Browse Source

Swiched back to fedora_repository

pull/43/head
Ben Woodhead 13 years ago
parent
commit
27d9520519
  1. 20
      BatchIngest.inc
  2. 42
      CollectionClass.inc
  3. 24
      CollectionManagement.inc
  4. 18
      CollectionPolicy.inc
  5. 50
      ContentModel.inc
  6. 68
      ObjectHelper.inc
  7. 30
      SearchClass.inc
  8. 2
      SecurityClass.inc
  9. 8
      XMLDatastream.inc
  10. 14
      api/fedora_collection.inc
  11. 4
      api/fedora_export.inc
  12. 10
      api/fedora_item.inc
  13. 12
      api/fedora_utils.inc
  14. 0
      fedora_repository.info
  15. 8
      fedora_repository.install
  16. 388
      fedora_repository.module
  17. 20
      fedora_repository.solutionpacks.inc
  18. 78
      formClass.inc
  19. 10
      islandoracm.xsd
  20. 4
      plugins/CollectionFormBuilder.inc
  21. 8
      plugins/DarwinCore.inc
  22. 6
      plugins/DemoFormBuilder.inc
  23. 2
      plugins/DocumentConverter.inc
  24. 2
      plugins/Exiftool.inc
  25. 12
      plugins/FedoraObjectDetailedContent.inc
  26. 2
      plugins/Flv.inc
  27. 6
      plugins/FlvFormBuilder.inc
  28. 8
      plugins/FormBuilder.inc
  29. 2
      plugins/ImageManipulation.inc
  30. 16
      plugins/ModsFormBuilder.inc
  31. 2
      plugins/PersonalCollectionClass.inc
  32. 4
      plugins/QtFormBuilder.php
  33. 12
      plugins/Refworks.inc
  34. 18
      plugins/ShowStreamsInFieldSets.inc
  35. 2
      plugins/fedora_imageapi.info
  36. 8
      plugins/fedora_imageapi.module
  37. 28
      plugins/herbarium.inc
  38. 10
      plugins/map_viewer.inc
  39. 6
      plugins/qt_viewer.inc
  40. 6
      plugins/slide_viewer.inc
  41. 22
      plugins/tagging_form.inc
  42. 2
      tests/README_TESTING.txt
  43. 20
      tests/fedora_repository.test

20
BatchIngest.inc

@ -9,8 +9,8 @@
* @param array $content_models * @param array $content_models
*/ */
function batch_creation_form(&$form_state, $collection_pid, $content_models) { function batch_creation_form(&$form_state, $collection_pid, $content_models) {
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
$cm_options = array(); $cm_options = array();
$name_mappings = array(); $name_mappings = array();
foreach ($content_models as $content_model) { foreach ($content_models as $content_model) {
@ -95,8 +95,8 @@ function batch_creation_form_validate($form, &$form_state) {
} }
function batch_creation_form_submit($form, &$form_state) { function batch_creation_form_submit($form, &$form_state) {
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
global $user; global $user;
$namespace_mappings = array(); $namespace_mappings = array();
$content_model = $form_state['values']['content_model']; $content_model = $form_state['values']['content_model'];
@ -150,7 +150,7 @@ function batch_creation_form_submit($form, &$form_state) {
$batch = array( $batch = array(
'title' => 'Ingesting Objects', 'title' => 'Ingesting Objects',
'operations' => array(), 'operations' => array(),
'file' => drupal_get_path('module', 'islandora_repository') . '/BatchIngest.inc', 'file' => drupal_get_path('module', 'fedora_repository') . '/BatchIngest.inc',
); );
@ -176,8 +176,8 @@ function batch_creation_form_submit($form, &$form_state) {
function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) { function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) {
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
$cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM');
$allowedMimeTypes = $cm->getMimetypes(); $allowedMimeTypes = $cm->getMimetypes();
$mime_helper = new MimeClass(); $mime_helper = new MimeClass();
@ -227,9 +227,9 @@ function create_batch_objects($label, $content_model, $object_files, $collection
function batch_create_dc_from_mods($mods_xml) { function batch_create_dc_from_mods($mods_xml) {
$path = drupal_get_path('module', 'islandora_repository'); $path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
if ($xmlstr == NULL || strlen($xmlstr) < 5) { if ($xmlstr == NULL || strlen($xmlstr) < 5) {
return " "; return " ";

42
CollectionClass.inc

@ -29,7 +29,7 @@ class CollectionClass {
*/ */
function __construct($pid = NULL) { function __construct($pid = NULL) {
if (!empty($pid)) { if (!empty($pid)) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$this->collectionObject = new ObjectHelper($pid); $this->collectionObject = new ObjectHelper($pid);
$this->pid = $pid; $this->pid = $pid;
} }
@ -45,7 +45,7 @@ class CollectionClass {
* @return type * @return type
*/ */
function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
if (!isset($itqlquery)) { if (!isset($itqlquery)) {
// $query_string = $objectHelper->getStream($pid, 'QUERY', 0); // $query_string = $objectHelper->getStream($pid, 'QUERY', 0);
@ -65,8 +65,8 @@ class CollectionClass {
* @return type * @return type
*/ */
function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
if (!isset($limit)) { if (!isset($limit)) {
$limit = 1000; $limit = 1000;
} }
@ -74,7 +74,7 @@ class CollectionClass {
$offset = 0; $offset = 0;
} }
global $user; global $user;
if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error');
return ' '; return ' ';
} }
@ -101,7 +101,7 @@ class CollectionClass {
$query_string = htmlentities(urlencode($query_string)); $query_string = htmlentities(urlencode($query_string));
$content = ''; $content = '';
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string;
$content .= do_curl($url); $content .= do_curl($url);
@ -156,7 +156,7 @@ class CollectionClass {
* @return type * @return type
*/ */
function getStream($pid, $dsid, $showError = 1) { function getStream($pid, $dsid, $showError = 1) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new fedora_item($pid); $item = new fedora_item($pid);
return isset($item->datastreams[$dsid]) ? $item->get_datastream_dissemination($dsid) : NULL; return isset($item->datastreams[$dsid]) ? $item->get_datastream_dissemination($dsid) : NULL;
} }
@ -223,7 +223,7 @@ class CollectionClass {
module_load_include('inc', 'Fedora_Repository', 'ConnectionHelper'); module_load_include('inc', 'Fedora_Repository', 'ConnectionHelper');
$pidNameSpace = $this->getPidNameSpace($pid, $dsid); $pidNameSpace = $this->getPidNameSpace($pid, $dsid);
$pname = substr($pidNameSpace, 0, strpos($pidNameSpace, ":")); $pname = substr($pidNameSpace, 0, strpos($pidNameSpace, ":"));
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
return Fedora_Item::get_next_pid_in_namespace($pname); return Fedora_Item::get_next_pid_in_namespace($pname);
} }
@ -339,7 +339,7 @@ class CollectionClass {
} }
} }
// module_load_include( $phpFile, 'Fedora_Repository', ' '); // module_load_include( $phpFile, 'Fedora_Repository', ' ');
require_once(drupal_get_path('module', 'islandora_repository') . '/' . $phpFile); require_once(drupal_get_path('module', 'fedora_repository') . '/' . $phpFile);
$thisClass = new $phpClass (); $thisClass = new $phpClass ();
$returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext); $returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext);
if (!$returnValue) { if (!$returnValue) {
@ -409,7 +409,7 @@ class CollectionClass {
$ingest_form = $xml->ingest_form; //should only be one $ingest_form = $xml->ingest_form; //should only be one
$drupal_module = strip_tags($ingest_form->form_builder_method->module->asXML()); $drupal_module = strip_tags($ingest_form->form_builder_method->module->asXML());
if (empty($drupal_module)) { if (empty($drupal_module)) {
$drupal_module = 'islandora_repository'; $drupal_module = 'fedora_repository';
} }
$phpFile = strip_tags($ingest_form->form_builder_method->file->asXML()); $phpFile = strip_tags($ingest_form->form_builder_method->file->asXML());
$phpClass = strip_tags($ingest_form->form_builder_method->class_name->asXML()); $phpClass = strip_tags($ingest_form->form_builder_method->class_name->asXML());
@ -437,11 +437,11 @@ class CollectionClass {
'name' => variable_get('fedora_admin_user', 'fedoraAdmin') 'name' => variable_get('fedora_admin_user', 'fedoraAdmin')
); );
$admin_user = user_load($username); $admin_user = user_load($username);
module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
$connectionHelper = new ConnectionHelper(); $connectionHelper = new ConnectionHelper();
try { try {
$soapClient = $connectionHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $soapClient = $connectionHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'));
$pidNameSpace = variable_get('islandora_repository_pid', 'vre:'); $pidNameSpace = variable_get('fedora_repository_pid', 'vre:');
$pidNameSpace = substr($pidNameSpace, 0, strpos($pidNameSpace, ":")); $pidNameSpace = substr($pidNameSpace, 0, strpos($pidNameSpace, ":"));
$params = array( $params = array(
'numPIDs' => '', 'numPIDs' => '',
@ -460,7 +460,7 @@ class CollectionClass {
$personal_collection_pid = array( $personal_collection_pid = array(
'fedora_personal_pid' => $pid 'fedora_personal_pid' => $pid
); );
module_load_include('inc', 'islandora_repository', 'plugins/PersonalCollectionClass'); module_load_include('inc', 'fedora_repository', 'plugins/PersonalCollectionClass');
$personalCollectionClass = new PersonalCollectionClass(); $personalCollectionClass = new PersonalCollectionClass();
if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) { if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) {
drupal_set_message("Did not create a personal collection object for !u", array('!u' => $user->name)); drupal_set_message("Did not create a personal collection object for !u", array('!u' => $user->name));
@ -480,7 +480,7 @@ class CollectionClass {
* @return type * @return type
*/ */
function getXslContent($pid, $path, $canUseDefault = TRUE) { function getXslContent($pid, $path, $canUseDefault = TRUE) {
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
$collectionClass = new CollectionClass(); $collectionClass = new CollectionClass();
$xslContent = $collectionClass->getCollectionViewStream($pid); $xslContent = $collectionClass->getCollectionViewStream($pid);
if (!$xslContent && $canUseDefault) { //no xslt so we will use the default sent with the module if (!$xslContent && $canUseDefault) { //no xslt so we will use the default sent with the module
@ -497,9 +497,9 @@ class CollectionClass {
* @return string * @return string
*/ */
function showFieldSets($page_number) { function showFieldSets($page_number) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'CollectionManagement'); module_load_include('inc', 'fedora_repository', 'CollectionManagement');
module_load_include('inc', 'islandora_repository', 'BatchIngest'); module_load_include('inc', 'fedora_repository', 'BatchIngest');
global $base_url; global $base_url;
$tabset = array(); $tabset = array();
global $user; global $user;
@ -514,7 +514,7 @@ class CollectionClass {
$collection_items = $this->renderCollection($results, $this->pid, NULL, NULL, $page_number); $collection_items = $this->renderCollection($results, $this->pid, NULL, NULL, $page_number);
$collection_item = new Fedora_Item($this->pid); $collection_item = new Fedora_Item($this->pid);
// Check the form post to see if we are in the middle of an ingest operation. // Check the form post to see if we are in the middle of an ingest operation.
$show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_ingest_form'); $show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_ingest_form');
$add_to_collection = $this->getIngestInterface(); $add_to_collection = $this->getIngestInterface();
$show_batch_tab = TRUE; $show_batch_tab = TRUE;
@ -586,7 +586,7 @@ class CollectionClass {
$allow = fedora_fesl_check_roles($this->pid, 'write'); $allow = fedora_fesl_check_roles($this->pid, 'write');
} }
if ($allow) { if ($allow) {
$ingestObject = drupal_get_form('islandora_repository_ingest_form', $this->pid); $ingestObject = drupal_get_form('fedora_repository_ingest_form', $this->pid);
} }
} }
} }
@ -608,7 +608,7 @@ class CollectionClass {
* @return type * @return type
*/ */
function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) {
$path = drupal_get_path('module', 'islandora_repository'); $path = drupal_get_path('module', 'fedora_repository');
global $base_url; global $base_url;
$collection_pid = $pid; //we will be changing the pid later maybe $collection_pid = $pid; //we will be changing the pid later maybe
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
@ -628,7 +628,7 @@ class CollectionClass {
} }
if (!isset($collectionName)) { if (!isset($collectionName)) {
$collectionName = variable_get('islandora_repository_name', 'Collection'); $collectionName = variable_get('fedora_repository_name', 'Collection');
} }
$xslContent = $this->getXslContent($pid, $path); $xslContent = $this->getXslContent($pid, $path);

24
CollectionManagement.inc

@ -8,7 +8,7 @@
* @return array * @return array
*/ */
function collection_management_form(&$form_state, $this_collection_pid, $content_models) { function collection_management_form(&$form_state, $this_collection_pid, $content_models) {
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$restricted = FALSE; $restricted = FALSE;
if (variable_get('fedora_namespace_restriction_enforced', true)) { if (variable_get('fedora_namespace_restriction_enforced', true)) {
$restricted = true; $restricted = true;
@ -20,8 +20,8 @@ function collection_management_form(&$form_state, $this_collection_pid, $content
} }
} }
} }
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
$item = new Fedora_Item($this_collection_pid); $item = new Fedora_Item($this_collection_pid);
$collection_name = $item->objectProfile->objLabel; $collection_name = $item->objectProfile->objLabel;
$new_content_models = get_content_models_as_option_array(); $new_content_models = get_content_models_as_option_array();
@ -224,8 +224,8 @@ function collection_management_form(&$form_state, $this_collection_pid, $content
*/ */
function collection_management_form_validate($form, &$form_state) { function collection_management_form_validate($form, &$form_state) {
if ($form_state['clicked_button']['#id'] == 'create_class') { if ($form_state['clicked_button']['#id'] == 'create_class') {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$pid = $form_state['values']['new_collection_pid']; $pid = $form_state['values']['new_collection_pid'];
$item = new fedora_item($pid); $item = new fedora_item($pid);
if ($item->exists()) { if ($item->exists()) {
@ -252,14 +252,14 @@ function collection_management_form_validate($form, &$form_state) {
* @param type $form_state * @param type $form_state
*/ */
function collection_management_form_submit($form, &$form_state) { function collection_management_form_submit($form, &$form_state) {
module_load_include('inc', 'islandora_repository', 'api/fedora_collection'); module_load_include('inc', 'fedora_repository', 'api/fedora_collection');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/dublin_core'); module_load_include('inc', 'fedora_repository', 'api/dublin_core');
global $user; global $user;
$collection_pid = $form_state['values']['parent_collection']; $collection_pid = $form_state['values']['parent_collection'];
$policy = CollectionPolicy::loadFromCollection($collection_pid, TRUE); $policy = CollectionPolicy::loadFromCollection($collection_pid, TRUE);
if ($form_state['clicked_button']['#id'] == 'create_class') { if ($form_state['clicked_button']['#id'] == 'create_class') {
$module_path = drupal_get_path('module', 'islandora_repository'); $module_path = drupal_get_path('module', 'fedora_repository');
$thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png';
$new_collection_pid = $form_state['values']['new_collection_pid']; $new_collection_pid = $form_state['values']['new_collection_pid'];
$new_collection_label = $form_state['values']['collection_name']; $new_collection_label = $form_state['values']['collection_name'];
@ -345,7 +345,7 @@ function collection_management_form_submit($form, &$form_state) {
$query = htmlentities(urlencode($query)); $query = htmlentities(urlencode($query));
$content = ''; $content = '';
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=TRUE&format=csv&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query; $url .= "?type=tuples&flush=TRUE&format=csv&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query;
$content .= do_curl($url); $content .= do_curl($url);
$results = explode("\n", $content); $results = explode("\n", $content);
@ -370,7 +370,7 @@ function collection_management_form_submit($form, &$form_state) {
$batch = array( $batch = array(
'title' => "Deleting Objects from $name", 'title' => "Deleting Objects from $name",
'operations' => array(), 'operations' => array(),
'file' => drupal_get_path('module', 'islandora_repository') . '/CollectionManagement.inc', 'file' => drupal_get_path('module', 'fedora_repository') . '/CollectionManagement.inc',
); );
@ -389,7 +389,7 @@ function collection_management_form_submit($form, &$form_state) {
* @param <type> $pid * @param <type> $pid
*/ */
function delete_objects_as_batch($pid) { function delete_objects_as_batch($pid) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$name = $user->name; $name = $user->name;
$item_to_delete = new Fedora_Item($pid); $item_to_delete = new Fedora_Item($pid);
$models = $item_to_delete->get_models(); $models = $item_to_delete->get_models();

18
CollectionPolicy.inc

@ -4,7 +4,7 @@
* @file * @file
* Collection Policy Class * Collection Policy Class
*/ */
module_load_include('inc', 'islandora_repository', 'XMLDatastream'); module_load_include('inc', 'fedora_repository', 'XMLDatastream');
/** /**
* Collection Policy class ?? * Collection Policy class ??
@ -36,7 +36,7 @@ class CollectionPolicy extends XMLDatastream {
*/ */
static function loadFromCollection($pid, $preFetch=TRUE) { static function loadFromCollection($pid, $preFetch=TRUE) {
$ret = FALSE; $ret = FALSE;
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
try { try {
if (self::valid_pid($pid)) { if (self::valid_pid($pid)) {
@ -80,7 +80,7 @@ class CollectionPolicy extends XMLDatastream {
$rootEl = $cp->xml->getElementsByTagName('collection_policy')->item(0); $rootEl = $cp->xml->getElementsByTagName('collection_policy')->item(0);
$rootEl->setAttribute('name', $name); $rootEl->setAttribute('name', $name);
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$fedoraItem = new Fedora_Item($pid); $fedoraItem = new Fedora_Item($pid);
$fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X');
$ret = $cp; $ret = $cp;
@ -110,7 +110,7 @@ class CollectionPolicy extends XMLDatastream {
$cp = new CollectionPolicy($newDom, $pid, $cpDsid); $cp = new CollectionPolicy($newDom, $pid, $cpDsid);
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$fedoraItem = new Fedora_Item($pid); $fedoraItem = new Fedora_Item($pid);
$fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X');
$ret = $cp; $ret = $cp;
@ -137,7 +137,7 @@ class CollectionPolicy extends XMLDatastream {
public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) { public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) {
$ret = FALSE; $ret = FALSE;
if (($cp = self::loadFromCollection($pid)) === FALSE) { //removed second, non-existant variable if (($cp = self::loadFromCollection($pid)) === FALSE) { //removed second, non-existant variable
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) { if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) {
$newDom = new DOMDocument('1.0', 'utf-8'); $newDom = new DOMDocument('1.0', 'utf-8');
$newDom->formatOutput = TRUE; $newDom->formatOutput = TRUE;
@ -171,7 +171,7 @@ class CollectionPolicy extends XMLDatastream {
$cp = new CollectionPolicy($newDom, $pid, $policyDsid); $cp = new CollectionPolicy($newDom, $pid, $policyDsid);
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$fedoraItem = new Fedora_Item($pid); $fedoraItem = new Fedora_Item($pid);
@ -299,7 +299,7 @@ class CollectionPolicy extends XMLDatastream {
$this->staging_area = trim($stagingEl->item(0)->nodeValue); $this->staging_area = trim($stagingEl->item(0)->nodeValue);
} }
elseif ($recurse) { elseif ($recurse) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new Fedora_Item($this->pid); $item = new Fedora_Item($this->pid);
$rels = $item->get_relationships(); $rels = $item->get_relationships();
if (count($rels) > 0) { if (count($rels) > 0) {
@ -373,7 +373,7 @@ class CollectionPolicy extends XMLDatastream {
$pname = substr($namespace, 0, strpos($namespace, ":")); $pname = substr($namespace, 0, strpos($namespace, ":"));
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$ret = Fedora_Item::get_next_pid_in_namespace($pname); $ret = Fedora_Item::get_next_pid_in_namespace($pname);
} }
return $ret; return $ret;
@ -443,7 +443,7 @@ class CollectionPolicy extends XMLDatastream {
if ($recurse && count($ret) == 0) { if ($recurse && count($ret) == 0) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new Fedora_Item($this->pid); $item = new Fedora_Item($this->pid);
$rels = $item->get_relationships(); $rels = $item->get_relationships();
if (count($rels) > 0) { if (count($rels) > 0) {

50
ContentModel.inc

@ -8,7 +8,7 @@
* @file * @file
* Content Model Class * Content Model Class
*/ */
module_load_include('inc', 'islandora_repository', 'XMLDatastream'); module_load_include('inc', 'fedora_repository', 'XMLDatastream');
/** /**
* Conent Model ?? * Conent Model ??
@ -41,7 +41,7 @@ class ContentModel extends XMLDatastream {
public static function loadFromObject($pid) { public static function loadFromObject($pid) {
$ret = FALSE; $ret = FALSE;
if (self::valid_pid($pid)) { if (self::valid_pid($pid)) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
$content_models = $objectHelper->get_content_models_list($pid); $content_models = $objectHelper->get_content_models_list($pid);
@ -73,7 +73,7 @@ class ContentModel extends XMLDatastream {
$rootEl = $cm->xml->getElementsByTagName('content_model')->item(0); $rootEl = $cm->xml->getElementsByTagName('content_model')->item(0);
$rootEl->setAttribute('name', $name); $rootEl->setAttribute('name', $name);
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$fedoraItem = new Fedora_Item($pid); $fedoraItem = new Fedora_Item($pid);
$fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X');
$ret = $cm; $ret = $cm;
@ -102,7 +102,7 @@ class ContentModel extends XMLDatastream {
$cm = new ContentModel($newDom, $pid, $modelDsid); $cm = new ContentModel($newDom, $pid, $modelDsid);
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$fedoraItem = new Fedora_Item($pid); $fedoraItem = new Fedora_Item($pid);
$fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X');
$ret = $cm; $ret = $cm;
@ -172,7 +172,7 @@ class ContentModel extends XMLDatastream {
$cm = new ContentModel($newDom, $pid, $modelDsid); $cm = new ContentModel($newDom, $pid, $modelDsid);
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$fedoraItem = new Fedora_Item($pid); $fedoraItem = new Fedora_Item($pid);
$fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X');
$ret = $cm; $ret = $cm;
@ -199,7 +199,7 @@ class ContentModel extends XMLDatastream {
*/ */
public static function loadFromModel($pid, $dsid = NULL, $pid_namespace = NULL, $name = NULL) { public static function loadFromModel($pid, $dsid = NULL, $pid_namespace = NULL, $name = NULL) {
$ret = FALSE; $ret = FALSE;
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
try { try {
if (self::valid_pid($pid)) { if (self::valid_pid($pid)) {
$fedoraItem = new Fedora_Item($pid); $fedoraItem = new Fedora_Item($pid);
@ -436,7 +436,7 @@ class ContentModel extends XMLDatastream {
and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
order by $title'; order by $title';
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
$collectionHelper = new CollectionClass(); $collectionHelper = new CollectionClass();
$xml = simplexml_load_string($collectionHelper->getRelatedItems($this->pid, $query)); $xml = simplexml_load_string($collectionHelper->getRelatedItems($this->pid, $query));
@ -1070,7 +1070,7 @@ class ContentModel extends XMLDatastream {
$method = $ingest_form->getElementsByTagName('form_builder_method')->item(0); $method = $ingest_form->getElementsByTagName('form_builder_method')->item(0);
$module = $method->getAttribute('module'); $module = $method->getAttribute('module');
$path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file');
if (!file_exists($path)) { if (!file_exists($path)) {
self::$errors[] = 'Build Ingest Form: file \'' . $path . '\' does not exist.'; self::$errors[] = 'Build Ingest Form: file \'' . $path . '\' does not exist.';
} }
@ -1110,7 +1110,7 @@ class ContentModel extends XMLDatastream {
if ($method->length > 0 && $method->item(0)->getAttribute('dsid') == $dsid) { if ($method->length > 0 && $method->item(0)->getAttribute('dsid') == $dsid) {
$method = $method->item(0); $method = $method->item(0);
$module = $method->getAttribute('module'); $module = $method->getAttribute('module');
$path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file');
if (!file_exists($path)) { if (!file_exists($path)) {
self::$errors[] = 'Build Edit Metadata Form: file \'' . $path . '\' does not exist.'; self::$errors[] = 'Build Edit Metadata Form: file \'' . $path . '\' does not exist.';
} }
@ -1153,7 +1153,7 @@ class ContentModel extends XMLDatastream {
if ($method->length > 0) { if ($method->length > 0) {
$method = $method->item(0); $method = $method->item(0);
$module = $method->getAttribute('module'); $module = $method->getAttribute('module');
$path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file');
if (!file_exists($path)) { if (!file_exists($path)) {
self::$errors[] = 'Handle Edit Metadata Form: file \'' . $path . '\' does not exist.'; self::$errors[] = 'Handle Edit Metadata Form: file \'' . $path . '\' does not exist.';
} }
@ -1177,7 +1177,7 @@ class ContentModel extends XMLDatastream {
} }
else { else {
// Assume DC form if none is specified. // Assume DC form if none is specified.
module_load_include('inc', 'islandora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'formClass');
$metaDataForm = new formClass(); $metaDataForm = new formClass();
$ret = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $soap_client); $ret = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $soap_client);
$form_state['storage'] = NULL; $form_state['storage'] = NULL;
@ -1198,7 +1198,7 @@ class ContentModel extends XMLDatastream {
$method = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); $method = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method');
if ($method->length > 0) { if ($method->length > 0) {
$method = $method->item(0); $method = $method->item(0);
$ret = array('module' => $method->getAttribute('module') == '' ? 'islandora_repository' : $method->getAttribute('module'), $ret = array('module' => $method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module'),
'file' => $method->getAttribute('file'), 'file' => $method->getAttribute('file'),
'class' => $method->getAttribute('class'), 'class' => $method->getAttribute('class'),
'method' => $method->getAttribute('method'), 'method' => $method->getAttribute('method'),
@ -1282,7 +1282,7 @@ class ContentModel extends XMLDatastream {
} }
} }
$module = $addMethod->getAttribute('module'); $module = $addMethod->getAttribute('module');
$path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $addMethod->getAttribute('file'); $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $addMethod->getAttribute('file');
if (!file_exists($path)) { if (!file_exists($path)) {
self::$errors[] = 'Execute Add Datastream Methods: file \'' . $path . '\' does not exist.'; self::$errors[] = 'Execute Add Datastream Methods: file \'' . $path . '\' does not exist.';
} }
@ -1351,9 +1351,9 @@ class ContentModel extends XMLDatastream {
if (!$preview || isset($param_array['preview'])) { if (!$preview || isset($param_array['preview'])) {
$module = $method->getAttribute('module'); $module = $method->getAttribute('module');
$path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file');
if (!file_exists($path) || substr_compare($path, 'islandora_repository/', -strlen('islandora_repository/'), strlen('islandora_repository/')) === 0) { if (!file_exists($path) || substr_compare($path, 'fedora_repository/', -strlen('fedora_repository/'), strlen('fedora_repository/')) === 0) {
self::$errors[] = 'Execute Ingest Rules: file \'' . $path . '\' does not exist.'; self::$errors[] = 'Execute Ingest Rules: file \'' . $path . '\' does not exist.';
$ret = FALSE; $ret = FALSE;
} }
@ -1399,7 +1399,7 @@ class ContentModel extends XMLDatastream {
if ($this->validate()) { if ($this->validate()) {
$method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0);
$module = $method->getAttribute('module'); $module = $method->getAttribute('module');
$path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file');
if (!file_exists($path)) { if (!file_exists($path)) {
self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.';
} }
@ -1469,7 +1469,7 @@ class ContentModel extends XMLDatastream {
for ($j = 0; $j < $dispMethods->length; $j++) { for ($j = 0; $j < $dispMethods->length; $j++) {
$method = $dispMethods->item($j); $method = $dispMethods->item($j);
$module = $method->getAttribute('module'); $module = $method->getAttribute('module');
$path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file');
if (!file_exists($path)) { if (!file_exists($path)) {
self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.';
} }
@ -1588,7 +1588,7 @@ class ContentModel extends XMLDatastream {
$ret = array(); $ret = array();
$dispMethods = $ds->getElementsByTagName('display_method'); $dispMethods = $ds->getElementsByTagName('display_method');
for ($i = 0; $i < $dispMethods->length; $i++) { for ($i = 0; $i < $dispMethods->length; $i++) {
$ret[] = array('module' => $dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module'), $ret[] = array('module' => $dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module'),
'file' => $dispMethods->item($i)->getAttribute('file'), 'file' => $dispMethods->item($i)->getAttribute('file'),
'class' => $dispMethods->item($i)->getAttribute('class'), 'class' => $dispMethods->item($i)->getAttribute('class'),
'method' => $dispMethods->item($i)->getAttribute('method'), 'method' => $dispMethods->item($i)->getAttribute('method'),
@ -1694,7 +1694,7 @@ class ContentModel extends XMLDatastream {
$found = FALSE; $found = FALSE;
$dispMethods = $ds->getElementsByTagName('display_method'); $dispMethods = $ds->getElementsByTagName('display_method');
for ($i = 0; !$found && $i < $dispMethods->length; $i++) { for ($i = 0; !$found && $i < $dispMethods->length; $i++) {
if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module')) && if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module')) &&
$file == $dispMethods->item($i)->getAttribute('file') && $file == $dispMethods->item($i)->getAttribute('file') &&
$class == $dispMethods->item($i)->getAttribute('class') && $class == $dispMethods->item($i)->getAttribute('class') &&
$method == $dispMethods->item($i)->getAttribute('method')) { $method == $dispMethods->item($i)->getAttribute('method')) {
@ -1732,7 +1732,7 @@ class ContentModel extends XMLDatastream {
$found = FALSE; $found = FALSE;
$dispMethods = $ds->getElementsByTagName('display_method'); $dispMethods = $ds->getElementsByTagName('display_method');
for ($i = 0; !$found && $i < $dispMethods->length; $i++) { for ($i = 0; !$found && $i < $dispMethods->length; $i++) {
if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module') == '') && if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module') == '') &&
$file == $dispMethods->item($i)->getAttribute('file') && $file == $dispMethods->item($i)->getAttribute('file') &&
$class == $dispMethods->item($i)->getAttribute('class') && $class == $dispMethods->item($i)->getAttribute('class') &&
$method == $dispMethods->item($i)->getAttribute('method')) { $method == $dispMethods->item($i)->getAttribute('method')) {
@ -1785,7 +1785,7 @@ class ContentModel extends XMLDatastream {
if (($ds = $this->getDSModel($ds)) !== FALSE) { if (($ds = $this->getDSModel($ds)) !== FALSE) {
$addDsMethod = $ds->getElementsByTagName('add_datastream_method'); $addDsMethod = $ds->getElementsByTagName('add_datastream_method');
if ($addDsMethod !== FALSE && $addDsMethod->length > 0) { if ($addDsMethod !== FALSE && $addDsMethod->length > 0) {
$ret = array('module' => $addDsMethod->item(0)->getAttribute('module') == '' ? 'islandora_repository' : $addDsMethod->item(0)->getAttribute('module'), $ret = array('module' => $addDsMethod->item(0)->getAttribute('module') == '' ? 'fedora_repository' : $addDsMethod->item(0)->getAttribute('module'),
'file' => $addDsMethod->item(0)->getAttribute('file'), 'file' => $addDsMethod->item(0)->getAttribute('file'),
'class' => $addDsMethod->item(0)->getAttribute('class'), 'class' => $addDsMethod->item(0)->getAttribute('class'),
'method' => $addDsMethod->item(0)->getAttribute('method'), 'method' => $addDsMethod->item(0)->getAttribute('method'),
@ -1936,7 +1936,7 @@ class ContentModel extends XMLDatastream {
$methods = $rule->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); $methods = $rule->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method');
$found = FALSE; $found = FALSE;
for ($i = 0; $found === FALSE && $i < $methods->length; $i++) { for ($i = 0; $found === FALSE && $i < $methods->length; $i++) {
if (($methods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $methods->item($i)->getAttribute('module')) == $module && if (($methods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($i)->getAttribute('module')) == $module &&
$methods->item($i)->getAttribute('file') == $file && $methods->item($i)->getAttribute('file') == $file &&
$methods->item($i)->getAttribute('class') == $class && $methods->item($i)->getAttribute('class') == $class &&
$methods->item($i)->getAttribute('method') == $method) { $methods->item($i)->getAttribute('method') == $method) {
@ -1989,7 +1989,7 @@ class ContentModel extends XMLDatastream {
$methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0);
$methods = $methodsEl->getElementsByTagName('ingest_method'); $methods = $methodsEl->getElementsByTagName('ingest_method');
for ($i = 0; !$found && $i < $methods->length; $i++) { for ($i = 0; !$found && $i < $methods->length; $i++) {
if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'islandora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'fedora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) {
$found = $methods->item($i); $found = $methods->item($i);
} }
} }
@ -2077,7 +2077,7 @@ class ContentModel extends XMLDatastream {
$methods = $rules->item($i)->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); $methods = $rules->item($i)->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method');
for ($j = 0; $j < $methods->length; $j++) { for ($j = 0; $j < $methods->length; $j++) {
$method = array('module' => $methods->item($j)->getAttribute('module') == '' ? 'islandora_repository' : $methods->item($j)->getAttribute('module'), $method = array('module' => $methods->item($j)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($j)->getAttribute('module'),
'file' => $methods->item($j)->getAttribute('file'), 'file' => $methods->item($j)->getAttribute('file'),
'class' => $methods->item($j)->getAttribute('class'), 'class' => $methods->item($j)->getAttribute('class'),
'method' => $methods->item($j)->getAttribute('method'), 'method' => $methods->item($j)->getAttribute('method'),
@ -2157,7 +2157,7 @@ class ContentModel extends XMLDatastream {
$ret = FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
$method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0);
$ret = array('module' => ($method->getAttribute('module') == '' ? 'islandora_repository' : $method->getAttribute('module')), $ret = array('module' => ($method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module')),
'file' => $method->getAttribute('file'), 'file' => $method->getAttribute('file'),
'class' => $method->getAttribute('class'), 'class' => $method->getAttribute('class'),
'method' => $method->getAttribute('method'), 'method' => $method->getAttribute('method'),

68
ObjectHelper.inc

@ -33,7 +33,7 @@ class ObjectHelper {
*/ */
function ObjectHelper() { function ObjectHelper() {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
$connectionHelper = new ConnectionHelper(); $connectionHelper = new ConnectionHelper();
//$this->fedoraUser = $connectionHelper->getUser(); //$this->fedoraUser = $connectionHelper->getUser();
//$this->fedoraPass = $connectionHelper->getPassword(); //$this->fedoraPass = $connectionHelper->getPassword();
@ -56,7 +56,7 @@ class ObjectHelper {
*/ */
function makeObject($pid, $dsID, $asAttachment = FALSE, $label = NULL, $filePath=FALSE, $version=NULL, $forceSoap = TRUE) { function makeObject($pid, $dsID, $asAttachment = FALSE, $label = NULL, $filePath=FALSE, $version=NULL, $forceSoap = TRUE) {
global $user; global $user;
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
if ($pid == NULL || $dsID == NULL) { if ($pid == NULL || $dsID == NULL) {
drupal_set_message(t("no pid or dsid given to create an object with"), 'error'); drupal_set_message(t("no pid or dsid given to create an object with"), 'error');
return ' '; return ' ';
@ -69,7 +69,7 @@ class ObjectHelper {
return ' '; return ' ';
} }
if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
drupal_set_message(t("You do not have access Fedora objects within the attempted namespace."), 'error'); drupal_set_message(t("You do not have access Fedora objects within the attempted namespace."), 'error');
drupal_access_denied(); drupal_access_denied();
return ' '; return ' ';
@ -91,7 +91,7 @@ class ObjectHelper {
} }
} }
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new Fedora_Item($pid); $item = new Fedora_Item($pid);
@ -176,7 +176,7 @@ class ObjectHelper {
* for the mimetype in question. * for the mimetype in question.
*/ */
if ($pos === FALSE) { if ($pos === FALSE) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
$mimeclass = new MimeClass(); $mimeclass = new MimeClass();
$ext = $mimeclass->get_extension($mimeType); $ext = $mimeclass->get_extension($mimeType);
$suggestedFileName = "$label.$ext"; $suggestedFileName = "$label.$ext";
@ -207,7 +207,7 @@ class ObjectHelper {
* @return type * @return type
*/ */
function getCollectionInfo($pid, $query = NULL) { function getCollectionInfo($pid, $query = NULL) {
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
$collectionClass = new CollectionClass(); $collectionClass = new CollectionClass();
$results = $collectionClass->getRelatedItems($pid, $query); $results = $collectionClass->getRelatedItems($pid, $query);
return $results; return $results;
@ -227,12 +227,12 @@ class ObjectHelper {
drupal_set_message(t('You must specify an object pid and datastream ID.'), 'error'); drupal_set_message(t('You must specify an object pid and datastream ID.'), 'error');
return ''; return '';
} }
if (!islandora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (!fedora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
drupal_set_message(t('You do not have the appropriate permissions'), 'error'); drupal_set_message(t('You do not have the appropriate permissions'), 'error');
return; return;
} }
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new fedora_item($pid); $item = new fedora_item($pid);
$datastream_list = $item->get_datastreams_list_as_SimpleXML(); $datastream_list = $item->get_datastreams_list_as_SimpleXML();
if (!isset($datastream_list)) { if (!isset($datastream_list)) {
@ -262,12 +262,12 @@ class ObjectHelper {
drupal_set_message(t('You must specify an object pid and datastream ID.'), 'error'); drupal_set_message(t('You must specify an object pid and datastream ID.'), 'error');
return ''; return '';
} }
if (!islandora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (!fedora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
drupal_set_message(t('You do not have the appropriate permissions'), 'error'); drupal_set_message(t('You do not have the appropriate permissions'), 'error');
return; return;
} }
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new fedora_item($pid); $item = new fedora_item($pid);
$datastream_list = $item->get_datastreams_list_as_SimpleXML(); $datastream_list = $item->get_datastreams_list_as_SimpleXML();
if (!isset($datastream_list)) { if (!isset($datastream_list)) {
@ -291,7 +291,7 @@ class ObjectHelper {
*/ */
function create_link_for_ds($pid, $dataStreamValue) { function create_link_for_ds($pid, $dataStreamValue) {
global $base_url; global $base_url;
$path = drupal_get_path('module', 'islandora_repository'); $path = drupal_get_path('module', 'fedora_repository');
require_once($path . '/api/fedora_item.inc'); require_once($path . '/api/fedora_item.inc');
$item = new Fedora_Item($pid); $item = new Fedora_Item($pid);
@ -359,8 +359,8 @@ class ObjectHelper {
*/ */
function getFormattedDC($item) { function getFormattedDC($item) {
global $base_url; global $base_url;
$path = drupal_get_path('module', 'islandora_repository'); $path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
$dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC'; $dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC';
$xmlstr = $item->get_datastream_dissemination($dsid); $xmlstr = $item->get_datastream_dissemination($dsid);
@ -408,7 +408,7 @@ class ObjectHelper {
$ds_list = $item->get_datastreams_list_as_array(); $ds_list = $item->get_datastreams_list_as_array();
$output = $this->getFormattedDC($item); $output = $this->getFormattedDC($item);
$dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC'; $dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC';
$path = drupal_get_path('module', 'islandora_repository'); $path = drupal_get_path('module', 'fedora_repository');
//$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1)); //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1));
if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) {
@ -440,12 +440,12 @@ class ObjectHelper {
*/ */
function get_formatted_datastream_list($object_pid, $contentModels, &$fedoraItem) { function get_formatted_datastream_list($object_pid, $contentModels, &$fedoraItem) {
global $fedoraUser, $fedoraPass, $base_url, $user; global $fedoraUser, $fedoraPass, $base_url, $user;
module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
$path = drupal_get_path('module', 'islandora_repository'); $path = drupal_get_path('module', 'fedora_repository');
$dataStreamBody = ''; $dataStreamBody = '';
$fedoraItem = new Fedora_Item($object_pid); $fedoraItem = new Fedora_Item($object_pid);
@ -514,7 +514,7 @@ class ObjectHelper {
* *
*/ */
function getStream($pid, $dsid, $showError = FALSE) { function getStream($pid, $dsid, $showError = FALSE) {
module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
$soapHelper = new ConnectionHelper(); $soapHelper = new ConnectionHelper();
try { try {
$client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'));
@ -548,7 +548,7 @@ class ObjectHelper {
* @return array * @return array
*/ */
function get_content_models_list($pid, $include_fedora_system_content_models = FALSE) { function get_content_models_list($pid, $include_fedora_system_content_models = FALSE) {
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
$collectionHelper = new CollectionClass(); $collectionHelper = new CollectionClass();
$pids = array(); $pids = array();
$query = 'select $object from <#ri> $query = 'select $object from <#ri>
@ -593,7 +593,7 @@ class ObjectHelper {
* @param type $pid * @param type $pid
* @return type * @return type
*/ */
function islandora_repository_access($op, $pid) { function fedora_repository_access($op, $pid) {
global $user; global $user;
$returnValue = FALSE; $returnValue = FALSE;
@ -602,7 +602,7 @@ class ObjectHelper {
$namespaceAccess = TRUE; $namespaceAccess = TRUE;
} }
if ($pid == NULL) { if ($pid == NULL) {
$pid = variable_get('islandora_repository_pid', 'islandora:root'); $pid = variable_get('fedora_repository_pid', 'islandora:root');
} }
$nameSpaceAllowed = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $nameSpaceAllowed = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: '));
$pos = NULL; $pos = NULL;
@ -632,7 +632,7 @@ class ObjectHelper {
* @param $content String * @param $content String
*/ */
function parseContent($content, $pid, $dsId, $collection, $pageNumber = NULL) { function parseContent($content, $pid, $dsId, $collection, $pageNumber = NULL) {
$path = drupal_get_path('module', 'islandora_repository'); $path = drupal_get_path('module', 'fedora_repository');
global $base_url; global $base_url;
$collection_pid = $pid; //we will be changing the pid later maybe $collection_pid = $pid; //we will be changing the pid later maybe
//module_load_include('php', ''Fedora_Repository'', 'ObjectHelper'); //module_load_include('php', ''Fedora_Repository'', 'ObjectHelper');
@ -790,7 +790,7 @@ class ObjectHelper {
return NULL; return NULL;
} }
$output = ''; $output = '';
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) { if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) {
$output .= $cm->displayExtraFieldset($pid, $page_number); $output .= $cm->displayExtraFieldset($pid, $page_number);
} }
@ -810,7 +810,7 @@ class ObjectHelper {
return FALSE; return FALSE;
} }
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
if ($dsid != NULL && $pid != NULL && ($cm = ContentModel::loadFromObject($pid)) !== FALSE) { if ($dsid != NULL && $pid != NULL && ($cm = ContentModel::loadFromObject($pid)) !== FALSE) {
$cm->execAddDatastreamMethods($dsid, $file); $cm->execAddDatastreamMethods($dsid, $file);
} }
@ -826,7 +826,7 @@ class ObjectHelper {
if (!$pid) { if (!$pid) {
return FALSE; return FALSE;
} }
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
// Get title and descriptions for $pid // Get title and descriptions for $pid
$query_string = 'select $title $desc from <#ri> $query_string = 'select $title $desc from <#ri>
@ -834,7 +834,7 @@ class ObjectHelper {
and $o <dc:description> $desc and $o <dc:description> $desc
and $o <mulgara:is> <info:fedora/' . $pid . '>'; and $o <mulgara:is> <info:fedora/' . $pid . '>';
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query=";
$content = do_curl($url . htmlentities(urlencode($query_string))); $content = do_curl($url . htmlentities(urlencode($query_string)));
@ -868,7 +868,7 @@ class ObjectHelper {
} }
$query_string = substr($query_string, 0, -3) . ' )'; $query_string = substr($query_string, 0, -3) . ' )';
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query=";
$url .= htmlentities(urlencode($query_string)); $url .= htmlentities(urlencode($query_string));
$content = $this->doCurl($url); $content = $this->doCurl($url);
@ -905,7 +905,7 @@ class ObjectHelper {
* @return type * @return type
*/ */
function getObject($pid, $context = 'archive', $format = FOXML_11) { function getObject($pid, $context = 'archive', $format = FOXML_11) {
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/objects/' . $pid . '/export?context=' . $context . '&format=' . $format; $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/objects/' . $pid . '/export?context=' . $context . '&format=' . $format;
$result_data = do_curl($url); $result_data = do_curl($url);
@ -921,10 +921,10 @@ class ObjectHelper {
* @param type $level * @param type $level
*/ */
function getBreadcrumbs($pid, &$breadcrumbs, $level=10) { function getBreadcrumbs($pid, &$breadcrumbs, $level=10) {
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
// Before executing the query, we hve a base case of accessing the top-level collection // Before executing the query, we hve a base case of accessing the top-level collection
global $base_url; global $base_url;
if ($pid == variable_get('islandora_repository_pid', 'islandora:root')) { if ($pid == variable_get('fedora_repository_pid', 'islandora:root')) {
$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository');
$breadcrumbs[] = l(t('Home'), $base_url); $breadcrumbs[] = l(t('Home'), $base_url);
} }
@ -940,7 +940,7 @@ class ObjectHelper {
order by $title'; order by $title';
$query_string = htmlentities(urlencode($query_string)); $query_string = htmlentities(urlencode($query_string));
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string;
$result = preg_split('/[\r\n]+/', do_curl($url)); $result = preg_split('/[\r\n]+/', do_curl($url));
@ -950,7 +950,7 @@ class ObjectHelper {
$parent = preg_replace('/^info:fedora\//', '', $matches[0]); $parent = preg_replace('/^info:fedora\//', '', $matches[0]);
$breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid);
if ($parent == variable_get('islandora_repository_pid', 'islandora:root')) { if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) {
$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository');
$breadcrumbs[] = l(t('Home'), $base_url); $breadcrumbs[] = l(t('Home'), $base_url);
} }

30
SearchClass.inc

@ -25,14 +25,14 @@ class SearchClass {
function solr_search($query, $startPage=1, $fq = NULL, $dismax = NULL) { function solr_search($query, $startPage=1, $fq = NULL, $dismax = NULL) {
$solrFile = trim(variable_get('islandora_solr_search_block_handler_file', 'plugins/SolrResults.inc')); $solrFile = trim(variable_get('islandora_solr_search_block_handler_file', 'plugins/SolrResults.inc'));
// Don't let us bust out of islandora_repository modules directory when looking for a handler // Don't let us bust out of fedora_repository modules directory when looking for a handler
if (strpos($solrField, '../')) { if (strpos($solrField, '../')) {
drupal_set_message(t('You have illegal characters in your solr handler function in the Islandora solr block config.'), 'error'); drupal_set_message(t('You have illegal characters in your solr handler function in the Islandora solr block config.'), 'error');
} }
$solrClass = trim(variable_get('islandora_solr_search_block_handler_class', 'SolrResults')); $solrClass = trim(variable_get('islandora_solr_search_block_handler_class', 'SolrResults'));
$solrFunction = trim(variable_get('islandora_solr_search_block_handler_function', 'SearchAndDisplay')); $solrFunction = trim(variable_get('islandora_solr_search_block_handler_function', 'SearchAndDisplay'));
require_once(drupal_get_path('module', 'islandora_repository') . '/' . $solrFile); require_once(drupal_get_path('module', 'fedora_repository') . '/' . $solrFile);
try { try {
$implementation = new $solrClass(); $implementation = new $solrClass();
} catch (Exception $e) { } catch (Exception $e) {
@ -185,8 +185,8 @@ class SearchClass {
* @return type * @return type
*/ */
function quickSearch($type, $query, $showForm = 1, $orderBy = 0, & $userArray) { function quickSearch($type, $query, $showForm = 1, $orderBy = 0, & $userArray) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
if (user_access('view fedora collection')) { if (user_access('view fedora collection')) {
$numberOfHistPerPage = '5000'; //hack for IR they do not want next button $numberOfHistPerPage = '5000'; //hack for IR they do not want next button
$luceneQuery = NULL; $luceneQuery = NULL;
@ -222,7 +222,7 @@ class SearchClass {
} }
} }
if ($showForm) { if ($showForm) {
$output = '<Strong>Quick Search</strong><br /><table class="table-form"><tr>' . drupal_get_form('islandora_repository_quick_search_form') . '</tr></table>'; $output = '<Strong>Quick Search</strong><br /><table class="table-form"><tr>' . drupal_get_form('fedora_repository_quick_search_form') . '</tr></table>';
} }
$output .= $this->applyXSLT($resultData, $orderBy); $output .= $this->applyXSLT($resultData, $orderBy);
return $output; return $output;
@ -237,8 +237,8 @@ class SearchClass {
* @return type * @return type
*/ */
function getTerms($fieldName, $startTerm, $displayName = NULL) { function getTerms($fieldName, $startTerm, $displayName = NULL) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$indexName = variable_get('fedora_index_name', 'DemoOnLucene'); $indexName = variable_get('fedora_index_name', 'DemoOnLucene');
$searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest');
if ($startTerm == NULL) { if ($startTerm == NULL) {
@ -269,8 +269,8 @@ class SearchClass {
* @return type * @return type
*/ */
function custom_search($query, $startPage=1, $xslt= '/xsl/advanced_search_results.xsl', $numberOfHistPerPage = 50) { function custom_search($query, $startPage=1, $xslt= '/xsl/advanced_search_results.xsl', $numberOfHistPerPage = 50) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
if (user_access('view fedora collection')) { if (user_access('view fedora collection')) {
//$numberOfHistPerPage = '50';//hack for IR they do not want next button //$numberOfHistPerPage = '50';//hack for IR they do not want next button
@ -322,7 +322,7 @@ class SearchClass {
return ' '; return ' ';
} }
//$proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl //$proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl
$proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'objectsPage', base_path());
$proc->setParameter('', 'userID', $user->uid); $proc->setParameter('', 'userID', $user->uid);
if (isset($displayName)) { if (isset($displayName)) {
@ -390,8 +390,8 @@ class SearchClass {
//inject into xsl stylesheet //inject into xsl stylesheet
global $user; global $user;
$proc->setParameter('', 'userID', $user->uid); $proc->setParameter('', 'userID', $user->uid);
$proc->setParameter('', 'searchToken', drupal_get_token('islandora_repository_advanced_search')); //token generated by Drupal, keeps tack of what tab etc we are on $proc->setParameter('', 'searchToken', drupal_get_token('fedora_repository_advanced_search')); //token generated by Drupal, keeps tack of what tab etc we are on
$proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl
$proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'objectsPage', base_path());
$proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: '));
$proc->setParameter('', 'hitPageStart', $startPage); $proc->setParameter('', 'hitPageStart', $startPage);
@ -441,7 +441,7 @@ class SearchClass {
//inject into xsl stylesheet //inject into xsl stylesheet
//$proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on //$proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on
$proc->setParameter('', 'userID', $user->uid); $proc->setParameter('', 'userID', $user->uid);
$proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl
$proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'objectsPage', base_path());
$proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: '));
$proc->setParameter('', 'orderBy', $orderBy); $proc->setParameter('', 'orderBy', $orderBy);
@ -475,7 +475,7 @@ class SearchClass {
*/ */
function theme_advanced_search_form($form, $repeat=NULL) { function theme_advanced_search_form($form, $repeat=NULL) {
if (!isset($repeat)) { if (!isset($repeat)) {
$repeat = variable_get('islandora_repository_advanced_block_repeat', t('3')); $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3'));
} }
$output = drupal_render($form['search_type']['type1']); $output = drupal_render($form['search_type']['type1']);
@ -515,7 +515,7 @@ class SearchClass {
$form = array(); $form = array();
if (!isset($repeat)) { if (!isset($repeat)) {
$repeat = variable_get('islandora_repository_advanced_block_repeat', t('3')); $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3'));
} }
$var0 = explode(':', $queryArray[0]); $var0 = explode(':', $queryArray[0]);
$var1 = explode(':', $queryArray[1]); $var1 = explode(':', $queryArray[1]);

2
SecurityClass.inc

@ -30,7 +30,7 @@ class SecurityClass {
*/ */
function canIngestHere($collection_pid) { function canIngestHere($collection_pid) {
global $user; global $user;
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
// get the childsecurity policy from the collection. // get the childsecurity policy from the collection.
$policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS :: $SECURITY_CLASS_SECURITY_STREAM, FALSE); $policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS :: $SECURITY_CLASS_SECURITY_STREAM, FALSE);

8
XMLDatastream.inc

@ -168,7 +168,7 @@ abstract class XMLDatastream {
//$tmpname = substr($this->pid, strpos($this->pid, ':') + 1); //$tmpname = substr($this->pid, strpos($this->pid, ':') + 1);
$tmpname = user_password(10); $tmpname = user_password(10);
$this->convertFromOldSchema(); $this->convertFromOldSchema();
drupal_add_js("islandora_repository_print_new_schema_$tmpname = function(tagID) { drupal_add_js("fedora_repository_print_new_schema_$tmpname = function(tagID) {
var target = document.getElementById(tagID); var target = document.getElementById(tagID);
var content = target.innerHTML; var content = target.innerHTML;
var text = '<html><head><title>Title' + var text = '<html><head><title>Title' +
@ -179,7 +179,7 @@ abstract class XMLDatastream {
}", 'inline'); }", 'inline');
if (user_access('administer site configuration')) { if (user_access('administer site configuration')) {
drupal_set_message('<span id="new_schema_' . $tmpname . '" style="display: none;">' . htmlentities($this->xml->saveXML()) . '</span>Warning: XMLDatastream performed conversion of \'' . $this->getIdentifier() . '\' from old schema. Please update the datastream. The new datastream contents are <a href="javascript:islandora_repository_print_new_schema_' . $tmpname . '(\'new_schema_' . $tmpname . '\')">here.</a> '); drupal_set_message('<span id="new_schema_' . $tmpname . '" style="display: none;">' . htmlentities($this->xml->saveXML()) . '</span>Warning: XMLDatastream performed conversion of \'' . $this->getIdentifier() . '\' from old schema. Please update the datastream. The new datastream contents are <a href="javascript:fedora_repository_print_new_schema_' . $tmpname . '(\'new_schema_' . $tmpname . '\')">here.</a> ');
} }
$rootEl = $this->xml->firstChild; $rootEl = $this->xml->firstChild;
@ -246,7 +246,7 @@ abstract class XMLDatastream {
* @return boolean $valid * @return boolean $valid
*/ */
public function purgeVersions($start_date, $end_date = NULL) { public function purgeVersions($start_date, $end_date = NULL) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$fedora_item = new Fedora_Item($this->pid); $fedora_item = new Fedora_Item($this->pid);
return $fedora_item->purge_datastream($this->dsid, $start_date, $end_date); return $fedora_item->purge_datastream($this->dsid, $start_date, $end_date);
} }
@ -258,7 +258,7 @@ abstract class XMLDatastream {
* @return string[] $ret * @return string[] $ret
*/ */
public function getHistory() { public function getHistory() {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$fedora_item = new Fedora_Item($this->pid); $fedora_item = new Fedora_Item($this->pid);
$history = $fedora_item->get_datastream_history($this->dsid); $history = $fedora_item->get_datastream_history($this->dsid);

14
api/fedora_collection.inc

@ -4,10 +4,10 @@
* @file * @file
* Operations that affect a Fedora repository at a collection level. * Operations that affect a Fedora repository at a collection level.
*/ */
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('module', 'islandora_repository'); module_load_include('module', 'fedora_repository');
/** /**
* Exports a fedora collection object and all of its children in a format * Exports a fedora collection object and all of its children in a format
@ -68,10 +68,10 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio
* @param <type> $query_format R * @param <type> $query_format R
*/ */
function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
global $user; global $user;
if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error');
return array(); return array();
} }
@ -111,7 +111,7 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb
$content = ''; $content = '';
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string;
$content .= do_curl($url); $content .= do_curl($url);

4
api/fedora_export.inc

@ -41,7 +41,7 @@ function export_to_export_area($pid, $foxml_dir, $ob_dir, &$log = array()) {
* @return string * @return string
*/ */
function export_objects_for_pid($pid, $dir, &$log) { function export_objects_for_pid($pid, $dir, &$log) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new Fedora_Item($pid); $item = new Fedora_Item($pid);
if (!$object = $item->get_datastreams_list_as_SimpleXML($pid)) { if (!$object = $item->get_datastreams_list_as_SimpleXML($pid)) {
$log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error'); $log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error');
@ -85,7 +85,7 @@ function export_objects_for_pid($pid, $dir, &$log) {
* @return type * @return type
*/ */
function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $remove_islandora = FALSE) { function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $remove_islandora = FALSE) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$ob_helper = new ObjectHelper(); $ob_helper = new ObjectHelper();
if (!$object_xml = $ob_helper->getObject($pid, 'migrate', $format)) { if (!$object_xml = $ob_helper->getObject($pid, 'migrate', $format)) {
$log[] = log_line(t("Failed to get foxml for %pid", array('%pid' => $pid)), 'error'); $log[] = log_line(t("Failed to get foxml for %pid", array('%pid' => $pid)), 'error');

10
api/fedora_item.inc

@ -28,8 +28,8 @@ class Fedora_Item {
*/ */
function __construct($pid) { function __construct($pid) {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$this->pid = $pid; $this->pid = $pid;
if (isset(Fedora_Item::$instantiated_pids[$pid])) { if (isset(Fedora_Item::$instantiated_pids[$pid])) {
@ -75,7 +75,7 @@ class Fedora_Item {
* @return type * @return type
*/ */
function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
if (!is_file($datastream_file)) { if (!is_file($datastream_file)) {
drupal_set_message("$datastream_file not found<br />", 'warning'); drupal_set_message("$datastream_file not found<br />", 'warning');
return; return;
@ -285,7 +285,7 @@ class Fedora_Item {
* @return Array of pid => title pairs that match the results * @return Array of pid => title pairs that match the results
*/ */
static function find_objects_by_pattern($pattern = '*', $field = 'pid', $max_results = 100, $resultFields = array()) { static function find_objects_by_pattern($pattern = '*', $field = 'pid', $max_results = 100, $resultFields = array()) {
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$pattern = drupal_urlencode($pattern); $pattern = drupal_urlencode($pattern);
$done = FALSE; $done = FALSE;
@ -848,7 +848,7 @@ class Fedora_Item {
*/ */
static function soap_call($function_name, $params_array, $quiet = FALSE) { static function soap_call($function_name, $params_array, $quiet = FALSE) {
if (!self::$connection_helper) { if (!self::$connection_helper) {
module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
self::$connection_helper = new ConnectionHelper(); self::$connection_helper = new ConnectionHelper();
} }
switch ($function_name) { switch ($function_name) {

12
api/fedora_utils.inc

@ -158,7 +158,7 @@ function fedora_available() {
*/ */
function risearch_available() { function risearch_available() {
$response = do_curl_ext(variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch')); $response = do_curl_ext(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'));
return ($response != NULL) ? ($response[1] == 0): FALSE; return ($response != NULL) ? ($response[1] == 0): FALSE;
} }
@ -238,13 +238,13 @@ function fix_dsid($dsid) {
* @return array * @return array
*/ */
function get_collections_as_option_array() { function get_collections_as_option_array() {
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$query = 'select $object $title from <#ri> $query = 'select $object $title from <#ri>
where ($object <dc:title> $title where ($object <dc:title> $title
and $object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/islandora:collectionCModel> and $object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/islandora:collectionCModel>
and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
order by $title'; order by $title';
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query=";
$content = do_curl($url . htmlentities(urlencode($query))); $content = do_curl($url . htmlentities(urlencode($query)));
$list = explode("\n", $content); $list = explode("\n", $content);
@ -269,8 +269,8 @@ function get_collections_as_option_array() {
* @return array * @return array
*/ */
function get_content_models_as_option_array() { function get_content_models_as_option_array() {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$restricted = variable_get('fedora_namespace_restriction_enforced', true); $restricted = variable_get('fedora_namespace_restriction_enforced', true);
$allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:');
$namespaces = explode(':', $allowed_string); $namespaces = explode(':', $allowed_string);
@ -286,7 +286,7 @@ function get_content_models_as_option_array() {
and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
order by $title'; order by $title';
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query=";
$content = do_curl($url . htmlentities(urlencode($query))); $content = do_curl($url . htmlentities(urlencode($query)));
$list = explode("\n", $content); $list = explode("\n", $content);

0
islandora_repository.info → fedora_repository.info

8
islandora_repository.install → fedora_repository.install

@ -1,7 +1,7 @@
<?php <?php
/** /**
* @file islandora_repository.install * @file fedora_repository.install
*/ */
/** /**
@ -33,7 +33,7 @@ function fedora_collections_enable() {
* @see _update_message_text() * @see _update_message_text()
* @see _update_cron_notify() * @see _update_cron_notify()
*/ */
function islandora_repository_requirements($phase) { function fedora_repository_requirements($phase) {
global $base_url; global $base_url;
$requirements = array(); $requirements = array();
@ -89,13 +89,13 @@ function islandora_repository_requirements($phase) {
} }
} }
elseif ($phase == 'runtime') { elseif ($phase == 'runtime') {
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$requirements['fedora-repository']['title'] = t("Fedora server"); $requirements['fedora-repository']['title'] = t("Fedora server");
if (!fedora_available()) { if (!fedora_available()) {
$requirements['fedora-repository']['value'] = t("Not available"); $requirements['fedora-repository']['value'] = t("Not available");
$requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; $requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR;
$requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/islandora_repository')); $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository'));
} }
else { else {
$requirements['fedora-repository']['value'] = t("Available"); $requirements['fedora-repository']['value'] = t("Available");

388
islandora_repository.module → fedora_repository.module

File diff suppressed because it is too large Load Diff

20
islandora_repository.solutionpacks.inc → fedora_repository.solutionpacks.inc

@ -20,7 +20,7 @@
* *
* Datastreams which don't have this element are assumed to be at version 0. * Datastreams which don't have this element are assumed to be at version 0.
*/ */
function islandora_repository_solution_packs_page() { function fedora_repository_solution_packs_page() {
$enabled_solution_packs = module_invoke_all('required_fedora_objects'); $enabled_solution_packs = module_invoke_all('required_fedora_objects');
$output = ''; $output = '';
foreach ($enabled_solution_packs as $solution_pack_module => $solution_pack_info) { foreach ($enabled_solution_packs as $solution_pack_module => $solution_pack_info) {
@ -35,7 +35,7 @@ function islandora_repository_solution_packs_page() {
break; break;
} }
} }
$output .= drupal_get_form('islandora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects); $output .= drupal_get_form('fedora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects);
} }
return $output; return $output;
@ -45,9 +45,9 @@ function islandora_repository_solution_packs_page() {
* Check for installed objects and add a 'Update' or 'Install' button if some objects are missing. * Check for installed objects and add a 'Update' or 'Install' button if some objects are missing.
* @param array $solution_pack * @param array $solution_pack
*/ */
function islandora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { function fedora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) {
// Check each object to see if it is in the repository. // Check each object to see if it is in the repository.
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
global $base_path; global $base_path;
$needs_update = FALSE; $needs_update = FALSE;
$needs_install = FALSE; $needs_install = FALSE;
@ -111,8 +111,8 @@ function islandora_repository_solution_pack_form(&$form_state, $solution_pack_mo
} }
if (isset($ds['dsversion'])) { if (isset($ds['dsversion'])) {
// Check if the datastream is versioned and needs updating. // Check if the datastream is versioned and needs updating.
$installed_version = islandora_repository_get_islandora_datastream_version($item, $ds['dsid']); $installed_version = fedora_repository_get_islandora_datastream_version($item, $ds['dsid']);
$available_version = islandora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); $available_version = fedora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']);
if ($available_version > $installed_version) { if ($available_version > $installed_version) {
$needs_update = TRUE; $needs_update = TRUE;
$object_status = 'Out of date'; $object_status = 'Out of date';
@ -151,25 +151,25 @@ function islandora_repository_solution_pack_form(&$form_state, $solution_pack_mo
); );
$form['#submit'] = array( $form['#submit'] = array(
'islandora_repository_solution_pack_form_submit', 'fedora_repository_solution_pack_form_submit',
); );
return $form; return $form;
} }
function islandora_repository_solution_pack_form_submit($form, &$form_state) { function fedora_repository_solution_pack_form_submit($form, &$form_state) {
$what = $form_state; $what = $form_state;
$module_name = $form_state['values']['solution_pack_module']; $module_name = $form_state['values']['solution_pack_module'];
$solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); $solution_pack_info = call_user_func($module_name . '_required_fedora_objects');
$batch = array( $batch = array(
'title' => t('Installing / updating solution pack objects'), 'title' => t('Installing / updating solution pack objects'),
'file' => drupal_get_path('module', 'islandora_repository') . '/islandora_repository.module', 'file' => drupal_get_path('module', 'fedora_repository') . '/fedora_repository.module',
'operations' => array(), 'operations' => array(),
); );
foreach ($solution_pack_info[$module_name]['objects'] as $object) { foreach ($solution_pack_info[$module_name]['objects'] as $object) {
// Add this object to the batch job queue. // Add this object to the batch job queue.
$batch['operations'][] = array('islandora_repository_batch_reingest_object', array($object)); $batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object));
} }
batch_set($batch); batch_set($batch);
} }

78
formClass.inc

@ -24,15 +24,15 @@ class formClass {
function createMenu() { function createMenu() {
$items = array(); $items = array();
$items['admin/settings/islandora_repository'] = array( $items['admin/settings/fedora_repository'] = array(
'title' => t('Islandora Configure'), 'title' => t('Islandora Configure'),
'description' => t('Enter the Islandora Collection information here'), 'description' => t('Enter the Islandora Collection information here'),
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('islandora_repository_admin'), 'page arguments' => array('fedora_repository_admin'),
'access arguments' => array('administer site configuration'), 'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
); );
$items['admin/settings/islandora_repository/collection'] = array( $items['admin/settings/fedora_repository/collection'] = array(
'title' => t('Collection list'), 'title' => t('Collection list'),
'description' => t('Enter the Islandora collection information here.'), 'description' => t('Enter the Islandora collection information here.'),
'access arguments' => array('administer site configuration'), 'access arguments' => array('administer site configuration'),
@ -40,18 +40,18 @@ class formClass {
'weight' => 0, 'weight' => 0,
); );
$items['admin/settings/islandora_repository/demoobjects'] = array( $items['admin/settings/fedora_repository/demoobjects'] = array(
'title' => t('Solution Packs'), 'title' => t('Solution Packs'),
'description' => t('Install content models and collections required by installed solution packs.'), 'description' => t('Install content models and collections required by installed solution packs.'),
'page callback' => 'islandora_repository_solution_packs_page', 'page callback' => 'fedora_repository_solution_packs_page',
'access arguments' => array('add fedora datastreams'), 'access arguments' => array('add fedora datastreams'),
'file' => 'islandora_repository.solutionpacks.inc', 'file' => 'fedora_repository.solutionpacks.inc',
'type' => MENU_LOCAL_TASK, 'type' => MENU_LOCAL_TASK,
); );
$items['islandoracm.xsd'] = array( $items['islandoracm.xsd'] = array(
'title' => t('Islandora Content Model XML Schema Definition'), 'title' => t('Islandora Content Model XML Schema Definition'),
'page callback' => 'islandora_repository_display_schema', 'page callback' => 'fedora_repository_display_schema',
'page arguments' => array('islandoracm.xsd'), 'page arguments' => array('islandoracm.xsd'),
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection'), 'access arguments' => array('view fedora collection'),
@ -59,7 +59,7 @@ class formClass {
$items['collection_policy.xsd'] = array( $items['collection_policy.xsd'] = array(
'title' => t('Islandora Content Model XML Schema Definition'), 'title' => t('Islandora Content Model XML Schema Definition'),
'page callback' => 'islandora_repository_display_schema', 'page callback' => 'fedora_repository_display_schema',
'page arguments' => array('collection_policy.xsd'), 'page arguments' => array('collection_policy.xsd'),
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection'), 'access arguments' => array('view fedora collection'),
@ -70,7 +70,7 @@ class formClass {
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection'), 'access arguments' => array('view fedora collection'),
); );
$repository_title = variable_get('islandora_repository_title', 'Digital repository'); $repository_title = variable_get('fedora_repository_title', 'Digital repository');
if (trim($repository_title) != '') { if (trim($repository_title) != '') {
$respository_title = t($repository_title); $respository_title = t($repository_title);
} }
@ -100,7 +100,7 @@ class formClass {
$items['fedora/repository/editmetadata'] = array( $items['fedora/repository/editmetadata'] = array(
'title' => t('Edit metadata'), 'title' => t('Edit metadata'),
'page callback' => 'islandora_repository_edit_qdc_page', 'page callback' => 'fedora_repository_edit_qdc_page',
// 'page arguments' => array(1), // 'page arguments' => array(1),
//'type' => MENU_LOCAL_TASK, //'type' => MENU_LOCAL_TASK,
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
@ -109,21 +109,21 @@ class formClass {
$items['fedora/repository/purgeStream'] = array( $items['fedora/repository/purgeStream'] = array(
'title' => t('Purge data stream'), 'title' => t('Purge data stream'),
'page callback' => 'islandora_repository_purge_stream', 'page callback' => 'fedora_repository_purge_stream',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('purge objects and datastreams') 'access arguments' => array('purge objects and datastreams')
); );
$items['fedora/repository/replaceStream'] = array( $items['fedora/repository/replaceStream'] = array(
'title' => t('Replace Stream'), 'title' => t('Replace Stream'),
'page callback' => 'islandora_repository_replace_stream', 'page callback' => 'fedora_repository_replace_stream',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('add fedora datastreams'), 'access arguments' => array('add fedora datastreams'),
); );
$items['fedora/repository/purgeObject'] = array( $items['fedora/repository/purgeObject'] = array(
'title' => t('Purge object'), 'title' => t('Purge object'),
'page callback' => 'islandora_repository_purge_object', 'page callback' => 'fedora_repository_purge_object',
// 'type' => MENU_LOCAL_TASK, // 'type' => MENU_LOCAL_TASK,
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('purge objects and datastreams') 'access arguments' => array('purge objects and datastreams')
@ -147,21 +147,21 @@ class formClass {
//new for mnpl****************************************** //new for mnpl******************************************
$items['fedora/repository/mnpl_advanced_search'] = array( $items['fedora/repository/mnpl_advanced_search'] = array(
'title' => t('Repository advanced search'), 'title' => t('Repository advanced search'),
'page callback' => 'islandora_repository_mnpl_advanced_search', 'page callback' => 'fedora_repository_mnpl_advanced_search',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection') 'access arguments' => array('view fedora collection')
); );
$items['fedora/ingestObject'] = array( $items['fedora/ingestObject'] = array(
'title' => t('Ingest object'), 'title' => t('Ingest object'),
'page callback' => 'islandora_repository_ingest_object', 'page callback' => 'fedora_repository_ingest_object',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('add fedora datastreams') 'access arguments' => array('add fedora datastreams')
); );
$items['fedora/repository/list_terms'] = array( $items['fedora/repository/list_terms'] = array(
'title' => t('List terms'), 'title' => t('List terms'),
'page callback' => 'islandora_repository_list_terms', 'page callback' => 'fedora_repository_list_terms',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection') 'access arguments' => array('view fedora collection')
); );
@ -170,25 +170,25 @@ class formClass {
$items['fedora/basket'] = array( $items['fedora/basket'] = array(
'title' => t('Fedora Basket'), 'title' => t('Fedora Basket'),
'description' => t('View and download objects added to your basket'), 'description' => t('View and download objects added to your basket'),
'page callback' => 'islandora_repository_basket', 'page callback' => 'fedora_repository_basket',
'access arguments' => array('view fedora collection'), 'access arguments' => array('view fedora collection'),
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
); );
$items['fedora/repository/addToBasket'] = array( $items['fedora/repository/addToBasket'] = array(
'page callback' => 'islandora_repository_add_to_basket', 'page callback' => 'fedora_repository_add_to_basket',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection'), 'access arguments' => array('view fedora collection'),
); );
$items['fedora/repository/removeFromBasket'] = array( $items['fedora/repository/removeFromBasket'] = array(
'page callback' => 'islandora_repository_remove_from_basket', 'page callback' => 'fedora_repository_remove_from_basket',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection'), 'access arguments' => array('view fedora collection'),
); );
$items['fedora/repository/add_search_results_to_basket'] = array( $items['fedora/repository/add_search_results_to_basket'] = array(
'page callback' => 'islandora_repository_add_search_results_to_basket', 'page callback' => 'fedora_repository_add_search_results_to_basket',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection'), 'access arguments' => array('view fedora collection'),
); );
@ -205,21 +205,21 @@ class formClass {
drupal_set_message(t('You must be a site administrator to edit the Fedora collecitons list.'), 'error'); drupal_set_message(t('You must be a site administrator to edit the Fedora collecitons list.'), 'error');
return; return;
} }
module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$form = array(); $form = array();
$form['islandora_repository_name'] = array( $form['fedora_repository_name'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Root Collection Name'), '#title' => t('Root Collection Name'),
'#default_value' => variable_get('islandora_repository_name', 'Islandora demos collection'), '#default_value' => variable_get('fedora_repository_name', 'Islandora demos collection'),
'#description' => t('The Name of the Root Collection Object'), '#description' => t('The Name of the Root Collection Object'),
'#required' => TRUE, '#required' => TRUE,
'#weight' => -20 '#weight' => -20
); );
$form['islandora_repository_pid'] = array( $form['fedora_repository_pid'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Root Collection PID'), '#title' => t('Root Collection PID'),
'#default_value' => variable_get('islandora_repository_pid', 'islandora:root'), '#default_value' => variable_get('fedora_repository_pid', 'islandora:root'),
'#description' => t('The PID of the Root Collection Object'), '#description' => t('The PID of the Root Collection Object'),
'#required' => TRUE, '#required' => TRUE,
'#weight' => -18 '#weight' => -18
@ -235,10 +235,10 @@ class formClass {
); );
$form['islandora_repository_url'] = array( $form['fedora_repository_url'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Fedora RISearch URL'), '#title' => t('Fedora RISearch URL'),
'#default_value' => variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'), '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'),
'#description' => t('The url of the Fedora server'), '#required' => TRUE, '#description' => t('The url of the Fedora server'), '#required' => TRUE,
'#weight' => -14 '#weight' => -14
); );
@ -296,10 +296,10 @@ class formClass {
'#weight' => 0 '#weight' => 0
); );
} }
$form['islandora_repository_title'] = array( $form['fedora_repository_title'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Digital Repository Title'), '#title' => t('Digital Repository Title'),
'#default_value' => variable_get('islandora_repository_title', 'Digital Repository'), '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'),
'#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'),
); );
$form['advanced'] = array( $form['advanced'] = array(
@ -432,7 +432,7 @@ class formClass {
* @return type * @return type
*/ */
function can_ingest_here($collection_pid) { function can_ingest_here($collection_pid) {
module_load_include('inc', 'islandora_repository', 'SecurityClass'); module_load_include('inc', 'fedora_repository', 'SecurityClass');
$securityClass = new SecurityClass(); $securityClass = new SecurityClass();
return $securityClass->canIngestHere($collection_pid); return $securityClass->canIngestHere($collection_pid);
} }
@ -447,7 +447,7 @@ class formClass {
drupal_set_message(t('You do not have permission to ingest.'), 'error'); drupal_set_message(t('You do not have permission to ingest.'), 'error');
return FALSE; return FALSE;
} }
module_load_include('inc', 'islandora_repository', 'SecurityClass'); module_load_include('inc', 'fedora_repository', 'SecurityClass');
$security_class = new SecurityClass(); $security_class = new SecurityClass();
if (!$security_class->canIngestHere($collection_pid)) { if (!$security_class->canIngestHere($collection_pid)) {
// Queries the collection object for a child security datastream and if found parses it // Queries the collection object for a child security datastream and if found parses it
@ -507,7 +507,7 @@ class formClass {
), ),
'submit' => array( 'submit' => array(
'#type' => 'submit', '#type' => 'submit',
'#submit' => array('islandora_repository_ingest_form_submit'), '#submit' => array('fedora_repository_ingest_form_submit'),
'#value' => t('Next') '#value' => t('Next')
), ),
); );
@ -523,7 +523,7 @@ class formClass {
* @return array * @return array
*/ */
function createQDCIngestFormPageTwo($collection_pid, $collection_label, array &$form_state) { function createQDCIngestFormPageTwo($collection_pid, $collection_label, array &$form_state) {
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
$form = array(); $form = array();
$content_model_pid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $content_model_pid = ContentModel::getPidFromIdentifier($form_state['values']['models']);
$content_model_dsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); $content_model_dsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']);
@ -541,7 +541,7 @@ class formClass {
); );
$form['submit'] = array( $form['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
'#submit' => array('islandora_repository_ingest_form_submit'), '#submit' => array('fedora_repository_ingest_form_submit'),
'#value' => t('Ingest') '#value' => t('Ingest')
); );
} }
@ -558,7 +558,7 @@ class formClass {
* @return array * @return array
*/ */
function createQDCIngestForm($collection_pid, $collection_label, array &$form_state) { function createQDCIngestForm($collection_pid, $collection_label, array &$form_state) {
module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
$form_state['storage']['step'] = empty($form_state['storage']['step']) ? 1 : $form_state['storage']['step']; $form_state['storage']['step'] = empty($form_state['storage']['step']) ? 1 : $form_state['storage']['step'];
if ($form_state['storage']['step'] == 1) { if ($form_state['storage']['step'] == 1) {
return $this->createQDCIngestFormPageOne($collection_pid, $collection_label, $form_state); return $this->createQDCIngestFormPageOne($collection_pid, $collection_label, $form_state);
@ -603,9 +603,9 @@ class formClass {
//dump_vars($form_state); //dump_vars($form_state);
// Populate the list of datastream IDs. // Populate the list of datastream IDs.
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$obj_helper = new ObjectHelper(); $obj_helper = new ObjectHelper();
$content_models = $obj_helper->get_content_models_list($pid); $content_models = $obj_helper->get_content_models_list($pid);

10
islandoracm.xsd

@ -48,14 +48,14 @@
</xsd:complexType> </xsd:complexType>
<xsd:complexType name="form_builder_methodType"> <xsd:complexType name="form_builder_methodType">
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="handler" type="xsd:normalizedString" use="required"/> <xsd:attribute name="handler" type="xsd:normalizedString" use="required"/>
</xsd:complexType> </xsd:complexType>
<xsd:complexType name="edit_metadata_methodType"> <xsd:complexType name="edit_metadata_methodType">
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="handler" type="xsd:normalizedString" use="required"/> <xsd:attribute name="handler" type="xsd:normalizedString" use="required"/>
@ -118,7 +118,7 @@
</xsd:all> </xsd:all>
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/> <xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/>
@ -149,7 +149,7 @@
<xsd:element name="parameters" type="parametersType" minOccurs="0"/> <xsd:element name="parameters" type="parametersType" minOccurs="0"/>
</xsd:all> </xsd:all>
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/> <xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/>
@ -171,7 +171,7 @@
<xsd:complexContent> <xsd:complexContent>
<xsd:restriction base="xsd:anyType"> <xsd:restriction base="xsd:anyType">
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="default" type="xsd:boolean" default="false"/> <xsd:attribute name="default" type="xsd:boolean" default="false"/>

4
plugins/CollectionFormBuilder.inc

@ -7,7 +7,7 @@
* Collection Form Builder * Collection Form Builder
*/ */
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/** /**
* implements methods from content model ingest form xml * implements methods from content model ingest form xml
@ -32,7 +32,7 @@ class CollectionFormBuilder extends FormBuilder {
* @param type $rootElement * @param type $rootElement
*/ */
function createFedoraDataStreams($form_values, &$dom, &$rootElement) { function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
global $base_url; global $base_url;
$mimetype = new MimeClass(); $mimetype = new MimeClass();

8
plugins/DarwinCore.inc

@ -21,7 +21,7 @@ class DarwinCore {
* @param type $item * @param type $item
*/ */
function __construct($item = NULL) { function __construct($item = NULL) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
if (!empty($item)) { if (!empty($item)) {
$this->owner = $item; $this->owner = $item;
if (array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) { if (array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) {
@ -200,7 +200,7 @@ class DarwinCore {
* @param type $form_values * @param type $form_values
*/ */
public function handleForm($form_values) { public function handleForm($form_values) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
global $user; global $user;
//$new_item = Fedora_Item::ingest_new_item($form_values['pid'], 'A', $form_values['dwc:institutionCode'].':'.$form_values['dwc:collectionCode'].':'.$form_values['dwc:catalogNumber'], $user->name); //$new_item = Fedora_Item::ingest_new_item($form_values['pid'], 'A', $form_values['dwc:institutionCode'].':'.$form_values['dwc:collectionCode'].':'.$form_values['dwc:catalogNumber'], $user->name);
//$new_item->add_datastream_from_string($this->darwinCoreXML, 'DARWIN_CORE', 'Darwin Core Metadata', 'text/xml', 'X'); //$new_item->add_datastream_from_string($this->darwinCoreXML, 'DARWIN_CORE', 'Darwin Core Metadata', 'text/xml', 'X');
@ -248,8 +248,8 @@ class DarwinCore {
*/ */
public function asHTML() { public function asHTML() {
$path = drupal_get_path('module', 'Fedora_Repository'); $path = drupal_get_path('module', 'Fedora_Repository');
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
$xmlstr = $this->darwinCoreXML; $xmlstr = $this->darwinCoreXML;
html_entity_decode($xmlstr); html_entity_decode($xmlstr);

6
plugins/DemoFormBuilder.inc

@ -6,7 +6,7 @@
* @file * @file
* *
*/ */
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/** /**
* implements methods from content model ingest form xml * implements methods from content model ingest form xml
@ -19,7 +19,7 @@ class DemoFormBuilder extends FormBuilder {
* Constructor * Constructor
*/ */
function DemoFormBuilder() { function DemoFormBuilder() {
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
} }
@ -31,7 +31,7 @@ class DemoFormBuilder extends FormBuilder {
* @param type $rootElement * @param type $rootElement
*/ */
function createFedoraDataStreams($form_values, &$dom, &$rootElement) { function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
global $base_url; global $base_url;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;

2
plugins/DocumentConverter.inc

@ -32,7 +32,7 @@ class DocumentConverter {
* @return string * @return string
*/ */
function convert($parameterArray = NULL, $dsid, $file, $output_ext) { function convert($parameterArray = NULL, $dsid, $file, $output_ext) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
#debug: #debug:
#drupal_set_message("Sending $file to ". $this->converter_service_url ." for convertsion to $output_ext", 'status'); #drupal_set_message("Sending $file to ". $this->converter_service_url ." for convertsion to $output_ext", 'status');

2
plugins/Exiftool.inc

@ -22,7 +22,7 @@ class Exiftool {
function __construct($pid) { function __construct($pid) {
//drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); //drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$this->pid = $pid; $this->pid = $pid;
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$this->item = new Fedora_Item($this->pid); $this->item = new Fedora_Item($this->pid);
} }

12
plugins/FedoraObjectDetailedContent.inc

@ -19,7 +19,7 @@ class FedoraObjectDetailedContent {
* @param type $pid * @param type $pid
*/ */
function __construct($pid = '') { function __construct($pid = '') {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
if (!empty($pid)) { if (!empty($pid)) {
$this->pid = $pid; $this->pid = $pid;
@ -36,9 +36,9 @@ class FedoraObjectDetailedContent {
global $user; global $user;
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
$tabset = array(); $tabset = array();
$show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_purge_object_form'); $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form');
$show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_edit_qdc_form'); $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_form');
$purge_form = drupal_get_form('islandora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path())))); $purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path()))));
$tabset['fedora_object_details'] = array( $tabset['fedora_object_details'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
@ -59,8 +59,8 @@ class FedoraObjectDetailedContent {
'#content' => $dc_html . $ds_list . $purge_form, '#content' => $dc_html . $ds_list . $purge_form,
); );
if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DC'); $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC');
$tabset['fedora_object_details']['tabset']['edit'] = array( $tabset['fedora_object_details']['tabset']['edit'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Edit'), '#title' => t('Edit'),

2
plugins/Flv.inc

@ -138,7 +138,7 @@ class FormBuilder {
* @param type $rootElement * @param type $rootElement
*/ */
function createFedoraDataStreams($form_values, &$dom, &$rootElement) { function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;
$file = $form_values['ingest-file-location']; $file = $form_values['ingest-file-location'];

6
plugins/FlvFormBuilder.inc

@ -6,7 +6,7 @@
* @file * @file
* FLVFormBuilder * FLVFormBuilder
*/ */
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/** /**
* implements methods from content model ingest form xml * implements methods from content model ingest form xml
@ -19,7 +19,7 @@ class FlvFormBuilder extends FormBuilder {
* Constructor * Constructor
*/ */
function FlvFormBuilder() { function FlvFormBuilder() {
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
} }
@ -32,7 +32,7 @@ class FlvFormBuilder extends FormBuilder {
*/ */
function createFedoraDataStreams($form_values, &$dom, &$rootElement) { function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
global $base_url; global $base_url;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;

8
plugins/FormBuilder.inc

@ -84,7 +84,7 @@ class FormBuilder {
* @return type * @return type
*/ */
function createPolicy($collectionPid, &$dom, &$rootElement) { function createPolicy($collectionPid, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
$dsid = 'CHILD_SECURITY'; $dsid = 'CHILD_SECURITY';
@ -135,8 +135,8 @@ class FormBuilder {
* @return type * @return type
*/ */
function handleQDCForm($form_values) { function handleQDCForm($form_values) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
$dom = new DomDocument("1.0", "UTF-8"); $dom = new DomDocument("1.0", "UTF-8");
$dom->formatOutput = TRUE; $dom->formatOutput = TRUE;
@ -196,7 +196,7 @@ class FormBuilder {
* @param type $rootElement * @param type $rootElement
*/ */
function createFedoraDataStreams($form_values, &$dom, &$rootElement) { function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
global $base_url; global $base_url;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;

2
plugins/ImageManipulation.inc

@ -16,7 +16,7 @@ class ImageManipulation {
* Constructor * Constructor
*/ */
function ImageManipulation() { function ImageManipulation() {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
} }
/** /**

16
plugins/ModsFormBuilder.inc

@ -6,7 +6,7 @@
* @file * @file
* ModsFormBuilder class * ModsFormBuilder class
*/ */
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/** /**
* ModsFormBuilder class ??? * ModsFormBuilder class ???
@ -25,8 +25,8 @@ class ModsFormBuilder extends FormBuilder {
function __construct($pid=NULL) { function __construct($pid=NULL) {
parent::__construct(); parent::__construct();
if ($pid !== NULL) { if ($pid !== NULL) {
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$this->pid = $pid; $this->pid = $pid;
$this->cm = ContentModel::loadFromObject($pid); $this->cm = ContentModel::loadFromObject($pid);
@ -241,7 +241,7 @@ class ModsFormBuilder extends FormBuilder {
$form['submit'] = array( $form['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
'#submit' => array('islandora_repository_edit_qdc_form_submit'), '#submit' => array('fedora_repository_edit_qdc_form_submit'),
'#value' => 'Save Metadata' '#value' => 'Save Metadata'
); );
@ -256,8 +256,8 @@ class ModsFormBuilder extends FormBuilder {
* @param &$form_state * @param &$form_state
*/ */
function handleModsForm(&$form_values, &$form_state) { function handleModsForm(&$form_values, &$form_state) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
$form_state['storage']['people'] = NULL; //clears out old entities for the next run of the formbuilder. $form_state['storage']['people'] = NULL; //clears out old entities for the next run of the formbuilder.
@ -329,7 +329,7 @@ class ModsFormBuilder extends FormBuilder {
* @param &$rootElement * @param &$rootElement
*/ */
function createCollectionPolicy($form_values, &$dom, &$rootElement) { function createCollectionPolicy($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$model = new fedora_item($form_values['content_model_pid']); $model = new fedora_item($form_values['content_model_pid']);
$ds_list = $model->get_datastreams_list_as_array(); $ds_list = $model->get_datastreams_list_as_array();
if (isset($ds_list['COLLECTION_POLICY_TMPL'])) { if (isset($ds_list['COLLECTION_POLICY_TMPL'])) {
@ -364,7 +364,7 @@ class ModsFormBuilder extends FormBuilder {
* @param &$rootElement * @param &$rootElement
*/ */
function createWorkflowStream($form_values, &$dom, &$rootElement) { function createWorkflowStream($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$model = new fedora_item($form_values['content_model_pid']); $model = new fedora_item($form_values['content_model_pid']);
$ds_list = $model->get_datastreams_list_as_array(); $ds_list = $model->get_datastreams_list_as_array();
if (isset($ds_list['WORKFLOW_TMPL'])) { if (isset($ds_list['WORKFLOW_TMPL'])) {

2
plugins/PersonalCollectionClass.inc

@ -120,7 +120,7 @@ class PersonalCollectionClass {
* @return type * @return type
*/ */
function createPolicyStream($user, $dom, $rootElement) { function createPolicyStream($user, $dom, $rootElement) {
module_load_include('inc', 'islandora_repository', 'SecurityClass'); module_load_include('inc', 'fedora_repository', 'SecurityClass');
$securityClass = new SecurityClass(); $securityClass = new SecurityClass();
$policyStreamDoc = $securityClass->createPersonalPolicy($user); $policyStreamDoc = $securityClass->createPersonalPolicy($user);

4
plugins/QtFormBuilder.php

@ -6,7 +6,7 @@
* @file * @file
* QTFormBuilder class * QTFormBuilder class
*/ */
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/** /**
* Implements methods from content model ingest form xml * Implements methods from content model ingest form xml
@ -30,7 +30,7 @@ class QtFormBuilder extends FormBuilder {
* @param type $rootElement * @param type $rootElement
*/ */
function createFedoraDataStreams($form_values, &$dom, &$rootElement) { function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
global $base_url; global $base_url;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = null; $server = null;

12
plugins/Refworks.inc

@ -7,7 +7,7 @@
* Refworks class * Refworks class
*/ */
module_load_include('inc', 'islandora_repository', 'SecurityClass'); module_load_include('inc', 'fedora_repository', 'SecurityClass');
/** /**
* Refworks class ??? * Refworks class ???
@ -222,9 +222,9 @@ class Refworks {
*/ */
function handleForm(&$form_values) { function handleForm(&$form_values) {
$errorMessage = NULL; $errorMessage = NULL;
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
module_load_include('inc', 'islandora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$contentModelPid = ContentModel::getPidFromIdentifier($form_values['models']); $contentModelPid = ContentModel::getPidFromIdentifier($form_values['models']);
$contentModelDsid = ContentModel::getDSIDFromIdentifier($form_values['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_values['models']);
$collectionHelper = new CollectionClass(); $collectionHelper = new CollectionClass();
@ -238,7 +238,7 @@ class Refworks {
$collection_item = new Fedora_Item($collection_pid); $collection_item = new Fedora_Item($collection_pid);
$this->collectionPolicyStream = $collection_item->get_datastream_dissemination('CHILD_SECURITY'); $this->collectionPolicyStream = $collection_item->get_datastream_dissemination('CHILD_SECURITY');
if (empty($this->collectionPolicyStream)) { if (empty($this->collectionPolicyStream)) {
$this->collectionPolicyStream = file_get_contents(drupal_get_path('module', 'islandora_repository') . '/policies/noObjectEditPolicy.xml'); $this->collectionPolicyStream = file_get_contents(drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml');
} }
$success = 0; $success = 0;
$errors = 0; $errors = 0;
@ -388,7 +388,7 @@ class Refworks {
*/ */
function createFedoraDataStreams($form_values, &$dom, &$rootElement, $reference) { function createFedoraDataStreams($form_values, &$dom, &$rootElement, $reference) {
global $base_url; global $base_url;
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;
$this->createRomeoDataStream($dom, $rootElement); $this->createRomeoDataStream($dom, $rootElement);

18
plugins/ShowStreamsInFieldSets.inc

@ -87,7 +87,7 @@ class ShowStreamsInFieldSets {
global $base_url; global $base_url;
global $base_path; global $base_path;
global $user; global $user;
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$tabset = array(); $tabset = array();
@ -105,7 +105,7 @@ class ShowStreamsInFieldSets {
$tn_url = $base_url . '/fedora/repository/' . $item->pid . '/TN'; $tn_url = $base_url . '/fedora/repository/' . $item->pid . '/TN';
} }
else { else {
$tn_url = $base_path . drupal_get_path('module', 'islandora_repository') . '/images/Crystal_Clear_app_download_manager.png'; $tn_url = $base_path . drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_app_download_manager.png';
} }
$dc_html = $objectHelper->getFormattedDC($item); $dc_html = $objectHelper->getFormattedDC($item);
@ -117,8 +117,8 @@ class ShowStreamsInFieldSets {
'#content' => $dl_link . $dc_html, '#content' => $dl_link . $dc_html,
); );
if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DC'); $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC');
$tabset['first_tab']['tabs']['edit'] = array( $tabset['first_tab']['tabs']['edit'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Edit'), '#title' => t('Edit'),
@ -142,7 +142,7 @@ class ShowStreamsInFieldSets {
* @return type * @return type
*/ */
function showQdc() { function showQdc() {
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
$content = $objectHelper->getQDC($this->pid); $content = $objectHelper->getQDC($this->pid);
$collection_fieldset = array( $collection_fieldset = array(
@ -161,7 +161,7 @@ class ShowStreamsInFieldSets {
*/ */
function showOBJLink() { function showOBJLink() {
global $base_url; global $base_url;
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new Fedora_Item($this->pid); $item = new Fedora_Item($this->pid);
$streams = $item->get_datastreams_list_as_array(); $streams = $item->get_datastreams_list_as_array();
return "<a href='" . $base_url . "/fedora/repository/" . $this->pid . "/OBJ/" . $streams['OBJ']['label'] . "'>" . $streams['OBJ']['label'] . "</a>"; return "<a href='" . $base_url . "/fedora/repository/" . $this->pid . "/OBJ/" . $streams['OBJ']['label'] . "'>" . $streams['OBJ']['label'] . "</a>";
@ -172,8 +172,8 @@ class ShowStreamsInFieldSets {
* @return type * @return type
*/ */
function showRefworks() { function showRefworks() {
$path = drupal_get_path('module', 'islandora_repository'); $path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$collectionHelper = new CollectionClass(); $collectionHelper = new CollectionClass();
$xmlstr = $collectionHelper->getStream($this->pid, "refworks"); $xmlstr = $collectionHelper->getStream($this->pid, "refworks");
html_entity_decode($xmlstr); html_entity_decode($xmlstr);
@ -226,7 +226,7 @@ class ShowStreamsInFieldSets {
*/ */
function showRomeo($collapsed = FALSE) { function showRomeo($collapsed = FALSE) {
$path = drupal_get_path('module', 'Fedora_Repository'); $path = drupal_get_path('module', 'Fedora_Repository');
module_load_include('inc', 'islandora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
$collectionHelper = new CollectionClass(); $collectionHelper = new CollectionClass();
$xmlstr = $collectionHelper->getStream($this->pid, "ROMEO", 0); $xmlstr = $collectionHelper->getStream($this->pid, "ROMEO", 0);

2
plugins/islandora_imageapi.info → plugins/fedora_imageapi.info

@ -1,7 +1,7 @@
name = Fedora ImageAPI name = Fedora ImageAPI
description = Adds image manipulation support through a REST interface description = Adds image manipulation support through a REST interface
package = Islandora Dependencies package = Islandora Dependencies
dependencies[] = islandora_repository dependencies[] = fedora_repository
dependencies[] = imageapi dependencies[] = imageapi
version = 11.2.beta2 version = 11.2.beta2
core = 6.x core = 6.x

8
plugins/islandora_imageapi.module → plugins/fedora_imageapi.module

@ -6,7 +6,7 @@ function fedora_imageapi_menu() {
$items = array(); $items = array();
$items['fedora/imageapi'] = array( $items['fedora/imageapi'] = array(
'title' => t('Image manipulation functions'), 'title' => t('Image manipulation functions'),
'page callback' => 'islandora_repository_image_manip', 'page callback' => 'fedora_repository_image_manip',
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection'), 'access arguments' => array('view fedora collection'),
); );
@ -21,7 +21,7 @@ function fedora_imageapi_menu() {
* @param string $op * @param string $op
* @param string $params * @param string $params
*/ */
function islandora_repository_image_manip($pid = '', $dsid = '', $op = '', $params = '') { function fedora_repository_image_manip($pid = '', $dsid = '', $op = '', $params = '') {
module_load_include('inc', 'Fedora_Repository', 'ObjectHelper'); module_load_include('inc', 'Fedora_Repository', 'ObjectHelper');
module_load_include('module', 'imageapi'); module_load_include('module', 'imageapi');
$obj = new ObjectHelper(); $obj = new ObjectHelper();
@ -30,7 +30,7 @@ function islandora_repository_image_manip($pid = '', $dsid = '', $op = '', $para
$op = (!empty($_GET['op']) ? $_GET['op'] : ''); $op = (!empty($_GET['op']) ? $_GET['op'] : '');
$safe_pid = str_replace(':', '_', $pid); $safe_pid = str_replace(':', '_', $pid);
$cache_key = 'islandora_repository_image_manip_' . md5($safe_pid . '_' . $dsid . '_' . $ext . '_' . $op . (isset($_GET['width']) ? '_' . $_GET['width'] : '') . (isset($_GET['height']) ? '_' . $_GET['height'] : '')); $cache_key = 'fedora_repository_image_manip_' . md5($safe_pid . '_' . $dsid . '_' . $ext . '_' . $op . (isset($_GET['width']) ? '_' . $_GET['width'] : '') . (isset($_GET['height']) ? '_' . $_GET['height'] : ''));
if (($file = cache_get($cache_key)) === 0) { if (($file = cache_get($cache_key)) === 0) {
//added the slash as sys_get_temp_dir in linux does not seem to include the slash //added the slash as sys_get_temp_dir in linux does not seem to include the slash
$tmp_file_name = sys_get_temp_dir() . '/' . $safe_pid . '_' . $dsid . '.' . $ext; $tmp_file_name = sys_get_temp_dir() . '/' . $safe_pid . '_' . $dsid . '.' . $ext;
@ -83,7 +83,7 @@ function islandora_repository_image_manip($pid = '', $dsid = '', $op = '', $para
function fedora_imageapi_form_alter( &$form, $form_state, $form_id) { function fedora_imageapi_form_alter( &$form, $form_state, $form_id) {
switch ( $form_id ) { switch ( $form_id ) {
case 'islandora_repository_admin': case 'fedora_repository_admin':
$fedora_base_url = $form['fedora_base_url']['#default_value']; $fedora_base_url = $form['fedora_base_url']['#default_value'];

28
plugins/herbarium.inc

@ -16,7 +16,7 @@
class Herbarium { class Herbarium {
function __construct($pid = '') { function __construct($pid = '') {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
if (!empty($pid)) { if (!empty($pid)) {
$this->pid = $pid; $this->pid = $pid;
$this->item = new Fedora_Item($pid); $this->item = new Fedora_Item($pid);
@ -32,7 +32,7 @@ class Herbarium {
public function buildDrupalForm($form = array(), $form_state = array()) { public function buildDrupalForm($form = array(), $form_state = array()) {
// We don't need to add anything beyond the standard Darwin Core form so just pass this through // We don't need to add anything beyond the standard Darwin Core form so just pass this through
// If we wanted to we could add other fields. // If we wanted to we could add other fields.
module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
$dwc = new DarwinCore($this->item); $dwc = new DarwinCore($this->item);
return $dwc->buildDrupalForm($form); return $dwc->buildDrupalForm($form);
@ -73,9 +73,9 @@ class Herbarium {
* Process the metadata form * Process the metadata form
* Update the datastreams * Update the datastreams
*/ */
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
global $user; global $user;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$dwc = new DarwinCore($this->item); $dwc = new DarwinCore($this->item);
@ -97,9 +97,9 @@ class Herbarium {
* Create fedora object * Create fedora object
* Add the datastreams * Add the datastreams
*/ */
module_load_include('inc', 'islandora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
global $user; global $user;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$dwc = new DarwinCore(); $dwc = new DarwinCore();
@ -141,8 +141,8 @@ class Herbarium {
* @return string * @return string
*/ */
public function showFieldSets() { public function showFieldSets() {
module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
global $base_url; global $base_url;
$tabset = array(); $tabset = array();
@ -167,7 +167,7 @@ class Herbarium {
'#title' => t('View'), '#title' => t('View'),
// This will be the content of the tab. // This will be the content of the tab.
'#content' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/FULL_JPG/"><img src="' . $base_url . '/fedora/imageapi/' . '#content' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/FULL_JPG/"><img src="' . $base_url . '/fedora/imageapi/' .
$this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('islandora_repository_image_tagging_form', $this->pid) . '</p>', $this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>',
); );
$dwc = new DarwinCore($this->item); $dwc = new DarwinCore($this->item);
@ -184,10 +184,10 @@ class Herbarium {
'#title' => t('Darwin Core'), '#title' => t('Darwin Core'),
'#content' => $dwc->asHTML(), '#content' => $dwc->asHTML(),
); );
module_load_include('inc', 'islandora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$obj = new ObjectHelper(); $obj = new ObjectHelper();
if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE'); $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE');
$tabset['third_tab']['tabset']['edit'] = array( $tabset['third_tab']['tabset']['edit'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Edit'), '#title' => t('Edit'),

10
plugins/map_viewer.inc

@ -29,9 +29,9 @@ class ShowMapStreamsInFieldSets {
* @return type * @return type
*/ */
function showJPG() { function showJPG() {
module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
global $base_url; global $base_url;
@ -51,8 +51,8 @@ class ShowMapStreamsInFieldSets {
$html = '<iframe src="' . $viewer_url . '" scrolling="no" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>'; $html = '<iframe src="' . $viewer_url . '" scrolling="no" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>';
drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme');
drupal_add_css(drupal_get_path('module', 'islandora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css'); drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css');
drupal_add_css(drupal_get_path('module', 'islandora_repository') . '/js/iiv/css/iiv.css'); drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/iiv.css');
$tabset['my_tabset']['second_tab'] = array( $tabset['my_tabset']['second_tab'] = array(

6
plugins/qt_viewer.inc

@ -112,9 +112,9 @@ class ShowQtStreamsInFieldSets {
* @return type * @return type
*/ */
function showQt() { function showQt() {
module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$info = $this->technicalMetadata(array('width' => 640, 'height' => 480)); $info = $this->technicalMetadata(array('width' => 640, 'height' => 480));
$width = $info['width']; $width = $info['width'];

6
plugins/slide_viewer.inc

@ -30,8 +30,8 @@ class ShowSlideStreamsInFieldSets {
* @return type * @return type
*/ */
function showJPG() { function showJPG() {
module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets');
global $base_url; global $base_url;
global $user; global $user;
@ -58,7 +58,7 @@ class ShowSlideStreamsInFieldSets {
'#title' => t('View'), '#title' => t('View'),
// This will be the content of the tab. // This will be the content of the tab.
'#content' => '<img src="' . $base_url . '#content' => '<img src="' . $base_url .
'/fedora/imageapi/' . $this->pid . '/JPG/JPG.jpg' . '" />' . '<p>' . drupal_get_form('islandora_repository_image_tagging_form', $this->pid) . '</p>', '/fedora/imageapi/' . $this->pid . '/JPG/JPG.jpg' . '" />' . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>',
); );
return $tabset; return $tabset;

22
plugins/tagging_form.inc

@ -13,9 +13,9 @@
* @return string * @return string
*/ */
function _show_subject_tags($pid) { function _show_subject_tags($pid) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/dublin_core'); module_load_include('inc', 'fedora_repository', 'api/dublin_core');
module_load_include('inc', 'islandora_repository', 'api/tagging'); module_load_include('inc', 'fedora_repository', 'api/tagging');
$obj = new Fedora_Item($pid); $obj = new Fedora_Item($pid);
$tags = new TagSet($obj); $tags = new TagSet($obj);
if (!empty($tags->tags)) { if (!empty($tags->tags)) {
@ -35,10 +35,10 @@ function _show_subject_tags($pid) {
* @param type $pid * @param type $pid
* @return type * @return type
*/ */
function islandora_repository_image_tagging_form($form_state, $pid) { function fedora_repository_image_tagging_form($form_state, $pid) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/dublin_core'); module_load_include('inc', 'fedora_repository', 'api/dublin_core');
module_load_include('inc', 'islandora_repository', 'api/tagging'); module_load_include('inc', 'fedora_repository', 'api/tagging');
global $base_url; global $base_url;
if (!empty($form_state['post']['pid'])) { if (!empty($form_state['post']['pid'])) {
@ -71,7 +71,7 @@ function islandora_repository_image_tagging_form($form_state, $pid) {
// Delete button for each existing tag. // Delete button for each existing tag.
$form['tags-wrapper']['tags'][$tag['name']]['delete'] = array( $form['tags-wrapper']['tags'][$tag['name']]['delete'] = array(
'#type' => 'imagebutton', '#type' => 'imagebutton',
'#image' => $base_url . '/' . drupal_get_path('module', 'islandora_repository') . '/images/remove_icon.png', '#image' => $base_url . '/' . drupal_get_path('module', 'fedora_repository') . '/images/remove_icon.png',
'#default_value' => $tag['name'], '#default_value' => $tag['name'],
'#title' => t('Delete this tag'), '#title' => t('Delete this tag'),
); );
@ -122,9 +122,9 @@ function hook_imagebutton_process($form) {
* @param type $form * @param type $form
* @param type $form_state * @param type $form_state
*/ */
function islandora_repository_image_tagging_form_submit($form, &$form_state) { function fedora_repository_image_tagging_form_submit($form, &$form_state) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/tagging'); module_load_include('inc', 'fedora_repository', 'api/tagging');
global $user; global $user;
$item = new Fedora_Item($form_state['values']['pid']); $item = new Fedora_Item($form_state['values']['pid']);

2
tests/README_TESTING.txt

@ -21,7 +21,7 @@ $FEDORA_HOME/server/config/fedora-users.xml:
</attribute> </attribute>
</user> </user>
If you look in the islandora_repository.test file we see that we are creating If you look in the fedora_repository.test file we see that we are creating
a user with a password set to 'simpletestpass'. Fedora requires the hashed a user with a password set to 'simpletestpass'. Fedora requires the hashed
version of this password to do a servlet filter-based authentication. version of this password to do a servlet filter-based authentication.

20
tests/fedora_repository.test

@ -16,9 +16,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
} }
function setUp() { function setUp() {
parent::setUp('tabs', 'islandora_repository'); parent::setUp('tabs', 'fedora_repository');
module_load_include('inc', 'islandora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
// Create and login user. // Create and login user.
$repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams', $repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams',
@ -57,11 +57,11 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2['dc:title'] = $this->randomName(32); $ingest_form_step_2['dc:title'] = $this->randomName(32);
$ingest_form_step_2['dc:description'] = $this->randomName(256); $ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/tests/test_files/lorem_ipsum.pdf'); $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$this->assertText('mimetype (application/pdf) is not associated with this Content Model', 'PDF mime type not accepted in collection content model.', 'message'); $this->assertText('mimetype (application/pdf) is not associated with this Content Model', 'PDF mime type not accepted in collection content model.', 'message');
$this->outputScreenContents('Initial ingest form submit step 2', 'islandora_repository'); $this->outputScreenContents('Initial ingest form submit step 2', 'fedora_repository');
// Now try ingesting a proper collection policy. // Now try ingesting a proper collection policy.
$ingest_form = array(); $ingest_form = array();
@ -72,9 +72,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2 = array(); $ingest_form_step_2 = array();
$ingest_form_step_2['dc:title'] = $this->randomName(32); $ingest_form_step_2['dc:title'] = $this->randomName(32);
$ingest_form_step_2['dc:description'] = $this->randomName(256); $ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml'); $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
//$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'islandora_repository'); //$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'fedora_repository');
$this->assertPattern('/Item .* created successfully./', "Verified item created."); $this->assertPattern('/Item .* created successfully./', "Verified item created.");
$pid = $this->getIngestedPid(); $pid = $this->getIngestedPid();
@ -88,7 +88,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2 = array(); $ingest_form_step_2 = array();
$ingest_form_step_2['dc:title'] = "Lorem Ipsum"; $ingest_form_step_2['dc:title'] = "Lorem Ipsum";
$ingest_form_step_2['dc:description'] = $this->randomName(256); $ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/tests/test_files/lorem_ipsum.pdf'); $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$pid = $this->getIngestedPid(); $pid = $this->getIngestedPid();
$pid_list[] = $pid; $pid_list[] = $pid;
@ -104,7 +104,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$admin_tester = $this->drupalCreateUser(array('administer site configuration', 'view fedora collection')); $admin_tester = $this->drupalCreateUser(array('administer site configuration', 'view fedora collection'));
$this->drupalLogin($admin_tester); $this->drupalLogin($admin_tester);
$pageContent = $this->drupalGet('admin/settings/islandora_repository'); $pageContent = $this->drupalGet('admin/settings/fedora_repository');
$hasOption = preg_match('/Enforce namespace restrictions/', $pageContent); $hasOption = preg_match('/Enforce namespace restrictions/', $pageContent);
@ -115,13 +115,13 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$this->pass('Removal of namespace restrictions is enabled'); $this->pass('Removal of namespace restrictions is enabled');
$inVal['fedora_namespace_restriction_enforced'] = TRUE; $inVal['fedora_namespace_restriction_enforced'] = TRUE;
$inVal['fedora_pids_allowed'] = 'simpletest:'; $inVal['fedora_pids_allowed'] = 'simpletest:';
$this->drupalPost('admin/settings/islandora_repository', $inVal, 'Save configuration'); $this->drupalPost('admin/settings/fedora_repository', $inVal, 'Save configuration');
$this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.'); $this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.');
$this->drupalGet('fedora/repository/islandora:largeimages/'); $this->drupalGet('fedora/repository/islandora:largeimages/');
$this->assertPattern('/Access denied/', 'No access to Large image Collection Collection'); $this->assertPattern('/Access denied/', 'No access to Large image Collection Collection');
$inVal['fedora_namespace_restriction_enforced'] = 0; $inVal['fedora_namespace_restriction_enforced'] = 0;
$this->drupalPost('admin/settings/islandora_repository', $inVal, 'Save configuration'); $this->drupalPost('admin/settings/fedora_repository', $inVal, 'Save configuration');
$this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.'); $this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.');
$this->drupalLogin($this->repository_user); $this->drupalLogin($this->repository_user);
$this->drupalGet('fedora/repository/islandora:largeimages/'); $this->drupalGet('fedora/repository/islandora:largeimages/');

Loading…
Cancel
Save