290 likes | 495 Views
Developer Developer. Chicago ExLibris 9-10 Mar 2011 Ken Herold Hamilton College. [ALL IP MARKS IMPLIED]. ILL requests - integration. Combine VoyagerILL , Ariel, and RapidILL data Voyager 7+ Tomcat Web Voyage; Perl; PHP ../cl_myAccount.xsl (Patron logged in)
E N D
Developer Developer Chicago ExLibris 9-10 Mar 2011 Ken Herold Hamilton College [ALL IP MARKS IMPLIED]
ILL requests - integration • Combine VoyagerILL, Ariel, and RapidILL data • Voyager 7+ Tomcat Web Voyage; Perl; PHP • ../cl_myAccount.xsl (Patron logged in) • New “ILL Items – Summary” links and table • Replace Requests Pending table/suppress template • Renew/View 90-day history link (VoyagerILL) • Manage Document Delivery link (Ariel/RAPID) • Table displays title, ILL number, status, date requested, date received, and date due • Automate retrieval/live PDF link when available Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
PATRON EMAIL, FORMS, OPENURL VOYAGER ILL ARIEL RAPID ILL CLIODATA.MDB FILESYSTEM SOAP BORROWING REQPDF DELIVERY PERL SQL/PHP PHP/PERL XML INPUT keys: FULL NAME PATRON_ID EMAIL ADDRESS MATCHING ACHIEVED VIA PATRON EXTRACT TO XML FILE MY ACCOUNTS PAGE REQUESTS Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
PATRON EMAIL, FORMS, OPENURL VOYAGER ILL ARIEL RAPID ILL Patrons initiate ILL requests via email, online forms, and using OpelURL Resolved links in databases and web resources. Staff input these into OCLC and ingest into ILL Management via ILL Request, the Voyager CLIO modules. Data is managed and responded to in various ways. Books shipped, articles transmitted, Ariel images received, RapidILL documents delivered as pdfs. Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
GENERATE HTML/XML FROM 3 SOURCES VOYAGER ILL ARIEL RAPID ILL CLIODATA.MDB FILESYSTEM SOAP API BORROWING REQPDF DELIVERY PERL SQL/PHP PHP/PERL PATRON_ID EMAIL ADDRESS REQUEST # Alex2clio.php Ill2alex.php DocList.pl arielDocs.php Rapid2.cgi cl_myAccount.xsl Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
MY ACCOUNTS PAGE REQUESTS LINKS TAKE PATRON TO PRE- AUTHENTICATED PERSONAL HISTORY AND MANAGEMENT DESIGN OBJECTIVE IS A ONE-STOP LOCATION FOR ALL INTERLIBRARY LOAN AND DOCUMENT DELIVERY REQUESTS FOR A LOGGED-IN PATRON IN TOMCAT WEB VOYAGE. XML STREAMS FILL THIS TABLE WITH CITATION DATA, ILL NUMBER, STATUS WITHIN THE LAST HOUR, AND DATES FOR REQUEST, RECEIPT, AND DATE DUE FOR LOANS. Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
GENERATED BY ALEX2CLIO.PHP USING INTERNAL PATRON_ID POST Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
VOYAGER ILL VoyagerILL Data • Hosted on Windows 2003 R2 server • MS Access 2003 database Cliodata.mdb • System DSN Data Source: cliodata_copy.mdb • BorrowingRequests table updated hourly • Mdb includes patron table refreshed monthly • Requests archived monthly/latest 90 days • Project leverages existing PHP reporting Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
VOYAGER ILL ILL2Alex.php – output xml <doc> <illNo>73014956</illNo> <reqDate>2011-01-18</reqDate> <recDate>2011-01-22</recDate> <dueDate /> <bookTitle>Atti del terzoCongressodistudiarabi e islamici. Ravello, 1-6 settembre 1966.; pp: ??</bookTitle> <artTitle>"le nom supreme de dieu"</artTitle> <status>RecCopy</status> </doc> <doc> <illNo>72524358</illNo> <reqDate>2011-01-04</reqDate> <recDate>2011-01-14</recDate> <dueDate>2011-02-19</dueDate> <bookTitle>Los nombres del diablo : ensayosobre la magia, Granada : Universidad de Granada, 2005</bookTitle> <artTitle /> <status>RecLoan</status> </doc> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
ARIEL Document Delivery Ariel then sends patron notification email with this pre-formed link: http://{server}/cgi-bin/DocList.pl? PN=$$PIN$$ &EM=$$PATRONEMAIL$$ $$PIN$$ is randomly generated. We do not want patron to have to remember this and do extra login. It and $$PATRONEMAIL$$ is at Ariel PC in antiquated and secured SQL database. Staff enter singly into Ariel DB per patron. ARIEL_{PIN}_... .PDF • ARIEL_{PIN}_... .CTRL • Email xxxxxxx@hamilton.edu • Status {0|1|2} 0=available • ID --ID:-NNNNNNN [-RAPID] • Postdate MM/DD/YYYY • Views {0-5} • Total views 5 Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
ARIEL Automate: PHP reads docs folder http://{server}/arielDocs.php?EMAIL=xxxxxxxx@hamilton.edu <?xml version="1.0" ?> <result> <doc> <field2>2</field2> <field3>nnnnnnnnn</field3> <field4>02/01/2010</field4> <field5>3</field5> <field6>5</field6> <file>ARIEL_{PIN}_{Ariel_PC}_20100201152952.PDF</file> </doc> <login>http://{server}/cgi-bin/DocList.pl?PN={PIN}&EM=xxxxxxxx@hamilton.edu</login> </result> • PARSES .CTRL FILES • MATCHES EMAIL AT FIELD1 • CLEANS UP ILL ID NUMBER • GETS DATE POSTED • RE-CREATES PDF FILENAME • CREATES AUTO-LOGIN LINK • BUILDS XML OUTPUT Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
RAPID ILL SOAP web service via Perl RAPID API DOCUMENTATION - CSU LIBRARIES – RAPID EXPANSION PROJECT LAST MODIFIED: MARCH 9, 2010 - REV. 1.55 METHOD: RetrieveHistory (Returns the status history of the request in Rapid. ) SOAP Request (Input) <UserName>string</UserName> <Password>string</Password> <RequestingRapidCode>string</RequestingRapidCode> <RequestingBranchName>string</RequestingBranchName> <RequestId>int</RequestId> SOAP Request (Output) <IsSuccessful>boolean</IsSuccessful> <HistoryTransactions /> <JournalYear> string </JournalYear> <JournalTitle> string</JournalTitle> <ArticleTitle> string </ ArticleTitle > <JournalVol> string </JournalVol> <JournalIssue> string </JournalIssue> <JournalPages string </JournalPages> <Issn> string </Issn> <OclcNumber> string </OclcNumber> We send RequestId, which is our negative ILL number, and receive citation data. RAPID added the optional output values following HistoryTransactions at our request. Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
RAPID ILL SOAP web service example http://{serverIP}/rapid2.cgi?3705838 <result>The international journal of transitional justice [electronic resource].. Vol 3 (2009); pp: 445- Musila G. M. "Options for Transitional Justice in Kenya: Autonomy and the Challenge of External Prescriptions</result> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
SUPPRESS “BORROWS” IN CHARGED AND PENDING ITEMS TABLES Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
VoyagerILL with RapidILL Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
cl_myAccount.xsl <xsl:variable name="patFN" select="page:page//page:element[@nameId='page.header.logout.link']/page:preText[1]"/> …. <xsl:key name="patrons" match="patron" use="@patName" /> <xsl:template name="displayILLLink"> <xsl:for-each select="document('/m1/…/users.xml')"> <xsl:variable name="patronID"><xsl:value-of select="key('patrons', $patFN)/@patID" /></xsl:variable> <form style="display:inline;float:left" action="http://{serverIP}/alex2clio.php" method="post" target="_blank"> <input type="hidden" name="glomf" value="{$patronID}" /> <span class="yellowBtnLeft"> </span> <input class="yellowBtn" type="submit" name="sendit" value="Renew / View History" /> <span class="yellowBtnRight"> </span>   </form> </xsl:for-each> </xsl:template> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
MY ACCOUNTS PAGE REQUESTS call link, build table <xsl:key name="patrons" match="patron" use="@patName" /> <xsl:template name="displayILLItems"><div style="clear:both;margin-left:3px"><p class="subTitle"><a name="illItems"></a>ILL Items - Summary</p></div> <!-- Ken added to show CLIO link--><p><xsl:call-template name="displayILLLink"/></p> <div id="hctableDisplay"> <table id="hctableILLItems" cellspacing="0" > <tr id="hctableHeadingILLItems"> <th id="hccellILLItem">Title</th> <th id="hccellILLNo">ILL No</th> <th id="hccellILLStatus">Status</th> <th id="hccellILLReqDate">Requested</th> <th id="hccellILLRecDate">Received</th> <th id="hccellILLDueDate">Date Due</th> </tr> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
MY ACCOUNTS PAGE REQUESTS get CLIO data <xsl:for-each select="document('/m1/…/users.xml')"><xsl:variable name="patronEM"><xsl:value-of select="key('patrons', $patFN)/@patEmail" /></xsl:variable> <xsl:variable name="patronILL"> http://{serverIP}/ill2Alex.php?email=<xsl:value-of select="$patronEM“> </xsl:value-of></xsl:variable><xsl:for-each select="document($patronILL)/result/doc"> <tr class="{$rowClass}"> <xsl:variable name="hcillNo" select="illNo"/> <!-- store ill# from VoyagerILL--> <xsl:variable name="hcartTitle" select="artTitle"/> <!-- store artTitle --> <xsl:variable name="hcrequestType" select="status"/> <!-- store requestType --> <div style="margin-left:20px;margin-bottom:10px;font-size:.8em"> <td class="tableCell" headers="cellILLItem"> <xsl:value-of select="bookTitle" /> <xsl:if test="string-length($hcartTitle)!=0">   <xsl:value-of select="artTitle" /> </xsl:if> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
MY ACCOUNTS PAGE REQUESTS test PDF delivery <xsl:variable name="arielDocs“>http://{serverIP}/arielDocs.php?EMAIL= <xsl:value-of select="$patronEM“></xsl:value-of> </xsl:variable><xsl:for-each select="document($arielDocs)/result/doc"><xsl:variable name="hcStatus" select="field2"/> <!-- store status from Ariel --><xsl:variable name="hcillNum" select="field3"/> <!-- store ill# from Ariel --><xsl:variable name="hcLink" select="file"/> <!-- store filename from Ariel --> <xsl:if test="$hcillNo = $hcillNum"> <!-- Match means display link to PDF if status =0 (available) --> <xsl:if test="$hcStatus = '0'"> <br /> <a style="margin-left:5px;padding:0 3px 0 3px;border:1px solid #990000;text-decoration:none" href="http://{server}/ariel/docs/{$hcLink}" target="_blank"><img border="none" src="/vwebv/ui/en_US/images/pdf.gif"> </img></a> </xsl:if> </xsl:if> </xsl:for-each> </td> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
MY ACCOUNTS PAGE REQUESTS more CLIO data <td class="tableCell" headers="cellILLNo“><xsl:value-of select="illNo" /></td> <td class="tableCell" headers="cellILLStatus"><xsl:choose> <xsl:when test="$hcrequestType='RecLoan'">Charged  </xsl:when> <xsl:when test="$hcrequestType='RecCopy'">Delivered </xsl:when> <xsl:when test="$hcrequestType='SHIPPED'">Shipped </xsl:when> <xsl:when test="$hcrequestType='CONDITIONAL'">Pending </xsl:when> <xsl:otherwise><xsl:value-of select="status" /></xsl:otherwise> </xsl:choose></td> <td class="tableCell" headers="cellILLReqDate“><xsl:value-of select="reqDate" /> </td> <td class="tableCell" headers="cellILLRecDate“><xsl:value-of select="recDate" /> </td> <td class="tableCell" headers="cellILLDueDate“><xsl:value-of select="dueDate" /> </td> </div></tr></xsl:for-each> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
MY ACCOUNTS PAGE REQUESTS get RAPID data <div style="margin-bottom:10px;font-size:.8em"><xsl:variable name="arielDocs2">http://{SERVER}/arielDocs.php?EMAIL= <xsl:value-of select="$patronEM“> </xsl:value-of></xsl:variable><xsl:for-each select="document($arielDocs2)/result/doc"> <tr class="{$rowClass}"> <xsl:variable name="hcStatus2" select="field2"/> <!-- store status from Ariel --> <xsl:variable name="hcillNum2" select="field3"/> <!-- store ill# from Ariel --> <xsl:variable name="hcPostDate" select="field4"/> <!-- store postdate from Ariel --> <xsl:variable name="hcillFile" select="file"/> <!-- store filename from Ariel --> <xsl:variable name="hcillViews" select="field5"/> <!– store times viewed Ariel --> <!-- RAPID ILL requests start with negative sign --> <xsl:if test="starts-with($hcillNum2,'-')" > Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
MY ACCOUNTS PAGE REQUESTS more RAPID data <!-- Match means display link to PDF if status =0 (available) --> <xsl:if test="$hcStatus2 = '0'"> <xsl:variable name="rapidData">http://{serverIP}/rapid2.cgi? <xsl:value-of select="field3“> </xsl:value-of></xsl:variable><td class="tableCell" headers="cellILLItem"> <xsl:value-of select="document($rapidData)"/> <!– Fill with citation data from RAPID SOAP service plus PDF icon --> <a style="margin-left:5px;padding:0 3px 0 3px;border:1px solid #990000;text-decoration:none" href="http://{SERVER}/ariel/docs/{$hcillFile}" target="_blank"><img border="none" src="/vwebv/ui/en_US/images/pdf.gif"/> </a> </td> <td class="tableCell" headers="cellILLNo"><xsl:value-of select="field3" /></td> <td class="tableCell" headers="cellILLStatus">Available</td> <td class="tableCell" headers="cellReqDate"></td> <td class="tableCell" headers="cellRecDate"><xsl:value-of select="field4" /></td> <td class="tableCell" headers="cellDueDate"></td> </xsl:if></xsl:if> </tr> </xsl:for-each> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
…finish with ARIEL data for second link <xsl:for-each select="document($arielDocs2)/result"> <xsl:variable name="loginLink"><xsl:value-of select="login" /></xsl:variable> <form style="display:inline;float:left" action="{$loginLink}" method="post" target="_blank"><span class="yellowBtnLeft"> </span><input class="yellowBtn" type="submit" name="sendit" value="Manage Document Delivery" /> <span class="yellowBtnRight"> </span>   </form><p style="clear:both"/> </xsl:for-each> </div> </xsl:for-each> </table> CREDIT: Peter MacDonald for all style elements, css, and page /table behaviors Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
ARIEL <?php // arielDocs.php $baseDir = 'd:\\...\\ariel\\docs\\'; $email =$_GET['EMAIL']; // Build the xml output $xml_output = "<?xml version=\"1.0\"?>\n"; $xml_output .= "<result>\n"; $d = opendir($baseDir) or die($php_errormsg); while (false !== ($f = readdir($d))) { if (preg_match('/^ARIEL_.*CTRL/',$f)) { $fh = fopen($baseDir.$f,r) or die($php_errormsg); $s = rtrim(fgets($fh,256)); if ($s == $email) { $xml_output .= "<doc>\n"; for ($i=2; $i<=6; $i++) { $s = rtrim(fgets($fh,256)); $s = preg_replace("|--ID:il|","",$s); $s = preg_replace("|--ID:|","",$s); $s = preg_replace("|ILL:|","",$s); $xml_output .= "<field".$i.">".$s."</field".$i.">\n"; } fclose($fh) or die($php_errormsg); $f = preg_replace("|CTRL|","PDF",$f); $xml_output .= "<file>".$f."</file>\n"; $xml_output .= "</doc>\n"; $pin = preg_split("/_/",$f); } } } closedir($d); $xml_output .= "<login>http://{server}/cgi-bin/DocList.pl?PN=".$pin[1]."&EM=".$email."</login>"; $xml_output .= "</result>"; echo $xml_output; ?> Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
RAPID ILL rapid2.cgi – SOAP service use strict;use SOAP::Lite ;my $reqNum = $ENV{QUERY_STRING};# reqNum comes in as negative number$reqNum =~ s/-//;my $soap = SOAP::Lite->new( proxy => ("http://rapid2.library.colostate.edu/rapidapi/apiservice.asmx"),uri => ("http://rapid2.library.colostate.edu/rapidapi"),on_action => (sub{join '', '', @_ }),default_ns => ("http://rapid2.library.colostate.edu/rapidapi/"), autotype => 0); Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
RAPID ILL next RetrieveHistory my $method = SOAP::Data->name('RetrieveHistory') ->attr({xmlns => 'http://rapid2.library.colostate.edu/rapidapi/'});my @params = (SOAP::Data->name("input" => \SOAP::Data->value( SOAP::Data->name("UserName" => 'yhm'), SOAP::Data->name("Password" => ‘{password}'), SOAP::Data->name("RequestingRapidCode" => 'yhm'), SOAP::Data->name("RequestingBranchName" => 'Main Library'), SOAP::Data->name("RequestId" => SOAP::Data->value($reqNum) )) )); Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
RAPID ILL then parse/format result my $result = $soap->call($method => @params);my $data = $result->valueof('//RetrieveHistoryResponse/RetrieveHistoryResult/JournalTitle');$data .= ". Vol ";$data .= $result->valueof('//RetrieveHistoryResponse/RetrieveHistoryResult/JournalVol');$data .= " (";$data .= $result->valueof('//RetrieveHistoryResponse/RetrieveHistoryResult/JournalYear');$data .= "); pp: ";$data .= $result->valueof('//RetrieveHistoryResponse/RetrieveHistoryResult/JournalPages');$data .= " ";$data .= $result->valueof('//RetrieveHistoryResponse/RetrieveHistoryResult/ArticleTitle');$data =~ s/-eoa/- /g;$data =~ s/-EOA/- /g;$data =~ s/\<|\>//g;print "Content-type: text/xml\n\n<result>".$data."</result>"; exit(0); NOTE: oXygen XML Editor contains an invaluable WSDL SOAP Analyzer tool Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer
… exit; // Thank You! // kherold@hamilton.edu Ken Herold Hamilton College 9-10 Mar 2011 ExLibris Chicago Developer - Developer