[LibX] how to add your own custom catalog without rebuilding

Godmar Back godmar at gmail.com
Sat Oct 13 12:41:49 PDT 2007


In order to allow adoption of LibX by libraries whose catalogs we do
not currently support, I added a feature that allows catalog
implementations to be downloaded by the client at run-time. It's
called 'custom catalog', or external catalog. It is now offered in the
edition builder as an option.
Currently, the feature is only supported in the Firefox version of LibX.

A custom catalog works such that LibX will download the catalog's
implementation from a URL you specify whenever the user opens a new
window. The catalog must be implemented in JavaScript. It must support
two method: makeSearch and makeAdvancedSearch which form search URLs
based on a set of input types/fields.

I've created a demo edition and a demo catalog to show how it works.
The demo edition is called Demo for Custom Catalog and is located here:
http://libx.org/editions/libxtestedition.php?edition=3BC693A6

As an example, I implemented Worldcat as a custom catalog. This demo is here:
http://libx.org/catalogs/worldcat.js

Please only use this as a demo - if you wish to deploy this, copy this
file, host it elsewhere, then add the URL where it's located to your
configuration.

Custom catalogs have 4 required fields: a url, a name, options, and a
URL where the JavaScript implementation is found. In addition, you may
define up to 20 parameters param0 to param19.

Note that this introduces a dependency: the URL must be reachable to
use LibX. Therefore, choose a reliable server - googlepages.com may be
an option. That said, this feature doesn't mean we will stop adding
new catalog types to LibX. However, it will give people a way to
introduce and debug new types without consulting with us. Once
debugged, we'll be happy to add specific support (with custom
documentation/names) in the edition builder.

A limitation is that your catalog must support GET requests. If there
is a need, we'll add POST.

Finally, I should point out that we are opening internal interfaces
here, with no sandbox. Do not configure custom catalogs whose
implementations reside at URLs you do not trust. If the URL is
compromised, we currently have no way of revoking access to it.

 - Godmar


More information about the Libx mailing list