1 / 45

Using MAJAX and Google Book Classes in Mashups

Using MAJAX and Google Book Classes in Mashups. Annette Bailey University Libraries Virginia Tech April 29, 2008. Mashups. Are hybrid web applications that combine information drawn from various web sources Simple example: A library web page that includes a news feed. Mashup Example.

ruth-riley
Télécharger la présentation

Using MAJAX and Google Book Classes in Mashups

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. Using MAJAX and Google Book Classes in Mashups Annette Bailey University Libraries Virginia Tech April 29, 2008

  2. Mashups • Are hybrid web applications that combine information drawn from various web sources • Simple example: • A library web page that includes a news feed

  3. Mashup Example Library Homepage Latest Library News Items

  4. Mashup Sources • RSS Feeds • Web services, e.g. Google API, Amazon API • StrikeIron is a market place that matches providers and users • How can the III Millennium system become an information source for mashups? • That’s where MAJAX comes in

  5. MAJAX Overview • Millennium AJAX is software that allows mixing catalog data into web pages • Freely available from VT • Simple to install & use • No III support required • No plug-in for users to install

  6. New Books List • Library publishes a list of newly acquired books every month • We would like to include up-to-the-minute circulation information in this list

  7. New Books List Demo

  8. New Books List

  9. MAJAX • Millennium AJAX • Asynchronous • Query the catalog without the user having to wait • JavaScript • Run in client’s browser to construct page content • And • XML • (Really HTML) – comes from a web service: here, Millennium’s MARC display

  10. Screen Scraping MARC

  11. Course Page Demo A professor wants to offer a list of books on his course page, along with full bibliographic and up-to-the-minute holdings information about each book

  12. Course Page Demo • Screen Shot

  13. The Pyramid of Web Skills Programmers Librarians

  14. Installing & Using MAJAX • To install MAJAX at your institution, upload two files to your catalog’s /screens directory: • majax.js • majax.html • To use MAJAX in web pages • include <script> tag once • include <span> tags wherever library catalog information should be inserted

  15. Course Page HTML <script type="text/javascript" src="http://yourlibrarycatalog/screens/majax.js"> </script> <span title="i0596002556" class="majax-harvard-reference majax-newline majax-ebook"> </span> <span title="i0596002556" class="majax-showholdings majax-linktocatalog"> </span>

  16. MAJAX Identifiers • <span title=“IDENTIFIER” class=“MAJAX-CLASSES”></span> • IDENTIFIER can refer to ISBN, Bibrecord #, OCLC #, or Book Title

  17. MAJAX Alternative Syntax • <span title=“T*” class=“MAJAX-CLASSES”> IDENTIFIER</span> • T can be ‘i’, ‘o’, ‘t’, or ‘.b’ • IDENTIFIER as defined on previous slide without leading character <span title=“i*" class="majax-showholdings"> 0596002556 </span>

  18. MAJAX Examples (1)

  19. MAJAX Examples (2)

  20. Create a new file: majaxcustomize.js Include the file using a <script> tag on the page where you want to use MAJAX Define your customized variables MAJAX Customization <script type="text/javascript" src="http://yourlibrarycatalog/screens/majaxcustomize.js"> </script> varsingleCopyStatus = “Un exemplaireest %s”;

  21. Load Considerations • MAJAX uses caching and sends exactly 1 request per unique item per page to the server • Regardless of the number of span tags referencing an item • MAJAX imposes additional load on your III system • Currently self-limiting to 100 requests per second per page, which can be changed. • To turn MAJAX capabilities off, simply remove majax.html & majax.js from the /screens directory.

  22. Limitations • MAJAX works only on web pages from within the same domain as your Millennium system • If Millennium runs on addison.vt.edu, MAJAX can be used on all pages in *.vt.edu • www.lib.vt.edu Ok  • courses.cs.vt.edu Ok  • livejournal.com Not Ok  (needs a proxy) • MAJAX works in Internet Explorer 6.x and up, Firefox, and Safari browsers • Will fail silently on other browsers

  23. MAJAX Summary • MAJAX provides the ability to include live catalog information in any webpage on your domain • Without special server support, access or programming • Without requiring end users to install any plug-ins • It is easy to use, requiring only HTML skills • Free! • Has been adopted by a number of III libraries • Users have contributed suggestions, bug fixes, and help test it

  24. Part 2 Google Book Classes

  25. Mashing a Service into the III Catalog Display • MAJAX mashes catalog data into other web pages • Now we’ll mash data from another service into the library catalog

  26. Google Book Search Book Viewability API Programmatic client-side access to small set of Google Book Search information Provides thumbnails of book covers Provides link to Google’s book information, preview, or full text pages Provides information on whether Google has full text, partial preview, or no preview Indexed by ISBN#, OCLC#, LCCN# Released March 2008

  27. Goals We want to incorporate information from Google Book Search into our catalog E.g., allow users to see a preview of a book if one is available from Google Or use Google’s book covers Without JavaScript coding (even though Google’s API requires JavaScript coding as it is)

  28. Google Book Classes Demo

  29. Google Books Demo Buttons appear if Google Book Search has a partial preview of book

  30. Google Books Demo (2) Buttons appears if Google has a partial preview of book

  31. Google Book Classes • A JavaScript library and set of classes that simplify using the Google Book Search Book Viewability API • Can be used on any web page, including inside the Millennium system • Usage is much like MAJAX • Available from libx.org/gbs

  32. Using Google Book Classes(on general web server) Include the class(es) in <span> tags • Upload a copy of gbsclasses.js to your server • Include gbsclasses.js in a <script> tag in the target page <script type="text/javascript" src="http://yourserver/yourpath/gbsclasses.js"> </script> <span title=“ISBN:0596002556” class=“gbs-thumbnail”> </span>

  33. GBS Identifiers <span title=“IDENTIFIER” class=“GBS-CLASSES”></span> IDENTIFIER can refer to ISBN #, OCLC #, or LCCN# Alternate syntax: use * as IDENTIFIER

  34. Using Google Book Classes in Millennium • Include gbsclasses.js in HTML template file via <script> tag • E.g. toplogo.html • Use III fieldspec token to insert HTML that includes the Google Book Classes into the briefcit.html file

  35. briefCitPub <div> briefcit.html

  36. A Google Preview Button Inside “Publisher” box Insert 1x2 HTML table 260 Field goes in left column Link to info page – but only if Google has a partial view hide span initially Remove span if Google does not index this ISBN III will put first 020 Field here <div class="briefCitPub"><table><tr> <td style="text-align:left" width="65%"><!--{fieldspec:Vbp260}--> </td><td width="35%"><span style="display:none" title="*" class="gbs-link-to-info gbs-if-partial gbs-remove-on-failure"><!--{fieldspec:Vbi020}--><img src="http://code.google.com/apis/books/images/api-example2.png"></span></td> </tr></table></div> briefcit.html

  37. Currently Supported Google Book Classes • Thumbnails Image • gbs-thumbnail • Wrap span in a hyperlink • gbs-link-to-preview • gbs-link-to-info • gbs-link-to-thumbnail • Conditionals: only keep span if … • gbs-if-noview • gbs-if-partial-or-full • gbs-if-partial • gbs-if-full • Remove if Google does not index book • gbs-remove-on-failure • Multiple classes can be combined

  38. Google Book Classes: Summary Google Book Classes allows the use of the Google Book Viewability API in mashups Without requiring any JavaScript or AJAX knowledge Allows integration in places (such as III briefcit.html) where control of a page is limited

  39. Acknowledgements • Dr. Godmar Back • Assistant ProfessorComputer Science

  40. Questions? Thank you! http://libx.org/majax http://libx.org/gbs Contact us: libx.org@gmail.com

  41. majax resource 1 majax resource 2 majax resource 3 WebBridge Example (1)

  42. majax resource 1 majax resource 2 majax resource 3 WebBridge Example (2)

  43. Setting Up MAJAX for WebBridge • Add <script> tag to resserv_panel.html • WebBridge Management interface • Create 1 or more resources • Associate hasISBN or hasTitle data tests • Embed <span> tags in Link Display field

More Related