Browse Source

Updated require objects hook to use NewFedoraObjects.

pull/220/head
Nigel Banks 12 years ago
parent
commit
65fd37cbac
  1. 45
      islandora.module

45
islandora.module

@ -632,35 +632,32 @@ function islandora_get_islandora_datastream_version($item = NULL, $dsid = NULL,
/** /**
* Implements hook_islandora_required_objects(). * Implements hook_islandora_required_objects().
*/ */
function islandora_islandora_required_objects() { function islandora_islandora_required_objects(IslandoraTuque $connection) {
$module_path = drupal_get_path('module', 'islandora'); $module_path = drupal_get_path('module', 'islandora');
// Root Collection
$root_collection = $connection->repository->constructObject('islandora:root');
$root_collection->owner = 'fedoraAdmin';
$root_collection->label = 'Top-level Collection';
$root_collection->models = 'islandora:collectionCModel';
// Collection Policy Datastream
$datastream = $root_collection->constructDatastream('COLLECTION_POLICY', 'X');
$datastream->label = 'Collection policy';
$datastream->mimetype = 'text/xml';
$datastream->setContentFromFile("$module_path/xml/islandora_collection_policy.xml", FALSE);
$root_collection->ingestDatastream($datastream);
// TN Datastream
$datastream = $root_collection->constructDatastream('TN', 'M');
$datastream->label = 'Thumbnail';
$datastream->mimetype = 'image/png';
$datastream->setContentFromFile("$module_path/images/folder.png", FALSE);
$root_collection->ingestDatastream($datastream);
return array( return array(
'islandora' => array( 'islandora' => array(
'title' => 'Islandora', 'title' => 'Islandora',
'objects' => array( 'objects' => array(
array( $root_collection
'pid' => 'islandora:root', )
'label' => 'Top-level collection', )
'cmodel' => 'islandora:collectionCModel',
'datastreams' => array(
array(
'dsid' => 'COLLECTION_POLICY',
'label' => 'Collection policy',
'mimetype' => 'text/xml',
'control_group' => 'X',
'datastream_file' => "$module_path/xml/islandora_collection_policy.xml",
),
array(
'dsid' => 'TN',
'label' => 'Thumbnail',
'mimetype' => 'image/png',
'control_group' => 'M',
'datastream_file' => "$module_path/images/folder.png",
),
),
),
),
),
); );
} }

Loading…
Cancel
Save