Commit b840bc60 authored by Mark Jordan's avatar Mark Jordan
Browse files

Updated README.md; added islandora_bagit_extended_baginfo submodule.

parent 4827c6a1
......@@ -17,27 +17,24 @@ Islandora BagIt Light requires the following modules/libraries:
* [Islandora](https://github.com/islandora/islandora)
* [Libraries](https://drupal.org/project/libraries)
* [Scholars' Lab BagItPHP library](https://github.com/scholarslab/BagItPHP)
* [Archive_Tar](http://pear.php.net/package/Archive_Tar)
* And its dependency [Archive_Tar](http://pear.php.net/package/Archive_Tar)
## Installation
To install the Islandora BagIt Light module:
1. Install [Archive_Tar](http://pear.php.net/package/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](https://drupal.org/project/libraries) 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 Libraries and Islandora BagIt Light modules like you would any other contrib modules.
1. Install the [Libraries API](https://drupal.org/project/libraries) contrib module.
1. Unzip this module into your site's modules directory as you would any other contrib module.
1. 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`
1. Enable the Libraries and Islandora BagIt Light modules like you would any other contrib modules.
## Usage
Bags can be created for individual Islandora objects or for lists of objects using Drush:
Bags can be created for individual Islandora objects (using the `--pid`` option) or for lists of objects (using the `--pid_file` option) using Drush:
`drush -u 1 islandora-create-bag --pid=islandora:102 --ini_file=test.ini`
`drush -u 1 islandora-create-bag --pid_file=/tmp/pid_to_create_bags_for.txt --ini_file=test.ini`
* `drush -u 1 islandora-create-bag --pid=islandora:102 --ini_file=test.ini`
* `drush -u 1 islandora-create-bag --pid_file=/tmp/pid_to_create_bags_for.txt --ini_file=test.ini`
The .ini file and PID file are documented below.
......@@ -114,11 +111,11 @@ Contact-Phone = 1-555-555-5555
Organization-Address = "Visit us at [site:url] any time you want."
```
You can insert Drupal tokens in tag values if the [Token](https://www.drupal.org/project/token) module is enabled. Most standard Drupal tokens won't apply to Islandora content, but some [types of tokens](https://www.drupal.org/node/390482), such as tokens that describe site information or users, might be applicable. The [Islandora Pathauto](https://github.com/Islandora/islandora_pathauto) module provides some Islandora-specific tokens, such as `[fedora:pid]`, `[fedora:namespace]`, and `[fedora:label]`. Any module that implements [hook_tokens](https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_tokens/7.x) can provide additional tokens.
Drupal tokens can be used in tag values if the [Token](https://www.drupal.org/project/token) module is enabled. Most standard Drupal tokens won't apply to Islandora content, but some [types of tokens](https://www.drupal.org/node/390482), such as tokens that describe site information or users, might be applicable. The [Islandora Pathauto](https://github.com/Islandora/islandora_pathauto) module provides some Islandora-specific tokens, such as `[fedora:pid]`, `[fedora:namespace]`, and `[fedora:label]`. Any module that implements [hook_tokens](https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_tokens/7.x) can provide additional tokens.
### Using a PID file
This module provides a Drush command to assign DOIs to a list of objects identified in a "PID file." The PID file is a simple list of object PIDS, one PID per line, like this:
This module can create Bags for sets of objects identified in a "PID file." The PID file is a simple list of object PIDS, one PID per line, like this:
```
islandora:23
......@@ -128,6 +125,8 @@ islandora:107
islandora:2183
```
Each object in listed in the PID file will get its own Bag.
## Bundled submodules
### Extending and customizing the Islandora BagIt Light module
......@@ -161,6 +160,7 @@ Some submodules it would be useful to have include:
* A submodule to generate Bags for paged content
* A submodule to generate Bags for compound objects
* A submodule to generate a Bag containing multiple objects, e.g. all objects in a collection.
* A submodule to add data from an object's MODS or DC datastreams to the `External-Description` bag-info.txt tag
* A submodule to generate PID files for all objects in a collection, with a given namespace, etc.
......
name = Islandora BagIt Extended Bag Info
description = Allows adding data from an object's datastreams to tags in the bag-info.txt file.
version = 7.x-dev
core = 7.x
package = Islandora Tools
dependencies[] = libraries
dependencies[] = islandora
dependencies[] = islandora_bagit_light
<?php
/**
* @file
*/
/**
* Implements hook_islandora_bagit_bag_alter().
*/
function islandora_bagit_extended_baginfo_islandora_bagit_bag_alter($bag, $islandora_object) {
// Add some custom metadata to bag-info.txt.
if ($islandora_object['DC']) {
$bag->setBagInfoData('External-Description', $islandora_object['DC']->content);
}
// Update the Bag.
$bag->update();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment