Documentation: Millennium Integration module for Drupal

This module is oriented towards libraries with Innovative Interfaces Inc.'s Millennium who want to import or expose some of its information in a Drupal site.

It can:

Introduction

This module is oriented towards libraries with Innovative Interfaces Inc.'s Millennium who want to import or expose some of its information in a Drupal site.

It can:

Features:

This module works best when used with some other modules:

Basically, the module works as follows:

Setup

Installation

Configuration (for importing items)

Note: If you just want to embed book information in nodes, you can skip to the Millennium Input Filter module's documentation.

To fill your Drupal site with records from a library catalog, you should follow these steps.

  1. (Optional) Create a new Drupal Content Type to put your items into.
    • Go to Structure -> Content Types
    • Click on the "Add Content Type" tab
    • Fill the "Name" field: could be something like "Library Items".
  2. (Optional) Set up taxonomy categories for your items, so that each imported item can then be properly tagged:
    • Create taxonomy free-tagging vocabularies for each one of these:
      • Subjects
      • Document type
      • Language
      • Author
      If case you haven't created vocabularies before, here is a quick step-by-step:
      • Go to: Administer -> Content Management -> Categories
      • Click on the "Add Vocabulary" tab.
      • Enter the Vocabulary's name (e.g.: Subject: keyword).
      • Below enable "tags" for the vocabulary.
      • Enale the vocabulary for the node type you will be importing items into.
      • Save changes.
      • Repeat for another vocabulary.
  3. Now, go to the administration section at admin/config/services/millennium and enter the required settings:
    • General tab:
      • Content type to import records into:
        If you created one in the above optional step, choose it now.
      • WebOpac Base URL:
        This is the base URL for your webopac. For example: http://library.org/
    • Taxonomy mapping tab:
      If you set up Drupal taxonomy with the above optional steps, you can now select which vocabularies will hold imported data like Subjects, Authors, Language and more.
    • Display tab:
      • Display real-time holdings information:
        Choose when users will see holdings information.

Permissions

You can also set different permissions for your roles at admin/people/permissions#millennium :

Importing items

You have several ways to import records:

Manual import:
You can specify a specific list or range of bibliographic or item numbers to import. You can specify to import them inmediately (using Drupal's Batch API) or to queue them to be processed during cron runs. Doing a small batch import is a good way to test your setup.
Auto-crawl:
Specify a beginning and (estimated) ending record number and the module will try to fetch records one by one automatically during cron runs. See Import via auto-crawl for more information.
One-by-one import:
You can go to the URL millennium/preview?url=[record URL] and you will be shown a preview showing how that record would be imported using your current settings. To import, click on the "Import now" link.

Importing via auto-crawl

Go to the administration section at admin/config/services/millennium, and enter the required settings:

  • Automatic crawl enabled:
    mark it as "enabled"
  • Starting record number for crawl:
    the bib record number, MINUS the starting .b or .i
    For example, if you wanted to import from record .b120000 you would type "120000"
  • Ending record number:
    Your estimated ending record number. This number grows on its own when the module reaches it and still finds records after it (so don't worry) =)
  • Restart crawl from above starting record?:
    Check this box whenever you want to restart the crawl from the beginning. (Only necessary if you're testing your setup).

Now, each time the Drupal Cron process is run, a few records will be imported.
How many depends on the option "Items to import per Cron run". When the module finds a large gap in consecutive item numbers, it will restart from the beginning.

Remember, you can always run cron manually (see http://drupal.org/node/158922) or set up Cron to run automatically (see http://drupal.org/cron)

Embed book information in nodes: the Millennium Input Filter module

About the Millennium Input Filter

Millennium Input Filter embeds book information in nodes, by letting you add a token inside the node body. The token includes a record number or URL which specifies the item to embed.

For instance, typing the following text in a node body would insert 2 items from the library catalog at Consuls.org:

When you view the node, it would look something like this:

You also can configure what fields to show (see below).

NOTE: Remember to pick the proper Input Format before saving the node!

Installation and usage

  1. Enable the "Millennium Filter" module at admin/modules, under the "Millennium" fieldset.
  2. Go to admin/config/content/formats and click "configure" beside one of the enabled input formats (or create a new input format).
  3. Find the checkbox for "Millennium Filter", and click "Save configuration".
  4. Optionally, you can go to the "Configure" tab for the Input Filter and change the settings under the "Millennium Records Filter" fieldset, to change the fields to show.
  5. Create a new node.
  6. Select the just-modified input format under the body field.
  7. Use any of these syntaxes to add a record display inside the body:
        {{millennium|b123456}}
        {{millennium|i123456}}
        {{millennium|http://example.org/record=b123456}}
        {{millennium|http://example.org/any/link/to/a/single/record/in/WebOPAC}}
    

    Note the first two examples would try to fetch the record information from the currently-configured WebOPAC in the Millennium module settings (admin/config/services/millennium).

Note the URL syntax allows any URL as long as it leads to a single record. For example, the following are equivalent:

    {{millennium|http://catalog.nypl.org/record=b17496311~S1}}

    {{millennium|http://catalog.nypl.org/search~S1?/Xharry+potter+and+the
    +philosopher%27s&searchscope=1&SORT=D/Xharry+potter+and+the+philosoph
    er%27s&searchscope=1&SORT=D&SUBKEY=harry%20potter%20and%20the%20philo
    sopher%27s/1%2C20%2C20%2CB/frameset&FF=Xharry+potter+and+the+philosop
    her%27s&searchscope=1&SORT=D&1%2C1%2C}}

Developer information (API, hooks)

Exposed hooks:

hook_millennium_biblio_data_alter(&$biblio, $marc)
Lets other modules add/change custom bibliographic data when storing biblio data in the database. Arguments:
  • $biblio is the biblio information array
  • $marc is the parsed MARC record
hook_millennium_load_biblio_data_alter($node, &$biblio)
Lets other modules add/change custom bibliographic data when fetching it from the database. This hook is invoked from within hook_nodeapi($op=load). Arguments:
  • $node is the node object
  • $biblio_data is the biblio data array
hook_millennium_continue_process_record($node, $data, $force_update)
Allows other modules to continue or skip importing of a record by returning TRUE (allow) or FALSE (skip this record). Arguments:
  • $node is the node object generated from a Millennium record
  • $data is the incoming Millennium record array
  • $force_update is the current active setting to force updating existing records.

More information

See the project's page at http://drupal.org/project/millennium