Presentation is loading. Please wait.

Presentation is loading. Please wait.

Peter Millington SHERPA Technical Development Officer University of Nottingham, England Application Programmers Interface Digital Repositories: Dealing.

Similar presentations


Presentation on theme: "Peter Millington SHERPA Technical Development Officer University of Nottingham, England Application Programmers Interface Digital Repositories: Dealing."— Presentation transcript:

1 Peter Millington SHERPA Technical Development Officer University of Nottingham, England Application Programmers Interface Digital Repositories: Dealing with the Digital Deluge, 5-6June 2007, Manchester 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

4

5 API Browser Output Query specified in the address bar –http://www.opendoar.org/api.php?co=gb&show=basic,indexhttp://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

6

7 API & Excel: min and basic options 1.Specify query in File Open File Name 2.Select: Open XML As a List 3.For easier processing, copy to a new worksheet: –Select All Copy Paste Special Values 4.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 5.Change rNumOfItems from strings to numbers –Use formula =IF(ISBLANK(X2),"",INT(X2))

8

9

10

11

12

13

14 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. 1.Add a temporary column next to rID or rName 2.Add formula such as =IF(B2=B1,">>>","") 3.Fill down column – duplicate rows are now tagged >>> 4.Select column & Copy Paste Special Values 5.Select All and sort on the temporary column 6.Delete all the rows tagged >>> 7.Delete the temporary column

15

16

17

18 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.

19

20

21

22

23 Adding local style with HTML, CSS, etc

24 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.

25 Basic PHP wrapper

26 Simple XSL Adds HTML headers & footers Renders required XML fields

27

28

29

30

31 Recursive XSL Lists repositories under country headings

32

33

34

35

36 Live Examples & Further Info Live Examples –Browser output – Raw XML –PHP-processed API output –JISC-customised PHP-processed API output –Simple XSL rendition of API output –Recursive XSL rendition of API output Documentation for the OpenDOAR API –http://www.opendoar.org/tools/api.htmlhttp://www.opendoar.org/tools/api.html


Download ppt "Peter Millington SHERPA Technical Development Officer University of Nottingham, England Application Programmers Interface Digital Repositories: Dealing."

Similar presentations


Ads by Google