Explore my side projects and work using this link

Upsidedown is a WordPress theme design that brings blog posts rising above inverted header and footer components.

(published Sept 2007, which is a long time a go. Both the technology discussed here and my understanding of it have moved on a long way since it was written. Kept online because I don’t like things disappearing on the web, but other than that pretty much of no use to anyone.)

Over the last year I’ve read a lot about the Talis Platform. It sounds interesting, but somewhat daunting for my little mind. Here I take periodic small steps in trying to understand what it can do and how to use it.

Sending a search to a catalogue

First up I used this page
http://www.talis.com/tdn/node/1429
As a simple starter, taking the example code and trying it for myself (but searching Sussex not Birmingham).

I created this page.

Using the Talis Silkworm directory I found the code for the Sussex collection. The collection had a number of id codes and I wasn’t sure which one to use. I just picked one similar to that used for Birmingham in the example and it was fine.

Well that was easy! Of course this isn’t really anything special, the end result is the user ends up on the Catalogue search result. No real difference compared with just sticking a form on a page that points straight to the catalogue. Pro: it will work even if the underlying catalogue interface changes (unlike a form straight to the catalogue). Con: adds another system in to the equation could make the search box more vulnerable to downtime.

Step 2: Holdings

I then had a look at this page for doing an ISSN lookup. It looks like we send an ISSN, and are returned a set of results.

I wanted to understand what we would be getting back, before going on to do something useful with it (which is the point of the example on the page linked to above).

Looking at the PHP example I found the following line:

http://api.talis.com/1/bib/holdings?api_key={KEY}&output=json&isbn=$isbn

Even I realised that it should be possible to create a form which submits the variables api_key, output and isbn to the URL http://api.talis.com/1/bib/holdings and on submitting the form we should get back some structured data that would not normally be seen by humans.

My form (top of page, version1) looked like:

<form method=”get” action=”http://api.talis.com/1/bib/holdings”>
isbn: <input type=”text” name=”isbn” size=”15″/> <input type=”submit” value=”Search”/><br/>
<input type=”hidden” name=”api_key” value=”{KEY}”>
<input type=”hidden” name=”output” value=”json”>
</form>

Sure enough it produced some output. Notice the ‘output=json’, I wasn’t familiar with JSON, but wondered what other options there were. I tried changing this to RDF and the output changed to look like… well, RDF! I tried a few others. RSS, txt and html didn’t work but it looked like any output type not recognised meant it reverted back to XML.

Hence in my second attempt (version 2) – where you could select your output – I have used ‘xml-ish’ rather than XML, as this demonstrates how this unknown type simply reverts to XML.

Before moving on, I wonder if there are any other formats. Of course, this must be exactly the sort of thing the API docs will be useful for. I go to the API docs page on the TDN and find the page for the Holdings lookup API. It has some useful info but confirms these are the three output types at the moment.

OK, now I know what is going on, I feel ready to try the holdings lookup example in PHP. I cut and paste this code in to a file on my web space.

Problem: Failed opening required ‘JSON.php’. Looks like I need to get JSON.php. The page mentioned in the comments of the example makes it look quite complex, setting up PEAR, running a PEAR installer to add the JSON module. In the end I decided just to ignore all this, find a file that looks like PHP (but named phps) and save it as JSON.PHP in the same directory as the other files I’m working on.

I’m shocked when my JSON ‘solution’ (i.e. randomlly saving and renaming a file) actually works. The bottom search form on this page passes nothing more than the ISBN to my PHP file, it then displays a list of collections which contain the item in question.

Clicking on some just takes you to the Silkworm directory, I presume because they have no ‘service’ setup for the collection, so it doesn’t know how to take you on to the record on the actually library catalogue. Using my example ISBN John Rylands Library link is an example of one that works.

Now to try actually creating a page that will search some catalogue records and show the results…
[next page: building a simple search and display results]