1 / 36

Application Programmers’ Interface Digital Repositories: Dealing with the Digital Deluge, 5-6June 2007, Manchester

Application Programmers’ Interface Digital Repositories: Dealing with the Digital Deluge, 5-6June 2007, Manchester. Peter Millington SHERPA Technical Development Officer University of Nottingham, England. FOR DUMMIES® is a registered trademark of Wiley Publishing, Inc.

accalia
Download Presentation

Application Programmers’ Interface Digital Repositories: Dealing with the Digital Deluge, 5-6June 2007, Manchester

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Application Programmers’ InterfaceDigital Repositories: Dealing with the Digital Deluge,5-6June 2007, Manchester Peter Millington SHERPA Technical Development Officer University of Nottingham, England FOR DUMMIES® is a registered trademark of Wiley Publishing, Inc.

  2. Application Programmers’ Interface (API) • Using your Browser • Loading OpenDOAR data into Microsoft Excel • Simple tables – min & basic options – single-row records • Complex – all other options – multi-row records • Programmatically processing data • e.g. PHP, PERL, etc • Rendering data using XSL stylesheets • Adding your own corporate style

  3. API Browser Output • Query specified in the address bar • http://www.opendoar.org/api.php?co=gb&show=basic,index • Searching for UK repositories (?co=gb) • Output required: • Popular fields (&show=basic) – for number of items held • Index fields (&show=index) – for repository type • Sorted by repository name (default) • Raw XML Output

  4. API & Excel: min and basic options • Specify query in File  Open  File Name • Select: Open XML  As a List • For easier processing, copy to a new worksheet: • Select All  Copy  Paste Special  Values • Tidy up • Delete unwanted columns - notably columns A to C • View  Zoom  75% • Highlight header row & Window  Freeze Panes below • Adjust column widths to taste • Change rNumOfItems from strings to numbers • Use formula =IF(ISBLANK(X2),"",INT(X2))

  5. API & Excel: Other &show options • Approach similar to simple min & basic options • But returns multiple rows per repository • Due to multiple subjects, languages, policies, etc. • Therefore may need to de-duplicate – e.g. • Add a temporary column next to rID or rName • Add formula such as =IF(B2=B1,">>>","") • Fill down column – duplicate rows are now tagged >>> • Select column & Copy  Paste Special  Values • Select All and sort on the temporary column • Delete all the rows tagged >>> • Delete the temporary column

  6. OpenDOAR API – PHP Processing • Check API query in web browser • Note the order of required fields in each record • rName • rNumOfHits • repositoryType • Use PHP to loop through the output XML File • Identify required XML field tags • Extract data into variables • Display data using HTML • Add your own web style using HTML, CSS, etc.

  7. Adding local style with HTML, CSS, etc

  8. OpenDOAR API – Using XSL • Check API query in web browser • PHP (or PERL) program inserts link to XSL file • XSL style sheet • Adds HTML headers and footers • May include local CSS styles and code • Renders the required XML fields • Advanced XSL • Listing under headings • Adding counts & calculations • Etc.

  9. Basic PHP wrapper

  10. Simple XSL Adds HTML headers & footers Renders required XML fields

  11. Recursive XSL Lists repositories under country headings

  12. Live Examples & Further Info • Live Examples • Browser output – Raw XML • http://www.opendoar.org/api.php?co=gb&show=basic%2Cindex • PHP-processed API output • http://www.opendoar.org/documents/JISC200706demo1.php • JISC-customised PHP-processed API output • http://www.opendoar.org/documents/JISC200706demo2.php • Simple XSL rendition of API output • http://www.opendoar.org/documents/JISC200706demo3.php • Recursive XSL rendition of API output • http://www.opendoar.org/documents/JISC200706demo4.php • Documentation for the OpenDOAR API • http://www.opendoar.org/tools/api.html

More Related