Web Services - Library Technology Guides

Download Report

Transcript Web Services - Library Technology Guides

SERVICE-DRIVEN CONTENT
DELIVERY:
Do more for your patrons through
APIs and Web services
Marshall Breeding
Director for Innovative Technology and Research
Vanderbilt University
http://www.librarytechnology.org
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. Springshare LibGuides)
Local digital collections



ETDs, photos, rich media collections
Metasearch engines
All searched separately
Web site as menu of search options
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 on
Internal Proprietary programming
Delivered Interfaces
Core Software
Data stores
Public
Interfac
e
Staff
Interfac
e
Reports
Module
Core Functionality / Business
Logic
Application with abstract Database API
Public
Interface
Staff
Interface
Reports
Module
Delivered Interfaces
Core Software
Core Functionality / Business Logic
RDMS API
Data stores
Application with abstract Database API
Delivered Interfaces
Core Software
Public
Interfac
e
Staff
Interfac
e
Core Functionality / Business Logic
RDMS API
Data stores
Reports
Module
External
application
s
Application with API abstraction layer
Public
Interface
Staff
Interface
Reports
Module
Delivered Interfaces
API abstraction layer
Core Software
Application Programming Interfaces
Core Functionality / Business Logic
RDMS API
Data stores
Application API
exposed to External Applications
Public
Interface
Delivered Interfaces
Staff
Interfac
e
Report
s
Module
External
application
s
API abstraction layer Application Programming Interfaces
Core Software
Core Functionality / Business
Logic
RDMS API
Data
stores
Application API
exposed to External Applications
Public
Interface
Delivered Interfaces
Staff
Interfac
e
Report
s
Module
External
applications
use proprietary
programming
Core Software
Core Functionality /
Business Logic
RDMS API
Data stores
Application
Programming
Interfaces
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
Role of 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
SOA Architecture diagram

http://www.w3.org/TR/2002/WD-ws-arch-20021114/
Roles

Service provider
 Technically

more challenging
Service Requestor
 Simple
to implement
Web services communication Path
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:
Circulation
Functional
modules:
Federated
Search
Cataloging
Data Stores:
Staff Interfaces:
Acquisitions
Serials
OpenURL
Linking
Electronic
Resource
Mgmt
System
SOA model for business automation

Underlying data repositories
 Local


or Global
Reusable business services
Composite business applications
SOA Framework from Kuali OLE
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
LET’S BUILD A MASHUP
USING WEB SERVICES
Recipe

Ingredients
 Information
 Name,
photo, street address
 Latitude
 USGS
 Map,
about the library from the local database
and Longitude from an external Web service
Web service
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&amp;
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{'ad
dress'}
);
$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 /><img src=\\\"$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 "
print "
print "
print "
print "
print "
GEvent.addListener(marker, \"click\", function() {\n";
marker.openInfoWindowHtml(\"<strong>\" + name + \"</strong><br />\" + address $libphototext);\n";
});\n";
return marker;\n";
}\n";
function load() {\n";
print "
print "
print "
if (GBrowserIsCompatible()) {\n";
var map = new GMap2(document.getElementById(\"map\"));\n";
map.setCenter(new GLatLng($lat, $long), 15);\n";
print "
print "
print "
var point = new GLatLng($lat,$long);\n";
map.addOverlay(createMarker(point,\"$fields{'library'}\",\"$fields{'address'}\",\"$fields{'libphoto'}\"));\n";
}\n";
print " }\n";
print "\n";
print " //]]>\n";
print "
}
</script>\n";
Step 4. Stir, bake and serve
More information
Library Technology Reports Nov / Dec 2009
ALA TechSource
“Opening up Library Systems through Web
Services and SOA: Hype or Reality?”
By Marshall Breeding
http://www.librarytechnology.org/ltgdisplaytext.pl?RC=14408
Opening up Library Systems through Web
Services and SOA: Hype or Reality?
This report aims to assess the
current slate of major library
automation systems in regard to
their ability to provide openness
through APIs, Web services, and
the adoption of SOA.
Library Technology Reports Nov/Dec Issue 2009 by Marshall Breeding
A more in-depth version:
Library Technology Reports May / June
2006
ALA TechSource
 “Web Services and the Service Oriented
Architecture”

 By

Marshall Breeding
http://www.librarytechnology.org/ltgdisplaytext.pl?RC=12055
COMMENTS QUESTIONS AND
DISCUSSION