0
Att jobba med
SFX API & MetaLib X-server



              17 november 2009
                     Norrköping
Ex Libris produkter erbjuder API:er till de
flesta av sina produkter


SFX API

Aleph, MetaLib, och DigiTool X-Services

V...
All dokumentation har flyttat till EL Commons

CodeShare – Dokumentation & exempelkod
      Wiki – För erfarenhetsutbyte

...
För att använda API:erna behöver man kunna konsumera XML

Idag inget stöd för JSON

PHP5 - SimpleXML och Xpath

Manipulera...
SFX API

Enkelt att titta på, kräver ingen autentisering

http://link.libris.kb.se.bibl.proxy.hj.se/sfxjon?sid=google&auin...
sfx.response_type
It is possible to select the following types of responses from
the SFX server.
1. HTML - Response will b...
<target>
   <target_name>LIBRIS_WEBBSÖK_LCL</target_name>
   <target_public_name>LIBRIS</target_public_name>
   <target_se...
$openurl = "http://link.libris.kb.se/sfxjon?sid=ALEPH:JUL01
&issn=$issn&sfx.response_type=simplexml";

$xml = simplexml_lo...
MetaLib

Upprätta en session – återanvänd denna för varje anrop

http://ram47:8334/X?op=login_request&user_name=exlibris&u...
function getSession($u,$p){

$get_session = "http://samsok.libris.kb.se/X?
op=login_request&user_name=".$u."&user_password...
function ml_search($session, $db_id, $wrd){
$do_search = "http://samsok.libris.kb.se/X?
op=find_request&wait_flag=Y&find_r...
function getAllCategories($session){
$get_cats = "http://samsok.libris.kb.se/X?
op=retrieve_categories_request&requester_i...
Samsa 2009 ht, Arbeta med SFX API & MetaLib X-server
Samsa 2009 ht, Arbeta med SFX API & MetaLib X-server
Samsa 2009 ht, Arbeta med SFX API & MetaLib X-server
Samsa 2009 ht, Arbeta med SFX API & MetaLib X-server
Upcoming SlideShare
Loading in...5
×

Samsa 2009 ht, Arbeta med SFX API & MetaLib X-server

1,195

Published on

Exempel på vad man kan göra med SFX API och MetaLib X-server

Published in: Spiritual
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,195
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Samsa 2009 ht, Arbeta med SFX API & MetaLib X-server"

  1. 1. Att jobba med SFX API & MetaLib X-server 17 november 2009 Norrköping
  2. 2. Ex Libris produkter erbjuder API:er till de flesta av sina produkter SFX API Aleph, MetaLib, och DigiTool X-Services Verde®, DigiTool, Voyager och Primo SOAP Web services Avsedda för maskin-till-maskin kommunikation XML baserade Utsökningar men även uppdateringar Ex Libris utvecklar nu REST baserade API:er i enlighet med DLF Discovery Interfaces
  3. 3. All dokumentation har flyttat till EL Commons CodeShare – Dokumentation & exempelkod Wiki – För erfarenhetsutbyte www.exlibrisgroup.org
  4. 4. För att använda API:erna behöver man kunna konsumera XML Idag inget stöd för JSON PHP5 - SimpleXML och Xpath Manipulera DOM – AJAX (Prototype | jQuery)
  5. 5. SFX API Enkelt att titta på, kräver ingen autentisering http://link.libris.kb.se.bibl.proxy.hj.se/sfxjon?sid=google&auinit=J& aulast=Fernandez-Lopez&atitle=Antioxidant+and+antibacterial+activities+ of+natural+extracts:+application+in+beef+meatballs&title=Meat+science& volume=69&issue=3&date=2005&spage=371&issn=0309-1740& sfx.response_type=simplexml
  6. 6. sfx.response_type It is possible to select the following types of responses from the SFX server. 1. HTML - Response will be 'regular' SFX menu (not described in this document - not part of API) 2. sfx_api_0_1_xml - OpenURL 0.1 XML response - This is the SFX V2 API described above. 3. simplexml - OpenURL 1.0 response for single Object requests 4. multi_obj_xml - OpenURL 1.0 response for multiple Object requests 5. multi_obj_detailed_xml - OpenURL 1.0 response for multiple Object requests with additional options available 6. service_exist - OpenURL 1.0 response with minimal data
  7. 7. <target> <target_name>LIBRIS_WEBBSÖK_LCL</target_name> <target_public_name>LIBRIS</target_public_name> <target_service_id>25320000000000000</target_service_id> <service_type>getHolding</service_type> <parser>UNION::LIBRIS_SEWS20</parser> <parse_param/> <proxy>no</proxy> <crossref>no</crossref> <note/> <authentication/> <char_set>utf8</char_set> <displayer/> <target_url> http://libris.kb.se.bibl.proxy.hj.se/hitlist?q=linkisxn:0309-1740 </target_url> </target>
  8. 8. $openurl = "http://link.libris.kb.se/sfxjon?sid=ALEPH:JUL01 &issn=$issn&sfx.response_type=simplexml"; $xml = simplexml_load_file($openurl); $Base = $xml->targets; foreach ($Base->target as $target) { if($target->service_type == 'getCitedJournal' ){ echo "<li><a href=". $target->target_url ."> Search for ". $target->target_public_name . "</a></li>"; } if($target->service_type == 'getFullTxt'){ echo "<li><a href=". $target->target_url ."> Fulltext available from ". $target->target_public_name . "</a></li>"; } if($target->service_type == 'getAbstract'){ echo "<li><a href=". $target->target_url ."> Abstract available from ". $target->target_public_name . "</a></li>"; } if($target->service_type == 'getTOC'){ echo "<li><a href=". $target->target_url ."> ToC available from ". $target->target_public_name . "</a></li>"; } }
  9. 9. MetaLib Upprätta en session – återanvänd denna för varje anrop http://ram47:8334/X?op=login_request&user_name=exlibris&user_password=12 <x_server_response metalib_version="4.00 (20)"> <login_response> <auth>Y</auth> <session_id new_session="Y">PB22QIX32KJK8AV3GCEPNU19I2HJV</session_id> </login_response> </x_server_response>
  10. 10. function getSession($u,$p){ $get_session = "http://samsok.libris.kb.se/X? op=login_request&user_name=".$u."&user_password=".$p.""; $xml = simplexml_load_file($get_session); $Base = $xml->login_response; $session = $Base->session_id; return $session; }
  11. 11. function ml_search($session, $db_id, $wrd){ $do_search = "http://samsok.libris.kb.se/X? op=find_request&wait_flag=Y&find_request_command=WRD=($wrd)&find_base_001 =$db_id&session_id=$session"; $xml = simplexml_load_file($do_search); $Base = $xml->find_response->base_info; $doc_count = $Base->no_of_documents; $set_number = $Base->set_number; if($doc_count >= '1'){ $sb_url = "http://hbopac.lingonline.jonkoping.se/opac/search_result.aspx? TextFritext=$wrd"; echo "<li><a href=$sb_url>Finns &auml;ven p&aring; stadsbiblioteket</a><br>"; }else{ echo "<li>Finns inte p&aring; stadsbiblioteket<br>"; }
  12. 12. function getAllCategories($session){ $get_cats = "http://samsok.libris.kb.se/X? op=retrieve_categories_request&requester_ip=193.10.208.75&session_id=$session" ; $xml = simplexml_load_file($get_cats); $Base = $xml->retrieve_categories_response; foreach ($Base->category_info as $cat){ $category_name = $cat->category_name; echo "<fieldset><legend>".$category_name."</legend>"; foreach($cat->subcategory_info as $sub){ $subcategory_name = $sub->subcategory_name; $subcategory_count = $sub->no_bases; $subcategory_seq = $sub->sequence; echo "<a href=getDBbyCat.php?sequence=". $subcategory_seq."&session=".$session."&name=".$subcategory_name.">". $subcategory_name."</a> [".ltrim($subcategory_count,0)."]<br> "; } echo "</fieldset>"; } }
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×