Skip to content

Commit

Permalink
Merge pull request Islandora#2 from jordandukart/7.x-1.7-ISLANDORA-1579
Browse files Browse the repository at this point in the history
7.x 1.7 islandora 1579
  • Loading branch information
ruebot committed Mar 2, 2016
2 parents e099bb6 + 1ef3354 commit e70741e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@ Further documentation for this module is available at [our wiki](https://wiki.du

The base ZIP/directory preprocessor can be called as a drush script (see `drush help islandora_book_batch_preprocess` for additional parameters):

Drush made the `target` parameter reserved as of Drush 7. To allow for backwards compatability this will be preserved.

Drush 7 and above:

`drush -v --user=admin --uri=http://localhost islandora_book_batch_preprocess --type=zip --scan_target=/path/to/archive.zip`

Drush 6 and below:
`drush -v --user=admin --uri=http://localhost islandora_book_batch_preprocess --type=zip --target=/path/to/archive.zip`

This will populate the queue (stored in the Drupal database) with base entries.

Books must be broken up into separate directories, such that each directory at the "top" level (in the scan_target directory or Zip file) represents a book. Book pages are their own directories inside of each book directory.
Books must be broken up into separate directories, such that each directory at the "top" level (in the target directory or Zip file) represents a book. Book pages are their own directories inside of each book directory.

Files are assigned to object datastreams based on their basename, so a folder structure like:

Expand Down
23 changes: 17 additions & 6 deletions islandora_book_batch.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ function islandora_book_batch_drush_command() {
'description' => 'Either "directory" or "zip".',
'required' => TRUE,
),
'scan_target' => array(
'description' => 'The target to directory or zip file to scan.',
'required' => TRUE,
),
'namespace' => array(
'description' => 'The namespace for objects created by this command. Defaults to namespce set in fedora config.',
'required' => FALSE,
Expand Down Expand Up @@ -87,7 +83,22 @@ function islandora_book_batch_drush_command() {
),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
);

// XXX: The target parameter became reserved in Drush 7 and above, for
// backwards compatibility both will be supported. Not using
// strict-option-handling (http://www.drush.org/en/master/strict-options) as
// it requires manual argument parsing.
if (drush_core_version() >= 7) {
$items['islandora_book_batch_preprocess']['options']['scan_target'] = array(
'description' => 'The target to directory or zip file to scan.',
'required' => TRUE,
);
}
else {
$items['islandora_book_batch_preprocess']['options']['target'] = array(
'description' => 'The target to directory or zip file to scan.',
'required' => TRUE,
);
}
return $items;
}

Expand All @@ -104,7 +115,7 @@ function drush_islandora_book_batch_preprocess() {
$parameters = array(
'type' => drush_get_option('type'),
'namespace' => drush_get_option('namespace'),
'scan_target' => drush_get_option('scan_target'),
'target' => drush_core_version() >= 7 ? drush_get_option('scan_target') : drush_get_option('target'),
'parent' => drush_get_option('parent', 'islandora:bookCollection'),
'parent_relationship_uri' => drush_get_option('parent_relationship_uri', 'info:fedora/fedora-system:def/relations-external#'),
'parent_relationship_pred' => drush_get_option('parent_relationship_pred', 'isMemberOfCollection'),
Expand Down

0 comments on commit e70741e

Please sign in to comment.