Deciding on an API for Biblios

As I continue to work on Biblios in anticipation of its release (soon, I hope!), it is about time to decide on an API.

I have already put into place a simple macro system for batch editing of bibliographic records. The language is Javascript and makes use of a MarcRecord javascript object to manipulate MARCXML records.

Here is a simple example (record is a MarcRecord instance):


// Check to see if record has 856.  If so, add subfield $u with url.  If not, add a new 856 with url.
if( record.hasField('856') ) {
    record.field('856').subfield('u', 'http://www.google.com');
}
else {
    record.addField( new Field('856', '', '', [ new Subfield('u', 'http://www.google.com')]) );
}

I would like to provide access to Biblios’ main functions for use by plugins. Here are a few ideas for API functions:

  • Run a search
  • Run the current search but limited to something
  • Save all search results to a folder
  • Save record with id n to a particular folder
  • Edit record with id n
  • Run a macro on all records in a folder

I’d be interested to hear what others think: what they’re used to in other cataloging software and what commands/tools that software might be missing which could be ultimately included in Biblios.

Viewing 4 Comments

    • ^
    • v
    I haven't seen yet 'biblio' but I suppose there is a way to target Z39.50 hosts in order to download records. I would be nice to manage Z39.50 list from API. It would be nice also to be able to register a callback function to be called after biblio record has been retrieved from z3950 server and before being displayed in 'biblio'. This function (one by z3950 target) would be able to clean record, do whatever on it, create items, deduplicate, etc.

    Thanks and continue the good work.
    • ^
    • v
    Hi Chris,

    I'm happy that you keep working on Biblios and sharing some of your developer thoughts.

    My work on a similar project during the last years makes me naturally interested in what you are doing now. I'm wondering if perhaps we could collaborate somehow...
    • ^
    • v
    Frederic,

    Thank you for your comment; I think these are good suggestions.

    In fact I think Biblios should allow callbacks at all important events in the record life cycle: on retrieval from z3950 server, on record editing, on record saving (or "send"ing to a remote ils). This way plugins will have the opportunity to modify things as needed.

    This also goes hand in hand with the concept of editor plugins, whereby someone could write an editor for another kind of metadata record, like MODS.
    • ^
    • v
    Fernando,

    I had not seen your project before: it is very interesting and exciting. It looks as if we have adopted some of the same techniques (not to mention, javascript framework).

    I will read over your project's documentation - indeed it seems as if we could collaborate and settle on some best practices as well!

Trackbacks

blog comments powered by Disqus