Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Release Notes and Downloads

Islandora BagIt GitHub Repository

Installation

To install the Islandora BagIt module:

  1. Install Archive_Tar. This package is required by PEAR so if you have PEAR installed on your system, you won't need to install Archive_Tar separately.
  2. Install the Libraries API contrib module.
  3. Unzip this module into your site's modules directory as you would any other contrib module.
  4. Install the BagItPHP library by entering your site's sites/all/libraries directory and issuing the following command:

    git clone git://github.com/scholarslab/BagItPHP.git

  5. Enable the following modules in admin/modules:

    1. Other > Libraries
    2. Islandora Tools > Islandora BagIt

Configuration

Set the location for the BagIt library, temporary directory for unserialized Bags, output directory for serialized Bags, Bag name prefix, select Collection batch type, compression type, object plugins, collection plugins, and set Bag Metadata in Administration » Islandora » Islandora BagIt (admin/islandora/bagit).

...

Islandora BagIt needs initial configuration before it can export Bags. To set the configurations, go to Administration » Islandora » Islandora Utility Modules » Islandora BagIt (admin/islandora/tools/bagit).

Defaults and recommended configurations:

  • Location of the BagIt library: BagItPHP
  • Temporary directory for unserialized Bags: /tmp
  • Delete unserialized (zipped) Bags: Check this box to automatically delete the version of the bag that isn't zipped, after the zipped version is created.
  • Output directory for serialized Bags: sites/default/files (Note: "Provide link to download Bag" will only work if this is a web-accessible directory.)
  • Create Bag on object ingest: unchecked by default
  • Create Bag on object modification: unchecked by default
  • Provide link to download Bag: checked by default (See note under "Output directory for serialized Bags")
  • Collection batch type:
    • one Bag per object - creates a separate Bag for each object in the collection
    • one Bag per Collection - creates a single Bag that contains all objects in the collection
  • Serialize collection Bags: unchecked by default
  • Bag name: Bag- (the object's PID is appended to this value)
  • Display messages: checked by default
  • Log the creation of Bags: checked by default
  • Compression type: choose tgz or zip
  • Object plugins: You must select at least one object plugin to add content to a Bag.
    • plugin_object_archivematica_transfers - creates an Archivematica (http://archivematica.org) 'transfer' Bag
    • plugin_object_ds_add_file - creates an arbitrary file to add to the Bag
    • plugin_object_ds_add_file - copies all the datastreams in an Islandora object to the top level of the Bag's 'data' directory
    • plugin_object_foxml - includes the FOXML for an Islandora object
    • plugin_object_premis - ncludes a PREMIS preservation metadata file generated by the Islandora PREMIS module (https://github.com/ruebot/islandora_premis).
  • Collection plugins: select one
    • plugin_collection_basic - creates a subdirectory for each object in the Bag's 'data' directory. This is the default.
    • plugin_collection_oddeven - creates an 'odd' and 'even' subdirectory in the Bag's 'data' directory, and then organizes object-level Bags within those two subdirectories
  • Bag metadata - expand this to fill out information for the Bag's bag-info.txt file.

Extending and customizing the BagIt module with plugins

Islandora BagIt uses two diffent different types of plugins, object plugins and collection plugins.

Object Plugins

Object plugins add files to an Islandora object's Bag. Object plugins 1) define the source path for datastream files and their destination paths in the Bag relative to the Bag's 'data' directory, and 2) optionally, rename datastream files or create new files for inclusion in the Bag.

The module comes with five object plugins: one that copies all the datastreams in an Islandora object to the top level of the Bag's 'data' directory, one that illustrates how to create an arbitrary file to add to the Bag, one that includes the FOXML for an Islandora object, one that creates an Archivematica (http://archivematica.org) 'transfer' Bag, and one that includes a PREMIS preservation metadata file generated by the Islandora PREMIS module (https://github.com/ruebot/islandora_premis).

Multiple object plugins may be activated, but they all add files to the same Bag. This means you can write a plugin that creates one specific file (for example) and activate it or deactivate it as needed. Plugins are fired in the order in which their filenames sortapplied to the Bag in alphabetical order by plugin file name.

If you have requirements not covered by the supplied object plugins, you can use the plugins described above to base your own on. If you write your own plugins, follow these guidelines:

  1. Begin plugin filenames with 'plugin_object_' and end in '.inc'.
  2. Every plugin has a function that is named the same as the filename prepended with 'islandora_bagit_', ending in '_init().' All init functions take $islandora_object and $tmp_ds_directory parameters.
  3. Plugins must complete all file writing and copying tasks before they return the file's source and destination paths to the Bagit module.
  4. Plugins return FALSE if there is an error in copying or writing files.

Collection Plugins

Collection plugins only apply to Bags that contain all the objects in a collection. Whereas with a Collection batch type of "one Bag per collection." Where object plugins determine what goes in each object-level Bag, collection plugins determine how all the objects that are in a collection-level Bag are arranged in the Bag's 'data' directory. AlsoUnlike object plugins, you can only activate one collection plugin at a time, unlike object plugins.

The requirements for collection plugins are the same as those for object plugins except for the requirement a) above: collection plugin filenames being with 'plugin_collection_' instead of 'plugin_object_'.

...