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:
- Import bibliographic information into Drupal nodes which can display real-time item availability, cover images, tables of contents and book previews obtained from the Library of Congress, Open Library and Google Books.
- Embed book record information in existing nodes (for instance, to build bibliography or highlighted item lists).
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:
- Import bibliographic information into Drupal nodes which can display real-time item availability, cover images, tables of contents and book previews obtained from the Library of Congress, Open Library and Google Books.
- Embed book record information in existing nodes (for instance, to build bibliography or highlighted item lists).
Features:
- auto-crawl or manual import of items from the WebOPAC.
- support for external book jacket image services.
- choose between real-time holdings information or just a link to the original item in your WebOpac.
- maps MARC fields to taxonomy vocabularies for navigation and RSS. Via the optional (included) modules:
- imports Library of Congress book description and Table of Contents along with item, available for searching.
- Google Books links for items available online.
- Allows embedding one or more records in the body of existing nodes using the syntax {{millennium|[recordnumber]}} or {{millennium|[url]}}
This module works best when used with some other modules:
Basically, the module works as follows:
- You must first configure module settings, to tell the module where your WebOPAC is, and how to import records.
- You can import records manually (see below) or automatically (during cron).
- Records are imported into nodes, with links back to the original item and, if you configured it to do so, you will see the realtime holdings information fetched from the WebOPAC.
- If you want to see the module“s progress, go to to admin/reports/dblog or go to admin/reports/millennium for a detailed view.
Setup
Installation
- This module requires PHP5.
- Install this module as usual, see http://drupal.org/node/70151 for further information.
- (Required for Auto-crawl) Enable Cron for your site: see http://drupal.org/cron
- Read the instructions below for more setup instructions.
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.
- (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".
- (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.
- 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 :
- view millennium marc:
lets specified roles have access to MARC views of imported records thru a "MARC view" option on the node.
- administer millennium:
lets specified roles change all the configuration options at admin/config/services/millennium
- import single millennium items:
lets specified roles import single items at
- use millennium mass import/refresh:
lets users add or refresh items massively at admin/content/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
- Enable the "Millennium Filter" module at admin/modules, under the "Millennium" fieldset.
- Go to admin/config/content/formats and click "configure" beside one of the enabled input formats (or create a new input format).
- Find the checkbox for "Millennium Filter", and click "Save configuration".
- 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.
- Create a new node.
- Select the just-modified input format under the body field.
- 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.