Samsa 2009 ht, Arbeta med SFX API & MetaLib X-server
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

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

  • 2,002 views
Uploaded on

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

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

More in: Spiritual
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,002
On Slideshare
1,938
From Embeds
64
Number of Embeds
2

Actions

Shares
Downloads
5
Comments
0
Likes
0

Embeds 64

http://www.betabib.org 61
http://www.slideshare.net 3

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Att jobba med SFX API & MetaLib X-server 17 november 2009 Norrköping
  • 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. All dokumentation har flyttat till EL Commons CodeShare – Dokumentation & exempelkod Wiki – För erfarenhetsutbyte www.exlibrisgroup.org
  • 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. 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. 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. <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. $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. 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. 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. 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. 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>"; } }