To what degree are SRU client and server implementations expected to be
combined into the same application? Put another way, should my SRU
implementations expect HTTP user agents to be able to transform XML
with XSLT?
My latest SRU implementation lives here:
http://alert.ockham.org/sru.cgi
The implementation acts as both a client as well as a server against my
index. XML is returned from an explain operation with an associated
XSLT stylesheet. The HTTP user-agent is expected to transform this XML
into XHTML, render a query interface, and provide the means to send the
application a query. Similarly, searchRetrieve operations go through
the same process: get results, transform, display, and provide query
interface again.
My problem with this implementation is it assumes the HTTP user-agent
knows how to transform XML. Yes, most browsers in use support XSLT
transformation, but not all. Furthermore, not all HTTP user-agents are
intended to display XHTML. Some user-agents are intended to grab RSS or
OAI data. Alternatively, if I want to disseminate the results of
searches against my index via email, then a different transformation,
as well as input, will be necessary. (I will need an email address.)
Consequently, I think I am going to spend time creating a simple SRU
server with no interface. It will accept SRU queries, obviously, and it
will return raw SRU/XML data with no associated stylesheet by default.
Yes, a stylesheet can be associated with the returned data but only
upon request.
At the same time, I will create one or more SRU clients. They will all
work similarly, but they will take a variety of inputs and transform
the returned data from the server differently. I suspect this is how
they will all work:
* write a CGI interface that accepts input
* convert the input into SRU
* instantiate a user-agent
* send the SRU URL to the server via the user-agent
* get the results
* transform the results
* return the results to the user
By separating my SRU client from my SRU server I can accomplish many
goals:
1. I can simplify my server application
2. I can write a single server application
3. I can provide many interfaces, and therefore
many outputs, against my index
4. I can still allow anybody to query the
server directly and therefore create their
own interface to my index
What do y'all think?
--
Eric Lease Morgan
University Libraries of Notre Dame
|