From 964cf2f9cb66253ba391f73b24c722aa381e4cc5 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Tue, 15 Feb 2011 15:30:06 -0400 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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; } }