540 likes | 638 Views
Service-driven content delivery:. Marshall Breeding Director for Innovative Technology and Research Vanderbilt University http ://www.librarytechnology.org. Do more for your patrons through APIs and Web services. Oct 24, 2010. Web Manager’s Academy. General Issue.
E N D
Service-driven content delivery: Marshall Breeding Director for Innovative Technology and Research Vanderbilt University http://www.librarytechnology.org Do more for your patrons through APIs and Web services Oct 24, 2010 Web Manager’s Academy
General Issue • Library websites involve many different components that deliver some aspect of content or functionality • We need ways to let systems and components communicate with each other • Construct more unified interfaces of interrelated functionality rather than send users to many separate interfaces
Addressing the problem • Working toward a more cohesive and unified Web presence for the library • Need to be able to include content or services on a Web site from external sources • Web sites need to interact with other Web sites or applications • Role of the Web site to redistribute content from a variety of resources • Library applications need to distribute content and services to other consumers beyond its direct Web presence
Disjointed approach to information and service delivery • Silos Prevail • Books: Library OPAC (ILS module) • Articles: Aggregated content products, e-journal collections • OpenURL linking services • E-journal finding aids (Often managed by link resolver) • Subject guides (e.g. SpringshareLibGuides) • Local digital collections • ETDs, photos, rich media collections • Metasearch engines • All searched separately
Lack of unified Web presence • User’s don’t understand the distinctions libraries make • Web site content • Search interfaces based on content formats • Non-library Web sites are much more unified
Bringing it all together • Work toward a single unified presentation layer • Interacts with multiple back-end infrastructure components • Make use of API’s and other approaches to tie many systems together
APIs: Application Programming Interfaces • A general approach that allows access to data and functionality of a software application • Computer-to-computer communications • Expose services without access to source code • Proprietary or open implementations
Application based onInternal Proprietary programming Public Interface Staff Interface Reports Module Delivered Interfaces Core Functionality / Business Logic Core Software Data stores
Application with abstract Database API Public Interface Staff Interface Reports Module Delivered Interfaces Core Functionality / Business Logic Core Software RDMS API Data stores
Application with abstract Database API Public Interface Staff Interface Reports Module Delivered Interfaces Core Functionality / Business Logic External applications Core Software RDMS API Data stores
Application with API abstraction layer Public Interface Staff Interface Reports Module Delivered Interfaces Application Programming Interfaces API abstraction layer Core Functionality / Business Logic Core Software RDMS API Data stores
Application API exposed to External Applications Reports Module Public Interface Staff Interface External applications Delivered Interfaces Application Programming Interfaces API abstraction layer Core Functionality / Business Logic Core Software RDMS API Data stores
Application API exposed to External Applications Reports Module Public Interface Staff Interface External applications Delivered Interfaces use proprietary programming Core Functionality / Business Logic Application Programming Interfaces Core Software RDMS API Data stores
Web Services • An API using Web infrastructure technologies • Based on XML encoding of requests and responses • Not a Web-based service • Operates behind the scenes • Makes use of Web protocols • Computers need too agree on the details of the request and the response
Roleof Web Services • Provides interoperability among diverse applications • Widespread use for interaction of information resources • Complex applications require information and services from multiple sources • Web services makes use of existing Web infrastructure rather than one-off proprietary protocols • XML + HTTP
Ideal for library applications • A key supporting technology for Web 2.0 • Data exchange, conversions, lookups, etc. • Appropriate for portal integration, e-commerce, distributed applications. • Basis for mash-ups – applications based on content from multiple content resources
Your API / Web Services toolbox • Scripting language • Ruby, PHP, Perl, Java • Mid-level programming skills • Knowledge of XML • Documentation of source and target applications • Development environment
Display and Discovery • Enrich library content • MARC record from ILS • Book images from Amazon, Google Book Search, Syntetics • Table of contents • Summary • Ratings • Tags – LibraryThing for Libraries • ChiliFresh -- reviews
Service Oriented Architecture • A broad framework that organizes complex sets of Web services into larger applications • Increasingly becoming the preferred architecture and framework for Web programming and enterprise systems
http://www.w3.org/TR/2002/WD-ws-arch-20021114/ SOA Architecture diagram
Roles • Service provider • Technically more challenging • Service Requestor • Simple to implement
An XML oriented Architecture • All the components of SOA are expressed in XML • Definition of a service • Directories of services • Messages involved in the operation of the service
Adoption of Web services • Widespread use in all information and e-commerce arenas • Mainstream programming approach • Use in library applications increasingly common
From Web Services to SOA Building a new library technology infrastructure through a service-oriented architecture
Breaking down the modules • Traditional ILS • Cataloging • Circulation • Online Catalog • Acquisitions • Serials control • Reporting • Modern approach: SOA
Service Oriented Architecture http://www.sun.com/products/soa/benefits.jsp
Legacy ILS + e-content modules End User Interfaces: Federated Search OpenURL Linking Electronic Resource Mgmt System Circulation Acquisitions Functional modules: Cataloging Serials Data Stores: Staff Interfaces:
SOA model for business automation • Underlying data repositories • Local or Global • Reusable business services • Composite business applications
Benefits of Web services • Easy way to add e-commerce capabilities to Web site • Leverage services offered by other providers for the benefit of your users.
Web Service implementation methods • REST • Representational State Transfer • Easier, more common approach • Most common approach in library applications • SOAP • Used in more complex environments • Requires more set-up and infrastructure
Relevant APIs / Web Services • Amazon Web Service • Google Search • Google Book Search API • OCLC WorldCat APIs • Local ILS APIs • Facebook
Mashups • A new resource based on content or services from multiple sources • Usually created through Web services • Typically involves use of a scripting language • JavaScript, Ruby, PHP, Perl, .NET • Many Web sites have built-in tools for creating mashups
What’s involved? • Some knowledge of scripting or programming languages • Application components with accessible and documented API’s • Interface design • Data models • Can get started with basic programming and technical knowledge, but more can be accomplished with deeper expertise and resources.
Rest-like Example: Google search http://www.google.com/search? q=marshall+breeding& hl=en& safe=off
RSS as an example of REST • http://www.librarytechnology.org/rss
REST Example: SRU http://law-library2.rutgers.edu/SRU/srucql.pl? query="New+Jersey"& startRecord=1& maximumRecords=10& collection=lawlib& version=1.1& operation=searchRetrieve& recordSchema=dc
Recipe • Ingredients • Information about the library from the local database • Name, photo, street address • Latitude and Longitude from an external Web service • USGS Web service • Map, positioning and display services from Google
Step 1. Launch map • Create button to launch a new window for the map • Pass Library name, address and photo location: sub ViewMap { local ($Library,$StreetAddress,$libphoto) = @_; print "<input type=\"button\" value=\"view street map\" onclick=\"newWindow( \'lwc-viewmap.pl $sessionstring& address=$StreetAddress &library=$Library& libphoto=$libphoto \',\'window2\')\" $buttonstyle />\n"; }
Step 2. Turn address into Geocode data my $d = get( http://rpc.geocoder.us/service/rest?address=$fields{'address'} ); $d =~ /geo:long>([^< ]*).*?geo:lat>([^< ]*)/is; $lat = $2;
Step 3. Invoke Google MAP API Use pre-established API key Fetch the correct map specifying size and location Place the marker on the map Label the marker Create and populate info window
Call the subroutine &MapScript("$lat","$long","$fields{'libphoto'}");
Invoke the subroutine sub MapScript { local($lat,$long,$photo) = @_; local $libphototext = ""; $libphototext = "+ \"<br /><imgsrc=\\\"$imageserver//\" + libphoto + \".jpg\\\" height = \\\"100\\\">\"" if (length($photo) > 0); print "<script type=\"text/javascript\">\n"; print " //<![CDATA[\n"; print "\n"; print " function createMarker(point, name, address, libphoto) {\n"; print " var marker = new GMarker(point);\n"; print " GEvent.addListener(marker, \"click\", function() {\n"; print " marker.openInfoWindowHtml(\"<strong>\" + name + \"</strong><br />\" + address $libphototext);\n"; print " });\n"; print " return marker;\n"; print " }\n"; print " function load() {\n"; print " if (GBrowserIsCompatible()) {\n"; print " var map = new GMap2(document.getElementById(\"map\"));\n"; print " map.setCenter(new GLatLng($lat, $long), 15);\n"; print " var point = new GLatLng($lat,$long);\n"; print " map.addOverlay(createMarker(point,\"$fields{'library'}\",\"$fields{'address'}\",\"$fields{'libphoto'}\"));\n"; print " }\n"; print " }\n"; print "\n"; print " //]]>\n"; print " </script>\n"; }