From 8fd7a03999ae58c8484adfa4cb36d0f5b92652f2 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 17 Jan 2011 16:39:00 -0400 Subject: [PATCH 01/38] Started work to move collections into content model. --- CollectionClass.inc | 77 ++++++++++++++++++- ObjectHelper.inc | 181 ++++++++++++++++++++------------------------ 2 files changed, 156 insertions(+), 102 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 553634a4..142fd765 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -26,12 +26,13 @@ class CollectionClass { * @param string $pid The pid of the collection to represent. * @return CollectionClass */ - function CollectionClass($pid = NULL) { - drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); + function __construct($pid = NULL) { if (!empty($pid)) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $this->collectionObject = new ObjectHelper($pid); + $this->pid = $pid; } + } /* gets objects related to this object. must include offset and limit @@ -395,6 +396,78 @@ class CollectionClass { user_save($user, $personal_collection_pid); return TRUE; } + + function showFieldSets() { + + global $base_url; + + $tabset = array(); + + $tabset['my_tabset'] = array( + '#type' => 'tabset', + ); + + global $user; + $objectHelper = new ObjectHelper(); + $results = $this->getRelatedItems($this->pid, NULL); + + + + $html = $objectHelper->renderCollection($results, $this->pid ); + + + + $tabset['my_tabset']['second_tab'] = array( +// $collection_fieldset = array ( + '#type' => 'tabpage', + '#title' => t('Members'), + '#content' => $html + ); + $tabset['my_tabset']['first_tab'] = array( + // #type and #title are the minimum requirements. + '#type' => 'tabpage', + '#title' => t('View'), + // This will be the content of the tab. + '#content' => 'what what', + ); + $tabset['my_tabset']['third_tab'] = array( + '#type' => 'tabpage', + '#title' => t('Description'), + ); + $tabset['my_tabset']['third_tab']['tabset'] = array( + '#type' => 'tabset', + ); + + $tabset['my_tabset']['third_tab']['tabset']['view'] = array( + '#type' => 'tabpage', + '#title' => t('Darwin Core'), + '#content' => "METADATA", + ); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); +/* $obj = new ObjectHelper(); + if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { + $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE'); + $tabset['my_tabset']['third_tab']['tabset']['edit'] = array( + '#type' => 'tabpage', + '#title' => t('Edit'), + '#content' => $editform, + ); + $tabset['my_tabset']['third_tab']['tabset']['source'] = array( + '#type' => 'tabpage', + '#title' => t('Vew Source'), + ); + $xmlsrc = $dwc->asXML(); + $tabset['my_tabset']['third_tab']['tabset']['source']['srctext'] = array( + '#name' => 'source', + '#type' => 'textarea', + '#value' => $xmlsrc, + '#id' => 'source', + '#height' => 50, + ); + } +*/ + return tabs_render($tabset); + } } diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 9b24f088..6b6c9dec 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -666,56 +666,6 @@ class ObjectHelper { $isCollection = TRUE; } } - - //$label=$content; - $collectionName = $collection; - if (!$pageNumber) { - $pageNumber = 1; - } - - if (!isset($collectionName)) { - $collectionName = variable_get('fedora_repository_name', 'Collection'); - } - $xslContent = $this->getXslContent($pid, $path); - - //get collection list and display using xslt------------------------------------------- - - if (isset($content) && $content != FALSE) { - $input = new DomDocument(); - $input->loadXML(trim($content)); - $results = $input->getElementsByTagName('result'); - if ($results->length > 0) { - try { - $proc = new XsltProcessor(); - $proc->setParameter('', 'collectionPid', $collection_pid); - $proc->setParameter('', 'collectionTitle', $collectionName); - $proc->setParameter('', 'baseUrl', $base_url); - $proc->setParameter('', 'path', $base_url . '/' . $path); - $proc->setParameter('', 'hitPage', $pageNumber); - $proc->registerPHPFunctions(); - $xsl = new DomDocument(); - $xsl->loadXML($xslContent); - // php xsl does not seem to work with namespaces so removing it below - // I may have just been being stupid here - // $content = str_ireplace('xmlns="http://www.w3.org/2001/sw/DataAccess/rf1/result"', '', $content); - - $xsl = $proc->importStylesheet($xsl); - $newdom = $proc->transformToDoc($input); - - $objectList = $newdom->saveXML(); //is the xml transformed to html as defined in the xslt associated with the collection object - - if (!$objectList) { - throw new Exception("Invalid XML."); - } - } catch (Exception $e) { - drupal_set_message(t('!e', array('!e' => $e->getMessage())), 'error'); - return ''; - } - } - } else { - drupal_set_message(t("No Objects in this collection or bad query.")); - } - //-------------------------------------------------------------------------------- //show the collections datastreams if ($results->length > 0 || $isCollection == TRUE) { @@ -739,45 +689,10 @@ class ObjectHelper { else { $ingestObject = ' '; } - - - $datastreams .= $ingestObject; - - $objectListOut = ''; - if (isset($objectList)) { - $object_list_fieldset = array( - '#title' => t('Items in this collection'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#value' => (isset($objectList) ? $objectList : ''), //collection list - ); - $objectListOut = theme('fieldset', $object_list_fieldset); - } - } else { - //$collectionName=''; - $collection_fieldset = array( - '#title' => "", - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#value' => $datastreams, - ); - $objectListOut = ''; //no collection objects to show so don't show field set } - $output = ''; - switch (variable_get('fedora_object_display_title', ObjectHelper::$DISPLAY_ALWAYS)) { - case ObjectHelper :: $DISPLAY_NEVER: break; - case ObjectHelper :: $DISPLAY_NO_MODEL_OUTPUT: - if (trim($datastreams) == '') { - $output .= '' . $collectionName . '
'; - } - break; + $datastreams .= $ingestObject; - case ObjectHelper :: $DISPLAY_ALWAYS: - default: - $output .= '' . $collectionName . '
'; - break; - } $output .= $datastreams; @@ -808,20 +723,7 @@ class ObjectHelper { $output .= theme('fieldset', $fieldset); } - switch (variable_get('fedora_collection_display_list', ObjectHelper::$DISPLAY_ALWAYS)) { - case ObjectHelper :: $DISPLAY_NEVER: break; - case ObjectHelper :: $DISPLAY_NO_MODEL_OUTPUT: - if (trim($datastreams) == '') { - $output .= $objectListOut . '
'; - } - break; - - case ObjectHelper :: $DISPLAY_ALWAYS: - default: - $output .= $objectListOut . '
'; - break; - } - + return $output; } @@ -869,6 +771,85 @@ class ObjectHelper { return $parent_collections_HTML; } + function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { + $path = drupal_get_path('module', 'fedora_repository'); + global $base_url; + $collection_pid = $pid; //we will be changing the pid later maybe + //module_load_include('php', ''Fedora_Repository'', 'ObjectHelper'); + $objectHelper = $this; + $parsedContent = NULL; + $contentModels = $objectHelper->get_content_models_list($pid); + $isCollection = FALSE; + //if this is a collection object store the $pid in the session as it will come in handy + //after a purge or ingest to return to the correct collection. + + $fedoraItem = NULL; + + + + $collectionName = $collection; + if (!$pageNumber) { + $pageNumber = 1; + } + + if (!isset($collectionName)) { + $collectionName = variable_get('fedora_repository_name', 'Collection'); + } + $xslContent = $this->getXslContent($pid, $path); + + //get collection list and display using xslt------------------------------------------- + + if (isset($content) && $content != FALSE) { + $input = new DomDocument(); + $input->loadXML(trim($content)); + $results = $input->getElementsByTagName('result'); + if ($results->length > 0) { + try { + $proc = new XsltProcessor(); + $proc->setParameter('', 'collectionPid', $collection_pid); + $proc->setParameter('', 'collectionTitle', $collectionName); + $proc->setParameter('', 'baseUrl', $base_url); + $proc->setParameter('', 'path', $base_url . '/' . $path); + $proc->setParameter('', 'hitPage', $pageNumber); + $proc->registerPHPFunctions(); + $xsl = new DomDocument(); + $xsl->loadXML($xslContent); + // php xsl does not seem to work with namespaces so removing it below + // I may have just been being stupid here + // $content = str_ireplace('xmlns="http://www.w3.org/2001/sw/DataAccess/rf1/result"', '', $content); + + $xsl = $proc->importStylesheet($xsl); + $newdom = $proc->transformToDoc($input); + + $objectList = $newdom->saveXML(); //is the xml transformed to html as defined in the xslt associated with the collection object + + if (!$objectList) { + throw new Exception("Invalid XML."); + } + } catch (Exception $e) { + drupal_set_message(t('!e', array('!e' => $e->getMessage())), 'error'); + return ''; + } + } + } else { + drupal_set_message(t("No Objects in this collection or bad query.")); + } + + + $object_list_fieldset = array( + '#title' => t('Items in this collection'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#value' => (isset($objectList) ? $objectList : ''),); + $objectListOut = theme('fieldset', $object_list_fieldset); + + + $output .= $objectListOut . '
'; + + return $output; + } + + /** * gets a list of datastreams and related function that we should use to show datastreams in their own fieldsets * from the content model associated with the object From e0be6600e49ebeee6f878e36e67d0e616ce38769 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Wed, 19 Jan 2011 16:01:38 -0400 Subject: [PATCH 02/38] Moved collection rendering into the content model. --- CollectionClass.inc | 4 ++-- ContentModel.inc | 4 ++-- ObjectHelper.inc | 6 +++--- fedora_repository.module | 9 +++++++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 142fd765..b86d9b20 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -397,7 +397,7 @@ class CollectionClass { return TRUE; } - function showFieldSets() { + function showFieldSets($page_number) { global $base_url; @@ -413,7 +413,7 @@ class CollectionClass { - $html = $objectHelper->renderCollection($results, $this->pid ); + $html = $objectHelper->renderCollection($results, $this->pid, NULL, NULL, $page_number ); diff --git a/ContentModel.inc b/ContentModel.inc index 5ed33d59..a28c7ff9 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -1437,7 +1437,7 @@ class ContentModel extends XMLDatastream { * @param string $pid * @return string $output */ - public function displayExtraFieldset($pid) { + public function displayExtraFieldset($pid, $page_number) { $output = ''; if ($this->validate()) { $datastreams = $this->xml->getElementsByTagName('datastreams'); @@ -1467,7 +1467,7 @@ class ContentModel extends XMLDatastream { self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.'; } else { - $output .= $class->$methodName(); + $output .= $class->$methodName($page_number); } } } diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 6b6c9dec..73a25deb 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -844,7 +844,7 @@ class ObjectHelper { $objectListOut = theme('fieldset', $object_list_fieldset); - $output .= $objectListOut . '
'; + $output = $objectListOut . '
'; return $output; } @@ -854,7 +854,7 @@ class ObjectHelper { * gets a list of datastreams and related function that we should use to show datastreams in their own fieldsets * from the content model associated with the object */ - function createExtraFieldsets($pid, $contentModel) { + function createExtraFieldsets($pid, $contentModel, $page_number) { //$models = $collectionHelper->getContentModels($collectionPid, FALSE); // possible problem in below if the collection policy has multiple content models //with different pids but same dsid we could get wrong one, low probability and functionality @@ -865,7 +865,7 @@ class ObjectHelper { $output = ''; module_load_include('inc', 'fedora_repository', 'ContentModel'); if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) { - $output .= $cm->displayExtraFieldset($pid); + $output .= $cm->displayExtraFieldset($pid, $page_number); } return $output; } diff --git a/fedora_repository.module b/fedora_repository.module index c67ca207..ac612ac9 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -808,9 +808,14 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $offset = $limit * $pageNumber; - $results = $collectionClass->getRelatedObjects($pid, $limit, $offset, NULL); //updated so we can do paging in query not in xslt + //$results = $collectionClass->getRelatedObjects($pid, $limit, $offset, NULL); //updated so we can do paging in query not in xslt //$results = $collectionClass->getRelatedItems($pid, NULL); - $content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); + $content_models = $objectHelper->get_content_models_list($pid); + foreach ($content_models as $content_model) { + $content .= $objectHelper->createExtraFieldsets($pid, $content_model, $pageNumber); + } + //$content .= $objectHelper + //$content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); //the below is for islandlives we should be able to do this in the xslt though //$css=$path.'/stylesheets/container-large.css'; //drupal_add_css($css); From d0fc4ad9010aec308994501c9c848df0c50319b5 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Wed, 19 Jan 2011 16:32:55 -0400 Subject: [PATCH 03/38] ISLANDORA-171 removed fieldset around collection. --- ObjectHelper.inc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 73a25deb..73498578 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -834,19 +834,7 @@ class ObjectHelper { } else { drupal_set_message(t("No Objects in this collection or bad query.")); } - - - $object_list_fieldset = array( - '#title' => t('Items in this collection'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#value' => (isset($objectList) ? $objectList : ''),); - $objectListOut = theme('fieldset', $object_list_fieldset); - - - $output = $objectListOut . '
'; - - return $output; + return $objectList; } From f492f3e5d26f8ad8005f52b66a40636cdeaa0722 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 20 Jan 2011 11:38:41 -0400 Subject: [PATCH 04/38] Added ingest form as a tab. --- CollectionClass.inc | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index b86d9b20..437549c2 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -411,24 +411,24 @@ class CollectionClass { $objectHelper = new ObjectHelper(); $results = $this->getRelatedItems($this->pid, NULL); + $collection_items = $objectHelper->renderCollection($results, $this->pid, NULL, NULL, $page_number ); + $show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_ingest_form') + && (!empty($_POST['op']) && $_POST['op'] == 'Next'); + $add_to_collection = $this->getIngestInterface(); - - $html = $objectHelper->renderCollection($results, $this->pid, NULL, NULL, $page_number ); - - - - $tabset['my_tabset']['second_tab'] = array( + $tabset['my_tabset']['view_tab'] = array( // $collection_fieldset = array ( '#type' => 'tabpage', '#title' => t('Members'), - '#content' => $html + '#content' => $collection_items ); - $tabset['my_tabset']['first_tab'] = array( + $tabset['my_tabset']['add_tab'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', - '#title' => t('View'), + '#title' => t('Add / Edit'), + '#selected' => $show_ingest_tab, // This will be the content of the tab. - '#content' => 'what what', + '#content' => $add_to_collection, ); $tabset['my_tabset']['third_tab'] = array( '#type' => 'tabpage', @@ -469,5 +469,29 @@ class CollectionClass { return tabs_render($tabset); } + function getIngestInterface() { + global $base_url; + $objectHelper = new ObjectHelper(); + module_load_include('inc', 'Fedora_Repository', 'CollectionPolicy'); + $collectionPolicyExists = $objectHelper->getMimeType($this->pid, CollectionPolicy::getDefaultDSID()); + if (user_access(ObjectHelper :: $INGEST_FEDORA_OBJECTS) && $collectionPolicyExists) { + if (!empty($collectionPolicyExists)) { + $allow=TRUE; + if (module_exists('fedora_fesl')) { + $allow= fedora_fesl_check_roles($this->pid,'write'); + } + if ($allow) { + // $ingestObject = ' Date: Thu, 20 Jan 2011 11:42:54 -0400 Subject: [PATCH 05/38] ISLANDORA-171 Added a comment to explain tab activation code. --- CollectionClass.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CollectionClass.inc b/CollectionClass.inc index 437549c2..d3495621 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -412,6 +412,8 @@ class CollectionClass { $results = $this->getRelatedItems($this->pid, NULL); $collection_items = $objectHelper->renderCollection($results, $this->pid, NULL, NULL, $page_number ); + + // 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'] == 'fedora_repository_ingest_form') && (!empty($_POST['op']) && $_POST['op'] == 'Next'); $add_to_collection = $this->getIngestInterface(); From 047bb78319250d1ea69989ff4f89ecf312c68dfb Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 20 Jan 2011 13:06:35 -0400 Subject: [PATCH 06/38] Check for form post to display ingest form. --- CollectionClass.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index d3495621..fc82cfd8 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -414,8 +414,7 @@ class CollectionClass { $collection_items = $objectHelper->renderCollection($results, $this->pid, NULL, NULL, $page_number ); // 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'] == 'fedora_repository_ingest_form') - && (!empty($_POST['op']) && $_POST['op'] == 'Next'); + $show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_ingest_form'); $add_to_collection = $this->getIngestInterface(); $tabset['my_tabset']['view_tab'] = array( From da5fb410a4c0316341272d585fc6c39c45a588ae Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 21 Jan 2011 11:47:33 -0400 Subject: [PATCH 07/38] Added datastream list and DC to collection tab view. --- CollectionClass.inc | 10 ++-- ObjectHelper.inc | 108 ++++++++++++++++++++++---------------------- 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index fc82cfd8..49bde84e 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -412,7 +412,7 @@ class CollectionClass { $results = $this->getRelatedItems($this->pid, NULL); $collection_items = $objectHelper->renderCollection($results, $this->pid, NULL, NULL, $page_number ); - + $collection_item = new Fedora_Item($this->pid); // 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'] == 'fedora_repository_ingest_form'); $add_to_collection = $this->getIngestInterface(); @@ -438,12 +438,16 @@ class CollectionClass { $tabset['my_tabset']['third_tab']['tabset'] = array( '#type' => 'tabset', ); + $dc_html = $objectHelper->getQDC($this->pid); + + $ds_list = $objectHelper->getFormattedDatastreamList($this->pid, NULL, $collection_item); $tabset['my_tabset']['third_tab']['tabset']['view'] = array( '#type' => 'tabpage', - '#title' => t('Darwin Core'), - '#content' => "METADATA", + '#title' => t('View'), + '#content' => $dc_html . $ds_list, ); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); /* $obj = new ObjectHelper(); if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 73498578..75e1d0dd 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -392,6 +392,59 @@ class ObjectHelper { return $output; } + function getFormattedDatastreamList($object_pid, $contentModels, &$fedoraItem) { + $availableDataStreamsText = 'Detailed List of Content'; + //$metaDataText='Description'; + $mainStreamLabel = NULL; + $object = $fedoraItem->get_datastreams_list_as_SimpleXML(); + if (!isset($object)) { + drupal_set_message(t("No datastreams available")); + return ' '; + } + $hasOBJStream = NULL; + $hasTNStream = FALSE; + $dataStreamBody = "
\n"; + + $cmDatastreams = array(); + if (variable_get('fedora_object_restrict_datastreams', FALSE) == TRUE && ($cm = ContentModel::loadFromObject($object_pid)) !== FALSE) { + $cmDatastreams = $cm->listDatastreams(); + } + + $dataStreamBody .= $this->get_parent_objects_asHTML($object_pid); + $dataStreamBody .= ''; + foreach ($object as $datastream) { + foreach ($datastream as $datastreamValue) { + + if (variable_get('fedora_object_restrict_datastreams', FALSE) == FALSE || ((isset($user) && in_array('administrator',$user->roles)) || in_array($datastreamValue->ID,$cmDatastreams))) { + if ($datastreamValue->ID == 'OBJ') { + $hasOBJStream = '1'; + $mainStreamLabel = $datastreamValue->label; + $mainStreamLabel = str_replace("_", " ", $mainStreamLabel); + } + if ($datastreamValue->ID == 'TN') { + $hasTNStream = TRUE; + } + //create the links to each datastream + $dataStreamBody .= $this->create_link_for_ds($object_pid, $datastreamValue); //"\n"; + } + } + } + $dataStreamBody .= "

' . t("!text", array('!text' => $availableDataStreamsText)) . '

$key :$value
\n"; + //if they have access let them add a datastream + if (user_access(ObjectHelper :: $ADD_FEDORA_STREAMS)) { + $allow=TRUE; + if (module_exists('fedora_fesl')) { + $allow= fedora_fesl_check_roles($object_pid,'write'); + } + if ($allow) { + $dataStreamBody .= drupal_get_form('add_stream_form', $object_pid); + } + } + + $dataStreamBody = '
' . $dataStreamBody . '
'; + return $dataStreamBody; + } + /** * Gets a list of datastreams from an object using its pid * @@ -417,60 +470,7 @@ class ObjectHelper { $fedoraItem = new Fedora_Item($object_pid); if (user_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST)) { - $availableDataStreamsText = 'Detailed List of Content'; - //$metaDataText='Description'; - $mainStreamLabel = NULL; - $object = $fedoraItem->get_datastreams_list_as_SimpleXML(); - if (!isset($object)) { - drupal_set_message(t("No datastreams available")); - return ' '; - } - $hasOBJStream = NULL; - $hasTNStream = FALSE; - $dataStreamBody = "
\n"; - - $cmDatastreams = array(); - if (variable_get('fedora_object_restrict_datastreams', FALSE) == TRUE && ($cm = ContentModel::loadFromObject($object_pid)) !== FALSE) { - $cmDatastreams = $cm->listDatastreams(); - } - - $dataStreamBody .= $this->get_parent_objects_asHTML($object_pid); - $dataStreamBody .= ''; - foreach ($object as $datastream) { - foreach ($datastream as $datastreamValue) { - - if (variable_get('fedora_object_restrict_datastreams', FALSE) == FALSE || ((isset($user) && in_array('administrator',$user->roles)) || in_array($datastreamValue->ID,$cmDatastreams))) { - if ($datastreamValue->ID == 'OBJ') { - $hasOBJStream = '1'; - $mainStreamLabel = $datastreamValue->label; - $mainStreamLabel = str_replace("_", " ", $mainStreamLabel); - } - if ($datastreamValue->ID == 'TN') { - $hasTNStream = TRUE; - } - //create the links to each datastream - $dataStreamBody .= $this->create_link_for_ds($object_pid, $datastreamValue); //"\n"; - } - } - } - $dataStreamBody .= "

' . t("!text", array('!text' => $availableDataStreamsText)) . '

$key :$value
\n"; - //if they have access let them add a datastream - if (user_access(ObjectHelper :: $ADD_FEDORA_STREAMS)) { - $allow=TRUE; - if (module_exists('fedora_fesl')) { - $allow= fedora_fesl_check_roles($object_pid,'write'); - } - if ($allow) { - $dataStreamBody .= drupal_get_form('add_stream_form', $object_pid); - } - } - $fieldset = array( - '#title' => t("!text", array('!text' => $availableDataStreamsText)), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#value' => $dataStreamBody - ); - $dataStreamBody = '
' . theme('fieldset', $fieldset) . '
'; + $dataStreamBody = $this->getFormattedDatastreamList($object_pid, $contentModels, $fedoraItem); } $content = ''; From 4e23d8ddc6aaceb8d9ed40b355dc37075bcc4e50 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 21 Jan 2011 14:54:30 -0400 Subject: [PATCH 08/38] Added metadata edit form to collection view. --- CollectionClass.inc | 22 ++++------------------ ObjectHelper.inc | 38 ++++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 49bde84e..266f04e1 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -431,14 +431,14 @@ class CollectionClass { // This will be the content of the tab. '#content' => $add_to_collection, ); - $tabset['my_tabset']['third_tab'] = array( + $tabset['my_tabset']['third_tab'] = array( '#type' => 'tabpage', '#title' => t('Description'), ); $tabset['my_tabset']['third_tab']['tabset'] = array( '#type' => 'tabset', ); - $dc_html = $objectHelper->getQDC($this->pid); + $dc_html = $objectHelper->getFormattedDC($collection_item); $ds_list = $objectHelper->getFormattedDatastreamList($this->pid, NULL, $collection_item); @@ -448,29 +448,15 @@ class CollectionClass { '#content' => $dc_html . $ds_list, ); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); -/* $obj = new ObjectHelper(); 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, 'DC'); $tabset['my_tabset']['third_tab']['tabset']['edit'] = array( '#type' => 'tabpage', '#title' => t('Edit'), '#content' => $editform, ); - $tabset['my_tabset']['third_tab']['tabset']['source'] = array( - '#type' => 'tabpage', - '#title' => t('Vew Source'), - ); - $xmlsrc = $dwc->asXML(); - $tabset['my_tabset']['third_tab']['tabset']['source']['srctext'] = array( - '#name' => 'source', - '#type' => 'textarea', - '#value' => $xmlsrc, - '#id' => 'source', - '#height' => 50, - ); + } -*/ return tabs_render($tabset); } diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 75e1d0dd..6b11efc3 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -313,16 +313,8 @@ class ObjectHelper { return $content; } - /** - * Queries fedora for what we call the qualified dublin core. Currently only dc.coverage has - * any qualified fields - * Transforms the returned xml to html - * This is the default metadata view. With icons for searching a dublin core field - * @param $pid String - * @return String - */ - function getQDC($pid) { - global $base_url; + function getFormattedDC($item) { + global $base_url; $path = drupal_get_path('module', 'fedora_repository'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); @@ -331,7 +323,7 @@ class ObjectHelper { $dsId = 'QDC'; $params = array( - 'pid' => "$pid", + 'pid' => "$item->pid", 'dsID' => "$dsId", 'asOfDateTime' => "" ); @@ -343,7 +335,7 @@ class ObjectHelper { try { //probably no QDC so we will try for the DC stream. $dsId = 'DC'; $params = array( - 'pid' => "$pid", + 'pid' => "$item->pid", 'dsID' => "$dsId", 'asOfDateTime' => "" ); @@ -377,7 +369,25 @@ class ObjectHelper { $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); $output = $newdom->saveXML(); - $baseUrl = base_path(); + return $output; + } + + /** + * Queries fedora for what we call the qualified dublin core. Currently only dc.coverage has + * any qualified fields + * Transforms the returned xml to html + * This is the default metadata view. With icons for searching a dublin core field + * @param $pid String + * @return String + */ + function getQDC($pid) { + global $base_url; + $item = new Fedora_Item($pid); + $ds_list = $item->get_datastreams_list_as_array(); + $output = $this->getFormattedDC($item); + $dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC'; + + //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1)); if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { $allow=TRUE; @@ -386,7 +396,7 @@ class ObjectHelper { } if ($allow) { $output .= '
' . t('Edit Meta Data') . ''; + $dsid . '">' . t('Edit Meta Data') . ''; } } return $output; From c77a5d0059d2f1a4dea7f4310cd81e3cced7fe78 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 21 Jan 2011 15:09:44 -0400 Subject: [PATCH 09/38] ISLANDORA-171 Got getQED() to use Fedora_Item, stop attempting to get QDC --- ObjectHelper.inc | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 6b11efc3..7299e64c 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -314,40 +314,13 @@ class ObjectHelper { } function getFormattedDC($item) { - global $base_url; + global $base_url; $path = drupal_get_path('module', 'fedora_repository'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); - - $dsId = 'QDC'; - $params = array( - 'pid' => "$item->pid", - 'dsID' => "$dsId", - 'asOfDateTime' => "" - ); - try { - $object = $client->__soapCall('getDatastreamDissemination', array( - 'parameters' => $params - )); - } catch (Exception $e) { - try { //probably no QDC so we will try for the DC stream. - $dsId = 'DC'; - $params = array( - 'pid' => "$item->pid", - 'dsID' => "$dsId", - 'asOfDateTime' => "" - ); - $object = $client->__soapCAll('getDatastreamDissemination', array( - 'parameters' => $params - )); - } catch (exception $e2) { - drupal_set_message($e2->getMessage(), 'error'); - return; - } - } - $xmlstr = $object->dissemination->stream; + $dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC'; + $xmlstr = $item->get_datastream_dissemination($dsid); + try { $proc = new XsltProcessor(); } catch (Exception $e) { From d86024d8f687d3fcf6750d791f932807892acd69 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 21 Jan 2011 15:20:32 -0400 Subject: [PATCH 10/38] ISLANDORA-171 minor formatting. --- ObjectHelper.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 7299e64c..6cf3a715 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -307,9 +307,7 @@ class ObjectHelper { } } - $content .= "$label $view $downloadVersion $mimeType $replaceImage $purgeImage\n"; - //$content .= "Mime Type :$mimeType\n"; return $content; } @@ -320,6 +318,10 @@ class ObjectHelper { $dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC'; $xmlstr = $item->get_datastream_dissemination($dsid); + + if (empty($xmlstr)) { + return ''; + } try { $proc = new XsltProcessor(); From 4744ff2e28512a27e044e972ed71c6da772c6a47 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 21 Jan 2011 15:43:31 -0400 Subject: [PATCH 11/38] Added available datastreams to colleciton content model. --- CollectionClass.inc | 2 +- content_models/COLLECTIONCM.xml | 90 +- content_models/islandora_collectionCModel.xml | 860 +++++++++--------- 3 files changed, 522 insertions(+), 430 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 266f04e1..7e2b3626 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -445,7 +445,7 @@ class CollectionClass { $tabset['my_tabset']['third_tab']['tabset']['view'] = array( '#type' => 'tabpage', '#title' => t('View'), - '#content' => $dc_html . $ds_list, + '#content' => $dc_html . $ds_list . drupal_get_form('add_stream_form', $this->pid), ); if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { diff --git a/content_models/COLLECTIONCM.xml b/content_models/COLLECTIONCM.xml index 85ed18d1..144dbad8 100644 --- a/content_models/COLLECTIONCM.xml +++ b/content_models/COLLECTIONCM.xml @@ -1 +1,89 @@ - text/xml text/plain application/xml The name given to the resource An entity primarily responsible for making the content of the resource such as a person, organization or service. An entity primarily responsible for making the content of the resource such as a person, organization or service. none Multi Media image meeting presentation sound text Examples include an abstract, table of contents, or free-text account of the content of the resource. An entity, (including persons, organizations, or services), responsible for making the resource available. An entity responsible for contributing to the content of the resource such as a person, organization or service. Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. none collection dataset event image interactive resource model party physical object place service software sound text A reference to a resource from which the present resource is derived. A unique reference to the resource; In this instance, the accession number or collection number. The language of the intellectual content of the resource. English French Reference to a related resource. Information about intellectual property rights, copyright, and various property rights. \ No newline at end of file + + + + text/xml + text/plain + application/xml + + + + + + + + + + + + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + diff --git a/content_models/islandora_collectionCModel.xml b/content_models/islandora_collectionCModel.xml index c8c7154a..330a62cf 100644 --- a/content_models/islandora_collectionCModel.xml +++ b/content_models/islandora_collectionCModel.xml @@ -5,11 +5,11 @@ - - + + - @@ -17,559 +17,563 @@ ingest - fedoraAdmin - 2009-02-24T14:23:47.169Z - Created with Admin GUI "New Object" command + admin + 2010-12-20T16:14:50.165Z + Fedora Object Ingested addDatastream - ISLANDORACM - fedoraAdmin - 2009-02-24T16:05:35.823Z - DatastreamsPane generated this logMessage. + RELS-EXT + admin + 2010-12-20T16:14:50.352Z + Ingested object RELS-EXT - ingest - - fedoraAdmin - 2009-03-31T18:10:17.791Z - Ingested from local file /Applications/MAMP/htdocs/f3/sites/all/modules/fedora_repository/installer_files/foxml/islandora-collectionCModel.xml + modifyDatastreamByValue + RELS-EXT + admin + 2010-12-20T16:14:50.407Z + Modified by Islandora API - purgeDatastream + addDatastream ISLANDORACM - fedoraAdmin - 2009-03-31T18:12:53.830Z - DatastreamPane generated this logMessage. . . . Purged datastream (ID=ISLANDORACM), versions ranging from 2009-02-24T12:05:35.823Z to 2009-02-24T12:05:35.823Z. This resulted in the permanent removal of 1 datastream version(s) (2009-02-24T12:05:35.823Z) and all associated audit records. + admin + 2010-12-20T16:14:50.475Z + Ingested object ISLANDORACM - ingest - - admin - 2010-01-05T20:29:36.835Z - Fedora Object Ingested + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2011-01-17T15:04:59.169Z + - addDatastream + modifyDatastreamByValue ISLANDORACM - admin - 2010-01-05T20:29:37.047Z - Ingested object ISLANDORACM + fedoraAdmin + 2011-01-17T15:06:08.023Z + modifyDatastreamByValue ISLANDORACM fedoraAdmin - 2010-05-05T14:23:39.206Z + 2011-01-21T19:40:39.790Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2011-01-21T19:41:19.709Z + + + + + Islandora Collection Content Model + islandora:collectionCModel + + + + - + + + + + + + + - + - + - - + + - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - -
- - + + + text/xml + text/plain + application/xml + + + + + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + - - - + - - Islandora Collection Content Model - islandora:collectionCModel - + + + text/xml + text/plain + application/xml + + + + + + + + + + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + - - - + + + + + text/xml + text/plain + application/xml + + + + + + + + + + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + + + + - + text/xml text/plain application/xml - - - - text/xml - - - text/plain - - - application/xml - - - - + + + + + + + + + - - plugins/CollectionFormBuilder.php - CollectionFormBuilder - buildQDCForm - handleQDCForm - + - - - dc:title - textfield + The name given to the resource - true - - - dc:creator - textfield + An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - dc:subject - select + An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - none - none - - - Multi Media - Multi Media - - - image - image - - - meeting - meeting - - - presentation - presentation - - - sound - sound - - - text - text - + none + Multi Media + image + meeting + presentation + sound + text - - - dc:description - textarea + Examples include an abstract, table of contents, or free-text account of the content of the resource. - true - - - dc:publisher - textfield + An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - dc:contributor - textfield + An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - dc:date - textfield + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - dc:type - select + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - none - none - - - collection - collection - - - dataset - dataset - - - event - event - - - image - image - - - interactive resource - interactive resource - - - model - model - - - party - party - - - physical object - physical object - - - place - place - - - service - service - - - software - software - - - sound - sound - - - text - text - + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text - - - dc:source - textfield + A reference to a resource from which the present resource is derived. - false - - - dc:identifier - textfield + A unique reference to the resource; In this instance, the accession number or collection number. - false - - - dc:language - select + The language of the intellectual content of the resource. - false - - eng - English - - - fre - French - + English + French - - - dc:relation - textfield + Reference to a related resource. - false - - - dc:rights - textarea + Information about intellectual property rights, copyright, and various property rights. - false - + - + text/xml text/plain application/xml - - - - text/xml - - - text/plain - - - application/xml - - - - + + + + + + + + - - plugins/CollectionFormBuilder.inc - CollectionFormBuilder - buildQDCForm - handleQDCForm - + - - - dc:title - textfield + The name given to the resource - true - - - dc:creator - textfield + An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - dc:subject - select + An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - none - none - - - Multi Media - Multi Media - - - image - image - - - meeting - meeting - - - presentation - presentation - - - sound - sound - - - text - text - + none + Multi Media + image + meeting + presentation + sound + text - - - dc:description - textarea + Examples include an abstract, table of contents, or free-text account of the content of the resource. - true - - - dc:publisher - textfield + An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - dc:contributor - textfield + An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - dc:date - textfield + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - dc:type - select + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - none - none - - - collection - collection - - - dataset - dataset - - - event - event - - - image - image - - - interactive resource - interactive resource - - - model - model - - - party - party - - - physical object - physical object - - - place - place - - - service - service - - - software - software - - - sound - sound - - - text - text - + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text - - - dc:source - textfield + A reference to a resource from which the present resource is derived. - false - - - dc:identifier - textfield + A unique reference to the resource; In this instance, the accession number or collection number. - false - - - dc:language - select + The language of the intellectual content of the resource. - false - - eng - English - - - fre - French - + English + French - - - dc:relation - textfield + Reference to a related resource. - false - - - dc:rights - textarea + Information about intellectual property rights, copyright, and various property rights. - false From f92e2267037a7d1384719b293600e6fb692ed9f1 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Fri, 21 Jan 2011 15:58:47 -0400 Subject: [PATCH 12/38] Fixed problem of available datastream list. --- CollectionClass.inc | 2 +- fedora_repository.module | 2 +- formClass.inc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 7e2b3626..266f04e1 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -445,7 +445,7 @@ class CollectionClass { $tabset['my_tabset']['third_tab']['tabset']['view'] = array( '#type' => 'tabpage', '#title' => t('View'), - '#content' => $dc_html . $ds_list . drupal_get_form('add_stream_form', $this->pid), + '#content' => $dc_html . $ds_list, ); if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { diff --git a/fedora_repository.module b/fedora_repository.module index 16f42c33..a4171e4f 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -356,7 +356,7 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } if (!(preg_match("/^[a-zA-Z]/", $dsid))) { - form_set_error('', t('Data stream ID has to start with a letter.')); + form_set_error('', t("Data stream ID ($dsid) has to start with a letter.")); return FALSE; } if (strlen($dsLabel) > 64) { diff --git a/formClass.inc b/formClass.inc index 356f31f3..72ecac17 100644 --- a/formClass.inc +++ b/formClass.inc @@ -704,7 +704,7 @@ class formClass { '#weight' => '-1', '#description' => t('Datastream IDs defined by the content model.'), ); - $form['stream_id']['#options'] = $unused_dsids; + $form['stream_id']['#options'] = array_combine($unused_dsids, $unused_dsids); } else { $form['stream_id'] = array( From ebc1c6ce120fb7142a24c5d41e9bc0969f69bfa2 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Wed, 26 Jan 2011 14:47:30 -0400 Subject: [PATCH 13/38] Moved renderCollection to CollectionClass.inc --- CollectionClass.inc | 83 +++++++++++++++++- ObjectHelper.inc | 2 +- ...8px-Crystal_Clear_app_download_manager.png | Bin 0 -> 4049 bytes images/Crystal_Clear_app_download_manager.png | Bin 0 -> 11019 bytes 4 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 images/48px-Crystal_Clear_app_download_manager.png create mode 100644 images/Crystal_Clear_app_download_manager.png diff --git a/CollectionClass.inc b/CollectionClass.inc index 266f04e1..ad736e65 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -397,6 +397,20 @@ class CollectionClass { return TRUE; } + /** + * Queries a collection object for an xslt to format how the + * collection of objects is displayed. + */ + function getXslContent($pid, $path, $canUseDefault = TRUE) { + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + $collectionClass = new CollectionClass(); + $xslContent = $collectionClass->getCollectionViewStream($pid); + if (!$xslContent && $canUseDefault) { //no xslt so we will use the default sent with the module + $xslContent = file_get_contents($path . '/xsl/sparql_to_html.xsl'); + } + return $xslContent; + } + function showFieldSets($page_number) { global $base_url; @@ -411,7 +425,7 @@ class CollectionClass { $objectHelper = new ObjectHelper(); $results = $this->getRelatedItems($this->pid, NULL); - $collection_items = $objectHelper->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); // 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'] == 'fedora_repository_ingest_form'); @@ -484,5 +498,72 @@ class CollectionClass { return $ingestObject; } + + function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { + $path = drupal_get_path('module', 'fedora_repository'); + global $base_url; + $collection_pid = $pid; //we will be changing the pid later maybe + //module_load_include('php', ''Fedora_Repository'', 'ObjectHelper'); + $objectHelper = new ObjectHelper(); + $parsedContent = NULL; + $contentModels = $objectHelper->get_content_models_list($pid); + $isCollection = FALSE; + //if this is a collection object store the $pid in the session as it will come in handy + //after a purge or ingest to return to the correct collection. + + $fedoraItem = NULL; + + + + $collectionName = $collection; + if (!$pageNumber) { + $pageNumber = 1; + } + + if (!isset($collectionName)) { + $collectionName = variable_get('fedora_repository_name', 'Collection'); + } + $xslContent = $this->getXslContent($pid, $path); + + //get collection list and display using xslt------------------------------------------- + $objectList = ''; + if (isset($content) && $content != FALSE) { + $input = new DomDocument(); + $input->loadXML(trim($content)); + $results = $input->getElementsByTagName('result'); + if ($results->length > 0) { + try { + $proc = new XsltProcessor(); + $proc->setParameter('', 'collectionPid', $collection_pid); + $proc->setParameter('', 'collectionTitle', $collectionName); + $proc->setParameter('', 'baseUrl', $base_url); + $proc->setParameter('', 'path', $base_url . '/' . $path); + $proc->setParameter('', 'hitPage', $pageNumber); + $proc->registerPHPFunctions(); + $xsl = new DomDocument(); + $xsl->loadXML($xslContent); + // php xsl does not seem to work with namespaces so removing it below + // I may have just been being stupid here + // $content = str_ireplace('xmlns="http://www.w3.org/2001/sw/DataAccess/rf1/result"', '', $content); + + $xsl = $proc->importStylesheet($xsl); + $newdom = $proc->transformToDoc($input); + + $objectList = $newdom->saveXML(); //is the xml transformed to html as defined in the xslt associated with the collection object + + if (!$objectList) { + throw new Exception("Invalid XML."); + } + } catch (Exception $e) { + drupal_set_message(t('!e', array('!e' => $e->getMessage())), 'error'); + return ''; + } + } + } else { + drupal_set_message(t("No Objects in this collection or bad query.")); + } + return $objectList; + } + } diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 6cf3a715..3276fc9f 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -783,7 +783,7 @@ class ObjectHelper { $xslContent = $this->getXslContent($pid, $path); //get collection list and display using xslt------------------------------------------- - + $objectList = ''; if (isset($content) && $content != FALSE) { $input = new DomDocument(); $input->loadXML(trim($content)); diff --git a/images/48px-Crystal_Clear_app_download_manager.png b/images/48px-Crystal_Clear_app_download_manager.png new file mode 100644 index 0000000000000000000000000000000000000000..d2fc764b6e4a5ba619b4875fdf968428f060d454 GIT binary patch literal 4049 zcmV;?4=(VDP)Dk{6Ltn!w0rGe1?g@#(}^xAZaDE zf?a7>tJ%5wtnRKO(+|}%JG(n84U)rTM@Dsbbya=8{J!s>UuFwlX}bsLqV1x6*f#8a znask}rDQ$>2l!EUyN;LM3ko)A@<;q7-{AE)9(`qI1h3ToXeuI&(zl#=!-?O!^Nu?w z=gmArKcw&aq%OrfUm9HOGQI%e1-)U9ub=)pPk#5w6<*Id{+1tbfdAii^ovJ{J{o=I z(~o}IH(k^JwC!upea+WDTkrEaJ`AW=YKMHK7dGC}KsXVOg<}|D$b3fTGg6;k-rd!` z@CEbnJk_u&$*8>=fZ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0_Q#FR=4=c`E_)lSezMSdZJ2fHDRETBiENBIO$A9?i32O~P3X*o0 zq}v4{m}pF)0)+>f-9FuZO1)y4sK-pyBBU(6R5-UY(%a#nq(llq;T*{zauvdaQ*_K$Vdh$p)pKM zPHZm`aL&{0^l5bmgn`290BZtt7!at^VCOwW;mC@DG%d*TazAM&YhHXnF+mbm7DX}{n#HHyvG@7M@2k;KG3DH`U6%K2y9L>fr?SUW&0hEoR@h}Vt zlw^9g@sh>a_DHfzVRj^PH^eo6Cw4fLfR#h#QdJ5;GR$ykj*Tov+c6*zLgKyK8(?Z` zk+s#n9jjHUD+^Q9s?okn{JrWFvBw*+=e2Of`V>JKqJ{S`NU+w_0WGDXD6RouZOmk& z5k)4f{P@iCY&P2nA+P?6<>hg9T_bjmME zHsh9qr#Hm;ub`A7jw@Vu-BDVtEe;>Po{fz)uDk9CLcr4U zJQL&Nq*(z72E&BM&pgT?O*nqwRvJ@t03^MHEKRe$QtdK;PG^(#^%q+>w-Fn2Sk!Cu zdTshi!ra^vv$ONmYIUr&Xst2El;yP$rFX(|VRGouQ5F}M2?9l}R%dzn5S>norKJ@% zHr82Qz78QI2NtIptJN3`Go+BL_0DqchEw>uL;lEfD0(kQ$kU8|(%l4xy4YI)7t*oj4AF6e)9}D5O@a5yut6FhB@70tgAifIPpRMq>u0B$Jb4 zOi#~I6vvpIo#FWLV=OGpVT__NJ%*`N2*V74*+cdi&bu0{zdAwDoAKzaF_rL*H%}*pLBcgI(+yLAN}=@A*Dx(-HRBBRB~tZw*_)r4i6t$L`t(f z%$aBYb2v=?6?k#K0OhtNG=MSSX9fTafpws@R}B0wre@PkbRI?M00000NkvXXu0mjf Dd||DW literal 0 HcmV?d00001 diff --git a/images/Crystal_Clear_app_download_manager.png b/images/Crystal_Clear_app_download_manager.png new file mode 100644 index 0000000000000000000000000000000000000000..77a1b8778d4e20027d225cbf0e7b18ad7f4b4986 GIT binary patch literal 11019 zcmV+mEA-TfP)hAyHwJfd+uBG zcBv$}s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hLi0q{d+iYXeyf26B%! z)BbuxQ#0(|xgEmc5efn{usDKP0Hu{c9NdJuH~MTrHYc%e)qud?lp1|`-Os303NAp! z0l-TLLWlHB_L>mV6c`D!KpGDrGStEL+TkI0R@0ay@ovZOVvewLjuwD`gxTga2EFCTK+<- zR6hd1K7xfRg&Few58r~mxu@Z&e|QR7tGT7$!uN#Xp~oJA?b~03TW=!glf!|>N1bV@0h{8XhbZ!ghX*JS5CnomFuX7k7jek}FF87N4B4{hrj|*Ab z=yJG)C&mJ`et65g70!&Dq3_3%V{kft8ZzX&pA38wkVlN-3CVbz0zVcTM*yTid~)$Q zmH=d%K;$9ESv2ebd<;rK(G`zUAmC$VgTWdK1YD}E(hcnt1c3mEJc!JizgLNV`dik* zLwmuzCGf+Z9|F`$2ajyW0G4$uBkCjojLB@M|B(*F)*9jgFfnBSAbRJ6-m`tHv=C~y z*^53Ix`-nqgEaa^pQl5(3H2%x4S{4X)19_htn^%hN|6%DsUcn~(T~1)F_FNvORs{P zPTd6kk$#{x7Nqs}_Cw-y0={tP128mZ{PfURG)AT0=;*-kR7wCe+p|Qk_lyjWtfI@F zE84L;xF#_HT?RWU%-jCPk@U6)g5xfqhI_13=d`so`Z}(5&w~4 zp74SMn3C$?iFkZ`7jb`XI&tg-EL^-mbwK;v3ueTO89tXt^TtgU@LGKp?~f-kVB{hz zTX>9x&tLKoIQaTSEKwUBPVg}egYSjHaIE_{k(@(kfqR0nAOWUifryFMUi`z)ExZOdfR>0`$Z9on(u Date: Wed, 26 Jan 2011 16:09:18 -0400 Subject: [PATCH 14/38] Adopted PDF content model to use tabs. --- ObjectHelper.inc | 81 +----------------------------- plugins/ShowStreamsInFieldSets.inc | 32 +++++++++--- 2 files changed, 27 insertions(+), 86 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 3276fc9f..81e09186 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -501,19 +501,7 @@ class ObjectHelper { return '
' . $content . '
'; } - /** - * Queries a collection object for an xslt to format how the - * collection of objects is displayed. - */ - function getXslContent($pid, $path, $canUseDefault = TRUE) { - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - $collectionClass = new CollectionClass(); - $xslContent = $collectionClass->getCollectionViewStream($pid); - if (!$xslContent && $canUseDefault) { //no xslt so we will use the default sent with the module - $xslContent = file_get_contents($path . '/xsl/sparql_to_html.xsl'); - } - return $xslContent; - } + /** * returns a stream from a fedora object given a pid and dsid @@ -755,73 +743,6 @@ class ObjectHelper { return $parent_collections_HTML; } - - function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { - $path = drupal_get_path('module', 'fedora_repository'); - global $base_url; - $collection_pid = $pid; //we will be changing the pid later maybe - //module_load_include('php', ''Fedora_Repository'', 'ObjectHelper'); - $objectHelper = $this; - $parsedContent = NULL; - $contentModels = $objectHelper->get_content_models_list($pid); - $isCollection = FALSE; - //if this is a collection object store the $pid in the session as it will come in handy - //after a purge or ingest to return to the correct collection. - - $fedoraItem = NULL; - - - - $collectionName = $collection; - if (!$pageNumber) { - $pageNumber = 1; - } - - if (!isset($collectionName)) { - $collectionName = variable_get('fedora_repository_name', 'Collection'); - } - $xslContent = $this->getXslContent($pid, $path); - - //get collection list and display using xslt------------------------------------------- - $objectList = ''; - if (isset($content) && $content != FALSE) { - $input = new DomDocument(); - $input->loadXML(trim($content)); - $results = $input->getElementsByTagName('result'); - if ($results->length > 0) { - try { - $proc = new XsltProcessor(); - $proc->setParameter('', 'collectionPid', $collection_pid); - $proc->setParameter('', 'collectionTitle', $collectionName); - $proc->setParameter('', 'baseUrl', $base_url); - $proc->setParameter('', 'path', $base_url . '/' . $path); - $proc->setParameter('', 'hitPage', $pageNumber); - $proc->registerPHPFunctions(); - $xsl = new DomDocument(); - $xsl->loadXML($xslContent); - // php xsl does not seem to work with namespaces so removing it below - // I may have just been being stupid here - // $content = str_ireplace('xmlns="http://www.w3.org/2001/sw/DataAccess/rf1/result"', '', $content); - - $xsl = $proc->importStylesheet($xsl); - $newdom = $proc->transformToDoc($input); - - $objectList = $newdom->saveXML(); //is the xml transformed to html as defined in the xslt associated with the collection object - - if (!$objectList) { - throw new Exception("Invalid XML."); - } - } catch (Exception $e) { - drupal_set_message(t('!e', array('!e' => $e->getMessage())), 'error'); - return ''; - } - } - } else { - drupal_set_message(t("No Objects in this collection or bad query.")); - } - return $objectList; - } - /** * gets a list of datastreams and related function that we should use to show datastreams in their own fieldsets diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index ad3f2829..d2108293 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -57,7 +57,8 @@ class ShowStreamsInFieldSets { */ function showPDFPreview() { global $base_url; - + global $user; + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $tabset = array(); $tabset['my_tabset'] = array( @@ -66,11 +67,33 @@ class ShowStreamsInFieldSets { $tabset['my_tabset']['first_tab'] = array( '#type' => 'tabpage', '#title' => t('Description'), - '#content' => $this->showQdc(), ); + $tabset['my_tabset']['first_tab']['tabset'] = array( + '#type' => 'tabset', + ); + $objectHelper = new ObjectHelper(); + $item = new Fedora_Item($this->pid); + $dc_html = $objectHelper->getFormattedDC($item); + + $ds_list = $objectHelper->getFormattedDatastreamList($this->pid, NULL, $item); + + $tabset['my_tabset']['first_tab']['tabset']['view'] = array( + '#type' => 'tabpage', + '#title' => t('View'), + '#content' => $dc_html . $ds_list, + ); + + if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { + $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC'); + $tabset['my_tabset']['first_tab']['tabset']['edit'] = array( + '#type' => 'tabpage', + '#title' => t('Edit'), + '#content' => $editform, + ); + } + $tabset['my_tabset']['second_tab'] = array( -// $collection_fieldset = array ( '#type' => 'tabpage', '#title' => t('Read Online'), '#content' => "'; - $tabset['my_tabset']['second_tab'] = array( + $tabset['second_tab'] = array( '#type' => 'tabpage', '#title' => t('Full-size'), '#content' => $html ); - $tabset['my_tabset']['first_tab'] = array( + $tabset['first_tab'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', '#title' => t('Description'), @@ -184,12 +180,12 @@ class IslandoraBook { '#content' => fedora_ilives_create_book_view($this->pid), ); - $tabset['my_tabset']['add_pages'] = array( + $tabset['add_pages'] = array( '#type' => 'tabpage', '#title' => t('Add pages'), '#content' => drupal_get_form('book_add_pages_form', $this->pid), ); - return tabs_render($tabset); + return $tabset; } } From 964cf2f9cb66253ba391f73b24c722aa381e4cc5 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 15 Feb 2011 15:30:06 -0400 Subject: [PATCH 32/38] ISLANDORA-171 Herbarium support for modular tabs. --- plugins/herbarium.inc | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/plugins/herbarium.inc b/plugins/herbarium.inc index 54a7d331..3af6f8bd 100644 --- a/plugins/herbarium.inc +++ b/plugins/herbarium.inc @@ -106,10 +106,6 @@ class Herbarium { global $base_url; $tabset = array(); - - $tabset['my_tabset'] = array( - '#type' => 'tabset', - ); global $user; $qs = ''; @@ -119,13 +115,13 @@ class Herbarium { $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; $html = ''; - $tabset['my_tabset']['second_tab'] = array( + $tabset['second_tab'] = array( // $collection_fieldset = array ( '#type' => 'tabpage', '#title' => t('Full-size'), '#content' => $html ); - $tabset['my_tabset']['first_tab'] = array( + $tabset['first_tab'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', '#title' => t('View'), @@ -135,15 +131,15 @@ class Herbarium { ); $dwc = new DarwinCore($this->item); - $tabset['my_tabset']['third_tab'] = array( + $tabset['third_tab'] = array( '#type' => 'tabpage', '#title' => t('Description'), ); - $tabset['my_tabset']['third_tab']['tabset'] = array( + $tabset['third_tab']['tabset'] = array( '#type' => 'tabset', ); - $tabset['my_tabset']['third_tab']['tabset']['view'] = array( + $tabset['third_tab']['tabset']['view'] = array( '#type' => 'tabpage', '#title' => t('Darwin Core'), '#content' => $dwc->asHTML(), @@ -152,17 +148,17 @@ class Herbarium { $obj = new ObjectHelper(); if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE'); - $tabset['my_tabset']['third_tab']['tabset']['edit'] = array( + $tabset['third_tab']['tabset']['edit'] = array( '#type' => 'tabpage', '#title' => t('Edit'), '#content' => $editform, ); - $tabset['my_tabset']['third_tab']['tabset']['source'] = array( + $tabset['third_tab']['tabset']['source'] = array( '#type' => 'tabpage', '#title' => t('Vew Source'), ); $xmlsrc = $dwc->asXML(); - $tabset['my_tabset']['third_tab']['tabset']['source']['srctext'] = array( + $tabset['third_tab']['tabset']['source']['srctext'] = array( '#name' => 'source', '#type' => 'textarea', '#value' => $xmlsrc, @@ -170,7 +166,6 @@ class Herbarium { '#height' => 50, ); } - - return tabs_render($tabset); + return $tabset; } } From 34157e33d7470b772df97b35e51a04a488a1d135 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 22 Feb 2011 09:40:32 -0400 Subject: [PATCH 33/38] ISLANDORA-171 Make DualResImageCollection into an islandora collection --- ObjectHelper.inc | 7 +++++-- fedora_repository.module | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 381ab39c..17974b26 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -566,11 +566,14 @@ class ObjectHelper { } $cmodels = array(); foreach ($sxml->xpath('//@uri') as $uri) { - if (strpos($uri, 'fedora-system') != FALSE && $include_fedora_system_content_models == FALSE) { + if (strpos($uri, 'fedora-system:fedoraObject-3.0') != FALSE && $include_fedora_system_content_models == FALSE) { continue; } $cmodel_pid = substr(strstr($uri, '/'), 1); - $cmodels[] = ContentModel::loadFromModel($cmodel_pid); + $cm = ContentModel::loadFromModel($cmodel_pid); + if ($cm) { + $cmodels[] = $cm; + } } return $cmodels; diff --git a/fedora_repository.module b/fedora_repository.module index 21f33217..2fc95363 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -815,7 +815,6 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $objectHelper->getBreadcrumbs($pid, $breadcrumbs); drupal_set_breadcrumb(array_reverse($breadcrumbs)); - $offset = $limit * $page_number; //$results = $collectionClass->getRelatedObjects($pid, $limit, $offset, NULL); //updated so we can do paging in query not in xslt //$results = $collectionClass->getRelatedItems($pid, NULL); From 92c1cee380f6352958800a8475be8e93533fc559 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 22 Feb 2011 09:25:55 -0400 Subject: [PATCH 34/38] Add ISLANDORACM to DualResImageCollection. --- fedora_repository.module | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fedora_repository.module b/fedora_repository.module index 2fc95363..72cb2ac3 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1427,9 +1427,16 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $smiley_stuff->add_relationship('isMemberOfCollection', 'info:fedora/islandora:demos'); $tn = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/smileytn.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); $cp = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/JPG-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy.xml', 'application/xml', 'X'); + $cm = new Fedora_Item('demo:DualResImage'); try { $cmstream = $cm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STANDARD JPG.xml', 'ISLANDORACM', 'Content Model.xml', 'application/xml', 'X'); + } catch (exception $e) { + + } + $dual_res_image_collection_cmodel = new Fedora_Item('demo:DualResImageCollection'); + try { + $cmstream = $dual_res_image_collection_cmodel->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); drupal_set_message("Successfully installed demo:SmileyStuff collection view.", 'message'); } catch (exception $e) { From 208827cb204b2306c5a78c7da7c43d63bab34dd7 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 22 Feb 2011 10:11:07 -0400 Subject: [PATCH 35/38] ISLANDORA-171 Update collection policy and content model to new schema. --- collection_policies/JPG-COLLECTION POLICY.xml | 71 +---- content_models/COLLECTIONCM.xml | 14 +- content_models/STANDARD JPG.xml | 293 ++++++------------ content_models/STANDARD_JPG.xml | 293 ++++++------------ 4 files changed, 198 insertions(+), 473 deletions(-) diff --git a/collection_policies/JPG-COLLECTION POLICY.xml b/collection_policies/JPG-COLLECTION POLICY.xml index 98f3520b..3e2fd4db 100644 --- a/collection_policies/JPG-COLLECTION POLICY.xml +++ b/collection_policies/JPG-COLLECTION POLICY.xml @@ -1,70 +1 @@ - - - - - - demo:Smiley - demo:DualResImage - ISLANDORACM - - - - isMemberOf - - - dc.description - - dc.title - dc.title - - - dc.creator - dc.creator - - - dc.description - dc.description - - - dc.date - dc.date - - - dc.identifier - dc.identifier - - - dc.language - dc.language - - - dc.publisher - dc.publisher - - - dc.rights - dc.rights - - - dc.subject - dc.subject - - - dc.relation - dc.relation - - - dcterms.temporal - dcterms.temporal - - - dcterms.spatial - dcterms.spatial - - - fgs.DS.first.text - Full Text - - - + dc.title dc.creator dc.description dc.date dc.identifier dc.language dc.publisher dc.rights dc.subject dc.relation dcterms.temporal dcterms.spatial Full Text isMemberOf \ No newline at end of file diff --git a/content_models/COLLECTIONCM.xml b/content_models/COLLECTIONCM.xml index 144dbad8..8232e730 100644 --- a/content_models/COLLECTIONCM.xml +++ b/content_models/COLLECTIONCM.xml @@ -1,20 +1,20 @@ - - + text/xml text/plain application/xml - + - + - - + + - + The name given to the resource diff --git a/content_models/STANDARD JPG.xml b/content_models/STANDARD JPG.xml index 9a36e81e..911b1f91 100644 --- a/content_models/STANDARD JPG.xml +++ b/content_models/STANDARD JPG.xml @@ -1,198 +1,95 @@ - - - - image/jpeg - - - - - plugins/ShowDemoStreamsInFieldSets.inc - ShowDemoStreamsInFieldSets - showMediumSize - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - image/jpeg - - plugins/ImageManipulation.inc - ImageManipulation - manipulateImage - jpg - MEDIUM_SIZE - - 120 - 160 - - - - - - - - image/jpeg - - - - plugins/ImageManipulation.inc - ImageManipulation - manipulateImage - jpg - MEDIUM_SIZE - - 160 - 120 - - - - plugins/ImageManipulation.inc - ImageManipulation - manipulateImage - jpg - TN - - 120 - 120 - - - - - - - - plugins/DemoFormBuilder.inc - DemoFormBuilder - buildQDCForm - handleQDCForm - - - - - - dc:title - textfield - The name given to the resource - true - - - - dc:creator - textfield - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - dc:subject - select - Subject - false - - - image - image - - - photograph - photograph - - - presentation - presentation - - - art - art - - - - - - - dc:description - textarea - Description of the Image - true - - - - dc:publisher - textfield - An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - - dc:contributor - textfield - An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - - dc:date - textfield - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - - dc:type - textfield - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - - - dc:source - textfield - A reference to a resource from which the present resource is derived. - false - - - - dc:identifier - textfield - A unique reference to the resource; In this instance, the accession number or collection number. - false - - - - dc:language - select - The language of the intellectual content of the resource. - false - - - eng - English - - - fre - French - - - - - - dc:relation - textfield - Reference to a related resource. - false - - - - dc:rights - textarea - Information about intellectual property rights, copyright, and various property rights. - false - - - - + + + + image/jpeg + + + + image/jpeg + + + + 160 + 120 + + + + + 120 + 120 + + + + + + + + + + + + + + + + 120 + 160 + + + + + + + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + Subject + + image + photograph + presentation + art + + + + Description of the Image + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + \ No newline at end of file diff --git a/content_models/STANDARD_JPG.xml b/content_models/STANDARD_JPG.xml index 9a36e81e..911b1f91 100644 --- a/content_models/STANDARD_JPG.xml +++ b/content_models/STANDARD_JPG.xml @@ -1,198 +1,95 @@ - - - - image/jpeg - - - - - plugins/ShowDemoStreamsInFieldSets.inc - ShowDemoStreamsInFieldSets - showMediumSize - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - image/jpeg - - plugins/ImageManipulation.inc - ImageManipulation - manipulateImage - jpg - MEDIUM_SIZE - - 120 - 160 - - - - - - - - image/jpeg - - - - plugins/ImageManipulation.inc - ImageManipulation - manipulateImage - jpg - MEDIUM_SIZE - - 160 - 120 - - - - plugins/ImageManipulation.inc - ImageManipulation - manipulateImage - jpg - TN - - 120 - 120 - - - - - - - - plugins/DemoFormBuilder.inc - DemoFormBuilder - buildQDCForm - handleQDCForm - - - - - - dc:title - textfield - The name given to the resource - true - - - - dc:creator - textfield - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - dc:subject - select - Subject - false - - - image - image - - - photograph - photograph - - - presentation - presentation - - - art - art - - - - - - - dc:description - textarea - Description of the Image - true - - - - dc:publisher - textfield - An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - - dc:contributor - textfield - An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - - dc:date - textfield - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - - dc:type - textfield - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - - - dc:source - textfield - A reference to a resource from which the present resource is derived. - false - - - - dc:identifier - textfield - A unique reference to the resource; In this instance, the accession number or collection number. - false - - - - dc:language - select - The language of the intellectual content of the resource. - false - - - eng - English - - - fre - French - - - - - - dc:relation - textfield - Reference to a related resource. - false - - - - dc:rights - textarea - Information about intellectual property rights, copyright, and various property rights. - false - - - - + + + + image/jpeg + + + + image/jpeg + + + + 160 + 120 + + + + + 120 + 120 + + + + + + + + + + + + + + + + 120 + 160 + + + + + + + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + Subject + + image + photograph + presentation + art + + + + Description of the Image + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + \ No newline at end of file From f56bf582ef01a09b45841acf448c6341c326a666 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 22 Feb 2011 10:16:47 -0400 Subject: [PATCH 36/38] ISLANDORA-171 Remove commented out code. --- fedora_repository.module | 1 - 1 file changed, 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index 72cb2ac3..06ed06b9 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -223,7 +223,6 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { function fedora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) { module_load_include('inc', 'fedora_repository', 'formClass'); - //$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); // For the sake of easily maintaining the module in different core versions create our own form_values variable. if (empty($form_state['storage']['step'])) { $form_state['storage']['step'] = 1; From 76ddd9f3b8518e807a400af3d0c14a101e0b76c3 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 22 Feb 2011 10:58:44 -0400 Subject: [PATCH 37/38] ISLANDORA-171 change book 'full-size' tab to 'read' --- ilives/book.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ilives/book.inc b/ilives/book.inc index 706d0f4c..fdb5150a 100644 --- a/ilives/book.inc +++ b/ilives/book.inc @@ -169,7 +169,7 @@ class IslandoraBook { $html = ''; $tabset['second_tab'] = array( '#type' => 'tabpage', - '#title' => t('Full-size'), + '#title' => t('Read'), '#content' => $html ); $tabset['first_tab'] = array( From 7dc748b86715946bab4a03f48aeb287512fc8f7f Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 22 Feb 2011 11:01:32 -0400 Subject: [PATCH 38/38] ISLANDORA-171 Add permissoin check for book add pages tab. --- ilives/book.inc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ilives/book.inc b/ilives/book.inc index fdb5150a..608b9ba0 100644 --- a/ilives/book.inc +++ b/ilives/book.inc @@ -179,12 +179,14 @@ class IslandoraBook { // This will be the content of the tab. '#content' => fedora_ilives_create_book_view($this->pid), ); - - $tabset['add_pages'] = array( - '#type' => 'tabpage', - '#title' => t('Add pages'), - '#content' => drupal_get_form('book_add_pages_form', $this->pid), - ); + + if (user_access('ingest new fedora objects')) { + $tabset['add_pages'] = array( + '#type' => 'tabpage', + '#title' => t('Add pages'), + '#content' => drupal_get_form('book_add_pages_form', $this->pid), + ); + } return $tabset; } }