Drupal modules for browsing and managing Fedora-based digital repositories.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.1 KiB

Merge branch 'ISLANDORA-278' into 6.x Conflicts: CollectionClass.inc CollectionPolicy.inc ConnectionHelper.inc ContentModel.inc MimeClass.inc ObjectHelper.inc SearchClass.inc SecurityClass.inc api/dublin_core.inc api/fedora_collection.inc api/fedora_export.inc api/fedora_item.inc api/fedora_utils.inc api/rels-ext.inc api/tagging.inc fedora_repository.module formClass.inc form_elements/css/copyright.css form_elements/css/filechooser.css form_elements/css/list.css form_elements/css/people.css form_elements/css/sticky.css form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css form_elements/includes/autocomplete.inc form_elements/includes/creative_commons.inc form_elements/includes/filechooser.inc form_elements/includes/people.inc form_elements/islandora_form_elements.module form_elements/js/copyright.js form_elements/js/filechooser.js form_elements/js/jcarousellite_1.0.1.js form_elements/js/jquery.breakly-1.0.js form_elements/js/jquery.easing.1.1.js form_elements/js/jquery.loadImages.1.0.1.js form_elements/js/jquery.loadImages.1.0.1.min.js form_elements/js/jquery.mousewheel.min.js form_elements/js/jquery.tag.editor-min.js form_elements/js/jquery.ui.core.js form_elements/js/jquery.ui.datepicker.js form_elements/js/jquery.ui.widget.js form_elements/js/otherselect.js form_elements/js/people_ahah.js form_elements/xml/gacs.xml form_elements/xml/languages.xml plugins/CollectionFormBuilder.inc plugins/CreateCollection.inc plugins/DemoFormBuilder.inc plugins/DocumentConverter.inc plugins/Exiftool.inc plugins/Ffmpeg.inc plugins/Flv.inc plugins/FlvFormBuilder.inc plugins/FormBuilder.inc plugins/ImageManipulation.inc plugins/ModsFormBuilder.inc plugins/PersonalCollectionClass.inc plugins/QtFormBuilder.php plugins/Refworks.inc plugins/ShowDemoStreamsInFieldSets.inc plugins/ShowStreamsInFieldSets.inc plugins/fedoraObject.inc plugins/herbarium.inc plugins/map_viewer.inc plugins/qt_viewer.inc plugins/slide_viewer.inc plugins/tagging_form.inc
13 years ago
<?php
Merge branch 'ISLANDORA-278' into 6.x Conflicts: CollectionClass.inc CollectionPolicy.inc ConnectionHelper.inc ContentModel.inc MimeClass.inc ObjectHelper.inc SearchClass.inc SecurityClass.inc api/dublin_core.inc api/fedora_collection.inc api/fedora_export.inc api/fedora_item.inc api/fedora_utils.inc api/rels-ext.inc api/tagging.inc fedora_repository.module formClass.inc form_elements/css/copyright.css form_elements/css/filechooser.css form_elements/css/list.css form_elements/css/people.css form_elements/css/sticky.css form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css form_elements/includes/autocomplete.inc form_elements/includes/creative_commons.inc form_elements/includes/filechooser.inc form_elements/includes/people.inc form_elements/islandora_form_elements.module form_elements/js/copyright.js form_elements/js/filechooser.js form_elements/js/jcarousellite_1.0.1.js form_elements/js/jquery.breakly-1.0.js form_elements/js/jquery.easing.1.1.js form_elements/js/jquery.loadImages.1.0.1.js form_elements/js/jquery.loadImages.1.0.1.min.js form_elements/js/jquery.mousewheel.min.js form_elements/js/jquery.tag.editor-min.js form_elements/js/jquery.ui.core.js form_elements/js/jquery.ui.datepicker.js form_elements/js/jquery.ui.widget.js form_elements/js/otherselect.js form_elements/js/people_ahah.js form_elements/xml/gacs.xml form_elements/xml/languages.xml plugins/CollectionFormBuilder.inc plugins/CreateCollection.inc plugins/DemoFormBuilder.inc plugins/DocumentConverter.inc plugins/Exiftool.inc plugins/Ffmpeg.inc plugins/Flv.inc plugins/FlvFormBuilder.inc plugins/FormBuilder.inc plugins/ImageManipulation.inc plugins/ModsFormBuilder.inc plugins/PersonalCollectionClass.inc plugins/QtFormBuilder.php plugins/Refworks.inc plugins/ShowDemoStreamsInFieldSets.inc plugins/ShowStreamsInFieldSets.inc plugins/fedoraObject.inc plugins/herbarium.inc plugins/map_viewer.inc plugins/qt_viewer.inc plugins/slide_viewer.inc plugins/tagging_form.inc
13 years ago
/**
* @file
*
*/
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/**
* implements methods from content model ingest form xml
* builds a dc metadata form
*/
class DemoFormBuilder extends FormBuilder {
/**
* Constructor
*/
function DemoFormBuilder() {
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
/**
* Override this so we can specify the datastream id of FULL_SIZE should make this easier
* @global type $base_url
* @param type $form_values
* @param type $dom
* @param type $rootElement
*/
function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
global $base_url;
$mimetype = new MimeClass();
$server = NULL;
$file = $form_values['ingest-file-location'];
if (!empty($file)) {
$dformat = $mimetype->getType($file);
$fileUrl = $base_url . '/' . drupal_urlencode($file);
$beginIndex = strrpos($fileUrl, '/');
$dtitle = substr($fileUrl, $beginIndex + 1);
$dtitle = urldecode($dtitle);
// $dtitle = substr($dtitle, 0, strpos($dtitle, "."));
$ds1 = $dom->createElement("foxml:datastream");
$ds1->setAttribute("ID", "FULL_SIZE");
$ds1->setAttribute("STATE", "A");
$ds1->setAttribute("CONTROL_GROUP", "M");
$ds1v = $dom->createElement("foxml:datastreamVersion");
$rootElement->appendChild($ds1);
$ds1v->setAttribute("ID", "FULL_SIZE.0");
$ds1v->setAttribute("MIMETYPE", "$dformat");
$ds1v->setAttribute("LABEL", "$dtitle");
$ds1content = $dom->createElement('foxml:contentLocation');
$ds1content->setAttribute("REF", "$fileUrl");
$ds1content->setAttribute("TYPE", "URL");
$ds1->appendChild($ds1v);
$ds1v->appendChild($ds1content);
}
if (!empty($_SESSION['fedora_ingest_files'])) {
foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) {
$createdFile = strstr($createdFile, $file);
$dformat = $mimetype->getType($createdFile);
$fileUrl = $base_url . '/' . drupal_urlencode($createdFile);
$beginIndex = strrpos($fileUrl, '/');
$dtitle = substr($fileUrl, $beginIndex + 1);
$dtitle = urldecode($dtitle);
// $dtitle = substr($dtitle, 0, strpos($dtitle, "."));
$dtitle = $dtitle;
$ds1 = $dom->createElement("foxml:datastream");
$ds1->setAttribute("ID", "$dsid");
$ds1->setAttribute("STATE", "A");
$ds1->setAttribute("CONTROL_GROUP", "M");
$ds1v = $dom->createElement("foxml:datastreamVersion");
$ds1v->setAttribute("ID", "$dsid.0");
$ds1v->setAttribute("MIMETYPE", "$dformat");
$ds1v->setAttribute("LABEL", "$dtitle");
$ds1content = $dom->createElement('foxml:contentLocation');
$ds1content->setAttribute("REF", "$fileUrl");
$ds1content->setAttribute("TYPE", "URL");
$ds1->appendChild($ds1v);
$ds1v->appendChild($ds1content);
$rootElement->appendChild($ds1);
}
}
}
}