Browse Source

ISLANDORA-214 Add support for custom collection queries into default collection class.

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
f47a4d7f42
  1. 148
      CollectionClass.inc
  2. 6
      ContentModel.inc
  3. 261
      ObjectHelper.inc
  4. 2
      api/fedora_item.inc
  5. 7
      collection_views/demo_image_collection_dc_record.xml
  6. 66
      collection_views/standard_jpeg_collection_view.xml
  7. 1
      content_models/COLLECTIONCM.xml
  8. 860
      content_models/islandora_collectionCModel.xml
  9. 59
      fedora_repository.module
  10. 40
      formClass.inc
  11. 16
      ilives/book.inc
  12. BIN
      images/48px-Crystal_Clear_app_download_manager.png
  13. BIN
      images/Crystal_Clear_app_download_manager.png
  14. 300
      installer_files/foxml/islandora-collectionCModel.xml
  15. 46
      plugins/ShowStreamsInFieldSets.inc
  16. 50
      plugins/fedoraObject.inc
  17. 23
      plugins/herbarium.inc
  18. 9
      plugins/map_viewer.inc
  19. 24
      plugins/slide_viewer.inc

148
CollectionClass.inc

@ -26,12 +26,13 @@ class CollectionClass {
* @param string $pid The pid of the collection to represent. * @param string $pid The pid of the collection to represent.
* @return CollectionClass * @return CollectionClass
*/ */
function CollectionClass($pid = NULL) { function __construct($pid = NULL) {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
if (!empty($pid)) { if (!empty($pid)) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$this->collectionObject = new ObjectHelper($pid); $this->collectionObject = new ObjectHelper($pid);
$this->pid = $pid;
} }
} }
/* gets objects related to this object. must include offset and limit /* gets objects related to this object. must include offset and limit
@ -401,5 +402,148 @@ class CollectionClass {
return TRUE; 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) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
global $base_url;
$tabset = array();
global $user;
$objectHelper = new ObjectHelper();
$item = new Fedora_Item($this->pid);
$query = NULL;
if ($item->exists()) {
$query = $item->get_datastream_dissemination('QUERY');
}
$results = $this->getRelatedItems($this->pid, $query);
$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');
$add_to_collection = $this->getIngestInterface();
$tabset['view_tab'] = array(
// $collection_fieldset = array (
'#type' => 'tabpage',
'#title' => 'View',
'#content' => $collection_items
);
$tabset['add_tab'] = array(
// #type and #title are the minimum requirements.
'#type' => 'tabpage',
'#title' => t('Add'),
'#selected' => $show_ingest_tab,
// This will be the content of the tab.
'#content' => $add_to_collection,
);
return $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 = '<a title="'. t('Ingest a New object into ') . $collectionName . ' '. $collection_pid . '" href="'. base_path() .
$ingestObject = drupal_get_form('fedora_repository_ingest_form', $this->pid);
}
}
}
else {
$ingestObject = '';
}
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;
}
} }

6
ContentModel.inc

@ -37,7 +37,7 @@ class ContentModel extends XMLDatastream {
$content_models = $objectHelper->get_content_models_list($pid); $content_models = $objectHelper->get_content_models_list($pid);
foreach ($content_models as $content_model) { foreach ($content_models as $content_model) {
if ($content_model != 'fedora-system:FedoraObject-3.0') { if ($content_model != 'fedora-system:FedoraObject-3.0') {
$ret = self::loadFromModel($content_model); $ret = $content_model;
break; break;
} }
} }
@ -1437,7 +1437,7 @@ class ContentModel extends XMLDatastream {
* @param string $pid * @param string $pid
* @return string $output * @return string $output
*/ */
public function displayExtraFieldset($pid) { public function displayExtraFieldset($pid, $page_number) {
$output = ''; $output = '';
if ($this->validate()) { if ($this->validate()) {
$datastreams = $this->xml->getElementsByTagName('datastreams'); $datastreams = $this->xml->getElementsByTagName('datastreams');
@ -1467,7 +1467,7 @@ class ContentModel extends XMLDatastream {
self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.'; self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.';
} }
else { else {
$output .= $class->$methodName(); $output = $class->$methodName($page_number);
} }
} }
} }

261
ObjectHelper.inc

@ -307,55 +307,22 @@ class ObjectHelper {
} }
} }
$content .= "<tr><td>$label</td><td>&nbsp;$view</td><td>&nbsp;$downloadVersion</td><td>&nbsp;$mimeType</td><td>&nbsp;$replaceImage&nbsp;$purgeImage</td></tr>\n"; $content .= "<tr><td>$label</td><td>&nbsp;$view</td><td>&nbsp;$downloadVersion</td><td>&nbsp;$mimeType</td><td>&nbsp;$replaceImage&nbsp;$purgeImage</td></tr>\n";
//$content .= "<tr><td><b>Mime Type :</b></td><td>$mimeType</td></tr>\n";
return $content; return $content;
} }
/** function getFormattedDC($item) {
* 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; global $base_url;
$path = drupal_get_path('module', 'fedora_repository'); $path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
$soapHelper = new ConnectionHelper(); $dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC';
$client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); $xmlstr = $item->get_datastream_dissemination($dsid);
$dsId = 'QDC'; if (empty($xmlstr)) {
$params = array( return '';
'pid' => "$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' => "$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;
try { try {
$proc = new XsltProcessor(); $proc = new XsltProcessor();
} catch (Exception $e) { } catch (Exception $e) {
@ -377,7 +344,25 @@ class ObjectHelper {
$xsl = $proc->importStylesheet($xsl); $xsl = $proc->importStylesheet($xsl);
$newdom = $proc->transformToDoc($input); $newdom = $proc->transformToDoc($input);
$output = $newdom->saveXML(); $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)); //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1));
if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) {
$allow=TRUE; $allow=TRUE;
@ -386,36 +371,13 @@ class ObjectHelper {
} }
if ($allow) { if ($allow) {
$output .= '<br /><a title = "' . t('Edit Meta Data') . '" href="' . $base_url . '/fedora/repository/' . 'editmetadata/' . $pid . '/' . $output .= '<br /><a title = "' . t('Edit Meta Data') . '" href="' . $base_url . '/fedora/repository/' . 'editmetadata/' . $pid . '/' .
$dsId . '"><img src="' . $base_url . '/' . $path . '/images/edit.gif" alt="' . t('Edit Meta Data') . '" /></a>'; $dsid . '"><img src="' . $base_url . '/' . drupal_get_path('module', 'fedora_repository') . '/images/edit.gif" alt="' . t('Edit Meta Data') . '" /></a>';
} }
} }
return $output; return $output;
} }
/** function getFormattedDatastreamList($object_pid, $contentModels, &$fedoraItem) {
* Gets a list of datastreams from an object using its pid
*
* We make some assumptions here. We have implemented a policy that
* we ingest in our repository will have TN (thumbnail) datastream. Even audio
* will have a picture of a speaker or something. This is not critical
* but makes searches etc. look better if there is a TN stream.
* This diplays all the streams in a collapsed fieldset at the bottom of the object page.
* you can implement a content model if you would like certain streams displayed in certain ways.
* @param $object_pid String
* @return String
*
*/
function get_formatted_datastream_list($object_pid, $contentModels, &$fedoraItem) {
global $fedoraUser, $fedoraPass, $base_url, $user;
module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'ContentModel');
$path = drupal_get_path('module', 'fedora_repository');
$dataStreamBody = '';
$fedoraItem = new Fedora_Item($object_pid);
if (user_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST)) { if (user_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST)) {
$availableDataStreamsText = 'Detailed List of Content'; $availableDataStreamsText = 'Detailed List of Content';
//$metaDataText='Description'; //$metaDataText='Description';
@ -464,14 +426,39 @@ class ObjectHelper {
$dataStreamBody .= drupal_get_form('add_stream_form', $object_pid); $dataStreamBody .= drupal_get_form('add_stream_form', $object_pid);
} }
} }
$fieldset = array(
'#title' => t("!text", array('!text' => $availableDataStreamsText)), $dataStreamBody = '<div class = "fedora_detailed_list">' . $dataStreamBody . '</div>';
'#collapsible' => TRUE, return $dataStreamBody;
'#collapsed' => TRUE, }
'#value' => $dataStreamBody return '';
);
$dataStreamBody = '<div class = "fedora_detailed_list">' . theme('fieldset', $fieldset) . '</div>';
} }
/**
* Gets a list of datastreams from an object using its pid
*
* We make some assumptions here. We have implemented a policy that
* we ingest in our repository will have TN (thumbnail) datastream. Even audio
* will have a picture of a speaker or something. This is not critical
* but makes searches etc. look better if there is a TN stream.
* This diplays all the streams in a collapsed fieldset at the bottom of the object page.
* you can implement a content model if you would like certain streams displayed in certain ways.
* @param $object_pid String
* @return String
*
*/
function get_formatted_datastream_list($object_pid, $contentModels, &$fedoraItem) {
global $fedoraUser, $fedoraPass, $base_url, $user;
module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'ContentModel');
$path = drupal_get_path('module', 'fedora_repository');
$dataStreamBody = '';
$fedoraItem = new Fedora_Item($object_pid);
$dataStreamBody = $this->getFormattedDatastreamList($object_pid, $contentModels, $fedoraItem);
$content = ''; $content = '';
if (empty($contentModels)) { if (empty($contentModels)) {
@ -516,19 +503,7 @@ class ObjectHelper {
return '<div class="fedora_datastream_content">' . $content . '</div>'; return '<div class="fedora_datastream_content">' . $content . '</div>';
} }
/**
* 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 * returns a stream from a fedora object given a pid and dsid
@ -589,15 +564,19 @@ class ObjectHelper {
if (!isset($sxml)) { if (!isset($sxml)) {
return $pids; return $pids;
} }
$cmodels = array();
foreach ($sxml->xpath('//@uri') as $uri) { 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; continue;
} }
$pids[] = substr(strstr($uri, '/'), 1); $cmodel_pid = substr(strstr($uri, '/'), 1);
$cm = ContentModel::loadFromModel($cmodel_pid);
if ($cm) {
$cmodels[] = $cm;
}
} }
return $pids; return $cmodels;
} }
/* /*
@ -666,56 +645,6 @@ class ObjectHelper {
$isCollection = TRUE; $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 //show the collections datastreams
if ($results->length > 0 || $isCollection == TRUE) { if ($results->length > 0 || $isCollection == TRUE) {
@ -739,45 +668,10 @@ class ObjectHelper {
else { else {
$ingestObject = '&nbsp;'; $ingestObject = '&nbsp;';
} }
$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 = ''; $datastreams .= $ingestObject;
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 .= '<strong>' . $collectionName . '</strong><br/>';
}
break;
case ObjectHelper :: $DISPLAY_ALWAYS:
default:
$output .= '<strong>' . $collectionName . '</strong><br/>';
break;
}
$output .= $datastreams; $output .= $datastreams;
@ -808,19 +702,6 @@ class ObjectHelper {
$output .= theme('fieldset', $fieldset); $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 . '<br/>';
}
break;
case ObjectHelper :: $DISPLAY_ALWAYS:
default:
$output .= $objectListOut . '<br/>';
break;
}
return $output; return $output;
} }
@ -873,7 +754,7 @@ class ObjectHelper {
* gets a list of datastreams and related function that we should use to show datastreams in their own fieldsets * 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 the content model associated with the object
*/ */
function createExtraFieldsets($pid, $contentModel) { function createExtraFieldsets($pid, $contentModel, $page_number) {
//$models = $collectionHelper->getContentModels($collectionPid, FALSE); //$models = $collectionHelper->getContentModels($collectionPid, FALSE);
// possible problem in below if the collection policy has multiple content models // 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 //with different pids but same dsid we could get wrong one, low probability and functionality
@ -884,7 +765,7 @@ class ObjectHelper {
$output = ''; $output = '';
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) { if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) {
$output .= $cm->displayExtraFieldset($pid); $output .= $cm->displayExtraFieldset($pid, $page_number);
} }
return $output; return $output;
} }

2
api/fedora_item.inc

@ -299,7 +299,7 @@ class Fedora_Item {
$content = trim($content); $content = trim($content);
} }
else { else {
$content = ""; $content = NULL;
} }
return $content; return $content;
} }

7
collection_views/demo_image_collection_dc_record.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>Demo Image Collection</dc:title>
<dc:identifier>islandora:demo_image_collection</dc:identifier>
<dc:description>Demo image collection</dc:description>
</oai_dc:dc>

66
collection_views/standard_jpeg_collection_view.xml

@ -0,0 +1,66 @@
<xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="BASEURL">
<xsl:value-of select="$baseUrl"/>
</xsl:variable>
<xsl:variable name="collTitle" select="/s:sparql/s:results/s:result/s:collTitle"/>
<xsl:variable name="collDesc" select="/s:sparql/s:results/s:result/s:collDesc"/>
<center>
<font face="arial,helvetica">
<h2>
<xsl:value-of select="$collTitle"/>
<br/>
<i>
<xsl:value-of select="$collDesc"/>
</i>
</h2>
</font>
</center>
<hr size="1"/>
<center>
<table border="0" cellpadding="5">
<xsl:for-each select="/s:sparql/s:results/s:result">
<xsl:variable name="pid" select="substring-after(s:member/@uri, '/')"/>
<tr>
<td>
<center>
<a>
<xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>
<xsl:text>/fedora/repository/</xsl:text>
<xsl:value-of select="$pid"/>
<xsl:text>/FULL_SIZE</xsl:text>
</xsl:attribute>
<img height="120" width="160">
<xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>
<xsl:text>/fedora/repository/</xsl:text>
<xsl:value-of select="$pid"/>
<xsl:text>/MEDIUM_SIZE</xsl:text>
</xsl:attribute>
</img>
<br/>
( Full Size )
</a>
</center>
</td>
<td>
<b>
<a>
<xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>
<xsl:text>/fedora/repository/</xsl:text>
<xsl:value-of select="$pid"/>/-/<xsl:value-of select="s:memberTitle"/>
</xsl:attribute>
<xsl:value-of select="s:memberTitle"/>
</a>
</b>
<br/>
<xsl:value-of select="s:memberDesc"/>
</td>
</tr>
</xsl:for-each>
</table>
</center>
</xsl:template>
</xsl:stylesheet>

1
content_models/COLLECTIONCM.xml

@ -1,4 +1,3 @@
<content_model xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Collection" version="2" xsi:schemaLocation="http://www.islandora.ca http://localhost/islandoracm.xsd"> <content_model xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Collection" version="2" xsi:schemaLocation="http://www.islandora.ca http://localhost/islandoracm.xsd">
<mimetypes> <mimetypes>
<type>text/xml</type> <type>text/xml</type>

860
content_models/islandora_collectionCModel.xml

File diff suppressed because it is too large Load Diff

59
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) { function fedora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) {
module_load_include('inc', 'fedora_repository', 'formClass'); module_load_include('inc', 'fedora_repository', '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. // For the sake of easily maintaining the module in different core versions create our own form_values variable.
if (empty($form_state['storage']['step'])) { if (empty($form_state['storage']['step'])) {
$form_state['storage']['step'] = 1; $form_state['storage']['step'] = 1;
@ -358,7 +357,7 @@ function add_stream_form_validate($form, &$form_state) {
return FALSE; return FALSE;
} }
if (!(preg_match("/^[a-zA-Z]/", $dsid))) { 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; return FALSE;
} }
if (strlen($dsLabel) > 64) { if (strlen($dsLabel) > 64) {
@ -434,11 +433,14 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) {
if (!empty($form_state['values']['referrer'])) { if (!empty($form_state['values']['referrer'])) {
$form_state['redirect'] = $form_state['values']['referrer']; $form_state['redirect'] = $form_state['values']['referrer'];
} }
elseif (empty($collectionPid) && $_SESSION['fedora_collection'] != $pid) { elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) {
$collectionPid = $_SESSION['fedora_collection']; $collectionPid = $_SESSION['fedora_collection'];
$form_state['redirect'] = "fedora/repository/$collectionPid/"; $form_state['redirect'] = "fedora/repository/$collectionPid/";
} }
else {
$form_state['redirect'] = 'fedora/repository/';
}
} }
} }
@ -712,7 +714,7 @@ function makeObject($pid, $dsID) {
* if there is no query datastream falls back to the query shipped with the module. * if there is no query datastream falls back to the query shipped with the module.
* @return String * @return String
*/ */
function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $pageNumber = NULL, $limit = NULL) { function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $page_number = NULL, $limit = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
global $user; global $user;
@ -762,19 +764,46 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
// $limit=20; // $limit=20;
//} //}
module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'fedora_repository', 'plugins/fedoraObject');
$breadcrumbs = array(); $breadcrumbs = array();
$objectHelper->getBreadcrumbs($pid, $breadcrumbs); $objectHelper->getBreadcrumbs($pid, $breadcrumbs);
drupal_set_breadcrumb(array_reverse($breadcrumbs)); drupal_set_breadcrumb(array_reverse($breadcrumbs));
$offset = $limit * $page_number;
$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); //$results = $collectionClass->getRelatedItems($pid, NULL);
$content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); $content_models = $objectHelper->get_content_models_list($pid);
// Each content model may return either a tabset array or plain HTML. If it's HTML, stick it in a tab.
$cmodels_tabs = array(
'#type' => 'tabset',
);
foreach ($content_models as $content_model) {
//$content_model_fieldsets = $objectHelper->createExtraFieldsets($pid, $content_model, $pageNumber);
$content_model_fieldset = $content_model->displayExtraFieldset($pid, $page_number);
if (is_array($content_model_fieldset)) {
$cmodels_tabs = array_merge($cmodels_tabs, $content_model_fieldset);
}
else {
$cmodels_tabs[$content_model->pid] = array(
'#type' => 'tabpage',
'#title' => $content_model->name,
'#content' => $content_model_fieldset,
);
}
}
// Add a 'manage object' tab for all objects, where detailed list of content is shown.
$obj = new FedoraObject($pid);
$object_details = $obj->showFieldSets();
$cmodels_tabs = array_merge($cmodels_tabs, $object_details);
//$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 //the below is for islandlives we should be able to do this in the xslt though
//$css=$path.'/stylesheets/container-large.css'; //$css=$path.'/stylesheets/container-large.css';
//drupal_add_css($css); //drupal_add_css($css);
return $content . '</div>'; return tabs_render($cmodels_tabs) . '</div>';
} }
function fedora_repository_urlencode_string($str) { function fedora_repository_urlencode_string($str) {
@ -1548,11 +1577,16 @@ function fedora_repository_required_fedora_objects() {
), ),
array ( array (
'dsid' => 'COLLECTION_VIEW', 'dsid' => 'COLLECTION_VIEW',
'datastream_file' => "$module_path/collection_views/SmileyStuff-COLLECTION_VIEW.xml", 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml",
), ),
array ( array (
'dsid' => 'QUERY', 'dsid' => 'QUERY',
'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt", 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt",
'mimetype' => 'text/plain',
),
array (
'dsid' => 'DC',
'datastream_file' => "$module_path/collection_views/demo_image_collection_dc_record.xml",
), ),
), ),
), ),
@ -1946,10 +1980,15 @@ function fedora_repository_batch_reingest_object($object, &$context) {
$new_item->add_relationship('isMemberOfCollection', $object['parent']); $new_item->add_relationship('isMemberOfCollection', $object['parent']);
} }
foreach($datastreams as $ds) { foreach($datastreams as $ds) {
if ($ds['dsid'] == 'DC') {
$new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml');
}
else {
$new_item->add_datastream_from_file($ds['datastream_file'], $ds['dsid'], !empty($ds['label']) ? $ds['label'] : '', !empty($ds['mimetype']) ? $ds['mimetype'] : 'text/xml'); $new_item->add_datastream_from_file($ds['datastream_file'], $ds['dsid'], !empty($ds['label']) ? $ds['label'] : '', !empty($ds['mimetype']) ? $ds['mimetype'] : 'text/xml');
} }
} }
} }
}
} }
/** /**

40
formClass.inc

@ -615,12 +615,12 @@ class formClass {
if (!empty($content_models)) { if (!empty($content_models)) {
foreach ($content_models as $content_model) { foreach ($content_models as $content_model) {
if (($cm = ContentModel::loadFromModel($content_model)) !== FALSE) {
$newElements = $cm->listDatastreams(); $newElements = $content_model->listDatastreams();
if (!empty($newElements)) { if (!empty($newElements)) {
$available_dsids = array_merge($available_dsids, $newElements); $available_dsids = array_merge($available_dsids, $newElements);
} }
}
} }
} }
@ -709,7 +709,9 @@ class formClass {
'#weight' => '-1', '#weight' => '-1',
'#description' => t('Datastream IDs defined by the content model.'), '#description' => t('Datastream IDs defined by the content model.'),
); );
$form['stream_id']['#options'] = $dsidsForForm;
$form['stream_id']['#options'] = array_combine($unused_dsids, $unused_dsids);
} }
else { else {
$form['stream_id'] = array( $form['stream_id'] = array(
@ -850,35 +852,5 @@ class formClass {
return $form; return $form;
} }
/*
function createReplaceDataStreamForm($pid, $dsId, &$form_state) {
$form = array();
$form['#attributes']['enctype'] = 'multipart/form-data';
$form['file'] = array(
'#type' => 'file',
'#title' => t('Upload Document'),
'#description' => t('The file to upload.')
);
$form['pid'] = array(
'#type' => 'value',
'#value' => $pid,
);
$form['dsId'] = array(
'#type' => 'value',
'#value' => $dsId,
);
$form['submit']=array(
'#type' => 'submit',
'#value'=>t('Replace Datastream')
);
return $form;
}
*/
} }

16
ilives/book.inc

@ -171,10 +171,6 @@ class IslandoraBook {
$tabset = array(); $tabset = array();
$tabset['my_tabset'] = array(
'#type' => 'tabset',
);
global $user; global $user;
$qs = ''; $qs = '';
if ($user->uid != 0) { if ($user->uid != 0) {
@ -183,12 +179,12 @@ class IslandoraBook {
$viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs;
$html = '<iframe src="'. $viewer_url . '" scrolling="0" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>'; $html = '<iframe src="'. $viewer_url . '" scrolling="0" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>';
$tabset['my_tabset']['second_tab'] = array( $tabset['second_tab'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Full-size'), '#title' => t('Read'),
'#content' => $html '#content' => $html
); );
$tabset['my_tabset']['first_tab'] = array( $tabset['first_tab'] = array(
// #type and #title are the minimum requirements. // #type and #title are the minimum requirements.
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Description'), '#title' => t('Description'),
@ -196,12 +192,14 @@ class IslandoraBook {
'#content' => fedora_ilives_create_book_view($this->pid), '#content' => fedora_ilives_create_book_view($this->pid),
); );
$tabset['my_tabset']['add_pages'] = array( if (user_access('ingest new fedora objects')) {
$tabset['add_pages'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Add pages'), '#title' => t('Add pages'),
'#content' => drupal_get_form('book_add_pages_form', $this->pid), '#content' => drupal_get_form('book_add_pages_form', $this->pid),
); );
return tabs_render($tabset); }
return $tabset;
} }
} }

BIN
images/48px-Crystal_Clear_app_download_manager.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/Crystal_Clear_app_download_manager.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

300
installer_files/foxml/islandora-collectionCModel.xml

@ -5,11 +5,11 @@
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/> <foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Islandora Collection Content Model"/> <foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Islandora Collection Content Model"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/> <foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2009-02-17T16:49:02.191Z"/> <foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2011-01-24T20:34:53.430Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-09-15T11:47:31.885Z"/> <foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2011-01-24T20:34:54.711Z"/>
</foxml:objectProperties> </foxml:objectProperties>
<foxml:datastream CONTROL_GROUP="X" ID="AUDIT" STATE="A" VERSIONABLE="false"> <foxml:datastream CONTROL_GROUP="X" ID="AUDIT" STATE="A" VERSIONABLE="false">
<foxml:datastreamVersion CREATED="2009-02-17T16:49:02.191Z" <foxml:datastreamVersion CREATED="2011-01-24T20:34:53.430Z"
FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit" ID="AUDIT.0" LABEL="Audit Trail for this object" MIMETYPE="text/xml"> FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit" ID="AUDIT.0" LABEL="Audit Trail for this object" MIMETYPE="text/xml">
<foxml:xmlContent> <foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#"> <audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
@ -17,174 +17,40 @@
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action> <audit:action>ingest</audit:action>
<audit:componentID/> <audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>admin</audit:responsibility>
<audit:date>2009-02-17T16:49:02.191Z</audit:date> <audit:date>2011-01-24T20:34:53.430Z</audit:date>
<audit:justification>Created with Admin GUI "New Object" command</audit:justification> <audit:justification>Fedora Object Ingested</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC2"> <audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>addDatastream</audit:action>
<audit:componentID>DS-COMPOSITE-MODEL</audit:componentID> <audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>admin</audit:responsibility>
<audit:date>2009-02-17T16:50:04.876Z</audit:date> <audit:date>2011-01-24T20:34:54.112Z</audit:date>
<audit:justification/> <audit:justification>Ingested object RELS-EXT</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC3"> <audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID> <audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>ppound</audit:responsibility> <audit:responsibility>admin</audit:responsibility>
<audit:date>2009-02-26T17:23:07.848Z</audit:date> <audit:date>2011-01-24T20:34:54.528Z</audit:date>
<audit:justification>datastream added</audit:justification> <audit:justification>Modified by Islandora API</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC4"> <audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/>
<audit:action>purgeDatastream</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID>
<audit:responsibility>ppound</audit:responsibility>
<audit:date>2009-02-26T17:24:28.067Z</audit:date>
<audit:justification>Purged . . . Purged datastream (ID=ISLANDORACM), versions ranging from the beginning of time to the end of time. This resulted in the permanent removal of 1 datastream version(s) (2009-02-26T13:23:07.848Z) and all associated audit records.</audit:justification>
</audit:record>
<audit:record ID="AUDREC5">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action> <audit:action>addDatastream</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID> <audit:componentID>ISLANDORACM</audit:componentID>
<audit:responsibility>ppound</audit:responsibility> <audit:responsibility>admin</audit:responsibility>
<audit:date>2009-02-26T17:27:10.814Z</audit:date> <audit:date>2011-01-24T20:34:54.711Z</audit:date>
<audit:justification>datastream added</audit:justification> <audit:justification>Ingested object ISLANDORACM</audit:justification>
</audit:record>
<audit:record ID="AUDREC6">
<audit:process type="Fedora API-M"/>
<audit:action>purgeDatastream</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-02-26T17:37:58.880Z</audit:date>
<audit:justification>DatastreamPane generated this logMessage. . . . Purged datastream (ID=ISLANDORACM), versions ranging from 2009-02-26T13:27:10.814Z to 2009-02-26T13:27:10.814Z. This resulted in the permanent removal of 1 datastream version(s) (2009-02-26T13:27:10.814Z) and all associated audit records.</audit:justification>
</audit:record>
<audit:record ID="AUDREC7">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>test</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-02-26T19:02:49.879Z</audit:date>
<audit:justification>DatastreamsPane generated this logMessage.</audit:justification>
</audit:record>
<audit:record ID="AUDREC8">
<audit:process type="Fedora API-M"/>
<audit:action>purgeDatastream</audit:action>
<audit:componentID>test</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-02-26T19:03:04.069Z</audit:date>
<audit:justification>DatastreamPane generated this logMessage. . . . Purged datastream (ID=test), versions ranging from 2009-02-26T15:02:49.879Z to 2009-02-26T15:02:49.879Z. This resulted in the permanent removal of 1 datastream version(s) (2009-02-26T15:02:49.879Z) and all associated audit records.</audit:justification>
</audit:record>
<audit:record ID="AUDREC9">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID>
<audit:responsibility>ppound</audit:responsibility>
<audit:date>2009-02-26T19:03:36.147Z</audit:date>
<audit:justification>datastream added</audit:justification>
</audit:record>
<audit:record ID="AUDREC10">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID>
<audit:responsibility>plux</audit:responsibility>
<audit:date>2009-03-13T19:11:44.755Z</audit:date>
<audit:justification>datastream added</audit:justification>
</audit:record>
<audit:record ID="AUDREC11">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByReference</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-01-26T21:10:29.212Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC12">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByReference</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-09-15T11:47:31.885Z</audit:date>
<audit:justification/>
</audit:record> </audit:record>
</audit:auditTrail> </audit:auditTrail>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="RELS-EXT" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2009-02-17T16:49:02.248Z" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0"
ID="RELS-EXT1.0" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" SIZE="370">
<foxml:xmlContent>
<rdf:RDF xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:collectionCModel">
<fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ContentModel-3.0"/>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DS-COMPOSITE-MODEL" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2009-02-17T16:49:02.248Z"
FORMAT_URI="info:fedora/fedora-system:FedoraDSCompositeModel-1.0" ID="DS-COMPOSITE-MODEL1.0"
LABEL="Datastream Composite Model" MIMETYPE="text/xml" SIZE="1148">
<foxml:xmlContent>
<dsCompositeModel xmlns="info:fedora/fedora-system:def/dsCompositeModel#">
<comment xmlns="info:fedora/fedora-system:def/comment#">
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:
$FEDORA_HOME/docs/userdocs/digitalobjects/objectModel.html#CMODEL.
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:
$FEDORA_HOME/docs/userdocs/distribution/demos.html
</comment>
<dsTypeModel ID="DSID">
<form MIME="text/xml"/>
</dsTypeModel>
</dsCompositeModel>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2009-02-17T16:50:04.876Z"
FORMAT_URI="info:fedora/fedora-system:FedoraDSCompositeModel-1.0" ID="DS-COMPOSITE-MODEL.1"
LABEL="Datastream Composite Model" MIMETYPE="text/xml" SIZE="1416">
<foxml:xmlContent>
<dsCompositeModel xmlns="info:fedora/fedora-system:def/dsCompositeModel#">
<comment xmlns="info:fedora/fedora-system:def/comment#">
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:
$FEDORA_HOME/docs/userdocs/digitalobjects/objectModel.html#CMODEL.
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:
$FEDORA_HOME/docs/userdocs/distribution/demos.html
</comment>
<dsTypeModel ID="COLLECTION_VIEW">
<form MIME="text/xml"/>
</dsTypeModel>
<dsTypeModel ID="COLLECTION_POLICY" ORDERED="false">
<form MIME="text/xml"/>
</dsTypeModel>
<dsTypeModel ID="CHILD_SECURITY" ORDERED="false">
<form MIME="text/xml"/>
</dsTypeModel>
</dsCompositeModel>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DC" STATE="A" VERSIONABLE="true"> <foxml:datastream CONTROL_GROUP="X" ID="DC" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2009-02-17T16:49:02.191Z" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" <foxml:datastreamVersion CREATED="2011-01-24T20:34:53.430Z" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/"
ID="DC1.0" LABEL="Dublin Core Record for this object" MIMETYPE="text/xml" SIZE="413"> ID="DC1.0" LABEL="Dublin Core Record for this object" MIMETYPE="text/xml" SIZE="413">
<foxml:xmlContent> <foxml:xmlContent>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" <oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/"
@ -196,21 +62,121 @@
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream CONTROL_GROUP="M" ID="ISLANDORACM" STATE="A" VERSIONABLE="true"> <foxml:datastream CONTROL_GROUP="X" ID="RELS-EXT" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2009-03-13T19:11:44.755Z" FORMAT_URI="URL" ID="ISLANDORACM.0" <foxml:datastreamVersion CREATED="2011-01-24T20:34:54.112Z" ID="RELS-EXT.0"
LABEL="ISLANDORACM.xml" MIMETYPE="text/xml"> LABEL="Fedora object-to-object relationship metadata" MIMETYPE="text/xml" SIZE="167">
<foxml:contentLocation <foxml:xmlContent>
REF="http://137.149.200.4:8080/fedora/get/islandora:collectionCModel/ISLANDORACM/2009-03-13T19:11:44.755Z" TYPE="INTERNAL_ID"/> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:collectionCModel"/>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-01-26T21:10:29.212Z" FORMAT_URI="URL" ID="ISLANDORACM.1" <foxml:datastreamVersion CREATED="2011-01-24T20:34:54.528Z" ID="RELS-EXT.1"
LABEL="ISLANDORACM.xml" MIMETYPE="text/xml"> LABEL="Fedora Object-to-Object Relationship Metadata" MIMETYPE="text/xml" SIZE="299">
<foxml:contentLocation <foxml:xmlContent>
REF="http://137.149.200.4:8080/fedora/get/islandora:collectionCModel/ISLANDORACM/2010-01-26T21:10:29.212Z" TYPE="INTERNAL_ID"/> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:collectionCModel">
<hasModel rdf:resource="info:fedora/fedora-system:ContentModel-3.0" xmlns="info:fedora/fedora-system:def/model#"/>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-09-15T11:47:31.885Z" FORMAT_URI="URL" ID="ISLANDORACM.2" </foxml:datastream>
LABEL="ISLANDORACM.xml" MIMETYPE="text/xml"> <foxml:datastream CONTROL_GROUP="X" ID="ISLANDORACM" STATE="A" VERSIONABLE="true">
<foxml:contentLocation <foxml:datastreamVersion CREATED="2011-01-24T20:34:54.711Z" ID="ISLANDORACM.0" LABEL="Islandora Content Model.xml"
REF="http://137.149.200.4:8080/fedora/get/islandora:collectionCModel/ISLANDORACM/2010-09-15T11:47:31.885Z" TYPE="INTERNAL_ID"/> MIMETYPE="application/xml" SIZE="4646">
<foxml:xmlContent>
<content_model name="Collection" xmlns="http://www.islandora.ca"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.islandora.ca http://localhost/islandoracm.xsd">
<mimetypes>
<type>text/xml</type>
<type>text/plain</type>
<type>application/xml</type>
</mimetypes>
<ingest_rules/>
<datastreams>
<datastream dsid="DC">
<display_method class="CollectionClass" file="CollectionClass.inc" method="showFieldSets" module=""/>
</datastream>
<datastream dsid="TN"/>
<datastream dsid="COLLECTION_POLICY"/>
</datastreams>
<ingest_form dsid="QDC" page="2">
<form_builder_method class="CollectionFormBuilder" file="plugins/CollectionFormBuilder.inc"
handler="handleQDCForm" method="buildQDCForm" module=""/>
<form_elements>
<element label="Title/Caption/Object Name" name="dc:title" required="true" type="textfield">
<description>The name given to the resource</description>
</element>
<element label="Creator/Photographer/Author" name="dc:creator" type="textfield">
<description>An entity primarily responsible for making the content of the resource such as a person, organization or service.</description>
</element>
<element label="Subject" name="dc:subject" type="select">
<description>An entity primarily responsible for making the content of the resource such as a person, organization or service.</description>
<authoritative_list>
<item>none</item>
<item>Multi Media</item>
<item>image</item>
<item>meeting</item>
<item>presentation</item>
<item>sound</item>
<item>text</item>
</authoritative_list>
</element>
<element label="Description" name="dc:description" required="true" type="textarea">
<description>Examples include an abstract, table of contents, or free-text account of the content of the resource.</description>
</element>
<element label="Publisher" name="dc:publisher" type="textfield">
<description>An entity, (including persons, organizations, or services), responsible for making the resource available.</description>
</element>
<element label="Contributor" name="dc:contributor" type="textfield">
<description>An entity responsible for contributing to the content of the resource such as a person, organization or service.</description>
</element>
<element label="Date" name="dc:date" type="textfield">
<description>Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23)</description>
</element>
<element label="Resource Type" name="dc:type" type="select">
<description>Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary.</description>
<authoritative_list>
<item>none</item>
<item>collection</item>
<item>dataset</item>
<item>event</item>
<item>image</item>
<item>interactive resource</item>
<item>model</item>
<item>party</item>
<item>physical object</item>
<item>place</item>
<item>service</item>
<item>software</item>
<item>sound</item>
<item>text</item>
</authoritative_list>
</element>
<element label="Source" name="dc:source" type="textfield">
<description>A reference to a resource from which the present resource is derived.</description>
</element>
<element label="Identifier" name="dc:identifier" type="textfield">
<description>A unique reference to the resource; In this instance, the accession number or collection number.</description>
</element>
<element label="Language" name="dc:language" type="select">
<description>The language of the intellectual content of the resource.</description>
<authoritative_list>
<item field="eng">English</item>
<item field="fre">French</item>
</authoritative_list>
</element>
<element label="Relation" name="dc:relation" type="textfield">
<description>Reference to a related resource.</description>
</element>
<element label="Rights Management" name="dc:rights" type="textarea">
<description>Information about intellectual property rights, copyright, and various property rights.</description>
</element>
</form_elements>
</ingest_form>
</content_model>
</foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
</foxml:digitalObject> </foxml:digitalObject>

46
plugins/ShowStreamsInFieldSets.inc

@ -57,19 +57,48 @@ class ShowStreamsInFieldSets {
*/ */
function showPDFPreview() { function showPDFPreview() {
global $base_url; global $base_url;
global $base_path;
global $user;
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$tabset = array(); $tabset = array();
$tabset['my_tabset'] = array( $tabset['first_tab'] = array(
'#type' => 'tabpage',
'#title' => t('Description'),
);
$tabset['first_tab']['tabs'] = array(
'#type' => 'tabset', '#type' => 'tabset',
); );
$tabset['my_tabset']['first_tab'] = array( $objectHelper = new ObjectHelper();
$item = new Fedora_Item($this->pid);
if (key_exists('TN', $item->datastreams)) {
$tn_url = $base_url.'/fedora/repository/'.$item->pid.'/TN';
}
else {
$tn_url = $base_path.drupal_get_path('module', 'fedora_repository').'/images/Crystal_Clear_app_download_manager.png';
}
$dc_html = $objectHelper->getFormattedDC($item);
$dl_link = l('<div style="float:left; padding: 10px"><img src="'.$tn_url.'"><br />View Document</div>', '/fedora/repository/'.$this->pid.'/OBJ', array('html' => TRUE));
$tabset['first_tab']['tabs']['view'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Description'), '#title' => t('View'),
'#content' => $this->showQdc(), '#content' => $dl_link . $dc_html,
); );
$tabset['my_tabset']['second_tab'] = array( if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
// $collection_fieldset = array ( $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC');
$tabset['first_tab']['tabs']['edit'] = array(
'#type' => 'tabpage',
'#title' => t('Edit'),
'#content' => $editform,
);
}
$tabset['second_tab'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Read Online'), '#title' => t('Read Online'),
'#content' => "<iframe src=\"http://docs.google.com/viewer?url=". $base_url . '/fedora/repository/'. '#content' => "<iframe src=\"http://docs.google.com/viewer?url=". $base_url . '/fedora/repository/'.
@ -77,10 +106,7 @@ class ShowStreamsInFieldSets {
); );
// Render the tabset. // Render the tabset.
return tabs_render($tabset); return $tabset;
return theme('fieldset', $collection_fieldset);
// . (user_access('add fedora datastreams') ? drupal_get_form('fedora_ilives_image_tagging_form', $this->pid) : '');
} }

50
plugins/fedoraObject.inc

@ -0,0 +1,50 @@
<?php
class FedoraObject {
function __construct($pid = '') {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
if (!empty($pid)) {
$this->pid = $pid;
$this->item = new Fedora_Item($pid);
}
}
public function showFieldSets() {
global $user;
$objectHelper = new ObjectHelper();
$tabset = array();
$show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form');
$purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path()))));
$tabset['fedora_object_details'] = array(
'#type' => 'tabpage',
'#title' => t('Object Details'),
'#selected' => $show_purge_tab,
);
$tabset['fedora_object_details']['tabset'] = array(
'#type' => 'tabset',
);
$dc_html = $objectHelper->getFormattedDC($this->item);
$ds_list = $objectHelper->getFormattedDatastreamList($this->pid, NULL, $this->item);
$tabset['fedora_object_details']['tabset']['view'] = array(
'#type' => 'tabpage',
'#title' => t('View'),
'#content' => $dc_html . $ds_list . $purge_form,
);
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC');
$tabset['fedora_object_details']['tabset']['edit'] = array(
'#type' => 'tabpage',
'#title' => t('Edit'),
'#content' => $editform,
);
}
return $tabset;
}
}

23
plugins/herbarium.inc

@ -107,10 +107,6 @@ class Herbarium {
$tabset = array(); $tabset = array();
$tabset['my_tabset'] = array(
'#type' => 'tabset',
);
global $user; global $user;
$qs = ''; $qs = '';
if ($user->uid != 0) { if ($user->uid != 0) {
@ -119,13 +115,13 @@ class Herbarium {
$viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs;
$html = '<iframe src="'. $viewer_url . '" scrolling="no" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>'; $html = '<iframe src="'. $viewer_url . '" scrolling="no" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>';
$tabset['my_tabset']['second_tab'] = array( $tabset['second_tab'] = array(
// $collection_fieldset = array ( // $collection_fieldset = array (
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Full-size'), '#title' => t('Full-size'),
'#content' => $html '#content' => $html
); );
$tabset['my_tabset']['first_tab'] = array( $tabset['first_tab'] = array(
// #type and #title are the minimum requirements. // #type and #title are the minimum requirements.
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('View'), '#title' => t('View'),
@ -135,15 +131,15 @@ class Herbarium {
); );
$dwc = new DarwinCore($this->item); $dwc = new DarwinCore($this->item);
$tabset['my_tabset']['third_tab'] = array( $tabset['third_tab'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Description'), '#title' => t('Description'),
); );
$tabset['my_tabset']['third_tab']['tabset'] = array( $tabset['third_tab']['tabset'] = array(
'#type' => 'tabset', '#type' => 'tabset',
); );
$tabset['my_tabset']['third_tab']['tabset']['view'] = array( $tabset['third_tab']['tabset']['view'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Darwin Core'), '#title' => t('Darwin Core'),
'#content' => $dwc->asHTML(), '#content' => $dwc->asHTML(),
@ -152,17 +148,17 @@ class Herbarium {
$obj = new ObjectHelper(); $obj = new ObjectHelper();
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE'); $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE');
$tabset['my_tabset']['third_tab']['tabset']['edit'] = array( $tabset['third_tab']['tabset']['edit'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Edit'), '#title' => t('Edit'),
'#content' => $editform, '#content' => $editform,
); );
$tabset['my_tabset']['third_tab']['tabset']['source'] = array( $tabset['third_tab']['tabset']['source'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Vew Source'), '#title' => t('Vew Source'),
); );
$xmlsrc = $dwc->asXML(); $xmlsrc = $dwc->asXML();
$tabset['my_tabset']['third_tab']['tabset']['source']['srctext'] = array( $tabset['third_tab']['tabset']['source']['srctext'] = array(
'#name' => 'source', '#name' => 'source',
'#type' => 'textarea', '#type' => 'textarea',
'#value' => $xmlsrc, '#value' => $xmlsrc,
@ -170,7 +166,6 @@ class Herbarium {
'#height' => 50, '#height' => 50,
); );
} }
return $tabset;
return tabs_render($tabset);
} }
} }

9
plugins/map_viewer.inc

@ -38,18 +38,17 @@ class ShowMapStreamsInFieldSets {
$tabset['my_tabset']['second_tab'] = array( $tabset['my_tabset']['second_tab'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Full-size'), '#title' => t('Full-size'),
'#content' => $html//'<div class="iiv"></div>' '#content' => $html,
); );
$objectHelper = new ObjectHelper();
$item = new Fedora_Item($this->pid); $item = new Fedora_Item($this->pid);
$tabset['my_tabset']['third_tab'] = array( $tabset['my_tabset']['third_tab'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Description'), '#title' => t('Description'),
'#content' => $item->get_dissemination('islandora:mods2htmlSdef', 'mods2html'), '#content' => $item->get_dissemination('islandora:mods2htmlSdef', 'mods2html')
. $objectHelper->getFormattedDatastreamList($this->pid, NULL, $item),
); );
// Render the tabset. // Render the tabset.
return tabs_render($tabset); return tabs_render($tabset);
return theme('fieldset', $collection_fieldset);
} }
} }

24
plugins/slide_viewer.inc

@ -14,17 +14,12 @@ class ShowSlideStreamsInFieldSets {
module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets');
global $base_url; global $base_url;
global $user;
$tabset = array(); $tabset = array();
$tabset['my_tabset'] = array(
'#type' => 'tabset',
);
global $user;
$qs = ''; $qs = '';
if ($user->uid != 0) { if ($user->uid != 0) {
// $qs = '?uid=' . base64_encode($user->name . ':' . $user->sid);
$qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass);
} }
@ -33,13 +28,12 @@ class ShowSlideStreamsInFieldSets {
drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme');
$tabset['my_tabset']['second_tab'] = array( $tabset['second_tab'] = array(
// $collection_fieldset = array (
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('Full-size'), '#title' => t('Full-size'),
'#content' => $html); '#content' => $html);
$tabset['my_tabset']['first_tab'] = array( $tabset['first_tab'] = array(
// #type and #title are the minimum requirements. // #type and #title are the minimum requirements.
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('View'), '#title' => t('View'),
@ -48,16 +42,6 @@ class ShowSlideStreamsInFieldSets {
'/fedora/imageapi/'. $this->pid . '/JPG/JPG.jpg'. '" />'. '<p>'. drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>', '/fedora/imageapi/'. $this->pid . '/JPG/JPG.jpg'. '" />'. '<p>'. drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>',
); );
$ssifs = new ShowStreamsInFieldSets($this->pid); return $tabset;
$tabset['my_tabset']['third_tab'] = array(
'#type' => 'tabpage',
'#title' => t('Description'),
'#content' => $ssifs->showQdc(),
);
// Render the tabset.
return tabs_render($tabset);
return theme('fieldset', $collection_fieldset);
// . (user_access('add fedora datastreams') ? drupal_get_form('fedora_ilives_image_tagging_form', $this->pid) : '');
} }
} }

Loading…
Cancel
Save