Browse Source

Added datastream list and DC to collection tab view.

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
da5fb410a4
  1. 10
      CollectionClass.inc
  2. 64
      ObjectHelper.inc

10
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)) {

64
ObjectHelper.inc

@ -392,31 +392,7 @@ class ObjectHelper {
return $output;
}
/**
* 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)) {
function getFormattedDatastreamList($object_pid, $contentModels, &$fedoraItem) {
$availableDataStreamsText = 'Detailed List of Content';
//$metaDataText='Description';
$mainStreamLabel = NULL;
@ -464,13 +440,37 @@ class ObjectHelper {
$dataStreamBody .= drupal_get_form('add_stream_form', $object_pid);
}
}
$fieldset = array(
'#title' => t("!text", array('!text' => $availableDataStreamsText)),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#value' => $dataStreamBody
);
$dataStreamBody = '<div class = "fedora_detailed_list">' . theme('fieldset', $fieldset) . '</div>';
$dataStreamBody = '<div class = "fedora_detailed_list">' . $dataStreamBody . '</div>';
return $dataStreamBody;
}
/**
* 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)) {
$dataStreamBody = $this->getFormattedDatastreamList($object_pid, $contentModels, $fedoraItem);
}
$content = '';

Loading…
Cancel
Save