Introduktion till API:er, webbtjänster & att integrera LIBRIS tjänster i OPAC

Embed Size (px)

DESCRIPTION

Del av workshopen i projektet Att använda LIBRIS öppna infrastruktur

Citation preview

  • 1.Att anvnda LIBRIS ppna infrastruktur
    Hgskolan i Jnkping
    20-21 maj 2010

2. #librisAPIws
3. 20 maj
12.00 12.10 Inledning
12.10 13.00 Tankarna bakom LIBRIS ppna infrastruktur
13.00 13.30 Introduktion till API:er, webbtjnster och LIBRIS system
13.30 14.30 Integrera LIBRIS tjnster i din OPAC
14.30 15.00 Paus
15.00 16.00 Integrera LIBRIS tjnster i din webbplats
16.00 17.00 Att skapa en sktjnst med LIBRIS som komponent
17.00 Gruppdiskussioner p temat Vad skulle du vilja gra med LIBRIS API:er och tjnster?
21 maj
09.00 09.30 terkoppling till grdagens diskussion
09.30 10.00 SUB:s arbete med LIBRIS API:er
10.00 10.20 Paus
10.20 11.20 Hur kommer LIBRIS ppna infrastruktur att utvecklas, vad kan vi frvnta oss i framtiden?
11.20 12.00 ppna frgor till en panel med de som presenterat under dagarna
12.00 12.30 Hur gr vi vidare, uppfljning, avrundning och avslutning
4. Introduktion till API:er, webbtjnster &
att integrera LIBRIS tjnster i OPAC
Daniel Forsman
Chalmers bibliotek
Att anvnda LIBRIS ppna infrastruktur
20 maj 2010
5. Basic scholarly information usepracticeshaveshiftedrapidlyin recent years,
and as a result the academiclibrary is increasinglybeingdisintermediated from the
discoveryprocess, riskingirrelevancein one of itscorefunctionalareas
Ithaka S+R 2009 FacultySurvey Report
The future of libraries? Technology has created a verydifferent contextfor the
missions of academic and research libraries
No Brief Candle, DaphneeRentfrow
6. LIBRIS
ILS
OPAC
CAT
ACQ
ILL
CAT
OPAC
Patron
CIRC
7. OA
Arkiv
Linked data
Fed. search
Link
Resolv.
ERM
LIBRIS
ILS
Aggr.
Rekommendation
Proxy & SSO
OPAC
CAT
ACQ
ILL
CAT
RDF
ILL
OPAC
Patron
Aggr. DB
Discovery
CIRC
Integratedsearch
Amazon
Google
Enskild DB
OER
Digitalisering
8. Lokalt
Globalt
Kontext
SaaS
Nationellt
Individ
Konvergens
Paradigm
skifte
Institution
System
Bransch
glidning
OS
Sam
arbete
Digitalisering
Institutionella arkiv
Linked data
API
Mobil
Data
OA
Open
Data
Kanaler
Webb
Licens
Bib. service
Lokaler
DaaS
VLE
9. ppenhet i en tjnstebaserad vrld
Open standards
Open Access
Open educationalresources
Open source
Open platform
Open data
Garanti fr teoretisk valfrihet
10. 11. Webben har blivit en plattform dr grnssnitten frikopplas frn systemen och de underliggande tjnsterna
Decoupling of frontend from backend
WorldcatAPI, XISBN, LibraryThing for Libraries , LIBRIS Xsearch, MetaLib | Aleph X-server, SFX API, EbscoHost Integration Toolkit,
ISI Web Services, Amazon, SRU/W, RDF | Linked Data, Google Code, Flickr API, Yahoo! Developer Network, Yahoo! Pipes
12. API?
An ApplicationProgramming Interface (API) is an interface implemented by a software program whichenables it to interact with other software. It is similar to the way the user interface facilitates interaction between humans and computers. An API is implemented by applications, libraries, and operating systems to determinetheirvocabularies and calling conventions, and is used to access their services. It mayincludespecifications for routines, data structures, object classes, and protocols used to communicatebetween the consumer and the implementer of the API
// Wikipedia ApplicationProgramming Interface
13. Webbtjnst?
AWebserviceisasoftwaresystemdesignedtosupportinteroperable machineto-machine interaction over a network. It has an interface described in a machineprocessable format (specifically WSDL). Other systems interact with the Web service in a mannerprescribed by itsdescriptionusing SOAP messages, typicallyconveyedusing HTTP with an XML serialization in conjunction with other Web related standards.
// W3C definition
WebservicesarefrequentlyjustInternetApplicationProgramming
Interfaces(API)thatcanbeaccessedoveranetwork,suchasthe
Internet,andexecutedonaremotesystemhostingtherequested
services. //WikipediaWebservice
14. SOAP & REST
REST Representational State Transfer -r en arkitektur fr att tillhandahlla tjnster fr maskin till maskin-kommunikation. Varje resurs r unikt adresserbar enligt en gemensam standard (URI). Grundlggande kommandon fr att interagera med objekt baserade p de verb som r angivna i HTTP-standarden: POST, GET, PUT och DELETE.
// http://sv.wikipedia.org/wiki/Representational_State_Transfer
SOAP Simple Object Access Protocol, men inte frn och med 1.2, ett protokoll fr utbyte av strukturerad information i form av XML
SOAP provides a simple and lightweightmechanism for exchangingstructured and typed information betweenpeers in a decentralized, distributedenvironmentusing XML. SOAP does not itselfdefineanyapplicationsemanticssuch as a programmingmodel or implementationspecificsemantics; rather it defines a simple mechanism for expressingapplicationsemantics by providing a modularpackagingmodel and encodingmechanisms for encoding data withinmodules. This allows SOAP to be used in a largevariety of systems ranging from messaging systems to RPC
// http://www.programmera.net/webservice/soap.php
15. AJAX r en akronym fr Asynchronous JavaScript and XML (Asynkron JavaScript och XML) som r ett samlingsnamn fr ett antal olika tekniker som kan anvndas fr att bygga applikationer fr World Wide Web med bttre interaktivitet n tidigare webbapplikationer. Knda tjnster som anvnder dessa lsningar r Gmail, Google Maps och Facebook.
XMLHttpRequest-objektet, som tillter JavaScript p en webbsida att gra anrop till webbservern utan att sidan laddas om.
DOM (DocumentObjectModel) vilket tillter JavaScript att skriva om innehll p den aktuella sidan.
//http://sv.wikipedia.org/wiki/AJAX
DocumentObjectModel, frkortat DOM, r ett plattforms- och sprkoberoende grnssnitt fr tkomst och dynamiskt uppdatering av ett dokuments innehll, struktur och formatering.
// http://sv.wikipedia.org/wiki/Document_Object_Model
16. Vad behver man?
Fr att fnga upp element p en webbsida manipulerar man DOM
Med XMLhttpRequest kan man skicka och f tillbaka data till webblsaren utan att ladda om den
Javascript bibliotek som jQuery och Prototype gr detta enkelt
JSON-formatet gr att man kan lsa in data direkt i klienten via javascript
JSON (JavaScript Object Notation) is a lightweightdata-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
// http://www.json.org/
Om man inte kan f JSON utan ett XML format mste detta hanteras p servern dr scriptet krs PERL, PHP, Python, Ruby osv.
Skerhetsinstllningarna fr XMLhttpRequest gr att man inte kan anropa externa servrar,
anrop mste ske lokalt eller via proxy
Mina exempel bygger i huvudsak p PHP och Prototype
17. Varfr integrera webbtjnster i OPAC?
By exploringweb services and new technology wegain first hand experiencemakingusstrongercustomers and development partners
Strategy is to present libraryresources in a singlethoughtthroughstructure and presentation BUT ALSO to identify key services and make themavailableoutside the librarywebsite. Webservicesallowsus to do this.
By integrating services the localcollection is displayed in a broadercontext, part of a widenetwork of resources. The librarywebsite or OPAC turnsinto a small federatedsearch service, rich in functionality and content, seamlesslyintegrated.
Att kunna visa lokala resurser i ett regionalt, nationellt och globalt sammanhang
18. OPAC:en r inte decoupled
Men de flesta tillter att man stoppar in javascript
Javascript tillsammans med en hook kan agera med ett serverside script
XML format spelar ingen roll fr mig metoden gr att teranvnda genom att anvnda PHP:s
frdiga funktioner fr att gra anrop och bearbeta XML
19. 20. Hooki full-999-body

id="myDiv"
http://api.jquery.com/category/selectors/
Prototype : $$('#contents');
getElementsbyTagName
getElementsbyClassName
http://api.prototypejs.org/language/dollardollar/
22. //putissn in xissn variable
var xissn=document.getElementById("ISSN");
//pass issn to backend script, echoresult in diveJULIA
new Ajax.Updater('eJULIA', sfx.php', { method: 'get', success: 'eJULIA', failure: 'errors', parameters: {issn: xissn.innerHTML}
23. 24. OPAC -> DOM manipulation -> AJAX -> PHP -> Webbtjnst-> OPAC
25. 26. http://libris.kb.se/xsearch?query=word+of+mouth+marketing&format=mods
27. Att fnga sktermer

28. new Ajax.Updater(libris', libris.php', {method: 'get', success: libris',
failure: 'errors', parameters: {libristerm: searchword} });
29.