Browse Source

Merge pull request #50 from bwoodhead/master

Moved files to appropriate places
pull/51/merge
Ben Woodhead 13 years ago
parent
commit
98c9fc60cd
  1. 2
      api/ConnectionHelper.inc
  2. 0
      api/MimeClass.inc
  3. 26
      api/ObjectHelper.inc
  4. 4
      api/fedora_collection.inc
  5. 2
      api/fedora_export.inc
  6. 2
      api/fedora_imageapi.module
  7. 6
      api/fedora_item.inc
  8. 12
      core/BatchIngest.inc
  9. 16
      core/CollectionClass.inc
  10. 2
      core/CollectionManagement.inc
  11. 6
      core/CollectionPolicy.inc
  12. 8
      core/ContentModel.inc
  13. 6
      core/SearchClass.inc
  14. 2
      core/SecurityClass.inc
  15. 10
      core/formClass.inc
  16. 78
      fedora_repository.module
  17. 2
      plugins/CollectionFormBuilder.inc
  18. 4
      plugins/DarwinCore.inc
  19. 2
      plugins/DemoFormBuilder.inc
  20. 2
      plugins/DocumentConverter.inc
  21. 2
      plugins/Flv.inc
  22. 2
      plugins/FlvFormBuilder.inc
  23. 6
      plugins/FormBuilder.inc
  24. 2
      plugins/ImageManipulation.inc
  25. 4
      plugins/ModsFormBuilder.inc
  26. 6
      plugins/Refworks.inc
  27. 6
      plugins/ShowStreamsInFieldSets.inc
  28. 6
      plugins/herbarium.inc

2
core/ConnectionHelper.inc → api/ConnectionHelper.inc

@ -1,7 +1,5 @@
<?php <?php
/** /**
* @file * @file
* Connection Helper Class * Connection Helper Class

0
core/MimeClass.inc → api/MimeClass.inc

26
core/ObjectHelper.inc → api/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', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/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', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/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 ' ';
@ -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', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/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', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
$collectionClass = new CollectionClass(); $collectionClass = new CollectionClass();
$results = $collectionClass->getRelatedItems($pid, $query); $results = $collectionClass->getRelatedItems($pid, $query);
return $results; return $results;
@ -360,7 +360,7 @@ class ObjectHelper {
function getFormattedDC($item) { function getFormattedDC($item) {
global $base_url; global $base_url;
$path = drupal_get_path('module', 'fedora_repository'); $path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/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);
@ -440,10 +440,10 @@ 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', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
$path = drupal_get_path('module', 'fedora_repository'); $path = drupal_get_path('module', 'fedora_repository');
$dataStreamBody = ''; $dataStreamBody = '';
@ -514,7 +514,7 @@ class ObjectHelper {
* *
*/ */
function getStream($pid, $dsid, $showError = FALSE) { function getStream($pid, $dsid, $showError = FALSE) {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/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', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
$collectionHelper = new CollectionClass(); $collectionHelper = new CollectionClass();
$pids = array(); $pids = array();
$query = 'select $object from <#ri> $query = 'select $object from <#ri>
@ -665,7 +665,7 @@ class ObjectHelper {
//show the collections datastreams //show the collections datastreams
if ($results->length > 0 || $isCollection == TRUE) { if ($results->length > 0 || $isCollection == TRUE) {
// if(strlen($objectList)>22||$contentModel=='Collection'||$contentModel=='Community')//length of empty dom still equals 22 because of <table/> etc // if(strlen($objectList)>22||$contentModel=='Collection'||$contentModel=='Community')//length of empty dom still equals 22 because of <table/> etc
module_load_include('inc', 'Fedora_Repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'core/CollectionPolicy');
$collectionPolicyExists = $objectHelper->getMimeType($pid, CollectionPolicy::getDefaultDSID()); $collectionPolicyExists = $objectHelper->getMimeType($pid, CollectionPolicy::getDefaultDSID());
if (user_access(ObjectHelper :: $INGEST_FEDORA_OBJECTS) && $collectionPolicyExists) { if (user_access(ObjectHelper :: $INGEST_FEDORA_OBJECTS) && $collectionPolicyExists) {
if (!empty($collectionPolicyExists)) { if (!empty($collectionPolicyExists)) {
@ -790,7 +790,7 @@ class ObjectHelper {
return NULL; return NULL;
} }
$output = ''; $output = '';
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/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', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/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);
} }

4
api/fedora_collection.inc

@ -4,7 +4,7 @@
* @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', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('module', 'fedora_repository'); module_load_include('module', 'fedora_repository');
@ -68,7 +68,7 @@ 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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
global $user; global $user;
if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {

2
api/fedora_export.inc

@ -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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/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');

2
api/fedora_imageapi.module

@ -24,7 +24,7 @@ function fedora_imageapi_menu() {
* @param string $params * @param string $params
*/ */
function fedora_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', 'api/ObjectHelper');
module_load_include('module', 'imageapi'); module_load_include('module', 'imageapi');
$obj = new ObjectHelper(); $obj = new ObjectHelper();
$mimetype = $obj->getMimeType($pid, $dsid); $mimetype = $obj->getMimeType($pid, $dsid);

6
api/fedora_item.inc

@ -28,7 +28,7 @@ class Fedora_Item {
*/ */
function __construct($pid) { function __construct($pid) {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$this->pid = $pid; $this->pid = $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', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/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;
@ -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', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
self::$connection_helper = new ConnectionHelper(); self::$connection_helper = new ConnectionHelper();
} }
switch ($function_name) { switch ($function_name) {

12
core/BatchIngest.inc

@ -9,7 +9,7 @@
*/ */
function batch_creation_form(&$form_state, $collection_pid, $content_models) { function batch_creation_form(&$form_state, $collection_pid, $content_models) {
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'core/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) {
@ -86,7 +86,7 @@ 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', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
global $user; global $user;
$namespace_mappings = array(); $namespace_mappings = array();
@ -163,8 +163,8 @@ function batch_creation_form_submit($form, &$form_state) {
* @param <string> $metadata * @param <string> $metadata
*/ */
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', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
module_load_include('inc', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); module_load_include('inc', 'fedora_reppository', 'api/fedora_item');
$cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM');
@ -219,8 +219,8 @@ 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', 'fedora_repository'); $path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
if ($xmlstr == NULL || strlen($xmlstr) < 5) { if ($xmlstr == NULL || strlen($xmlstr) < 5) {
return " "; return " ";

16
core/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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/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,7 +65,7 @@ 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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
if (!isset($limit)) { if (!isset($limit)) {
$limit = 1000; $limit = 1000;
@ -193,7 +193,7 @@ class CollectionClass {
* @return ContentModel * @return ContentModel
*/ */
function getContentModels($collection_pid, $showError = TRUE) { function getContentModels($collection_pid, $showError = TRUE) {
module_load_include('inc', 'Fedora_Repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
$collection_stream = $this->getCollectionPolicyStream($collection_pid); $collection_stream = $this->getCollectionPolicyStream($collection_pid);
try { try {
$xml = new SimpleXMLElement($collection_stream); $xml = new SimpleXMLElement($collection_stream);
@ -220,7 +220,7 @@ class CollectionClass {
* $dsid is the datastream id of the content model. * $dsid is the datastream id of the content model.
*/ */
function getNextPid($pid, $dsid) { function getNextPid($pid, $dsid) {
module_load_include('inc', 'Fedora_Repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/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', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
@ -437,7 +437,7 @@ 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', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/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'));
@ -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', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/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
@ -577,7 +577,7 @@ class CollectionClass {
function getIngestInterface() { function getIngestInterface() {
global $base_url; global $base_url;
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
module_load_include('inc', 'Fedora_Repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'core/CollectionPolicy');
$collectionPolicyExists = $objectHelper->getMimeType($this->pid, CollectionPolicy::getDefaultDSID()); $collectionPolicyExists = $objectHelper->getMimeType($this->pid, CollectionPolicy::getDefaultDSID());
if (user_access(ObjectHelper :: $INGEST_FEDORA_OBJECTS) && $collectionPolicyExists) { if (user_access(ObjectHelper :: $INGEST_FEDORA_OBJECTS) && $collectionPolicyExists) {
if (!empty($collectionPolicyExists)) { if (!empty($collectionPolicyExists)) {

2
core/CollectionManagement.inc

@ -21,7 +21,7 @@ function collection_management_form(&$form_state, $this_collection_pid, $content
} }
} }
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'core/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();

6
core/CollectionPolicy.inc

@ -4,7 +4,7 @@
* @file * @file
* Collection Policy Class * Collection Policy Class
*/ */
module_load_include('inc', 'fedora_repository', 'XMLDatastream'); module_load_include('inc', 'fedora_repository', 'core/XMLDatastream');
/** /**
* Collection Policy class ?? * Collection Policy class ??
@ -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', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/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;
@ -387,7 +387,7 @@ class CollectionPolicy extends XMLDatastream {
function getContentModels() { function getContentModels() {
$ret = FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
module_load_include('inc', 'Fedora_Repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
$ret = array(); $ret = array();
$content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model');
for ($i = 0; $i < $content_models->length; $i++) { for ($i = 0; $i < $content_models->length; $i++) {

8
core/ContentModel.inc

@ -8,7 +8,7 @@
* @file * @file
* Content Model Class * Content Model Class
*/ */
module_load_include('inc', 'fedora_repository', 'XMLDatastream'); module_load_include('inc', 'fedora_repository', 'core/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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
$content_models = $objectHelper->get_content_models_list($pid); $content_models = $objectHelper->get_content_models_list($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', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/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));
@ -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', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'core/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;

6
core/SearchClass.inc

@ -185,7 +185,7 @@ 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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_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
@ -237,7 +237,7 @@ class SearchClass {
* @return type * @return type
*/ */
function getTerms($fieldName, $startTerm, $displayName = NULL) { function getTerms($fieldName, $startTerm, $displayName = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_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');
@ -269,7 +269,7 @@ 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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_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')) {

2
core/SecurityClass.inc

@ -30,7 +30,7 @@ class SecurityClass {
*/ */
function canIngestHere($collection_pid) { function canIngestHere($collection_pid) {
global $user; global $user;
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/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);

10
core/formClass.inc

@ -206,7 +206,7 @@ class formClass {
return; return;
} }
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
$form = array(); $form = array();
$form['fedora_repository_name'] = array( $form['fedora_repository_name'] = array(
'#type' => 'textfield', '#type' => 'textfield',
@ -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', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/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']);
@ -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', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'core/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,8 +603,8 @@ 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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$obj_helper = new ObjectHelper(); $obj_helper = new ObjectHelper();

78
fedora_repository.module

@ -8,7 +8,7 @@
* the name and pid can also be passed as url parameters * the name and pid can also be passed as url parameters
*/ */
function fedora_repository_admin() { function fedora_repository_admin() {
module_load_include('inc', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'core/formClass');
$adminForm = new formClass(); $adminForm = new formClass();
return $adminForm->createAdminForm(); return $adminForm->createAdminForm();
} }
@ -18,7 +18,7 @@ function fedora_repository_admin() {
* calls the fedora_repositorys_admin form * calls the fedora_repositorys_admin form
*/ */
function fedora_repository_menu() { function fedora_repository_menu() {
module_load_include('inc', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'core/formClass');
$adminMenu = new formClass(); $adminMenu = new formClass();
return $adminMenu->createMenu(); return $adminMenu->createMenu();
} }
@ -72,7 +72,7 @@ function fedora_repository_purge_object($pid = NULL, $name = NULL) {
* @return type * @return type
*/ */
function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pageNumber = NULL) { function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pageNumber = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
global $user; global $user;
if (!fedora_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');
@ -86,7 +86,7 @@ function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pag
$content = ''; $content = '';
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
$collectionClass = new CollectionClass(); $collectionClass = new CollectionClass();
$results = $collectionClass->getRelatedItems($pid, NULL); $results = $collectionClass->getRelatedItems($pid, NULL);
$content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); $content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber);
@ -103,7 +103,7 @@ function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pag
*/ */
function fedora_repository_ingest_object($collection_pid=NULL, $collection_label = NULL, $content_model = NULL) { function fedora_repository_ingest_object($collection_pid=NULL, $collection_label = NULL, $content_model = NULL) {
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
if (!user_access('ingest new fedora objects')) { if (!user_access('ingest new fedora objects')) {
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 ''; return '';
@ -151,9 +151,9 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) {
} }
elseif ($form_state['clicked_button']['#id'] == 'edit-submit') { elseif ($form_state['clicked_button']['#id'] == 'edit-submit') {
global $base_url; global $base_url;
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'core/CollectionPolicy');
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
$contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']);
$contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']);
@ -222,8 +222,8 @@ function fedora_repository_ingest_form_validate($form, &$form_state) {
} }
if (isset($form_state['values']['ingest-file-location']) && file_exists($form_state['values']['ingest-file-location'])) { if (isset($form_state['values']['ingest-file-location']) && file_exists($form_state['values']['ingest-file-location'])) {
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
module_load_include('inc', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
$file = $form_state['values']['ingest-file-location']; $file = $form_state['values']['ingest-file-location'];
@ -267,7 +267,7 @@ function fedora_repository_ingest_form_validate($form, &$form_state) {
* @return type * @return type
*/ */
function fedora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) { function fedora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) {
module_load_include('inc', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'core/formClass');
// For the sake of easily maintaining the module in different core versions create our own form_values variable. // For the sake of easily maintaining the module in different core versions create our own form_values variable.
if (empty($form_state['storage']['step'])) { if (empty($form_state['storage']['step'])) {
$form_state['storage']['step'] = 1; $form_state['storage']['step'] = 1;
@ -367,8 +367,8 @@ function add_stream_form_submit($form, &$form_state) {
$form_state['rebuild'] = TRUE; $form_state['rebuild'] = TRUE;
return; return;
} }
module_load_include('inc', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$pathToModule = drupal_get_path('module', 'fedora_repository'); $pathToModule = drupal_get_path('module', 'fedora_repository');
@ -412,7 +412,7 @@ function add_stream_form_submit($form, &$form_state) {
* @return type * @return type
*/ */
function add_stream_form(&$form_state, $pid) { function add_stream_form(&$form_state, $pid) {
module_load_include('inc', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'core/formClass');
$addDataStreamForm = new formClass(); $addDataStreamForm = new formClass();
return $addDataStreamForm->createAddDataStreamForm($pid, $form_state); return $addDataStreamForm->createAddDataStreamForm($pid, $form_state);
} }
@ -470,7 +470,7 @@ function add_stream_form_validate($form, &$form_state) {
* @return type * @return type
*/ */
function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) { function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
global $user; global $user;
if ($pid == NULL || $dsId == NULL) { if ($pid == NULL || $dsId == NULL) {
drupal_set_message(t('You must specify an object pid and DataStream ID to purge a datastream'), 'error'); drupal_set_message(t('You must specify an object pid and DataStream ID to purge a datastream'), 'error');
@ -495,7 +495,7 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL)
* @return type * @return type
*/ */
function fedora_repository_purge_object_form_submit($form, &$form_state) { function fedora_repository_purge_object_form_submit($form, &$form_state) {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$pid = $form_state['values']['pid']; $pid = $form_state['values']['pid'];
if (!isset($form_state['storage']['confirm'])) { if (!isset($form_state['storage']['confirm'])) {
$form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form $form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form
@ -609,7 +609,7 @@ function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName
*/ */
function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) {
//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); //module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', '');
module_load_include('inc', 'Fedora_Repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'core/formClass');
//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); //$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'));
$replaceDataStreamForm = new formClass(); $replaceDataStreamForm = new formClass();
return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state); return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state);
@ -635,7 +635,7 @@ function fedora_repository_replace_stream_form_validate($form, &$form_state) {
} }
$doc = new DOMDocument(); $doc = new DOMDocument();
module_load_include('inc', 'Fedora_Repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
$mime = new MimeClass(); $mime = new MimeClass();
if ($mime->getType($file->filepath) == 'text/xml' && !$doc->load($file->filepath)) { if ($mime->getType($file->filepath) == 'text/xml' && !$doc->load($file->filepath)) {
form_set_error('file', 'Invalid XML format.'); form_set_error('file', 'Invalid XML format.');
@ -665,7 +665,7 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) {
$dsLabel = substr($dsLabel, 0, $indexOfDot); $dsLabel = substr($dsLabel, 0, $indexOfDot);
$dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.;
} }
module_load_include('inc', 'Fedora_Repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$file_basename = basename($file->filepath); $file_basename = basename($file->filepath);
@ -693,7 +693,7 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) {
* @return type * @return type
*/ */
function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
global $user; global $user;
if ($pid == NULL || $dsId == NULL) { if ($pid == NULL || $dsId == NULL) {
drupal_set_message(t('You must specify an object pid and a Dublin Core DataStream ID to edit metadata'), 'error'); drupal_set_message(t('You must specify an object pid and a Dublin Core DataStream ID to edit metadata'), 'error');
@ -717,8 +717,8 @@ function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) {
* @return type * @return type
*/ */
function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) {
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
if ($pid == NULL) { if ($pid == NULL) {
drupal_set_message(t('You must specify an object pid!'), 'error'); drupal_set_message(t('You must specify an object pid!'), 'error');
} }
@ -728,8 +728,8 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) {
return ' '; return ' ';
} }
module_load_include('inc', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'core/formClass');
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
$soapHelper = new ConnectionHelper(); $soapHelper = new ConnectionHelper();
$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'));
// Check if there is a custom edit metadata function defined in the content model. // Check if there is a custom edit metadata function defined in the content model.
@ -787,7 +787,7 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) {
$xml_form->submit($form, $form_state); $xml_form->submit($form, $form_state);
} }
else { else {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'api/ConnectionHelper');
global $base_url; global $base_url;
if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) {
@ -797,13 +797,13 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) {
// Check the content model for a custom edit metadata form submit function. // Check the content model for a custom edit metadata form submit function.
if (isset($form_state['values']['pid'])) { if (isset($form_state['values']['pid'])) {
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) {
return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client); return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client);
} }
} }
module_load_include('inc', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', 'core/formClass');
$metaDataForm = new formClass(); $metaDataForm = new formClass();
$return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client);
$form_state['storage'] = NULL; $form_state['storage'] = NULL;
@ -819,7 +819,7 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) {
* creates a new permission than can be assigned to roles * creates a new permission than can be assigned to roles
*/ */
function fedora_repository_perm() { function fedora_repository_perm() {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
return array( return array(
OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA,
OBJECTHELPER::$EDIT_FEDORA_METADATA, OBJECTHELPER::$EDIT_FEDORA_METADATA,
@ -844,7 +844,7 @@ function fedora_repository_perm() {
* @return type * @return type
*/ */
function fedora_repository_access($op, $node, $account) { function fedora_repository_access($op, $node, $account) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
return $objectHelper->fedora_repository_access($op, $node, $account); return $objectHelper->fedora_repository_access($op, $node, $account);
} }
@ -879,7 +879,7 @@ function makeObject($pid, $dsID) {
return ' '; return ' ';
} }
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
$objectHelper->makeObject($pid, $dsID); $objectHelper->makeObject($pid, $dsID);
} }
@ -898,7 +898,7 @@ function makeObject($pid, $dsID) {
* @return type * @return type
*/ */
function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $page_number = NULL, $limit = NULL) { function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $page_number = NULL, $limit = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
global $user; global $user;
@ -958,9 +958,9 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
$content = '<div id="content-fedora">'; $content = '<div id="content-fedora">';
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
$collectionClass = new CollectionClass(); $collectionClass = new CollectionClass();
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
module_load_include('inc', 'fedora_repository', 'plugins/FedoraObjectDetailedContent'); module_load_include('inc', 'fedora_repository', 'plugins/FedoraObjectDetailedContent');
$breadcrumbs = array(); $breadcrumbs = array();
$objectHelper->getBreadcrumbs($pid, $breadcrumbs); $objectHelper->getBreadcrumbs($pid, $breadcrumbs);
@ -1023,7 +1023,7 @@ function fedora_repository_urlencode_string($str) {
*/ */
function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) {
global $user; global $user;
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
if ($pid == NULL || $dsId == NULL) { if ($pid == NULL || $dsId == NULL) {
drupal_set_message(t("no pid or dsid given to create an object with!")); drupal_set_message(t("no pid or dsid given to create an object with!"));
@ -1058,7 +1058,7 @@ function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNum
*/ */
function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NULL) { function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NULL) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
global $user; global $user;
if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
@ -1103,7 +1103,7 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU
* @return array * @return array
*/ */
function fedora_repository_search($op = 'search', $keys = NULL) { function fedora_repository_search($op = 'search', $keys = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
switch ($op) { switch ($op) {
@ -1444,7 +1444,7 @@ function fedora_repository_install_demos_page() {
* @return string * @return string
*/ */
function fedora_repository_demo_objects_form() { function fedora_repository_demo_objects_form() {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$form = array(); $form = array();
$existing_demos = array(); $existing_demos = array();
@ -1786,7 +1786,7 @@ function theme_fedora_repository_time($element) {
*/ */
function fedora_repository_remove_item_from_basket($pid) { function fedora_repository_remove_item_from_basket($pid) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
$pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed'];
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
@ -1996,7 +1996,7 @@ function _fedora_repository_get_basket_pids() {
$pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed'];
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
$ob = new ObjectHelper(); $ob = new ObjectHelper();
foreach ($_SESSION['basket']['unprocessed'] as $pid) { foreach ($_SESSION['basket']['unprocessed'] as $pid) {
// Check if the pid already exists in the tree // Check if the pid already exists in the tree

2
plugins/CollectionFormBuilder.inc

@ -30,7 +30,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', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
global $base_url; global $base_url;
$mimetype = new MimeClass(); $mimetype = new MimeClass();

4
plugins/DarwinCore.inc

@ -243,8 +243,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', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
$xmlstr = $this->darwinCoreXML; $xmlstr = $this->darwinCoreXML;
html_entity_decode($xmlstr); html_entity_decode($xmlstr);

2
plugins/DemoFormBuilder.inc

@ -29,7 +29,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', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/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', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/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/Flv.inc

@ -137,7 +137,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', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;
$file = $form_values['ingest-file-location']; $file = $form_values['ingest-file-location'];

2
plugins/FlvFormBuilder.inc

@ -30,7 +30,7 @@ class FlvFormBuilder extends FormBuilder {
*/ */
function createFedoraDataStreams($form_values, &$dom, &$rootElement) { function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
global $base_url; global $base_url;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;

6
plugins/FormBuilder.inc

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

2
plugins/ImageManipulation.inc

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

4
plugins/ModsFormBuilder.inc

@ -24,7 +24,7 @@ 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', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$this->pid = $pid; $this->pid = $pid;
@ -256,7 +256,7 @@ class ModsFormBuilder extends FormBuilder {
*/ */
function handleModsForm(&$form_values, &$form_state) { function handleModsForm(&$form_values, &$form_state) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'core/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.

6
plugins/Refworks.inc

@ -223,8 +223,8 @@ class Refworks {
*/ */
function handleForm(&$form_values) { function handleForm(&$form_values) {
$errorMessage = NULL; $errorMessage = NULL;
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'core/ContentModel');
module_load_include('inc', 'fedora_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']);
@ -389,7 +389,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', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;
$this->createRomeoDataStream($dom, $rootElement); $this->createRomeoDataStream($dom, $rootElement);

6
plugins/ShowStreamsInFieldSets.inc

@ -143,7 +143,7 @@ class ShowStreamsInFieldSets {
* @return type * @return type
*/ */
function showQdc() { function showQdc() {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
$content = $objectHelper->getQDC($this->pid); $content = $objectHelper->getQDC($this->pid);
$collection_fieldset = array( $collection_fieldset = array(
@ -174,7 +174,7 @@ class ShowStreamsInFieldSets {
*/ */
function showRefworks() { function showRefworks() {
$path = drupal_get_path('module', 'fedora_repository'); $path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/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);
@ -227,7 +227,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', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'core/CollectionClass');
$collectionHelper = new CollectionClass(); $collectionHelper = new CollectionClass();
$xmlstr = $collectionHelper->getStream($this->pid, "ROMEO", 0); $xmlstr = $collectionHelper->getStream($this->pid, "ROMEO", 0);

6
plugins/herbarium.inc

@ -75,7 +75,7 @@ class Herbarium {
*/ */
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
module_load_include('inc', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
global $user; global $user;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$dwc = new DarwinCore($this->item); $dwc = new DarwinCore($this->item);
@ -97,7 +97,7 @@ class Herbarium {
* Create fedora object * Create fedora object
* Add the datastreams * Add the datastreams
*/ */
module_load_include('inc', 'fedora_repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/MimeClass');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
global $user; global $user;
@ -184,7 +184,7 @@ class Herbarium {
'#title' => t('Darwin Core'), '#title' => t('Darwin Core'),
'#content' => $dwc->asHTML(), '#content' => $dwc->asHTML(),
); );
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/ObjectHelper');
$obj = new ObjectHelper(); $obj = new ObjectHelper();
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE'); $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE');

Loading…
Cancel
Save