Web pages are seldom as simple as they look

I’ve kept a personal/professional web page on the USQ web site for as long as it has been possible to do so – since the mid-1990s. It has the usual stuff – brief bio, abbreviated CV, list of publications.

Over the years I’ve done periodic renovations. It started as a set of simple pages, moved to frames when they were in vogue, dabbled with CSS driven tabs when they became fashionable, and progressed to rounded corners and other neat touches when I renovated last year with a newly acquired copy of RapidWeaver. Previously I’d used hand coded HTML, Claris HomePage, and DreamWeaver in various manifestations.

One of the challenges of maintaining such a site is keeping a neatly formatted list of publications up to date with links to copies of papers when they are available. When you realise that the same list needs to be maintained in several other places – EndNote library for future use in writing, full CV, USQ ePrints, and a Faculty/USQ Research Office database used to justify research funding – the whole thing becomes more than a bit frustrating. Surely at least some of those lists could draw from the same data entry.

A few years ago it became frustrating enough that I learned enough PHP to put together a solution that would take a reference exported in a tagged (XML-ish) format from an original EndNote entry, parse and import it into a web page that could produce APA styled lists and documents needed for reporting to the office. When the server I was using for that was retired so was my database and I’ve been using the ePrints facility for producing the necessary forms. However, that has left me to manually maintain a list on my web site and I’d prefer to pull that from ePrints if I could. In an ideal world the ePrints folk would enable that by providing a simple means to query the database and acquire the desired list. They don’t, or at least not that I’m aware of, and what is there is a set of static HTML pages generated each night.

For some reason this bee got in my bonnet over the weekend and I decided to renovate my web site (DreamWeaver and CSS this time) and to look for a way to pull the publications list from ePrints. I figured it might be done using JavaScript and expected to have to suck in and parse the page contents to get what I needed. When I started searching via Google for the snippets I needed I discovered ajaxLoader which seemed to do what I needed and offered the added bonus of an adventure with AJAX. My initial trials on my local Mac using Safari 4 were promising. I was easily able to pull in and display the content of the page from ePrints. When I looked at the code in the ePrints page and saw that much of it was styled using CSS classes I realised that I may be able to hide badging and navigation that I didn’t need by overriding CSS classes with “display: none” definitions. It looked as though I had an easy solution.

When I tested using Firefox things began to fall apart with cross-domain security. I worked around by coding an alternative that displayed the whole page in an iFrame if the AJAX call generated an error. When I had that working locally I put the files on the server where it all fell apart again as the other browsers applied the cross-domain restrictions once away from the local host.

I was resigned to doing it all with an iFrame, not so neat with all the unnecessary (for my purposes) badging and navigation, but better than maintaining a manual list. Then I realised that if i saved a copy of the ePrints file on the host serving my pages I could make it work as I wanted. All I’d have to do would be to update that file copy periodically – at least as often as my publication list changes and ideally daily or weekly. Next step is to craft an AppleScript and/or Automator solution to do those updates. For now my publications list is matched to ePrints, though Firefox appears to have some problems with formatting content that includes multiple body tags. I may need to code some parsing yet, either in JavaScript or in the AppleScript that grabs the file.