From abfc84457d9b309158910d3320a8ba6349e507b1 Mon Sep 17 00:00:00 2001 From: jonathangreen Date: Thu, 16 Jun 2011 22:23:25 -0300 Subject: [PATCH 001/247] ISLANDORA-278 Initial pass at making the islandora code conform to the drupal coding standards. --- CollectionClass.inc | 6 +- CollectionPolicy.inc | 369 +- ConnectionHelper.inc | 34 +- ContentModel.inc | 1008 +- MimeClass.inc | 372 +- ObjectHelper.inc | 80 +- SearchClass.inc | 272 +- SecurityClass.inc | 28 +- XMLDatastream.inc | 17 +- api/dublin_core.inc | 26 +- api/fedora_collection.inc | 51 +- api/fedora_export.inc | 54 +- api/fedora_item.inc | 21 +- api/fedora_utils.inc | 42 +- api/rels-ext.inc | 61 +- api/tagging.inc | 10 +- .../COLLECTION-COLLECTION POLICY.xml | 39 +- collection_policies/FLV-COLLECTION POLICY.xml | 6 +- collection_policies/JPG-COLLECTION POLICY.xml | 38 +- collection_policies/PDF-COLLECTION POLICY.xml | 25 +- .../PERSONAL-COLLECTION-POLICY.xml | 3 +- .../RIRI COLLECTION POLICY.xml | 2 +- .../book_collection_policy.xml | 127 +- .../large_image_collection_policy.xml | 146 +- collection_policies/qt_collection_policy.xml | 79 +- collection_policy.xsd | 77 +- collection_views/COLLECTION_VIEW.xml | 470 +- .../Coverflow_Collection_View.xsl | 119 +- .../Coverflow_PRE_Collection_View.xsl | 129 +- collection_views/FLV-COLLECTION VIEW(2).xml | 427 +- collection_views/REFWORKS-COLLECTION_VIEW.xml | 407 +- collection_views/SIMPLE-COLLECTION_VIEW.xml | 431 +- .../SmileyStuff-COLLECTION_VIEW.xml | 118 +- collection_views/Video-COLLECTION_VIEW.xml | 114 +- collection_views/default-sparqltoHtml.xsl | 287 +- .../demo_image_collection_dc_record.xml | 6 +- collection_views/simple_list_view.xml | 36 +- .../standard_jpeg_collection_view.xml | 128 +- collection_views/yui_coverflow/css/test.css | 20 +- .../yui_coverflow/js/CoverFlow.js | 1526 +- collection_views/yui_coverflow/js/test.js | 97 +- content_models/BASIC_AUDIO.xml | 14 +- content_models/BASIC_VIDEO.xml | 14 +- content_models/COLLECTIONCM.xml | 173 +- content_models/FAS_slideCModel.xml | 323 +- content_models/REFWORKSCM.xml | 26 +- content_models/REFWORKSCM_1.xml | 26 +- content_models/STANDARD JPG.xml | 184 +- content_models/STANDARD PDF.xml | 14 +- content_models/STANDARD_FLVCM.xml | 14 +- content_models/STANDARD_IMAGECM.xml | 18 +- content_models/STANDARD_JPG.xml | 184 +- content_models/STANDARD_QT.xml | 251 +- content_models/STRICT_PDFCM.xml | 205 +- content_models/demo_Collection.xml | 108 +- content_models/demo_CollectionImpl.xml | 348 +- content_models/demo_DualResImage.xml | 130 +- .../demo_DualResImageCollection.xml | 124 +- content_models/demo_DualResImageImpl.xml | 286 +- content_models/demo_DualResolution.xml | 108 +- content_models/ilives_bookCModel.xml | 1282 +- content_models/ilives_jp2Sdef.xml | 124 +- content_models/ilives_jp2Sdep-pageCModel.xml | 322 +- content_models/ilives_tei2htmlSdef.xml | 122 +- .../ilives_tei2htmlSdep-pageCModel.xml | 435 +- content_models/ilives_viewerSdef.xml | 122 +- .../ilives_viewerSdep-bookCModel.xml | 276 +- content_models/islandora_collectionCModel.xml | 1118 +- content_models/islandora_herbCModel.xml | 3556 +- .../islandora_jp2Sdep-slideCModel.xml | 508 +- content_models/islandora_largeimages.xml | 466 +- content_models/islandora_mapCModel.xml | 672 +- content_models/islandora_mods2htmlSdef.xml | 172 +- content_models/islandora_mods2htmlSdep.xml | 848 +- content_models/islandora_qtCModel.xml | 301 +- content_models/islandora_slideCModel.xml | 2838 +- .../islandora_viewerSdep-slideCModel.xml | 524 +- example_collection_views/MHL-sparqltoHtml.xsl | 434 +- example_collection_views/critter.xsl | 113 +- example_collection_views/flv-sparqltoHtml.xsl | 427 +- example_collection_views/mlp-sparqltoHtml.xsl | 417 +- example_collection_views/refworks.xsl | 298 +- .../riri-sparqltoHtml.xsl | 438 +- example_collection_views/sparqltoHtml.xsl | 287 +- fedora_repository.install | 5 +- fedora_repository.module | 167 +- fedora_repository.solutionpacks.inc | 12 +- formClass.inc | 31 +- form_elements/css/copyright.css | 8 +- form_elements/css/filechooser.css | 64 +- form_elements/css/list.css | 28 +- form_elements/css/people.css | 120 +- form_elements/css/sticky.css | 24 +- .../ui-lightness/jquery-ui-1.8.4.custom.css | 64 +- form_elements/includes/autocomplete.inc | 372 +- form_elements/includes/creative_commons.inc | 227 +- form_elements/includes/filechooser.inc | 176 +- form_elements/includes/people.inc | 143 +- form_elements/islandora_form_elements.module | 1046 +- form_elements/js/copyright.js | 122 +- form_elements/js/filechooser.js | 104 +- form_elements/js/jcarousellite_1.0.1.js | 245 +- form_elements/js/jquery.breakly-1.0.js | 58 +- form_elements/js/jquery.easing.1.1.js | 205 +- form_elements/js/jquery.loadImages.1.0.1.js | 14 +- .../js/jquery.loadImages.1.0.1.min.js | 17 +- form_elements/js/jquery.mousewheel.min.js | 46 +- form_elements/js/jquery.tag.editor-min.js | 146 +- form_elements/js/jquery.ui.core.js | 536 +- form_elements/js/jquery.ui.datepicker.js | 3321 +- form_elements/js/jquery.ui.widget.js | 448 +- form_elements/js/otherselect.js | 36 +- form_elements/js/people_ahah.js | 144 +- form_elements/xml/gacs.xml | 11108 ++--- form_elements/xml/languages.xml | 39128 ++++++++-------- ilives/book.inc | 10 +- ilives/fedora_ilives.install | 5 +- ilives/fedora_ilives.module | 4 +- ilives/image_rotator_tagger_block.inc | 49 +- ilives/searchTerms.xml | 64 +- ilives/tests/fedora_ilives.test | 248 +- ilives/tests/test_files/mods_record.xml | 158 +- ilives/xml/book_collection_policy.xml | 38 +- ilives/xml/ilives_CollectionModel.xml | 237 +- ilives/xml/ilives_bookCModel.xml | 984 +- ilives/xml/ilives_collection.xml | 100 +- ilives/xml/ilives_figuresCModel.xml | 34 +- ilives/xml/ilives_jp2Sdef.xml | 140 +- ilives/xml/ilives_jp2Sdep-pageCModel.xml | 322 +- ilives/xml/ilives_pageCModel.xml | 156 +- ilives/xml/ilives_tei2htmlSdef.xml | 106 +- ilives/xml/ilives_tei2htmlSdep-pageCModel.xml | 419 +- ilives/xml/ilives_viewerSdef.xml | 106 +- ilives/xml/ilives_viewerSdep-bookCModel.xml | 228 +- ilives/xml/ilives_viewerSdep-pageCModel.xml | 228 +- ilives/xsl/MODS3-22simpleDC.xsl | 711 +- ilives/xsl/book_view.xsl | 211 +- ilives/xsl/pageResults.xsl | 221 +- ilives/xsl/results.xsl | 481 +- .../foxml/islandora-collectionCModel.xml | 338 +- installer_files/foxml/islandora-demos.xml | 4 +- .../foxml/islandora-pdfcollection.xml | 346 +- .../foxml/islandora-strictpdfCModel.xml | 1542 +- installer_files/foxml/islandora-top.xml | 280 +- islandoracm.xsd | 685 +- js/AC_Quicktime.js | 398 +- js/printer_tool.js | 23 +- js/swfobject.js | 385 +- plugins/CollectionFormBuilder.inc | 14 +- plugins/CreateCollection.inc | 11 +- plugins/DarwinCore.inc | 31 +- plugins/DemoFormBuilder.inc | 14 +- plugins/DocumentConverter.inc | 26 +- plugins/Exiftool.inc | 77 +- plugins/Ffmpeg.inc | 18 +- plugins/Flv.inc | 67 +- plugins/FlvFormBuilder.inc | 13 +- plugins/FormBuilder.inc | 152 +- plugins/ImageManipulation.inc | 21 +- plugins/ModsFormBuilder.inc | 816 +- plugins/PersonalCollectionClass.inc | 27 +- plugins/QtFormBuilder.php | 121 +- plugins/Refworks.inc | 97 +- plugins/ShowDemoStreamsInFieldSets.inc | 14 +- plugins/ShowStreamsInFieldSets.inc | 58 +- plugins/fedoraObject.inc | 14 +- plugins/fedora_attach/fedora_attach.admin.inc | 12 +- plugins/fedora_attach/fedora_attach.install | 12 +- plugins/fedora_attach/fedora_attach.module | 88 +- plugins/fedora_imageapi.module | 118 +- plugins/herbarium.inc | 43 +- plugins/islandora_newspaper/Newspaper.inc | 59 +- .../islandora_newspaper.module | 8 +- .../newspapers_collection_policy.xml | 39 +- .../newspapers_guardian.xml | 695 +- .../newspapers_issueCModel_islandoracm.xml | 45 +- .../newspapers_pageCModel.xml | 250 +- .../newspapers_viewerSdep-issueCModel.xml | 392 +- .../newspapers_viewerSdep-pageCModel.xml | 350 +- plugins/map_viewer.inc | 13 +- plugins/pidfield/pidfield.install | 3 +- plugins/pidfield/pidfield.module | 42 +- plugins/qt_viewer.inc | 114 +- plugins/slide_viewer.inc | 18 +- plugins/tagging_form.inc | 19 +- policies/viewANDeditbyrole.xml | 24 +- searchTerms.xml | 136 +- solrSearchTerms.xml | 136 +- tests/fedora_repository.test | 18 +- xsl/advanced_search_results.xsl | 515 +- xsl/browseIndexToResultPage.xslt | 893 +- xsl/convertQDC.xsl | 72 +- xsl/refworks.xsl | 298 +- xsl/results.xsl | 482 +- xsl/romeo.xsl | 101 +- xsl/sparql_to_html.xsl | 466 +- xsl/specdwc.xsl | 177 +- xsl/unfilteredresults.xsl | 416 +- 198 files changed, 51615 insertions(+), 49414 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index a7c369a3..c90a5e89 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -1,6 +1,6 @@ $pidNameSpace ); $object = $soapClient->__soapCall('getNextPID', array( - $params - )); + $params + )); } catch (exception $e) { drupal_set_message(t('Error getting Next PID: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index 8997b42e..21002710 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -1,16 +1,15 @@ get_datastream_dissemination($dsid); - } else { - $ds=null; } - + else { + $ds = NULL; + } } - + if (!empty($ds) || !$preFetch) { - $ret=new CollectionPolicy($ds, $pid, $dsid); + $ret = new CollectionPolicy($ds, $pid, $dsid); } - } - catch (SOAPException $e) { - + } catch (SOAPException $e) { + $ret = FALSE; } return $ret; } - + /** * Ingests a new Collection Policy datastream to the specified * PID with the DSID specified. The file should be a valid collection @@ -68,24 +66,24 @@ class CollectionPolicy extends XMLDatastream { * @param string $cpDsid * @param string $file * @return CollectionPolicy $ret - */ + */ public static function ingestFromFile($pid, $name, $cpDsid, $file) { $ret = FALSE; - + if (($cp = self::loadFromCollection($pid, $cpDsid)) === FALSE && file_exists($file)) { $cp = new ContentModel(file_get_contents($file), $pid, $cpDsid); $rootEl = $cp->xml->getElementsByTagName('collection_policy')->item(0); $rootEl->setAttribute('name', $name); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $ret = $cp; } - + return $ret; } - + /** * Ingests a new Collection Policy datastream to the specified * PID with the DSID specified. Clones the collection policy from the @@ -96,26 +94,26 @@ class CollectionPolicy extends XMLDatastream { * @param string $cpDsid * @param string $copy_collection_pid * @return CollectionPolicy $ret - */ + */ public static function ingestFromCollection($pid, $name, $cpDsid, $copy_collection_pid) { $ret = FALSE; - + if (($cp = self::loadFromCollection($pid, $cpDsid)) === FALSE && ($copy_cp = self::loadFromCollection($copy_collection_pid)) !== FALSE && $copy_cp->validate()) { $newDom = $copy_cp->xml; $rootEl = $newDom->getElementsByTagName('collection_policy')->item(0); $rootEl->setAttribute('name', $name); - + $cp = new CollectionPolicy($newDom, $pid, $cpDsid); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $ret = $cp; } - + return $ret; - } - + } + /** * Ingests a new minimum Collection Policy datastream to the specified * PID with the DSID specified. Initializes the policy with the specified values. @@ -130,10 +128,10 @@ class CollectionPolicy extends XMLDatastream { * @param string $searchField * @param string $searchValue * @return CollectionPolicy $ret - */ + */ public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) { - $ret = FALSE; - if (($cp = self::loadFromCollection($pid )) === FALSE) { //removed second, non-existant variable + $ret = FALSE; + if (($cp = self::loadFromCollection($pid)) === FALSE) { //removed second, non-existant variable module_load_include('inc', 'fedora_repository', 'ContentModel'); if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) { $newDom = new DOMDocument('1.0', 'utf-8'); @@ -142,45 +140,43 @@ class CollectionPolicy extends XMLDatastream { $rootEl->setAttribute('name', $name); $rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS .' '. self::$SCHEMA_URI); - + $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS . ' ' . self::$SCHEMA_URI); + $modelsEl = $newDom->createElement('content_models'); - + $cmEl = $newDom->createElement('content_model'); $cmEl->setAttribute('name', $cm->getName()); $cmEl->setAttribute('dsid', $cm->dsid); $cmEl->setAttribute('namespace', $model_namespace); $cmEl->setAttribute('pid', $cm->pid); - - $modelsEl->appendChild($cmEl); + + $modelsEl->appendChild($cmEl); $rootEl->appendChild($modelsEl); - + $relEl = $newDom->createElement('relationship', $relationship); $rootEl->appendChild($relEl); - + $searchTermsEl = $newDom->createElement('search_terms'); $newTermEl = $newDom->createElement('term', $searchValue); $newTermEl->setAttribute('field', $searchField); $searchTermsEl->appendChild($newTermEl); $rootEl->appendChild($searchTermsEl); - + $newDom->appendChild($rootEl); - + $cp = new CollectionPolicy($newDom, $pid, $policyDsid); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - + + $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $policyDsid, $name, 'text/xml', 'X'); $ret = $cp; } - } - + return $ret; - } - + } /** * Constructor @@ -192,10 +188,10 @@ class CollectionPolicy extends XMLDatastream { * @return XMLDatastream $cm */ public function __construct($xmlStr, $pid = NULL, $dsid = NULL) { - parent::__construct($xmlStr,$pid,$dsid); - $this->name= 'Collection Policy'; + parent::__construct($xmlStr, $pid, $dsid); + $this->name = 'Collection Policy'; } - + /** * Attempts to convert from the old XML schema to the new by * traversing the XML DOM and building a new DOM. When done @@ -205,17 +201,17 @@ class CollectionPolicy extends XMLDatastream { */ protected function convertFromOldSchema() { if ($this->xml == NULL) { - $this->fetchXml(); + $this->fetchXml(); } $sXml = simplexml_load_string($this->xml->saveXML()); $newDom = new DOMDocument('1.0', 'utf-8'); $newDom->formatOutput = TRUE; - + $rootEl = $newDom->createElement('collection_policy'); $rootEl->setAttribute('name', $sXml['name']); $rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS .' '. self::$SCHEMA_URI); + $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS . ' ' . self::$SCHEMA_URI); $content_modelsEl = $newDom->createElement('content_models'); foreach ($sXml->contentmodels->contentmodel as $contentmodel) { @@ -227,13 +223,13 @@ class CollectionPolicy extends XMLDatastream { $content_modelsEl->appendChild($content_modelEl); } $rootEl->appendChild($content_modelsEl); - + $search_termsEl = $newDom->createElement('search_terms'); foreach ($sXml->search_terms->term as $term) { $termEl = $newDom->createElement('term', $term->value); $termEl->setAttribute('field', $term->field); if (strval($sXml->search_terms->default) == $term->field) { - $termEl->setAttribute('default', 'true'); + $termEl->setAttribute('default', 'true'); } $search_termsEl->appendChild($termEl); } @@ -241,13 +237,12 @@ class CollectionPolicy extends XMLDatastream { $relationshipEl = $newDom->createElement('relationship', $sXml->relationship); $rootEl->appendChild($relationshipEl); - + $newDom->appendChild($rootEl); $this->xml = DOMDocument::loadXML($newDom->saveXml()); } - /** * Gets the name of the relationship to use * for members of this collection. @@ -256,14 +251,14 @@ class CollectionPolicy extends XMLDatastream { * @return string $relationship */ public function getRelationship() { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { - $ret=trim($this->xml->getElementsByTagName('relationship')->item(0)->nodeValue); + $ret = trim($this->xml->getElementsByTagName('relationship')->item(0)->nodeValue); } return $ret; } - - /** + + /** * Sets the name of the relationship to use * for members of this collection. * Returns FALSE on failure. @@ -272,16 +267,16 @@ class CollectionPolicy extends XMLDatastream { * @return boolean $ret */ public function setRelationship($relationship) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { - $relationshipEl=$this->xml->getElementsByTagName('relationship')->item(0); - $relationshipEl->nodeValue=trim($relationship); + $relationshipEl = $this->xml->getElementsByTagName('relationship')->item(0); + $relationshipEl->nodeValue = trim($relationship); $ret = TRUE; } - return $ret; + return $ret; } - - /** + + /** * Gets the path to the staging area to use for this * collection. By default recurses to the parent collection * if the staging area is undefined @@ -290,17 +285,18 @@ class CollectionPolicy extends XMLDatastream { * @return string $path */ public function getStagingArea($recurse=TRUE) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { if ($this->staging_area === NULL) { - $stagingEl=$this->xml->getElementsByTagName('staging_area'); - + $stagingEl = $this->xml->getElementsByTagName('staging_area'); + if ($stagingEl->length > 0) { $this->staging_area = trim($stagingEl->item(0)->nodeValue); - } elseif ($recurse) { + } + elseif ($recurse) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $item=new Fedora_Item($this->pid); - $rels=$item->get_relationships(); + $item = new Fedora_Item($this->pid); + $rels = $item->get_relationships(); if (count($rels) > 0) { foreach ($rels as $rel) { $cp = CollectionPolicy::loadFromCollection($rel['object']); @@ -310,16 +306,15 @@ class CollectionPolicy extends XMLDatastream { } } } - } + } } - + $ret = $this->staging_area; - } return $ret; } - - /** + + /** * Sets the path to the staging area to use for this * collection. If specified path is blank (or false) it will * remove the staging are path element from the collection policy. @@ -329,84 +324,80 @@ class CollectionPolicy extends XMLDatastream { * @return string $relationship */ public function setStagingArea($path) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { - $rootEl=$this->xml->getElementsByTagName('collection_policy')->item(0); - $stagingEl=$this->xml->getElementsByTagName('staging_area'); + $rootEl = $this->xml->getElementsByTagName('collection_policy')->item(0); + $stagingEl = $this->xml->getElementsByTagName('staging_area'); if ($stagingEl->length > 0) { - $stagingEl=$stagingEl->item(0); - if (trim($path) == '') { - $rootEl->removeChild($stagingEl); - } + $stagingEl = $stagingEl->item(0); + if (trim($path) == '') { + $rootEl->removeChild($stagingEl); + } else { - $stagingEl->nodeValue=trim($path); - } - } + $stagingEl->nodeValue = trim($path); + } + } elseif (trim($path) != '') { - $stagingEl=$this->xml->createElement('staging_area', trim($path)); - $rootEl->appendChild($stagingEl); + $stagingEl = $this->xml->createElement('staging_area', trim($path)); + $rootEl->appendChild($stagingEl); } $ret = TRUE; } - return $ret; - } - - + return $ret; + } + /** - * Gets the next available PID for the - * content model specified by the DSID - * parameter. - * - * @param string $dsid - * @return string $nextPid - */ + * Gets the next available PID for the + * content model specified by the DSID + * parameter. + * + * @param string $dsid + * @return string $nextPid + */ public function getNextPid($dsid) { $ret = FALSE; if (self::validDsid($dsid) && $this->validate()) { $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); $namespace = FALSE; - for ($i=0; $namespace === FALSE && $i<$content_models->length;$i++) { + for ($i = 0; $namespace === FALSE && $i < $content_models->length; $i++) { if (strtolower($content_models->item($i)->getAttribute('dsid')) == strtolower($dsid)) { $namespace = $content_models->item($i)->getAttribute('namespace'); } } $pname = substr($namespace, 0, strpos($namespace, ":")); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $ret = Fedora_Item::get_next_pid_in_namespace($pname); } return $ret; } - + /** - * Gets a list of ContentModel objects supported by this collection. - * - * @return ContentModel[] $models - */ + * Gets a list of ContentModel objects supported by this collection. + * + * @return ContentModel[] $models + */ function getContentModels() { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { module_load_include('inc', 'Fedora_Repository', 'ContentModel'); - $ret=array(); + $ret = array(); $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); - for ($i=0;$i<$content_models->length;$i++) { - $cm=ContentModel::loadFromModel($content_models->item($i)->getAttribute('pid'), - $content_models->item($i)->getAttribute('dsid'), - $content_models->item($i)->getAttribute('namespace'), - $content_models->item($i)->getAttribute('name')); - if ($cm !== FALSE) { - $ret[]=$cm; - } - + for ($i = 0; $i < $content_models->length; $i++) { + $cm = ContentModel::loadFromModel($content_models->item($i)->getAttribute('pid'), + $content_models->item($i)->getAttribute('dsid'), + $content_models->item($i)->getAttribute('namespace'), + $content_models->item($i)->getAttribute('name')); + if ($cm !== FALSE) { + $ret[] = $cm; + } } } return $ret; } - - /** * Gets a list of search terms from the Collection Policy. If asArray is set * it will return an associative array with the value, field name, and the default value. @@ -421,52 +412,51 @@ class CollectionPolicy extends XMLDatastream { */ function getSearchTerms($asArray = FALSE, $recurse = FALSE, $cache = FALSE) { $ret = FALSE; - - if ($cache == TRUE && ($cache = cache_get('collection_policy_search_terms-'.$this->pid)) !== 0 ) { - $ret=$cache->data; - } else { - + + if ($cache == TRUE && ($cache = cache_get('collection_policy_search_terms-' . $this->pid)) !== 0) { + $ret = $cache->data; + } + else { + if ($this->xml == NULL) { - $fedoraItem = new Fedora_Item($this->pid); - $ds = $fedoraItem->get_datastream_dissemination($this->dsid); - $this->xml = DOMDocument::loadXML($ds); + $fedoraItem = new Fedora_Item($this->pid); + $ds = $fedoraItem->get_datastream_dissemination($this->dsid); + $this->xml = DOMDocument::loadXML($ds); } - + if ($this->validate()) { - $ret=array(); - $terms= $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term'); - for ($i=0;$i<$terms->length;$i++) { - $default = $terms->item($i)->attributes->getNamedItem('default'); - $default = ($default !== NULL) ? (strtolower($default->nodeValue) == 'true') : FALSE; - $ret[] = ($asArray)?array( 'value' => $terms->item($i)->nodeValue, - 'field' => $terms->item($i)->getAttribute('field'), - 'default' => $default): $terms->item($i)->nodeValue; - } - - - if ($recurse && count($ret) == 0) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $item=new Fedora_Item($this->pid); - $rels=$item->get_relationships(); - if (count($rels) > 0) { - foreach ($rels as $rel) { - $cp = CollectionPolicy::loadFromCollection($rel['object']); - if ($cp !== FALSE) { - $ret = $cp->getSearchTerms($asArray, $recurse); - break; - } - } - } - } - cache_set('collection_policy_search_terms-'.$this->pid, $ret, 'cache', time()+3600); - + $ret = array(); + $terms = $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term'); + for ($i = 0; $i < $terms->length; $i++) { + $default = $terms->item($i)->attributes->getNamedItem('default'); + $default = ($default !== NULL) ? (strtolower($default->nodeValue) == 'true') : FALSE; + $ret[] = ($asArray) ? array('value' => $terms->item($i)->nodeValue, + 'field' => $terms->item($i)->getAttribute('field'), + 'default' => $default) : $terms->item($i)->nodeValue; + } + + + if ($recurse && count($ret) == 0) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $item = new Fedora_Item($this->pid); + $rels = $item->get_relationships(); + if (count($rels) > 0) { + foreach ($rels as $rel) { + $cp = CollectionPolicy::loadFromCollection($rel['object']); + if ($cp !== FALSE) { + $ret = $cp->getSearchTerms($asArray, $recurse); + break; + } + } + } + } + cache_set('collection_policy_search_terms-' . $this->pid, $ret, 'cache', time() + 3600); } } return $ret; } - /** * Adds a search term to the collection policy. * Returns fase on failure. @@ -476,17 +466,17 @@ class CollectionPolicy extends XMLDatastream { * @return boolean $success */ function addTerm($field, $value) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); - $terms= $search_termsEl->getElementsByTagName('term'); - $found=FALSE; - for ($i=0;!$found && $i<$terms->length;$i++) { + $terms = $search_termsEl->getElementsByTagName('term'); + $found = FALSE; + for ($i = 0; !$found && $i < $terms->length; $i++) { if ($terms->item($i)->getAttribute('field') == $field) { - $found = TRUE; + $found = TRUE; } } - + if (!$found) { $newTermEl = $this->xml->createElement('term', $value); $newTermEl->setAttribute('field', $field); @@ -502,19 +492,19 @@ class CollectionPolicy extends XMLDatastream { * * @param string $field * @return boolean $success - */ + */ function removeTerm($field) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); $terms = $search_termsEl->getElementsByTagName('term'); $found = FALSE; - for ($i=0; !$found && $i < $terms->length; $i++) { + for ($i = 0; !$found && $i < $terms->length; $i++) { if ($terms->item($i)->getAttribute('field') == $field) { - $found = $terms->item($i); + $found = $terms->item($i); } } - + if ($found !== FALSE) { $search_termsEl->removeChild($found); $ret = TRUE; @@ -523,21 +513,20 @@ class CollectionPolicy extends XMLDatastream { return $ret; } - - function setDefaultTerm($field) { + function setDefaultTerm($field) { $ret = FALSE; if ($this->validate()) { $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); - $terms= $search_termsEl->getElementsByTagName('term'); - $found=FALSE; - for ($i=0;!$found && $i<$terms->length;$i++) { + $terms = $search_termsEl->getElementsByTagName('term'); + $found = FALSE; + for ($i = 0; !$found && $i < $terms->length; $i++) { if ($terms->item($i)->getAttribute('field') == $field) { - $found = $terms->item($i); + $found = $terms->item($i); } } - + if ($found !== FALSE) { - for ($i=0;$i<$terms->length;$i++) + for ($i = 0; $i < $terms->length; $i++) if ($terms->item($i)->attributes->getNamedItem('default') !== NULL) { $terms->item($i)->removeAttribute('default'); } @@ -547,8 +536,7 @@ class CollectionPolicy extends XMLDatastream { } return $ret; } - - + /** * Removes the specified content model from the collection policy. This will only * prevent future ingests of the removed model to the collection. $cm should be @@ -559,17 +547,17 @@ class CollectionPolicy extends XMLDatastream { * @return boolean $valid */ function removeModel($cm) { - $ret=FALSE; + $ret = FALSE; if ($this->validate() && $cm->validate()) { $contentmodelsEl = $this->xml->getElementsByTagName('content_models'); $models = $contentmodelsEl->item(0)->getElementsByTagName('content_model'); $found = FALSE; - for ($i=0; $found === FALSE && $i < $models->length; $i++) { + for ($i = 0; $found === FALSE && $i < $models->length; $i++) { if ($models->item($i)->getAttribute('pid') == $cm->pid) { - $found=$models->item($i); + $found = $models->item($i); } - } - + } + if ($found !== FALSE && $models->length > 1) { $contentmodelsEl->item(0)->removeChild($found); $ret = TRUE; @@ -577,21 +565,18 @@ class CollectionPolicy extends XMLDatastream { } return $ret; } - - - function addModel($cm, $namespace) { $ret = FALSE; if (self::validPid($namespace) && $this->validate() && $cm->validate()) { $contentmodelsEl = $this->xml->getElementsByTagName('content_models'); $models = $contentmodelsEl->item(0)->getElementsByTagName('content_model'); $found = FALSE; - for ($i=0;!$found && $i<$models->length;$i++) { + for ($i = 0; !$found && $i < $models->length; $i++) { if ($models->item($i)->getAttribute('pid') == $cm->pid) $found = TRUE; } - + if (!$found) { $cmEl = $this->xml->createElement('content_model'); $cmEl->setAttribute('name', $cm->getName()); @@ -600,16 +585,16 @@ class CollectionPolicy extends XMLDatastream { $cmEl->setAttribute('pid', $cm->pid); $contentmodelsEl->item(0)->appendChild($cmEl); } - + $ret = !$found; } return $ret; } - + function getName() { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { - $ret=$this->xml->getElementsByTagName('collection_policy')->item(0)->getAttribute('name'); + $ret = $this->xml->getElementsByTagName('collection_policy')->item(0)->getAttribute('name'); } return $ret; } diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 68ed4124..1de4cd01 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -1,5 +1,6 @@ $url))); return NULL; } - + return $new_url; } function getSoapClient($url = NULL, $exceptions = TRUE) { if (empty($url)) { - $url=variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'); + $url = variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'); } - + global $user; if ($user->uid == 0) { //anonymous user. We will need an entry in the fedora users.xml file @@ -49,9 +52,8 @@ class ConnectionHelper { 'login' => 'anonymous', 'password' => 'anonymous', 'exceptions' => $exceptions, - )); - } - catch (SoapFault $e) { + )); + } catch (SoapFault $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage()))); return NULL; } @@ -62,14 +64,14 @@ class ConnectionHelper { 'login' => $user->name, 'password' => $user->pass, 'exceptions' => TRUE, - )); - } - catch (SoapFault $e) { + )); + } catch (SoapFault $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage()))); return NULL; } } return $client; } + } diff --git a/ContentModel.inc b/ContentModel.inc index 9bac23eb..e4b112e0 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -1,13 +1,13 @@ get_content_models_list($pid); foreach ($content_models as $content_model) { @@ -58,21 +58,20 @@ class ContentModel extends XMLDatastream { */ public static function ingestFromFile($pid, $name, $modelDsid, $file) { $ret = FALSE; - + if (($cm = self::loadFromModel($pid, $modelDsid)) === FALSE && file_exists($file)) { $cm = new ContentModel(file_get_contents($file), $pid, $modelDsid); $rootEl = $cm->xml->getElementsByTagName('content_model')->item(0); $rootEl->setAttribute('name', $name); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); - $ret= $cm; - } + $ret = $cm; + } return $ret; } - /** * Ingests a Content Model from an existing model to the specified pid/dsid . @@ -86,24 +85,23 @@ class ContentModel extends XMLDatastream { */ public static function ingestFromModel($pid, $name, $modelDsid, $copy_model_pid) { $ret = FALSE; - + if (($cm = self::loadFromModel($pid, $modelDsid)) === FALSE && ($copy_cm = self::loadFromModel($copy_model_pid)) !== FALSE && $copy_cm->validate()) { $newDom = $copy_cm->xml; $rootEl = $newDom->getElementsByTagName('content_model')->item(0); $rootEl->setAttribute('name', $name); - + $cm = new ContentModel($newDom, $pid, $modelDsid); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $ret = $cm; -} + } - return $ret; + return $ret; } - - + /** * Ingests a minimum Content Model to the specified pid/dsid. * Returns false on failure. @@ -123,9 +121,9 @@ class ContentModel extends XMLDatastream { * @param string $ingestFormHandler * * @return ContentModel $cm - */ + */ public static function ingestBlankModel($pid, $name, $modelDsid, $defaultMimetype, $ingestFormDsid, $ingestFormPage, $ingestFormHideChooser, $ingestFormModule, $ingestFormModule, $ingestFormFile, $ingestFormClass, $ingestFormMethod, $ingestFormHandler) { - $ret = FALSE; + $ret = FALSE; if (($cm = self::loadFromModel($pid, $modelDsid)) === FALSE) { $newDom = new DOMDocument('1.0', 'utf-8'); $newDom->formatOutput = TRUE; @@ -133,48 +131,47 @@ class ContentModel extends XMLDatastream { $rootEl->setAttribute('name', $name); $rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS .' '. self::$SCHEMA_URI); - + $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS . ' ' . self::$SCHEMA_URI); + $mimeEl = $newDom->createElement('mimetypes'); - $typeEl=$newDom->createElement('type', $defaultMimetype); - $mimeEl->appendChild($typeEl); + $typeEl = $newDom->createElement('type', $defaultMimetype); + $mimeEl->appendChild($typeEl); $rootEl->appendChild($mimeEl); - + $ingestRulesEl = $newDom->createElement('ingest_rules'); $rootEl->appendChild($ingestRulesEl); - + $ingestFormEl = $newDom->createElement('ingest_form'); $ingestFormEl->setAttribute('dsid', $ingestFormDsid); $ingestFormEl->setAttribute('page', $ingestFormPage); if ($ingestFormHideChooser == 'true') { $ingestFormEl->setAttribute('hide_file_chooser', 'true'); } - - $builderEl= $newDom->createElement('form_builder_method'); + + $builderEl = $newDom->createElement('form_builder_method'); $builderEl->setAttribute('module', $ingestFormModule); $builderEl->setAttribute('file', $ingestFormFile); $builderEl->setAttribute('class', $ingestFormClass); $builderEl->setAttribute('method', $ingestFormMethod); $builderEl->setAttribute('handler', $ingestFormHandler); - $ingestFormEl->appendChild($builderEl); - + $ingestFormEl->appendChild($builderEl); + $elementsEl = $newDom->createElement('form_elements'); $ingestFormEl->appendChild($elementsEl); $rootEl->appendChild($ingestFormEl); $newDom->appendChild($rootEl); - + $cm = new ContentModel($newDom, $pid, $modelDsid); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $fedoraItem = new Fedora_Item($pid); - $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); - $ret = $cm; + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $fedoraItem = new Fedora_Item($pid); + $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); + $ret = $cm; } - + return $ret; } - - + /** * Constructs a ContentModel object from the PID of the model in Fedora. * If DSID is specified it will use that datastream as the model, otherwise it will @@ -200,11 +197,10 @@ class ContentModel extends XMLDatastream { $dsid = ($dsid != NULL && self::validDsid($dsid)) ? $dsid : ContentModel::getDefaultDSID(); $ds = $fedoraItem->get_datastream_dissemination($dsid); if (!empty($ds)) { - $ret=new ContentModel($ds, $pid, $dsid, $pid_namespace, $name); + $ret = new ContentModel($ds, $pid, $dsid, $pid_namespace, $name); } } - } - catch (SOAPException $e) { + } catch (SOAPException $e) { $ret = FALSE; } return $ret; @@ -224,7 +220,7 @@ class ContentModel extends XMLDatastream { public function __construct($xmlStr, $pid = NULL, $dsid = NULL, $pid_namespace = NULL, $name = NULL) { parent::__construct($xmlStr, $pid, $dsid); $this->pid_namespace = $pid_namespace; - $this->name = ($name == NULL)?'Islandora Content Model':$name; + $this->name = ($name == NULL) ? 'Islandora Content Model' : $name; $this->xpath = new DOMXPath($this->xml); $this->xpath->registerNamespace('cm', 'http://www.islandora.ca'); } @@ -244,7 +240,7 @@ class ContentModel extends XMLDatastream { $rootEl->setAttribute('name', $sXml['name']); $rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS .' ' . self::$SCHEMA_URI); + $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS . ' ' . self::$SCHEMA_URI); $mimeEl = $newDom->createElement('mimetypes'); foreach ($sXml->mimetypes->type as $mime) { @@ -270,7 +266,7 @@ class ContentModel extends XMLDatastream { $methodEl->setAttribute('method', $method->method_name); $methodEl->setAttribute('dsid', $method->datastream_id); $methodEl->setAttribute('modified_files_ext', $method->modified_files_ext); - + if (isset($method->parameters)) { $paramsEl = $newDom->createElement('parameters'); foreach ($method->parameters->parameter as $param) { @@ -280,14 +276,13 @@ class ContentModel extends XMLDatastream { } $methodEl->appendChild($paramsEl); } - - + + $methodsEl->appendChild($methodEl); } $ruleEl->appendChild($methodsEl); $ingestRulesEl->appendChild($ruleEl); } - } $rootEl->appendChild($ingestRulesEl); @@ -306,7 +301,7 @@ class ContentModel extends XMLDatastream { $add_ds_methodEl->setAttribute('method', $ds->add_datastream_method->method_name); $add_ds_methodEl->setAttribute('dsid', $ds->add_datastream_method->datastream_id); $add_ds_methodEl->setAttribute('modified_files_ext', $ds->add_datastream_method->modified_files_ext); - + if (isset($ds->add_datastream_method->parameters)) { $paramsEl = $newDom->createElement('parameters'); foreach ($ds->add_datastream_method->parameters->parameter as $param) { @@ -316,7 +311,7 @@ class ContentModel extends XMLDatastream { } $add_ds_methodEl->appendChild($paramsEl); } - + $dsEl->appendChild($add_ds_methodEl); } @@ -354,12 +349,12 @@ class ContentModel extends XMLDatastream { //I found an XML where the label was HTML.. this code will attempt to //walk the object setting the label to be the first string it finds. if (count(get_object_vars($element->label)) > 0) { - $obj=$element->label; + $obj = $element->label; while ($obj != NULL && !is_string($obj)) { $keys = get_object_vars($obj); $obj = array_shift($keys); } - $element->label=($obj == NULL) ? '' : $obj; + $element->label = ($obj == NULL) ? '' : $obj; } $elEl = $newDom->createElement('element'); @@ -390,15 +385,15 @@ class ContentModel extends XMLDatastream { $ingest_formEl->appendChild($form_elementsEl); $rootEl->appendChild($ingest_formEl); - if (isset($sXml->edit_metadata) && - trim($sXml->edit_metadata->build_form_method->module) != '' && - trim($sXml->edit_metadata->build_form_method->file) != '' && - trim($sXml->edit_metadata->build_form_method->class_name) != '' && - trim($sXml->edit_metadata->build_form_method->method_name) != '' && - trim($sXml->edit_metadata->submit_form_method->method_name) != '' && - trim($sXml->edit_metadata->build_form_method['dsid']) != '' - ) { - $edit_metadata_methodEl= $newDom->createElement('edit_metadata_method'); + if (isset($sXml->edit_metadata) && + trim($sXml->edit_metadata->build_form_method->module) != '' && + trim($sXml->edit_metadata->build_form_method->file) != '' && + trim($sXml->edit_metadata->build_form_method->class_name) != '' && + trim($sXml->edit_metadata->build_form_method->method_name) != '' && + trim($sXml->edit_metadata->submit_form_method->method_name) != '' && + trim($sXml->edit_metadata->build_form_method['dsid']) != '' + ) { + $edit_metadata_methodEl = $newDom->createElement('edit_metadata_method'); $edit_metadata_methodEl->setAttribute('module', $sXml->edit_metadata->build_form_method->module); $edit_metadata_methodEl->setAttribute('file', $sXml->edit_metadata->build_form_method->file); $edit_metadata_methodEl->setAttribute('class', $sXml->edit_metadata->build_form_method->class_name); @@ -411,39 +406,38 @@ class ContentModel extends XMLDatastream { $newDom->appendChild($rootEl); $this->xml = DOMDocument::loadXML($newDom->saveXml()); - } /** - * Gets a list of service deployments that this model has. - * - * NOTE: Not currently being used. - * - * @return String[] $serviceDepPids - */ + * Gets a list of service deployments that this model has. + * + * NOTE: Not currently being used. + * + * @return String[] $serviceDepPids + */ public function getServices() { - $query = 'select $object $title from <#ri> + $query = 'select $object $title from <#ri> where ($object $title and $object $deploymentOf and $object - and $object pid .'> + and $object pid . '> and $object ) order by $title'; - - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - - $collectionHelper = new CollectionClass(); - $xml = simplexml_load_string($collectionHelper->getRelatedItems($this->pid, $query)); - - $results = array(); - foreach ($xml->results->result as $result) { - $pid = strval(($result->object['uri'])); - $pid = substr($pid, strpos($pid, "/") + 1, strlen($pid)); - $results[] = $pid; - } - - return $results; - } + + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + + $collectionHelper = new CollectionClass(); + $xml = simplexml_load_string($collectionHelper->getRelatedItems($this->pid, $query)); + + $results = array(); + foreach ($xml->results->result as $result) { + $pid = strval(($result->object['uri'])); + $pid = substr($pid, strpos($pid, "/") + 1, strlen($pid)); + $results[] = $pid; + } + + return $results; + } /** * Gets the name of the ContentModel @@ -455,7 +449,7 @@ class ContentModel extends XMLDatastream { $ret = FALSE; if ($this->name != NULL) { $ret = $this->name; - } + } elseif ($this->validate()) { $rootEl = $this->xml->getElementsByTagName('content_model')->item(0); $this->name = $rootEl->getAttribute('name'); @@ -464,7 +458,6 @@ class ContentModel extends XMLDatastream { return $ret; } - /** * Gets the element corresponding to the datastream specified * in the element of the schema. @@ -476,12 +469,12 @@ class ContentModel extends XMLDatastream { private function getDSModel($dsid) { $ret = FALSE; if (self::validDsid($dsid) && $this->validate()) { - $result=$this->xml->getElementsByTagName('datastreams'); - if ($result->length > 0) { - $result=$result->item(0)->getElementsByTagName('datastream'); + $result = $this->xml->getElementsByTagName('datastreams'); + if ($result->length > 0) { + $result = $result->item(0)->getElementsByTagName('datastream'); for ($i = 0; $ret == FALSE && $i < $result->length; $i++) { if ($result->item($i)->getAttribute('dsid') == $dsid) - $ret=$result->item($i); + $ret = $result->item($i); } } } @@ -501,59 +494,59 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $elements_array = array(); $form_elements_wrapper = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements'); - + if ($form_elements_wrapper->length == 0) { return $ret; } $elements = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0)->getElementsByTagName('element'); - for ($i=0;$i<$elements->length;$i++) { + for ($i = 0; $i < $elements->length; $i++) { $desc = $elements->item($i)->getElementsByTagName('description'); - $desc = ($desc->length > 0)?$desc->item(0)->nodeValue:''; - + $desc = ($desc->length > 0) ? $desc->item(0)->nodeValue : ''; + $label = $elements->item($i)->getAttribute('label'); if ($label == NULL) { - $label=$elements->item($i)->getAttribute('name'); + $label = $elements->item($i)->getAttribute('name'); } - - $element=array('name' => $elements->item($i)->getAttribute('name'), - 'label' => $label, - 'type' => $elements->item($i)->getAttribute('type'), - 'required' => ($elements->item($i)->getAttribute('required') == 'true') ? TRUE : FALSE, - 'description' => $desc + + $element = array('name' => $elements->item($i)->getAttribute('name'), + 'label' => $label, + 'type' => $elements->item($i)->getAttribute('type'), + 'required' => ($elements->item($i)->getAttribute('required') == 'true') ? TRUE : FALSE, + 'description' => $desc ); - + $auth_list = $elements->item($i)->getElementsByTagName('authoritative_list'); if ($auth_list->length > 0) { $list = array(); $items = $auth_list->item(0)->getElementsByTagName('item'); for ($j = 0; $j < $items->length; $j++) { $field = $items->item($j)->attributes->getNamedItem('field'); - $list[ $items->item($j)->nodeValue ] = ($field !== NULL) ? $field->nodeValue : $items->item($j)->nodeValue; + $list[$items->item($j)->nodeValue] = ($field !== NULL) ? $field->nodeValue : $items->item($j)->nodeValue; } - $element['authoritative_list']=$list; + $element['authoritative_list'] = $list; } - + $params = $elements->item($i)->getElementsByTagName('parameters'); $list = array(); if ($params->length > 0) { $items = $params->item(0)->getElementsByTagName('parameter'); for ($j = 0; $j < $items->length; $j++) { - $value = $items-> item($j)->nodeValue; + $value = $items->item($j)->nodeValue; $list[$items->item($j)->getAttribute('name')] = (strtolower($value) == 'true' ? TRUE : (strtolower($value) == 'false' ? FALSE : $value)); } } $element['parameters'] = $list; - + $elements_array[] = $element; - } + } $ret = $elements_array; } - return $ret; + return $ret; } - /** + /** * Decrements an ingest form element in the list of elements. * Updates the "order". This method is simply an overload to the incIngestFormElement * which has a direction parameter. @@ -563,12 +556,12 @@ class ContentModel extends XMLDatastream { * * @param String $name * @return boolean $success - */ + */ public function decIngestFormElement($name) { return $this->incIngestFormElement($name, 'dec'); } - - /** + + /** * Increments (or decrements) ingest form element in the list of elements. * Updates the "order". The $reorder parameter accepts 'inc' or 'dec' to * specify the direction to move (defaults to increment.) @@ -579,7 +572,7 @@ class ContentModel extends XMLDatastream { * @param String $name * @param String $reorder * @return boolean $success - */ + */ public function incIngestFormElement($name, $reorder = 'inc') { $ret = FALSE; if ($this->validate()) { @@ -590,26 +583,26 @@ class ContentModel extends XMLDatastream { for ($i = 0; $found === FALSE && $i < $elements->length; $i++) { if ($elements->item($i)->getAttribute('name') == trim($name)) { if ($reorder == 'inc') { - $found=$elements->item($i); - $refEl = ($i > 0)?$elements->item($i-1):false; - } + $found = $elements->item($i); + $refEl = ($i > 0) ? $elements->item($i - 1) : false; + } else { $found = ($i + 1 < $elements->length) ? $elements->item($i + 1) : FALSE; $refEl = $elements->item($i); } } } - + if ($found !== FALSE) { $elementsEl->removeChild($found); $elementsEl->insertBefore($found, $refEl); $ret = TRUE; } - } + } return $ret; - } - - /** + } + + /** * Removes an ingest form element from the list of ingest form elements. * @param String $name * @return boolean $success @@ -622,18 +615,18 @@ class ContentModel extends XMLDatastream { $found = FALSE; for ($i = 0; $found === FALSE && $i < $elements->length; $i++) { if ($elements->item($i)->getAttribute('name') == trim($name)) { - $found=$elements->item($i); + $found = $elements->item($i); } } - + if ($found !== FALSE) { $elementsEl->removeChild($found); $ret = TRUE; } - } + } return $ret; } - + /** * Sets a parameter of an ingest form element. If the value of the element is FALSE the parameter * will be removed entirely (if you want to store false as a value, then send the String "false"). @@ -646,7 +639,7 @@ class ContentModel extends XMLDatastream { public function setIngestFormElementParam($name, $paramName, $paramValue) { $ret = FALSE; - if ($this->validate()) { + if ($this->validate()) { $elements = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0)->getElementsByTagName('element'); $element = FALSE; for ($i = 0; $element === FALSE && $i < $elements->length; $i++) { @@ -661,24 +654,24 @@ class ContentModel extends XMLDatastream { if ($paramValue !== FALSE) { $paramsEl = $this->xml->createElement('parameters'); $element->appendChild($paramsEl); - } + } else { $ret = TRUE; } - } + } else { - $paramsEl=$paramsEl->item(0); + $paramsEl = $paramsEl->item(0); } - + if (!$ret) { $params = $paramsEl->getElementsByTagName('parameter'); $found = FALSE; for ($i = 0; $found === FALSE && $i < $params->length; $i++) { if ($params->item($i)->getAttribute('name') == $paramName) { - $found=$params->item($i); + $found = $params->item($i); } } - + if ($paramValue === FALSE) { if ($found !== FALSE) { $paramsEl->removeChild($found); @@ -687,27 +680,26 @@ class ContentModel extends XMLDatastream { } } $ret = TRUE; - } + } else { if ($found !== FALSE) { $found->nodeValue = $paramValue; - } + } else { - $paramEl=$this->xml->createElement('parameter', $paramValue); + $paramEl = $this->xml->createElement('parameter', $paramValue); $paramEl->setAttribute('name', $paramName); $paramsEl->appendChild($paramEl); } $ret = TRUE; } } - } + } } return $ret; } - - -/** + + /** * Gets a list of all parameters that belong to the specified ingest form element. * * @param String $elementName @@ -719,7 +711,7 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $elements = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0)->getElementsByTagName('element'); $element = FALSE; - for ($i=0; $element === FALSE && $i < $elements->length; $i++) { + for ($i = 0; $element === FALSE && $i < $elements->length; $i++) { if ($elements->item($i)->getAttribute('name') == $name) { $element = $elements->item($i); } @@ -727,20 +719,20 @@ class ContentModel extends XMLDatastream { if ($element !== FALSE) { $ret = array(); - $paramsEl = $element->getElementsByTagName('parameters'); - + $paramsEl = $element->getElementsByTagName('parameters'); + if ($paramsEl->length > 0) { - $params = $paramsEl->item(0)->getElementsByTagName('parameter'); - for ($i = 0; $i < $params->length; $i++) { - $ret[$params->item($i)->getAttribute('name')]=$params->item($i)->nodeValue; - } - } - } + $params = $paramsEl->item(0)->getElementsByTagName('parameter'); + for ($i = 0; $i < $params->length; $i++) { + $ret[$params->item($i)->getAttribute('name')] = $params->item($i)->nodeValue; + } + } + } } return $ret; - } - + } + /** * Edits the ingest form element specified. * NOTE: The element name can not be changed. To update an elements name @@ -763,45 +755,44 @@ class ContentModel extends XMLDatastream { $found = $elements->item($i); } } - + $found->setAttribute('name', $name); $found->setAttribute('type', $type); $found->setAttribute('required', $required ? 'true' : 'false'); if (trim($label) != '' && trim($label) != trim($name)) { $found->setAttribute('label', $label); - } + } elseif ($found->getAttribute('label') != '') { $found->removeAttribute('label'); } - - $descEl=$found->getElementsByTagName('description'); + + $descEl = $found->getElementsByTagName('description'); if (trim($description) != '') { - if ($descEl->length > 0) { - $descEl=$descEl->item(0); - $descEl->nodeValue = $description; - } + if ($descEl->length > 0) { + $descEl = $descEl->item(0); + $descEl->nodeValue = $description; + } else { - $descEl = $this->xml->createElement('description', $description); - $found->appendChild($descEl); - } - } + $descEl = $this->xml->createElement('description', $description); + $found->appendChild($descEl); + } + } elseif ($descEl->length > 0) { - $found->removeChild($descEl->item(0)); + $found->removeChild($descEl->item(0)); } - - if ($found->getAttribute('type') != 'select' && $found->getAttribute('type') != 'radio') { + + if ($found->getAttribute('type') != 'select' && $found->getAttribute('type') != 'radio') { $authList = $found->getElementsByTagName('authoritative_list'); if ($authList->length > 0) { $found->removeChild($authList->item(0)); } } - + $ret = TRUE; } return $ret; } - - + /** * Add an ingest form element to the model. * @@ -822,19 +813,19 @@ class ContentModel extends XMLDatastream { $elementEl->setAttribute('required', $requiredi ? 'true' : 'false'); if (trim($label) != '' && trim($label) != trim($name)) { $elementEl->setAttribute('label', $label); - } + } if (trim($description) != '') { - $descEl=$this->xml->createElement('description', $description); - $elementEl->appendChild($descEl); + $descEl = $this->xml->createElement('description', $description); + $elementEl->appendChild($descEl); } $elements->appendChild($elementEl); - + $ret = TRUE; } return $ret; } - - /** + + /** * Decrements an authority list item from a form element in the list of elements. * Updates the "order". This method is simply an overload to the incAuthListItem * which has a direction parameter. @@ -843,12 +834,12 @@ class ContentModel extends XMLDatastream { * @param String $elementName * @param String $value * @return boolean $success - */ + */ public function decAuthListItem($elementName, $value) { return $this->incAuthListItem($elementName, $value, 'dec'); - } + } - /** + /** * Increments (or decrements) an authority list item from a form element in the list of elements. * Updates the "order". * @@ -856,7 +847,7 @@ class ContentModel extends XMLDatastream { * @param String $value * @param String $direction * @return boolean $success - */ + */ public function incAuthListItem($elementName, $value, $reorder = 'inc') { $ret = FALSE; if ($this->validate()) { @@ -869,43 +860,43 @@ class ContentModel extends XMLDatastream { } if ($found !== FALSE) { - - $authListEl = $found->getElementsByTagName('authoritative_list'); - if ($authListEl->length > 0) { - $authListEl = $authListEl->item(0); - - $items = $authListEl->getElementsByTagName('item'); - $found = FALSE; - $refEl = FALSE; - for ($i = 0; $found === FALSE && $i < $items->length; $i++) { - if ($items->item($i)->nodeValue == $value) { - if ($reorder == 'inc') { - $refEl = ($i > 0) ? $items->item($i - 1) : FALSE; - $found = $items->item($i); - } - else { - $refEl = $items->item($i); - $found = ($i + 1 < $items->length) ? $items->item($i + 1) : FALSE; - } - } - } - - if ($found !== FALSE && $refEl !== FALSE) { - $authListEl->removeChild($found); - $authListEl->insertBefore($found, $refEl); - $ret = TRUE; - } - } + + $authListEl = $found->getElementsByTagName('authoritative_list'); + if ($authListEl->length > 0) { + $authListEl = $authListEl->item(0); + + $items = $authListEl->getElementsByTagName('item'); + $found = FALSE; + $refEl = FALSE; + for ($i = 0; $found === FALSE && $i < $items->length; $i++) { + if ($items->item($i)->nodeValue == $value) { + if ($reorder == 'inc') { + $refEl = ($i > 0) ? $items->item($i - 1) : FALSE; + $found = $items->item($i); + } + else { + $refEl = $items->item($i); + $found = ($i + 1 < $items->length) ? $items->item($i + 1) : FALSE; + } + } + } + + if ($found !== FALSE && $refEl !== FALSE) { + $authListEl->removeChild($found); + $authListEl->insertBefore($found, $refEl); + $ret = TRUE; + } + } } } return $ret; - } + } /** - * Removes an authority list item from a form element. - @param String $elementName - @param String $value - @return boolean $success + * Removes an authority list item from a form element. + @param String $elementName + @param String $value + @return boolean $success */ public function removeAuthListItem($elementName, $value) { $ret = FALSE; @@ -913,46 +904,46 @@ class ContentModel extends XMLDatastream { $elements = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0)->getElementsByTagName('element'); $found = FALSE; for ($i = 0; $found === FALSE && $i < $elements->length; $i++) { - if ($elements->item($i)->getAttribute('name') == $elementName) { - $found = $elements->item($i); - } + if ($elements->item($i)->getAttribute('name') == $elementName) { + $found = $elements->item($i); + } } if ($found !== FALSE) { - $authListEl = $found->getElementsByTagName('authoritative_list'); - if ($authListEl->length > 0) { - $authListEl = $authListEl->item(0); - $items = $authListEl->getElementsByTagName('item'); - $found = FALSE; - for ($i = 0; $found === FALSE && $i < $items->length; $i++) { - if ($items->item($i)->nodeValue == $value) { - $found=$items->item($i); - } - } - - if ($found !== FALSE) { - if ($items->length == 1) { - $found->removeChild($authListEl); - } - else { - $authListEl->removeChild($found); - } - - $ret = TRUE; - } - } + $authListEl = $found->getElementsByTagName('authoritative_list'); + if ($authListEl->length > 0) { + $authListEl = $authListEl->item(0); + $items = $authListEl->getElementsByTagName('item'); + $found = FALSE; + for ($i = 0; $found === FALSE && $i < $items->length; $i++) { + if ($items->item($i)->nodeValue == $value) { + $found = $items->item($i); + } + } + + if ($found !== FALSE) { + if ($items->length == 1) { + $found->removeChild($authListEl); + } + else { + $authListEl->removeChild($found); + } + + $ret = TRUE; + } + } } } return $ret; - } + } /** * Adds an authority list item to a form element. - @param String $elementName - @param String $value - @param String $label (optional) - @return boolean $success - */ + @param String $elementName + @param String $value + @param String $label (optional) + @return boolean $success + */ public function addAuthListItem($elementName, $value, $label = '') { $ret = FALSE; if ($this->validate()) { @@ -965,37 +956,36 @@ class ContentModel extends XMLDatastream { } if ($found !== FALSE) { - $authListEl = $found->getElementsByTagName('authoritative_list'); - if ($authListEl->length == 0) { - $authListEl = $this->xml->createElement('authoritative_list'); - $found->appendChild($authListEl); - } - else { - $authListEl = $authListEl->item(0); - } - - $items = $authListEl->getElementsByTagName('item'); - $found = FALSE; - for ($i = 0; $found == FALSE && $i < $items->length; $i++) { - if ($items->item($i)->nodeValue == $value) { - $found = TRUE; - } - } - - if (!$found) { - $itemEl = $this->xml->createElement('item', trim($value)); - if (trim($label) != '' && trim($label) != trim($value)) { - $itemEl->setAttribute('field', trim($label)); - } - $authListEl->appendChild($itemEl); - $ret = TRUE; - } - } - + $authListEl = $found->getElementsByTagName('authoritative_list'); + if ($authListEl->length == 0) { + $authListEl = $this->xml->createElement('authoritative_list'); + $found->appendChild($authListEl); + } + else { + $authListEl = $authListEl->item(0); + } + + $items = $authListEl->getElementsByTagName('item'); + $found = FALSE; + for ($i = 0; $found == FALSE && $i < $items->length; $i++) { + if ($items->item($i)->nodeValue == $value) { + $found = TRUE; + } + } + + if (!$found) { + $itemEl = $this->xml->createElement('item', trim($value)); + if (trim($label) != '' && trim($label) != trim($value)) { + $itemEl->setAttribute('field', trim($label)); + } + $authListEl->appendChild($itemEl); + $ret = TRUE; + } + } } return $ret; } - + /** * Builds an ingest form using the method specified in element of * Returns FALSE on failure. @@ -1009,9 +999,9 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $docRoot = $_SERVER['DOCUMENT_ROOT']; $file = (isset($form_state['values']['ingest-file-location']) ? $form_state['values']['ingest-file-location'] : ''); - + $fullpath = $file; - + $form['step'] = array( '#type' => 'hidden', '#value' => (isset($form_state['values']['step']) ? $form_state['values']['step'] : 0) + 1, @@ -1024,7 +1014,7 @@ class ContentModel extends XMLDatastream { '#type' => 'hidden', '#value' => 'ISLANDORACM', ); - $form['models'] = array( //content models available + $form['models'] = array(//content models available '#type' => 'hidden', '#value' => $form_state['values']['models'], ); @@ -1050,27 +1040,27 @@ class ContentModel extends XMLDatastream { } $dsid = $ingest_form->getAttribute('dsid'); - $method=$ingest_form->getElementsByTagName('form_builder_method')->item(0); + $method = $ingest_form->getElementsByTagName('form_builder_method')->item(0); $module = $method->getAttribute('module'); - $path=drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[]='Build Ingest Form: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Build Ingest Form: file \'' . $path . '\' does not exist.'; + } else { @require_once($path); - $className=$method->getAttribute('class'); - $methodName=($method->getAttribute('method')); + $className = $method->getAttribute('class'); + $methodName = ($method->getAttribute('method')); if (!class_exists($className)) { - self::$errors[] = 'Build Ingest Form: class \''. $className .' does not exist.'; - } + self::$errors[] = 'Build Ingest Form: class \'' . $className . ' does not exist.'; + } else { $class = new $className; - $elements_array=$this->getIngestFormElements(); + $elements_array = $this->getIngestFormElements(); if (method_exists($class, $methodName)) { - $ret = $class->$methodName ($form, $elements_array, $form_state); - } + $ret = $class->$methodName($form, $elements_array, $form_state); + } else { - self::$errors[] = 'Build Ingest Form: method \''. $className .'->'. $methodName .'\' does not exist.'; + self::$errors[] = 'Build Ingest Form: method \'' . $className . '->' . $methodName . '\' does not exist.'; } } } @@ -1080,7 +1070,7 @@ class ContentModel extends XMLDatastream { /** * Builds an edit metadata form using the method specified in the element -= * The DSID specified must match the DSID attribute of . Returns FALSE on failure. + = * The DSID specified must match the DSID attribute of . Returns FALSE on failure. * * @param string $dsid * @return $form @@ -1092,22 +1082,22 @@ class ContentModel extends XMLDatastream { if ($method->length > 0 && $method->item(0)->getAttribute('dsid') == $dsid) { $method = $method->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Build Edit Metadata Form: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Build Edit Metadata Form: file \'' . $path . '\' does not exist.'; + } else { @require_once($path ); - $className=$method->getAttribute('class'); - $methodName=($method->getAttribute('method')); + $className = $method->getAttribute('class'); + $methodName = ($method->getAttribute('method')); if (!class_exists($className)) { - self::$errors[] = 'Build Edit Metadata Form: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Build Edit Metadata Form: class \'' . $className . '\' does not exist.'; + } else { $class = new $className($pid); if (!method_exists($class, $methodName)) { - self::$errors[] = 'Build Edit Metadata Form: method \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Build Edit Metadata Form: method \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { $ret = $class->$methodName(); } @@ -1133,24 +1123,24 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $method = $this->xml->getElementsByTagName('edit_metadata_method'); if ($method->length > 0) { - $method=$method->item(0); + $method = $method->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Handle Edit Metadata Form: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Handle Edit Metadata Form: file \'' . $path . '\' does not exist.'; + } else { @require_once($path); $className = $method->getAttribute('class'); $methodName = ($method->getAttribute('handler')); if (!class_exists($className)) { - self::$errors[] = 'Handle Edit Metadata Form: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Handle Edit Metadata Form: class \'' . $className . '\' does not exist.'; + } else { $class = new $className($form_state['values']['pid']); if (!method_exists($class, $methodName)) { - self::$errors[] = 'Handle Edit Metadata Form: metho \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Handle Edit Metadata Form: metho \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { $ret = $class->$methodName($form_id, $form_state['values'], $soap_client); } @@ -1163,13 +1153,11 @@ class ContentModel extends XMLDatastream { $metaDataForm = new formClass(); $ret = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $soap_client); $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; - } } return $ret; } - /** * Gets an associative array describing the edit metadata method. * Array has the following keys: 'file', 'class', 'method', 'handler', 'dsid' @@ -1178,21 +1166,21 @@ class ContentModel extends XMLDatastream { public function getEditMetadataMethod() { $ret = FALSE; if ($this->validate()) { - $method=$this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); + $method = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); if ($method->length > 0) { $method = $method->item(0); $ret = array('module' => $method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module'), - 'file' => $method->getAttribute('file'), - 'class' => $method->getAttribute('class'), - 'method' => $method->getAttribute('method'), - 'handler' => $method->getAttribute('handler'), - 'dsid' => $method->getAttribute('dsid') + 'file' => $method->getAttribute('file'), + 'class' => $method->getAttribute('class'), + 'method' => $method->getAttribute('method'), + 'handler' => $method->getAttribute('handler'), + 'dsid' => $method->getAttribute('dsid') ); } } return $ret; - } - + } + /** * Removes the edit data method from the Content Model. * @return boolean $success @@ -1200,7 +1188,7 @@ class ContentModel extends XMLDatastream { public function removeEditMetadataMethod() { $ret = FALSE; if ($this->validate()) { - $rootEl=$this->xml->getElementsByTagName('content_model')->item(0); + $rootEl = $this->xml->getElementsByTagName('content_model')->item(0); $method = $rootEl->getElementsByTagName('edit_metadata_method'); if ($method->length > 0) { $rootEl->removeChild($method->item(0)); @@ -1209,8 +1197,8 @@ class ContentModel extends XMLDatastream { } return $ret; } - - /** + + /** * Update the Edit Metadata Method defined in the Content Model * @param String $module * @param String $file @@ -1225,8 +1213,8 @@ class ContentModel extends XMLDatastream { if (self::validDsid($dsid) && $this->validate()) { $methodEl = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); if ($methodEl->length > 0) { - $methodEl=$methodEl->item(0); - } + $methodEl = $methodEl->item(0); + } else { $methodEl = $this->xml->createElement('edit_metadata_method'); $this->xml->getElementsByTagName('content_model')->item(0)->appendChild($methodEl); @@ -1241,7 +1229,7 @@ class ContentModel extends XMLDatastream { } return $ret; } - + /** * Executes the add datastream method for the specified datastream on the specified file. * Returns FALSE on failure. @@ -1255,32 +1243,32 @@ class ContentModel extends XMLDatastream { if (self::validDsid($dsid) && $this->validate() && ($ds = $this->getDSModel($dsid)) !== FALSE) { $addMethod = $ds->getElementsByTagName('add_datastream_method'); if ($addMethod->length > 0) { - $addMethod=$addMethod->item(0); + $addMethod = $addMethod->item(0); $paramArray = array(); - $params= $addMethod->getElementsByTagName('parameters'); + $params = $addMethod->getElementsByTagName('parameters'); if ($params->length > 0) { - $params=$params->item(0)->getElementsByTagName('parameter'); + $params = $params->item(0)->getElementsByTagName('parameter'); for ($i = 0; $i < $params->length; $i++) { $paramsArray[$params->item($i)->getAttribute('name')] = $params->item($i)->nodeValue; } } $module = $addMethod->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $addMethod->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $addMethod->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Execute Add Datastream Methods: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Execute Add Datastream Methods: file \'' . $path . '\' does not exist.'; + } else { @require_once($path); $className = $addMethod->getAttribute('class'); $methodName = $addMethod->getAttribute('method'); if (!class_exists($className)) { - self::$errors[] = 'Execute Add Datastream Methods: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Execute Add Datastream Methods: class \'' . $className . '\' does not exist.'; + } else { $class = new $className; if (!method_exists($class, $methodName)) { - self::$errors[] = 'Execute Add Datastream Methods: method \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Execute Add Datastream Methods: method \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { $ret = $class->$methodName($paramsArray, $addMethod->getAttribute('dsid'), $file, $addMethod->getAttribute('modified_files_ext')); } @@ -1309,11 +1297,11 @@ class ContentModel extends XMLDatastream { $ret = TRUE; $rules = $this->xml->getElementsByTagName('ingest_rules')->item(0)->getElementsByTagName('rule'); for ($i = 0; $i < $rules->length; $i++) { - $rule=$rules->item($i); + $rule = $rules->item($i); $types = $rule->getElementsbyTagName('applies_to'); $valid_types = array(); for ($j = 0; $j < $types->length; $j++) { - $valid_types[]=trim($types->item($j)->nodeValue); + $valid_types[] = trim($types->item($j)->nodeValue); } if (in_array($mimetype, $valid_types)) { @@ -1321,38 +1309,39 @@ class ContentModel extends XMLDatastream { if ($methods->length > 0) { $methods = $methods->item(0)->getElementsbyTagName('ingest_method'); for ($j = 0; $j < $methods->length; $j++) { - $method=$methods->item($j); - $param_array=array(); - $params=$method->getElementsByTagName('parameters'); + $method = $methods->item($j); + $param_array = array(); + $params = $method->getElementsByTagName('parameters'); $param_array['model_pid'] = $this->pid; - if ($params->length > 0) { + if ($params->length > 0) { $params = $params->item(0)->getElementsByTagName('parameter'); for ($k = 0; $k < $params->length; $k++) - $param_array[$params->item($k)->getAttribute('name')]=$params->item($k)->nodeValue; + $param_array[$params->item($k)->getAttribute('name')] = $params->item($k)->nodeValue; } - - + + if (!$preview || isset($param_array['preview'])) { $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path) || substr_compare($path, 'fedora_repository/', -strlen('fedora_repository/'), strlen('fedora_repository/')) === 0) { - self::$errors[] = 'Execute Ingest Rules: file \''. $path .'\' does not exist.'; + self::$errors[] = 'Execute Ingest Rules: file \'' . $path . '\' does not exist.'; $ret = FALSE; - } + } else { require_once($path); - $className=$method->getAttribute('class'); - $methodName=($method->getAttribute('method')); + $className = $method->getAttribute('class'); + $methodName = ($method->getAttribute('method')); if (!class_exists($className)) { - self::$errors[] = 'Execute Ingest Rules: class \''. $className .'\' does not exist.'; + self::$errors[] = 'Execute Ingest Rules: class \'' . $className . '\' does not exist.'; $ret = FALSE; - } - else $class = new $className; + } + else + $class = new $className; if (!method_exists($class, $methodName)) { - self::$errors[] = 'Execute Ingest Rules: method \''. $className .'->' . $methodName .'\' does not exist.'; + self::$errors[] = 'Execute Ingest Rules: method \'' . $className . '->' . $methodName . '\' does not exist.'; $ret = FALSE; - } + } else { $status = $class->$methodName($param_array, $method->getAttribute('dsid'), $file, $method->getAttribute('modified_files_ext')); if ($status !== TRUE) { @@ -1365,7 +1354,6 @@ class ContentModel extends XMLDatastream { } } } - } return $ret; } @@ -1377,29 +1365,29 @@ class ContentModel extends XMLDatastream { * @param &$form_state * @return boolean $success */ - public function execFormHandler(&$data,&$form_state) { + public function execFormHandler(&$data, &$form_state) { $ret = FALSE; if ($this->validate()) { - $method =$this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); + $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); $module = $method->getAttribute('module'); - $path=drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Execute Form Handler: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; + } else { require_once($path); - $className=$method->getAttribute('class'); - $methodName=($method->getAttribute('handler')); + $className = $method->getAttribute('class'); + $methodName = ($method->getAttribute('handler')); if (!class_exists($className)) { - self::$errors[] = 'Execute Form Handler: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: class \'' . $className . '\' does not exist.'; + } else { $class = new $className; if (!method_exists($class, $methodName)) { - self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: method \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { - $class->$methodName($data,$form_state); + $class->$methodName($data, $form_state); $ret = TRUE; } } @@ -1419,13 +1407,13 @@ class ContentModel extends XMLDatastream { //only proceed if the xml is valid. if ($this->validate()) { if ($this->mimes === NULL) { - $result=$this->xml->getElementsByTagName('mimetypes'); - $result=$result->item(0)->getElementsByTagName('type'); + $result = $this->xml->getElementsByTagName('mimetypes'); + $result = $result->item(0)->getElementsByTagName('type'); $mimes = array(); for ($i = 0; $i < $result->length; $i++) { $mimes[] = trim($result->item($i)->nodeValue); } - $this->mimes=$mimes; + $this->mimes = $mimes; } return $this->mimes; } @@ -1445,29 +1433,29 @@ class ContentModel extends XMLDatastream { $datastreams = $this->xml->getElementsByTagName('datastreams'); if ($datastreams->length > 0) { $datastreams = $datastreams->item(0)->getElementsByTagName('datastream'); - for ($i=0; $i < $datastreams->length; $i++) { + for ($i = 0; $i < $datastreams->length; $i++) { $ds = $datastreams->item($i); - if ($ds->attributes->getNamedItem('display_in_fieldset') == NULL || strtolower($ds->getAttribute('display_in_fieldset')) != 'false' ) { + if ($ds->attributes->getNamedItem('display_in_fieldset') == NULL || strtolower($ds->getAttribute('display_in_fieldset')) != 'false') { $dispMethods = $ds->getElementsByTagName('display_method'); for ($j = 0; $j < $dispMethods->length; $j++) { $method = $dispMethods->item($j); $module = $method->getAttribute('module'); - $path=drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Execute Form Handler: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; + } else { require_once($path); $className = $method->getAttribute('class'); $methodName = ($method->getAttribute('method')); if (!class_exists($className)) { - self::$errors[] = 'Execute Form Handler: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: class \'' . $className . '\' does not exist.'; + } else { $class = new $className($pid); if (!method_exists($class, $methodName)) { - self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: method \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { $output = $class->$methodName($page_number); } @@ -1490,17 +1478,17 @@ class ContentModel extends XMLDatastream { * @return string[] $datastreams */ public function listDatastreams() { - $ds_array=array(); + $ds_array = array(); if ($this->validate()) { $datastreams = $this->xml->getElementsByTagName('datastreams'); if ($datastreams->length > 0) { - $datastreams=$datastreams->item(0)->getElementsByTagName('datastream'); - for ($i=0;$i<$datastreams->length;$i++) { - $dsName=$datastreams->item($i)->getAttribute('dsid'); - // if ($dsName != 'QDC') - // { - $ds_array[]=$dsName; - // } + $datastreams = $datastreams->item(0)->getElementsByTagName('datastream'); + for ($i = 0; $i < $datastreams->length; $i++) { + $dsName = $datastreams->item($i)->getAttribute('dsid'); + // if ($dsName != 'QDC') + // { + $ds_array[] = $dsName; + // } } } } @@ -1508,30 +1496,29 @@ class ContentModel extends XMLDatastream { return $ds_array; } - /** - * Adds an allowed mimetype to the model. - * + /** + * Adds an allowed mimetype to the model. + * * @param String $type * @return boolean $success */ public function addMimetype($type) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { $mimetypesEl = $this->xml->getElementsByTagName('mimetypes')->item(0); - $types= $mimetypesEl->getElementsByTagName('type'); + $types = $mimetypesEl->getElementsByTagName('type'); $found = FALSE; - for ($i=0;!$found && $i<$types->length;$i++) { + for ($i = 0; !$found && $i < $types->length; $i++) { if ($types->item($i)->nodeValue == $type) - $found = TRUE; + $found = TRUE; } if (!$found) { $newTypeEl = $this->xml->createElement('type', $type); $mimetypesEl->appendChild($newTypeEl); - $ret=TRUE; + $ret = TRUE; } - } return $ret; } @@ -1543,54 +1530,53 @@ class ContentModel extends XMLDatastream { * @return boolean $success */ public function removeMimetype($type) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { $mimetypesEl = $this->xml->getElementsByTagName('mimetypes')->item(0); - $types= $mimetypesEl->getElementsByTagName('type'); - $found=FALSE; - for ($i=0;!$found && $i<$types->length;$i++) { + $types = $mimetypesEl->getElementsByTagName('type'); + $found = FALSE; + for ($i = 0; !$found && $i < $types->length; $i++) { if ($types->item($i)->nodeValue == $type) - $found=$types->item($i); + $found = $types->item($i); } if ($found !== FALSE && $types->length > 1) { $mimetypesEl->removeChild($found); $ret = TRUE; } - } return $ret; } public function getDisplayMethods($ds) { - $ret=FALSE; - if (($ds = $this->getDSModel($ds))!==FALSE) { - $ret=array(); - $dispMethods= $ds->getElementsByTagName('display_method'); - for ($i=0;$i<$dispMethods->length;$i++) { - $ret[] = array( 'module' => $dispMethods->item($i)->getAttribute('module')==''?'fedora_repository':$dispMethods->item($i)->getAttribute('module'), - 'file' => $dispMethods->item($i)->getAttribute('file'), - 'class' => $dispMethods->item($i)->getAttribute('class'), - 'method' => $dispMethods->item($i)->getAttribute('method'), - 'default' => ($dispMethods->item($i)->attributes->getNamedItem('default') !== NULL ? strtolower($dispMethods->item($i)->getAttribute('default')) == 'true' : FALSE)); + $ret = FALSE; + if (($ds = $this->getDSModel($ds)) !== FALSE) { + $ret = array(); + $dispMethods = $ds->getElementsByTagName('display_method'); + for ($i = 0; $i < $dispMethods->length; $i++) { + $ret[] = array('module' => $dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module'), + 'file' => $dispMethods->item($i)->getAttribute('file'), + 'class' => $dispMethods->item($i)->getAttribute('class'), + 'method' => $dispMethods->item($i)->getAttribute('method'), + 'default' => ($dispMethods->item($i)->attributes->getNamedItem('default') !== NULL ? strtolower($dispMethods->item($i)->getAttribute('default')) == 'true' : FALSE)); } } return $ret; } public function addDs($dsid, $display_in_fieldset = FALSE) { - $ret=FALSE; - + $ret = FALSE; + if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) === FALSE) { $datastreamsEl = $this->xml->getElementsByTagName('datastreams'); if ($datastreamsEl->length > 0) { - $datastreamsEl=$datastreamsEl->item(0); - } + $datastreamsEl = $datastreamsEl->item(0); + } else { $datastreamsEl = $this->xml->createElement('datastreams'); $this->xml->getElementsByTagName('content_model')->item(0)->appendChild($datastreamsEl); } - + $dsEl = $this->xml->createElement('datastream'); $dsEl->setAttribute('dsid', $dsid); if ($display_in_fieldset == TRUE) { @@ -1627,7 +1613,7 @@ class ContentModel extends XMLDatastream { if ($value == FALSE && $ds->attributes->getNamedItem('display_in_fieldset') !== NULL) { $ds->removeAttribute('display_in_fieldset'); $ret = TRUE; - } + } elseif ($value == TRUE) { $ds->setAttribute('display_in_fieldset', 'true'); $ret = TRUE; @@ -1638,16 +1624,16 @@ class ContentModel extends XMLDatastream { public function setDefaultDispMeth($dsid, $module, $file, $class, $method) { $ret = FALSE; - + if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $found = FALSE; $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module')) && - $file == $dispMethods->item($i)->getAttribute('file') && - $class == $dispMethods->item($i)->getAttribute('class') && - $method == $dispMethods->item($i)->getAttribute('method')) { - $found=$dispMethods->item($i); + $file == $dispMethods->item($i)->getAttribute('file') && + $class == $dispMethods->item($i)->getAttribute('class') && + $method == $dispMethods->item($i)->getAttribute('method')) { + $found = $dispMethods->item($i); } } @@ -1662,7 +1648,6 @@ class ContentModel extends XMLDatastream { $found->setAttribute('default', 'true'); $ret = TRUE; } - } return $ret; } @@ -1671,13 +1656,13 @@ class ContentModel extends XMLDatastream { $ret = FALSE; if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $found = FALSE; - $dispMethods= $ds->getElementsByTagName('display_method'); - for ($i=0;!$found && $i<$dispMethods->length;$i++) { + $dispMethods = $ds->getElementsByTagName('display_method'); + for ($i = 0; !$found && $i < $dispMethods->length; $i++) { if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module') == '') && - $file == $dispMethods->item($i)->getAttribute('file') && - $class == $dispMethods->item($i)->getAttribute('class') && - $method == $dispMethods->item($i)->getAttribute('method')) { - $found=$dispMethods->item($i); + $file == $dispMethods->item($i)->getAttribute('file') && + $class == $dispMethods->item($i)->getAttribute('class') && + $method == $dispMethods->item($i)->getAttribute('method')) { + $found = $dispMethods->item($i); } } @@ -1685,20 +1670,19 @@ class ContentModel extends XMLDatastream { $ds->removeChild($found); $ret = TRUE; } - } return $ret; } public function addDispMeth($dsid, $module, $file, $class, $method, $default = FALSE) { - $ret=FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid))!==FALSE) { + $ret = FALSE; + if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $dispMethEl = $this->xml->createElement('display_method'); $dispMethEl->setAttribute('module', $module); $dispMethEl->setAttribute('file', $file); $dispMethEl->setAttribute('class', $class); $dispMethEl->setAttribute('method', $method); - if ($default==TRUE) { + if ($default == TRUE) { $dispMethEl->setAttribute('default', TRUE); } $ds->appendChild($dispMethEl); @@ -1708,16 +1692,16 @@ class ContentModel extends XMLDatastream { } public function getAddDsMethod($ds) { - $ret=FALSE; - if (($ds = $this->getDSModel($ds))!==FALSE) { - $addDsMethod= $ds->getElementsByTagName('add_datastream_method'); + $ret = FALSE; + if (($ds = $this->getDSModel($ds)) !== FALSE) { + $addDsMethod = $ds->getElementsByTagName('add_datastream_method'); if ($addDsMethod !== FALSE && $addDsMethod->length > 0) { $ret = array('module' => $addDsMethod->item(0)->getAttribute('module') == '' ? 'fedora_repository' : $addDsMethod->item(0)->getAttribute('module'), - 'file' => $addDsMethod->item(0)->getAttribute('file'), - 'class' => $addDsMethod->item(0)->getAttribute('class'), - 'method' => $addDsMethod->item(0)->getAttribute('method'), - 'modified_files_ext' => $addDsMethod->item(0)->getAttribute('modified_files_ext'), - 'dsid' => $addDsMethod->item(0)->getAttribute('dsid') + 'file' => $addDsMethod->item(0)->getAttribute('file'), + 'class' => $addDsMethod->item(0)->getAttribute('class'), + 'method' => $addDsMethod->item(0)->getAttribute('method'), + 'modified_files_ext' => $addDsMethod->item(0)->getAttribute('modified_files_ext'), + 'dsid' => $addDsMethod->item(0)->getAttribute('dsid') ); } } @@ -1729,7 +1713,7 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $rules = $this->xml->getElementsByTagName('ingest_rules')->item(0)->getElementsByTagName('rule'); if ($rule_id < $rules->length) - $ret = $rules->item($rule_id); + $ret = $rules->item($rule_id); } return $ret; } @@ -1739,7 +1723,7 @@ class ContentModel extends XMLDatastream { if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $applies = $rule->getElementsByTagName('applies_to'); $found = FALSE; - for ($i=0; $found === FALSE && $i < $applies->length; $i++) { + for ($i = 0; $found === FALSE && $i < $applies->length; $i++) { if ($type == $applies->item($i)->nodeValue) { $found = $applies->item($i); } @@ -1754,11 +1738,11 @@ class ContentModel extends XMLDatastream { } public function addAppliesTo($rule_id, $type) { - $ret=FALSE; - if (($rule = $this->getIngestRule($rule_id))!==FALSE) { + $ret = FALSE; + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $applies = $rule->getElementsByTagName('applies_to'); $found = FALSE; - for ($i=0;!$found && $i<$applies->length;$i++) { + for ($i = 0; !$found && $i < $applies->length; $i++) { $found = ($type == $applies->item($i)->nodeValue); } @@ -1772,8 +1756,8 @@ class ContentModel extends XMLDatastream { } public function addIngestMethod($rule_id, $module, $file, $class, $method, $dsid, $modified_files_ext) { - $ret=FALSE; - if (self::validDsid($dsid) && ($rule=$this->getIngestRule($rule_id))!==FALSE) { + $ret = FALSE; + if (self::validDsid($dsid) && ($rule = $this->getIngestRule($rule_id)) !== FALSE) { $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $meth = $this->xml->createElement('ingest_method'); $meth->setAttribute('module', $module); @@ -1790,12 +1774,12 @@ class ContentModel extends XMLDatastream { } public function removeIngestMethod($rule_id, $module, $file, $class, $method) { - $ret=FALSE; - if (($rule=$this->getIngestRule($rule_id))!==FALSE) { - $found=FALSE; + $ret = FALSE; + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { + $found = FALSE; $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $methods = $methodsEl->getElementsByTagName('ingest_method'); - for ($i=0;!$found && $i<$methods->length;$i++) { + for ($i = 0; !$found && $i < $methods->length; $i++) { if ($methods->item($i)->getAttribute('module') == $module && $methods->item($i)->getAttribute('file') == $file && $methods->item($i)->getAttribute('class') == $class && $methods->item($i)->getAttribute('method') == $method) { $found = $methods->item($i); } @@ -1808,33 +1792,33 @@ class ContentModel extends XMLDatastream { } return $ret; } - + public function addIngestMethodParam($rule_id, $module, $file, $class, $method, $name, $value) { $ret = FALSE; - if (($rule=$this->getIngestRule($rule_id)) !== FALSE) { + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $methods = $rule->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); $found = FALSE; for ($i = 0; $found === FALSE && $i < $methods->length; $i++) { if (($methods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($i)->getAttribute('module')) == $module && - $methods->item($i)->getAttribute('file') == $file && - $methods->item($i)->getAttribute('class') == $class && - $methods->item($i)->getAttribute('method') == $method) { - $found=$methods->item($i); + $methods->item($i)->getAttribute('file') == $file && + $methods->item($i)->getAttribute('class') == $class && + $methods->item($i)->getAttribute('method') == $method) { + $found = $methods->item($i); } } if ($found !== FALSE) { $paramsEl = $found->getElementsByTagName('parameters'); if ($paramsEl->length == 0) { - $paramsEl=$found->appendChild($this->xml->createElement('parameters')); - } + $paramsEl = $found->appendChild($this->xml->createElement('parameters')); + } else { - $paramsEl=$paramsEl->item(0); + $paramsEl = $paramsEl->item(0); } $params = $paramsEl->getElementsByTagName('parameter'); $found = FALSE; - for ($i=0; $found === FALSE && $i < $params->length; $i++) { + for ($i = 0; $found === FALSE && $i < $params->length; $i++) { if ($params->item($i)->getAttribute('name') == $name) { $found = $params->item($i); } @@ -1853,12 +1837,12 @@ class ContentModel extends XMLDatastream { public function removeIngestMethodParam($rule_id, $module, $file, $class, $method, $name) { $ret = FALSE; - if (($rule=$this->getIngestRule($rule_id)) !== FALSE) { + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $found = FALSE; $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $methods = $methodsEl->getElementsByTagName('ingest_method'); - for ($i=0; !$found && $i < $methods->length; $i++) { - if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'fedora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { + for ($i = 0; !$found && $i < $methods->length; $i++) { + if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'fedora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { $found = $methods->item($i); } } @@ -1866,25 +1850,24 @@ class ContentModel extends XMLDatastream { $methodEl = $found; $paramsEl = $found->getElementsByTagName('parameters'); if ($paramsEl->length > 0) { - $paramsEl=$paramsEl->item(0); + $paramsEl = $paramsEl->item(0); $params = $paramsEl->getElementsByTagName('parameter'); $found = FALSE; - for ($i=0; $found === FALSE && $i < $params->length; $i++) { + for ($i = 0; $found === FALSE && $i < $params->length; $i++) { if ($params->item($i)->getAttribute('name') == $name) { - $found=$params->item($i); + $found = $params->item($i); } } - + if ($found !== FALSE) { $paramsEl->removeChild($found); if ($params->length == 0) { $methodEl->removeChild($paramsEl); } - + $ret = TRUE; } } - } } return $ret; @@ -1892,7 +1875,7 @@ class ContentModel extends XMLDatastream { public function removeIngestRule($rule_id) { $ret = FALSE; - if (($rule = $this->getIngestRule($rule_id))!==FALSE) { + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $ret = $this->xml->getElementsByTagName('ingest_rules')->item(0)->removeChild($rule); } return $ret; @@ -1917,34 +1900,33 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $ret = array(); $rules = $this->xml->getElementsByTagName('ingest_rules')->item(0)->getElementsByTagName('rule'); - for ($i=0; $i < $rules->length; $i++) { + for ($i = 0; $i < $rules->length; $i++) { $rule = array('applies_to' => array(), 'ingest_methods' => array()); $applies_to = $rules->item($i)->getElementsByTagName('applies_to'); - for ($j=0; $j < $applies_to->length; $j++) { + for ($j = 0; $j < $applies_to->length; $j++) { $rule['applies_to'][] = trim($applies_to->item($j)->nodeValue); } $methods = $rules->item($i)->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); - for ($j=0; $j < $methods->length; $j++) { + for ($j = 0; $j < $methods->length; $j++) { $method = array('module' => $methods->item($j)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($j)->getAttribute('module'), - 'file' => $methods->item($j)->getAttribute('file'), - 'class' => $methods->item($j)->getAttribute('class'), - 'method' => $methods->item($j)->getAttribute('method'), - 'dsid' => $methods->item($j)->getAttribute('dsid'), - 'modified_files_ext' => $methods->item($j)->getAttribute('modified_files_ext'), - 'parameters' => array()); - + 'file' => $methods->item($j)->getAttribute('file'), + 'class' => $methods->item($j)->getAttribute('class'), + 'method' => $methods->item($j)->getAttribute('method'), + 'dsid' => $methods->item($j)->getAttribute('dsid'), + 'modified_files_ext' => $methods->item($j)->getAttribute('modified_files_ext'), + 'parameters' => array()); + $params = $methods->item($j)->getElementsByTagName('parameters'); if ($params->length > 0) { - $params=$params->item(0)->getElementsByTagName('parameter'); - for ($k=0; $k < $params->length; $k++) { + $params = $params->item(0)->getElementsByTagName('parameter'); + for ($k = 0; $k < $params->length; $k++) { $method['parameters'][$params->item($k)->getAttribute('name')] = $params->item($k)->nodeValue; } } - + $rule['ingest_methods'][] = $method; - } $ret[] = $rule; @@ -1957,34 +1939,33 @@ class ContentModel extends XMLDatastream { $ret = FALSE; if ($this->validate()) { $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); - $ret=array('dsid' => $ingest_formEl->getAttribute('dsid'), - 'page' => $ingest_formEl->getAttribute('page'), - 'hide_file_chooser' => strtolower($ingest_formEl->getAttribute('hide_file_chooser')) == 'true', - 'redirect' => strtolower($ingest_formEl->getAttribute('redirect')) == 'false' ? FALSE : TRUE); - + $ret = array('dsid' => $ingest_formEl->getAttribute('dsid'), + 'page' => $ingest_formEl->getAttribute('page'), + 'hide_file_chooser' => strtolower($ingest_formEl->getAttribute('hide_file_chooser')) == 'true', + 'redirect' => strtolower($ingest_formEl->getAttribute('redirect')) == 'false' ? FALSE : TRUE); } return $ret; } - + public function editIngestFormAttributes($dsid, $page, $hide_file_chooser = FALSE, $redirect = TRUE) { $ret = FALSE; if (self::validDsid($dsid) && $this->validate()) { - $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); - $ingest_formEl->setAttribute('dsid', $dsid); - $ingest_formEl->setAttribute('page', $page); - if (!$redirect) { - $ingest_formEl->setAttribute('redirect', 'false'); - } - else { - $ingest_formEl->removeAttribute('redirect'); - } - if ($hide_file_chooser) { + $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); + $ingest_formEl->setAttribute('dsid', $dsid); + $ingest_formEl->setAttribute('page', $page); + if (!$redirect) { + $ingest_formEl->setAttribute('redirect', 'false'); + } + else { + $ingest_formEl->removeAttribute('redirect'); + } + if ($hide_file_chooser) { $ingest_formEl->setAttribute('hide_file_chooser', 'true'); - } - else { + } + else { $ingest_formEl->removeAttribute('hide_file_chooser'); - } - $ret = TRUE; + } + $ret = TRUE; } return $ret; } @@ -1993,15 +1974,15 @@ class ContentModel extends XMLDatastream { $ret = FALSE; if ($this->validate()) { $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); - $ret = array( 'module' => ($method->getAttribute('module')==''?'fedora_repository':$method->getAttribute('module')), - 'file' => $method->getAttribute('file'), - 'class' => $method->getAttribute('class'), - 'method' => $method->getAttribute('method'), - 'handler' => $method->getAttribute('handler')); + $ret = array('module' => ($method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module')), + 'file' => $method->getAttribute('file'), + 'class' => $method->getAttribute('class'), + 'method' => $method->getAttribute('method'), + 'handler' => $method->getAttribute('handler')); } return $ret; } - + public function editIngestFormBuilderMethod($module, $file, $class, $method, $handler) { $ret = FALSE; if ($this->validate()) { @@ -2013,7 +1994,7 @@ class ContentModel extends XMLDatastream { $methodEl->setAttribute('handler', $handler); $ret = TRUE; } - return $ret; + return $ret; } /** @@ -2040,7 +2021,7 @@ class ContentModel extends XMLDatastream { } $names = FALSE; $result = $this->xpath->query('//cm:forms/cm:form/@name'); // Select the name attribute of all forms. - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $attribute = $result->item($i); $name = $attribute->value; $names[$name] = $name; @@ -2058,7 +2039,7 @@ class ContentModel extends XMLDatastream { return FALSE; } $result = $this->xpath->query('//cm:forms/cm:form[@ingest_class and @ingest_file and @ingest_module]/@name'); // Select the name attribute of all forms. - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $attribute = $result->item($i); $name = $attribute->value; $names[$name] = $name; @@ -2076,7 +2057,7 @@ class ContentModel extends XMLDatastream { return FALSE; } $result = $this->xpath->query('//cm:forms/cm:form[@edit_class and @edit_file and @edit_module]/@name'); // Select the name attribute of all forms. - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $attribute = $result->item($i); $name = $attribute->value; $names[$name] = $name; @@ -2122,7 +2103,7 @@ class ContentModel extends XMLDatastream { $result->item(0)->appendChild($forms); return TRUE; } - else if ($result->length == 1) { + elseif ($result->length == 1) { $element = $this->xml->importNode($element); $result->item(0)->appendChild($element); return TRUE; @@ -2130,7 +2111,6 @@ class ContentModel extends XMLDatastream { return FALSE; } - /** * Edits a form element with attribute name='$name' from the 'forms' element. * @@ -2141,11 +2121,11 @@ class ContentModel extends XMLDatastream { return FALSE; } $result = $this->xpath->query("//cm:form[@name='$name']"); - if($result->length == 1) { + if ($result->length == 1) { $form = $result->item(0); $result = $this->xpath->query("child::node()", $form); $element = $this->xml->importNode($element); - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $child = $result->item($i); $element->appendChild($child); } @@ -2176,10 +2156,10 @@ class ContentModel extends XMLDatastream { $new_element = $this->xml->importNode($new_element, TRUE); $name = $new_element->tagName; $result = $new_element->getElementsByTagName('content'); - if($result->length == 1) { + if ($result->length == 1) { $new_content = $result->item(0); $result = $this->xpath->query("child::cm:content/child::node()", $edit_element); - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $child = $result->item($i); $new_content->appendChild($child); } diff --git a/MimeClass.inc b/MimeClass.inc index f1c5cb16..7d2ae33e 100644 --- a/MimeClass.inc +++ b/MimeClass.inc @@ -1,5 +1,6 @@ extension lookups in the context of Islandora collections. - * - * It has been cut from a much longer list. - * - * Two types of mimetypes should be put in this list: - * 1) Special emerging formats which may not yet be expressed in the system - * mime.types file. - * 2) Heavily used mimetypes of particular importance to the Islandora - * project, as lookups against this list will be quicker and less - * resource intensive than other methods. - * - * Lookups are first checked against this short list. If no results are found, - * then the lookup function may move on to check other sources, namely the - * system's mime.types file. - * - * In most cases though, this short list should suffice. - * - * If modifying this list, please note that for promiscuous mimetypes - * (those which map to multiple extensions, such as text/plain) - * The function get_extension will always return the *LAST* extension in this list, - * so you should put your preferred extension *LAST*. - * - * e.g... - * "jpeg" => "image/jpeg", - * "jpe" => "image/jpeg", - * "jpg" => "image/jpeg", - * - * $this->get_extension('image/jpeg') will always return 'jpg'. - * - */ + /** + * This is a shortlist of mimetypes which should catch most + * mimetype<-->extension lookups in the context of Islandora collections. + * + * It has been cut from a much longer list. + * + * Two types of mimetypes should be put in this list: + * 1) Special emerging formats which may not yet be expressed in the system + * mime.types file. + * 2) Heavily used mimetypes of particular importance to the Islandora + * project, as lookups against this list will be quicker and less + * resource intensive than other methods. + * + * Lookups are first checked against this short list. If no results are found, + * then the lookup function may move on to check other sources, namely the + * system's mime.types file. + * + * In most cases though, this short list should suffice. + * + * If modifying this list, please note that for promiscuous mimetypes + * (those which map to multiple extensions, such as text/plain) + * The function get_extension will always return the *LAST* extension in this list, + * so you should put your preferred extension *LAST*. + * + * e.g... + * "jpeg" => "image/jpeg", + * "jpe" => "image/jpeg", + * "jpg" => "image/jpeg", + * + * $this->get_extension('image/jpeg') will always return 'jpg'. + * + */ // openoffice: - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'ott' => 'application/vnd.oasis.opendocument.text-template', // staroffice: - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'std' => 'application/vnd.sun.xml.draw.template', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'sxc' => 'application/vnd.sun.xml.calc', + 'sxd' => 'application/vnd.sun.xml.draw', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', // k-office: - 'kil' => 'application/x-killustrator', - 'kpt' => 'application/x-kpresenter', - 'kpr' => 'application/x-kpresenter', - 'ksp' => 'application/x-kspread', - 'kwt' => 'application/x-kword', - 'kwd' => 'application/x-kword', + 'kil' => 'application/x-killustrator', + 'kpt' => 'application/x-kpresenter', + 'kpr' => 'application/x-kpresenter', + 'ksp' => 'application/x-kspread', + 'kwt' => 'application/x-kword', + 'kwd' => 'application/x-kword', // ms office 97: - 'doc' => 'application/msword', - 'xls' => 'application/vnd.ms-excel', - 'ppt' => 'application/vnd.ms-powerpoint', + 'doc' => 'application/msword', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', // office2007: - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12', // wordperfect (who cares?): - 'wpd' => 'application/wordperfect', + 'wpd' => 'application/wordperfect', // common and generic containers: - 'pdf' => 'application/pdf', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'rtf' => 'text/rtf', - 'rtx' => 'text/richtext', - 'latex' => 'application/x-latex', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', + 'pdf' => 'application/pdf', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'rtf' => 'text/rtf', + 'rtx' => 'text/richtext', + 'latex' => 'application/x-latex', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', // *ml: - 'css' => 'text/css', - 'htm' => 'text/html', - 'html' => 'text/html', - 'wbxml' => 'application/vnd.wap.wbxml', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xsl' => 'text/xml', - 'xml' => 'text/xml', - 'csv' => 'text/csv', - 'tsv' => 'text/tab-separated-values', - 'txt' => 'text/plain', + 'css' => 'text/css', + 'htm' => 'text/html', + 'html' => 'text/html', + 'wbxml' => 'application/vnd.wap.wbxml', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'xsl' => 'text/xml', + 'xml' => 'text/xml', + 'csv' => 'text/csv', + 'tsv' => 'text/tab-separated-values', + 'txt' => 'text/plain', // images: - "bmp" => "image/bmp", - "gif" => "image/gif", - "ief" => "image/ief", - "jpeg" => "image/jpeg", - "jpe" => "image/jpeg", - "jpg" => "image/jpeg", - "jp2" => "image/jp2", - "png" => "image/png", - "tiff" => "image/tiff", - "tif" => "image/tif", - "djvu" => "image/vnd.djvu", - "djv" => "image/vnd.djvu", - "wbmp" => "image/vnd.wap.wbmp", - "ras" => "image/x-cmu-raster", - "pnm" => "image/x-portable-anymap", - "pbm" => "image/x-portable-bitmap", - "pgm" => "image/x-portable-graymap", - "ppm" => "image/x-portable-pixmap", - "rgb" => "image/x-rgb", - "xbm" => "image/x-xbitmap", - "xpm" => "image/x-xpixmap", - "xwd" => "image/x-windowdump", + "bmp" => "image/bmp", + "gif" => "image/gif", + "ief" => "image/ief", + "jpeg" => "image/jpeg", + "jpe" => "image/jpeg", + "jpg" => "image/jpeg", + "jp2" => "image/jp2", + "png" => "image/png", + "tiff" => "image/tiff", + "tif" => "image/tif", + "djvu" => "image/vnd.djvu", + "djv" => "image/vnd.djvu", + "wbmp" => "image/vnd.wap.wbmp", + "ras" => "image/x-cmu-raster", + "pnm" => "image/x-portable-anymap", + "pbm" => "image/x-portable-bitmap", + "pgm" => "image/x-portable-graymap", + "ppm" => "image/x-portable-pixmap", + "rgb" => "image/x-rgb", + "xbm" => "image/x-xbitmap", + "xpm" => "image/x-xpixmap", + "xwd" => "image/x-windowdump", // videos: - "mpeg" => "video/mpeg", - "mpe" => "video/mpeg", - "mpg" => "video/mpeg", - "m4v" => "video/mp4", - "mp4" => "video/mp4", - "ogv" => "video/ogg", - "qt" => "video/quicktime", - "mov" => "video/quicktime", - "mxu" => "video/vnd.mpegurl", - "avi" => "video/x-msvideo", - "movie" => "video/x-sgi-movie", - "flv" => "video/x-flv", - "swf" => "application/x-shockwave-flash", + "mpeg" => "video/mpeg", + "mpe" => "video/mpeg", + "mpg" => "video/mpeg", + "m4v" => "video/mp4", + "mp4" => "video/mp4", + "ogv" => "video/ogg", + "qt" => "video/quicktime", + "mov" => "video/quicktime", + "mxu" => "video/vnd.mpegurl", + "avi" => "video/x-msvideo", + "movie" => "video/x-sgi-movie", + "flv" => "video/x-flv", + "swf" => "application/x-shockwave-flash", // audio: - "mp3" => "audio/mpeg", - "mp4a" => "audio/mp4", - "m4a" => "audio/mp4", - "oga" => "audio/ogg", - "ogg" => "audio/ogg", - "flac" => "audio/x-flac", - "wav" => "audio/vnd.wave", + "mp3" => "audio/mpeg", + "mp4a" => "audio/mp4", + "m4a" => "audio/mp4", + "oga" => "audio/ogg", + "ogg" => "audio/ogg", + "flac" => "audio/x-flac", + "wav" => "audio/vnd.wave", // compressed formats: (note: http://svn.cleancode.org/svn/email/trunk/mime.types) - "tgz" => "application/x-gzip", - "gz" => "application/x-gzip", - "tar" => "application/x-tar", - "gtar" => "application/x-gtar", - "zip" => "application/x-zip", + "tgz" => "application/x-gzip", + "gz" => "application/x-gzip", + "tar" => "application/x-tar", + "gtar" => "application/x-gtar", + "zip" => "application/x-zip", // others: - 'bin' => 'application/octet-stream', + 'bin' => 'application/octet-stream', ); - private $private_file_extensions; private $system_types; private $system_exts; @@ -199,84 +199,82 @@ class MimeClass { public function __construct() { // populate the reverse shortlist: - $this->private_file_extensions = array_flip( $this->private_mime_types ); + $this->private_file_extensions = array_flip($this->private_mime_types); // pick up a local mime.types file if it is available - if (is_readable('mime.types') ) { + if (is_readable('mime.types')) { $this->etc_mime_types = 'mime.types'; } - } - + /** * function: getType * description: An alias to get_mimetype, * for backwards-compatibility with our old mimetype class. */ - public function getType( $filename ) { - return $this->get_mimetype( $filename ); + public function getType($filename) { + return $this->get_mimetype($filename); } /** * function: get_mimetype * description: returns a mimetype associated with the file extension of $filename */ - public function get_mimetype( $filename, $debug = FALSE ) { + public function get_mimetype($filename, $debug = FALSE) { - $file_name_and_extension = explode( '.', $filename ); - $ext = strtolower( array_pop( $file_name_and_extension ) ); - - if ( ! empty( $this->private_mime_types[$ext] ) ) { - if ( TRUE === $debug ) - return array( 'mime_type' => $this->private_mime_types[$ext], 'method' => 'from_array' ); + $file_name_and_extension = explode('.', $filename); + $ext = strtolower(array_pop($file_name_and_extension)); + + if (!empty($this->private_mime_types[$ext])) { + if (TRUE === $debug) + return array('mime_type' => $this->private_mime_types[$ext], 'method' => 'from_array'); return $this->private_mime_types[$ext]; } - + if (function_exists('file_get_mimetype')) { - $drupal_mimetype = file_get_mimetype( $filename ); + $drupal_mimetype = file_get_mimetype($filename); if ('application/octet-stream' != $drupal_mimetype) { if (TRUE == $debug) return array('mime_type' => $drupal_mimetype, 'method' => 'file_get_mimetype'); return $drupal_mimetype; } } - - if (!isset( $this->system_types)) + + if (!isset($this->system_types)) $this->system_types = $this->system_extension_mime_types(); - if (isset( $this->system_types[$ext])) { + if (isset($this->system_types[$ext])) { if (TRUE == $debug) return array('mime_type' => $this->system_types[$ext], 'method' => 'mime.types'); return $this->system_types[$ext]; } - - if ( TRUE === $debug ) - return array( 'mime_type' => 'application/octet-stream', 'method' => 'last_resort' ); - return 'application/octet-stream'; + if (TRUE === $debug) + return array('mime_type' => 'application/octet-stream', 'method' => 'last_resort'); + return 'application/octet-stream'; } /** * function: get_extension * description: returns *one* valid file extension for a given $mime_type */ - public function get_extension( $mime_type, $debug = FALSE ) { + public function get_extension($mime_type, $debug = FALSE) { - if (!empty( $this->private_file_extensions[$mime_type])) { + if (!empty($this->private_file_extensions[$mime_type])) { if (TRUE == $debug) - return array( 'extension' => $this->private_file_extensions[$mime_type], 'method' => 'from_array' ); + return array('extension' => $this->private_file_extensions[$mime_type], 'method' => 'from_array'); return $this->private_file_extensions[$mime_type]; } - if (!isset ( $this->system_exts)) + if (!isset($this->system_exts)) $this->system_exts = $this->system_mime_type_extensions(); - if (isset( $this->system_exts[$mime_type])) { + if (isset($this->system_exts[$mime_type])) { if (TRUE == $debug) - return array( 'extension' => $this->system_exts[$mime_type], 'method' => 'mime.types' ); + return array('extension' => $this->system_exts[$mime_type], 'method' => 'mime.types'); return $this->system_exts[$mime_type]; } if (TRUE == $debug) - return array( 'extension' => 'bin', 'method' => 'last_resort' ); + return array('extension' => 'bin', 'method' => 'last_resort'); return 'bin'; } @@ -297,11 +295,11 @@ class MimeClass { $parts = preg_split('/\s+/', $line); if (count($parts) == 1) continue; - // A single part means a mimetype without extensions, which we ignore. + // A single part means a mimetype without extensions, which we ignore. $type = array_shift($parts); if (!isset($out[$type])) $out[$type] = array_shift($parts); - // We take the first ext from the line if many are present. + // We take the first ext from the line if many are present. } fclose($file); return $out; @@ -324,7 +322,7 @@ class MimeClass { $parts = preg_split('/\s+/', $line); if (count($parts) == 1) continue; - // A single part means a mimetype without extensions, which we ignore. + // A single part means a mimetype without extensions, which we ignore. $type = array_shift($parts); foreach ($parts as $part) $out[$part] = $type; diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 0f8be1bb..4f5044eb 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -1,6 +1,6 @@ datastreams[$dsID]['label']; } - } else { + } + else { drupal_not_found(); exit(); } @@ -95,7 +96,8 @@ class ObjectHelper { $fedoraUser = 'anonymous'; $fedoraPass = 'anonymous'; $contentSize = 0; - } else { + } + else { $fedoraUser = $user->name; $fedoraPass = $user->pass; $dataStreamInfo = $item->get_datastream_info($dsID); @@ -135,7 +137,8 @@ class ObjectHelper { curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); fclose($fp); - } else { + } + else { header("Content-type: $mimeType"); if ($contentSize > 0) { @@ -168,12 +171,14 @@ class ObjectHelper { if ((isset($user) && $user->uid != 0) || $forceSoap || isset($_SERVER['HTTPS'])) { curl_exec($ch); - } else { + } + else { header('Location: ' . $url); } } curl_close($ch); - } else { + } + else { drupal_set_message(t('No curl support.'), 'error'); } } @@ -264,10 +269,11 @@ class ObjectHelper { } if ($allow) { $purgeImage = 'purge datastream'; + $pid . '/' . $dataStreamValue->ID . '/' . $dataStreamValue->label . '">purge datastream'; } - } else { + } + else { $purgeImage = ' '; } $fullPath = base_path() . $path; @@ -292,7 +298,7 @@ class ObjectHelper { $mimeType = $dataStreamValue->MIMEType; $view = '' . t('View') . ''; + '" target="_blank" >' . t('View') . ''; $action = "$base_url/fedora/repository/object_download/" . drupal_urlencode($pid) . '/' . $id . '/' . drupal_urlencode(preg_replace('/\//i', '${1}_', $label)); // Necessary to handle the case of Datastream labels that contain slashes. Ugh. $downloadVersion = '
'; if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { @@ -322,9 +328,8 @@ class ObjectHelper { if (empty($xmlstr)) { return ''; - } - + try { $proc = new XsltProcessor(); } catch (Exception $e) { @@ -348,7 +353,7 @@ class ObjectHelper { $output = $newdom->saveHTML(); return $output; } - + /** * Queries fedora for what we call the qualified dublin core. Currently only dc.coverage has * any qualified fields @@ -364,7 +369,7 @@ class ObjectHelper { $output = $this->getFormattedDC($item); $dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC'; $path = drupal_get_path('module', 'fedora_repository'); - + //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1)); if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { $allow = TRUE; @@ -374,14 +379,12 @@ class ObjectHelper { if ($allow) { $output .= '
' . t('Edit Meta Data') . ''; - + $dsid . '">' . t('Edit Meta Data') . ''; } } return $output; } - /** * Gets a list of datastreams from an object using its pid * @@ -465,8 +468,6 @@ class ObjectHelper { } return ''; } - - /** * returns a stream from a fedora object given a pid and dsid @@ -572,7 +573,8 @@ class ObjectHelper { return FALSE; } return $user_access; - } else { + } + else { return FALSE; } } @@ -629,17 +631,17 @@ class ObjectHelper { if ($allow) { // $ingestObject = ' $collectionName, '!collection_pid' => $collection_pid)) . '" href="' . base_path() . - 'fedora/ingestObject/' . $collection_pid . '/' . $collectionName . '">' . t('Add a New Object') . '' . t(' Add to this Collection'); + 'fedora/ingestObject/' . $collection_pid . '/' . $collectionName . '">' . t('Add a New Object') . '' . t(' Add to this Collection'); } } - } else { + } + else { $ingestObject = ' '; } - } - $datastreams .= $ingestObject; + $datastreams .= $ingestObject; $output .= $datastreams; @@ -671,7 +673,7 @@ class ObjectHelper { $output .= theme('fieldset', $fieldset); } - + return $output; } @@ -718,7 +720,7 @@ class ObjectHelper { return $parent_collections_HTML; } - + /** * 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 @@ -794,10 +796,10 @@ class ObjectHelper { // Get pid, title and description for children of object $pid $query_string = 'select $o $title from <#ri> ' . // $query_string = 'select $o $title $desc from <#ri> '. - 'where $s $o ' . - 'and $o $title ' . + 'where $s $o ' . + 'and $o $title ' . // 'and $o $desc '. - 'and ( '; + 'and ( '; foreach ($pids as $pid) { $query_string .= '$s or '; @@ -850,10 +852,11 @@ class ObjectHelper { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; - if ($pid == variable_get('fedora_repository_pid', 'islandora:top')){ - $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(t('Home'), $base_url); - } else { + if ($pid == variable_get('fedora_repository_pid', 'islandora:top')) { + $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); + $breadcrumbs[] = l(t('Home'), $base_url); + } + else { $query_string = 'select $parentObject $title $content from <#ri> where ( $title and $parentObject $content @@ -868,17 +871,18 @@ class ObjectHelper { $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; - $result = preg_split('/[\r\n]+/',do_curl($url)); + $result = preg_split('/[\r\n]+/', do_curl($url)); array_shift($result); // throw away first line - $matches =str_getcsv(join("\n",$result)); + $matches = str_getcsv(join("\n", $result)); if ($matches !== FALSE) { - $parent = preg_replace('/^info:fedora\//','',$matches[0]); + $parent = preg_replace('/^info:fedora\//', '', $matches[0]); $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); - } elseif ($level > 0) { + } + elseif ($level > 0) { $this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); } } diff --git a/SearchClass.inc b/SearchClass.inc index 85a91968..ef62ce91 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -1,101 +1,105 @@ $e->getMessage())), NULL, WATCHDOG_ERROR); return 'Error getting solr search results class. Check watchdog for more info.'; - } + } return $implementation->$solrFunction($query, $startPage, $fq, $dismax); } + function build_solr_search_form($repeat = NULL, $pathToSearchTerms = NULL, $query = NULL) { $types = $this->get_search_terms_array(NULL, 'solrSearchTerms.xml'); - $queryArray=NULL; + $queryArray = NULL; if (isset($query)) { $queryArray = explode('AND', $query); } $andOrArray = array( - 'AND' => 'and', - //'OR' => 'or' //removed or for now as it would be a pain to parse + 'AND' => 'and', + //'OR' => 'or' //removed or for now as it would be a pain to parse ); $form = array(); if (!isset($repeat)) { - $repeat = variable_get('islandora_solr_search_block_repeat', t('3')); + $repeat = variable_get('islandora_solr_search_block_repeat', t('3')); } $var0 = explode(':', $queryArray[0]); $var1 = explode(':', $queryArray[1]); $form['search_type']['type1'] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => trim($var0[0]) + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => trim($var0[0]) ); $form['fedora_terms1'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#required' => TRUE, - '#default_value' => (count($var0) >= 2 ? trim($var0[1]) : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#required' => TRUE, + '#default_value' => (count($var0) >= 2 ? trim($var0[1]) : ''), ); $form['andor1'] = array( - '#title' => t(''), - '#type' => 'select', - '#default_value' => 'AND', - '#options' => $andOrArray + '#title' => t(''), + '#type' => 'select', + '#default_value' => 'AND', + '#options' => $andOrArray ); $form['search_type']['type2'] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => (count($var1) >= 2 ? trim($var1[0]) : ''), + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => (count($var1) >= 2 ? trim($var1[0]) : ''), ); $form['fedora_terms2'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#default_value' => (count($var1) >= 2 ? $var1[1] : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#default_value' => (count($var1) >= 2 ? $var1[1] : ''), ); - if ($repeat>2 && $repeat < 9) { //don't want less then 2 or more then 9 + if ($repeat > 2 && $repeat < 9) { //don't want less then 2 or more then 9 for ($i = 3; $i < $repeat + 1; $i++) { $t = $i - 1; $field_and_term = explode(':', $queryArray[$t]); $form["andor$t"] = array( - '#title' => t(''), - '#type' => 'select', - '#default_value' => 'AND', - '#options' => $andOrArray + '#title' => t(''), + '#type' => 'select', + '#default_value' => 'AND', + '#options' => $andOrArray ); $form['search_type']["type$i"] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => trim($field_and_term[0]) + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => trim($field_and_term[0]) ); $form["fedora_terms$i"] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), ); } } $form['submit'] = array( - '#type' => 'submit', - '#value' => t('search') + '#type' => 'submit', + '#value' => t('search') ); return $form; } @@ -103,39 +107,39 @@ class SearchClass { function build_simple_solr_form() { //$form = array(); $form["search_query"] = array( - '#size' => '30', - '#type' => 'textfield', - '#title' => t(''), - // '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), - ); + '#size' => '30', + '#type' => 'textfield', + '#title' => t(''), + // '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), + ); $form['submit'] = array( - '#type' => 'submit', - '#value' => t('search') + '#type' => 'submit', + '#value' => t('search') ); return $form; } + function theme_solr_search_form($form) { if (!isset($repeat)) { - $repeat = variable_get('islandora_solr_search_block_repeat', t('3')); + $repeat = variable_get('islandora_solr_search_block_repeat', t('3')); } - $output = drupal_render($form['search_type']['type1']) ; - $output .= drupal_render($form['fedora_terms1']) ; - $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']) ; + $output = drupal_render($form['search_type']['type1']); + $output .= drupal_render($form['fedora_terms1']); + $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']); $output .= drupal_render($form['fedora_terms2']); - if ($repeat>2 && $repeat < 9) { - for ($i=3;$i<$repeat+1;$i++) { + if ($repeat > 2 && $repeat < 9) { + for ($i = 3; $i < $repeat + 1; $i++) { $t = $i - 1; - $output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$i"]) ; - $output .= drupal_render($form["fedora_terms$i"]) ; + $output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$i"]); + $output .= drupal_render($form["fedora_terms$i"]); } } - $output .= drupal_render($form['submit']) ; + $output .= drupal_render($form['submit']); $output .= drupal_render($form); return $output; - - } + function quickSearch($type, $query, $showForm = 1, $orderBy = 0, & $userArray) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -146,15 +150,15 @@ class SearchClass { $keywords = explode(' ', $query); foreach ($keywords as $keyword) { - $luceneQuery .= $type . ':'. $keyword . '+AND+'; + $luceneQuery .= $type . ':' . $keyword . '+AND+'; } $luceneQuery = substr($luceneQuery, 0, strlen($luceneQuery) - 5); $indexName = variable_get('fedora_index_name', 'DemoOnLucene'); $keys = htmlentities(urlencode($query)); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); - $searchString = '?operation=gfindObjects&indexName='. $indexName . '&restXslt=copyXml&query='. $luceneQuery; - $searchString .= '&hitPageSize='. $numberOfHistPerPage . '&hitPageStart=1'; + $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=copyXml&query=' . $luceneQuery; + $searchString .= '&hitPageSize=' . $numberOfHistPerPage . '&hitPageStart=1'; //$searchString = htmlentities($searchString); $searchUrl .= $searchString; @@ -169,19 +173,18 @@ class SearchClass { $nodeList = $xPath->query('//field[@name="refworks.u1"]'); foreach ($nodeList as $node) { if (!in_array($node->nodeValue, $userArray)) { - $userArray[]=$node->nodeValue; + $userArray[] = $node->nodeValue; } } } if ($showForm) { - $output = 'Quick Search
'. drupal_get_form('fedora_repository_quick_search_form') . '
'; + $output = 'Quick Search
' . drupal_get_form('fedora_repository_quick_search_form') . '
'; } $output .= $this->applyXSLT($resultData, $orderBy); return $output; } } - // gets term from a lucene index and displays them in a list function getTerms($fieldName, $startTerm, $displayName = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -192,10 +195,10 @@ class SearchClass { $startTerm = ""; } $startTerm = drupal_urlencode($startTerm); - $query = 'operation=browseIndex&startTerm='. $startTerm . '&fieldName='. $fieldName . '&termPageSize=20&indexName='. $indexName . '&restXslt=copyXml&resultPageXslt=copyXml'; + $query = 'operation=browseIndex&startTerm=' . $startTerm . '&fieldName=' . $fieldName . '&termPageSize=20&indexName=' . $indexName . '&restXslt=copyXml&resultPageXslt=copyXml'; // $query=drupal_urlencode($query); - $query = '?'. $query; - $searchString=$searchUrl . $query; + $query = '?' . $query; + $searchString = $searchUrl . $query; $objectHelper = new ObjectHelper(); @@ -205,11 +208,8 @@ class SearchClass { $output .= $this->applySpecifiedXSLT($resultData, $path . '/xsl/browseIndexToResultPage.xslt', $displayName); //$output .= '
'.$alpha_out; return $output; - } - - function custom_search($query, $startPage=1, $xslt= '/xsl/advanced_search_results.xsl', $numberOfHistPerPage = 50) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -225,8 +225,8 @@ class SearchClass { $query = trim($query); $query = htmlentities(urlencode($query)); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); - $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt='. $copyXMLFile . '&query=' . $query; - $searchString .= '&hitPageSize='. $numberOfHistPerPage . '&hitPageStart='. $startPage; + $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=' . $copyXMLFile . '&query=' . $query; + $searchString .= '&hitPageSize=' . $numberOfHistPerPage . '&hitPageStart=' . $startPage; //$searchString = htmlentities($searchString); $searchUrl .= $searchString; @@ -242,7 +242,6 @@ class SearchClass { } } - function applySpecifiedXSLT($resultData, $pathToXSLT, $displayName = NULL) { $proc = NULL; global $user; @@ -252,9 +251,8 @@ class SearchClass { } try { $proc = new XsltProcessor(); - } - catch (Exception $e) { - drupal_set_message(t('Error loading '. $pathToXSLT . ' xslt!') . $e->getMessage()); + } catch (Exception $e) { + drupal_set_message(t('Error loading ' . $pathToXSLT . ' xslt!') . $e->getMessage()); return ' '; } @@ -270,10 +268,10 @@ class SearchClass { $xsl = new DomDocument(); - $test= $xsl->load($pathToXSLT); + $test = $xsl->load($pathToXSLT); if (!isset($test)) { - drupal_set_message(t('Error loading '. $pathToXSLT . ' xslt!')); + drupal_set_message(t('Error loading ' . $pathToXSLT . ' xslt!')); return t('Error loading !pathToXSLT xslt.', array('!pathToXSLT' => $pathToXSLT)); } @@ -291,8 +289,8 @@ class SearchClass { return $newdom->saveXML(); } } - //default function for lucene results + //default function for lucene results /** * apply an xslt to lucene gsearch search results @@ -305,8 +303,8 @@ class SearchClass { function applyLuceneXSLT($resultData, $startPage = 1, $xslt_file = '/xsl/results.xsl', $query=NULL) { $path = drupal_get_path('module', 'Fedora_Repository'); $test = $xslt_file; - $isRestricted = variable_get('fedora_namespace_restriction_enforced',TRUE); - if(!isRestricted && $xslt_file == null){ + $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); + if (!isRestricted && $xslt_file == NULL) { $xslt_file = '/xsl/unfilteredresults.xsl'; } $proc = NULL; @@ -378,7 +376,7 @@ class SearchClass { $proc->setParameter('', 'orderBy', $orderBy); $xsl = new DomDocument(); - $test=$xsl->load($path . '/ir/xsl/results.xsl'); + $test = $xsl->load($path . '/ir/xsl/results.xsl'); if (!isset($test)) { drupal_set_message(t('Error loading search results xslt!')); return t('Error loading search results XSLT.'); @@ -400,21 +398,21 @@ class SearchClass { function theme_advanced_search_form($form, $repeat=NULL) { if (!isset($repeat)) { - $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); } - $output = drupal_render($form['search_type']['type1']) ; - $output .= drupal_render($form['fedora_terms1']) ; - $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']) ; + $output = drupal_render($form['search_type']['type1']); + $output .= drupal_render($form['fedora_terms1']); + $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']); $output .= drupal_render($form['fedora_terms2']); - if ($repeat>2 && $repeat < 9) { - for ($i=3;$i<$repeat+1;$i++) { + if ($repeat > 2 && $repeat < 9) { + for ($i = 3; $i < $repeat + 1; $i++) { $t = $i - 1; - $output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$i"]) ; - $output .= drupal_render($form["fedora_terms$i"]) ; + $output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$i"]); + $output .= drupal_render($form["fedora_terms$i"]); } } - $output .= drupal_render($form['submit']) ; + $output .= drupal_render($form['submit']); $output .= drupal_render($form); return $output; } @@ -422,86 +420,85 @@ class SearchClass { //build search form, custom blocks should set the number of repeats or it will use the default function build_advanced_search_form($repeat = NULL, $pathToSearchTerms = NULL, $query = NULL) { $types = $this->get_search_terms_array($pathToSearchTerms); - $queryArray=NULL; + $queryArray = NULL; if (isset($query)) { $queryArray = explode('AND', $query); } $andOrArray = array( - 'AND' => 'and', - //'OR' => 'or' //removed or for now as it would be a pain to parse + 'AND' => 'and', + //'OR' => 'or' //removed or for now as it would be a pain to parse ); $form = array(); if (!isset($repeat)) { - $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); } $var0 = explode(':', $queryArray[0]); $var1 = explode(':', $queryArray[1]); $form['search_type']['type1'] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => trim($var0[0]) + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => trim($var0[0]) ); $form['fedora_terms1'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#required' => TRUE, - '#default_value' => (count($var0) >= 2 ? trim($var0[1]) : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#required' => TRUE, + '#default_value' => (count($var0) >= 2 ? trim($var0[1]) : ''), ); $form['andor1'] = array( - '#title' => t(''), - '#type' => 'select', - '#default_value' => 'AND', - '#options' => $andOrArray + '#title' => t(''), + '#type' => 'select', + '#default_value' => 'AND', + '#options' => $andOrArray ); $form['search_type']['type2'] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => (count($var1) >= 2 ? trim($var1[0]) : ''), + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => (count($var1) >= 2 ? trim($var1[0]) : ''), ); $form['fedora_terms2'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#default_value' => (count($var1) >= 2 ? $var1[1] : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#default_value' => (count($var1) >= 2 ? $var1[1] : ''), ); - if ($repeat>2 && $repeat < 9) { //don't want less then 2 or more then 9 + if ($repeat > 2 && $repeat < 9) { //don't want less then 2 or more then 9 for ($i = 3; $i < $repeat + 1; $i++) { $t = $i - 1; $field_and_term = explode(':', $queryArray[$t]); $form["andor$t"] = array( - '#title' => t(''), - '#type' => 'select', - '#default_value' => 'AND', - '#options' => $andOrArray + '#title' => t(''), + '#type' => 'select', + '#default_value' => 'AND', + '#options' => $andOrArray ); $form['search_type']["type$i"] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => trim($field_and_term[0]) + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => trim($field_and_term[0]) ); $form["fedora_terms$i"] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), ); } } $form['submit'] = array( - '#type' => 'submit', - '#value' => t('search') + '#type' => 'submit', + '#value' => t('search') ); return $form; } - function get_search_terms_array($path = NULL, $file = NULL) { if (!isset($path)) { $path = drupal_get_path('module', 'Fedora_Repository'); @@ -510,7 +507,7 @@ class SearchClass { if (!isset($file)) { $file = 'searchTerms.xml'; } - $xmlDoc->load($path . '/'. $file); + $xmlDoc->load($path . '/' . $file); $nodeList = $xmlDoc->getElementsByTagName('term'); $types = array(); for ($i = 0; $i < $nodeList->length; $i++) { @@ -522,4 +519,5 @@ class SearchClass { } return $types; } + } diff --git a/SecurityClass.inc b/SecurityClass.inc index c314cbd1..37a1a90c 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -1,5 +1,6 @@ $e->getMessage())), 'error'); @@ -68,7 +70,7 @@ class SecurityClass { foreach ($conditions as $condition) { $designator = $condition->Apply->SubjectAttributeDesignator; if (empty($designator)) {//$disignator may be wrapped by an or - $designator=$condition->Apply->Apply->SubjectAttributeDesignator; + $designator = $condition->Apply->Apply->SubjectAttributeDesignator; } $attributeId = strip_tags($designator['AttributeId']); @@ -92,8 +94,8 @@ class SecurityClass { $usersAndRoles['users'] = $allowedUsers; $usersAndRoles['roles'] = $allowedRoles; return $usersAndRoles; - } + // When a user's profile is saved in drupal we will attempt to create a collection for them in Fedora // this will be their personal space. In the IR it is editable by users with the same role in the VRE // it probably would not be. @@ -101,8 +103,7 @@ class SecurityClass { $doc = new DOMDocument(); try { $doc->load(drupal_get_path('module', 'Fedora_Repository') . '/policies/noObjectEditPolicy.xml'); - } - catch (exception $e) { + } catch (exception $e) { watchdog(t("Fedora_Repository"), t("Problem loading policy file."), NULL, WATCHDOG_ERROR); } $conditions = $doc->getElementsByTagName('Condition'); @@ -117,7 +118,7 @@ class SecurityClass { if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { foreach ($user->roles as $role) { if (!($role == 'authenticated user' || $role == 'administrator')) { //don't want authenticated user included administrator already is included' - $newAttributeValue=$doc->createElement('AttributeValue', ''); + $newAttributeValue = $doc->createElement('AttributeValue', ''); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); // $newAttributeValue->setAttribute('MustBePresent', 'FALSE'); $apply->appendChild($newAttributeValue); @@ -132,7 +133,7 @@ class SecurityClass { foreach ($applies as $apply) { $functionId = $apply->getAttribute('FunctionId'); if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { - $newAttributeValue=$doc->createElement('AttributeValue', $user->name); + $newAttributeValue = $doc->createElement('AttributeValue', $user->name); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); $apply->appendChild($newAttributeValue); @@ -145,7 +146,7 @@ class SecurityClass { return $doc; //NULL; //$xml; } - /** + /** * Add a list of allowed users and roles to the given policy stream and return it. * * @param string $policy_stream @@ -170,7 +171,7 @@ class SecurityClass { if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { foreach ($allowed_roles as $role) { if (!($role == 'authenticated user' || $role == 'administrator')) { //don't want authenticated user included administrator already is included' - $newAttributeValue=$dom->createElement('AttributeValue', $role); + $newAttributeValue = $dom->createElement('AttributeValue', $role); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); $apply->appendChild($newAttributeValue); @@ -186,8 +187,8 @@ class SecurityClass { foreach ($applies as $apply) { $functionId = $apply->getAttribute('FunctionId'); if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { - foreach ( $allowed_users as $username ) { - $newAttributeValue=$dom->createElement('AttributeValue', $username ); + foreach ($allowed_users as $username) { + $newAttributeValue = $dom->createElement('AttributeValue', $username); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); $apply->appendChild($newAttributeValue); @@ -200,4 +201,5 @@ class SecurityClass { // $this->collection_policy_stream = $dom->saveXML(); return $dom->saveXML(); } + } diff --git a/XMLDatastream.inc b/XMLDatastream.inc index f5efa4d2..c012be8a 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -1,6 +1,6 @@ pid = $pid; $this->dsid = $dsid; - if ($xmlStr !== NULL) { - if(is_object($xmlStr) && get_class($xmlStr) == DOMDocument) { + if ($xmlStr !== NULL) { + if (is_object($xmlStr) && get_class($xmlStr) == DOMDocument) { $this->xml = $xmlStr; } else { $this->xml = new DOMDocument(); $this->xml->loadXML($xmlStr); - } + } } } @@ -180,7 +180,8 @@ abstract class XMLDatastream { // a subclass. $vars = get_class_vars(get_class($this)); $schemaLocation = $vars['SCHEMA_URI']; - } elseif ($rootEl->attributes->getNamedItem('schemaLocation') !== NULL) { + } + elseif ($rootEl->attributes->getNamedItem('schemaLocation') !== NULL) { //figure out where the schema is located and validate. list(, $schemaLocation) = preg_split('/\s+/', $rootEl->attributes->getNamedItem('schemaLocation')->nodeValue); } @@ -193,10 +194,12 @@ abstract class XMLDatastream { foreach ($errors as $err) { self::$errors[] = 'XML Error: Line ' . $err->line . ': ' . $err->message; } - } else { + } + else { $this->name = $rootEl->attributes->getNamedItem('name')->nodeValue; } - } else { + } + else { $ret = FALSE; self::$errors[] = 'Unable to load schema.'; } diff --git a/api/dublin_core.inc b/api/dublin_core.inc index 04321677..1658b1f4 100644 --- a/api/dublin_core.inc +++ b/api/dublin_core.inc @@ -1,13 +1,15 @@ array(), 'dc:creator' => array(), @@ -45,21 +47,21 @@ class Dublin_Core { * @param $element_name * @param $value */ - function add_element( $element_name, $value ) { + function add_element($element_name, $value) { if (is_string($value) && is_array($this->dc[$element_name])) { $this->dc[$element_name][] = $value; } } -/** - * Replace the given DC element with the values in $values - * @param string $elemnt_name - * @param array $values - */ + /** + * Replace the given DC element with the values in $values + * @param string $elemnt_name + * @param array $values + */ function set_element($element_name, $values) { if (is_array($values)) { $this->dc[$element_name] = $values; - } + } elseif (is_string($values)) { $this->dc[$element_name] = array($values); } @@ -68,7 +70,7 @@ class Dublin_Core { /** * Serialize this object to XML and return it. */ - function as_xml( $with_preamble = FALSE ) { + function as_xml($with_preamble = FALSE) { $dc_xml = new DomDocument(); $oai_dc = $dc_xml->createElementNS('http://www.openarchives.org/OAI/2.0/oai_dc/', 'oai_dc:dc'); $oai_dc->setAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); @@ -78,7 +80,7 @@ class Dublin_Core { $new_item = $dc_xml->createElement($dc_element, $value); $oai_dc->appendChild($new_item); } - } + } else { $new_item = $dc_xml->createElement($dc_element); $oai_dc->appendChild($new_item); @@ -114,7 +116,7 @@ class Dublin_Core { array_push($new_dc->dc[$child->nodeName], $child->nodeValue); } return $new_dc; - } + } else { return NULL; } diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index 3db41018..f2333c3f 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -1,7 +1,8 @@ $format */ -function export_collection($collection_pid, $relationship = 'isMemberOfCollection', $format = 'info:fedora/fedora-system:FOXML-1.1' ) { +function export_collection($collection_pid, $relationship = 'isMemberOfCollection', $format = 'info:fedora/fedora-system:FOXML-1.1') { $collection_item = new Fedora_Item($collection_pid); $foxml = $collection_item->export_as_foxml(); $file_dir = file_directory_path(); - + // Create a temporary directory to contain the exported FOXML files. $container = tempnam($file_dir, 'export_'); file_delete($container); print $container; - if (mkdir($container) && mkdir($container . '/'. $collection_pid)) { - $foxml_dir = $container . '/'. $collection_pid; - $file = fopen($foxml_dir . '/'. $collection_pid . '.xml', 'w'); + if (mkdir($container) && mkdir($container . '/' . $collection_pid)) { + $foxml_dir = $container . '/' . $collection_pid; + $file = fopen($foxml_dir . '/' . $collection_pid . '.xml', 'w'); fwrite($file, $foxml); fclose($file); - + $member_pids = get_related_items_as_array($collection_pid, $relationship); foreach ($member_pids as $member) { - $file = fopen($foxml_dir . '/'. $member . '.xml', 'w'); + $file = fopen($foxml_dir . '/' . $member . '.xml', 'w'); $item = new Fedora_Item($member); $item_foxml = $item->export_as_foxml(); fwrite($file, $item_foxml); @@ -41,16 +42,16 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio } if (system("cd $container;zip -r $collection_pid.zip $collection_pid/* >/dev/NULL") == 0) { header("Content-type: application/zip"); - header('Content-Disposition: attachment; filename="' . $collection_pid . '.zip'. '"'); - $fh = fopen($container . '/'. $collection_pid . '.zip', 'r'); - $the_data = fread($fh, filesize($container . '/'. $collection_pid . '.zip')); + header('Content-Disposition: attachment; filename="' . $collection_pid . '.zip' . '"'); + $fh = fopen($container . '/' . $collection_pid . '.zip', 'r'); + $the_data = fread($fh, filesize($container . '/' . $collection_pid . '.zip')); fclose($fh); echo $the_data; } - if (file_exists($container . '/'. $collection_pid)) { + if (file_exists($container . '/' . $collection_pid)) { system("rm -rf $container"); // I'm sorry. } - } + } else { drupal_set_message("Error creating temp directory for batch export.", 'error'); return FALSE; @@ -68,13 +69,13 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $collection_item = new Fedora_Item($collection_pid); - + global $user; if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return array(); } - + $query_string = 'select $object $title $content from <#ri> where ($object $title and $object $content @@ -82,36 +83,36 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb if (is_array($relationship)) { foreach ($relationship as $rel) { - $query_string .= '$object '; + $query_string .= '$object '; if (next($relationship)) { $query_string .= ' OR '; } } } elseif (is_string($relationship)) { - $query_string .= '$object '; + $query_string .= '$object '; } else { return ''; } $query_string .= ') '; - $query_string .= $active_objects_only ? 'and $object ' : ''; - + $query_string .= $active_objects_only ? 'and $object ' : ''; + if ($cmodel) { $query_string .= ' and $content '; } - + $query_string .= ') minus $content - order by '.$orderby; - + order by ' . $orderby; + $query_string = htmlentities(urlencode($query_string)); - + $content = ''; $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=". $query_string; + $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; $content .= do_curl($url); return $content; diff --git a/api/fedora_export.inc b/api/fedora_export.inc index d2b08baf..bfc1397b 100644 --- a/api/fedora_export.inc +++ b/api/fedora_export.inc @@ -1,6 +1,6 @@ get_datastreams_list_as_SimpleXML($pid)) { $log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error'); return FALSE; - } + } // Datastreams added as a result of the ingest process $ignore_dsids = array('QUERY'); @@ -38,7 +38,7 @@ function export_objects_for_pid($pid, $dir, &$log) { $paths = array(); foreach ($object->datastreamDef as $ds) { if (!in_array($ds->ID, $ignore_dsids)) { - $file = $dir .'/'. $ds->label .'.'. get_file_extension($ds->MIMEType); + $file = $dir . '/' . $ds->label . '.' . get_file_extension($ds->MIMEType); $paths[$ds->ID] = $file; //$content = $ob_helper->getDatastreamDissemination($pid, $ds->ID); @@ -49,7 +49,7 @@ function export_objects_for_pid($pid, $dir, &$log) { } fwrite($fp, $content); fclose($fp); - } + } else { $log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error'); } @@ -65,7 +65,7 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re $log[] = log_line(t("Failed to get foxml for %pid", array('%pid' => $pid)), 'error'); return FALSE; } - + $foxml = new DOMDocument(); $foxml->loadXML($object_xml); @@ -75,11 +75,11 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re if ($remove_islandora) { $xpath->registerNamespace('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); $descNode = $xpath->query("//rdf:RDF/rdf:Description")->item(0); - + if ($model = $descNode->getElementsByTagName('hasModel')->item(0)) { $descNode->removeChild($model); } - + if ($member = $descNode->getElementsByTagName('rel:isMemberOfCollection')->item(0)) { $descNode->removeChild($member); } @@ -90,26 +90,26 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re switch ($format) { case FOXML_10: case FOXML_11: - + $disallowed_groups = array('E', 'R'); - + // Update datastream uris $xpath->registerNamespace('foxml', 'info:fedora/fedora-system:def/foxml#'); foreach ($xpath->query("//foxml:datastream[@ID]") as $dsNode) { - + // Don't update datastreams having external uris if (in_array($dsNode->getAttribute('CONTROL_GROUP'), $disallowed_groups)) { continue; } $dsId = $dsNode->getAttribute('ID'); - + // Remove QUERY datastream if ($dsId == "QUERY") { $parentNode = $xpath->query('/foxml:digitalObject')->item(0); $parentNode->removeChild($dsNode); } - + foreach ($dsNode->getElementsByTagName('*') as $contentNode) { if ($str = $contentNode->getAttribute('REF')) { $contentNode->setAttribute('REF', url($paths[$dsId], array('absolute' => TRUE))); @@ -117,52 +117,52 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re } } break; - + case METS_10: case METS_11: // Update datastream uris $xpath->registerNamespace('METS', 'http://www.loc.gov/METS/'); foreach ($xpath->query('//METS:fileGrp[@ID="DATASTREAMS"]/METS:fileGrp') as $dsNode) { - + $dsId = $dsNode->getAttribute('ID'); - + // Remove QUERY datastream if ($dsId == "QUERY") { $parentNode = $xpath->query('//METS:fileGrp[@ID="DATASTREAMS"]')->item(0); $parentNode->removeChild($dsNode); } - + $xpath->registerNamespace('xlink', 'http://www.loc.gov/METS/'); foreach ($xpath->query('METS:file[@OWNERID!="E"][@OWNERID!="R"]/METS:FLocat[@xlink:href]', $dsNode) as $Floc) { $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => TRUE))); } -/* - foreach ($dsNode->getElementsByTagName('METS:file') as $contentNode) { + /* + foreach ($dsNode->getElementsByTagName('METS:file') as $contentNode) { // Don't update datastreams having external uris if (in_array($dsNode->getAttribute('OWNERID'), $disallowed_groups)) { - continue; + continue; } foreach ($xpath->('METS:FLocat[@xlink:href]', $contentNode) as $Floc) { - $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => true))); + $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => true))); } - `} -*/ + `} + */ } - + break; - + default: - $log[] = log_line(t("Unknown or invalid format: ". $format), 'error'); + $log[] = log_line(t("Unknown or invalid format: " . $format), 'error'); return FALSE; } } //if $remove_islandora - $file = $dir .'/'. $pid .'.xml'; + $file = $dir . '/' . $pid . '.xml'; if (!$foxml->save($file)) { $log[] = log_line(t("Failed to write datastream %dsid for pid %pid to %file", array('%dsid' => $ds->ID, '%pid' => $pid, '%file' => $file)), 'error'); return FALSE; - } + } else { $log[] = log_line(t("Exported %pid to %file", array('%pid' => $pid, '%file' => $file)), 'info'); } diff --git a/api/fedora_item.inc b/api/fedora_item.inc index aabe5d32..ef07e4de 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -1,6 +1,6 @@ objectProfile)); } - function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = null) { + function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { module_load_include('inc', 'fedora_repository', 'MimeClass'); if (empty($datastream_mimetype)) { // Get mime type from the file extension. @@ -76,7 +76,7 @@ class Fedora_Item { return $return_value; } - function add_datastream_from_url($datastream_url, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = null) { + function add_datastream_from_url($datastream_url, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { if (empty($datastream_label)) { $datastream_label = $datastream_id; } @@ -94,15 +94,14 @@ class Fedora_Item { 'dsState' => 'A', 'checksumType' => 'DISABLED', 'checksum' => 'none', - 'logMessage' => ($logMessage != null) ? $logMessage : 'Ingested object ' . $datastream_id + 'logMessage' => ($logMessage != NULL) ? $logMessage : 'Ingested object ' . $datastream_id ); - return $this->soap_call( 'addDataStream', $params ); - + return $this->soap_call('addDataStream', $params); } - function add_datastream_from_string($str, $datastream_id, $datastream_label = NULL, $datastream_mimetype = 'text/xml', $controlGroup = 'M', $logMessage = null) { + function add_datastream_from_string($str, $datastream_id, $datastream_label = NULL, $datastream_mimetype = 'text/xml', $controlGroup = 'M', $logMessage = NULL) { $dir = sys_get_temp_dir(); $tmpfilename = tempnam($dir, 'fedoratmp'); $tmpfile = fopen($tmpfilename, 'w'); @@ -265,7 +264,7 @@ class Fedora_Item { } $cursor += count($resultelements->resultList->objectFields); if (count($resultelements->resultList->objectFields) < $max_results - || count($resultelements->resultList->objectFields) == 0) { + || count($resultelements->resultList->objectFields) == 0) { $done = TRUE; } foreach ($resultelements->resultList->objectFields as $obj) { @@ -332,7 +331,7 @@ class Fedora_Item { return $ret; } - function get_dissemination($service_definition_pid, $method_name, $parameters = array(), $as_of_date_time = null) { + function get_dissemination($service_definition_pid, $method_name, $parameters = array(), $as_of_date_time = NULL) { $params = array( 'pid' => $this->pid, 'serviceDefinitionPid' => $service_definition_pid, @@ -512,7 +511,7 @@ class Fedora_Item { // Verify the array format and that it isn't empty. if (!empty($relationships)) { $relsextxml = '' - . ''; + . ''; foreach ($relationships as $rel) { if (empty($rel['subject']) || empty($rel['predicate']) || empty($rel['object']) || $rel['subject'] != 'info:fedora/' . $this->pid) { @@ -612,7 +611,7 @@ class Fedora_Item { closedir($dir_handle); } - function modify_object($label = '', $state = null, $ownerId = null, $logMessage = 'Modified by Islandora API', $quiet=TRUE) { + function modify_object($label = '', $state = NULL, $ownerId = NULL, $logMessage = 'Modified by Islandora API', $quiet=TRUE) { $params = array( 'pid' => $this->pid, diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index d80ee701..2ca9f6a4 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -1,35 +1,36 @@ uid == 0) { + if ((!isset($user)) || $user->uid == 0) { $fedora_user = 'anonymous'; $fedora_pass = 'anonymous'; } @@ -51,7 +52,7 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, "$fedora_user:$fedora_pass"); //curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); - if ($number_of_post_vars>0&&$post) { + if ($number_of_post_vars > 0 && $post) { curl_setopt($ch, CURLOPT_POST, $number_of_post_vars); curl_setopt($ch, CURLOPT_POSTFIELDS, "$post"); } @@ -67,26 +68,24 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post function fedora_available() { - $response = do_curl(variable_get('fedora_base_url', 'http://localhost:8080/fedora').'/describe'); + $response = do_curl(variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/describe'); return strstr($response, 'Repository Information HTML Presentation') !== FALSE; - } - /** * Returns a UTF-8-encoded transcripiton of the string given in $in_str. * @param string $in_str * @return string A UTF-8 encoded string. */ function fix_encoding($in_str) { - $cur_encoding = mb_detect_encoding($in_str) ; + $cur_encoding = mb_detect_encoding($in_str); if ($cur_encoding == "UTF-8" && mb_check_encoding($in_str, "UTF-8")) { return $in_str; } else { return utf8_encode($in_str); } -} +} function validPid($pid) { $valid = FALSE; @@ -113,16 +112,15 @@ function fixDsid($dsid) { $replace = ''; $new_dsid = preg_replace($find, $replace, $new_dsid); - if( strlen($new_dsid) > 63 ) + if (strlen($new_dsid) > 63) $new_dsid = substr($new_dsid, -63); - if( preg_match('/^[^a-zA-Z]/', $dsid ) ) + if (preg_match('/^[^a-zA-Z]/', $dsid)) $new_dsid = 'x' . $new_dsid; - if( strlen($new_dsid) == 0 ) + if (strlen($new_dsid) == 0) $new_dsid = 'item' . rand(1, 100); return $new_dsid; - } diff --git a/api/rels-ext.inc b/api/rels-ext.inc index 06aa4cd5..578a8760 100644 --- a/api/rels-ext.inc +++ b/api/rels-ext.inc @@ -1,7 +1,8 @@ get_datastream_dissemination('RELS-EXT'); - - } - - function modified() { - return !(empty(array_diff($this->relsExtArray, $this->originalRelsExtArray)) && - empty(array_diff($this->originalRelsExtArray, $this->relsExtArray))); - } - - /** - * Save the current state of the RELS-EXT array out to the repository item - * as a datastream. - */ - function save() { - - } + + // Instance variables + public $relsExtArray = array(); + private $originalRelsExtArray = array(); // Used to determine the result of modified() funciton. + + // Member functions + + /** + * Constructor that builds itself by retrieving the RELS-EXT stream from + * the repository for the given Fedora_Item. + * @param Fedora_Item $item + */ + function RelsExt($item) { + $relsextxml = $item->get_datastream_dissemination('RELS-EXT'); + } + + function modified() { + return!(empty(array_diff($this->relsExtArray, $this->originalRelsExtArray)) && + empty(array_diff($this->originalRelsExtArray, $this->relsExtArray))); + } + + /** + * Save the current state of the RELS-EXT array out to the repository item + * as a datastream. + */ + function save() { + + } + } diff --git a/api/tagging.inc b/api/tagging.inc index 4156d7d4..da66e4db 100644 --- a/api/tagging.inc +++ b/api/tagging.inc @@ -1,5 +1,6 @@ item->datastreams[$this->tagsDSID])? $this->item->get_datastream_dissemination($this->tagsDSID) : NULL; + $tagsxml = isset($this->item->datastreams[$this->tagsDSID]) ? $this->item->get_datastream_dissemination($this->tagsDSID) : NULL; if (empty($tagsxml)) { $this->tags = array(); return FALSE; @@ -59,11 +61,11 @@ class TagSet { else { $this->item->modify_datastream_by_value($tagdoc->saveXML(), $this->tagsDSID, 'Tags', 'text/xml', 'X'); } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message('There was an error saving the tags datastream: !e', array('!e' => $e), 'error'); return FALSE; } return TRUE; } + } diff --git a/collection_policies/COLLECTION-COLLECTION POLICY.xml b/collection_policies/COLLECTION-COLLECTION POLICY.xml index 5888fd35..4eaaf48b 100644 --- a/collection_policies/COLLECTION-COLLECTION POLICY.xml +++ b/collection_policies/COLLECTION-COLLECTION POLICY.xml @@ -1,21 +1,22 @@ + - - - - - 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 - - isMemberOfCollection + + + + + 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 + + isMemberOfCollection diff --git a/collection_policies/FLV-COLLECTION POLICY.xml b/collection_policies/FLV-COLLECTION POLICY.xml index e7ea27a8..e8037a2c 100644 --- a/collection_policies/FLV-COLLECTION POLICY.xml +++ b/collection_policies/FLV-COLLECTION POLICY.xml @@ -7,8 +7,8 @@ vre:contentmodel STANDARD_FLV - - + + dc.description @@ -63,5 +63,5 @@ fgs.DS.first.text Full Text - + \ No newline at end of file diff --git a/collection_policies/JPG-COLLECTION POLICY.xml b/collection_policies/JPG-COLLECTION POLICY.xml index e66cd198..1b80514c 100644 --- a/collection_policies/JPG-COLLECTION POLICY.xml +++ b/collection_policies/JPG-COLLECTION POLICY.xml @@ -1,22 +1,22 @@ - - - - - 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 + + + + + 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 diff --git a/collection_policies/PDF-COLLECTION POLICY.xml b/collection_policies/PDF-COLLECTION POLICY.xml index 3f86bf16..4821da06 100644 --- a/collection_policies/PDF-COLLECTION POLICY.xml +++ b/collection_policies/PDF-COLLECTION POLICY.xml @@ -1 +1,24 @@ - 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 isMemberOfCollection \ No newline at end of file + + + + + + + + + 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 + + isMemberOfCollection + \ No newline at end of file diff --git a/collection_policies/PERSONAL-COLLECTION-POLICY.xml b/collection_policies/PERSONAL-COLLECTION-POLICY.xml index be51e65b..9605c1d9 100644 --- a/collection_policies/PERSONAL-COLLECTION-POLICY.xml +++ b/collection_policies/PERSONAL-COLLECTION-POLICY.xml @@ -1,3 +1,4 @@ + @@ -11,7 +12,7 @@ vre:contentmodel STANDARD_PDF - + ir:image vre:contentmodel STANDARD_IMAGE diff --git a/collection_policies/RIRI COLLECTION POLICY.xml b/collection_policies/RIRI COLLECTION POLICY.xml index 8424f9e9..11f726af 100644 --- a/collection_policies/RIRI COLLECTION POLICY.xml +++ b/collection_policies/RIRI COLLECTION POLICY.xml @@ -63,5 +63,5 @@ fgs.DS.first.text Full Text - + diff --git a/collection_policies/book_collection_policy.xml b/collection_policies/book_collection_policy.xml index 4a6c4a0f..f17f1df9 100644 --- a/collection_policies/book_collection_policy.xml +++ b/collection_policies/book_collection_policy.xml @@ -1,69 +1,70 @@ + - - - islandora - ilives:bookCModel - ISLANDORACM - - + + + islandora + ilives:bookCModel + ISLANDORACM + + - isMemberOfCollection - + isMemberOfCollection + - 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.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 + + diff --git a/collection_policies/large_image_collection_policy.xml b/collection_policies/large_image_collection_policy.xml index 4f9793a6..8a158940 100644 --- a/collection_policies/large_image_collection_policy.xml +++ b/collection_policies/large_image_collection_policy.xml @@ -6,79 +6,79 @@ Purpose of the document follows. --> - - - islandora:slide - islandora:slideCModel - ISLANDORACM - - - islandora:map - islandora:mapCModel - ISLANDORACM - - - islandora:herb - islandora:herbCModel - ISLANDORACM - - + + + islandora:slide + islandora:slideCModel + ISLANDORACM + + + islandora:map + islandora:mapCModel + ISLANDORACM + + + islandora:herb + islandora:herbCModel + ISLANDORACM + + - isMemberOfCollection - - 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 - - + isMemberOfCollection + + 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 + + diff --git a/collection_policies/qt_collection_policy.xml b/collection_policies/qt_collection_policy.xml index 2f8df517..70ba7b49 100644 --- a/collection_policies/qt_collection_policy.xml +++ b/collection_policies/qt_collection_policy.xml @@ -1,35 +1,48 @@ - - - - - - -dc.title - -dc.creator - -dc.description - -dc.date - -dc.identifier - -dc.language - -dc.publisher - -dc.rights - -dc.subject - -dc.relation - -dcterms.temporal - -dcterms.spatial - - -isMemberOfCollection - + + + + + + +dc.title + + +dc.creator + + +dc.description + + +dc.date + + +dc.identifier + + +dc.language + + +dc.publisher + + +dc.rights + + +dc.subject + + +dc.relation + + +dcterms.temporal + + +dcterms.spatial + + + +isMemberOfCollection + + diff --git a/collection_policy.xsd b/collection_policy.xsd index 8822f103..d5ea6637 100644 --- a/collection_policy.xsd +++ b/collection_policy.xsd @@ -1,47 +1,48 @@ + - - + + Islandora Collection Policy Schema Islandora, Robertson Library, University of Prince Edward Island, 550 University Ave., Charlottetown, Prince Edward Island - - + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/collection_views/COLLECTION_VIEW.xml b/collection_views/COLLECTION_VIEW.xml index 7b30307d..4d7def0e 100644 --- a/collection_views/COLLECTION_VIEW.xml +++ b/collection_views/COLLECTION_VIEW.xml @@ -1,264 +1,264 @@ - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - - - - + - - - - - - - - - - - - - - - - - - - - - - - /fedora/repository/ - /-/ - - - - /fedora/repository/ - / - / - - - - - + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + + /fedora/repository/ + / + / + + + + + - - - /fedora/repository/ - /TN - - -
+ + + /fedora/repository/ + /TN + + +
- + - -
-- - - - /fedora/repository/ - /-/ - - + +
-- +
+ + /fedora/repository/ + /-/ + + DETAILS - -- -
- - - - - - -
- - -   - - - - - - - - - - + -- + + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + +
\ No newline at end of file diff --git a/collection_views/Coverflow_Collection_View.xsl b/collection_views/Coverflow_Collection_View.xsl index 1e67f79f..243ce893 100644 --- a/collection_views/Coverflow_Collection_View.xsl +++ b/collection_views/Coverflow_Collection_View.xsl @@ -1,59 +1,61 @@ + - - - - - - - - - - - - - - - - - + + + + + + + -
Testing YUI's CoverFlow version 0.1 (beta)
-
- - -
-
- + }; + + +
Testing YUI's CoverFlow version 0.1 (beta)
+
+ + +
+
+ diff --git a/collection_views/Coverflow_PRE_Collection_View.xsl b/collection_views/Coverflow_PRE_Collection_View.xsl index e9bae87d..091fbfe1 100644 --- a/collection_views/Coverflow_PRE_Collection_View.xsl +++ b/collection_views/Coverflow_PRE_Collection_View.xsl @@ -1,63 +1,65 @@ + - - - - - - - - - - - - - - - - - + + + + + + + -
Testing YUI's CoverFlow version 0.1 (beta)
-
- - -
-
- + }; + + +
Testing YUI's CoverFlow version 0.1 (beta)
+
+ + +
+
+ diff --git a/collection_views/FLV-COLLECTION VIEW(2).xml b/collection_views/FLV-COLLECTION VIEW(2).xml index e591de97..7eebe2f3 100644 --- a/collection_views/FLV-COLLECTION VIEW(2).xml +++ b/collection_views/FLV-COLLECTION VIEW(2).xml @@ -1,65 +1,96 @@ - - - - - - - - - - - - - - - - - -
-
+
+ -
-
- - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - - /fedora/repository//OBJ/ - - - - - - - /fedora/repository//-/ - - - /fedora/repository//TN - - - -
- - - /fedora/repository//-/ - - - + + + +
+ + + + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + + /fedora/repository/ + /OBJ/ + + + + + + + + /fedora/repository/ + /-/ + + + + + /fedora/repository/ + /TN + + + + + + +
+ + + /fedora/repository/ + /-/ + + + + - - - - - - -
- - -   - - - - - - - - - - + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/collection_views/REFWORKS-COLLECTION_VIEW.xml b/collection_views/REFWORKS-COLLECTION_VIEW.xml index 26d637e4..9a8eebdd 100644 --- a/collection_views/REFWORKS-COLLECTION_VIEW.xml +++ b/collection_views/REFWORKS-COLLECTION_VIEW.xml @@ -1,65 +1,96 @@ - - - - - - - - - - - - - - - - - -
-
+
+ -
-
- - - - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - - /fedora/repository//OBJ/ - - - - - + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + + /fedora/repository/ + /OBJ/ + + + + + + -
- - /fedora/repository//-/ - - - +
+ + + /fedora/repository/ + /-/ + + + + - - - - - - -
- - -   - - - - - - - - - - + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + +
\ No newline at end of file diff --git a/collection_views/SIMPLE-COLLECTION_VIEW.xml b/collection_views/SIMPLE-COLLECTION_VIEW.xml index a01e66e0..8f67e1c0 100644 --- a/collection_views/SIMPLE-COLLECTION_VIEW.xml +++ b/collection_views/SIMPLE-COLLECTION_VIEW.xml @@ -1,65 +1,96 @@ - - - - - - - - - - - - - - - - - -
-
+
+ -
-
- - - - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - - /fedora/repository//OBJ/ - - - - - - - - - - /fedora/repository//TN - - - -
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + + /fedora/repository/ + /OBJ/ + + + + + + + + + + + + + /fedora/repository/ + /TN + + + + + + +
-
- - /fedora/repository//-/ - - - +
+ + + /fedora/repository/ + /-/ + + + + - - - - - - -
- - -   - - - - - - - - - - + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/collection_views/SmileyStuff-COLLECTION_VIEW.xml b/collection_views/SmileyStuff-COLLECTION_VIEW.xml index 58e28287..5aa853bc 100644 --- a/collection_views/SmileyStuff-COLLECTION_VIEW.xml +++ b/collection_views/SmileyStuff-COLLECTION_VIEW.xml @@ -1,67 +1,69 @@ + - - - - - - + + + + + +
- -

- -
- - - -

-
+ +

+ +
+ + + +

+

- - - - - + + + +
-
- - - - /fedora/repository/ - - /FULL_SIZE - - - - - /fedora/repository/ - - /MEDIUM_SIZE - - -
+ + + + + - - - -
+
+ + + + /fedora/repository/ + + /FULL_SIZE + + + + + /fedora/repository/ + + /MEDIUM_SIZE + + +
( Full Size ) -
-
-
- - - - - /fedora/repository/ - /-/ - - - - -
- -
+
+
+
+ + + + + /fedora/repository/ + /-/ + + + + + +
+ +
-
+
diff --git a/collection_views/Video-COLLECTION_VIEW.xml b/collection_views/Video-COLLECTION_VIEW.xml index f52dea89..39f9fe52 100644 --- a/collection_views/Video-COLLECTION_VIEW.xml +++ b/collection_views/Video-COLLECTION_VIEW.xml @@ -1,64 +1,66 @@ + - - - - - - + + + + + +
- -

- -
- - - -

-
+ +

+ +
+ + + +

+

- - - - - - - - -
-
- - - - /fedora/repository/ - - - - - - /fedora/repository/ - - /THUMBNAIL - - - -
-
- - - - - /fedora/repository/ - /-/ - - - - -
- -
+ + + + + + + + +
+
+ + + + /fedora/repository/ + + + + + + /fedora/repository/ + + /THUMBNAIL + + + +
+
+ + + + + /fedora/repository/ + /-/ + + + + + +
+ +
-
+
diff --git a/collection_views/default-sparqltoHtml.xsl b/collection_views/default-sparqltoHtml.xsl index 2f88acb5..8701c66d 100644 --- a/collection_views/default-sparqltoHtml.xsl +++ b/collection_views/default-sparqltoHtml.xsl @@ -1,124 +1,189 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + +
-
+ + + /fedora/repository/ + /TN + + + + + + /fedora/repository/ + /-/ + + + + +
+ -
-
+ + + +
+ +
\ No newline at end of file diff --git a/collection_views/demo_image_collection_dc_record.xml b/collection_views/demo_image_collection_dc_record.xml index a0879d69..72433b60 100644 --- a/collection_views/demo_image_collection_dc_record.xml +++ b/collection_views/demo_image_collection_dc_record.xml @@ -1,7 +1,7 @@ - Demo Image Collection - islandora:demo_image_collection - Demo image collection + Demo Image Collection + islandora:demo_image_collection + Demo image collection diff --git a/collection_views/simple_list_view.xml b/collection_views/simple_list_view.xml index e8711651..37ada1d5 100644 --- a/collection_views/simple_list_view.xml +++ b/collection_views/simple_list_view.xml @@ -1,28 +1,30 @@ + - - - - + + + + - - + diff --git a/collection_views/standard_jpeg_collection_view.xml b/collection_views/standard_jpeg_collection_view.xml index 40a8c96a..4604b454 100644 --- a/collection_views/standard_jpeg_collection_view.xml +++ b/collection_views/standard_jpeg_collection_view.xml @@ -1,66 +1,68 @@ + - - - - - - -
- -

- -
- - - -

-
-
-
-
- - - - - + + + +
-
- - - - /fedora/repository/ - - /FULL_SIZE - - - - - /fedora/repository/ - - /MEDIUM_SIZE - - -
+ + + + + + +
+ +

+ +
+ + + +

+
+
+
+
+ + + + + - - - -
+
+ + + + /fedora/repository/ + + /FULL_SIZE + + + + + /fedora/repository/ + + /MEDIUM_SIZE + + +
( Full Size ) -
-
-
- - - - - /fedora/repository/ - /-/ - - - - -
- -
-
-
+
+
+
+ + + + + /fedora/repository/ + /-/ + + + + + +
+ +
+
+
diff --git a/collection_views/yui_coverflow/css/test.css b/collection_views/yui_coverflow/css/test.css index c6f215a7..0442d49e 100644 --- a/collection_views/yui_coverflow/css/test.css +++ b/collection_views/yui_coverflow/css/test.css @@ -1,18 +1,18 @@ body { - font-family: Arial; - font-size: 12px; - color: gray; - background: black; + font-family: Arial; + font-size: 12px; + color: gray; + background: black; } .title { - font-size: 18px; - font-weight: bold; + font-size: 18px; + font-weight: bold; } #coverFlowTest .coverFlowLabel { - margin-top: 10px; - font-size: 14px; - color: #C0C0C0; - font-weight: bold; + margin-top: 10px; + font-size: 14px; + color: #C0C0C0; + font-weight: bold; } \ No newline at end of file diff --git a/collection_views/yui_coverflow/js/CoverFlow.js b/collection_views/yui_coverflow/js/CoverFlow.js index 3b041592..4a521745 100644 --- a/collection_views/yui_coverflow/js/CoverFlow.js +++ b/collection_views/yui_coverflow/js/CoverFlow.js @@ -19,7 +19,7 @@ YAHOO.namespace("ext"); //(function(){ - /** +/** * @class CoverFlow * @namespace YAHOO.ext * @constructor @@ -31,906 +31,966 @@ YAHOO.namespace("ext"); * config.bgColor {String} Background color. Could be in the form #00000 or black. Optional. Default: CoverFlow.DEFAULT_BG_COLOR. * */ - YAHOO.ext.CoverFlow = function(el, userConfig){ - if(el) - this.init(el, userConfig || {}); - }; +YAHOO.ext.CoverFlow = function(el, userConfig){ + if(el) + this.init(el, userConfig || {}); +}; - //shortcuts - var CoverFlow = YAHOO.ext.CoverFlow; - var Dom = YAHOO.util.Dom; +//shortcuts +var CoverFlow = YAHOO.ext.CoverFlow; +var Dom = YAHOO.util.Dom; - /** +/** * Defaults */ - CoverFlow.DEFAULT_HEIGHT = 300; - CoverFlow.DEFAULT_WIDTH = 800; - CoverFlow.DEFAULT_BG_COLOR = '#000000'; - CoverFlow.IMAGE_SEPARATION = 50; - CoverFlow.RIGHT = 'right'; - CoverFlow.LEFT = 'left'; - CoverFlow.LABEL_CLASS = 'coverFlowLabel'; +CoverFlow.DEFAULT_HEIGHT = 300; +CoverFlow.DEFAULT_WIDTH = 800; +CoverFlow.DEFAULT_BG_COLOR = '#000000'; +CoverFlow.IMAGE_SEPARATION = 50; +CoverFlow.RIGHT = 'right'; +CoverFlow.LEFT = 'left'; +CoverFlow.LABEL_CLASS = 'coverFlowLabel'; - CoverFlow.prototype = { - //Images array (it's a sort of transient var) - images: [], - //Items array {CoverFlowItem[]} - coverFlowItems: [], +CoverFlow.prototype = { + //Images array (it's a sort of transient var) + images: [], + //Items array {CoverFlowItem[]} + coverFlowItems: [], - remainingImages: 9999, + remainingImages: 9999, - element: null, - labelElement: null, - containerHeight: 0, - containerWidth: 0, + element: null, + labelElement: null, + containerHeight: 0, + containerWidth: 0, - imageHeightRatio: 0.6, - imageWidthRatio: 0.2, - reflectionRatio: 0.6, // this causes: imageTotalHeightRatio = imageHeightRatio + imageHeightRatio*reflectionRatio - topRatio: 0.1, - sideRatio: 0.4, + imageHeightRatio: 0.6, + imageWidthRatio: 0.2, + reflectionRatio: 0.6, // this causes: imageTotalHeightRatio = imageHeightRatio + imageHeightRatio*reflectionRatio + topRatio: 0.1, + sideRatio: 0.4, - perspectiveAngle: 20, - imageZIndex: 1000, - selectedImageZIndex: 9999, - selectedItem: 0, + perspectiveAngle: 20, + imageZIndex: 1000, + selectedImageZIndex: 9999, + selectedItem: 0, - moveQueue: [], - animationWorking: false, + moveQueue: [], + animationWorking: false, - init: function(el, userConfig){ + init: function(el, userConfig){ - this.element = Dom.get(el); - this.applyConfig(userConfig); + this.element = Dom.get(el); + this.applyConfig(userConfig); - if(userConfig.images) - this.addImages(userConfig.images); + if(userConfig.images) + this.addImages(userConfig.images); - this.attachEventListeners(); - this.createLabelElement(); - }, - - applyConfig: function(config){ - this.containerHeight = config.height || CoverFlow.DEFAULT_HEIGHT; - this.containerWidth = config.width || CoverFlow.DEFAULT_WIDTH; - this.backgroundColor = config.bgColor || CoverFlow.DEFAULT_BG_COLOR; + this.attachEventListeners(); + this.createLabelElement(); + }, + + applyConfig: function(config){ + this.containerHeight = config.height || CoverFlow.DEFAULT_HEIGHT; + this.containerWidth = config.width || CoverFlow.DEFAULT_WIDTH; + this.backgroundColor = config.bgColor || CoverFlow.DEFAULT_BG_COLOR; - this.element.style.position = 'relative'; - this.element.style.height = this.containerHeight + 'px'; - this.element.style.width = this.containerWidth + 'px'; - this.element.style.background = this.backgroundColor; - this.element.style.overflow = 'hidden'; - }, - - addImages: function(images){ - this.images = []; - this.remainingImages = images.length; + this.element.style.position = 'relative'; + this.element.style.height = this.containerHeight + 'px'; + this.element.style.width = this.containerWidth + 'px'; + this.element.style.background = this.backgroundColor; + this.element.style.overflow = 'hidden'; + }, + + addImages: function(images){ + this.images = []; + this.remainingImages = images.length; - for(var i=0; i < images.length; i++){ - var img = images[i]; - var image = new Image(); - image.id = Dom.generateId(); - image.index = i; - image.onclick = img.onclick; - image.label = img.label; + for(var i=0; i < images.length; i++){ + var img = images[i]; + var image = new Image(); + image.id = Dom.generateId(); + image.index = i; + image.onclick = img.onclick; + image.label = img.label; - //hide images - image.style.visibility = 'hidden'; - image.style.display = 'none'; - //this is to maintain image order since image.onload will be called randomly - this.element.appendChild(image); - //a shortcut to not create another context to call onload - var me = this; -// image.onload = function(){ -// CoverFlow.preloadImage(me, this); // this = image -// }; - YAHOO.util.Event.on(image, 'load', this.preloadImage, image, this); - image.src = img.src; + //hide images + image.style.visibility = 'hidden'; + image.style.display = 'none'; + //this is to maintain image order since image.onload will be called randomly + this.element.appendChild(image); + //a shortcut to not create another context to call onload + var me = this; + // image.onload = function(){ + // CoverFlow.preloadImage(me, this); // this = image + // }; + YAHOO.util.Event.on(image, 'load', this.preloadImage, image, this); + image.src = img.src; - }; + }; - }, + }, - /** + /** * @function preloadImage * @param event * @param image * @return void */ - preloadImage : function(e, image){ - this.images.push(image); - this.checkAllImagesLoaded(); - }, - - checkAllImagesLoaded: function(){ - this.remainingImages--; - if(!this.remainingImages){ - this.setup(); - } - }, - - setup: function(){ - this.createCoverFlowItems(); - this.sortCoverFlowItems(); - this.initCoverFlow(); - }, - - initCoverFlow: function(){ + preloadImage : function(e, image){ + this.images.push(image); + this.checkAllImagesLoaded(); + }, + + checkAllImagesLoaded: function(){ + this.remainingImages--; + if(!this.remainingImages){ + this.setup(); + } + }, + + setup: function(){ + this.createCoverFlowItems(); + this.sortCoverFlowItems(); + this.initCoverFlow(); + }, + + initCoverFlow: function(){ - for(var i=0; i < this.coverFlowItems.length; i++){ - var coverFlowItem = this.coverFlowItems[i]; + for(var i=0; i < this.coverFlowItems.length; i++){ + var coverFlowItem = this.coverFlowItems[i]; - var angle = 0; - var direction; + var angle = 0; + var direction; - if(i==0){ - coverFlowItem.setZIndex(this.selectedImageZIndex); - coverFlowItem.setLeft(this.getCenter() - coverFlowItem.element.width/2); - coverFlowItem.isSelected(true); - this.selectedItem = 0; - this.showLabel(coverFlowItem.getLabel()); - }else{ - angle = this.perspectiveAngle; - direction = CoverFlow.LEFT; - coverFlowItem.setZIndex(this.imageZIndex - i); - coverFlowItem.setLeft( this.getRightStart()+ (i - 1)* CoverFlow.IMAGE_SEPARATION); - coverFlowItem.isSelected(false); - } - coverFlowItem.setAngle(angle); - coverFlowItem.drawInPerspective(direction); - } - }, - - createLabelElement: function(){ - var label = document.createElement('div'); - label.id = Dom.generateId(); - label.style.position = 'absolute'; - label.style.top = this.getFooterOffset() + 'px'; - label.innerHTML = ' '; - label.style.textAlign = 'center'; - label.style.width = this.containerWidth + 'px'; - label.style.zIndex = this.selectedImageZIndex + 10; - label.className = CoverFlow.LABEL_CLASS; - this.labelElement = this.element.appendChild(label); - }, - - showLabel: function(text){ - if(text) - this.labelElement.innerHTML = text; - else - this.labelElement.innerHTML = ''; - }, - - attachEventListeners: function(){ - new YAHOO.util.KeyListener(this.element, { keys:39 }, - { fn:this.selectNext, - scope:this, - correctScope:true } ).enable(); + if(i==0){ + coverFlowItem.setZIndex(this.selectedImageZIndex); + coverFlowItem.setLeft(this.getCenter() - coverFlowItem.element.width/2); + coverFlowItem.isSelected(true); + this.selectedItem = 0; + this.showLabel(coverFlowItem.getLabel()); + }else{ + angle = this.perspectiveAngle; + direction = CoverFlow.LEFT; + coverFlowItem.setZIndex(this.imageZIndex - i); + coverFlowItem.setLeft( this.getRightStart()+ (i - 1)* CoverFlow.IMAGE_SEPARATION); + coverFlowItem.isSelected(false); + } + coverFlowItem.setAngle(angle); + coverFlowItem.drawInPerspective(direction); + } + }, + + createLabelElement: function(){ + var label = document.createElement('div'); + label.id = Dom.generateId(); + label.style.position = 'absolute'; + label.style.top = this.getFooterOffset() + 'px'; + label.innerHTML = ' '; + label.style.textAlign = 'center'; + label.style.width = this.containerWidth + 'px'; + label.style.zIndex = this.selectedImageZIndex + 10; + label.className = CoverFlow.LABEL_CLASS; + this.labelElement = this.element.appendChild(label); + }, + + showLabel: function(text){ + if(text) + this.labelElement.innerHTML = text; + else + this.labelElement.innerHTML = ''; + }, + + attachEventListeners: function(){ + new YAHOO.util.KeyListener(this.element, { + keys:39 + }, +{ + fn:this.selectNext, + scope:this, + correctScope:true + } ).enable(); - new YAHOO.util.KeyListener(this.element, { keys:37 }, - { fn:this.selectPrevious, - scope:this, - correctScope:true } ).enable(); + new YAHOO.util.KeyListener(this.element, { + keys:37 + }, +{ + fn:this.selectPrevious, + scope:this, + correctScope:true + } ).enable(); - }, - - select: function(e,coverFlowItem){ - var distance = this.selectedItem - coverFlowItem.index; - if(distance < 0){ - for(var i=0; i < -distance; i++) - this.selectNext(); - }else{ - for(var i=0; i < distance; i++) - this.selectPrevious(); - } - }, - - - selectNext: function(){ - if(this.animationWorking){ - this.moveQueue.push('moveLeft'); - return; - } + }, + + select: function(e,coverFlowItem){ + var distance = this.selectedItem - coverFlowItem.index; + if(distance < 0){ + for(var i=0; i < -distance; i++) + this.selectNext(); + }else{ + for(var i=0; i < distance; i++) + this.selectPrevious(); + } + }, + + + selectNext: function(){ + if(this.animationWorking){ + this.moveQueue.push('moveLeft'); + return; + } - var animateItems = []; + var animateItems = []; - for(var i=0; i < this.coverFlowItems.length; i++){ - var coverFlowItem = this.coverFlowItems[i]; - var isLast = (this.selectedItem == this.coverFlowItems.length -1); - if(!isLast){ - var distance = i-this.selectedItem; + for(var i=0; i < this.coverFlowItems.length; i++){ + var coverFlowItem = this.coverFlowItems[i]; + var isLast = (this.selectedItem == this.coverFlowItems.length -1); + if(!isLast){ + var distance = i-this.selectedItem; - if(distance == 0){// selected - coverFlowItem.setZIndex(this.imageZIndex); - coverFlowItem.isSelected(false); - animateItems.push({item: coverFlowItem, attribute:{angle: {start: 0, end: this.perspectiveAngle} } }); + if(distance == 0){// selected + coverFlowItem.setZIndex(this.imageZIndex); + coverFlowItem.isSelected(false); + animateItems.push({ + item: coverFlowItem, + attribute:{ + angle: { + start: 0, + end: this.perspectiveAngle + } + } + }); - coverFlowItem = this.coverFlowItems[++i]; - coverFlowItem.isSelected(true); - this.showLabel(coverFlowItem.getLabel()); - animateItems.push({item: coverFlowItem, attribute:{angle: {start: this.perspectiveAngle, end: 0} } }); + coverFlowItem = this.coverFlowItems[++i]; + coverFlowItem.isSelected(true); + this.showLabel(coverFlowItem.getLabel()); + animateItems.push({ + item: coverFlowItem, + attribute:{ + angle: { + start: this.perspectiveAngle, + end: 0 + } + } + }); - }else{ - animateItems.push({item: coverFlowItem, attribute: {left: {start:coverFlowItem.getLeft(), end: coverFlowItem.getLeft() - CoverFlow.IMAGE_SEPARATION} }}); - } - } - } + }else{ + animateItems.push({ + item: coverFlowItem, + attribute: { + left: { + start:coverFlowItem.getLeft(), + end: coverFlowItem.getLeft() - CoverFlow.IMAGE_SEPARATION + } + } + }); +} +} +} - var animation = new CoverFlowAnimation({ - direction: CoverFlow.LEFT, - center: this.getCenter(), - startLeftPos: this.getLeftStart(), - startRightPos: this.getRightStart() - }, - animateItems, 0.5); +var animation = new CoverFlowAnimation({ + direction: CoverFlow.LEFT, + center: this.getCenter(), + startLeftPos: this.getLeftStart(), + startRightPos: this.getRightStart() +}, +animateItems, 0.5); - animation.onStart.subscribe(this.handleAnimationWorking, this); - animation.onComplete.subscribe(this.handleQueuedMove, this); +animation.onStart.subscribe(this.handleAnimationWorking, this); +animation.onComplete.subscribe(this.handleQueuedMove, this); - animation.animate(); +animation.animate(); - if(this.selectedItem + 1 < this.coverFlowItems.length) - this.selectedItem++; - }, +if(this.selectedItem + 1 < this.coverFlowItems.length) + this.selectedItem++; +}, - selectPrevious: function(){ - if(this.animationWorking){ - this.moveQueue.push('moveRight'); - return; - } +selectPrevious: function(){ + if(this.animationWorking){ + this.moveQueue.push('moveRight'); + return; + } - var animateItems = []; + var animateItems = []; - for(var i=0; i < this.coverFlowItems.length; i++){ - var coverFlowItem = this.coverFlowItems[i]; - var isFirst = (this.selectedItem == 0); - var distance = i-this.selectedItem; - if(!isFirst){ - if(distance == - 1){ - coverFlowItem.setZIndex(this.selectedImageZIndex); - coverFlowItem.isSelected(true); - this.showLabel(coverFlowItem.getLabel()); - animateItems.push({item: coverFlowItem, attribute: {angle: {start: this.perspectiveAngle, end: 0}}}); + for(var i=0; i < this.coverFlowItems.length; i++){ + var coverFlowItem = this.coverFlowItems[i]; + var isFirst = (this.selectedItem == 0); + var distance = i-this.selectedItem; + if(!isFirst){ + if(distance == - 1){ + coverFlowItem.setZIndex(this.selectedImageZIndex); + coverFlowItem.isSelected(true); + this.showLabel(coverFlowItem.getLabel()); + animateItems.push({ + item: coverFlowItem, + attribute: { + angle: { + start: this.perspectiveAngle, + end: 0 + } + } + }); - coverFlowItem = this.coverFlowItems[++i]; - coverFlowItem.isSelected(false); - coverFlowItem.setZIndex(this.imageZIndex); - animateItems.push({item: coverFlowItem, attribute: {angle: {start: 0, end: this.perspectiveAngle}}}); - }else{ - coverFlowItem.setZIndex(coverFlowItem.getZIndex() - 1); - animateItems.push({item: coverFlowItem, attribute: {left: {start:coverFlowItem.getLeft(), end: coverFlowItem.getLeft() + CoverFlow.IMAGE_SEPARATION} }}); - } - } - } - var animation = new CoverFlowAnimation({ - direction: CoverFlow.RIGHT, - center: this.getCenter(), - startLeftPos: this.getLeftStart(), - startRightPos: this.getRightStart() - }, - animateItems, 0.5); + coverFlowItem = this.coverFlowItems[++i]; + coverFlowItem.isSelected(false); + coverFlowItem.setZIndex(this.imageZIndex); + animateItems.push({ + item: coverFlowItem, + attribute: { + angle: { + start: 0, + end: this.perspectiveAngle + } + } + }); +}else{ + coverFlowItem.setZIndex(coverFlowItem.getZIndex() - 1); + animateItems.push({ + item: coverFlowItem, + attribute: { + left: { + start:coverFlowItem.getLeft(), + end: coverFlowItem.getLeft() + CoverFlow.IMAGE_SEPARATION + } + } + }); +} +} +} +var animation = new CoverFlowAnimation({ + direction: CoverFlow.RIGHT, + center: this.getCenter(), + startLeftPos: this.getLeftStart(), + startRightPos: this.getRightStart() +}, +animateItems, 0.5); - animation.onStart.subscribe(this.handleAnimationWorking, this); - animation.onComplete.subscribe(this.handleQueuedMove, this); +animation.onStart.subscribe(this.handleAnimationWorking, this); +animation.onComplete.subscribe(this.handleQueuedMove, this); - animation.animate(); +animation.animate(); - if(this.selectedItem > 0) - this.selectedItem--; - }, +if(this.selectedItem > 0) + this.selectedItem--; +}, - handleAnimationWorking: function(a, b, cf){ - cf.animationWorking = true; - }, +handleAnimationWorking: function(a, b, cf){ + cf.animationWorking = true; +}, - handleQueuedMove: function(msg, data, cf){ - cf.animationWorking = false; +handleQueuedMove: function(msg, data, cf){ + cf.animationWorking = false; - var next = cf.moveQueue.pop(); - if(next == 'moveLeft') - cf.selectNext(); - if(next == 'moveRight') - cf.selectPrevious(); - }, - - getCenter: function(){ - return this.containerWidth / 2; - }, - - getRightStart: function() { - return this.containerWidth - this.sideRatio * this.containerWidth; - }, - - getLeftStart: function() { - return this.sideRatio * this.containerWidth; - }, - - sortCoverFlowItems: function(){ - function sortFunction(aCoverFlowItem, bCoverFlowItem){ - return aCoverFlowItem.index - bCoverFlowItem.index; - } + var next = cf.moveQueue.pop(); + if(next == 'moveLeft') + cf.selectNext(); + if(next == 'moveRight') + cf.selectPrevious(); +}, + +getCenter: function(){ + return this.containerWidth / 2; +}, + +getRightStart: function() { + return this.containerWidth - this.sideRatio * this.containerWidth; +}, + +getLeftStart: function() { + return this.sideRatio * this.containerWidth; +}, + +sortCoverFlowItems: function(){ + function sortFunction(aCoverFlowItem, bCoverFlowItem){ + return aCoverFlowItem.index - bCoverFlowItem.index; + } - this.coverFlowItems.sort(sortFunction); - }, - - createCoverFlowItems: function(){ - this.coverFlowItems = []; - for(var i=0; i this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ - height = ((image.height / this.getMaxImageHeight())) * image.height; - } - if(image.height <= this.getMaxImageHeight() && image.width > this.getMaxImageWidth()){ - height = ((image.width / this.getMaxImageWidth())) * image.height; - } - if(image.height > this.getMaxImageHeight() && image.width > this.getMaxImageWidth()){ - if(image.height > image.width) - height = ((this.getMaxImageHeight() / image.height)) * image.height; - else - height = ((this.getMaxImageWidth() / image.width)) * image.height; - } - return height; - }, +}, + +scaleHeight: function(image){ + var height = 0; + if(image.height <= this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ + height = image.height; + } + if(image.height > this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ + height = ((image.height / this.getMaxImageHeight())) * image.height; + } + if(image.height <= this.getMaxImageHeight() && image.width > this.getMaxImageWidth()){ + height = ((image.width / this.getMaxImageWidth())) * image.height; + } + if(image.height > this.getMaxImageHeight() && image.width > this.getMaxImageWidth()){ + if(image.height > image.width) + height = ((this.getMaxImageHeight() / image.height)) * image.height; + else + height = ((this.getMaxImageWidth() / image.width)) * image.height; + } + return height; +}, - scaleWidth: function(image){ - var width = 0; - if(image.height <= this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ - width = image.width; - } - if(image.height > this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ - width = ((image.height / this.getMaxImageHeight())) * image.width; - } - if(image.height <= this.getMaxImageHeight() && image.width > this.getMaxImageWidth()){ - width = ((image.width / this.getMaxImageWidth())) * image.width; - } - if(image.height > this.getMaxImageHeight() && image.width > this.getMaxImageWidth()){ - if(image.height > image.width) - width = ((this.getMaxImageHeight() / image.height)) * image.width; - else - width = ((this.getMaxImageWidth() / image.width)) * image.width; - } - return width; - }, - - - getMaxImageHeight: function(){ - return (this.containerHeight * this.imageHeightRatio); - }, - - getMaxImageWidth: function(){ - return (this.containerWidth * this.imageWidthRatio); - }, - - getTopOffset: function(){ - return this.containerHeight * this.topRatio; - }, - - getFooterOffset: function(){ - return this.containerHeight * (this.topRatio + this.imageHeightRatio); - } - }; +scaleWidth: function(image){ + var width = 0; + if(image.height <= this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ + width = image.width; + } + if(image.height > this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ + width = ((image.height / this.getMaxImageHeight())) * image.width; + } + if(image.height <= this.getMaxImageHeight() && image.width > this.getMaxImageWidth()){ + width = ((image.width / this.getMaxImageWidth())) * image.width; + } + if(image.height > this.getMaxImageHeight() && image.width > this.getMaxImageWidth()){ + if(image.height > image.width) + width = ((this.getMaxImageHeight() / image.height)) * image.width; + else + width = ((this.getMaxImageWidth() / image.width)) * image.width; + } + return width; +}, + + +getMaxImageHeight: function(){ + return (this.containerHeight * this.imageHeightRatio); +}, + +getMaxImageWidth: function(){ + return (this.containerWidth * this.imageWidthRatio); +}, + +getTopOffset: function(){ + return this.containerHeight * this.topRatio; +}, + +getFooterOffset: function(){ + return this.containerHeight * (this.topRatio + this.imageHeightRatio); +} +}; - /** +/** * @class CoverFlowItem * */ - CoverFlowItem = function(image, config){ - if(image) - this.init(image, config); - }; +CoverFlowItem = function(image, config){ + if(image) + this.init(image, config); +}; - CoverFlowItem.prototype = { - canvas: null, - element: null, - index: null, - id: null, - angle: 0, - selected: false, - onclickFn: null, - selectedOnclickFn: null, - label: null, - - onSelected: null, - - init: function(image, config){ - var scaledWidth = config.scaledWidth; - var scaledHeight = config.scaledHeight; - var reflectionRatio = config.reflectionRatio; - var bgColor = config.bgColor; +CoverFlowItem.prototype = { + canvas: null, + element: null, + index: null, + id: null, + angle: 0, + selected: false, + onclickFn: null, + selectedOnclickFn: null, + label: null, + + onSelected: null, + + init: function(image, config){ + var scaledWidth = config.scaledWidth; + var scaledHeight = config.scaledHeight; + var reflectionRatio = config.reflectionRatio; + var bgColor = config.bgColor; - this.id = image.id; - this.index = image.index; - this.onclickFn = config.onclick; - this.selectedOnclickFn = image.onclick; - this.label = image.label; - var parent = image.parentNode; - this.canvas = this.createImageCanvas(image,scaledWidth,scaledHeight,reflectionRatio, bgColor); - this.element = this.canvas.cloneNode(false); - this.element.id = this.id; - parent.replaceChild(this.element, image); + this.id = image.id; + this.index = image.index; + this.onclickFn = config.onclick; + this.selectedOnclickFn = image.onclick; + this.label = image.label; + var parent = image.parentNode; + this.canvas = this.createImageCanvas(image,scaledWidth,scaledHeight,reflectionRatio, bgColor); + this.element = this.canvas.cloneNode(false); + this.element.id = this.id; + parent.replaceChild(this.element, image); - this.onSelected = new YAHOO.util.CustomEvent('onSelected', this); - this.onSelected.subscribe(this.handleOnclick); + this.onSelected = new YAHOO.util.CustomEvent('onSelected', this); + this.onSelected.subscribe(this.handleOnclick); - }, - - getLabel: function(){ - return this.label; - }, - - handleOnclick: function(){ - YAHOO.util.Event.removeListener(this.element, 'click'); - if(!this.selected){ - YAHOO.util.Event.addListener(this.element, 'click', this.onclickFn.fn, this, this.onclickFn.scope); - }else{ - if(this.selectedOnclickFn && this.selectedOnclickFn.fn) - YAHOO.util.Event.addListener(this.element, 'click', this.selectedOnclickFn.fn, this, this.selectedOnclickFn.scope); - else - YAHOO.util.Event.addListener(this.element, 'click', this.selectedOnclickFn); - } - }, - - isSelected: function(selected){ - this.selected = selected; - this.onSelected.fire(); - }, - - setAngle: function(angle){ - this.angle = angle; - }, - - getAngle: function(){ - return this.angle; - }, - - setTop: function(top){ - this.element.style.top = top + 'px'; - }, - - setLeft: function(left){ - this.element.style.left = left + 'px'; - }, - - getLeft: function(){ - var ret = this.element.style.left; - return new Number(ret.replace("px", "")); - }, - - getZIndex: function(){ - return this.element.style.zIndex; - }, - - setZIndex: function(zIndex){ - this.element.style.zIndex = zIndex; - }, - - createImageCanvas: function(image, sWidth, sHeight, reflectionRatio, bgColor){ + }, + + getLabel: function(){ + return this.label; + }, + + handleOnclick: function(){ + YAHOO.util.Event.removeListener(this.element, 'click'); + if(!this.selected){ + YAHOO.util.Event.addListener(this.element, 'click', this.onclickFn.fn, this, this.onclickFn.scope); + }else{ + if(this.selectedOnclickFn && this.selectedOnclickFn.fn) + YAHOO.util.Event.addListener(this.element, 'click', this.selectedOnclickFn.fn, this, this.selectedOnclickFn.scope); + else + YAHOO.util.Event.addListener(this.element, 'click', this.selectedOnclickFn); + } + }, + + isSelected: function(selected){ + this.selected = selected; + this.onSelected.fire(); + }, + + setAngle: function(angle){ + this.angle = angle; + }, + + getAngle: function(){ + return this.angle; + }, + + setTop: function(top){ + this.element.style.top = top + 'px'; + }, + + setLeft: function(left){ + this.element.style.left = left + 'px'; + }, + + getLeft: function(){ + var ret = this.element.style.left; + return new Number(ret.replace("px", "")); + }, + + getZIndex: function(){ + return this.element.style.zIndex; + }, + + setZIndex: function(zIndex){ + this.element.style.zIndex = zIndex; + }, + + createImageCanvas: function(image, sWidth, sHeight, reflectionRatio, bgColor){ - var imageCanvas = document.createElement('canvas'); + var imageCanvas = document.createElement('canvas'); - if(imageCanvas.getContext){ + if(imageCanvas.getContext){ - var scaledWidth = sWidth; - var scaledHeight = sHeight; - var reflectionHeight = scaledHeight * reflectionRatio; + var scaledWidth = sWidth; + var scaledHeight = sHeight; + var reflectionHeight = scaledHeight * reflectionRatio; - imageCanvas.height = scaledHeight + reflectionHeight; - imageCanvas.width = scaledWidth; + imageCanvas.height = scaledHeight + reflectionHeight; + imageCanvas.width = scaledWidth; - var ctx = imageCanvas.getContext('2d'); + var ctx = imageCanvas.getContext('2d'); - ctx.clearRect(0, 0, imageCanvas.width, imageCanvas.height); - ctx.globalCompositeOperation = 'source-over'; - ctx.fillStyle = 'rgba(0, 0, 0, 1)'; - ctx.fillRect(0, 0, imageCanvas.width, imageCanvas.height); + ctx.clearRect(0, 0, imageCanvas.width, imageCanvas.height); + ctx.globalCompositeOperation = 'source-over'; + ctx.fillStyle = 'rgba(0, 0, 0, 1)'; + ctx.fillRect(0, 0, imageCanvas.width, imageCanvas.height); - //draw the reflection image - ctx.save(); - ctx.translate(0, (2*scaledHeight)); - ctx.scale(1, -1); - ctx.drawImage(image, 0, 0, scaledWidth, scaledHeight); - ctx.restore(); - //create the gradient effect - ctx.save(); - ctx.translate(0, scaledHeight); - ctx.globalCompositeOperation = 'destination-out'; - var grad = ctx.createLinearGradient( 0, 0, 0, scaledHeight); - grad.addColorStop(1, 'rgba(0, 0, 0, 1)'); - grad.addColorStop(0, 'rgba(0, 0, 0, 0.75)'); - ctx.fillStyle = grad; - ctx.fillRect(0, 0, scaledWidth, scaledHeight); - //apply the background color to the gradient - ctx.globalCompositeOperation = 'destination-over'; - ctx.fillStyle = bgColor; '#000'; - ctx.globalAlpha = 0.8; - ctx.fillRect(0, 0 , scaledWidth, scaledHeight); - ctx.restore(); - //draw the image - ctx.save(); - ctx.translate(0, 0); - ctx.globalCompositeOperation = 'source-over'; - ctx.drawImage(image, 0, 0, scaledWidth, scaledHeight); - ctx.restore(); + //draw the reflection image + ctx.save(); + ctx.translate(0, (2*scaledHeight)); + ctx.scale(1, -1); + ctx.drawImage(image, 0, 0, scaledWidth, scaledHeight); + ctx.restore(); + //create the gradient effect + ctx.save(); + ctx.translate(0, scaledHeight); + ctx.globalCompositeOperation = 'destination-out'; + var grad = ctx.createLinearGradient( 0, 0, 0, scaledHeight); + grad.addColorStop(1, 'rgba(0, 0, 0, 1)'); + grad.addColorStop(0, 'rgba(0, 0, 0, 0.75)'); + ctx.fillStyle = grad; + ctx.fillRect(0, 0, scaledWidth, scaledHeight); + //apply the background color to the gradient + ctx.globalCompositeOperation = 'destination-over'; + ctx.fillStyle = bgColor; + '#000'; + ctx.globalAlpha = 0.8; + ctx.fillRect(0, 0 , scaledWidth, scaledHeight); + ctx.restore(); + //draw the image + ctx.save(); + ctx.translate(0, 0); + ctx.globalCompositeOperation = 'source-over'; + ctx.drawImage(image, 0, 0, scaledWidth, scaledHeight); + ctx.restore(); - return imageCanvas; - } - }, - - drawInPerspective: function(direction, frameSize){ - var canvas = this.element; - var image = this.canvas; - var angle = Math.ceil(this.angle); - var ctx; - var originalWidth = image.width; - var originalHeight = image.height; - var destinationWidth = destinationWidth || originalWidth; // for future use - var destinationHeight = destinationHeight || originalHeight; // for future use + return imageCanvas; + } + }, + + drawInPerspective: function(direction, frameSize){ + var canvas = this.element; + var image = this.canvas; + var angle = Math.ceil(this.angle); + var ctx; + var originalWidth = image.width; + var originalHeight = image.height; + var destinationWidth = destinationWidth || originalWidth; // for future use + var destinationHeight = destinationHeight || originalHeight; // for future use - var perspectiveCanvas = document.createElement('canvas'); - perspectiveCanvas.height = destinationHeight; - perspectiveCanvas.width = destinationWidth; - var perspectiveCtx = perspectiveCanvas.getContext('2d'); + var perspectiveCanvas = document.createElement('canvas'); + perspectiveCanvas.height = destinationHeight; + perspectiveCanvas.width = destinationWidth; + var perspectiveCtx = perspectiveCanvas.getContext('2d'); - var alpha = angle * Math.PI/180; // Math uses radian + var alpha = angle * Math.PI/180; // Math uses radian - if(alpha > 0){ // if we have an angle greater than 0 then apply the perspective - var right = (direction == CoverFlow.RIGHT); + if(alpha > 0){ // if we have an angle greater than 0 then apply the perspective + var right = (direction == CoverFlow.RIGHT); - var initialX=0, finalX=0, initialY=0, finalY=0; + var initialX=0, finalX=0, initialY=0, finalY=0; - frameSize = frameSize || 1; - var xDes, yDes; - var heightDes, widthDes; - var perspectiveWidht = destinationWidth; + frameSize = frameSize || 1; + var xDes, yDes; + var heightDes, widthDes; + var perspectiveWidht = destinationWidth; - var frameFactor = frameSize / originalWidth; - var frames = Math.floor(originalWidth / frameSize); + var frameFactor = frameSize / originalWidth; + var frames = Math.floor(originalWidth / frameSize); - var widthSrc = frameSize ; - var heightSrc = originalHeight; + var widthSrc = frameSize ; + var heightSrc = originalHeight; - for(var i=0; i < frames; i++){ - var xSrc = (i) * frameSize; - var ySrc = 0; - var betaTan = 0; - width = destinationWidth * (i) * frameFactor; - horizon = destinationHeight / 2; + for(var i=0; i < frames; i++){ + var xSrc = (i) * frameSize; + var ySrc = 0; + var betaTan = 0; + width = destinationWidth * (i) * frameFactor; + horizon = destinationHeight / 2; - if(right){ - betaTan = horizon/((Math.tan(alpha)*horizon) + width); - xDes = (betaTan*width)/(Math.tan(alpha) + betaTan); - yDes = Math.tan(alpha) * xDes; + if(right){ + betaTan = horizon/((Math.tan(alpha)*horizon) + width); + xDes = (betaTan*width)/(Math.tan(alpha) + betaTan); + yDes = Math.tan(alpha) * xDes; - if(i == frames -1){ - finalX=xDes; - finalY=yDes; - } - }else{ - betaTan = horizon/((Math.tan(alpha)*horizon) +(destinationWidth-width)); - xDes = (Math.tan(alpha)*(destinationWidth) + (betaTan * width))/(Math.tan(alpha) + betaTan); - yDes = -Math.tan(alpha)*xDes + (Math.tan(alpha)*(destinationWidth)); + if(i == frames -1){ + finalX=xDes; + finalY=yDes; + } + }else{ + betaTan = horizon/((Math.tan(alpha)*horizon) +(destinationWidth-width)); + xDes = (Math.tan(alpha)*(destinationWidth) + (betaTan * width))/(Math.tan(alpha) + betaTan); + yDes = -Math.tan(alpha)*xDes + (Math.tan(alpha)*(destinationWidth)); - if(i == 0){ - initialX = xDes; - initialY = yDes; - finalX = destinationWidth; - finalY = 0; - } - } + if(i == 0){ + initialX = xDes; + initialY = yDes; + finalX = destinationWidth; + finalY = 0; + } + } - heightDes = destinationHeight - (2*yDes); - widthDes = heightDes / destinationHeight * destinationWidth; + heightDes = destinationHeight - (2*yDes); + widthDes = heightDes / destinationHeight * destinationWidth; - perspectiveCtx.drawImage(image, xSrc, ySrc, widthSrc, heightSrc, xDes, yDes, widthDes, heightDes); + perspectiveCtx.drawImage(image, xSrc, ySrc, widthSrc, heightSrc, xDes, yDes, widthDes, heightDes); - } + } - perspectiveWidth = finalX - initialX; - originalCanvasWidth = destinationWidth; - canvas.width = perspectiveWidth; + perspectiveWidth = finalX - initialX; + originalCanvasWidth = destinationWidth; + canvas.width = perspectiveWidth; - ctx = canvas.getContext('2d'); + ctx = canvas.getContext('2d'); - //remove exceeded pixels - ctx.beginPath(); - if(right){ - ctx.moveTo(0, 0); - ctx.lineTo(finalX, finalY); - ctx.lineTo(finalX, finalY + (destinationHeight - 2*finalY)); - ctx.lineTo(0, destinationHeight); - ctx.lineTo(0,0); - }else{ - var initialX1 = initialX - (originalCanvasWidth - perspectiveWidth); - var finalX1 = finalX - (originalCanvasWidth - perspectiveWidth); - ctx.moveTo(0, initialY); - ctx.lineTo(finalX1, finalY); - ctx.lineTo(finalX1, destinationHeight); - ctx.lineTo(initialX1, initialY + (destinationHeight - 2*initialY)); - ctx.lineTo(0, initialY); - } - ctx.closePath(); - ctx.clip(); + //remove exceeded pixels + ctx.beginPath(); + if(right){ + ctx.moveTo(0, 0); + ctx.lineTo(finalX, finalY); + ctx.lineTo(finalX, finalY + (destinationHeight - 2*finalY)); + ctx.lineTo(0, destinationHeight); + ctx.lineTo(0,0); + }else{ + var initialX1 = initialX - (originalCanvasWidth - perspectiveWidth); + var finalX1 = finalX - (originalCanvasWidth - perspectiveWidth); + ctx.moveTo(0, initialY); + ctx.lineTo(finalX1, finalY); + ctx.lineTo(finalX1, destinationHeight); + ctx.lineTo(initialX1, initialY + (destinationHeight - 2*initialY)); + ctx.lineTo(0, initialY); + } + ctx.closePath(); + ctx.clip(); - ctx.drawImage(perspectiveCanvas, initialX, 0, perspectiveWidth, destinationHeight, 0, 0, perspectiveWidth, destinationHeight); + ctx.drawImage(perspectiveCanvas, initialX, 0, perspectiveWidth, destinationHeight, 0, 0, perspectiveWidth, destinationHeight); - }else{ + }else{ - canvas.width = perspectiveCanvas.width; - canvas.height = perspectiveCanvas.height; - perspectiveCtx.drawImage(image, 0, 0, originalWidth, originalHeight, 0, 0, destinationWidth, destinationHeight); - ctx = canvas.getContext('2d'); - ctx.clearRect(0, 0, canvas.width, canvas.height); - ctx.drawImage(perspectiveCanvas, 0, 0); - } - } - - }; + canvas.width = perspectiveCanvas.width; + canvas.height = perspectiveCanvas.height; + perspectiveCtx.drawImage(image, 0, 0, originalWidth, originalHeight, 0, 0, destinationWidth, destinationHeight); + ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.drawImage(perspectiveCanvas, 0, 0); + } + } + +}; - /** +/** * @class CoverFlowAnimation * @requires YAHOO.util.AnimMgr */ - CoverFlowAnimation = function(config, animationItems, duration){ - this.init(config, animationItems, duration); - }; +CoverFlowAnimation = function(config, animationItems, duration){ + this.init(config, animationItems, duration); +}; - CoverFlowAnimation.prototype = { - direction: null, +CoverFlowAnimation.prototype = { + direction: null, - center: null, + center: null, - startLeftPos: null, + startLeftPos: null, - startRightPos: null, + startRightPos: null, - animationItems: null, + animationItems: null, - method : YAHOO.util.Easing.easeNone, + method : YAHOO.util.Easing.easeNone, - animated: false, + animated: false, - startTime: null, + startTime: null, - actualFrames : 0, + actualFrames : 0, - useSeconds : true, // default to seconds + useSeconds : true, // default to seconds - currentFrame : 0, + currentFrame : 0, - totalFrames : YAHOO.util.AnimMgr.fps, + totalFrames : YAHOO.util.AnimMgr.fps, - init: function(config, animationItems, duration){ - this.direction = config.direction; - this.center = config.center; - this.startLeftPos = config.startLeftPos; - this.startRightPos = config.startRightPos; - this.animationItems = animationItems; - this.duration = duration || 1; - this.registerEvents(); - }, - - registerEvents: function(){ - /** + init: function(config, animationItems, duration){ + this.direction = config.direction; + this.center = config.center; + this.startLeftPos = config.startLeftPos; + this.startRightPos = config.startRightPos; + this.animationItems = animationItems; + this.duration = duration || 1; + this.registerEvents(); + }, + + registerEvents: function(){ + /** * Custom event that fires after onStart, useful in subclassing * @private */ - this._onStart = new YAHOO.util.CustomEvent('_start', this, true); + this._onStart = new YAHOO.util.CustomEvent('_start', this, true); - /** + /** * Custom event that fires when animation begins * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction) * @event onStart */ - this.onStart = new YAHOO.util.CustomEvent('start', this); + this.onStart = new YAHOO.util.CustomEvent('start', this); - /** + /** * Custom event that fires between each frame * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction) * @event onTween */ - this.onTween = new YAHOO.util.CustomEvent('tween', this); + this.onTween = new YAHOO.util.CustomEvent('tween', this); - /** + /** * Custom event that fires after onTween * @private */ - this._onTween = new YAHOO.util.CustomEvent('_tween', this, true); + this._onTween = new YAHOO.util.CustomEvent('_tween', this, true); - /** + /** * Custom event that fires when animation ends * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction) * @event onComplete */ - this.onComplete = new YAHOO.util.CustomEvent('complete', this); - /** + this.onComplete = new YAHOO.util.CustomEvent('complete', this); + /** * Custom event that fires after onComplete * @private */ - this._onComplete = new YAHOO.util.CustomEvent('_complete', this, true); + this._onComplete = new YAHOO.util.CustomEvent('_complete', this, true); - this._onStart.subscribe(this.doOnStart); - this._onTween.subscribe(this.doOnTween); - this._onComplete.subscribe(this.doOnComplete); + this._onStart.subscribe(this.doOnStart); + this._onTween.subscribe(this.doOnTween); + this._onComplete.subscribe(this.doOnComplete); - }, + }, - isAnimated : function() { - return this.animated; - }, + isAnimated : function() { + return this.animated; + }, - getStartTime : function() { - return this.startTime; - }, + getStartTime : function() { + return this.startTime; + }, - doMethod: function(start, end) { - return this.method(this.currentFrame, start, end - start, this.totalFrames); - }, + doMethod: function(start, end) { + return this.method(this.currentFrame, start, end - start, this.totalFrames); + }, - animate : function() { - if ( this.isAnimated() ) { - return false; - } + animate : function() { + if ( this.isAnimated() ) { + return false; + } - this.currentFrame = 0; + this.currentFrame = 0; - this.totalFrames = ( this.useSeconds ) ? Math.ceil(YAHOO.util.AnimMgr.fps * this.duration) : this.duration; + this.totalFrames = ( this.useSeconds ) ? Math.ceil(YAHOO.util.AnimMgr.fps * this.duration) : this.duration; - if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration - this.totalFrames = 1; - } - YAHOO.util.AnimMgr.registerElement(this); - return true; - }, + if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration + this.totalFrames = 1; + } + YAHOO.util.AnimMgr.registerElement(this); + return true; + }, - stop : function(finish) { - if (!this.isAnimated()) { // nothing to stop - return false; - } + stop : function(finish) { + if (!this.isAnimated()) { // nothing to stop + return false; + } - if (finish) { - this.currentFrame = this.totalFrames; - this._onTween.fire(); - } - YAHOO.util.AnimMgr.stop(this); - }, + if (finish) { + this.currentFrame = this.totalFrames; + this._onTween.fire(); + } + YAHOO.util.AnimMgr.stop(this); + }, - doOnStart : function() { - this.onStart.fire(); + doOnStart : function() { + this.onStart.fire(); - this.runtimeItems = []; - for (var i=0; i 0){ - runtimeItem.attribute[attr].perspectiveDirection = this.direction; - runtimeItem.attribute[attr].center = true; - }else{ - runtimeItem.attribute[attr].perspectiveDirection = this.direction == CoverFlow.RIGHT ? CoverFlow.LEFT : CoverFlow.RIGHT; - runtimeItem.attribute[attr].center = false; - } - } - } - this.runtimeItems.push(runtimeItem); - }, + setRuntimeItem: function(item){ + var runtimeItem = {}; + runtimeItem.item = item.item; + runtimeItem.attribute = {}; + for(var attr in item.attribute){ + runtimeItem.attribute[attr] = item.attribute[attr]; + if(attr == 'angle'){ + if(item.attribute[attr].start - item.attribute[attr].end > 0){ + runtimeItem.attribute[attr].perspectiveDirection = this.direction; + runtimeItem.attribute[attr].center = true; + }else{ + runtimeItem.attribute[attr].perspectiveDirection = this.direction == CoverFlow.RIGHT ? CoverFlow.LEFT : CoverFlow.RIGHT; + runtimeItem.attribute[attr].center = false; + } + } + } + this.runtimeItems.push(runtimeItem); + }, - setItemAttributes: function(item){ + setItemAttributes: function(item){ - for(var attr in item.attribute){ + for(var attr in item.attribute){ - var value = Math.ceil(this.doMethod(item.attribute[attr].start, item.attribute[attr].end)); + var value = Math.ceil(this.doMethod(item.attribute[attr].start, item.attribute[attr].end)); - if(attr == 'angle'){ - item.item.setAngle(value); - var frameSize = Math.ceil(this.doMethod(3, 1)); - item.item.drawInPerspective(item.attribute[attr].perspectiveDirection, frameSize); - var left; - if(item.attribute[attr].center){ - left = this.doMethod(item.item.getLeft(), this.center - item.item.element.width/2); - }else{ - if(this.direction == CoverFlow.LEFT) - left = this.doMethod(item.item.getLeft(), this.startLeftPos - item.item.element.width); - else - left = this.doMethod(item.item.getLeft(), this.startRightPos); - } - item.item.setLeft(Math.ceil(left)); + if(attr == 'angle'){ + item.item.setAngle(value); + var frameSize = Math.ceil(this.doMethod(3, 1)); + item.item.drawInPerspective(item.attribute[attr].perspectiveDirection, frameSize); + var left; + if(item.attribute[attr].center){ + left = this.doMethod(item.item.getLeft(), this.center - item.item.element.width/2); + }else{ + if(this.direction == CoverFlow.LEFT) + left = this.doMethod(item.item.getLeft(), this.startLeftPos - item.item.element.width); + else + left = this.doMethod(item.item.getLeft(), this.startRightPos); + } + item.item.setLeft(Math.ceil(left)); - }else{ - item.item.setLeft(value); - } - } + }else{ + item.item.setLeft(value); + } } - }; + } +}; //}); \ No newline at end of file diff --git a/collection_views/yui_coverflow/js/test.js b/collection_views/yui_coverflow/js/test.js index 7ba4d637..e200d949 100644 --- a/collection_views/yui_coverflow/js/test.js +++ b/collection_views/yui_coverflow/js/test.js @@ -3,34 +3,83 @@ YAHOO.util.Event.onDOMReady(function(){ - var images = [ - {src: 'images/ardillitaMac.jpg', label: 'Ardileta!', onclick: function(){alert('image1');}}, - {src: 'http://farm2.static.flickr.com/1380/1426855399_b4b8eccbdb.jpg?v=0'}, - {src: 'http://farm1.static.flickr.com/69/213130158_0d1aa23576_d.jpg'}, - {src: 'http://farm1.static.flickr.com/69/213130158_0d1aa23576_d.jpg'}, - {src: 'images/msn2.jpg', label: 'My Mac'}, - {src: 'images/msn2.jpg', label: 'My Mac again...'} + var images = [ + { + src: 'images/ardillitaMac.jpg', + label: 'Ardileta!', + onclick: function(){ + alert('image1'); + } + }, +{ + src: 'http://farm2.static.flickr.com/1380/1426855399_b4b8eccbdb.jpg?v=0' +}, +{ + src: 'http://farm1.static.flickr.com/69/213130158_0d1aa23576_d.jpg' +}, +{ + src: 'http://farm1.static.flickr.com/69/213130158_0d1aa23576_d.jpg' +}, +{ + src: 'images/msn2.jpg', + label: 'My Mac' +}, +{ + src: 'images/msn2.jpg', + label: 'My Mac again...' +} - ]; - var myCoverFlow = new YAHOO.ext.CoverFlow('coverFlowTest', {height: 200, width: 600, images: images}); - - function moveLeft(e, coverFlow){ - coverFlow.selectNext(); - } - function moveRight(e, coverFlow){ - coverFlow.selectPrevious(); - } - var myMoveLeftBtn = new YAHOO.widget.Button('moveLeftButton', {onclick: {fn: moveLeft, obj: myCoverFlow}}); - var myMoveRightBtn = new YAHOO.widget.Button('moveRightButton', {onclick: {fn: moveRight, obj: myCoverFlow}}); +]; +var myCoverFlow = new YAHOO.ext.CoverFlow('coverFlowTest', { + height: 200, + width: 600, + images: images +}); + +function moveLeft(e, coverFlow){ + coverFlow.selectNext(); +} +function moveRight(e, coverFlow){ + coverFlow.selectPrevious(); +} +var myMoveLeftBtn = new YAHOO.widget.Button('moveLeftButton', { + onclick: { + fn: moveLeft, + obj: myCoverFlow + } +}); +var myMoveRightBtn = new YAHOO.widget.Button('moveRightButton', { + onclick: { + fn: moveRight, + obj: myCoverFlow + } +}); - var otherImages = [ - {src: 'images/ardillitaMac.jpg', label: 'Ardileta!', onclick: function(){alert('image1');}}, - {src: 'images/msn2.jpg', label: 'My Mac'}, - {src: 'images/msn2.jpg', label: 'My Mac again...'} +var otherImages = [ +{ + src: 'images/ardillitaMac.jpg', + label: 'Ardileta!', + onclick: function(){ + alert('image1'); + } +}, +{ + src: 'images/msn2.jpg', + label: 'My Mac' +}, +{ + src: 'images/msn2.jpg', + label: 'My Mac again...' +} - ]; - var anotherCoverFlow = new YAHOO.ext.CoverFlow('anotherCoverFlowTest', {height: 150, width: 500, images: otherImages, bgColor: '#C0C0C0'}); +]; +var anotherCoverFlow = new YAHOO.ext.CoverFlow('anotherCoverFlowTest', { + height: 150, + width: 500, + images: otherImages, + bgColor: '#C0C0C0' +}); diff --git a/content_models/BASIC_AUDIO.xml b/content_models/BASIC_AUDIO.xml index e3030f9f..21dc668c 100644 --- a/content_models/BASIC_AUDIO.xml +++ b/content_models/BASIC_AUDIO.xml @@ -1,8 +1,8 @@ - - video/quicktime - + + video/quicktime + @@ -28,15 +28,15 @@ - + plugins/QtFormBuilder.php QtFormBuilder buildQDCForm handleQDCForm - - +
+ dc:title @@ -215,4 +215,4 @@ - + diff --git a/content_models/BASIC_VIDEO.xml b/content_models/BASIC_VIDEO.xml index e3030f9f..21dc668c 100644 --- a/content_models/BASIC_VIDEO.xml +++ b/content_models/BASIC_VIDEO.xml @@ -1,8 +1,8 @@ - - video/quicktime - + + video/quicktime + @@ -28,15 +28,15 @@ - + plugins/QtFormBuilder.php QtFormBuilder buildQDCForm handleQDCForm - - + + dc:title @@ -215,4 +215,4 @@ - + diff --git a/content_models/COLLECTIONCM.xml b/content_models/COLLECTIONCM.xml index d20711c9..91d6f8f9 100644 --- a/content_models/COLLECTIONCM.xml +++ b/content_models/COLLECTIONCM.xml @@ -1,88 +1,89 @@ + - - text/xml - text/plain - application/xml - - - - - - - - - - - - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - + + text/xml + text/plain + application/xml + + + + + + + + + + + + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + diff --git a/content_models/FAS_slideCModel.xml b/content_models/FAS_slideCModel.xml index 5d37ba49..aa4e5b4a 100644 --- a/content_models/FAS_slideCModel.xml +++ b/content_models/FAS_slideCModel.xml @@ -1,166 +1,167 @@ + - - image/tiff - image/tif - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - - - + + image/tiff + image/tif + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + + + + image/tiff - + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - + + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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 + + + diff --git a/content_models/REFWORKSCM.xml b/content_models/REFWORKSCM.xml index 6948278c..ecab1543 100644 --- a/content_models/REFWORKSCM.xml +++ b/content_models/REFWORKSCM.xml @@ -7,14 +7,14 @@ ShowStreamsInFieldSets showQdc - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showRefworks - - + + + + plugins/ShowStreamsInFieldSets.inc + ShowStreamsInFieldSets + showRefworks + + plugins/ShowStreamsInFieldSets.inc @@ -29,10 +29,10 @@ - + text/xml - text/plain - application/xml + text/plain + application/xml @@ -59,8 +59,8 @@ buildForm handleForm - - + + hiddenvalue diff --git a/content_models/REFWORKSCM_1.xml b/content_models/REFWORKSCM_1.xml index 6948278c..ecab1543 100644 --- a/content_models/REFWORKSCM_1.xml +++ b/content_models/REFWORKSCM_1.xml @@ -7,14 +7,14 @@ ShowStreamsInFieldSets showQdc - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showRefworks - - + + + + plugins/ShowStreamsInFieldSets.inc + ShowStreamsInFieldSets + showRefworks + + plugins/ShowStreamsInFieldSets.inc @@ -29,10 +29,10 @@ - + text/xml - text/plain - application/xml + text/plain + application/xml @@ -59,8 +59,8 @@ buildForm handleForm - - + + hiddenvalue diff --git a/content_models/STANDARD JPG.xml b/content_models/STANDARD JPG.xml index 911b1f91..fd3f49ec 100644 --- a/content_models/STANDARD JPG.xml +++ b/content_models/STANDARD JPG.xml @@ -1,95 +1,95 @@ - - 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. - - - + + 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 PDF.xml b/content_models/STANDARD PDF.xml index 2880bc10..0d1b5ec4 100644 --- a/content_models/STANDARD PDF.xml +++ b/content_models/STANDARD PDF.xml @@ -1,14 +1,14 @@ - + application/pdf - + application/pdf - + plugins/ImageManipulation.inc ImageManipulation @@ -32,7 +32,7 @@ - a868aef684fa34923d4fe697db1e785b + a868aef684fa34923d4fe697db1e785b plugins/FormBuilder.inc @@ -40,8 +40,8 @@ buildQDCForm handleQDCForm - - + + dc:title @@ -233,4 +233,4 @@ - + diff --git a/content_models/STANDARD_FLVCM.xml b/content_models/STANDARD_FLVCM.xml index 75a691b5..6089f8a1 100644 --- a/content_models/STANDARD_FLVCM.xml +++ b/content_models/STANDARD_FLVCM.xml @@ -1,8 +1,8 @@ - - video/x-flv - + + video/x-flv + @@ -28,15 +28,15 @@ - + plugins/FlvFormBuilder.inc FlvFormBuilder buildQDCForm handleQDCForm - - + + dc:title @@ -215,4 +215,4 @@ - + diff --git a/content_models/STANDARD_IMAGECM.xml b/content_models/STANDARD_IMAGECM.xml index 635b745c..9d48ebc0 100644 --- a/content_models/STANDARD_IMAGECM.xml +++ b/content_models/STANDARD_IMAGECM.xml @@ -1,11 +1,11 @@ - + image/jpeg image/gif image/png - image/tiff - image/tif + image/tiff + image/tif @@ -29,7 +29,7 @@ plugins/ImageManipulation.inc ImageManipulation - createThumbnail + createThumbnail jpg TN @@ -43,7 +43,7 @@ createPNG png PNG - + plugins/ImageManipulation.inc ImageManipulation @@ -67,7 +67,7 @@ - a868aef684fa34923d4fe697db1e785b + a868aef684fa34923d4fe697db1e785b plugins/FormBuilder.inc @@ -75,8 +75,8 @@ buildQDCForm handleQDCForm - - + + dc:title @@ -268,4 +268,4 @@ - + diff --git a/content_models/STANDARD_JPG.xml b/content_models/STANDARD_JPG.xml index 911b1f91..fd3f49ec 100644 --- a/content_models/STANDARD_JPG.xml +++ b/content_models/STANDARD_JPG.xml @@ -1,95 +1,95 @@ - - 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. - - - + + 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_QT.xml b/content_models/STANDARD_QT.xml index 5d95e27b..39a16543 100644 --- a/content_models/STANDARD_QT.xml +++ b/content_models/STANDARD_QT.xml @@ -1,137 +1,148 @@ - - video/quicktime - video/mp4 + + video/quicktime + video/mp4 - audio/mp3 - audio/x-aiff - - - - video/quicktime - video/mp4 + audio/mp3 + audio/x-aiff + + + + video/quicktime + video/mp4 - audio/mp3 - audio/x-aiff - - - - + audio/mp3 + audio/x-aiff + + + + - - - - + + + + - - - 92x92 - - - - - - - - - - - - - - - - - - - - - - The name given to the file - - - An entity primarily responsible for making the + + + 92x92 + + + + + + + + + + + + + + + + + + + + + + The name given to the file + + + An entity primarily responsible for making the content of the resource such as a person, organization or - service. - - - An entity primarily responsible for making the + service. + + + + An entity primarily responsible for making the content of the resource such as a person, organization or - service. - - home recording - meeting - presentation - sound - - - - Examples include an abstract, table of + service. + + + home recording + meeting + presentation + sound + + + + Examples include an abstract, table of contents, or free-text account of the content of the - resource. - - - An entity, (including persons, organizations, + resource. + + + + An entity, (including persons, organizations, or services), responsible for making the resource - available. - - - An entity responsible for contributing to the + 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 + 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 + 2007-10-23) + + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical - report, essay, dictionary. - - none - video - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the - present resource is derived. - - - A unique reference to the resource; In this + report, essay, dictionary. + + + none + video + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the + present resource is derived. + + + + A unique reference to the resource; In this instance, the accession number or collection - number. - - - The language of the intellectual content of - the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property + 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. - - - + rights. + + + + diff --git a/content_models/STRICT_PDFCM.xml b/content_models/STRICT_PDFCM.xml index 313d4ca4..bd9a5450 100644 --- a/content_models/STRICT_PDFCM.xml +++ b/content_models/STRICT_PDFCM.xml @@ -1,107 +1,108 @@ + - - application/pdf - - - - application/pdf - - + application/pdf + + + + application/pdf + + - - 100 - 120 - - - - - - - - - - - + 100 + 120 + + + + + + + + + + + - - 100 - 120 - - - - - - + 100 + 120 + + + + + + - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - experiment session - home recording - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + experiment session + home recording + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + diff --git a/content_models/demo_Collection.xml b/content_models/demo_Collection.xml index a2e804eb..05b32730 100644 --- a/content_models/demo_Collection.xml +++ b/content_models/demo_Collection.xml @@ -1,65 +1,65 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:20.712Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDefObjects/demo_Collection.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2011-03-29T14:15:20.712Z + Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDefObjects/demo_Collection.xml + + + + + + + - - + - Service Definition Object (Collection) for Image Collection Demo - demo:Collection - - - - - - Service Definition Object (Collection) for Image Collection Demo
+ demo:Collection + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/content_models/demo_CollectionImpl.xml b/content_models/demo_CollectionImpl.xml index b907afb9..071e9923 100644 --- a/content_models/demo_CollectionImpl.xml +++ b/content_models/demo_CollectionImpl.xml @@ -1,196 +1,196 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:20.819Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDepObjects/demo_CollectionImpl.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2011-03-29T14:15:20.819Z + Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDepObjects/demo_CollectionImpl.xml + + + + + + + - - + - Service Deployment Object (Collection) for Image Collection Demo - demo:ImageCollectionImpl - demo:CollectionImpl - - - - - - Service Deployment Object (Collection) for Image Collection Demo + demo:ImageCollectionImpl + demo:CollectionImpl + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + - - + - - - - + + - - - - - - - - - - - - + + + + + + + + + + + - - - - XSLT Binding - text/xml - - - - LIST Binding - text/xml - - - - QUERY Binding - text/plain - - - - - - - - + + + XSLT Binding + text/xml + + + + LIST Binding + text/xml + + + + QUERY Binding + text/plain + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content_models/demo_DualResImage.xml b/content_models/demo_DualResImage.xml index 0bb7dd8c..6dbbca0f 100644 --- a/content_models/demo_DualResImage.xml +++ b/content_models/demo_DualResImage.xml @@ -1,76 +1,76 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:19.456Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/cModelObjects/demo_DualResImage.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2011-03-29T14:15:19.456Z + Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/cModelObjects/demo_DualResImage.xml + + + + + + + - - + - Content Model Object (Image) for Image Collection Demo - demo:DualResImage - - - - - - Content Model Object (Image) for Image Collection Demo + demo:DualResImage + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - -
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/content_models/demo_DualResImageCollection.xml b/content_models/demo_DualResImageCollection.xml index f4e1962f..b9eb819e 100644 --- a/content_models/demo_DualResImageCollection.xml +++ b/content_models/demo_DualResImageCollection.xml @@ -1,73 +1,73 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:19.509Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/cModelObjects/demo_DualResImageCollection.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2011-03-29T14:15:19.509Z + Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/cModelObjects/demo_DualResImageCollection.xml + + + + + + + - - + - Content Model Object (Image Collection) for Image Collection Demo - demo:DualResImageCollection - - - - - - Content Model Object (Image Collection) for Image Collection Demo + demo:DualResImageCollection + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/content_models/demo_DualResImageImpl.xml b/content_models/demo_DualResImageImpl.xml index 36df937a..6019aaab 100644 --- a/content_models/demo_DualResImageImpl.xml +++ b/content_models/demo_DualResImageImpl.xml @@ -1,162 +1,162 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:20.881Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDepObjects/demo_DualResImageImpl.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2011-03-29T14:15:20.881Z + Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDepObjects/demo_DualResImageImpl.xml + + + + + + + - - + - Service Deployment Object (Image) for Image Collection Demo - demo:DualResImageImpl - - - - - - Service Deployment Object (Image) for Image Collection Demo + demo:DualResImageImpl + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + - - - - FULL_SIZE Binding - image/jpeg - - - - MEDIUM_SIZE Binding - image/jpeg - - - - - - - - + + + FULL_SIZE Binding + image/jpeg + + + + MEDIUM_SIZE Binding + image/jpeg + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content_models/demo_DualResolution.xml b/content_models/demo_DualResolution.xml index 62348a34..d8bacfe8 100644 --- a/content_models/demo_DualResolution.xml +++ b/content_models/demo_DualResolution.xml @@ -1,65 +1,65 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:20.765Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDefObjects/demo_DualResolution.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2011-03-29T14:15:20.765Z + Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDefObjects/demo_DualResolution.xml + + + + + + + - - + - Service Definition Object (Image) for Image Collection Demo - demo:DualResolution - - - - - - Service Definition Object (Image) for Image Collection Demo + demo:DualResolution + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/content_models/ilives_bookCModel.xml b/content_models/ilives_bookCModel.xml index 8c52cc1d..7f95b8ca 100644 --- a/content_models/ilives_bookCModel.xml +++ b/content_models/ilives_bookCModel.xml @@ -1,162 +1,162 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:56:58.331Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_bookCModel.xml - - - - ingest - - fedoraAdmin - 2010-05-31T19:56:44.131Z - Ingested from source repository with pid ilives:bookCModel - - - - ingest - - fedoraAdmin - 2010-06-10T17:43:56.335Z - Ingested from local file /Users/aoneill/fedora_repository/content_models/ilives_bookCModel.xml - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-06-10T19:01:39.144Z - DatastreamsPane generated this logMessage. - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-10T19:29:20.220Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-10T19:46:24.930Z - - - - - ingest - - fedoraAdmin - 2010-06-15T07:01:30.019Z - Ingested from local file /Users/al/fedora_repository/content_models/ilives_bookCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T08:56:09.156Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T08:59:35.673Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T08:59:52.831Z - - - - - addDatastream - MODS - fedoraAdmin - 2010-06-16T09:13:08.428Z - DatastreamsPane generated this logMessage. - - - - purgeDatastream - MODS - fedoraAdmin - 2010-06-16T09:13:32.732Z - DatastreamPane generated this logMessage. . . . Purged datastream (ID=MODS), versions ranging from 2010-06-16T06:13:08.428Z to 2010-06-16T06:13:08.428Z. This resulted in the permanent removal of 1 datastream version(s) (2010-06-16T06:13:08.428Z) and all associated audit records. - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T09:21:14.357Z - - - - - ingest - - fedoraAdmin - 2010-08-30T13:14:03.487Z - Ingested from local file /Users/aoneill/fedora_repository/ilives/xml/ilives_bookCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-11-26T15:24:13.742Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:56:58.331Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_bookCModel.xml + + + + ingest + + fedoraAdmin + 2010-05-31T19:56:44.131Z + Ingested from source repository with pid ilives:bookCModel + + + + ingest + + fedoraAdmin + 2010-06-10T17:43:56.335Z + Ingested from local file /Users/aoneill/fedora_repository/content_models/ilives_bookCModel.xml + + + + addDatastream + ISLANDORACM + fedoraAdmin + 2010-06-10T19:01:39.144Z + DatastreamsPane generated this logMessage. + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-10T19:29:20.220Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-10T19:46:24.930Z + + + + + ingest + + fedoraAdmin + 2010-06-15T07:01:30.019Z + Ingested from local file /Users/al/fedora_repository/content_models/ilives_bookCModel.xml + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-16T08:56:09.156Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-16T08:59:35.673Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-16T08:59:52.831Z + + + + + addDatastream + MODS + fedoraAdmin + 2010-06-16T09:13:08.428Z + DatastreamsPane generated this logMessage. + + + + purgeDatastream + MODS + fedoraAdmin + 2010-06-16T09:13:32.732Z + DatastreamPane generated this logMessage. . . . Purged datastream (ID=MODS), versions ranging from 2010-06-16T06:13:08.428Z to 2010-06-16T06:13:08.428Z. This resulted in the permanent removal of 1 datastream version(s) (2010-06-16T06:13:08.428Z) and all associated audit records. + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-16T09:21:14.357Z + + + + + ingest + + fedoraAdmin + 2010-08-30T13:14:03.487Z + Ingested from local file /Users/aoneill/fedora_repository/ilives/xml/ilives_bookCModel.xml + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-11-26T15:24:13.742Z + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - + + + 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 @@ -169,507 +169,507 @@ demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - Book Content Model - ilives:bookCModel - - - - - - Book Content Model + ilives:bookCModel + + + + + + - - - - image/tiff - image/tif - - - - - ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + image/tif + + + + + ilives + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + text/xml + + + ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - image/tif - - - - - fedora_ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + image/tif + + + + + fedora_ilives + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - - - - - fedora_ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + + + + + fedora_ilives + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + + + + + fedora_ilives + book.inc + IslandoraBook + showFieldSets + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSet - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + + + + + fedora_ilives + book.inc + IslandoraBook + showFieldSet + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + + + + + fedora_ilives + book.inc + IslandoraBook + showFieldSets + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + + + + + fedora_ilives + book.inc + IslandoraBook + showFieldSets + + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - - - - text/xml - - + + + image/tiff + + + + text/xml + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + - - - - + + + + diff --git a/content_models/ilives_jp2Sdef.xml b/content_models/ilives_jp2Sdef.xml index 9fa5e9a7..e7580656 100644 --- a/content_models/ilives_jp2Sdef.xml +++ b/content_models/ilives_jp2Sdef.xml @@ -1,73 +1,73 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:56:59.840Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdef.xml - - - - ingest - - admin - 2010-05-25T13:17:14.106Z - Fedora Object Ingested - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:56:59.840Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdef.xml + + + + ingest + + admin + 2010-05-25T13:17:14.106Z + Fedora Object Ingested + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - + - ilives:jp2Sdef - ilives:jp2Sdef - - - - - - ilives:jp2Sdef + ilives:jp2Sdef + + + + + + - - - - - - - - + + + + + + + + diff --git a/content_models/ilives_jp2Sdep-pageCModel.xml b/content_models/ilives_jp2Sdep-pageCModel.xml index 7eedea6d..0aa21432 100644 --- a/content_models/ilives_jp2Sdep-pageCModel.xml +++ b/content_models/ilives_jp2Sdep-pageCModel.xml @@ -1,179 +1,179 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:00.246Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdep-pageCModel.xml - - - - ingest - - fedoraAdmin - 2010-06-01T00:46:19.239Z - Ingested from local file /Users/al/Desktop/ilives_jp2Sdep-pageCModel.xml - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-01T00:48:39.302Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:57:00.246Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdep-pageCModel.xml + + + + ingest + + fedoraAdmin + 2010-06-01T00:46:19.239Z + Ingested from local file /Users/al/Desktop/ilives_jp2Sdep-pageCModel.xml + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-06-01T00:48:39.302Z + + + + + + + + - - + - ilives:jp2Sdep-pageCModel - ilives:jp2Sdep-pageCModel - - - - - - ilives:jp2Sdep-pageCModel + ilives:jp2Sdep-pageCModel + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - DC - text/xml - - - - - - - - + + + DC + text/xml + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/content_models/ilives_tei2htmlSdef.xml b/content_models/ilives_tei2htmlSdef.xml index a65ded77..225df813 100644 --- a/content_models/ilives_tei2htmlSdef.xml +++ b/content_models/ilives_tei2htmlSdef.xml @@ -1,72 +1,72 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:01.057Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdef.xml - - - - ingest - - fedoraAdmin - 2010-06-01T00:46:19.652Z - Ingested from local file /Users/al/Desktop/ilives_tei2htmlSdef.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:57:01.057Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdef.xml + + + + ingest + + fedoraAdmin + 2010-06-01T00:46:19.652Z + Ingested from local file /Users/al/Desktop/ilives_tei2htmlSdef.xml + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - + - ilives:tei2htmlSdef - ilives:tei2htmlSdef - - - - - - ilives:tei2htmlSdef + ilives:tei2htmlSdef + + + + + + - - - - - - - + + + + + + + diff --git a/content_models/ilives_tei2htmlSdep-pageCModel.xml b/content_models/ilives_tei2htmlSdep-pageCModel.xml index b3d38549..fbc8f585 100644 --- a/content_models/ilives_tei2htmlSdep-pageCModel.xml +++ b/content_models/ilives_tei2htmlSdep-pageCModel.xml @@ -1,234 +1,241 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:01.366Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdep-pageCModel.xml - - - - modifyDatastreamByValue - XSL - fedoraAdmin - 2009-12-11T19:09:52.417Z - - - - - modifyDatastreamByValue - XSL - fedoraAdmin - 2009-12-11T19:22:11.096Z - - - - - ingest - - fedoraAdmin - 2010-06-01T00:46:19.847Z - Ingested from local file /Users/al/Desktop/ilives_tei2htmlSdep-pageCModel.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:57:01.366Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdep-pageCModel.xml + + + + modifyDatastreamByValue + XSL + fedoraAdmin + 2009-12-11T19:09:52.417Z + + + + + modifyDatastreamByValue + XSL + fedoraAdmin + 2009-12-11T19:22:11.096Z + + + + + ingest + + fedoraAdmin + 2010-06-01T00:46:19.847Z + Ingested from local file /Users/al/Desktop/ilives_tei2htmlSdep-pageCModel.xml + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - + - ilives:tei2htmlSdep-pageCModel - ilives:tei2htmlSdep-pageCModel - - - - - - ilives:tei2htmlSdep-pageCModel + ilives:tei2htmlSdep-pageCModel + + + + + + - - - - TEI - text/xml - - - - XSL - text/xml - - - - - - - - + + + TEI + text/xml + + + + XSL + text/xml + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + - - - - - <xsl:value-of select="normalize-space(tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title)"/> - - - - - - - - -
- -
-
- -

- -

-
- - - - - - - - - - - search persName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22+%22+AND+dc.type:collection - - - - - - - - - - - - search placeName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22%22+AND+dc.type:collection - - - - - - search orgName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22%22+AND+dc.type:collection - - - - -
-
-
-
+ + + + + <xsl:value-of select="normalize-space(tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title)"/> + + + + + + + + +
+ +
+
+ +

+ +

+
+ + + + + + + + + + + search persName + _blank + http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22 + + + %22+AND+dc.type:collection + + + + + + + + + + + + + search placeName + _blank + http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22 + %22+AND+dc.type:collection + + + + + + + search orgName + _blank + http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22 + %22+AND+dc.type:collection + + + + + + + +
+
diff --git a/content_models/ilives_viewerSdef.xml b/content_models/ilives_viewerSdef.xml index 94a0031e..c0031d70 100644 --- a/content_models/ilives_viewerSdef.xml +++ b/content_models/ilives_viewerSdef.xml @@ -1,72 +1,72 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T17:09:29.912Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdef.xml - - - - ingest - - admin - 2010-05-25T13:17:14.247Z - Fedora Object Ingested - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T17:09:29.912Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdef.xml + + + + ingest + + admin + 2010-05-25T13:17:14.247Z + Fedora Object Ingested + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - + - ilives:viewerSdef - ilives:viewerSdef - - - - - - ilives:viewerSdef + ilives:viewerSdef + + + + + + - - - - - - - + + + + + + + diff --git a/content_models/ilives_viewerSdep-bookCModel.xml b/content_models/ilives_viewerSdep-bookCModel.xml index e91d3ce8..1332ac82 100644 --- a/content_models/ilives_viewerSdep-bookCModel.xml +++ b/content_models/ilives_viewerSdep-bookCModel.xml @@ -1,157 +1,157 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T17:09:41.797Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-bookCModel.xml - - - - ingest - - fedoraAdmin - 2010-05-31T20:03:42.709Z - Ingested from source repository with pid ilives:viewerSdep-bookCModel - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-31T20:04:57.893Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-31T20:57:49.117Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T17:09:41.797Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-bookCModel.xml + + + + ingest + + fedoraAdmin + 2010-05-31T20:03:42.709Z + Ingested from source repository with pid ilives:viewerSdep-bookCModel + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-05-31T20:04:57.893Z + + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-05-31T20:57:49.117Z + + + + + + + + - - + - ilives:viewerSdep-bookCModel - ilives:viewerSdep-bookCModel - - - - - - ilives:viewerSdep-bookCModel + ilives:viewerSdep-bookCModel + + + + + + - - - - DC - text/xml - - - - - - - - + + + DC + text/xml + + + + + + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/content_models/islandora_collectionCModel.xml b/content_models/islandora_collectionCModel.xml index 330a62cf..129d2f50 100644 --- a/content_models/islandora_collectionCModel.xml +++ b/content_models/islandora_collectionCModel.xml @@ -1,584 +1,584 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - admin - 2010-12-20T16:14:50.165Z - Fedora Object Ingested - - - - addDatastream - RELS-EXT - admin - 2010-12-20T16:14:50.352Z - Ingested object RELS-EXT - - - - modifyDatastreamByValue - RELS-EXT - admin - 2010-12-20T16:14:50.407Z - Modified by Islandora API - - - - addDatastream - ISLANDORACM - admin - 2010-12-20T16:14:50.475Z - Ingested object ISLANDORACM - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2011-01-17T15:04:59.169Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2011-01-17T15:06:08.023Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2011-01-21T19:40:39.790Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2011-01-21T19:41:19.709Z - - - - - - - - + + + + ingest + + admin + 2010-12-20T16:14:50.165Z + Fedora Object Ingested + + + + addDatastream + RELS-EXT + admin + 2010-12-20T16:14:50.352Z + Ingested object RELS-EXT + + + + modifyDatastreamByValue + RELS-EXT + admin + 2010-12-20T16:14:50.407Z + Modified by Islandora API + + + + addDatastream + ISLANDORACM + admin + 2010-12-20T16:14:50.475Z + Ingested object ISLANDORACM + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2011-01-17T15:04:59.169Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2011-01-17T15:06:08.023Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2011-01-21T19:40:39.790Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2011-01-21T19:41:19.709Z + + + + + + + + - - + - Islandora Collection Content Model - islandora:collectionCModel - - - - - - Islandora Collection Content Model + islandora:collectionCModel + + + + + + - - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + - - + - - text/xml - text/plain - application/xml - - - - + text/xml + text/plain + application/xml + + + + - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + + + + - - + - - text/xml - text/plain - application/xml - - - - - - - - - + text/xml + text/plain + application/xml + + + + + + + + + - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + + + + - - + - - text/xml - text/plain - application/xml - - - - - - - - - + text/xml + text/plain + application/xml + + + + + + + + + - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + + + + - - + - - text/xml - text/plain - application/xml - - - - - - - - - - - - + text/xml + text/plain + application/xml + + + + + + + + + + + + - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + + + + - - + - - text/xml - text/plain - application/xml - - - - - - - - - - - + text/xml + text/plain + application/xml + + + + + + + + + + + - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - + + + The name given to the resource + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + + An entity primarily responsible for making the content of the resource such as a person, organization or service. + + none + Multi Media + image + meeting + presentation + sound + text + + + + Examples include an abstract, table of contents, or free-text account of the content of the resource. + + + An entity, (including persons, organizations, or services), responsible for making the resource available. + + + An entity responsible for contributing to the content of the resource such as a person, organization or service. + + + Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. + + none + collection + dataset + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the present resource is derived. + + + A unique reference to the resource; In this instance, the accession number or collection number. + + + The language of the intellectual content of the resource. + + English + French + + + + Reference to a related resource. + + + Information about intellectual property rights, copyright, and various property rights. + + + + + + + diff --git a/content_models/islandora_herbCModel.xml b/content_models/islandora_herbCModel.xml index 4ad9e72c..6763cdc6 100644 --- a/content_models/islandora_herbCModel.xml +++ b/content_models/islandora_herbCModel.xml @@ -1,187 +1,187 @@ - - - - - - - - - + + + + + + + + - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-03-05T19:52:46.133Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-10T06:43:54.714Z - - - - - ingest - - fedoraAdmin - 2010-05-10T15:42:10.930Z - Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/islandora_herbCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-10T16:56:37.065Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-10T16:58:56.685Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-10T19:07:11.023Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-11T19:12:28.380Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-13T19:30:13.540Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-17T20:10:15.478Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-18T18:58:52.382Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-19T18:16:39.272Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-19T18:36:31.560Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-19T19:52:41.316Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-19T20:06:17.332Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-20T19:12:33.099Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-07T14:01:43.997Z - - - - - ingest - - fedoraAdmin - 2010-09-16T16:15:28.762Z - Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/islandora_herbCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-09-16T17:32:21.037Z - - - - - - - - + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-03-05T19:52:46.133Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-10T06:43:54.714Z + + + + + ingest + + fedoraAdmin + 2010-05-10T15:42:10.930Z + Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/islandora_herbCModel.xml + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-10T16:56:37.065Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-10T16:58:56.685Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-10T19:07:11.023Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-11T19:12:28.380Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-13T19:30:13.540Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-17T20:10:15.478Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-18T18:58:52.382Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-19T18:16:39.272Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-19T18:36:31.560Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-19T19:52:41.316Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-19T20:06:17.332Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-05-20T19:12:33.099Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-07T14:01:43.997Z + + + + + ingest + + fedoraAdmin + 2010-09-16T16:15:28.762Z + Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/islandora_herbCModel.xml + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-09-16T17:32:21.037Z + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + 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 @@ -194,1658 +194,1658 @@ demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - + + + + + + + + + - - + - Herbarium Content Model - islandora:herbCModel - - - - - - Herbarium Content Model + islandora:herbCModel + + + + + + - - - - image/tiff - - - - - plugins/slide_viewer.php - ShowSlideStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + + + + + plugins/slide_viewer.php + ShowSlideStreamsInFieldSets + showJPG + + + + + + image/tiff - - - - plugins/ImageManipulation.php - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/DemoFormBuilder.php - 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 - - - - - - - + + + plugins/ImageManipulation.php + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/DemoFormBuilder.php + 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/tiff - - - - - plugins/herb_viewer.php - HerbStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + + + + + plugins/herb_viewer.php + HerbStreamsInFieldSets + showJPG + + + + + + image/tiff - - - - plugins/ImageManipulation.php - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/DemoFormBuilder.php - 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 - - - - - - - + + + plugins/ImageManipulation.php + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/DemoFormBuilder.php + 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/tiff - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + + + + + plugins/herb_viewer.inc + HerbStreamsInFieldSets + showJPG + + + + + + image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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/tiff - - - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + + + image/tif + + + + + plugins/herb_viewer.inc + HerbStreamsInFieldSets + showJPG + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herb_viewer.inc + HerbStreamsInFieldSets + showJPG + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herb_viewer.inc + HerbStreamsInFieldSets + showJPG + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herb_viewer.inc + HerbStreamsInFieldSets + showJPG + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/DarwinCore.inc - DarwinCore - buildDrupalForm - handleDarwinCoreForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/DarwinCore.inc + DarwinCore + buildDrupalForm + handleDarwinCoreForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herb_viewer.inc + HerbStreamsInFieldSets + showJPG + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/DarwinCore.inc - DarwinCore - buildDrupalForm - handleIngestForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/DarwinCore.inc + DarwinCore + buildDrupalForm + handleIngestForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herb_viewer.inc + HerbStreamsInFieldSets + showJPG + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + handleIngestForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + handleIngestForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + handleIngestForm + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + handleIngestForm + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/Herbarium.inc - Herbarium - buildEditMetadataForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + handleIngestForm + + + + + plugins/Herbarium.inc + Herbarium + buildEditMetadataForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/Herbarium.inc - Herbarium - buildEditMetadataForm - - - plugins/Herbarium.inc - Herbarium - handleEditMetadataForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + handleIngestForm + + + + + plugins/Herbarium.inc + Herbarium + buildEditMetadataForm + + + plugins/Herbarium.inc + Herbarium + handleEditMetadataForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/herbarium.inc - Herbarium - buildEditMetadataForm - - - plugins/herbarium.inc - Herbarium - handleEditMetadataForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/Herbarium.inc + Herbarium + buildDrupalForm + handleIngestForm + + + + + plugins/herbarium.inc + Herbarium + buildEditMetadataForm + + + plugins/herbarium.inc + Herbarium + handleEditMetadataForm + + + + + + - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/herbarium.inc - Herbarium - buildEditMetadataForm - - - plugins/herbarium.inc - Herbarium - handleEditMetadataForm - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + plugins/herbarium.inc + Herbarium + buildDrupalForm + handleIngestForm + + + + + plugins/herbarium.inc + Herbarium + buildEditMetadataForm + + + plugins/herbarium.inc + Herbarium + handleEditMetadataForm + + + + + + - - + - - image/tiff - image/tif - - - - image/tiff - image/tif - - + image/tiff + image/tif + + + + image/tiff + image/tif + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + + - - - - + + + + diff --git a/content_models/islandora_jp2Sdep-slideCModel.xml b/content_models/islandora_jp2Sdep-slideCModel.xml index 47a14dc0..67cbe24d 100644 --- a/content_models/islandora_jp2Sdep-slideCModel.xml +++ b/content_models/islandora_jp2Sdep-slideCModel.xml @@ -3,197 +3,197 @@ xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"> - - - - - - - - - - - - - -ingest - -fedoraAdmin -2009-11-27T18:25:48.654Z -Created with Admin GUI "New Object" command - - - -modifyDatastreamByValue -METHODMAP -fedoraAdmin -2009-11-27T18:30:03.064Z - - - - -modifyDatastreamByValue -DSINPUTSPEC -fedoraAdmin -2009-11-27T18:30:34.272Z - - - - -modifyDatastreamByValue -WSDL -fedoraAdmin -2009-11-27T18:31:33.967Z - - - - -modifyDatastreamByValue -RELS-EXT -fedoraAdmin -2009-11-27T18:36:14.648Z - - - - -ingest - -fedoraAdmin -2010-01-26T20:06:07.452Z -Ingested from local file /Users/aoneill/Desktop/tmp/islandora_jp2Sdep-slideCModel.xml - - - -modifyDatastreamByValue -RELS-EXT -fedoraAdmin -2010-03-05T16:47:23.192Z - - - - -modifyDatastreamByValue -RELS-EXT -fedoraAdmin -2010-03-11T20:58:05.234Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + ingest + + fedoraAdmin + 2009-11-27T18:25:48.654Z + Created with Admin GUI "New Object" command + + + + modifyDatastreamByValue + METHODMAP + fedoraAdmin + 2009-11-27T18:30:03.064Z + + + + + modifyDatastreamByValue + DSINPUTSPEC + fedoraAdmin + 2009-11-27T18:30:34.272Z + + + + + modifyDatastreamByValue + WSDL + fedoraAdmin + 2009-11-27T18:31:33.967Z + + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2009-11-27T18:36:14.648Z + + + + + ingest + + fedoraAdmin + 2010-01-26T20:06:07.452Z + Ingested from local file /Users/aoneill/Desktop/tmp/islandora_jp2Sdep-slideCModel.xml + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-03-05T16:47:23.192Z + + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-03-11T20:58:05.234Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This METHODMAP datastream is included as a starting point to assist in the creation of a service deployment. The METHODMAP should define the the mapping of the WSDL to Fedora object methods. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This DSINPUTSPEC datastream is included as a starting point to assist in the creation of a service deployment. The DSINPUTSPEC should define the datastreams to be used by WSDL-defined methods. - - - - - - - - DC - text/xml - - - - - - - - - - + + + + + + + + DC + text/xml + + + + + + + + + + This WSDL datastream is included as a starting point to assist in the creation of a service deployment. The WSDL should define the services provided by this @@ -205,73 +205,73 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/ demo:2, demo:13, demo:20, and demo:28. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - islandora:jp2Sdep-slideCModel - islandora:jp2Sdep-slideCModel - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + islandora:jp2Sdep-slideCModel + islandora:jp2Sdep-slideCModel + + + + \ No newline at end of file diff --git a/content_models/islandora_largeimages.xml b/content_models/islandora_largeimages.xml index f78168d4..e4d59de4 100644 --- a/content_models/islandora_largeimages.xml +++ b/content_models/islandora_largeimages.xml @@ -1,247 +1,247 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - admin - 2010-12-20T16:02:16.800Z - Fedora Object Ingested - - - - addDatastream - RELS-EXT - admin - 2010-12-20T16:02:17.020Z - Ingested object RELS-EXT - - - - modifyDatastreamByValue - RELS-EXT - admin - 2010-12-20T16:02:17.091Z - Modified by Islandora API - - - - modifyDatastreamByValue - RELS-EXT - admin - 2010-12-20T16:02:17.142Z - Modified by Islandora API - - - - addDatastream - COLLECTION_POLICY - admin - 2010-12-20T16:02:17.213Z - Ingested object COLLECTION_POLICY - - - - ingest - - admin - 2010-12-20T16:08:27.075Z - Fedora Object Ingested - - - - addDatastream - TN - admin - 2010-12-20T16:08:27.131Z - Ingested object TN - - - - purgeDatastream - TN - fedoraAdmin - 2010-12-20T16:09:24.726Z - DatastreamPane generated this logMessage. . . . Purged datastream (ID=TN), versions ranging from 2010-12-20T12:08:27.131Z to 2010-12-20T12:08:27.131Z. This resulted in the permanent removal of 1 datastream version(s) (2010-12-20T12:08:27.131Z) and all associated audit records. - - - - modifyDatastreamByValue - COLLECTION_POLICY - fedoraAdmin - 2010-12-20T16:09:32.544Z - - - - - - - - + + + + ingest + + admin + 2010-12-20T16:02:16.800Z + Fedora Object Ingested + + + + addDatastream + RELS-EXT + admin + 2010-12-20T16:02:17.020Z + Ingested object RELS-EXT + + + + modifyDatastreamByValue + RELS-EXT + admin + 2010-12-20T16:02:17.091Z + Modified by Islandora API + + + + modifyDatastreamByValue + RELS-EXT + admin + 2010-12-20T16:02:17.142Z + Modified by Islandora API + + + + addDatastream + COLLECTION_POLICY + admin + 2010-12-20T16:02:17.213Z + Ingested object COLLECTION_POLICY + + + + ingest + + admin + 2010-12-20T16:08:27.075Z + Fedora Object Ingested + + + + addDatastream + TN + admin + 2010-12-20T16:08:27.131Z + Ingested object TN + + + + purgeDatastream + TN + fedoraAdmin + 2010-12-20T16:09:24.726Z + DatastreamPane generated this logMessage. . . . Purged datastream (ID=TN), versions ranging from 2010-12-20T12:08:27.131Z to 2010-12-20T12:08:27.131Z. This resulted in the permanent removal of 1 datastream version(s) (2010-12-20T12:08:27.131Z) and all associated audit records. + + + + modifyDatastreamByValue + COLLECTION_POLICY + fedoraAdmin + 2010-12-20T16:09:32.544Z + + + + + + + + - - + - Large Images Collection - islandora:largeimages - - - - - - Large Images Collection + islandora:largeimages + + + + + + - - - - - - - + + + + + + - - - - - - - - - + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - islandora:slide - islandora:slideCModel - ISLANDORACM - - - islandora:map - islandora:mapCModel - ISLANDORACM - - - islandora:herb - islandora:herbCModel - ISLANDORACM - - - isMemberOfCollection - - 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 - - - - - - + + + + islandora:slide + islandora:slideCModel + ISLANDORACM + + + islandora:map + islandora:mapCModel + ISLANDORACM + + + islandora:herb + islandora:herbCModel + ISLANDORACM + + + isMemberOfCollection + + 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 - - isMemberOfCollection - - - - + + + + + + + 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 + + isMemberOfCollection + + + + diff --git a/content_models/islandora_mapCModel.xml b/content_models/islandora_mapCModel.xml index e1026ea7..4820b6cf 100644 --- a/content_models/islandora_mapCModel.xml +++ b/content_models/islandora_mapCModel.xml @@ -1,73 +1,73 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2010-05-25T12:52:58.656Z - Created with Admin GUI "New Object" command - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-05-25T12:53:38.788Z - DatastreamsPane generated this logMessage. - - - - ingest - - fedoraAdmin - 2010-09-16T16:13:13.388Z - Ingested from local file /Users/aoneill/fedora_repository/content_models/islandora_mapCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-09-16T16:13:49.927Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2010-05-25T12:52:58.656Z + Created with Admin GUI "New Object" command + + + + addDatastream + ISLANDORACM + fedoraAdmin + 2010-05-25T12:53:38.788Z + DatastreamsPane generated this logMessage. + + + + ingest + + fedoraAdmin + 2010-09-16T16:13:13.388Z + Ingested from local file /Users/aoneill/fedora_repository/content_models/islandora_mapCModel.xml + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-09-16T16:13:49.927Z + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - + + + 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 @@ -80,287 +80,287 @@ demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - + + + + + + + + + - - + - Islandora Map Content Model - islandora:mapCModel - - - - - - Islandora Map Content Model + islandora:mapCModel + + + + + + - - - - image/tiff - image/tif - - - - - plugins/map_viewer.inc - ShowMapStreamsInFieldSets - showJPG - - - - - - - - - - - + + + + image/tiff + image/tif + + + + + plugins/map_viewer.inc + ShowMapStreamsInFieldSets + showJPG + + + + + + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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/tiff - image/tif - - - - image/tiff - image/tif - - + image/tiff + image/tif + + + + image/tiff + image/tif + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - 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. - - - - - - - + + + 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. + + + + + + + diff --git a/content_models/islandora_mods2htmlSdef.xml b/content_models/islandora_mods2htmlSdef.xml index 5eaae20a..ac9a5bf6 100644 --- a/content_models/islandora_mods2htmlSdef.xml +++ b/content_models/islandora_mods2htmlSdef.xml @@ -1,73 +1,73 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2010-03-12T14:57:03.509Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-03-12T15:12:03.341Z - - - - - ingest - - fedoraAdmin - 2010-03-12T17:28:34.323Z - Ingested from local file /Users/aoneill/fedora_repository/content_models/islandora-mods2htmlSdef.xml - - - - ingest - - admin - 2010-05-25T13:17:13.492Z - Fedora Object Ingested - - - - - - - + + + + ingest + + fedoraAdmin + 2010-03-12T14:57:03.509Z + Created with Admin GUI "New Object" command + + + + modifyDatastreamByValue + METHODMAP + fedoraAdmin + 2010-03-12T15:12:03.341Z + + + + + ingest + + fedoraAdmin + 2010-03-12T17:28:34.323Z + Ingested from local file /Users/aoneill/fedora_repository/content_models/islandora-mods2htmlSdef.xml + + + + ingest + + admin + 2010-05-25T13:17:13.492Z + Fedora Object Ingested + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - + + + This METHODMAP datastream is included as a starting point to assist in the creation of a service definition. The METHODMAP should define the methods and method parameters for this @@ -79,32 +79,32 @@ demo:1, demo:12, demo: 19, and demo:27. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - - - + + + + + - - - - - - - - - + + + + + + + + - - + - MODS to HTML Disseminator - islandora:mods2htmlSdef - - - - + MODS to HTML Disseminator + islandora:mods2htmlSdef + + + + diff --git a/content_models/islandora_mods2htmlSdep.xml b/content_models/islandora_mods2htmlSdep.xml index f5fd2cd9..af4e67e3 100644 --- a/content_models/islandora_mods2htmlSdep.xml +++ b/content_models/islandora_mods2htmlSdep.xml @@ -1,188 +1,188 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2010-03-12T15:14:29.138Z - Created with Admin GUI "New Object" command - - - - addDatastream - XSL - fedoraAdmin - 2010-03-12T15:17:20.270Z - DatastreamsPane generated this logMessage. - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-03-12T15:18:27.234Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-03-12T15:21:44.430Z - - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2010-03-12T15:23:21.361Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2010-03-12T15:27:58.299Z - - - - - ingest - - admin - 2010-05-25T13:17:13.612Z - Fedora Object Ingested - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-01T01:05:17.111Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2010-03-12T15:14:29.138Z + Created with Admin GUI "New Object" command + + + + addDatastream + XSL + fedoraAdmin + 2010-03-12T15:17:20.270Z + DatastreamsPane generated this logMessage. + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-03-12T15:18:27.234Z + + + + + modifyDatastreamByValue + METHODMAP + fedoraAdmin + 2010-03-12T15:21:44.430Z + + + + + modifyDatastreamByValue + DSINPUTSPEC + fedoraAdmin + 2010-03-12T15:23:21.361Z + + + + + modifyDatastreamByValue + WSDL + fedoraAdmin + 2010-03-12T15:27:58.299Z + + + + + ingest + + admin + 2010-05-25T13:17:13.612Z + Fedora Object Ingested + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-06-01T01:05:17.111Z + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + This METHODMAP datastream is included as a starting point to assist in the creation of a service deployment. The METHODMAP should define the the mapping of the WSDL to Fedora object methods. - - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + This DSINPUTSPEC datastream is included as a starting point to assist in the creation of a service deployment. The DSINPUTSPEC should define the datastreams to be used by WSDL-defined methods. - - - - + + + - - - - MODS - text/xml - - - - XSL - text/xml - - - - - - - - + + + MODS + text/xml + + + + XSL + text/xml + + + + + + + + - - + + This WSDL datastream is included as a starting point to assist in the creation of a service deployment. The WSDL should define the services provided by this @@ -194,271 +194,279 @@ demo:2, demo:13, demo:20, and demo:28. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - MODS to HTML Disseminator Service Deployment - islandora:mods2htmlSdep - - - - - - MODS to HTML Disseminator Service Deployment + islandora:mods2htmlSdep + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - - -

- - - -
- - - -

- - - - - - -

- - - - - -
-
-
- - - - - -

- - - - - - -

- - - -
- - - -

- - - - - - -

- - - - - -
-
-
- - - -

- - - - - - -

- - - - - -
- - - - - - - - - - - - - : - - - - - - - ( - - - - - - Edition - ) - - - ="", - - - () - -
-
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + +

+ + + +
+ + + +

+ + + + + + +

+ + + + + +
+
+
+ + + + + +

+ + + + + + +

+ + + +
+ + + +

+ + + + + + +

+ + + + + +
+
+
+ + + +

+ + + + + + +

+ + + + + +
+ + + + + + + + + + + + + : + + + + + + + + ( + + + + + + + Edition + + ) + + + + =" + ", + + + + ( + ) + + + + +
+
diff --git a/content_models/islandora_qtCModel.xml b/content_models/islandora_qtCModel.xml index 0323fc31..e1798417 100644 --- a/content_models/islandora_qtCModel.xml +++ b/content_models/islandora_qtCModel.xml @@ -3,161 +3,172 @@ xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"> - - - - - - - - - - - - Quicktime Content Model - islandora:qtCModel - - - - - - - - - - video/quicktime - video/mp4 - audio/mp3 - audio/x-aiff - - - - video/quicktime - video/mp4 + + + + + + + + + + + + Quicktime Content Model + islandora:qtCModel + + + + + + + + + + video/quicktime + video/mp4 + audio/mp3 + audio/x-aiff + + + + video/quicktime + video/mp4 - audio/mp3 - audio/x-aiff - - - - + audio/mp3 + audio/x-aiff + + + + - - - - + + + + - - - 92x92 - - - - - - - - - - - - - - - - - - - - - - The name given to the file - - - An entity primarily responsible for making the + + + 92x92 + + + + + + + + + + + + + + + + + + + + + + The name given to the file + + + An entity primarily responsible for making the content of the resource such as a person, organization or - service. - - - An entity primarily responsible for making the + service. + + + + An entity primarily responsible for making the content of the resource such as a person, organization or - service. - - home recording - meeting - presentation - sound - - - - Examples include an abstract, table of + service. + + + home recording + meeting + presentation + sound + + + + Examples include an abstract, table of contents, or free-text account of the content of the - resource. - - - An entity, (including persons, organizations, + resource. + + + + An entity, (including persons, organizations, or services), responsible for making the resource - available. - - - An entity responsible for contributing to the + 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 + 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 + 2007-10-23) + + + + Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical - report, essay, dictionary. - - none - video - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the - present resource is derived. - - - A unique reference to the resource; In this + report, essay, dictionary. + + + none + video + event + image + interactive resource + model + party + physical object + place + service + software + sound + text + + + + A reference to a resource from which the + present resource is derived. + + + + A unique reference to the resource; In this instance, the accession number or collection - number. - - - The language of the intellectual content of - the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property + 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. - - - - - - - + rights. + + + + + + + + diff --git a/content_models/islandora_slideCModel.xml b/content_models/islandora_slideCModel.xml index 9d0386e3..b11eaa2f 100644 --- a/content_models/islandora_slideCModel.xml +++ b/content_models/islandora_slideCModel.xml @@ -1,205 +1,205 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-10-15T16:00:27.323Z - Created with Admin GUI "New Object" command - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2009-10-15T16:01:56.633Z - DatastreamsPane generated this logMessage. - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-10-16T16:30:09.592Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-10-16T16:40:10.323Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-10-16T17:50:03.365Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-10-16T17:59:16.270Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-11-27T15:22:48.433Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2009-11-27T15:47:29.716Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-01-12T20:39:20.430Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-01-13T17:59:36.652Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-01-13T19:08:21.266Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-01-13T19:56:37.843Z - - - - - ingest - - fedoraAdmin - 2010-01-26T20:06:21.726Z - Ingested from local file /Users/aoneill/Desktop/tmp/islandora_slideCModel.xml - - - - ingest - - aoneill - 2010-03-31T22:51:13.964Z - Fedora Object Ingested - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-03-31T22:54:03.479Z - - - - - ingest - - aoneill - 2010-04-01T18:17:22.725Z - Fedora Object Ingested - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-04-01T18:25:12.904Z - - - - - ingest - - admin - 2010-08-26T18:57:07.237Z - Fedora Object Ingested - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-09-16T16:01:27.415Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2009-10-15T16:00:27.323Z + Created with Admin GUI "New Object" command + + + + addDatastream + ISLANDORACM + fedoraAdmin + 2009-10-15T16:01:56.633Z + DatastreamsPane generated this logMessage. + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2009-10-16T16:30:09.592Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2009-10-16T16:40:10.323Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2009-10-16T17:50:03.365Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2009-10-16T17:59:16.270Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2009-11-27T15:22:48.433Z + + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2009-11-27T15:47:29.716Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-01-12T20:39:20.430Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-01-13T17:59:36.652Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-01-13T19:08:21.266Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-01-13T19:56:37.843Z + + + + + ingest + + fedoraAdmin + 2010-01-26T20:06:21.726Z + Ingested from local file /Users/aoneill/Desktop/tmp/islandora_slideCModel.xml + + + + ingest + + aoneill + 2010-03-31T22:51:13.964Z + Fedora Object Ingested + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-03-31T22:54:03.479Z + + + + + ingest + + aoneill + 2010-04-01T18:17:22.725Z + Fedora Object Ingested + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-04-01T18:25:12.904Z + + + + + ingest + + admin + 2010-08-26T18:57:07.237Z + Fedora Object Ingested + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-09-16T16:01:27.415Z + + + + + + + + - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + 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 @@ -212,1255 +212,1255 @@ demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - + + + + + + + + + - - + - Slide Content Model - islandora:slideCModel - - - - - - Slide Content Model + islandora:slideCModel + + + + + + - - - - image/jpeg - - - - - plugins/image_rotator_tagger_block.inc - ShowILivesStreamsInFieldSets - showJPG - - - - image/jpeg - - - - - - - + + + image/jpeg + + + + + plugins/image_rotator_tagger_block.inc + ShowILivesStreamsInFieldSets + showJPG + + + + image/jpeg + + + + + + + - - - - image/jpeg - - - - - plugins/image_rotator_tagger_block.inc - ShowILivesStreamsInFieldSets - showJPG - - - - - - - - + + + image/jpeg + + + + + plugins/image_rotator_tagger_block.inc + ShowILivesStreamsInFieldSets + showJPG + + + + + + + + - - - - image/jpeg - - - - - ilives/image_rotator_tagger_block.inc - ShowILivesStreamsInFieldSets - showJPG - - - - - - - - + + + image/jpeg + + + + + ilives/image_rotator_tagger_block.inc + ShowILivesStreamsInFieldSets + showJPG + + + + + + + + - - - - image/jpeg - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - - + + + image/jpeg + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + + + - - - - image/jpeg - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - - - - - + + + image/jpeg + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + plugins/ShowStreamsInFieldSets.inc + ShowStreamsInFieldSets + showQdc + + + + + + + + - - - - image/jpeg - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - - + + + image/jpeg + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + + + - - - - image/tiff - image/tif - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + image/tif + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + 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 - - - - - - - + + + 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/tiff - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jpg - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jpg + JP2 + + + + + + + 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/tiff - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + 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/tiff - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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/tiff - image/tif - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + image/tif + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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/tiff - image/tif - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - + + + + image/tiff + image/tif + + + + + plugins/slide_viewer.inc + ShowSlideStreamsInFieldSets + showJPG + + + + + + image/tiff - - + + image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - - - - + + + plugins/ImageManipulation.inc + ImageManipulation + createJP2 + jp2 + JP2 + + + + + + + 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/tiff - image/tif - - - - image/tiff - image/tif - - + image/tiff + image/tif + + + + image/tiff + image/tif + + - - - - - - - - - - + + + + + + + + + - - - 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. - - - - - - - + + + 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. + + + + + + + diff --git a/content_models/islandora_viewerSdep-slideCModel.xml b/content_models/islandora_viewerSdep-slideCModel.xml index d45fddb8..694c66f8 100644 --- a/content_models/islandora_viewerSdep-slideCModel.xml +++ b/content_models/islandora_viewerSdep-slideCModel.xml @@ -1,199 +1,199 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-27T17:57:45.462Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2009-11-27T18:02:20.095Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2009-11-27T18:17:31.165Z - - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2009-11-27T18:20:50.036Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2009-11-27T18:22:44.560Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2009-11-27T18:37:33.153Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-03-11T21:01:10.851Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-14T20:05:44.278Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-27T17:57:45.462Z + Created with Admin GUI "New Object" command + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2009-11-27T18:02:20.095Z + + + + + modifyDatastreamByValue + METHODMAP + fedoraAdmin + 2009-11-27T18:17:31.165Z + + + + + modifyDatastreamByValue + DSINPUTSPEC + fedoraAdmin + 2009-11-27T18:20:50.036Z + + + + + modifyDatastreamByValue + WSDL + fedoraAdmin + 2009-11-27T18:22:44.560Z + + + + + modifyDatastreamByValue + WSDL + fedoraAdmin + 2009-11-27T18:37:33.153Z + + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-03-11T21:01:10.851Z + + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-05-14T20:05:44.278Z + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + This METHODMAP datastream is included as a starting point to assist in the creation of a service deployment. The METHODMAP should define the the mapping of the WSDL to Fedora object methods. - - - - + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - + + This DSINPUTSPEC datastream is included as a starting point to assist in the creation of a service deployment. The DSINPUTSPEC should define the datastreams to be used by WSDL-defined methods. - - - - + + + - - - - DC - text/xml - - - - - - - - + + + DC + text/xml + + + + + + + + - - + + This WSDL datastream is included as a starting point to assist in the creation of a service deployment. The WSDL should define the services provided by this @@ -205,107 +205,107 @@ demo:2, demo:13, demo:20, and demo:28. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - viewerSdep-slideCModel - islandora:viewerSdep-slideCModel - - - - + viewerSdep-slideCModel + islandora:viewerSdep-slideCModel + + + + diff --git a/example_collection_views/MHL-sparqltoHtml.xsl b/example_collection_views/MHL-sparqltoHtml.xsl index 2b3295fe..4a2904f6 100644 --- a/example_collection_views/MHL-sparqltoHtml.xsl +++ b/example_collection_views/MHL-sparqltoHtml.xsl @@ -1,196 +1,270 @@ - - - - - - - - - - - - - - - - - - + + +
-
+
+ -
-
- - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - - /fedora/repository/// - - - - - - - - - /fedora/repository//TN - -
- - - - - - -
-- - - /fedora/repository//-/ - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + + /fedora/repository/ + / + / + + + + + + + + + + + + /fedora/repository/ + /TN + + + +
+ + + + + + + +
-- + + + /fedora/repository/ + /-/ + + DETAILS - -- -
- - - - - - -
- - -   - - - - - - - - - - + -- + + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + +
\ No newline at end of file diff --git a/example_collection_views/critter.xsl b/example_collection_views/critter.xsl index 294218ed..cbfcd81b 100644 --- a/example_collection_views/critter.xsl +++ b/example_collection_views/critter.xsl @@ -1,33 +1,96 @@ - + - + -
    -
  • Date Collected:
  • -
  • Type:
  • -
  • Phylum:
  • -
  • SubPhylum:
  • -
  • Class:
  • -
  • Order:
  • -
  • Family:
  • -
  • Genus:
  • -
  • Species:
  • +
      +
    • + Date Collected: + + +
    • +
    • + Type: + + +
    • +
    • + Phylum: + + +
    • +
    • + SubPhylum: + + +
    • +
    • + Class: + + +
    • +
    • + Order: + + +
    • +
    • + Family: + + +
    • +
    • + Genus: + + +
    • +
    • + Species: + + +
    • -
    +
-

Collection Location

-
    -
  • Site Name:
  • -
  • Country:
  • -
  • Region:
  • -
  • Latitude:
  • -
  • Longitude:
  • -
  • Depth: Feet
  • -
-

Description

-
+

Collection Location

+
    +
  • + Site Name: + + +
  • +
  • + Country: + + +
  • +
  • + Region: + + +
  • +
  • + Latitude: + + +
  • +
  • + Longitude: + + +
  • +
  • + Depth: + + + Feet +
  • +
+

Description

+
+ +
-
+
\ No newline at end of file diff --git a/example_collection_views/flv-sparqltoHtml.xsl b/example_collection_views/flv-sparqltoHtml.xsl index e591de97..7eebe2f3 100644 --- a/example_collection_views/flv-sparqltoHtml.xsl +++ b/example_collection_views/flv-sparqltoHtml.xsl @@ -1,65 +1,96 @@ - - - - - - - - - - - - - - - - - -
-
+
+ -
-
- - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - - /fedora/repository//OBJ/ - - - - - - - /fedora/repository//-/ - - - /fedora/repository//TN - - - -
- - - /fedora/repository//-/ - - - + + + + + +
+ + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + + /fedora/repository/ + /OBJ/ + + + + + + + + /fedora/repository/ + /-/ + + + + + /fedora/repository/ + /TN + + + + + + +
+ + + /fedora/repository/ + /-/ + + + + - - - - - - -
- - -   - - - - - - - - - - + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + +
\ No newline at end of file diff --git a/example_collection_views/mlp-sparqltoHtml.xsl b/example_collection_views/mlp-sparqltoHtml.xsl index 63688c08..892d8ed2 100644 --- a/example_collection_views/mlp-sparqltoHtml.xsl +++ b/example_collection_views/mlp-sparqltoHtml.xsl @@ -1,193 +1,264 @@ - - - - - - - - - - - - - - - - - - + + +
-
+
+ -
-
- - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - - /fedora/repository/// - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + + /fedora/repository/ + / + / + + + + + - - /fedora/repository//TN - -
+ + + /fedora/repository/ + /TN + + +
- + - -
-- - - /fedora/repository//-/ - + +
-- +
+ + /fedora/repository/ + /-/ + + DETAILS - -- -
- - - - - - -
- - -   - - - - - - - - - - + -- + + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + +
\ No newline at end of file diff --git a/example_collection_views/refworks.xsl b/example_collection_views/refworks.xsl index 2ef0c8df..e021ef2b 100644 --- a/example_collection_views/refworks.xsl +++ b/example_collection_views/refworks.xsl @@ -1,92 +1,216 @@ - + - - -

General Information

- - - - - - - - - - - - - - - -
Periodical:
Abbreviation:
Volume:
Issue:
Publisher:
Place of Publication:
Edition:
Year:
Date:
Start Page:
Other Pages:
ISSN/ISBN:
Language:
UL:
-
- -

Titles

-
    - -
  • -
    -
-
- -
    -

    Secondary Titles

    - -
  • -
    -
-
- -

Authors

-
    - -
  • -
    -
-
+ + +

General Information

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Periodical: + + +
+ Abbreviation: + + +
+ Volume: + + +
+ Issue: + + +
+ Publisher: + + +
+ Place of Publication: + + +
+ Edition: + + +
+ Year: + + +
+ Date: + + +
+ Start Page: + + +
+ Other Pages: + + +
+ ISSN/ISBN: + + +
+ Language: + + +
+ UL: + + +
+
+ +

Titles

+
    + +
  • + +
  • +
    +
+
+ +
    +

    Secondary Titles

    + +
  • + +
  • +
    +
+
+ +

Authors

+
    + +
  • + +
  • +
    +
+
- -
    -

    Secondary Authors

    - -
  • -
    -
-
- -

Keywords

-
    - -
  • -
    -
-
- -

Abstract

- -
-
-
- -

Notes

- -
-
-
- - - - - http://articles.library.upei.ca:7888/godot/hold_tab.cgi?hold_tab_branch=PCU&issn=&date=&volume=&issue=&spage=&atitle=&stitle= - -
- - - -
+ +
    +

    Secondary Authors

    + +
  • + +
  • +
    +
+
+ +

Keywords

+
    + +
  • + +
  • +
    +
+
+ +

Abstract

+ +
+ +
+
+
+ +

Notes

+ +
+ +
+
+
+ + + + + http://articles.library.upei.ca:7888/godot/hold_tab.cgi?hold_tab_branch=PCU&issn= + &date= + &volume= + &issue= + &spage= + &atitle= + &stitle= + + +
+ + + +
\ No newline at end of file diff --git a/example_collection_views/riri-sparqltoHtml.xsl b/example_collection_views/riri-sparqltoHtml.xsl index 72907d1c..28f4e663 100644 --- a/example_collection_views/riri-sparqltoHtml.xsl +++ b/example_collection_views/riri-sparqltoHtml.xsl @@ -1,65 +1,96 @@ - - - - - - - - - - - - - - - - - -
-
+
+ -
-
- - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - - /fedora/repository//OBJ/.pdf - - - - - - - - - /fedora/repository//TN - - - -
- - - - - - -
-- - - /fedora/repository//-/ - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + + /fedora/repository/ + /OBJ/ + .pdf + + + + + + + + + + + /fedora/repository/ + /TN + + + + + + +
+ + + + + + + +
-- + + + /fedora/repository/ + /-/ + + DETAILS - -- -
- - - - - - -
- - -   - - - - - - - - - - + -- + + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + +
\ No newline at end of file diff --git a/example_collection_views/sparqltoHtml.xsl b/example_collection_views/sparqltoHtml.xsl index 15e2e35e..7bb1f0d6 100644 --- a/example_collection_views/sparqltoHtml.xsl +++ b/example_collection_views/sparqltoHtml.xsl @@ -1,125 +1,190 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + + + +
-
+ + + /fedora/repository/ + /TN + + + + + + /fedora/repository/ + /-/ + + + + +
+ -
-
+ + + + +
+
\ No newline at end of file diff --git a/fedora_repository.install b/fedora_repository.install index 84016939..27cd4ffe 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -1,5 +1,6 @@ collection settings are correct.', - array('@collection-settings' => $base_url.'/admin/settings/fedora_repository')); + array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); } else { $requirements['fedora-repository']['value'] = t("Available"); diff --git a/fedora_repository.module b/fedora_repository.module index 307f2ec2..d7765e01 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1,6 +1,6 @@ createAdminForm(); } - - /** * drupal hook * calls the fedora_repositorys_admin form @@ -56,9 +54,9 @@ function fedora_repository_purge_object($pid = NULL, $name = NULL) { return ''; } $output = t('Are you sure you wish to purge object %name %pid!
This cannot be undone
', - array( - '%name' => $name, - '%pid' => $pid) + array( + '%name' => $name, + '%pid' => $pid) ); $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); @@ -201,7 +199,7 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { if (!empty($file)) { if (!in_array($dformat, $allowedMimeTypes)) { form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . - implode(' ', $allowedMimeTypes))); + implode(' ', $allowedMimeTypes))); file_delete($file); return; } @@ -368,9 +366,9 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } $validators = array( - // 'file_validate_is_image' => array(), - // 'file_validate_image_resolution' => array('85x85'), - // 'file_validate_size' => array(30 * 1024), + // 'file_validate_is_image' => array(), + // 'file_validate_image_resolution' => array('85x85'), + // 'file_validate_size' => array(30 * 1024), ); $fileObject = file_save_upload('add-stream-file-location', $validators); @@ -395,8 +393,8 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) } $output = t('Are you sure you wish to purge this datastream %name
', - array( - '%name' => $name) + array( + '%name' => $name) ); $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); return $output; @@ -435,7 +433,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { } elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { $collectionPid = $_SESSION['fedora_collection']; - + $form_state['redirect'] = "fedora/repository/$collectionPid/"; } else { @@ -527,14 +525,14 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $dsid = $form_state['values']['dsId']; $dsLabel = $form_state['values']['dsLabel']; // Remove the original file extension from the label and add the new one - $indexOfDot = strrpos($dsLabel,'.');//use strrpos to get the last dot - if($indexOfDot !== FALSE){ + $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot + if ($indexOfDot !== FALSE) { $dsLabel = substr($dsLabel, 0, $indexOfDot); $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; } module_load_include('inc', 'Fedora_Repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - + $file_basename = basename($file->filepath); $file_directory = dirname($file->filepath); $streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename); @@ -546,11 +544,10 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $dformat = $mimetype->getType($file->filepath); $item = new Fedora_Item($pid); - + $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); - - $form_state['redirect'] = 'fedora/repository/' . $pid; + $form_state['redirect'] = 'fedora/repository/' . $pid; } function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { @@ -726,8 +723,8 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU drupal_set_message('The Fedora repository server is currently unavailable. Please contact the site administrator.', 'warning', FALSE); return ''; } - - if ($pid &!validPid($pid)) { + + if ($pid & !validPid($pid)) { drupal_set_message(t("Invalid PID!"), 'error'); return ' '; @@ -806,8 +803,8 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $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 @@ -869,7 +866,7 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU $item = new Fedora_Item($pid); - if ($item !== false) { + if ($item !== FALSE) { echo $item->get_dissemination($servicePid, $serviceMethod); } @@ -1180,7 +1177,6 @@ function fedora_repository_theme() { 'arguments' => array( 'element' => NULL ), - 'fedora_repository_solution_packs_list' => array( 'arguments' => array( 'solution_packs' => NULL, @@ -1263,10 +1259,10 @@ function fedora_repository_demo_objects_form() { ); foreach (array( - 'islandora:collectionCModel' => 'Islandora default content models', - 'islandora:top' => 'Islandora top-level collection', - 'islandora:demos' => 'Islandora demos collection', - 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', + 'islandora:collectionCModel' => 'Islandora default content models', + 'islandora:top' => 'Islandora top-level collection', + 'islandora:demos' => 'Islandora demos collection', + 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', ) as $available_demo => $available_demo_desc) { try { @@ -1413,7 +1409,7 @@ 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'); @@ -1432,7 +1428,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { if (!empty($form_state['values']['demo_collections']['islandora:largeimages'])) { $error = ''; foreach (array('islandora_jp2Sdep-slideCModel.xml', 'islandora_mods2htmlSdef.xml', 'islandora_mods2htmlSdep.xml', - 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { + 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { try { $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/' . $foxml_file); } catch (exception $e) { @@ -1454,16 +1450,15 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { } } - function fedora_repository_required_fedora_objects() { // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) $module_path = drupal_get_path('module', 'fedora_repository'); - return array ( + return array( 'fedora_repository' => array( 'module' => 'fedora_repository', 'title' => 'Islandora Core', - 'objects' => array ( - array ( + 'objects' => array( + array( 'pid' => 'islandora:collectionCModel', 'label' => 'Islandora Collection Content Model', 'dsid' => 'ISLANDORACM', @@ -1471,7 +1466,7 @@ function fedora_repository_required_fedora_objects() { 'dsversion' => 2, 'cmodel' => 'fedora-system:ContentModel-3.0', ), - array ( + array( 'pid' => 'islandora:strict_pdf', 'label' => 'Islandora strict PDF content model', 'dsid' => 'ISLANDORACM', @@ -1482,85 +1477,85 @@ function fedora_repository_required_fedora_objects() { 'pid' => 'islandora:top', 'label' => 'Islandora Top-level Collection', 'cmodel' => 'islandora:collectionCModel', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - ), + ), ), - array ( + array( 'pid' => 'islandora:ContentModelCollection', 'label' => 'Collection of installed content models', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:top', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_VIEW', 'datastream_file' => "$module_path/collection_views/simple_list_view.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/contentModel.jpg", 'mimetype' => 'image/jpeg', ), - array ( + array( 'dsid' => 'QUERY', 'datastream_file' => "$module_path/collection_views/cmodel_collection_query.txt", 'mimetype' => 'text/plain', ), ), ), - array ( + array( 'pid' => 'islandora:demos', 'label' => 'Islandora demos collection', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:top', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", ), ), ), - array ( + array( 'pid' => 'islandora:pdf_collection', 'label' => 'Islandora Demo PDF Collection', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:demos', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Crystal_Clear_mimetype_pdf.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/PDF-COLLECTION POLICY.xml", ), ), ), - array ( + array( 'pid' => 'demo:DualResImage', 'foxml_file' => "$module_path/content_models/demo_DualResImage.xml", 'datastreams' => array( - array ( + array( 'dsid' => 'ISLANDORACM', 'datastream_file' => "$module_path/content_models/STANDARD JPG.xml", ), ), ), - array ( + array( 'pid' => 'demo:DualResImageCollection', 'foxml_file' => "$module_path/content_models/demo_DualResImageCollection.xml", 'datastreams' => array( @@ -1570,51 +1565,51 @@ function fedora_repository_required_fedora_objects() { ), ), ), - array ( + array( 'pid' => 'demo:DualResolution', 'foxml_file' => "$module_path/content_models/demo_DualResolution.xml", ), - array ( + array( 'pid' => 'demo:DualResImageImpl', 'foxml_file' => "$module_path/content_models/demo_DualResImageImpl.xml", ), - array ( + array( 'pid' => 'demo:CollectionImpl', 'foxml_file' => "$module_path/content_models/demo_CollectionImpl.xml", ), - array ( + array( 'pid' => 'demo:Collection', 'foxml_file' => "$module_path/content_models/demo_Collection.xml", ), - array ( + array( 'pid' => 'islandora:demo_image_collection', 'label' => 'Demo Image Collection', 'cmodel' => 'demo:DualResImageCollection', 'parent' => 'islandora:demos', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/JPG-COLLECTION POLICY.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_VIEW', 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml", ), - array ( + array( 'dsid' => 'QUERY', 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt", 'mimetype' => 'text/plain', ), - array ( + array( 'dsid' => 'DC', 'datastream_file' => "$module_path/collection_views/demo_image_collection_dc_record.xml", ), - ), + ), ), ), ), @@ -1939,9 +1934,9 @@ function theme_add_to_basket_link($pid, $type = 'object') { */ if (!_is_added_to_basket($pid)) { return l( - theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), - "fedora/repository/addToBasket/" . $path, - array('html' => TRUE) + theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), + "fedora/repository/addToBasket/" . $path, + array('html' => TRUE) ); } @@ -1964,7 +1959,6 @@ function fedora_repository_display_schema($file) { return; } - function fedora_repository_batch_reingest_object($object, &$context) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -1989,8 +1983,8 @@ function fedora_repository_batch_reingest_object($object, &$context) { } } if (!empty($object['dsid']) && !empty($object['datastream_file'])) { - $datastreams = array ( - array ( + $datastreams = array( + array( 'dsid' => $object['dsid'], 'datastream_file' => $object['datastream_file'], ) @@ -1999,19 +1993,19 @@ function fedora_repository_batch_reingest_object($object, &$context) { elseif (!empty($object['datastreams'])) { $datastreams = $object['datastreams']; } - + if (!empty($datastreams) && is_array($datastreams)) { $label = !empty($object['label']) ? $object['label'] : ''; if (empty($object['foxml_file']) && !defined($new_item)) { $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); } if (!empty($object['cmodel'])) { - $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); + $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); } if (!empty($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'); } @@ -2037,13 +2031,14 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid $return = NULL; if (isset($item)) { $doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); - } elseif (isset($datastream_file)) { + } + elseif (isset($datastream_file)) { $doc = simplexml_load_file($datastream_file); } - + if (!empty($doc)) { $attrs = $doc->attributes(); - foreach($attrs as $name => $value) { + foreach ($attrs as $name => $value) { if ($name == 'version') { $return = (int) $value; break; @@ -2052,18 +2047,18 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid } return $return; } - + function theme_fedora_repository_solution_packs_list($solution_packs) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $output = ''; $header = array(); $rows = array(); - - - - - drupal_add_css(drupal_get_path('module', 'update') .'/update.css'); + + + + + drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); return $output; } diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index ad49ce86..28106517 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -1,6 +1,5 @@ exists()) { $object_status = 'Missing'; $needs_install = TRUE; - } else { + } + else { if (isset($object['dsid']) && isset($object['datastream_file']) && isset($object['dsversion'])) { $datastreams = array( array( @@ -96,7 +96,8 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul 'dsversion' => $object['dsversion'], ), ); - } elseif (!empty($object['datastreams'])) { + } + elseif (!empty($object['datastreams'])) { $datastreams = $object['datastreams']; } if (!empty($datastreams) && is_array($datastreams)) { @@ -118,7 +119,7 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul } } } - } + } } array_push($table_row, $object_status); $table_rows[] = $table_row; @@ -137,7 +138,8 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul ); if (!$needs_install && !$needs_update) { $form['install_status']['#value'] = theme_image('misc/watchdog-ok.png') . t('All required objects are installed and up-to-date.'); - } else { + } + else { $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); } $form['submit'] = array( diff --git a/formClass.inc b/formClass.inc index dc369357..3fe34582 100644 --- a/formClass.inc +++ b/formClass.inc @@ -1,6 +1,6 @@ t('Solution Packs'), - 'description' => t('Install content models and collections required by installed solution packs.'), - 'page callback' => 'fedora_repository_solution_packs_page', - 'access arguments' => array('add fedora datastreams'), - 'file' => 'fedora_repository.solutionpacks.inc', - 'type' => MENU_LOCAL_TASK, + 'title' => t('Solution Packs'), + 'description' => t('Install content models and collections required by installed solution packs.'), + 'page callback' => 'fedora_repository_solution_packs_page', + 'access arguments' => array('add fedora datastreams'), + 'file' => 'fedora_repository.solutionpacks.inc', + 'type' => MENU_LOCAL_TASK, ); $items['islandoracm.xsd'] = array( @@ -78,7 +78,7 @@ class formClass { 'page callback' => 'repository_page', 'type' => MENU_NORMAL_ITEM, 'access arguments' => array('view fedora collection'), - // 'access' => TRUE + // 'access' => TRUE ); $items['fedora/repository/service'] = array( @@ -242,7 +242,7 @@ class formClass { '#type' => 'textfield', '#title' => t('Fedora RISearch URL'), '#default_value' => variable_get('fedora_repository_url', - 'http://localhost:8080/fedora/risearch'), + 'http://localhost:8080/fedora/risearch'), '#description' => t('The url of the Fedora server'), '#required' => TRUE, '#weight' => 0 ); @@ -577,7 +577,6 @@ class formClass { if (!empty($newElements)) { $available_dsids = array_merge($available_dsids, $newElements); } - } } @@ -640,19 +639,19 @@ class formClass { ); if (!empty($unused_dsids)) { - $dsidsForForm = array(); - foreach ($unused_dsids as $dsid){ - $dsidsForForm[$dsid]=$dsid; - } + $dsidsForForm = array(); + foreach ($unused_dsids as $dsid) { + $dsidsForForm[$dsid] = $dsid; + } $form['stream_id'] = array( '#type' => 'select', '#title' => t('Datastream ID'), '#default_value' => variable_get('feed_item_length', 'teaser'), '#weight' => '-1', '#description' => t('Datastream IDs defined by the content model.'), - ); + ); $form['stream_id']['#options'] = array_combine($unused_dsids, $unused_dsids); - } + } else { $form['stream_id'] = array( '#title' => 'Datastream ID', diff --git a/form_elements/css/copyright.css b/form_elements/css/copyright.css index cc663232..4a4005f0 100644 --- a/form_elements/css/copyright.css +++ b/form_elements/css/copyright.css @@ -1,7 +1,7 @@ .cc_preview { - width: 250px; - overflow: none; - border: 0px solid black; - float: right; + width: 250px; + overflow: none; + border: 0px solid black; + float: right; } \ No newline at end of file diff --git a/form_elements/css/filechooser.css b/form_elements/css/filechooser.css index f8b48594..dfef5a57 100644 --- a/form_elements/css/filechooser.css +++ b/form_elements/css/filechooser.css @@ -2,25 +2,25 @@ border: 1px solid black; float: left; background-color: #dfdfdf; - - /* - position: relative; - visibility: hidden; - left: -5000px;*/ - - width: 680px; - height: 200px; - + + /* + position: relative; + visibility: hidden; + left: -5000px;*/ + + width: 680px; + height: 200px; + } .carousel li { - cursor:pointer; + cursor:pointer; } .carousel li.selected { - background-color: #999; + background-color: #999; } .carousel li div @@ -56,38 +56,38 @@ .carousel li div.audioplaceholder { - width: 128px; - height: 128px; - margin: 10px 10px 0 10px; - background-image: url('../images/video.png'); - background-repeat:no-repeat; + width: 128px; + height: 128px; + margin: 10px 10px 0 10px; + background-image: url('../images/video.png'); + background-repeat:no-repeat; } .carousel li div.imageplaceholder { - width: 128px; - height: 128px; - margin: 10px 10px 0 10px; - background-image: url('../images/image.png'); - background-repeat:no-repeat; + width: 128px; + height: 128px; + margin: 10px 10px 0 10px; + background-image: url('../images/image.png'); + background-repeat:no-repeat; } .carousel li div.applicationplaceholder { - width: 128px; - height: 128px; - margin: 10px 10px 0 10px; - background-image: url('../images/application.png'); - background-repeat:no-repeat; + width: 128px; + height: 128px; + margin: 10px 10px 0 10px; + background-image: url('../images/application.png'); + background-repeat:no-repeat; } .carousel li.loading { - font-size: 150%; - margin: auto; - margin-top: 50px; - text-align: center; - - width: 250px; + font-size: 150%; + margin: auto; + margin-top: 50px; + text-align: center; + + width: 250px; } diff --git a/form_elements/css/list.css b/form_elements/css/list.css index 8e52d5ce..ac3354d1 100644 --- a/form_elements/css/list.css +++ b/form_elements/css/list.css @@ -1,25 +1,25 @@ .tagEditor { - margin: 4px 0; - padding: 0; + margin: 4px 0; + padding: 0; } .tagEditor li { - display: inline; - background-image: url('../images/minus_small.png'); - background-color: #efe; - background-position: right center; - background-repeat: no-repeat; - list-style-type: none; - padding: 0 18px 0 6px; - margin: 0 4px; - cursor: pointer; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; + display: inline; + background-image: url('../images/minus_small.png'); + background-color: #efe; + background-position: right center; + background-repeat: no-repeat; + list-style-type: none; + padding: 0 18px 0 6px; + margin: 0 4px; + cursor: pointer; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; } .tagEditor li:hover { - background-color: #eee; + background-color: #eee; } \ No newline at end of file diff --git a/form_elements/css/people.css b/form_elements/css/people.css index 06b54ad0..729952d4 100644 --- a/form_elements/css/people.css +++ b/form_elements/css/people.css @@ -4,134 +4,134 @@ #ife-peoplelist-table { - margin-top: 15px; - width: 100%; + margin-top: 15px; + width: 100%; } #ife-peoplelist-table .form-item { - margin-bottom: 5px; + margin-bottom: 5px; } #ife-peoplelist-table .form-item .description { - margin-top: 3px; + margin-top: 3px; } #ife-peoplelist-table .ife-person-name { - width: auto; - height: 125px; + width: auto; + height: 125px; } #ife-peoplelist-table .ife-person-name label{ - font-weight: bold; - float: left; - clear: left; - width: 125px; + font-weight: bold; + float: left; + clear: left; + width: 125px; } #ife-peoplelist-table .ife-person-role { - width: 150px; - padding-right: 50px; + width: 150px; + padding-right: 50px; } #ife-peoplelist-table .ife-person-remove { - width: 100px; + width: 100px; } #ife-peoplelist-table .description { - white-space: normal; + white-space: normal; } #ife-peoplelist-table .ife-person-content .form-item .form-text { - width: 150px; + width: 150px; } #ife-peoplelist-table .ife-person-view-content input.form-submit { - display: none; + display: none; } #ife-peoplelist-table .ife-person-content { - display: none; + display: none; } #ife-peoplelist-table .ife-person-remove label, #add-more-people-button label, #add-more-conf-button label, #add-more-org-button label { - font-weight: bold; - float: left; - clear: left; - width: auto; + font-weight: bold; + float: left; + clear: left; + width: auto; } #add-more-org-button, #add-more-conf-button, #add-more-people-button { - width: 150px; - display: block; - margin-top: 20px; - float: right; + width: 150px; + display: block; + margin-top: 20px; + float: right; } .add-person, .add-conf, .add-org, #ife-peoplelist-table .delete-person { - display: block; - overflow: hidden; - width: 32px; - height: 32px; - padding: 0; - margin: 0; - border: 0; - text-indent: -9999px; - cursor: pointer; /* hand-shaped cursor */ - cursor: hand; /* for IE 5.x */ + display: block; + overflow: hidden; + width: 32px; + height: 32px; + padding: 0; + margin: 0; + border: 0; + text-indent: -9999px; + cursor: pointer; /* hand-shaped cursor */ + cursor: hand; /* for IE 5.x */ } .add-person { - background: transparent url(../images/add_user.png) no-repeat 0 0; + background: transparent url(../images/add_user.png) no-repeat 0 0; } .delete-person { - background: transparent url(../images/editdelete.png) no-repeat 0 0; + background: transparent url(../images/editdelete.png) no-repeat 0 0; } .add-org { - background: transparent url(../images/add_group.png) no-repeat 0 0; + background: transparent url(../images/add_group.png) no-repeat 0 0; } .add-conf { - background: transparent url(../images/groupevent.png) no-repeat 0 0; + background: transparent url(../images/groupevent.png) no-repeat 0 0; } /* QT style selection form */ div.ife-people-preview { - border: none; - width: 280px; - height: 80px; + border: none; + width: 280px; + height: 80px; } #ife-people-settings .ife-people-styles .form-item { - width: 280px; - float: left; - margin: 0 10px 10px 0; - border: 1px solid #ccc; - background-color: #fff; + width: 280px; + float: left; + margin: 0 10px 10px 0; + border: 1px solid #ccc; + background-color: #fff; } #ife-people-settings .ife-people-styles .form-item .option { - display: block; - background-color: #bfe3ff; - font: bold 12px/18px verdana; - color: #0a5793; + display: block; + background-color: #bfe3ff; + font: bold 12px/18px verdana; + color: #0a5793; } #ife-people-settings .ife-people-styles .form-item .option:hover { - background-color: #aadaff; - cursor: pointer; - color: #003863; + background-color: #aadaff; + cursor: pointer; + color: #003863; } #ife-people-settings .ife-people-styles .form-item .option .form-radio { - margin-right: 5px; - float: left; - height: 15px; - margin-top: 2px; + margin-right: 5px; + float: left; + height: 15px; + margin-top: 2px; } #ife-people-settings .ife-people_wrapper { - margin: 5px; - font: bold 12px/170% Verdana; + margin: 5px; + font: bold 12px/170% Verdana; } diff --git a/form_elements/css/sticky.css b/form_elements/css/sticky.css index a58588c9..30315f80 100644 --- a/form_elements/css/sticky.css +++ b/form_elements/css/sticky.css @@ -1,18 +1,18 @@ input.sticky { -height: 18px; -padding-left: 15px; -background: url(../images/pushpin.png) top left no-repeat; - filter:alpha(opacity=50); - -moz-opacity:0.5; - -khtml-opacity:0.5; - opacity:0.5; + height: 18px; + padding-left: 15px; + background: url(../images/pushpin.png) top left no-repeat; + filter:alpha(opacity=50); + -moz-opacity:0.5; + -khtml-opacity:0.5; + opacity:0.5; } input.sticky:checked { - background-image: url(../images/pushpin.png); - filter:alpha(opacity=100); - -moz-opacity:1; - -khtml-opacity:1; - opacity:1; + background-image: url(../images/pushpin.png); + filter:alpha(opacity=100); + -moz-opacity:1; + -khtml-opacity:1; + opacity:1; } \ No newline at end of file diff --git a/form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css b/form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css index 11ede670..4e85e94d 100644 --- a/form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css +++ b/form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css @@ -6,7 +6,7 @@ * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API - */ +*/ /* Layout helpers ----------------------------------*/ @@ -51,7 +51,7 @@ * http://docs.jquery.com/UI/Theming/API * * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px - */ +*/ /* Component containers @@ -300,7 +300,7 @@ * http://jquery.org/license * * http://docs.jquery.com/UI/Resizable#theming - */ +*/ .ui-resizable { position: relative;} .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } @@ -319,7 +319,7 @@ * http://jquery.org/license * * http://docs.jquery.com/UI/Selectable#theming - */ +*/ .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } /* * jQuery UI Accordion @VERSION @@ -329,7 +329,7 @@ * http://jquery.org/license * * http://docs.jquery.com/UI/Accordion#theming - */ +*/ /* IE/Win - Fix animation bug - #4615 */ .ui-accordion { width: 100%; } .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } @@ -347,7 +347,7 @@ * http://jquery.org/license * * http://docs.jquery.com/UI/Autocomplete#theming - */ +*/ .ui-autocomplete { position: absolute; cursor: default; } /* workarounds */ @@ -361,36 +361,36 @@ * http://jquery.org/license * * http://docs.jquery.com/UI/Menu#theming - */ +*/ .ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; } .ui-menu .ui-menu { - margin-top: -3px; + margin-top: -3px; } .ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; } .ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; } .ui-menu .ui-menu-item a.ui-state-hover, .ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; + font-weight: normal; + margin: -1px; } /* * jQuery UI Button @VERSION @@ -400,7 +400,7 @@ * http://jquery.org/license * * http://docs.jquery.com/UI/Button#theming - */ +*/ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ @@ -438,7 +438,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog#theming - */ +*/ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } .ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } @@ -459,7 +459,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad * http://jquery.org/license * * http://docs.jquery.com/UI/Slider#theming - */ +*/ .ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } @@ -482,7 +482,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad * http://jquery.org/license * * http://docs.jquery.com/UI/Tabs#theming - */ +*/ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } @@ -500,7 +500,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker#theming - */ +*/ .ui-datepicker { width: 17em; padding: .2em .2em 0; } .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } @@ -567,6 +567,6 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar#theming - */ +*/ .ui-progressbar { height:2em; text-align: left; } .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/form_elements/includes/autocomplete.inc b/form_elements/includes/autocomplete.inc index 90ead4cc..30b887a6 100644 --- a/form_elements/includes/autocomplete.inc +++ b/form_elements/includes/autocomplete.inc @@ -1,231 +1,231 @@ escape($string); - $query = 'name_personal_t:'.$string.'* OR name_organization_t:'.$string.'* OR name_conference_t:'.$string.'*'; - - $additionalParams = array( - 'facet' => 'false', - 'qt' => $requestHandler, - ); - - try { - $results = $solr->search($query, 0, 10,$additionalParams); - }catch (Exception $e) { - drupal_set_message(t('error searching ').$e->getMessage()); - } - if(empty($results)){ - drupal_set_message(t('Error searching solr index. Is the solr search block configured properly?'),'error'); - return ' '; - } - - header('content-type: text/plain'); - $matches = array(); - - foreach($results->response->docs as $doc) { - - $item = new fedora_item($doc->id); - - $mods = $item->get_datastream_dissemination('MODS'); - if (trim($mods) != '') { - $modsDom = new DomDocument(); - $modsDom->loadXML($mods); - - $xpath = new DOMXPath($modsDom); - $xpath->registerNamespace("php", "http://php.net/xpath"); - $xpath->registerPHPFunctions(); + + +function ife_autocomplete_person($string) { + $string = trim(strtolower($string)); + + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('php', 'islandora_solr_search', 'Solr/Service'); + $host = variable_get('islandora_solr_search_block_host', 'localhost'); + $port = variable_get('islandora_solr_search_block_port', '8080'); + $appName = variable_get('islandora_solr_search_block_app_name', 'solr'); + $requestHandler = variable_get("islandora_solr_search_block_request_handler", t("standard")); + + $solr = new Apache_Solr_Service($host, $port, '/' . $appName . '/'); + + $string = $solr->escape($string); + $query = 'name_personal_t:' . $string . '* OR name_organization_t:' . $string . '* OR name_conference_t:' . $string . '*'; + + $additionalParams = array( + 'facet' => 'false', + 'qt' => $requestHandler, + ); + + try { + $results = $solr->search($query, 0, 10, $additionalParams); + } catch (Exception $e) { + drupal_set_message(t('error searching ') . $e->getMessage()); + } + if (empty($results)) { + drupal_set_message(t('Error searching solr index. Is the solr search block configured properly?'), 'error'); + return ' '; + } + + header('content-type: text/plain'); + $matches = array(); + + foreach ($results->response->docs as $doc) { + + $item = new fedora_item($doc->id); + + $mods = $item->get_datastream_dissemination('MODS'); + if (trim($mods) != '') { + $modsDom = new DomDocument(); + $modsDom->loadXML($mods); + + $xpath = new DOMXPath($modsDom); + $xpath->registerNamespace("php", "http://php.net/xpath"); + $xpath->registerPHPFunctions(); // echo $mods; - $nodeList = $xpath->evaluate('/mods:mods/mods:name'); - foreach ($nodeList as $node) { - - $type=$node->getAttribute('type'); - $title=null; - $name =null; - $given=null; - $family=null; - $date = null; - $nameParts = $node->getElementsByTagName('namePart'); - foreach ($nameParts as $part) { - switch ($part->getAttribute('type')) { - case 'given': $given = $part->nodeValue; break; - case 'family': $family = $part->nodeValue; break; - case 'termsOfAddress': $title= $part->nodeValue; break; - case 'date': $date = $part->nodeValue; break; - default: $name = $part->nodeValue; break; - } - } - - if ($name == null && isset($given) && isset($family)) { - $name = (isset($title)?$title.' ':'').$family.', '.$given; - } - - $role =null; - $roleTerm = $node->getElementsByTagName('roleTerm'); - if ($roleTerm->length > 0) { - $role=$roleTerm->item(0)->nodeValue; - } - - if (strpos(strtolower($name),$string)!==FALSE) { - $display = $name; - $matches[json_encode(array('type'=>trim($type),'name'=>trim($name),'role'=>trim($role),'date'=>trim($date)))]= $display.' - '.$role.' '.$date; - } - } + $nodeList = $xpath->evaluate('/mods:mods/mods:name'); + foreach ($nodeList as $node) { + + $type = $node->getAttribute('type'); + $title = NULL; + $name = NULL; + $given = NULL; + $family = NULL; + $date = NULL; + $nameParts = $node->getElementsByTagName('namePart'); + foreach ($nameParts as $part) { + switch ($part->getAttribute('type')) { + case 'given': $given = $part->nodeValue; + break; + case 'family': $family = $part->nodeValue; + break; + case 'termsOfAddress': $title = $part->nodeValue; + break; + case 'date': $date = $part->nodeValue; + break; + default: $name = $part->nodeValue; + break; + } + } + + if ($name == NULL && isset($given) && isset($family)) { + $name = (isset($title) ? $title . ' ' : '') . $family . ', ' . $given; + } + + $role = NULL; + $roleTerm = $node->getElementsByTagName('roleTerm'); + if ($roleTerm->length > 0) { + $role = $roleTerm->item(0)->nodeValue; + } + + if (strpos(strtolower($name), $string) !== FALSE) { + $display = $name; + $matches[json_encode(array('type' => trim($type), 'name' => trim($name), 'role' => trim($role), 'date' => trim($date)))] = $display . ' - ' . $role . ' ' . $date; + } } } - drupal_json($matches); exit(); - + } + drupal_json($matches); + exit(); } function ife_autocomplete_marcrelator($collection, $string='') { $moduleRoot = drupal_get_path('module', 'islandora_form_elements'); if ($string == '') { - $string = $collection; - $collection = FALSE; - } - - $string=ucfirst(trim($string)); - - $dom = DOMDocument::load ( $moduleRoot .'/xml/relators.rdf' ); - $rootEl = $dom->getElementsByTagName('RDF'); - if ($rootEl->length > 0) { - $rootEl=$rootEl->item(0); - - $xpath = new DOMXPath($dom); - $xpath->registerNamespace ( 'skos' , $rootEl->getAttribute('xmlns:skos') ); - $xpath->registerNamespace ( 'rdf' , $rootEl->getAttribute('xmlns:rdf') ); - - - $result = $xpath->query('/rdf:RDF/rdf:Description[starts-with(skos:prefLabel, "'. $string .'")]'); - - $terms = array(); - foreach ($result as $term) { - $termVal =$term->getElementsByTagName('prefLabel')->item(0)->nodeValue; - $termVal = preg_replace('/\s+/', ' ', $termVal); - $terms[$term->getElementsByTagName('notation')->item(0)->nodeValue]= $termVal; - } - echo drupal_json($terms); - } - - + $string = $collection; + $collection = FALSE; + } + + $string = ucfirst(trim($string)); + + $dom = DOMDocument::load($moduleRoot . '/xml/relators.rdf'); + $rootEl = $dom->getElementsByTagName('RDF'); + if ($rootEl->length > 0) { + $rootEl = $rootEl->item(0); + + $xpath = new DOMXPath($dom); + $xpath->registerNamespace('skos', $rootEl->getAttribute('xmlns:skos')); + $xpath->registerNamespace('rdf', $rootEl->getAttribute('xmlns:rdf')); + + + $result = $xpath->query('/rdf:RDF/rdf:Description[starts-with(skos:prefLabel, "' . $string . '")]'); + + $terms = array(); + foreach ($result as $term) { + $termVal = $term->getElementsByTagName('prefLabel')->item(0)->nodeValue; + $termVal = preg_replace('/\s+/', ' ', $termVal); + $terms[$term->getElementsByTagName('notation')->item(0)->nodeValue] = $termVal; + } + echo drupal_json($terms); + } } function ife_autocomplete_gacs($collection, $string='') { $moduleRoot = drupal_get_path('module', 'islandora_form_elements'); if ($string == '') { - $string = $collection; - $collection = FALSE; - } - - $string=ucwords(trim($string)); - - $dom = DOMDocument::load ( $moduleRoot .'/xml/gacs.xml' ); - $rootEl = $dom->getElementsByTagName('codelist'); - if ($rootEl->length > 0) { - $rootEl=$rootEl->item(0); - - $xpath = new DOMXPath($dom); - $xpath->registerNamespace ( 'a' , $rootEl->getAttribute('xmlns') ); - - $result = $xpath->query('/a:codelist/a:gacs/a:gac[starts-with(a:name, "'. $string .'")]'); - - $gacs = array(); - foreach ($result as $gac) { - $gacs[$gac->getElementsByTagName('name')->item(0)->nodeValue]= $gac->getElementsByTagName('name')->item(0)->nodeValue; - } - echo drupal_json($gacs); - } - - + $string = $collection; + $collection = FALSE; + } + + $string = ucwords(trim($string)); + + $dom = DOMDocument::load($moduleRoot . '/xml/gacs.xml'); + $rootEl = $dom->getElementsByTagName('codelist'); + if ($rootEl->length > 0) { + $rootEl = $rootEl->item(0); + + $xpath = new DOMXPath($dom); + $xpath->registerNamespace('a', $rootEl->getAttribute('xmlns')); + + $result = $xpath->query('/a:codelist/a:gacs/a:gac[starts-with(a:name, "' . $string . '")]'); + + $gacs = array(); + foreach ($result as $gac) { + $gacs[$gac->getElementsByTagName('name')->item(0)->nodeValue] = $gac->getElementsByTagName('name')->item(0)->nodeValue; + } + echo drupal_json($gacs); + } } function ife_autocomplete_language($collection, $string='') { - $moduleRoot=drupal_get_path('module', 'islandora_form_elements'); + $moduleRoot = drupal_get_path('module', 'islandora_form_elements'); if ($string == '') { - $string = $collection; - $collection = FALSE; - } - - $string=ucwords(trim($string)); - - $dom = DOMDocument::load ( $moduleRoot .'/xml/languages.xml' ); - $rootEl = $dom->getElementsByTagName('codelist'); - if ($rootEl->length > 0) { - $rootEl=$rootEl->item(0); - - $xpath = new DOMXPath($dom); - $xpath->registerNamespace ( 'a' , $rootEl->getAttribute('xmlns') ); - - $result = $xpath->query('/a:codelist/a:languages/a:language[starts-with(a:name, "'. $string .'")]'); - - $languages = array(); - foreach ($result as $lang) { - $languages[$lang->getElementsByTagName('name')->item(0)->nodeValue]= $lang->getElementsByTagName('name')->item(0)->nodeValue; - } - echo drupal_json($languages); - } - - + $string = $collection; + $collection = FALSE; + } + + $string = ucwords(trim($string)); + + $dom = DOMDocument::load($moduleRoot . '/xml/languages.xml'); + $rootEl = $dom->getElementsByTagName('codelist'); + if ($rootEl->length > 0) { + $rootEl = $rootEl->item(0); + + $xpath = new DOMXPath($dom); + $xpath->registerNamespace('a', $rootEl->getAttribute('xmlns')); + + $result = $xpath->query('/a:codelist/a:languages/a:language[starts-with(a:name, "' . $string . '")]'); + + $languages = array(); + foreach ($result as $lang) { + $languages[$lang->getElementsByTagName('name')->item(0)->nodeValue] = $lang->getElementsByTagName('name')->item(0)->nodeValue; + } + echo drupal_json($languages); + } } function ife_autocomplete($field, $collection, $string='') { - - if ($string == '') { - $string=$collection; $collection=FALSE; - } - + + if ($string == '') { + $string = $collection; + $collection = FALSE; + } + module_load_include('php', 'islandora_solr_search', 'Solr/Service'); $host = variable_get('islandora_solr_search_block_host', 'localhost'); $port = variable_get('islandora_solr_search_block_port', '8080'); $appName = variable_get('islandora_solr_search_block_app_name', 'solr'); - $solr = new Apache_Solr_Service($host, $port, '/'. $appName .'/'); - + $solr = new Apache_Solr_Service($host, $port, '/' . $appName . '/'); + $additionalParams = array( 'fl' => $field ); - $query = $field .':'. $solr->escape(strtolower(trim($string))) .'*'; - + $query = $field . ':' . $solr->escape(strtolower(trim($string))) . '*'; + if ($collection != FALSE) { - $query .= ' AND related_item_identifier_t:'. $solr->escape($collection); + $query .= ' AND related_item_identifier_t:' . $solr->escape($collection); } - + try { $results = $solr->search($query, 0, 10, $additionalParams); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t('error searching ') . $e->getMessage()); - } - + } + $docs = $results->response->docs; $values = array(); if ($docs != NULL) { foreach ($docs as $doc) { - $resfield=$doc->getField($field); - - if (is_array($resfield['value'])) { - foreach ($resfield['value'] as $val) { - if (preg_match('/^'.strtolower($string).'/i',$val)) { - $values[$val]=$val; - } - } - } else { - $values[$resfield['value']]=$resfield['value']; + $resfield = $doc->getField($field); + + if (is_array($resfield['value'])) { + foreach ($resfield['value'] as $val) { + if (preg_match('/^' . strtolower($string) . '/i', $val)) { + $values[$val] = $val; + } + } + } + else { + $values[$resfield['value']] = $resfield['value']; } } } diff --git a/form_elements/includes/creative_commons.inc b/form_elements/includes/creative_commons.inc index 7213cb74..38760c2d 100644 --- a/form_elements/includes/creative_commons.inc +++ b/form_elements/includes/creative_commons.inc @@ -1,117 +1,116 @@ 'International', - 'ar' => 'Argentina', - 'au' => 'Australia', - 'at' => 'Austria', - 'be' => 'Belgium', - 'br' => 'Brazil', - 'bg' => 'Bulgaria', - 'ca' => 'Canada', - 'cl' => 'Chile', - 'cn' => 'ChinaMainland', - 'co' => 'Colombia', - 'hr' => 'Croatia', - 'cz' => 'CzechRepublic', - 'dk' => 'Denmark', - 'ec' => 'Ecuador', - 'fi' => 'Finland', - 'fr' => 'France', - 'de' => 'Germany', - 'gr' => 'Greece', - 'gt' => 'Guatemala', - 'hk' => 'HongKong', - 'hu' => 'Hungary', - 'in' => 'India', - 'il' => 'Israel', - 'it' => 'Italy', - 'jp' => 'Japan', - 'kr' => 'Korea', - 'lu' => 'Luxembourg', - 'mk' => 'Macedonia', - 'my' => 'Malaysia', - 'mt' => 'Malta', - 'mx' => 'Mexico', - 'nl' => 'Netherlands', - 'nz' => 'NewZealand', - 'no' => 'Norway', - 'pe' => 'Peru', - 'ph' => 'Philippines', - 'pl' => 'Poland', - 'pt' => 'Portugal', - 'pr' => 'PuertoRico', - 'ro' => 'Romania', - 'rs' => 'Serbia', - 'sg' => 'Singapore', - 'si' => 'Slovenia', - 'za' => 'SouthAfrica', - 'es' => 'Spain', - 'se' => 'Sweden', - 'ch' => 'Switzerland', - 'tw' => 'Taiwan', - 'th' => 'Thailand', - 'uk' => 'UK:England&Wales', - 'scotland' => 'UK:Scotland', - 'us' => 'UnitedStates', - 'vn' => 'Vietnam'); - public static $cc_versions = array( - ''=>'3.0', - 'ar'=>'2.5', - 'au'=>'3.0', - 'at'=>'3.0', - 'be'=>'2.0', - 'br'=>'3.0', - 'bg'=>'2.5', - 'ca'=>'2.5', - 'cl'=>'2.0', - 'cn'=>'2.5', - 'co'=>'2.5', - 'hr'=>'3.0', - 'cz'=>'3.0', - 'dk'=>'2.5', - 'ec'=>'3.0', - 'fi'=>'1.0', - 'fr'=>'2.0', - 'de'=>'3.0', - 'gr'=>'3.0', - 'gt'=>'3.0', - 'hk'=>'3.0', - 'hu'=>'2.5', - 'in'=>'2.5', - 'il'=>'2.5', - 'it'=>'2.5', - 'jp'=>'2.0', - 'kr'=>'2.0', - 'lu'=>'3.0', - 'mk'=>'2.5', - 'my'=>'2.5', - 'mt'=>'2.5', - 'mx'=>'2.5', - 'nl'=>'3.0', - 'nz'=>'3.0', - 'no'=>'3.0', - 'pe'=>'2.5', - 'ph'=>'3.0', - 'pl'=>'3.0', - 'pt'=>'2.5', - 'pr'=>'3.0', - 'ro'=>'3.0', - 'rs'=>'3.0', - 'sg'=>'3.0', - 'si'=>'2.5', - 'za'=>'2.5', - 'es'=>'3.0', - 'se'=>'2.5', - 'ch'=>'2.5', - 'tw'=>'3.0', - 'th'=>'3.0', - 'uk'=>'2.0', - 'scotland'=>'2.5', - 'us'=>'3.0', - 'vn'=>'3.0'); +class CreativeCommons { + + public static $cc_jurisdiction_vals = array( + '' => 'International', + 'ar' => 'Argentina', + 'au' => 'Australia', + 'at' => 'Austria', + 'be' => 'Belgium', + 'br' => 'Brazil', + 'bg' => 'Bulgaria', + 'ca' => 'Canada', + 'cl' => 'Chile', + 'cn' => 'ChinaMainland', + 'co' => 'Colombia', + 'hr' => 'Croatia', + 'cz' => 'CzechRepublic', + 'dk' => 'Denmark', + 'ec' => 'Ecuador', + 'fi' => 'Finland', + 'fr' => 'France', + 'de' => 'Germany', + 'gr' => 'Greece', + 'gt' => 'Guatemala', + 'hk' => 'HongKong', + 'hu' => 'Hungary', + 'in' => 'India', + 'il' => 'Israel', + 'it' => 'Italy', + 'jp' => 'Japan', + 'kr' => 'Korea', + 'lu' => 'Luxembourg', + 'mk' => 'Macedonia', + 'my' => 'Malaysia', + 'mt' => 'Malta', + 'mx' => 'Mexico', + 'nl' => 'Netherlands', + 'nz' => 'NewZealand', + 'no' => 'Norway', + 'pe' => 'Peru', + 'ph' => 'Philippines', + 'pl' => 'Poland', + 'pt' => 'Portugal', + 'pr' => 'PuertoRico', + 'ro' => 'Romania', + 'rs' => 'Serbia', + 'sg' => 'Singapore', + 'si' => 'Slovenia', + 'za' => 'SouthAfrica', + 'es' => 'Spain', + 'se' => 'Sweden', + 'ch' => 'Switzerland', + 'tw' => 'Taiwan', + 'th' => 'Thailand', + 'uk' => 'UK:England&Wales', + 'scotland' => 'UK:Scotland', + 'us' => 'UnitedStates', + 'vn' => 'Vietnam'); + public static $cc_versions = array( + '' => '3.0', + 'ar' => '2.5', + 'au' => '3.0', + 'at' => '3.0', + 'be' => '2.0', + 'br' => '3.0', + 'bg' => '2.5', + 'ca' => '2.5', + 'cl' => '2.0', + 'cn' => '2.5', + 'co' => '2.5', + 'hr' => '3.0', + 'cz' => '3.0', + 'dk' => '2.5', + 'ec' => '3.0', + 'fi' => '1.0', + 'fr' => '2.0', + 'de' => '3.0', + 'gr' => '3.0', + 'gt' => '3.0', + 'hk' => '3.0', + 'hu' => '2.5', + 'in' => '2.5', + 'il' => '2.5', + 'it' => '2.5', + 'jp' => '2.0', + 'kr' => '2.0', + 'lu' => '3.0', + 'mk' => '2.5', + 'my' => '2.5', + 'mt' => '2.5', + 'mx' => '2.5', + 'nl' => '3.0', + 'nz' => '3.0', + 'no' => '3.0', + 'pe' => '2.5', + 'ph' => '3.0', + 'pl' => '3.0', + 'pt' => '2.5', + 'pr' => '3.0', + 'ro' => '3.0', + 'rs' => '3.0', + 'sg' => '3.0', + 'si' => '2.5', + 'za' => '2.5', + 'es' => '3.0', + 'se' => '2.5', + 'ch' => '2.5', + 'tw' => '3.0', + 'th' => '3.0', + 'uk' => '2.0', + 'scotland' => '2.5', + 'us' => '3.0', + 'vn' => '3.0'); - } \ No newline at end of file +} \ No newline at end of file diff --git a/form_elements/includes/filechooser.inc b/form_elements/includes/filechooser.inc index 6bd077fa..c4b43717 100644 --- a/form_elements/includes/filechooser.inc +++ b/form_elements/includes/filechooser.inc @@ -1,138 +1,134 @@ + + + $output = ''; + + '; return theme('form_element', $element, $output); } - - function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) { module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'MimeClass'); - + $mimeClass = new MimeClass(); - + $cm = ContentModel::loadFromModel($cm_pid); $cp = CollectionPolicy::loadFromCollection($cp_pid); - $path=$cp->getStagingArea() .'/'; - - if ($cm !== FALSE && $cp !== FALSE) { + $path = $cp->getStagingArea() . '/'; + + if ($cm !== FALSE && $cp !== FALSE) { if (is_file($path . $file)) { - - $mime=$mimeClass->getType($path . $file); - + + $mime = $mimeClass->getType($path . $file); + $allowed_types = $cm->getMimetypes(); if (in_array($mime, $allowed_types)) { - - $thumbnail = ''; - //executes ingest rules with the "preview" parameter set. - if ($cm->execIngestRules($path . $file, $mime, TRUE) && isset($_SESSION['fedora_ingest_files']['TN']) && file_exists($_SESSION['fedora_ingest_files']['TN'])) { - $thumbnail=$_SESSION['fedora_ingest_files']['TN']; + + $thumbnail = ''; + //executes ingest rules with the "preview" parameter set. + if ($cm->execIngestRules($path . $file, $mime, TRUE) && isset($_SESSION['fedora_ingest_files']['TN']) && file_exists($_SESSION['fedora_ingest_files']['TN'])) { + $thumbnail = $_SESSION['fedora_ingest_files']['TN']; + } + + $thumbmime = $mimeClass->getType($thumbnail); + + header('Pragma: no-cache'); + header('Content-Type: ' . $thumbmime); + echo file_get_contents($thumbnail); + exit(); } - - $thumbmime=$mimeClass->getType($thumbnail); - - header('Pragma: no-cache'); - header('Content-Type: '. $thumbmime); - echo file_get_contents($thumbnail); - exit(); - } } - } - } -function ife_filechooser_cmp($a,$b) -{ - return strcmp($a['name'],$b['name']); + +function ife_filechooser_cmp($a, $b) { + return strcmp($a['name'], $b['name']); } function ife_filechooser_generate_thumbnails($cp_pid, $cm_pid) { module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'MimeClass'); - + $cm = ContentModel::loadFromModel($cm_pid); $cp = CollectionPolicy::loadFromCollection($cp_pid); - if ($cm === FALSE || $cp === FALSE) { - echo '[]'; exit(); - } + if ($cm === FALSE || $cp === FALSE) { + echo '[]'; + exit(); + } $mimeClass = new MimeClass(); - $path=$cp->getStagingArea() .'/'; - $start=isset($_GET['start'])?intval($_GET['start']):0; - $end=isset($_GET['end'])?intval($_GET['end']):50; + $path = $cp->getStagingArea() . '/'; + $start = isset($_GET['start']) ? intval($_GET['start']) : 0; + $end = isset($_GET['end']) ? intval($_GET['end']) : 50; $thumbnails = array(); $files = array(); if ($cm !== FALSE && $cp !== FALSE) { - $allowed_types = $cm->getMimetypes(); - if (file_exists($path) && is_dir($path)) { - $dir = opendir($path); - for ($i=$start; $i < $end && ($file = readdir($dir)) !== FALSE;) { - if (is_file($path . $file)) { - $mime=$mimeClass->getType($path . $file); - if (in_array($mime, $allowed_types)) { - - $thumbnail = FALSE; - //executes ingest rules with the "preview" parameter set. - if ($cm->execIngestRules($path . $file, $mime, TRUE) && isset($_SESSION['fedora_ingest_files']['TN']) && file_exists($_SESSION['fedora_ingest_files']['TN'])) { - $thumbnail=$_SESSION['fedora_ingest_files']['TN']; - unset($_SESSION['fedora_ingest_files']['TN']); - } - - $res_array = getimagesize($path .'/'. $file); - $res = ''; - if (is_array($res_array)) { - $res = $res_array[0] .'x'. $res_array[1]; - } - - $size = filesize($path .'/'. $file); - $labels = array('kB', 'MB', 'GB', 'TB'); - $label = 'B'; - while ($size > 1024) { - $size=$size/1024; - $label=array_shift($labels); - } - $size = round($size, 2) .' '. $label; - - $files[] = array('name' => $file, 'mime' => $mime, 'size' => $size, 'resolution' => $res, 'thumb' => ($thumbnail != FALSE)); - $i++; - } - } - } - } + $allowed_types = $cm->getMimetypes(); + if (file_exists($path) && is_dir($path)) { + $dir = opendir($path); + for ($i = $start; $i < $end && ($file = readdir($dir)) !== FALSE;) { + if (is_file($path . $file)) { + $mime = $mimeClass->getType($path . $file); + if (in_array($mime, $allowed_types)) { + + $thumbnail = FALSE; + //executes ingest rules with the "preview" parameter set. + if ($cm->execIngestRules($path . $file, $mime, TRUE) && isset($_SESSION['fedora_ingest_files']['TN']) && file_exists($_SESSION['fedora_ingest_files']['TN'])) { + $thumbnail = $_SESSION['fedora_ingest_files']['TN']; + unset($_SESSION['fedora_ingest_files']['TN']); + } + + $res_array = getimagesize($path . '/' . $file); + $res = ''; + if (is_array($res_array)) { + $res = $res_array[0] . 'x' . $res_array[1]; + } + + $size = filesize($path . '/' . $file); + $labels = array('kB', 'MB', 'GB', 'TB'); + $label = 'B'; + while ($size > 1024) { + $size = $size / 1024; + $label = array_shift($labels); + } + $size = round($size, 2) . ' ' . $label; + + $files[] = array('name' => $file, 'mime' => $mime, 'size' => $size, 'resolution' => $res, 'thumb' => ($thumbnail != FALSE)); + $i++; + } + } + } + } } - usort($files,'ife_filechooser_cmp'); + usort($files, 'ife_filechooser_cmp'); echo json_encode($files); - } diff --git a/form_elements/includes/people.inc b/form_elements/includes/people.inc index 43cf52ad..421e0a3b 100644 --- a/form_elements/includes/people.inc +++ b/form_elements/includes/people.inc @@ -1,6 +1,5 @@ 0) { - foreach ($children as $key) { - $post = _dummy_post_info($form[$key], $post, $key); + foreach ($children as $key) { + $post = _dummy_post_info($form[$key], $post, $key); } } - if ($key!='' && isset($form['#required']) && $form['#required'] == TRUE && trim($post[$key]) == '') { - $post[$key] = 'not empty'; + if ($key != '' && isset($form['#required']) && $form['#required'] == TRUE && trim($post[$key]) == '') { + $post[$key] = 'not empty'; } - + return $post; } function _ife_find_people_element($form, &$keys = array()) { if (isset($form['#type']) && $form['#type'] == 'people') { return $form['people']; - } - + } + $children = element_children($form); foreach ($children as $key) { $found = _ife_find_people_element($form[$key], $keys); @@ -34,41 +33,40 @@ function _ife_find_people_element($form, &$keys = array()) { return $found; } } - - return FALSE; + return FALSE; } function ife_people_ahah() { - + if (!isset($_POST['form_build_id'])) - return; - + return; + $form_state = array('storage' => NULL, 'submitted' => FALSE); $form_build_id = $_POST['form_build_id']; $form = form_get_cache($form_build_id, $form_state); - + $args = $form['#parameters']; $form_id = array_shift($args); $form['#post'] = $_POST; $form['#redirect'] = FALSE; $form['#programmed'] = FALSE; - + $_POST = _dummy_post_info($form, $_POST); $form_state['post'] = $_POST; $form['#post'] = $_POST; drupal_process_form($form_id, $form, $form_state); - - //ob_start(); echo '
'; echo $_POST['form_build_id']."\n"; var_dump($form_state);   echo '
'; $dump = ob_get_contents(); ob_end_clean(); - + + //ob_start(); echo '
'; echo $_POST['form_build_id']."\n"; var_dump($form_state);   echo '
'; $dump = ob_get_contents(); ob_end_clean(); + $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id); $qt_form = _ife_find_people_element($form); - + unset($qt_form['#prefix'], $qt_form['#suffix']); // Prevent duplicate wrappers. $javascript = drupal_add_js(NULL, NULL, 'header'); drupal_json(array( - 'status' => TRUE, - 'data' => $dump . theme('status_messages') . drupal_render($qt_form), + 'status' => TRUE, + 'data' => $dump . theme('status_messages') . drupal_render($qt_form), 'settings' => call_user_func_array('array_merge_recursive', $javascript['setting']), )); } @@ -77,22 +75,22 @@ function ife_people_ahah() { * Submit handler for the "Remove Person" button. */ function ife_remove_person_submit($form, &$form_state) { - + // Get the tab delta for the clicked button. $delta = $form_state['clicked_button']['#parents'][2]; - - $keys=array(); + + $keys = array(); $qt_form = _ife_find_people_element($form, $keys); - + $peopleVals = &$form_state['values']; while (count($keys) > 0) { $key = array_pop($keys); if (isset($peopleVals[$key])) { $peopleVals = &$peopleVals[$key]; } - } - - $people = array(); + } + + $people = array(); $i = 0; foreach ($peopleVals['people'] as $key => $val) { if ($key != $delta) { @@ -100,17 +98,16 @@ function ife_remove_person_submit($form, &$form_state) { } $i++; } - + // ob_start(); var_dump($form_state['clicked_button']['#parents'][1]); var_dump($people); $dump = ob_get_contents(); ob_end_clean(); -// watchdog('people_field','
'.$dump.'
',array(),WATCHDOG_NOTICE); - +// watchdog('people_field','
'.$dump.'
',array(),WATCHDOG_NOTICE); + unset($form_state['submit_handlers']); form_execute_handlers('submit', $form, $form_state); $form_state['storage']['people'] = $people; $form_state['rebuild'] = TRUE; } - /** * Submit handler for the "Add Person" button. */ @@ -119,24 +116,24 @@ function ife_add_person_submit($form, &$form_state) { $keys = array(); $qt_form = _ife_find_people_element($form, $keys); $peopleVals = &$form_state['values']; - + while (count($keys) > 0) { $key = array_pop($keys); if (isset($peopleVals[$key])) { $peopleVals = &$peopleVals[$key]; } - } + } if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); - + $peopleVals['people'] = array(); + foreach ($peopleVals['people'] as $val) { $people[] = $val; } - + //only add new person if we are not adding from repository. - $elName = isset($qt_form['entity0']['#parents'][0])?$qt_form['entity0']['#parents'][0]:null; - if ($elName == null || !isset($form_state['clicked_button']['#post'][$elName]['add_from_repository']) || trim($form_state['clicked_button']['#post'][$elName]['add_from_repository']) == '') { - $people[] = array('name' => '', 'date'=>'', 'role' => '', 'subject' => ''); + $elName = isset($qt_form['entity0']['#parents'][0]) ? $qt_form['entity0']['#parents'][0] : NULL; + if ($elName == NULL || !isset($form_state['clicked_button']['#post'][$elName]['add_from_repository']) || trim($form_state['clicked_button']['#post'][$elName]['add_from_repository']) == '') { + $people[] = array('name' => '', 'date' => '', 'role' => '', 'subject' => ''); } unset($form_state['submit_handlers']); form_execute_handlers('submit', $form, $form_state); @@ -144,8 +141,6 @@ function ife_add_person_submit($form, &$form_state) { $form_state['rebuild'] = TRUE; } - - /** * Submit handler for the "Add Person" button. */ @@ -154,64 +149,60 @@ function ife_add_org_submit($form, &$form_state) { $keys = array(); $qt_form = _ife_find_people_element($form, $keys); $peopleVals = &$form_state['values']; - + while (count($keys) > 0) { $key = array_pop($keys); if (isset($peopleVals[$key])) { $peopleVals = &$peopleVals[$key]; } } - + if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); - + $peopleVals['people'] = array(); + foreach ($peopleVals['people'] as $val) { - $people[]=$val; + $people[] = $val; } $people[] = array('role' => '', 'organization' => ''); - + unset($form_state['submit_handlers']); form_execute_handlers('submit', $form, $form_state); $form_state['storage']['people'] = $people; //$form_state['rebuild'] = TRUE; } - - /** * Submit handler for the "Add Person" button. */ function ife_add_conf_submit($form, &$form_state) { $people = array(); - $keys=array(); + $keys = array(); $qt_form = _ife_find_people_element($form, $keys); $peopleVals = &$form_state['values']; while (count($keys) > 0) { $key = array_pop($keys); if (isset($peopleVals[$key])) { - $peopleVals=&$peopleVals[$key]; + $peopleVals = &$peopleVals[$key]; } - } + } if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); - + $peopleVals['people'] = array(); + foreach ($peopleVals['people'] as $val) { $people[] = $val; } - + $people[] = array('role' => '', 'conference' => '', 'subject' => ''); - + unset($form_state['submit_handlers']); form_execute_handlers('submit', $form, $form_state); $form_state['storage']['people'] = $people; //$form_state['rebuild'] = TRUE; } - - function theme_people($element) { - drupal_add_js(drupal_get_path('module', 'islandora_form_elements') .'/js/people_ahah.js'); - if (!empty($element['#collapsible'])) { + drupal_add_js(drupal_get_path('module', 'islandora_form_elements') . '/js/people_ahah.js'); + if (!empty($element['#collapsible'])) { drupal_add_js('misc/collapse.js'); if (!isset($element['#attributes']['class'])) { @@ -223,10 +214,9 @@ function theme_people($element) { $element['#attributes']['class'] .= ' collapsed'; } } - return ''. ($element['#title'] ? ''. $element['#title'] .'' : '') . (isset($element['#description']) && $element['#description'] ? '
'. $element['#description'] .'
' : '') . (!empty($element['#children']) ? $element['#children'] : '') . "\n"; + return '' . ($element['#title'] ? '' . $element['#title'] . '' : '') . (isset($element['#description']) && $element['#description'] ? '
' . $element['#description'] . '
' : '') . (!empty($element['#children']) ? $element['#children'] : '') . "\n"; } - function theme_people_items($form) { $rows = array(); $headers = array( @@ -241,32 +231,32 @@ function theme_people_items($form) { // Build the table row. $row = array( 'data' => array( - array('data' => drupal_render($form[$key]['organization']), 'class' => 'ife-person-name container-inline'), - array('data' => drupal_render($form[$key]['role']).drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), - array('data' => drupal_render($form[$key]['remove']), 'class' => 'ife-person-remove'), + array('data' => drupal_render($form[$key]['organization']), 'class' => 'ife-person-name container-inline'), + array('data' => drupal_render($form[$key]['role']) . drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), + array('data' => drupal_render($form[$key]['remove']), 'class' => 'ife-person-remove'), ), ); - } + } elseif (isset($form[$key]['conference'])) { $form[$key]['weight']['#attributes']['class'] = 'ife-people-weight'; // Build the table row. $row = array( 'data' => array( - array('data' => drupal_render($form[$key]['conference']).'
'. drupal_render($form[$key]['date']), 'class' => 'ife-person-name container-inline' ), - array('data' => drupal_render($form[$key]['role']).drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), + array('data' => drupal_render($form[$key]['conference']) . '
' . drupal_render($form[$key]['date']), 'class' => 'ife-person-name container-inline'), + array('data' => drupal_render($form[$key]['role']) . drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), array('data' => drupal_render($form[$key]['remove']), 'class' => 'ife-person-remove'), - ), + ), ); - } + } else { $form[$key]['weight']['#attributes']['class'] = 'ife-people-weight'; // Build the table row. $row = array( 'data' => array( - array('data' => drupal_render($form[$key]['name']) .'
'. drupal_render($form[$key]['date']), 'class' => 'ife-person-name container-inline'), - array('data' => drupal_render($form[$key]['role']).drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), + array('data' => drupal_render($form[$key]['name']) . '
' . drupal_render($form[$key]['date']), 'class' => 'ife-person-name container-inline'), + array('data' => drupal_render($form[$key]['role']) . drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), array('data' => drupal_render($form[$key]['remove']), 'class' => 'ife-person-remove'), - ), + ), ); } @@ -281,8 +271,7 @@ function theme_people_items($form) { $output .= drupal_render($form); // Add our JS file, which has some Drupal core JS overrides, and ensures ahah behaviours get re-attached - drupal_add_css(drupal_get_path('module', 'islandora_form_elements') .'/css/people.css'); - return $output; + drupal_add_css(drupal_get_path('module', 'islandora_form_elements') . '/css/people.css'); + return $output; } - diff --git a/form_elements/islandora_form_elements.module b/form_elements/islandora_form_elements.module index 094eff67..d7e77b34 100644 --- a/form_elements/islandora_form_elements.module +++ b/form_elements/islandora_form_elements.module @@ -1,328 +1,313 @@ TRUE, + '#input' => TRUE, '#process' => array('ife_fieldset_process'), ); - + $type['textfield'] = array( '#input' => TRUE, '#sticky' => FALSE, '#process' => array('ife_sticky_textfield_process'), ); - $type['textarea'] = array( - '#input'=> TRUE, + $type['textarea'] = array( + '#input' => TRUE, '#sticky ' => FALSE, '#process' => array('ife_sticky_textarea_process'), ); - $type['select'] = array( - '#input'=> TRUE, + $type['select'] = array( + '#input' => TRUE, '#sticky ' => FALSE, '#process' => array('ife_sticky_select_process'), ); - + $type['list'] = array( - '#input'=>TRUE, + '#input' => TRUE, '#element_validate' => array('ife_list_validate'), '#process' => array('ife_list_process'), '#sticky' => FALSE, ); - + $type['other_select'] = array( - '#input'=>TRUE, + '#input' => TRUE, '#process' => array('ife_other_select_process'), ); - + $type['copyright'] = array( '#input' => TRUE, '#process' => array('ife_copyright_process'), '#element_validate' => array('ife_copyright_validate'), - ); - - + ); + + $type['filechooser'] = array( '#input' => TRUE, '#path' => '', '#model' => '', - '#collection'=>'', + '#collection' => '', '#process' => array('ife_filechooser_process'), '#element_validate' => array('ife_filechooser_validate'), ); - + $type['person'] = array( '#input' => TRUE, '#process' => array('ife_person_process'), - '#default_value' => array('name'=>'', 'date'=>'', 'subject'=>'', 'role' => ''), + '#default_value' => array('name' => '', 'date' => '', 'subject' => '', 'role' => ''), ); $type['organization'] = array( '#input' => TRUE, '#process' => array('ife_org_process'), - '#default_value' => array( 'organization' => '', 'date'=>'', 'subject'=>'', 'role' => ''), + '#default_value' => array('organization' => '', 'date' => '', 'subject' => '', 'role' => ''), ); $type['conference'] = array( '#input' => TRUE, '#process' => array('ife_conf_process'), - '#default_value' => array( 'conference' => '', 'date'=>'', 'subject'=>'', 'role' => ''), + '#default_value' => array('conference' => '', 'date' => '', 'subject' => '', 'role' => ''), ); - + $type['people'] = array( '#input' => TRUE, '#process' => array('ife_people_process'), ); - + $type['datepicker'] = array( '#input' => TRUE, '#process' => array('ife_datepicker_process'), ); - + return $type; } -function ife_fieldset_process($element,$edit,&$form_state) -{ +function ife_fieldset_process($element, $edit, &$form_state) { // echo 'fieldset process '. $element['#collapsible'].'
'; - if (isset($element['#collapsed']) && ife_fieldset_children_has_value($element)) - { + if (isset($element['#collapsed']) && ife_fieldset_children_has_value($element)) { unset($element['#collapsed']); } return $element; } -function ife_fieldset_children_has_value($el) -{ +function ife_fieldset_children_has_value($el) { $ret = false; - - + + if ((isset($el['#default_value']) && !is_array($el['#default_value']) && trim($el['#default_value']) != '') || - (isset($el['#value']) && trim($el['#value']) != '')) - { + (isset($el['#value']) && trim($el['#value']) != '')) { $ret = true; - } else - { - foreach (element_children($el) as $key) - { - - if (!$ret) - { - $ret = (isset($_POST[$key]) && (is_array($_POST[$key]) || trim($_POST[$key]) != '')) || ife_fieldset_children_has_value($el[$key]); + } + else { + foreach (element_children($el) as $key) { + + if (!$ret) { + $ret = (isset($_POST[$key]) && (is_array($_POST[$key]) || trim($_POST[$key]) != '')) || ife_fieldset_children_has_value($el[$key]); } } } - + return $ret; } +function ife_people_process($element, $edit, &$form_state) { -function ife_people_process($element,$edit,&$form_state) -{ - - $element['#tree'] = TRUE; - $element['#prefix'] = '
'; - $element['#suffix'] = '
'; - - $element['people'] = array( - '#tree' => TRUE, - '#prefix' => '
', - '#suffix' => '
', - '#theme' => 'people_items', - ); - - if (isset($form_state['post'][$element['#name']]['add_from_repository']) && trim($form_state['post'][$element['#name']]['add_from_repository']) != '') { - - $people= array(); - if (isset($form_state['storage']['people']) && !empty($form_state['storage']['people'])) { - foreach ($form_state['storage']['people'] as $ent) { - if ( trim($ent['name']) != '' || trim($ent['organization']) != '' || trim($ent['conference']) != '' || trim($ent['role']) != '' || trim($ent['date']) != '') { - $people[]=$ent; - } - } - } - - - $json = json_decode($form_state['post'][$element['#name']]['add_from_repository']); - $form_state['post'][$element['#name']]['add_from_repository'] = ''; // clear so that if the form is processed multiple times, it does not add twice. - $person=array(); - - - switch ($json->type) - { - case 'personal': - $person['name']=$json->name; - $person['role']=$json->role; - $person['subject']=$json->subject; - $person['date']=$json->date; - break; - case 'organization': - $person['organization'] = $json->name; - $person['role'] = $json->role; - $person['subject']=$json->subject; - break; - case 'conference': - $person['conference'] = $json->name; - $person['role'] = $json->role; - $person['date'] = $json->date; - $person['subject']=$json->subject; - break; - } - - $people[]=$person; - - $form_state['storage']['people']=$people; - - } else if (!isset($form_state['storage']['people']) || empty($form_state['storage']['people'])) - { - if ( (!isset($form_state['clicked_button']) || count($form_state['clicked_button']) == 0) && isset($element['#default_value']) && is_array($element['#default_value']) ) { - $form_state['storage']['people']=$element['#default_value']; - if (count($element['#default_value']) > 0) { - $element['#collapsed'] = FALSE; - } - - } else { - $form_state['storage']['people']=array( array('name'=>'', 'role'=>'', 'date'=>'', 'subject' => '')); + $element['#tree'] = TRUE; + $element['#prefix'] = '
'; + $element['#suffix'] = '
'; + + $element['people'] = array( + '#tree' => TRUE, + '#prefix' => '
', + '#suffix' => '
', + '#theme' => 'people_items', + ); + + if (isset($form_state['post'][$element['#name']]['add_from_repository']) && trim($form_state['post'][$element['#name']]['add_from_repository']) != '') { + + $people = array(); + if (isset($form_state['storage']['people']) && !empty($form_state['storage']['people'])) { + foreach ($form_state['storage']['people'] as $ent) { + if (trim($ent['name']) != '' || trim($ent['organization']) != '' || trim($ent['conference']) != '' || trim($ent['role']) != '' || trim($ent['date']) != '') { + $people[] = $ent; + } } } - - $i=0; - foreach ($form_state['storage']['people'] as $person) - { - - $person['delta'] = $i; - $type='person'; - if (isset($person['organization'])) - { - $type='organization'; - } else if (isset($person['conference'])) - { - $type='conference'; + + + $json = json_decode($form_state['post'][$element['#name']]['add_from_repository']); + $form_state['post'][$element['#name']]['add_from_repository'] = ''; // clear so that if the form is processed multiple times, it does not add twice. + $person = array(); + + + switch ($json->type) { + case 'personal': + $person['name'] = $json->name; + $person['role'] = $json->role; + $person['subject'] = $json->subject; + $person['date'] = $json->date; + break; + case 'organization': + $person['organization'] = $json->name; + $person['role'] = $json->role; + $person['subject'] = $json->subject; + break; + case 'conference': + $person['conference'] = $json->name; + $person['role'] = $json->role; + $person['date'] = $json->date; + $person['subject'] = $json->subject; + break; + } + + $people[] = $person; + + $form_state['storage']['people'] = $people; + } + elseif (!isset($form_state['storage']['people']) || empty($form_state['storage']['people'])) { + if ((!isset($form_state['clicked_button']) || count($form_state['clicked_button']) == 0) && isset($element['#default_value']) && is_array($element['#default_value'])) { + $form_state['storage']['people'] = $element['#default_value']; + if (count($element['#default_value']) > 0) { + $element['#collapsed'] = FALSE; } - - $element['people']['entity'.$i] = array('#type'=>$type, '#default_value'=>$person); - $i++; } + else { + $form_state['storage']['people'] = array(array('name' => '', 'role' => '', 'date' => '', 'subject' => '')); + } + } + + $i = 0; + foreach ($form_state['storage']['people'] as $person) { + + $person['delta'] = $i; + $type = 'person'; + if (isset($person['organization'])) { + $type = 'organization'; + } + elseif (isset($person['conference'])) { + $type = 'conference'; + } + + $element['people']['entity' . $i] = array('#type' => $type, '#default_value' => $person); + $i++; + } $element['add_from_repository'] = array( '#type' => 'textfield', '#autocomplete_path' => 'autocomplete_person/', - '#weight' => 4, + '#weight' => 4, '#size' => 30, '#value' => '', - '#title'=> t('Add entity from repository'), - '#description'=>t('To add an existing entity, simply start typing the name of the person, organization or conference and select the desired name from the resulting dropdown list.') + '#title' => t('Add entity from repository'), + '#description' => t('To add an existing entity, simply start typing the name of the person, organization or conference and select the desired name from the resulting dropdown list.') ); $element['add_person'] = array( - '#type' => 'submit', - '#prefix' => '
', - '#suffix' => '
', - '#value' => t('Add Person'), - '#attributes' => array('class' => 'add-person', 'title' => t('Click here to add a person.')), - '#weight' => 3, - '#submit' => array('ife_add_person_submit'), // If no javascript action. - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - -$element['add_organization'] = array( - '#type' => 'submit', - '#prefix' => '
', - '#suffix' => '
', - '#value' => t('Add Organization'), - '#attributes' => array('class' => 'add-org', 'title' => t('Click here to add an organization.')), - '#weight' => 2, - '#submit' => array('ife_add_org_submit'), // If no javascript action. - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - - $element['add_conference'] = array( - '#type' => 'submit', - '#prefix' => '
', - '#suffix' => '
', - '#value' => t('Add Conference'), - '#attributes' => array('class' => 'add-conf', 'title' => t('Click here to add a conference.')), - '#weight' => 1, - '#submit' => array('ife_add_conf_submit'), // If no javascript action. - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - return $element; + '#type' => 'submit', + '#prefix' => '
', + '#suffix' => '
', + '#value' => t('Add Person'), + '#attributes' => array('class' => 'add-person', 'title' => t('Click here to add a person.')), + '#weight' => 3, + '#submit' => array('ife_add_person_submit'), // If no javascript action. + '#ahah' => array( + 'path' => 'ife/people_ahah', + 'wrapper' => 'ife-people', + 'method' => 'replace', + 'effect' => 'fade', + ), + ); + + $element['add_organization'] = array( + '#type' => 'submit', + '#prefix' => '
', + '#suffix' => '
', + '#value' => t('Add Organization'), + '#attributes' => array('class' => 'add-org', 'title' => t('Click here to add an organization.')), + '#weight' => 2, + '#submit' => array('ife_add_org_submit'), // If no javascript action. + '#ahah' => array( + 'path' => 'ife/people_ahah', + 'wrapper' => 'ife-people', + 'method' => 'replace', + 'effect' => 'fade', + ), + ); + + $element['add_conference'] = array( + '#type' => 'submit', + '#prefix' => '
', + '#suffix' => '
', + '#value' => t('Add Conference'), + '#attributes' => array('class' => 'add-conf', 'title' => t('Click here to add a conference.')), + '#weight' => 1, + '#submit' => array('ife_add_conf_submit'), // If no javascript action. + '#ahah' => array( + 'path' => 'ife/people_ahah', + 'wrapper' => 'ife-people', + 'method' => 'replace', + 'effect' => 'fade', + ), + ); + return $element; } -function ife_person_process($element) -{ +function ife_person_process($element) { $element['#tree'] = TRUE; - - if (!isset($element['#value'])) - { - $element['#value'] = array('name'=>''); + + if (!isset($element['#value'])) { + $element['#value'] = array('name' => ''); } - - + + $element['name'] = array( '#type' => 'textfield', - '#title'=> t('Name(s)'), + '#title' => t('Name(s)'), '#size' => 30, '#value' => $element['#value']['name'], '#description' => t('Please enter last name first, followed by a comma and first name.'), ); - + $element['date'] = array( - '#type' => 'datepicker', - '#title' => t('Date'), - '#size'=> 30, - '#value' => $element['#value']['date'], - '#description' => '
'.t('Use this field to express birth/death dates. You may use the date chooser, but the field is free-form') + '#type' => 'datepicker', + '#title' => t('Date'), + '#size' => 30, + '#value' => $element['#value']['date'], + '#description' => '
' . t('Use this field to express birth/death dates. You may use the date chooser, but the field is free-form') ); - + $element['role'] = array( '#type' => 'textfield', - '#size'=>30, - '#description'=>t('The role that this person plays with regards to the object.'), + '#size' => 30, + '#description' => t('The role that this person plays with regards to the object.'), '#value' => $element['#value']['role'], '#autocomplete_path' => 'autocomplete_marcrelator/', - ); + ); $element['subject'] = array( '#type' => 'checkbox', - '#size'=>30, - '#description'=>t('If checked, this person will be listed as a subject term. If selected, role field does not apply.'), + '#size' => 30, + '#description' => t('If checked, this person will be listed as a subject term. If selected, role field does not apply.'), '#title' => t('Subject'), '#value' => $element['#value']['subject'], - ); - + ); + $element['remove'] = array( '#type' => 'submit', '#prefix' => '
', - '#suffix' => '
', - '#value' => 'remove_'. $element['#default_value']['delta'], + '#suffix' => '', + '#value' => 'remove_' . $element['#default_value']['delta'], '#submit' => array('ife_remove_person_submit'), '#attributes' => array('class' => 'delete-person', 'title' => t('Click here to delete this Person.')), '#ahah' => array( @@ -335,47 +320,44 @@ function ife_person_process($element) return $element; } - -function ife_org_process($element) -{ +function ife_org_process($element) { $element['#tree'] = TRUE; - - if (!isset($element['#value'])) - { - $element['#value'] = array('name'=>''); + + if (!isset($element['#value'])) { + $element['#value'] = array('name' => ''); } - - + + $element['role'] = array( '#type' => 'textfield', - '#size'=>30, - '#description'=>t('The role that this organization plays with regards to the object.'), + '#size' => 30, + '#description' => t('The role that this organization plays with regards to the object.'), '#value' => $element['#value']['role'], '#autocomplete_path' => 'autocomplete_marcrelator/', - ); + ); $element['subject'] = array( '#type' => 'checkbox', - '#size'=>30, - '#description'=>t('If checked, this organization will be listed as a subject term. If selected, role field does not apply.'), + '#size' => 30, + '#description' => t('If checked, this organization will be listed as a subject term. If selected, role field does not apply.'), '#title' => t('Subject'), '#value' => $element['#value']['subject'], - ); + ); $element['organization'] = array( '#type' => 'textfield', '#title' => t('Organization'), '#size' => 30, '#value' => $element['#value']['organization'], - ); + ); $element['remove'] = array( '#type' => 'submit', '#prefix' => '
', - '#suffix' => '
', - '#value' => 'remove_'. $element['#default_value']['delta'], + '#suffix' => '', + '#value' => 'remove_' . $element['#default_value']['delta'], '#submit' => array('ife_remove_person_submit'), '#attributes' => array('class' => 'delete-person', 'title' => t('Click here to delete this Person.')), '#ahah' => array( @@ -388,53 +370,50 @@ function ife_org_process($element) return $element; } - -function ife_conf_process($element) -{ +function ife_conf_process($element) { $element['#tree'] = TRUE; - - if (!isset($element['#value'])) - { - $element['#value'] = array('name'=>''); + + if (!isset($element['#value'])) { + $element['#value'] = array('name' => ''); } - + $element['role'] = array( '#type' => 'textfield', - '#size'=>30, - '#description'=>t('The role that this conference plays with regards to the object.'), + '#size' => 30, + '#description' => t('The role that this conference plays with regards to the object.'), '#value' => $element['#value']['role'], '#autocomplete_path' => 'autocomplete_marcrelator/', - ); - + ); + $element['subject'] = array( '#type' => 'checkbox', - '#size'=>30, - '#description'=>t('If checked, this conference will be listed as a subject term. If selected, role field does not apply.'), + '#size' => 30, + '#description' => t('If checked, this conference will be listed as a subject term. If selected, role field does not apply.'), '#title' => t('Subject'), '#value' => $element['#value']['subject'], - ); - + ); + $element['conference'] = array( '#type' => 'textfield', '#title' => t('Conference'), '#size' => 30, '#value' => $element['#value']['conference'], - ); - - + ); + + $element['date'] = array( - '#type' => 'datepicker', - '#title' => t('Date'), - '#size'=> 30, - '#value' => $element['#value']['date'] - ); + '#type' => 'datepicker', + '#title' => t('Date'), + '#size' => 30, + '#value' => $element['#value']['date'] + ); $element['remove'] = array( '#type' => 'submit', '#prefix' => '
', - '#suffix' => '
', - '#value' => 'remove_'. $element['#default_value']['delta'], + '#suffix' => '', + '#value' => 'remove_' . $element['#default_value']['delta'], '#submit' => array('ife_remove_person_submit'), '#attributes' => array('class' => 'delete-person', 'title' => t('Click here to delete this Person.')), '#ahah' => array( @@ -450,211 +429,189 @@ function ife_conf_process($element) /** * Our process callback to expand the control. */ -function ife_sticky_textfield_process($element,$edit,&$form_state) -{ +function ife_sticky_textfield_process($element, $edit, &$form_state) { + - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { + if (isset($element['#sticky']) && $element['#sticky'] == TRUE) { $element['#type'] = 'sticky_textfield'; - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + + if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') { + $form_state['storage'][$element['#name']] = $element['#value']; + } + elseif (isset($form_state['storage'][$element['#name']])) { $element['#value'] = $form_state['storage'][$element['#name']]; $element['#sticky_on'] = TRUE; } } - + return $element; } /** * Our process callback to expand the control. */ -function ife_datepicker_process($element,$edit,&$form_state) -{ - - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { +function ife_datepicker_process($element, $edit, &$form_state) { + + + if (isset($element['#sticky']) && $element['#sticky'] == TRUE) { + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + + if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') { + $form_state['storage'][$element['#name']] = $element['#value']; + } + elseif (isset($form_state['storage'][$element['#name']])) { $element['#value'] = $form_state['storage'][$element['#name']]; $element['#sticky_on'] = TRUE; } } - + return $element; } - - /** * Our process callback to expand the control. */ -function ife_sticky_textarea_process($element,$edit,&$form_state) -{ +function ife_sticky_textarea_process($element, $edit, &$form_state) { + - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { + if (isset($element['#sticky']) && $element['#sticky'] == TRUE) { $element['#type'] = 'sticky_textarea'; - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + + if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') { + $form_state['storage'][$element['#name']] = $element['#value']; + } + elseif (isset($form_state['storage'][$element['#name']])) { $element['#value'] = $form_state['storage'][$element['#name']]; $element['#sticky_on'] = TRUE; } } - + return $element; } - /** * Our process callback to expand the control. */ -function ife_sticky_select_process($element,$edit,&$form_state) -{ +function ife_sticky_select_process($element, $edit, &$form_state) { - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { + + if (isset($element['#sticky']) && $element['#sticky'] == TRUE) { $element['#type'] = 'sticky_select'; - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + + if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') { + $form_state['storage'][$element['#name']] = $element['#value']; + } + elseif (isset($form_state['storage'][$element['#name']])) { $element['#value'] = $form_state['storage'][$element['#name']]; $element['#sticky_on'] = TRUE; } } - + return $element; } /** * Our process callback to expand the control. */ -function ife_copyright_process($element,$edit,&$form_state) { - - module_load_include('inc','islandora_form_elements','includes/creative_commons'); - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { +function ife_copyright_process($element, $edit, &$form_state) { + + module_load_include('inc', 'islandora_form_elements', 'includes/creative_commons'); + + if (isset($element['#sticky']) && $element['#sticky'] == TRUE) { + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + + if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') { + $form_state['storage'][$element['#name']] = $element['#value']; + } + elseif (isset($form_state['storage'][$element['#name']])) { $element['#value'] = $form_state['storage'][$element['#name']]; $element['#sticky_on'] = TRUE; } - } + } - if ($element['#sticky']) { - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
':''); + if ($element['#sticky']) { + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_css($path . '/css/sticky.css'); + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE ? '
' : ''); } - + $element['#tree'] = TRUE; - + if (isset($element['#value']) && !is_array($element['#value'])) { - $matches=array(); - if (preg_match('/by-*([a-z]+)-*([a-z]+)\/([\d\.]+)\/([a-z]*)/',$element['#value'],$matches)) { - $element['#value'] = array('cc_commercial' => $matches[1], 'cc_modifications' => $matches[2], 'cc_jurisdiction' => $matches[4]); - } else - $element['#value'] = array('cc_commercial' => '', 'cc_modifications' => '', 'cc_jurisdiction' => ''); - } else if (!isset($element['#value'])) { + $matches = array(); + if (preg_match('/by-*([a-z]+)-*([a-z]+)\/([\d\.]+)\/([a-z]*)/', $element['#value'], $matches)) { + $element['#value'] = array('cc_commercial' => $matches[1], 'cc_modifications' => $matches[2], 'cc_jurisdiction' => $matches[4]); + } else + $element['#value'] = array('cc_commercial' => '', 'cc_modifications' => '', 'cc_jurisdiction' => ''); + } elseif (!isset($element['#value'])) { $element['#value'] = array('cc_commercial' => '', 'cc_modifications' => '', 'cc_jurisdiction' => ''); } - - $element['cc'] = array('#type' => 'fieldset', '#title'=>$element['#title'], '#description' => $sticky.'
preview
' , '#collapsible' => TRUE); - + + $element['cc'] = array('#type' => 'fieldset', '#title' => $element['#title'], '#description' => $sticky . '
preview
', '#collapsible' => TRUE); + $element['cc']['cc_enable'] = array( '#type' => 'checkbox', '#title' => t('Use a CreativeCommons.org Licence'), '#attributes' => array('class' => 'cc_enable'), '#default_value' => TRUE, ); - - $element['cc']['cc_commercial'] = array( + + $element['cc']['cc_commercial'] = array( '#type' => 'select', '#title' => t('Allow commercial uses of your work?'), - '#options' => array( ''=>'Yes', 'nc'=>'No'), + '#options' => array('' => 'Yes', 'nc' => 'No'), '#attributes' => array('class' => 'cc_field cc_commercial'), '#default_value' => $element['#value']['cc_commercial'], ); - $element['cc']['cc_modifications'] = array( + $element['cc']['cc_modifications'] = array( '#type' => 'select', '#title' => t('Allow modifications of your work?'), - '#options' => array( ''=>'Yes', 'sa'=>'Yes, as long as others share alike', 'nd'=>'No'), + '#options' => array('' => 'Yes', 'sa' => 'Yes, as long as others share alike', 'nd' => 'No'), '#attributes' => array('class' => 'cc_field cc_modifications'), '#default_value' => $element['#value']['cc_modifications'], ); - - $element['cc']['cc_jurisdiction'] = array( + + $element['cc']['cc_jurisdiction'] = array( '#type' => 'select', '#title' => t('Jurisdiction of your license'), '#options' => CreativeCommons::$cc_jurisdiction_vals, '#default_value' => $element['#value']['cc_jurisdiction'], '#attributes' => array('class' => 'cc_field cc_jurisdiction'), ); - + $element['#title'] = ''; - + return $element; - } - /** * Our process callback to expand the control. */ -function ife_list_process($element,$edit,&$form_state) -{ +function ife_list_process($element, $edit, &$form_state) { if (is_array($element['#default_value'])) { - $element['#default_value']=join('; ',$element['#default_value']); + $element['#default_value'] = join('; ', $element['#default_value']); } - + if (is_array($element['#value'])) { - $element['#value']=join('; ',$element['#value']); - } - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { + $element['#value'] = join('; ', $element['#value']); + } + + if (isset($element['#sticky']) && $element['#sticky'] == TRUE) { + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + + if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') { + $form_state['storage'][$element['#name']] = $element['#value']; + } + elseif (isset($form_state['storage'][$element['#name']])) { $element['#value'] = $form_state['storage'][$element['#name']]; $element['#sticky_on'] = TRUE; } } - + return $element; } @@ -664,19 +621,16 @@ function ife_list_process($element,$edit,&$form_state) * This lets us tell Drupal about our theme functions and their arguments. */ function islandora_form_elements_theme() { - return array( + return array( 'sticky_textfield' => array( 'arguments' => array('element'), ), - 'sticky_textarea' => array( 'arguments' => array('element'), - ), - + ), 'sticky_select' => array( 'arguments' => array('element'), - ), - + ), 'filechooser' => array( 'arguments' => array('element'), 'file' => 'includes/filechooser.inc' @@ -687,14 +641,13 @@ function islandora_form_elements_theme() { 'other_select' => array( 'arguments' => array('element'), ), - - 'people' => array( - 'arguments' => array('element'), - 'file'=> 'includes/people.inc', - ), + 'people' => array( + 'arguments' => array('element'), + 'file' => 'includes/people.inc', + ), 'people_items' => array( 'arguments' => array('form' => NULL), - 'file'=> 'includes/people.inc', + 'file' => 'includes/people.inc', ), 'datepicker' => array( 'arguments' => array('element'), @@ -705,79 +658,70 @@ function islandora_form_elements_theme() { ); } - -function ife_other_select_process($element,$edit,&$form_state) -{ - if (isset($element['#value']) && trim($element['#value']) != '' && !isset($element['#options'][$element['#value']])) - { - $element['#options'][$element['#value']]=$element['#value']; - } +function ife_other_select_process($element, $edit, &$form_state) { + if (isset($element['#value']) && trim($element['#value']) != '' && !isset($element['#options'][$element['#value']])) { + $element['#options'][$element['#value']] = $element['#value']; + } return $element; } -function theme_copyright($element) -{ - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_js($path.'/js/copyright.js'); - drupal_add_css($path.'/css/copyright.css'); - +function theme_copyright($element) { + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_js($path . '/js/copyright.js'); + drupal_add_css($path . '/css/copyright.css'); + return theme('form_element', $element, $element['#children']); } -function theme_other_select($element) -{ - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_js($path.'/js/otherselect.js'); +function theme_other_select($element) { + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_js($path . '/js/otherselect.js'); $select = ''; - $size = $element['#size'] ? ' size="'. $element['#size'] .'"' : ''; + $size = $element['#size'] ? ' size="' . $element['#size'] . '"' : ''; _form_set_class($element, array('otherSelect')); - return theme('form_element', $element, ''); + return theme('form_element', $element, ''); } -function theme_list($element) -{ - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_js($path.'/js/jquery.tag.editor-min.js'); - drupal_add_js('$(document).ready(function () { $(\'#'.$element['#id'].'\').tagEditor({ separator: \';\', confirmRemoval: false, completeOnBlur: true }); }); ', 'inline'); - drupal_add_css($path.'/css/list.css'); +function theme_list($element) { + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_js($path . '/js/jquery.tag.editor-min.js'); + drupal_add_js('$(document).ready(function () { $(\'#' . $element['#id'] . '\').tagEditor({ separator: \';\', confirmRemoval: false, completeOnBlur: true }); }); ', 'inline'); + drupal_add_css($path . '/css/list.css'); $output .= ''; - //return theme('theme_form_element', $element, '
' . $element['#children'] . '
'); - - $size = empty($element['#size']) ? 'size="25"' : ' size="'. $element['#size'] .'"'; - $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"'; - $class = array('form-text','listElement'); + //return theme('theme_form_element', $element, '
' . $element['#children'] . '
'); + + $size = empty($element['#size']) ? 'size="25"' : ' size="' . $element['#size'] . '"'; + $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="' . $element['#maxlength'] . '"'; + $class = array('form-text', 'listElement'); $extra = ''; - $output='
'; - - if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { - drupal_add_js('misc/autocomplete.js'); - $class[] = 'form-autocomplete'; - $extra = ''; - } - _form_set_class($element, $class); - - if (isset($element['#field_prefix'])) { - $output .= ''. $element['#field_prefix'] .' '; - } - - $output .= ''; - - if (isset($element['#field_suffix'])) { - $output .= ' '. $element['#field_suffix'] .''; - } - - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
':''); - - - return theme('form_element', $element, $output . $sticky ) . $extra; - - -} + $output = '
'; + + if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { + drupal_add_js('misc/autocomplete.js'); + $class[] = 'form-autocomplete'; + $extra = ''; + } + _form_set_class($element, $class); + + if (isset($element['#field_prefix'])) { + $output .= '' . $element['#field_prefix'] . ' '; + } + $output .= ''; + + if (isset($element['#field_suffix'])) { + $output .= ' ' . $element['#field_suffix'] . ''; + } + + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_css($path . '/css/sticky.css'); + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE ? '
' : ''); + + + return theme('form_element', $element, $output . $sticky) . $extra; +} /** * Format a sticky textarea. @@ -809,18 +753,16 @@ function theme_sticky_textarea($element) { $class[] = 'resizable'; } - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
':''); + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_css($path . '/css/sticky.css'); + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE ? '
' : ''); _form_set_class($element, $class); - return theme('form_element', $element, ''.$sticky); + return theme('form_element', $element, '' . $sticky); } - - /** * Format a sticky select. * @@ -833,20 +775,19 @@ function theme_sticky_textarea($element) { * @ingroup themeable */ function theme_sticky_select($element) { - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
':''); + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_css($path . '/css/sticky.css'); + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE ? '
' : ''); $select = ''; - $size = $element['#size'] ? ' size="'. $element['#size'] .'"' : ''; + $size = $element['#size'] ? ' size="' . $element['#size'] . '"' : ''; _form_set_class($element, array('form-select')); $multiple = $element['#multiple']; - return theme('form_element', $element, ''.$sticky); + return theme('form_element', $element, '' . $sticky); } - /** * Theme function to format the output. * @@ -855,49 +796,46 @@ function theme_sticky_select($element) { */ function theme_datepicker($element) { global $base_url; - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_js($path.'/js/jquery.ui.core.js'); - drupal_add_js($path.'/js/jquery.ui.widget.js'); - drupal_add_js($path.'/js/jquery.ui.datepicker.js'); - drupal_add_css($path.'/css/ui-lightness/jquery-ui-1.8.4.custom.css'); - $js = '$(document).ready(function () { $(\'#'.$element['#id'].'\').datepicker({ buttonImage: \''.$base_url.'/'.$path.'/images/date.png\', constrainInput: false, showOn: \'button\', changeMonth: true, changeYear: true }); });'; - - $size = empty($element['#size']) ? '' : ' size="'. $element['#size'] .'"'; - $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"'; - $class = array('form-text','datepicker'); + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_js($path . '/js/jquery.ui.core.js'); + drupal_add_js($path . '/js/jquery.ui.widget.js'); + drupal_add_js($path . '/js/jquery.ui.datepicker.js'); + drupal_add_css($path . '/css/ui-lightness/jquery-ui-1.8.4.custom.css'); + $js = '$(document).ready(function () { $(\'#' . $element['#id'] . '\').datepicker({ buttonImage: \'' . $base_url . '/' . $path . '/images/date.png\', constrainInput: false, showOn: \'button\', changeMonth: true, changeYear: true }); });'; + + $size = empty($element['#size']) ? '' : ' size="' . $element['#size'] . '"'; + $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="' . $element['#maxlength'] . '"'; + $class = array('form-text', 'datepicker'); $extra = ''; - $output= ''; + $output = ''; $output.='
'; - if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { - drupal_add_js('misc/autocomplete.js'); - $class[] = 'form-autocomplete'; - $extra = ''; - } - _form_set_class($element, $class); - - if (isset($element['#field_prefix'])) { - $output .= ''. $element['#field_prefix'] .' '; - } - - $output .= ''; - - if (isset($element['#field_suffix'])) { - $output .= ' '. $element['#field_suffix'] .''; - } - - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
':''); - - - - return theme('form_element', $element, $output.$sticky ) . $extra; - -} + if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { + drupal_add_js('misc/autocomplete.js'); + $class[] = 'form-autocomplete'; + $extra = ''; + } + _form_set_class($element, $class); + if (isset($element['#field_prefix'])) { + $output .= '' . $element['#field_prefix'] . ' '; + } + $output .= ''; + + if (isset($element['#field_suffix'])) { + $output .= ' ' . $element['#field_suffix'] . ''; + } + + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_css($path . '/css/sticky.css'); + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE ? '
' : ''); + + + + return theme('form_element', $element, $output . $sticky) . $extra; +} /** * Theme function to format the output. @@ -906,67 +844,61 @@ function theme_datepicker($element) { * are placed next to each other, rather than on separate lines. */ function theme_sticky_textfield($element) { - + //echo '
'; var_dump($element); echo '
'; - //return theme('theme_form_element', $element, '
' . $element['#children'] . '
'); - $size = empty($element['#size']) ? '' : ' size="'. $element['#size'] .'"'; - $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"'; + $size = empty($element['#size']) ? '' : ' size="' . $element['#size'] . '"'; + $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="' . $element['#maxlength'] . '"'; $class = array('form-text'); $extra = ''; - $output='
'; - - if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { - drupal_add_js('misc/autocomplete.js'); - $class[] = 'form-autocomplete'; - $extra = ''; - } - _form_set_class($element, $class); - - if (isset($element['#field_prefix'])) { - $output .= ''. $element['#field_prefix'] .' '; - } - - $output .= ''; - - if (isset($element['#field_suffix'])) { - $output .= ' '. $element['#field_suffix'] .''; - } - - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
':''); - - - - return theme('form_element', $element, $output . $sticky) . $extra; - + $output = '
'; + + if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { + drupal_add_js('misc/autocomplete.js'); + $class[] = 'form-autocomplete'; + $extra = ''; + } + _form_set_class($element, $class); + + if (isset($element['#field_prefix'])) { + $output .= '' . $element['#field_prefix'] . ' '; + } + + $output .= ''; + + if (isset($element['#field_suffix'])) { + $output .= ' ' . $element['#field_suffix'] . ''; + } + + $path = drupal_get_path('module', 'islandora_form_elements'); + drupal_add_css($path . '/css/sticky.css'); + $stickyName = preg_replace('/\]/', '', array_pop(preg_split('/\[/', $element['#name']))) . '-sticky'; + $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE ? '
' : ''); + + + + return theme('form_element', $element, $output . $sticky) . $extra; } -function ife_filechooser_validate($element,&$form_state) -{ +function ife_filechooser_validate($element, &$form_state) { module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); $cp = CollectionPolicy::loadFromCollection($form_state['storage']['collection_pid']); - if ($cp !== false) - { - $form_state['values'][$element['#name']] =$cp->getStagingArea().'/'.$element['#value']; + if ($cp !== false) { + $form_state['values'][$element['#name']] = $cp->getStagingArea() . '/' . $element['#value']; } } -function ife_filechooser_process($element, $edit, &$form_state) -{ - $element['#model_pid']=$form_state['values']['models']; - - return $element; +function ife_filechooser_process($element, $edit, &$form_state) { + $element['#model_pid'] = $form_state['values']['models']; + + return $element; } -function islandora_form_elements_menu() -{ +function islandora_form_elements_menu() { - module_load_include('inc','fedora_repository','ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $items=array(); + $items = array(); $items['ife/people_ahah'] = array( 'page callback' => 'ife_people_ahah', @@ -974,72 +906,72 @@ function islandora_form_elements_menu() 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), 'file' => 'includes/people.inc', ); - + $items['autocomplete_marcrelator/%'] = array( 'title' => 'autocomplete', 'page callback' => 'ife_autocomplete_marcrelator', - 'page arguments'=> array(1), + 'page arguments' => array(1), 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc' - ); - + 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), + 'file' => 'includes/autocomplete.inc' + ); + $items['autocomplete_gacs/%'] = array( 'title' => 'autocomplete', 'page callback' => 'ife_autocomplete_gacs', - 'page arguments'=> array(1), + 'page arguments' => array(1), 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc' - ); - + 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), + 'file' => 'includes/autocomplete.inc' + ); + $items['autocomplete_language/%'] = array( 'title' => 'autocomplete', 'page callback' => 'ife_autocomplete_language', - 'page arguments'=> array(1), + 'page arguments' => array(1), 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc' + 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), + 'file' => 'includes/autocomplete.inc' ); $items['autocomplete_person/%'] = array( 'title' => 'autocomplete', 'page callback' => 'ife_autocomplete_person', - 'page arguments'=> array(1), + 'page arguments' => array(1), 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc' - ); - + 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), + 'file' => 'includes/autocomplete.inc' + ); + $items['autocomplete/%/%'] = array( 'title' => 'autocomplete', 'page callback' => 'ife_autocomplete', - 'page arguments'=> array(1,2), + 'page arguments' => array(1, 2), 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc', + 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), + 'file' => 'includes/autocomplete.inc', ); $items['filechooser/getThumbnail/%/%/%'] = array( 'title' => 'getThumbnail', 'page callback' => 'ife_filechooser_get_thumbnail', - 'page arguments'=> array(2,3,4), + 'page arguments' => array(2, 3, 4), 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), + 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), 'file' => 'includes/filechooser.inc' - ); - + ); + $items['filechooser/generatePreview/%/%'] = array( 'title' => 'generatePreview', 'page callback' => 'ife_filechooser_generate_thumbnails', - 'page arguments'=> array(2,3), + 'page arguments' => array(2, 3), 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), + 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), 'file' => 'includes/filechooser.inc' - ); + ); + - return $items; } diff --git a/form_elements/js/copyright.js b/form_elements/js/copyright.js index 6c9ed082..b36061a6 100644 --- a/form_elements/js/copyright.js +++ b/form_elements/js/copyright.js @@ -1,48 +1,102 @@ $(document).ready(function () { - var cc_versions = new Array(); cc_versions[""]="3.0"; cc_versions["ar"]="2.5"; cc_versions["au"]="3.0"; cc_versions["at"]="3.0"; cc_versions["be"]="2.0"; cc_versions["br"]="3.0"; cc_versions["bg"]="2.5"; cc_versions["ca"]="2.5"; cc_versions["cl"]="2.0"; cc_versions["cn"]="2.5"; cc_versions["co"]="2.5"; cc_versions["hr"]="3.0"; cc_versions["cz"]="3.0"; cc_versions["dk"]="2.5"; cc_versions["ec"]="3.0"; cc_versions["fi"]="1.0"; cc_versions["fr"]="2.0"; cc_versions["de"]="3.0"; cc_versions["gr"]="3.0"; cc_versions["gt"]="3.0"; cc_versions["hk"]="3.0"; cc_versions["hu"]="2.5"; cc_versions["in"]="2.5"; cc_versions["il"]="2.5"; cc_versions["it"]="2.5"; cc_versions["jp"]="2.0"; cc_versions["kr"]="2.0"; cc_versions["lu"]="3.0"; cc_versions["mk"]="2.5"; cc_versions["my"]="2.5"; cc_versions["mt"]="2.5"; cc_versions["mx"]="2.5"; cc_versions["nl"]="3.0"; cc_versions["nz"]="3.0"; cc_versions["no"]="3.0"; cc_versions["pe"]="2.5"; cc_versions["ph"]="3.0"; cc_versions["pl"]="3.0"; cc_versions["pt"]="2.5"; cc_versions["pr"]="3.0"; cc_versions["ro"]="3.0"; cc_versions["rs"]="3.0"; cc_versions["sg"]="3.0"; cc_versions["si"]="2.5"; cc_versions["za"]="2.5"; cc_versions["es"]="3.0"; cc_versions["se"]="2.5"; cc_versions["ch"]="2.5"; cc_versions["tw"]="3.0"; cc_versions["th"]="3.0"; cc_versions["uk"]="2.0"; cc_versions["scotland"]="2.5"; cc_versions["us"]="3.0"; cc_versions["vn"]="3.0"; + var cc_versions = new Array(); + cc_versions[""]="3.0"; + cc_versions["ar"]="2.5"; + cc_versions["au"]="3.0"; + cc_versions["at"]="3.0"; + cc_versions["be"]="2.0"; + cc_versions["br"]="3.0"; + cc_versions["bg"]="2.5"; + cc_versions["ca"]="2.5"; + cc_versions["cl"]="2.0"; + cc_versions["cn"]="2.5"; + cc_versions["co"]="2.5"; + cc_versions["hr"]="3.0"; + cc_versions["cz"]="3.0"; + cc_versions["dk"]="2.5"; + cc_versions["ec"]="3.0"; + cc_versions["fi"]="1.0"; + cc_versions["fr"]="2.0"; + cc_versions["de"]="3.0"; + cc_versions["gr"]="3.0"; + cc_versions["gt"]="3.0"; + cc_versions["hk"]="3.0"; + cc_versions["hu"]="2.5"; + cc_versions["in"]="2.5"; + cc_versions["il"]="2.5"; + cc_versions["it"]="2.5"; + cc_versions["jp"]="2.0"; + cc_versions["kr"]="2.0"; + cc_versions["lu"]="3.0"; + cc_versions["mk"]="2.5"; + cc_versions["my"]="2.5"; + cc_versions["mt"]="2.5"; + cc_versions["mx"]="2.5"; + cc_versions["nl"]="3.0"; + cc_versions["nz"]="3.0"; + cc_versions["no"]="3.0"; + cc_versions["pe"]="2.5"; + cc_versions["ph"]="3.0"; + cc_versions["pl"]="3.0"; + cc_versions["pt"]="2.5"; + cc_versions["pr"]="3.0"; + cc_versions["ro"]="3.0"; + cc_versions["rs"]="3.0"; + cc_versions["sg"]="3.0"; + cc_versions["si"]="2.5"; + cc_versions["za"]="2.5"; + cc_versions["es"]="3.0"; + cc_versions["se"]="2.5"; + cc_versions["ch"]="2.5"; + cc_versions["tw"]="3.0"; + cc_versions["th"]="3.0"; + cc_versions["uk"]="2.0"; + cc_versions["scotland"]="2.5"; + cc_versions["us"]="3.0"; + cc_versions["vn"]="3.0"; - function updateCCPreview() - { + function updateCCPreview() + { - var commercial = $('.cc_commercial').val(); - var modification = $('.cc_modifications').val(); - var jurisdiction= $('.cc_jurisdiction').val(); - var jurisdiction_name = jurisdiction; - var version = cc_versions[jurisdiction_name]; + var commercial = $('.cc_commercial').val(); + var modification = $('.cc_modifications').val(); + var jurisdiction= $('.cc_jurisdiction').val(); + var jurisdiction_name = jurisdiction; + var version = cc_versions[jurisdiction_name]; - var params=""; + var params=""; - if (commercial != '') - params+="-"+commercial; - if (modification != '') - params+="-"+modification; + if (commercial != '') + params+="-"+commercial; + if (modification != '') + params+="-"+modification; - if (jurisdiction != null) - jurisdiction+="/"; - else - { - jurisdiction = ""; - jurisdiction_name = ""; - } + if (jurisdiction != null) + jurisdiction+="/"; + else + { + jurisdiction = ""; + jurisdiction_name = ""; + } - var html = "\"Creative
This work is licensed under a Creative Commons License."; + var html = "\"Creative
This work is licensed under a Creative Commons License."; - $('.cc_preview').html(html); - } + $('.cc_preview').html(html); + } - $('.cc_enable').change(function () { - $('.cc_field').attr('disabled', !$(this).attr('checked')); - if ($(this).attr('checked')) - updateCCPreview(); - else - $('.cc_preview').html(''); - }); + $('.cc_enable').change(function () { + $('.cc_field').attr('disabled', !$(this).attr('checked')); + if ($(this).attr('checked')) + updateCCPreview(); + else + $('.cc_preview').html(''); + }); - $('.cc_field').change(function () { - updateCCPreview(); - }); + $('.cc_field').change(function () { + updateCCPreview(); + }); - updateCCPreview(); + updateCCPreview(); }); \ No newline at end of file diff --git a/form_elements/js/filechooser.js b/form_elements/js/filechooser.js index 7a9625ef..8c73c49f 100644 --- a/form_elements/js/filechooser.js +++ b/form_elements/js/filechooser.js @@ -13,7 +13,7 @@ $(document).ready(function () { if ($('#fileField').attr('value') != '') { - selectedValue = $('#fileField').attr('value'); + selectedValue = $('#fileField').attr('value'); } cp_pid = $('#edit-collection-pid').attr('value'); @@ -21,66 +21,66 @@ $(document).ready(function () { $.getJSON("/filechooser/generatePreview/"+cp_pid+"/"+cm_pid+"?start="+start+"&end="+end,function (data) { - $('#fileList').html(''); - if (data.length == 0) - { - $('#fileList').append('
No files found in staging area.
'); + $('#fileList').html(''); + if (data.length == 0) + { + $('#fileList').append('
No files found in staging area.
'); - } else - { - $.each(data, function(i, item) - { - var html; - files[i]=item.name; - var selected= ""; - if (selectedValue == item.name) - { - selected='class="selected"'; - selectedFile='file'+i; - selectedIndex=i - (i%visibleFiles); - } + } else +{ + $.each(data, function(i, item) + { + var html; + files[i]=item.name; + var selected= ""; + if (selectedValue == item.name) + { + selected='class="selected"'; + selectedFile='file'+i; + selectedIndex=i - (i%visibleFiles); + } - if (item.thumb) - { - html='
  • '+item.name+'
    '+item.mime+'
    '+item.size+'  '+item.resolution+'
  • '; - } else - { - var type=item.mime.split('/',1).shift(); - html='
  •  
    '+item.name+'
    '+item.mime+'
    '+item.size+'
  • '; - } + if (item.thumb) + { + html='
  • '+item.name+'
    '+item.mime+'
    '+item.size+'  '+item.resolution+'
  • '; + } else +{ + var type=item.mime.split('/',1).shift(); + html='
  •  
    '+item.name+'
    '+item.mime+'
    '+item.size+'
  • '; + } - $('#fileList').append(html); - }); + $('#fileList').append(html); + }); - $('#fileList li div').breakly(15); + $('#fileList li div').breakly(15); - } + } - $(".carousel .jCarouselLite").jCarouselLite({ - btnNext: ".carousel .next", - btnPrev: ".carousel .prev", - mouseWheel: true, - circular: false, - speed: 750, - visible: visibleFiles, - scroll: visibleFiles, - initial: selectedIndex - }); + $(".carousel .jCarouselLite").jCarouselLite({ + btnNext: ".carousel .next", + btnPrev: ".carousel .prev", + mouseWheel: true, + circular: false, + speed: 750, + visible: visibleFiles, + scroll: visibleFiles, + initial: selectedIndex + }); - $(".carousel li").click(function() { + $(".carousel li").click(function() { - if (selectedFile != this.id) - { - $('#fileField').attr('value',files[this.id.split('file',2).pop()]); - $("#"+(this.id)).addClass('selected'); - if (selectedFile != null) - { - $("#"+selectedFile).removeClass('selected'); - } - selectedFile=this.id; - } - }) + if (selectedFile != this.id) + { + $('#fileField').attr('value',files[this.id.split('file',2).pop()]); + $("#"+(this.id)).addClass('selected'); + if (selectedFile != null) + { + $("#"+selectedFile).removeClass('selected'); + } + selectedFile=this.id; + } + }) }); diff --git a/form_elements/js/jcarousellite_1.0.1.js b/form_elements/js/jcarousellite_1.0.1.js index d51bca66..845b7f46 100644 --- a/form_elements/js/jcarousellite_1.0.1.js +++ b/form_elements/js/jcarousellite_1.0.1.js @@ -201,143 +201,164 @@ */ (function($) { // Compliant with jquery.noConflict() -$.fn.jCarouselLite = function(o) { - o = $.extend({ - btnPrev: null, - btnNext: null, - btnGo: null, - mouseWheel: false, - auto: null, + $.fn.jCarouselLite = function(o) { + o = $.extend({ + btnPrev: null, + btnNext: null, + btnGo: null, + mouseWheel: false, + auto: null, - speed: 200, - easing: null, + speed: 200, + easing: null, - vertical: false, - circular: true, - visible: 3, - start: 0, - scroll: 1, + vertical: false, + circular: true, + visible: 3, + start: 0, + scroll: 1, - beforeStart: null, - afterEnd: null - }, o || {}); + beforeStart: null, + afterEnd: null + }, o || {}); - return this.each(function() { // Returns the element collection. Chainable. + return this.each(function() { // Returns the element collection. Chainable. - var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width"; - var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible; + var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width"; + var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible; - if(o.circular) { - ul.prepend(tLi.slice(tl-v-1+1).clone()) - .append(tLi.slice(0,v).clone()); - o.start += v; - } + if(o.circular) { + ul.prepend(tLi.slice(tl-v-1+1).clone()) + .append(tLi.slice(0,v).clone()); + o.start += v; + } - var li = $("li", ul), itemLength = li.size(), curr = o.start; - div.css("visibility", "visible"); + var li = $("li", ul), itemLength = li.size(), curr = o.start; + div.css("visibility", "visible"); - li.css({overflow: "hidden", float: o.vertical ? "none" : "left"}); - ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"}); - div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"}); + li.css({ + overflow: "hidden", + float: o.vertical ? "none" : "left" + }); + ul.css({ + margin: "0", + padding: "0", + position: "relative", + "list-style-type": "none", + "z-index": "1" + }); + div.css({ + overflow: "hidden", + position: "relative", + "z-index": "2", + left: "0px" + }); - var liSize = o.vertical ? height(li) : width(li); // Full li size(incl margin)-Used for animation - var ulSize = liSize * itemLength; // size of full ul(total length, not just for the visible items) - var divSize = liSize * v; // size of entire div(total length for just the visible items) + var liSize = o.vertical ? height(li) : width(li); // Full li size(incl margin)-Used for animation + var ulSize = liSize * itemLength; // size of full ul(total length, not just for the visible items) + var divSize = liSize * v; // size of entire div(total length for just the visible items) - li.css({width: li.width(), height: li.height()}); - ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize)); + li.css({ + width: li.width(), + height: li.height() + }); + ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize)); - div.css(sizeCss, divSize+"px"); // Width of the DIV. length of visible images + div.css(sizeCss, divSize+"px"); // Width of the DIV. length of visible images - if(o.btnPrev) - $(o.btnPrev).click(function() { - return go(curr-o.scroll); - }); + if(o.btnPrev) + $(o.btnPrev).click(function() { + return go(curr-o.scroll); + }); - if(o.btnNext) - $(o.btnNext).click(function() { - return go(curr+o.scroll); - }); + if(o.btnNext) + $(o.btnNext).click(function() { + return go(curr+o.scroll); + }); - if(o.btnGo) - $.each(o.btnGo, function(i, val) { - $(val).click(function() { - return go(o.circular ? o.visible+i : i); + if(o.btnGo) + $.each(o.btnGo, function(i, val) { + $(val).click(function() { + return go(o.circular ? o.visible+i : i); + }); }); - }); - if(o.initial && o.initial >= o.visible) - go(o.circular ? o.visible+o.initial : o.initial); + if(o.initial && o.initial >= o.visible) + go(o.circular ? o.visible+o.initial : o.initial); - if(o.mouseWheel && div.mousewheel) - div.mousewheel(function(e, d) { - return d>0 ? go(curr-o.scroll) : go(curr+o.scroll); - }); + if(o.mouseWheel && div.mousewheel) + div.mousewheel(function(e, d) { + return d>0 ? go(curr-o.scroll) : go(curr+o.scroll); + }); - if(o.auto) - setInterval(function() { - go(curr+o.scroll); - }, o.auto+o.speed); + if(o.auto) + setInterval(function() { + go(curr+o.scroll); + }, o.auto+o.speed); - function vis() { - return li.slice(curr).slice(0,v); - }; + function vis() { + return li.slice(curr).slice(0,v); + }; - function go(to) { - if(!running) { + function go(to) { + if(!running) { - if(o.beforeStart) - o.beforeStart.call(this, vis()); + if(o.beforeStart) + o.beforeStart.call(this, vis()); - if(o.circular) { // If circular we are in first or last, then goto the other end - if(to<=o.start-v-1) { // If first, then goto last - ul.css(animCss, -((itemLength-(v*2))*liSize)+"px"); - // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements. - curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll; - } else if(to>=itemLength-v+1) { // If last, then goto first - ul.css(animCss, -( (v) * liSize ) + "px" ); - // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements. - curr = to==itemLength-v+1 ? v+1 : v+o.scroll; - } else curr = to; - } else { // If non-circular and to points to first or last, we just return. - if(to<0 || to>itemLength-v) return; - else curr = to; - } // If neither overrides it, the curr will still be "to" and we can proceed. + if(o.circular) { // If circular we are in first or last, then goto the other end + if(to<=o.start-v-1) { // If first, then goto last + ul.css(animCss, -((itemLength-(v*2))*liSize)+"px"); + // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements. + curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll; + } else if(to>=itemLength-v+1) { // If last, then goto first + ul.css(animCss, -( (v) * liSize ) + "px" ); + // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements. + curr = to==itemLength-v+1 ? v+1 : v+o.scroll; + } else curr = to; + } else { // If non-circular and to points to first or last, we just return. + if(to<0 || to>itemLength-v) return; + else curr = to; + } // If neither overrides it, the curr will still be "to" and we can proceed. - running = true; + running = true; - ul.animate( - animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing, - function() { - if(o.afterEnd) - o.afterEnd.call(this, vis()); - running = false; + ul.animate( + animCss == "left" ? { + left: -(curr*liSize) + } : { + top: -(curr*liSize) + } , o.speed, o.easing, + function() { + if(o.afterEnd) + o.afterEnd.call(this, vis()); + running = false; + } + ); + // Disable buttons when the carousel reaches the last/first, and enable when not + if(!o.circular) { + $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); + $( (curr-o.scroll<0 && o.btnPrev) + || + (curr+o.scroll > itemLength-v && o.btnNext) + || + [] + ).addClass("disabled"); } - ); - // Disable buttons when the carousel reaches the last/first, and enable when not - if(!o.circular) { - $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); - $( (curr-o.scroll<0 && o.btnPrev) - || - (curr+o.scroll > itemLength-v && o.btnNext) - || - [] - ).addClass("disabled"); - } - } - return false; - }; - }); -}; + } + return false; + }; + }); + }; -function css(el, prop) { - return parseInt($.css(el[0], prop)) || 0; -}; -function width(el) { - return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); -}; -function height(el) { - return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); -}; + function css(el, prop) { + return parseInt($.css(el[0], prop)) || 0; + }; + function width(el) { + return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); + }; + function height(el) { + return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); + }; })(jQuery); \ No newline at end of file diff --git a/form_elements/js/jquery.breakly-1.0.js b/form_elements/js/jquery.breakly-1.0.js index e025a34d..2aad2cc2 100644 --- a/form_elements/js/jquery.breakly-1.0.js +++ b/form_elements/js/jquery.breakly-1.0.js @@ -21,38 +21,38 @@ * List of Unicode spaces: http://www.cs.tut.fi/~jkorpela/chars/spaces.html */ $.fn.breakly = function(chopAt, spaceCode) { - spaceCode |= 8203; // U+200B ZERO WIDTH SPACE - var zw = String.fromCharCode(spaceCode), re = new RegExp(/\B/), orig, idx, chopped, ch; - function breakly(node) { - if (3 == node.nodeType && (orig = node.nodeValue).length > chopAt) { - idx = 0; - chopped=[]; - for (var i=0; i < orig.length; i++) { - ch = orig.substr(i,1); - chopped.push(ch); - if (null != ch.match(re)) { - idx=0; - continue; + spaceCode |= 8203; // U+200B ZERO WIDTH SPACE + var zw = String.fromCharCode(spaceCode), re = new RegExp(/\B/), orig, idx, chopped, ch; + function breakly(node) { + if (3 == node.nodeType && (orig = node.nodeValue).length > chopAt) { + idx = 0; + chopped=[]; + for (var i=0; i < orig.length; i++) { + ch = orig.substr(i,1); + chopped.push(ch); + if (null != ch.match(re)) { + idx=0; + continue; + } + if (++idx == chopAt) { + ch = orig.substr(i+1,1); // look ahead + if (ch && null == ch.match(re)) { + chopped.push(zw); + idx=0; + } + } + } + node.nodeValue = chopped.join(''); + } else { + for (var i=0; i < node.childNodes.length; i++) { + breakly(node.childNodes[i]); + } } - if (++idx == chopAt) { - ch = orig.substr(i+1,1); // look ahead - if (ch && null == ch.match(re)) { - chopped.push(zw); - idx=0; - } - } - } - node.nodeValue = chopped.join(''); - } else { - for (var i=0; i < node.childNodes.length; i++) { - breakly(node.childNodes[i]); - } } - } - return this.each(function() { - breakly(this); - }) + return this.each(function() { + breakly(this); + }) } diff --git a/form_elements/js/jquery.easing.1.1.js b/form_elements/js/jquery.easing.1.1.js index f2ae8730..8f20be60 100644 --- a/form_elements/js/jquery.easing.1.1.js +++ b/form_elements/js/jquery.easing.1.1.js @@ -10,96 +10,117 @@ */ jQuery.easing = { - easein: function(x, t, b, c, d) { - return c*(t/=d)*t + b; // in - }, - easeinout: function(x, t, b, c, d) { - if (t < d/2) return 2*c*t*t/(d*d) + b; - var ts = t - d/2; - return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b; - }, - easeout: function(x, t, b, c, d) { - return -c*t*t/(d*d) + 2*c*t/d + b; - }, - expoin: function(x, t, b, c, d) { - var flip = 1; - if (c < 0) { - flip *= -1; - c *= -1; - } - return flip * (Math.exp(Math.log(c)/d * t)) + b; - }, - expoout: function(x, t, b, c, d) { - var flip = 1; - if (c < 0) { - flip *= -1; - c *= -1; - } - return flip * (-Math.exp(-Math.log(c)/d * (t-d)) + c + 1) + b; - }, - expoinout: function(x, t, b, c, d) { - var flip = 1; - if (c < 0) { - flip *= -1; - c *= -1; - } - if (t < d/2) return flip * (Math.exp(Math.log(c/2)/(d/2) * t)) + b; - return flip * (-Math.exp(-2*Math.log(c/2)/d * (t-d)) + c + 1) + b; - }, - bouncein: function(x, t, b, c, d) { - return c - jQuery.easing['bounceout'](x, d-t, 0, c, d) + b; - }, - bounceout: function(x, t, b, c, d) { - if ((t/=d) < (1/2.75)) { - return c*(7.5625*t*t) + b; - } else if (t < (2/2.75)) { - return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; - } else if (t < (2.5/2.75)) { - return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; - } else { - return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; - } - }, - bounceinout: function(x, t, b, c, d) { - if (t < d/2) return jQuery.easing['bouncein'] (x, t*2, 0, c, d) * .5 + b; - return jQuery.easing['bounceout'] (x, t*2-d,0, c, d) * .5 + c*.5 + b; - }, - elasin: function(x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - }, - elasout: function(x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; - }, - elasinout: function(x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; - }, - backin: function(x, t, b, c, d) { - var s=1.70158; - return c*(t/=d)*t*((s+1)*t - s) + b; - }, - backout: function(x, t, b, c, d) { - var s=1.70158; - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; - }, - backinout: function(x, t, b, c, d) { - var s=1.70158; - if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; - }, - linear: function(x, t, b, c, d) { - return c*t/d + b; //linear - } + easein: function(x, t, b, c, d) { + return c*(t/=d)*t + b; // in + }, + easeinout: function(x, t, b, c, d) { + if (t < d/2) return 2*c*t*t/(d*d) + b; + var ts = t - d/2; + return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b; + }, + easeout: function(x, t, b, c, d) { + return -c*t*t/(d*d) + 2*c*t/d + b; + }, + expoin: function(x, t, b, c, d) { + var flip = 1; + if (c < 0) { + flip *= -1; + c *= -1; + } + return flip * (Math.exp(Math.log(c)/d * t)) + b; + }, + expoout: function(x, t, b, c, d) { + var flip = 1; + if (c < 0) { + flip *= -1; + c *= -1; + } + return flip * (-Math.exp(-Math.log(c)/d * (t-d)) + c + 1) + b; + }, + expoinout: function(x, t, b, c, d) { + var flip = 1; + if (c < 0) { + flip *= -1; + c *= -1; + } + if (t < d/2) return flip * (Math.exp(Math.log(c/2)/(d/2) * t)) + b; + return flip * (-Math.exp(-2*Math.log(c/2)/d * (t-d)) + c + 1) + b; + }, + bouncein: function(x, t, b, c, d) { + return c - jQuery.easing['bounceout'](x, d-t, 0, c, d) + b; + }, + bounceout: function(x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + bounceinout: function(x, t, b, c, d) { + if (t < d/2) return jQuery.easing['bouncein'] (x, t*2, 0, c, d) * .5 + b; + return jQuery.easing['bounceout'] (x, t*2-d,0, c, d) * .5 + c*.5 + b; + }, + elasin: function(x, t, b, c, d) { + var s=1.70158; + var p=0; + var a=c; + if (t==0) return b; + if ((t/=d)==1) return b+c; + if (!p) p=d*.3; + if (a < Math.abs(c)) { + a=c; + var s=p/4; + } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + elasout: function(x, t, b, c, d) { + var s=1.70158; + var p=0; + var a=c; + if (t==0) return b; + if ((t/=d)==1) return b+c; + if (!p) p=d*.3; + if (a < Math.abs(c)) { + a=c; + var s=p/4; + } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + elasinout: function(x, t, b, c, d) { + var s=1.70158; + var p=0; + var a=c; + if (t==0) return b; + if ((t/=d/2)==2) return b+c; + if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { + a=c; + var s=p/4; + } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + backin: function(x, t, b, c, d) { + var s=1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + backout: function(x, t, b, c, d) { + var s=1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + backinout: function(x, t, b, c, d) { + var s=1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + linear: function(x, t, b, c, d) { + return c*t/d + b; //linear + } }; \ No newline at end of file diff --git a/form_elements/js/jquery.loadImages.1.0.1.js b/form_elements/js/jquery.loadImages.1.0.1.js index b2594ba3..c97e74e2 100644 --- a/form_elements/js/jquery.loadImages.1.0.1.js +++ b/form_elements/js/jquery.loadImages.1.0.1.js @@ -9,24 +9,24 @@ images = [images]; } - if (!(images instanceof Array)) { - ids = [ids]; - } + if (!(images instanceof Array)) { + ids = [ids]; + } var imagesLength = images.length; var loadedCounter = 0; for (var i=0; i < imagesLength; i++) { - var cacheImage = document.createElement('img'); - //set the onload method before the src is called otherwise will fail to be called in IE + var cacheImage = document.createElement('img'); + //set the onload method before the src is called otherwise will fail to be called in IE cacheImage.onload = function(){ loadedCounter++; if ($.isFunction(callback)) { - callback(this); + callback(this); } } cacheImage.src = images[i]; - cacheImage.id = '#'+ids[i]; + cacheImage.id = '#'+ids[i]; cache.push(cacheImage); } } diff --git a/form_elements/js/jquery.loadImages.1.0.1.min.js b/form_elements/js/jquery.loadImages.1.0.1.min.js index b697758e..37ddde82 100644 --- a/form_elements/js/jquery.loadImages.1.0.1.min.js +++ b/form_elements/js/jquery.loadImages.1.0.1.min.js @@ -1 +1,16 @@ -(function(c){var h=[];c.loadImages=function(a,d){a instanceof Array||(a=[a]);for(var e=a.length,f=0,g=e;g--;){var b=document.createElement("img");b.onload=function(){f++;f>=e&&c.isFunction(d)&&d()};b.src=a[g];h.push(b)}}})(jQuery); \ No newline at end of file +(function(c){ + var h=[]; + c.loadImages=function(a,d){ + a instanceof Array||(a=[a]); + for(var e=a.length,f=0,g=e;g--;){ + var b=document.createElement("img"); + b.onload=function(){ + f++; + f>=e&&c.isFunction(d)&&d() + }; + + b.src=a[g]; + h.push(b) + } + } + })(jQuery); \ No newline at end of file diff --git a/form_elements/js/jquery.mousewheel.min.js b/form_elements/js/jquery.mousewheel.min.js index 05ebb0a9..06a4127c 100644 --- a/form_elements/js/jquery.mousewheel.min.js +++ b/form_elements/js/jquery.mousewheel.min.js @@ -8,4 +8,48 @@ * * Requires: 1.2.2+ */ -(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery); \ No newline at end of file +(function(c){ + var a=["DOMMouseScroll","mousewheel"]; + c.event.special.mousewheel={ + setup:function(){ + if(this.addEventListener){ + for(var d=a.length;d;){ + this.addEventListener(a[--d],b,false) + } + }else{ + this.onmousewheel=b + } + }, +teardown:function(){ + if(this.removeEventListener){ + for(var d=a.length;d;){ + this.removeEventListener(a[--d],b,false) + } + }else{ + this.onmousewheel=null + } +} +}; + +c.fn.extend({ + mousewheel:function(d){ + return d?this.bind("mousewheel",d):this.trigger("mousewheel") + }, + unmousewheel:function(d){ + return this.unbind("mousewheel",d) + } + }); +function b(f){ + var d=[].slice.call(arguments,1),g=0,e=true; + f=c.event.fix(f||window.event); + f.type="mousewheel"; + if(f.wheelDelta){ + g=f.wheelDelta/120 + } + if(f.detail){ + g=-f.detail/3 + } + d.unshift(f,g); + return c.event.handle.apply(this,d) + } +})(jQuery); \ No newline at end of file diff --git a/form_elements/js/jquery.tag.editor-min.js b/form_elements/js/jquery.tag.editor-min.js index b111631d..fe6dfe8a 100644 --- a/form_elements/js/jquery.tag.editor-min.js +++ b/form_elements/js/jquery.tag.editor-min.js @@ -5,4 +5,148 @@ @license: Creative Commons License - ShareAlike http://creativecommons.org/licenses/by-sa/3.0/ @version: 1.4.1 */ -(function(jQuery) { jQuery.fn.tagEditor = function(options) { var defaults = { separator: ",", items: [], className: "tagEditor", confirmRemoval: false, confirmRemovalText: "Do you really want to remove the tag?", completeOnSeparator: false, completeOnBlur: false, tagsBeforeField: false, initialParse: true, imageTag: false, imageTagUrl: "", continuousOutputBuild: false }; options = jQuery.extend(defaults, options); var listBase, textBase = this, hiddenText; var itemBase = []; return this.each(function() { function addTag(tag) { tag = jQuery.trim(tag); for (var i = 0; i < itemBase.length; i++) { if (itemBase[i].toLowerCase() == tag.toLowerCase()) { return false; } } var item = jQuery(document.createElement("li")); item.text(tag); item.attr("title", "Remove tag"); if (options.imageTag) { item.append(''); } item.click(function() { if (options.confirmRemoval) { if (!confirm(options.confirmRemovalText)) { return; } } item.remove(); parse(); }); listBase.append(item); return true; } function resetTags() { itemBase = []; listBase.html(""); textBase.val(""); hiddenText.val(""); for (var i = 0; i < options.items.length; i++) { addTag(jQuery.trim(options.items[i])); } parse(); } function buildArray() { itemBase = []; var items = jQuery("li", listBase); for (var i = 0; i < items.length; i++) { itemBase.push(jQuery.trim(jQuery(items[i]).text())); } if (options.continuousOutputBuild) { hiddenText.val(itemBase.join(options.separator)); } } function parse() { var items = textBase.val().split(options.separator); for (var i = 0; i < items.length; i++) { var trimmedItem = jQuery.trim(items[i]); if (trimmedItem.length > 0) { addTag(trimmedItem); } } textBase.val(""); buildArray(); } function handleKeys(ev) { var keyCode = (ev.which) ? ev.which : ev.keyCode; if (options.completeOnSeparator) { if (String.fromCharCode(keyCode) == options.separator) { parse(); return false; } } switch (keyCode) { case 13: if (jQuery.trim(textBase.val()) != "") { parse(); return false; } return true; default: return true; } } jQuery.fn.extend({ tagEditorGetTags: function() { return itemBase.join(options.separator); }, tagEditorResetTags: function() { resetTags(); }, tagEditorAddTag: function(tag) { return addTag(tag); } }); hiddenText = jQuery(document.createElement("input")); hiddenText.attr("type", "hidden"); if (options.continuousOutputBuild) { hiddenText.attr("name", textBase.attr("name")); textBase.attr("name", textBase.attr("name") + "_old"); } textBase.after(hiddenText); listBase = jQuery(document.createElement("ul")); listBase.attr("class", options.className); if (options.tagsBeforeField) { jQuery(this).before(listBase); } else { jQuery(this).after(listBase); } for (var i = 0; i < options.items.length; i++) { addTag(jQuery.trim(options.items[i])); } if (options.initialParse) { parse(); } if (options.completeOnBlur) { jQuery(this).blur(parse); } buildArray(); jQuery(this).keypress(handleKeys); var form = jQuery(this).parents("form"); if (!options.continuousOutputBuild) { form.submit(function() { parse(); hiddenText.val(itemBase.join(options.separator)); hiddenText.attr("id", textBase.attr("id")); hiddenText.attr("name", textBase.attr("name")); textBase.attr("id", textBase.attr("id") + "_old"); textBase.attr("name", textBase.attr("name") + "_old"); }); } }); }; })(jQuery); \ No newline at end of file +(function(jQuery) { + jQuery.fn.tagEditor = function(options) { + var defaults = { + separator: ",", + items: [], + className: "tagEditor", + confirmRemoval: false, + confirmRemovalText: "Do you really want to remove the tag?", + completeOnSeparator: false, + completeOnBlur: false, + tagsBeforeField: false, + initialParse: true, + imageTag: false, + imageTagUrl: "", + continuousOutputBuild: false + }; + options = jQuery.extend(defaults, options); + var listBase, textBase = this, hiddenText; + var itemBase = []; + return this.each(function() { + function addTag(tag) { + tag = jQuery.trim(tag); + for (var i = 0; i < itemBase.length; i++) { + if (itemBase[i].toLowerCase() == tag.toLowerCase()) { + return false; + } + } + var item = jQuery(document.createElement("li")); + item.text(tag); + item.attr("title", "Remove tag"); + if (options.imageTag) { + item.append(''); + } + item.click(function() { + if (options.confirmRemoval) { + if (!confirm(options.confirmRemovalText)) { + return; + } + } + item.remove(); + parse(); + }); + listBase.append(item); + return true; + } + function resetTags() { + itemBase = []; + listBase.html(""); + textBase.val(""); + hiddenText.val(""); + for (var i = 0; i < options.items.length; i++) { + addTag(jQuery.trim(options.items[i])); + } + parse(); + } + function buildArray() { + itemBase = []; + var items = jQuery("li", listBase); + for (var i = 0; i < items.length; i++) { + itemBase.push(jQuery.trim(jQuery(items[i]).text())); + } + if (options.continuousOutputBuild) { + hiddenText.val(itemBase.join(options.separator)); + } + } + function parse() { + var items = textBase.val().split(options.separator); + for (var i = 0; i < items.length; i++) { + var trimmedItem = jQuery.trim(items[i]); + if (trimmedItem.length > 0) { + addTag(trimmedItem); + } + } + textBase.val(""); + buildArray(); +} +function handleKeys(ev) { + var keyCode = (ev.which) ? ev.which : ev.keyCode; + if (options.completeOnSeparator) { + if (String.fromCharCode(keyCode) == options.separator) { + parse(); + return false; + } + } +switch (keyCode) { + case 13: + if (jQuery.trim(textBase.val()) != "") { + parse(); + return false; + } + return true; + default: + return true; +} +} +jQuery.fn.extend({ + tagEditorGetTags: function() { + return itemBase.join(options.separator); + }, + tagEditorResetTags: function() { + resetTags(); + }, + tagEditorAddTag: function(tag) { + return addTag(tag); + } +}); +hiddenText = jQuery(document.createElement("input")); +hiddenText.attr("type", "hidden"); +if (options.continuousOutputBuild) { + hiddenText.attr("name", textBase.attr("name")); + textBase.attr("name", textBase.attr("name") + "_old"); +} +textBase.after(hiddenText); +listBase = jQuery(document.createElement("ul")); +listBase.attr("class", options.className); +if (options.tagsBeforeField) { + jQuery(this).before(listBase); +} else { + jQuery(this).after(listBase); +} +for (var i = 0; i < options.items.length; i++) { + addTag(jQuery.trim(options.items[i])); +} +if (options.initialParse) { + parse(); +} +if (options.completeOnBlur) { + jQuery(this).blur(parse); +} +buildArray(); +jQuery(this).keypress(handleKeys); +var form = jQuery(this).parents("form"); +if (!options.continuousOutputBuild) { + form.submit(function() { + parse(); + hiddenText.val(itemBase.join(options.separator)); + hiddenText.attr("id", textBase.attr("id")); + hiddenText.attr("name", textBase.attr("name")); + textBase.attr("id", textBase.attr("id") + "_old"); + textBase.attr("name", textBase.attr("name") + "_old"); + }); +} +}); +}; +})(jQuery); \ No newline at end of file diff --git a/form_elements/js/jquery.ui.core.js b/form_elements/js/jquery.ui.core.js index 7067cddf..6b702a93 100644 --- a/form_elements/js/jquery.ui.core.js +++ b/form_elements/js/jquery.ui.core.js @@ -9,273 +9,273 @@ */ (function( $, undefined ) { -// prevent duplicate loading -// this is only a problem because we proxy existing functions -// and we don't want to double proxy them -$.ui = $.ui || {}; -if ( $.ui.version ) { - return; -} - -//Helper functions and ui object -$.extend( $.ui, { - version: "1.8.4", - - // $.ui.plugin is deprecated. Use the proxy pattern instead. - plugin: { - add: function( module, option, set ) { - var proto = $.ui[ module ].prototype; - for ( var i in set ) { - proto.plugins[ i ] = proto.plugins[ i ] || []; - proto.plugins[ i ].push( [ option, set[ i ] ] ); - } - }, - call: function( instance, name, args ) { - var set = instance.plugins[ name ]; - if ( !set || !instance.element[ 0 ].parentNode ) { - return; - } - - for ( var i = 0; i < set.length; i++ ) { - if ( instance.options[ set[ i ][ 0 ] ] ) { - set[ i ][ 1 ].apply( instance.element, args ); - } - } - } - }, - - contains: function( a, b ) { - return document.compareDocumentPosition ? - a.compareDocumentPosition( b ) & 16 : - a !== b && a.contains( b ); - }, - - hasScroll: function( el, a ) { - - //If overflow is hidden, the element might have extra content, but the user wants to hide it - if ( $( el ).css( "overflow" ) === "hidden") { - return false; - } - - var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", - has = false; - - if ( el[ scroll ] > 0 ) { - return true; - } - - // TODO: determine which cases actually cause this to happen - // if the element doesn't have the scroll set, see if it's possible to - // set the scroll - el[ scroll ] = 1; - has = ( el[ scroll ] > 0 ); - el[ scroll ] = 0; - return has; - }, - - isOverAxis: function( x, reference, size ) { - //Determines when x coordinate is over "b" element axis - return ( x > reference ) && ( x < ( reference + size ) ); - }, - - isOver: function( y, x, top, left, height, width ) { - //Determines when x, y coordinates is over "b" element - return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); - }, - - keyCode: { - ALT: 18, - BACKSPACE: 8, - CAPS_LOCK: 20, - COMMA: 188, - COMMAND: 91, - COMMAND_LEFT: 91, // COMMAND - COMMAND_RIGHT: 93, - CONTROL: 17, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - INSERT: 45, - LEFT: 37, - MENU: 93, // COMMAND_RIGHT - NUMPAD_ADD: 107, - NUMPAD_DECIMAL: 110, - NUMPAD_DIVIDE: 111, - NUMPAD_ENTER: 108, - NUMPAD_MULTIPLY: 106, - NUMPAD_SUBTRACT: 109, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SHIFT: 16, - SPACE: 32, - TAB: 9, - UP: 38, - WINDOWS: 91 // COMMAND - } -}); - -//jQuery plugins -$.fn.extend({ - _focus: $.fn.focus, - focus: function( delay, fn ) { - return typeof delay === "number" ? - this.each(function() { - var elem = this; - setTimeout(function() { - $( elem ).focus(); - if ( fn ) { - fn.call( elem ); - } - }, delay ); - }) : - this._focus.apply( this, arguments ); - }, - - enableSelection: function() { - return this - .attr( "unselectable", "off" ) - .css( "MozUserSelect", "" ); - }, - - disableSelection: function() { - return this - .attr( "unselectable", "on" ) - .css( "MozUserSelect", "none" ); - }, - - scrollParent: function() { - var scrollParent; - if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { - scrollParent = this.parents().filter(function() { - return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } else { - scrollParent = this.parents().filter(function() { - return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } - - return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; - }, - - zIndex: function( zIndex ) { - if ( zIndex !== undefined ) { - return this.css( "zIndex", zIndex ); - } - - if ( this.length ) { - var elem = $( this[ 0 ] ), position, value; - while ( elem.length && elem[ 0 ] !== document ) { - // Ignore z-index if position is set to a value where z-index is ignored by the browser - // This makes behavior of this function consistent across browsers - // WebKit always returns auto if the element is positioned - position = elem.css( "position" ); - if ( position === "absolute" || position === "relative" || position === "fixed" ) { - // IE returns 0 when zIndex is not specified - // other browsers return a string - // we ignore the case of nested elements with an explicit value of 0 - //
    - value = parseInt( elem.css( "zIndex" ) ); - if ( !isNaN( value ) && value != 0 ) { - return value; - } - } - elem = elem.parent(); - } - } - - return 0; - } -}); - -$.each( [ "Width", "Height" ], function( i, name ) { - var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], - type = name.toLowerCase(), - orig = { - innerWidth: $.fn.innerWidth, - innerHeight: $.fn.innerHeight, - outerWidth: $.fn.outerWidth, - outerHeight: $.fn.outerHeight - }; - - function reduce( elem, size, border, margin ) { - $.each( side, function() { - size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; - if ( border ) { - size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; - } - if ( margin ) { - size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; - } - }); - return size; - } - - $.fn[ "inner" + name ] = function( size ) { - if ( size === undefined ) { - return orig[ "inner" + name ].call( this ); - } - - return this.each(function() { - $.style( this, type, reduce( this, size ) + "px" ); - }); - }; - - $.fn[ "outer" + name] = function( size, margin ) { - if ( typeof size !== "number" ) { - return orig[ "outer" + name ].call( this, size ); - } - - return this.each(function() { - $.style( this, type, reduce( this, size, true, margin ) + "px" ); - }); - }; -}); - -//Additional selectors -function visible( element ) { - return !$( element ).parents().andSelf().filter(function() { - return $.curCSS( this, "visibility" ) === "hidden" || - $.expr.filters.hidden( this ); - }).length; -} - -$.extend( $.expr[ ":" ], { - data: function( elem, i, match ) { - return !!$.data( elem, match[ 3 ] ); - }, - - focusable: function( element ) { - var nodeName = element.nodeName.toLowerCase(), - tabIndex = $.attr( element, "tabindex" ); - if ( "area" === nodeName ) { - var map = element.parentNode, - mapName = map.name, - img; - if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { - return false; - } - img = $( "img[usemap=#" + mapName + "]" )[0]; - return !!img && visible( img ); - } - return ( /input|select|textarea|button|object/.test( nodeName ) - ? !element.disabled - : "a" == nodeName - ? element.href || !isNaN( tabIndex ) - : !isNaN( tabIndex )) - // the element and all of its ancestors must be visible - && visible( element ); - }, - - tabbable: function( element ) { - var tabIndex = $.attr( element, "tabindex" ); - return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" ); - } -}); + // prevent duplicate loading + // this is only a problem because we proxy existing functions + // and we don't want to double proxy them + $.ui = $.ui || {}; + if ( $.ui.version ) { + return; + } + + //Helper functions and ui object + $.extend( $.ui, { + version: "1.8.4", + + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var proto = $.ui[ module ].prototype; + for ( var i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode ) { + return; + } + + for ( var i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + contains: function( a, b ) { + return document.compareDocumentPosition ? + a.compareDocumentPosition( b ) & 16 : + a !== b && a.contains( b ); + }, + + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + }, + + keyCode: { + ALT: 18, + BACKSPACE: 8, + CAPS_LOCK: 20, + COMMA: 188, + COMMAND: 91, + COMMAND_LEFT: 91, // COMMAND + COMMAND_RIGHT: 93, + CONTROL: 17, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + INSERT: 45, + LEFT: 37, + MENU: 93, // COMMAND_RIGHT + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SHIFT: 16, + SPACE: 32, + TAB: 9, + UP: 38, + WINDOWS: 91 // COMMAND + } + }); + + //jQuery plugins + $.fn.extend({ + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + enableSelection: function() { + return this + .attr( "unselectable", "off" ) + .css( "MozUserSelect", "" ); + }, + + disableSelection: function() { + return this + .attr( "unselectable", "on" ) + .css( "MozUserSelect", "none" ); + }, + + scrollParent: function() { + var scrollParent; + if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
    + value = parseInt( elem.css( "zIndex" ) ); + if ( !isNaN( value ) && value != 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + } + }); + + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; + if ( border ) { + size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $.style( this, type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $.style( this, type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); + + //Additional selectors + function visible( element ) { + return !$( element ).parents().andSelf().filter(function() { + return $.curCSS( this, "visibility" ) === "hidden" || + $.expr.filters.hidden( this ); + }).length; + } + + $.extend( $.expr[ ":" ], { + data: function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + var nodeName = element.nodeName.toLowerCase(), + tabIndex = $.attr( element, "tabindex" ); + if ( "area" === nodeName ) { + var map = element.parentNode, + mapName = map.name, + img; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) + ? !element.disabled + : "a" == nodeName + ? element.href || !isNaN( tabIndex ) + : !isNaN( tabIndex )) + // the element and all of its ancestors must be visible + && visible( element ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ); + return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" ); + } + }); })( jQuery ); diff --git a/form_elements/js/jquery.ui.datepicker.js b/form_elements/js/jquery.ui.datepicker.js index 8937b0f3..38d760d6 100644 --- a/form_elements/js/jquery.ui.datepicker.js +++ b/form_elements/js/jquery.ui.datepicker.js @@ -12,269 +12,287 @@ */ (function( $, undefined ) { -$.extend($.ui, { datepicker: { version: "1.8.4" } }); + $.extend($.ui, { + datepicker: { + version: "1.8.4" + } + }); var PROP_NAME = 'datepicker'; var dpuuid = new Date().getTime(); -/* Date picker manager. + /* Date picker manager. Use the singleton instance of this class, $.datepicker, to interact with the date picker. Settings for (groups of) date pickers are maintained in an instance object, allowing multiple different settings on the same page. */ -function Datepicker() { - this.debug = false; // Change this to true to start debugging - this._curInst = null; // The current instance in use - this._keyEvent = false; // If the last event was a key event - this._disabledInputs = []; // List of date picker inputs that have been disabled - this._datepickerShowing = false; // True if the popup picker is showing , false if not - this._inDialog = false; // True if showing within a "dialog", false if not - this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division - this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class - this._appendClass = 'ui-datepicker-append'; // The name of the append marker class - this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class - this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class - this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class - this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class - this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class - this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class - this.regional = []; // Available regional settings, indexed by language code - this.regional[''] = { // Default regional settings - closeText: 'Done', // Display text for close link - prevText: 'Prev', // Display text for previous month link - nextText: 'Next', // Display text for next month link - currentText: 'Today', // Display text for current month link - monthNames: ['January','February','March','April','May','June', - 'July','August','September','October','November','December'], // Names of months for drop-down and formatting - monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting - dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting - dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting - dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday - weekHeader: 'Wk', // Column header for week of the year - dateFormat: 'mm/dd/yy', // See format options on parseDate - firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... - isRTL: false, // True if right-to-left language, false if left-to-right - showMonthAfterYear: false, // True if the year select precedes month, false for month then year - yearSuffix: '' // Additional text to append to the year in the month headers - }; - this._defaults = { // Global defaults for all the date picker instances - showOn: 'focus', // 'focus' for popup on focus, - // 'button' for trigger button, or 'both' for either - showAnim: 'fadeIn', // Name of jQuery animation for popup - showOptions: {}, // Options for enhanced animations - defaultDate: null, // Used when field is blank: actual date, - // +/-number for offset from today, null for today - appendText: '', // Display text following the input box, e.g. showing the format - buttonText: '...', // Text for trigger button - buttonImage: '', // URL for trigger button image - buttonImageOnly: false, // True if the image appears alone, false if it appears on a button - hideIfNoPrevNext: false, // True to hide next/previous month links - // if not applicable, false to just disable them - navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links - gotoCurrent: false, // True if today link goes back to current selection instead - changeMonth: false, // True if month can be selected directly, false if only prev/next - changeYear: false, // True if year can be selected directly, false if only prev/next - yearRange: 'c-10:c+10', // Range of years to display in drop-down, - // either relative to today's year (-nn:+nn), relative to currently displayed year - // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) - showOtherMonths: false, // True to show dates in other months, false to leave blank - selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable - showWeek: false, // True to show week of the year, false to not show it - calculateWeek: this.iso8601Week, // How to calculate the week of the year, - // takes a Date and returns the number of the week for it - shortYearCutoff: '+10', // Short year values < this are in the current century, - // > this are in the previous century, - // string value starting with '+' for current year + value - minDate: null, // The earliest selectable date, or null for no limit - maxDate: null, // The latest selectable date, or null for no limit - duration: 'fast', // Duration of display/closure - beforeShowDay: null, // Function that takes a date and returns an array with - // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', - // [2] = cell title (optional), e.g. $.datepicker.noWeekends - beforeShow: null, // Function that takes an input field and - // returns a set of custom settings for the date picker - onSelect: null, // Define a callback function when a date is selected - onChangeMonthYear: null, // Define a callback function when the month or year is changed - onClose: null, // Define a callback function when the datepicker is closed - numberOfMonths: 1, // Number of months to show at a time - showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) - stepMonths: 1, // Number of months to step back/forward - stepBigMonths: 12, // Number of months to step back/forward for the big links - altField: '', // Selector for an alternate field to store selected dates into - altFormat: '', // The date format to use for the alternate field - constrainInput: true, // The input is constrained by the current date format - showButtonPanel: false, // True to show button panel, false to not show it - autoSize: false // True to size the input for the date format, false to leave as is - }; - $.extend(this._defaults, this.regional['']); - this.dpDiv = $('
    '); -} - -$.extend(Datepicker.prototype, { - /* Class name added to elements to indicate already configured with a date picker. */ - markerClassName: 'hasDatepicker', - - /* Debug logging (if enabled). */ - log: function () { - if (this.debug) - console.log.apply('', arguments); - }, + function Datepicker() { + this.debug = false; // Change this to true to start debugging + this._curInst = null; // The current instance in use + this._keyEvent = false; // If the last event was a key event + this._disabledInputs = []; // List of date picker inputs that have been disabled + this._datepickerShowing = false; // True if the popup picker is showing , false if not + this._inDialog = false; // True if showing within a "dialog", false if not + this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division + this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class + this._appendClass = 'ui-datepicker-append'; // The name of the append marker class + this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class + this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class + this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class + this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class + this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class + this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + closeText: 'Done', // Display text for close link + prevText: 'Prev', // Display text for previous month link + nextText: 'Next', // Display text for next month link + currentText: 'Today', // Display text for current month link + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], // Names of months for drop-down and formatting + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday + weekHeader: 'Wk', // Column header for week of the year + dateFormat: 'mm/dd/yy', // See format options on parseDate + firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... + isRTL: false, // True if right-to-left language, false if left-to-right + showMonthAfterYear: false, // True if the year select precedes month, false for month then year + yearSuffix: '' // Additional text to append to the year in the month headers + }; + this._defaults = { // Global defaults for all the date picker instances + showOn: 'focus', // 'focus' for popup on focus, + // 'button' for trigger button, or 'both' for either + showAnim: 'fadeIn', // Name of jQuery animation for popup + showOptions: {}, // Options for enhanced animations + defaultDate: null, // Used when field is blank: actual date, + // +/-number for offset from today, null for today + appendText: '', // Display text following the input box, e.g. showing the format + buttonText: '...', // Text for trigger button + buttonImage: '', // URL for trigger button image + buttonImageOnly: false, // True if the image appears alone, false if it appears on a button + hideIfNoPrevNext: false, // True to hide next/previous month links + // if not applicable, false to just disable them + navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links + gotoCurrent: false, // True if today link goes back to current selection instead + changeMonth: false, // True if month can be selected directly, false if only prev/next + changeYear: false, // True if year can be selected directly, false if only prev/next + yearRange: 'c-10:c+10', // Range of years to display in drop-down, + // either relative to today's year (-nn:+nn), relative to currently displayed year + // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) + showOtherMonths: false, // True to show dates in other months, false to leave blank + selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable + showWeek: false, // True to show week of the year, false to not show it + calculateWeek: this.iso8601Week, // How to calculate the week of the year, + // takes a Date and returns the number of the week for it + shortYearCutoff: '+10', // Short year values < this are in the current century, + // > this are in the previous century, + // string value starting with '+' for current year + value + minDate: null, // The earliest selectable date, or null for no limit + maxDate: null, // The latest selectable date, or null for no limit + duration: 'fast', // Duration of display/closure + beforeShowDay: null, // Function that takes a date and returns an array with + // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', + // [2] = cell title (optional), e.g. $.datepicker.noWeekends + beforeShow: null, // Function that takes an input field and + // returns a set of custom settings for the date picker + onSelect: null, // Define a callback function when a date is selected + onChangeMonthYear: null, // Define a callback function when the month or year is changed + onClose: null, // Define a callback function when the datepicker is closed + numberOfMonths: 1, // Number of months to show at a time + showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) + stepMonths: 1, // Number of months to step back/forward + stepBigMonths: 12, // Number of months to step back/forward for the big links + altField: '', // Selector for an alternate field to store selected dates into + altFormat: '', // The date format to use for the alternate field + constrainInput: true, // The input is constrained by the current date format + showButtonPanel: false, // True to show button panel, false to not show it + autoSize: false // True to size the input for the date format, false to leave as is + }; + $.extend(this._defaults, this.regional['']); + this.dpDiv = $('
    '); + } + + $.extend(Datepicker.prototype, { + /* Class name added to elements to indicate already configured with a date picker. */ + markerClassName: 'hasDatepicker', + + /* Debug logging (if enabled). */ + log: function () { + if (this.debug) + console.log.apply('', arguments); + }, - // TODO rename to "widget" when switching to widget factory - _widgetDatepicker: function() { - return this.dpDiv; - }, + // TODO rename to "widget" when switching to widget factory + _widgetDatepicker: function() { + return this.dpDiv; + }, - /* Override the default settings for all instances of the date picker. + /* Override the default settings for all instances of the date picker. @param settings object - the new settings to use as defaults (anonymous object) @return the manager object */ - setDefaults: function(settings) { - extendRemove(this._defaults, settings || {}); - return this; - }, + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, - /* Attach the date picker to a jQuery selection. + /* Attach the date picker to a jQuery selection. @param target element - the target input field or division or span @param settings object - the new settings to use for this date picker instance (anonymous) */ - _attachDatepicker: function(target, settings) { - // check for settings on the control itself - in namespace 'date:' - var inlineSettings = null; - for (var attrName in this._defaults) { - var attrValue = target.getAttribute('date:' + attrName); - if (attrValue) { - inlineSettings = inlineSettings || {}; - try { - inlineSettings[attrName] = eval(attrValue); - } catch (err) { - inlineSettings[attrName] = attrValue; - } - } - } - var nodeName = target.nodeName.toLowerCase(); - var inline = (nodeName == 'div' || nodeName == 'span'); - if (!target.id) { - this.uuid += 1; - target.id = 'dp' + this.uuid; - } - var inst = this._newInst($(target), inline); - inst.settings = $.extend({}, settings || {}, inlineSettings || {}); - if (nodeName == 'input') { - this._connectDatepicker(target, inst); - } else if (inline) { - this._inlineDatepicker(target, inst); - } - }, - - /* Create a new instance object. */ - _newInst: function(target, inline) { - var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\$1'); // escape jQuery meta chars - return {id: id, input: target, // associated target - selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection - drawMonth: 0, drawYear: 0, // month being drawn - inline: inline, // is datepicker inline or not - dpDiv: (!inline ? this.dpDiv : // presentation div - $('
    '))}; - }, - - /* Attach the date picker to an input field. */ - _connectDatepicker: function(target, inst) { - var input = $(target); - inst.append = $([]); - inst.trigger = $([]); - if (input.hasClass(this.markerClassName)) - return; - this._attachments(input, inst); - input.addClass(this.markerClassName).keydown(this._doKeyDown). - keypress(this._doKeyPress).keyup(this._doKeyUp). - bind("setData.datepicker", function(event, key, value) { - inst.settings[key] = value; - }).bind("getData.datepicker", function(event, key) { - return this._get(inst, key); - }); - this._autoSize(inst); - $.data(target, PROP_NAME, inst); - }, - - /* Make attachments based on settings. */ - _attachments: function(input, inst) { - var appendText = this._get(inst, 'appendText'); - var isRTL = this._get(inst, 'isRTL'); - if (inst.append) - inst.append.remove(); - if (appendText) { - inst.append = $('' + appendText + ''); - input[isRTL ? 'before' : 'after'](inst.append); - } - input.unbind('focus', this._showDatepicker); - if (inst.trigger) - inst.trigger.remove(); - var showOn = this._get(inst, 'showOn'); - if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field - input.focus(this._showDatepicker); - if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked - var buttonText = this._get(inst, 'buttonText'); - var buttonImage = this._get(inst, 'buttonImage'); - inst.trigger = $(this._get(inst, 'buttonImageOnly') ? - $('').addClass(this._triggerClass). - attr({ src: buttonImage, alt: buttonText, title: buttonText }) : - $('').addClass(this._triggerClass). - html(buttonImage == '' ? buttonText : $('').attr( - { src:buttonImage, alt:buttonText, title:buttonText }))); - input[isRTL ? 'before' : 'after'](inst.trigger); - inst.trigger.click(function() { - if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) - $.datepicker._hideDatepicker(); - else - $.datepicker._showDatepicker(input[0]); - return false; - }); - } - }, - - /* Apply the maximum length for the date format. */ - _autoSize: function(inst) { - if (this._get(inst, 'autoSize') && !inst.inline) { - var date = new Date(2009, 12 - 1, 20); // Ensure double digits - var dateFormat = this._get(inst, 'dateFormat'); - if (dateFormat.match(/[DM]/)) { - var findMax = function(names) { - var max = 0; - var maxI = 0; - for (var i = 0; i < names.length; i++) { - if (names[i].length > max) { - max = names[i].length; - maxI = i; - } - } - return maxI; - }; - date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? - 'monthNames' : 'monthNamesShort')))); - date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? - 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); - } - inst.input.attr('size', this._formatDate(inst, date).length); - } - }, - - /* Attach an inline date picker to a div. */ - _inlineDatepicker: function(target, inst) { - var divSpan = $(target); - if (divSpan.hasClass(this.markerClassName)) - return; - divSpan.addClass(this.markerClassName).append(inst.dpDiv). - bind("setData.datepicker", function(event, key, value){ - inst.settings[key] = value; - }).bind("getData.datepicker", function(event, key){ - return this._get(inst, key); - }); - $.data(target, PROP_NAME, inst); - this._setDate(inst, this._getDefaultDate(inst), true); - this._updateDatepicker(inst); - this._updateAlternate(inst); - }, - - /* Pop-up the date picker in a "dialog" box. + _attachDatepicker: function(target, settings) { + // check for settings on the control itself - in namespace 'date:' + var inlineSettings = null; + for (var attrName in this._defaults) { + var attrValue = target.getAttribute('date:' + attrName); + if (attrValue) { + inlineSettings = inlineSettings || {}; + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + var nodeName = target.nodeName.toLowerCase(); + var inline = (nodeName == 'div' || nodeName == 'span'); + if (!target.id) { + this.uuid += 1; + target.id = 'dp' + this.uuid; + } + var inst = this._newInst($(target), inline); + inst.settings = $.extend({}, settings || {}, inlineSettings || {}); + if (nodeName == 'input') { + this._connectDatepicker(target, inst); + } else if (inline) { + this._inlineDatepicker(target, inst); + } + }, + + /* Create a new instance object. */ + _newInst: function(target, inline) { + var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\$1'); // escape jQuery meta chars + return { + id: id, + input: target, // associated target + selectedDay: 0, + selectedMonth: 0, + selectedYear: 0, // current selection + drawMonth: 0, + drawYear: 0, // month being drawn + inline: inline, // is datepicker inline or not + dpDiv: (!inline ? this.dpDiv : // presentation div + $('
    ')) + }; + }, + + /* Attach the date picker to an input field. */ + _connectDatepicker: function(target, inst) { + var input = $(target); + inst.append = $([]); + inst.trigger = $([]); + if (input.hasClass(this.markerClassName)) + return; + this._attachments(input, inst); + input.addClass(this.markerClassName).keydown(this._doKeyDown). + keypress(this._doKeyPress).keyup(this._doKeyUp). + bind("setData.datepicker", function(event, key, value) { + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key) { + return this._get(inst, key); + }); + this._autoSize(inst); + $.data(target, PROP_NAME, inst); + }, + + /* Make attachments based on settings. */ + _attachments: function(input, inst) { + var appendText = this._get(inst, 'appendText'); + var isRTL = this._get(inst, 'isRTL'); + if (inst.append) + inst.append.remove(); + if (appendText) { + inst.append = $('' + appendText + ''); + input[isRTL ? 'before' : 'after'](inst.append); + } + input.unbind('focus', this._showDatepicker); + if (inst.trigger) + inst.trigger.remove(); + var showOn = this._get(inst, 'showOn'); + if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field + input.focus(this._showDatepicker); + if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked + var buttonText = this._get(inst, 'buttonText'); + var buttonImage = this._get(inst, 'buttonImage'); + inst.trigger = $(this._get(inst, 'buttonImageOnly') ? + $('').addClass(this._triggerClass). + attr({ + src: buttonImage, + alt: buttonText, + title: buttonText + }) : + $('').addClass(this._triggerClass). + html(buttonImage == '' ? buttonText : $('').attr( + { + src:buttonImage, + alt:buttonText, + title:buttonText + }))); + input[isRTL ? 'before' : 'after'](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) + $.datepicker._hideDatepicker(); + else + $.datepicker._showDatepicker(input[0]); + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, 'autoSize') && !inst.inline) { + var date = new Date(2009, 12 - 1, 20); // Ensure double digits + var dateFormat = this._get(inst, 'dateFormat'); + if (dateFormat.match(/[DM]/)) { + var findMax = function(names) { + var max = 0; + var maxI = 0; + for (var i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + 'monthNames' : 'monthNamesShort')))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); + } + inst.input.attr('size', this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) + return; + divSpan.addClass(this.markerClassName).append(inst.dpDiv). + bind("setData.datepicker", function(event, key, value){ + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key){ + return this._get(inst, key); + }); + $.data(target, PROP_NAME, inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + }, + + /* Pop-up the date picker in a "dialog" box. @param input element - ignored @param date string or Date - the initial date to display @param onSelect function - the function to call when a date is selected @@ -283,142 +301,156 @@ $.extend(Datepicker.prototype, { event - with x/y coordinates or leave empty for default (screen centre) @return the manager object */ - _dialogDatepicker: function(input, date, onSelect, settings, pos) { - var inst = this._dialogInst; // internal instance - if (!inst) { - this.uuid += 1; - var id = 'dp' + this.uuid; - this._dialogInput = $(''); - this._dialogInput.keydown(this._doKeyDown); - $('body').append(this._dialogInput); - inst = this._dialogInst = this._newInst(this._dialogInput, false); - inst.settings = {}; - $.data(this._dialogInput[0], PROP_NAME, inst); - } - extendRemove(inst.settings, settings || {}); - date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); - this._dialogInput.val(date); - - this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); - if (!this._pos) { - var browserWidth = document.documentElement.clientWidth; - var browserHeight = document.documentElement.clientHeight; - var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; - var scrollY = document.documentElement.scrollTop || document.body.scrollTop; - this._pos = // should use actual width/height below - [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; - } - - // move input on screen for focus, but hidden behind dialog - this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); - inst.settings.onSelect = onSelect; - this._inDialog = true; - this.dpDiv.addClass(this._dialogClass); - this._showDatepicker(this._dialogInput[0]); - if ($.blockUI) - $.blockUI(this.dpDiv); - $.data(this._dialogInput[0], PROP_NAME, inst); - return this; - }, - - /* Detach a datepicker from its control. + _dialogDatepicker: function(input, date, onSelect, settings, pos) { + var inst = this._dialogInst; // internal instance + if (!inst) { + this.uuid += 1; + var id = 'dp' + this.uuid; + this._dialogInput = $(''); + this._dialogInput.keydown(this._doKeyDown); + $('body').append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], PROP_NAME, inst); + } + extendRemove(inst.settings, settings || {}); + date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + var browserWidth = document.documentElement.clientWidth; + var browserHeight = document.documentElement.clientHeight; + var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) + $.blockUI(this.dpDiv); + $.data(this._dialogInput[0], PROP_NAME, inst); + return this; + }, + + /* Detach a datepicker from its control. @param target element - the target input field or division or span */ - _destroyDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - $.removeData(target, PROP_NAME); - if (nodeName == 'input') { - inst.append.remove(); - inst.trigger.remove(); - $target.removeClass(this.markerClassName). - unbind('focus', this._showDatepicker). - unbind('keydown', this._doKeyDown). - unbind('keypress', this._doKeyPress). - unbind('keyup', this._doKeyUp); - } else if (nodeName == 'div' || nodeName == 'span') - $target.removeClass(this.markerClassName).empty(); - }, - - /* Enable the date picker to a jQuery selection. + _destroyDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + $.removeData(target, PROP_NAME); + if (nodeName == 'input') { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind('focus', this._showDatepicker). + unbind('keydown', this._doKeyDown). + unbind('keypress', this._doKeyPress). + unbind('keyup', this._doKeyUp); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + }, + + /* Enable the date picker to a jQuery selection. @param target element - the target input field or division or span */ - _enableDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - if (nodeName == 'input') { - target.disabled = false; - inst.trigger.filter('button'). - each(function() { this.disabled = false; }).end(). - filter('img').css({opacity: '1.0', cursor: ''}); - } - else if (nodeName == 'div' || nodeName == 'span') { - var inline = $target.children('.' + this._inlineClass); - inline.children().removeClass('ui-state-disabled'); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - }, - - /* Disable the date picker to a jQuery selection. + _enableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = false; + inst.trigger.filter('button'). + each(function() { + this.disabled = false; + }).end(). + filter('img').css({ + opacity: '1.0', + cursor: '' + }); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().removeClass('ui-state-disabled'); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { + return (value == target ? null : value); + }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. @param target element - the target input field or division or span */ - _disableDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - if (nodeName == 'input') { - target.disabled = true; - inst.trigger.filter('button'). - each(function() { this.disabled = true; }).end(). - filter('img').css({opacity: '0.5', cursor: 'default'}); - } - else if (nodeName == 'div' || nodeName == 'span') { - var inline = $target.children('.' + this._inlineClass); - inline.children().addClass('ui-state-disabled'); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - this._disabledInputs[this._disabledInputs.length] = target; - }, - - /* Is the first field in a jQuery collection disabled as a datepicker? + _disableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = true; + inst.trigger.filter('button'). + each(function() { + this.disabled = true; + }).end(). + filter('img').css({ + opacity: '0.5', + cursor: 'default' + }); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().addClass('ui-state-disabled'); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { + return (value == target ? null : value); + }); // delete entry + this._disabledInputs[this._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? @param target element - the target input field or division or span @return boolean - true if disabled, false if enabled */ - _isDisabledDatepicker: function(target) { - if (!target) { - return false; - } - for (var i = 0; i < this._disabledInputs.length; i++) { - if (this._disabledInputs[i] == target) - return true; - } - return false; - }, - - /* Retrieve the instance data for the target control. + _isDisabledDatepicker: function(target) { + if (!target) { + return false; + } + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] == target) + return true; + } + return false; + }, + + /* Retrieve the instance data for the target control. @param target element - the target input field or division or span @return object - the associated instance data @throws error if a jQuery problem getting data */ - _getInst: function(target) { - try { - return $.data(target, PROP_NAME); - } - catch (err) { - throw 'Missing instance data for this datepicker'; - } - }, - - /* Update or retrieve the settings for a date picker attached to an input field or division. + _getInst: function(target) { + try { + return $.data(target, PROP_NAME); + } + catch (err) { + throw 'Missing instance data for this datepicker'; + } + }, + + /* Update or retrieve the settings for a date picker attached to an input field or division. @param target element - the target input field or division or span @param name object - the new settings to update or string - the name of the setting to change or retrieve, @@ -426,512 +458,554 @@ $.extend(Datepicker.prototype, { 'defaults' for all global defaults @param value any - the new value for the setting (omit if above is an object or to retrieve a value) */ - _optionDatepicker: function(target, name, value) { - var inst = this._getInst(target); - if (arguments.length == 2 && typeof name == 'string') { - return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : - (inst ? (name == 'all' ? $.extend({}, inst.settings) : - this._get(inst, name)) : null)); - } - var settings = name || {}; - if (typeof name == 'string') { - settings = {}; - settings[name] = value; - } - if (inst) { - if (this._curInst == inst) { - this._hideDatepicker(); - } - var date = this._getDateDatepicker(target, true); - extendRemove(inst.settings, settings); - this._attachments($(target), inst); - this._autoSize(inst); - this._setDateDatepicker(target, date); - this._updateDatepicker(inst); - } - }, - - // change method deprecated - _changeDatepicker: function(target, name, value) { - this._optionDatepicker(target, name, value); - }, - - /* Redraw the date picker attached to an input field or division. + _optionDatepicker: function(target, name, value) { + var inst = this._getInst(target); + if (arguments.length == 2 && typeof name == 'string') { + return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : + (inst ? (name == 'all' ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst) { + if (this._curInst == inst) { + this._hideDatepicker(); + } + var date = this._getDateDatepicker(target, true); + extendRemove(inst.settings, settings); + this._attachments($(target), inst); + this._autoSize(inst); + this._setDateDatepicker(target, date); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. @param target element - the target input field or division or span */ - _refreshDatepicker: function(target) { - var inst = this._getInst(target); - if (inst) { - this._updateDatepicker(inst); - } - }, - - /* Set the dates for a jQuery selection. + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. @param target element - the target input field or division or span @param date Date - the new date */ - _setDateDatepicker: function(target, date) { - var inst = this._getInst(target); - if (inst) { - this._setDate(inst, date); - this._updateDatepicker(inst); - this._updateAlternate(inst); - } - }, - - /* Get the date(s) for the first entry in a jQuery selection. + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. @param target element - the target input field or division or span @param noDefault boolean - true if no default date is to be used @return Date - the current date */ - _getDateDatepicker: function(target, noDefault) { - var inst = this._getInst(target); - if (inst && !inst.inline) - this._setDateFromField(inst, noDefault); - return (inst ? this._getDate(inst) : null); - }, - - /* Handle keystrokes. */ - _doKeyDown: function(event) { - var inst = $.datepicker._getInst(event.target); - var handled = true; - var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); - inst._keyEvent = true; - if ($.datepicker._datepickerShowing) - switch (event.keyCode) { - case 9: $.datepicker._hideDatepicker(); - handled = false; - break; // hide on tab out - case 13: var sel = $('td.' + $.datepicker._dayOverClass, inst.dpDiv). - add($('td.' + $.datepicker._currentClass, inst.dpDiv)); - if (sel[0]) - $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); - else - $.datepicker._hideDatepicker(); - return false; // don't submit the form - break; // select the value on enter - case 27: $.datepicker._hideDatepicker(); - break; // hide on escape - case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, 'stepBigMonths') : - -$.datepicker._get(inst, 'stepMonths')), 'M'); - break; // previous month/year on page up/+ ctrl - case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, 'stepBigMonths') : - +$.datepicker._get(inst, 'stepMonths')), 'M'); - break; // next month/year on page down/+ ctrl - case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); - handled = event.ctrlKey || event.metaKey; - break; // clear on ctrl or command +end - case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); - handled = event.ctrlKey || event.metaKey; - break; // current on ctrl or command +home - case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); - handled = event.ctrlKey || event.metaKey; - // -1 day on ctrl or command +left - if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, 'stepBigMonths') : - -$.datepicker._get(inst, 'stepMonths')), 'M'); - // next month/year on alt +left on Mac - break; - case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); - handled = event.ctrlKey || event.metaKey; - break; // -1 week on ctrl or command +up - case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); - handled = event.ctrlKey || event.metaKey; - // +1 day on ctrl or command +right - if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, 'stepBigMonths') : - +$.datepicker._get(inst, 'stepMonths')), 'M'); - // next month/year on alt +right - break; - case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); - handled = event.ctrlKey || event.metaKey; - break; // +1 week on ctrl or command +down - default: handled = false; - } - else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home - $.datepicker._showDatepicker(this); - else { - handled = false; - } - if (handled) { - event.preventDefault(); - event.stopPropagation(); - } - }, - - /* Filter entered characters - based on date format. */ - _doKeyPress: function(event) { - var inst = $.datepicker._getInst(event.target); - if ($.datepicker._get(inst, 'constrainInput')) { - var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); - var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); - return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); - } - }, - - /* Synchronise manual entry and field/alternate field. */ - _doKeyUp: function(event) { - var inst = $.datepicker._getInst(event.target); - if (inst.input.val() != inst.lastVal) { - try { - var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), - (inst.input ? inst.input.val() : null), - $.datepicker._getFormatConfig(inst)); - if (date) { // only if valid - $.datepicker._setDateFromField(inst); - $.datepicker._updateAlternate(inst); - $.datepicker._updateDatepicker(inst); - } - } - catch (event) { - $.datepicker.log(event); - } - } - return true; - }, - - /* Pop-up the date picker for a given input field. + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) + this._setDateFromField(inst, noDefault); + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var inst = $.datepicker._getInst(event.target); + var handled = true; + var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) + switch (event.keyCode) { + case 9: + $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: + var sel = $('td.' + $.datepicker._dayOverClass, inst.dpDiv). + add($('td.' + $.datepicker._currentClass, inst.dpDiv)); + if (sel[0]) + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + else + $.datepicker._hideDatepicker(); + return false; // don't submit the form + break; // select the value on enter + case 27: + $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: + $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // previous month/year on page up/+ ctrl + case 34: + $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // next month/year on page down/+ ctrl + case 35: + if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: + if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: + if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +left on Mac + break; + case 38: + if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: + if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +right + break; + case 40: + if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: + handled = false; + } + else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + else { + handled = false; + } + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var inst = $.datepicker._getInst(event.target); + if ($.datepicker._get(inst, 'constrainInput')) { + var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); + var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); + return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var inst = $.datepicker._getInst(event.target); + if (inst.input.val() != inst.lastVal) { + try { + var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (event) { + $.datepicker.log(event); + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. @param input element - the input field attached to the date picker or event - if triggered by focus */ - _showDatepicker: function(input) { - input = input.target || input; - if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger - input = $('input', input.parentNode)[0]; - if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here - return; - var inst = $.datepicker._getInst(input); - if ($.datepicker._curInst && $.datepicker._curInst != inst) { - $.datepicker._curInst.dpDiv.stop(true, true); - } - var beforeShow = $.datepicker._get(inst, 'beforeShow'); - extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); - inst.lastVal = null; - $.datepicker._lastInput = input; - $.datepicker._setDateFromField(inst); - if ($.datepicker._inDialog) // hide cursor - input.value = ''; - if (!$.datepicker._pos) { // position below input - $.datepicker._pos = $.datepicker._findPos(input); - $.datepicker._pos[1] += input.offsetHeight; // add the height - } - var isFixed = false; - $(input).parents().each(function() { - isFixed |= $(this).css('position') == 'fixed'; - return !isFixed; - }); - if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled - $.datepicker._pos[0] -= document.documentElement.scrollLeft; - $.datepicker._pos[1] -= document.documentElement.scrollTop; - } - var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; - $.datepicker._pos = null; - // determine sizing offscreen - inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); - $.datepicker._updateDatepicker(inst); - // fix width for dynamic number of date pickers - // and adjust position before showing - offset = $.datepicker._checkOffset(inst, offset, isFixed); - inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? - 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', - left: offset.left + 'px', top: offset.top + 'px'}); - if (!inst.inline) { - var showAnim = $.datepicker._get(inst, 'showAnim'); - var duration = $.datepicker._get(inst, 'duration'); - var postProcess = function() { - $.datepicker._datepickerShowing = true; - var borders = $.datepicker._getBorders(inst.dpDiv); - inst.dpDiv.find('iframe.ui-datepicker-cover'). // IE6- only - css({left: -borders[0], top: -borders[1], - width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); - }; - inst.dpDiv.zIndex($(input).zIndex()+1); - if ($.effects && $.effects[showAnim]) - inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); - else - inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); - if (!showAnim || !duration) - postProcess(); - if (inst.input.is(':visible') && !inst.input.is(':disabled')) - inst.input.focus(); - $.datepicker._curInst = inst; - } - }, - - /* Generate the date picker content. */ - _updateDatepicker: function(inst) { - var self = this; - var borders = $.datepicker._getBorders(inst.dpDiv); - inst.dpDiv.empty().append(this._generateHTML(inst)) - .find('iframe.ui-datepicker-cover') // IE6- only - .css({left: -borders[0], top: -borders[1], - width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) - .end() - .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') - .bind('mouseout', function(){ - $(this).removeClass('ui-state-hover'); - if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); - if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); - }) - .bind('mouseover', function(){ - if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) { - $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); - $(this).addClass('ui-state-hover'); - if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); - if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); - } - }) - .end() - .find('.' + this._dayOverClass + ' a') - .trigger('mouseover') - .end(); - var numMonths = this._getNumberOfMonths(inst); - var cols = numMonths[1]; - var width = 17; - if (cols > 1) - inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); - else - inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); - inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + - 'Class']('ui-datepicker-multi'); - inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + - 'Class']('ui-datepicker-rtl'); - if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && - inst.input.is(':visible') && !inst.input.is(':disabled')) - inst.input.focus(); - }, - - /* Retrieve the size of left and top borders for an element. + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger + input = $('input', input.parentNode)[0]; + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here + return; + var inst = $.datepicker._getInst(input); + if ($.datepicker._curInst && $.datepicker._curInst != inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + } + var beforeShow = $.datepicker._get(inst, 'beforeShow'); + extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + if ($.datepicker._inDialog) // hide cursor + input.value = ''; + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + var isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css('position') == 'fixed'; + return !isFixed; + }); + if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled + $.datepicker._pos[0] -= document.documentElement.scrollLeft; + $.datepicker._pos[1] -= document.documentElement.scrollTop; + } + var offset = { + left: $.datepicker._pos[0], + top: $.datepicker._pos[1] + }; + $.datepicker._pos = null; + // determine sizing offscreen + inst.dpDiv.css({ + position: 'absolute', + display: 'block', + top: '-1000px' + }); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({ + position: ($.datepicker._inDialog && $.blockUI ? + 'static' : (isFixed ? 'fixed' : 'absolute')), + display: 'none', + left: offset.left + 'px', + top: offset.top + 'px' + }); + if (!inst.inline) { + var showAnim = $.datepicker._get(inst, 'showAnim'); + var duration = $.datepicker._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._datepickerShowing = true; + var borders = $.datepicker._getBorders(inst.dpDiv); + inst.dpDiv.find('iframe.ui-datepicker-cover'). // IE6- only + css({ + left: -borders[0], + top: -borders[1], + width: inst.dpDiv.outerWidth(), + height: inst.dpDiv.outerHeight() + }); + }; + inst.dpDiv.zIndex($(input).zIndex()+1); + if ($.effects && $.effects[showAnim]) + inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); + if (!showAnim || !duration) + postProcess(); + if (inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + var self = this; + var borders = $.datepicker._getBorders(inst.dpDiv); + inst.dpDiv.empty().append(this._generateHTML(inst)) + .find('iframe.ui-datepicker-cover') // IE6- only + .css({ + left: -borders[0], + top: -borders[1], + width: inst.dpDiv.outerWidth(), + height: inst.dpDiv.outerHeight() + }) + .end() + .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') + .bind('mouseout', function(){ + $(this).removeClass('ui-state-hover'); + if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); + if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); + }) + .bind('mouseover', function(){ + if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) { + $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + $(this).addClass('ui-state-hover'); + if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); + if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); + } + }) + .end() + .find('.' + this._dayOverClass + ' a') + .trigger('mouseover') + .end(); + var numMonths = this._getNumberOfMonths(inst); + var cols = numMonths[1]; + var width = 17; + if (cols > 1) + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); + else + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); + inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + + 'Class']('ui-datepicker-multi'); + inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + + 'Class']('ui-datepicker-rtl'); + if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && + inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + }, + + /* Retrieve the size of left and top borders for an element. @param elem (jQuery object) the element of interest @return (number[2]) the left and top borders */ - _getBorders: function(elem) { - var convert = function(value) { - return {thin: 1, medium: 2, thick: 3}[value] || value; - }; - return [parseFloat(convert(elem.css('border-left-width'))), - parseFloat(convert(elem.css('border-top-width')))]; - }, - - /* Check positioning to remain on screen. */ - _checkOffset: function(inst, offset, isFixed) { - var dpWidth = inst.dpDiv.outerWidth(); - var dpHeight = inst.dpDiv.outerHeight(); - var inputWidth = inst.input ? inst.input.outerWidth() : 0; - var inputHeight = inst.input ? inst.input.outerHeight() : 0; - var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); - var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); - - offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); - offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; - offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; - - // now check if datepicker is showing outside window viewport - move to a better place if so. - offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? - Math.abs(offset.left + dpWidth - viewWidth) : 0); - offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? - Math.abs(dpHeight + inputHeight) : 0); - - return offset; - }, - - /* Find an object's position on the screen. */ - _findPos: function(obj) { - var inst = this._getInst(obj); - var isRTL = this._get(inst, 'isRTL'); - while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { - obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; - } - var position = $(obj).offset(); - return [position.left, position.top]; - }, - - /* Hide the date picker from view. + _getBorders: function(elem) { + var convert = function(value) { + return { + thin: 1, + medium: 2, + thick: 3 + } + [value] || value; + }; + return [parseFloat(convert(elem.css('border-left-width'))), + parseFloat(convert(elem.css('border-top-width')))]; + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(); + var dpHeight = inst.dpDiv.outerHeight(); + var inputWidth = inst.input ? inst.input.outerWidth() : 0; + var inputHeight = inst.input ? inst.input.outerHeight() : 0; + var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); + var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); + + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var inst = this._getInst(obj); + var isRTL = this._get(inst, 'isRTL'); + while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { + obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; + } + var position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. @param input element - the input field attached to the date picker */ - _hideDatepicker: function(input) { - var inst = this._curInst; - if (!inst || (input && inst != $.data(input, PROP_NAME))) - return; - if (this._datepickerShowing) { - var showAnim = this._get(inst, 'showAnim'); - var duration = this._get(inst, 'duration'); - var postProcess = function() { - $.datepicker._tidyDialog(inst); - this._curInst = null; - }; - if ($.effects && $.effects[showAnim]) - inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); - else - inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : - (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); - if (!showAnim) - postProcess(); - var onClose = this._get(inst, 'onClose'); - if (onClose) - onClose.apply((inst.input ? inst.input[0] : null), - [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback - this._datepickerShowing = false; - this._lastInput = null; - if (this._inDialog) { - this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); - if ($.blockUI) { - $.unblockUI(); - $('body').append(this.dpDiv); - } - } - this._inDialog = false; - } - }, - - /* Tidy up after a dialog display. */ - _tidyDialog: function(inst) { - inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); - }, - - /* Close date picker if clicked elsewhere. */ - _checkExternalClick: function(event) { - if (!$.datepicker._curInst) - return; - var $target = $(event.target); - if ($target[0].id != $.datepicker._mainDivId && - $target.parents('#' + $.datepicker._mainDivId).length == 0 && - !$target.hasClass($.datepicker.markerClassName) && - !$target.hasClass($.datepicker._triggerClass) && - $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) - $.datepicker._hideDatepicker(); - }, - - /* Adjust one of the date sub-fields. */ - _adjustDate: function(id, offset, period) { - var target = $(id); - var inst = this._getInst(target[0]); - if (this._isDisabledDatepicker(target[0])) { - return; - } - this._adjustInstDate(inst, offset + - (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning - period); - this._updateDatepicker(inst); - }, - - /* Action for current link. */ - _gotoToday: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - if (this._get(inst, 'gotoCurrent') && inst.currentDay) { - inst.selectedDay = inst.currentDay; - inst.drawMonth = inst.selectedMonth = inst.currentMonth; - inst.drawYear = inst.selectedYear = inst.currentYear; - } - else { - var date = new Date(); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - } - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Action for selecting a new month/year. */ - _selectMonthYear: function(id, select, period) { - var target = $(id); - var inst = this._getInst(target[0]); - inst._selectingMonthYear = false; - inst['selected' + (period == 'M' ? 'Month' : 'Year')] = - inst['draw' + (period == 'M' ? 'Month' : 'Year')] = - parseInt(select.options[select.selectedIndex].value,10); - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Restore input focus after not changing month/year. */ - _clickMonthYear: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - if (inst.input && inst._selectingMonthYear) { - setTimeout(function() { - inst.input.focus(); - }, 0); - } - inst._selectingMonthYear = !inst._selectingMonthYear; - }, - - /* Action for selecting a day. */ - _selectDay: function(id, month, year, td) { - var target = $(id); - if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { - return; - } - var inst = this._getInst(target[0]); - inst.selectedDay = inst.currentDay = $('a', td).html(); - inst.selectedMonth = inst.currentMonth = month; - inst.selectedYear = inst.currentYear = year; - this._selectDate(id, this._formatDate(inst, - inst.currentDay, inst.currentMonth, inst.currentYear)); - }, - - /* Erase the input field and hide the date picker. */ - _clearDate: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - this._selectDate(target, ''); - }, - - /* Update the input field with the selected date. */ - _selectDate: function(id, dateStr) { - var target = $(id); - var inst = this._getInst(target[0]); - dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); - if (inst.input) - inst.input.val(inst.input.val()+dateStr); - this._updateAlternate(inst); - var onSelect = this._get(inst, 'onSelect'); - if (onSelect) - onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback - else if (inst.input) - inst.input.trigger('change'); // fire the change event - if (inst.inline) - this._updateDatepicker(inst); - else { - this._hideDatepicker(); - this._lastInput = inst.input[0]; - if (typeof(inst.input[0]) != 'object') - inst.input.focus(); // restore focus - this._lastInput = null; - } - }, - - /* Update any alternate field to synchronise with the main field. */ - _updateAlternate: function(inst) { - var altField = this._get(inst, 'altField'); - if (altField) { // update alternate field too - var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); - var date = this._getDate(inst); - var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); - $(altField).each(function() { $(this).val(dateStr); }); - } - }, - - /* Set as beforeShowDay function to prevent selection of weekends. + _hideDatepicker: function(input) { + var inst = this._curInst; + if (!inst || (input && inst != $.data(input, PROP_NAME))) + return; + if (this._datepickerShowing) { + var showAnim = this._get(inst, 'showAnim'); + var duration = this._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._tidyDialog(inst); + this._curInst = null; + }; + if ($.effects && $.effects[showAnim]) + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); + if (!showAnim) + postProcess(); + var onClose = this._get(inst, 'onClose'); + if (onClose) + onClose.apply((inst.input ? inst.input[0] : null), + [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback + this._datepickerShowing = false; + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ + position: 'absolute', + left: '0', + top: '-100px' + }); + if ($.blockUI) { + $.unblockUI(); + $('body').append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) + return; + var $target = $(event.target); + if ($target[0].id != $.datepicker._mainDivId && + $target.parents('#' + $.datepicker._mainDivId).length == 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.hasClass($.datepicker._triggerClass) && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) + $.datepicker._hideDatepicker(); + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._get(inst, 'gotoCurrent') && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } + else { + var date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id); + var inst = this._getInst(target[0]); + inst._selectingMonthYear = false; + inst['selected' + (period == 'M' ? 'Month' : 'Year')] = + inst['draw' + (period == 'M' ? 'Month' : 'Year')] = + parseInt(select.options[select.selectedIndex].value,10); + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Restore input focus after not changing month/year. */ + _clickMonthYear: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (inst.input && inst._selectingMonthYear) { + setTimeout(function() { + inst.input.focus(); + }, 0); + } + inst._selectingMonthYear = !inst._selectingMonthYear; + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var target = $(id); + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + var inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $('a', td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + this._selectDate(target, ''); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var target = $(id); + var inst = this._getInst(target[0]); + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) + inst.input.val(inst.input.val()+dateStr); + this._updateAlternate(inst); + var onSelect = this._get(inst, 'onSelect'); + if (onSelect) + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback + else if (inst.input) + inst.input.trigger('change'); // fire the change event + if (inst.inline) + this._updateDatepicker(inst); + else { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) != 'object') + inst.input.focus(); // restore focus + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altField = this._get(inst, 'altField'); + if (altField) { // update alternate field too + var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); + var date = this._getDate(inst); + var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { + $(this).val(dateStr); + }); + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. @param date Date - the date to customise @return [boolean, string] - is this date selectable?, what is its CSS class? */ - noWeekends: function(date) { - var day = date.getDay(); - return [(day > 0 && day < 6), '']; - }, + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), '']; + }, - /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. @param date Date - the date to get the week for @return number - the number of the week within the year that contains this date */ - iso8601Week: function(date) { - var checkDate = new Date(date.getTime()); - // Find Thursday of this week starting on Monday - checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); - var time = checkDate.getTime(); - checkDate.setMonth(0); // Compare with Jan 1 - checkDate.setDate(1); - return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; - }, - - /* Parse a string value into a date object. + iso8601Week: function(date) { + var checkDate = new Date(date.getTime()); + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + var time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. See formatDate below for the possible formats. @param format string - the expected format of the date @@ -943,147 +1017,147 @@ $.extend(Datepicker.prototype, { monthNamesShort string[12] - abbreviated names of the months (optional) monthNames string[12] - names of the months (optional) @return Date - the extracted date value or null if value is blank */ - parseDate: function (format, value, settings) { - if (format == null || value == null) - throw 'Invalid arguments'; - value = (typeof value == 'object' ? value.toString() : value + ''); - if (value == '') - return null; - var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; - var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; - var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; - var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; - var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; - var year = -1; - var month = -1; - var day = -1; - var doy = -1; - var literal = false; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - // Extract a number from the string value - var getNumber = function(match) { - lookAhead(match); - var size = (match == '@' ? 14 : (match == '!' ? 20 : - (match == 'y' ? 4 : (match == 'o' ? 3 : 2)))); - var digits = new RegExp('^\\d{1,' + size + '}'); - var num = value.substring(iValue).match(digits); - if (!num) - throw 'Missing number at position ' + iValue; - iValue += num[0].length; - return parseInt(num[0], 10); - }; - // Extract a name from the string value and convert to an index - var getName = function(match, shortNames, longNames) { - var names = (lookAhead(match) ? longNames : shortNames); - for (var i = 0; i < names.length; i++) { - if (value.substr(iValue, names[i].length) == names[i]) { - iValue += names[i].length; - return i + 1; - } - } - throw 'Unknown name at position ' + iValue; - }; - // Confirm that a literal character matches the string value - var checkLiteral = function() { - if (value.charAt(iValue) != format.charAt(iFormat)) - throw 'Unexpected literal at position ' + iValue; - iValue++; - }; - var iValue = 0; - for (var iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - checkLiteral(); - else - switch (format.charAt(iFormat)) { - case 'd': - day = getNumber('d'); - break; - case 'D': - getName('D', dayNamesShort, dayNames); - break; - case 'o': - doy = getNumber('o'); - break; - case 'm': - month = getNumber('m'); - break; - case 'M': - month = getName('M', monthNamesShort, monthNames); - break; - case 'y': - year = getNumber('y'); - break; - case '@': - var date = new Date(getNumber('@')); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case '!': - var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case "'": - if (lookAhead("'")) - checkLiteral(); - else - literal = true; - break; - default: - checkLiteral(); - } - } - if (year == -1) - year = new Date().getFullYear(); - else if (year < 100) - year += new Date().getFullYear() - new Date().getFullYear() % 100 + - (year <= shortYearCutoff ? 0 : -100); - if (doy > -1) { - month = 1; - day = doy; - do { - var dim = this._getDaysInMonth(year, month - 1); - if (day <= dim) - break; - month++; - day -= dim; - } while (true); - } - var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); - if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) - throw 'Invalid date'; // E.g. 31/02/* - return date; - }, - - /* Standard date formats. */ - ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) - COOKIE: 'D, dd M yy', - ISO_8601: 'yy-mm-dd', - RFC_822: 'D, d M y', - RFC_850: 'DD, dd-M-y', - RFC_1036: 'D, d M y', - RFC_1123: 'D, d M yy', - RFC_2822: 'D, d M yy', - RSS: 'D, d M y', // RFC 822 - TICKS: '!', - TIMESTAMP: '@', - W3C: 'yy-mm-dd', // ISO 8601 - - _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + - Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), - - /* Format a date object into a string value. + parseDate: function (format, value, settings) { + if (format == null || value == null) + throw 'Invalid arguments'; + value = (typeof value == 'object' ? value.toString() : value + ''); + if (value == '') + return null; + var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + var year = -1; + var month = -1; + var day = -1; + var doy = -1; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Extract a number from the string value + var getNumber = function(match) { + lookAhead(match); + var size = (match == '@' ? 14 : (match == '!' ? 20 : + (match == 'y' ? 4 : (match == 'o' ? 3 : 2)))); + var digits = new RegExp('^\\d{1,' + size + '}'); + var num = value.substring(iValue).match(digits); + if (!num) + throw 'Missing number at position ' + iValue; + iValue += num[0].length; + return parseInt(num[0], 10); + }; + // Extract a name from the string value and convert to an index + var getName = function(match, shortNames, longNames) { + var names = (lookAhead(match) ? longNames : shortNames); + for (var i = 0; i < names.length; i++) { + if (value.substr(iValue, names[i].length) == names[i]) { + iValue += names[i].length; + return i + 1; + } + } + throw 'Unknown name at position ' + iValue; + }; + // Confirm that a literal character matches the string value + var checkLiteral = function() { + if (value.charAt(iValue) != format.charAt(iFormat)) + throw 'Unexpected literal at position ' + iValue; + iValue++; + }; + var iValue = 0; + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + checkLiteral(); + else + switch (format.charAt(iFormat)) { + case 'd': + day = getNumber('d'); + break; + case 'D': + getName('D', dayNamesShort, dayNames); + break; + case 'o': + doy = getNumber('o'); + break; + case 'm': + month = getNumber('m'); + break; + case 'M': + month = getName('M', monthNamesShort, monthNames); + break; + case 'y': + year = getNumber('y'); + break; + case '@': + var date = new Date(getNumber('@')); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case '!': + var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")) + checkLiteral(); + else + literal = true; + break; + default: + checkLiteral(); + } + } + if (year == -1) + year = new Date().getFullYear(); + else if (year < 100) + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + if (doy > -1) { + month = 1; + day = doy; + do { + var dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) + break; + month++; + day -= dim; + } while (true); + } + var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) + throw 'Invalid date'; // E.g. 31/02/* + return date; + }, + + /* Standard date formats. */ + ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) + COOKIE: 'D, dd M yy', + ISO_8601: 'yy-mm-dd', + RFC_822: 'D, d M y', + RFC_850: 'DD, dd-M-y', + RFC_1036: 'D, d M y', + RFC_1123: 'D, d M yy', + RFC_2822: 'D, d M yy', + RSS: 'D, d M y', // RFC 822 + TICKS: '!', + TIMESTAMP: '@', + W3C: 'yy-mm-dd', // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* Format a date object into a string value. The format can be combinations of the following: d - day of month (no leading zero) dd - day of month (two digit) @@ -1110,623 +1184,636 @@ $.extend(Datepicker.prototype, { monthNamesShort string[12] - abbreviated names of the months (optional) monthNames string[12] - names of the months (optional) @return string - the date in the above format */ - formatDate: function (format, date, settings) { - if (!date) - return ''; - var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; - var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; - var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; - var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - // Format a number, with leading zero if necessary - var formatNumber = function(match, value, len) { - var num = '' + value; - if (lookAhead(match)) - while (num.length < len) - num = '0' + num; - return num; - }; - // Format a name, short or long as requested - var formatName = function(match, value, shortNames, longNames) { - return (lookAhead(match) ? longNames[value] : shortNames[value]); - }; - var output = ''; - var literal = false; - if (date) - for (var iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - output += format.charAt(iFormat); - else - switch (format.charAt(iFormat)) { - case 'd': - output += formatNumber('d', date.getDate(), 2); - break; - case 'D': - output += formatName('D', date.getDay(), dayNamesShort, dayNames); - break; - case 'o': - output += formatNumber('o', - (date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3); - break; - case 'm': - output += formatNumber('m', date.getMonth() + 1, 2); - break; - case 'M': - output += formatName('M', date.getMonth(), monthNamesShort, monthNames); - break; - case 'y': - output += (lookAhead('y') ? date.getFullYear() : - (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); - break; - case '@': - output += date.getTime(); - break; - case '!': - output += date.getTime() * 10000 + this._ticksTo1970; - break; - case "'": - if (lookAhead("'")) - output += "'"; - else - literal = true; - break; - default: - output += format.charAt(iFormat); - } - } - return output; - }, - - /* Extract all possible characters from the date format. */ - _possibleChars: function (format) { - var chars = ''; - var literal = false; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - for (var iFormat = 0; iFormat < format.length; iFormat++) - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - chars += format.charAt(iFormat); - else - switch (format.charAt(iFormat)) { - case 'd': case 'm': case 'y': case '@': - chars += '0123456789'; - break; - case 'D': case 'M': - return null; // Accept anything - case "'": - if (lookAhead("'")) - chars += "'"; - else - literal = true; - break; - default: - chars += format.charAt(iFormat); - } - return chars; - }, - - /* Get a setting value, defaulting if necessary. */ - _get: function(inst, name) { - return inst.settings[name] !== undefined ? - inst.settings[name] : this._defaults[name]; - }, - - /* Parse existing date and initialise date picker. */ - _setDateFromField: function(inst, noDefault) { - if (inst.input.val() == inst.lastVal) { - return; - } - var dateFormat = this._get(inst, 'dateFormat'); - var dates = inst.lastVal = inst.input ? inst.input.val() : null; - var date, defaultDate; - date = defaultDate = this._getDefaultDate(inst); - var settings = this._getFormatConfig(inst); - try { - date = this.parseDate(dateFormat, dates, settings) || defaultDate; - } catch (event) { - this.log(event); - dates = (noDefault ? '' : dates); - } - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - inst.currentDay = (dates ? date.getDate() : 0); - inst.currentMonth = (dates ? date.getMonth() : 0); - inst.currentYear = (dates ? date.getFullYear() : 0); - this._adjustInstDate(inst); - }, - - /* Retrieve the default date shown on opening. */ - _getDefaultDate: function(inst) { - return this._restrictMinMax(inst, - this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); - }, - - /* A date may be specified as an exact value or a relative one. */ - _determineDate: function(inst, date, defaultDate) { - var offsetNumeric = function(offset) { - var date = new Date(); - date.setDate(date.getDate() + offset); - return date; - }; - var offsetString = function(offset) { - try { - return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), - offset, $.datepicker._getFormatConfig(inst)); - } - catch (e) { - // Ignore - } - var date = (offset.toLowerCase().match(/^c/) ? - $.datepicker._getDate(inst) : null) || new Date(); - var year = date.getFullYear(); - var month = date.getMonth(); - var day = date.getDate(); - var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; - var matches = pattern.exec(offset); - while (matches) { - switch (matches[2] || 'd') { - case 'd' : case 'D' : - day += parseInt(matches[1],10); break; - case 'w' : case 'W' : - day += parseInt(matches[1],10) * 7; break; - case 'm' : case 'M' : - month += parseInt(matches[1],10); - day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); - break; - case 'y': case 'Y' : - year += parseInt(matches[1],10); - day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); - break; - } - matches = pattern.exec(offset); - } - return new Date(year, month, day); - }; - date = (date == null ? defaultDate : (typeof date == 'string' ? offsetString(date) : - (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); - date = (date && date.toString() == 'Invalid Date' ? defaultDate : date); - if (date) { - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - date.setMilliseconds(0); - } - return this._daylightSavingAdjust(date); - }, - - /* Handle switch to/from daylight saving. + formatDate: function (format, date, settings) { + if (!date) + return ''; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Format a number, with leading zero if necessary + var formatNumber = function(match, value, len) { + var num = '' + value; + if (lookAhead(match)) + while (num.length < len) + num = '0' + num; + return num; + }; + // Format a name, short or long as requested + var formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }; + var output = ''; + var literal = false; + if (date) + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + output += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': + output += formatNumber('d', date.getDate(), 2); + break; + case 'D': + output += formatName('D', date.getDay(), dayNamesShort, dayNames); + break; + case 'o': + output += formatNumber('o', + (date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3); + break; + case 'm': + output += formatNumber('m', date.getMonth() + 1, 2); + break; + case 'M': + output += formatName('M', date.getMonth(), monthNamesShort, monthNames); + break; + case 'y': + output += (lookAhead('y') ? date.getFullYear() : + (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); + break; + case '@': + output += date.getTime(); + break; + case '!': + output += date.getTime() * 10000 + this._ticksTo1970; + break; + case "'": + if (lookAhead("'")) + output += "'"; + else + literal = true; + break; + default: + output += format.charAt(iFormat); + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var chars = ''; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + for (var iFormat = 0; iFormat < format.length; iFormat++) + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + chars += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': case 'm': case 'y': case '@': + chars += '0123456789'; + break; + case 'D': case 'M': + return null; // Accept anything + case "'": + if (lookAhead("'")) + chars += "'"; + else + literal = true; + break; + default: + chars += format.charAt(iFormat); + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() == inst.lastVal) { + return; + } + var dateFormat = this._get(inst, 'dateFormat'); + var dates = inst.lastVal = inst.input ? inst.input.val() : null; + var date, defaultDate; + date = defaultDate = this._getDefaultDate(inst); + var settings = this._getFormatConfig(inst); + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + this.log(event); + dates = (noDefault ? '' : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }; + var offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(); + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; + var matches = pattern.exec(offset); + while (matches) { + switch (matches[2] || 'd') { + case 'd' : case 'D' : + day += parseInt(matches[1],10); + break; + case 'w' : case 'W' : + day += parseInt(matches[1],10) * 7; + break; + case 'm' : case 'M' : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case 'y': case 'Y' : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }; + date = (date == null ? defaultDate : (typeof date == 'string' ? offsetString(date) : + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); + date = (date && date.toString() == 'Invalid Date' ? defaultDate : date); + if (date) { + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + date.setMilliseconds(0); + } + return this._daylightSavingAdjust(date); + }, + + /* Handle switch to/from daylight saving. Hours may be non-zero on daylight saving cut-over: > 12 when midnight changeover, but then cannot generate midnight datetime, so jump to 1AM, otherwise reset. @param date (Date) the date to check @return (Date) the corrected date */ - _daylightSavingAdjust: function(date) { - if (!date) return null; - date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); - return date; - }, - - /* Set the date(s) directly. */ - _setDate: function(inst, date, noChange) { - var clear = !(date); - var origMonth = inst.selectedMonth; - var origYear = inst.selectedYear; - date = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); - inst.selectedDay = inst.currentDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear(); - if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) - this._notifyChange(inst); - this._adjustInstDate(inst); - if (inst.input) { - inst.input.val(clear ? '' : this._formatDate(inst)); - } - }, - - /* Retrieve the date(s) directly. */ - _getDate: function(inst) { - var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : - this._daylightSavingAdjust(new Date( - inst.currentYear, inst.currentMonth, inst.currentDay))); - return startDate; - }, - - /* Generate the HTML for the current state of the date picker. */ - _generateHTML: function(inst) { - var today = new Date(); - today = this._daylightSavingAdjust( - new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time - var isRTL = this._get(inst, 'isRTL'); - var showButtonPanel = this._get(inst, 'showButtonPanel'); - var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); - var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); - var numMonths = this._getNumberOfMonths(inst); - var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); - var stepMonths = this._get(inst, 'stepMonths'); - var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); - var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : - new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - var drawMonth = inst.drawMonth - showCurrentAtPos; - var drawYear = inst.drawYear; - if (drawMonth < 0) { - drawMonth += 12; - drawYear--; - } - if (maxDate) { - var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), - maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); - maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); - while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { - drawMonth--; - if (drawMonth < 0) { - drawMonth = 11; - drawYear--; - } - } - } - inst.drawMonth = drawMonth; - inst.drawYear = drawYear; - var prevText = this._get(inst, 'prevText'); - prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), - this._getFormatConfig(inst))); - var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? - '' + prevText + '' : - (hideIfNoPrevNext ? '' : '' + prevText + '')); - var nextText = this._get(inst, 'nextText'); - nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), - this._getFormatConfig(inst))); - var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? - '' + nextText + '' : - (hideIfNoPrevNext ? '' : '' + nextText + '')); - var currentText = this._get(inst, 'currentText'); - var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); - currentText = (!navigationAsDateFormat ? currentText : - this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); - var controls = (!inst.inline ? '' : ''); - var buttonPanel = (showButtonPanel) ? '
    ' + (isRTL ? controls : '') + - (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
    ' : ''; - var firstDay = parseInt(this._get(inst, 'firstDay'),10); - firstDay = (isNaN(firstDay) ? 0 : firstDay); - var showWeek = this._get(inst, 'showWeek'); - var dayNames = this._get(inst, 'dayNames'); - var dayNamesShort = this._get(inst, 'dayNamesShort'); - var dayNamesMin = this._get(inst, 'dayNamesMin'); - var monthNames = this._get(inst, 'monthNames'); - var monthNamesShort = this._get(inst, 'monthNamesShort'); - var beforeShowDay = this._get(inst, 'beforeShowDay'); - var showOtherMonths = this._get(inst, 'showOtherMonths'); - var selectOtherMonths = this._get(inst, 'selectOtherMonths'); - var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; - var defaultDate = this._getDefaultDate(inst); - var html = ''; - for (var row = 0; row < numMonths[0]; row++) { - var group = ''; - for (var col = 0; col < numMonths[1]; col++) { - var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); - var cornerClass = ' ui-corner-all'; - var calender = ''; - if (isMultiMonth) { - calender += '
    '; - } - calender += '
    ' + - (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + - (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + - this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, - row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers - '
    ' + - ''; - var thead = (showWeek ? '' : ''); - for (var dow = 0; dow < 7; dow++) { // days of the week - var day = (dow + firstDay) % 7; - thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + - '' + dayNamesMin[day] + ''; - } - calender += thead + ''; - var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); - if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) - inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); - var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; - var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate - var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); - for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows - calender += ''; - var tbody = (!showWeek ? '' : ''); - for (var dow = 0; dow < 7; dow++) { // create date picker days - var daySettings = (beforeShowDay ? - beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); - var otherMonth = (printDate.getMonth() != drawMonth); - var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || - (minDate && printDate < minDate) || (maxDate && printDate > maxDate); - tbody += ''; // display selectable date - printDate.setDate(printDate.getDate() + 1); - printDate = this._daylightSavingAdjust(printDate); - } - calender += tbody + ''; - } - drawMonth++; - if (drawMonth > 11) { - drawMonth = 0; - drawYear++; - } - calender += '
    ' + this._get(inst, 'weekHeader') + '
    ' + - this._get(inst, 'calculateWeek')(printDate) + '' + // actions - (otherMonth && !showOtherMonths ? ' ' : // display for other months - (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
    ' + (isMultiMonth ? '
    ' + - ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
    ' : '') : ''); - group += calender; - } - html += group; - } - html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? - '' : ''); - inst._keyEvent = false; - return html; - }, - - /* Generate the month and year header. */ - _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, - secondary, monthNames, monthNamesShort) { - var changeMonth = this._get(inst, 'changeMonth'); - var changeYear = this._get(inst, 'changeYear'); - var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); - var html = '
    '; - var monthHtml = ''; - // month selection - if (secondary || !changeMonth) - monthHtml += '' + monthNames[drawMonth] + ''; - else { - var inMinYear = (minDate && minDate.getFullYear() == drawYear); - var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); - monthHtml += ''; - } - if (!showMonthAfterYear) - html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); - // year selection - if (secondary || !changeYear) - html += '' + drawYear + ''; - else { - // determine range of years to display - var years = this._get(inst, 'yearRange').split(':'); - var thisYear = new Date().getFullYear(); - var determineYear = function(value) { - var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : - (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : - parseInt(value, 10))); - return (isNaN(year) ? thisYear : year); - }; - var year = determineYear(years[0]); - var endYear = Math.max(year, determineYear(years[1] || '')); - year = (minDate ? Math.max(year, minDate.getFullYear()) : year); - endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); - html += ''; - } - html += this._get(inst, 'yearSuffix'); - if (showMonthAfterYear) - html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; - html += '
    '; // Close datepicker_header - return html; - }, - - /* Adjust one of the date sub-fields. */ - _adjustInstDate: function(inst, offset, period) { - var year = inst.drawYear + (period == 'Y' ? offset : 0); - var month = inst.drawMonth + (period == 'M' ? offset : 0); - var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + - (period == 'D' ? offset : 0); - var date = this._restrictMinMax(inst, - this._daylightSavingAdjust(new Date(year, month, day))); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - if (period == 'M' || period == 'Y') - this._notifyChange(inst); - }, - - /* Ensure a date is within any min/max bounds. */ - _restrictMinMax: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - date = (minDate && date < minDate ? minDate : date); - date = (maxDate && date > maxDate ? maxDate : date); - return date; - }, - - /* Notify change of month/year. */ - _notifyChange: function(inst) { - var onChange = this._get(inst, 'onChangeMonthYear'); - if (onChange) - onChange.apply((inst.input ? inst.input[0] : null), - [inst.selectedYear, inst.selectedMonth + 1, inst]); - }, - - /* Determine the number of months to show. */ - _getNumberOfMonths: function(inst) { - var numMonths = this._get(inst, 'numberOfMonths'); - return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); - }, - - /* Determine the current maximum date - ensure no time components are set. */ - _getMinMaxDate: function(inst, minMax) { - return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); - }, - - /* Find the number of days in a given month. */ - _getDaysInMonth: function(year, month) { - return 32 - new Date(year, month, 32).getDate(); - }, - - /* Find the day of the week of the first of a month. */ - _getFirstDayOfMonth: function(year, month) { - return new Date(year, month, 1).getDay(); - }, - - /* Determines if we should allow a "next/prev" month display change. */ - _canAdjustMonth: function(inst, offset, curYear, curMonth) { - var numMonths = this._getNumberOfMonths(inst); - var date = this._daylightSavingAdjust(new Date(curYear, - curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); - if (offset < 0) - date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); - return this._isInRange(inst, date); - }, - - /* Is the given date in the accepted range? */ - _isInRange: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - return ((!minDate || date.getTime() >= minDate.getTime()) && - (!maxDate || date.getTime() <= maxDate.getTime())); - }, - - /* Provide the configuration settings for formatting/parsing. */ - _getFormatConfig: function(inst) { - var shortYearCutoff = this._get(inst, 'shortYearCutoff'); - shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : - new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); - return {shortYearCutoff: shortYearCutoff, - dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), - monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; - }, - - /* Format the given date for display. */ - _formatDate: function(inst, day, month, year) { - if (!day) { - inst.currentDay = inst.selectedDay; - inst.currentMonth = inst.selectedMonth; - inst.currentYear = inst.selectedYear; - } - var date = (day ? (typeof day == 'object' ? day : - this._daylightSavingAdjust(new Date(year, month, day))) : - this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); - } -}); - -/* jQuery extend now ignores nulls! */ -function extendRemove(target, props) { - $.extend(target, props); - for (var name in props) - if (props[name] == null || props[name] == undefined) - target[name] = props[name]; - return target; -}; - -/* Determine whether an object is an array. */ -function isArray(a) { - return (a && (($.browser.safari && typeof a == 'object' && a.length) || - (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); -}; - -/* Invoke the datepicker functionality. + _daylightSavingAdjust: function(date) { + if (!date) return null; + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !(date); + var origMonth = inst.selectedMonth; + var origYear = inst.selectedYear; + date = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + inst.selectedDay = inst.currentDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear(); + if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) + this._notifyChange(inst); + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? '' : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var today = new Date(); + today = this._daylightSavingAdjust( + new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time + var isRTL = this._get(inst, 'isRTL'); + var showButtonPanel = this._get(inst, 'showButtonPanel'); + var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); + var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); + var numMonths = this._getNumberOfMonths(inst); + var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); + var stepMonths = this._get(inst, 'stepMonths'); + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); + var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var drawMonth = inst.drawMonth - showCurrentAtPos; + var drawYear = inst.drawYear; + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + var prevText = this._get(inst, 'prevText'); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + '' + prevText + '' : + (hideIfNoPrevNext ? '' : '' + prevText + '')); + var nextText = this._get(inst, 'nextText'); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + '' + nextText + '' : + (hideIfNoPrevNext ? '' : '' + nextText + '')); + var currentText = this._get(inst, 'currentText'); + var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + var controls = (!inst.inline ? '' : ''); + var buttonPanel = (showButtonPanel) ? '
    ' + (isRTL ? controls : '') + + (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
    ' : ''; + var firstDay = parseInt(this._get(inst, 'firstDay'),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + var showWeek = this._get(inst, 'showWeek'); + var dayNames = this._get(inst, 'dayNames'); + var dayNamesShort = this._get(inst, 'dayNamesShort'); + var dayNamesMin = this._get(inst, 'dayNamesMin'); + var monthNames = this._get(inst, 'monthNames'); + var monthNamesShort = this._get(inst, 'monthNamesShort'); + var beforeShowDay = this._get(inst, 'beforeShowDay'); + var showOtherMonths = this._get(inst, 'showOtherMonths'); + var selectOtherMonths = this._get(inst, 'selectOtherMonths'); + var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; + var defaultDate = this._getDefaultDate(inst); + var html = ''; + for (var row = 0; row < numMonths[0]; row++) { + var group = ''; + for (var col = 0; col < numMonths[1]; col++) { + var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + var cornerClass = ' ui-corner-all'; + var calender = ''; + if (isMultiMonth) { + calender += '
    '; + } + calender += '
    ' + + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + '
    ' + + ''; + var thead = (showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // days of the week + var day = (dow + firstDay) % 7; + thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + + '' + dayNamesMin[day] + ''; + } + calender += thead + ''; + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate + var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += ''; + var tbody = (!showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // create date picker days + var daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); + var otherMonth = (printDate.getMonth() != drawMonth); + var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += ''; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + ''; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += '
    ' + this._get(inst, 'weekHeader') + '
    ' + + this._get(inst, 'calculateWeek')(printDate) + '' + // actions + (otherMonth && !showOtherMonths ? ' ' : // display for other months + (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
    ' + (isMultiMonth ? '
    ' + + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
    ' : '') : ''); + group += calender; + } + html += group; + } + html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? + '' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '
    '; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '' + monthNames[drawMonth] + ''; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += ''; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + if (secondary || !changeYear) + html += '' + drawYear + ''; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + html += ''; + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '
    '; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + date = (minDate && date < minDate ? minDate : date); + date = (maxDate && date > maxDate ? maxDate : date); + return date; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - new Date(year, month, 32).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return { + shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), + dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), + monthNames: this._get(inst, 'monthNames') + }; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } + }); + + /* jQuery extend now ignores nulls! */ + function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; + }; + + /* Determine whether an object is an array. */ + function isArray(a) { + return (a && (($.browser.safari && typeof a == 'object' && a.length) || + (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); + }; + + /* Invoke the datepicker functionality. @param options string - a command, optionally followed by additional parameters or Object - settings for attaching new datepicker functionality @return jQuery object */ -$.fn.datepicker = function(options){ - - /* Initialise the date picker. */ - if (!$.datepicker.initialized) { - $(document).mousedown($.datepicker._checkExternalClick). - find('body').append($.datepicker.dpDiv); - $.datepicker.initialized = true; - } - - var otherArgs = Array.prototype.slice.call(arguments, 1); - if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - return this.each(function() { - typeof options == 'string' ? - $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this].concat(otherArgs)) : - $.datepicker._attachDatepicker(this, options); - }); -}; - -$.datepicker = new Datepicker(); // singleton instance -$.datepicker.initialized = false; -$.datepicker.uuid = new Date().getTime(); -$.datepicker.version = "1.8.4"; - -// Workaround for #4055 -// Add another global to avoid noConflict issues with inline event handlers -window['DP_jQuery_' + dpuuid] = $; + $.fn.datepicker = function(options){ + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find('body').append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); + }; + + $.datepicker = new Datepicker(); // singleton instance + $.datepicker.initialized = false; + $.datepicker.uuid = new Date().getTime(); + $.datepicker.version = "1.8.4"; + + // Workaround for #4055 + // Add another global to avoid noConflict issues with inline event handlers + window['DP_jQuery_' + dpuuid] = $; })(jQuery); diff --git a/form_elements/js/jquery.ui.widget.js b/form_elements/js/jquery.ui.widget.js index 85e9293b..87d4199a 100644 --- a/form_elements/js/jquery.ui.widget.js +++ b/form_elements/js/jquery.ui.widget.js @@ -9,229 +9,229 @@ */ (function( $, undefined ) { -var _remove = $.fn.remove; - -$.fn.remove = function( selector, keepData ) { - return this.each(function() { - if ( !keepData ) { - if ( !selector || $.filter( selector, [ this ] ).length ) { - $( "*", this ).add( [ this ] ).each(function() { - $( this ).triggerHandler( "remove" ); - }); - } - } - return _remove.call( $(this), selector, keepData ); - }); -}; - -$.widget = function( name, base, prototype ) { - var namespace = name.split( "." )[ 0 ], - fullName; - name = name.split( "." )[ 1 ]; - fullName = namespace + "-" + name; - - if ( !prototype ) { - prototype = base; - base = $.Widget; - } - - // create selector for plugin - $.expr[ ":" ][ fullName ] = function( elem ) { - return !!$.data( elem, name ); - }; - - $[ namespace ] = $[ namespace ] || {}; - $[ namespace ][ name ] = function( options, element ) { - // allow instantiation without initializing for simple inheritance - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; - - var basePrototype = new base(); - // we need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from -// $.each( basePrototype, function( key, val ) { -// if ( $.isPlainObject(val) ) { -// basePrototype[ key ] = $.extend( {}, val ); -// } -// }); - basePrototype.options = $.extend( true, {}, basePrototype.options ); - $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { - namespace: namespace, - widgetName: name, - widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, - widgetBaseClass: fullName - }, prototype ); - - $.widget.bridge( name, $[ namespace ][ name ] ); -}; - -$.widget.bridge = function( name, object ) { - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string", - args = Array.prototype.slice.call( arguments, 1 ), - returnValue = this; - - // allow multiple hashes to be passed on init - options = !isMethodCall && args.length ? - $.extend.apply( null, [ true, options ].concat(args) ) : - options; - - // prevent calls to internal methods - if ( isMethodCall && options.substring( 0, 1 ) === "_" ) { - return returnValue; - } - - if ( isMethodCall ) { - this.each(function() { - var instance = $.data( this, name ), - methodValue = instance && $.isFunction( instance[options] ) ? - instance[ options ].apply( instance, args ) : - instance; - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue; - return false; - } - }); - } else { - this.each(function() { - var instance = $.data( this, name ); - if ( instance ) { - if ( options ) { - instance.option( options ); - } - instance._init(); - } else { - $.data( this, name, new object( options, this ) ); - } - }); - } - - return returnValue; - }; -}; - -$.Widget = function( options, element ) { - // allow instantiation without initializing for simple inheritance - if ( arguments.length ) { - this._createWidget( options, element ); - } -}; - -$.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - options: { - disabled: false - }, - _createWidget: function( options, element ) { - // $.widget.bridge stores the plugin instance, but we do it anyway - // so that it's stored even before the _create function runs - $.data( element, this.widgetName, this ); - this.element = $( element ); - this.options = $.extend( true, {}, - this.options, - $.metadata && $.metadata.get( element )[ this.widgetName ], - options ); - - var self = this; - this.element.bind( "remove." + this.widgetName, function() { - self.destroy(); - }); - - this._create(); - this._init(); - }, - _create: function() {}, - _init: function() {}, - - destroy: function() { - this.element - .unbind( "." + this.widgetName ) - .removeData( this.widgetName ); - this.widget() - .unbind( "." + this.widgetName ) - .removeAttr( "aria-disabled" ) - .removeClass( - this.widgetBaseClass + "-disabled " + - "ui-state-disabled" ); - }, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key, - self = this; - - if ( arguments.length === 0 ) { - // don't return a reference to the internal hash - return $.extend( {}, self.options ); - } - - if (typeof key === "string" ) { - if ( value === undefined ) { - return this.options[ key ]; - } - options = {}; - options[ key ] = value; - } - - $.each( options, function( key, value ) { - self._setOption( key, value ); - }); - - return self; - }, - _setOption: function( key, value ) { - this.options[ key ] = value; - - if ( key === "disabled" ) { - this.widget() - [ value ? "addClass" : "removeClass"]( - this.widgetBaseClass + "-disabled" + " " + - "ui-state-disabled" ) - .attr( "aria-disabled", value ); - } - - return this; - }, - - enable: function() { - return this._setOption( "disabled", false ); - }, - disable: function() { - return this._setOption( "disabled", true ); - }, - - _trigger: function( type, event, data ) { - var callback = this.options[ type ]; - - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); - data = data || {}; - - // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if ( event.originalEvent ) { - for ( var i = $.event.props.length, prop; i; ) { - prop = $.event.props[ --i ]; - event[ prop ] = event.originalEvent[ prop ]; - } - } - - this.element.trigger( event, data ); - - return !( $.isFunction(callback) && - callback.call( this.element[0], event, data ) === false || - event.isDefaultPrevented() ); - } -}; + var _remove = $.fn.remove; + + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + $( this ).triggerHandler( "remove" ); + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; + + $.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from + // $.each( basePrototype, function( key, val ) { + // if ( $.isPlainObject(val) ) { + // basePrototype[ key ] = $.extend( {}, val ); + // } + // }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); + }; + + $.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.substring( 0, 1 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + if ( options ) { + instance.option( options ); + } + instance._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; + }; + + $.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + $.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + $.metadata && $.metadata.get( element )[ this.widgetName ], + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._init(); + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key, + self = this; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, self.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return self; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var callback = this.options[ type ]; + + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + data = data || {}; + + // copy original event properties over to the new event + // this would happen if we could call $.event.fix instead of $.Event + // but we don't have a way to force an event to be fixed multiple times + if ( event.originalEvent ) { + for ( var i = $.event.props.length, prop; i; ) { + prop = $.event.props[ --i ]; + event[ prop ] = event.originalEvent[ prop ]; + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } + }; })( jQuery ); diff --git a/form_elements/js/otherselect.js b/form_elements/js/otherselect.js index a138aba7..619fed90 100644 --- a/form_elements/js/otherselect.js +++ b/form_elements/js/otherselect.js @@ -1,30 +1,30 @@ $(document).ready(function () { $('.otherSelect').each(function (index) { - var name = $(this).attr('name').replace(/[\[\]]+/g,'-'); - $(this).attr('id',name); + var name = $(this).attr('name').replace(/[\[\]]+/g,'-'); + $(this).attr('id',name); - $('#'+name+' option:last').after(''); - $(this).after(''); + $('#'+name+' option:last').after(''); + $(this).after(''); - $(this).removeAttr('name'); + $(this).removeAttr('name'); - $(this).change(function () - { + $(this).change(function () + { - if ($(this).val() == 'other') - { - $('#'+$(this).attr('id')+'_field').val(''); - $('#'+$(this).attr('id')+'_other').show('fast'); - } else - { - $('#'+$(this).attr('id')+'_field').val($(this).val()); - $('#'+$(this).attr('id')+'_other').hide('fast'); - } - }); + if ($(this).val() == 'other') + { + $('#'+$(this).attr('id')+'_field').val(''); + $('#'+$(this).attr('id')+'_other').show('fast'); + } else +{ + $('#'+$(this).attr('id')+'_field').val($(this).val()); + $('#'+$(this).attr('id')+'_other').hide('fast'); + } + }); }); - }); +}); \ No newline at end of file diff --git a/form_elements/js/people_ahah.js b/form_elements/js/people_ahah.js index 0c545ba3..d722a904 100755 --- a/form_elements/js/people_ahah.js +++ b/form_elements/js/people_ahah.js @@ -1,92 +1,98 @@ (function($) { -if (Drupal.jsEnabled) { - $(document).ready(function() { - $('#edit-mods-people-add-from-repository').blur(function () { - if ($('#edit-mods-people-add-from-repository').val() != '') { - $('#edit-mods-people-add-person').mousedown(); - } - }); + if (Drupal.jsEnabled) { + $(document).ready(function() { + $('#edit-mods-people-add-from-repository').blur(function () { + if ($('#edit-mods-people-add-from-repository').val() != '') { + $('#edit-mods-people-add-person').mousedown(); + } + }); - if (Drupal.ahah != undefined) { + if (Drupal.ahah != undefined) { -/** + /** * Override of Drupal.ahah.prototype.success. The only difference is that we * allow for new Drupal.settings. */ -Drupal.ahah.prototype.success = function (response, status) { - $('#edit-mods-people-add-from-repository').val(''); + Drupal.ahah.prototype.success = function (response, status) { + $('#edit-mods-people-add-from-repository').val(''); - var wrapper = $(this.wrapper); - var form = $(this.element).parents('form'); - // Manually insert HTML into the jQuery object, using $() directly crashes - // Safari with long string lengths. http://dev.jquery.com/ticket/1152 - var new_content = $('
    ').html(response.data); + var wrapper = $(this.wrapper); + var form = $(this.element).parents('form'); + // Manually insert HTML into the jQuery object, using $() directly crashes + // Safari with long string lengths. http://dev.jquery.com/ticket/1152 + var new_content = $('
    ').html(response.data); - // Restore the previous action and target to the form. - form.attr('action', this.form_action); - this.form_target ? form.attr('target', this.form_target) : form.removeAttr('target'); - this.form_encattr ? form.attr('target', this.form_encattr) : form.removeAttr('encattr'); + // Restore the previous action and target to the form. + form.attr('action', this.form_action); + this.form_target ? form.attr('target', this.form_target) : form.removeAttr('target'); + this.form_encattr ? form.attr('target', this.form_encattr) : form.removeAttr('encattr'); - // Remove the progress element. - if (this.progress.element) { - $(this.progress.element).remove(); - } - if (this.progress.object) { - this.progress.object.stopMonitoring(); - } - $(this.element).removeClass('progress-disabled').attr('disabled', false); + // Remove the progress element. + if (this.progress.element) { + $(this.progress.element).remove(); + } + if (this.progress.object) { + this.progress.object.stopMonitoring(); + } + $(this.element).removeClass('progress-disabled').attr('disabled', false); - // Add the new content to the page. - Drupal.freezeHeight(); - if (this.method == 'replace') { - wrapper.empty().append(new_content); - } - else { - wrapper[this.method](new_content); - } + // Add the new content to the page. + Drupal.freezeHeight(); + if (this.method == 'replace') { + wrapper.empty().append(new_content); + } + else { + wrapper[this.method](new_content); + } - $('.datepicker').datepicker({ buttonImage: '/misc/date.png', constrainInput: false, showOn: 'button', changeMonth: true, changeYear: true }); + $('.datepicker').datepicker({ + buttonImage: '/misc/date.png', + constrainInput: false, + showOn: 'button', + changeMonth: true, + changeYear: true + }); - // Immediately hide the new content if we're using any effects. - if (this.showEffect != 'show') { - new_content.hide(); - } + // Immediately hide the new content if we're using any effects. + if (this.showEffect != 'show') { + new_content.hide(); + } - // Determine what effect use and what content will receive the effect, then - // show the new content. For browser compatibility, Safari is excluded from - // using effects on table rows. - if (($.browser.safari && $("tr.ahah-new-content", new_content).size() > 0)) { - new_content.show(); - } - else if ($('.ahah-new-content', new_content).size() > 0) { - $('.ahah-new-content', new_content).hide(); - new_content.show(); - $(".ahah-new-content", new_content)[this.showEffect](this.showSpeed); - } - else if (this.showEffect != 'show') { - new_content[this.showEffect](this.showSpeed); - } + // Determine what effect use and what content will receive the effect, then + // show the new content. For browser compatibility, Safari is excluded from + // using effects on table rows. + if (($.browser.safari && $("tr.ahah-new-content", new_content).size() > 0)) { + new_content.show(); + } + else if ($('.ahah-new-content', new_content).size() > 0) { + $('.ahah-new-content', new_content).hide(); + new_content.show(); + $(".ahah-new-content", new_content)[this.showEffect](this.showSpeed); + } + else if (this.showEffect != 'show') { + new_content[this.showEffect](this.showSpeed); + } - // Merge in new and changed settings, if any. - if (response.settings) { - $.extend(Drupal.settings, response.settings); - } + // Merge in new and changed settings, if any. + if (response.settings) { + $.extend(Drupal.settings, response.settings); + } - // Attach all javascript behaviors to the new content, if it was successfully - // added to the page, this if statement allows #ahah[wrapper] to be optional. - if (new_content.parents('html').length > 0) { - Drupal.attachBehaviors(new_content); - } + // Attach all javascript behaviors to the new content, if it was successfully + // added to the page, this if statement allows #ahah[wrapper] to be optional. + if (new_content.parents('html').length > 0) { + Drupal.attachBehaviors(new_content); + } - Drupal.unfreezeHeight(); -}; + Drupal.unfreezeHeight(); + }; - } + } - }); -} + }); + } })(jQuery); diff --git a/form_elements/xml/gacs.xml b/form_elements/xml/gacs.xml index dc9f4db7..a430acae 100644 --- a/form_elements/xml/gacs.xml +++ b/form_elements/xml/gacs.xml @@ -11,5552 +11,5564 @@ xmlns="info:lc/xmlns/codelist-v1" xsi:schemaLocation="info:lc/xmlns/codelist-v1 http://www.loc.gov/standards/codelists/codelist.xsd"> - marcgac - MARC Code List for Geographic Areas - Network Development and MARC Standards Office - info:lc/vocabulary/gacs - - - info:lc/vocabulary/gacs/a-af - Afghanistan - a-af - - - info:lc/vocabulary/gacs/f - Africa - f - - Islamic countries - - - Sahel - - - - info:lc/vocabulary/gacs/fc - Africa, Central - fc - - Central Africa - - - - info:lc/vocabulary/gacs/fe - Africa, Eastern - fe - - Africa, East - - British East Africa - - - East Africa - - - - Eastern Africa - - - - info:lc/vocabulary/gacs/fq - Africa, French-speaking Equatorial - fq - - Chad, Lake - - - Africa, Equatorial - - - French Equatorial Africa - - - French-speaking Equatorial Africa - - - - info:lc/vocabulary/gacs/ff - Africa, North - ff - - Africa, Northwest - - Northwest Africa - - - - Islamic Empire - - - Rome - - Roman Empire - - - - North Africa - - - - info:lc/vocabulary/gacs/fh - Africa, Northeast - fh - - Africa, Italian East - - - East African Horn - - - Italian East Africa - - - Northeast Africa - - - - info:lc/vocabulary/gacs/fs - Africa, Southern - fs - - Southern Africa - - - - info:lc/vocabulary/gacs/fb - Africa, Sub-Saharan - fb - - Sub-Saharan Africa - - - - info:lc/vocabulary/gacs/fw - Africa, West - fw - - Africa, French-speaking West - - French-speaking West Africa - - - French West Africa - - - - Africa, Northwest - - Northwest Africa - - - - Ghana (Empire) - - - Mali (Empire) - - - British West Africa - - - West Africa - - - - info:lc/vocabulary/gacs/n-us-al - Alabama - n-us-al - - - info:lc/vocabulary/gacs/n-us-ak - Alaska - n-us-ak - - - info:lc/vocabulary/gacs/e-aa - Albania - e-aa - - People's Socialist Republic of Albania - - - - info:lc/vocabulary/gacs/n-cn-ab - Alberta - n-cn-ab - - - info:lc/vocabulary/gacs/f-ae - Algeria - f-ae - - People's Democratic Republic of Algeria - - - - info:lc/vocabulary/gacs/ea - Alps - ea - - - info:lc/vocabulary/gacs/sa - Amazon River - sa - - - info:lc/vocabulary/gacs/poas - American Samoa - poas - - Samoa, American - - - - info:lc/vocabulary/gacs/aa - Amur River (China and Russia) - aa - - Hei Ho (China and Russia) - - - Heilong Jiang (China and Russia) - - - Reka Amur (China and Russia) - - - Sakhalin Ula (China and Russia) - - - - info:lc/vocabulary/gacs/sn - Andes - sn - - Andean Area - - - - info:lc/vocabulary/gacs/e-an - Andorra - e-an - - - info:lc/vocabulary/gacs/f-ao - Angola - f-ao - - Kongo Kingdom - - Congo (Kingdom) - - - - People's Republic of Angola - - - Portuguese West Africa - - - West Africa, Portuguese - - - - info:lc/vocabulary/gacs/nwxa - Anguilla - nwxa - - Coded [nwxi] (Saint Kitts and Nevis) before Mar. 1988 - - - Saint Kitts-Nevis-Anguilla - - St. Christopher-Nevis-Anguilla - - - - - info:lc/vocabulary/gacs/a-cc-an - Anhui Sheng (China) - a-cc-an - - Anhwei Province (China) - - - - info:lc/vocabulary/gacs/t - Antarctic Ocean - t - - - info:lc/vocabulary/gacs/t - Antarctica - t - - Coded also [t-ay] (Antarctica) before Mar. 1988 - - - Polar regions - - - South Shetland Islands (Antarctica) - - Coded [lsfk] (Falkland Islands) before Mar. 1998 - - - - Antarctic regions - - - South Pole - - - - info:lc/vocabulary/gacs/nwaq - Antigua and Barbuda - nwaq - - Antigua - - - Barbuda - - Coded [nwbc] (Barbuda) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/nwla - Antilles, Lesser - nwla - - West Indies, French - - French West Indies - - - - Lesser Antilles - - - - info:lc/vocabulary/gacs/n-usa - Appalachian Mountains - n-usa - - Appalachian Mountains, Southern - - - Appalachian Region - - - Blue Ridge Mountains - - - - info:lc/vocabulary/gacs/ma - Arab countries - ma - - Arabic countries - - - - info:lc/vocabulary/gacs/ar - Arabian Peninsula - ar - - Persian Gulf States - - - Arabia - - - - info:lc/vocabulary/gacs/au - Arabian Sea - au - - Oman, Gulf of - - Gulf of Oman - - - - - info:lc/vocabulary/gacs/r - Arctic Ocean - r - - Barents Sea - - - Beaufort Sea - - - - info:lc/vocabulary/gacs/r - Arctic regions - r - - Polar regions - - - Northeast Passage - - - Northwest Passage - - - North Pole - - - - info:lc/vocabulary/gacs/s-ag - Argentina - s-ag - - - info:lc/vocabulary/gacs/n-us-az - Arizona - n-us-az - - - info:lc/vocabulary/gacs/n-us-ar - Arkansas - n-us-ar - - Ozark Mountains - - - - info:lc/vocabulary/gacs/a-ai - Armenia (Republic) - a-ai - - Coded [e-ur-ai] (Armenia (Republic)) before June 1998 - - - Armenia - - - Transcaucasia - - Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia - (Republic)) before June 1998] - - - - Armenian S.S.R. - - - - info:lc/vocabulary/gacs/nwaw - Aruba - nwaw - - Coded [nwco] (Curaçao) before Sept. 2002 - - - - info:lc/vocabulary/gacs/lsai - Ascension Island (Atlantic Ocean) - lsai - - - info:lc/vocabulary/gacs/u-ac - Ashmore and Cartier Islands - u-ac - - - info:lc/vocabulary/gacs/a - Asia - a - - Islamic countries - - - Orient - - East - - - - - info:lc/vocabulary/gacs/ac - Asia, Central - ac - - Central Asia - - - Soviet Central Asia - - - - info:lc/vocabulary/gacs/l - Atlantic Ocean - l - - Islands of the Atlantic - - - - info:lc/vocabulary/gacs/fa - Atlas Mountains - fa - - - info:lc/vocabulary/gacs/u - Australasia - u - - - info:lc/vocabulary/gacs/u-at - Australia - u-at - - Norfolk Island - - - - info:lc/vocabulary/gacs/u-at-ac - Australian Capital Territory - u-at-ac - - Coded [u-at-ne] (New South Wales) before Sept. 2002 - - - A.C.T. - - - Federal Capital Territory - - - - info:lc/vocabulary/gacs/e-au - Austria - e-au - - Pannonia - - - - info:lc/vocabulary/gacs/a-aj - Azerbaijan - a-aj - - Coded [e-ur-aj] (Azerbaijan) before June 1998 - - - Transcaucasia - - Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia - (Republic)) before June 1998] - - - - Azerbaijan S.S.R. - - - - info:lc/vocabulary/gacs/lnaz - Azores - lnaz - - Açores - - - - info:lc/vocabulary/gacs/nwbf - Bahamas - nwbf - - - info:lc/vocabulary/gacs/a-ba - Bahrain - a-ba - - Bahrein - - - - info:lc/vocabulary/gacs/ed - Balkan Peninsula - ed - - Europe, Southeastern - - - Southeastern Europe - - - - info:lc/vocabulary/gacs/eb - Baltic States - eb - - - info:lc/vocabulary/gacs/a-bg - Bangladesh - a-bg - - East Pakistan (Pakistan) - - - - info:lc/vocabulary/gacs/nwbb - Barbados - nwbb - - - info:lc/vocabulary/gacs/a-cc-pe - Beijing (China) - a-cc-pe - - Peiping (China) - - - Peking (China) - - - - info:lc/vocabulary/gacs/e-bw - Belarus - e-bw - - Coded [e-ur-bw] (Belarus) before June 1998 - - - Kievan Rus - - Coded [e-ur] (Soviet Union) before June 1998 - - - - Belorussian S.S.R. - - - Byelorussian S.S.R. - - - White Russia - - - - info:lc/vocabulary/gacs/e-be - Belgium - e-be - - - info:lc/vocabulary/gacs/ncbh - Belize - ncbh - - British Honduras - - - - info:lc/vocabulary/gacs/el - Benelux countries - el - - Low countries - - - - info:lc/vocabulary/gacs/ab - Bengal, Bay of - ab - - Bay of Bengal - - - - info:lc/vocabulary/gacs/f-dm - Benin - f-dm - - Dahomey - - - People's Republic of Benin - - - - info:lc/vocabulary/gacs/lnbm - Bermuda Islands - lnbm - - - info:lc/vocabulary/gacs/a-bt - Bhutan - a-bt - - - info:lc/vocabulary/gacs/mb - Black Sea - mb - - - info:lc/vocabulary/gacs/a-ccp - Bo Hai (China) - a-ccp - - Bohai (China : Gulf) - - - Chihli, Gulf of (China) - - - Po Gulf (China) - - - Po Hai (China) - - - - info:lc/vocabulary/gacs/s-bo - Bolivia - s-bo - - - info:lc/vocabulary/gacs/nwbn - Bonaire (Netherlands Antilles) - nwbn - - Coded [nwco] (Curaçao) before Sept. 200 - - - - info:lc/vocabulary/gacs/a-bn - Borneo - a-bn - - - info:lc/vocabulary/gacs/e-bn - Bosnia and Hercegovina - e-bn - - Coded [e-yu] (Yugoslavia) before Oct. 1992 - - - - info:lc/vocabulary/gacs/f-bs - Botswana - f-bs - - Bechuanaland - - - - info:lc/vocabulary/gacs/lsbv - Bouvet Island - lsbv - - - info:lc/vocabulary/gacs/s-bl - Brazil - s-bl - - - info:lc/vocabulary/gacs/n-cn-bc - British Columbia - n-cn-bc - - Canada, Western - - Western Canada - - - - Northwest, Pacific - - Northwest (U.S.) - - - Pacific Northwest - - - - - info:lc/vocabulary/gacs/i-bi - British Indian Ocean Territory - i-bi - - Diego Garcia (British Indian Ocean Territory) - - - Chagos Islands - - - Indian Ocean Territory, British - - - - info:lc/vocabulary/gacs/nwvb - British Virgin Islands - nwvb - - Virgin Islands - - Coded [nwvr] (Virgin Islands) before Mar. 1988 - - - - Virgin Islands, British - - - Virgin Islands (Great Britain) - - - Virgin Islands (Presidency) - - - - info:lc/vocabulary/gacs/a-bx - Brunei - a-bx - - - info:lc/vocabulary/gacs/e-bu - Bulgaria - e-bu - - Macedonia - - - Macedonia (Bulgaria) - - - People's Republic of Bulgaria - - - - info:lc/vocabulary/gacs/f-uv - Burkina Faso - f-uv - - Upper Volta - - - - info:lc/vocabulary/gacs/a-br - Burma - a-br - - Shan States - - - Myanmar - - - - info:lc/vocabulary/gacs/f-bd - Burundi - f-bd - - Ruanda-Urundi - - - German East Africa - - - - info:lc/vocabulary/gacs/n-us-ca - California - n-us-ca - - Pacific States - - - - info:lc/vocabulary/gacs/a-cb - Cambodia - a-cb - - Kampuchea - - - Khmer Republic - - - - info:lc/vocabulary/gacs/f-cm - Cameroon - f-cm - - Adamawa (Emirate) - - - Cameroons, French - - - Cameroons, Southern - - - Cameroun - - - French Cameroons - - - Southern Cameroons - - - - info:lc/vocabulary/gacs/n-cn - Canada - n-cn - - Canada, Eastern - - Eastern Canada - - - - Canada, Northern - - Northern Canada - - - - Northwest, Canadian - - Canadian Northwest - - - West (Canada) - - - - Saint Lawrence River - - - - info:lc/vocabulary/gacs/nccz - Canal Zone - nccz - - Panama Canal Zone - - - - info:lc/vocabulary/gacs/lnca - Canary Islands - lnca - - - info:lc/vocabulary/gacs/lncv - Cape Verde - lncv - - Cabo Verde - - - Republic of Cape Verde - - - - info:lc/vocabulary/gacs/cc - Caribbean Area - cc - - Spanish Main - - - Caribbean Sea Region - - - Circumcaribbean - - Coded [cr] (Circumcaribbean) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/cc - Caribbean Sea - cc - - - info:lc/vocabulary/gacs/poci - Caroline Islands - poci - - - info:lc/vocabulary/gacs/ak - Caspian Sea - ak - - - info:lc/vocabulary/gacs/e-urk - Caucasus - e-urk - - - info:lc/vocabulary/gacs/e-urr - Caucasus, Northern (Russia) - e-urr - - North Caucasus (Russia) - - - Northern Caucasus (Russia) - - - - info:lc/vocabulary/gacs/nwcj - Cayman Islands - nwcj - - - info:lc/vocabulary/gacs/f-cx - Central African Republic - f-cx - - Central African Empire - - - Ubangi Shari - - - - info:lc/vocabulary/gacs/nc - Central America - nc - - America, Central - - - Middle America - - Coded [cm] (Middle America) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/u-atc - Central Australia - u-atc - - Coded [u-at] (Australia) before September 2005 - - - Australia, Central - - - - info:lc/vocabulary/gacs/e-urc - Central Chernozem Region (Russia) - e-urc - - Central Black Earth Region (Russia) - - - Central Black Soil Region (Russia) - - - - info:lc/vocabulary/gacs/f-cd - Chad - f-cd - - Tibesti Mountains - - - - info:lc/vocabulary/gacs/s-cl - Chile - s-cl - - - info:lc/vocabulary/gacs/a-cc - China - a-cc - - Manchuria (China) - - - Mainland China - - - People's Republic of China - - - - info:lc/vocabulary/gacs/a-cc-cq - Chongqing (China) - a-cc-cq - - Coded [a-cc-sz] (Szechuan Province (China)) before Sept. 2000 - - - Ch'ung-ch'ing shih (China) - - - Chungking (China) - - - - info:lc/vocabulary/gacs/i-xa - Christmas Island (Indian Ocean) - i-xa - - - info:lc/vocabulary/gacs/i-xb - Cocos (Keeling) Islands - i-xb - - Keeling Islands - - - - info:lc/vocabulary/gacs/q - Cold regions - q - - - info:lc/vocabulary/gacs/s-ck - Colombia - s-ck - - - info:lc/vocabulary/gacs/n-us-co - Colorado - n-us-co - - - info:lc/vocabulary/gacs/b - Commonwealth countries - b - - British Commonwealth countries - - - British Dominions - - - Commonwealth nations - - - - info:lc/vocabulary/gacs/i-cq - Comoros - i-cq - - Comoro Islands - - - Îles Comores - - - - info:lc/vocabulary/gacs/f-cf - Congo (Brazzaville) - f-cf - - Kongo Kingdom - - Congo (Kingdom) - - - - Brazzaville - - - French Congo - - - Middle Congo - - - - info:lc/vocabulary/gacs/f-cg - Congo (Democratic Republic) - f-cg - - Kongo Kingdom - - Congo (Kingdom) - - - - Belgian Congo - - - Congo (Kinshasa) - - - Congo (Leopoldville) - - - Zaire - - - - info:lc/vocabulary/gacs/fg - Congo River - fg - - - info:lc/vocabulary/gacs/n-us-ct - Connecticut - n-us-ct - - - info:lc/vocabulary/gacs/pocw - Cook Islands - pocw - - - info:lc/vocabulary/gacs/u-cs - Coral Sea Islands - u-cs - - - info:lc/vocabulary/gacs/nccr - Costa Rica - nccr - - - info:lc/vocabulary/gacs/f-iv - Côte d'Ivoire - f-iv - - Ivory Coast - - - - info:lc/vocabulary/gacs/e-ci - Croatia - e-ci - - Coded [e-yu] (Yugoslavia) before Oct. 1992] - - - People's Republic of Croatia - - - - info:lc/vocabulary/gacs/nwcu - Cuba - nwcu - - - info:lc/vocabulary/gacs/nwco - Curaçao (Netherlands Antilles) - nwco - - - info:lc/vocabulary/gacs/a-cy - Cyprus - a-cy - - - info:lc/vocabulary/gacs/e-xr - Czech Republic [e-xr] - e-xr - - Coded [e-cs] (Czechoslovakia) before May 1993 - - - Czech Socialist Republic (Czechoslovakia) - - - - info:lc/vocabulary/gacs/e-cs - Czechoslovakia - e-cs - - Includes the Czech Republic and Slovakia treated collectively - - - - info:lc/vocabulary/gacs/eo - Danube River - eo - - - info:lc/vocabulary/gacs/zd - Deep space - zd - - - info:lc/vocabulary/gacs/n-us-de - Delaware - n-us-de - - - info:lc/vocabulary/gacs/e-dk - Denmark - e-dk - - - info:lc/vocabulary/gacs/dd - Developed countries - dd - - Advanced countries - - - Economically advanced countries - - - First World - - - Industrialized countries - - - - info:lc/vocabulary/gacs/d - Developing countries - d - - Emerging nations - - - Third World - - - Underdeveloped areas - - - - info:lc/vocabulary/gacs/f-ft - Djibouti - f-ft - - Afars and Issas, French Territory of the - - - French Somaliland - - - French Territory of the Afars and Issas - - - Somaliland, French - - - - info:lc/vocabulary/gacs/nwdq - Dominica - nwdq - - - info:lc/vocabulary/gacs/nwdr - Dominican Republic - nwdr - - - info:lc/vocabulary/gacs/x - Earth - x - - - info:lc/vocabulary/gacs/n-usr - East (U.S.) - n-usr - - - info:lc/vocabulary/gacs/ae - East Asia - ae - - Asia, East - - - East (Far East) - - - Far East - - - - info:lc/vocabulary/gacs/an - East China Sea - an - - - info:lc/vocabulary/gacs/a-em - East Timor - a-em - - Coded [a-pt] (Portuguese Timor) before April 21, 1980; coded [a-io] (Indonesia) from - 1980-Sept. 2002] - - - Lesser Sunda Islands (Indonesia and East Timor) - - Sunda Islands, Lesser (Indonesia and East Timor) - - - - Timor Island - - - Portuguese Timor - - - Timor, East - - - Timor, Portuguese - - - Timor Timur - - - - info:lc/vocabulary/gacs/poea - Easter Island - poea - - Isla de Pascua - - - Pascua Island - - - - info:lc/vocabulary/gacs/u-ate - Eastern Australia - u-ate - - Coded [u-at] (Australia) before September 2005 - - - Australia, Eastern - - - - info:lc/vocabulary/gacs/xa - Eastern Hemisphere - xa - - - info:lc/vocabulary/gacs/s-ec - Ecuador - s-ec - - - info:lc/vocabulary/gacs/f-ua - Egypt - f-ua - - United Arab Republic - - - - info:lc/vocabulary/gacs/nces - El Salvador - nces - - Salvador - - - - info:lc/vocabulary/gacs/e-uk-en - England - e-uk-en - - Brownsea Island (England) - - - Isle of Wight (England) - - Wight, Isle of - - - - - info:lc/vocabulary/gacs/f-eg - Equatorial Guinea - f-eg - - Fernando Po (Equatorial Guinea) - - Bioco (Equatorial Guinea) - - - Bioko (Equatorial Guinea) - - - Macias Nguema (Equatorial Guinea) - - - - Guinea, Equatorial - - - Guinea, Spanish - - - Río Muni - - - Spanish Guinea - - - - info:lc/vocabulary/gacs/f-ea - Eritrea - f-ea - - Coded [f-et] (Ethiopia) before Nov. 1993 - - - - info:lc/vocabulary/gacs/e-er - Estonia - e-er - - Coded [e-ur-er] (Estonia) before June 1998 - - - - info:lc/vocabulary/gacs/f-et - Ethiopia - f-et - - Abyssinia - - - - info:lc/vocabulary/gacs/me - Eurasia - me - - Asia and Europe (treated collectively) - - - Europe and Asia (treated collectively) - - - - info:lc/vocabulary/gacs/e - Europe - e - - European Economic Community countries - - - European Union countries - - - Holy Roman Empire - - - Rome - - Roman Empire - - - - - info:lc/vocabulary/gacs/ec - Europe, Central - ec - - Central Europe - - - Europe, East Central - - Coded [et] (Europe, East Central) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/ee - Europe, Eastern - ee - - Carpathian Mountains - - - Communist countries - - Coded [v] (Communist countries) before June 1998 - - - - Eastern Europe - - - Europe, East Central - - Coded [et] (Europe, East Central) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/en - Europe, Northern - en - - Northern Europe - - - - info:lc/vocabulary/gacs/es - Europe, Southern - es - - Southern Europe - - - - info:lc/vocabulary/gacs/ew - Europe, Western - ew - - Western Europe - - - - info:lc/vocabulary/gacs/lsfk - Falkland Islands - lsfk - - South Orkney Islands - - - Malvinas Islands - - - - info:lc/vocabulary/gacs/lnfa - Faroe Islands - lnfa - - Faeroe Islands - - - - info:lc/vocabulary/gacs/pofj - Fiji - pofj - - - info:lc/vocabulary/gacs/e-fi - Finland - e-fi - - Lapland - - - - info:lc/vocabulary/gacs/e-fr - France - e-fr - - Corsica (France) - - - - info:lc/vocabulary/gacs/h - French Community - h - - Communauté francaise - - - French Union - - - - info:lc/vocabulary/gacs/s-fg - French Guiana - s-fg - - Guiana, French - - - - info:lc/vocabulary/gacs/pofp - French Polynesia - pofp - - Austral Islands (French Polynesia) - - Tubuai Islands (French Polynesia) - - - - Gambier Islands (French Polynesia) - - - Marquesas Islands (French Polynesia) - - Archipel des Marquises (French Polynesia) - - - Îles Marquises de Mendoça (French Polynesia) - - - Islas Marquesas de Mendoza (French Polynesia) - - - Mendaña (French Polynesia) - - - - Society Islands (French Polynesia) - - - Tuamotu Archipelago (French Polynesia) - - - Oceania, French - - - Polynesia, French - - - - info:lc/vocabulary/gacs/a-cc-fu - Fujian Sheng (China) - a-cc-fu - - Fukien Province (China) - - - - info:lc/vocabulary/gacs/f-go - Gabon - f-go - - - info:lc/vocabulary/gacs/pogg - Galapagos Islands - pogg - - - info:lc/vocabulary/gacs/f-gm - Gambia - f-gm - - - info:lc/vocabulary/gacs/a-cc-ka - Gansu Sheng (China) [a-cc-ka] - a-cc-ka - - Kansu Province (China) - - - - info:lc/vocabulary/gacs/awgz - Gaza Strip - awgz - - Palestine - - - - info:lc/vocabulary/gacs/n-us-ga - Georgia - n-us-ga - - - info:lc/vocabulary/gacs/a-gs - Georgia (Republic) - a-gs - - Coded [e-ur-gs] (Georgia (Republic)) before June 1998 - - - Transcaucasia - - Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia - (Republic)) before June 1998] - - - - Georgia (Soviet Union) - - - Georgian S.S.R. - - - - info:lc/vocabulary/gacs/e-gx - Germany - e-gx - - For Germany as a whole regardless of time period; includes Germany (East) and Germany - (West) as a whole between 1949 and 1990] - - - Berlin (Germany) - - Coded [e-gx] (Germany) for Berlin as a whole; [e-ge] (Germany (East)) for East - Berlin; or [e-gw] (Germany (West)) for West Berlin before Jan. 1991] - - - East Berlin - - - West Berlin - - - - Germany, Northern - - Northern Germany - - - - Prussia (Germany) - - - Germany, Southern - - Southern Germany - - - - - info:lc/vocabulary/gacs/e-ge - Germany (East) - e-ge - - For the eastern part of Germany before 1949 or after 1990 and for the German - Democratic Republic between 1949-1990] - - - Democratic German Republic - - - East Germany - - - German Democratic Republic - - - Germany, Eastern - - - - info:lc/vocabulary/gacs/e-gw - Germany (West) - e-gw - - For the western part of Germany before 1949 or after 1990 and for the Federal Republic - of Germany between 1949-1990 - - - Federal German Republic - - - German Federal Republic - - - Germany, Western - - - West Germany - - - - info:lc/vocabulary/gacs/f-gh - Ghana - f-gh - - Togoland - - - Togoland (British) - - British Togoland - - - - Ashanti - - - Gold Coast - - - - info:lc/vocabulary/gacs/e-gi - Gibraltar - e-gi - - Gibraltar, Strait of - - Strait of Gibraltar - - - - - info:lc/vocabulary/gacs/e-uk - Great Britain - e-uk - - British Isles - - - United Kingdom - - - - info:lc/vocabulary/gacs/e-uk-ui - Great Britain Miscellaneous Island Dependencies - e-uk-ui - - Alderney (Channel Islands) - - - Calf of Man (Isle of Man) - - - Channel Islands - - - Guernsey (Channel Islands) - - - Isle of Man - - Man, Isle of - - - - Jersey (Channel Islands) - - - Island Dependencies of Great Britain - - - United Kingdom Miscellaneous Island Dependencies - - - - info:lc/vocabulary/gacs/nl - Great Lakes (North America) - nl - - - info:lc/vocabulary/gacs/np - Great Plains - np - - - info:lc/vocabulary/gacs/fr - Great Rift Valley - fr - - Rift Valley - - - - info:lc/vocabulary/gacs/e-gr - Greece - e-gr - - Aegean Islands (Greece and Turkey) - - Islands of the Aegean - - - - Aegean Sea - - - Crete (Greece) - - - Dodekanesos (Greece) - - - Macedonia - - - Macedonia (Greece) - - - - info:lc/vocabulary/gacs/n-gl - Greenland - n-gl - - - info:lc/vocabulary/gacs/nwgd - Grenada - nwgd - - Grenadines (Saint Vincent and the Grenadines and Grenada) - - - - info:lc/vocabulary/gacs/nwgp - Guadeloupe - nwgp - - Marie-Galante (Guadeloupe) - - - Saint-Barthélemy - - Coded [nwsb] (Saint-Barthelemy) before Mar. 1988 - - - Saint Bartholomew - - - Saint Barts - - - St. Barthélémy - - - - - info:lc/vocabulary/gacs/pogu - Guam - pogu - - - info:lc/vocabulary/gacs/a-cc-kn - Guangdong Sheng (China) - a-cc-kn - - Kwangtung Province (China) - - - - info:lc/vocabulary/gacs/a-cc-kc - Guangxi Zhuangzu Zizhiqu (China) - a-cc-kc - - Kuang-hsi Chuang tsu tzu chih ch'ü (China) - - - Kwangsi Chuang Autonomous Region - - - - info:lc/vocabulary/gacs/ncgt - Guatemala - ncgt - - - info:lc/vocabulary/gacs/f-gv - Guinea - f-gv - - French Guinea - - - Guinea, French - - - Guinée - - - Republique de Guinée - - - - info:lc/vocabulary/gacs/f-pg - Guinea-Bissau - f-pg - - Guinea, Portuguese - - - Portuguese Guinea - - - - info:lc/vocabulary/gacs/a-cc-kw - Guizhou Sheng (China) - a-cc-kw - - Kweichow Province (China) - - - - info:lc/vocabulary/gacs/s-gy - Guyana - s-gy - - British Guiana - - - Guiana, British - - - - info:lc/vocabulary/gacs/a-cc-ha - Hainan Sheng (China) - a-cc-ha - - Coded [a-cc-kn] (Kwangtung Province (China)) before June 1998 - - - Hainan Island (China) - - - Hainan Province (China) - - - - info:lc/vocabulary/gacs/nwht - Haiti - nwht - - - info:lc/vocabulary/gacs/n-us-hi - Hawaii - n-us-hi - - Sunbelt States - - - - info:lc/vocabulary/gacs/i-hm - Heard and McDonald Islands - i-hm - - Heard Island (Heard and McDonald Islands) - - - McDonald Island (Heard and McDonald Islands) - - - - info:lc/vocabulary/gacs/a-cc-hp - Hebei Sheng (China) - a-cc-hp - - Ho-pei sheng (China) - - - Hopeh Province (China) - - - - info:lc/vocabulary/gacs/a-cc-he - Heilongjiang Sheng (China) - a-cc-he - - Heilungkiang Province (China) - - - - info:lc/vocabulary/gacs/a-cc-ho - Henan Sheng (China) - a-cc-ho - - Honan Province (China) - - - - info:lc/vocabulary/gacs/ah - Himalaya Mountains - ah - - - info:lc/vocabulary/gacs/nwhi - Hispaniola - nwhi - - - info:lc/vocabulary/gacs/ncho - Honduras - ncho - - - info:lc/vocabulary/gacs/a-cc-hk - Hong Kong (China) - a-cc-hk - - Coded [a-hk] (Hong Kong) before June 1998 - - - Hong Kong - - - Hong Kong (China : Special Administrative Region) - - - - info:lc/vocabulary/gacs/a-cc-hh - Hubei Sheng (China) - a-cc-hh - - Hu-pei (China) - - - Hupeh Province (China) - - - - info:lc/vocabulary/gacs/n-cnh - Hudson Bay - n-cnh - - - info:lc/vocabulary/gacs/a-cc-hu - Hunan Sheng (China) - a-cc-hu - - Hunan Province (China) - - - - info:lc/vocabulary/gacs/e-hu - Hungary - e-hu - - Pannonia - - - - info:lc/vocabulary/gacs/e-ic - Iceland - e-ic - - - info:lc/vocabulary/gacs/n-us-id - Idaho - n-us-id - - - info:lc/vocabulary/gacs/n-us-il - Illinois - n-us-il - - - info:lc/vocabulary/gacs/a-ii - India - a-ii - - Andaman and Nicobar Islands (India) - - - French India - - India, French - - - - Jammu and Kashmir (India) - - Kashmir - - - Kashmir and Jammu (India) - - - - Lakshadweep (India) - - Laccadive, Minicoy, and Amindivi Islands (India) - - - - Sikkim (India) - - Coded [a-sk] (Sikkim) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/i - Indian Ocean - i - - Islands of the Indian Ocean - - - Timor Sea - - - - info:lc/vocabulary/gacs/n-us-in - Indiana - n-us-in - - - info:lc/vocabulary/gacs/ai - Indochina - ai - - French Indochina - - - - info:lc/vocabulary/gacs/a-io - Indonesia - a-io - - Celebes (Indonesia) - - Sulawesi (Indonesia) - - - - Java (Indonesia) - - - Kalimantan Barat (Indonesia) - - - Lesser Sunda Islands (Indonesia and East Timor) - - - Madura Island (Indonesia) - - - Maluku (Indonesia) - - Moluccas (Indonesia) - - - - Papua (Indonesia) - - Irian Barat (Indonesia) - - - Irian Jaya (Indonesia) - - - West Irian - - - West New Guinea - - - - Sunda Islands, Lesser (Indonesia and East Timor) - - - Sumatra (Indonesia) - - - Timor Island - - - Dutch East Indies - - - Netherlands East Indies - - - - info:lc/vocabulary/gacs/a-cc-im - Inner Mongolia (China) - a-cc-im - - Mongolia (Inner Mongolia) - - - - info:lc/vocabulary/gacs/m - Intercontinental areas (Eastern Hemisphere) - m - - - info:lc/vocabulary/gacs/c - Intercontinental areas (Western Hemisphere) - c - - - info:lc/vocabulary/gacs/n-us-ia - Iowa - n-us-ia - - - info:lc/vocabulary/gacs/a-ir - Iran - a-ir - - Armenia - - - Persia - - - - info:lc/vocabulary/gacs/a-iq - Iraq - a-iq - - Babylonia - - - - info:lc/vocabulary/gacs/e-ie - Ireland - e-ie - - Aran Islands (Ireland) - - - British Isles - - - Eire - - - Ireland (Eire) - - - Irish Republic - - - Republic of Ireland - - - - info:lc/vocabulary/gacs/a-is - Israel - a-is - - Jerusalem - - - Palestine - - - - info:lc/vocabulary/gacs/e-it - Italy - e-it - - Sardinia (Italy) - - - Sicily (Italy) - - - - info:lc/vocabulary/gacs/nwjm - Jamaica - nwjm - - - info:lc/vocabulary/gacs/lnjn - Jan Mayen Island - lnjn - - - info:lc/vocabulary/gacs/a-ja - Japan - a-ja - - Okinawa Island (Japan) - - Coded [a-ok] (Okinawa) before 1984] - - - - Ryukyu Islands - - - Ryukyu Islands, Southern - - Coded [pory] (Ryukyu Islands, Southern) before 1984 - - - - - info:lc/vocabulary/gacs/a-cc-ku - Jiangsu Sheng (China) - a-cc-ku - - Kiangsu Province (China) - - - - info:lc/vocabulary/gacs/a-cc-ki - Jiangxi Sheng (China) - a-cc-ki - - Kiangsi Province (China) - - - - info:lc/vocabulary/gacs/a-cc-kr - Jilin Sheng (China) - a-cc-kr - - Kirin Province (China) - - - - info:lc/vocabulary/gacs/poji - Johnston Island - poji - - - info:lc/vocabulary/gacs/a-jo - Jordan - a-jo - - Transjordan - - - - info:lc/vocabulary/gacs/zju - Jupiter (Planet) - zju - - - info:lc/vocabulary/gacs/n-us-ks - Kansas - n-us-ks - - - info:lc/vocabulary/gacs/a-kz - Kazakhstan - a-kz - - Coded [e-ur-kz] (Kazakhstan) before June 1998 - - - Kazakh S.S.R. - - - Kazakstan - - - - info:lc/vocabulary/gacs/n-us-ky - Kentucky - n-us-ky - - - info:lc/vocabulary/gacs/f-ke - Kenya - f-ke - - East Africa Protectorate - - - - info:lc/vocabulary/gacs/poki - Kermadec Islands - poki - - - info:lc/vocabulary/gacs/pokb - Kiribati - pokb - - Coded [pogn] (Gilbert and Ellice Islands) or [poln] (Line Islands) before Mar. - 1988 - - - Banaba (Kiribati) - - Ocean Island (Kiribati) - - - - Canton and Enderbury Islands - - Coded [pocp] (Canton and Enderbury Islands) before Mar. 1988 - - - Enderbury and Canton Islands - - - - Gilbert and Ellice Islands Colony - - Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 - - - - Kiritimati (Kiribati) - - Christmas Island (Pacific Ocean) - - - - Phoenix Islands (Kiribati) - - - Gilbert Islands - - - - info:lc/vocabulary/gacs/a-kr - Korea - a-kr - - - info:lc/vocabulary/gacs/a-kn - Korea (North) - a-kn - - Korean People's Republic - - - North Korea - - - - info:lc/vocabulary/gacs/a-ko - Korea (South) - a-ko - - Korea (Republic) - - - South Korea - - - - info:lc/vocabulary/gacs/e-kv - Kosovo - e-kv - - Coded [e-rb] (Serbia) before May 2008 and [e-yu] (Serbia and Montenegro) before April - 2007 - - - - info:lc/vocabulary/gacs/a-cck - Kunlun Mountains (China and India) - a-cck - - Kwenlun Mountains - - - - info:lc/vocabulary/gacs/a-ku - Kuwait - a-ku - - - info:lc/vocabulary/gacs/a-kg - Kyrgyzstan - a-kg - - Coded [e-ur-kg] (Kyrgystan) before June 1998 - - - Kirghiz S.S.R. - - - - info:lc/vocabulary/gacs/nl - Lake States - nl - - Great Lakes States - - - - info:lc/vocabulary/gacs/a-ls - Laos - a-ls - - - info:lc/vocabulary/gacs/cl - Latin America - cl - - Neotropics - - - - info:lc/vocabulary/gacs/e-lv - Latvia - e-lv - - Coded [e-ur-lv] (Latvia) before June 1998 - - - - info:lc/vocabulary/gacs/a-le - Lebanon - a-le - - - info:lc/vocabulary/gacs/nwli - Leeward Islands (West Indies) - nwli - - - info:lc/vocabulary/gacs/f-lo - Lesotho - f-lo - - Basutoland - - - - info:lc/vocabulary/gacs/a-cc-lp - Liaoning Sheng (China) - a-cc-lp - - Liaoning Province (China) - - - - info:lc/vocabulary/gacs/f-lb - Liberia - f-lb - - - info:lc/vocabulary/gacs/f-ly - Libya - f-ly - - Tibesti Mountains - - - - info:lc/vocabulary/gacs/e-lh - Liechtenstein - e-lh - - - info:lc/vocabulary/gacs/poln - Line Islands - poln - - - info:lc/vocabulary/gacs/e-li - Lithuania - e-li - - Coded [e-ur-li] (Lithuania) before March 1998 - - - - info:lc/vocabulary/gacs/n-us-la - Louisiana - n-us-la - - - info:lc/vocabulary/gacs/e-lu - Luxembourg - e-lu - - - info:lc/vocabulary/gacs/a-cc-mh - Macau (China : Special Administrative Region) - a-cc-mh - - Coded [a-mh] (Macao) before May 29, 2000 - - - Macao - - - - info:lc/vocabulary/gacs/e-xn - Macedonia (Republic)] - e-xn - - Coded [e-yu] (Yugoslavia) before Oct. 1992 - - - Macedonia - - - - info:lc/vocabulary/gacs/f-mg - Madagascar - f-mg - - Malagasy Republic - - - - info:lc/vocabulary/gacs/lnma - Madeira Islands - lnma - - Selvagens Islands (Madeira Islands) - - Salvage Islands (Madeira Islands) - - - Salvages (Madeira Islands) - - - - - info:lc/vocabulary/gacs/n-us-me - Maine - n-us-me - - - info:lc/vocabulary/gacs/f-mw - Malawi - f-mw - - Rhodesia and Nyasaland - - Federation of Rhodesia and Nyasaland - - - - Nyasaland - - - - info:lc/vocabulary/gacs/am - Malaya - am - - Malay Peninsula - - - - info:lc/vocabulary/gacs/a-my - Malaysia - a-my - - Sabah - - British North Borneo - - - North Borneo - - - - Sarawak - - - Straits Settlements - - - - info:lc/vocabulary/gacs/i-xc - Maldives - i-xc - - - info:lc/vocabulary/gacs/f-ml - Mali - f-ml - - Songhai Empire - - - French Sudan - - - Sudan, French - - - - info:lc/vocabulary/gacs/e-mm - Malta - e-mm - - - info:lc/vocabulary/gacs/n-cn-mb - Manitoba - n-cn-mb - - - info:lc/vocabulary/gacs/poxd - Mariana Islands - poxd - - Commonwealth of the Northern Mariana Islands - - - Northern Mariana Islands - - - - info:lc/vocabulary/gacs/n-cnm - Maritime Provinces - n-cnm - - - info:lc/vocabulary/gacs/zma - Mars (Planet) - zma - - Red Planet - - - - info:lc/vocabulary/gacs/poxe - Marshall Islands - poxe - - Bikini Atoll (Marshall Islands) - - - - info:lc/vocabulary/gacs/nwmq - Martinique - nwmq - - - info:lc/vocabulary/gacs/n-us-md - Maryland - n-us-md - - Chesapeake Bay (Md. and Va.) - - - Washington Region - - - - info:lc/vocabulary/gacs/n-us-m - Massachusetts - n-us-m - - - info:lc/vocabulary/gacs/f-mu - Mauritania - f-mu - - - info:lc/vocabulary/gacs/i-mf - Mauritius - i-mf - - - info:lc/vocabulary/gacs/i-my - Mayotte - i-my - - Coded [i-cq] (Comoros) before Mar. 1988 - - - - info:lc/vocabulary/gacs/mm - Mediterranean Region - mm - - Byzantine Empire - - - - info:lc/vocabulary/gacs/mm - Mediterranean Sea - mm - - Adriatic Sea - - - Gibraltar, Strait of - - Strait of Gibraltar - - - - Islands of the Mediterranean - - - - info:lc/vocabulary/gacs/ag - Mekong River - ag - - Dza-chu - - - Lan-ts'ang Chiang - - - Lancang Jiang - - - Song Tíên Giang - - - - info:lc/vocabulary/gacs/pome - Melanesia - pome - - - info:lc/vocabulary/gacs/zme - Mercury (Planet) - zme - - - info:lc/vocabulary/gacs/n-mx - Mexico - n-mx - - Colorado River (Colo.-Mexico) - - - Colorado River Delta (Mexico) - - - Middle America - - Coded [cm] (Middle America) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/nm - Mexico, Gulf of - nm - - Gulf of Mexico - - - - info:lc/vocabulary/gacs/n-us-mi - Michigan - n-us-mi - - - info:lc/vocabulary/gacs/pott - Micronesia - pott - - - info:lc/vocabulary/gacs/pomi - Micronesia (Federated States) - pomi - - Coded [pott] (Micronesia) before Mar. 1988 - - - Chuuk (Micronesia) - - Truk (Micronesia) - - - - Kosrae (Micronesia) - - Kusaie (Micronesia) - - - - Pohnpei (Micronesia) - - Ponape (Micronesia) - - - - Yap (Micronesia) - - - Federated States of Micronesia - - - - info:lc/vocabulary/gacs/n-usl - Middle Atlantic States - n-usl - - Middle States - - - - info:lc/vocabulary/gacs/aw - Middle East - aw - - Islamic Empire - - - Latin Orient - - - Rome - - Roman Empire - - - - Asia, Southwestern - - - Asia, Western - - - East (Near East) - - - Eastern Mediterranean - - - Levant - - - Mediterranean Region, Eastern - - - Mideast - - - Near East - - - - info:lc/vocabulary/gacs/n-usc - Middle West - n-usc - - Northwest, Old - - - Midwest - - - North Central States - - - - info:lc/vocabulary/gacs/poxf - Midway Islands - poxf - - - info:lc/vocabulary/gacs/n-us-mn - Minnesota - n-us-mn - - - info:lc/vocabulary/gacs/n-us-ms - Mississippi - n-us-ms - - - info:lc/vocabulary/gacs/n-usm - Mississippi River - n-usm - - - info:lc/vocabulary/gacs/n-us-mo - Missouri - n-us-mo - - Ozark Mountains - - - - info:lc/vocabulary/gacs/n-uss - Missouri River - n-uss - - - info:lc/vocabulary/gacs/e-mv - Moldova - e-mv - - Coded [e-ur-mv] (Moldova) before June 1998 - - - Moldavia - - - Moldavian S.S.R. - - - - info:lc/vocabulary/gacs/e-mc - Monaco - e-mc - - - info:lc/vocabulary/gacs/a-mp - Mongolia - a-mp - - Mongolian People's Republic - - - Outer Mongolia - - - - info:lc/vocabulary/gacs/n-us-mt - Montana - n-us-mt - - - info:lc/vocabulary/gacs/e-mo - Montenegro - e-mo - - Coded [e-yu] (Yugoslavia) before April 2007 - - - - info:lc/vocabulary/gacs/nwmj - Montserrat - nwmj - - - info:lc/vocabulary/gacs/zmo - Moon - zmo - - - info:lc/vocabulary/gacs/f-mr - Morocco - f-mr - - Ifni - - Coded [f-if] (Ifni) before Mar. 1988 - - - - Tangier (Morocco) - - - French Morocco - - - - info:lc/vocabulary/gacs/f-mz - Mozambique - f-mz - - East Africa, Portuguese German East Africa - - - People's Republic of Mozambique - - - Portuguese East Africa - - - - info:lc/vocabulary/gacs/f-sx - Namibia - f-sx - - Africa, Southwest - - - South-West Africa - - - - info:lc/vocabulary/gacs/ponu - Nauru - ponu - - Pleasant Island - - - - info:lc/vocabulary/gacs/n-us-nb - Nebraska - n-us-nb - - - info:lc/vocabulary/gacs/a-np - Nepal - a-np - - - info:lc/vocabulary/gacs/zne - Neptune (Planet) - zne - - - info:lc/vocabulary/gacs/e-ne - Netherlands - e-ne - - Holland - - - - info:lc/vocabulary/gacs/nwna - Netherlands Antilles - nwna - - Dutch West Indies - - - Netherlands West Indies - - - West Indies, Dutch - - - - info:lc/vocabulary/gacs/n-us-nv - Nevada - n-us-nv - - - info:lc/vocabulary/gacs/n-cn-nk - New Brunswick - n-cn-nk - - - info:lc/vocabulary/gacs/ponl - New Caledonia - ponl - - Loyalty Islands (New Caledonia) - - - - info:lc/vocabulary/gacs/n-usn - New England - n-usn - - - info:lc/vocabulary/gacs/a-nw - New Guinea - a-nw - - New Guinea Island - - - - info:lc/vocabulary/gacs/n-us-nh - New Hampshire - n-us-nh - - - info:lc/vocabulary/gacs/n-us-nj - New Jersey - n-us-nj - - - info:lc/vocabulary/gacs/n-us-nm - New Mexico - n-us-nm - - - info:lc/vocabulary/gacs/u-at-ne - New South Wales - u-at-ne - - - info:lc/vocabulary/gacs/n-us-ny - New York (State) - n-us-ny - - - info:lc/vocabulary/gacs/u-nz - New Zealand - u-nz - - - info:lc/vocabulary/gacs/n-cn-nf - Newfoundland and Labrador - n-cn-nf - - Labrador (N.L.) - - - - info:lc/vocabulary/gacs/ncnq - Nicaragua - ncnq - - - info:lc/vocabulary/gacs/f-ng - Niger - f-ng - - Songhai Empire - - - Tibesti Mountains - - - - info:lc/vocabulary/gacs/fi - Niger River - fi - - - info:lc/vocabulary/gacs/f-nr - Nigeria - f-nr - - Adamawa (Emirate) - - - Songhai Empire - - - Biafra - - Coded [f-by] (Biafra) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/fl - Nile River - fl - - - info:lc/vocabulary/gacs/a-cc-nn - Ningxia Huizu Zizhiqu (China) - a-cc-nn - - Ninghsia Province (China) - - - Ningsia Hui Autonomous Region (China) - - - - info:lc/vocabulary/gacs/poxh - Niue - poxh - - - info:lc/vocabulary/gacs/n - North America - n - - America - - - New France - - - Pacific Coast (North America) - - - - info:lc/vocabulary/gacs/ln - North Atlantic Ocean - ln - - Baltic Sea - - - Bermuda Triangle - - - English Channel - - - Fundy, Bay of - - Bay of Fundy - - - - Georges Bank - - - Irish Sea - - - North Sea - - - Norwegian Sea - - - Skagerrak (Denmark and Norway) - - - - info:lc/vocabulary/gacs/n-us-nc - North Carolina - n-us-nc - - - info:lc/vocabulary/gacs/n-us-nd - North Dakota - n-us-nd - - - info:lc/vocabulary/gacs/pn - North Pacific Ocean - pn - - Alaska, Gulf of (Alaska) - - Gulf of Alaska (Alaska) - - - - Bering Sea - - - Philippine Sea - - - Pacific Ocean, North - - - - info:lc/vocabulary/gacs/n-use - Northeastern States - n-use - - Northeast (U.S.) - - - - info:lc/vocabulary/gacs/u-atn - Northern Australia - u-atn - - Coded [u-at] (Australia) before September 2005 - - - Australia, Northern - - - - info:lc/vocabulary/gacs/xb - Northern Hemisphere - xb - - - info:lc/vocabulary/gacs/e-uk-ni - Northern Ireland - e-uk-ni - - Ireland, Northern - - - - info:lc/vocabulary/gacs/u-at-no - Northern Territory - u-at-no - - Carpentaria, Gulf of (N.T. and Qld.) - - Coded [ps] (South Pacific Ocean) before June 1998 - - - Gulf of Carpentaria (N.T. and Qld.) - - - - - info:lc/vocabulary/gacs/n-cn-nt - Northwest Territories - n-cn-nt - - - info:lc/vocabulary/gacs/e-no - Norway - e-no - - Lapland - - - - info:lc/vocabulary/gacs/n-cn-ns - Nova Scotia - n-cn-ns - - - info:lc/vocabulary/gacs/n-cn-nu - Nunavut - n-cn-nu - - - info:lc/vocabulary/gacs/po - Oceania - po - - Oceanica - - - - info:lc/vocabulary/gacs/n-us-oh - Ohio - n-us-oh - - - info:lc/vocabulary/gacs/n-uso - Ohio River - n-uso - - - info:lc/vocabulary/gacs/n-us-ok - Oklahoma - n-us-ok - - Indian Territory - - - Ozark Mountains - - - - info:lc/vocabulary/gacs/a-mk - Oman - a-mk - - Arabia, Southern - - - Muscat and Oman - - - - info:lc/vocabulary/gacs/n-cn-on - Ontario - n-cn-on - - - info:lc/vocabulary/gacs/n-us-or - Oregon - n-us-or - - Pacific States - - - - info:lc/vocabulary/gacs/zo - Outer space - zo - - Space, Outer - - - - info:lc/vocabulary/gacs/p - Pacific Ocean - p - - Pacific Area - - - - info:lc/vocabulary/gacs/a-pk - Pakistan - a-pk - - Azad Kashmir - - Azad Jammu and Kashmir - - - Kashmir - - - - West Pakistan - - - - info:lc/vocabulary/gacs/popl - Palau - popl - - Coded [poci] (Caroline Islands) before Mar. 1988 - - - Belau - - - Pelew - - - Republic of Palau - - - - info:lc/vocabulary/gacs/ncpn - Panama - ncpn - - - info:lc/vocabulary/gacs/a-pp - Papua New Guinea - a-pp - - Admiralty Islands (Papua New Guinea) - - - Bismarck Archipelago (Papua New Guinea) - - - Bougainville Island (Papua New Guinea) - - - D'Entrecasteaux Islands (Papua New Guinea) - - - Louisiade Archipelago (Papua New Guinea) - - - New Britain Island (Papua New Guinea) - - - New Guinea (Territory) - - - New Ireland Island (Papua New Guinea) - - - Papua - - - Trobriand Islands (Papua New Guinea) - - - Woodlark Islands (Papua New Guinea) - - - - info:lc/vocabulary/gacs/aopf - Paracel Islands - aopf - - Hoàng Sa - - - Hsi-sha Islands - - - Xisha Islands - - - - info:lc/vocabulary/gacs/s-py - Paraguay - s-py - - - info:lc/vocabulary/gacs/n-us-pa - Pennsylvania - n-us-pa - - - info:lc/vocabulary/gacs/ap - Persian Gulf - ap - - - info:lc/vocabulary/gacs/s-pe - Peru - s-pe - - - info:lc/vocabulary/gacs/a-ph - Philippines - a-ph - - Eastern Samar (Philippines) - - - Luzon (Philippines) - - - Mindanao Island (Philippines) - - - Negros Island (Philippines) - - - Northern Samar (Philippines) - - - Panay Island (Philippines) - - - Samar (Philippines) - - - Philippine Islands - - - - info:lc/vocabulary/gacs/popc - Pitcairn Island - popc - - - info:lc/vocabulary/gacs/zpl - Pluto (Planet) - zpl - - - info:lc/vocabulary/gacs/e-pl - Poland - e-pl - - - info:lc/vocabulary/gacs/pops - Polynesia - pops - - - info:lc/vocabulary/gacs/e-po - Portugal - e-po - - Iberian Peninsula - - Coded [ei] (Iberian Peninsula) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/n-cnp - Prairie Provinces - n-cnp - - Canada, Western - - Western Canada - - - - - info:lc/vocabulary/gacs/n-cn-pi - Prince Edward Island - n-cn-pi - - - info:lc/vocabulary/gacs/nwpr - Puerto Rico - nwpr - - - info:lc/vocabulary/gacs/ep - Pyrenees - ep - - Pirineos - - - - info:lc/vocabulary/gacs/a-qa - Qatar - a-qa - - - info:lc/vocabulary/gacs/a-cc-ts - Qinghai Sheng (China) - a-cc-ts - - Tsinghai Province (China) - - - - info:lc/vocabulary/gacs/n-cn-qu - Québec (Province) - n-cn-qu - - - info:lc/vocabulary/gacs/u-at-qn - Queensland - u-at-qn - - Carpentaria, Gulf of (N.T. and Qld.) - - Coded [ps] (South Pacific Ocean) before June 1998 - - - Gulf of Carpentaria (N.T. and Qld.) - - - - Great Barrier Reef (Qld.) - - - Torres Strait Islands (Qld.) - - - - info:lc/vocabulary/gacs/mr - Red Sea - mr - - Aden, Gulf of - - Gulf of Aden - - - - Aqaba, Gulf of - - Gulf of Aqaba - - - - - info:lc/vocabulary/gacs/i-re - Réunion - i-re - - - info:lc/vocabulary/gacs/er - Rhine River - er - - - info:lc/vocabulary/gacs/n-us-ri - Rhode Island - n-us-ri - - - info:lc/vocabulary/gacs/su - Rio de la Plata (Argentina and Uruguay) - su - - La Plata River (Argentina and Uruguay) - - - Plata, Rio de la (Argentina and Uruguay) - - - Plate River (Argentina and Uruguay) - - - - info:lc/vocabulary/gacs/nr - Rocky Mountains - nr - - - info:lc/vocabulary/gacs/e-rm - Romania - e-rm - - Moldavia - - - Rumania - - - - info:lc/vocabulary/gacs/e-ru - Russia (Federation) - e-ru - - Coded [e-ur-ru] (Russia (Federation)) before June 1998 - - - Kievan Rus - - Coded [e-ur] (Soviet Union) before June 1998 - - - Kuril Islands (Russia) - - Coded [e-ur-ru] (Russia Federation) before June 1998 - - - Chishima-retto (Russia) - - - Kurile Islands (Russia) - - - Kuril'skie ostrova (Russia) - - - Non-Chernozem Region (Russia) - - Coded [e-ur-ru] (Russia Federation) before June 1998 - - - Non-Black Earth Region (Russia) - - - - Russia, Northern - - Coded [e-ur-ru] (Russia (Federation)) before June 1998 - - - Northern Russia - - - Northern Soviet Union - - - Soviet Union, Northern - - - - Sakha (Russia) - - Àkutskaíà A.S.S.R. (Russia) - - - Yakutia (Russia) - - - - Volgo-Viatskii Region (Russia) - - Coded [e-urv] (Volgo-Viatskii Region, RSFSR) before Mar. 1988 - - - - R.S.F.S.R. - - - Russian Republic - - - Russian S.F.S.R. - - - Russian Soviet Federated Socialist Republic - - - - info:lc/vocabulary/gacs/e-urf - Russian Far East (Russia) - e-urf - - Far East (Russia) - - - Far Eastern Region (Russia) - - - Soviet Far East (Russia) - - Coded [e-uro] (Soviet Central Asia) before 1994 - - - - - info:lc/vocabulary/gacs/f-rw - Rwanda - f-rw - - Ruanda-Urundi - - - German East Africa - - - - info:lc/vocabulary/gacs/nwsd - Saba (Netherlands Antilles) - nwsd - - - info:lc/vocabulary/gacs/fd - Sahara - fd - - Sahara Desert - - - - info:lc/vocabulary/gacs/lsxj - Saint Helena - lsxj - - St. Helena - - - - info:lc/vocabulary/gacs/nwxi - Saint Kitts and Nevis - nwxi - - Nevis - - - Saint Kitts - - - Saint Kitts-Nevis-Anguilla - - St. Christopher-Nevis-Anguilla - - - - Saint Christopher and Nevis - - - - info:lc/vocabulary/gacs/nwxk - Saint Lucia - nwxk - - St. Lucia - - - - info:lc/vocabulary/gacs/nwst - Saint Martin (West Indies) - nwst - - Sint Maarten (West Indies) - - - St. Martin (West Indies) - - - - info:lc/vocabulary/gacs/n-xl - Saint Pierre and Miquelon - n-xl - - Miquelon - - - Iles Saint-Pierre et Miquelon - - - St. Pierre and Miquelon - - - - info:lc/vocabulary/gacs/nwxm - Saint Vincent and the Grenadines - nwxm - - Grenadines (Saint Vincent and the Grenadines and Grenada) - - - Saint Vincent - - St. Vincent - - - - - info:lc/vocabulary/gacs/pows - Samoa - pows - - Western Samoa - - - - info:lc/vocabulary/gacs/posh - Samoan Islands - posh - - Samoa (Islands) - - - - info:lc/vocabulary/gacs/e-sm - San Marino - e-sm - - - info:lc/vocabulary/gacs/f-sf - Sao Tome and Principe - f-sf - - São Thomé e Pr¡ncipe - - - - info:lc/vocabulary/gacs/n-cn-sn - Saskatchewan - n-cn-sn - - - info:lc/vocabulary/gacs/zsa - Saturn (Planet) - zsa - - - info:lc/vocabulary/gacs/a-su - Saudi Arabia - a-su - - - info:lc/vocabulary/gacs/ev - Scandinavia - ev - - - info:lc/vocabulary/gacs/e-uk-st - Scotland - e-uk-st - - Shetland (Scotland) - - - Orkney (Scotland) - - - - info:lc/vocabulary/gacs/f-sg - Senegal - f-sg - - - info:lc/vocabulary/gacs/e-rb - Serbia - e-rb - - Coded [e-yu] (Yugoslavia) before April 2007 - - - - info:lc/vocabulary/gacs/i-se - Seychelles - i-se - - - info:lc/vocabulary/gacs/a-cc-ss - Shaanxi Sheng (China) - a-cc-ss - - Shensi Province (China) - - - - info:lc/vocabulary/gacs/a-cc-sp - Shandong Sheng (China) - a-cc-sp - - Shantung Province (China) - - - - info:lc/vocabulary/gacs/a-cc-sm - Shanghai (China) - a-cc-sm - - - info:lc/vocabulary/gacs/a-cc-sh - Shanxi Sheng (China) - a-cc-sh - - Shansi Province (China) - - - - info:lc/vocabulary/gacs/e-urs - Siberia (Russia) - e-urs - - Siberia, Northeastern (Russia) - - - Siberia, Northwestern (Russia) - - - - info:lc/vocabulary/gacs/e-ure - Siberia, Eastern (Russia) - e-ure - - East Siberian Region (Russia) - - - Eastern Siberia (Russia) - - - - info:lc/vocabulary/gacs/e-urw - Siberia, Western (Russia) - e-urw - - Western Siberia (Russia) - - - - info:lc/vocabulary/gacs/a-cc-sz - Sichuan Sheng (China) - a-cc-sz - - Szechwan Province (China) - - - - info:lc/vocabulary/gacs/f-sl - Sierra Leone - f-sl - - - info:lc/vocabulary/gacs/a-si - Singapore - a-si - - Straits Settlements - - - - info:lc/vocabulary/gacs/nweu - Sint Eustatius (Netherlands Antilles) - nweu - - Saint Eustatius (Netherlands Antilles) - - - St. Eustatius (Netherlands Antilles) - - - Statia (Netherlands Antilles) - - - - info:lc/vocabulary/gacs/e-xo - Slovakia - e-xo - - Coded [e-cs] (Czechoslovakia) before May 1993 - - - Slovak Socialist Republic (Czechoslovakia) - - - - info:lc/vocabulary/gacs/e-xv - Slovenia - e-xv - - Coded [e-yu] (Yugoslavia) before Oct. 1992 - - - - info:lc/vocabulary/gacs/zs - Solar system - zs - - - info:lc/vocabulary/gacs/pobp - Solomon Islands - pobp - - Coded also [posn] (Solomon Islands) before Mar. 1988 - - - Guadalcanal (Solomon Islands) - - - Santa Cruz Islands (Solomon Islands) - - Coded [posc] (Santa Cruz Islands) before Mar. 1988 - - - - British Solomon Islands - - - - info:lc/vocabulary/gacs/f-so - Somalia - f-so - - British Somaliland - - - Italian Somaliland - - - Somali Republic - - - - info:lc/vocabulary/gacs/f-sa - South Africa - f-sa - - Bophuthatswana (South Africa) - - - Homelands (South Africa) - - - Prince Edward Islands - - Froides, Îles - - - Îles Froides - - - - Africa, South - - - Union of South Africa - - - - info:lc/vocabulary/gacs/s - South America - s - - America - - - - info:lc/vocabulary/gacs/az - South Asia - az - - East Indies - - Indies, East - - - - Asia, South - - - - info:lc/vocabulary/gacs/ls - South Atlantic Ocean - ls - - Guinea, Gulf of - - Gulf of Guinea - - - - - info:lc/vocabulary/gacs/u-at-sa - South Australia - u-at-sa - - - info:lc/vocabulary/gacs/n-us-sc - South Carolina - n-us-sc - - - info:lc/vocabulary/gacs/ao - South China Sea - ao - - Islands of the South China Sea - - - - info:lc/vocabulary/gacs/n-us-sd - South Dakota - n-us-sd - - - info:lc/vocabulary/gacs/lsxs - South Georgia and South Sandwich Islands - lsxs - - Coded [lsfk] (Falkland Islands) before Oct. 1992 - - - Sandwich Islands, South - - Coded [lsfk] (Falkland Islands) before Oct. 1992 - - - - South Sandwich Islands - - Coded [lsfk] (Falkland Islands) before Oct. 1992 - - - - - info:lc/vocabulary/gacs/ps - South Pacific Ocean - ps - - Arafura Sea - - - Pacific Ocean, South - - - - info:lc/vocabulary/gacs/as - Southeast Asia - as - - East Indies - - Indies, East - - - - Malay Archipelagon - - - Asia, Southeastern - - - Southeastern Asia - - - - info:lc/vocabulary/gacs/xc - Southern Hemisphere - xc - - - info:lc/vocabulary/gacs/n-usu - Southern States - n-usu - - Confederate States of America - - - Cumberland Mountains - - - Gulf States - - - South Atlantic States - - Atlantic States, South - - - - Southwest, Old - - - Southwestern States - - - Sunbelt States - - - - info:lc/vocabulary/gacs/n-ust - Southwest, New - n-ust - - Southwestern States - - - Sunbelt States - - - - info:lc/vocabulary/gacs/e-ur - Soviet Union - e-ur - - Communist countries - - Coded [v] (Communist countries) before June 1998 - - - - Russia - - Russian Empire - - - - Soviet Union, Southern - - Southern Soviet Union - - - - Soviet Union, Western - - Western Soviet Union - - - - Commonwealth of Independent States countries - - - Former Soviet republics - - - U.S.S.R. - - - - info:lc/vocabulary/gacs/e-urn - Soviet Union, Northwestern - e-urn - - Northwestern Soviet Union - - - - info:lc/vocabulary/gacs/e-sp - Spain - e-sp - - Balearic Islands (Spain) - - - Iberian Peninsula - - Coded [ei] (Iberian Peninsula) before Mar. 1988 - - - - Islamic Empire - - - - info:lc/vocabulary/gacs/f-sh - Spanish North Africa - f-sh - - Ceuta (Spain) - - - Melilla (Spain) - - - Spanish Territories in Northern Morocco - - - - info:lc/vocabulary/gacs/aoxp - Spratly Islands - aoxp - - Nansha Islands - - - Shinnan Islands - - - - info:lc/vocabulary/gacs/a-ce - Sri Lanka - a-ce - - Ceylon - - - - info:lc/vocabulary/gacs/f-sj - Sudan - f-sj - - Anglo-Egyptian Sudan - - - - info:lc/vocabulary/gacs/fn - Sudan (Region) - fn - - - info:lc/vocabulary/gacs/fu - Suez Canal (Egypt) - fu - - - info:lc/vocabulary/gacs/zsu - Sun - zsu - - - info:lc/vocabulary/gacs/s-sr - Suriname - s-sr - - Dutch Guiana - - - Guiana, Dutch - - - Surinam - - - - info:lc/vocabulary/gacs/lnsb - Svalbard (Norway) - lnsb - - Bear Island (Norway) - - Bjørnøya (Norway) - - - - Spitsbergen Island (Norway) - - West Spitsbergen (Norway) - - - - - info:lc/vocabulary/gacs/nwsv - Swan Islands (Honduras) - nwsv - - - info:lc/vocabulary/gacs/f-sq - Swaziland - f-sq - - - info:lc/vocabulary/gacs/e-sw - Sweden - e-sw - - Lapland - - - - info:lc/vocabulary/gacs/e-sz - Switzerland - e-sz - - - info:lc/vocabulary/gacs/a-sy - Syria - a-sy - - United Arab Republic - - - - info:lc/vocabulary/gacs/a-ch - Taiwan - a-ch - - Pescadores Islands - - - Pratas Islands - - - Formosa - - - - info:lc/vocabulary/gacs/a-ta - Tajikistan - a-ta - - Coded [e-ur-ta] (Tajikistan) before June 1998 - - - Tadzik Soviet Socialist Republic - - - Tajik S.S.R. - - - - info:lc/vocabulary/gacs/f-tz - Tanzania - f-tz - - Pemba Island (Tanzania) - - Huthera (Tanzania) - - - - Tanganyika - - - Zanzibar - - - German East Africa - - - - info:lc/vocabulary/gacs/u-at-tm - Tasmania - u-at-tm - - - info:lc/vocabulary/gacs/n-us-tn - Tennessee - n-us-tn - - - info:lc/vocabulary/gacs/i-fs - Terres australes et antarctiques françaises - i-fs - - Kerguelen Islands - - Desolation Islands - - - Îles Kerguélen - - - - French Southern and Antarctic Lands - - - French Southern Indian Ocean Islands - - - Indian Ocean Islands, French - - - T.A.A.F. - - - - info:lc/vocabulary/gacs/n-us-tx - Texas - n-us-tx - - - info:lc/vocabulary/gacs/a-th - Thailand - a-th - - Malay Peninsula - - - Siam - - - - info:lc/vocabulary/gacs/af - Thailand, Gulf of - af - - Gulf of Thailand - - - Siam, Gulf of - - - - info:lc/vocabulary/gacs/a-cc-tn - Tianjin (China) - a-cc-tn - - Tientsin (China) - - - - info:lc/vocabulary/gacs/a-cc-ti - Tibet (China) - a-cc-ti - - Tibetan Autonomous Region (China) - - - - info:lc/vocabulary/gacs/at - Tien Shan - at - - Thian Shan - - - Tian Shan - - - Tien Mountains - - - - info:lc/vocabulary/gacs/f-tg - Togo - f-tg - - Togoland - - - French Togoland - - - Togoland (French) - - - - info:lc/vocabulary/gacs/potl - Tokelau - potl - - Union Islands - - - - info:lc/vocabulary/gacs/poto - Tonga - poto - - Friendly Islands - - - Tonga Islands - - - - info:lc/vocabulary/gacs/nwtr - Trinidad and Tobago - nwtr - - Tobago - - - Trinidad - - - - info:lc/vocabulary/gacs/lstd - Tristan da Cunha - lstd - - - info:lc/vocabulary/gacs/w - Tropics - w - - Equator - - - - info:lc/vocabulary/gacs/f-ti - Tunisia - f-ti - - - info:lc/vocabulary/gacs/a-tu - Turkey - a-tu - - Aegean Islands (Greece and Turkey) - - Islands of the Aegean - - - - Aegean Sea - - - Armenia - - - Asia Minor - - - - info:lc/vocabulary/gacs/a-tk - Turkmenistan - a-tk - - Coded [e-ur-tk] (Turkmenistan) before June 1998 - - - Turkmen S.S.R. - - - - info:lc/vocabulary/gacs/nwtc - Turks and Caicos Islands - nwtc - - Caicos Islands - - - - info:lc/vocabulary/gacs/potv - Tuvalu - potv - - Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 - - - Gilbert and Ellice Islands Colony - - Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 - - - - Ellice Islands - - - - info:lc/vocabulary/gacs/f-ug - Uganda - f-ug - - - info:lc/vocabulary/gacs/e-un - Ukraine - e-un - - Coded [e-ur-un] (Ukraine) before June 1998 - - - Kievan Rus - - Coded [e-ur] (Soviet Union) before June 1998 - - - - - info:lc/vocabulary/gacs/a-ts - United Arab Emirates - a-ts - - Abū Ẓaby (United Arab Emirates: Emirate) - - Abu Dhabi (United Arab Emirates : Emirate) - - - - Dubayy (United Arab Emirates : Emirate) - - Dubai - - - - Trucial States - - - - info:lc/vocabulary/gacs/n-us - United States - n-us - - Atlantic Coast (U.S.) - - - Atlantic States - - - Saint Lawrence River - - - Snowbelt States - - Frostbelt (U.S.) - - - - - info:lc/vocabulary/gacs/nwuc - United States Miscellaneous Caribbean Islands - nwuc - - Caribbean Island Dependencies of the United States - - - Island Dependencies of the United States in the Caribbean - - - - info:lc/vocabulary/gacs/poup - United States Miscellaneous Pacific Islands - poup - - Includes American Samoa, Guam, Pacific Islands (Trust Territory) treated - collectively - - - Pacific Islands (Trust Territory) - - Pacific Islands (Ter.) - - - Trust Territory of the Pacific Islands - - - - Island Dependencies of the United States in the Pacific - - - Pacific Island Dependencies of the United States - - - - info:lc/vocabulary/gacs/e-uru - Ural Mountains (Russia) - e-uru - - - info:lc/vocabulary/gacs/zur - Uranus (Planet) - zur - - - info:lc/vocabulary/gacs/s-uy - Uruguay - s-uy - - - info:lc/vocabulary/gacs/n-us-ut - Utah - n-us-ut - - - info:lc/vocabulary/gacs/a-uz - Uzbekistan - a-uz - - Coded [e-ur-uz] (Uzbekistan) before June 1998 - - - Uzbek S.S.R. - - - - info:lc/vocabulary/gacs/ponn - Vanuatu - ponn - - Banks Islands (Vanuatu) - - - New Hebrides - - - Republic of Vanuatu - - - - info:lc/vocabulary/gacs/e-vc - Vatican City - e-vc - - Holy See - - - - info:lc/vocabulary/gacs/s-ve - Venezuela - s-ve - - - info:lc/vocabulary/gacs/zve - Venus (Planet) - zve - - - info:lc/vocabulary/gacs/n-us-vt - Vermont - n-us-vt - - - info:lc/vocabulary/gacs/u-at-vi - Victoria - u-at-vi - - - info:lc/vocabulary/gacs/a-vt - Vietnam - a-vt - - Vietnam (Democratic Republic) - - Coded [a-vn] (Vietnam, North) before Mar. 1988 - - - North Vietnam - - - Vietnam, North - - - - Vietnam (Republic) - - Coded [a-vs] (Viet Nam, South) before Mar. 1988 - - - South Vietnam - - - Vietnam, South - - - - - info:lc/vocabulary/gacs/nwvi - Virgin Islands of the United States - nwvi - - Virgin Islands - - Coded [nwvr] (Virgin Islands) before Mar. 1988 - - - - Virgin Islands (American) - - - Virgin Islands (Danish) - - - - info:lc/vocabulary/gacs/n-us-va - Virginia - n-us-va - - Chesapeake Bay (Md. and Va.) - - - Washington Region - - - - info:lc/vocabulary/gacs/e-urp - Volga River (Russia) - e-urp - - - info:lc/vocabulary/gacs/fv - Volta River (Ghana) - fv - - - info:lc/vocabulary/gacs/powk - Wake Island - powk - - - info:lc/vocabulary/gacs/e-uk-wl - Wales - e-uk-wl - - - info:lc/vocabulary/gacs/powf - Wallis and Futuna Islands - powf - - Futuna Islands (Wallis and Futuna Islands) - - - Uvea Island (Wallis and Futuna Islands) - - - - info:lc/vocabulary/gacs/n-us-dc - Washington (D.C.) - n-us-dc - - Washington Region - - - District of Columbia - - - - info:lc/vocabulary/gacs/n-us-wa - Washington (State) - n-us-wa - - Pacific States - - - - info:lc/vocabulary/gacs/n-usp - West (U.S.) - n-usp - - Colorado River (Colo.-Mexico) - - - Great Basin - - - Northwest, Pacific - - Northwest (U.S.) - - - Pacific Northwest - - - - Northwestern States - - - Far West (U.S.) - - - Pacific and Mountain States - - - Western States (U.S.) - - - - info:lc/vocabulary/gacs/awba - West Bank - awba - - Coded [a-is] (Israel) and/or [a-jo] (Jordan) before Mar. 1988 - - - Jerusalem - - - Palestine - - - Judaea and Samaria - - - West Bank of the Jordan River - - - - info:lc/vocabulary/gacs/nw - West Indies - nw - - Antilles, Greater - - Coded [nwga] (Greater Antilles) before Mar. 1988 - - - - Greater Antilles - - Coded [nwga] (Greater Antilles) before Mar. 1988 - - - - Indies, West - - - - info:lc/vocabulary/gacs/n-us-wv - West Virginia - n-us-wv - - - info:lc/vocabulary/gacs/u-at-we - Western Australia - u-at-we - - Australia, Western - - - - info:lc/vocabulary/gacs/xd - Western Hemisphere - xd - - - info:lc/vocabulary/gacs/f-ss - Western Sahara - f-ss - - Spanish Sahara - - - - info:lc/vocabulary/gacs/nwwi - Windward Islands (West Indies) [nwwi] - nwwi - - - info:lc/vocabulary/gacs/n-us-wi - Wisconsin - n-us-wi - - - info:lc/vocabulary/gacs/n-us-wy - Wyoming - n-us-wy - - - info:lc/vocabulary/gacs/a-ccs - Xi River (China) - a-ccs - - Hsi Chiang (China) - - - Si Kiang (China) - - - Si River (China) - - - West River (China) - - - - info:lc/vocabulary/gacs/a-cc-su - Xinjiang Uygur Zizhiqu (China) - a-cc-su - - Hsin-chiang-wei-wy-erh tzu chin chü (China) - - - Sinkiang Uighur Autonomous Region (China) - - - - info:lc/vocabulary/gacs/a-ccg - Yangtze River (China) - a-ccg - - Chang Chiang (China) - - - Long River (China) - - - - info:lc/vocabulary/gacs/a-ccy - Yellow River (China) - a-ccy - - Hoang Ho (China) - - - Huang Ho (China) - - - Hwang Ho (China) - - - - info:lc/vocabulary/gacs/ay - Yellow Sea - ay - - Huang Hai - - - Kwang Sea - - - - info:lc/vocabulary/gacs/a-ye - Yemen (Republic) - a-ye - - Aden - - Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992] - - - - Aden (Protectorate) - - Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992 - - - - Arabia, Southern - - - Federation of South Arabia - - South Arabia, Federation of - - - - Socotra (Yemen) - - Coded [i-xo] (Socotra Island) before Mar. 1988; Coded [a-ys] (Yemen (People's - Democratic Republic) before Oct. 1992 - - - Sokotra (Yemen) - - - - Arab Republic of Yemen - - - People's Democratic Republic of Yemen - - - Southern Yemen - - - Yemen (Arab Republic) - - - Yemen (People's Democratic Republic) - - Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992 - - - - - info:lc/vocabulary/gacs/e-yu - Yugoslavia - e-yu - - Pannonia - - - Former Yugoslav republics - - - - info:lc/vocabulary/gacs/n-cn-yk - Yukon Territory - n-cn-yk - - - info:lc/vocabulary/gacs/a-cc-yu - Yunnan Sheng (China) - a-cc-yu - - Yunnan Province (China) - - - - info:lc/vocabulary/gacs/fz - Zambezi River - fz - - Rio Zambezi - - - - info:lc/vocabulary/gacs/f-za - Zambia - f-za - - Rhodesia - - - Rhodesia and Nyasaland - - Federation of Rhodesia and Nyasaland - - - - Northern Rhodesia - - - - info:lc/vocabulary/gacs/a-cc-ch - Zhejiang Sheng (China) - a-cc-ch - - Chekiang Province (China) - - - - info:lc/vocabulary/gacs/f-rh - Zimbabwe - f-rh - - Rhodesia - - - Rhodesia and Nyasaland - - Federation of Rhodesia and Nyasaland - - - - Rhodesia, Southern - - - Southern Rhodesia - - - + marcgac + MARC Code List for Geographic Areas + Network Development and MARC Standards Office + info:lc/vocabulary/gacs + + + info:lc/vocabulary/gacs/a-af + Afghanistan + a-af + + + info:lc/vocabulary/gacs/f + Africa + f + + Islamic countries + + + Sahel + + + + info:lc/vocabulary/gacs/fc + Africa, Central + fc + + Central Africa + + + + info:lc/vocabulary/gacs/fe + Africa, Eastern + fe + + Africa, East + + British East Africa + + + East Africa + + + + Eastern Africa + + + + info:lc/vocabulary/gacs/fq + Africa, French-speaking Equatorial + fq + + Chad, Lake + + + Africa, Equatorial + + + French Equatorial Africa + + + French-speaking Equatorial Africa + + + + info:lc/vocabulary/gacs/ff + Africa, North + ff + + Africa, Northwest + + Northwest Africa + + + + Islamic Empire + + + Rome + + Roman Empire + + + + North Africa + + + + info:lc/vocabulary/gacs/fh + Africa, Northeast + fh + + Africa, Italian East + + + East African Horn + + + Italian East Africa + + + Northeast Africa + + + + info:lc/vocabulary/gacs/fs + Africa, Southern + fs + + Southern Africa + + + + info:lc/vocabulary/gacs/fb + Africa, Sub-Saharan + fb + + Sub-Saharan Africa + + + + info:lc/vocabulary/gacs/fw + Africa, West + fw + + Africa, French-speaking West + + French-speaking West Africa + + + French West Africa + + + + Africa, Northwest + + Northwest Africa + + + + Ghana (Empire) + + + Mali (Empire) + + + British West Africa + + + West Africa + + + + info:lc/vocabulary/gacs/n-us-al + Alabama + n-us-al + + + info:lc/vocabulary/gacs/n-us-ak + Alaska + n-us-ak + + + info:lc/vocabulary/gacs/e-aa + Albania + e-aa + + People's Socialist Republic of Albania + + + + info:lc/vocabulary/gacs/n-cn-ab + Alberta + n-cn-ab + + + info:lc/vocabulary/gacs/f-ae + Algeria + f-ae + + People's Democratic Republic of Algeria + + + + info:lc/vocabulary/gacs/ea + Alps + ea + + + info:lc/vocabulary/gacs/sa + Amazon River + sa + + + info:lc/vocabulary/gacs/poas + American Samoa + poas + + Samoa, American + + + + info:lc/vocabulary/gacs/aa + Amur River (China and Russia) + aa + + Hei Ho (China and Russia) + + + Heilong Jiang (China and Russia) + + + Reka Amur (China and Russia) + + + Sakhalin Ula (China and Russia) + + + + info:lc/vocabulary/gacs/sn + Andes + sn + + Andean Area + + + + info:lc/vocabulary/gacs/e-an + Andorra + e-an + + + info:lc/vocabulary/gacs/f-ao + Angola + f-ao + + Kongo Kingdom + + Congo (Kingdom) + + + + People's Republic of Angola + + + Portuguese West Africa + + + West Africa, Portuguese + + + + info:lc/vocabulary/gacs/nwxa + Anguilla + nwxa + + Coded [nwxi] (Saint Kitts and Nevis) before Mar. 1988 + + + Saint Kitts-Nevis-Anguilla + + St. Christopher-Nevis-Anguilla + + + + + info:lc/vocabulary/gacs/a-cc-an + Anhui Sheng (China) + a-cc-an + + Anhwei Province (China) + + + + info:lc/vocabulary/gacs/t + Antarctic Ocean + t + + + info:lc/vocabulary/gacs/t + Antarctica + t + + Coded also [t-ay] (Antarctica) before Mar. 1988 + + + Polar regions + + + South Shetland Islands (Antarctica) + + Coded [lsfk] (Falkland Islands) before Mar. 1998 + + + + Antarctic regions + + + South Pole + + + + info:lc/vocabulary/gacs/nwaq + Antigua and Barbuda + nwaq + + Antigua + + + Barbuda + + Coded [nwbc] (Barbuda) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/nwla + Antilles, Lesser + nwla + + West Indies, French + + French West Indies + + + + Lesser Antilles + + + + info:lc/vocabulary/gacs/n-usa + Appalachian Mountains + n-usa + + Appalachian Mountains, Southern + + + Appalachian Region + + + Blue Ridge Mountains + + + + info:lc/vocabulary/gacs/ma + Arab countries + ma + + Arabic countries + + + + info:lc/vocabulary/gacs/ar + Arabian Peninsula + ar + + Persian Gulf States + + + Arabia + + + + info:lc/vocabulary/gacs/au + Arabian Sea + au + + Oman, Gulf of + + Gulf of Oman + + + + + info:lc/vocabulary/gacs/r + Arctic Ocean + r + + Barents Sea + + + Beaufort Sea + + + + info:lc/vocabulary/gacs/r + Arctic regions + r + + Polar regions + + + Northeast Passage + + + Northwest Passage + + + North Pole + + + + info:lc/vocabulary/gacs/s-ag + Argentina + s-ag + + + info:lc/vocabulary/gacs/n-us-az + Arizona + n-us-az + + + info:lc/vocabulary/gacs/n-us-ar + Arkansas + n-us-ar + + Ozark Mountains + + + + info:lc/vocabulary/gacs/a-ai + Armenia (Republic) + a-ai + + Coded [e-ur-ai] (Armenia (Republic)) before June 1998 + + + Armenia + + + Transcaucasia + + Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia + (Republic)) before June 1998] + + + + + Armenian S.S.R. + + + + info:lc/vocabulary/gacs/nwaw + Aruba + nwaw + + Coded [nwco] (Curaçao) before Sept. 2002 + + + + info:lc/vocabulary/gacs/lsai + Ascension Island (Atlantic Ocean) + lsai + + + info:lc/vocabulary/gacs/u-ac + Ashmore and Cartier Islands + u-ac + + + info:lc/vocabulary/gacs/a + Asia + a + + Islamic countries + + + Orient + + East + + + + + info:lc/vocabulary/gacs/ac + Asia, Central + ac + + Central Asia + + + Soviet Central Asia + + + + info:lc/vocabulary/gacs/l + Atlantic Ocean + l + + Islands of the Atlantic + + + + info:lc/vocabulary/gacs/fa + Atlas Mountains + fa + + + info:lc/vocabulary/gacs/u + Australasia + u + + + info:lc/vocabulary/gacs/u-at + Australia + u-at + + Norfolk Island + + + + info:lc/vocabulary/gacs/u-at-ac + Australian Capital Territory + u-at-ac + + Coded [u-at-ne] (New South Wales) before Sept. 2002 + + + A.C.T. + + + Federal Capital Territory + + + + info:lc/vocabulary/gacs/e-au + Austria + e-au + + Pannonia + + + + info:lc/vocabulary/gacs/a-aj + Azerbaijan + a-aj + + Coded [e-ur-aj] (Azerbaijan) before June 1998 + + + Transcaucasia + + Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia + (Republic)) before June 1998] + + + + + Azerbaijan S.S.R. + + + + info:lc/vocabulary/gacs/lnaz + Azores + lnaz + + Açores + + + + info:lc/vocabulary/gacs/nwbf + Bahamas + nwbf + + + info:lc/vocabulary/gacs/a-ba + Bahrain + a-ba + + Bahrein + + + + info:lc/vocabulary/gacs/ed + Balkan Peninsula + ed + + Europe, Southeastern + + + Southeastern Europe + + + + info:lc/vocabulary/gacs/eb + Baltic States + eb + + + info:lc/vocabulary/gacs/a-bg + Bangladesh + a-bg + + East Pakistan (Pakistan) + + + + info:lc/vocabulary/gacs/nwbb + Barbados + nwbb + + + info:lc/vocabulary/gacs/a-cc-pe + Beijing (China) + a-cc-pe + + Peiping (China) + + + Peking (China) + + + + info:lc/vocabulary/gacs/e-bw + Belarus + e-bw + + Coded [e-ur-bw] (Belarus) before June 1998 + + + Kievan Rus + + Coded [e-ur] (Soviet Union) before June 1998 + + + + Belorussian S.S.R. + + + Byelorussian S.S.R. + + + White Russia + + + + info:lc/vocabulary/gacs/e-be + Belgium + e-be + + + info:lc/vocabulary/gacs/ncbh + Belize + ncbh + + British Honduras + + + + info:lc/vocabulary/gacs/el + Benelux countries + el + + Low countries + + + + info:lc/vocabulary/gacs/ab + Bengal, Bay of + ab + + Bay of Bengal + + + + info:lc/vocabulary/gacs/f-dm + Benin + f-dm + + Dahomey + + + People's Republic of Benin + + + + info:lc/vocabulary/gacs/lnbm + Bermuda Islands + lnbm + + + info:lc/vocabulary/gacs/a-bt + Bhutan + a-bt + + + info:lc/vocabulary/gacs/mb + Black Sea + mb + + + info:lc/vocabulary/gacs/a-ccp + Bo Hai (China) + a-ccp + + Bohai (China : Gulf) + + + Chihli, Gulf of (China) + + + Po Gulf (China) + + + Po Hai (China) + + + + info:lc/vocabulary/gacs/s-bo + Bolivia + s-bo + + + info:lc/vocabulary/gacs/nwbn + Bonaire (Netherlands Antilles) + nwbn + + Coded [nwco] (Curaçao) before Sept. 200 + + + + info:lc/vocabulary/gacs/a-bn + Borneo + a-bn + + + info:lc/vocabulary/gacs/e-bn + Bosnia and Hercegovina + e-bn + + Coded [e-yu] (Yugoslavia) before Oct. 1992 + + + + info:lc/vocabulary/gacs/f-bs + Botswana + f-bs + + Bechuanaland + + + + info:lc/vocabulary/gacs/lsbv + Bouvet Island + lsbv + + + info:lc/vocabulary/gacs/s-bl + Brazil + s-bl + + + info:lc/vocabulary/gacs/n-cn-bc + British Columbia + n-cn-bc + + Canada, Western + + Western Canada + + + + Northwest, Pacific + + Northwest (U.S.) + + + Pacific Northwest + + + + + info:lc/vocabulary/gacs/i-bi + British Indian Ocean Territory + i-bi + + Diego Garcia (British Indian Ocean Territory) + + + Chagos Islands + + + Indian Ocean Territory, British + + + + info:lc/vocabulary/gacs/nwvb + British Virgin Islands + nwvb + + Virgin Islands + + Coded [nwvr] (Virgin Islands) before Mar. 1988 + + + + Virgin Islands, British + + + Virgin Islands (Great Britain) + + + Virgin Islands (Presidency) + + + + info:lc/vocabulary/gacs/a-bx + Brunei + a-bx + + + info:lc/vocabulary/gacs/e-bu + Bulgaria + e-bu + + Macedonia + + + Macedonia (Bulgaria) + + + People's Republic of Bulgaria + + + + info:lc/vocabulary/gacs/f-uv + Burkina Faso + f-uv + + Upper Volta + + + + info:lc/vocabulary/gacs/a-br + Burma + a-br + + Shan States + + + Myanmar + + + + info:lc/vocabulary/gacs/f-bd + Burundi + f-bd + + Ruanda-Urundi + + + German East Africa + + + + info:lc/vocabulary/gacs/n-us-ca + California + n-us-ca + + Pacific States + + + + info:lc/vocabulary/gacs/a-cb + Cambodia + a-cb + + Kampuchea + + + Khmer Republic + + + + info:lc/vocabulary/gacs/f-cm + Cameroon + f-cm + + Adamawa (Emirate) + + + Cameroons, French + + + Cameroons, Southern + + + Cameroun + + + French Cameroons + + + Southern Cameroons + + + + info:lc/vocabulary/gacs/n-cn + Canada + n-cn + + Canada, Eastern + + Eastern Canada + + + + Canada, Northern + + Northern Canada + + + + Northwest, Canadian + + Canadian Northwest + + + West (Canada) + + + + Saint Lawrence River + + + + info:lc/vocabulary/gacs/nccz + Canal Zone + nccz + + Panama Canal Zone + + + + info:lc/vocabulary/gacs/lnca + Canary Islands + lnca + + + info:lc/vocabulary/gacs/lncv + Cape Verde + lncv + + Cabo Verde + + + Republic of Cape Verde + + + + info:lc/vocabulary/gacs/cc + Caribbean Area + cc + + Spanish Main + + + Caribbean Sea Region + + + Circumcaribbean + + Coded [cr] (Circumcaribbean) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/cc + Caribbean Sea + cc + + + info:lc/vocabulary/gacs/poci + Caroline Islands + poci + + + info:lc/vocabulary/gacs/ak + Caspian Sea + ak + + + info:lc/vocabulary/gacs/e-urk + Caucasus + e-urk + + + info:lc/vocabulary/gacs/e-urr + Caucasus, Northern (Russia) + e-urr + + North Caucasus (Russia) + + + Northern Caucasus (Russia) + + + + info:lc/vocabulary/gacs/nwcj + Cayman Islands + nwcj + + + info:lc/vocabulary/gacs/f-cx + Central African Republic + f-cx + + Central African Empire + + + Ubangi Shari + + + + info:lc/vocabulary/gacs/nc + Central America + nc + + America, Central + + + Middle America + + Coded [cm] (Middle America) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/u-atc + Central Australia + u-atc + + Coded [u-at] (Australia) before September 2005 + + + Australia, Central + + + + info:lc/vocabulary/gacs/e-urc + Central Chernozem Region (Russia) + e-urc + + Central Black Earth Region (Russia) + + + Central Black Soil Region (Russia) + + + + info:lc/vocabulary/gacs/f-cd + Chad + f-cd + + Tibesti Mountains + + + + info:lc/vocabulary/gacs/s-cl + Chile + s-cl + + + info:lc/vocabulary/gacs/a-cc + China + a-cc + + Manchuria (China) + + + Mainland China + + + People's Republic of China + + + + info:lc/vocabulary/gacs/a-cc-cq + Chongqing (China) + a-cc-cq + + Coded [a-cc-sz] (Szechuan Province (China)) before Sept. 2000 + + + Ch'ung-ch'ing shih (China) + + + Chungking (China) + + + + info:lc/vocabulary/gacs/i-xa + Christmas Island (Indian Ocean) + i-xa + + + info:lc/vocabulary/gacs/i-xb + Cocos (Keeling) Islands + i-xb + + Keeling Islands + + + + info:lc/vocabulary/gacs/q + Cold regions + q + + + info:lc/vocabulary/gacs/s-ck + Colombia + s-ck + + + info:lc/vocabulary/gacs/n-us-co + Colorado + n-us-co + + + info:lc/vocabulary/gacs/b + Commonwealth countries + b + + British Commonwealth countries + + + British Dominions + + + Commonwealth nations + + + + info:lc/vocabulary/gacs/i-cq + Comoros + i-cq + + Comoro Islands + + + Îles Comores + + + + info:lc/vocabulary/gacs/f-cf + Congo (Brazzaville) + f-cf + + Kongo Kingdom + + Congo (Kingdom) + + + + Brazzaville + + + French Congo + + + Middle Congo + + + + info:lc/vocabulary/gacs/f-cg + Congo (Democratic Republic) + f-cg + + Kongo Kingdom + + Congo (Kingdom) + + + + Belgian Congo + + + Congo (Kinshasa) + + + Congo (Leopoldville) + + + Zaire + + + + info:lc/vocabulary/gacs/fg + Congo River + fg + + + info:lc/vocabulary/gacs/n-us-ct + Connecticut + n-us-ct + + + info:lc/vocabulary/gacs/pocw + Cook Islands + pocw + + + info:lc/vocabulary/gacs/u-cs + Coral Sea Islands + u-cs + + + info:lc/vocabulary/gacs/nccr + Costa Rica + nccr + + + info:lc/vocabulary/gacs/f-iv + Côte d'Ivoire + f-iv + + Ivory Coast + + + + info:lc/vocabulary/gacs/e-ci + Croatia + e-ci + + Coded [e-yu] (Yugoslavia) before Oct. 1992] + + + People's Republic of Croatia + + + + info:lc/vocabulary/gacs/nwcu + Cuba + nwcu + + + info:lc/vocabulary/gacs/nwco + Curaçao (Netherlands Antilles) + nwco + + + info:lc/vocabulary/gacs/a-cy + Cyprus + a-cy + + + info:lc/vocabulary/gacs/e-xr + Czech Republic [e-xr] + e-xr + + Coded [e-cs] (Czechoslovakia) before May 1993 + + + Czech Socialist Republic (Czechoslovakia) + + + + info:lc/vocabulary/gacs/e-cs + Czechoslovakia + e-cs + + Includes the Czech Republic and Slovakia treated collectively + + + + info:lc/vocabulary/gacs/eo + Danube River + eo + + + info:lc/vocabulary/gacs/zd + Deep space + zd + + + info:lc/vocabulary/gacs/n-us-de + Delaware + n-us-de + + + info:lc/vocabulary/gacs/e-dk + Denmark + e-dk + + + info:lc/vocabulary/gacs/dd + Developed countries + dd + + Advanced countries + + + Economically advanced countries + + + First World + + + Industrialized countries + + + + info:lc/vocabulary/gacs/d + Developing countries + d + + Emerging nations + + + Third World + + + Underdeveloped areas + + + + info:lc/vocabulary/gacs/f-ft + Djibouti + f-ft + + Afars and Issas, French Territory of the + + + French Somaliland + + + French Territory of the Afars and Issas + + + Somaliland, French + + + + info:lc/vocabulary/gacs/nwdq + Dominica + nwdq + + + info:lc/vocabulary/gacs/nwdr + Dominican Republic + nwdr + + + info:lc/vocabulary/gacs/x + Earth + x + + + info:lc/vocabulary/gacs/n-usr + East (U.S.) + n-usr + + + info:lc/vocabulary/gacs/ae + East Asia + ae + + Asia, East + + + East (Far East) + + + Far East + + + + info:lc/vocabulary/gacs/an + East China Sea + an + + + info:lc/vocabulary/gacs/a-em + East Timor + a-em + + Coded [a-pt] (Portuguese Timor) before April 21, 1980; coded [a-io] (Indonesia) from + 1980-Sept. 2002] + + + + Lesser Sunda Islands (Indonesia and East Timor) + + Sunda Islands, Lesser (Indonesia and East Timor) + + + + Timor Island + + + Portuguese Timor + + + Timor, East + + + Timor, Portuguese + + + Timor Timur + + + + info:lc/vocabulary/gacs/poea + Easter Island + poea + + Isla de Pascua + + + Pascua Island + + + + info:lc/vocabulary/gacs/u-ate + Eastern Australia + u-ate + + Coded [u-at] (Australia) before September 2005 + + + Australia, Eastern + + + + info:lc/vocabulary/gacs/xa + Eastern Hemisphere + xa + + + info:lc/vocabulary/gacs/s-ec + Ecuador + s-ec + + + info:lc/vocabulary/gacs/f-ua + Egypt + f-ua + + United Arab Republic + + + + info:lc/vocabulary/gacs/nces + El Salvador + nces + + Salvador + + + + info:lc/vocabulary/gacs/e-uk-en + England + e-uk-en + + Brownsea Island (England) + + + Isle of Wight (England) + + Wight, Isle of + + + + + info:lc/vocabulary/gacs/f-eg + Equatorial Guinea + f-eg + + Fernando Po (Equatorial Guinea) + + Bioco (Equatorial Guinea) + + + Bioko (Equatorial Guinea) + + + Macias Nguema (Equatorial Guinea) + + + + Guinea, Equatorial + + + Guinea, Spanish + + + Río Muni + + + Spanish Guinea + + + + info:lc/vocabulary/gacs/f-ea + Eritrea + f-ea + + Coded [f-et] (Ethiopia) before Nov. 1993 + + + + info:lc/vocabulary/gacs/e-er + Estonia + e-er + + Coded [e-ur-er] (Estonia) before June 1998 + + + + info:lc/vocabulary/gacs/f-et + Ethiopia + f-et + + Abyssinia + + + + info:lc/vocabulary/gacs/me + Eurasia + me + + Asia and Europe (treated collectively) + + + Europe and Asia (treated collectively) + + + + info:lc/vocabulary/gacs/e + Europe + e + + European Economic Community countries + + + European Union countries + + + Holy Roman Empire + + + Rome + + Roman Empire + + + + + info:lc/vocabulary/gacs/ec + Europe, Central + ec + + Central Europe + + + Europe, East Central + + Coded [et] (Europe, East Central) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/ee + Europe, Eastern + ee + + Carpathian Mountains + + + Communist countries + + Coded [v] (Communist countries) before June 1998 + + + + Eastern Europe + + + Europe, East Central + + Coded [et] (Europe, East Central) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/en + Europe, Northern + en + + Northern Europe + + + + info:lc/vocabulary/gacs/es + Europe, Southern + es + + Southern Europe + + + + info:lc/vocabulary/gacs/ew + Europe, Western + ew + + Western Europe + + + + info:lc/vocabulary/gacs/lsfk + Falkland Islands + lsfk + + South Orkney Islands + + + Malvinas Islands + + + + info:lc/vocabulary/gacs/lnfa + Faroe Islands + lnfa + + Faeroe Islands + + + + info:lc/vocabulary/gacs/pofj + Fiji + pofj + + + info:lc/vocabulary/gacs/e-fi + Finland + e-fi + + Lapland + + + + info:lc/vocabulary/gacs/e-fr + France + e-fr + + Corsica (France) + + + + info:lc/vocabulary/gacs/h + French Community + h + + Communauté francaise + + + French Union + + + + info:lc/vocabulary/gacs/s-fg + French Guiana + s-fg + + Guiana, French + + + + info:lc/vocabulary/gacs/pofp + French Polynesia + pofp + + Austral Islands (French Polynesia) + + Tubuai Islands (French Polynesia) + + + + Gambier Islands (French Polynesia) + + + Marquesas Islands (French Polynesia) + + Archipel des Marquises (French Polynesia) + + + Îles Marquises de Mendoça (French Polynesia) + + + Islas Marquesas de Mendoza (French Polynesia) + + + Mendaña (French Polynesia) + + + + Society Islands (French Polynesia) + + + Tuamotu Archipelago (French Polynesia) + + + Oceania, French + + + Polynesia, French + + + + info:lc/vocabulary/gacs/a-cc-fu + Fujian Sheng (China) + a-cc-fu + + Fukien Province (China) + + + + info:lc/vocabulary/gacs/f-go + Gabon + f-go + + + info:lc/vocabulary/gacs/pogg + Galapagos Islands + pogg + + + info:lc/vocabulary/gacs/f-gm + Gambia + f-gm + + + info:lc/vocabulary/gacs/a-cc-ka + Gansu Sheng (China) [a-cc-ka] + a-cc-ka + + Kansu Province (China) + + + + info:lc/vocabulary/gacs/awgz + Gaza Strip + awgz + + Palestine + + + + info:lc/vocabulary/gacs/n-us-ga + Georgia + n-us-ga + + + info:lc/vocabulary/gacs/a-gs + Georgia (Republic) + a-gs + + Coded [e-ur-gs] (Georgia (Republic)) before June 1998 + + + Transcaucasia + + Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia + (Republic)) before June 1998] + + + + + Georgia (Soviet Union) + + + Georgian S.S.R. + + + + info:lc/vocabulary/gacs/e-gx + Germany + e-gx + + For Germany as a whole regardless of time period; includes Germany (East) and Germany + (West) as a whole between 1949 and 1990] + + + + Berlin (Germany) + + Coded [e-gx] (Germany) for Berlin as a whole; [e-ge] (Germany (East)) for East + Berlin; or [e-gw] (Germany (West)) for West Berlin before Jan. 1991] + + + + East Berlin + + + West Berlin + + + + Germany, Northern + + Northern Germany + + + + Prussia (Germany) + + + Germany, Southern + + Southern Germany + + + + + info:lc/vocabulary/gacs/e-ge + Germany (East) + e-ge + + For the eastern part of Germany before 1949 or after 1990 and for the German + Democratic Republic between 1949-1990] + + + + Democratic German Republic + + + East Germany + + + German Democratic Republic + + + Germany, Eastern + + + + info:lc/vocabulary/gacs/e-gw + Germany (West) + e-gw + + For the western part of Germany before 1949 or after 1990 and for the Federal Republic + of Germany between 1949-1990 + + + + Federal German Republic + + + German Federal Republic + + + Germany, Western + + + West Germany + + + + info:lc/vocabulary/gacs/f-gh + Ghana + f-gh + + Togoland + + + Togoland (British) + + British Togoland + + + + Ashanti + + + Gold Coast + + + + info:lc/vocabulary/gacs/e-gi + Gibraltar + e-gi + + Gibraltar, Strait of + + Strait of Gibraltar + + + + + info:lc/vocabulary/gacs/e-uk + Great Britain + e-uk + + British Isles + + + United Kingdom + + + + info:lc/vocabulary/gacs/e-uk-ui + Great Britain Miscellaneous Island Dependencies + e-uk-ui + + Alderney (Channel Islands) + + + Calf of Man (Isle of Man) + + + Channel Islands + + + Guernsey (Channel Islands) + + + Isle of Man + + Man, Isle of + + + + Jersey (Channel Islands) + + + Island Dependencies of Great Britain + + + United Kingdom Miscellaneous Island Dependencies + + + + info:lc/vocabulary/gacs/nl + Great Lakes (North America) + nl + + + info:lc/vocabulary/gacs/np + Great Plains + np + + + info:lc/vocabulary/gacs/fr + Great Rift Valley + fr + + Rift Valley + + + + info:lc/vocabulary/gacs/e-gr + Greece + e-gr + + Aegean Islands (Greece and Turkey) + + Islands of the Aegean + + + + Aegean Sea + + + Crete (Greece) + + + Dodekanesos (Greece) + + + Macedonia + + + Macedonia (Greece) + + + + info:lc/vocabulary/gacs/n-gl + Greenland + n-gl + + + info:lc/vocabulary/gacs/nwgd + Grenada + nwgd + + Grenadines (Saint Vincent and the Grenadines and Grenada) + + + + info:lc/vocabulary/gacs/nwgp + Guadeloupe + nwgp + + Marie-Galante (Guadeloupe) + + + Saint-Barthélemy + + Coded [nwsb] (Saint-Barthelemy) before Mar. 1988 + + + Saint Bartholomew + + + Saint Barts + + + St. Barthélémy + + + + + info:lc/vocabulary/gacs/pogu + Guam + pogu + + + info:lc/vocabulary/gacs/a-cc-kn + Guangdong Sheng (China) + a-cc-kn + + Kwangtung Province (China) + + + + info:lc/vocabulary/gacs/a-cc-kc + Guangxi Zhuangzu Zizhiqu (China) + a-cc-kc + + Kuang-hsi Chuang tsu tzu chih ch'ü (China) + + + Kwangsi Chuang Autonomous Region + + + + info:lc/vocabulary/gacs/ncgt + Guatemala + ncgt + + + info:lc/vocabulary/gacs/f-gv + Guinea + f-gv + + French Guinea + + + Guinea, French + + + Guinée + + + Republique de Guinée + + + + info:lc/vocabulary/gacs/f-pg + Guinea-Bissau + f-pg + + Guinea, Portuguese + + + Portuguese Guinea + + + + info:lc/vocabulary/gacs/a-cc-kw + Guizhou Sheng (China) + a-cc-kw + + Kweichow Province (China) + + + + info:lc/vocabulary/gacs/s-gy + Guyana + s-gy + + British Guiana + + + Guiana, British + + + + info:lc/vocabulary/gacs/a-cc-ha + Hainan Sheng (China) + a-cc-ha + + Coded [a-cc-kn] (Kwangtung Province (China)) before June 1998 + + + Hainan Island (China) + + + Hainan Province (China) + + + + info:lc/vocabulary/gacs/nwht + Haiti + nwht + + + info:lc/vocabulary/gacs/n-us-hi + Hawaii + n-us-hi + + Sunbelt States + + + + info:lc/vocabulary/gacs/i-hm + Heard and McDonald Islands + i-hm + + Heard Island (Heard and McDonald Islands) + + + McDonald Island (Heard and McDonald Islands) + + + + info:lc/vocabulary/gacs/a-cc-hp + Hebei Sheng (China) + a-cc-hp + + Ho-pei sheng (China) + + + Hopeh Province (China) + + + + info:lc/vocabulary/gacs/a-cc-he + Heilongjiang Sheng (China) + a-cc-he + + Heilungkiang Province (China) + + + + info:lc/vocabulary/gacs/a-cc-ho + Henan Sheng (China) + a-cc-ho + + Honan Province (China) + + + + info:lc/vocabulary/gacs/ah + Himalaya Mountains + ah + + + info:lc/vocabulary/gacs/nwhi + Hispaniola + nwhi + + + info:lc/vocabulary/gacs/ncho + Honduras + ncho + + + info:lc/vocabulary/gacs/a-cc-hk + Hong Kong (China) + a-cc-hk + + Coded [a-hk] (Hong Kong) before June 1998 + + + Hong Kong + + + Hong Kong (China : Special Administrative Region) + + + + info:lc/vocabulary/gacs/a-cc-hh + Hubei Sheng (China) + a-cc-hh + + Hu-pei (China) + + + Hupeh Province (China) + + + + info:lc/vocabulary/gacs/n-cnh + Hudson Bay + n-cnh + + + info:lc/vocabulary/gacs/a-cc-hu + Hunan Sheng (China) + a-cc-hu + + Hunan Province (China) + + + + info:lc/vocabulary/gacs/e-hu + Hungary + e-hu + + Pannonia + + + + info:lc/vocabulary/gacs/e-ic + Iceland + e-ic + + + info:lc/vocabulary/gacs/n-us-id + Idaho + n-us-id + + + info:lc/vocabulary/gacs/n-us-il + Illinois + n-us-il + + + info:lc/vocabulary/gacs/a-ii + India + a-ii + + Andaman and Nicobar Islands (India) + + + French India + + India, French + + + + Jammu and Kashmir (India) + + Kashmir + + + Kashmir and Jammu (India) + + + + Lakshadweep (India) + + Laccadive, Minicoy, and Amindivi Islands (India) + + + + Sikkim (India) + + Coded [a-sk] (Sikkim) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/i + Indian Ocean + i + + Islands of the Indian Ocean + + + Timor Sea + + + + info:lc/vocabulary/gacs/n-us-in + Indiana + n-us-in + + + info:lc/vocabulary/gacs/ai + Indochina + ai + + French Indochina + + + + info:lc/vocabulary/gacs/a-io + Indonesia + a-io + + Celebes (Indonesia) + + Sulawesi (Indonesia) + + + + Java (Indonesia) + + + Kalimantan Barat (Indonesia) + + + Lesser Sunda Islands (Indonesia and East Timor) + + + Madura Island (Indonesia) + + + Maluku (Indonesia) + + Moluccas (Indonesia) + + + + Papua (Indonesia) + + Irian Barat (Indonesia) + + + Irian Jaya (Indonesia) + + + West Irian + + + West New Guinea + + + + Sunda Islands, Lesser (Indonesia and East Timor) + + + Sumatra (Indonesia) + + + Timor Island + + + Dutch East Indies + + + Netherlands East Indies + + + + info:lc/vocabulary/gacs/a-cc-im + Inner Mongolia (China) + a-cc-im + + Mongolia (Inner Mongolia) + + + + info:lc/vocabulary/gacs/m + Intercontinental areas (Eastern Hemisphere) + m + + + info:lc/vocabulary/gacs/c + Intercontinental areas (Western Hemisphere) + c + + + info:lc/vocabulary/gacs/n-us-ia + Iowa + n-us-ia + + + info:lc/vocabulary/gacs/a-ir + Iran + a-ir + + Armenia + + + Persia + + + + info:lc/vocabulary/gacs/a-iq + Iraq + a-iq + + Babylonia + + + + info:lc/vocabulary/gacs/e-ie + Ireland + e-ie + + Aran Islands (Ireland) + + + British Isles + + + Eire + + + Ireland (Eire) + + + Irish Republic + + + Republic of Ireland + + + + info:lc/vocabulary/gacs/a-is + Israel + a-is + + Jerusalem + + + Palestine + + + + info:lc/vocabulary/gacs/e-it + Italy + e-it + + Sardinia (Italy) + + + Sicily (Italy) + + + + info:lc/vocabulary/gacs/nwjm + Jamaica + nwjm + + + info:lc/vocabulary/gacs/lnjn + Jan Mayen Island + lnjn + + + info:lc/vocabulary/gacs/a-ja + Japan + a-ja + + Okinawa Island (Japan) + + Coded [a-ok] (Okinawa) before 1984] + + + + Ryukyu Islands + + + Ryukyu Islands, Southern + + Coded [pory] (Ryukyu Islands, Southern) before 1984 + + + + + info:lc/vocabulary/gacs/a-cc-ku + Jiangsu Sheng (China) + a-cc-ku + + Kiangsu Province (China) + + + + info:lc/vocabulary/gacs/a-cc-ki + Jiangxi Sheng (China) + a-cc-ki + + Kiangsi Province (China) + + + + info:lc/vocabulary/gacs/a-cc-kr + Jilin Sheng (China) + a-cc-kr + + Kirin Province (China) + + + + info:lc/vocabulary/gacs/poji + Johnston Island + poji + + + info:lc/vocabulary/gacs/a-jo + Jordan + a-jo + + Transjordan + + + + info:lc/vocabulary/gacs/zju + Jupiter (Planet) + zju + + + info:lc/vocabulary/gacs/n-us-ks + Kansas + n-us-ks + + + info:lc/vocabulary/gacs/a-kz + Kazakhstan + a-kz + + Coded [e-ur-kz] (Kazakhstan) before June 1998 + + + Kazakh S.S.R. + + + Kazakstan + + + + info:lc/vocabulary/gacs/n-us-ky + Kentucky + n-us-ky + + + info:lc/vocabulary/gacs/f-ke + Kenya + f-ke + + East Africa Protectorate + + + + info:lc/vocabulary/gacs/poki + Kermadec Islands + poki + + + info:lc/vocabulary/gacs/pokb + Kiribati + pokb + + Coded [pogn] (Gilbert and Ellice Islands) or [poln] (Line Islands) before Mar. + 1988 + + + + Banaba (Kiribati) + + Ocean Island (Kiribati) + + + + Canton and Enderbury Islands + + Coded [pocp] (Canton and Enderbury Islands) before Mar. 1988 + + + Enderbury and Canton Islands + + + + Gilbert and Ellice Islands Colony + + Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 + + + + Kiritimati (Kiribati) + + Christmas Island (Pacific Ocean) + + + + Phoenix Islands (Kiribati) + + + Gilbert Islands + + + + info:lc/vocabulary/gacs/a-kr + Korea + a-kr + + + info:lc/vocabulary/gacs/a-kn + Korea (North) + a-kn + + Korean People's Republic + + + North Korea + + + + info:lc/vocabulary/gacs/a-ko + Korea (South) + a-ko + + Korea (Republic) + + + South Korea + + + + info:lc/vocabulary/gacs/e-kv + Kosovo + e-kv + + Coded [e-rb] (Serbia) before May 2008 and [e-yu] (Serbia and Montenegro) before April + 2007 + + + + + info:lc/vocabulary/gacs/a-cck + Kunlun Mountains (China and India) + a-cck + + Kwenlun Mountains + + + + info:lc/vocabulary/gacs/a-ku + Kuwait + a-ku + + + info:lc/vocabulary/gacs/a-kg + Kyrgyzstan + a-kg + + Coded [e-ur-kg] (Kyrgystan) before June 1998 + + + Kirghiz S.S.R. + + + + info:lc/vocabulary/gacs/nl + Lake States + nl + + Great Lakes States + + + + info:lc/vocabulary/gacs/a-ls + Laos + a-ls + + + info:lc/vocabulary/gacs/cl + Latin America + cl + + Neotropics + + + + info:lc/vocabulary/gacs/e-lv + Latvia + e-lv + + Coded [e-ur-lv] (Latvia) before June 1998 + + + + info:lc/vocabulary/gacs/a-le + Lebanon + a-le + + + info:lc/vocabulary/gacs/nwli + Leeward Islands (West Indies) + nwli + + + info:lc/vocabulary/gacs/f-lo + Lesotho + f-lo + + Basutoland + + + + info:lc/vocabulary/gacs/a-cc-lp + Liaoning Sheng (China) + a-cc-lp + + Liaoning Province (China) + + + + info:lc/vocabulary/gacs/f-lb + Liberia + f-lb + + + info:lc/vocabulary/gacs/f-ly + Libya + f-ly + + Tibesti Mountains + + + + info:lc/vocabulary/gacs/e-lh + Liechtenstein + e-lh + + + info:lc/vocabulary/gacs/poln + Line Islands + poln + + + info:lc/vocabulary/gacs/e-li + Lithuania + e-li + + Coded [e-ur-li] (Lithuania) before March 1998 + + + + info:lc/vocabulary/gacs/n-us-la + Louisiana + n-us-la + + + info:lc/vocabulary/gacs/e-lu + Luxembourg + e-lu + + + info:lc/vocabulary/gacs/a-cc-mh + Macau (China : Special Administrative Region) + a-cc-mh + + Coded [a-mh] (Macao) before May 29, 2000 + + + Macao + + + + info:lc/vocabulary/gacs/e-xn + Macedonia (Republic)] + e-xn + + Coded [e-yu] (Yugoslavia) before Oct. 1992 + + + Macedonia + + + + info:lc/vocabulary/gacs/f-mg + Madagascar + f-mg + + Malagasy Republic + + + + info:lc/vocabulary/gacs/lnma + Madeira Islands + lnma + + Selvagens Islands (Madeira Islands) + + Salvage Islands (Madeira Islands) + + + Salvages (Madeira Islands) + + + + + info:lc/vocabulary/gacs/n-us-me + Maine + n-us-me + + + info:lc/vocabulary/gacs/f-mw + Malawi + f-mw + + Rhodesia and Nyasaland + + Federation of Rhodesia and Nyasaland + + + + Nyasaland + + + + info:lc/vocabulary/gacs/am + Malaya + am + + Malay Peninsula + + + + info:lc/vocabulary/gacs/a-my + Malaysia + a-my + + Sabah + + British North Borneo + + + North Borneo + + + + Sarawak + + + Straits Settlements + + + + info:lc/vocabulary/gacs/i-xc + Maldives + i-xc + + + info:lc/vocabulary/gacs/f-ml + Mali + f-ml + + Songhai Empire + + + French Sudan + + + Sudan, French + + + + info:lc/vocabulary/gacs/e-mm + Malta + e-mm + + + info:lc/vocabulary/gacs/n-cn-mb + Manitoba + n-cn-mb + + + info:lc/vocabulary/gacs/poxd + Mariana Islands + poxd + + Commonwealth of the Northern Mariana Islands + + + Northern Mariana Islands + + + + info:lc/vocabulary/gacs/n-cnm + Maritime Provinces + n-cnm + + + info:lc/vocabulary/gacs/zma + Mars (Planet) + zma + + Red Planet + + + + info:lc/vocabulary/gacs/poxe + Marshall Islands + poxe + + Bikini Atoll (Marshall Islands) + + + + info:lc/vocabulary/gacs/nwmq + Martinique + nwmq + + + info:lc/vocabulary/gacs/n-us-md + Maryland + n-us-md + + Chesapeake Bay (Md. and Va.) + + + Washington Region + + + + info:lc/vocabulary/gacs/n-us-m + Massachusetts + n-us-m + + + info:lc/vocabulary/gacs/f-mu + Mauritania + f-mu + + + info:lc/vocabulary/gacs/i-mf + Mauritius + i-mf + + + info:lc/vocabulary/gacs/i-my + Mayotte + i-my + + Coded [i-cq] (Comoros) before Mar. 1988 + + + + info:lc/vocabulary/gacs/mm + Mediterranean Region + mm + + Byzantine Empire + + + + info:lc/vocabulary/gacs/mm + Mediterranean Sea + mm + + Adriatic Sea + + + Gibraltar, Strait of + + Strait of Gibraltar + + + + Islands of the Mediterranean + + + + info:lc/vocabulary/gacs/ag + Mekong River + ag + + Dza-chu + + + Lan-ts'ang Chiang + + + Lancang Jiang + + + Song Tíên Giang + + + + info:lc/vocabulary/gacs/pome + Melanesia + pome + + + info:lc/vocabulary/gacs/zme + Mercury (Planet) + zme + + + info:lc/vocabulary/gacs/n-mx + Mexico + n-mx + + Colorado River (Colo.-Mexico) + + + Colorado River Delta (Mexico) + + + Middle America + + Coded [cm] (Middle America) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/nm + Mexico, Gulf of + nm + + Gulf of Mexico + + + + info:lc/vocabulary/gacs/n-us-mi + Michigan + n-us-mi + + + info:lc/vocabulary/gacs/pott + Micronesia + pott + + + info:lc/vocabulary/gacs/pomi + Micronesia (Federated States) + pomi + + Coded [pott] (Micronesia) before Mar. 1988 + + + Chuuk (Micronesia) + + Truk (Micronesia) + + + + Kosrae (Micronesia) + + Kusaie (Micronesia) + + + + Pohnpei (Micronesia) + + Ponape (Micronesia) + + + + Yap (Micronesia) + + + Federated States of Micronesia + + + + info:lc/vocabulary/gacs/n-usl + Middle Atlantic States + n-usl + + Middle States + + + + info:lc/vocabulary/gacs/aw + Middle East + aw + + Islamic Empire + + + Latin Orient + + + Rome + + Roman Empire + + + + Asia, Southwestern + + + Asia, Western + + + East (Near East) + + + Eastern Mediterranean + + + Levant + + + Mediterranean Region, Eastern + + + Mideast + + + Near East + + + + info:lc/vocabulary/gacs/n-usc + Middle West + n-usc + + Northwest, Old + + + Midwest + + + North Central States + + + + info:lc/vocabulary/gacs/poxf + Midway Islands + poxf + + + info:lc/vocabulary/gacs/n-us-mn + Minnesota + n-us-mn + + + info:lc/vocabulary/gacs/n-us-ms + Mississippi + n-us-ms + + + info:lc/vocabulary/gacs/n-usm + Mississippi River + n-usm + + + info:lc/vocabulary/gacs/n-us-mo + Missouri + n-us-mo + + Ozark Mountains + + + + info:lc/vocabulary/gacs/n-uss + Missouri River + n-uss + + + info:lc/vocabulary/gacs/e-mv + Moldova + e-mv + + Coded [e-ur-mv] (Moldova) before June 1998 + + + Moldavia + + + Moldavian S.S.R. + + + + info:lc/vocabulary/gacs/e-mc + Monaco + e-mc + + + info:lc/vocabulary/gacs/a-mp + Mongolia + a-mp + + Mongolian People's Republic + + + Outer Mongolia + + + + info:lc/vocabulary/gacs/n-us-mt + Montana + n-us-mt + + + info:lc/vocabulary/gacs/e-mo + Montenegro + e-mo + + Coded [e-yu] (Yugoslavia) before April 2007 + + + + info:lc/vocabulary/gacs/nwmj + Montserrat + nwmj + + + info:lc/vocabulary/gacs/zmo + Moon + zmo + + + info:lc/vocabulary/gacs/f-mr + Morocco + f-mr + + Ifni + + Coded [f-if] (Ifni) before Mar. 1988 + + + + Tangier (Morocco) + + + French Morocco + + + + info:lc/vocabulary/gacs/f-mz + Mozambique + f-mz + + East Africa, Portuguese German East Africa + + + People's Republic of Mozambique + + + Portuguese East Africa + + + + info:lc/vocabulary/gacs/f-sx + Namibia + f-sx + + Africa, Southwest + + + South-West Africa + + + + info:lc/vocabulary/gacs/ponu + Nauru + ponu + + Pleasant Island + + + + info:lc/vocabulary/gacs/n-us-nb + Nebraska + n-us-nb + + + info:lc/vocabulary/gacs/a-np + Nepal + a-np + + + info:lc/vocabulary/gacs/zne + Neptune (Planet) + zne + + + info:lc/vocabulary/gacs/e-ne + Netherlands + e-ne + + Holland + + + + info:lc/vocabulary/gacs/nwna + Netherlands Antilles + nwna + + Dutch West Indies + + + Netherlands West Indies + + + West Indies, Dutch + + + + info:lc/vocabulary/gacs/n-us-nv + Nevada + n-us-nv + + + info:lc/vocabulary/gacs/n-cn-nk + New Brunswick + n-cn-nk + + + info:lc/vocabulary/gacs/ponl + New Caledonia + ponl + + Loyalty Islands (New Caledonia) + + + + info:lc/vocabulary/gacs/n-usn + New England + n-usn + + + info:lc/vocabulary/gacs/a-nw + New Guinea + a-nw + + New Guinea Island + + + + info:lc/vocabulary/gacs/n-us-nh + New Hampshire + n-us-nh + + + info:lc/vocabulary/gacs/n-us-nj + New Jersey + n-us-nj + + + info:lc/vocabulary/gacs/n-us-nm + New Mexico + n-us-nm + + + info:lc/vocabulary/gacs/u-at-ne + New South Wales + u-at-ne + + + info:lc/vocabulary/gacs/n-us-ny + New York (State) + n-us-ny + + + info:lc/vocabulary/gacs/u-nz + New Zealand + u-nz + + + info:lc/vocabulary/gacs/n-cn-nf + Newfoundland and Labrador + n-cn-nf + + Labrador (N.L.) + + + + info:lc/vocabulary/gacs/ncnq + Nicaragua + ncnq + + + info:lc/vocabulary/gacs/f-ng + Niger + f-ng + + Songhai Empire + + + Tibesti Mountains + + + + info:lc/vocabulary/gacs/fi + Niger River + fi + + + info:lc/vocabulary/gacs/f-nr + Nigeria + f-nr + + Adamawa (Emirate) + + + Songhai Empire + + + Biafra + + Coded [f-by] (Biafra) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/fl + Nile River + fl + + + info:lc/vocabulary/gacs/a-cc-nn + Ningxia Huizu Zizhiqu (China) + a-cc-nn + + Ninghsia Province (China) + + + Ningsia Hui Autonomous Region (China) + + + + info:lc/vocabulary/gacs/poxh + Niue + poxh + + + info:lc/vocabulary/gacs/n + North America + n + + America + + + New France + + + Pacific Coast (North America) + + + + info:lc/vocabulary/gacs/ln + North Atlantic Ocean + ln + + Baltic Sea + + + Bermuda Triangle + + + English Channel + + + Fundy, Bay of + + Bay of Fundy + + + + Georges Bank + + + Irish Sea + + + North Sea + + + Norwegian Sea + + + Skagerrak (Denmark and Norway) + + + + info:lc/vocabulary/gacs/n-us-nc + North Carolina + n-us-nc + + + info:lc/vocabulary/gacs/n-us-nd + North Dakota + n-us-nd + + + info:lc/vocabulary/gacs/pn + North Pacific Ocean + pn + + Alaska, Gulf of (Alaska) + + Gulf of Alaska (Alaska) + + + + Bering Sea + + + Philippine Sea + + + Pacific Ocean, North + + + + info:lc/vocabulary/gacs/n-use + Northeastern States + n-use + + Northeast (U.S.) + + + + info:lc/vocabulary/gacs/u-atn + Northern Australia + u-atn + + Coded [u-at] (Australia) before September 2005 + + + Australia, Northern + + + + info:lc/vocabulary/gacs/xb + Northern Hemisphere + xb + + + info:lc/vocabulary/gacs/e-uk-ni + Northern Ireland + e-uk-ni + + Ireland, Northern + + + + info:lc/vocabulary/gacs/u-at-no + Northern Territory + u-at-no + + Carpentaria, Gulf of (N.T. and Qld.) + + Coded [ps] (South Pacific Ocean) before June 1998 + + + Gulf of Carpentaria (N.T. and Qld.) + + + + + info:lc/vocabulary/gacs/n-cn-nt + Northwest Territories + n-cn-nt + + + info:lc/vocabulary/gacs/e-no + Norway + e-no + + Lapland + + + + info:lc/vocabulary/gacs/n-cn-ns + Nova Scotia + n-cn-ns + + + info:lc/vocabulary/gacs/n-cn-nu + Nunavut + n-cn-nu + + + info:lc/vocabulary/gacs/po + Oceania + po + + Oceanica + + + + info:lc/vocabulary/gacs/n-us-oh + Ohio + n-us-oh + + + info:lc/vocabulary/gacs/n-uso + Ohio River + n-uso + + + info:lc/vocabulary/gacs/n-us-ok + Oklahoma + n-us-ok + + Indian Territory + + + Ozark Mountains + + + + info:lc/vocabulary/gacs/a-mk + Oman + a-mk + + Arabia, Southern + + + Muscat and Oman + + + + info:lc/vocabulary/gacs/n-cn-on + Ontario + n-cn-on + + + info:lc/vocabulary/gacs/n-us-or + Oregon + n-us-or + + Pacific States + + + + info:lc/vocabulary/gacs/zo + Outer space + zo + + Space, Outer + + + + info:lc/vocabulary/gacs/p + Pacific Ocean + p + + Pacific Area + + + + info:lc/vocabulary/gacs/a-pk + Pakistan + a-pk + + Azad Kashmir + + Azad Jammu and Kashmir + + + Kashmir + + + + West Pakistan + + + + info:lc/vocabulary/gacs/popl + Palau + popl + + Coded [poci] (Caroline Islands) before Mar. 1988 + + + Belau + + + Pelew + + + Republic of Palau + + + + info:lc/vocabulary/gacs/ncpn + Panama + ncpn + + + info:lc/vocabulary/gacs/a-pp + Papua New Guinea + a-pp + + Admiralty Islands (Papua New Guinea) + + + Bismarck Archipelago (Papua New Guinea) + + + Bougainville Island (Papua New Guinea) + + + D'Entrecasteaux Islands (Papua New Guinea) + + + Louisiade Archipelago (Papua New Guinea) + + + New Britain Island (Papua New Guinea) + + + New Guinea (Territory) + + + New Ireland Island (Papua New Guinea) + + + Papua + + + Trobriand Islands (Papua New Guinea) + + + Woodlark Islands (Papua New Guinea) + + + + info:lc/vocabulary/gacs/aopf + Paracel Islands + aopf + + Hoàng Sa + + + Hsi-sha Islands + + + Xisha Islands + + + + info:lc/vocabulary/gacs/s-py + Paraguay + s-py + + + info:lc/vocabulary/gacs/n-us-pa + Pennsylvania + n-us-pa + + + info:lc/vocabulary/gacs/ap + Persian Gulf + ap + + + info:lc/vocabulary/gacs/s-pe + Peru + s-pe + + + info:lc/vocabulary/gacs/a-ph + Philippines + a-ph + + Eastern Samar (Philippines) + + + Luzon (Philippines) + + + Mindanao Island (Philippines) + + + Negros Island (Philippines) + + + Northern Samar (Philippines) + + + Panay Island (Philippines) + + + Samar (Philippines) + + + Philippine Islands + + + + info:lc/vocabulary/gacs/popc + Pitcairn Island + popc + + + info:lc/vocabulary/gacs/zpl + Pluto (Planet) + zpl + + + info:lc/vocabulary/gacs/e-pl + Poland + e-pl + + + info:lc/vocabulary/gacs/pops + Polynesia + pops + + + info:lc/vocabulary/gacs/e-po + Portugal + e-po + + Iberian Peninsula + + Coded [ei] (Iberian Peninsula) before Mar. 1988 + + + + + info:lc/vocabulary/gacs/n-cnp + Prairie Provinces + n-cnp + + Canada, Western + + Western Canada + + + + + info:lc/vocabulary/gacs/n-cn-pi + Prince Edward Island + n-cn-pi + + + info:lc/vocabulary/gacs/nwpr + Puerto Rico + nwpr + + + info:lc/vocabulary/gacs/ep + Pyrenees + ep + + Pirineos + + + + info:lc/vocabulary/gacs/a-qa + Qatar + a-qa + + + info:lc/vocabulary/gacs/a-cc-ts + Qinghai Sheng (China) + a-cc-ts + + Tsinghai Province (China) + + + + info:lc/vocabulary/gacs/n-cn-qu + Québec (Province) + n-cn-qu + + + info:lc/vocabulary/gacs/u-at-qn + Queensland + u-at-qn + + Carpentaria, Gulf of (N.T. and Qld.) + + Coded [ps] (South Pacific Ocean) before June 1998 + + + Gulf of Carpentaria (N.T. and Qld.) + + + + Great Barrier Reef (Qld.) + + + Torres Strait Islands (Qld.) + + + + info:lc/vocabulary/gacs/mr + Red Sea + mr + + Aden, Gulf of + + Gulf of Aden + + + + Aqaba, Gulf of + + Gulf of Aqaba + + + + + info:lc/vocabulary/gacs/i-re + Réunion + i-re + + + info:lc/vocabulary/gacs/er + Rhine River + er + + + info:lc/vocabulary/gacs/n-us-ri + Rhode Island + n-us-ri + + + info:lc/vocabulary/gacs/su + Rio de la Plata (Argentina and Uruguay) + su + + La Plata River (Argentina and Uruguay) + + + Plata, Rio de la (Argentina and Uruguay) + + + Plate River (Argentina and Uruguay) + + + + info:lc/vocabulary/gacs/nr + Rocky Mountains + nr + + + info:lc/vocabulary/gacs/e-rm + Romania + e-rm + + Moldavia + + + Rumania + + + + info:lc/vocabulary/gacs/e-ru + Russia (Federation) + e-ru + + Coded [e-ur-ru] (Russia (Federation)) before June 1998 + + + Kievan Rus + + Coded [e-ur] (Soviet Union) before June 1998 + + + Kuril Islands (Russia) + + Coded [e-ur-ru] (Russia Federation) before June 1998 + + + Chishima-retto (Russia) + + + Kurile Islands (Russia) + + + Kuril'skie ostrova (Russia) + + + Non-Chernozem Region (Russia) + + Coded [e-ur-ru] (Russia Federation) before June 1998 + + + Non-Black Earth Region (Russia) + + + + Russia, Northern + + Coded [e-ur-ru] (Russia (Federation)) before June 1998 + + + Northern Russia + + + Northern Soviet Union + + + Soviet Union, Northern + + + + Sakha (Russia) + + Àkutskaíà A.S.S.R. (Russia) + + + Yakutia (Russia) + + + + Volgo-Viatskii Region (Russia) + + Coded [e-urv] (Volgo-Viatskii Region, RSFSR) before Mar. 1988 + + + + R.S.F.S.R. + + + Russian Republic + + + Russian S.F.S.R. + + + Russian Soviet Federated Socialist Republic + + + + info:lc/vocabulary/gacs/e-urf + Russian Far East (Russia) + e-urf + + Far East (Russia) + + + Far Eastern Region (Russia) + + + Soviet Far East (Russia) + + Coded [e-uro] (Soviet Central Asia) before 1994 + + + + + info:lc/vocabulary/gacs/f-rw + Rwanda + f-rw + + Ruanda-Urundi + + + German East Africa + + + + info:lc/vocabulary/gacs/nwsd + Saba (Netherlands Antilles) + nwsd + + + info:lc/vocabulary/gacs/fd + Sahara + fd + + Sahara Desert + + + + info:lc/vocabulary/gacs/lsxj + Saint Helena + lsxj + + St. Helena + + + + info:lc/vocabulary/gacs/nwxi + Saint Kitts and Nevis + nwxi + + Nevis + + + Saint Kitts + + + Saint Kitts-Nevis-Anguilla + + St. Christopher-Nevis-Anguilla + + + + Saint Christopher and Nevis + + + + info:lc/vocabulary/gacs/nwxk + Saint Lucia + nwxk + + St. Lucia + + + + info:lc/vocabulary/gacs/nwst + Saint Martin (West Indies) + nwst + + Sint Maarten (West Indies) + + + St. Martin (West Indies) + + + + info:lc/vocabulary/gacs/n-xl + Saint Pierre and Miquelon + n-xl + + Miquelon + + + Iles Saint-Pierre et Miquelon + + + St. Pierre and Miquelon + + + + info:lc/vocabulary/gacs/nwxm + Saint Vincent and the Grenadines + nwxm + + Grenadines (Saint Vincent and the Grenadines and Grenada) + + + Saint Vincent + + St. Vincent + + + + + info:lc/vocabulary/gacs/pows + Samoa + pows + + Western Samoa + + + + info:lc/vocabulary/gacs/posh + Samoan Islands + posh + + Samoa (Islands) + + + + info:lc/vocabulary/gacs/e-sm + San Marino + e-sm + + + info:lc/vocabulary/gacs/f-sf + Sao Tome and Principe + f-sf + + São Thomé e Pr¡ncipe + + + + info:lc/vocabulary/gacs/n-cn-sn + Saskatchewan + n-cn-sn + + + info:lc/vocabulary/gacs/zsa + Saturn (Planet) + zsa + + + info:lc/vocabulary/gacs/a-su + Saudi Arabia + a-su + + + info:lc/vocabulary/gacs/ev + Scandinavia + ev + + + info:lc/vocabulary/gacs/e-uk-st + Scotland + e-uk-st + + Shetland (Scotland) + + + Orkney (Scotland) + + + + info:lc/vocabulary/gacs/f-sg + Senegal + f-sg + + + info:lc/vocabulary/gacs/e-rb + Serbia + e-rb + + Coded [e-yu] (Yugoslavia) before April 2007 + + + + info:lc/vocabulary/gacs/i-se + Seychelles + i-se + + + info:lc/vocabulary/gacs/a-cc-ss + Shaanxi Sheng (China) + a-cc-ss + + Shensi Province (China) + + + + info:lc/vocabulary/gacs/a-cc-sp + Shandong Sheng (China) + a-cc-sp + + Shantung Province (China) + + + + info:lc/vocabulary/gacs/a-cc-sm + Shanghai (China) + a-cc-sm + + + info:lc/vocabulary/gacs/a-cc-sh + Shanxi Sheng (China) + a-cc-sh + + Shansi Province (China) + + + + info:lc/vocabulary/gacs/e-urs + Siberia (Russia) + e-urs + + Siberia, Northeastern (Russia) + + + Siberia, Northwestern (Russia) + + + + info:lc/vocabulary/gacs/e-ure + Siberia, Eastern (Russia) + e-ure + + East Siberian Region (Russia) + + + Eastern Siberia (Russia) + + + + info:lc/vocabulary/gacs/e-urw + Siberia, Western (Russia) + e-urw + + Western Siberia (Russia) + + + + info:lc/vocabulary/gacs/a-cc-sz + Sichuan Sheng (China) + a-cc-sz + + Szechwan Province (China) + + + + info:lc/vocabulary/gacs/f-sl + Sierra Leone + f-sl + + + info:lc/vocabulary/gacs/a-si + Singapore + a-si + + Straits Settlements + + + + info:lc/vocabulary/gacs/nweu + Sint Eustatius (Netherlands Antilles) + nweu + + Saint Eustatius (Netherlands Antilles) + + + St. Eustatius (Netherlands Antilles) + + + Statia (Netherlands Antilles) + + + + info:lc/vocabulary/gacs/e-xo + Slovakia + e-xo + + Coded [e-cs] (Czechoslovakia) before May 1993 + + + Slovak Socialist Republic (Czechoslovakia) + + + + info:lc/vocabulary/gacs/e-xv + Slovenia + e-xv + + Coded [e-yu] (Yugoslavia) before Oct. 1992 + + + + info:lc/vocabulary/gacs/zs + Solar system + zs + + + info:lc/vocabulary/gacs/pobp + Solomon Islands + pobp + + Coded also [posn] (Solomon Islands) before Mar. 1988 + + + Guadalcanal (Solomon Islands) + + + Santa Cruz Islands (Solomon Islands) + + Coded [posc] (Santa Cruz Islands) before Mar. 1988 + + + + British Solomon Islands + + + + info:lc/vocabulary/gacs/f-so + Somalia + f-so + + British Somaliland + + + Italian Somaliland + + + Somali Republic + + + + info:lc/vocabulary/gacs/f-sa + South Africa + f-sa + + Bophuthatswana (South Africa) + + + Homelands (South Africa) + + + Prince Edward Islands + + Froides, Îles + + + Îles Froides + + + + Africa, South + + + Union of South Africa + + + + info:lc/vocabulary/gacs/s + South America + s + + America + + + + info:lc/vocabulary/gacs/az + South Asia + az + + East Indies + + Indies, East + + + + Asia, South + + + + info:lc/vocabulary/gacs/ls + South Atlantic Ocean + ls + + Guinea, Gulf of + + Gulf of Guinea + + + + + info:lc/vocabulary/gacs/u-at-sa + South Australia + u-at-sa + + + info:lc/vocabulary/gacs/n-us-sc + South Carolina + n-us-sc + + + info:lc/vocabulary/gacs/ao + South China Sea + ao + + Islands of the South China Sea + + + + info:lc/vocabulary/gacs/n-us-sd + South Dakota + n-us-sd + + + info:lc/vocabulary/gacs/lsxs + South Georgia and South Sandwich Islands + lsxs + + Coded [lsfk] (Falkland Islands) before Oct. 1992 + + + Sandwich Islands, South + + Coded [lsfk] (Falkland Islands) before Oct. 1992 + + + + South Sandwich Islands + + Coded [lsfk] (Falkland Islands) before Oct. 1992 + + + + + info:lc/vocabulary/gacs/ps + South Pacific Ocean + ps + + Arafura Sea + + + Pacific Ocean, South + + + + info:lc/vocabulary/gacs/as + Southeast Asia + as + + East Indies + + Indies, East + + + + Malay Archipelagon + + + Asia, Southeastern + + + Southeastern Asia + + + + info:lc/vocabulary/gacs/xc + Southern Hemisphere + xc + + + info:lc/vocabulary/gacs/n-usu + Southern States + n-usu + + Confederate States of America + + + Cumberland Mountains + + + Gulf States + + + South Atlantic States + + Atlantic States, South + + + + Southwest, Old + + + Southwestern States + + + Sunbelt States + + + + info:lc/vocabulary/gacs/n-ust + Southwest, New + n-ust + + Southwestern States + + + Sunbelt States + + + + info:lc/vocabulary/gacs/e-ur + Soviet Union + e-ur + + Communist countries + + Coded [v] (Communist countries) before June 1998 + + + + Russia + + Russian Empire + + + + Soviet Union, Southern + + Southern Soviet Union + + + + Soviet Union, Western + + Western Soviet Union + + + + Commonwealth of Independent States countries + + + Former Soviet republics + + + U.S.S.R. + + + + info:lc/vocabulary/gacs/e-urn + Soviet Union, Northwestern + e-urn + + Northwestern Soviet Union + + + + info:lc/vocabulary/gacs/e-sp + Spain + e-sp + + Balearic Islands (Spain) + + + Iberian Peninsula + + Coded [ei] (Iberian Peninsula) before Mar. 1988 + + + + Islamic Empire + + + + info:lc/vocabulary/gacs/f-sh + Spanish North Africa + f-sh + + Ceuta (Spain) + + + Melilla (Spain) + + + Spanish Territories in Northern Morocco + + + + info:lc/vocabulary/gacs/aoxp + Spratly Islands + aoxp + + Nansha Islands + + + Shinnan Islands + + + + info:lc/vocabulary/gacs/a-ce + Sri Lanka + a-ce + + Ceylon + + + + info:lc/vocabulary/gacs/f-sj + Sudan + f-sj + + Anglo-Egyptian Sudan + + + + info:lc/vocabulary/gacs/fn + Sudan (Region) + fn + + + info:lc/vocabulary/gacs/fu + Suez Canal (Egypt) + fu + + + info:lc/vocabulary/gacs/zsu + Sun + zsu + + + info:lc/vocabulary/gacs/s-sr + Suriname + s-sr + + Dutch Guiana + + + Guiana, Dutch + + + Surinam + + + + info:lc/vocabulary/gacs/lnsb + Svalbard (Norway) + lnsb + + Bear Island (Norway) + + Bjørnøya (Norway) + + + + Spitsbergen Island (Norway) + + West Spitsbergen (Norway) + + + + + info:lc/vocabulary/gacs/nwsv + Swan Islands (Honduras) + nwsv + + + info:lc/vocabulary/gacs/f-sq + Swaziland + f-sq + + + info:lc/vocabulary/gacs/e-sw + Sweden + e-sw + + Lapland + + + + info:lc/vocabulary/gacs/e-sz + Switzerland + e-sz + + + info:lc/vocabulary/gacs/a-sy + Syria + a-sy + + United Arab Republic + + + + info:lc/vocabulary/gacs/a-ch + Taiwan + a-ch + + Pescadores Islands + + + Pratas Islands + + + Formosa + + + + info:lc/vocabulary/gacs/a-ta + Tajikistan + a-ta + + Coded [e-ur-ta] (Tajikistan) before June 1998 + + + Tadzik Soviet Socialist Republic + + + Tajik S.S.R. + + + + info:lc/vocabulary/gacs/f-tz + Tanzania + f-tz + + Pemba Island (Tanzania) + + Huthera (Tanzania) + + + + Tanganyika + + + Zanzibar + + + German East Africa + + + + info:lc/vocabulary/gacs/u-at-tm + Tasmania + u-at-tm + + + info:lc/vocabulary/gacs/n-us-tn + Tennessee + n-us-tn + + + info:lc/vocabulary/gacs/i-fs + Terres australes et antarctiques françaises + i-fs + + Kerguelen Islands + + Desolation Islands + + + Îles Kerguélen + + + + French Southern and Antarctic Lands + + + French Southern Indian Ocean Islands + + + Indian Ocean Islands, French + + + T.A.A.F. + + + + info:lc/vocabulary/gacs/n-us-tx + Texas + n-us-tx + + + info:lc/vocabulary/gacs/a-th + Thailand + a-th + + Malay Peninsula + + + Siam + + + + info:lc/vocabulary/gacs/af + Thailand, Gulf of + af + + Gulf of Thailand + + + Siam, Gulf of + + + + info:lc/vocabulary/gacs/a-cc-tn + Tianjin (China) + a-cc-tn + + Tientsin (China) + + + + info:lc/vocabulary/gacs/a-cc-ti + Tibet (China) + a-cc-ti + + Tibetan Autonomous Region (China) + + + + info:lc/vocabulary/gacs/at + Tien Shan + at + + Thian Shan + + + Tian Shan + + + Tien Mountains + + + + info:lc/vocabulary/gacs/f-tg + Togo + f-tg + + Togoland + + + French Togoland + + + Togoland (French) + + + + info:lc/vocabulary/gacs/potl + Tokelau + potl + + Union Islands + + + + info:lc/vocabulary/gacs/poto + Tonga + poto + + Friendly Islands + + + Tonga Islands + + + + info:lc/vocabulary/gacs/nwtr + Trinidad and Tobago + nwtr + + Tobago + + + Trinidad + + + + info:lc/vocabulary/gacs/lstd + Tristan da Cunha + lstd + + + info:lc/vocabulary/gacs/w + Tropics + w + + Equator + + + + info:lc/vocabulary/gacs/f-ti + Tunisia + f-ti + + + info:lc/vocabulary/gacs/a-tu + Turkey + a-tu + + Aegean Islands (Greece and Turkey) + + Islands of the Aegean + + + + Aegean Sea + + + Armenia + + + Asia Minor + + + + info:lc/vocabulary/gacs/a-tk + Turkmenistan + a-tk + + Coded [e-ur-tk] (Turkmenistan) before June 1998 + + + Turkmen S.S.R. + + + + info:lc/vocabulary/gacs/nwtc + Turks and Caicos Islands + nwtc + + Caicos Islands + + + + info:lc/vocabulary/gacs/potv + Tuvalu + potv + + Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 + + + Gilbert and Ellice Islands Colony + + Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 + + + + Ellice Islands + + + + info:lc/vocabulary/gacs/f-ug + Uganda + f-ug + + + info:lc/vocabulary/gacs/e-un + Ukraine + e-un + + Coded [e-ur-un] (Ukraine) before June 1998 + + + Kievan Rus + + Coded [e-ur] (Soviet Union) before June 1998 + + + + + info:lc/vocabulary/gacs/a-ts + United Arab Emirates + a-ts + + Abū Ẓaby (United Arab Emirates: Emirate) + + Abu Dhabi (United Arab Emirates : Emirate) + + + + Dubayy (United Arab Emirates : Emirate) + + Dubai + + + + Trucial States + + + + info:lc/vocabulary/gacs/n-us + United States + n-us + + Atlantic Coast (U.S.) + + + Atlantic States + + + Saint Lawrence River + + + Snowbelt States + + Frostbelt (U.S.) + + + + + info:lc/vocabulary/gacs/nwuc + United States Miscellaneous Caribbean Islands + nwuc + + Caribbean Island Dependencies of the United States + + + Island Dependencies of the United States in the Caribbean + + + + info:lc/vocabulary/gacs/poup + United States Miscellaneous Pacific Islands + poup + + Includes American Samoa, Guam, Pacific Islands (Trust Territory) treated + collectively + + + + Pacific Islands (Trust Territory) + + Pacific Islands (Ter.) + + + Trust Territory of the Pacific Islands + + + + Island Dependencies of the United States in the Pacific + + + Pacific Island Dependencies of the United States + + + + info:lc/vocabulary/gacs/e-uru + Ural Mountains (Russia) + e-uru + + + info:lc/vocabulary/gacs/zur + Uranus (Planet) + zur + + + info:lc/vocabulary/gacs/s-uy + Uruguay + s-uy + + + info:lc/vocabulary/gacs/n-us-ut + Utah + n-us-ut + + + info:lc/vocabulary/gacs/a-uz + Uzbekistan + a-uz + + Coded [e-ur-uz] (Uzbekistan) before June 1998 + + + Uzbek S.S.R. + + + + info:lc/vocabulary/gacs/ponn + Vanuatu + ponn + + Banks Islands (Vanuatu) + + + New Hebrides + + + Republic of Vanuatu + + + + info:lc/vocabulary/gacs/e-vc + Vatican City + e-vc + + Holy See + + + + info:lc/vocabulary/gacs/s-ve + Venezuela + s-ve + + + info:lc/vocabulary/gacs/zve + Venus (Planet) + zve + + + info:lc/vocabulary/gacs/n-us-vt + Vermont + n-us-vt + + + info:lc/vocabulary/gacs/u-at-vi + Victoria + u-at-vi + + + info:lc/vocabulary/gacs/a-vt + Vietnam + a-vt + + Vietnam (Democratic Republic) + + Coded [a-vn] (Vietnam, North) before Mar. 1988 + + + North Vietnam + + + Vietnam, North + + + + Vietnam (Republic) + + Coded [a-vs] (Viet Nam, South) before Mar. 1988 + + + South Vietnam + + + Vietnam, South + + + + + info:lc/vocabulary/gacs/nwvi + Virgin Islands of the United States + nwvi + + Virgin Islands + + Coded [nwvr] (Virgin Islands) before Mar. 1988 + + + + Virgin Islands (American) + + + Virgin Islands (Danish) + + + + info:lc/vocabulary/gacs/n-us-va + Virginia + n-us-va + + Chesapeake Bay (Md. and Va.) + + + Washington Region + + + + info:lc/vocabulary/gacs/e-urp + Volga River (Russia) + e-urp + + + info:lc/vocabulary/gacs/fv + Volta River (Ghana) + fv + + + info:lc/vocabulary/gacs/powk + Wake Island + powk + + + info:lc/vocabulary/gacs/e-uk-wl + Wales + e-uk-wl + + + info:lc/vocabulary/gacs/powf + Wallis and Futuna Islands + powf + + Futuna Islands (Wallis and Futuna Islands) + + + Uvea Island (Wallis and Futuna Islands) + + + + info:lc/vocabulary/gacs/n-us-dc + Washington (D.C.) + n-us-dc + + Washington Region + + + District of Columbia + + + + info:lc/vocabulary/gacs/n-us-wa + Washington (State) + n-us-wa + + Pacific States + + + + info:lc/vocabulary/gacs/n-usp + West (U.S.) + n-usp + + Colorado River (Colo.-Mexico) + + + Great Basin + + + Northwest, Pacific + + Northwest (U.S.) + + + Pacific Northwest + + + + Northwestern States + + + Far West (U.S.) + + + Pacific and Mountain States + + + Western States (U.S.) + + + + info:lc/vocabulary/gacs/awba + West Bank + awba + + Coded [a-is] (Israel) and/or [a-jo] (Jordan) before Mar. 1988 + + + Jerusalem + + + Palestine + + + Judaea and Samaria + + + West Bank of the Jordan River + + + + info:lc/vocabulary/gacs/nw + West Indies + nw + + Antilles, Greater + + Coded [nwga] (Greater Antilles) before Mar. 1988 + + + + Greater Antilles + + Coded [nwga] (Greater Antilles) before Mar. 1988 + + + + Indies, West + + + + info:lc/vocabulary/gacs/n-us-wv + West Virginia + n-us-wv + + + info:lc/vocabulary/gacs/u-at-we + Western Australia + u-at-we + + Australia, Western + + + + info:lc/vocabulary/gacs/xd + Western Hemisphere + xd + + + info:lc/vocabulary/gacs/f-ss + Western Sahara + f-ss + + Spanish Sahara + + + + info:lc/vocabulary/gacs/nwwi + Windward Islands (West Indies) [nwwi] + nwwi + + + info:lc/vocabulary/gacs/n-us-wi + Wisconsin + n-us-wi + + + info:lc/vocabulary/gacs/n-us-wy + Wyoming + n-us-wy + + + info:lc/vocabulary/gacs/a-ccs + Xi River (China) + a-ccs + + Hsi Chiang (China) + + + Si Kiang (China) + + + Si River (China) + + + West River (China) + + + + info:lc/vocabulary/gacs/a-cc-su + Xinjiang Uygur Zizhiqu (China) + a-cc-su + + Hsin-chiang-wei-wy-erh tzu chin chü (China) + + + Sinkiang Uighur Autonomous Region (China) + + + + info:lc/vocabulary/gacs/a-ccg + Yangtze River (China) + a-ccg + + Chang Chiang (China) + + + Long River (China) + + + + info:lc/vocabulary/gacs/a-ccy + Yellow River (China) + a-ccy + + Hoang Ho (China) + + + Huang Ho (China) + + + Hwang Ho (China) + + + + info:lc/vocabulary/gacs/ay + Yellow Sea + ay + + Huang Hai + + + Kwang Sea + + + + info:lc/vocabulary/gacs/a-ye + Yemen (Republic) + a-ye + + Aden + + Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992] + + + + Aden (Protectorate) + + Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992 + + + + Arabia, Southern + + + Federation of South Arabia + + South Arabia, Federation of + + + + Socotra (Yemen) + + Coded [i-xo] (Socotra Island) before Mar. 1988; Coded [a-ys] (Yemen (People's + Democratic Republic) before Oct. 1992 + + + + Sokotra (Yemen) + + + + Arab Republic of Yemen + + + People's Democratic Republic of Yemen + + + Southern Yemen + + + Yemen (Arab Republic) + + + Yemen (People's Democratic Republic) + + Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992 + + + + + info:lc/vocabulary/gacs/e-yu + Yugoslavia + e-yu + + Pannonia + + + Former Yugoslav republics + + + + info:lc/vocabulary/gacs/n-cn-yk + Yukon Territory + n-cn-yk + + + info:lc/vocabulary/gacs/a-cc-yu + Yunnan Sheng (China) + a-cc-yu + + Yunnan Province (China) + + + + info:lc/vocabulary/gacs/fz + Zambezi River + fz + + Rio Zambezi + + + + info:lc/vocabulary/gacs/f-za + Zambia + f-za + + Rhodesia + + + Rhodesia and Nyasaland + + Federation of Rhodesia and Nyasaland + + + + Northern Rhodesia + + + + info:lc/vocabulary/gacs/a-cc-ch + Zhejiang Sheng (China) + a-cc-ch + + Chekiang Province (China) + + + + info:lc/vocabulary/gacs/f-rh + Zimbabwe + f-rh + + Rhodesia + + + Rhodesia and Nyasaland + + Federation of Rhodesia and Nyasaland + + + + Rhodesia, Southern + + + Southern Rhodesia + + + diff --git a/form_elements/xml/languages.xml b/form_elements/xml/languages.xml index ef5e8eb3..bfade2bd 100644 --- a/form_elements/xml/languages.xml +++ b/form_elements/xml/languages.xml @@ -6,19570 +6,19572 @@ xmlns="info:lc/xmlns/codelist-v1" xsi:schemaLocation="info:lc/xmlns/codelist-v1 http://www.loc.gov/standards/codelists/codelist.xsd"> - iso639-2b - MARC Code List for Languages - Network Development and MARC Standards Office, Library of Congress - info:lc/vocabulary/languages + iso639-2b + MARC Code List for Languages + Network Development and MARC Standards Office, Library of Congress + info:lc/vocabulary/languages - - - info:lc/vocabulary/languages/abk - Abkhaz - abk - - - info:lc/vocabulary/languages/ace - Achinese - ace - - Atjeh - - - - info:lc/vocabulary/languages/ach - Acoli - ach - - Acholi - - - Gang - - - Lwo - - - Shuli - - - - info:lc/vocabulary/languages/ada - Adangme - ada - - Dangme - - - - info:lc/vocabulary/languages/ady - Adygei - ady - - Circassian, Lower - - - Circassian, West - - - Kiakh - - - Kjax - - - Lower Circassian - - - West Circassian - - - - info:lc/vocabulary/languages/aar - Afar - aar - - Adaiel - - - Danakil - - - - info:lc/vocabulary/languages/afh - Afrihili (Artificial language) - afh - - - info:lc/vocabulary/languages/afr - Afrikaans - afr - - Afrikander - - - Cape Dutch - - - - info:lc/vocabulary/languages/afa - Afroasiatic (Other) - afa - - Angas - - Karan - - - Karang (Nigeria) - - - Ngas - - - - Bidiyo - - - Daba (Cameroon and Nigeria) - - - Dangaleat - - - Day (Chad) - - Dari (Chad) - - - Sara Dai - - - - Gabri - - - Gamo (Ethiopia) - - Gemu - - - - Glavda - - - Goemai - - Ankwe - - - Gamai (Nigeria) - - - Kemai - - - - Gude - - - Guruntum-Mbaaru - - Gurdung - - - Guruntum - - - - Hedi - - Hdi - - - - Huba - - Chobba - - - Kilba - - - - Jongor - - Dionkor - - - Djongor - - - - Kamwe - - Higi - - - Higgi - - - Hiji - - - Vacamwe - - - - Kanakuru - - Dera - - - - Kapsiki - - Kamsiki - - - Psikye - - - Ptsake - - - - Kera - - - Mada (Cameroon) - - - Mafa - - Matakam - - - Natakan - - - - Male (Ethiopia) - - Maale - - - - Masa (Chadic) - - Banaa - - - Banana (Masa) - - - Masana - - - Massa - - - Walai - - - - Miya - - - Musgu - - Masa - - - - Nancere - - - Ngizim - - Gwazum - - - Kirdiwat - - - Nugzum - - - Walu - - - - Paduko - - Podoko - - - - Ron - - Chala - - - Run - - - - Saya - - Sayanci - - - Sayara - - - Sayawa - - - Seiyara - - - Seya - - - Seyawa - - - - Southern Mofu - - Mofu, Southern - - - Mofu-Gudur - - - - Tera - - - Tumak - - Maga - - - Sara Toumak - - - Toumak - - - - Tupuri - - Ndore - - - Tuburi - - - - Uldeme - - Mizlime - - - Ouldémé - - - Udlam - - - Uzlam - - - Uzan - - - Wuzlam - - - - Wandala - - Mandara - - - - Yemsa - - Janjero - - - - Zaar - - Vigzar - - - Vikzar - - - - Zulgo - - Zelgwa - - - - - info:lc/vocabulary/languages/ain - Ainu - ain - - - info:lc/vocabulary/languages/aka - Akan - aka - - Twi-Fante - - - - info:lc/vocabulary/languages/akk - Akkadian - akk - - Assyro-Babylonian - - - Babylonian - - - - info:lc/vocabulary/languages/alb - Albanian - alb - - Calabrian Albanian - - Albanian, Calabrian - - - - - info:lc/vocabulary/languages/ale - Aleut - ale - - Eleuth - - - - info:lc/vocabulary/languages/alg - Algonquian (Other) - alg - - Abenaki - - Abnaki - - - - Algonquin - - Algonkin - - - - Atakapa - - - Atikamekw - - Attikamekw - - - Tête-de-Boule - - - - Fox - - - Illinois - - - Kickapoo - - - Mahican - - - Massachuset - - Natick - - - Niantic - - - Nonantum - - - - Menominee - - - Miami (Ind. and Okla.) - - - Mohegan - - Pequot - - - - Montagnais - - Innu (Montagnais) - - - Montagnais Innu - - - Montagnar - - - Montagnard - - - Montagnie - - - Mountainee - - - - Naskapi - - Nascapee - - - Naskapee - - - - Passamaquoddy - - Etchemin - - - Malecite - - - - Penobscot - - - Potawatomi - - - Powhatan - - - Quileute - - - Roanoak - - - Shawnee - - - Wampanoag - - - Yurok - - - - info:lc/vocabulary/languages/ajm - Aljamía - ajm - - - info:lc/vocabulary/languages/alt - Altai - alt - - Oirat (Turkic) - - - Southern Altai - - - - info:lc/vocabulary/languages/tut - Altaic (Other) - tut - - Turko-Tataric (Other) - - - Bulgaro-Turkic - - Turko-Bulgarian - - - (Altaic (Other)) - - - - Dagur - - Daghur - - - Daur - - - - Dolgan - - - Even - - Lamut - - - - Evenki - - O-wen-k`o - - - Tungus - - - - Gagauz - - - Greek Tatar - - Urum - - - - Karaim - - - Karakhanid - - Khakani - - - Qarakhanid - - - - Khakass - - Xakas - - - Xaqas - - - - Khalaj - - - Khitan - - Kitan - - - Liao - - - - Khorezmian Turkic - - Khwarezmian Turkic - - - - Kipchak - - Coman - - - Cuman - - - Falven - - - Kuman - - - Polovtsi - - - Walwen - - - - Moghol - - Mogol - - - - Mongolian, Middle (13th-16th centuries) - - Middle Mongolian (13th-16th centuries) - - - - Mongour - - Tu - - - - Nanai - - Goldi - - - - Northern Altai - - Altai, Northern - - - - Olcha - - Ulcha - - - - Old Turkic - - Turkic, Old - - - - Oroch - - - Oroqen - - Orochon - - - - Salar - - - Shor - - - Sibo - - Xive - - - - Teleut - - - Turkish, Old (to 1500) - - Anatolian Turkish, Old - - - Old Anatolian Turkish - - - Old Ottoman Turkish - - - Old Turkish - - - Ottoman Turkish, Old - - - - Udekhe - - - Western Yugur - - Yugur, Western - - - - - info:lc/vocabulary/languages/amh - Amharic - amh - - Amarigna - - - Amarinya - - - - info:lc/vocabulary/languages/anp - Angika - anp - - Anga - - - - info:lc/vocabulary/languages/apa - Apache languages - apa - - Chiricahua - - - Mescalero - - - White Mountain Apache - - - - info:lc/vocabulary/languages/ara - Arabic - ara - - Hassaniyya - - - - info:lc/vocabulary/languages/arg - Aragonese - arg - - Altoaragonés - - - Aragoieraz - - - Aragonés - - - Fabla Aragonesa - - - High Aragonese - - - Patués - - - Spanish, Aragonese - - - - info:lc/vocabulary/languages/arc - Aramaic - arc - - Aramean - - - Biblical Aramaic - - - Chaldaic - - - Chaldean (Aramaic) - - - Chaldee - - - - info:lc/vocabulary/languages/arp - Arapaho - arp - - - info:lc/vocabulary/languages/arw - Arawak - arw - - Loko (Arawakan) - - - Lokono - - - - info:lc/vocabulary/languages/arm - Armenian - arm - - Khayasa - - Hayasa - - - Khaiass - - - - - info:lc/vocabulary/languages/rup - Aromanian - rup - - Macedo-Romanian - - - - info:lc/vocabulary/languages/art - Artificial (Other) - art - - Ande (Artificial language) - - - Babm - - - Balaibalan - - Bâl-i bîlen - - - Bala-i-balan - - - Balabalan - - - Bâleybelen - - - Bali belen - - - Bâlibîlen - - - - Enochian - - - Europanto - - - Glosa (Artificial language) - - - International auxiliari linguo (Artificial language) - - INTAL (Artificial language) - - - - Loglan (Artificial language) - - - Neo (Artificial language) - - - Novial (Artificial language) - - - Tsolyáni (Artificial language) - - - Vela (Artificial language) - - - - info:lc/vocabulary/languages/asm - Assamese - asm - - Kāmrūpī - - - Rābhāmija - - Rābhāmiz - - - - - info:lc/vocabulary/languages/ath - Athapascan (Other) - ath - - Ahtena - - - Carrier - - Takulli - - - - Chilcotin - - Tsilkotin - - - - Dena'ina - - Tanaina - - - - Kaska - - - Kiowa Apache - - - Koyukon - - - Sarsi - - - Sekani-Beaver - - - Southern Tutchone - - Tutchone, Southern - - - - Tagish - - - Tahltan - - - Tanacross - - - Tsattine - - - Upper Tanana - - Tanana, Upper - - - - Upper Umpqua - - - - info:lc/vocabulary/languages/aus - Australian languages - aus - - Adnyamathanha - - Atynyamatana - - - Wailpi - - - - Alawa - - Galawa - - - - Alyawarra - - Iliaura - - - - Anindilyakwa - - Andilyaugwa - - - - Awabakal - - - Bandjalang - - Minyung - - - - Bidjara - - Pitjara - - - - Biri (Australia) - - Birri (Australia) - - - - Burarra - - Bara (Australia) - - - Jikai - - - Tchikai - - - - Butchulla - - - Darling River dialects - - Bagandji dialects - - - - Dhungutti - - Daingatti - - - Dyangadi - - - Thangatti - - - - Djaru - - Jaroo - - - Tjaru - - - - Djinang - - Jandjinung - - - Yandjinung - - - - Djingili - - Jingulu - - - Tjingili - - - - Eastern Arrernte - - Aranda, Eastern - - - Arrernte, Eastern - - - - Garawa - - Karawa (Australia) - - - Korrawa - - - Kurrawar - - - Leearrawa - - - - Gidabal - - Kitabul - - - - Gubbi-Gubbi - - Kabi Kabi - - - - Gugada - - Kukota - - - - Gumatj - - Gomadj - - - Kainyao - - - Komaits - - - Kumait - - - - Gungabula - - Kongabula - - - - Gunian - - Gooniyandi - - - - Gunwinggu - - - Gupapuyngu - - - Guugu Yimithirr - - - Iwaidja - - Jiwadja - - - Yiwadja - - - - Kala Lagaw Ya - - Mabuiaq - - - - Kalkatungu - - Galgadung - - - - Kattang - - Kutthung - - - - Kitja - - Gidja - - - Kija - - - - Kuku-Yalanji - - Gugu Yalanji - - - Koko Jelandji - - - - Kuuku Ya'u - - Koko Ya'o - - - - Kwini - - Belaa - - - Cuini - - - Goonan - - - Gunin - - - Gwiini - - - Gwini - - - Kunan (Kwini) - - - Kwini/Belaa - - - Wunambal (Kwini) - - - - Malgana - - Maldjana - - - Maljanna - - - Malkana - - - - Mandjildjara - - Mantjiltjara - - - - Mangarayi - - Manggarai (Australia) - - - Mungerry - - - - Maranunggu - - - Martu Wangka - - - Murrinhpatha - - - Nakara - - - Narangga - - Narungga - - - - Narrinyeri - - - Ngaanyatjarra - - - Ngandi - - - Ngarinyin - - Ungarinjin - - - Wungarinjin - - - - Ngarla - - - Ngarluma - - - Nukunu - - Nugunu - - - - Nunggubuyu - - Wubuy - - - - Pintupi - - Bindubi - - - - Pitjantjatjara - - - Proto Mirndi - - - Ritharrngu - - - Tharrkari - - Dhargari - - - - Tiwi (Australia) - - - Umpila - - - Walmajarri - - - Wandarang - - Andarang - - - Nawariyi - - - - Wanʼguri - - Wonguri - - - - Warlpiri - - Elpira - - - Ilpara - - - Ngaliya - - - Ngardilpa - - - Wailbri - - - Walbiri - - - Waljbiri - - - Walmama - - - Walpiri - - - Warnayaka - - - Warrmarla - - - - Warumungu - - - Western Arrernte - - Aranda, Western - - - Arrernte, Western - - - - Western Desert - - - Wik-Munkan - - Munggan - - - - Wik-Ngathan - - Wik-Ngathana - - - - Worora - - - Wunambal - - Jeidji - - - Jeithi - - - Unambal - - - Wumnabal - - - Wunambullu - - - Yeidji - - - Yeithi - - - - Yandruwandha - - - Yanyuwa - - - Yawuru - - Jaudjibara - - - Jawadjag - - - Jawdjibaia - - - Jawdjibara - - - Winjawindjagu - - - Yaudijbaia - - - Yaudjibara - - - Yawjibara - - - - Yidiny - - - Yindjibarndi - - Jindjibandji - - - - Yinhawangka - - Inawonga - - - - Yualyai - - Euahlayi - - - Jualjai - - - Ualari - - - Uollaroi - - - Wallaroi - - - Yerraleroi - - - Yowalri - - - Yuwaalaraay - - - - Yugambeh - - - - info:lc/vocabulary/languages/map - Austronesian (Other) - map - - Malayo-Polynesian (Other) - - - Adzera - - Acira - - - Atsera - - - Atzera - - - - Ajie - - Houailou - - - Wailu - - - - Ambrym - - - Amis - - Ami - - - - Anesu - - Canala - - - Kanala - - - Xaracuu - - - Yaracuu - - - - Apma - - - Areare - - - Arop-Lokep - - Lokep - - - Lokewe - - - - Arosi - - - Atayal - - Tayal - - - - Bajau - - Badjo - - - Bayo - - - Luaan - - - Orang Laut (Indonesia) - - - Sama (Indonesia) - - - Turije̕ne̕ - - - - Bakumpai - - - Balaesang - - Balaisang - - - Pajo - - - - Banjar Hulu - - Hulu - - - - Barangas - - Alalak - - - - Bareë - - - Begak - - - Berawan - - - Biliau - - - Bimanese - - - Bolaang Mongondow - - - Buang - - - Bugotu - - Mahaga - - - - Bukar Sadong - - Sadong - - - Serian - - - Tebakang - - - - Bunama - - - Bunun - - - Buol - - Bual - - - Bwuolo - - - Dia - - - - Bwaidoga - - - Bwatoo - - - Camuhi - - Cemuhi - - - Tyamuhi - - - Wagap - - - - Carolinian - - - Daa - - Pekawa - - - - Dawawa - - - Dehu - - Drehu - - - Lifu - - - Miny - - - - Dobel - - Kobroor - - - - Dobu - - - Dumbea - - Drubea - - - - Dusun - - Kadazan - - - - East Makian - - Inner Makian - - - Makian, East - - - Makian, Inner - - - Taba - - - - East Uvean - - Uvean, East - - - Wallisian - - - - Enggano - - Etaka - - - - Enim - - - Eromanga - - Sie - - - Sye - - - - Favorlang - - Babuza - - - - Futuna-Aniwa - - Erronan - - - West Futuna - - - - Gapapaiwa - - Manape - - - - Gedaged - - Graged - - - - Gumasi - - - Halia - - - Ham - - Dami - - - - Hote - - - Iai (Loyalty Islands) - - - Iamalele - - Yamalele - - - - Ida'an - - - Iduna - - - Irahutu - - - Kaidipang - - - Kaili - - Ledo' - - - Palu - - - - Kaiwa (Papua New Guinea) - - Iwal - - - - Kambera - - - Kapingamarangi - - - Kara (Papua New Guinea) - - Kara-Lemakot - - - Lemakot - - - Lemusmus - - - - Katingan - - - Kaulong - - - Kayan (Borneo) - - - Kayu Agung - - - Kemak - - Ema - - - - Kerinci - - Kinchai - - - Korintje - - - - Kiput - - - Kiriwinian - - Kilivila - - - Trobriand - - - - Koluwawa - - - Komodo - - - Kubu - - - Kuni - - - Kurada - - Auhelawa - - - Cauhelawa - - - Nuakata - - - - Kutai - - Tenggarong - - - - Kwara'ae - - Fiu - - - - Lamenu - - Lamen - - - Lewo (Lamenu) - - - Varmali - - - - Lampung - - Api - - - Lampong - - - - Lau - - - Lavongai - - Dang (Papua New Guinea) - - - Lavangai - - - New Hanover - - - Tungag - - - Tungak - - - - Lembak Bilide - - - Lenakel - - - Lewo - - Varsu - - + + + info:lc/vocabulary/languages/abk + Abkhaz + abk + + + info:lc/vocabulary/languages/ace + Achinese + ace + + Atjeh + + + + info:lc/vocabulary/languages/ach + Acoli + ach + + Acholi + + + Gang + + + Lwo + + + Shuli + + + + info:lc/vocabulary/languages/ada + Adangme + ada + + Dangme + + + + info:lc/vocabulary/languages/ady + Adygei + ady + + Circassian, Lower + + + Circassian, West + + + Kiakh + + + Kjax + + + Lower Circassian + + + West Circassian + + + + info:lc/vocabulary/languages/aar + Afar + aar + + Adaiel + + + Danakil + + + + info:lc/vocabulary/languages/afh + Afrihili (Artificial language) + afh + + + info:lc/vocabulary/languages/afr + Afrikaans + afr + + Afrikander + + + Cape Dutch + + + + info:lc/vocabulary/languages/afa + Afroasiatic (Other) + afa + + Angas + + Karan + + + Karang (Nigeria) + + + Ngas + + + + Bidiyo + + + Daba (Cameroon and Nigeria) + + + Dangaleat + + + Day (Chad) + + Dari (Chad) + + + Sara Dai + + + + Gabri + + + Gamo (Ethiopia) + + Gemu + + + + Glavda + + + Goemai + + Ankwe + + + Gamai (Nigeria) + + + Kemai + + + + Gude + + + Guruntum-Mbaaru + + Gurdung + + + Guruntum + + + + Hedi + + Hdi + + + + Huba + + Chobba + + + Kilba + + + + Jongor + + Dionkor + + + Djongor + + + + Kamwe + + Higi + + + Higgi + + + Hiji + + + Vacamwe + + + + Kanakuru + + Dera + + + + Kapsiki + + Kamsiki + + + Psikye + + + Ptsake + + + + Kera + + + Mada (Cameroon) + + + Mafa + + Matakam + + + Natakan + + + + Male (Ethiopia) + + Maale + + + + Masa (Chadic) + + Banaa + + + Banana (Masa) + + + Masana + + + Massa + + + Walai + + + + Miya + + + Musgu + + Masa + + + + Nancere + + + Ngizim + + Gwazum + + + Kirdiwat + + + Nugzum + + + Walu + + + + Paduko + + Podoko + + + + Ron + + Chala + + + Run + + + + Saya + + Sayanci + + + Sayara + + + Sayawa + + + Seiyara + + + Seya + + + Seyawa + + + + Southern Mofu + + Mofu, Southern + + + Mofu-Gudur + + + + Tera + + + Tumak + + Maga + + + Sara Toumak + + + Toumak + + + + Tupuri + + Ndore + + + Tuburi + + + + Uldeme + + Mizlime + + + Ouldémé + + + Udlam + + + Uzlam + + + Uzan + + + Wuzlam + + + + Wandala + + Mandara + + + + Yemsa + + Janjero + + + + Zaar + + Vigzar + + + Vikzar + + + + Zulgo + + Zelgwa + + + + + info:lc/vocabulary/languages/ain + Ainu + ain + + + info:lc/vocabulary/languages/aka + Akan + aka + + Twi-Fante + + + + info:lc/vocabulary/languages/akk + Akkadian + akk + + Assyro-Babylonian + + + Babylonian + + + + info:lc/vocabulary/languages/alb + Albanian + alb + + Calabrian Albanian + + Albanian, Calabrian + + + + + info:lc/vocabulary/languages/ale + Aleut + ale + + Eleuth + + + + info:lc/vocabulary/languages/alg + Algonquian (Other) + alg + + Abenaki + + Abnaki + + + + Algonquin + + Algonkin + + + + Atakapa + + + Atikamekw + + Attikamekw + + + Tête-de-Boule + + + + Fox + + + Illinois + + + Kickapoo + + + Mahican + + + Massachuset + + Natick + + + Niantic + + + Nonantum + + + + Menominee + + + Miami (Ind. and Okla.) + + + Mohegan + + Pequot + + + + Montagnais + + Innu (Montagnais) + + + Montagnais Innu + + + Montagnar + + + Montagnard + + + Montagnie + + + Mountainee + + + + Naskapi + + Nascapee + + + Naskapee + + + + Passamaquoddy + + Etchemin + + + Malecite + + + + Penobscot + + + Potawatomi + + + Powhatan + + + Quileute + + + Roanoak + + + Shawnee + + + Wampanoag + + + Yurok + + + + info:lc/vocabulary/languages/ajm + Aljamía + ajm + + + info:lc/vocabulary/languages/alt + Altai + alt + + Oirat (Turkic) + + + Southern Altai + + + + info:lc/vocabulary/languages/tut + Altaic (Other) + tut + + Turko-Tataric (Other) + + + Bulgaro-Turkic + + Turko-Bulgarian + + + (Altaic (Other)) + + + + Dagur + + Daghur + + + Daur + + + + Dolgan + + + Even + + Lamut + + + + Evenki + + O-wen-k`o + + + Tungus + + + + Gagauz + + + Greek Tatar + + Urum + + + + Karaim + + + Karakhanid + + Khakani + + + Qarakhanid + + + + Khakass + + Xakas + + + Xaqas + + + + Khalaj + + + Khitan + + Kitan + + + Liao + + + + Khorezmian Turkic + + Khwarezmian Turkic + + + + Kipchak + + Coman + + + Cuman + + + Falven + + + Kuman + + + Polovtsi + + + Walwen + + + + Moghol + + Mogol + + + + Mongolian, Middle (13th-16th centuries) + + Middle Mongolian (13th-16th centuries) + + + + Mongour + + Tu + + + + Nanai + + Goldi + + + + Northern Altai + + Altai, Northern + + + + Olcha + + Ulcha + + + + Old Turkic + + Turkic, Old + + + + Oroch + + + Oroqen + + Orochon + + + + Salar + + + Shor + + + Sibo + + Xive + + + + Teleut + + + Turkish, Old (to 1500) + + Anatolian Turkish, Old + + + Old Anatolian Turkish + + + Old Ottoman Turkish + + + Old Turkish + + + Ottoman Turkish, Old + + + + Udekhe + + + Western Yugur + + Yugur, Western + + + + + info:lc/vocabulary/languages/amh + Amharic + amh + + Amarigna + + + Amarinya + + + + info:lc/vocabulary/languages/anp + Angika + anp + + Anga + + + + info:lc/vocabulary/languages/apa + Apache languages + apa + + Chiricahua + + + Mescalero + + + White Mountain Apache + + + + info:lc/vocabulary/languages/ara + Arabic + ara + + Hassaniyya + + + + info:lc/vocabulary/languages/arg + Aragonese + arg + + Altoaragonés + + + Aragoieraz + + + Aragonés + + + Fabla Aragonesa + + + High Aragonese + + + Patués + + + Spanish, Aragonese + + + + info:lc/vocabulary/languages/arc + Aramaic + arc + + Aramean + + + Biblical Aramaic + + + Chaldaic + + + Chaldean (Aramaic) + + + Chaldee + + + + info:lc/vocabulary/languages/arp + Arapaho + arp + + + info:lc/vocabulary/languages/arw + Arawak + arw + + Loko (Arawakan) + + + Lokono + + + + info:lc/vocabulary/languages/arm + Armenian + arm + + Khayasa + + Hayasa + + + Khaiass + + + + + info:lc/vocabulary/languages/rup + Aromanian + rup + + Macedo-Romanian + + + + info:lc/vocabulary/languages/art + Artificial (Other) + art + + Ande (Artificial language) + + + Babm + + + Balaibalan + + Bâl-i bîlen + + + Bala-i-balan + + + Balabalan + + + Bâleybelen + + + Bali belen + + + Bâlibîlen + + + + Enochian + + + Europanto + + + Glosa (Artificial language) + + + International auxiliari linguo (Artificial language) + + INTAL (Artificial language) + + + + Loglan (Artificial language) + + + Neo (Artificial language) + + + Novial (Artificial language) + + + Tsolyáni (Artificial language) + + + Vela (Artificial language) + + + + info:lc/vocabulary/languages/asm + Assamese + asm + + Kāmrūpī + + + Rābhāmija + + Rābhāmiz + + + + + info:lc/vocabulary/languages/ath + Athapascan (Other) + ath + + Ahtena + + + Carrier + + Takulli + + + + Chilcotin + + Tsilkotin + + + + Dena'ina + + Tanaina + + + + Kaska + + + Kiowa Apache + + + Koyukon + + + Sarsi + + + Sekani-Beaver + + + Southern Tutchone + + Tutchone, Southern + + + + Tagish + + + Tahltan + + + Tanacross + + + Tsattine + + + Upper Tanana + + Tanana, Upper + + + + Upper Umpqua + + + + info:lc/vocabulary/languages/aus + Australian languages + aus + + Adnyamathanha + + Atynyamatana + + + Wailpi + + + + Alawa + + Galawa + + + + Alyawarra + + Iliaura + + + + Anindilyakwa + + Andilyaugwa + + + + Awabakal + + + Bandjalang + + Minyung + + + + Bidjara + + Pitjara + + + + Biri (Australia) + + Birri (Australia) + + + + Burarra + + Bara (Australia) + + + Jikai + + + Tchikai + + + + Butchulla + + + Darling River dialects + + Bagandji dialects + + + + Dhungutti + + Daingatti + + + Dyangadi + + + Thangatti + + + + Djaru + + Jaroo + + + Tjaru + + + + Djinang + + Jandjinung + + + Yandjinung + + + + Djingili + + Jingulu + + + Tjingili + + + + Eastern Arrernte + + Aranda, Eastern + + + Arrernte, Eastern + + + + Garawa + + Karawa (Australia) + + + Korrawa + + + Kurrawar + + + Leearrawa + + + + Gidabal + + Kitabul + + + + Gubbi-Gubbi + + Kabi Kabi + + + + Gugada + + Kukota + + + + Gumatj + + Gomadj + + + Kainyao + + + Komaits + + + Kumait + + + + Gungabula + + Kongabula + + + + Gunian + + Gooniyandi + + + + Gunwinggu + + + Gupapuyngu + + + Guugu Yimithirr + + + Iwaidja + + Jiwadja + + + Yiwadja + + + + Kala Lagaw Ya + + Mabuiaq + + + + Kalkatungu + + Galgadung + + + + Kattang + + Kutthung + + + + Kitja + + Gidja + + + Kija + + + + Kuku-Yalanji + + Gugu Yalanji + + + Koko Jelandji + + + + Kuuku Ya'u + + Koko Ya'o + + + + Kwini + + Belaa + + + Cuini + + + Goonan + + + Gunin + + + Gwiini + + + Gwini + + + Kunan (Kwini) + + + Kwini/Belaa + + + Wunambal (Kwini) + + + + Malgana + + Maldjana + + + Maljanna + + + Malkana + + + + Mandjildjara + + Mantjiltjara + + + + Mangarayi + + Manggarai (Australia) + + + Mungerry + + + + Maranunggu + + + Martu Wangka + + + Murrinhpatha + + + Nakara + + + Narangga + + Narungga + + + + Narrinyeri + + + Ngaanyatjarra + + + Ngandi + + + Ngarinyin + + Ungarinjin + + + Wungarinjin + + + + Ngarla + + + Ngarluma + + + Nukunu + + Nugunu + + + + Nunggubuyu + + Wubuy + + + + Pintupi + + Bindubi + + + + Pitjantjatjara + + + Proto Mirndi + + + Ritharrngu + + + Tharrkari + + Dhargari + + + + Tiwi (Australia) + + + Umpila + + + Walmajarri + + + Wandarang + + Andarang + + + Nawariyi + + + + Wanʼguri + + Wonguri + + + + Warlpiri + + Elpira + + + Ilpara + + + Ngaliya + + + Ngardilpa + + + Wailbri + + + Walbiri + + + Waljbiri + + + Walmama + + + Walpiri + + + Warnayaka + + + Warrmarla + + + + Warumungu + + + Western Arrernte + + Aranda, Western + + + Arrernte, Western + + + + Western Desert + + + Wik-Munkan + + Munggan + + + + Wik-Ngathan + + Wik-Ngathana + + + + Worora + + + Wunambal + + Jeidji + + + Jeithi + + + Unambal + + + Wumnabal + + + Wunambullu + + + Yeidji + + + Yeithi + + + + Yandruwandha + + + Yanyuwa + + + Yawuru + + Jaudjibara + + + Jawadjag + + + Jawdjibaia + + + Jawdjibara + + + Winjawindjagu + + + Yaudijbaia + + + Yaudjibara + + + Yawjibara + + + + Yidiny + + + Yindjibarndi + + Jindjibandji + + + + Yinhawangka + + Inawonga + + + + Yualyai + + Euahlayi + + + Jualjai + + + Ualari + + + Uollaroi + + + Wallaroi + + + Yerraleroi + + + Yowalri + + + Yuwaalaraay + + + + Yugambeh + + + + info:lc/vocabulary/languages/map + Austronesian (Other) + map + + Malayo-Polynesian (Other) + + + Adzera + + Acira + + + Atsera + + + Atzera + + + + Ajie + + Houailou + + + Wailu + + + + Ambrym + + + Amis + + Ami + + + + Anesu + + Canala + + + Kanala + + + Xaracuu + + + Yaracuu + + + + Apma + + + Areare + + + Arop-Lokep + + Lokep + + + Lokewe + + + + Arosi + + + Atayal + + Tayal + + + + Bajau + + Badjo + + + Bayo + + + Luaan + + + Orang Laut (Indonesia) + + + Sama (Indonesia) + + + Turije̕ne̕ + + + + Bakumpai + + + Balaesang + + Balaisang + + + Pajo + + + + Banjar Hulu + + Hulu + + + + Barangas + + Alalak + + + + Bareë + + + Begak + + + Berawan + + + Biliau + + + Bimanese + + + Bolaang Mongondow + + + Buang + + + Bugotu + + Mahaga + + + + Bukar Sadong + + Sadong + + + Serian + + + Tebakang + + + + Bunama + + + Bunun + + + Buol + + Bual + + + Bwuolo + + + Dia + + + + Bwaidoga + + + Bwatoo + + + Camuhi + + Cemuhi + + + Tyamuhi + + + Wagap + + + + Carolinian + + + Daa + + Pekawa + + + + Dawawa + + + Dehu + + Drehu + + + Lifu + + + Miny + + + + Dobel + + Kobroor + + + + Dobu + + + Dumbea + + Drubea + + + + Dusun + + Kadazan + + + + East Makian + + Inner Makian + + + Makian, East + + + Makian, Inner + + + Taba + + + + East Uvean + + Uvean, East + + + Wallisian + + + + Enggano + + Etaka + + + + Enim + + + Eromanga + + Sie + + + Sye + + + + Favorlang + + Babuza + + + + Futuna-Aniwa + + Erronan + + + West Futuna + + + + Gapapaiwa + + Manape + + + + Gedaged + + Graged + + + + Gumasi + + + Halia + + + Ham + + Dami + + + + Hote + + + Iai (Loyalty Islands) + + + Iamalele + + Yamalele + + + + Ida'an + + + Iduna + + + Irahutu + + + Kaidipang + + + Kaili + + Ledo' + + + Palu + + + + Kaiwa (Papua New Guinea) + + Iwal + + + + Kambera + + + Kapingamarangi + + + Kara (Papua New Guinea) + + Kara-Lemakot + + + Lemakot + + + Lemusmus + + + + Katingan + + + Kaulong + + + Kayan (Borneo) + + + Kayu Agung + + + Kemak + + Ema + + + + Kerinci + + Kinchai + + + Korintje + + + + Kiput + + + Kiriwinian + + Kilivila + + + Trobriand + + + + Koluwawa + + + Komodo + + + Kubu + + + Kuni + + + Kurada + + Auhelawa + + + Cauhelawa + + + Nuakata + + + + Kutai + + Tenggarong + + + + Kwara'ae + + Fiu + + + + Lamenu + + Lamen + + + Lewo (Lamenu) + + + Varmali + + + + Lampung + + Api + + + Lampong + + + + Lau + + + Lavongai + + Dang (Papua New Guinea) + + + Lavangai + + + New Hanover + + + Tungag + + + Tungak + + + + Lembak Bilide + + + Lenakel + + + Lewo + + Varsu + + - - Lindrou - - - Lundayeh - - Lun Daya - - - Lun Daye - - - Lun Dayho - - - Lundaya - - - Southern Murut - - - - Manam - - - Mandak - - Lelet - - - - Mandara (Papua New Guinea) - - Madara - - - Tabar - - - - Mangap - - Mbula (Mangap) - - - - Manggarai (Indonesia) - - - Mangseng - - - Marquesan - - - Mekeo - - - Mele-Fila - - Fila - - - - Mentawai - - - Mokilese - - - Mori - - Aikoa - - - - Mortlockese - - Mortlock (Micronesia) - - - Nomoi - - - - Motu - - - Mouk - - - Mukawa - - Kapikapi - - - - Muna - - Mina (Indonesia) - - - Wuna - - - - Nakanai - - Lakalai - - - - Nali - - Yiru - - - - Napu - - Bara (Indonesia) - - - - Nemi - - - Nengone - - - Ngada - - - Ngaju - - Biadju - - - Ngaju Dayak - - - - Ngatik - - - Nguna - - - Notsi - - Nochi - - - - Nuaulu - - - Nukuoro - - - Numfor - - Mafor - - - Noemfoor - - - Nufor - - - - Paiwan - - - Pala - - - Paranan - - Palanan - - - - Pasir (Lawangan) - - - Pazeh - - Bazai - - - - Petats - - - Pileni - - - Puluwat - - - Puyuma - - Kadas language (Puyuma) - - - Panapanayan - - - Pelam - - - Pilam - - - Piyuma - - - Pyuma - - - Tipun - - - - Ramoaaina - - Malu (Papua New Guinea) - - - - Rejang (Sumatra, Indonesia) - - Redjang (Sumatra, Indonesia) - - - - Rennellese - - Bellonese - - - Munggava - - - - Roti - - Rottinese - - - - Rotuman - - - Rukai - - Drukai - - - - Rungus - - Dusun Dayak - - - Melobong Rungus - - - Memagun - - - Memogun - - - Momogun - - - Roongas - - - Rungus Dusun - - - - Saaroa - - La'alua - - - La'arua - - - Pachien - - - Paichien - - - Rarua - - - Saarua - - - Saroa - - - Shishaban - - - Sisyaban - - - - Sangen - - - Sangil - - Sangiré - - - - Sangir (Indonesia and Philippines) - - Sangihe - - - - Saposa - - - Sawu - - Havunese - - - Hawu - - - Sabu - - - Savu - - - - Sedik - - Sazek - - - Seedik - - - Shedekka - - - - Semendo - - - Serawai - - - Sigi - - Idja - - - - Sikka - - - Siladang - - - Sinagoro - - - Sio - - - Sissano - - - Sobei - - - Sokop - - - Sonsorol-Tobi - - Tobi - - - - Suau - - - Sumba - - - Sumbawa - - Semana - - - Soembawa - - - - Sursurunga - - - Suwawa - - Bunda (Indonesia) - - - - Tagal Murut - - Murut Tahol - - - Semambu - - - Semembu - - - Sumambu - - - Sumambu-Tagal - - - Sumambuq - - - - Tagula - - Sudest - - - - Takuu - - Mortlock (Papua New Guinea) - - - Nahoa - - - Taku - - - Taʻu - - - Tauu - - - - Talaud - - Talaoed - - - - Tamuan - - - Tanga (Tanga Islands) - - - Tavara (Papua New Guinea) - - Kehelala - - - Tawala - - - - Tawoyan - - - Teop - - Tiop - - - - Tidore - - - Tikopia - - - Timor - - Atoni - - - Timorese - - - - Timugon - - - Tinputz - - Timputs - - - Vasuii - - - Wasoi - - - - Tolai - - Blanche Bay - - - Gunantuna - - - Kuanua - - - New Britain - - - Raluana - - - Tinata Tuna - - - Tuna - - - - Tolaki - - Kendari - - - Toolaki - - - - Tombulu - - Toumbulu - - - - Tondano - - Tolou - - - Tolour - - - - Tonsea - - - Toraja - - Toradja - - - - Toraja Sa'dan - - Sadan (Indonesia) - - - Saqdab Toraja - - - South Toraja - - - Tae' - - - - Tuamotuan - - Paumotu - - - - Tubetube - - - Ulithi - - - Uma - - Pipikoro - - - - Urak Lawoi̕ - - Chāo Lē - - - Orak Lawoi' - - - Orang Laut (Thailand and Malaysia) - - - - Uripiv - - - Wampar - - - Wandamen - - Windesi - - - Wondama - - - - Wewewa - - Sumba, West - - - Waidjewa - - - West Sumba - - - - Woleaian - - Uleai - - - Woleai - - - - Wolio - - - Yabim - - Jabêm - - - - Yamdena - - Jamdena - - - - - info:lc/vocabulary/languages/ava - Avaric - ava - - - info:lc/vocabulary/languages/ave - Avestan - ave - - Avesta - - - Bactrian, Old (Avestan) - - - Old Bactrian (Avestan) - - - Zend - - - - info:lc/vocabulary/languages/awa - Awadhi - awa - - - info:lc/vocabulary/languages/aym - Aymara - aym - - Aimara - - - - info:lc/vocabulary/languages/aze - Azerbaijani - aze - - Azari - - - Azeri - - - Afshar - - - - info:lc/vocabulary/languages/ast - Bable - ast - - Asturian - - - - info:lc/vocabulary/languages/ban - Balinese - ban - - - info:lc/vocabulary/languages/bat - Baltic (Other) - bat - - Curonian - - - Proto-Baltic - - - Prussian - - Old Prussian - - - - - info:lc/vocabulary/languages/bal - Baluchi - bal - - Balochi - - - Beloutchi - - - Biluchi - - - - info:lc/vocabulary/languages/bam - Bambara - bam - - Bamana (Mandekan) - - - Bamanankan - - - - info:lc/vocabulary/languages/bai - Bamileke languages - bai - - Bandjoun - - Bamileke-Jo - - - - Fe'fe' - - Bafang - - - Bamileke-Fe'fe' - - - Bana (Bamileke) - - - Fa (Bamileke) - - - Fan (Bamileke) - - - Fanwe (Bamileke) - - - Fe'e fe'e - - - Fotouni - - - Kuu - - - Nufi - - - - Ngyemboon - - Nguemba (Bamileke) - - - - Yemba - - - - info:lc/vocabulary/languages/bad - Banda languages - bad - - Banda (Central Africa) - - - Linda - - - - info:lc/vocabulary/languages/bnt - Bantu (Other) - bnt - - Abo (Cameroon) - - Abaw - - - Bo (Cameroon) - - - Bon (Cameroon) - - - - Aka (Central African Republic) - - - Asu - - Athu - - - Chasu - - - Pare - - - - Bafia - - - Bakundu - - Kundu - - - - Bati - - - Bekwil - - Bakwele - - - Bakwil - - - Bekwel - - - Bekwie - - - Bekwyel - - - Kwele - - - Okpele - - - - Bembe (Congo (Brazzaville)) - - KiBembe - - - Mbembe - - - - Benga - - - Bobangi - - Rebu - - - - Bolia - - Bulia - - - - Boma (Congo) - - Buma (Congo) - - - - Bomitaba - - Mbomitaba - - - Mitaba - - - - Bondei - - Bonde - - - Boondei - - - Kibondei - - - Wabondei - - - - Bube - - Bubi (Equatorial Guinea) - - - Fernandian - - - - Bubi (Gabon) - - Pove - - - - Budu - - - Bukusu - - Lubukusu - - - - Bulu - - Boulou - - - - Camtho - - Iscamtho - - - Isicamtho - - - Shalambombo - - - Tsotsitaal (Camtho) - - - - Chaga - - Djaga - - - Dschagga - - - Jagga - - - Tschagga - - - - Chokwe - - Cibokwe - - - Cokwe - - - Jok - - - Katchokue - - - Kioko - - - Quioco - - - Tutchokue - - - - Chopi - - Lenge - - - - Comorian - - - Diriku - - Mbogedo - - - Rugciriku - - - Rumanyo - - - Shimbogedu - - - - Doko (Congo) - - - Duruma - - - Embu - - - Enahara - - Emathipane - - - Enaharra - - - Maharra - - - Nahara - - - Naharra - - - - Fipa - - - Fuliru - - - Ganguela - - Ngangela - - - - Geviya - - Avias - - - Eviya - - - Viya - - - - Giryama - - - Gisu - - Lugisu - - - Lumasaaba - - - Masaba - - - - Gungu - - Lugungu - - - Rugungu - - - - Gusii - - Ekegusii - - - Kisii - - - - Gweno - - Kigweno - - - - Gwere - - - Ha - - - Haya - - Luhaya - - - Lusiba - - - Ruhaya - - - Ziba - - - - Hehe - - - Hunde - - - Ikizu - - Ikiizo - - - Ikikizo - - - Ikikizu - - - Kiikizu - - - - Ila - - - Jita - - Echijita - - - Ecijita - - - Kijita - - - - Kahe - - Kikahe - - - - Kako - - Kaka (Northwest Bantu) - - - Yaka (Cameroon and Central African Republic) - - - - Kalanga (Botswana and Zimbabwe) - - - Kaonde - - Luba-Kaonde - - - - Kare - - Akare - - - Bakare - - - - Kele (Gabon) - - - Kete - - - Kom (Cameroon) - - Nkom - - - - Kombe - - - Komo (Congo) - - Kumu - - - - Koonzime - - Djimu - - - Dzimou - - - Konzime - - - Kooncimo - - - Koozhime - - - Koozime - - - Nzime - - - Zimu - - - - Kuria - - Ekiguria - - - Igikuria - - - Ikikuria - - - Kikoria - - - Kikouria - - - Kikuria - - - Kikuria cha juu - - - Kikuria cha Mashariki - - - Koria - - - Kurya - - - Kurye - - - Tende (Kuria) - - - - Kwangali - - - Kwese - - Kwezo - - - - Kwiri - - Mokpwe - - - - Lala - - - Lega - - - Lenje - - Bwine-Mukuni - - - Ci-Renje - - - - Logooli - - Ragoli - - - - Lomwe (Malawi) - - - Lucazi - - Ponda - - - - Luvale - - - Luyana - - - Luyia - - Oluluyia - - - - Maka (Cameroon) - - Makaa (Cameroon) - - - Mekaa - - - - Makhuwa - - Central Makhuwa - - - Emakhuwa - - - Emakua - - - Macua - - - Makhuwa-Makhuwana - - - Makhuwwa of Nampula - - - Makoane language - - - Makua (Mozambique) - - - Maquoua (Makhuwa) - - - - Makonde - - Chimakonde - - - Konde (Yao group) - - - - Makwe - - Kimakwe - - - Macue - - - Maraba (Makwe) - - - Palma - - - - Mashami - - Kimashami - - - Machambe - - - Machame - - - Madschame - - - - Mbala (Bandundu, Congo) - - - Mbo (Cameroon) - - - Mbosi - - - Mbukushu - - Goba - - - Mambukush - - - Mpukush - - - Thimbukushu - - - - Mbunda (Angola and Zambia) - - - Meru - - Kimeru - - - - Mijikenda languages - - Nika languages - - - Nyika languages - - - - Mituku - - - Mkaaʼ - - Bakaka - - - - Mochi - - Kimochi - - - Kimoshi - - - Moshi (Tanzania) - - - Mosi (Tanzania) - - - Old Moshi - - - - Mpiemo - - Bimu - - - Mbimou - - - Mbimu - - - Mbyemo - - - Mpo - - - Mpyemo - - - - Mpongwe - - Pongwe - - - - Mpur (Congo) - - - Nambya - - - Nande - - Nandi (Congo) - - - - Ndau - - Chindau - - - Shona, Southeastern - - - - Ndumu - - - Ngonde - - Ikinyi-Kiusa - - - Kiusa - - - Konde (Nyakyusa) - - - Mombe - - - Nkonde - - - Nyakyusa - - - Sochile - - - - Ngul - - Engwî - - - Ingul - - - Kingóli - - - Ngoli - - - Nguli - - - Ngulu (Congo (Democratic Republic)) - - - Ngwi (Congo (Democratic Republic)) - - - - Nsenga - - - Ntomba - - - Nyaneka - - Lunyaneka - - - Olunyaneka - - - - Nyanga - - - Nyole (Uganda) - - Lunyole (Uganda) - - - Nyule - - - Nyuli - - - - Nyungwe - - Tete - - - - Nzebi - - Bandzabi - - - Indzèbi - - - Injebi - - - Ndjabi - - - Ndjebi - - - Ndjevi - - - Njabi - - - Njevi - - - Nzabi - - - Yinzabi - - - - Pangwa - - - Pelende - - - Pende - - Kipende - - - Pindi (Pende) - - - - Pokomo - - - Punu - - Bapounou - - - Pounou - - - - Rangi - - Irangi - - - Kilangi - - - Kirangi - - - Langi (Tanzania) - - - - Ronga - - Landim - - - Shironga - - - Xironga - - - - Ruri - - Ciruuri - - - Kiruri - - - Ruuri - - - - Ruund - - Chiluwunda - - - Lunda, Northern - - - Luwunda - - - Muatiamvua - - - Northern Lunda - - - Uruund - - - - Saamia - - Luhya (Saamia) - - - Luluyia (Saamia) - - - Lusaamia - - - Luyia (Saamia) - - - Ólusaamya - - - Olusamia - - - Samia - - - Samya - - - - Sakata - - - Salampasu - - Chisalampasu - - - - Sanga - - Luba, Southern - - - Southern Luba - - - - Sena - - - Shambala - - - Shi - - Mashi - - - Nyabungu - - - - Shimaore - - Mahorais - - - - Simbiti - - Kisimbiti - - - - Songye - - Songe - - - - Subiya - - ciIkuhane - - - Ikuhane - - - Soubiya - - - - Suku (Congo) - - - Sumbwa - - Kisumbwa - - - Shisumbwa - - - Sisumbwa - - - Sisuumbwa - - - - Taita - - Sagalla - - - Teita - - - - Talinga-Bwisi - - Bwisi-Talinga - - - Kitalinga - - - - Teke - - Balali - - - Ilali - - - Itio - - - Lali - - - - Tembo (Sud-Kivu, Congo) - - KiTembo - - - - Temi - - Gitemi - - - Kisonjo - - - Sonjo - - - Sonyo - - - Wasonjo - - - Watemi - - - - Tetela - - - Tharaka - - Saraka - - - - Tiene - - Ketiine - - - Kitiene - - - Kitiini - - - Tende (Congo (Democratic Republic)) - - - - Tiriki - - - Tonga (Inhambane) - - Gitonga - - - - Tonga (Zambezi) - - - Tooro - - Toro - - - - Tsogo - - Apindji - - - Mitsogo - - - - Tswa - - Kitswa - - - Shitswa - - - Tshwa - - - Xitswa - - - - Tunen - - Banen - - - - Yaka (Congo and Angola) - - Iaka - - - - Yanzi - - - Yombe (Congo and Angola) - - - Zanaki - - Iki-Zanaki - - - IkiZanaki - - - - Zigula - - Kizigula - - - Seguha - - - Wayombo - - - Wazegua - - - Wazigua - - - Zeguha - - - Zegura - - - Zigoua - - - Zigua - - - Zigwa - - - - Zinza - - Dzinda - - - Dzindza - - - Echidzindza - - - Echijinja - - - Eciinja - - - Ecizinza - - - Jinja - - - Kizinza - - - Luzinza - - - Zinja - - - - - info:lc/vocabulary/languages/bas - Basa - bas - - - info:lc/vocabulary/languages/bak - Bashkir - bak - - - info:lc/vocabulary/languages/baq - Basque - baq - - Euskara - - - - info:lc/vocabulary/languages/btk - Batak - btk - - Batta (Sumatra) - - - Alas - - - Angkola - - - Dairi Pakpak - - Pakpak - - - - Karo-Batak - - - Mandailing - - Batak Mandailing - - - - Simelungun - - - Toba-Batak - - - - info:lc/vocabulary/languages/bej - Beja - bej - - Bedawiye - - - Bedja - - - Bishári - - - - info:lc/vocabulary/languages/bel - Belarusian - bel - - Belorussian - - - Byelorussian - - - Russian, White - - - White Russian - - - - info:lc/vocabulary/languages/bem - Bemba - bem - - - info:lc/vocabulary/languages/ben - Bengali - ben - - Banga-Bhasa - - - Bangala - - - Bangla - - - Sylheti - - Sylhet - - - Sylhetti Bangla - - - - - info:lc/vocabulary/languages/ber - Berber (Other) - ber - - Mzab - - Mozabite - - - - Rif - - Northern Shilha - - - Shilha, Northern - - - Tarifit - - - - Shilha - - Chleuh - - - Sölha - - - Tachelhait - - - Tashelhiyt - - - - Tamazight - - - - info:lc/vocabulary/languages/bho - Bhojpuri - bho - - Bajpuri - - - Bhojapuri - - - Bhozpuri - - - Bihari (Bhojpuri) - - - Deswali (Bhojpuri) - - - Khotla - - - Piscimas - - - Sadani - - Chota Nagpuri - - - Chotar Nagpuri - - - Dikku Kaji - - - Dikkukaji - - - Nagpuri (Bhojpuri) - - - Nagpuriā - - - Napuria - - - Sadan - - - Sadari - - - Sadati - - - Sadhan - - - Sadhana - - - Sadharan - - - Sadna - - - Sadri - - - Sadrik - - - Santri - - - Siddri - - - Sradri - - - - Western Standard Bhojpuri - - Benarsi - - - Bhojpuri, Western Standard - - - Purbi - - - - - info:lc/vocabulary/languages/bih - Bihari (Other) - bih - - Behari - - - Bajjika - - - Kudmali - - Bedia - - - Dharua - - - Khotta (Kurmali) - - - Kurma - - - Kurmali - - - Kurmali Thar - - - Kurmik - - - Kurni - - - Kurumali - - - - - info:lc/vocabulary/languages/bik - Bikol - bik - - Vikol - - - - info:lc/vocabulary/languages/byn - Bilin - byn - - - info:lc/vocabulary/languages/bis - Bislama - bis - - Beach-la-mar - - - Bêche-de-mer - - - Bichelamar - - - - info:lc/vocabulary/languages/zbl - Blissymbolics - zbl - - - info:lc/vocabulary/languages/bos - Bosnian - bos - - - info:lc/vocabulary/languages/bra - Braj - bra - - Braj bhākhā - - - Braj bhāshā - - - Pingal - - - - info:lc/vocabulary/languages/bre - Breton - bre - - Armoric - - - - info:lc/vocabulary/languages/bug - Bugis - bug - - Buginese - - - - info:lc/vocabulary/languages/bul - Bulgarian - bul - - - info:lc/vocabulary/languages/bua - Buriat - bua - - Buryat - - - Mongolian, Northern - - - Northern Mongolian - - - - info:lc/vocabulary/languages/bur - Burmese - bur - - - info:lc/vocabulary/languages/cad - Caddo - cad - - - info:lc/vocabulary/languages/car - Carib - car - - Galibi - - - - info:lc/vocabulary/languages/cat - Catalan - cat - - Majorcan Catalan - - Catalan, Majorcan - - - - Valencian Catalan - - Catalan, Valencian - - - - - info:lc/vocabulary/languages/cau - Caucasian (Other) - cau - - Abazin - - - Bats - - Bac - - - Tsova-Tush - - - Tush - - - - Bezhta - - - Botlikh - - - Budukh - - - Chamalal - - - Dido - - Tsez - - - - Ginukh - - Ginukhtsy - - - Ginux - - - Hinukh - - - Hinux - - - - Hunzib - - Gunzib - - - - Kubachi - - - Lak - - - Laz - - Chan - - - Chanuri - - - Chanzan - - - Laze - - - Lazian - - - Lazuri - - - Zan - - - - Mingrelian - - - Svan - - - Tabasaran - - - Tsakhur - - - Ubykh - - Oubykh - - - - Udi - - - - info:lc/vocabulary/languages/ceb - Cebuano - ceb - - Binisaya - - - Bisayan - - - Sebuano - - - Sinugboanon - - - Sugbuanon - - - Sugbuhanon - - - Visayan - - - - info:lc/vocabulary/languages/cel - Celtic (Other) - cel - - Celtiberian - - Celti-Iberian - - - Celto-Iberian - - - - Gaulish - - Gallic - - - - Proto-Celtic - - Common Celtic - - - - Welsh, Middle (ca. 1100-1400) - - Middle Welsh (ca. 1100-1400) - - - - Welsh, Old (to 1100) - - Old Welsh (to 1100) - - - - - info:lc/vocabulary/languages/cai - Central American Indian (Other) - cai - - Use for the other languages of Central America and Mexico, as well as for the - languages of the Azteco-Tanoan language phylum. - - - Amuzgo - - Amishgo - - - - Boruca - - Brunka - - - Burunca - - - - Bribri - - - Cabecar - - - Cahita - - - Cahuilla - - Coahuila - - - Kawia (Shoshone) - - - - Chatino - - - Chiapanec - - - Chinantecan languages - - - Chocho - - - Chontal - - Tequistlateca - - - - Cochimi - - - Comanche - - - Cora - - Chora - - - Nayarita - - - - Cuicatec - - - Cuitlateco - - Teco (Cuitlateco) - - - - Cupeño - - - Eudeve - - Batuco - - - Dohema - - - Hegue - - - - Garifuna - - Black Carib - - - Carib, Black - - - - Guarijío - - Huarijío - - - Warijío - - - - Guatuso - - Maléku Jaíka - - - - Guaymi - - - Hopi - - Moki - - - - Huave - - - Huichol - - Guichola - - - - Ixcateco - - - Jicaque - - Tol - - - Torrupan - - - Xicaque - - - - Kawaiisu - - - Kiowa - - Kayowe - - - - Lenca - - - Mangue - - Choluteca - - - - Matagalpa - - Cacaopera - - - - Mayo (Piman) - - - Mazateco - - - Miskito - - Mosquito - - - - Mixe - - Ayook - - - - Mixtec - - - Opata - - - Panamint - - Coso - - - Koso - - - Tümpisa - - - - Pima - - - Popoloca - - - Rama - - - Seri - - - Serrano - - Maarrenga'twich - - - - Shoshoni - - - Sierra Popoluca - - Highland Popoluca - - - Popoluca, Highland - - - Popoluca of Vera Cruz - - - - Southern Paiute - - Paiute, Southern - - - - Sumo - - - Tarahumara - - Rarámuri - - - - Tarascan - - Michoacana - - - Phurhembe - - - Purepecha - - - - Tepehuan - - O'dam - - - - Terraba - - Teribe - - - Tirribi - - - - Tewa - - - Tlapanec - - Chocho (Tlapanec) - - - Tiapaneco - - - - Tohono O'odham - - Papago - - - - Totonac - - - Trique - - - Ulva - - Woolwa - - - Wulwa - - - - Ute - - - Yaqui - - - Zoque - - Soke - - - - - info:lc/vocabulary/languages/chg - Chagatai - chg - - Dschagatai - - - Jagataic - - - Old Uzbek - - - Tschagatai - - - Uzbek, Old - - - - info:lc/vocabulary/languages/cmc - Chamic languages - cmc - - Cham - - Čam - - - - Haroi - - - Jarai - - - Rade - - Ede - - - Rhade - - - - Roglai - - - - info:lc/vocabulary/languages/cha - Chamorro - cha - - Tjamoro - - - - info:lc/vocabulary/languages/che - Chechen - che - - Tchetchen - - - - info:lc/vocabulary/languages/chr - Cherokee - chr - - - info:lc/vocabulary/languages/chy - Cheyenne - chy - - - info:lc/vocabulary/languages/chb - Chibcha - chb - - - info:lc/vocabulary/languages/chi - Chinese - chi - - Cantonese - - - Mandarin - - - - info:lc/vocabulary/languages/chn - Chinook jargon - chn - - Chinook pidgin - - - - info:lc/vocabulary/languages/chp - Chipewyan - chp - - Dene (Chipewyan) - - - Montagnais (Athapascan) - - - - info:lc/vocabulary/languages/cho - Choctaw - cho - - Chahta - - - - info:lc/vocabulary/languages/chu - Church Slavic - chu - - Bulgarian, Old (to 1100) - - - Old Bulgarian (to 1100) - - - Old Church Slavic - - - Old Slovenian - - - Slavonic, Old Church - - - Slovenian, Old - - - - info:lc/vocabulary/languages/chk - Chuukese - chk - - Truk - - - - info:lc/vocabulary/languages/chv - Chuvash - chv - - - info:lc/vocabulary/languages/cop - Coptic - cop - - - info:lc/vocabulary/languages/cor - Cornish - cor - - - info:lc/vocabulary/languages/cos - Corsican - cos - - Corse - - - Corsi - - - Corso - - - Corsu - - - - info:lc/vocabulary/languages/cre - Cree - cre - - Cris - - - Knistenaux - - - Maskegon - - - - info:lc/vocabulary/languages/mus - Creek - mus - - Maskoki - - - Muscogee - - - - info:lc/vocabulary/languages/crp - Creoles and Pidgins (Other) - crp - - Pidgins - - - Ambonese Malay - - Malay, Ambonese - - - - Betawi - - Batawi - - - Jakarta Malay - - - Malay, Jakarta - - - - Chabacano - - Chavacano - - - Zamboangueño - - - - Fanakalo - - Fanagalo - - - Pidgin Kaffir - - - - Kituba (Congo (Democratic Republic)) - - Kibulamatadi - - - Kikongo Commercial - - - Kikongo-Kutuba - - - Kikongo Simplifié - - - Kikongo ya Leta - - - Kikwango - - - Kileta - - - - Naga Pidgin - - Nagamese - - - - San Basilio del Palenque Spanish Creole - - Palenquero (Colombia) - - - Spanish Creole, San Basilio del Palenque - - - - Unami jargon - - - - info:lc/vocabulary/languages/cpe - Creoles and Pidgins, English-based (Other) - cpe - - Bamyili Creole - - - Djuka - - Aucaans - - - Aukan - - - Djoeka - - - Ndjuka - - - - English-based Creoles and Pidgins (Other) - - - Fitzroy Valley Kriol - - - Hawaiian Pidgin English - - - Jamaican Creole - - - Krio - - Aku (Creole) - - - - Kriol - - - Pijin - - Neo-Solomonic - - - Solomons Pidgin - - - - Pidgin English - - - Saramaccan - - - Sea Islands Creole - - Geechee - - - Gullah - - - - - info:lc/vocabulary/languages/cpf - Creoles and Pidgins, French-based (Other) - cpf - - French-based Creoles and Pidgins (Other) - - - Dominican French Creole - - French Creole, Dominican - - - - Louisiana French Creole - - French Creole, Louisiana - - - - Mauritian French Creole - - French Creole, Mauritian - - - - Michif - - Cree, French - - - French Cree - - - Mitchif - - - - Reunionese French Creole - - French Creole, Reunionese - - - - Seychellois French Creole - - French Creole, Seychellois - - - - - info:lc/vocabulary/languages/cpp - Creoles and Pidgins, Portuguese-based (Other) - cpp - - Portuguese-based Creoles and Pidgins (Other) - - - Annobon - - Ambu - - - - Cape Verde Creole - - Brava Island Creole - - - - Crioulo - - - Indo-Portuguese - - Ceylon Portuguese - - - - - info:lc/vocabulary/languages/crh - Crimean Tatar - crh - - Crimean Turkish - - - Tatar, Crimean - - - Turkish, Crimean - - - - info:lc/vocabulary/languages/hrv - Croatian - hrv - - - info:lc/vocabulary/languages/scr - Croatian - scr - - - info:lc/vocabulary/languages/cus - Cushitic (Other) - cus - - Alaba - - Alaaba - - - Allaaba - - - Halaba - - - - Burji - - - Dasenech - - Geleb - - - Marille - - - - Gedeo - - Darasa - - - Derasa - - - - Hadiya - - - Iraqw - - - Kambata - - - Qebena - - K'abena - - - Kebena - - - Qabena - - - Womba - - - Wombi Afoo - - - Wombisanat - - - - Rendille - - - Tunni - - - - info:lc/vocabulary/languages/cze - Czech - cze - - Bohemian - - - - info:lc/vocabulary/languages/dak - Dakota - dak - - Sioux - - - Assiniboine - - - Lakota - - Teton - - - - Santee - - - Yankton - - - - info:lc/vocabulary/languages/dan - Danish - dan - - - info:lc/vocabulary/languages/dar - Dargwa - dar - - Darghi - - - Dargin - - - - info:lc/vocabulary/languages/day - Dayak - day - - Bidayuh - - - Bideyu - - - Dajak - - - Dyak - - - Kendayan - - - Land Dayak - - - Biatah - - - - info:lc/vocabulary/languages/del - Delaware - del - - Lenape - - - Lenni Lenape - - - Munsee - - Minsi - - - - - info:lc/vocabulary/languages/din - Dinka - din - - Denca - - - - info:lc/vocabulary/languages/div - Divehi - div - - Dhivehi - - - Maldivian - - - - info:lc/vocabulary/languages/doi - Dogri - doi - - Dhogaryali - - - Dogari - - - Dogra - - - Dogri Jammu - - - Dogri-Kangri - - - Dogri Pahari - - - Dongari - - - Hindi Dogri - - - Tokkaru - - - Kangri - - Kangari - - - Kangra - - - - - info:lc/vocabulary/languages/dgr - Dogrib - dgr - - Thlingchadinne - - - - info:lc/vocabulary/languages/dra - Dravidian (Other) - dra - - Abujhmaria - - - Alu Kurumba - - - Brahui - - Berouhi - - - Birohi - - - Brohki - - - - Gadaba (Dravidian) - - Gadba (Dravidian) - - - Gudwa (Dravidian) - - - Gutob (Dravidian) - - - Konekor Gadaba - - - Ollari - - - Salur - - - - Kodagu - - Coorg - - - Kodava - - - Kurg - - - - Kolami - - - Kota (India) - - - Kui - - Kandh - - - - Kuvi - - - Malto - - - Pengo - - - Toda (India) - - Tuda (India) - - - - Tulu - - - - info:lc/vocabulary/languages/dua - Duala - dua - - Douala - - - - info:lc/vocabulary/languages/dut - Dutch - dut - - Flemish - - - Netherlandic - - - - info:lc/vocabulary/languages/dum - Dutch, Middle (ca. 1050-1350) - dum - - Diets - - - Middle Dutch - - - - info:lc/vocabulary/languages/dyu - Dyula - dyu - - Dioula - - - Diula - - - Jula - - - - info:lc/vocabulary/languages/dzo - Dzongkha - dzo - - Bhotia of Bhutan - - - Bhutanese - - - - info:lc/vocabulary/languages/frs - East Frisian - frs - - Frisian, East - - - - info:lc/vocabulary/languages/bin - Edo - bin - - Bini - - - - info:lc/vocabulary/languages/efi - Efik - efi - - Calabar - - - Ibibio - - - - info:lc/vocabulary/languages/egy - Egyptian - egy - - Demotic - - - Hieratic - - - Hieroglyphics (Egyptian) - - - - info:lc/vocabulary/languages/eka - Ekajuk - eka - - - info:lc/vocabulary/languages/elx - Elamite - elx - - Amardic - - - Anzanic - - - Susian - - - - info:lc/vocabulary/languages/eng - English - eng - - - info:lc/vocabulary/languages/enm - English, Middle (1100-1500) - enm - - Middle English - - - - info:lc/vocabulary/languages/ang - English, Old (ca. 450-1100) - ang - - Anglo-Saxon - - - Old English - - - West Saxon - - - - info:lc/vocabulary/languages/myv - Erzya - myv - - - info:lc/vocabulary/languages/esk - Eskimo languages - esk - - - info:lc/vocabulary/languages/epo - Esperanto - epo - - - info:lc/vocabulary/languages/esp - Esperanto - esp - - - info:lc/vocabulary/languages/est - Estonian - est - - Seto - - Setu - - - - Võro - - Võru - - - Werro - - - - - info:lc/vocabulary/languages/gez - Ethiopic - gez - - Geez - - - - info:lc/vocabulary/languages/eth - Ethiopic - eth - - - info:lc/vocabulary/languages/ewe - Ewe - ewe - - - info:lc/vocabulary/languages/ewo - Ewondo - ewo - - Jaunde - - - Yaounde - - - Yaunde - - - - info:lc/vocabulary/languages/fan - Fang - fan - - Fan (Bantu) - - - - info:lc/vocabulary/languages/fat - Fanti - fat - - - info:lc/vocabulary/languages/fao - Faroese - fao - - Faeroese - - - - info:lc/vocabulary/languages/far - Faroese - far - - - info:lc/vocabulary/languages/fij - Fijian - fij - - Viti - - - - info:lc/vocabulary/languages/fil - Filipino - fil - - - info:lc/vocabulary/languages/fin - Finnish - fin - - - info:lc/vocabulary/languages/fiu - Finno-Ugrian (Other) - fiu - - Ingrian - - Izhorskii - - - - Khanty - - Ostiak - - - Xanty - - - - Livonian - - - Ludic - - Lydi - - - - Mansi - - Vogul - - - - Mordvin - - Mordva - - - Mordvinian - - - - Veps - - - - info:lc/vocabulary/languages/fon - Fon - fon - - Dahoman - - - Djedji - - - Jeji - - - - info:lc/vocabulary/languages/fre - French - fre - - Allevard French - - French, Allevard - - - - Judeo-French - - Western Loez - - - Zarphatic - - - - Morvan French - - French, Morvan - - - - Poitevin French - - French, Poitevin - - - - Saintongeais French - - French, Saintongeais - - - - - info:lc/vocabulary/languages/frm - French, Middle (ca. 1300-1600) - frm - - Middle French - - - - info:lc/vocabulary/languages/fro - French, Old (ca. 842-1300) - fro - - Old French - - - - info:lc/vocabulary/languages/fry - Frisian - fry - - Friesian - - - West Frisian - - - Stadsfries - - Stadfries - - - Stedsk - - - Town Frisian - - - - - info:lc/vocabulary/languages/fri - Frisian - fri - - - info:lc/vocabulary/languages/fur - Friulian - fur - - - info:lc/vocabulary/languages/ful - Fula - ful - - Adamawa - - - Fulah - - - Fulani - - - Fulbe - - - Fulfulde - - - Peul - - - Poul - - - Bororo (West Africa) - - - Pular - - Poular - - - Toucouleur - - - Tukolor - - - - - info:lc/vocabulary/languages/gaa - - gaa - - Acra - - - Incran - - - - info:lc/vocabulary/languages/glg - Galician - glg - - Gallegan - - - - info:lc/vocabulary/languages/gag - Galician - gag - - - info:lc/vocabulary/languages/lug - Ganda - lug - - Luganda - - - - info:lc/vocabulary/languages/gay - Gayo - gay - - - info:lc/vocabulary/languages/gba - Gbaya - gba - - Baya - - - Gbeya - - - - info:lc/vocabulary/languages/geo - Georgian - geo - - Ingilo - - - - info:lc/vocabulary/languages/ger - German - ger - - Hochdeutsch - - - Alemannic - - Alamannic - - - Alemannisch - - - Allemannic - - - Allemannisch - - - Alsatian - - - Schwyzerdütsch - - - - Cimbrian - - Tzimbro - - - Zimbrisch - - - - - info:lc/vocabulary/languages/gmh - German, Middle High (ca. 1050-1500) - gmh - - Middle High German - - - - info:lc/vocabulary/languages/goh - German, Old High (ca. 750-1050) - goh - - Old High German - - - - info:lc/vocabulary/languages/gem - Germanic (Other) - gem - - Danish, Old (to 1500) - - Old Danish - - - - Dutch, Old (to 1050) - - Franconian, Old Low - - - Old Dutch - - - Old Low Franconian - - - - Frisian, Old (to 1500) - - Old Frisian - - - - Lombard - - - Old Saxon - - Low German, Old (ca. 850-1050) - - - Old Low German (ca. 850-1050) - - - Saxon, Old - - - - Pennsylvania German - - - Swedish, Old (to 1550) - - Old Swedish - - - - Walser - - - - info:lc/vocabulary/languages/gil - Gilbertese - gil - - Arorai - - - I-Kiribati - - - Kiribatese - - - - info:lc/vocabulary/languages/gon - Gondi - gon - - - info:lc/vocabulary/languages/gor - Gorontalo - gor - - - info:lc/vocabulary/languages/got - Gothic - got - - - info:lc/vocabulary/languages/grb - Grebo - grb - - Gdebo - - - Gedebo - - - Krebo - - - - info:lc/vocabulary/languages/grc - Greek, Ancient (to 1453) - grc - - Ancient Greek - - - Biblical Greek - - - Byzantine Greek - - - Classical Greek - - - Greek, Biblical - - - Greek, Byzantine - - - Greek, Classical - - - Greek, Hellenistic - - - Greek, Medieval - - - Greek, Patristic - - - Greek (Koine) - - - Hellenistic Greek - - - Koine (Greek) - - - Medieval Greek - - - Patristic Greek - - - Aeolic Greek - - Greek, Aeolic - - - - Attic Greek - - Greek, Attic - - - - Doric Greek - - Greek, Doric - - - - Ionic Greek - - Greek, Ionic - - - - - info:lc/vocabulary/languages/gre - Greek, Modern (1453- ) - gre - - East Cretan Greek - - Cretan Greek, East - - - Greek, East Cretan - - - - - info:lc/vocabulary/languages/grn - Guarani - grn - - Chiriguano - - Aba - - - Camba - - - Tembeta - - - - Chiripá - - Tsiripa - - - - Mbya - - - - info:lc/vocabulary/languages/gua - Guarani - gua - - - info:lc/vocabulary/languages/guj - Gujarati - guj - - Dhodia - - Dhobi - - - Dhoḍiyā - - - Dhore - - - Dhowari - - - Doria - - - - Gamit - - Gamati - - - Gāmīta - - - Gamta - - - Gavit - - - - Halari - - - Parsi-Gujarati - - - Saurashtri - - Patanuli - - - Patnuli - - - Saurashtra - - - Saurastra - - - Sawrashtra - - - Sourashtra - - - Sowrashtra - - - - Sidi - - - - info:lc/vocabulary/languages/gwi - Gwich'in - gwi - - Kutchin - - - Loucheux - - - Takudh - - - Tukudh - - - - info:lc/vocabulary/languages/hai - Haida - hai - - Skittagetan - - - - info:lc/vocabulary/languages/hat - Haitian French Creole - hat - - French Creole, Haitian - - - - info:lc/vocabulary/languages/hau - Hausa - hau - - - info:lc/vocabulary/languages/haw - Hawaiian - haw - - - info:lc/vocabulary/languages/heb - Hebrew - heb - - Ancient Hebrew - - - - info:lc/vocabulary/languages/her - Herero - her - - Himba - - Chimba - - - Cimba - - - Dhimba - - - Simba - - - Tjimba - - - - - info:lc/vocabulary/languages/hil - Hiligaynon - hil - - Ilongo - - - Panayan - - - - info:lc/vocabulary/languages/hin - Hindi - hin - - Badayuni - - - Bagheli - - Bagelkhandi - - - Bhugelkhud - - - Ganggai - - - Kawathi - - - Kenat - - - Kevat Boli - - - Kevati - - - Kewani - - - Kewat - - - Kewati - - - Kewot - - - Mandal - - - Mannadi - - - Riwai - - - - Bangaru - - Hariani - - - Jatu - - - - Bundeli - - Bundelkhandi - - - - Chattisgarhi - - Chhattisgarhi - - - Khalṭāhī - - - Khatahi - - - Laria - - - - Deswali - - - Kanauji - - Bhakha - - - Braj Kanauji - - - Kannaujī - - - - Khari Boli - - Kauravī - - - Khaṛībolī - - - Kourvi - - - - Marari - - - Pawari - - - Powari - - Povārī - - - - - info:lc/vocabulary/languages/hmo - Hiri Motu - hmo - - Police Motu - - - - info:lc/vocabulary/languages/hit - Hittite - hit - - - info:lc/vocabulary/languages/hmn - Hmong - hmn - - Humung - - - Meo - - - Miao - - - Mong - - - Hmong Njua - - Black Flowery Miao - - - Blue Miao - - - Green Hmong - - - Green Miao - - - Green Mong - - - Hmong Leng - - - Moob Ntsuab - - - Tak Meo - - - - She - - Ho Ne - - - Ho Nte - - - Huo Nte - - - She Yao - - - - White Hmong - - Hmong, White - - - Hmong Daw - - - Hmoob Dawb - - - Miao, White - - - White Miao - - - - - info:lc/vocabulary/languages/hun - Hungarian - hun - - Magyar - - - - info:lc/vocabulary/languages/hup - Hupa - hup - - - info:lc/vocabulary/languages/iba - Iban - iba - - Sea Dyak - - - - info:lc/vocabulary/languages/ice - Icelandic - ice - - - info:lc/vocabulary/languages/ido - Ido - ido - - - info:lc/vocabulary/languages/ibo - Igbo - ibo - - Ibo - - - - info:lc/vocabulary/languages/ijo - Ijo - ijo - - Djo - - - Dzo - - - Ejo - - - Ido (African) - - - Iyo (Nigeria) - - - Izo - - - Izon - - - Ojo - - - Oru - - - Udzo - - - Uzo - - - Ibani - - Bonny - - - Ubani - - - - Nembe - - Nimbi - - - - - info:lc/vocabulary/languages/ilo - Iloko - ilo - - Ilocano - - - - info:lc/vocabulary/languages/smn - Inari Sami - smn - - Finnish Lapp - - - Lapp, Finnish - - - Sami, Inari - - - - info:lc/vocabulary/languages/inc - Indic (Other) - inc - - Adiwasi Garasia - - Adivasi Garasia - - - Ādivāsī Garāsiyā - - - Adiwasi Girasia - - - Adiwasi Gujarati - - - Garasia Adivasi - - - - Ahirani - - Ahiri - - - - Apabhraṃśa - - Apabhramsha - - - - Avahattha - - - Bashgali - - Bashgal - - - Bashgari - - - Kamtoz - - - Katai - - - Kati - - - - Bhili - - - Bote-Majhi - - Bote-Mahi - - - Kushar - - - Pakhe-Bote - - - - Chakma - - - Changari - - - Chinali - - Chana (India) - - - Channali - - - Chinal - - - Dagi - - - Harijan - - - Shipi - - - - Danuwar Rai - - Denwar - - - Dhanvar - - - Dhanwar - - - Donwar - - - - Darai - - - Dehawali - - Dehavali - - - Dehwali - - - - Domaaki - - Bericho - - - Dom - - - Doma - - - Dumaki - - - - Dungra Bhil - - Dungari Bhili - - - Dungri Bhili - - - - Fiji Hindi - - Hindi, Fiji - - - - Garasiya - - Garahaiya - - - Girasia - - - - Garhwali - - Gadhavali - - - Gadhawala - - - Gadwahi - - - Gashwali - - - Girwali - - - Godauli - - - Gorwali - - - Gurvali - - - Pahari Garhwali - - - - Halbi - - Bastari - - - - Hindustani - - - Indus Kohistani - - Khili - - - Kohistani, Indus - - - Kohiste - - - Mair - - - Maiya - - - Maiyan - - - Maiyon - - - Shuthun - - - - Kalami - - Bashgharik - - - Bashkarik - - - Dir Kohistani - - - Diri (Kalami) - - - Dirwali - - - Gaawro - - - Garwa - - - Garwi - - - Gawri - - - Gowri - - - Kalam Kohistani - - - Kalami Kohistani - - - Kohistana - - - Kohistani, Dir - - - Kohistani, Kalam - - - Kohistani, Kalami - - - - Khandesi - - Dhed Gujari - - - Khandeshi - - - Khandish - - - - Khowar - - - Kumaoni - - Kamaoni - - - Kumau - - - Kumauni - - - Kumawani - - - Kumgoni - - - Kumman - - - Kunayaoni - - - - Kupia - - Valmiki - - - - Mawchi - - Mauchi - - - Māvacī - - - Mavchi - - - Mawachi - - - Mawchi Bhil - - - Mowchi - - - - Memoni - - - Parya - - Tajuzbeki - - - - Rajbangsi - - Kamtapuri - - - Rajbanshi - - - Rajbansi - - - Rajbongshi - - - - Rathvi - - Rāthavi - - - Rathwi - - - - Shina - - Sheena - - - Sina - - - - Suriname Hindustani - - Aili-Gaili - - - Hindustani, Suriname - - - Surinam Hindustani - - - Sarnami Hindi - - - - Tharu - - - Vaagri Boli - - - Veddah (Sinhalese) - - - Waigali - - Kalaṣa-alā - - - Vaigalī - - - Wai - - - Wai-alā - - - Waigelī - - - - Wotapuri-Katarqalai - - Katarqalai - - - - - info:lc/vocabulary/languages/ine - Indo-European (Other) - ine - - Carian - - - Dacian - - Daco-Mysian - - - North Thracian - - - - Luwian - - Luian - - - Lûish - - - Luvian - - - - Lycian - - - Lydian - - - Macedonian (Ancient) - - - Messapic - - Iapygian - - - Messapian - - - - Palaic - - Balaic - - - Palâ (Palaic) - - - Palaite - - - Palawi - - - - Phrygian - - - Proto-Indo-European - - Proto-Aryan - - - Protoindoeuropean - - - - Thracian - - - Tokharian - - Kuchean - - - Tocharian - - - Tocharish - - - Turfanish - - - - Venetic - - - Yuezhi - - Yüeh-chih - - - - - info:lc/vocabulary/languages/ind - Indonesian - ind - - Bahasa Indonesia - - - - info:lc/vocabulary/languages/inh - Ingush - inh - - - info:lc/vocabulary/languages/ina - Interlingua (International Auxiliary Language Association) - ina - - - info:lc/vocabulary/languages/int - Interlingua (International Auxiliary Language Association) - int - - - info:lc/vocabulary/languages/ile - Interlingue - ile - - Occidental - - - - info:lc/vocabulary/languages/iku - Inuktitut - iku - - Inuit - - - Inuvialuktun - - - Kopagmiut - - Chiglit - - - Siglit - - - - - info:lc/vocabulary/languages/ipk - Inupiaq - ipk - - Inuit - - - - info:lc/vocabulary/languages/ira - Iranian (Other) - ira - - Bactrian - - - Badzhuv - - Badschu - - - Badžū - - - Bāǰūī - - - - Bakhtiari - - Bakhtiyārī - - - Baxtīarī - - - Lori - - - Lori-ye Khaveri - - - Lur (Bakhtiari) - - - Luri (Bakhtiari) - - - - Bartang - - Bartangi - - - - Ephthalite - - Hephthalite - - - - Gilaki - - Gelaki - - - Gilan - - - - Gorani - - Awromani - - - Gurani - - - Hawramani - - - Hawrami - - - Hewrami - - - Howrami - - - Macho - - - - Hazaragi - - Azargi - - - Hazara - - - Hezareh - - - Hezareʼi - - - Khazara - - - Khezare - - - - Ishkashmi - - - Judeo-Tat - - Bik - - - Dzhuhuric - - - Hebrew Tat - - - Hebrew Tati - - - Jew-Tatish - - - Jewish Tat - - - Judeo-Tatic - - - - Khorezmi - - Choresmian - - - Khwarezmian - - - - Khuf - - Chuf - - - - Laki (Iran) - - Alaki - - - Leki - - - - Māzandarānī - - Mazanderani - - - Tabri - - - - Median - - Medic - - - - Munji - - Mundzhan - - - Munjani - - - - Natanzi - - Naṭanz - - - - Ormuri - - Baraks - - - Bargista - - - - Parthian - - - Roshan - - Rochani - - - Ruschan - - - - Sarikoli - - Sarykoli - - - - Sarmatian - - - Shughni - - Shugnan-Rushan - - - - Sivandi - - Sivendi - - - - Talysh - - - Tat - - - Wakhi - - - Yaghnobi - - Neo-Sogdian - - - Yaghnabi - - - Yaghnubi - - - Yagnabi - - - Yagnob - - - Yagnobi - - - Yagnubi - - - - Yazghulami - - - Zebaki - - Sanglici - - - - - info:lc/vocabulary/languages/gle - Irish - gle - - Erse (Irish) - - - Gaelic (Irish) - - - Irish Gaelic - - - - info:lc/vocabulary/languages/iri - Irish - iri - - - info:lc/vocabulary/languages/mga - Irish, Middle (ca. 1100-1550) - mga - - Middle Irish - - - - info:lc/vocabulary/languages/sga - Irish, Old (to 1100) - sga - - Old Irish - - - - info:lc/vocabulary/languages/iro - Iroquoian (Other) - iro - - Cayuga - - - Iroquois - - - Oneida - - - Onondaga - - - Seneca - - - Tuscarora - - - Wyandot - - Huron - - - - - info:lc/vocabulary/languages/ita - Italian - ita - - Judeo-Italian - - - Milanese - - - Modena Italian - - Italian, Modena - - - - Romagnol - - - Venetian Italian - - Italian, Venetian - - - - - info:lc/vocabulary/languages/jpn - Japanese - jpn - - Use for related Japanese languages and dialects - - - - info:lc/vocabulary/languages/jav - Javanese - jav - - - info:lc/vocabulary/languages/jrb - Judeo-Arabic - jrb - - - info:lc/vocabulary/languages/jpr - Judeo-Persian - jpr - - Judeo-Tajik - - - - info:lc/vocabulary/languages/kbd - Kabardian - kbd - - Cabardan - - - Circassian, East - - - Circassian, Upper - - - East Circassian - - - Qabardian - - - Upper Circassian - - - - info:lc/vocabulary/languages/kab - Kabyle - kab - - - info:lc/vocabulary/languages/kac - Kachin - kac - - Chingpaw - - - Jingpho - - - - info:lc/vocabulary/languages/kal - Kalâtdlisut - kal - - Ammassalimiut - - East Greenlandic - - - Greenlandic, East - - - Tunumiisut - - - - Greenlandic - - - Inuit - - - Kalaallisut - - - - info:lc/vocabulary/languages/kam - Kamba - kam - - - info:lc/vocabulary/languages/kan - Kannada - kan - - Canarese - - - Kanarese - - - Havyaka - - - - info:lc/vocabulary/languages/kau - Kanuri - kau - - Bornu - - - - info:lc/vocabulary/languages/krc - Karachay-Balkar - krc - - Balkar - - - - info:lc/vocabulary/languages/kaa - Kara-Kalpak - kaa - - Karakalpak - - - Qaraqalpaq - - - - info:lc/vocabulary/languages/krl - Karelian - krl - - Carelian - - - - info:lc/vocabulary/languages/kar - Karen languages - kar - - Kayah - - Karen, Red - - - Red Karen - - - - Pwo Karen - - - Sgaw Karen - - - Taungthu - - Pa-o - - - - - info:lc/vocabulary/languages/kas - Kashmiri - kas - - - info:lc/vocabulary/languages/csb - Kashubian - csb - - Cashubian - - - - info:lc/vocabulary/languages/kaw - Kawi - kaw - - Javanese, Old - - - Old Javanese - - - - info:lc/vocabulary/languages/kaz - Kazakh - kaz - - Kirghiz-Kaissak - - - - info:lc/vocabulary/languages/kha - Khasi - kha - - - info:lc/vocabulary/languages/khm - Khmer - khm - - Cambodian - - - Central Khmer - - - - info:lc/vocabulary/languages/cam - Khmer - cam - - - info:lc/vocabulary/languages/khi - Khoisan (Other) - khi - - Ju/'hoan - - !Xũ (!Kung) - - - Zjuc'hôa - - - Žu/'hõasi - - - - Khoikhoi - - Hottentot - - - - Korana - - - Nama - - - Nharo - - Naro - - - - San languages - - Bushman languages - - - - !Xõ - - Gxon - - - Hua-owani - - - !Kõ (Botswana and Namibia) - - - Koon - - - Magong - - - !Xong (Botswana and Namibia) - - - - - info:lc/vocabulary/languages/kho - Khotanese - kho - - Khotan-Saka - - - Khotanese-Sakan - - - Khotani - - - Khotansaka - - - Middle Khotanese - - - North Aryan - - - Old Khotanese - - - Saka - - - Sakan - - - - info:lc/vocabulary/languages/kik - Kikuyu - kik - - Gikuyu - - - - info:lc/vocabulary/languages/kmb - Kimbundu - kmb - - Angola - - - Bunda - - - Mbundu (Luanda Province, Angola) - - - Nbundu - - - Quimbundo (Luanda Province, Angola) - - - - info:lc/vocabulary/languages/kin - Kinyarwanda - kin - - Nyaruanda - - - Ruanda - - - Runyarwanda - - - Rwanda - - - Rufumbira - - - - info:lc/vocabulary/languages/tlh - Klingon (Artificial language) - tlh - - - info:lc/vocabulary/languages/kom - Komi - kom - - Syryenian - - - Zyrian - - - Komi-Permyak - - Permiak - - - - - info:lc/vocabulary/languages/kon - Kongo - kon - - Congo - - - Kikongo - - - Kituba (Congo (Brazzaville)) - - Kikoongo (Kituba (Congo (Brazzaville))) - - - Munukutuba - - - - Laadi - - Kilari - - - - Manyanga - - Kimanyanga - - - Kisi-Ngóombe - - - Manianga - - - - Ntaandu - - Kintaandu - - - Kisantu - - - Santu - - - - Vili - - Civili - - - Fiot - - - Fiote - - - Ki-vili - - - Ki-vumbu - - - Kivili - - - Kivumbu - - - Loango - - - Lu-wumbu - - - Luwumbu - - - Tsivili - - - - Zombo - - - - info:lc/vocabulary/languages/kok - Konkani - kok - - Concani - - - Komkani - - - Koṅkṇi - - - Agri - - Agari - - - - Chitapavani - - Chitpavani - - - Citpāvanī - - - - Jhāḍī - - - Kudali - - Malvani - - - - - info:lc/vocabulary/languages/kut - Kootenai - kut - - Kutenai - - - - info:lc/vocabulary/languages/kor - Korean - kor - - Use for related Korean languages and dialects - - - - info:lc/vocabulary/languages/kos - Kosraean - kos - - Kosrae - - - Kusaie - - - Kusaiean - - - - info:lc/vocabulary/languages/kpe - Kpelle - kpe - - Guerzé - - - - info:lc/vocabulary/languages/kro - Kru (Other) - kro - - Bete - - - Dadjriwalé - - Dadjrignoa - - - Dagli - - - Dajriwali - - - - Dida - - Wawi - - - - Godié - - Go (Côte d'Ivoire) - - - Godia - - - Godye - - - - Kru - - - Kuwaa - - Belle - - - Belleh - - - Kowaao - - - Kwaa - - - - Neyo - - Gwibwen - - - Néouolé - - - Néyau - - - Niyo - - - Towi - - - - Ngere - - Gere - - - Guéré - - - - Nyabwa - - Niaboua - - - - Tchien - - Gien - - - Kien - - - Tie - - - - Tepo - - Kroumen - - - Tewi - - - - Wobe - - Ouobe - - - - - info:lc/vocabulary/languages/kua - Kuanyama - kua - - Cuanhama - - - Kwanyama - - - Ovambo (Kuanyama) - - - - info:lc/vocabulary/languages/kum - Kumyk - kum - - - info:lc/vocabulary/languages/kur - Kurdish - kur - - Kurmanji - - - Mukri - - - - info:lc/vocabulary/languages/kru - Kurukh - kru - - Kurux - - - Oraon - - - Uraon - - - - info:lc/vocabulary/languages/kus - Kusaie - kus - - - info:lc/vocabulary/languages/kir - Kyrgyz - kir - - Kara-Kirghiz - - - Kirghiz - - - - info:lc/vocabulary/languages/lad - Ladino - lad - - Judeo-Spanish - - - Judesmo - - - Ḥakétia - - Ḥakétie - - - Haketiya - - - Ḥakitía - - - Haquetía - - - Haquetiya - - - - - info:lc/vocabulary/languages/lah - Lahndā - lah - - Jaṭkī - - - Lahndi - - - Panjabi, Western - - - Western Panjabi - - - Hindkōo - - - Khetrānī - - - Pōṭhwārī - - - Siraiki - - Bahawalpuri - - - Lahnda, Southern - - - Multani - - - Mutani - - - Panjabi, Southern - - - Reasati - - - Riasati - - - Saraiki - - - Southern Lahnda - - - Southern Panjabi - - - - Sirāikī Hindkī - - Siraiki Lahndi - - - - Sirāikī Sindhī - - Sindhi, Siraiki - - - - - info:lc/vocabulary/languages/lam - Lamba (Zambia and Congo) - lam - - - info:lc/vocabulary/languages/lao - Lao - lao - - - info:lc/vocabulary/languages/lat - Latin - lat - - Latin, Vulgar - - - Vulgar Latin - - - - info:lc/vocabulary/languages/lav - Latvian - lav - - Lettish - - - Latgalian - - East Latvian - - - High Latvian - - - Letgalian - - - - - info:lc/vocabulary/languages/lez - Lezgian - lez - - - info:lc/vocabulary/languages/lim - Limburgish - lim - - Limburger - - - - info:lc/vocabulary/languages/lin - Lingala - lin - - Bangala (Congo) - - - Mangala (Congo) - - - Ngala (Congo) - - - - info:lc/vocabulary/languages/lit - Lithuanian - lit - - - info:lc/vocabulary/languages/jbo - Lojban (Artificial language) - jbo - - - info:lc/vocabulary/languages/nds - Low German - nds - - German, Low - - - Low Saxon - - - Plattdeutsch - - - Plautdietsch - - - Saxon, Low - - - - info:lc/vocabulary/languages/dsb - Lower Sorbian - dsb - - Sorbian, Lower - - - - info:lc/vocabulary/languages/loz - Lozi - loz - - Kololo - - - Rozi - - - Sikololo - - - - info:lc/vocabulary/languages/lub - Luba-Katanga - lub - - Chiluba - - - Katanga - - - - info:lc/vocabulary/languages/lua - Luba-Lulua - lua - - Ciluba - - - Kalebwe (Luba-Lulua) - - - Luba, Western - - - Luba-Kasai - - - Western Luba - - - - info:lc/vocabulary/languages/lui - Luiseño - lui - - - info:lc/vocabulary/languages/smj - Lule Sami - smj - - Lapp, Swedish - - - Sami, Lule - - - Swedish Lapp - - - - info:lc/vocabulary/languages/lun - Lunda - lun - - - info:lc/vocabulary/languages/luo - Luo (Kenya and Tanzania) - luo - - Dho Luo - - - Gaya - - - Jo Luo - - - Kavirondo, Nilotic - - - Nife - - - Nilotic Kavirondo - - - Nyife - - - Wagaya - - - - info:lc/vocabulary/languages/lus - Lushai - lus - - Dulien - - - Mizo - - - Sailau - - - - info:lc/vocabulary/languages/ltz - Luxembourgish - ltz - - Letzebuergesch - - - Letzeburgesch - - - Luxembourgeois - - - Luxemburgian - - - - info:lc/vocabulary/languages/mac - Macedonian - mac - - Bǎlgarski (Macedonian) - - - Balgàrtzki (Macedonian) - - - Bolgàrtski (Macedonian) - - - Bulgàrtski (Macedonian) - - - Dópia - - - Entópia - - - Macedonian Slavic - - - Makedoniski - - - Makedonski - - - Slavic (Macedonian) - - - Slaviká (Macedonian) - - - Slavomacedonian - - - - info:lc/vocabulary/languages/mad - Madurese - mad - - - info:lc/vocabulary/languages/mag - Magahi - mag - - Bihari (Magahi) - - - Magadhi - - - Magaya - - - Maghadi - - - Maghai - - - Maghaya - - - Maghori - - - Magi (India) - - - Magodhi - - - Megahi - - - - info:lc/vocabulary/languages/mai - Maithili - mai - - Apabhramsa (Maithili) - - - Bihari (Maithili) - - - Maitili - - - Maitli - - - Methli - - - Tirahutia - - - Tirhuti - - - Tirhutia - - - Khotta (Maithili) - - Eastern Maithili - - - Khoratha - - - - - info:lc/vocabulary/languages/mak - Makasar - mak - - Macassarese - - - - info:lc/vocabulary/languages/mlg - Malagasy - mlg - - Hova - - - Madagascan - - - Malgache - - - Merina - - - Bara (Madagascar) - - - Betsileo - - - Masikoro - - - Sakalava - - - Tsimihety - - - - info:lc/vocabulary/languages/mla - Malagasy - mla - - - info:lc/vocabulary/languages/may - Malay - may - - Palembang Malay - - - - info:lc/vocabulary/languages/mal - Malayalam - mal - - Malabar - - - Moplah - - - - info:lc/vocabulary/languages/mlt - Maltese - mlt - - - info:lc/vocabulary/languages/mnc - Manchu - mnc - - - info:lc/vocabulary/languages/mdr - Mandar - mdr - - Andian - - - - info:lc/vocabulary/languages/man - Mandingo - man - - Malinka - - - Mandeka - - - Maninka - - - Meninka - - - - info:lc/vocabulary/languages/mni - Manipuri - mni - - Meithei - - - - info:lc/vocabulary/languages/mno - Manobo languages - mno - - Agusan Manobo - - - Ata Manobo - - - Binukid Manobo - - Binokid - - - Bukidnon - - - - Cotabato Manobo - - - Dibabawon - - Debabaon - - - Dibabaon - - - Mandaya - - - - Higaonon - - - Ilianen Manobo - - - Kagayanen - - Cagayano Cillo - - - - Manuvu - - Bagobo, Upper - - - Upper Bagobo - - - - MatigSalug - - - Sarangani Manobo - - Culamanes - - - Kulaman - - - - Western Bukidnon Manobo - - Bukidnon Manobo, Western - - - Central Manobo - - - Central Mindanao Manobo - - - - - info:lc/vocabulary/languages/glv - Manx - glv - - Manx Gaelic - - - - info:lc/vocabulary/languages/max - Manx - max - - - info:lc/vocabulary/languages/mao - Maori - mao - - South Island Maori - - Maori, South Island - - - - - info:lc/vocabulary/languages/arn - Mapuche - arn - - Araucanian - - - Mapudungun - - - - info:lc/vocabulary/languages/mar - Marathi - mar - - Mahratta - - - Mahratti - - - Murathee - - - Are - - Ade Basha - - - Aray - - - Arrey - - - Arya - - - Kalika Arya Bhasha - - - - Koshti (Marathi) - - Kosti (Marathi) - - - - Kunabi - - - Varhadi Nagpuri - - Berar Marathi - - - Berari - - - Dhanagari - - - Kumbhari - - - Madhya Pradesh Marathi - - - Nagpuri (Varhadi Nagpuri) - - - Nagpuri-Varhadi - - - Varhadi-Nagpuri Marathi - - - - - info:lc/vocabulary/languages/chm - Mari - chm - - Cheremissian - - - - info:lc/vocabulary/languages/mah - Marshallese - mah - - Ebon - - - - info:lc/vocabulary/languages/mwr - Marwari - mwr - - Bikaneri - - - Dingal - - - Mewari - - Mevadi - - - Mewa - - - Mewadi - - - - Shekhawati - - Sekhavati - - - - - info:lc/vocabulary/languages/mas - Massai - mas - - Maa (Kenya and Tanzania) - - - Masai - - - - info:lc/vocabulary/languages/myn - Mayan languages - myn - - Achi - - Cubulco Achi - - - Rabinal Achi - - - - Akatek - - Acateco - - - Kanjobal, Western - - - San Miguel Acatán Kanjobal - - - Western Kanjobal - - - - Awakateko - - Aguacatec - - - - Cakchikel - - Kacchiquel - - - - Chol - - - Chontal of Tabasco - - - Chorti - - - Chuj - - - Huastec - - Guastec - - - Wastek - - - - Itzá - - - Ixil - - - Jacalteca - - Jakalteka - - - - Kanjobal - - Conob - - - - Kekchi - - Cacchi - - - Ghec-chi - - - Quekchi - - - - Lacandon - - - Mam - - Zaklohpakap - - - - Maya - - Yucatecan - - - - Mochó - - Motozintlec - - - - Mopan - - Manche - - - - Pokomam - - Pocomam - - - Poqomam - - - - Pokonchi - - - Quiché - - Kiché - - - Utlateca - - - - Tectiteco - - Teco (Mayan) - - - - Tojolabal - - Chañabal - - - - Tzeltal - - Celdal - - - Tseltal - - - Zendal - - - - Tzotzil - - Chamula - - - Querene - - - Zotzil - - - - Tzutuhil - - Zutuhil - - - - Uspanteca - - - - info:lc/vocabulary/languages/men - Mende - men - - - info:lc/vocabulary/languages/mic - Micmac - mic - - - info:lc/vocabulary/languages/min - Minangkabau - min - - Menangkabau - - - - info:lc/vocabulary/languages/mwl - Mirandese - mwl - - - info:lc/vocabulary/languages/mis - Miscellaneous languages - mis - - Andamanese - - - Burushaski - - Boorishki - - - Khajuna - - - - Chukchi - - Tchuktchi - - - Tuski - - - - Etruscan - - - Gilyak - - Guiliak - - - Nivkh - - - - Hattic - - Hattian - - - Khattic - - - Khattili - - - Khattish - - - Proto-Hittite - + + Lindrou + + + Lundayeh + + Lun Daya + + + Lun Daye + + + Lun Dayho + + + Lundaya + + + Southern Murut + + + + Manam + + + Mandak + + Lelet + + + + Mandara (Papua New Guinea) + + Madara + + + Tabar + + + + Mangap + + Mbula (Mangap) + + + + Manggarai (Indonesia) + + + Mangseng + + + Marquesan + + + Mekeo + + + Mele-Fila + + Fila + + + + Mentawai + + + Mokilese + + + Mori + + Aikoa + + + + Mortlockese + + Mortlock (Micronesia) + + + Nomoi + + + + Motu + + + Mouk + + + Mukawa + + Kapikapi + + + + Muna + + Mina (Indonesia) + + + Wuna + + + + Nakanai + + Lakalai + + + + Nali + + Yiru + + + + Napu + + Bara (Indonesia) + + + + Nemi + + + Nengone + + + Ngada + + + Ngaju + + Biadju + + + Ngaju Dayak + + + + Ngatik + + + Nguna + + + Notsi + + Nochi + + + + Nuaulu + + + Nukuoro + + + Numfor + + Mafor + + + Noemfoor + + + Nufor + + + + Paiwan + + + Pala + + + Paranan + + Palanan + + + + Pasir (Lawangan) + + + Pazeh + + Bazai + + + + Petats + + + Pileni + + + Puluwat + + + Puyuma + + Kadas language (Puyuma) + + + Panapanayan + + + Pelam + + + Pilam + + + Piyuma + + + Pyuma + + + Tipun + + + + Ramoaaina + + Malu (Papua New Guinea) + + + + Rejang (Sumatra, Indonesia) + + Redjang (Sumatra, Indonesia) + + + + Rennellese + + Bellonese + + + Munggava + + + + Roti + + Rottinese + + + + Rotuman + + + Rukai + + Drukai + + + + Rungus + + Dusun Dayak + + + Melobong Rungus + + + Memagun + + + Memogun + + + Momogun + + + Roongas + + + Rungus Dusun + + + + Saaroa + + La'alua + + + La'arua + + + Pachien + + + Paichien + + + Rarua + + + Saarua + + + Saroa + + + Shishaban + + + Sisyaban + + + + Sangen + + + Sangil + + Sangiré + + + + Sangir (Indonesia and Philippines) + + Sangihe + + + + Saposa + + + Sawu + + Havunese + + + Hawu + + + Sabu + + + Savu + + + + Sedik + + Sazek + + + Seedik + + + Shedekka + + + + Semendo + + + Serawai + + + Sigi + + Idja + + + + Sikka + + + Siladang + + + Sinagoro + + + Sio + + + Sissano + + + Sobei + + + Sokop + + + Sonsorol-Tobi + + Tobi + + + + Suau + + + Sumba + + + Sumbawa + + Semana + + + Soembawa + + + + Sursurunga + + + Suwawa + + Bunda (Indonesia) + + + + Tagal Murut + + Murut Tahol + + + Semambu + + + Semembu + + + Sumambu + + + Sumambu-Tagal + + + Sumambuq + + + + Tagula + + Sudest + + + + Takuu + + Mortlock (Papua New Guinea) + + + Nahoa + + + Taku + + + Taʻu + + + Tauu + + + + Talaud + + Talaoed + + + + Tamuan + + + Tanga (Tanga Islands) + + + Tavara (Papua New Guinea) + + Kehelala + + + Tawala + + + + Tawoyan + + + Teop + + Tiop + + + + Tidore + + + Tikopia + + + Timor + + Atoni + + + Timorese + + + + Timugon + + + Tinputz + + Timputs + + + Vasuii + + + Wasoi + + + + Tolai + + Blanche Bay + + + Gunantuna + + + Kuanua + + + New Britain + + + Raluana + + + Tinata Tuna + + + Tuna + + + + Tolaki + + Kendari + + + Toolaki + + + + Tombulu + + Toumbulu + + + + Tondano + + Tolou + + + Tolour + + + + Tonsea + + + Toraja + + Toradja + + + + Toraja Sa'dan + + Sadan (Indonesia) + + + Saqdab Toraja + + + South Toraja + + + Tae' + + + + Tuamotuan + + Paumotu + + + + Tubetube + + + Ulithi + + + Uma + + Pipikoro + + + + Urak Lawoi̕ + + Chāo Lē + + + Orak Lawoi' + + + Orang Laut (Thailand and Malaysia) + + + + Uripiv + + + Wampar + + + Wandamen + + Windesi + + + Wondama + + + + Wewewa + + Sumba, West + + + Waidjewa + + + West Sumba + + + + Woleaian + + Uleai + + + Woleai + + + + Wolio + + + Yabim + + Jabêm + + + + Yamdena + + Jamdena + + + + + info:lc/vocabulary/languages/ava + Avaric + ava + + + info:lc/vocabulary/languages/ave + Avestan + ave + + Avesta + + + Bactrian, Old (Avestan) + + + Old Bactrian (Avestan) + + + Zend + + + + info:lc/vocabulary/languages/awa + Awadhi + awa + + + info:lc/vocabulary/languages/aym + Aymara + aym + + Aimara + + + + info:lc/vocabulary/languages/aze + Azerbaijani + aze + + Azari + + + Azeri + + + Afshar + + + + info:lc/vocabulary/languages/ast + Bable + ast + + Asturian + + + + info:lc/vocabulary/languages/ban + Balinese + ban + + + info:lc/vocabulary/languages/bat + Baltic (Other) + bat + + Curonian + + + Proto-Baltic + + + Prussian + + Old Prussian + + + + + info:lc/vocabulary/languages/bal + Baluchi + bal + + Balochi + + + Beloutchi + + + Biluchi + + + + info:lc/vocabulary/languages/bam + Bambara + bam + + Bamana (Mandekan) + + + Bamanankan + + + + info:lc/vocabulary/languages/bai + Bamileke languages + bai + + Bandjoun + + Bamileke-Jo + + + + Fe'fe' + + Bafang + + + Bamileke-Fe'fe' + + + Bana (Bamileke) + + + Fa (Bamileke) + + + Fan (Bamileke) + + + Fanwe (Bamileke) + + + Fe'e fe'e + + + Fotouni + + + Kuu + + + Nufi + + + + Ngyemboon + + Nguemba (Bamileke) + + + + Yemba + + + + info:lc/vocabulary/languages/bad + Banda languages + bad + + Banda (Central Africa) + + + Linda + + + + info:lc/vocabulary/languages/bnt + Bantu (Other) + bnt + + Abo (Cameroon) + + Abaw + + + Bo (Cameroon) + + + Bon (Cameroon) + + + + Aka (Central African Republic) + + + Asu + + Athu + + + Chasu + + + Pare + + + + Bafia + + + Bakundu + + Kundu + + + + Bati + + + Bekwil + + Bakwele + + + Bakwil + + + Bekwel + + + Bekwie + + + Bekwyel + + + Kwele + + + Okpele + + + + Bembe (Congo (Brazzaville)) + + KiBembe + + + Mbembe + + + + Benga + + + Bobangi + + Rebu + + + + Bolia + + Bulia + + + + Boma (Congo) + + Buma (Congo) + + + + Bomitaba + + Mbomitaba + + + Mitaba + + + + Bondei + + Bonde + + + Boondei + + + Kibondei + + + Wabondei + + + + Bube + + Bubi (Equatorial Guinea) + + + Fernandian + + + + Bubi (Gabon) + + Pove + + + + Budu + + + Bukusu + + Lubukusu + + + + Bulu + + Boulou + + + + Camtho + + Iscamtho + + + Isicamtho + + + Shalambombo + + + Tsotsitaal (Camtho) + + + + Chaga + + Djaga + + + Dschagga + + + Jagga + + + Tschagga + + + + Chokwe + + Cibokwe + + + Cokwe + + + Jok + + + Katchokue + + + Kioko + + + Quioco + + + Tutchokue + + + + Chopi + + Lenge + + + + Comorian + + + Diriku + + Mbogedo + + + Rugciriku + + + Rumanyo + + + Shimbogedu + + + + Doko (Congo) + + + Duruma + + + Embu + + + Enahara + + Emathipane + + + Enaharra + + + Maharra + + + Nahara + + + Naharra + + + + Fipa + + + Fuliru + + + Ganguela + + Ngangela + + + + Geviya + + Avias + + + Eviya + + + Viya + + + + Giryama + + + Gisu + + Lugisu + + + Lumasaaba + + + Masaba + + + + Gungu + + Lugungu + + + Rugungu + + + + Gusii + + Ekegusii + + + Kisii + + + + Gweno + + Kigweno + + + + Gwere + + + Ha + + + Haya + + Luhaya + + + Lusiba + + + Ruhaya + + + Ziba + + + + Hehe + + + Hunde + + + Ikizu + + Ikiizo + + + Ikikizo + + + Ikikizu + + + Kiikizu + + + + Ila + + + Jita + + Echijita + + + Ecijita + + + Kijita + + + + Kahe + + Kikahe + + + + Kako + + Kaka (Northwest Bantu) + + + Yaka (Cameroon and Central African Republic) + + + + Kalanga (Botswana and Zimbabwe) + + + Kaonde + + Luba-Kaonde + + + + Kare + + Akare + + + Bakare + + + + Kele (Gabon) + + + Kete + + + Kom (Cameroon) + + Nkom + + + + Kombe + + + Komo (Congo) + + Kumu + + + + Koonzime + + Djimu + + + Dzimou + + + Konzime + + + Kooncimo + + + Koozhime + + + Koozime + + + Nzime + + + Zimu + + + + Kuria + + Ekiguria + + + Igikuria + + + Ikikuria + + + Kikoria + + + Kikouria + + + Kikuria + + + Kikuria cha juu + + + Kikuria cha Mashariki + + + Koria + + + Kurya + + + Kurye + + + Tende (Kuria) + + + + Kwangali + + + Kwese + + Kwezo + + + + Kwiri + + Mokpwe + + + + Lala + + + Lega + + + Lenje + + Bwine-Mukuni + + + Ci-Renje + + + + Logooli + + Ragoli + + + + Lomwe (Malawi) + + + Lucazi + + Ponda + + + + Luvale + + + Luyana + + + Luyia + + Oluluyia + + + + Maka (Cameroon) + + Makaa (Cameroon) + + + Mekaa + + + + Makhuwa + + Central Makhuwa + + + Emakhuwa + + + Emakua + + + Macua + + + Makhuwa-Makhuwana + + + Makhuwwa of Nampula + + + Makoane language + + + Makua (Mozambique) + + + Maquoua (Makhuwa) + + + + Makonde + + Chimakonde + + + Konde (Yao group) + + + + Makwe + + Kimakwe + + + Macue + + + Maraba (Makwe) + + + Palma + + + + Mashami + + Kimashami + + + Machambe + + + Machame + + + Madschame + + + + Mbala (Bandundu, Congo) + + + Mbo (Cameroon) + + + Mbosi + + + Mbukushu + + Goba + + + Mambukush + + + Mpukush + + + Thimbukushu + + + + Mbunda (Angola and Zambia) + + + Meru + + Kimeru + + + + Mijikenda languages + + Nika languages + + + Nyika languages + + + + Mituku + + + Mkaaʼ + + Bakaka + + + + Mochi + + Kimochi + + + Kimoshi + + + Moshi (Tanzania) + + + Mosi (Tanzania) + + + Old Moshi + + + + Mpiemo + + Bimu + + + Mbimou + + + Mbimu + + + Mbyemo + + + Mpo + + + Mpyemo + + + + Mpongwe + + Pongwe + + + + Mpur (Congo) + + + Nambya + + + Nande + + Nandi (Congo) + + + + Ndau + + Chindau + + + Shona, Southeastern + + + + Ndumu + + + Ngonde + + Ikinyi-Kiusa + + + Kiusa + + + Konde (Nyakyusa) + + + Mombe + + + Nkonde + + + Nyakyusa + + + Sochile + + + + Ngul + + Engwî + + + Ingul + + + Kingóli + + + Ngoli + + + Nguli + + + Ngulu (Congo (Democratic Republic)) + + + Ngwi (Congo (Democratic Republic)) + + + + Nsenga + + + Ntomba + + + Nyaneka + + Lunyaneka + + + Olunyaneka + + + + Nyanga + + + Nyole (Uganda) + + Lunyole (Uganda) + + + Nyule + + + Nyuli + + + + Nyungwe + + Tete + + + + Nzebi + + Bandzabi + + + Indzèbi + + + Injebi + + + Ndjabi + + + Ndjebi + + + Ndjevi + + + Njabi + + + Njevi + + + Nzabi + + + Yinzabi + + + + Pangwa + + + Pelende + + + Pende + + Kipende + + + Pindi (Pende) + + + + Pokomo + + + Punu + + Bapounou + + + Pounou + + + + Rangi + + Irangi + + + Kilangi + + + Kirangi + + + Langi (Tanzania) + + + + Ronga + + Landim + + + Shironga + + + Xironga + + + + Ruri + + Ciruuri + + + Kiruri + + + Ruuri + + + + Ruund + + Chiluwunda + + + Lunda, Northern + + + Luwunda + + + Muatiamvua + + + Northern Lunda + + + Uruund + + + + Saamia + + Luhya (Saamia) + + + Luluyia (Saamia) + + + Lusaamia + + + Luyia (Saamia) + + + Ólusaamya + + + Olusamia + + + Samia + + + Samya + + + + Sakata + + + Salampasu + + Chisalampasu + + + + Sanga + + Luba, Southern + + + Southern Luba + + + + Sena + + + Shambala + + + Shi + + Mashi + + + Nyabungu + + + + Shimaore + + Mahorais + + + + Simbiti + + Kisimbiti + + + + Songye + + Songe + + + + Subiya + + ciIkuhane + + + Ikuhane + + + Soubiya + + + + Suku (Congo) + + + Sumbwa + + Kisumbwa + + + Shisumbwa + + + Sisumbwa + + + Sisuumbwa + + + + Taita + + Sagalla + + + Teita + + + + Talinga-Bwisi + + Bwisi-Talinga + + + Kitalinga + + + + Teke + + Balali + + + Ilali + + + Itio + + + Lali + + + + Tembo (Sud-Kivu, Congo) + + KiTembo + + + + Temi + + Gitemi + + + Kisonjo + + + Sonjo + + + Sonyo + + + Wasonjo + + + Watemi + + + + Tetela + + + Tharaka + + Saraka + + + + Tiene + + Ketiine + + + Kitiene + + + Kitiini + + + Tende (Congo (Democratic Republic)) + + + + Tiriki + + + Tonga (Inhambane) + + Gitonga + + + + Tonga (Zambezi) + + + Tooro + + Toro + + + + Tsogo + + Apindji + + + Mitsogo + + + + Tswa + + Kitswa + + + Shitswa + + + Tshwa + + + Xitswa + + + + Tunen + + Banen + + + + Yaka (Congo and Angola) + + Iaka + + + + Yanzi + + + Yombe (Congo and Angola) + + + Zanaki + + Iki-Zanaki + + + IkiZanaki + + + + Zigula + + Kizigula + + + Seguha + + + Wayombo + + + Wazegua + + + Wazigua + + + Zeguha + + + Zegura + + + Zigoua + + + Zigua + + + Zigwa + + + + Zinza + + Dzinda + + + Dzindza + + + Echidzindza + + + Echijinja + + + Eciinja + + + Ecizinza + + + Jinja + + + Kizinza + + + Luzinza + + + Zinja + + + + + info:lc/vocabulary/languages/bas + Basa + bas + + + info:lc/vocabulary/languages/bak + Bashkir + bak + + + info:lc/vocabulary/languages/baq + Basque + baq + + Euskara + + + + info:lc/vocabulary/languages/btk + Batak + btk + + Batta (Sumatra) + + + Alas + + + Angkola + + + Dairi Pakpak + + Pakpak + + + + Karo-Batak + + + Mandailing + + Batak Mandailing + + + + Simelungun + + + Toba-Batak + + + + info:lc/vocabulary/languages/bej + Beja + bej + + Bedawiye + + + Bedja + + + Bishári + + + + info:lc/vocabulary/languages/bel + Belarusian + bel + + Belorussian + + + Byelorussian + + + Russian, White + + + White Russian + + + + info:lc/vocabulary/languages/bem + Bemba + bem + + + info:lc/vocabulary/languages/ben + Bengali + ben + + Banga-Bhasa + + + Bangala + + + Bangla + + + Sylheti + + Sylhet + + + Sylhetti Bangla + + + + + info:lc/vocabulary/languages/ber + Berber (Other) + ber + + Mzab + + Mozabite + + + + Rif + + Northern Shilha + + + Shilha, Northern + + + Tarifit + + + + Shilha + + Chleuh + + + Sölha + + + Tachelhait + + + Tashelhiyt + + + + Tamazight + + + + info:lc/vocabulary/languages/bho + Bhojpuri + bho + + Bajpuri + + + Bhojapuri + + + Bhozpuri + + + Bihari (Bhojpuri) + + + Deswali (Bhojpuri) + + + Khotla + + + Piscimas + + + Sadani + + Chota Nagpuri + + + Chotar Nagpuri + + + Dikku Kaji + + + Dikkukaji + + + Nagpuri (Bhojpuri) + + + Nagpuriā + + + Napuria + + + Sadan + + + Sadari + + + Sadati + + + Sadhan + + + Sadhana + + + Sadharan + + + Sadna + + + Sadri + + + Sadrik + + + Santri + + + Siddri + + + Sradri + + + + Western Standard Bhojpuri + + Benarsi + + + Bhojpuri, Western Standard + + + Purbi + + + + + info:lc/vocabulary/languages/bih + Bihari (Other) + bih + + Behari + + + Bajjika + + + Kudmali + + Bedia + + + Dharua + + + Khotta (Kurmali) + + + Kurma + + + Kurmali + + + Kurmali Thar + + + Kurmik + + + Kurni + + + Kurumali + + + + + info:lc/vocabulary/languages/bik + Bikol + bik + + Vikol + + + + info:lc/vocabulary/languages/byn + Bilin + byn + + + info:lc/vocabulary/languages/bis + Bislama + bis + + Beach-la-mar + + + Bêche-de-mer + + + Bichelamar + + + + info:lc/vocabulary/languages/zbl + Blissymbolics + zbl + + + info:lc/vocabulary/languages/bos + Bosnian + bos + + + info:lc/vocabulary/languages/bra + Braj + bra + + Braj bhākhā + + + Braj bhāshā + + + Pingal + + + + info:lc/vocabulary/languages/bre + Breton + bre + + Armoric + + + + info:lc/vocabulary/languages/bug + Bugis + bug + + Buginese + + + + info:lc/vocabulary/languages/bul + Bulgarian + bul + + + info:lc/vocabulary/languages/bua + Buriat + bua + + Buryat + + + Mongolian, Northern + + + Northern Mongolian + + + + info:lc/vocabulary/languages/bur + Burmese + bur + + + info:lc/vocabulary/languages/cad + Caddo + cad + + + info:lc/vocabulary/languages/car + Carib + car + + Galibi + + + + info:lc/vocabulary/languages/cat + Catalan + cat + + Majorcan Catalan + + Catalan, Majorcan + + + + Valencian Catalan + + Catalan, Valencian + + + + + info:lc/vocabulary/languages/cau + Caucasian (Other) + cau + + Abazin + + + Bats + + Bac + + + Tsova-Tush + + + Tush + + + + Bezhta + + + Botlikh + + + Budukh + + + Chamalal + + + Dido + + Tsez + + + + Ginukh + + Ginukhtsy + + + Ginux + + + Hinukh + + + Hinux + + + + Hunzib + + Gunzib + + + + Kubachi + + + Lak + + + Laz + + Chan + + + Chanuri + + + Chanzan + + + Laze + + + Lazian + + + Lazuri + + + Zan + + + + Mingrelian + + + Svan + + + Tabasaran + + + Tsakhur + + + Ubykh + + Oubykh + + + + Udi + + + + info:lc/vocabulary/languages/ceb + Cebuano + ceb + + Binisaya + + + Bisayan + + + Sebuano + + + Sinugboanon + + + Sugbuanon + + + Sugbuhanon + + + Visayan + + + + info:lc/vocabulary/languages/cel + Celtic (Other) + cel + + Celtiberian + + Celti-Iberian + + + Celto-Iberian + + + + Gaulish + + Gallic + + + + Proto-Celtic + + Common Celtic + + + + Welsh, Middle (ca. 1100-1400) + + Middle Welsh (ca. 1100-1400) + + + + Welsh, Old (to 1100) + + Old Welsh (to 1100) + + + + + info:lc/vocabulary/languages/cai + Central American Indian (Other) + cai + + Use for the other languages of Central America and Mexico, as well as for the + languages of the Azteco-Tanoan language phylum. + + + + Amuzgo + + Amishgo + + + + Boruca + + Brunka + + + Burunca + + + + Bribri + + + Cabecar + + + Cahita + + + Cahuilla + + Coahuila + + + Kawia (Shoshone) + + + + Chatino + + + Chiapanec + + + Chinantecan languages + + + Chocho + + + Chontal + + Tequistlateca + + + + Cochimi + + + Comanche + + + Cora + + Chora + + + Nayarita + + + + Cuicatec + + + Cuitlateco + + Teco (Cuitlateco) + + + + Cupeño + + + Eudeve + + Batuco + + + Dohema + + + Hegue + + + + Garifuna + + Black Carib + + + Carib, Black + + + + Guarijío + + Huarijío + + + Warijío + + + + Guatuso + + Maléku Jaíka + + + + Guaymi + + + Hopi + + Moki + + + + Huave + + + Huichol + + Guichola + + + + Ixcateco + + + Jicaque + + Tol + + + Torrupan + + + Xicaque + + + + Kawaiisu + + + Kiowa + + Kayowe + + + + Lenca + + + Mangue + + Choluteca + + + + Matagalpa + + Cacaopera + + + + Mayo (Piman) + + + Mazateco + + + Miskito + + Mosquito + + + + Mixe + + Ayook + + + + Mixtec + + + Opata + + + Panamint + + Coso + + + Koso + + + Tümpisa + + + + Pima + + + Popoloca + + + Rama + + + Seri + + + Serrano + + Maarrenga'twich + + + + Shoshoni + + + Sierra Popoluca + + Highland Popoluca + + + Popoluca, Highland + + + Popoluca of Vera Cruz + + + + Southern Paiute + + Paiute, Southern + + + + Sumo + + + Tarahumara + + Rarámuri + + + + Tarascan + + Michoacana + + + Phurhembe + + + Purepecha + + + + Tepehuan + + O'dam + + + + Terraba + + Teribe + + + Tirribi + + + + Tewa + + + Tlapanec + + Chocho (Tlapanec) + + + Tiapaneco + + + + Tohono O'odham + + Papago + + + + Totonac + + + Trique + + + Ulva + + Woolwa + + + Wulwa + + + + Ute + + + Yaqui + + + Zoque + + Soke + + + + + info:lc/vocabulary/languages/chg + Chagatai + chg + + Dschagatai + + + Jagataic + + + Old Uzbek + + + Tschagatai + + + Uzbek, Old + + + + info:lc/vocabulary/languages/cmc + Chamic languages + cmc + + Cham + + Čam + + + + Haroi + + + Jarai + + + Rade + + Ede + + + Rhade + + + + Roglai + + + + info:lc/vocabulary/languages/cha + Chamorro + cha + + Tjamoro + + + + info:lc/vocabulary/languages/che + Chechen + che + + Tchetchen + + + + info:lc/vocabulary/languages/chr + Cherokee + chr + + + info:lc/vocabulary/languages/chy + Cheyenne + chy + + + info:lc/vocabulary/languages/chb + Chibcha + chb + + + info:lc/vocabulary/languages/chi + Chinese + chi + + Cantonese + + + Mandarin + + + + info:lc/vocabulary/languages/chn + Chinook jargon + chn + + Chinook pidgin + + + + info:lc/vocabulary/languages/chp + Chipewyan + chp + + Dene (Chipewyan) + + + Montagnais (Athapascan) + + + + info:lc/vocabulary/languages/cho + Choctaw + cho + + Chahta + + + + info:lc/vocabulary/languages/chu + Church Slavic + chu + + Bulgarian, Old (to 1100) + + + Old Bulgarian (to 1100) + + + Old Church Slavic + + + Old Slovenian + + + Slavonic, Old Church + + + Slovenian, Old + + + + info:lc/vocabulary/languages/chk + Chuukese + chk + + Truk + + + + info:lc/vocabulary/languages/chv + Chuvash + chv + + + info:lc/vocabulary/languages/cop + Coptic + cop + + + info:lc/vocabulary/languages/cor + Cornish + cor + + + info:lc/vocabulary/languages/cos + Corsican + cos + + Corse + + + Corsi + + + Corso + + + Corsu + + + + info:lc/vocabulary/languages/cre + Cree + cre + + Cris + + + Knistenaux + + + Maskegon + + + + info:lc/vocabulary/languages/mus + Creek + mus + + Maskoki + + + Muscogee + + + + info:lc/vocabulary/languages/crp + Creoles and Pidgins (Other) + crp + + Pidgins + + + Ambonese Malay + + Malay, Ambonese + + + + Betawi + + Batawi + + + Jakarta Malay + + + Malay, Jakarta + + + + Chabacano + + Chavacano + + + Zamboangueño + + + + Fanakalo + + Fanagalo + + + Pidgin Kaffir + + + + Kituba (Congo (Democratic Republic)) + + Kibulamatadi + + + Kikongo Commercial + + + Kikongo-Kutuba + + + Kikongo Simplifié + + + Kikongo ya Leta + + + Kikwango + + + Kileta + + + + Naga Pidgin + + Nagamese + + + + San Basilio del Palenque Spanish Creole + + Palenquero (Colombia) + + + Spanish Creole, San Basilio del Palenque + + + + Unami jargon + + + + info:lc/vocabulary/languages/cpe + Creoles and Pidgins, English-based (Other) + cpe + + Bamyili Creole + + + Djuka + + Aucaans + + + Aukan + + + Djoeka + + + Ndjuka + + + + English-based Creoles and Pidgins (Other) + + + Fitzroy Valley Kriol + + + Hawaiian Pidgin English + + + Jamaican Creole + + + Krio + + Aku (Creole) + + + + Kriol + + + Pijin + + Neo-Solomonic + + + Solomons Pidgin + + + + Pidgin English + + + Saramaccan + + + Sea Islands Creole + + Geechee + + + Gullah + + + + + info:lc/vocabulary/languages/cpf + Creoles and Pidgins, French-based (Other) + cpf + + French-based Creoles and Pidgins (Other) + + + Dominican French Creole + + French Creole, Dominican + + + + Louisiana French Creole + + French Creole, Louisiana + + + + Mauritian French Creole + + French Creole, Mauritian + + + + Michif + + Cree, French + + + French Cree + + + Mitchif + + + + Reunionese French Creole + + French Creole, Reunionese + + + + Seychellois French Creole + + French Creole, Seychellois + + + + + info:lc/vocabulary/languages/cpp + Creoles and Pidgins, Portuguese-based (Other) + cpp + + Portuguese-based Creoles and Pidgins (Other) + + + Annobon + + Ambu + + + + Cape Verde Creole + + Brava Island Creole + + + + Crioulo + + + Indo-Portuguese + + Ceylon Portuguese + + + + + info:lc/vocabulary/languages/crh + Crimean Tatar + crh + + Crimean Turkish + + + Tatar, Crimean + + + Turkish, Crimean + + + + info:lc/vocabulary/languages/hrv + Croatian + hrv + + + info:lc/vocabulary/languages/scr + Croatian + scr + + + info:lc/vocabulary/languages/cus + Cushitic (Other) + cus + + Alaba + + Alaaba + + + Allaaba + + + Halaba + + + + Burji + + + Dasenech + + Geleb + + + Marille + + + + Gedeo + + Darasa + + + Derasa + + + + Hadiya + + + Iraqw + + + Kambata + + + Qebena + + K'abena + + + Kebena + + + Qabena + + + Womba + + + Wombi Afoo + + + Wombisanat + + + + Rendille + + + Tunni + + + + info:lc/vocabulary/languages/cze + Czech + cze + + Bohemian + + + + info:lc/vocabulary/languages/dak + Dakota + dak + + Sioux + + + Assiniboine + + + Lakota + + Teton + + + + Santee + + + Yankton + + + + info:lc/vocabulary/languages/dan + Danish + dan + + + info:lc/vocabulary/languages/dar + Dargwa + dar + + Darghi + + + Dargin + + + + info:lc/vocabulary/languages/day + Dayak + day + + Bidayuh + + + Bideyu + + + Dajak + + + Dyak + + + Kendayan + + + Land Dayak + + + Biatah + + + + info:lc/vocabulary/languages/del + Delaware + del + + Lenape + + + Lenni Lenape + + + Munsee + + Minsi + + + + + info:lc/vocabulary/languages/din + Dinka + din + + Denca + + + + info:lc/vocabulary/languages/div + Divehi + div + + Dhivehi + + + Maldivian + + + + info:lc/vocabulary/languages/doi + Dogri + doi + + Dhogaryali + + + Dogari + + + Dogra + + + Dogri Jammu + + + Dogri-Kangri + + + Dogri Pahari + + + Dongari + + + Hindi Dogri + + + Tokkaru + + + Kangri + + Kangari + + + Kangra + + + + + info:lc/vocabulary/languages/dgr + Dogrib + dgr + + Thlingchadinne + + + + info:lc/vocabulary/languages/dra + Dravidian (Other) + dra + + Abujhmaria + + + Alu Kurumba + + + Brahui + + Berouhi + + + Birohi + + + Brohki + + + + Gadaba (Dravidian) + + Gadba (Dravidian) + + + Gudwa (Dravidian) + + + Gutob (Dravidian) + + + Konekor Gadaba + + + Ollari + + + Salur + + + + Kodagu + + Coorg + + + Kodava + + + Kurg + + + + Kolami + + + Kota (India) + + + Kui + + Kandh + + + + Kuvi + + + Malto + + + Pengo + + + Toda (India) + + Tuda (India) + + + + Tulu + + + + info:lc/vocabulary/languages/dua + Duala + dua + + Douala + + + + info:lc/vocabulary/languages/dut + Dutch + dut + + Flemish + + + Netherlandic + + + + info:lc/vocabulary/languages/dum + Dutch, Middle (ca. 1050-1350) + dum + + Diets + + + Middle Dutch + + + + info:lc/vocabulary/languages/dyu + Dyula + dyu + + Dioula + + + Diula + + + Jula + + + + info:lc/vocabulary/languages/dzo + Dzongkha + dzo + + Bhotia of Bhutan + + + Bhutanese + + + + info:lc/vocabulary/languages/frs + East Frisian + frs + + Frisian, East + + + + info:lc/vocabulary/languages/bin + Edo + bin + + Bini + + + + info:lc/vocabulary/languages/efi + Efik + efi + + Calabar + + + Ibibio + + + + info:lc/vocabulary/languages/egy + Egyptian + egy + + Demotic + + + Hieratic + + + Hieroglyphics (Egyptian) + + + + info:lc/vocabulary/languages/eka + Ekajuk + eka + + + info:lc/vocabulary/languages/elx + Elamite + elx + + Amardic + + + Anzanic + + + Susian + + + + info:lc/vocabulary/languages/eng + English + eng + + + info:lc/vocabulary/languages/enm + English, Middle (1100-1500) + enm + + Middle English + + + + info:lc/vocabulary/languages/ang + English, Old (ca. 450-1100) + ang + + Anglo-Saxon + + + Old English + + + West Saxon + + + + info:lc/vocabulary/languages/myv + Erzya + myv + + + info:lc/vocabulary/languages/esk + Eskimo languages + esk + + + info:lc/vocabulary/languages/epo + Esperanto + epo + + + info:lc/vocabulary/languages/esp + Esperanto + esp + + + info:lc/vocabulary/languages/est + Estonian + est + + Seto + + Setu + + + + Võro + + Võru + + + Werro + + + + + info:lc/vocabulary/languages/gez + Ethiopic + gez + + Geez + + + + info:lc/vocabulary/languages/eth + Ethiopic + eth + + + info:lc/vocabulary/languages/ewe + Ewe + ewe + + + info:lc/vocabulary/languages/ewo + Ewondo + ewo + + Jaunde + + + Yaounde + + + Yaunde + + + + info:lc/vocabulary/languages/fan + Fang + fan + + Fan (Bantu) + + + + info:lc/vocabulary/languages/fat + Fanti + fat + + + info:lc/vocabulary/languages/fao + Faroese + fao + + Faeroese + + + + info:lc/vocabulary/languages/far + Faroese + far + + + info:lc/vocabulary/languages/fij + Fijian + fij + + Viti + + + + info:lc/vocabulary/languages/fil + Filipino + fil + + + info:lc/vocabulary/languages/fin + Finnish + fin + + + info:lc/vocabulary/languages/fiu + Finno-Ugrian (Other) + fiu + + Ingrian + + Izhorskii + + + + Khanty + + Ostiak + + + Xanty + + + + Livonian + + + Ludic + + Lydi + + + + Mansi + + Vogul + + + + Mordvin + + Mordva + + + Mordvinian + + + + Veps + + + + info:lc/vocabulary/languages/fon + Fon + fon + + Dahoman + + + Djedji + + + Jeji + + + + info:lc/vocabulary/languages/fre + French + fre + + Allevard French + + French, Allevard + + + + Judeo-French + + Western Loez + + + Zarphatic + + + + Morvan French + + French, Morvan + + + + Poitevin French + + French, Poitevin + + + + Saintongeais French + + French, Saintongeais + + + + + info:lc/vocabulary/languages/frm + French, Middle (ca. 1300-1600) + frm + + Middle French + + + + info:lc/vocabulary/languages/fro + French, Old (ca. 842-1300) + fro + + Old French + + + + info:lc/vocabulary/languages/fry + Frisian + fry + + Friesian + + + West Frisian + + + Stadsfries + + Stadfries + + + Stedsk + + + Town Frisian + + + + + info:lc/vocabulary/languages/fri + Frisian + fri + + + info:lc/vocabulary/languages/fur + Friulian + fur + + + info:lc/vocabulary/languages/ful + Fula + ful + + Adamawa + + + Fulah + + + Fulani + + + Fulbe + + + Fulfulde + + + Peul + + + Poul + + + Bororo (West Africa) + + + Pular + + Poular + + + Toucouleur + + + Tukolor + + + + + info:lc/vocabulary/languages/gaa + + gaa + + Acra + + + Incran + + + + info:lc/vocabulary/languages/glg + Galician + glg + + Gallegan + + + + info:lc/vocabulary/languages/gag + Galician + gag + + + info:lc/vocabulary/languages/lug + Ganda + lug + + Luganda + + + + info:lc/vocabulary/languages/gay + Gayo + gay + + + info:lc/vocabulary/languages/gba + Gbaya + gba + + Baya + + + Gbeya + + + + info:lc/vocabulary/languages/geo + Georgian + geo + + Ingilo + + + + info:lc/vocabulary/languages/ger + German + ger + + Hochdeutsch + + + Alemannic + + Alamannic + + + Alemannisch + + + Allemannic + + + Allemannisch + + + Alsatian + + + Schwyzerdütsch + + + + Cimbrian + + Tzimbro + + + Zimbrisch + + + + + info:lc/vocabulary/languages/gmh + German, Middle High (ca. 1050-1500) + gmh + + Middle High German + + + + info:lc/vocabulary/languages/goh + German, Old High (ca. 750-1050) + goh + + Old High German + + + + info:lc/vocabulary/languages/gem + Germanic (Other) + gem + + Danish, Old (to 1500) + + Old Danish + + + + Dutch, Old (to 1050) + + Franconian, Old Low + + + Old Dutch + + + Old Low Franconian + + + + Frisian, Old (to 1500) + + Old Frisian + + + + Lombard + + + Old Saxon + + Low German, Old (ca. 850-1050) + + + Old Low German (ca. 850-1050) + + + Saxon, Old + + + + Pennsylvania German + + + Swedish, Old (to 1550) + + Old Swedish + + + + Walser + + + + info:lc/vocabulary/languages/gil + Gilbertese + gil + + Arorai + + + I-Kiribati + + + Kiribatese + + + + info:lc/vocabulary/languages/gon + Gondi + gon + + + info:lc/vocabulary/languages/gor + Gorontalo + gor + + + info:lc/vocabulary/languages/got + Gothic + got + + + info:lc/vocabulary/languages/grb + Grebo + grb + + Gdebo + + + Gedebo + + + Krebo + + + + info:lc/vocabulary/languages/grc + Greek, Ancient (to 1453) + grc + + Ancient Greek + + + Biblical Greek + + + Byzantine Greek + + + Classical Greek + + + Greek, Biblical + + + Greek, Byzantine + + + Greek, Classical + + + Greek, Hellenistic + + + Greek, Medieval + + + Greek, Patristic + + + Greek (Koine) + + + Hellenistic Greek + + + Koine (Greek) + + + Medieval Greek + + + Patristic Greek + + + Aeolic Greek + + Greek, Aeolic + + + + Attic Greek + + Greek, Attic + + + + Doric Greek + + Greek, Doric + + + + Ionic Greek + + Greek, Ionic + + + + + info:lc/vocabulary/languages/gre + Greek, Modern (1453- ) + gre + + East Cretan Greek + + Cretan Greek, East + + + Greek, East Cretan + + + + + info:lc/vocabulary/languages/grn + Guarani + grn + + Chiriguano + + Aba + + + Camba + + + Tembeta + + + + Chiripá + + Tsiripa + + + + Mbya + + + + info:lc/vocabulary/languages/gua + Guarani + gua + + + info:lc/vocabulary/languages/guj + Gujarati + guj + + Dhodia + + Dhobi + + + Dhoḍiyā + + + Dhore + + + Dhowari + + + Doria + + + + Gamit + + Gamati + + + Gāmīta + + + Gamta + + + Gavit + + + + Halari + + + Parsi-Gujarati + + + Saurashtri + + Patanuli + + + Patnuli + + + Saurashtra + + + Saurastra + + + Sawrashtra + + + Sourashtra + + + Sowrashtra + + + + Sidi + + + + info:lc/vocabulary/languages/gwi + Gwich'in + gwi + + Kutchin + + + Loucheux + + + Takudh + + + Tukudh + + + + info:lc/vocabulary/languages/hai + Haida + hai + + Skittagetan + + + + info:lc/vocabulary/languages/hat + Haitian French Creole + hat + + French Creole, Haitian + + + + info:lc/vocabulary/languages/hau + Hausa + hau + + + info:lc/vocabulary/languages/haw + Hawaiian + haw + + + info:lc/vocabulary/languages/heb + Hebrew + heb + + Ancient Hebrew + + + + info:lc/vocabulary/languages/her + Herero + her + + Himba + + Chimba + + + Cimba + + + Dhimba + + + Simba + + + Tjimba + + + + + info:lc/vocabulary/languages/hil + Hiligaynon + hil + + Ilongo + + + Panayan + + + + info:lc/vocabulary/languages/hin + Hindi + hin + + Badayuni + + + Bagheli + + Bagelkhandi + + + Bhugelkhud + + + Ganggai + + + Kawathi + + + Kenat + + + Kevat Boli + + + Kevati + + + Kewani + + + Kewat + + + Kewati + + + Kewot + + + Mandal + + + Mannadi + + + Riwai + + + + Bangaru + + Hariani + + + Jatu + + + + Bundeli + + Bundelkhandi + + + + Chattisgarhi + + Chhattisgarhi + + + Khalṭāhī + + + Khatahi + + + Laria + + + + Deswali + + + Kanauji + + Bhakha + + + Braj Kanauji + + + Kannaujī + + + + Khari Boli + + Kauravī + + + Khaṛībolī + + + Kourvi + + + + Marari + + + Pawari + + + Powari + + Povārī + + + + + info:lc/vocabulary/languages/hmo + Hiri Motu + hmo + + Police Motu + + + + info:lc/vocabulary/languages/hit + Hittite + hit + + + info:lc/vocabulary/languages/hmn + Hmong + hmn + + Humung + + + Meo + + + Miao + + + Mong + + + Hmong Njua + + Black Flowery Miao + + + Blue Miao + + + Green Hmong + + + Green Miao + + + Green Mong + + + Hmong Leng + + + Moob Ntsuab + + + Tak Meo + + + + She + + Ho Ne + + + Ho Nte + + + Huo Nte + + + She Yao + + + + White Hmong + + Hmong, White + + + Hmong Daw + + + Hmoob Dawb + + + Miao, White + + + White Miao + + + + + info:lc/vocabulary/languages/hun + Hungarian + hun + + Magyar + + + + info:lc/vocabulary/languages/hup + Hupa + hup + + + info:lc/vocabulary/languages/iba + Iban + iba + + Sea Dyak + + + + info:lc/vocabulary/languages/ice + Icelandic + ice + + + info:lc/vocabulary/languages/ido + Ido + ido + + + info:lc/vocabulary/languages/ibo + Igbo + ibo + + Ibo + + + + info:lc/vocabulary/languages/ijo + Ijo + ijo + + Djo + + + Dzo + + + Ejo + + + Ido (African) + + + Iyo (Nigeria) + + + Izo + + + Izon + + + Ojo + + + Oru + + + Udzo + + + Uzo + + + Ibani + + Bonny + + + Ubani + + + + Nembe + + Nimbi + + + + + info:lc/vocabulary/languages/ilo + Iloko + ilo + + Ilocano + + + + info:lc/vocabulary/languages/smn + Inari Sami + smn + + Finnish Lapp + + + Lapp, Finnish + + + Sami, Inari + + + + info:lc/vocabulary/languages/inc + Indic (Other) + inc + + Adiwasi Garasia + + Adivasi Garasia + + + Ādivāsī Garāsiyā + + + Adiwasi Girasia + + + Adiwasi Gujarati + + + Garasia Adivasi + + + + Ahirani + + Ahiri + + + + Apabhraṃśa + + Apabhramsha + + + + Avahattha + + + Bashgali + + Bashgal + + + Bashgari + + + Kamtoz + + + Katai + + + Kati + + + + Bhili + + + Bote-Majhi + + Bote-Mahi + + + Kushar + + + Pakhe-Bote + + + + Chakma + + + Changari + + + Chinali + + Chana (India) + + + Channali + + + Chinal + + + Dagi + + + Harijan + + + Shipi + + + + Danuwar Rai + + Denwar + + + Dhanvar + + + Dhanwar + + + Donwar + + + + Darai + + + Dehawali + + Dehavali + + + Dehwali + + + + Domaaki + + Bericho + + + Dom + + + Doma + + + Dumaki + + + + Dungra Bhil + + Dungari Bhili + + + Dungri Bhili + + + + Fiji Hindi + + Hindi, Fiji + + + + Garasiya + + Garahaiya + + + Girasia + + + + Garhwali + + Gadhavali + + + Gadhawala + + + Gadwahi + + + Gashwali + + + Girwali + + + Godauli + + + Gorwali + + + Gurvali + + + Pahari Garhwali + + + + Halbi + + Bastari + + + + Hindustani + + + Indus Kohistani + + Khili + + + Kohistani, Indus + + + Kohiste + + + Mair + + + Maiya + + + Maiyan + + + Maiyon + + + Shuthun + + + + Kalami + + Bashgharik + + + Bashkarik + + + Dir Kohistani + + + Diri (Kalami) + + + Dirwali + + + Gaawro + + + Garwa + + + Garwi + + + Gawri + + + Gowri + + + Kalam Kohistani + + + Kalami Kohistani + + + Kohistana + + + Kohistani, Dir + + + Kohistani, Kalam + + + Kohistani, Kalami + + + + Khandesi + + Dhed Gujari + + + Khandeshi + + + Khandish + + + + Khowar + + + Kumaoni + + Kamaoni + + + Kumau + + + Kumauni + + + Kumawani + + + Kumgoni + + + Kumman + + + Kunayaoni + + + + Kupia + + Valmiki + + + + Mawchi + + Mauchi + + + Māvacī + + + Mavchi + + + Mawachi + + + Mawchi Bhil + + + Mowchi + + + + Memoni + + + Parya + + Tajuzbeki + + + + Rajbangsi + + Kamtapuri + + + Rajbanshi + + + Rajbansi + + + Rajbongshi + + + + Rathvi + + Rāthavi + + + Rathwi + + + + Shina + + Sheena + + + Sina + + + + Suriname Hindustani + + Aili-Gaili + + + Hindustani, Suriname + + + Surinam Hindustani + + + Sarnami Hindi + + + + Tharu + + + Vaagri Boli + + + Veddah (Sinhalese) + + + Waigali + + Kalaṣa-alā + + + Vaigalī + + + Wai + + + Wai-alā + + + Waigelī + + + + Wotapuri-Katarqalai + + Katarqalai + + + + + info:lc/vocabulary/languages/ine + Indo-European (Other) + ine + + Carian + + + Dacian + + Daco-Mysian + + + North Thracian + + + + Luwian + + Luian + + + Lûish + + + Luvian + + + + Lycian + + + Lydian + + + Macedonian (Ancient) + + + Messapic + + Iapygian + + + Messapian + + + + Palaic + + Balaic + + + Palâ (Palaic) + + + Palaite + + + Palawi + + + + Phrygian + + + Proto-Indo-European + + Proto-Aryan + + + Protoindoeuropean + + + + Thracian + + + Tokharian + + Kuchean + + + Tocharian + + + Tocharish + + + Turfanish + + + + Venetic + + + Yuezhi + + Yüeh-chih + + + + + info:lc/vocabulary/languages/ind + Indonesian + ind + + Bahasa Indonesia + + + + info:lc/vocabulary/languages/inh + Ingush + inh + + + info:lc/vocabulary/languages/ina + Interlingua (International Auxiliary Language Association) + ina + + + info:lc/vocabulary/languages/int + Interlingua (International Auxiliary Language Association) + int + + + info:lc/vocabulary/languages/ile + Interlingue + ile + + Occidental + + + + info:lc/vocabulary/languages/iku + Inuktitut + iku + + Inuit + + + Inuvialuktun + + + Kopagmiut + + Chiglit + + + Siglit + + + + + info:lc/vocabulary/languages/ipk + Inupiaq + ipk + + Inuit + + + + info:lc/vocabulary/languages/ira + Iranian (Other) + ira + + Bactrian + + + Badzhuv + + Badschu + + + Badžū + + + Bāǰūī + + + + Bakhtiari + + Bakhtiyārī + + + Baxtīarī + + + Lori + + + Lori-ye Khaveri + + + Lur (Bakhtiari) + + + Luri (Bakhtiari) + + + + Bartang + + Bartangi + + + + Ephthalite + + Hephthalite + + + + Gilaki + + Gelaki + + + Gilan + + + + Gorani + + Awromani + + + Gurani + + + Hawramani + + + Hawrami + + + Hewrami + + + Howrami + + + Macho + + + + Hazaragi + + Azargi + + + Hazara + + + Hezareh + + + Hezareʼi + + + Khazara + + + Khezare + + + + Ishkashmi + + + Judeo-Tat + + Bik + + + Dzhuhuric + + + Hebrew Tat + + + Hebrew Tati + + + Jew-Tatish + + + Jewish Tat + + + Judeo-Tatic + + + + Khorezmi + + Choresmian + + + Khwarezmian + + + + Khuf + + Chuf + + + + Laki (Iran) + + Alaki + + + Leki + + + + Māzandarānī + + Mazanderani + + + Tabri + + + + Median + + Medic + + + + Munji + + Mundzhan + + + Munjani + + + + Natanzi + + Naṭanz + + + + Ormuri + + Baraks + + + Bargista + + + + Parthian + + + Roshan + + Rochani + + + Ruschan + + + + Sarikoli + + Sarykoli + + + + Sarmatian + + + Shughni + + Shugnan-Rushan + + + + Sivandi + + Sivendi + + + + Talysh + + + Tat + + + Wakhi + + + Yaghnobi + + Neo-Sogdian + + + Yaghnabi + + + Yaghnubi + + + Yagnabi + + + Yagnob + + + Yagnobi + + + Yagnubi + + + + Yazghulami + + + Zebaki + + Sanglici + + + + + info:lc/vocabulary/languages/gle + Irish + gle + + Erse (Irish) + + + Gaelic (Irish) + + + Irish Gaelic + + + + info:lc/vocabulary/languages/iri + Irish + iri + + + info:lc/vocabulary/languages/mga + Irish, Middle (ca. 1100-1550) + mga + + Middle Irish + + + + info:lc/vocabulary/languages/sga + Irish, Old (to 1100) + sga + + Old Irish + + + + info:lc/vocabulary/languages/iro + Iroquoian (Other) + iro + + Cayuga + + + Iroquois + + + Oneida + + + Onondaga + + + Seneca + + + Tuscarora + + + Wyandot + + Huron + + + + + info:lc/vocabulary/languages/ita + Italian + ita + + Judeo-Italian + + + Milanese + + + Modena Italian + + Italian, Modena + + + + Romagnol + + + Venetian Italian + + Italian, Venetian + + + + + info:lc/vocabulary/languages/jpn + Japanese + jpn + + Use for related Japanese languages and dialects + + + + info:lc/vocabulary/languages/jav + Javanese + jav + + + info:lc/vocabulary/languages/jrb + Judeo-Arabic + jrb + + + info:lc/vocabulary/languages/jpr + Judeo-Persian + jpr + + Judeo-Tajik + + + + info:lc/vocabulary/languages/kbd + Kabardian + kbd + + Cabardan + + + Circassian, East + + + Circassian, Upper + + + East Circassian + + + Qabardian + + + Upper Circassian + + + + info:lc/vocabulary/languages/kab + Kabyle + kab + + + info:lc/vocabulary/languages/kac + Kachin + kac + + Chingpaw + + + Jingpho + + + + info:lc/vocabulary/languages/kal + Kalâtdlisut + kal + + Ammassalimiut + + East Greenlandic + + + Greenlandic, East + + + Tunumiisut + + + + Greenlandic + + + Inuit + + + Kalaallisut + + + + info:lc/vocabulary/languages/kam + Kamba + kam + + + info:lc/vocabulary/languages/kan + Kannada + kan + + Canarese + + + Kanarese + + + Havyaka + + + + info:lc/vocabulary/languages/kau + Kanuri + kau + + Bornu + + + + info:lc/vocabulary/languages/krc + Karachay-Balkar + krc + + Balkar + + + + info:lc/vocabulary/languages/kaa + Kara-Kalpak + kaa + + Karakalpak + + + Qaraqalpaq + + + + info:lc/vocabulary/languages/krl + Karelian + krl + + Carelian + + + + info:lc/vocabulary/languages/kar + Karen languages + kar + + Kayah + + Karen, Red + + + Red Karen + + + + Pwo Karen + + + Sgaw Karen + + + Taungthu + + Pa-o + + + + + info:lc/vocabulary/languages/kas + Kashmiri + kas + + + info:lc/vocabulary/languages/csb + Kashubian + csb + + Cashubian + + + + info:lc/vocabulary/languages/kaw + Kawi + kaw + + Javanese, Old + + + Old Javanese + + + + info:lc/vocabulary/languages/kaz + Kazakh + kaz + + Kirghiz-Kaissak + + + + info:lc/vocabulary/languages/kha + Khasi + kha + + + info:lc/vocabulary/languages/khm + Khmer + khm + + Cambodian + + + Central Khmer + + + + info:lc/vocabulary/languages/cam + Khmer + cam + + + info:lc/vocabulary/languages/khi + Khoisan (Other) + khi + + Ju/'hoan + + !Xũ (!Kung) + + + Zjuc'hôa + + + Žu/'hõasi + + + + Khoikhoi + + Hottentot + + + + Korana + + + Nama + + + Nharo + + Naro + + + + San languages + + Bushman languages + + + + !Xõ + + Gxon + + + Hua-owani + + + !Kõ (Botswana and Namibia) + + + Koon + + + Magong + + + !Xong (Botswana and Namibia) + + + + + info:lc/vocabulary/languages/kho + Khotanese + kho + + Khotan-Saka + + + Khotanese-Sakan + + + Khotani + + + Khotansaka + + + Middle Khotanese + + + North Aryan + + + Old Khotanese + + + Saka + + + Sakan + + + + info:lc/vocabulary/languages/kik + Kikuyu + kik + + Gikuyu + + + + info:lc/vocabulary/languages/kmb + Kimbundu + kmb + + Angola + + + Bunda + + + Mbundu (Luanda Province, Angola) + + + Nbundu + + + Quimbundo (Luanda Province, Angola) + + + + info:lc/vocabulary/languages/kin + Kinyarwanda + kin + + Nyaruanda + + + Ruanda + + + Runyarwanda + + + Rwanda + + + Rufumbira + + + + info:lc/vocabulary/languages/tlh + Klingon (Artificial language) + tlh + + + info:lc/vocabulary/languages/kom + Komi + kom + + Syryenian + + + Zyrian + + + Komi-Permyak + + Permiak + + + + + info:lc/vocabulary/languages/kon + Kongo + kon + + Congo + + + Kikongo + + + Kituba (Congo (Brazzaville)) + + Kikoongo (Kituba (Congo (Brazzaville))) + + + Munukutuba + + + + Laadi + + Kilari + + + + Manyanga + + Kimanyanga + + + Kisi-Ngóombe + + + Manianga + + + + Ntaandu + + Kintaandu + + + Kisantu + + + Santu + + + + Vili + + Civili + + + Fiot + + + Fiote + + + Ki-vili + + + Ki-vumbu + + + Kivili + + + Kivumbu + + + Loango + + + Lu-wumbu + + + Luwumbu + + + Tsivili + + + + Zombo + + + + info:lc/vocabulary/languages/kok + Konkani + kok + + Concani + + + Komkani + + + Koṅkṇi + + + Agri + + Agari + + + + Chitapavani + + Chitpavani + + + Citpāvanī + + + + Jhāḍī + + + Kudali + + Malvani + + + + + info:lc/vocabulary/languages/kut + Kootenai + kut + + Kutenai + + + + info:lc/vocabulary/languages/kor + Korean + kor + + Use for related Korean languages and dialects + + + + info:lc/vocabulary/languages/kos + Kosraean + kos + + Kosrae + + + Kusaie + + + Kusaiean + + + + info:lc/vocabulary/languages/kpe + Kpelle + kpe + + Guerzé + + + + info:lc/vocabulary/languages/kro + Kru (Other) + kro + + Bete + + + Dadjriwalé + + Dadjrignoa + + + Dagli + + + Dajriwali + + + + Dida + + Wawi + + + + Godié + + Go (Côte d'Ivoire) + + + Godia + + + Godye + + + + Kru + + + Kuwaa + + Belle + + + Belleh + + + Kowaao + + + Kwaa + + + + Neyo + + Gwibwen + + + Néouolé + + + Néyau + + + Niyo + + + Towi + + + + Ngere + + Gere + + + Guéré + + + + Nyabwa + + Niaboua + + + + Tchien + + Gien + + + Kien + + + Tie + + + + Tepo + + Kroumen + + + Tewi + + + + Wobe + + Ouobe + + + + + info:lc/vocabulary/languages/kua + Kuanyama + kua + + Cuanhama + + + Kwanyama + + + Ovambo (Kuanyama) + + + + info:lc/vocabulary/languages/kum + Kumyk + kum + + + info:lc/vocabulary/languages/kur + Kurdish + kur + + Kurmanji + + + Mukri + + + + info:lc/vocabulary/languages/kru + Kurukh + kru + + Kurux + + + Oraon + + + Uraon + + + + info:lc/vocabulary/languages/kus + Kusaie + kus + + + info:lc/vocabulary/languages/kir + Kyrgyz + kir + + Kara-Kirghiz + + + Kirghiz + + + + info:lc/vocabulary/languages/lad + Ladino + lad + + Judeo-Spanish + + + Judesmo + + + Ḥakétia + + Ḥakétie + + + Haketiya + + + Ḥakitía + + + Haquetía + + + Haquetiya + + + + + info:lc/vocabulary/languages/lah + Lahndā + lah + + Jaṭkī + + + Lahndi + + + Panjabi, Western + + + Western Panjabi + + + Hindkōo + + + Khetrānī + + + Pōṭhwārī + + + Siraiki + + Bahawalpuri + + + Lahnda, Southern + + + Multani + + + Mutani + + + Panjabi, Southern + + + Reasati + + + Riasati + + + Saraiki + + + Southern Lahnda + + + Southern Panjabi + + + + Sirāikī Hindkī + + Siraiki Lahndi + + + + Sirāikī Sindhī + + Sindhi, Siraiki + + + + + info:lc/vocabulary/languages/lam + Lamba (Zambia and Congo) + lam + + + info:lc/vocabulary/languages/lao + Lao + lao + + + info:lc/vocabulary/languages/lat + Latin + lat + + Latin, Vulgar + + + Vulgar Latin + + + + info:lc/vocabulary/languages/lav + Latvian + lav + + Lettish + + + Latgalian + + East Latvian + + + High Latvian + + + Letgalian + + + + + info:lc/vocabulary/languages/lez + Lezgian + lez + + + info:lc/vocabulary/languages/lim + Limburgish + lim + + Limburger + + + + info:lc/vocabulary/languages/lin + Lingala + lin + + Bangala (Congo) + + + Mangala (Congo) + + + Ngala (Congo) + + + + info:lc/vocabulary/languages/lit + Lithuanian + lit + + + info:lc/vocabulary/languages/jbo + Lojban (Artificial language) + jbo + + + info:lc/vocabulary/languages/nds + Low German + nds + + German, Low + + + Low Saxon + + + Plattdeutsch + + + Plautdietsch + + + Saxon, Low + + + + info:lc/vocabulary/languages/dsb + Lower Sorbian + dsb + + Sorbian, Lower + + + + info:lc/vocabulary/languages/loz + Lozi + loz + + Kololo + + + Rozi + + + Sikololo + + + + info:lc/vocabulary/languages/lub + Luba-Katanga + lub + + Chiluba + + + Katanga + + + + info:lc/vocabulary/languages/lua + Luba-Lulua + lua + + Ciluba + + + Kalebwe (Luba-Lulua) + + + Luba, Western + + + Luba-Kasai + + + Western Luba + + + + info:lc/vocabulary/languages/lui + Luiseño + lui + + + info:lc/vocabulary/languages/smj + Lule Sami + smj + + Lapp, Swedish + + + Sami, Lule + + + Swedish Lapp + + + + info:lc/vocabulary/languages/lun + Lunda + lun + + + info:lc/vocabulary/languages/luo + Luo (Kenya and Tanzania) + luo + + Dho Luo + + + Gaya + + + Jo Luo + + + Kavirondo, Nilotic + + + Nife + + + Nilotic Kavirondo + + + Nyife + + + Wagaya + + + + info:lc/vocabulary/languages/lus + Lushai + lus + + Dulien + + + Mizo + + + Sailau + + + + info:lc/vocabulary/languages/ltz + Luxembourgish + ltz + + Letzebuergesch + + + Letzeburgesch + + + Luxembourgeois + + + Luxemburgian + + + + info:lc/vocabulary/languages/mac + Macedonian + mac + + Bǎlgarski (Macedonian) + + + Balgàrtzki (Macedonian) + + + Bolgàrtski (Macedonian) + + + Bulgàrtski (Macedonian) + + + Dópia + + + Entópia + + + Macedonian Slavic + + + Makedoniski + + + Makedonski + + + Slavic (Macedonian) + + + Slaviká (Macedonian) + + + Slavomacedonian + + + + info:lc/vocabulary/languages/mad + Madurese + mad + + + info:lc/vocabulary/languages/mag + Magahi + mag + + Bihari (Magahi) + + + Magadhi + + + Magaya + + + Maghadi + + + Maghai + + + Maghaya + + + Maghori + + + Magi (India) + + + Magodhi + + + Megahi + + + + info:lc/vocabulary/languages/mai + Maithili + mai + + Apabhramsa (Maithili) + + + Bihari (Maithili) + + + Maitili + + + Maitli + + + Methli + + + Tirahutia + + + Tirhuti + + + Tirhutia + + + Khotta (Maithili) + + Eastern Maithili + + + Khoratha + + + + + info:lc/vocabulary/languages/mak + Makasar + mak + + Macassarese + + + + info:lc/vocabulary/languages/mlg + Malagasy + mlg + + Hova + + + Madagascan + + + Malgache + + + Merina + + + Bara (Madagascar) + + + Betsileo + + + Masikoro + + + Sakalava + + + Tsimihety + + + + info:lc/vocabulary/languages/mla + Malagasy + mla + + + info:lc/vocabulary/languages/may + Malay + may + + Palembang Malay + + + + info:lc/vocabulary/languages/mal + Malayalam + mal + + Malabar + + + Moplah + + + + info:lc/vocabulary/languages/mlt + Maltese + mlt + + + info:lc/vocabulary/languages/mnc + Manchu + mnc + + + info:lc/vocabulary/languages/mdr + Mandar + mdr + + Andian + + + + info:lc/vocabulary/languages/man + Mandingo + man + + Malinka + + + Mandeka + + + Maninka + + + Meninka + + + + info:lc/vocabulary/languages/mni + Manipuri + mni + + Meithei + + + + info:lc/vocabulary/languages/mno + Manobo languages + mno + + Agusan Manobo + + + Ata Manobo + + + Binukid Manobo + + Binokid + + + Bukidnon + + + + Cotabato Manobo + + + Dibabawon + + Debabaon + + + Dibabaon + + + Mandaya + + + + Higaonon + + + Ilianen Manobo + + + Kagayanen + + Cagayano Cillo + + + + Manuvu + + Bagobo, Upper + + + Upper Bagobo + + + + MatigSalug + + + Sarangani Manobo + + Culamanes + + + Kulaman + + + + Western Bukidnon Manobo + + Bukidnon Manobo, Western + + + Central Manobo + + + Central Mindanao Manobo + + + + + info:lc/vocabulary/languages/glv + Manx + glv + + Manx Gaelic + + + + info:lc/vocabulary/languages/max + Manx + max + + + info:lc/vocabulary/languages/mao + Maori + mao + + South Island Maori + + Maori, South Island + + + + + info:lc/vocabulary/languages/arn + Mapuche + arn + + Araucanian + + + Mapudungun + + + + info:lc/vocabulary/languages/mar + Marathi + mar + + Mahratta + + + Mahratti + + + Murathee + + + Are + + Ade Basha + + + Aray + + + Arrey + + + Arya + + + Kalika Arya Bhasha + + + + Koshti (Marathi) + + Kosti (Marathi) + + + + Kunabi + + + Varhadi Nagpuri + + Berar Marathi + + + Berari + + + Dhanagari + + + Kumbhari + + + Madhya Pradesh Marathi + + + Nagpuri (Varhadi Nagpuri) + + + Nagpuri-Varhadi + + + Varhadi-Nagpuri Marathi + + + + + info:lc/vocabulary/languages/chm + Mari + chm + + Cheremissian + + + + info:lc/vocabulary/languages/mah + Marshallese + mah + + Ebon + + + + info:lc/vocabulary/languages/mwr + Marwari + mwr + + Bikaneri + + + Dingal + + + Mewari + + Mevadi + + + Mewa + + + Mewadi + + + + Shekhawati + + Sekhavati + + + + + info:lc/vocabulary/languages/mas + Massai + mas + + Maa (Kenya and Tanzania) + + + Masai + + + + info:lc/vocabulary/languages/myn + Mayan languages + myn + + Achi + + Cubulco Achi + + + Rabinal Achi + + + + Akatek + + Acateco + + + Kanjobal, Western + + + San Miguel Acatán Kanjobal + + + Western Kanjobal + + + + Awakateko + + Aguacatec + + + + Cakchikel + + Kacchiquel + + + + Chol + + + Chontal of Tabasco + + + Chorti + + + Chuj + + + Huastec + + Guastec + + + Wastek + + + + Itzá + + + Ixil + + + Jacalteca + + Jakalteka + + + + Kanjobal + + Conob + + + + Kekchi + + Cacchi + + + Ghec-chi + + + Quekchi + + + + Lacandon + + + Mam + + Zaklohpakap + + + + Maya + + Yucatecan + + + + Mochó + + Motozintlec + + + + Mopan + + Manche + + + + Pokomam + + Pocomam + + + Poqomam + + + + Pokonchi + + + Quiché + + Kiché + + + Utlateca + + + + Tectiteco + + Teco (Mayan) + + + + Tojolabal + + Chañabal + + + + Tzeltal + + Celdal + + + Tseltal + + + Zendal + + + + Tzotzil + + Chamula + + + Querene + + + Zotzil + + + + Tzutuhil + + Zutuhil + + + + Uspanteca + + + + info:lc/vocabulary/languages/men + Mende + men + + + info:lc/vocabulary/languages/mic + Micmac + mic + + + info:lc/vocabulary/languages/min + Minangkabau + min + + Menangkabau + + + + info:lc/vocabulary/languages/mwl + Mirandese + mwl + + + info:lc/vocabulary/languages/mis + Miscellaneous languages + mis + + Andamanese + + + Burushaski + + Boorishki + + + Khajuna + + + + Chukchi + + Tchuktchi + + + Tuski + + + + Etruscan + + + Gilyak + + Guiliak + + + Nivkh + + + + Hattic + + Hattian + + + Khattic + + + Khattili + + + Khattish + + + Proto-Hittite + - - - Hurrian - - Mitani - - - Subarian - - - - Iberian - - - Indus script - - - Jarawa (India) - - - Kamchadal - - Itelmes - - - - Ket - - Yenisei-Ostiak - - - - Koryak - - - Manipravalam (Malayalam) - - - Mysian - - - Nancowry - - - Nenets - - Jurak - - - Yurak - - - - Nganasan - - Tavgi - - - - Nicobarese - - - Palan - - Pallan - - - - Shelta - - - Urartian - - Chaldean (Urartian) - - - Khaldian - - - Urartaean - - - Urartic - - - Vannic - - - - Yugh - - Sym-Ketish - - - - Yukaghir - - Jukaghir - - - - - info:lc/vocabulary/languages/moh - Mohawk - moh - - - info:lc/vocabulary/languages/mdf - Moksha - mdf - - - info:lc/vocabulary/languages/mol - Moldavian - mol - - - info:lc/vocabulary/languages/mkh - Mon-Khmer (Other) - mkh - - Bahnar - - - Blang - - Bulang - - - Plang - - - Pulang - - - Samtao - - - - Chrau - - - Cua - - Bong Miew - - - Kor - - - Traw - - - - Eastern Mnong - - Mnong, Eastern - - - - Hrê - - Davak - - - - Jah Hut - - Eastern Sakai - - - Sakai, Eastern - - - - Jeh - - Die - - - Yeh - - - - Katu - - Attouat - - - Khat - - - Ta River Van Kieu - - - Teu - - - Thap - - - - Khmu' - - Kamhmu - - - Phouteng - - - - Koho - - - Kui (Mon-Khmer) - - Khmer, Old (Kui) - - - Kuay - - - Kuy - - - Old Khmer (Kui) - - - Suai - - - Suay - - - - Laven - - Loven - - - - Lawa (Thailand) - - La-oop - - - Lava - - - Lavua - - - Luwa - - - - Mah Meri - - Besisi - - - Cellate - - - - Mon - - Peguan - - - Talaing - - - - Muong - - - Northern Khmer - - Khmer, Northern - - - - Nyah Kur - - Chao Bon - - - Niakuol - - - - Pacoh - - Bo - - - River Van Kieu - - - - Rengao - - - Sedang - - - Semai - - Central Sakai - - - Sakai, Central - - - Senoi - - - - Semang - - Kensiu - - - Ngok Pa - - - - Senoic languages - - Aslian languages, Central - - - Central Aslian languages - - - Sakai languages - - - - Srê - - - Stieng - - - Temiar - - Northern Sakai - - - Sakai, Northern - - - - Wa - - - - info:lc/vocabulary/languages/lol - Mongo-Nkundu - lol - - Lolo (Congo) - - - Lomongo - - - Lonkundu - - - Mongo - - - Nkundu - - - - info:lc/vocabulary/languages/mon - Mongolian - mon - - Mongol - - - Chahar - - Čakhar - - - - Dariganga - - Dar'ganga - - - Dariġangġ-a - - - Darigangga - - - - Khalkha - - - Ordos - - - - info:lc/vocabulary/languages/mos - Mooré - mos - - Mole - - - Moré - - - Moshi - - - Mossi - - - Yana (Burkina Faso and Togo) - - - - info:lc/vocabulary/languages/mul - Multiple languages - mul - - - info:lc/vocabulary/languages/mun - Munda (Other) - mun - - Asuri - - - Bhumij - - - Ho - - - Kharia - - - Korwa - - Korava (Munda) - - - - Kurku - - Bondeya - - - Bopchi - - - Kirku - - - Korakū - - - Korki - - - Korku - - - Kuri (India) - - - - Mundari - - Kohl - - - - Nihali - - Nahali - - - - Sora - - Sabara - - - Saora - - - Savara - - - Sawara - - - - - info:lc/vocabulary/languages/nah - Nahuatl - nah - - Aztec - - - Mexican - - - Pipil - - Nahuat - - - - - info:lc/vocabulary/languages/nau - Nauru - nau - - - info:lc/vocabulary/languages/nav - Navajo - nav - - - info:lc/vocabulary/languages/nbl - Ndebele (South Africa) - nbl - - Ndzundza - - - Nrebele (South Africa) - - - Transvaal Ndebele - - - - info:lc/vocabulary/languages/nde - Ndebele (Zimbabwe) - nde - - Nrebele (Zimbabwe) - - - Sindebele - - - Tebele - - - - info:lc/vocabulary/languages/ndo - Ndonga - ndo - - Ambo (Angola and Namibia) - - - Oshindonga - - - Oshiwambo - - - Ovambo (Ndonga) - - - - info:lc/vocabulary/languages/nap - Neapolitan Italian - nap - - - info:lc/vocabulary/languages/nep - Nepali - nep - - Gorkhali - - - Gurkhali - - - Khas - - - Naipali - - - Nepalese - - - Parbate - - - Parbatiya - - - Purbutti - - - Baitadi - - - Kumali - - - Parvati - - Parbati - - - - - info:lc/vocabulary/languages/new - Newari - new - - - info:lc/vocabulary/languages/nwc - Newari, Old - nwc - - Old Newari - - - - info:lc/vocabulary/languages/nia - Nias - nia - - - info:lc/vocabulary/languages/nic - Niger-Kordofanian (Other) - nic - - Niger-Congo (Other) - - - Abidji - - Adidji - - - Ari (Côte d'Ivoire) - - - - Abua - - - Ahanta - - - Aja (Benin and Togo) - - Adja - - - - Alladian - - Aladian - - - Aladyã - - - Aladyan - - - Alagia - - - Alagian - - - Alagya - - - Alajan - - - Alladyan - - - Allagia - - - Allagian language - - - - Anufo - - Chakosi - - - - Anyang - - Denya - - - Nyang (Cameroon) - - - - Anyi - - Agni - - - - Attie - - Akye - - - Kurobu - - - - Avikam - - - Awutu - - - Babungo - - Ngo - - - - Bafut - - - Baka (Cameroon and Gabon) - - - Balanta-Ganja - - Alante (Senegal) - - - Balanda (Senegal) - - - Balant (Senegal) - - - Balante (Senegal) - - - Balãt - - - Ballante (Senegal) - - - Belante (Senegal) - - - Brassa (Senegal) - - - Bulanda (Senegal) - - - Fca - - - Fjaa - - - Fraase - - - - Balanta-Kentohe - - Alante (Balanta-Kentohe) - - - Balanda (Balanta-Kentohe) - - - Balant (Balanta-Kentohe) - - - Balanta - - - Balante (Balanta-Kentohe) - - - Ballante (Balanta-Kentohe) - - - Belante (Balanta-Kentohe) - - - Brassa (Balanta-Kentohe) - - - Bulanda (Balanta-Kentohe) - - - Frase - - - - Bamun - - - Bandial - - Banjaal - - - Eegima - - - Eegimaa - - - - Bariba - - Bargu - - - Berba (Benin and Nigeria) - - - - Bassari - - Ayan - - - Biyan - - - Wo - - - - Baule - - Baoulé - - - - Bedik - - Budik - - - Tenda - - - - Bekwarra - - - Bena (Nigeria) - - Binna - - - Buna (Bena) - - - Ebina (Bena) - - - Ebuna (Bena) - - - Gbinna - - - Yangeru - - - Yongor - - - Yungur (Bena) - - - - Benue-Congo languages - - - Biali - - Berba (Benin and Burkina Faso) - - - Bieri - - - - Bijago - - Bidyogo - - - - Birifor - - - Birom - - Berom - - - Bouroum - - - Burum (Nigeria) - - - Kibo - - - Kibyen - - - Shosho - - - - Blowo - - Blo - - - Dan-blo - - - Western Dan - - - - Bobo Fing - - Black Bobo - - - Bulse - - - Finng - - - - Boomu - - Bomu - - - - Bozo - - Sorko - - - Sorogo - - - - Brissa - - Anufo (Côte d'Ivoire) - - - - Bua languages - - Boua languages - - - - Buli - - Builsa - - - Bulea - - - Bulugu - - - Guresha - - - Kanjaga - - - - Busa - - Boko - - - - Bwamu - - Bobo Wule - - - Bouamou - - - - Cross River Mbembe - - Ekokoma - - - Ifunubwa - - - Oderiga - - - Ofunobwam - - - Okam - - - Wakande - - - - Dagaare - - - Dagbani - - Dagomba - - - - Dan (Côte d'Ivoire) - - Gio - - - Yacouba - - - - Degema - - Atala - - - Udekama - - - - Diola - - Dyola - - - Yola - - - - Djimini - - Dyimini - - - Gimini - - - Jimini - - - Jinmini - - - - Dogon - - Habe - - - Tombo - - - - Ebira - - Egbira - - - Igbira - - - - Eggon - - - Ejagham - - Central Ekoi - - - Ekwe - - - Ezam - - - - Ekpeye - - - Engenni - - Egene - - - Ngene - - - - Esuulaalu - - - Etsako - - Afenmai - - - Iyekhee - - - Kukuruku - - - Yekhee - - - - Fali (Cameroon) - - Falli - - - - Falor - - Palor - - - - Farefare - - Frafra - - - Gurenne - - - Gurne - - - Gurune - - - Nankani - - - Nankanse - - - Ninkare - - - - Gbagyi - - - Gbandi - - Bandi - - - - Gen-Gbe - - Gẽ - - - Mina (Benin and Togo) - - - - Gikyode - - Chode - - - Kyode - - - - Gonja - - Guang - - - - Gua - - Gwa (Ghana) - - - - Gun-Gbe - - Alada - - - Egun - - - - Gurma - - Gourmantché - - - Gulmance - - - - Guyuk - - - Gweetaawu - - Dan-gouéta - - - Eastern Dan - - - Gouéta - - - Gwétaawo - - - - Hanga (Ghana) - - Anga (Ghana) - - - - Hõne - - Jukun of Gwana - - - - Idoma - - Oturkpo - - - - Igede - - - Igo - - Ahlon - - - Anlo - - - - Ikwere - - Oratta-Ikwerri - - - - Indenie - - Ndenie - - - Ndenye - - - Ndinian - - - Ndyenye - - - - Itsekiri - - Isekiri - - - - Izere - - Jarawa (Nigeria) - - - - Izi - - - Jju - - Ju (Benue-Congo) - - - Kaje - - - - Jowulu - - Jo - - - Samogho (Jowulu) - - - Samoighokan - - - - Jukun - - Kurorofa - - - - Kaansa - - Gã (Burkina Faso) - - - Gan (Burkina Faso) - - - Gane (Burkina Faso) - - - Kaan (Burkina Faso) - - - Kaanse - - - Kãasa (Burkina Faso) - - - Kan (Burkina Faso) - - - - Kabiye - - Kabre - - - Kabye - - - - Kagoro (Mali) - - - Kagoro (Nigeria) - - Gworok - - - - Karang (Cameroon) - - - Kasem - - Kasena - - - Kasim - - - Kassem - - - Kassene - - - - Kassonke - - Khassonke - - - - Kissi - - Kisi (West Africa) - - - - Konkomba - - - Konni - - Koma (Ghana) - - - - Kposo - - Akposo - - - Ikposo - - - - Krahn - - Kran - - - Northern Krahn - - - Western Krahn - - - - Krongo - - Kadumodi - - - Kurungu - - - - Kulango - - Koulango - - - Kpelego - - - Nabe - - - Ngwala - - - Nkurange - - - Zazere - - - - Kuo (Cameroon and Chad) - - Ko (Cameroon and Chad) - - - Koh - - - - Kuranko - - Koranko - - - - Kurumba - - Deforo - - - Foulse - - - Fulse - - - Koromfe - - - Kouroumba - - - Kurumfe - - - Lilse - - - - Kusaal - - Kusasi - - - - Kwanja - - - Kweni - - Gouro - - - - Lefana - - Bouem - - - Buem - - - Bwem - - - - Ligbi - - - Limba - - - Limbum - - Llimbumi - - - Ndzungle - - - Njungene - - - Nsugni - - - Wimbum - - - Zungle - - - - Lobi - - - Loko - - Landogo - - - - Loma - - Baru - - - Buzi - - - Lorma - - - - Longuda - - Nunguda - - - - Lorhon - - Loghon - - - - Lyele - - Lele (Burkina Faso) - - - - Mamara - - Bamana (Senufo) - - - Mianka - - - Minianka - - - Minyanka - - - - Mambila - - Lagubi - - - Nor - - - Tagbo - - - Torbi - - - - Mampruli - - - Mandjak - - - Mankanya - - Bola (Portuguese Guinea) - - - Brame - - - Bulama - - - - Mankon - - - Mano - - - Mayogo - - - Mbili - - - Mbum - - Mbam - - - - Mi Gangam - - Dye - - - Gangam - - - Ngangan - - - - Migili - - Koro Lafia - - - - Mo (Côte d'Ivoire and Ghana) - - Buru (Côte d'Ivoire and Ghana) - - - Deg - - - Mmfo - - - - Moba - - - Muana - - - Mumuye - - - Mundang - - Moundang - - - - Mungaka - - Bali (Cameroon) - - - Ngaaka - - - - Nafaanra - - - Nawuri - - - Nchumburu - - - Ndogo-Sere languages - - - Ngbaka - - - Ngbaka ma'bo - - Bwaka - - - Ngbaka limba - - - - Nirere - - - Ninzo - - Akiza - - - Amar Tita - - - Ancha - - - Fadan Wate - - - Gbhu D Amar Randfa - - - Hate (Ninzo) - - - Incha - - - Kwasu - - - Ninzam - - - Nunzo - - - Sambe - - - - Nkonya - - - Nomaante - - - Noon - - - Noone - - Noni - - - - Northern Bullom - - Bullom, Northern - - - - Nunuma - - Nibulu - - - Nouni - - - - Nupe - - Nope - - - - Ogbronuagum - - - Oku - - Bvukoo - - - Ebkuo - - - Ekpwo - - - Kuo (Oku) - - - Ukfwo - - - Uku (Oku) - - - - Oron - - - Pinyin - - - Safaliba - - Safalaba - - - Safalba - - - Safali - - - - Samo (West Africa) - - Goe - - - Matya - - - Maya (Burkina Faso) - - - Samogo-Sane - - - San (Eastern Mande) - - - Sane - - - - Sanwi - - - Sembla - - Sambla - - - Samogho-Senku - - - Samogo-Senku - - - Seeku - - - Sembila - - - Senku - - - Southern Samo (Western Mande) - - - - Senari - - Senufo - - - - Senya - - - Sherbro - - Bullom, Southern - - - Southern Bullom - - - - Sissala - - - Somba - - Betammadibe - - - Ditammari - - - Tamaba - - - - Tagbana - - - Tampulma - - Tamprusi - - - - Téén - - - Tem - - Cotocoli - - - Kotokoli - - - Tim - - - - Tigon Mbembe - - Akonto - - - Akwanto - - - Noale - - - Tigim - - - Tigon - - - Tigong - - - Tigum - - - Tigun - - - Tikun - - - Tukun - - - - Tikar - - - Tobote - - Basari (Togo and Ghana) - - - - Tofingbe - - - Toma (Burkina Faso) - - Makaa (Burkina Faso) - - - Nyaana - - - - Tura - - Toura - - - - Tusia - - Toussia - - - - Tuwunro - - - Tyembara - - - Ukaan - - Aika - - - Anyaran - - - Auga - - - Ikan - - - Kakumo - - - - Urhobo - - - Vagala - - Kira - - - Konosarola - - - Siti - - - - Vige - - - Winyé - - Kõ (Burkina Faso) - - - Kols - - - Kolsi - - - - Yakö - - Kö (Yakö) - - - Lukö - - - - Yom - - Kpilakpila - - - Pila - - - Pilapila - - - - - info:lc/vocabulary/languages/ssa - Nilo-Saharan (Other) - ssa - - Sub-Saharan African (Other) - - - Adhola - - Dhopadhola - - - Ludama - - - - Alur - - Aloro - - - Alua - - - Alulu - - - Aluru - - - Dho Alur - - - Jo Alur - - - Lur (Alur) - - - Luri (Alur) - - - - Anuak - - Yambo - - - - Aringa - - Low Lugbara - - - - Bagirmi - - Barma - - - - Baka - - Tara Baaka - - - - Bari - - Dzilio - - - - Birri (Central African Republic) - - Abiri - - - Ambili - - - Biri (Central African Republic) - - - Bviri - - - Viri language - - - - Bongo - - - Bongo-Bagirmi languages - - - Bor (Lwo) - - Belanda - - - - Dazaga - - Dasa - - - Dasaga - - - Daza (Nilo-Saharan) - - - Dazagada - - - Dazza - - - Dazzaga - - - Tebu (Dazaga) - - - Tibbu (Dazaga) - - - Toubou (Dazaga) - - - Tubu (Dazaga) - - - - Fur - - - Gambai - - Kabba Laka - - - Ngambai - - - Sara Gambai - - - - Ingassana - - Gaam - - - Ingessana - - - Kamanidi - - - Mamidza - - - Memedja - - - Metabi - - - Muntabi - - - Tabi (Ingassana) - - - - Jur Modo - - Jur (Jur Modo) - - - Modo - - - - Kaba (Central Sudanic) - - - Kalenjin - - - Kara (Central African Republic and Sudan) - - Fer - - - Gula (Central African Republic and Sudan) - - - Yama - - - Yamegi - - - - Karamojong - - Akarimojong - - - - Kenga - - - Kipsikis - - - Kreish - - - Kùláál - - Gula (Lake Iro, Chad) - - - - Kunama - - Cunama - - - - Lango (Uganda) - - - Lendu - - - Lese - - - Logo - - Logo Kuli - - - Logoti - - - - Lotuko - - Latuka - - - - Lugbara - - Logbara - - - Logbware - - - Luguaret - - - Lugware - - - - Lwo (Sudan) - - Dhe Lwo - - - Dyur - - - Giur - - - Jo Lwo - - - Jur (Lwo (Sudan)) - - - Luo (Sudan) - - - - Maban - - Meban - - - - Maʾdi (Uganda and Sudan) - - Madi-ti (Uganda and Sudan) - - - - Majingai - - Midjinngay - - - Moggingain - - - Sara-Majingai - - - - Mamvu - - Momvu - - - Monvu - - - Tengo - - - - Mangbetu - - Monbuttu - - - - Mbai (Moissala) - - Moissala Mbai - - - Sara Mbai (Moissala) - - - - Moru - - - Murle - - Beir - - - - Nandi - - - Nara - - Barea - - - Baria - - - Barya - - - Higir - - - Kolkotta - - - Koyta - - - Mogoreb - - - Morda - - - Nera - - - Nere - - - Santora - - - - Ngama - - Sara Ngama - - - - Ngiti - - Druna - - - Lendu, Southern - - - Ndruna - - - Southern Lendu - - - - Nuer - - Abigar - - - Nath - - - - Päri (Sudan) - - - Proto-Eastern Sudanic - - - Sabaot - - - Samburu - - Burkeneji - - - Lokop - - - Nkutuk - - - Sambur - - - Sampur - - - - Sara - - Majingai-Ngama - - - - Suk - - Pokot - - - - Tedaga - - Tebou - - - Tebu (Tedaga) - - - Teda - - - Tedagada - - - Tibbu (Tedaga) - - - Tibu - - - Toda (Africa) - - - Todaga - - - Todga - - - Toubou (Tedaga) - - - Tubu - - - Tuda (Africa) - - - Tuduga - - - - Teso - - Ateso - - - Iteso - - - - Toposa - - Abo (Sudan) - - - Akeroa - - - Dabossa - - - Huma (Sudan) - - - Kare (Sudan) - - - Khumi (Sudan) - - - Taposa - - - - Turkana - - - Uduk - - - Yulu - - - Zaghawa - - Beri-aa - - - Berri - - - Kebadi - - - Merida - - - Soghaua - - - Zeghawa - - - - - info:lc/vocabulary/languages/niu - Niuean - niu - - - info:lc/vocabulary/languages/nqo - N'Ko - nqo - - - info:lc/vocabulary/languages/nog - Nogai - nog - - - info:lc/vocabulary/languages/zxx - No linguistic content - zxx - - - info:lc/vocabulary/languages/nai - North American Indian (Other) - nai - - Use for the other languages of North America north of Mexico excluding the - languages of the Azteco-Tanoan language phylum. - - - Alabama - - - Arikara - - - Atsugewi - - - Beothuk - - - Chickasaw - - - Chimariko - - - Chitimacha - - Chetimacha - - - Shetimasha - - - - Chumash - - - Coahuilteco - - Tejano - - - - Cocopa - - - Coos - - Kaus - - - Kwokwoos - - - - Eastern Pomo - - Pomo, Eastern - - - - Eyak - - Ugalachmut - - - - Hualapai - - Jaguallapai - - - Mataveke-paya - - - Walapai - - - - Karok - - - Keres - - - Kiliwa - - Yukaliwa - - - - Konomihu - - - Kuitsh - - Lower Umpqua - - - Umpqua, Lower - - - - Kumiai - - Campo - - - Cochimi (Diegueño) - - - Comeya - - - Cuchimí - - - Diegueño - - - Digueño - - - Iipay - - - Kamia - - - Kamiai - - - Kamiyahi - - - Kamiyai - - - Ki-Miai - - - Ko'al - - - Ku'ahl - - - Kumeyaai - - - Kumeyaay - - - Kumia - - - Kw'aal - - - Quemayá - - - Tiipay - - - Tipai - - - - Maidu - - Pujunan - - - - Mikasuki - - Mekusuky - - - - Miwok languages - - Mewan - - - Moquelumnan - - - - Mutsun - - - Nez Percé - - Numipu - - - Sahaptin - - - - Northern Sierra Miwok - - Miwok, Northern Sierra - - - - Ohlone - - Costanoan - - - - Paipai - - - Pawnee - - - Southeastern Pomo - - Pomo, Southeastern - - - - Timucua - - - Tlakluit - - Echeloot - - - Wishram - - - - Tonkawa - - - Tunica - - Tonican - - - Yoron - - - Yuron - - - - Wappo - - - Wichita - - - Wikchamni - - Wükchamni - - - - Wintu - - - Wiyot - - - Yahi - - - Yakama - - Yakima - - - - Yuchi - - Uchee - - - - Yuki - - - - info:lc/vocabulary/languages/frr - North Frisian - frr - - Frisian, North - - - - info:lc/vocabulary/languages/sme - Northern Sami - sme - - Sami, Northern - - - - info:lc/vocabulary/languages/nso - Northern Sotho - nso - - Pedi - - - Sepedi - - - Sotho, Northern - - - Transvaal Sotho - - - Pai (South Africa) - - Eastern Sotho - - - - - info:lc/vocabulary/languages/nor - Norwegian - nor - - Bokmål - - - Dano-Norwegian - - - Riksmål - - - Trøndersk - - Trønder - - - Trøndesk - - - Trøndsk - - - - - info:lc/vocabulary/languages/nob - Norwegian (Bokmål) - nob - - Bokmål - - - Dano-Norwegian - - - Riksmål - - - - info:lc/vocabulary/languages/nno - Norwegian (Nynorsk) - nno - - Landsmaal - - - Landsmål - - - Nynorsk - - - - info:lc/vocabulary/languages/nub - Nubian languages - nub - - Dilling - - Delen - - - Warkimbe - - - - Dongola-Kenuz - - Kenuz - - - - Mahas-Fiyadikka - - Fadicca - - - Fiadidja - - - Fiyadikka - - - Nobiin - - - - Midob - - - Old Nubian (to 1300) - - Nubian, Old - - - - - info:lc/vocabulary/languages/nym - Nyamwezi - nym - - - info:lc/vocabulary/languages/nya - Nyanja - nya - - Chinyanja - - - Nyassa - - - Chewa - - Cewa - - - - - info:lc/vocabulary/languages/nyn - Nyankole - nyn - - Lunyankole - - - Nkole - - - Runyankore - - - - info:lc/vocabulary/languages/nyo - Nyoro - nyo - - Lunyoro - - - Urunyoro - - - - info:lc/vocabulary/languages/nzi - Nzima - nzi - - Nsima - - - Nzema - - - Zema - - - - info:lc/vocabulary/languages/oci - Occitan (post-1500) - oci - - Langue d'oc (post-1500) - - - Provençal, Modern (post-1500) - - - Béarnais (post-1500) - - - Gascon (post-1500) - - - - info:lc/vocabulary/languages/lan - Occitan (post 1500) - lan - - - info:lc/vocabulary/languages/xal - Oirat - xal - - Kalmyk - - Calmuck - - - - Oyrat - - - - info:lc/vocabulary/languages/oji - Ojibwa - oji - - Anishinabe - - - Chippewa - - - Otchipwe - - - Salteaux - - - Saulteaux - - - Ottawa - - - - info:lc/vocabulary/languages/non - Old Norse - non - - Altnordish - - - Icelandic, Old (to 1550) - - - Norse, Old - - - Norse, Western - - - Norwegian, Old (to 1350) - - - Old Icelandic (to 1550) - - - Old Norwegian (to 1350) - - - Western Norse - - - - info:lc/vocabulary/languages/peo - Old Persian (ca. 600-400 B.C.) - peo - - Persian, Old (ca. 600-400 B.C.) - - - - info:lc/vocabulary/languages/ori - Oriya - ori - - Uriya - - - Adiwasi Oriya - - Adibasi Oriyā - - - Ādivāsi Oriyā - - - Desai - - - Kotia - - - Kotia Oriya - - - Kotiya - - - Tribal Oriya - - - - Bhatri - - Basturia - - - Bhatra - - - Bhattra - - - Bhattri - - - Bhottada - - - Bhottara - - - - Sambalpuri - - - - info:lc/vocabulary/languages/orm - Oromo - orm - - Afan - - - Galla - - - Gallinya - - - Boran - - - Orma - - Uardai - - - Warday - - - - - info:lc/vocabulary/languages/gal - Oromo - gal - - - info:lc/vocabulary/languages/osa - Osage - osa - - - info:lc/vocabulary/languages/oss - Ossetic - oss - - Āsī - - - Oseti - - - Osi - - - Ūsatī - - - - info:lc/vocabulary/languages/oto - Otomian languages - oto - - Chichimeca-Jonaz - - - Matlatzinca - - Pirinda - - - - Mazahua - - - Ocuiltec - - Atzinca - - - Maclatzinca - - - Tlahuica - - - - Otomi - - Hñahñu - - - Othomi - - - - Pame - - Chichimeca Pame - - - - - info:lc/vocabulary/languages/pal - Pahlavi - pal - - Huzvaresh - - - Middle Persian (Pahlavi) - - - Parsi - - - Pazend - - - Pehlevi - - - Persian, Middle (Pahlavi) - - - - info:lc/vocabulary/languages/pau - Palauan - pau - - Pelew - - - - info:lc/vocabulary/languages/pli - Pali - pli - - - info:lc/vocabulary/languages/pam - Pampanga - pam - - Kapampangan - - - - info:lc/vocabulary/languages/pag - Pangasinan - pag - - - info:lc/vocabulary/languages/pan - Panjabi - pan - - Eastern Panjabi - - - Punjabi - - - - info:lc/vocabulary/languages/pap - Papiamento - pap - - - info:lc/vocabulary/languages/paa - Papuan (Other) - paa - - Abau - - Green River - - - - Abulas - - Ambulas - - - Maprik - - - - Agarabe - - - Alamblak - - - Ama (Papua New Guinea) - - Sawiyanu - - - - Amele - - - Ampale - - Ampeeli - - - Safeyoka - - - - Aneme Wake - - Abia - - - Musa, Upper - - - Upper Musa - - - - Anggor - - Bibriari - - - Senagi - - - Watapor - - - - Ankave - - Angave - - - - Aomie - - Omie - - - - Asaro - - Dano - - - Upper Asaro - - - - Asmat - - - Au - - - Auyana - - - Awa (Eastern Highlands Province, Papua New Guinea) - - - Bahinemo - - Gahom - - - Wogu - - - - Baining - - Kakat - - - Makakat - - - Maqaqet - - - Qaqet - - - - Barai - - - Baruya - - - Bauzi - - Baudi - - - Bauri - - - Pauwi - - - - Benabena - - Bena (Papua New Guinea) - - - Bena-bena - - - - Berik - - - Biangai - - Baingai - - - - Bimin - - - Binumarien - - - Bisorio - - Gadio - - - Iniai - - - - Blagar - - Belagar - - - Tarang - - - - Bom - - Anjam - - - Bogadjim - - - Lalok - - - - Buin - - Rugara - - - Telei - - - - Bunak - - Buna' (Indonesia) - - - Bunake - - - Bunaq - - - - Burum (Papua New Guinea) - - Bulum - - - - Chuave - - Tjuave - - - - Daga - - Dimuga - - - Nawp - - - - Daribi - - Elu - - - Karimui - - - Makarub - - - Mikaru - - - - Dedua - - - Duna - - Yuna - - - - Eipo - - - Enga - - Tsaga - - - - Ese - - Managalasi - - - Managulasi - - - - Faiwol - - Fegolmin - - - - Fasu - - - Folopa - - - Fore - - - Gadsup - - - Gahuku - - - Galela - - - Gimi - - - Gogodala - - - Golin - - - Gope - - Era River - - - Kope - - - - Gresi - - Glesi - - - Gresik - - - Klesi - - - - Guhu-Samane - - Mid-Waria - - - - Gwahatike - - - Gwedena - - Umanakaina - - - - Halopa - - Botelkude - - - Nobonob - - - Nupanob - - - - Huli - - - Iatmul - - Big Sepik - - - - Inanwatan - - Suabo - - - - Inoke - - Yate (Papua New Guinea) - - - - Irumu - - - Iwam - - - Iyo (Papua New Guinea) - - Bure (Papua New Guinea) - - - Nabu - - - Naho - - - Nahu - - - Ndo (Papua New Guinea) - - - - Kalabra - - - Kalam - - Karam - - - - Kaluli - - - Kamano - - Kafe - - - - Kamasau - - - Kamtuk - - Kemtuik - - - - Kanite - - Kemiju Jate - - - - Kapauku - - Ekagi - - - - Kasua - - - Kâte - - - Kelon - - Kalong - - - Kelong - - - Klon - - - Kolon - - - - Ketengban - - Oktengban - - - - Kewa - - - Kobon - - - Komba - - - Komunku - - - Kongara - - - Korape - - Kwarafe - - - Okeina - - - - Kosena - - - Kovai - - Alngubin - - - Kobai - - - Kowai - - - Umboi - - - - Kunimaipa - - - Kwerba - - - Lambau - - - Lunambe - - - Mai Brat - - Mey Brat - - - - Manambu - - - Mape - - - Meax - - - Medlpa - - Hagen - - - Moglei - - - - Menya - - Menyama - - - Menye - - - - Mianmin - - - Migabac - - Migaba' - - - - Monumbo - - - Mountain Arapesh - - Arapesh, Mountain - - - Bukiyup - - - - Mountain Koiari - - Koiali, Mountain - - - - Mpur (Indonesia) - - Amberbaken - - - - Mugil - - Bargam - - - Saker - - - - Nabak - - Wain - - - - Nankina - - - Narak - - Gandja - - - Kandawo - - - Kol (Papua New Guinea) - - - - Nasioi - - - Nek - - - Nii - - Ek Nii - - - - Notu - - Ewage - - - - Oksapmin - - - Olo - - Orlei - - - - Ono - - - Orokaiva - - - Orokolo - - - Orya - - Oria - - - Uria - - - - Pay - - - Pinai-Hagahai - - - Purari - - Eurika - - - Evora - - - Iai (Papua New Guinea) - - - Iare - - - Kaimare - - - Kaura (Papua New Guinea) - - - Kipaia - - - Koriki - - - Maipua - - - Namau - - - - Rawa - - Karo-Rawa - - - - Rotokas - - - Saberi - - Isirawa - - - Okwasar - - - - Sahu - - - Samo (Western Province, Papua New Guinea) - - Supei - - - - Sawos - - Tshwosh - - - - Selepet - - - Sentani - - - Siane - - - Siroi - - Pasa - - - Suroi - - - - Siwai - - Motuna - - - - Sona (Papua New Guinea) - - Kanasi - - - - Suena - - Yarawe - - - Yema - - - - Sulka - - - Tabla - - Tanahmerah (Northeast Irian Jaya) - - - - Tairora - - - Tani - - Miami (Papua New Guinea) - - - Miani - - - Suaru - - - - Tauya - - Inafosa - - - - Telefol - - - Tepera - - - Ternate - - - Tewa (Papuan) - - Teiwa - - - - Tifal - - - Timbe - - - Toaripi - - Motumotu - - - - Tobelo - - - Urii - - - Usarufa - - Usurufa - - - Uturupa - - - - Waffa - - - Wantoat - - - Washkuk - - Kwoma - - - - Wasi - - - Were - - - West Makian - - Desite - - - Makian, West - - - Titinec - - - - Wiru - - - Woisika - - - Yabiyufa - - Jafijufa - - - - Yagaria - - Frigano Jate - - - Kami (Papua New Guinea) - - - - Yangoru - - - Yareba - - - Yau - - - Yessan-Mayo - - Mayo (New Guinea) - - - - Yongkom - - - Yopno - - Yupna - - - - Yui - - Salt-Yui - - - - - info:lc/vocabulary/languages/per - Persian - per - - Farsi - - - Dari - - Kabuli - - - Kabuli-Persian - - - Khorasani - - - - - info:lc/vocabulary/languages/phi - Philippine (Other) - phi - - Abaknon - - Capul - - - Inabaknon - - - Kapul - - - Sama Abaknon - - - - Agta - - Cagayan Agta, Central - - - Central Cagayan Agta - - - - Agutaynon - - - Aklanon - - - Alangan - - - Amganad Ifugao - - Ifugao, Amganad - - - - Atta - - Northern Cagayan Negrito - - - - Ayangan Ifugao - - Ifugao, Ayangan - - - - Bagobo - - - Balangao - - - Balangingì - - Baangingi' - - - Bangingi - - - Northern Sinama - - - Sama Bangingì - - - Sea Samal - - - Sinama, Northern - - - - Banton - - Bantuanon - - - - Batad Ifugao - - Ifugao, Batad - - - - Bilaan - - - Bolinao - - Binubolinao - - - - Bontoc - - Finontok - - - - Botolan Sambal - - Aeta Negrito - - - Sambal Botolan - - - Sambali Botolan - - - - Caluyanun - - - Central Bontoc - - Bontoc, Central - - - - Central Subanen - - Sindangan Subanun - - - Subanen, Central - - - Subanun, Sindangan - - - - Cuyunon - - Kuyonon - - - - Dumagat (Casiguran) - - Agta (Casiguran) - - - Casiguran Agta - - - Casiguran Dumagat - - - - Dumagat (Umirey) - - Agta (Umirey) - - - Dingalan Dumagat - - - Umirey Agta - - - Umirey Dumagat - - - - Eastern Bontoc - - Bontoc, Eastern - - - - Eastern Ifugao - - Ifugao, Eastern - - - - Gaddang - - - Ibaloi - - Benguet Igorot - - - Nabaloi - - - - Ibanag - - - Ifugao - - - Ilongot - - - Isinay - - Inmeas - - - - Isneg - - Apayao - - - - Itawis - - - Itbayat - - - Ivatan - - - Jama Mapun - - Cagayanon - - - Mapun - - - Pullon Mapun - - - Sama Mapun - - - - Ivatan - - Batan - - - Ibatan - - - - Kalamian - - Calamian - - - - Kalinga languages - - - Kankanay - - Cancanai - - - Lepanto-Igorot - - - - Kinaray-a - - Antiqueno - - - Binukidnon - - - Hamtiknon - - - Hinaraya - - - Karay-a - - - - Lower Tanudan Kalinga - - Kalinga, Lower Tanudan - - - Tanudan Kalinga, Lower - - - - Magindanao - - Moro - - - - Mamanwa - - - Mangyan - - Iraya - - - - Mansaka - - - Maranao - - Moro - - - - Masbateno - - Minasbate - - - - Mayoyao Ifugao - - Ifugao, Mayoyao - - - - Melebuganon - - Milebuganon - - - Molbog - - - - Northern Kankanay - - Bontoc, Western - - - Kankanay, Northern - - - Sagada-Igorot - - - Western Bontoc - - - - Palawano - - - Pangutaran Sama - - Sama Pangutaran - - - - Sama Sibutu - - Sibutu Sama - - - Southern Sama - - - - Sambali - - Zambal - - - - Southern Bontoc - - Barlig Bontoc - - - Bontoc, Southern - - - Kadaklan Barlig Bontoc - - - - Southern Subanen - - Lapuyan Subanen - - - Margosatubig Subanun - - - Subanen, Southern - - - - Subanun - - Subano - - - - Sulod - - Mundu (Philippines) - - - - Sulu - - Joloano - - - Moro - - - Sooloo - - - - Tagakaolo - - Kalagan, Tagakaolo - - - - Tagbanua - - Aborlan Tagbanwa - - - Apurahuano - - - - Tausug - - - Tboli - - Tagabili - - - Tiboli - - - - Tina Sambal - - - Tiruray - - Teduray - - - - Tuwali - - - Western Subanon - - Siocan Subanon - - - Subanon, Western - - - - Yakan - - - - info:lc/vocabulary/languages/phn - Phoenician - phn - - Punic - - - - info:lc/vocabulary/languages/pon - Pohnpeian - pon - - Ponape - - - Ponapean - - - - info:lc/vocabulary/languages/pol - Polish - pol - - - info:lc/vocabulary/languages/por - Portuguese - por - - - info:lc/vocabulary/languages/pra - Prakrit languages - pra - - Gandhari Prakrit - - Gandhari - - - - Magadhi Prakrit - - - Maharashtri - - - Śaurasēnī - - - - info:lc/vocabulary/languages/pro - Provençal (to 1500) - pro - - Occitan, Old (to 1500) - - - Old Occitan (to 1500) - - - Old Provençal (to 1500) - - - - info:lc/vocabulary/languages/pus - Pushto - pus - - Afghan - - - Pakhto - - - Pakkhto - - - Pashto - - - Pashtu - - - Pukhtu - - - Pukkhto - - - Pukshto - - - Pushtu - - - Wanetsi - - Vanechi - - - Waneci - - - Wanesi - - - Wenetsi - - - - - info:lc/vocabulary/languages/que - Quechua - que - - Inca - - - Kechua - - - Quichua - - - Runasimi - - - Huanca - - Wanka - - - - Ingano - - Inga - - - - - info:lc/vocabulary/languages/roh - Raeto-Romance - roh - - Rhaeto-Romance - - - Romansh - - - Rumansh - - - - info:lc/vocabulary/languages/raj - Rajasthani - raj - - Bagri - - Bagari - - - Bahgri - - - Baorias - - - - Gujuri - - Gojari - - - Gojri - - - Gujar - - - Gujari - - - Gujer - - - Gujjari - - - Gujri (Gujuri) - - - - Harauti - - - Jaipurī - - Dhundhari - - - - Lambadi - - Banjara - - - Labhani - - - Lamani - - - Lambani - - - - Malvi - - Malavi - - - Mallow - - - Malwi - - - Ujjaini (Malvi) - - - - Nimadi - - Nemadi - - - Nimari - - - - Sondwari - - Sondhavāṛī - - - Sondhwadi - - - Sondhwari - - - Soudhwari - - - - Wagdi - - Vāgaḍī - - - Vāgarī - - - Vagdi - - - Vaged - - - Vageri - - - Vagi - - - Vagri - - - Wagadi - - - Waghari - - - Wagholi - - - - - info:lc/vocabulary/languages/rap - Rapanui - rap - - - info:lc/vocabulary/languages/rar - Rarotongan - rar - - Cook Islands Maori - - - Maori, Cook Islands - - - Manihiki Rarotongan - - Rarotongan, Manihiki - - - - - info:lc/vocabulary/languages/roa - Romance (Other) - roa - - Anglo-Norman - - Anglo-French - - - Norman-French - - - - Cajun French - - Acadian (Louisiana) - - - French, Cajun - - - Louisiana Acadian - - - Louisiana French - - - - Franco-Venetian - - Franco-Italian - - - - Italian, Old (to 1300) - - Old Italian - - - - Ladin - - - Portuñol - - Bayano - - - Brasilero - - - Brasilero - - - Brazilero - - - Fronteiriço - - - Fronterizo - - - Portanhol - - - Portunhol - - - - Spanish, Old (to 1500) - - Old Spanish - - - - - info:lc/vocabulary/languages/rom - Romani - rom - - Gipsy - - - Gypsy - - - Romany - - - Rommany - - - Caló (Romani) - - - Kalderash - - Coppersmith - - - Kaldaraš - - - Kalderaš - - - Kelderaš - - - Kelderashícko - - - - Lovari - - - Nuri - - - Spoitori - - Spoitari - - - - - info:lc/vocabulary/languages/rum - Romanian - rum - - Rumanian - - - Boyash - - - Moldovan - - Moldavian - - - Moldovean - - - Moldovian - - - - - info:lc/vocabulary/languages/run - Rundi - run - - Kirundi - - - - info:lc/vocabulary/languages/rus - Russian - rus - - - info:lc/vocabulary/languages/sal - Salishan languages - sal - - Bella Coola - - - Colville - - - Comox - - Komuk - - - - Cowlitz - - - Kalispel - - Pend d'Oreille - - - - Lillooet - - - Ntlakyapamuk - - Netlakapamuk - - - Thompson - - - - Okanagan - - Okinagan - - - - Quinault - - - Salish - - - Sechelt - - Seshelt - - - - Shuswap - - - Squawmish - - Skwamish - - - - Stalo - - Halkomelem - - - - - info:lc/vocabulary/languages/sam - Samaritan Aramaic - sam - - - info:lc/vocabulary/languages/smi - Sami - smi - - Lapp - - - - info:lc/vocabulary/languages/lap - Sami - lap - - - info:lc/vocabulary/languages/smo - Samoan - smo - - - info:lc/vocabulary/languages/sao - Samoan - sao - - - info:lc/vocabulary/languages/sad - Sandawe - sad - - Kissandaui - - - Wassandaui - - - - info:lc/vocabulary/languages/sag - Sango (Ubangi Creole) - sag - - - info:lc/vocabulary/languages/san - Sanskrit - san - - Sanscrit - - - Buddhist Hybrid Sanskrit - - Hybrid Sanskrit, Buddhist - - - - Epigraphical Hybrid Sanskrit - - Hybrid Sanskrit, Epigraphical - - - - Vedic - - Indic, Old - - - Old Indic - - - Vedic Sanskrit - - - - - info:lc/vocabulary/languages/sat - Santali - sat - - Sonthal - - - - info:lc/vocabulary/languages/srd - Sardinian - srd - - - info:lc/vocabulary/languages/sas - Sasak - sas - - - info:lc/vocabulary/languages/sco - Scots - sco - - Lallans - - - Lowland Scots - - - Scots (English) - - - Scottish (Germanic) - - - - info:lc/vocabulary/languages/gla - Scottish Gaelic - gla - - Erse (Scottish Gaelic) - - - Gaelic (Scots) - - - Scots Gaelic - - - - info:lc/vocabulary/languages/gae - Scottish Gaelix - gae - - - info:lc/vocabulary/languages/sel - Selkup - sel - - Ostiak Samoyed - - - - info:lc/vocabulary/languages/sem - Semitic (Other) - sem - - Ammonite - - - Canaanite - - - Eblaite - - Paleocanaanite - - - - Gurage languages - - - Harari - - Adari - - - Ararge - - - - Inor - - Ennemor - - - - Jibbali - - - Mahri - - Mehri - - - - Mandean - - - Sabaean - - - South Arabic - - Arabic, South - - - - Wolane - - Olane - - - Walane - - - Welene - - - Weleni - - - - Zay - - Gelilla - - - Lak'i (Ethiopia) - - - Laqi - - - Zai - - - Zway - - - - - info:lc/vocabulary/languages/srp - Serbian - srp - - - info:lc/vocabulary/languages/scc - Serbian - scc - - - info:lc/vocabulary/languages/srr - Serer - srr - - - info:lc/vocabulary/languages/shn - Shan - shn - - - info:lc/vocabulary/languages/sna - Shona - sna - - China (Africa) - - - Mashona - - - Karanga - - - Zezuru - - Central Shona - - - - - info:lc/vocabulary/languages/sho - Shona - sho - - - info:lc/vocabulary/languages/iii - Sichuan Yi - iii - - Yi, Sichuan - - - - info:lc/vocabulary/languages/scn - Sicilian Italian - scn - - Italian, Sicilian - - - - info:lc/vocabulary/languages/sid - Sidamo - sid - - - info:lc/vocabulary/languages/sgn - Sign languages - sgn - - American Sign Language - - Ameslan - - - - Australasian Signed English - - - Austrian Sign Language - - ÖGS (Sign language) - - - Österreichische Gebärdensprache - - - - British Sign Language - - - Czech Sign Language - - Český znakový jazyk - - - - Danish Sign Language - - DSL (Danish Sign Language) - - - - French Belgian Sign Language - - Belgian French Sign Language - - - Langue des signes Belge Francophone - - - Langue des signes française Belgique - - - LSFB (Sign language) - - - - Icelandic Sign Language - - ISL (Icelandic Sign Language) - - - - Jordanian Sign Language - - JSL (Sign Language) - - - Lughat al-Ishāra al-Urdunia - - - - Mauritian Sign Language - - - Quebec Sign Language - - Langue des signes québécoise - - - - - info:lc/vocabulary/languages/bla - Siksika - bla - - Blackfoot - - - - info:lc/vocabulary/languages/snd - Sindhi - snd - - Kachchhi - - Kacchī - - - Kutchi - - - - - info:lc/vocabulary/languages/sin - Sinhalese - sin - - Cingalese - - - Singhala - - - Singhalese - - - Sinhala - - - - info:lc/vocabulary/languages/snh - Sinhalese - snh - - - info:lc/vocabulary/languages/sit - Sino-Tibetan (Other) - sit - - Abor - - Adi - - - Miri - - - Miśing - - - - Achang - - A-ch‘ang - - - Atsang - - - - Angami - - - Ao - - Chungli - - - Hatigorria - - - Mongsen - - - Zungi - - - Zwingi - - - - Apatani - - Aka - - - Apa Tanang - - - Hruso - - - - Arakanese - - Maghi - - - Rakhaing - - - - Bai (China) - - Min-chia - - - Pai (China) - - - - Balti - - Baltistani - - - Bhotia of Baltistan - - - Sbalti - - - - Bantawa - - Bontawa - - - Kirāta Rāī - - - - Baram - - - Belhariya - - Athpagari - - - Athpahariya - - - Athpare (Belhariya) - - - Athpariya (Belhariya) - - - Belhare - - - Belhāreor - - - - Bodo - - Bara (India and Nepal) - - - Boro (India and Nepal) - - - Kachari, Plains - - - Mech - - - Plains Kachari - - - - Chamling - - Camling - - - - Chang - - Mojung - - - - Chepang - - - Chinbon - - - Chino - - Jino - - - - Chothe Naga - - Chawte - - - Chothe - - - Chowte - - - - Dafla - - Nisi - - - - Dänjong-kä - - Bhotic of Sikkim - - - Dé-jong ké - - - Sikkim Bhotia - - - Sikkimese - - - - Deori - - Chutia - - - Chutiya - - - Dari (India) - - - Deori Chutiya - - - Deuri - - - Dewri - - - Drori - - - - Dhimal - - - Digaro - - Taraon - - - Taying - - - - Dimasa - - Cachari - - - Hill Kachari - - - Kachari - - - - Dungan - - - Gallong - - - Garo - - - Gurung - - - Haka Chin - - Baungshè - - - Chin, Haka - - - Lai - - - - Jero - - - Kabui - - - Kaw - - Akha - - - Ekaw - - - - Khaling - - - Khiamniungan - - - Kok Borok - - Mrung - - - Tipura - - - Tripuri - - - - Konyak - - Kanyak - - - - Kuki - - - Kusunda - - - Ladakhi - - - Lahu - - Muhso - - - - Laizo (Burma) - - - Lepcha - - Rong - - - - Limbu - - - Lisu - - Yawyin - - - - Lopa - - - Magar - - - Miju - - - Mikir - - Karbi - - - - Mishmi - - - Moklum - - - Monpa - - - Mün Chin - - Chinbok - - - - Naga languages - - - Naxi - - Moso - - - - Nocte - - Borduaria - - - Mohongia - - - Paniduaria - - - - Padam - - - Paite - - - Pānkhū - - Paang (Pānkhū) - - - Pāṃkhoẏā - - - Pang Khua - - - Pang (Pānkhū) - - - Pangkhu - - - Pangkhua - - - Pankho - - - Panko - - - Pankua - - - - Rabha - - - Rawang - - - Rongmei - - - Sampang - - Sāmpāṅ Rāī - - - Sampang Rai - - - Sampange Rai - - - Sangpang Gîn - - - Sangpang Gun - - - Sangpang Kha - - - Sangpang - - - - Singpho - - - Sunwar - - - Tamang - - Murmi - - - - Tamu - - - Tangkhul - - Thankhul - - - - Tangsa - - Tengsa - - - - Tangut - - Hsi-hsia - - - Si-hia - - - Xixia - - - - Tenyidie - - - Thādo - - - Thakali - - - Thami - - - Thulung - - - Tiddim Chin - - Chin, Tiddim - - - Kamhau - - - Sokte - - - - Tshangla - - Canglo Monba - - - Cangluo Menba - - - Cangluo Monba - - - Central Monpa - - - Dirang - - - Dungsam - - - Memba - - - Menba (Tshangla) - - - Monba - - - Monpa (Tshangla) - - - Motuo - - - Motuo Menba - - - Sangla - - - Sarchapkkha - - - Schachop - - - Shachobiikha - - - Shachopkha - - - Sharchagpakha - - - Sharchhop-kha - - - Sharchopkha - - - Tashigang - - - Tsangla - - - Tsangla Monba - - - Tsanglo (Tshangla) - - - Tshalingpa (Tshangla) - - - - Vaiphei - - Bhaipei - - - Veiphei - - - - Wambule - - - Wayu - - Hayu - - - Vayu - - - Wayo - - - - Yao (Southeast Asia) - - Mien - - - - Yi - - Lolo (China) - - - Nosu - - - - Zang Zung - - Zhang-Zhung - - - - - info:lc/vocabulary/languages/sio - Siouan (Other) - sio - - Biloxi - - - Chiwere - - - Crow - - - Dhegiha - - Cegiha - - - - Hidatsa - - Grosventres (Hidatsa) - - - - Mandan - - - Ofo - - Ofogoula - - - - Omaha - - - Oto - - Watoto - - - - Tutelo - - - Winnebago - - Hocak - - - - Woccon - - - - info:lc/vocabulary/languages/sms - Skolt Sami - sms - - Lapp, Russian - - - Russian Lapp - - - Sami, Skolt - - - - info:lc/vocabulary/languages/den - Slavey - den - - Dené (Slavey) - - - Dené Tha - - - Ethchaottine - - - Mackenzian - - - North Slavey - - - Slave - - - Slavi - - - South Slavey - - - Kawchottine - - Hare - - - Peaux-de-Lièvre - - - - - info:lc/vocabulary/languages/sla - Slavic (Other) - sla - - Belarusian, Old (to 1700) - - Old Belarusian - - - - Čakavian - - - Carpatho-Rusyn - - Rusyn - - - - Czech, Old (to 1500) - - Old Czech - - - - Polabian - - - Russian, Old (to 1300) - - East Slavic - - - Old East Slavic - - - Old Russian - - - - Ukrainian, Old (ca. 1300-1700) - - Old Ukrainian - - - - - info:lc/vocabulary/languages/slo - Slovak - slo - - - info:lc/vocabulary/languages/slv - Slovenian - slv - - Windic (Slovenian) - - - - info:lc/vocabulary/languages/sog - Sogdian - sog - - - info:lc/vocabulary/languages/som - Somali - som - - - info:lc/vocabulary/languages/son - Songhai - son - - Dendi - - Dandawa - - - - Zarma - - Djerma - - - Dyerma - - - Zerma - - - - - info:lc/vocabulary/languages/snk - Soninke - snk - - Sarakole - - - - info:lc/vocabulary/languages/wen - Sorbian (Other) - wen - - Wendic (Other) - - - - info:lc/vocabulary/languages/sot - Sotho - sot - - Sesuto - - - Southern Sotho - - - Suto - - - - info:lc/vocabulary/languages/sso - Sotho - sso - - - info:lc/vocabulary/languages/sai - South American Indian (Other) - sai - - Achagua - - - Achuar - - Achuale - - - Achuara Jivaro - - - Jivaro, Achuara - - - - Aguaruna - - - Alacaluf - - Kawesqar - - - - Amahuaca - - Sayaco - - - - Amuesha - - Lorenzo - - - - Andoque - - - Apalai - - - Apinagé - - Apinajé - - - Apinayé - - - - Arabela - - Chiripuno - - - - Araona - - - Arecuna - - - Arekena - - Guarequena - - - Uarequena - - - Warekena - - - - Bakairi - - Bacairi - - - - Baniwa - - - Barasana del Norte - - Bara (Colombia) - - - Northern Barasano - - - - Barasana del Sur - - Bara (Colombia) - - - Southern Barasano - - - - Bora - - Boro (South America) - - - - Bororo (Brazil) - - - Cacua - - Macú de cubeo - - - Macú de desano - - - Macú de guanano - - - - Caduveo - - Kadiweu - - - - Caingua - - Cayua - - - Kaingua - - - Kaiwa (Brazil) - - - - Callahuaya - - Callawalla - - - Callawaya - - - Kallawaya - - - Qollahuaya - - - - Campa - - Ande - - - Asheninca - - - - Camsa - - Coche - - - Kamentzá - - - Kamsa - - - Sebondoy - - - Sibondoy - - - - Canamari (Tucanoan) - - Kanamari (Tucanoan) - - - - Cañari - - - Candoshi - - Kandoshi - - - Morato - - - Murato - - - Shapra - - - - Canella - - Kanela - - - - Capanahua - - - Caquinte - - - Caraja - - Karaja - - - - Carapana (Tucanoan) - - Karapana (Tucanoan) - - - Möchda (Tucanoan) - - - - Cashibo - - Comabo - - - - Cashinawa - - Kashinawa - - - Sheminawa - - - - Catio - - Embena, Northern - - - Epera, Northern - - - Katio - - - Northern Epera - - - - Cauqui - - Jacaru - - - Jaqaru - - - - Cavineño - - - Cayapa - - - Cayapo - - Kayapo - - - - Chacobo - - - Chamacoco - - - Chamí - - Embera Chamí - - - - Chamicuro - - - Chana (Uruguay) - - Čaná - - - Layuna - - - Tšaná - - - Tsaná-Bequá - - - Tschaná - - - Yaro - - - - Chayahuita - - Chawi - - - - Chimane - - Nawazi-Moñtji - - - Tsimane - - - - Chipaya - - Puquina (Chipaya) - - - - Chiquito - - - Cholon - - - Chontaquiro - - Chuntaquiro - - - Piro (Arawakan) - - - Simirenchi - - - - Choroti - - Yofuaha - - - - Chulupí - - Ashluslay - - - Nivacle - - - - Cocama - - Kokama - - - Ucayale - - - - Cofán - - A'i - - - Kofán - - - - Colorado - - Tsacela - - - Yumba - - - - Coreguaje - - Caqueta - - - - Cuaiquer - - Coaiker - - - Koaiker - - - - Cubeo - - - Cuiba - - Cuiva - - - - Culina - - - Cumana - - - Cuna - - Kuna - - - - Damana - - Arosario - - - Guamaca - - - Malayo - - - Maracasero - - - Sanja - - - Wiwa - - - - Desana - - Wira - - - - Emerillon - - Mereo - - - Teco (Tupi) - - - - Epena Saija - - Saija - - - Saixa - - - - Ese Ejja - - Chama (Tacanan) - - - Guacanahua - - - Guarayo (Tacanan) - - - Huarayo (Tacanan) - - - Tiatinagua - - - - Fulnio - - Carnijo - - - Iate - - - Yahthe - - - Yate (Brazil) - - - - Gavião (Pará, Brazil) - - - Goajiro - - Guajira - - - Wayunaiki - - - Wayuu - - - - Guahibo - - Wa-jibi - - - - Guanano - - Anano - - - Kotiria - - - Uanana - - - Wanana - - - - Guarayo - - - Guayabero - - Jiw - - - - Guayaki - - Ache - - - Guaiaqui - - - Guayaki-Ache - - - Guoyagui - - - - Hixkaryana - - - Huambisa - - Ssimaku - - - Wambisa - - - - Huao - - Waorani - - - - Ica - - Arhuaco - - - Aruaco - - - Bintukua - - - Ika (Chibchan) - - - Ike - - - - Ipurina - - Apurina - - - Hypurina - - - Jupurina - - - Kangütü - - - Kankiti - - - - Iquito - - - Itonama - - Machoto - - - - Jaminaua - - Nishinahua - - - Yaminahua - - - - Jaruára - - Jarawara - - - - Jupda - - Hupde Maku - - - Macú de tucano - - - - Kagaba - - Cagaba - - - - Kaingang - - Caingang - - - Taven - - - - Kariri - - Cariri - - - Kiriri - - - - Karitiana - - Caritiana - - - - Lengua - - - Lule - - - Maca - - Maka (Paraguay) - - - - Machiguenga - - - Macuna - - Buhágana - - - - Macusi - - Makushi - - - - Mamaindê - - Tamainde - - - - Masacali - - Machacali - - - Mashakali - - - Maxakali - - - - Mascoi - - Emok - - - Machicui - - - Toba-Emok - - - - Mashco - - Amarakaeri - - - Harakmbet - - - - Mataco - - - Maue - - Andira - - - Arapium - - - Maragua - - - Satere - - - - Mayoruna - - Matses - - - - Moguex - - Cuambia - - - Guambiano - - - - Mojo - - Ignaciano - - - Moxo - - - - Moro (South America) - - Ayoré - - - Ayoweo - - - - Moseten - - - Motilon - - Bari (Venezuela) - - - Yupe - - - - Muinane - - - Munduruku - - - Münkü - - - Murui - - Huitoto, Murui - - - - Nambicuara - - Nhambicuara - - - - Nomatsiguenga - - Pangoa - - - - Ocaina - - - Orejón - - Coto (Tucanoan) - - - Mai Huna - - - Payagua - - - - Paez - - - Palicur - - - Pamoa - - Juna - - - Oa - - - Tatutapuyo - - - - Panare - - - Panobo - - - Paraujano - - Añún - - - - Paressi - - Ariti - - - - Patamona - - Paramuni - - - - Pemón - - - Piapoco - - - Piaroa - - - Pilaga - - - Piratapuyo - - - Puinave - - - Puquina - - - Purupuru - - Paumari - - - - Resigero - - - Rikbaktsa - - Aripaktsa - - - Canoeiro - - - - Saliva - - Saliba (Colombia and Venezuela) - - - - Sanapaná - - Lanapsua - - - Quiativis - - - Quilyacmoc - - - Saapa - - - Sanam - - - - Secoya - - - Sharanahua - - Chandinahua - - - Marinahua - - - - Shipibo-Conibo - - Conibo - - - Sipibo - - - - Shuar - - Jibaro, Shuar - - - Jivaro, Shuar - - - Xivaro, Shuar - - - - Sicuane - - Sikuani - - - - Sioni - - Siona - - - - Siriano - - Chiranga - - - - Tacana (Bolivia) - - - Tanimuca-Retuama - - Letuana - - - Retuara - - - Ufaina - - - Yahuna - - - - Tapirapé - - - Tariana - - - Tenetehara - - Asurini - - - Guajajara - - - Tembe - - - - Tenharim - - - Toba (Indian) - - - Trio - - Tiriyo - - - - Tucano - - Dagsexe - - - Dase - - - Tukano - - - - Tucuna - - Ticuna - - - - Tunebo - - Pedrazá - - - Tame - - - - Tuyuca - - Dochkafuara - - - Tejuka - - - - Urarina - - Itucale - - - Shimacu - - - Simacu - - - - Uru - - Puquina (Uru) - - - - Urubu - - - Vilela - - - Waiwai - - Uaiuai - - - - Warao - - Guarauno - - - Warrau - - - - Waunana - - Chanco - - - Chocama - - - Noanama - - - - Wayampi - - Guayapi - - - Oiampi - - - Waiapi - - - Wayapi - - - - Witoto - - Huitoto - - - - Xavante - - Acuan-Shavante - - - Akwẽ-Shavante - - - Chavante Acuan - - - Oti - - - Shavante Akwe - - - - Yagua - - Yegua - - - - Yahgan - - Jagane - - - - Yanomamo - - - Yaruro - - Hapotein - - - Llaruro - - - Pumé - - - Yuapin - - - - Yecuana - - Maquiritare - - - - Yucuna - - Matapi - - - - Yunca - - Chimu - - - Mochica - - - - Yupa - - - Yuruti - - - Zoró - - - - info:lc/vocabulary/languages/sma - Southern Sami - sma - - Sami, Southern - - - - info:lc/vocabulary/languages/spa - Spanish - spa - - Castilian - - - Chicano - - - Cheso - - - - info:lc/vocabulary/languages/srn - Sranan - srn - - Taki-Taki - - - - info:lc/vocabulary/languages/suk - Sukuma - suk - - Gwe (Tanzania) - - - Kesukuma - - - Kisukuma - - - Suku (Tanzania) - - - - info:lc/vocabulary/languages/sux - Sumerian - sux - - - info:lc/vocabulary/languages/sun - Sundanese - sun - - - info:lc/vocabulary/languages/sus - Susu - sus - - Soso - - - - info:lc/vocabulary/languages/swa - Swahili - swa - - Kae - - - Kingwana - - - - info:lc/vocabulary/languages/ssw - Swazi - ssw - - Siswati - - - - info:lc/vocabulary/languages/swz - Swazi - swz - - - info:lc/vocabulary/languages/swe - Swedish - swe - - - info:lc/vocabulary/languages/gsw - Swiss German - gsw - - German, Swiss - - - - info:lc/vocabulary/languages/syc - Syriac - syc - - Classifical Syriac - - - - info:lc/vocabulary/languages/syr - Syriac, Modern - syr - - Neo-Syriac - - - - info:lc/vocabulary/languages/tgl - Tagalog - tgl - - Filipino (Tagalog) - - - Pilipino - - - - info:lc/vocabulary/languages/tag - Tagalog - tag - - - info:lc/vocabulary/languages/tah - Tahitian - tah - - - info:lc/vocabulary/languages/tai - Tai (Other) - tai - - Ahom - - - Be - - Ongbe - - - - Black Tai - - Tai, Black - - - Tai Dam - - - Tai Noir - - - - Bouyei - - Buyi (China and Vietnam) - - - Dioi (China and Vietnam) - - - Giáy - - - Nhang - - - Puyi - - - Yay - - - - Cao Lan - - - Dong (China) - - Gam (China) - - - Kam (China) - - - Tong (China) - - - T‘ung - - - - Khün - - Hkun - - - Tai Khün - - - - - - Lue - - - Pai-i - - - Tai Lü - - - - Lungming - - - Northern Thai - - Kammyang - - - Lanna Thai - - - Lao, Western - - - Myang - - - Phayap - - - Thai, Northern - - - Western Lao - - - Yuan - - - - Southern Thai - - Pak Thai - - - Thai, Southern - - - - Tai Nüa - - Dai Na - - - Dehong Dai - - - Shan, Yunnanese - - - Tay Nüa - - - Te-hung Tai - - - Yunnanese Shan - - - - Tay-Nung - - - Tho - - - White Tai - - Tai, White - - - - Ya - - Tai Chung - - - Tai Ya - - - - - info:lc/vocabulary/languages/tgk - Tajik - tgk - - Tadjik - - - Tadzhik - - - - info:lc/vocabulary/languages/taj - Tajik - taj - - - info:lc/vocabulary/languages/tmh - Tamashek - tmh - - Amazigh - - - Kidal - - - Kidal Tamasheq - - - Tăhăggart - - - Tahaggart Tamahaq - - - Tahoua - - - Tahoua Tamajeq - - - Tajag - - - Tamachek - - - Tamahaq - - - Tamajaq - - - Tamajeq - - - Tamashekin - - - Tamasheq - - - Tamashiqt - - - Tawallammat Tamajaq - - - Tawarek - - - Tayart Tamajeq - - - Temajaq - - - Tewellemet - - - Timbuktu - - - Tomacheck - - - Tomachek - - - Touareg - - - Touarègue - - - Tourage - - - Toureg - - - Tuareg - - - - info:lc/vocabulary/languages/tam - Tamil - tam - - - info:lc/vocabulary/languages/tat - Tatar - tat - - - info:lc/vocabulary/languages/tar - Tatar - tar - - - info:lc/vocabulary/languages/tel - Telugu - tel - - Andhra - - - Gentoo - - - Telegu - - - - info:lc/vocabulary/languages/tem - Temne - tem - - Timne - - - - info:lc/vocabulary/languages/ter - Terena - ter - - - info:lc/vocabulary/languages/tet - Tetum - tet - - Belu - - - - info:lc/vocabulary/languages/tha - Thai - tha - - Siamese - - - - info:lc/vocabulary/languages/tib - Tibetan - tib - - Bhotanta - - - Helambu Sherpa - - Hyolmo - - - Yohlmo - - - - Kagate - - - Khams Tibetan - - Kam - - - Kang (Tibetan) - - - Kham (China) - - - Khamba (Tibetan) - - - Khampa - - - Khams - - - Khams Bhotia - - - Khams-Yal - - - - Sherpa - - Sharpa - - - - - info:lc/vocabulary/languages/tig - Tigré - tig - - - info:lc/vocabulary/languages/tir - Tigrinya - tir - - Tigriña - - - Tña - - - - info:lc/vocabulary/languages/tiv - Tiv - tiv - - - info:lc/vocabulary/languages/tli - Tlingit - tli - - Koluschan - - - Tongass - - - - info:lc/vocabulary/languages/tpi - Tok Pisin - tpi - - Neo-Melanesian - - - Pisin - - - - info:lc/vocabulary/languages/tkl - Tokelauan - tkl - - - info:lc/vocabulary/languages/tog - Tonga (Nyasa) - tog - - - info:lc/vocabulary/languages/ton - Tongan - ton - - Tonga (Tonga Islands) - - - - info:lc/vocabulary/languages/tru - Truk - tru - - - info:lc/vocabulary/languages/tsi - Tsimshian - tsi - - Zimshīan - - - - info:lc/vocabulary/languages/tso - Tsonga - tso - - Changana - - - Gwamba - - - Shangaan - - - Thonga - - - Tonga (Tsonga) - - - Xitsonga - - - - info:lc/vocabulary/languages/tsn - Tswana - tsn - - Bechuana - - - Chuana - - - Coana - - - Cuana - - - Cwana - - - Sechuana - - - Setswana - - - - info:lc/vocabulary/languages/tsw - Tswana - tsw - - - info:lc/vocabulary/languages/tum - Tumbuka - tum - - Tamboka - - - - info:lc/vocabulary/languages/tup - Tupi languages - tup - - Parintintin - - - Tupi - - Ñeengatú - - - - - info:lc/vocabulary/languages/tur - Turkish - tur - - - info:lc/vocabulary/languages/ota - Turkish, Ottoman - ota - - Osmanli - - - Ottoman Turkish - - - - info:lc/vocabulary/languages/tuk - Turkmen - tuk - - Turkoman - - - - info:lc/vocabulary/languages/tvl - Tuvaluan - tvl - - Ellicean - - - - info:lc/vocabulary/languages/tyv - Tuvinian - tyv - - Soyot - - - Tannu-Tuva - - - Tuba - - - Uriankhai - - - - info:lc/vocabulary/languages/twi - Twi - twi - - Akuapem - - - Ashanti - - - Chwee - - - Odschi - - - Tshi - - - - info:lc/vocabulary/languages/udm - Udmurt - udm - - Votiak - - - Votyak - - - - info:lc/vocabulary/languages/uga - Ugaritic - uga - - - info:lc/vocabulary/languages/uig - Uighur - uig - - Eastern Turki - - - Kashgar-Yarkend - - - Turki, Eastern - - - Uigur - - - Uyghur - - - Wighor - - - Yarkend - - - - info:lc/vocabulary/languages/ukr - Ukrainian - ukr - - - info:lc/vocabulary/languages/umb - Umbundu - umb - - Benguela - - - Mbundu (Benguela Province, Angola) - - - Ovimbundu - - - Quimbundo (Benguela Province, Angola) - - - South Mbundu - - - - info:lc/vocabulary/languages/und - Undetermined - und - - - info:lc/vocabulary/languages/hsb - Upper Sorbian - hsb - - High Sorbian - - - Sorbian, Upper - - - - info:lc/vocabulary/languages/urd - Urdu - urd - - Bihari (Urdu) - - - Gujri (Urdu) - - - Gurjari - - - Islami - - - Moorish (India) - - - Undri - - - Urudu - - - Dakhini - - Dakani - - - Dakhani - - - Dakhini Hindi - - - Dakhini Hindustani - - - Dakhini Urdu - - - Dakhni - - - Dakini - - - Dakkani - - - Dakkhani - - - Deccan - - - Dehlavi - - - Gujari (Dakhini) - - - Hindavi - - - - - info:lc/vocabulary/languages/uzb - Uzbek - uzb - - - info:lc/vocabulary/languages/vai - Vai - vai - - Vei - - - - info:lc/vocabulary/languages/ven - Venda - ven - - Tshivenda - - - Wenda - - - - info:lc/vocabulary/languages/vie - Vietnamese - vie - - Annamese - - - - info:lc/vocabulary/languages/vol - Volapük - vol - - - info:lc/vocabulary/languages/vot - Votic - vot - - Vatjan - - - Vote - - - Votian - - - Votish - - - - info:lc/vocabulary/languages/wak - Wakashan languages - wak - - Bella Bella - - - Haisla - - - Heiltsuk - - Haeltzuk - - - - Kwakiutl - - - Nitinat - - - Nootka - - Aht - - - Noutka - - - Nutka - - - Nuuchahnulth - - - - - info:lc/vocabulary/languages/wln - Walloon - wln - - - info:lc/vocabulary/languages/war - Waray - war - - Leytean - - - Samar-Leyte - - - Samaron - - - - info:lc/vocabulary/languages/was - Washoe - was - - Washo - - - Washoan - - - - info:lc/vocabulary/languages/wel - Welsh - wel - - Cymric - - - - info:lc/vocabulary/languages/him - Western Pahari languages - him - - Himachali - - - Pahadi - - - Pahari, Western - - - Bhadrawahi - - Baderwali - - - Badrohi - - - Bahi - - - Bhadarwahi - - - Bhaderbhai Jamu - - - Bhaderwali Pahari - - - Bhadrava - - - Bhadravāhī - - - Bhadri - - - - Bhalesi - - - Bilaspuri - - Bilāsapurī - - - Bilaspuri Pahari - - - Kahalurī - - - Khalūrī - - - Kehloori - - - Kehloori Pahari - - - Kehluri - - - Pacchmi - - - - Chambeali - - Cameali - - - Chamaya - - - Chambiali - - - Chambiyali - - - Chamiyali - - - Chamiyali Pahari - - - Chamya - - - - Gaddi - - Bharmauri - - - Bharmauri Bhadi - - - Bharmouri - - - Brahmauri - - - Gaddhi - - - Gaddyalali - - - Gaddyali - - - Gadhi - - - Gadhiali - - - Gadi - - - Gadiali - - - Gadiyali - - - Pahari Bharmauri - - - Panchi - - - Panchi Brahmauri Rajput - - - - Jaunsari - - Gaunsari - - - Jansauri - - - Jaunsauri - - - Pahari (Jaunsari) - - - - Kullu Pahari - - Kauli - - - Kullui - - - Kulu - - - Kulu Boli - - - Kulu Pahari - - - Kuluhi - - - Kului - - - Kulvi - - - Kulwali - - - Pahari Kullu - - - Pahari (Kullu Pahari) - - - Phari Kulu - - - - Mandeali - - Himachali (Mandeali) - - - Mandi (Mandeali) - - - Mandiali - - - Pahari Mandiyali - - - - Sirmauri - - Himachali (Sirmauri) - - - Pahari (Sirmauri) - - - Sirmouri - - - Sirmuri - - - - - info:lc/vocabulary/languages/wal - Wolayta - wal - - Ometo - - - Uallamo - - - Walamo - - - - info:lc/vocabulary/languages/wol - Wolof - wol - - Jaloof - - - Jolof - - - Ouolof - - - Volof - - - Yolof - - - Lebou - - - - info:lc/vocabulary/languages/xho - Xhosa - xho - - isiXhosa - - - Kafir - - - Xosa - - - - info:lc/vocabulary/languages/sah - Yakut - sah - - Jakut - - - Sakha - - - - info:lc/vocabulary/languages/yao - Yao (Africa) - yao - - Adjaua - - - Ajawa - - - Ayo - - - Chi-yao - - - Ciyao - - - Djao - - - Hiao - - - Wayao - - - - info:lc/vocabulary/languages/yap - Yapese - yap - - - info:lc/vocabulary/languages/yid - Yiddish - yid - - German Hebrew - - - Jewish - - - Judeo-German - - - - info:lc/vocabulary/languages/yor - Yoruba - yor - - Aku - - - Eyo - - - Nago - - - Yariba - - - - info:lc/vocabulary/languages/ypk - Yupik languages - ypk - - Eskimo languages, Western - - - Western Eskimo languages - - - Central Yupik - - Eskimo, West Alaska - - - West Alaska Eskimo - - - - Cup´ig - - - Pacific Gulf Yupik - - Aleut (Eskimo) - - - Eskimo, South Alaska - - - Sugpiak Eskimo - - - Suk (Eskimo) - - - - Sirinek - - - Yuit - - Asiatic Eskimo - - - Eskimo, Asiatic - - - Saint Lawrence Island Yupik - - - Siberian Yupik - - - - - info:lc/vocabulary/languages/znd - Zande languages - znd - - Nzakara - - Sakara - - - - Zande - - Azande - - - - - info:lc/vocabulary/languages/zap - Zapotec - zap - - - info:lc/vocabulary/languages/zza - Zaza - zza - - Dimili - - - Dimli - - - Kirdki - - - Kirmanjki - - - Zazaki - - - - info:lc/vocabulary/languages/zen - Zenaga - zen - - Senhadja - - - - info:lc/vocabulary/languages/zha - Zhuang - zha - - Chuang - - - - info:lc/vocabulary/languages/zul - Zulu - zul - - - info:lc/vocabulary/languages/zun - Zuni - zun - - + + + Hurrian + + Mitani + + + Subarian + + + + Iberian + + + Indus script + + + Jarawa (India) + + + Kamchadal + + Itelmes + + + + Ket + + Yenisei-Ostiak + + + + Koryak + + + Manipravalam (Malayalam) + + + Mysian + + + Nancowry + + + Nenets + + Jurak + + + Yurak + + + + Nganasan + + Tavgi + + + + Nicobarese + + + Palan + + Pallan + + + + Shelta + + + Urartian + + Chaldean (Urartian) + + + Khaldian + + + Urartaean + + + Urartic + + + Vannic + + + + Yugh + + Sym-Ketish + + + + Yukaghir + + Jukaghir + + + + + info:lc/vocabulary/languages/moh + Mohawk + moh + + + info:lc/vocabulary/languages/mdf + Moksha + mdf + + + info:lc/vocabulary/languages/mol + Moldavian + mol + + + info:lc/vocabulary/languages/mkh + Mon-Khmer (Other) + mkh + + Bahnar + + + Blang + + Bulang + + + Plang + + + Pulang + + + Samtao + + + + Chrau + + + Cua + + Bong Miew + + + Kor + + + Traw + + + + Eastern Mnong + + Mnong, Eastern + + + + Hrê + + Davak + + + + Jah Hut + + Eastern Sakai + + + Sakai, Eastern + + + + Jeh + + Die + + + Yeh + + + + Katu + + Attouat + + + Khat + + + Ta River Van Kieu + + + Teu + + + Thap + + + + Khmu' + + Kamhmu + + + Phouteng + + + + Koho + + + Kui (Mon-Khmer) + + Khmer, Old (Kui) + + + Kuay + + + Kuy + + + Old Khmer (Kui) + + + Suai + + + Suay + + + + Laven + + Loven + + + + Lawa (Thailand) + + La-oop + + + Lava + + + Lavua + + + Luwa + + + + Mah Meri + + Besisi + + + Cellate + + + + Mon + + Peguan + + + Talaing + + + + Muong + + + Northern Khmer + + Khmer, Northern + + + + Nyah Kur + + Chao Bon + + + Niakuol + + + + Pacoh + + Bo + + + River Van Kieu + + + + Rengao + + + Sedang + + + Semai + + Central Sakai + + + Sakai, Central + + + Senoi + + + + Semang + + Kensiu + + + Ngok Pa + + + + Senoic languages + + Aslian languages, Central + + + Central Aslian languages + + + Sakai languages + + + + Srê + + + Stieng + + + Temiar + + Northern Sakai + + + Sakai, Northern + + + + Wa + + + + info:lc/vocabulary/languages/lol + Mongo-Nkundu + lol + + Lolo (Congo) + + + Lomongo + + + Lonkundu + + + Mongo + + + Nkundu + + + + info:lc/vocabulary/languages/mon + Mongolian + mon + + Mongol + + + Chahar + + Čakhar + + + + Dariganga + + Dar'ganga + + + Dariġangġ-a + + + Darigangga + + + + Khalkha + + + Ordos + + + + info:lc/vocabulary/languages/mos + Mooré + mos + + Mole + + + Moré + + + Moshi + + + Mossi + + + Yana (Burkina Faso and Togo) + + + + info:lc/vocabulary/languages/mul + Multiple languages + mul + + + info:lc/vocabulary/languages/mun + Munda (Other) + mun + + Asuri + + + Bhumij + + + Ho + + + Kharia + + + Korwa + + Korava (Munda) + + + + Kurku + + Bondeya + + + Bopchi + + + Kirku + + + Korakū + + + Korki + + + Korku + + + Kuri (India) + + + + Mundari + + Kohl + + + + Nihali + + Nahali + + + + Sora + + Sabara + + + Saora + + + Savara + + + Sawara + + + + + info:lc/vocabulary/languages/nah + Nahuatl + nah + + Aztec + + + Mexican + + + Pipil + + Nahuat + + + + + info:lc/vocabulary/languages/nau + Nauru + nau + + + info:lc/vocabulary/languages/nav + Navajo + nav + + + info:lc/vocabulary/languages/nbl + Ndebele (South Africa) + nbl + + Ndzundza + + + Nrebele (South Africa) + + + Transvaal Ndebele + + + + info:lc/vocabulary/languages/nde + Ndebele (Zimbabwe) + nde + + Nrebele (Zimbabwe) + + + Sindebele + + + Tebele + + + + info:lc/vocabulary/languages/ndo + Ndonga + ndo + + Ambo (Angola and Namibia) + + + Oshindonga + + + Oshiwambo + + + Ovambo (Ndonga) + + + + info:lc/vocabulary/languages/nap + Neapolitan Italian + nap + + + info:lc/vocabulary/languages/nep + Nepali + nep + + Gorkhali + + + Gurkhali + + + Khas + + + Naipali + + + Nepalese + + + Parbate + + + Parbatiya + + + Purbutti + + + Baitadi + + + Kumali + + + Parvati + + Parbati + + + + + info:lc/vocabulary/languages/new + Newari + new + + + info:lc/vocabulary/languages/nwc + Newari, Old + nwc + + Old Newari + + + + info:lc/vocabulary/languages/nia + Nias + nia + + + info:lc/vocabulary/languages/nic + Niger-Kordofanian (Other) + nic + + Niger-Congo (Other) + + + Abidji + + Adidji + + + Ari (Côte d'Ivoire) + + + + Abua + + + Ahanta + + + Aja (Benin and Togo) + + Adja + + + + Alladian + + Aladian + + + Aladyã + + + Aladyan + + + Alagia + + + Alagian + + + Alagya + + + Alajan + + + Alladyan + + + Allagia + + + Allagian language + + + + Anufo + + Chakosi + + + + Anyang + + Denya + + + Nyang (Cameroon) + + + + Anyi + + Agni + + + + Attie + + Akye + + + Kurobu + + + + Avikam + + + Awutu + + + Babungo + + Ngo + + + + Bafut + + + Baka (Cameroon and Gabon) + + + Balanta-Ganja + + Alante (Senegal) + + + Balanda (Senegal) + + + Balant (Senegal) + + + Balante (Senegal) + + + Balãt + + + Ballante (Senegal) + + + Belante (Senegal) + + + Brassa (Senegal) + + + Bulanda (Senegal) + + + Fca + + + Fjaa + + + Fraase + + + + Balanta-Kentohe + + Alante (Balanta-Kentohe) + + + Balanda (Balanta-Kentohe) + + + Balant (Balanta-Kentohe) + + + Balanta + + + Balante (Balanta-Kentohe) + + + Ballante (Balanta-Kentohe) + + + Belante (Balanta-Kentohe) + + + Brassa (Balanta-Kentohe) + + + Bulanda (Balanta-Kentohe) + + + Frase + + + + Bamun + + + Bandial + + Banjaal + + + Eegima + + + Eegimaa + + + + Bariba + + Bargu + + + Berba (Benin and Nigeria) + + + + Bassari + + Ayan + + + Biyan + + + Wo + + + + Baule + + Baoulé + + + + Bedik + + Budik + + + Tenda + + + + Bekwarra + + + Bena (Nigeria) + + Binna + + + Buna (Bena) + + + Ebina (Bena) + + + Ebuna (Bena) + + + Gbinna + + + Yangeru + + + Yongor + + + Yungur (Bena) + + + + Benue-Congo languages + + + Biali + + Berba (Benin and Burkina Faso) + + + Bieri + + + + Bijago + + Bidyogo + + + + Birifor + + + Birom + + Berom + + + Bouroum + + + Burum (Nigeria) + + + Kibo + + + Kibyen + + + Shosho + + + + Blowo + + Blo + + + Dan-blo + + + Western Dan + + + + Bobo Fing + + Black Bobo + + + Bulse + + + Finng + + + + Boomu + + Bomu + + + + Bozo + + Sorko + + + Sorogo + + + + Brissa + + Anufo (Côte d'Ivoire) + + + + Bua languages + + Boua languages + + + + Buli + + Builsa + + + Bulea + + + Bulugu + + + Guresha + + + Kanjaga + + + + Busa + + Boko + + + + Bwamu + + Bobo Wule + + + Bouamou + + + + Cross River Mbembe + + Ekokoma + + + Ifunubwa + + + Oderiga + + + Ofunobwam + + + Okam + + + Wakande + + + + Dagaare + + + Dagbani + + Dagomba + + + + Dan (Côte d'Ivoire) + + Gio + + + Yacouba + + + + Degema + + Atala + + + Udekama + + + + Diola + + Dyola + + + Yola + + + + Djimini + + Dyimini + + + Gimini + + + Jimini + + + Jinmini + + + + Dogon + + Habe + + + Tombo + + + + Ebira + + Egbira + + + Igbira + + + + Eggon + + + Ejagham + + Central Ekoi + + + Ekwe + + + Ezam + + + + Ekpeye + + + Engenni + + Egene + + + Ngene + + + + Esuulaalu + + + Etsako + + Afenmai + + + Iyekhee + + + Kukuruku + + + Yekhee + + + + Fali (Cameroon) + + Falli + + + + Falor + + Palor + + + + Farefare + + Frafra + + + Gurenne + + + Gurne + + + Gurune + + + Nankani + + + Nankanse + + + Ninkare + + + + Gbagyi + + + Gbandi + + Bandi + + + + Gen-Gbe + + Gẽ + + + Mina (Benin and Togo) + + + + Gikyode + + Chode + + + Kyode + + + + Gonja + + Guang + + + + Gua + + Gwa (Ghana) + + + + Gun-Gbe + + Alada + + + Egun + + + + Gurma + + Gourmantché + + + Gulmance + + + + Guyuk + + + Gweetaawu + + Dan-gouéta + + + Eastern Dan + + + Gouéta + + + Gwétaawo + + + + Hanga (Ghana) + + Anga (Ghana) + + + + Hõne + + Jukun of Gwana + + + + Idoma + + Oturkpo + + + + Igede + + + Igo + + Ahlon + + + Anlo + + + + Ikwere + + Oratta-Ikwerri + + + + Indenie + + Ndenie + + + Ndenye + + + Ndinian + + + Ndyenye + + + + Itsekiri + + Isekiri + + + + Izere + + Jarawa (Nigeria) + + + + Izi + + + Jju + + Ju (Benue-Congo) + + + Kaje + + + + Jowulu + + Jo + + + Samogho (Jowulu) + + + Samoighokan + + + + Jukun + + Kurorofa + + + + Kaansa + + Gã (Burkina Faso) + + + Gan (Burkina Faso) + + + Gane (Burkina Faso) + + + Kaan (Burkina Faso) + + + Kaanse + + + Kãasa (Burkina Faso) + + + Kan (Burkina Faso) + + + + Kabiye + + Kabre + + + Kabye + + + + Kagoro (Mali) + + + Kagoro (Nigeria) + + Gworok + + + + Karang (Cameroon) + + + Kasem + + Kasena + + + Kasim + + + Kassem + + + Kassene + + + + Kassonke + + Khassonke + + + + Kissi + + Kisi (West Africa) + + + + Konkomba + + + Konni + + Koma (Ghana) + + + + Kposo + + Akposo + + + Ikposo + + + + Krahn + + Kran + + + Northern Krahn + + + Western Krahn + + + + Krongo + + Kadumodi + + + Kurungu + + + + Kulango + + Koulango + + + Kpelego + + + Nabe + + + Ngwala + + + Nkurange + + + Zazere + + + + Kuo (Cameroon and Chad) + + Ko (Cameroon and Chad) + + + Koh + + + + Kuranko + + Koranko + + + + Kurumba + + Deforo + + + Foulse + + + Fulse + + + Koromfe + + + Kouroumba + + + Kurumfe + + + Lilse + + + + Kusaal + + Kusasi + + + + Kwanja + + + Kweni + + Gouro + + + + Lefana + + Bouem + + + Buem + + + Bwem + + + + Ligbi + + + Limba + + + Limbum + + Llimbumi + + + Ndzungle + + + Njungene + + + Nsugni + + + Wimbum + + + Zungle + + + + Lobi + + + Loko + + Landogo + + + + Loma + + Baru + + + Buzi + + + Lorma + + + + Longuda + + Nunguda + + + + Lorhon + + Loghon + + + + Lyele + + Lele (Burkina Faso) + + + + Mamara + + Bamana (Senufo) + + + Mianka + + + Minianka + + + Minyanka + + + + Mambila + + Lagubi + + + Nor + + + Tagbo + + + Torbi + + + + Mampruli + + + Mandjak + + + Mankanya + + Bola (Portuguese Guinea) + + + Brame + + + Bulama + + + + Mankon + + + Mano + + + Mayogo + + + Mbili + + + Mbum + + Mbam + + + + Mi Gangam + + Dye + + + Gangam + + + Ngangan + + + + Migili + + Koro Lafia + + + + Mo (Côte d'Ivoire and Ghana) + + Buru (Côte d'Ivoire and Ghana) + + + Deg + + + Mmfo + + + + Moba + + + Muana + + + Mumuye + + + Mundang + + Moundang + + + + Mungaka + + Bali (Cameroon) + + + Ngaaka + + + + Nafaanra + + + Nawuri + + + Nchumburu + + + Ndogo-Sere languages + + + Ngbaka + + + Ngbaka ma'bo + + Bwaka + + + Ngbaka limba + + + + Nirere + + + Ninzo + + Akiza + + + Amar Tita + + + Ancha + + + Fadan Wate + + + Gbhu D Amar Randfa + + + Hate (Ninzo) + + + Incha + + + Kwasu + + + Ninzam + + + Nunzo + + + Sambe + + + + Nkonya + + + Nomaante + + + Noon + + + Noone + + Noni + + + + Northern Bullom + + Bullom, Northern + + + + Nunuma + + Nibulu + + + Nouni + + + + Nupe + + Nope + + + + Ogbronuagum + + + Oku + + Bvukoo + + + Ebkuo + + + Ekpwo + + + Kuo (Oku) + + + Ukfwo + + + Uku (Oku) + + + + Oron + + + Pinyin + + + Safaliba + + Safalaba + + + Safalba + + + Safali + + + + Samo (West Africa) + + Goe + + + Matya + + + Maya (Burkina Faso) + + + Samogo-Sane + + + San (Eastern Mande) + + + Sane + + + + Sanwi + + + Sembla + + Sambla + + + Samogho-Senku + + + Samogo-Senku + + + Seeku + + + Sembila + + + Senku + + + Southern Samo (Western Mande) + + + + Senari + + Senufo + + + + Senya + + + Sherbro + + Bullom, Southern + + + Southern Bullom + + + + Sissala + + + Somba + + Betammadibe + + + Ditammari + + + Tamaba + + + + Tagbana + + + Tampulma + + Tamprusi + + + + Téén + + + Tem + + Cotocoli + + + Kotokoli + + + Tim + + + + Tigon Mbembe + + Akonto + + + Akwanto + + + Noale + + + Tigim + + + Tigon + + + Tigong + + + Tigum + + + Tigun + + + Tikun + + + Tukun + + + + Tikar + + + Tobote + + Basari (Togo and Ghana) + + + + Tofingbe + + + Toma (Burkina Faso) + + Makaa (Burkina Faso) + + + Nyaana + + + + Tura + + Toura + + + + Tusia + + Toussia + + + + Tuwunro + + + Tyembara + + + Ukaan + + Aika + + + Anyaran + + + Auga + + + Ikan + + + Kakumo + + + + Urhobo + + + Vagala + + Kira + + + Konosarola + + + Siti + + + + Vige + + + Winyé + + Kõ (Burkina Faso) + + + Kols + + + Kolsi + + + + Yakö + + Kö (Yakö) + + + Lukö + + + + Yom + + Kpilakpila + + + Pila + + + Pilapila + + + + + info:lc/vocabulary/languages/ssa + Nilo-Saharan (Other) + ssa + + Sub-Saharan African (Other) + + + Adhola + + Dhopadhola + + + Ludama + + + + Alur + + Aloro + + + Alua + + + Alulu + + + Aluru + + + Dho Alur + + + Jo Alur + + + Lur (Alur) + + + Luri (Alur) + + + + Anuak + + Yambo + + + + Aringa + + Low Lugbara + + + + Bagirmi + + Barma + + + + Baka + + Tara Baaka + + + + Bari + + Dzilio + + + + Birri (Central African Republic) + + Abiri + + + Ambili + + + Biri (Central African Republic) + + + Bviri + + + Viri language + + + + Bongo + + + Bongo-Bagirmi languages + + + Bor (Lwo) + + Belanda + + + + Dazaga + + Dasa + + + Dasaga + + + Daza (Nilo-Saharan) + + + Dazagada + + + Dazza + + + Dazzaga + + + Tebu (Dazaga) + + + Tibbu (Dazaga) + + + Toubou (Dazaga) + + + Tubu (Dazaga) + + + + Fur + + + Gambai + + Kabba Laka + + + Ngambai + + + Sara Gambai + + + + Ingassana + + Gaam + + + Ingessana + + + Kamanidi + + + Mamidza + + + Memedja + + + Metabi + + + Muntabi + + + Tabi (Ingassana) + + + + Jur Modo + + Jur (Jur Modo) + + + Modo + + + + Kaba (Central Sudanic) + + + Kalenjin + + + Kara (Central African Republic and Sudan) + + Fer + + + Gula (Central African Republic and Sudan) + + + Yama + + + Yamegi + + + + Karamojong + + Akarimojong + + + + Kenga + + + Kipsikis + + + Kreish + + + Kùláál + + Gula (Lake Iro, Chad) + + + + Kunama + + Cunama + + + + Lango (Uganda) + + + Lendu + + + Lese + + + Logo + + Logo Kuli + + + Logoti + + + + Lotuko + + Latuka + + + + Lugbara + + Logbara + + + Logbware + + + Luguaret + + + Lugware + + + + Lwo (Sudan) + + Dhe Lwo + + + Dyur + + + Giur + + + Jo Lwo + + + Jur (Lwo (Sudan)) + + + Luo (Sudan) + + + + Maban + + Meban + + + + Maʾdi (Uganda and Sudan) + + Madi-ti (Uganda and Sudan) + + + + Majingai + + Midjinngay + + + Moggingain + + + Sara-Majingai + + + + Mamvu + + Momvu + + + Monvu + + + Tengo + + + + Mangbetu + + Monbuttu + + + + Mbai (Moissala) + + Moissala Mbai + + + Sara Mbai (Moissala) + + + + Moru + + + Murle + + Beir + + + + Nandi + + + Nara + + Barea + + + Baria + + + Barya + + + Higir + + + Kolkotta + + + Koyta + + + Mogoreb + + + Morda + + + Nera + + + Nere + + + Santora + + + + Ngama + + Sara Ngama + + + + Ngiti + + Druna + + + Lendu, Southern + + + Ndruna + + + Southern Lendu + + + + Nuer + + Abigar + + + Nath + + + + Päri (Sudan) + + + Proto-Eastern Sudanic + + + Sabaot + + + Samburu + + Burkeneji + + + Lokop + + + Nkutuk + + + Sambur + + + Sampur + + + + Sara + + Majingai-Ngama + + + + Suk + + Pokot + + + + Tedaga + + Tebou + + + Tebu (Tedaga) + + + Teda + + + Tedagada + + + Tibbu (Tedaga) + + + Tibu + + + Toda (Africa) + + + Todaga + + + Todga + + + Toubou (Tedaga) + + + Tubu + + + Tuda (Africa) + + + Tuduga + + + + Teso + + Ateso + + + Iteso + + + + Toposa + + Abo (Sudan) + + + Akeroa + + + Dabossa + + + Huma (Sudan) + + + Kare (Sudan) + + + Khumi (Sudan) + + + Taposa + + + + Turkana + + + Uduk + + + Yulu + + + Zaghawa + + Beri-aa + + + Berri + + + Kebadi + + + Merida + + + Soghaua + + + Zeghawa + + + + + info:lc/vocabulary/languages/niu + Niuean + niu + + + info:lc/vocabulary/languages/nqo + N'Ko + nqo + + + info:lc/vocabulary/languages/nog + Nogai + nog + + + info:lc/vocabulary/languages/zxx + No linguistic content + zxx + + + info:lc/vocabulary/languages/nai + North American Indian (Other) + nai + + Use for the other languages of North America north of Mexico excluding the + languages of the Azteco-Tanoan language phylum. + + + + Alabama + + + Arikara + + + Atsugewi + + + Beothuk + + + Chickasaw + + + Chimariko + + + Chitimacha + + Chetimacha + + + Shetimasha + + + + Chumash + + + Coahuilteco + + Tejano + + + + Cocopa + + + Coos + + Kaus + + + Kwokwoos + + + + Eastern Pomo + + Pomo, Eastern + + + + Eyak + + Ugalachmut + + + + Hualapai + + Jaguallapai + + + Mataveke-paya + + + Walapai + + + + Karok + + + Keres + + + Kiliwa + + Yukaliwa + + + + Konomihu + + + Kuitsh + + Lower Umpqua + + + Umpqua, Lower + + + + Kumiai + + Campo + + + Cochimi (Diegueño) + + + Comeya + + + Cuchimí + + + Diegueño + + + Digueño + + + Iipay + + + Kamia + + + Kamiai + + + Kamiyahi + + + Kamiyai + + + Ki-Miai + + + Ko'al + + + Ku'ahl + + + Kumeyaai + + + Kumeyaay + + + Kumia + + + Kw'aal + + + Quemayá + + + Tiipay + + + Tipai + + + + Maidu + + Pujunan + + + + Mikasuki + + Mekusuky + + + + Miwok languages + + Mewan + + + Moquelumnan + + + + Mutsun + + + Nez Percé + + Numipu + + + Sahaptin + + + + Northern Sierra Miwok + + Miwok, Northern Sierra + + + + Ohlone + + Costanoan + + + + Paipai + + + Pawnee + + + Southeastern Pomo + + Pomo, Southeastern + + + + Timucua + + + Tlakluit + + Echeloot + + + Wishram + + + + Tonkawa + + + Tunica + + Tonican + + + Yoron + + + Yuron + + + + Wappo + + + Wichita + + + Wikchamni + + Wükchamni + + + + Wintu + + + Wiyot + + + Yahi + + + Yakama + + Yakima + + + + Yuchi + + Uchee + + + + Yuki + + + + info:lc/vocabulary/languages/frr + North Frisian + frr + + Frisian, North + + + + info:lc/vocabulary/languages/sme + Northern Sami + sme + + Sami, Northern + + + + info:lc/vocabulary/languages/nso + Northern Sotho + nso + + Pedi + + + Sepedi + + + Sotho, Northern + + + Transvaal Sotho + + + Pai (South Africa) + + Eastern Sotho + + + + + info:lc/vocabulary/languages/nor + Norwegian + nor + + Bokmål + + + Dano-Norwegian + + + Riksmål + + + Trøndersk + + Trønder + + + Trøndesk + + + Trøndsk + + + + + info:lc/vocabulary/languages/nob + Norwegian (Bokmål) + nob + + Bokmål + + + Dano-Norwegian + + + Riksmål + + + + info:lc/vocabulary/languages/nno + Norwegian (Nynorsk) + nno + + Landsmaal + + + Landsmål + + + Nynorsk + + + + info:lc/vocabulary/languages/nub + Nubian languages + nub + + Dilling + + Delen + + + Warkimbe + + + + Dongola-Kenuz + + Kenuz + + + + Mahas-Fiyadikka + + Fadicca + + + Fiadidja + + + Fiyadikka + + + Nobiin + + + + Midob + + + Old Nubian (to 1300) + + Nubian, Old + + + + + info:lc/vocabulary/languages/nym + Nyamwezi + nym + + + info:lc/vocabulary/languages/nya + Nyanja + nya + + Chinyanja + + + Nyassa + + + Chewa + + Cewa + + + + + info:lc/vocabulary/languages/nyn + Nyankole + nyn + + Lunyankole + + + Nkole + + + Runyankore + + + + info:lc/vocabulary/languages/nyo + Nyoro + nyo + + Lunyoro + + + Urunyoro + + + + info:lc/vocabulary/languages/nzi + Nzima + nzi + + Nsima + + + Nzema + + + Zema + + + + info:lc/vocabulary/languages/oci + Occitan (post-1500) + oci + + Langue d'oc (post-1500) + + + Provençal, Modern (post-1500) + + + Béarnais (post-1500) + + + Gascon (post-1500) + + + + info:lc/vocabulary/languages/lan + Occitan (post 1500) + lan + + + info:lc/vocabulary/languages/xal + Oirat + xal + + Kalmyk + + Calmuck + + + + Oyrat + + + + info:lc/vocabulary/languages/oji + Ojibwa + oji + + Anishinabe + + + Chippewa + + + Otchipwe + + + Salteaux + + + Saulteaux + + + Ottawa + + + + info:lc/vocabulary/languages/non + Old Norse + non + + Altnordish + + + Icelandic, Old (to 1550) + + + Norse, Old + + + Norse, Western + + + Norwegian, Old (to 1350) + + + Old Icelandic (to 1550) + + + Old Norwegian (to 1350) + + + Western Norse + + + + info:lc/vocabulary/languages/peo + Old Persian (ca. 600-400 B.C.) + peo + + Persian, Old (ca. 600-400 B.C.) + + + + info:lc/vocabulary/languages/ori + Oriya + ori + + Uriya + + + Adiwasi Oriya + + Adibasi Oriyā + + + Ādivāsi Oriyā + + + Desai + + + Kotia + + + Kotia Oriya + + + Kotiya + + + Tribal Oriya + + + + Bhatri + + Basturia + + + Bhatra + + + Bhattra + + + Bhattri + + + Bhottada + + + Bhottara + + + + Sambalpuri + + + + info:lc/vocabulary/languages/orm + Oromo + orm + + Afan + + + Galla + + + Gallinya + + + Boran + + + Orma + + Uardai + + + Warday + + + + + info:lc/vocabulary/languages/gal + Oromo + gal + + + info:lc/vocabulary/languages/osa + Osage + osa + + + info:lc/vocabulary/languages/oss + Ossetic + oss + + Āsī + + + Oseti + + + Osi + + + Ūsatī + + + + info:lc/vocabulary/languages/oto + Otomian languages + oto + + Chichimeca-Jonaz + + + Matlatzinca + + Pirinda + + + + Mazahua + + + Ocuiltec + + Atzinca + + + Maclatzinca + + + Tlahuica + + + + Otomi + + Hñahñu + + + Othomi + + + + Pame + + Chichimeca Pame + + + + + info:lc/vocabulary/languages/pal + Pahlavi + pal + + Huzvaresh + + + Middle Persian (Pahlavi) + + + Parsi + + + Pazend + + + Pehlevi + + + Persian, Middle (Pahlavi) + + + + info:lc/vocabulary/languages/pau + Palauan + pau + + Pelew + + + + info:lc/vocabulary/languages/pli + Pali + pli + + + info:lc/vocabulary/languages/pam + Pampanga + pam + + Kapampangan + + + + info:lc/vocabulary/languages/pag + Pangasinan + pag + + + info:lc/vocabulary/languages/pan + Panjabi + pan + + Eastern Panjabi + + + Punjabi + + + + info:lc/vocabulary/languages/pap + Papiamento + pap + + + info:lc/vocabulary/languages/paa + Papuan (Other) + paa + + Abau + + Green River + + + + Abulas + + Ambulas + + + Maprik + + + + Agarabe + + + Alamblak + + + Ama (Papua New Guinea) + + Sawiyanu + + + + Amele + + + Ampale + + Ampeeli + + + Safeyoka + + + + Aneme Wake + + Abia + + + Musa, Upper + + + Upper Musa + + + + Anggor + + Bibriari + + + Senagi + + + Watapor + + + + Ankave + + Angave + + + + Aomie + + Omie + + + + Asaro + + Dano + + + Upper Asaro + + + + Asmat + + + Au + + + Auyana + + + Awa (Eastern Highlands Province, Papua New Guinea) + + + Bahinemo + + Gahom + + + Wogu + + + + Baining + + Kakat + + + Makakat + + + Maqaqet + + + Qaqet + + + + Barai + + + Baruya + + + Bauzi + + Baudi + + + Bauri + + + Pauwi + + + + Benabena + + Bena (Papua New Guinea) + + + Bena-bena + + + + Berik + + + Biangai + + Baingai + + + + Bimin + + + Binumarien + + + Bisorio + + Gadio + + + Iniai + + + + Blagar + + Belagar + + + Tarang + + + + Bom + + Anjam + + + Bogadjim + + + Lalok + + + + Buin + + Rugara + + + Telei + + + + Bunak + + Buna' (Indonesia) + + + Bunake + + + Bunaq + + + + Burum (Papua New Guinea) + + Bulum + + + + Chuave + + Tjuave + + + + Daga + + Dimuga + + + Nawp + + + + Daribi + + Elu + + + Karimui + + + Makarub + + + Mikaru + + + + Dedua + + + Duna + + Yuna + + + + Eipo + + + Enga + + Tsaga + + + + Ese + + Managalasi + + + Managulasi + + + + Faiwol + + Fegolmin + + + + Fasu + + + Folopa + + + Fore + + + Gadsup + + + Gahuku + + + Galela + + + Gimi + + + Gogodala + + + Golin + + + Gope + + Era River + + + Kope + + + + Gresi + + Glesi + + + Gresik + + + Klesi + + + + Guhu-Samane + + Mid-Waria + + + + Gwahatike + + + Gwedena + + Umanakaina + + + + Halopa + + Botelkude + + + Nobonob + + + Nupanob + + + + Huli + + + Iatmul + + Big Sepik + + + + Inanwatan + + Suabo + + + + Inoke + + Yate (Papua New Guinea) + + + + Irumu + + + Iwam + + + Iyo (Papua New Guinea) + + Bure (Papua New Guinea) + + + Nabu + + + Naho + + + Nahu + + + Ndo (Papua New Guinea) + + + + Kalabra + + + Kalam + + Karam + + + + Kaluli + + + Kamano + + Kafe + + + + Kamasau + + + Kamtuk + + Kemtuik + + + + Kanite + + Kemiju Jate + + + + Kapauku + + Ekagi + + + + Kasua + + + Kâte + + + Kelon + + Kalong + + + Kelong + + + Klon + + + Kolon + + + + Ketengban + + Oktengban + + + + Kewa + + + Kobon + + + Komba + + + Komunku + + + Kongara + + + Korape + + Kwarafe + + + Okeina + + + + Kosena + + + Kovai + + Alngubin + + + Kobai + + + Kowai + + + Umboi + + + + Kunimaipa + + + Kwerba + + + Lambau + + + Lunambe + + + Mai Brat + + Mey Brat + + + + Manambu + + + Mape + + + Meax + + + Medlpa + + Hagen + + + Moglei + + + + Menya + + Menyama + + + Menye + + + + Mianmin + + + Migabac + + Migaba' + + + + Monumbo + + + Mountain Arapesh + + Arapesh, Mountain + + + Bukiyup + + + + Mountain Koiari + + Koiali, Mountain + + + + Mpur (Indonesia) + + Amberbaken + + + + Mugil + + Bargam + + + Saker + + + + Nabak + + Wain + + + + Nankina + + + Narak + + Gandja + + + Kandawo + + + Kol (Papua New Guinea) + + + + Nasioi + + + Nek + + + Nii + + Ek Nii + + + + Notu + + Ewage + + + + Oksapmin + + + Olo + + Orlei + + + + Ono + + + Orokaiva + + + Orokolo + + + Orya + + Oria + + + Uria + + + + Pay + + + Pinai-Hagahai + + + Purari + + Eurika + + + Evora + + + Iai (Papua New Guinea) + + + Iare + + + Kaimare + + + Kaura (Papua New Guinea) + + + Kipaia + + + Koriki + + + Maipua + + + Namau + + + + Rawa + + Karo-Rawa + + + + Rotokas + + + Saberi + + Isirawa + + + Okwasar + + + + Sahu + + + Samo (Western Province, Papua New Guinea) + + Supei + + + + Sawos + + Tshwosh + + + + Selepet + + + Sentani + + + Siane + + + Siroi + + Pasa + + + Suroi + + + + Siwai + + Motuna + + + + Sona (Papua New Guinea) + + Kanasi + + + + Suena + + Yarawe + + + Yema + + + + Sulka + + + Tabla + + Tanahmerah (Northeast Irian Jaya) + + + + Tairora + + + Tani + + Miami (Papua New Guinea) + + + Miani + + + Suaru + + + + Tauya + + Inafosa + + + + Telefol + + + Tepera + + + Ternate + + + Tewa (Papuan) + + Teiwa + + + + Tifal + + + Timbe + + + Toaripi + + Motumotu + + + + Tobelo + + + Urii + + + Usarufa + + Usurufa + + + Uturupa + + + + Waffa + + + Wantoat + + + Washkuk + + Kwoma + + + + Wasi + + + Were + + + West Makian + + Desite + + + Makian, West + + + Titinec + + + + Wiru + + + Woisika + + + Yabiyufa + + Jafijufa + + + + Yagaria + + Frigano Jate + + + Kami (Papua New Guinea) + + + + Yangoru + + + Yareba + + + Yau + + + Yessan-Mayo + + Mayo (New Guinea) + + + + Yongkom + + + Yopno + + Yupna + + + + Yui + + Salt-Yui + + + + + info:lc/vocabulary/languages/per + Persian + per + + Farsi + + + Dari + + Kabuli + + + Kabuli-Persian + + + Khorasani + + + + + info:lc/vocabulary/languages/phi + Philippine (Other) + phi + + Abaknon + + Capul + + + Inabaknon + + + Kapul + + + Sama Abaknon + + + + Agta + + Cagayan Agta, Central + + + Central Cagayan Agta + + + + Agutaynon + + + Aklanon + + + Alangan + + + Amganad Ifugao + + Ifugao, Amganad + + + + Atta + + Northern Cagayan Negrito + + + + Ayangan Ifugao + + Ifugao, Ayangan + + + + Bagobo + + + Balangao + + + Balangingì + + Baangingi' + + + Bangingi + + + Northern Sinama + + + Sama Bangingì + + + Sea Samal + + + Sinama, Northern + + + + Banton + + Bantuanon + + + + Batad Ifugao + + Ifugao, Batad + + + + Bilaan + + + Bolinao + + Binubolinao + + + + Bontoc + + Finontok + + + + Botolan Sambal + + Aeta Negrito + + + Sambal Botolan + + + Sambali Botolan + + + + Caluyanun + + + Central Bontoc + + Bontoc, Central + + + + Central Subanen + + Sindangan Subanun + + + Subanen, Central + + + Subanun, Sindangan + + + + Cuyunon + + Kuyonon + + + + Dumagat (Casiguran) + + Agta (Casiguran) + + + Casiguran Agta + + + Casiguran Dumagat + + + + Dumagat (Umirey) + + Agta (Umirey) + + + Dingalan Dumagat + + + Umirey Agta + + + Umirey Dumagat + + + + Eastern Bontoc + + Bontoc, Eastern + + + + Eastern Ifugao + + Ifugao, Eastern + + + + Gaddang + + + Ibaloi + + Benguet Igorot + + + Nabaloi + + + + Ibanag + + + Ifugao + + + Ilongot + + + Isinay + + Inmeas + + + + Isneg + + Apayao + + + + Itawis + + + Itbayat + + + Ivatan + + + Jama Mapun + + Cagayanon + + + Mapun + + + Pullon Mapun + + + Sama Mapun + + + + Ivatan + + Batan + + + Ibatan + + + + Kalamian + + Calamian + + + + Kalinga languages + + + Kankanay + + Cancanai + + + Lepanto-Igorot + + + + Kinaray-a + + Antiqueno + + + Binukidnon + + + Hamtiknon + + + Hinaraya + + + Karay-a + + + + Lower Tanudan Kalinga + + Kalinga, Lower Tanudan + + + Tanudan Kalinga, Lower + + + + Magindanao + + Moro + + + + Mamanwa + + + Mangyan + + Iraya + + + + Mansaka + + + Maranao + + Moro + + + + Masbateno + + Minasbate + + + + Mayoyao Ifugao + + Ifugao, Mayoyao + + + + Melebuganon + + Milebuganon + + + Molbog + + + + Northern Kankanay + + Bontoc, Western + + + Kankanay, Northern + + + Sagada-Igorot + + + Western Bontoc + + + + Palawano + + + Pangutaran Sama + + Sama Pangutaran + + + + Sama Sibutu + + Sibutu Sama + + + Southern Sama + + + + Sambali + + Zambal + + + + Southern Bontoc + + Barlig Bontoc + + + Bontoc, Southern + + + Kadaklan Barlig Bontoc + + + + Southern Subanen + + Lapuyan Subanen + + + Margosatubig Subanun + + + Subanen, Southern + + + + Subanun + + Subano + + + + Sulod + + Mundu (Philippines) + + + + Sulu + + Joloano + + + Moro + + + Sooloo + + + + Tagakaolo + + Kalagan, Tagakaolo + + + + Tagbanua + + Aborlan Tagbanwa + + + Apurahuano + + + + Tausug + + + Tboli + + Tagabili + + + Tiboli + + + + Tina Sambal + + + Tiruray + + Teduray + + + + Tuwali + + + Western Subanon + + Siocan Subanon + + + Subanon, Western + + + + Yakan + + + + info:lc/vocabulary/languages/phn + Phoenician + phn + + Punic + + + + info:lc/vocabulary/languages/pon + Pohnpeian + pon + + Ponape + + + Ponapean + + + + info:lc/vocabulary/languages/pol + Polish + pol + + + info:lc/vocabulary/languages/por + Portuguese + por + + + info:lc/vocabulary/languages/pra + Prakrit languages + pra + + Gandhari Prakrit + + Gandhari + + + + Magadhi Prakrit + + + Maharashtri + + + Śaurasēnī + + + + info:lc/vocabulary/languages/pro + Provençal (to 1500) + pro + + Occitan, Old (to 1500) + + + Old Occitan (to 1500) + + + Old Provençal (to 1500) + + + + info:lc/vocabulary/languages/pus + Pushto + pus + + Afghan + + + Pakhto + + + Pakkhto + + + Pashto + + + Pashtu + + + Pukhtu + + + Pukkhto + + + Pukshto + + + Pushtu + + + Wanetsi + + Vanechi + + + Waneci + + + Wanesi + + + Wenetsi + + + + + info:lc/vocabulary/languages/que + Quechua + que + + Inca + + + Kechua + + + Quichua + + + Runasimi + + + Huanca + + Wanka + + + + Ingano + + Inga + + + + + info:lc/vocabulary/languages/roh + Raeto-Romance + roh + + Rhaeto-Romance + + + Romansh + + + Rumansh + + + + info:lc/vocabulary/languages/raj + Rajasthani + raj + + Bagri + + Bagari + + + Bahgri + + + Baorias + + + + Gujuri + + Gojari + + + Gojri + + + Gujar + + + Gujari + + + Gujer + + + Gujjari + + + Gujri (Gujuri) + + + + Harauti + + + Jaipurī + + Dhundhari + + + + Lambadi + + Banjara + + + Labhani + + + Lamani + + + Lambani + + + + Malvi + + Malavi + + + Mallow + + + Malwi + + + Ujjaini (Malvi) + + + + Nimadi + + Nemadi + + + Nimari + + + + Sondwari + + Sondhavāṛī + + + Sondhwadi + + + Sondhwari + + + Soudhwari + + + + Wagdi + + Vāgaḍī + + + Vāgarī + + + Vagdi + + + Vaged + + + Vageri + + + Vagi + + + Vagri + + + Wagadi + + + Waghari + + + Wagholi + + + + + info:lc/vocabulary/languages/rap + Rapanui + rap + + + info:lc/vocabulary/languages/rar + Rarotongan + rar + + Cook Islands Maori + + + Maori, Cook Islands + + + Manihiki Rarotongan + + Rarotongan, Manihiki + + + + + info:lc/vocabulary/languages/roa + Romance (Other) + roa + + Anglo-Norman + + Anglo-French + + + Norman-French + + + + Cajun French + + Acadian (Louisiana) + + + French, Cajun + + + Louisiana Acadian + + + Louisiana French + + + + Franco-Venetian + + Franco-Italian + + + + Italian, Old (to 1300) + + Old Italian + + + + Ladin + + + Portuñol + + Bayano + + + Brasilero + + + Brasilero + + + Brazilero + + + Fronteiriço + + + Fronterizo + + + Portanhol + + + Portunhol + + + + Spanish, Old (to 1500) + + Old Spanish + + + + + info:lc/vocabulary/languages/rom + Romani + rom + + Gipsy + + + Gypsy + + + Romany + + + Rommany + + + Caló (Romani) + + + Kalderash + + Coppersmith + + + Kaldaraš + + + Kalderaš + + + Kelderaš + + + Kelderashícko + + + + Lovari + + + Nuri + + + Spoitori + + Spoitari + + + + + info:lc/vocabulary/languages/rum + Romanian + rum + + Rumanian + + + Boyash + + + Moldovan + + Moldavian + + + Moldovean + + + Moldovian + + + + + info:lc/vocabulary/languages/run + Rundi + run + + Kirundi + + + + info:lc/vocabulary/languages/rus + Russian + rus + + + info:lc/vocabulary/languages/sal + Salishan languages + sal + + Bella Coola + + + Colville + + + Comox + + Komuk + + + + Cowlitz + + + Kalispel + + Pend d'Oreille + + + + Lillooet + + + Ntlakyapamuk + + Netlakapamuk + + + Thompson + + + + Okanagan + + Okinagan + + + + Quinault + + + Salish + + + Sechelt + + Seshelt + + + + Shuswap + + + Squawmish + + Skwamish + + + + Stalo + + Halkomelem + + + + + info:lc/vocabulary/languages/sam + Samaritan Aramaic + sam + + + info:lc/vocabulary/languages/smi + Sami + smi + + Lapp + + + + info:lc/vocabulary/languages/lap + Sami + lap + + + info:lc/vocabulary/languages/smo + Samoan + smo + + + info:lc/vocabulary/languages/sao + Samoan + sao + + + info:lc/vocabulary/languages/sad + Sandawe + sad + + Kissandaui + + + Wassandaui + + + + info:lc/vocabulary/languages/sag + Sango (Ubangi Creole) + sag + + + info:lc/vocabulary/languages/san + Sanskrit + san + + Sanscrit + + + Buddhist Hybrid Sanskrit + + Hybrid Sanskrit, Buddhist + + + + Epigraphical Hybrid Sanskrit + + Hybrid Sanskrit, Epigraphical + + + + Vedic + + Indic, Old + + + Old Indic + + + Vedic Sanskrit + + + + + info:lc/vocabulary/languages/sat + Santali + sat + + Sonthal + + + + info:lc/vocabulary/languages/srd + Sardinian + srd + + + info:lc/vocabulary/languages/sas + Sasak + sas + + + info:lc/vocabulary/languages/sco + Scots + sco + + Lallans + + + Lowland Scots + + + Scots (English) + + + Scottish (Germanic) + + + + info:lc/vocabulary/languages/gla + Scottish Gaelic + gla + + Erse (Scottish Gaelic) + + + Gaelic (Scots) + + + Scots Gaelic + + + + info:lc/vocabulary/languages/gae + Scottish Gaelix + gae + + + info:lc/vocabulary/languages/sel + Selkup + sel + + Ostiak Samoyed + + + + info:lc/vocabulary/languages/sem + Semitic (Other) + sem + + Ammonite + + + Canaanite + + + Eblaite + + Paleocanaanite + + + + Gurage languages + + + Harari + + Adari + + + Ararge + + + + Inor + + Ennemor + + + + Jibbali + + + Mahri + + Mehri + + + + Mandean + + + Sabaean + + + South Arabic + + Arabic, South + + + + Wolane + + Olane + + + Walane + + + Welene + + + Weleni + + + + Zay + + Gelilla + + + Lak'i (Ethiopia) + + + Laqi + + + Zai + + + Zway + + + + + info:lc/vocabulary/languages/srp + Serbian + srp + + + info:lc/vocabulary/languages/scc + Serbian + scc + + + info:lc/vocabulary/languages/srr + Serer + srr + + + info:lc/vocabulary/languages/shn + Shan + shn + + + info:lc/vocabulary/languages/sna + Shona + sna + + China (Africa) + + + Mashona + + + Karanga + + + Zezuru + + Central Shona + + + + + info:lc/vocabulary/languages/sho + Shona + sho + + + info:lc/vocabulary/languages/iii + Sichuan Yi + iii + + Yi, Sichuan + + + + info:lc/vocabulary/languages/scn + Sicilian Italian + scn + + Italian, Sicilian + + + + info:lc/vocabulary/languages/sid + Sidamo + sid + + + info:lc/vocabulary/languages/sgn + Sign languages + sgn + + American Sign Language + + Ameslan + + + + Australasian Signed English + + + Austrian Sign Language + + ÖGS (Sign language) + + + Österreichische Gebärdensprache + + + + British Sign Language + + + Czech Sign Language + + Český znakový jazyk + + + + Danish Sign Language + + DSL (Danish Sign Language) + + + + French Belgian Sign Language + + Belgian French Sign Language + + + Langue des signes Belge Francophone + + + Langue des signes française Belgique + + + LSFB (Sign language) + + + + Icelandic Sign Language + + ISL (Icelandic Sign Language) + + + + Jordanian Sign Language + + JSL (Sign Language) + + + Lughat al-Ishāra al-Urdunia + + + + Mauritian Sign Language + + + Quebec Sign Language + + Langue des signes québécoise + + + + + info:lc/vocabulary/languages/bla + Siksika + bla + + Blackfoot + + + + info:lc/vocabulary/languages/snd + Sindhi + snd + + Kachchhi + + Kacchī + + + Kutchi + + + + + info:lc/vocabulary/languages/sin + Sinhalese + sin + + Cingalese + + + Singhala + + + Singhalese + + + Sinhala + + + + info:lc/vocabulary/languages/snh + Sinhalese + snh + + + info:lc/vocabulary/languages/sit + Sino-Tibetan (Other) + sit + + Abor + + Adi + + + Miri + + + Miśing + + + + Achang + + A-ch‘ang + + + Atsang + + + + Angami + + + Ao + + Chungli + + + Hatigorria + + + Mongsen + + + Zungi + + + Zwingi + + + + Apatani + + Aka + + + Apa Tanang + + + Hruso + + + + Arakanese + + Maghi + + + Rakhaing + + + + Bai (China) + + Min-chia + + + Pai (China) + + + + Balti + + Baltistani + + + Bhotia of Baltistan + + + Sbalti + + + + Bantawa + + Bontawa + + + Kirāta Rāī + + + + Baram + + + Belhariya + + Athpagari + + + Athpahariya + + + Athpare (Belhariya) + + + Athpariya (Belhariya) + + + Belhare + + + Belhāreor + + + + Bodo + + Bara (India and Nepal) + + + Boro (India and Nepal) + + + Kachari, Plains + + + Mech + + + Plains Kachari + + + + Chamling + + Camling + + + + Chang + + Mojung + + + + Chepang + + + Chinbon + + + Chino + + Jino + + + + Chothe Naga + + Chawte + + + Chothe + + + Chowte + + + + Dafla + + Nisi + + + + Dänjong-kä + + Bhotic of Sikkim + + + Dé-jong ké + + + Sikkim Bhotia + + + Sikkimese + + + + Deori + + Chutia + + + Chutiya + + + Dari (India) + + + Deori Chutiya + + + Deuri + + + Dewri + + + Drori + + + + Dhimal + + + Digaro + + Taraon + + + Taying + + + + Dimasa + + Cachari + + + Hill Kachari + + + Kachari + + + + Dungan + + + Gallong + + + Garo + + + Gurung + + + Haka Chin + + Baungshè + + + Chin, Haka + + + Lai + + + + Jero + + + Kabui + + + Kaw + + Akha + + + Ekaw + + + + Khaling + + + Khiamniungan + + + Kok Borok + + Mrung + + + Tipura + + + Tripuri + + + + Konyak + + Kanyak + + + + Kuki + + + Kusunda + + + Ladakhi + + + Lahu + + Muhso + + + + Laizo (Burma) + + + Lepcha + + Rong + + + + Limbu + + + Lisu + + Yawyin + + + + Lopa + + + Magar + + + Miju + + + Mikir + + Karbi + + + + Mishmi + + + Moklum + + + Monpa + + + Mün Chin + + Chinbok + + + + Naga languages + + + Naxi + + Moso + + + + Nocte + + Borduaria + + + Mohongia + + + Paniduaria + + + + Padam + + + Paite + + + Pānkhū + + Paang (Pānkhū) + + + Pāṃkhoẏā + + + Pang Khua + + + Pang (Pānkhū) + + + Pangkhu + + + Pangkhua + + + Pankho + + + Panko + + + Pankua + + + + Rabha + + + Rawang + + + Rongmei + + + Sampang + + Sāmpāṅ Rāī + + + Sampang Rai + + + Sampange Rai + + + Sangpang Gîn + + + Sangpang Gun + + + Sangpang Kha + + + Sangpang + + + + Singpho + + + Sunwar + + + Tamang + + Murmi + + + + Tamu + + + Tangkhul + + Thankhul + + + + Tangsa + + Tengsa + + + + Tangut + + Hsi-hsia + + + Si-hia + + + Xixia + + + + Tenyidie + + + Thādo + + + Thakali + + + Thami + + + Thulung + + + Tiddim Chin + + Chin, Tiddim + + + Kamhau + + + Sokte + + + + Tshangla + + Canglo Monba + + + Cangluo Menba + + + Cangluo Monba + + + Central Monpa + + + Dirang + + + Dungsam + + + Memba + + + Menba (Tshangla) + + + Monba + + + Monpa (Tshangla) + + + Motuo + + + Motuo Menba + + + Sangla + + + Sarchapkkha + + + Schachop + + + Shachobiikha + + + Shachopkha + + + Sharchagpakha + + + Sharchhop-kha + + + Sharchopkha + + + Tashigang + + + Tsangla + + + Tsangla Monba + + + Tsanglo (Tshangla) + + + Tshalingpa (Tshangla) + + + + Vaiphei + + Bhaipei + + + Veiphei + + + + Wambule + + + Wayu + + Hayu + + + Vayu + + + Wayo + + + + Yao (Southeast Asia) + + Mien + + + + Yi + + Lolo (China) + + + Nosu + + + + Zang Zung + + Zhang-Zhung + + + + + info:lc/vocabulary/languages/sio + Siouan (Other) + sio + + Biloxi + + + Chiwere + + + Crow + + + Dhegiha + + Cegiha + + + + Hidatsa + + Grosventres (Hidatsa) + + + + Mandan + + + Ofo + + Ofogoula + + + + Omaha + + + Oto + + Watoto + + + + Tutelo + + + Winnebago + + Hocak + + + + Woccon + + + + info:lc/vocabulary/languages/sms + Skolt Sami + sms + + Lapp, Russian + + + Russian Lapp + + + Sami, Skolt + + + + info:lc/vocabulary/languages/den + Slavey + den + + Dené (Slavey) + + + Dené Tha + + + Ethchaottine + + + Mackenzian + + + North Slavey + + + Slave + + + Slavi + + + South Slavey + + + Kawchottine + + Hare + + + Peaux-de-Lièvre + + + + + info:lc/vocabulary/languages/sla + Slavic (Other) + sla + + Belarusian, Old (to 1700) + + Old Belarusian + + + + Čakavian + + + Carpatho-Rusyn + + Rusyn + + + + Czech, Old (to 1500) + + Old Czech + + + + Polabian + + + Russian, Old (to 1300) + + East Slavic + + + Old East Slavic + + + Old Russian + + + + Ukrainian, Old (ca. 1300-1700) + + Old Ukrainian + + + + + info:lc/vocabulary/languages/slo + Slovak + slo + + + info:lc/vocabulary/languages/slv + Slovenian + slv + + Windic (Slovenian) + + + + info:lc/vocabulary/languages/sog + Sogdian + sog + + + info:lc/vocabulary/languages/som + Somali + som + + + info:lc/vocabulary/languages/son + Songhai + son + + Dendi + + Dandawa + + + + Zarma + + Djerma + + + Dyerma + + + Zerma + + + + + info:lc/vocabulary/languages/snk + Soninke + snk + + Sarakole + + + + info:lc/vocabulary/languages/wen + Sorbian (Other) + wen + + Wendic (Other) + + + + info:lc/vocabulary/languages/sot + Sotho + sot + + Sesuto + + + Southern Sotho + + + Suto + + + + info:lc/vocabulary/languages/sso + Sotho + sso + + + info:lc/vocabulary/languages/sai + South American Indian (Other) + sai + + Achagua + + + Achuar + + Achuale + + + Achuara Jivaro + + + Jivaro, Achuara + + + + Aguaruna + + + Alacaluf + + Kawesqar + + + + Amahuaca + + Sayaco + + + + Amuesha + + Lorenzo + + + + Andoque + + + Apalai + + + Apinagé + + Apinajé + + + Apinayé + + + + Arabela + + Chiripuno + + + + Araona + + + Arecuna + + + Arekena + + Guarequena + + + Uarequena + + + Warekena + + + + Bakairi + + Bacairi + + + + Baniwa + + + Barasana del Norte + + Bara (Colombia) + + + Northern Barasano + + + + Barasana del Sur + + Bara (Colombia) + + + Southern Barasano + + + + Bora + + Boro (South America) + + + + Bororo (Brazil) + + + Cacua + + Macú de cubeo + + + Macú de desano + + + Macú de guanano + + + + Caduveo + + Kadiweu + + + + Caingua + + Cayua + + + Kaingua + + + Kaiwa (Brazil) + + + + Callahuaya + + Callawalla + + + Callawaya + + + Kallawaya + + + Qollahuaya + + + + Campa + + Ande + + + Asheninca + + + + Camsa + + Coche + + + Kamentzá + + + Kamsa + + + Sebondoy + + + Sibondoy + + + + Canamari (Tucanoan) + + Kanamari (Tucanoan) + + + + Cañari + + + Candoshi + + Kandoshi + + + Morato + + + Murato + + + Shapra + + + + Canella + + Kanela + + + + Capanahua + + + Caquinte + + + Caraja + + Karaja + + + + Carapana (Tucanoan) + + Karapana (Tucanoan) + + + Möchda (Tucanoan) + + + + Cashibo + + Comabo + + + + Cashinawa + + Kashinawa + + + Sheminawa + + + + Catio + + Embena, Northern + + + Epera, Northern + + + Katio + + + Northern Epera + + + + Cauqui + + Jacaru + + + Jaqaru + + + + Cavineño + + + Cayapa + + + Cayapo + + Kayapo + + + + Chacobo + + + Chamacoco + + + Chamí + + Embera Chamí + + + + Chamicuro + + + Chana (Uruguay) + + Čaná + + + Layuna + + + Tšaná + + + Tsaná-Bequá + + + Tschaná + + + Yaro + + + + Chayahuita + + Chawi + + + + Chimane + + Nawazi-Moñtji + + + Tsimane + + + + Chipaya + + Puquina (Chipaya) + + + + Chiquito + + + Cholon + + + Chontaquiro + + Chuntaquiro + + + Piro (Arawakan) + + + Simirenchi + + + + Choroti + + Yofuaha + + + + Chulupí + + Ashluslay + + + Nivacle + + + + Cocama + + Kokama + + + Ucayale + + + + Cofán + + A'i + + + Kofán + + + + Colorado + + Tsacela + + + Yumba + + + + Coreguaje + + Caqueta + + + + Cuaiquer + + Coaiker + + + Koaiker + + + + Cubeo + + + Cuiba + + Cuiva + + + + Culina + + + Cumana + + + Cuna + + Kuna + + + + Damana + + Arosario + + + Guamaca + + + Malayo + + + Maracasero + + + Sanja + + + Wiwa + + + + Desana + + Wira + + + + Emerillon + + Mereo + + + Teco (Tupi) + + + + Epena Saija + + Saija + + + Saixa + + + + Ese Ejja + + Chama (Tacanan) + + + Guacanahua + + + Guarayo (Tacanan) + + + Huarayo (Tacanan) + + + Tiatinagua + + + + Fulnio + + Carnijo + + + Iate + + + Yahthe + + + Yate (Brazil) + + + + Gavião (Pará, Brazil) + + + Goajiro + + Guajira + + + Wayunaiki + + + Wayuu + + + + Guahibo + + Wa-jibi + + + + Guanano + + Anano + + + Kotiria + + + Uanana + + + Wanana + + + + Guarayo + + + Guayabero + + Jiw + + + + Guayaki + + Ache + + + Guaiaqui + + + Guayaki-Ache + + + Guoyagui + + + + Hixkaryana + + + Huambisa + + Ssimaku + + + Wambisa + + + + Huao + + Waorani + + + + Ica + + Arhuaco + + + Aruaco + + + Bintukua + + + Ika (Chibchan) + + + Ike + + + + Ipurina + + Apurina + + + Hypurina + + + Jupurina + + + Kangütü + + + Kankiti + + + + Iquito + + + Itonama + + Machoto + + + + Jaminaua + + Nishinahua + + + Yaminahua + + + + Jaruára + + Jarawara + + + + Jupda + + Hupde Maku + + + Macú de tucano + + + + Kagaba + + Cagaba + + + + Kaingang + + Caingang + + + Taven + + + + Kariri + + Cariri + + + Kiriri + + + + Karitiana + + Caritiana + + + + Lengua + + + Lule + + + Maca + + Maka (Paraguay) + + + + Machiguenga + + + Macuna + + Buhágana + + + + Macusi + + Makushi + + + + Mamaindê + + Tamainde + + + + Masacali + + Machacali + + + Mashakali + + + Maxakali + + + + Mascoi + + Emok + + + Machicui + + + Toba-Emok + + + + Mashco + + Amarakaeri + + + Harakmbet + + + + Mataco + + + Maue + + Andira + + + Arapium + + + Maragua + + + Satere + + + + Mayoruna + + Matses + + + + Moguex + + Cuambia + + + Guambiano + + + + Mojo + + Ignaciano + + + Moxo + + + + Moro (South America) + + Ayoré + + + Ayoweo + + + + Moseten + + + Motilon + + Bari (Venezuela) + + + Yupe + + + + Muinane + + + Munduruku + + + Münkü + + + Murui + + Huitoto, Murui + + + + Nambicuara + + Nhambicuara + + + + Nomatsiguenga + + Pangoa + + + + Ocaina + + + Orejón + + Coto (Tucanoan) + + + Mai Huna + + + Payagua + + + + Paez + + + Palicur + + + Pamoa + + Juna + + + Oa + + + Tatutapuyo + + + + Panare + + + Panobo + + + Paraujano + + Añún + + + + Paressi + + Ariti + + + + Patamona + + Paramuni + + + + Pemón + + + Piapoco + + + Piaroa + + + Pilaga + + + Piratapuyo + + + Puinave + + + Puquina + + + Purupuru + + Paumari + + + + Resigero + + + Rikbaktsa + + Aripaktsa + + + Canoeiro + + + + Saliva + + Saliba (Colombia and Venezuela) + + + + Sanapaná + + Lanapsua + + + Quiativis + + + Quilyacmoc + + + Saapa + + + Sanam + + + + Secoya + + + Sharanahua + + Chandinahua + + + Marinahua + + + + Shipibo-Conibo + + Conibo + + + Sipibo + + + + Shuar + + Jibaro, Shuar + + + Jivaro, Shuar + + + Xivaro, Shuar + + + + Sicuane + + Sikuani + + + + Sioni + + Siona + + + + Siriano + + Chiranga + + + + Tacana (Bolivia) + + + Tanimuca-Retuama + + Letuana + + + Retuara + + + Ufaina + + + Yahuna + + + + Tapirapé + + + Tariana + + + Tenetehara + + Asurini + + + Guajajara + + + Tembe + + + + Tenharim + + + Toba (Indian) + + + Trio + + Tiriyo + + + + Tucano + + Dagsexe + + + Dase + + + Tukano + + + + Tucuna + + Ticuna + + + + Tunebo + + Pedrazá + + + Tame + + + + Tuyuca + + Dochkafuara + + + Tejuka + + + + Urarina + + Itucale + + + Shimacu + + + Simacu + + + + Uru + + Puquina (Uru) + + + + Urubu + + + Vilela + + + Waiwai + + Uaiuai + + + + Warao + + Guarauno + + + Warrau + + + + Waunana + + Chanco + + + Chocama + + + Noanama + + + + Wayampi + + Guayapi + + + Oiampi + + + Waiapi + + + Wayapi + + + + Witoto + + Huitoto + + + + Xavante + + Acuan-Shavante + + + Akwẽ-Shavante + + + Chavante Acuan + + + Oti + + + Shavante Akwe + + + + Yagua + + Yegua + + + + Yahgan + + Jagane + + + + Yanomamo + + + Yaruro + + Hapotein + + + Llaruro + + + Pumé + + + Yuapin + + + + Yecuana + + Maquiritare + + + + Yucuna + + Matapi + + + + Yunca + + Chimu + + + Mochica + + + + Yupa + + + Yuruti + + + Zoró + + + + info:lc/vocabulary/languages/sma + Southern Sami + sma + + Sami, Southern + + + + info:lc/vocabulary/languages/spa + Spanish + spa + + Castilian + + + Chicano + + + Cheso + + + + info:lc/vocabulary/languages/srn + Sranan + srn + + Taki-Taki + + + + info:lc/vocabulary/languages/suk + Sukuma + suk + + Gwe (Tanzania) + + + Kesukuma + + + Kisukuma + + + Suku (Tanzania) + + + + info:lc/vocabulary/languages/sux + Sumerian + sux + + + info:lc/vocabulary/languages/sun + Sundanese + sun + + + info:lc/vocabulary/languages/sus + Susu + sus + + Soso + + + + info:lc/vocabulary/languages/swa + Swahili + swa + + Kae + + + Kingwana + + + + info:lc/vocabulary/languages/ssw + Swazi + ssw + + Siswati + + + + info:lc/vocabulary/languages/swz + Swazi + swz + + + info:lc/vocabulary/languages/swe + Swedish + swe + + + info:lc/vocabulary/languages/gsw + Swiss German + gsw + + German, Swiss + + + + info:lc/vocabulary/languages/syc + Syriac + syc + + Classifical Syriac + + + + info:lc/vocabulary/languages/syr + Syriac, Modern + syr + + Neo-Syriac + + + + info:lc/vocabulary/languages/tgl + Tagalog + tgl + + Filipino (Tagalog) + + + Pilipino + + + + info:lc/vocabulary/languages/tag + Tagalog + tag + + + info:lc/vocabulary/languages/tah + Tahitian + tah + + + info:lc/vocabulary/languages/tai + Tai (Other) + tai + + Ahom + + + Be + + Ongbe + + + + Black Tai + + Tai, Black + + + Tai Dam + + + Tai Noir + + + + Bouyei + + Buyi (China and Vietnam) + + + Dioi (China and Vietnam) + + + Giáy + + + Nhang + + + Puyi + + + Yay + + + + Cao Lan + + + Dong (China) + + Gam (China) + + + Kam (China) + + + Tong (China) + + + T‘ung + + + + Khün + + Hkun + + + Tai Khün + + + + + + Lue + + + Pai-i + + + Tai Lü + + + + Lungming + + + Northern Thai + + Kammyang + + + Lanna Thai + + + Lao, Western + + + Myang + + + Phayap + + + Thai, Northern + + + Western Lao + + + Yuan + + + + Southern Thai + + Pak Thai + + + Thai, Southern + + + + Tai Nüa + + Dai Na + + + Dehong Dai + + + Shan, Yunnanese + + + Tay Nüa + + + Te-hung Tai + + + Yunnanese Shan + + + + Tay-Nung + + + Tho + + + White Tai + + Tai, White + + + + Ya + + Tai Chung + + + Tai Ya + + + + + info:lc/vocabulary/languages/tgk + Tajik + tgk + + Tadjik + + + Tadzhik + + + + info:lc/vocabulary/languages/taj + Tajik + taj + + + info:lc/vocabulary/languages/tmh + Tamashek + tmh + + Amazigh + + + Kidal + + + Kidal Tamasheq + + + Tăhăggart + + + Tahaggart Tamahaq + + + Tahoua + + + Tahoua Tamajeq + + + Tajag + + + Tamachek + + + Tamahaq + + + Tamajaq + + + Tamajeq + + + Tamashekin + + + Tamasheq + + + Tamashiqt + + + Tawallammat Tamajaq + + + Tawarek + + + Tayart Tamajeq + + + Temajaq + + + Tewellemet + + + Timbuktu + + + Tomacheck + + + Tomachek + + + Touareg + + + Touarègue + + + Tourage + + + Toureg + + + Tuareg + + + + info:lc/vocabulary/languages/tam + Tamil + tam + + + info:lc/vocabulary/languages/tat + Tatar + tat + + + info:lc/vocabulary/languages/tar + Tatar + tar + + + info:lc/vocabulary/languages/tel + Telugu + tel + + Andhra + + + Gentoo + + + Telegu + + + + info:lc/vocabulary/languages/tem + Temne + tem + + Timne + + + + info:lc/vocabulary/languages/ter + Terena + ter + + + info:lc/vocabulary/languages/tet + Tetum + tet + + Belu + + + + info:lc/vocabulary/languages/tha + Thai + tha + + Siamese + + + + info:lc/vocabulary/languages/tib + Tibetan + tib + + Bhotanta + + + Helambu Sherpa + + Hyolmo + + + Yohlmo + + + + Kagate + + + Khams Tibetan + + Kam + + + Kang (Tibetan) + + + Kham (China) + + + Khamba (Tibetan) + + + Khampa + + + Khams + + + Khams Bhotia + + + Khams-Yal + + + + Sherpa + + Sharpa + + + + + info:lc/vocabulary/languages/tig + Tigré + tig + + + info:lc/vocabulary/languages/tir + Tigrinya + tir + + Tigriña + + + Tña + + + + info:lc/vocabulary/languages/tiv + Tiv + tiv + + + info:lc/vocabulary/languages/tli + Tlingit + tli + + Koluschan + + + Tongass + + + + info:lc/vocabulary/languages/tpi + Tok Pisin + tpi + + Neo-Melanesian + + + Pisin + + + + info:lc/vocabulary/languages/tkl + Tokelauan + tkl + + + info:lc/vocabulary/languages/tog + Tonga (Nyasa) + tog + + + info:lc/vocabulary/languages/ton + Tongan + ton + + Tonga (Tonga Islands) + + + + info:lc/vocabulary/languages/tru + Truk + tru + + + info:lc/vocabulary/languages/tsi + Tsimshian + tsi + + Zimshīan + + + + info:lc/vocabulary/languages/tso + Tsonga + tso + + Changana + + + Gwamba + + + Shangaan + + + Thonga + + + Tonga (Tsonga) + + + Xitsonga + + + + info:lc/vocabulary/languages/tsn + Tswana + tsn + + Bechuana + + + Chuana + + + Coana + + + Cuana + + + Cwana + + + Sechuana + + + Setswana + + + + info:lc/vocabulary/languages/tsw + Tswana + tsw + + + info:lc/vocabulary/languages/tum + Tumbuka + tum + + Tamboka + + + + info:lc/vocabulary/languages/tup + Tupi languages + tup + + Parintintin + + + Tupi + + Ñeengatú + + + + + info:lc/vocabulary/languages/tur + Turkish + tur + + + info:lc/vocabulary/languages/ota + Turkish, Ottoman + ota + + Osmanli + + + Ottoman Turkish + + + + info:lc/vocabulary/languages/tuk + Turkmen + tuk + + Turkoman + + + + info:lc/vocabulary/languages/tvl + Tuvaluan + tvl + + Ellicean + + + + info:lc/vocabulary/languages/tyv + Tuvinian + tyv + + Soyot + + + Tannu-Tuva + + + Tuba + + + Uriankhai + + + + info:lc/vocabulary/languages/twi + Twi + twi + + Akuapem + + + Ashanti + + + Chwee + + + Odschi + + + Tshi + + + + info:lc/vocabulary/languages/udm + Udmurt + udm + + Votiak + + + Votyak + + + + info:lc/vocabulary/languages/uga + Ugaritic + uga + + + info:lc/vocabulary/languages/uig + Uighur + uig + + Eastern Turki + + + Kashgar-Yarkend + + + Turki, Eastern + + + Uigur + + + Uyghur + + + Wighor + + + Yarkend + + + + info:lc/vocabulary/languages/ukr + Ukrainian + ukr + + + info:lc/vocabulary/languages/umb + Umbundu + umb + + Benguela + + + Mbundu (Benguela Province, Angola) + + + Ovimbundu + + + Quimbundo (Benguela Province, Angola) + + + South Mbundu + + + + info:lc/vocabulary/languages/und + Undetermined + und + + + info:lc/vocabulary/languages/hsb + Upper Sorbian + hsb + + High Sorbian + + + Sorbian, Upper + + + + info:lc/vocabulary/languages/urd + Urdu + urd + + Bihari (Urdu) + + + Gujri (Urdu) + + + Gurjari + + + Islami + + + Moorish (India) + + + Undri + + + Urudu + + + Dakhini + + Dakani + + + Dakhani + + + Dakhini Hindi + + + Dakhini Hindustani + + + Dakhini Urdu + + + Dakhni + + + Dakini + + + Dakkani + + + Dakkhani + + + Deccan + + + Dehlavi + + + Gujari (Dakhini) + + + Hindavi + + + + + info:lc/vocabulary/languages/uzb + Uzbek + uzb + + + info:lc/vocabulary/languages/vai + Vai + vai + + Vei + + + + info:lc/vocabulary/languages/ven + Venda + ven + + Tshivenda + + + Wenda + + + + info:lc/vocabulary/languages/vie + Vietnamese + vie + + Annamese + + + + info:lc/vocabulary/languages/vol + Volapük + vol + + + info:lc/vocabulary/languages/vot + Votic + vot + + Vatjan + + + Vote + + + Votian + + + Votish + + + + info:lc/vocabulary/languages/wak + Wakashan languages + wak + + Bella Bella + + + Haisla + + + Heiltsuk + + Haeltzuk + + + + Kwakiutl + + + Nitinat + + + Nootka + + Aht + + + Noutka + + + Nutka + + + Nuuchahnulth + + + + + info:lc/vocabulary/languages/wln + Walloon + wln + + + info:lc/vocabulary/languages/war + Waray + war + + Leytean + + + Samar-Leyte + + + Samaron + + + + info:lc/vocabulary/languages/was + Washoe + was + + Washo + + + Washoan + + + + info:lc/vocabulary/languages/wel + Welsh + wel + + Cymric + + + + info:lc/vocabulary/languages/him + Western Pahari languages + him + + Himachali + + + Pahadi + + + Pahari, Western + + + Bhadrawahi + + Baderwali + + + Badrohi + + + Bahi + + + Bhadarwahi + + + Bhaderbhai Jamu + + + Bhaderwali Pahari + + + Bhadrava + + + Bhadravāhī + + + Bhadri + + + + Bhalesi + + + Bilaspuri + + Bilāsapurī + + + Bilaspuri Pahari + + + Kahalurī + + + Khalūrī + + + Kehloori + + + Kehloori Pahari + + + Kehluri + + + Pacchmi + + + + Chambeali + + Cameali + + + Chamaya + + + Chambiali + + + Chambiyali + + + Chamiyali + + + Chamiyali Pahari + + + Chamya + + + + Gaddi + + Bharmauri + + + Bharmauri Bhadi + + + Bharmouri + + + Brahmauri + + + Gaddhi + + + Gaddyalali + + + Gaddyali + + + Gadhi + + + Gadhiali + + + Gadi + + + Gadiali + + + Gadiyali + + + Pahari Bharmauri + + + Panchi + + + Panchi Brahmauri Rajput + + + + Jaunsari + + Gaunsari + + + Jansauri + + + Jaunsauri + + + Pahari (Jaunsari) + + + + Kullu Pahari + + Kauli + + + Kullui + + + Kulu + + + Kulu Boli + + + Kulu Pahari + + + Kuluhi + + + Kului + + + Kulvi + + + Kulwali + + + Pahari Kullu + + + Pahari (Kullu Pahari) + + + Phari Kulu + + + + Mandeali + + Himachali (Mandeali) + + + Mandi (Mandeali) + + + Mandiali + + + Pahari Mandiyali + + + + Sirmauri + + Himachali (Sirmauri) + + + Pahari (Sirmauri) + + + Sirmouri + + + Sirmuri + + + + + info:lc/vocabulary/languages/wal + Wolayta + wal + + Ometo + + + Uallamo + + + Walamo + + + + info:lc/vocabulary/languages/wol + Wolof + wol + + Jaloof + + + Jolof + + + Ouolof + + + Volof + + + Yolof + + + Lebou + + + + info:lc/vocabulary/languages/xho + Xhosa + xho + + isiXhosa + + + Kafir + + + Xosa + + + + info:lc/vocabulary/languages/sah + Yakut + sah + + Jakut + + + Sakha + + + + info:lc/vocabulary/languages/yao + Yao (Africa) + yao + + Adjaua + + + Ajawa + + + Ayo + + + Chi-yao + + + Ciyao + + + Djao + + + Hiao + + + Wayao + + + + info:lc/vocabulary/languages/yap + Yapese + yap + + + info:lc/vocabulary/languages/yid + Yiddish + yid + + German Hebrew + + + Jewish + + + Judeo-German + + + + info:lc/vocabulary/languages/yor + Yoruba + yor + + Aku + + + Eyo + + + Nago + + + Yariba + + + + info:lc/vocabulary/languages/ypk + Yupik languages + ypk + + Eskimo languages, Western + + + Western Eskimo languages + + + Central Yupik + + Eskimo, West Alaska + + + West Alaska Eskimo + + + + Cup´ig + + + Pacific Gulf Yupik + + Aleut (Eskimo) + + + Eskimo, South Alaska + + + Sugpiak Eskimo + + + Suk (Eskimo) + + + + Sirinek + + + Yuit + + Asiatic Eskimo + + + Eskimo, Asiatic + + + Saint Lawrence Island Yupik + + + Siberian Yupik + + + + + info:lc/vocabulary/languages/znd + Zande languages + znd + + Nzakara + + Sakara + + + + Zande + + Azande + + + + + info:lc/vocabulary/languages/zap + Zapotec + zap + + + info:lc/vocabulary/languages/zza + Zaza + zza + + Dimili + + + Dimli + + + Kirdki + + + Kirmanjki + + + Zazaki + + + + info:lc/vocabulary/languages/zen + Zenaga + zen + + Senhadja + + + + info:lc/vocabulary/languages/zha + Zhuang + zha + + Chuang + + + + info:lc/vocabulary/languages/zul + Zulu + zul + + + info:lc/vocabulary/languages/zun + Zuni + zun + + diff --git a/ilives/book.inc b/ilives/book.inc index 52524a9a..6d057156 100644 --- a/ilives/book.inc +++ b/ilives/book.inc @@ -1,6 +1,6 @@ handleForm($form_values); $this->item->purge_datastream('DARWIN_CORE'); $this->item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', - 'Darwin Core Metadata', 'text/xml', 'X'); + 'Darwin Core Metadata', 'text/xml', 'X'); return TRUE; } @@ -134,10 +134,10 @@ class IslandoraBook { $mimetype = new MimeClass(); $new_item = Fedora_Item::ingest_new_item(!empty($form_values['custom_pid']) ? $form_values['custom_pid'] : $form_values['pid'], 'A', $title, - $user->name); + $user->name); $new_item->add_datastream_from_string($mods_text, 'MODS', - 'MODS Metadata', 'text/xml', 'X'); + 'MODS Metadata', 'text/xml', 'X'); $dc = transform_mods_to_dc($mods_text); if ($dc) { @@ -193,7 +193,7 @@ class IslandoraBook { '#content' => $html ); } - + if (!$hasPage && user_access('ingest new fedora objects')) { $tabset['third_tab'] = array( '#type' => 'tabpage', diff --git a/ilives/fedora_ilives.install b/ilives/fedora_ilives.install index 3c8c6575..04ed6064 100644 --- a/ilives/fedora_ilives.install +++ b/ilives/fedora_ilives.install @@ -1,5 +1,6 @@ IIV app is deployed.', - array('@iiv-home' => 'http://github.com/islandora/iiv')); + array('@iiv-home' => 'http://github.com/islandora/iiv')); } else { $requirements['iiv-war']['value'] = ("Available"); diff --git a/ilives/image_rotator_tagger_block.inc b/ilives/image_rotator_tagger_block.inc index eb29e23f..a86c4291 100755 --- a/ilives/image_rotator_tagger_block.inc +++ b/ilives/image_rotator_tagger_block.inc @@ -1,7 +1,8 @@ $title'; $results = $collection->getRelatedItems('ilives:figures', $itqlquery); //drupal_set_message($results); - + if (empty($results)) { return NULL; } $resultsdoc = new DomDocument(); $resultsdoc->loadXML($results); - + $resultslist = $resultsdoc->getElementsByTagName('result'); - if ( $resultslist->length == 0 ) { + if ($resultslist->length == 0) { return NULL; } //return htmlentities(substr($results, 0, 1000)); - $randresult = $resultslist->item( rand()%$resultslist->length ); + $randresult = $resultslist->item(rand() % $resultslist->length); if (empty($randresult)) { return NULL; } $objs = $randresult->getElementsByTagName('object'); $obj = $objs->item(0); - $pid = substr( $obj->getAttribute('uri'), 12); + $pid = substr($obj->getAttribute('uri'), 12); $titles = $randresult->getElementsByTagName('title'); $title = $titles->item(0); return array('pid' => $pid, - //'title' => $randresult->textContent); - 'title' => $title->nodeValue); - + //'title' => $randresult->textContent); + 'title' => $title->nodeValue); } - function _fedora_image_rotator_tagger_block_content() { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); @@ -64,36 +63,35 @@ function _fedora_image_rotator_tagger_block_content() { } else { $result = get_random_image(); - + $image_item = new Fedora_Item($result['pid']); } - if (!empty ($result)) { + if (!empty($result)) { return '

    ' - . l( '', 'fedora/repository/'. $result['pid'], array('html' => TRUE, 'alias' => TRUE)) - .'

    This image is from '. l($result['title'], 'fedora/ilives_book_viewer/'. substr($image_item->pid, 0, strrpos($image_item->pid, '-')), array('html' => TRUE, 'alias' => TRUE)) . '.' - . drupal_get_form('fedora_repository_image_tagging_form', $result['pid']) . '

    '; - } + . l('', 'fedora/repository/' . $result['pid'], array('html' => TRUE, 'alias' => TRUE)) + . '

    This image is from ' . l($result['title'], 'fedora/ilives_book_viewer/' . substr($image_item->pid, 0, strrpos($image_item->pid, '-')), array('html' => TRUE, 'alias' => TRUE)) . '.' + . drupal_get_form('fedora_repository_image_tagging_form', $result['pid']) . '

    '; + } else { return ''; } } - /* -function fedora_ilives_preprocess_page(&$variables) { + function fedora_ilives_preprocess_page(&$variables) { drupal_add_js(drupal_get_path('module', 'fedora_ilives').'/fedora_ilives_ajax.js', 'theme'); return TRUE; -}*/ + } */ class ShowILivesStreamsInFieldSets { - private $pid =NULL; + private $pid = NULL; function ShowILivesStreamsInFieldSets($pid) { //drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - $this->pid=$pid; + $this->pid = $pid; } - + function showJPG() { module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); global $base_url; @@ -102,6 +100,7 @@ class ShowILivesStreamsInFieldSets { '#value' => '', ); return theme('fieldset', $collection_fieldset) - . drupal_get_form('fedora_repository_image_tagging_form', $this->pid); - } + . drupal_get_form('fedora_repository_image_tagging_form', $this->pid); + } + } diff --git a/ilives/searchTerms.xml b/ilives/searchTerms.xml index b224c959..651c96a1 100644 --- a/ilives/searchTerms.xml +++ b/ilives/searchTerms.xml @@ -1,32 +1,32 @@ - + - dc.title - 1000 - - dc.title - Title - - - mods.sor - Author - - - mods.subject - Subject - + dc.title + 1000 + + dc.title + Title + + + mods.sor + Author + + + mods.subject + Subject + - - tei.fullText - Text - - - tei.persName - People - + + tei.fullText + Text + + + tei.persName + People + - - tei.placeName - Places - - - tei.orgName - Organization Name - + + tei.placeName + Places + + + tei.orgName + Organization Name + - + diff --git a/ilives/tests/fedora_ilives.test b/ilives/tests/fedora_ilives.test index be8c0ffd..7a8d3a2e 100644 --- a/ilives/tests/fedora_ilives.test +++ b/ilives/tests/fedora_ilives.test @@ -1,132 +1,132 @@ 'Fedora Book', - 'description' => t('The Fedora repository book content model.'), - 'group' => t('fedora repository'), - ); - } - - function setUp() { - parent::setUp('fedora_repository', 'fedora_ilives', 'tabs'); - - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - // Create and login user. - $repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams', - 'edit fedora meta data', - 'edit tags datastream', - 'ingest new fedora objects', - 'purge objects and datastreams', - 'view fedora collection', - 'view detailed list of content')); - - - $this->drupalLogin($repository_user); - - } - - public function testBookCModel() { - // First add a book collection - - $pid_list = array(); - // Create a collection for ingesting book content model objects. - - $ingest_form = array(); - $ingest_form['models'] = 'islandora:collectionCModel/ISLANDORACM'; - - $this->drupalPost('fedora/ingestObject/islandora:top/Islandora%20Top-Level%20Collection', $ingest_form, 'Next'); - - $ingest_title = $this->randomName(32); - $ingest_form_step_2['dc:title'] = $ingest_title; - $ingest_form_step_2['dc:description'] = $this->randomName(256); - $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_ilives') . '/xml/book_collection_policy.xml'); - $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); - $this->assertPattern('/Item .* created successfully./', "Verified item created."); - - $pid = $this->getIngestedPid(); - $this->drupalGet("fedora/repository/$pid"); - $pid_list[] = $pid; - - // Now add a book into the new collection - $this->pass("Create book collection $pid below top-level collection.", 'fedora book'); - $ingest_book_form = array(); - $ingest_book_form['models'] = 'ilives:bookCModel/ISLANDORACM'; - $this->drupalPost("fedora/ingestObject/$pid/", $ingest_book_form, 'Next'); - $ingest_book_form_step_2 = array(); - - $ingest_book_form_step_2['mods[mods_record]'] = file_get_contents(drupal_get_path('module', 'fedora_ilives') . '/tests/test_files/mods_record.xml'); - $this->outputScreenContents(); - $this->drupalPost(NULL, $ingest_book_form_step_2, 'Ingest'); - $this->outputScreenContents(); - $book_pid = $this->getIngestedPid(); - $pid_list[] = $book_pid; - if (!empty($book_pid)) { - $this->pass("Successfully ingested book object $book_pid."); - } - $this->cleanUpRepository($pid_list); - - } - - private function cleanUpRepository($pid_list = array()) { - $this->pass("This is the PID list to purge: ". implode(", ", $pid_list) ); - foreach ($pid_list as $pid) { - $this->drupalPost("fedora/repository/purgeObject/$pid", array(), 'Purge'); - $this->drupalPost(NULL, array(), 'Delete'); - } - } - - private function getIngestedPid() { - $subject = $this->drupalGetContent(); - $pattern = '/">(.*)<\/a> created successfully./'; - $matches = array(); - $res = preg_match($pattern, $subject, $matches); - return $matches[1]; - } - - private function outputScreenContents($description = '', $basename = '') { - // This is a hack to get a directory that won't be cleaned up by SimpleTest. - $file_dir = file_directory_path() . '../simpletest_output_pages'; - if (!is_dir($file_dir)) { - mkdir($file_dir, 0777, TRUE); - } - $output_path = "$file_dir/$basename.". $this->randomName(10) . '.html'; - $rv = file_put_contents($output_path, $this->drupalGetContent()); - $this->pass("$description: Contents of result page are ". l('here', $output_path)); - } + public static function getInfo() { + return array( + 'name' => 'Fedora Book', + 'description' => t('The Fedora repository book content model.'), + 'group' => t('fedora repository'), + ); + } + + function setUp() { + parent::setUp('fedora_repository', 'fedora_ilives', 'tabs'); + + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + + // Create and login user. + $repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams', + 'edit fedora meta data', + 'edit tags datastream', + 'ingest new fedora objects', + 'purge objects and datastreams', + 'view fedora collection', + 'view detailed list of content')); + + + $this->drupalLogin($repository_user); + } + + public function testBookCModel() { + // First add a book collection + + $pid_list = array(); + // Create a collection for ingesting book content model objects. + + $ingest_form = array(); + $ingest_form['models'] = 'islandora:collectionCModel/ISLANDORACM'; + + $this->drupalPost('fedora/ingestObject/islandora:top/Islandora%20Top-Level%20Collection', $ingest_form, 'Next'); + + $ingest_title = $this->randomName(32); + $ingest_form_step_2['dc:title'] = $ingest_title; + $ingest_form_step_2['dc:description'] = $this->randomName(256); + $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_ilives') . '/xml/book_collection_policy.xml'); + $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); + $this->assertPattern('/Item .* created successfully./', "Verified item created."); + + $pid = $this->getIngestedPid(); + $this->drupalGet("fedora/repository/$pid"); + $pid_list[] = $pid; + + // Now add a book into the new collection + $this->pass("Create book collection $pid below top-level collection.", 'fedora book'); + $ingest_book_form = array(); + $ingest_book_form['models'] = 'ilives:bookCModel/ISLANDORACM'; + $this->drupalPost("fedora/ingestObject/$pid/", $ingest_book_form, 'Next'); + $ingest_book_form_step_2 = array(); + + $ingest_book_form_step_2['mods[mods_record]'] = file_get_contents(drupal_get_path('module', 'fedora_ilives') . '/tests/test_files/mods_record.xml'); + $this->outputScreenContents(); + $this->drupalPost(NULL, $ingest_book_form_step_2, 'Ingest'); + $this->outputScreenContents(); + $book_pid = $this->getIngestedPid(); + $pid_list[] = $book_pid; + if (!empty($book_pid)) { + $this->pass("Successfully ingested book object $book_pid."); + } + $this->cleanUpRepository($pid_list); + } + + private function cleanUpRepository($pid_list = array()) { + $this->pass("This is the PID list to purge: " . implode(", ", $pid_list)); + foreach ($pid_list as $pid) { + $this->drupalPost("fedora/repository/purgeObject/$pid", array(), 'Purge'); + $this->drupalPost(NULL, array(), 'Delete'); + } + } + + private function getIngestedPid() { + $subject = $this->drupalGetContent(); + $pattern = '/">(.*)<\/a> created successfully./'; + $matches = array(); + $res = preg_match($pattern, $subject, $matches); + return $matches[1]; + } + + private function outputScreenContents($description = '', $basename = '') { + // This is a hack to get a directory that won't be cleaned up by SimpleTest. + $file_dir = file_directory_path() . '../simpletest_output_pages'; + if (!is_dir($file_dir)) { + mkdir($file_dir, 0777, TRUE); + } + $output_path = "$file_dir/$basename." . $this->randomName(10) . '.html'; + $rv = file_put_contents($output_path, $this->drupalGetContent()); + $this->pass("$description: Contents of result page are " . l('here', $output_path)); + } protected function drupalCreateFedoraUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) { - // Create a role with the given permission set. - if (!($rid = $this->drupalCreateRole($permissions))) { - return FALSE; - } - - // Create a user assigned to that role. - $edit = array(); - $edit['name'] = 'simpletestuser'; - $edit['mail'] = $edit['name'] . '@example.com'; - $edit['roles'] = array($rid => $rid); - $edit['pass'] = 'simpletestpass'; - $edit['status'] = 1; - - $account = user_save('', $edit); - - $this->assertTrue(!empty($account->uid), t('User created with name %name and pass %pass', array('%name' => $edit['name'], '%pass' => $edit['pass'])), t('User login')); - if (empty($account->uid)) { - return FALSE; - } - - // Add the raw password so that we can log in as this user. - $account->pass_raw = $edit['pass']; - return $account; - } - -} \ No newline at end of file + // Create a role with the given permission set. + if (!($rid = $this->drupalCreateRole($permissions))) { + return FALSE; + } + + // Create a user assigned to that role. + $edit = array(); + $edit['name'] = 'simpletestuser'; + $edit['mail'] = $edit['name'] . '@example.com'; + $edit['roles'] = array($rid => $rid); + $edit['pass'] = 'simpletestpass'; + $edit['status'] = 1; + + $account = user_save('', $edit); + + $this->assertTrue(!empty($account->uid), t('User created with name %name and pass %pass', array('%name' => $edit['name'], '%pass' => $edit['pass'])), t('User login')); + if (empty($account->uid)) { + return FALSE; + } + + // Add the raw password so that we can log in as this user. + $account->pass_raw = $edit['pass']; + return $account; + } + +} + diff --git a/ilives/tests/test_files/mods_record.xml b/ilives/tests/test_files/mods_record.xml index 6ec2a1d2..c9dc081b 100644 --- a/ilives/tests/test_files/mods_record.xml +++ b/ilives/tests/test_files/mods_record.xml @@ -1,83 +1,83 @@ - - - The - amazing Maurice and his educated rodents - - - Pratchett, Terry. - - creator - - - text - novel - - - enk - - - London - - Corgi Books - 2002 - 2001 - monographic - - - eng - - - print - 269 p. ; 22 cm. - - A talking cat, intelligent rats, and a strange boy cooperate in a Pied Piper scam until they try to con the wrong town and are confronted by a deadly evil rat king. - juvenile - Terry Pratchett. - Carnegie Medal winner. - - Discworld (Imaginary place) - Fiction - - - Discworld (Imaginary place) - Fiction - - - Rats - Fiction - - - Cats - Fiction - - - Fantasy fiction - - - Humorous stories - - PZ7.P8865 Am 2002 - - - Discworld series - - - Pratchett, Terry. - - - 006001234X (library binding) - 0385601239 - 0552546933 (pbk.) - - CaNWHRN - 010730 - 20020314 .0 - - eng - - - + + + The + amazing Maurice and his educated rodents + + + Pratchett, Terry. + + creator + + + text + novel + + + enk + + + London + + Corgi Books + 2002 + 2001 + monographic + + + eng + + +
    print
    + 269 p. ; 22 cm. +
    + A talking cat, intelligent rats, and a strange boy cooperate in a Pied Piper scam until they try to con the wrong town and are confronted by a deadly evil rat king. + juvenile + Terry Pratchett. + Carnegie Medal winner. + + Discworld (Imaginary place) + Fiction + + + Discworld (Imaginary place) + Fiction + + + Rats + Fiction + + + Cats + Fiction + + + Fantasy fiction + + + Humorous stories + + PZ7.P8865 Am 2002 + + + Discworld series + + + Pratchett, Terry. + + + 006001234X (library binding) + 0385601239 + 0552546933 (pbk.) + + CaNWHRN + 010730 + 20020314 .0 + + eng + + +
    diff --git a/ilives/xml/book_collection_policy.xml b/ilives/xml/book_collection_policy.xml index 8c4639f5..07a01745 100644 --- a/ilives/xml/book_collection_policy.xml +++ b/ilives/xml/book_collection_policy.xml @@ -1,22 +1,22 @@ - - - - - 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 - - isMemberOfCollection + + + + + 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 + + isMemberOfCollection \ No newline at end of file diff --git a/ilives/xml/ilives_CollectionModel.xml b/ilives/xml/ilives_CollectionModel.xml index c5d4d7bd..bc9d58a9 100644 --- a/ilives/xml/ilives_CollectionModel.xml +++ b/ilives/xml/ilives_CollectionModel.xml @@ -3,95 +3,95 @@ xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"> - - - - - - - - - - - - - -ingest - -fedoraAdmin -2009-01-23T20:43:42.518Z -Created with Admin GUI "New Object" command - - - -modifyDatastreamByValue -RELS-EXT -fedoraAdmin -2009-01-23T20:45:33.190Z - - - - -modifyDatastreamByValue -DC -fedoraAdmin -2009-01-23T20:48:22.246Z - - - - -ingest - -fedoraAdmin -2009-01-26T20:27:14.697Z -Ingested from local file /opt/fedora/export/ilives_CollectionModel.xml - - - -ingest - -fedoraAdmin -2009-03-21T22:35:49.622Z -Ingested from local file /Volumes/iLives/iLivesTexts/215258_jpg/Content_Models/CollectionCModel.xml - - - -ingest - -admin -2009-09-14T14:09:41.955Z -Fedora Object Ingested - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + ingest + + fedoraAdmin + 2009-01-23T20:43:42.518Z + Created with Admin GUI "New Object" command + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2009-01-23T20:45:33.190Z + + + + + modifyDatastreamByValue + DC + fedoraAdmin + 2009-01-23T20:48:22.246Z + + + + + ingest + + fedoraAdmin + 2009-01-26T20:27:14.697Z + Ingested from local file /opt/fedora/export/ilives_CollectionModel.xml + + + + ingest + + fedoraAdmin + 2009-03-21T22:35:49.622Z + Ingested from local file /Volumes/iLives/iLivesTexts/215258_jpg/Content_Models/CollectionCModel.xml + + + + ingest + + admin + 2009-09-14T14:09:41.955Z + Fedora Object Ingested + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ -104,35 +104,36 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/ demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - -
    -
    -
    -
    -
    -
    - - - - - IslandLives Collection Model - ilives:CollectionModel - - - - - - - IslandLives Collection - Made possible through a generous private donation, the IslandLives project builds on the Robertson Library’s mission to preserve and share unique material relating to Prince Edward Island and demonstrates UPEI's ongoing commitment to making PEI's cultural and published heritage available to all. +
    + +
    +
    +
    +
    +
    +
    + + + + + IslandLives Collection Model + ilives:CollectionModel + + + + + + + IslandLives Collection + Made possible through a generous private donation, the IslandLives project builds on the Robertson Library’s mission to preserve and share unique material relating to Prince Edward Island and demonstrates UPEI's ongoing commitment to making PEI's cultural and published heritage available to all. Utilizing the library’s “Prince Edward Island Collection” and the latest in digitization technology, IslandLives will start by digitizing 300 or so published community histories dating from the mid-1800’s to the present day. These transformed community histories will form the basis of a rich online repository. IslandLives will provide a variety of search interfaces that will allow users to browse and search the content by name, community, time period, and keyword. The Island community will have a whole new way to rediscover, search and share their stories. -This project will engage and build community – recruiting interested individuals from the cultural heritage community and everyday Islanders. Project staff will travel to communities and host ‘digitization days’, introducing community members to the project and its goals, providing them with an opportunity to digitize their own content, and to contribute their content to the IslandLives collection. - Robertson Library, University of Prince Edward Island - ilives:CollectionModel - - - - +This project will engage and build community – recruiting interested individuals from the cultural heritage community and everyday Islanders. Project staff will travel to communities and host ‘digitization days’, introducing community members to the project and its goals, providing them with an opportunity to digitize their own content, and to contribute their content to the IslandLives collection. + + Robertson Library, University of Prince Edward Island + ilives:CollectionModel + + + + \ No newline at end of file diff --git a/ilives/xml/ilives_bookCModel.xml b/ilives/xml/ilives_bookCModel.xml index b6042042..99195fc5 100644 --- a/ilives/xml/ilives_bookCModel.xml +++ b/ilives/xml/ilives_bookCModel.xml @@ -1,130 +1,130 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:56:58.331Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_bookCModel.xml - - - - ingest - - fedoraAdmin - 2010-05-31T19:56:44.131Z - Ingested from source repository with pid ilives:bookCModel - - - - ingest - - fedoraAdmin - 2010-06-10T17:43:56.335Z - Ingested from local file /Users/aoneill/fedora_repository/content_models/ilives_bookCModel.xml - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-06-10T19:01:39.144Z - DatastreamsPane generated this logMessage. - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-10T19:29:20.220Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-10T19:46:24.930Z - - - - - ingest - - fedoraAdmin - 2010-06-16T11:27:32.059Z - Ingested from local file /Users/aoneill/Dropbox/fedora_repository/content_models/ilives_bookCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T11:29:54.285Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T18:36:16.581Z - - - - - ingest - - fedoraAdmin - 2010-06-16T16:14:12.989Z - Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/ilives_bookCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-09-16T17:43:54.445Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:56:58.331Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_bookCModel.xml + + + + ingest + + fedoraAdmin + 2010-05-31T19:56:44.131Z + Ingested from source repository with pid ilives:bookCModel + + + + ingest + + fedoraAdmin + 2010-06-10T17:43:56.335Z + Ingested from local file /Users/aoneill/fedora_repository/content_models/ilives_bookCModel.xml + + + + addDatastream + ISLANDORACM + fedoraAdmin + 2010-06-10T19:01:39.144Z + DatastreamsPane generated this logMessage. + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-10T19:29:20.220Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-10T19:46:24.930Z + + + + + ingest + + fedoraAdmin + 2010-06-16T11:27:32.059Z + Ingested from local file /Users/aoneill/Dropbox/fedora_repository/content_models/ilives_bookCModel.xml + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-16T11:29:54.285Z + + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-06-16T18:36:16.581Z + + + + + ingest + + fedoraAdmin + 2010-06-16T16:14:12.989Z + Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/ilives_bookCModel.xml + + + + modifyDatastreamByValue + ISLANDORACM + fedoraAdmin + 2010-09-16T17:43:54.445Z + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - + + + 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 @@ -137,388 +137,388 @@ demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - Book Content Model - ilives:bookCModel - - - - - - Book Content Model + ilives:bookCModel + + + + + + - - - - image/tiff - image/tif - - - - - ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + image/tif + + + + + ilives + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + text/xml + + + ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - image/tif - - - - - fedora_ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + image/tif + + + + + fedora_ilives + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - - - - - fedora_ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + + + + + fedora_ilives + plugins/herbarium.inc + Herbarium + showFieldSets + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + image/tiff + + + + + fedora_ilives + book.inc + IslandoraBook + showFieldSets + + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - text/xml - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - + + + text/xml + + + + + fedora_ilives + book.inc + IslandoraBook + showFieldSets + + + + + + + + text/xml + + + fedora_ilives + book.inc + IslandoraBook + ingestBook + MODS + + + + + + + fedora_ilives + book.inc + IslandoraBook + buildDrupalForm + handleIngestForm + + + + + fedora_ilives + book.inc + IslandoraBook + buildEditMetadataForm + + + fedora_ilives + book.inc + IslandoraBook + handleEditMetadataForm + + + + + + - - - - text/xml - - - - text/xml - - + + + text/xml + + + + text/xml + + - - - - - - - - - - - - + + + + + + + + + + + - - - + + - - - - + + + + diff --git a/ilives/xml/ilives_collection.xml b/ilives/xml/ilives_collection.xml index 23801263..a2803960 100644 --- a/ilives/xml/ilives_collection.xml +++ b/ilives/xml/ilives_collection.xml @@ -3,54 +3,54 @@ xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"> - - - - - - - - - - - - - -ingest - -fedoraAdmin -2009-05-14T19:32:21.132Z -Created with Admin GUI "New Object" command - - - -modifyDatastreamByValue -DC -fedoraAdmin -2009-05-14T19:35:11.912Z - - - - - - - - - - - IslandLives Collection - ilives:collection - - - - - - - IslandLives Collection - Made possible through a generous private donation, IslandLives contains community and church histories and it builds on the Robertson Library's mission to preserve and share unique material relating to Prince Edward Island and demonstrates UPEI"s ongoing commitment to making PEI"s cultural and published heritage available to all. Welcome. - ilives:collection - - - - + + + + + + + + + + + + + + ingest + + fedoraAdmin + 2009-05-14T19:32:21.132Z + Created with Admin GUI "New Object" command + + + + modifyDatastreamByValue + DC + fedoraAdmin + 2009-05-14T19:35:11.912Z + + + + + + + + + + + IslandLives Collection + ilives:collection + + + + + + + IslandLives Collection + Made possible through a generous private donation, IslandLives contains community and church histories and it builds on the Robertson Library's mission to preserve and share unique material relating to Prince Edward Island and demonstrates UPEI"s ongoing commitment to making PEI"s cultural and published heritage available to all. Welcome. + ilives:collection + + + + \ No newline at end of file diff --git a/ilives/xml/ilives_figuresCModel.xml b/ilives/xml/ilives_figuresCModel.xml index 7b63ae7b..05ea5f02 100644 --- a/ilives/xml/ilives_figuresCModel.xml +++ b/ilives/xml/ilives_figuresCModel.xml @@ -1,20 +1,20 @@ - - image/jpeg - - - - - fedora_ilives - image_rotator_tagger_block.inc - ShowILivesStreamsInFieldSets - showJPG - - - - image/jpeg - - - + + image/jpeg + + + + + fedora_ilives + image_rotator_tagger_block.inc + ShowILivesStreamsInFieldSets + showJPG + + + + image/jpeg + + + diff --git a/ilives/xml/ilives_jp2Sdef.xml b/ilives/xml/ilives_jp2Sdef.xml index f7212084..0f21ef52 100644 --- a/ilives/xml/ilives_jp2Sdef.xml +++ b/ilives/xml/ilives_jp2Sdef.xml @@ -1,81 +1,81 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:56:59.840Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdef.xml - - - - ingest - - admin - 2010-05-25T13:17:14.106Z - Fedora Object Ingested - - - - ingest - - fedoraAdmin - 2010-06-01T01:40:47.337Z - Ingested from local file /Users/al/fedora_repository/content_models/ilives_jp2Sdef.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:56:59.840Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdef.xml + + + + ingest + + admin + 2010-05-25T13:17:14.106Z + Fedora Object Ingested + + + + ingest + + fedoraAdmin + 2010-06-01T01:40:47.337Z + Ingested from local file /Users/al/fedora_repository/content_models/ilives_jp2Sdef.xml + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - + - ilives:jp2Sdef - ilives:jp2Sdef - - - - - - ilives:jp2Sdef + ilives:jp2Sdef + + + + + + - - - - - - - - + + + + + + + + diff --git a/ilives/xml/ilives_jp2Sdep-pageCModel.xml b/ilives/xml/ilives_jp2Sdep-pageCModel.xml index 7eedea6d..0aa21432 100644 --- a/ilives/xml/ilives_jp2Sdep-pageCModel.xml +++ b/ilives/xml/ilives_jp2Sdep-pageCModel.xml @@ -1,179 +1,179 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:00.246Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdep-pageCModel.xml - - - - ingest - - fedoraAdmin - 2010-06-01T00:46:19.239Z - Ingested from local file /Users/al/Desktop/ilives_jp2Sdep-pageCModel.xml - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-01T00:48:39.302Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:57:00.246Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdep-pageCModel.xml + + + + ingest + + fedoraAdmin + 2010-06-01T00:46:19.239Z + Ingested from local file /Users/al/Desktop/ilives_jp2Sdep-pageCModel.xml + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-06-01T00:48:39.302Z + + + + + + + + - - + - ilives:jp2Sdep-pageCModel - ilives:jp2Sdep-pageCModel - - - - - - ilives:jp2Sdep-pageCModel + ilives:jp2Sdep-pageCModel + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - DC - text/xml - - - - - - - - + + + DC + text/xml + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/ilives/xml/ilives_pageCModel.xml b/ilives/xml/ilives_pageCModel.xml index 0f24edeb..2e5e5638 100644 --- a/ilives/xml/ilives_pageCModel.xml +++ b/ilives/xml/ilives_pageCModel.xml @@ -1,52 +1,52 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:00.652Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_pageCModel.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:57:00.652Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_pageCModel.xml + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + 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 @@ -59,43 +59,43 @@ demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - Page Content Model - ilives:pageCModel - - - - + Page Content Model + ilives:pageCModel + + + + diff --git a/ilives/xml/ilives_tei2htmlSdef.xml b/ilives/xml/ilives_tei2htmlSdef.xml index f626c690..a387e512 100644 --- a/ilives/xml/ilives_tei2htmlSdef.xml +++ b/ilives/xml/ilives_tei2htmlSdef.xml @@ -1,64 +1,64 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:01.057Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdef.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:57:01.057Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdef.xml + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - + - ilives:tei2htmlSdef - ilives:tei2htmlSdef - - - - - - ilives:tei2htmlSdef + ilives:tei2htmlSdef + + + + + + - - - - - - - + + + + + + + diff --git a/ilives/xml/ilives_tei2htmlSdep-pageCModel.xml b/ilives/xml/ilives_tei2htmlSdep-pageCModel.xml index 3a2c5d9a..07351348 100644 --- a/ilives/xml/ilives_tei2htmlSdep-pageCModel.xml +++ b/ilives/xml/ilives_tei2htmlSdep-pageCModel.xml @@ -1,226 +1,233 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:01.366Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdep-pageCModel.xml - - - - modifyDatastreamByValue - XSL - fedoraAdmin - 2009-12-11T19:09:52.417Z - - - - - modifyDatastreamByValue - XSL - fedoraAdmin - 2009-12-11T19:22:11.096Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T14:57:01.366Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdep-pageCModel.xml + + + + modifyDatastreamByValue + XSL + fedoraAdmin + 2009-12-11T19:09:52.417Z + + + + + modifyDatastreamByValue + XSL + fedoraAdmin + 2009-12-11T19:22:11.096Z + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - + - ilives:tei2htmlSdep-pageCModel - ilives:tei2htmlSdep-pageCModel - - - - - - ilives:tei2htmlSdep-pageCModel + ilives:tei2htmlSdep-pageCModel + + + + + + - - - - TEI - text/xml - - - - XSL - text/xml - - - - - - - - + + + TEI + text/xml + + + + XSL + text/xml + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + - - - - - <xsl:value-of select="normalize-space(tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title)"/> - - - - - - - - -
    - -
    -
    - -

    - -

    -
    - - - - - - - - - - - search persName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22+%22+AND+dc.type:collection - - - - - - - - - - - - search placeName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22%22+AND+dc.type:collection - - - - - - search orgName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22%22+AND+dc.type:collection - - - - -
    -
    -
    -
    + + + + + <xsl:value-of select="normalize-space(tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title)"/> + + + + + + + + +
    + +
    +
    + +

    + +

    +
    + + + + + + + + + + + search persName + _blank + http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22 + + + %22+AND+dc.type:collection + + + + + + + + + + + + + search placeName + _blank + http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22 + %22+AND+dc.type:collection + + + + + + + search orgName + _blank + http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22 + %22+AND+dc.type:collection + + + + + + + +
    +
    diff --git a/ilives/xml/ilives_viewerSdef.xml b/ilives/xml/ilives_viewerSdef.xml index a97c50a2..18018cfa 100644 --- a/ilives/xml/ilives_viewerSdef.xml +++ b/ilives/xml/ilives_viewerSdef.xml @@ -1,64 +1,64 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T17:09:29.912Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdef.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T17:09:29.912Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdef.xml + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - + - ilives:viewerSdef - ilives:viewerSdef - - - - - - ilives:viewerSdef + ilives:viewerSdef + + + + + + - - - - - - - + + + + + + + diff --git a/ilives/xml/ilives_viewerSdep-bookCModel.xml b/ilives/xml/ilives_viewerSdep-bookCModel.xml index e5688998..ec7993b1 100644 --- a/ilives/xml/ilives_viewerSdep-bookCModel.xml +++ b/ilives/xml/ilives_viewerSdep-bookCModel.xml @@ -1,133 +1,133 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-12T17:09:41.797Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-bookCModel.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-12T17:09:41.797Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-bookCModel.xml + + + + + + + - - + - ilives:viewerSdep-bookCModel - ilives:viewerSdep-bookCModel - - - - - - ilives:viewerSdep-bookCModel + ilives:viewerSdep-bookCModel + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - DC - text/xml - - - - - - - - + + + DC + text/xml + + + + + + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ilives/xml/ilives_viewerSdep-pageCModel.xml b/ilives/xml/ilives_viewerSdep-pageCModel.xml index 6b30cd67..e19fe7c5 100644 --- a/ilives/xml/ilives_viewerSdep-pageCModel.xml +++ b/ilives/xml/ilives_viewerSdep-pageCModel.xml @@ -1,133 +1,133 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2009-11-24T14:52:27.296Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-pageCModel.xml - - - - - - - + + + + ingest + + fedoraAdmin + 2009-11-24T14:52:27.296Z + Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-pageCModel.xml + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - + - ilives:viewerSdep-pageCModel - ilives:viewerSdep-pageCModel - - - - - - ilives:viewerSdep-pageCModel + ilives:viewerSdep-pageCModel + + + + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - - - DC - text/xml - - - - - - - - + + + DC + text/xml + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ilives/xsl/MODS3-22simpleDC.xsl b/ilives/xsl/MODS3-22simpleDC.xsl index 4a4eff8d..eb147a42 100644 --- a/ilives/xsl/MODS3-22simpleDC.xsl +++ b/ilives/xsl/MODS3-22simpleDC.xsl @@ -37,372 +37,375 @@ Version 1.0 2007-05-04 Tracy Meehleib --> - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - : - - - - . - - - - . - - - - - - - - + + + + + + + + : + + + + . + + + + . + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - -- - + + + + + + + + + + + + + + + + + + + + + + + + -- + - - - -- - - - - - - - - - - - - - - - - - - - - - - + + -- + + + + + + + + + + + + + + + + + + + + + + - - -- - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - + -- + + + + + + + + + + + + + + + - + + + + + + + + + -- + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Collection - - - DataSet - - - Service - - - Software - - - Image - - - InteractiveResource - - - MovingImage - - - PhysicalObject - - - Sound - - - StillImage - - - Text - - - Text - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Collection + + + DataSet + + + Service + + + Software + + + Image + + + InteractiveResource + + + MovingImage + + + PhysicalObject + + + Sound + + + StillImage + + + Text + + + Text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + :  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - -- - - - - - - - - + + -- + + + + + + + + - - - -- - - - - - - - - - - - - - - - - - - - - - - , - - - - , - - - - - ( - - ) - - - ( - - ) - - - - - - - - - - - - + + + -- + + + + + + + + + + + + + + + + + + + + + + , + + + + , + + + + + ( + + ) + + + ( + + ) + + + + + + + + + - + + + - - - - + + - + + - - - + + + - + diff --git a/ilives/xsl/book_view.xsl b/ilives/xsl/book_view.xsl index a8bfb825..47559c12 100644 --- a/ilives/xsl/book_view.xsl +++ b/ilives/xsl/book_view.xsl @@ -1,65 +1,174 @@ - - + + - - - - - - - + + + + + + + - + -

    - :

    -

    +

    + + + + + : + + +

    + +

    -

    -
    - + +
    - - fedora/repository//TN - - + + + + + + + +
    + + + fedora/repository/ + /TN + + -
    - - - - - - - - + + +
    By Statement:
    Place of Publication:
    Publisher:
    Date:
    Language:
    Pagination:
    ISBN 10:
    Subjects: - - fedora/ilives_book_search/mods.subject:""%20AND%20dc.type:collection%20AND%20dc.type:ingested - + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
    + By Statement: + + +
    + Place of Publication: + + +
    + Publisher: + + +
    + Date: + + +
    + Language: + + +
    + Pagination: + + +
    + ISBN 10: + + +
    + Subjects: + + + + + + fedora/ilives_book_search/mods.subject:" + "%20AND%20dc.type:collection%20AND%20dc.type:ingested + -
    -
    - - -
    +
    +
    + + + + - - - -
    + + + + + + + + +
    -
    +
    \ No newline at end of file diff --git a/ilives/xsl/pageResults.xsl b/ilives/xsl/pageResults.xsl index fccee47a..e9476308 100644 --- a/ilives/xsl/pageResults.xsl +++ b/ilives/xsl/pageResults.xsl @@ -1,160 +1,165 @@ - - - + + + - - + + - + - + - + - - - - + + + + - - + + - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + Total Hits = - - , - + + , + -
    We have repeated your search within this book and found results on the following pages. +
    We have repeated your search within this book and found results on the following pages. -
    +
    - - - -
    + + + +
    -
    -
    + +
    - -
    - - - - - - - - - -
    -
    -
    + +
    + + + + + + + + + +
    +
    +
    - - - + + + - + - + - + - - - + + + - - + +
    - - - - - + + + + + - - - - - - - fedora/ilives_book_viewer/ - - - Thumbnail - + + + + + + + fedora/ilives_book_viewer/ + + + + Thumbnail + + + - fedora/repository//TN - - - -
    - - - fedora/ilives_book_viewer/ - - + fedora/repository/ + /TN + + +
    - + + + fedora/ilives_book_viewer/ + + + +
    +
    - - - - - + + + + + -
    +
    - - -   - - - - - - + + +   + + + + + + diff --git a/ilives/xsl/results.xsl b/ilives/xsl/results.xsl index 0757ea1e..c62fb169 100644 --- a/ilives/xsl/results.xsl +++ b/ilives/xsl/results.xsl @@ -1,76 +1,89 @@ - - - - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Total Hits = , - Number of Hits/page = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Total Hits = + + , + + Number of Hits/page = + -
    +
    -
    - -
    -
      - -
    • - - fedora/ilives_book_search// +
      + +
      - - - - -
      -
        - -
      • - - fedora/ilives_book_search// + + + + - - - -
        - -

        Your search yielded no results

        - -
          -
        • Check if your spelling is correct.
        • - -
        • Remove quotes around phrases to match each word individually: "blue smurf" will match less than blue smurf.
        • -
        • Consider loosening your query with OR: blue smurf will match less than blue OR smurf.
        • -
        - -
        - -
        - - - - - -
        -
        - - - - - - - - - - - - - - - - - - - + + + + + + + + +
        + +

        Your search yielded no results

        + +
        +
          +
        • Check if your spelling is correct.
        • + +
        • Remove quotes around phrases to match each word individually: + "blue smurf" will match less than + blue smurf. +
        • +
        • Consider loosening your query with + OR: + blue smurf will match less than + blue OR smurf. +
        • +
        +
        + +
        + +
        + + + + + +
        - - - -
        +
        +
        + + + + + + + + + + + + + + + + + + + + + - + - -
        + + + +
        + +
      + - - + + - - - - + + + + - + - + - + - - + + - + - - + - - - - + + + - - - + + + - - + + - - - + + + - - + + - - - fedora/ilives// - + + + + + fedora/ilives/ + / + + - - fedora/repository//TN - - 100 - + + + fedora/repository/ + /TN + + 100 + - + - + - + - - - fedora/ilives// - - + + + + fedora/ilives/ + / + + + - + - - - - - : - - + + + + + + : + + + - - + + - - - / - - + + + / + + + - - - - - + + + + + + - - - : - - + + + : + + + - - - , . - - + + + , + . + + - - - - - + + + + + + - - + + '; + return objTag = ''; } function _QTPageHasBehaviorObject(callingFcnName, args) { - var haveBehavior = false; - var objects = document.getElementsByTagName('object'); + var haveBehavior = false; + var objects = document.getElementsByTagName('object'); - for ( var ndx = 0, obj; obj = objects[ndx]; ndx++ ) - { - if ( obj.getAttribute('classid') == "clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598" ) - { - if ( obj.getAttribute('id') == gQTBehaviorID ) - haveBehavior = false; - break; - } - } - - return haveBehavior; + for ( var ndx = 0, obj; obj = objects[ndx]; ndx++ ) + { + if ( obj.getAttribute('classid') == "clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598" ) + { + if ( obj.getAttribute('id') == gQTBehaviorID ) + haveBehavior = false; + break; + } + } + + return haveBehavior; } function _QTShouldInsertBehavior() { - var shouldDo = false; + var shouldDo = false; - if ( gQTEventsEnabled && _QTIsMSIE() && !_QTPageHasBehaviorObject() ) - shouldDo = true; + if ( gQTEventsEnabled && _QTIsMSIE() && !_QTPageHasBehaviorObject() ) + shouldDo = true; - return shouldDo; + return shouldDo; } function _QTAddAttribute(prefix, slotName, tagName) { - var value; - - value = gTagAttrs[prefix + slotName]; - if ( null == value ) - value = gTagAttrs[slotName]; - - if ( null != value ) - { - if ( 0 == slotName.indexOf(prefix) && (null == tagName) ) - tagName = slotName.substring(prefix.length); - if ( null == tagName ) - tagName = slotName; - return ' ' + tagName + '="' + value + '"'; - } - else - return ""; + var value; + + value = gTagAttrs[prefix + slotName]; + if ( null == value ) + value = gTagAttrs[slotName]; + + if ( null != value ) + { + if ( 0 == slotName.indexOf(prefix) && (null == tagName) ) + tagName = slotName.substring(prefix.length); + if ( null == tagName ) + tagName = slotName; + return ' ' + tagName + '="' + value + '"'; + } + else + return ""; } function _QTAddObjectAttr(slotName, tagName) { - // don't bother if it is only for the embed tag - if ( 0 == slotName.indexOf("emb#") ) - return ""; + // don't bother if it is only for the embed tag + if ( 0 == slotName.indexOf("emb#") ) + return ""; - if ( 0 == slotName.indexOf("obj#") && (null == tagName) ) - tagName = slotName.substring(4); + if ( 0 == slotName.indexOf("obj#") && (null == tagName) ) + tagName = slotName.substring(4); - return _QTAddAttribute("obj#", slotName, tagName); + return _QTAddAttribute("obj#", slotName, tagName); } function _QTAddEmbedAttr(slotName, tagName) { - // don't bother if it is only for the object tag - if ( 0 == slotName.indexOf("obj#") ) - return ""; + // don't bother if it is only for the object tag + if ( 0 == slotName.indexOf("obj#") ) + return ""; - if ( 0 == slotName.indexOf("emb#") && (null == tagName) ) - tagName = slotName.substring(4); + if ( 0 == slotName.indexOf("emb#") && (null == tagName) ) + tagName = slotName.substring(4); - return _QTAddAttribute("emb#", slotName, tagName); + return _QTAddAttribute("emb#", slotName, tagName); } function _QTAddObjectParam(slotName, generateXHTML) { - var paramValue; - var paramStr = ""; - var endTagChar = (generateXHTML) ? ' />' : '>'; - - if ( -1 == slotName.indexOf("emb#") ) - { - // look for the OBJECT-only param first. if there is none, look for a generic one - paramValue = gTagAttrs["obj#" + slotName]; - if ( null == paramValue ) - paramValue = gTagAttrs[slotName]; - - if ( 0 == slotName.indexOf("obj#") ) - slotName = slotName.substring(4); + var paramValue; + var paramStr = ""; + var endTagChar = (generateXHTML) ? ' />' : '>'; + + if ( -1 == slotName.indexOf("emb#") ) + { + // look for the OBJECT-only param first. if there is none, look for a generic one + paramValue = gTagAttrs["obj#" + slotName]; + if ( null == paramValue ) + paramValue = gTagAttrs[slotName]; + + if ( 0 == slotName.indexOf("obj#") ) + slotName = slotName.substring(4); - if ( null != paramValue ) - paramStr = '' - + _QTAddObjectParam("src", generateXHTML); - var embedTag = ''; + // allocate an array, fill in the required attributes with fixed place params and defaults + gTagAttrs = new Object(); + gTagAttrs["src"] = args[0]; + gTagAttrs["width"] = args[1]; + gTagAttrs["height"] = args[2]; + gTagAttrs["classid"] = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"; + //Impportant note: It is recommended that you use this exact classid in order to ensure a seamless experience for all viewers + gTagAttrs["pluginspage"] = "http://www.apple.com/quicktime/download/"; + + // set up codebase attribute with specified or default version before parsing args so + // anything passed in will override + var activexVers = args[3] + if ( (null == activexVers) || ("" == activexVers) ) + activexVers = "7,3,0,0"; + gTagAttrs["codebase"] = "http://www.apple.com/qtactivex/qtplugin.cab#version=" + activexVers; + + var attrName, + attrValue; + + // add all of the optional attributes to the array + for ( var ndx = 4; ndx < args.length; ndx += 2) + { + attrName = args[ndx].toLowerCase(); + attrValue = args[ndx + 1]; + + gTagAttrs[attrName] = attrValue; + + if ( ("postdomevents" == attrName) && (attrValue.toLowerCase() != "false") ) + { + gQTEventsEnabled = true; + if ( _QTIsMSIE() ) + gTagAttrs["obj#style"] = "behavior:url(#" + gQTBehaviorID + ")"; + } + } + + // init both tags with the required and "special" attributes + var objTag = '' + + _QTAddObjectParam("src", generateXHTML); + var embedTag = ''; } // return the object/embed as a string function QT_GenerateOBJECTText() { - var txt = _QTGenerate("QT_GenerateOBJECTText", false, arguments); - if ( _QTShouldInsertBehavior() ) - txt = _QTGenerateBehavior() + txt; - return txt; + var txt = _QTGenerate("QT_GenerateOBJECTText", false, arguments); + if ( _QTShouldInsertBehavior() ) + txt = _QTGenerateBehavior() + txt; + return txt; } function QT_GenerateOBJECTText_XHTML() { - var txt = _QTGenerate("QT_GenerateOBJECTText_XHTML", true, arguments); - if ( _QTShouldInsertBehavior() ) - txt = _QTGenerateBehavior() + txt; - return txt; + var txt = _QTGenerate("QT_GenerateOBJECTText_XHTML", true, arguments); + if ( _QTShouldInsertBehavior() ) + txt = _QTGenerateBehavior() + txt; + return txt; } function QT_WriteOBJECT() { - var txt = _QTGenerate("QT_WriteOBJECT", false, arguments); - if ( _QTShouldInsertBehavior() ) - document.writeln(_QTGenerateBehavior()); - document.writeln(txt); + var txt = _QTGenerate("QT_WriteOBJECT", false, arguments); + if ( _QTShouldInsertBehavior() ) + document.writeln(_QTGenerateBehavior()); + document.writeln(txt); } function QT_WriteOBJECT_XHTML() { - var txt = _QTGenerate("QT_WriteOBJECT_XHTML", true, arguments); - if ( _QTShouldInsertBehavior() ) - document.writeln(_QTGenerateBehavior()); - document.writeln(txt); + var txt = _QTGenerate("QT_WriteOBJECT_XHTML", true, arguments); + if ( _QTShouldInsertBehavior() ) + document.writeln(_QTGenerateBehavior()); + document.writeln(txt); } function QT_GenerateBehaviorOBJECT() { - return _QTGenerateBehavior(); + return _QTGenerateBehavior(); } function QT_ReplaceElementContents() { - var element = arguments[0]; - var args = []; + var element = arguments[0]; + var args = []; - // copy all other arguments we want to pass through to the fcn - for ( var ndx = 1; ndx < arguments.length; ndx++ ) - args.push(arguments[ndx]); + // copy all other arguments we want to pass through to the fcn + for ( var ndx = 1; ndx < arguments.length; ndx++ ) + args.push(arguments[ndx]); - var txt = _QTGenerate("QT_ReplaceElementContents", false, args); - if ( txt.length > 0 ) - element.innerHTML = txt; + var txt = _QTGenerate("QT_ReplaceElementContents", false, args); + if ( txt.length > 0 ) + element.innerHTML = txt; } function QT_ReplaceElementContents_XHTML() { - var element = arguments[0]; - var args = []; + var element = arguments[0]; + var args = []; - // copy all other arguments we want to pass through to the fcn - for ( var ndx = 1; ndx < arguments.length; ndx++ ) - args.push(arguments[ndx]); + // copy all other arguments we want to pass through to the fcn + for ( var ndx = 1; ndx < arguments.length; ndx++ ) + args.push(arguments[ndx]); - var txt = _QTGenerate("QT_ReplaceElementContents_XHTML", true, args); - if ( txt.length > 0 ) - element.innerHTML = txt; + var txt = _QTGenerate("QT_ReplaceElementContents_XHTML", true, args); + if ( txt.length > 0 ) + element.innerHTML = txt; } diff --git a/js/printer_tool.js b/js/printer_tool.js index f5ff8802..2d7da8dd 100644 --- a/js/printer_tool.js +++ b/js/printer_tool.js @@ -3,12 +3,19 @@ var PrinterTool = {}; PrinterTool.windowSettings = 'toolbar=no,location=no,' + 'status=no,menu=no,scrollbars=yes,width=650,height=400'; /** * Open a printer-friendly page and prompt for printing. * @param tagID * The ID of the tag that contains the material that should * be printed. */ -PrinterTool.print = function (tagID) { var target = document.getElementById(tagID); var title = document.title; -if(!target || target.childNodes.length === 0) { alert("Nothing to Print"); return; -} -var content = target.innerHTML; -var text = '' + title + -'' + content +''; -printerWindow = window.open('', '', PrinterTool.windowSettings); printerWindow.document.open(); printerWindow.document.write(text); printerWindow.document.close(); -printerWindow.print(); +PrinterTool.print = function (tagID) { + var target = document.getElementById(tagID); + var title = document.title; + if(!target || target.childNodes.length === 0) { + alert("Nothing to Print"); + return; + } + var content = target.innerHTML; + var text = '' + title + + '' + content +''; + printerWindow = window.open('', '', PrinterTool.windowSettings); + printerWindow.document.open(); + printerWindow.document.write(text); + printerWindow.document.close(); + printerWindow.print(); }; diff --git a/js/swfobject.js b/js/swfobject.js index 6d541852..a2378c1e 100644 --- a/js/swfobject.js +++ b/js/swfobject.js @@ -10,206 +10,233 @@ if(typeof deconcept == "undefined") var deconcept = new Object(); if(typeof deconcept.util == "undefined") deconcept.util = new Object(); if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object(); deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) { - if (!document.getElementById) { return; } - this.DETECT_KEY = detectKey ? detectKey : 'detectflash'; - this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY); - this.params = new Object(); - this.variables = new Object(); - this.attributes = new Array(); - if(swf) { this.setAttribute('swf', swf); } - if(id) { this.setAttribute('id', id); } - if(w) { this.setAttribute('width', w); } - if(h) { this.setAttribute('height', h); } - if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); } - this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(); - if (!window.opera && document.all && this.installedVer.major > 7) { - // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE - deconcept.SWFObject.doPrepUnload = true; - } - if(c) { this.addParam('bgcolor', c); } - var q = quality ? quality : 'high'; - this.addParam('quality', q); - this.setAttribute('useExpressInstall', false); - this.setAttribute('doExpressInstall', false); - var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location; - this.setAttribute('xiRedirectUrl', xir); - this.setAttribute('redirectUrl', ''); - if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); } + if (!document.getElementById) { + return; + } + this.DETECT_KEY = detectKey ? detectKey : 'detectflash'; + this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY); + this.params = new Object(); + this.variables = new Object(); + this.attributes = new Array(); + if(swf) { + this.setAttribute('swf', swf); + } + if(id) { + this.setAttribute('id', id); + } + if(w) { + this.setAttribute('width', w); + } + if(h) { + this.setAttribute('height', h); + } + if(ver) { + this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); + } + this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(); + if (!window.opera && document.all && this.installedVer.major > 7) { + // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE + deconcept.SWFObject.doPrepUnload = true; + } + if(c) { + this.addParam('bgcolor', c); + } + var q = quality ? quality : 'high'; + this.addParam('quality', q); + this.setAttribute('useExpressInstall', false); + this.setAttribute('doExpressInstall', false); + var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location; + this.setAttribute('xiRedirectUrl', xir); + this.setAttribute('redirectUrl', ''); + if(redirectUrl) { + this.setAttribute('redirectUrl', redirectUrl); + } } deconcept.SWFObject.prototype = { - useExpressInstall: function(path) { - this.xiSWFPath = !path ? "expressinstall.swf" : path; - this.setAttribute('useExpressInstall', true); - }, - setAttribute: function(name, value){ - this.attributes[name] = value; - }, - getAttribute: function(name){ - return this.attributes[name]; - }, - addParam: function(name, value){ - this.params[name] = value; - }, - getParams: function(){ - return this.params; - }, - addVariable: function(name, value){ - this.variables[name] = value; - }, - getVariable: function(name){ - return this.variables[name]; - }, - getVariables: function(){ - return this.variables; - }, - getVariablePairs: function(){ - var variablePairs = new Array(); - var key; - var variables = this.getVariables(); - for(key in variables){ - variablePairs.push(key +"="+ variables[key]); - } - return variablePairs; - }, - getSWFHTML: function() { - var swfNode = ""; - if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture - if (this.getAttribute("doExpressInstall")) { - this.addVariable("MMplayerType", "PlugIn"); - this.setAttribute('swf', this.xiSWFPath); - } - swfNode = ' 0){ swfNode += 'flashvars="'+ pairs +'"'; } - swfNode += '/>'; - } else { // PC IE - if (this.getAttribute("doExpressInstall")) { - this.addVariable("MMplayerType", "ActiveX"); - this.setAttribute('swf', this.xiSWFPath); - } - swfNode = ''; - swfNode += ''; - var params = this.getParams(); - for(var key in params) { - swfNode += ''; - } - var pairs = this.getVariablePairs().join("&"); - if(pairs.length > 0) {swfNode += '';} - swfNode += ""; - } - return swfNode; - }, - write: function(elementId){ - if(this.getAttribute('useExpressInstall')) { - // check to see if we need to do an express install - var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]); - if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) { - this.setAttribute('doExpressInstall', true); - this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl'))); - document.title = document.title.slice(0, 47) + " - Flash Player Installation"; - this.addVariable("MMdoctitle", document.title); - } - } - if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){ - var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId; - n.innerHTML = this.getSWFHTML(); - return true; - }else{ - if(this.getAttribute('redirectUrl') != "") { - document.location.replace(this.getAttribute('redirectUrl')); - } - } - return false; - } + useExpressInstall: function(path) { + this.xiSWFPath = !path ? "expressinstall.swf" : path; + this.setAttribute('useExpressInstall', true); + }, + setAttribute: function(name, value){ + this.attributes[name] = value; + }, + getAttribute: function(name){ + return this.attributes[name]; + }, + addParam: function(name, value){ + this.params[name] = value; + }, + getParams: function(){ + return this.params; + }, + addVariable: function(name, value){ + this.variables[name] = value; + }, + getVariable: function(name){ + return this.variables[name]; + }, + getVariables: function(){ + return this.variables; + }, + getVariablePairs: function(){ + var variablePairs = new Array(); + var key; + var variables = this.getVariables(); + for(key in variables){ + variablePairs.push(key +"="+ variables[key]); + } + return variablePairs; + }, + getSWFHTML: function() { + var swfNode = ""; + if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture + if (this.getAttribute("doExpressInstall")) { + this.addVariable("MMplayerType", "PlugIn"); + this.setAttribute('swf', this.xiSWFPath); + } + swfNode = ' 0){ + swfNode += 'flashvars="'+ pairs +'"'; + } + swfNode += '/>'; + } else { // PC IE + if (this.getAttribute("doExpressInstall")) { + this.addVariable("MMplayerType", "ActiveX"); + this.setAttribute('swf', this.xiSWFPath); + } + swfNode = ''; + swfNode += ''; + var params = this.getParams(); + for(var key in params) { + swfNode += ''; + } + var pairs = this.getVariablePairs().join("&"); + if(pairs.length > 0) { + swfNode += ''; + } + swfNode += ""; + } + return swfNode; + }, + write: function(elementId){ + if(this.getAttribute('useExpressInstall')) { + // check to see if we need to do an express install + var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]); + if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) { + this.setAttribute('doExpressInstall', true); + this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl'))); + document.title = document.title.slice(0, 47) + " - Flash Player Installation"; + this.addVariable("MMdoctitle", document.title); + } + } + if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){ + var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId; + n.innerHTML = this.getSWFHTML(); + return true; + }else{ + if(this.getAttribute('redirectUrl') != "") { + document.location.replace(this.getAttribute('redirectUrl')); + } + } + return false; + } } /* ---- detection functions ---- */ deconcept.SWFObjectUtil.getPlayerVersion = function(){ - var PlayerVersion = new deconcept.PlayerVersion([0,0,0]); - if(navigator.plugins && navigator.mimeTypes.length){ - var x = navigator.plugins["Shockwave Flash"]; - if(x && x.description) { - PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); - } - }else{ - // do minor version lookup in IE, but avoid fp6 crashing issues - // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ - try{ - var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); - }catch(e){ - try { - var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); - PlayerVersion = new deconcept.PlayerVersion([6,0,21]); - axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code) - } catch(e) { - if (PlayerVersion.major == 6) { - return PlayerVersion; - } - } - try { - axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); - } catch(e) {} - } - if (axo != null) { - PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); - } - } - return PlayerVersion; + var PlayerVersion = new deconcept.PlayerVersion([0,0,0]); + if(navigator.plugins && navigator.mimeTypes.length){ + var x = navigator.plugins["Shockwave Flash"]; + if(x && x.description) { + PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); + } + }else{ + // do minor version lookup in IE, but avoid fp6 crashing issues + // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ + try{ + var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); + }catch(e){ + try { + var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); + PlayerVersion = new deconcept.PlayerVersion([6,0,21]); + axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code) + } catch(e) { + if (PlayerVersion.major == 6) { + return PlayerVersion; + } + } + try { + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + } catch(e) {} + } + if (axo != null) { + PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); + } + } + return PlayerVersion; } deconcept.PlayerVersion = function(arrVersion){ - this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0; - this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0; - this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0; + this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0; + this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0; + this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0; } deconcept.PlayerVersion.prototype.versionIsValid = function(fv){ - if(this.major < fv.major) return false; - if(this.major > fv.major) return true; - if(this.minor < fv.minor) return false; - if(this.minor > fv.minor) return true; - if(this.rev < fv.rev) return false; - return true; + if(this.major < fv.major) return false; + if(this.major > fv.major) return true; + if(this.minor < fv.minor) return false; + if(this.minor > fv.minor) return true; + if(this.rev < fv.rev) return false; + return true; } /* ---- get value of query string param ---- */ deconcept.util = { - getRequestParameter: function(param) { - var q = document.location.search || document.location.hash; - if(q) { - var pairs = q.substring(1).split("&"); - for (var i=0; i < pairs.length; i++) { - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { - return pairs[i].substring((pairs[i].indexOf("=")+1)); - } - } - } - return ""; - } + getRequestParameter: function(param) { + var q = document.location.search || document.location.hash; + if(q) { + var pairs = q.substring(1).split("&"); + for (var i=0; i < pairs.length; i++) { + if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { + return pairs[i].substring((pairs[i].indexOf("=")+1)); + } + } + } + return ""; + } } /* fix for video streaming bug */ deconcept.SWFObjectUtil.cleanupSWFs = function() { - var objects = document.getElementsByTagName("OBJECT"); - for (var i=0; i < objects.length; i++) { - objects[i].style.display = 'none'; - for (var x in objects[i]) { - if (typeof objects[i][x] == 'function') { - objects[i][x] = function(){}; - } - } - } + var objects = document.getElementsByTagName("OBJECT"); + for (var i=0; i < objects.length; i++) { + objects[i].style.display = 'none'; + for (var x in objects[i]) { + if (typeof objects[i][x] == 'function') { + objects[i][x] = function(){}; + } + } + } } // fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/swfobject-143-released/ if (deconcept.SWFObject.doPrepUnload) { - deconcept.SWFObjectUtil.prepUnload = function() { - __flash_unloadHandler = function(){}; - __flash_savedUnloadHandler = function(){}; - window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs); - } - window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload); + deconcept.SWFObjectUtil.prepUnload = function() { + __flash_unloadHandler = function(){}; + __flash_savedUnloadHandler = function(){}; + window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs); + } + window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload); } /* add Array.push if needed (ie5) */ -if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }} +if (Array.prototype.push == null) { + Array.prototype.push = function(item) { + this[this.length] = item; + return this.length; + } + } /* add some aliases for ease of use/backwards compatibility */ var getQueryParamValue = deconcept.util.getRequestParameter; diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index 6c5e33b6..a76c9282 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -1,5 +1,6 @@ getType($file); - $fileUrl = $base_url . '/'. drupal_urlencode($file); + $fileUrl = $base_url . '/' . drupal_urlencode($file); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); - $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); + $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); $ds1 = $dom->createElement("foxml:datastream"); $ds1->setAttribute("ID", "COLLECTION_POLICY"); //set the ID $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "COLLECTION_POLICY.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -42,4 +45,5 @@ class CollectionFormBuilder extends FormBuilder { $ds1v->appendChild($ds1content); $rootElement->appendChild($ds1); } + } diff --git a/plugins/CreateCollection.inc b/plugins/CreateCollection.inc index 0c185705..2fe5f8df 100644 --- a/plugins/CreateCollection.inc +++ b/plugins/CreateCollection.inc @@ -1,5 +1,6 @@ owner = $item; - if ( array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) { + if (array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) { $dwc = $item->get_datastream_dissemination('DARWIN_CORE'); if (!empty($dwc)) { $this->darwinCoreXML = $dwc; @@ -18,9 +18,9 @@ class DarwinCore { } public function buildDrupalForm($form = array()) { - + $dwc_xml = $this->darwinCoreXML; - + $dwc = DOMDocument::loadXML($dwc_xml); $form['dc:type'] = array( @@ -162,12 +162,12 @@ class DarwinCore { $date = $dwc->getElementsByTagNameNS('http://rs.tdwg.org/dwc/terms/', 'eventDate')->item(0)->nodeValue; $format = 'Y-m-d H:i:s'; $form['dwceventDate'] = array( - '#type' => 'date_popup', // types 'date_text' and 'date_timezone' are also supported. See .inc file. - '#title' => 'select a date', - '#default_value' => $date, - '#date_format' => $format, - '#date_label_position' => 'within', // See other available attributes and what they do in date_api_elements.inc - '#date_increment' => 15, // Optional, used by the date_select and date_popup elements to increment minutes and seconds. + '#type' => 'date_popup', // types 'date_text' and 'date_timezone' are also supported. See .inc file. + '#title' => 'select a date', + '#default_value' => $date, + '#date_format' => $format, + '#date_label_position' => 'within', // See other available attributes and what they do in date_api_elements.inc + '#date_increment' => 15, // Optional, used by the date_select and date_popup elements to increment minutes and seconds. '#description' => '', ); return $form; @@ -213,7 +213,7 @@ class DarwinCore { } public function asHTML() { - $path=drupal_get_path('module', 'Fedora_Repository'); + $path = drupal_get_path('module', 'Fedora_Repository'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'CollectionClass'); @@ -226,8 +226,7 @@ class DarwinCore { try { $proc = new XsltProcessor(); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); return " "; } @@ -238,7 +237,7 @@ class DarwinCore { $input->loadXML(trim($xmlstr)); $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); - $content=$newdom->saveXML(); + $content = $newdom->saveXML(); return $content; } @@ -256,9 +255,7 @@ class DarwinCore { 'MachineObservation' => 'MachineObservation', 'NomenclaturalChecklist' => 'NomenclaturalChecklist', ), - ); - public $dwcFields = array( 'dc:type', 'dc:language', @@ -283,8 +280,6 @@ class DarwinCore { 'dwc:eventDate', 'dwc:eventTime', ); - - public $darwinCoreXML = ' diff --git a/plugins/DemoFormBuilder.inc b/plugins/DemoFormBuilder.inc index 913d8005..d83a7cdb 100644 --- a/plugins/DemoFormBuilder.inc +++ b/plugins/DemoFormBuilder.inc @@ -1,5 +1,6 @@ getType($file); - $fileUrl = $base_url .'/'. drupal_urlencode($file); + $fileUrl = $base_url . '/' . drupal_urlencode($file); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -50,7 +53,7 @@ class DemoFormBuilder extends FormBuilder { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { $createdFile = strstr($createdFile, $file); $dformat = $mimetype->getType($createdFile); - $fileUrl = $base_url .'/'. drupal_urlencode( $createdFile ); + $fileUrl = $base_url . '/' . drupal_urlencode($createdFile); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -60,7 +63,7 @@ class DemoFormBuilder extends FormBuilder { $ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -73,5 +76,6 @@ class DemoFormBuilder extends FormBuilder { } } } + } diff --git a/plugins/DocumentConverter.inc b/plugins/DocumentConverter.inc index 3aafb49f..1e7c590f 100644 --- a/plugins/DocumentConverter.inc +++ b/plugins/DocumentConverter.inc @@ -1,13 +1,12 @@ get_mimetype($output_ext); $inputData = file_get_contents($file); - $outputFile = $file ."_". $dsid .".". $output_ext; + $outputFile = $file . "_" . $dsid . "." . $output_ext; #debug: #drupal_set_message("inputType: $inputType", 'status'); @@ -40,8 +39,8 @@ class DocumentConverter { #drupal_set_message("outputFile: $outputFile", 'status'); $ch = curl_init($this->converter_service_url); - curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: $inputType", "Accept: $outputType" ) ); - curl_setopt($ch, CURLOPT_POST, 1 ); + curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: $inputType", "Accept: $outputType")); + curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 120); // times out after 2 minutes curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable curl_setopt($ch, CURLOPT_POSTFIELDS, $inputData); // add POST fields @@ -52,28 +51,29 @@ class DocumentConverter { $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - if (200 == $code) { + if (200 == $code) { $returnValue = file_put_contents($outputFile, $data); if ($returnValue > 0) { drupal_set_message("Conversion successful.", 'status'); $_SESSION['fedora_ingest_files']["$dsid"] = $outputFile; return $outputFile; - } + } else { return $returnValue; // a.k.a. FALSE. } - } + } else { drupal_set_message("Conversion Failed. Webservice returned $code.", 'status'); return FALSE; } } + } /* -$documentConverter = new DocumentConverter(); -$inputFile = "document.docx"; -$outputType = "txt"; -$documentConverter->convert( null, 'TXT', $inputFile, $outputType); -/* */ + $documentConverter = new DocumentConverter(); + $inputFile = "document.docx"; + $outputType = "txt"; + $documentConverter->convert( NULL, 'TXT', $inputFile, $outputType); + /* */ diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index ec6d7ad0..8a524d61 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -1,5 +1,6 @@ item->get_datastream_dissemination('EXIF'); - if (trim($exif) != '') { - $exifDom = DOMDocument::loadXML($this->item->get_datastream_dissemination('EXIF')); - if ($exifDom != NULL) { - $description = $exifDom->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#','Description'); - if ($description->length > 0) { - $description=$description->item(0); - $output .= ''; - - $fieldset = array( - '#title' => t("!text", array('!text' => 'Technical Metadata')), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#value' => $output - ); - $output = theme('fieldset', $fieldset); - } - } - } + + function displayMetadata() { + $output = ''; + $exif = $this->item->get_datastream_dissemination('EXIF'); + if (trim($exif) != '') { + $exifDom = DOMDocument::loadXML($this->item->get_datastream_dissemination('EXIF')); + if ($exifDom != NULL) { + $description = $exifDom->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'Description'); + if ($description->length > 0) { + $description = $description->item(0); + $output .= ''; + + $fieldset = array( + '#title' => t("!text", array('!text' => 'Technical Metadata')), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#value' => $output + ); + $output = theme('fieldset', $fieldset); + } + } + } return $output; } - + } diff --git a/plugins/Ffmpeg.inc b/plugins/Ffmpeg.inc index f2faedac..6013a358 100644 --- a/plugins/Ffmpeg.inc +++ b/plugins/Ffmpeg.inc @@ -1,5 +1,6 @@ '00:00:10', 's' => null); + $defaults = array('ss' => '00:00:10', 's' => NULL); $params = array_merge($defaults, $parameterArray); $system = getenv('System'); - $file_suffix = '_'. $dsid . '.' . $file_ext; - $returnValue=TRUE; - $output=array(); + $file_suffix = '_' . $dsid . '.' . $file_ext; + $returnValue = TRUE; + $output = array(); $size = ''; - if($params['s'] != null) { + if ($params['s'] != NULL) { $size = ' -s ' . escapeshellarg($params['s']); } exec('ffmpeg -i ' . escapeshellarg($file) . ' -r 1 -ss ' . escapeshellarg($params['ss']) . ' ' . $size . ' -t 1 ' . escapeshellarg($file . $file_suffix)); if (!file_exists($file . $file_suffix)) { - return false; + return FALSE; } $_SESSION['fedora_ingest_files']["$dsid"] = $file . $file_suffix; return TRUE; } + } diff --git a/plugins/Flv.inc b/plugins/Flv.inc index 4b16fe7d..80a8f086 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -1,5 +1,6 @@ setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $content->appendChild($oai); //dc elements - $previousElement=NULL; //used in case we have to nest elements for qualified dublin core + $previousElement = NULL; //used in case we have to nest elements for qualified dublin core foreach ($form_values as $key => $value) { $index = strrpos($key, '-'); if ($index > 01) { @@ -42,7 +44,7 @@ class FormBuilder { $test = substr($key, 0, 2); - if ($test=='dc'||$test=='ap') {//don't try to process other form values + if ($test == 'dc' || $test == 'ap') {//don't try to process other form values try { if (!strcmp(substr($key, 0, 4), 'app_')) { $key = substr($key, 4); @@ -52,8 +54,7 @@ class FormBuilder { $previousElement = $dom->createElement($key, $value); $oai->appendChild($previousElement); } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); continue; } @@ -65,7 +66,7 @@ class FormBuilder { function handleQDCForm($form_values) { $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; - $pid=$form_values['pid']; + $pid = $form_values['pid']; $rootElement = $dom->createElement("foxml:digitalObject"); $rootElement->setAttribute('PID', "$pid"); $rootElement->setAttribute('xmlns:foxml', "info:fedora/fedora-system:def/foxml#"); @@ -87,13 +88,13 @@ class FormBuilder { try { $soapHelper = new ConnectionHelper(); - $client=$soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); if ($client == NULL) { drupal_set_message(t('Error getting SOAP client.'), 'error'); return; } - $object=$client->__soapCall('ingest', array($params)); + $object = $client->__soapCall('ingest', array($params)); $deleteFiles = $form_values['delete_file']; //remove files from drupal file system if ($deleteFiles > 0) { @@ -102,8 +103,7 @@ class FormBuilder { } unlink($form_values['fullpath']); } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); return; } @@ -113,9 +113,9 @@ class FormBuilder { module_load_include('inc', 'fedora_repository', 'MimeClass'); $mimetype = new MimeClass(); $server = NULL; - $file=$form_values['ingest-file-location']; + $file = $form_values['ingest-file-location']; $dformat = $mimetype->getType($file); - $fileUrl = 'http://'. $_SERVER['HTTP_HOST'] . $file; + $fileUrl = 'http://' . $_SERVER['HTTP_HOST'] . $file; $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); @@ -123,7 +123,7 @@ class FormBuilder { $ds1->setAttribute("ID", "OBJ"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "OBJ.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -137,16 +137,16 @@ class FormBuilder { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { $createdFile = strstr($createdFile, $file); $dformat = $mimetype->getType($createdFile); - $fileUrl = 'http://'. $_SERVER['HTTP_HOST'] . $createdFile; + $fileUrl = 'http://' . $_SERVER['HTTP_HOST'] . $createdFile; $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); - $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); - $dtitle = $dtitle . '_'. $dsid; + $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); + $dtitle = $dtitle . '_' . $dsid; $ds1 = $dom->createElement("foxml:datastream"); $ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -158,7 +158,7 @@ class FormBuilder { $rootElement->appendChild($ds1); } } - + /** * creates the RELS-EXT for the foxml */ @@ -190,14 +190,13 @@ class FormBuilder { $rdf->appendChild($rdfdesc); $rdfdesc->appendChild($member); $rootElement->appendChild($drdf); - } - + /** * creates the standard foxml properties */ function createStandardFedoraStuff($form_values, &$dom, &$rootElement) { - /*foxml object properties section */ + /* foxml object properties section */ $objproperties = $dom->createElement("foxml:objectProperties"); $prop1 = $dom->createElement("foxml:property"); $prop1->setAttribute("NAME", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); @@ -222,11 +221,10 @@ class FormBuilder { $rootElement->appendChild($objproperties); } - function buildQDCForm(&$form, $ingest_form_definition, &$form_values) { $form['indicator2'] = array( - '#type' => 'fieldset', - '#title' => t('Ingest Digital Object Step #2') + '#type' => 'fieldset', + '#title' => t('Ingest Digital Object Step #2') ); foreach ($ingest_form_definition->form_elements->element as $element) { $name = strip_tags($element->name->asXML()); @@ -234,7 +232,7 @@ class FormBuilder { $required = strip_tags($element->required->asXML()); $required = strtolower($required); if ($required != 'TRUE') { - $required='0'; + $required = '0'; } $description = strip_tags($element->description->asXML()); @@ -247,20 +245,19 @@ class FormBuilder { $options["$field"] = $value; } $form['indicator2']["$name"] = array( - '#title' => $title, - '#required' => $required, - '#description' => $description, - '#type' => $type, - '#options' => $options, + '#title' => $title, + '#required' => $required, + '#description' => $description, + '#type' => $type, + '#options' => $options, ); - } else { $form['indicator2']["$name"] = array( - '#title' => $title, - '#required' => $required, - '#description' => $description, - '#type' => $type + '#title' => $title, + '#required' => $required, + '#description' => $description, + '#type' => $type ); } } diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index 37b0e0d2..eee6eec3 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -1,5 +1,6 @@ getType($file); //$fileUrl = 'http://'.$_SERVER['HTTP_HOST'].$file; - $fileUrl = $base_url .'/'. drupal_urlencode($file); + $fileUrl = $base_url . '/' . drupal_urlencode($file); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); @@ -32,7 +36,7 @@ class FlvFormBuilder extends FormBuilder { $ds1->setAttribute("ID", "FLV"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "FLV.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -44,7 +48,7 @@ class FlvFormBuilder extends FormBuilder { $rootElement->appendChild($ds1); $createdFile = drupal_get_path('module', 'Fedora_Repository') . '/images/flashThumb.jpg'; - $fileUrl = $base_url .'/'. drupal_urlencode($createdFile); //'http://'.$_SERVER['HTTP_HOST'].'/'.$createdFile; + $fileUrl = $base_url . '/' . drupal_urlencode($createdFile); //'http://'.$_SERVER['HTTP_HOST'].'/'.$createdFile; $ds1 = $dom->createElement("foxml:datastream"); $ds1->setAttribute("ID", "TN"); $ds1->setAttribute("STATE", "A"); @@ -60,5 +64,6 @@ class FlvFormBuilder extends FormBuilder { $ds1v->appendChild($ds1content); $rootElement->appendChild($ds1); } + } diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 4fd3fa7d..990416d4 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -1,6 +1,6 @@ setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $content->appendChild($oai); //dc elements - $previousElement=NULL;//used in case we have to nest elements for qualified dublin core + $previousElement = NULL; //used in case we have to nest elements for qualified dublin core foreach ($form_values as $key => $value) { $key = str_replace('_', ':', $key); $index = strrpos($key, '-'); @@ -55,15 +56,13 @@ class FormBuilder { $previousElement = $dom->createElement($key, $value); $oai->appendChild($previousElement); } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); continue; } } $rootElement->appendChild($datastream); } - } //create the security Policy @@ -78,8 +77,7 @@ class FormBuilder { } try { $xml = new SimpleXMLElement($policyStreamDoc); - } - catch (Exception $e) { + } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); drupal_set_message(t('Problem getting security policy: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; @@ -91,7 +89,7 @@ class FormBuilder { return FALSE; } $dom->importNode($policyElement, TRUE); - $value=$policyElement->appendXML($policyStreamDoc); + $value = $policyElement->appendXML($policyStreamDoc); if (!$value) { drupal_set_message(t('Error creating security policy stream.')); watchdog(t("Fedora_Repository"), t("Error creating security policy stream, could not parse collection policy template file."), NULL, WATCHDOG_NOTICE); @@ -114,14 +112,13 @@ class FormBuilder { return TRUE; } - function handleQDCForm($form_values) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - + $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; - $pid=$form_values['pid']; + $pid = $form_values['pid']; $rootElement = $dom->createElement("foxml:digitalObject"); $rootElement->setAttribute('VERSION', '1.1'); $rootElement->setAttribute('PID', "$pid"); @@ -134,13 +131,13 @@ class FormBuilder { // Create relationships $this->createRelationShips($form_values, $dom, $rootElement); $collectionPid = $form_values['collection_pid']; - + if (($cp = CollectionPolicy::LoadFromCollection($collectionPid)) !== FALSE) { - $collectionName = trim($cp->getName()); + $collectionName = trim($cp->getName()); if (trim($collectionName) != '') { $form_values['dc_relation'] = $collectionName; } - } + } // Create dublin core $this->createQDCStream($form_values, $dom, $rootElement); @@ -150,20 +147,19 @@ class FormBuilder { $this->createPolicy($collectionPid, &$dom, &$rootElement); try { - + $object = Fedora_Item::ingest_from_FOXML($dom); if (!empty($object->pid)) { // drupal_set_message("Item ". l($object->pid, 'fedora/repository/'. $object->pid) . " created successfully.", "status"); - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/'. $object->pid))), "status"); + drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/' . $object->pid))), "status"); } - if (!empty( $_SESSION['fedora_ingest_files'])) { + if (!empty($_SESSION['fedora_ingest_files'])) { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { file_delete($createdFile); } } file_delete($form_values['ingest-file-location']); - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); watchdog(t("Fedora_Repository"), t("Error ingesting object: !e", array('!e' => $e->getMessage())), NULL, WATCHDOG_ERROR); return; @@ -174,19 +170,19 @@ class FormBuilder { module_load_include('inc', 'fedora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); - $server=NULL; - $file=$form_values['ingest-file-location']; + $server = NULL; + $file = $form_values['ingest-file-location']; - if (!empty( $file)) { + if (!empty($file)) { $dformat = $mimetype->getType($file); - + $parts = explode('/', $file); foreach ($parts as $n => $part) { $parts[$n] = rawurlencode($part); } $path = implode('/', $parts); $fileUrl = $base_url . '/' . $path; - + $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -194,7 +190,7 @@ class FormBuilder { $ds1->setAttribute("ID", "OBJ"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $rootElement->appendChild($ds1); $ds1v->setAttribute("ID", "OBJ.0"); @@ -207,27 +203,27 @@ class FormBuilder { $ds1v->appendChild($ds1content); } if (!empty($_SESSION['fedora_ingest_files'])) { - - - + + + foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { - - - if (!empty($file)) { - $found = strstr($createdFile, $file); - if ($found !== FALSE) { - $createdFile = $found; - } - } + + + if (!empty($file)) { + $found = strstr($createdFile, $file); + if ($found !== FALSE) { + $createdFile = $found; + } + } $dformat = $mimetype->getType($createdFile); - $parts = explode('/', $createdFile); + $parts = explode('/', $createdFile); foreach ($parts as $n => $part) { $parts[$n] = rawurlencode($part); } $path = implode('/', $parts); $fileUrl = $base_url . '/' . $path; - + $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -236,7 +232,7 @@ class FormBuilder { $ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -250,7 +246,6 @@ class FormBuilder { } } - /** * Creates the RELS-EXT for the foxml */ @@ -278,11 +273,11 @@ class FormBuilder { if (!isset($relationship)) { $relationship = 'isMemberOfCollection'; } - $member = $dom->createElement("fedora:". $relationship); + $member = $dom->createElement("fedora:" . $relationship); $membr = $form_values['collection_pid']; $member->setAttribute("rdf:resource", "info:fedora/$membr"); $rdfHasModel = $dom->createElement("fedora-model:hasModel"); - $contentModelPid=$form_values['content_model_pid']; + $contentModelPid = $form_values['content_model_pid']; $rdfHasModel->setAttribute("rdf:resource", "info:fedora/$contentModelPid"); $drdf->appendChild($dvrdf); $dvrdf->appendChild($dvcontent); @@ -293,7 +288,6 @@ class FormBuilder { $rootElement->appendChild($drdf); } - /** * Creates the standard foxml properties */ @@ -315,57 +309,59 @@ class FormBuilder { $rootElement->appendChild($objproperties); } - function buildQDCForm(&$form, $elements, &$form_values) { $form['#multistep'] = TRUE; // used so that it triggers a form rebuild every time. $form['indicator2'] = array( '#type' => 'fieldset', '#title' => t('Ingest digital object step #2'), ); - + foreach ($elements as $element) { - - if ($element['type'] == 'markup') { - $el = array('#value'=> $element['description']); - } else { - $el = array( - '#title' => $element['label'], - '#required' => ($element['required'] ? 1 : 0), - '#description' => $element['description'], - '#type' => $element['type'] - ); - } - $name = explode('][', $element['name']); - $elLocation = &$form['indicator2']; - while (isset($elLocation[$name[0]]) && ($partial = array_shift($name)) != NULL) { - $elLocation = &$elLocation[$partial]; - } - - $autocomplete_path = FALSE; - $autocomplete_omit_collection = FALSE; + if ($element['type'] == 'markup') { + $el = array('#value' => $element['description']); + } + else { + $el = array( + '#title' => $element['label'], + '#required' => ($element['required'] ? 1 : 0), + '#description' => $element['description'], + '#type' => $element['type'] + ); + } + + $name = explode('][', $element['name']); + $elLocation = &$form['indicator2']; + while (isset($elLocation[$name[0]]) && ($partial = array_shift($name)) != NULL) { + $elLocation = &$elLocation[$partial]; + } + + $autocomplete_path = FALSE; + $autocomplete_omit_collection = FALSE; foreach ($element['parameters'] as $key => $val) { if ($key == '#autocomplete_path') { - $autocomplete_path = $val; - } elseif ($key == '#autocomplete_omit_collection') { - $autocomplete_omit_collection = TRUE; - } else { - $el[$key]=$val; - } + $autocomplete_path = $val; + } + elseif ($key == '#autocomplete_omit_collection') { + $autocomplete_omit_collection = TRUE; + } + else { + $el[$key] = $val; + } } - if ($autocomplete_path !== FALSE) { - $el['#autocomplete_path'] = $autocomplete_path . (!$autocomplete_omit_collection?'/'.$form_values['storage']['collection_pid']:'/'); - } + if ($autocomplete_path !== FALSE) { + $el['#autocomplete_path'] = $autocomplete_path . (!$autocomplete_omit_collection ? '/' . $form_values['storage']['collection_pid'] : '/'); + } if ($element['type'] == 'select' || $element['type'] == 'other_select') { - $el['#options']= isset($element['authoritative_list'])?$element['authoritative_list']:array(); + $el['#options'] = isset($element['authoritative_list']) ? $element['authoritative_list'] : array(); } - + $elLocation[join('][', $name)] = $el; } - + return $form; } - + } diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 9971c367..4e3b65cb 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -1,6 +1,6 @@ &1 &', $output, $returnValue); + exec('convert -resize ' . $width . 'x' . $height . ' -quality 85 "' . $file . '"[0] -strip "' . $destFile . '" 2>&1 &', $output, $returnValue); } else $returnValue = '0'; diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index 6eb36d1b..c0cca9a1 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -1,245 +1,243 @@ pid=$pid; - $this->cm = ContentModel::loadFromObject($pid); - $this->item = new fedora_item($pid); - } - } - - function handleEditMetadataForm(&$form_id, &$form_values, &$soap_client) - { + protected $pid; + + function __construct($pid=NULL) { + parent::__construct(); + if ($pid !== NULL) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + + $this->pid = $pid; + $this->cm = ContentModel::loadFromObject($pid); + $this->item = new fedora_item($pid); + } + } + + function handleEditMetadataForm(&$form_id, &$form_values, &$soap_client) { $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; - $mods = $this->modsFromForm($form_values,$dom); + $mods = $this->modsFromForm($form_values, $dom); $dom->appendChild($mods); - + if ($this->item->modify_datastream_by_value($dom->saveXML(), 'MODS', "MODS Record", 'text/xml') !== NULL) { - drupal_set_message(t('Successfully updated MODS datastream for object %pid', array('%pid'=>$this->pid))); - } - drupal_goto('/fedora/repository/'.$this->pid); - } - - function buildEditMetadataForm() - { - $form['#multistep'] = TRUE; // used so that it triggers a form rebuild every time. - $form['indicator2'] = array( - '#type' => 'fieldset', - '#title' => t('Edit metadata'), - ); - + drupal_set_message(t('Successfully updated MODS datastream for object %pid', array('%pid' => $this->pid))); + } + drupal_goto('/fedora/repository/' . $this->pid); + } + + function buildEditMetadataForm() { + $form['#multistep'] = TRUE; // used so that it triggers a form rebuild every time. + $form['indicator2'] = array( + '#type' => 'fieldset', + '#title' => t('Edit metadata'), + ); + if ($this->cm !== FALSE && $this->item != NULL) { - $form['pid'] = array('#type'=>'hidden','#value'=>$this->pid); - + $form['pid'] = array('#type' => 'hidden', '#value' => $this->pid); + $elements = $this->cm->getIngestFormElements(); - $content = $this->item->get_datastream_dissemination('MODS'); - - if (trim($content) != '') { - $dom = DOMDocument::loadXML($content); - $xpath = new DOMXPath($dom); - // Register the php: namespace (required) - $xpath->registerNamespace("php", "http://php.net/xpath"); - - // Register PHP functions (no restrictions) - $xpath->registerPHPFunctions(); - - foreach ($elements as $element) { - - $el = array( - '#title' => $element['label'], - '#required' => ($element['required'] ? 1 : 0), - '#description' => $element['description'], - '#type' => $element['type'] - ); - - $includeEl = true; - $elname = explode('][', $element['name']); - $elLocation = &$form['indicator2']; - while (isset($elLocation[$name[0]]) && ($partial = array_shift($elname)) != NULL) { - $elLocation = &$elLocation[$partial]; - } - - foreach ($element['parameters'] as $key => $val) { - switch ($key) { - case '#autocomplete_path': - $val .= '/'. $form_values['storage']['collection_pid']; - break; - - case '#exclude_from_edit_metadata': - $includeEl=FALSE; - break; - - - case '#edit_metadata_xpath': - $nodeList = $xpath->evaluate($val); + $content = $this->item->get_datastream_dissemination('MODS'); + + if (trim($content) != '') { + $dom = DOMDocument::loadXML($content); + $xpath = new DOMXPath($dom); + // Register the php: namespace (required) + $xpath->registerNamespace("php", "http://php.net/xpath"); + + // Register PHP functions (no restrictions) + $xpath->registerPHPFunctions(); + + foreach ($elements as $element) { + + $el = array( + '#title' => $element['label'], + '#required' => ($element['required'] ? 1 : 0), + '#description' => $element['description'], + '#type' => $element['type'] + ); + + $includeEl = TRUE; + $elname = explode('][', $element['name']); + $elLocation = &$form['indicator2']; + while (isset($elLocation[$name[0]]) && ($partial = array_shift($elname)) != NULL) { + $elLocation = &$elLocation[$partial]; + } + + foreach ($element['parameters'] as $key => $val) { + switch ($key) { + case '#autocomplete_path': + $val .= '/' . $form_values['storage']['collection_pid']; + break; + + case '#exclude_from_edit_metadata': + $includeEl = FALSE; + break; + + + case '#edit_metadata_xpath': + $nodeList = $xpath->evaluate($val); // echo $val. ' '.$nodeList->length.' '; // echo $nodeList->item(0)->nodeValue.' '; // echo '
      '; - if (is_string($nodeList)) - { - $el['#default_value']=$nodeList; - } else if ($nodeList->length > 1) - { - $el['#default_value'] = array(); - foreach ($nodeList as $node) - { - $el['#default_value'][] = $node->nodeValue; - } - } else if ($nodeList->length > 0) - { - if ($el['#type'] == 'list') { - $values=array(); - for ($i=0;$i<$nodeList->length;$i++) { - $values[]=$nodeList->item($i)->nodeValue; - } - $el['#default_value']=join('; ',$values); - } else { - $el['#default_value'] = $nodeList->item(0)->nodeValue; - } - } - break; - } - - if ($key != '#sticky') { - $el[$key]=$val; - } - - } - - if ($element['type'] == 'people') - { - - $names = $xpath->evaluate('/mods:mods/mods:name'); - $people=array(); - foreach ($names as $mname) { - - $type = $mname->getAttribute('type'); - $role = $mname->getElementsByTagName('roleTerm')->item(0)->nodeValue; - - $nameParts = $mname->getElementsByTagName('namePart'); - foreach ($nameParts as $namePart) - { - switch ($namePart->getAttribute('type')) { - case 'given': $given = $namePart->nodeValue; break; - case 'family': $family = $namePart->nodeValue; break; - case 'termsOfAddress': $title = $namePart->nodeValue; break; - case 'date': $date = $namePart->nodeValue; break; - default: $name = $namePart->nodeValue; break; + if (is_string($nodeList)) { + $el['#default_value'] = $nodeList; + } + elseif ($nodeList->length > 1) { + $el['#default_value'] = array(); + foreach ($nodeList as $node) { + $el['#default_value'][] = $node->nodeValue; + } + } + elseif ($nodeList->length > 0) { + if ($el['#type'] == 'list') { + $values = array(); + for ($i = 0; $i < $nodeList->length; $i++) { + $values[] = $nodeList->item($i)->nodeValue; + } + $el['#default_value'] = join('; ', $values); + } + else { + $el['#default_value'] = $nodeList->item(0)->nodeValue; + } + } + break; + } + + if ($key != '#sticky') { + $el[$key] = $val; + } } - } - - $person=array('role'=>$role); - switch ($type) - { - case 'personal': - if (isset($given) && isset($family) && !isset($name)) { - $name = (isset($title)?$title.' ':'').$family.', '.$family; - } - $person['name']=$name; - $person['date']=$date; - break; - case 'organization': - $person['organization'] = $name; - break; - case 'conference': - $person['conference']=$name; - $person['date']=$date; - break; - } - $people[]=$person; - } - - $names = $xpath->evaluate('/mods:mods/mods:subject/mods:name'); - foreach ($names as $mname) { - - $type = $mname->getAttribute('type'); - - $nameParts = $mname->getElementsByTagName('namePart'); - foreach ($nameParts as $namePart) - { - switch ($namePart->getAttribute('type')) { - case 'given': $given = $namePart->nodeValue; break; - case 'family': $family = $namePart->nodeValue; break; - case 'termsOfAddress': $title = $namePart->nodeValue; break; - case 'date': $date = $namePart->nodeValue; break; - default: $name = $namePart->nodeValue; break; - } - } - - $person=array('subject'=>1); - switch ($type) - { - case 'personal': - if (isset($given) && isset($family) && !isset($name)) { - $name = (isset($title)?$title.' ':'').$family.', '.$family; - } - $person['name']=$name; - $person['date']=$date; - break; - case 'organization': - $person['organization'] = $name; - break; - case 'conference': - $person['conference']=$name; - $person['date']=$date; - break; - } - $people[]=$person; - } - - $el['#default_value'] = $people; - - } - - - if ($element['type'] == 'select' || $element['type'] == 'other_select') { - $el['#options']= isset($element['authoritative_list'])?$element['authoritative_list']:array(); - } - - if ($includeEl) { - $elLocation[join('][', $elname)] = $el; - } - } - - $form['submit'] = array( - '#type' => 'submit', - '#submit' => array('fedora_repository_edit_qdc_form_submit'), - '#value' => 'Save Metadata' - ); - - return $form; + if ($element['type'] == 'people') { + + $names = $xpath->evaluate('/mods:mods/mods:name'); + $people = array(); + foreach ($names as $mname) { + + $type = $mname->getAttribute('type'); + $role = $mname->getElementsByTagName('roleTerm')->item(0)->nodeValue; + + $nameParts = $mname->getElementsByTagName('namePart'); + foreach ($nameParts as $namePart) { + switch ($namePart->getAttribute('type')) { + case 'given': $given = $namePart->nodeValue; + break; + case 'family': $family = $namePart->nodeValue; + break; + case 'termsOfAddress': $title = $namePart->nodeValue; + break; + case 'date': $date = $namePart->nodeValue; + break; + default: $name = $namePart->nodeValue; + break; + } + } + + $person = array('role' => $role); + switch ($type) { + case 'personal': + if (isset($given) && isset($family) && !isset($name)) { + $name = (isset($title) ? $title . ' ' : '') . $family . ', ' . $family; + } + $person['name'] = $name; + $person['date'] = $date; + break; + case 'organization': + $person['organization'] = $name; + break; + case 'conference': + $person['conference'] = $name; + $person['date'] = $date; + break; + } + $people[] = $person; + } + + $names = $xpath->evaluate('/mods:mods/mods:subject/mods:name'); + foreach ($names as $mname) { + + $type = $mname->getAttribute('type'); + + $nameParts = $mname->getElementsByTagName('namePart'); + foreach ($nameParts as $namePart) { + switch ($namePart->getAttribute('type')) { + case 'given': $given = $namePart->nodeValue; + break; + case 'family': $family = $namePart->nodeValue; + break; + case 'termsOfAddress': $title = $namePart->nodeValue; + break; + case 'date': $date = $namePart->nodeValue; + break; + default: $name = $namePart->nodeValue; + break; + } + } + + $person = array('subject' => 1); + switch ($type) { + case 'personal': + if (isset($given) && isset($family) && !isset($name)) { + $name = (isset($title) ? $title . ' ' : '') . $family . ', ' . $family; + } + $person['name'] = $name; + $person['date'] = $date; + break; + case 'organization': + $person['organization'] = $name; + break; + case 'conference': + $person['conference'] = $name; + $person['date'] = $date; + break; + } + $people[] = $person; + } + + $el['#default_value'] = $people; + } + + + if ($element['type'] == 'select' || $element['type'] == 'other_select') { + $el['#options'] = isset($element['authoritative_list']) ? $element['authoritative_list'] : array(); + } + + if ($includeEl) { + $elLocation[join('][', $elname)] = $el; + } + } + + $form['submit'] = array( + '#type' => 'submit', + '#submit' => array('fedora_repository_edit_qdc_form_submit'), + '#value' => 'Save Metadata' + ); + + return $form; } } - - } - - function handleModsForm(&$form_values,&$form_state) { + } + + function handleModsForm(&$form_values, &$form_state) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - - $form_state['storage']['people']=NULL; //clears out old entities for the next run of the formbuilder. - + + $form_state['storage']['people'] = NULL; //clears out old entities for the next run of the formbuilder. + $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; - $pid=$form_values['pid']; + $pid = $form_values['pid']; $rootElement = $dom->createElement("foxml:digitalObject"); $rootElement->setAttribute('VERSION', '1.1'); $rootElement->setAttribute('PID', "$pid"); @@ -247,24 +245,24 @@ class ModsFormBuilder extends FormBuilder { $rootElement->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $rootElement->setAttribute('xsi:schemaLocation', "info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"); $dom->appendChild($rootElement); - + // Create standard fedora stuff $form_values['dc:title'] = $form_values['mods_title']; $this->createStandardFedoraStuff($form_values, $dom, $rootElement); - + // Create relationships $this->createRelationShips($form_values, $dom, $rootElement); $collectionPid = $form_values['collection_pid']; - + if (($cp = CollectionPolicy::LoadFromCollection($collectionPid)) !== FALSE) { - $collectionName =trim($cp->getName()); - if (trim($collectionName)!='') { - $form_values['dc_relation']=$collectionName; + $collectionName = trim($cp->getName()); + if (trim($collectionName) != '') { + $form_values['dc_relation'] = $collectionName; } - } + } // Create MODS $this->createModsStream($form_values, $dom, $rootElement); - $this->createCollectionPolicy($form_values, $dom, $rootElement); + $this->createCollectionPolicy($form_values, $dom, $rootElement); $this->createWorkflowStream($form_values, $dom, $rootElement); if (!empty($form_values['ingest-file-location'])) { @@ -274,33 +272,31 @@ class ModsFormBuilder extends FormBuilder { // header('Content-type: application/xml'); // echo $dom->saveXML(); exit(); - + try { - $object = Fedora_Item::ingest_from_FOXML($dom); - //for some reason, ingest_from_FOXML does not generate a JMS message - //I just modify the workflow DS and it sends a JMS message. - $item = new Fedora_Item($object->pid); - $item->modify_datastream_by_value( $item->get_datastream_dissemination('WORKFLOW'), 'WORKFLOW', "Workflow Record", 'text/xml'); - - if (!empty($object->pid)) { - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/'. $object->pid))), "status"); - } - if (!empty( $_SESSION['fedora_ingest_files'])) { - foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { - file_delete($createdFile); - } - } - file_delete($form_values['ingest-file-location']); - } - catch (exception $e) { + $object = Fedora_Item::ingest_from_FOXML($dom); + //for some reason, ingest_from_FOXML does not generate a JMS message + //I just modify the workflow DS and it sends a JMS message. + $item = new Fedora_Item($object->pid); + $item->modify_datastream_by_value($item->get_datastream_dissemination('WORKFLOW'), 'WORKFLOW', "Workflow Record", 'text/xml'); + + if (!empty($object->pid)) { + drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/' . $object->pid))), "status"); + } + if (!empty($_SESSION['fedora_ingest_files'])) { + foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { + file_delete($createdFile); + } + } + file_delete($form_values['ingest-file-location']); + } catch (exception $e) { drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); watchdog(t("Fedora_Repository"), t("Error ingesting object: !e", array('!e' => $e->getMessage())), NULL, WATCHDOG_ERROR); return; } - } - - - function createCollectionPolicy($form_values, &$dom, &$rootElement) { + } + + function createCollectionPolicy($form_values, &$dom, &$rootElement) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $model = new fedora_item($form_values['content_model_pid']); $ds_list = $model->get_datastreams_list_as_array(); @@ -308,10 +304,10 @@ class ModsFormBuilder extends FormBuilder { $cp = $model->get_datastream_dissemination('COLLECTION_POLICY_TMPL'); $cpDom = DOMDocument::loadXML($cp); $cpRootEl = $cpDom->getElementsByTagName('collection_policy'); - if ($cpRootEl->length >0) { - $cpRootEl=$cpRootEl->item(0); + if ($cpRootEl->length > 0) { + $cpRootEl = $cpRootEl->item(0); $newNode = $dom->importNode($cpRootEl, TRUE); - + $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "COLLECTION_POLICY"); $datastream->setAttribute("STATE", "A"); @@ -328,7 +324,7 @@ class ModsFormBuilder extends FormBuilder { } } } - + function createWorkflowStream($form_values, &$dom, &$rootElement) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $model = new fedora_item($form_values['content_model_pid']); @@ -337,10 +333,10 @@ class ModsFormBuilder extends FormBuilder { $workflow = $model->get_datastream_dissemination('WORKFLOW_TMPL'); $workflowDom = DOMDocument::loadXML($workflow); $workflowRootEl = $workflowDom->getElementsByTagName('workflow'); - if ($workflowRootEl->length >0) { - $workflowRootEl=$workflowRootEl->item(0); + if ($workflowRootEl->length > 0) { + $workflowRootEl = $workflowRootEl->item(0); $newNode = $dom->importNode($workflowRootEl, TRUE); - + $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "WORKFLOW"); $datastream->setAttribute("STATE", "A"); @@ -357,9 +353,9 @@ class ModsFormBuilder extends FormBuilder { } } } - + function createModsStream($form_values, &$dom, &$rootElement) { - + $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "MODS"); $datastream->setAttribute("STATE", "A"); @@ -371,63 +367,61 @@ class ModsFormBuilder extends FormBuilder { $datastream->appendChild($version); $content = $dom->createElement("foxml:xmlContent"); $version->appendChild($content); - - $mods = $this->modsFromForm($form_values,$dom); + + $mods = $this->modsFromForm($form_values, $dom); $content->appendChild($mods); - - $rootElement->appendChild($datastream); - } + $rootElement->appendChild($datastream); + } - function modsFromForm(&$form_values,&$dom) - { + function modsFromForm(&$form_values, &$dom) { - ///begin writing MODS + ///begin writing MODS $mods = $dom->createElement("mods:mods"); $mods->setAttribute('version', '3.4'); $mods->setAttribute('xmlns:xlink', "http://www.w3.org/1999/xlink"); $mods->setAttribute('xmlns:mods', "http://www.loc.gov/mods/v3"); $mods->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $mods->setAttribute('xsi:schemaLocation', "http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd"); - - + + if (isset($form_values['mods_title']) && trim($form_values['mods_title']) != '') { $titleinfo = $dom->createElement('mods:titleInfo'); - $title = $dom->createElement('mods:title', htmlspecialchars($form_values['mods_title'])); + $title = $dom->createElement('mods:title', htmlspecialchars($form_values['mods_title'])); $titleinfo->appendChild($title); $mods->appendChild($titleinfo); } - - if (isset($form_values['mods_alternative_titles']) && trim($form_values['mods_alternative_titles']) != '') { - $titles=preg_split('/\s+\;\s+/',trim($form_values['mods_alternative_titles'])); + + if (isset($form_values['mods_alternative_titles']) && trim($form_values['mods_alternative_titles']) != '') { + $titles = preg_split('/\s+\;\s+/', trim($form_values['mods_alternative_titles'])); foreach ($titles as $t) { - $titleinfo = $dom->createElement('mods:titleInfo'); - $titleinfo->setAttribute('type','alternative') ; - $title = $dom->createElement('mods:title',$t); - $titleinfo->appendChild($title); - $mods->appendChild($titleinfo); + $titleinfo = $dom->createElement('mods:titleInfo'); + $titleinfo->setAttribute('type', 'alternative'); + $title = $dom->createElement('mods:title', $t); + $titleinfo->appendChild($title); + $mods->appendChild($titleinfo); } } - - if (isset($form_values['mods_alternative_title']) && trim($form_values['mods_alternative_title']) != '') { - $titleinfo = $dom->createElement('mods:titleInfo'); - $titleinfo->setAttribute('type','alternative') ; - $title = $dom->createElement('mods:title',trim($form_values['mods_alternative_title'])); - $titleinfo->appendChild($title); - $mods->appendChild($titleinfo); - } - + + if (isset($form_values['mods_alternative_title']) && trim($form_values['mods_alternative_title']) != '') { + $titleinfo = $dom->createElement('mods:titleInfo'); + $titleinfo->setAttribute('type', 'alternative'); + $title = $dom->createElement('mods:title', trim($form_values['mods_alternative_title'])); + $titleinfo->appendChild($title); + $mods->appendChild($titleinfo); + } + if (isset($form_values['mods_description']) && trim($form_values['mods_description']) != '') { - $abstract = $dom->createElement('mods:abstract', htmlspecialchars(trim($form_values['mods_description']))); - $mods->appendChild($abstract); + $abstract = $dom->createElement('mods:abstract', htmlspecialchars(trim($form_values['mods_description']))); + $mods->appendChild($abstract); } - + if (isset($form_values['pid']) && trim($form_values['pid']) != '') { - $identifier = $dom->createElement('mods:identifier', htmlspecialchars(trim(preg_replace('/\:/','\/',$form_values['pid'])))); + $identifier = $dom->createElement('mods:identifier', htmlspecialchars(trim(preg_replace('/\:/', '\/', $form_values['pid'])))); $identifier->setAttribute('type', 'hdl'); $mods->appendChild($identifier); } - + if (isset($form_values['collection_pid']) && trim($form_values['collection_pid']) != '') { $relatedItem = $dom->createElement('mods:relatedItem'); $relatedItem->setAttribute('type', 'isMemberOfCollection'); @@ -435,13 +429,13 @@ class ModsFormBuilder extends FormBuilder { $relatedItem->appendChild($identifier); $mods->appendChild($relatedItem); } - + if (isset($form_values['mods_identifier']) && trim($form_values['mods_identifier']) != '') { $identifier = $dom->createElement('mods:identifier', htmlspecialchars(trim($form_values['mods_identifier']))); $identifier->setAttribute('type', 'local'); $mods->appendChild($identifier); } - + if (isset($form_values['mods_physicalLocation']) && trim($form_values['mods_physicalLocation']) != '') { $location = $dom->createElement('mods:location'); $physLocation = $dom->createElement('mods:physicalLocation', htmlspecialchars(trim($form_values['mods_physicalLocation']))); @@ -452,154 +446,152 @@ class ModsFormBuilder extends FormBuilder { } $mods->appendChild($location); } - + $originInfo = $dom->createElement('mods:originInfo'); $addOriginInfo = FALSE; if (isset($form_values['mods_pubinfo_place']) && trim($form_values['mods_pubinfo_place']) != '') { $place = $dom->createElement('mods:place'); - $placeTerm=$dom->createElement('mods:placeTerm', htmlspecialchars(trim($form_values['mods_pubinfo_place']))); + $placeTerm = $dom->createElement('mods:placeTerm', htmlspecialchars(trim($form_values['mods_pubinfo_place']))); $placeTerm->setAttribute('type', 'text'); $place->appendChild($placeTerm); $originInfo->appendChild($place); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_pubinfo_publisher']) && trim($form_values['mods_pubinfo_publisher']) != '') { $publisher = $dom->createElement('mods:publisher', htmlspecialchars(trim($form_values['mods_pubinfo_publisher']))); $originInfo->appendChild($publisher); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_pubinfo_edition']) && trim($form_values['mods_pubinfo_edition']) != '') { $edition = $dom->createElement('mods:edition', htmlspecialchars(trim($form_values['mods_pubinfo_edition']))); $originInfo->appendChild($edition); $addOriginInfo = TRUE; } - - + + if (isset($form_values['mods_pubinfo_date']) && trim($form_values['mods_pubinfo_date']) != '' && - isset($form_values['mods_pubinfo_dateType']) && trim($form_values['mods_pubinfo_dateType']) != '') { - if (in_array($form_values['mods_pubinfo_dateType'], array('issued', 'created', 'copyright', 'captured'))) { - $date = $dom->createElement('mods:'. trim($form_values['mods_pubinfo_dateType']) .'Date', htmlspecialchars(trim($form_values['mods_pubinfo_date']))); - } - else { - //how to handle other types? otherDate? - $date= $dom->createElement('mods:otherDate', htmlspecialchars(trim($form_values['mods_pubinfo_date']))); - $date->setAttribute('type', htmlspecialchars(trim($form_values['mods_pubinfo_dateType']))); - } - $originInfo->appendChild($date); - $addOriginInfo = TRUE; - } else { + isset($form_values['mods_pubinfo_dateType']) && trim($form_values['mods_pubinfo_dateType']) != '') { + if (in_array($form_values['mods_pubinfo_dateType'], array('issued', 'created', 'copyright', 'captured'))) { + $date = $dom->createElement('mods:' . trim($form_values['mods_pubinfo_dateType']) . 'Date', htmlspecialchars(trim($form_values['mods_pubinfo_date']))); + } + else { + //how to handle other types? otherDate? + $date = $dom->createElement('mods:otherDate', htmlspecialchars(trim($form_values['mods_pubinfo_date']))); + $date->setAttribute('type', htmlspecialchars(trim($form_values['mods_pubinfo_dateType']))); + } + $originInfo->appendChild($date); + $addOriginInfo = TRUE; + } + else { if (isset($form_values['mods_createdDate'])) { - $date = $dom->createElement('mods:createdDate',htmlspecialchars(trim($form_values['mods_createdDate']))); - $originInfo->appendChild($date); + $date = $dom->createElement('mods:createdDate', htmlspecialchars(trim($form_values['mods_createdDate']))); + $originInfo->appendChild($date); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_issuedDate'])) { - $date = $dom->createElement('mods:issuedDate',htmlspecialchars(trim($form_values['mods_issuedDate']))); - $originInfo->appendChild($date); + $date = $dom->createElement('mods:issuedDate', htmlspecialchars(trim($form_values['mods_issuedDate']))); + $originInfo->appendChild($date); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_copyrightDate'])) { - $date = $dom->createElement('mods:copyrightDate',htmlspecialchars(trim($form_values['mods_copyrightDate']))); - $originInfo->appendChild($date); + $date = $dom->createElement('mods:copyrightDate', htmlspecialchars(trim($form_values['mods_copyrightDate']))); + $originInfo->appendChild($date); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_capturedDate'])) { - $date = $dom->createElement('mods:capturedDate',htmlspecialchars(trim($form_values['mods_capturedDate']))); - $originInfo->appendChild($date); + $date = $dom->createElement('mods:capturedDate', htmlspecialchars(trim($form_values['mods_capturedDate']))); + $originInfo->appendChild($date); $addOriginInfo = TRUE; } - } - + if (isset($form_values['mods_pubinfo_journalFreq']) && trim($form_values['mods_pubinfo_journalFreq']) != '') { $frequency = $dom->createElement('mods:frequency', htmlspecialchars(trim($form_values['mods_pubinfo_journalFreq']))); $originInfo->appendChild($frequency); - $issuance= $dom->createElement('mods:issuance', 'journal'); + $issuance = $dom->createElement('mods:issuance', 'journal'); $originInfo->appendChild($issuance); $addOriginInfo = TRUE; - } + } elseif (isset($form_values['mods_pubinfo_journalFreq'])) { - $issuance= $dom->createElement('mods:issuance', 'monographic'); + $issuance = $dom->createElement('mods:issuance', 'monographic'); $originInfo->appendChild($issuance); } - - + + if ($addOriginInfo) { $mods->appendChild($originInfo); } - + if (isset($form_values['mods_note']) && trim($form_values['mods_note']) != '') { $note = $dom->createElement('mods:note', htmlspecialchars(trim($form_values['mods_note']))); $mods->appendChild($note); - } - + } + if (isset($form_values['mods_caption']) && trim($form_values['mods_caption']) != '') { $note = $dom->createElement('mods:note', htmlspecialchars(trim($form_values['mods_caption']))); - $note->setAttribute('type','caption'); + $note->setAttribute('type', 'caption'); $mods->appendChild($note); - } - + } + if (isset($form_values['mods_format']) && trim($form_values['mods_format']) != '') { $typeOfResource = $dom->createElement('mods:typeOfResource', htmlspecialchars($form_values['mods_format'])); $mods->appendChild($typeOfResource); } - - - if (isset($form_values['mods_language']) && trim($form_values['mods_language']) != '') - { + + + if (isset($form_values['mods_language']) && trim($form_values['mods_language']) != '') { $languageList = explode(';', htmlspecialchars($form_values['mods_language'])); - foreach ($languageList as $lang) - { - $language = $dom->createElement('mods:language'); - $langTerm = $dom->createElement('mods:languageTerm',htmlspecialchars($lang)); - $langTerm->setAttribute('type','text'); - $language->appendChild($langTerm); - $mods->appendChild($language); + foreach ($languageList as $lang) { + $language = $dom->createElement('mods:language'); + $langTerm = $dom->createElement('mods:languageTerm', htmlspecialchars($lang)); + $langTerm->setAttribute('type', 'text'); + $language->appendChild($langTerm); + $mods->appendChild($language); } } - - + + $hasSubject = FALSE; $subject = $dom->createElement('mods:subject'); - - + + // Hierarchical Geographic Subject if (isset($form_values['mods_country']) && trim($form_values['mods_country']) != '') { $hasSubject = TRUE; $geographic = $dom->createElement('mods:hierarchicalGeographic'); - - $country=$dom->createElement('mods:country', htmlspecialchars($form_values['mods_country'])); + + $country = $dom->createElement('mods:country', htmlspecialchars($form_values['mods_country'])); $geographic->appendChild($country); - + if (isset($form_values['mods_province']) && trim($form_values['mods_province']) != '') { - $province = $dom->createElement('mods:province', htmlspecialchars($form_values['mods_province'])); + $province = $dom->createElement('mods:province', htmlspecialchars($form_values['mods_province'])); $geographic->appendChild($province); } - + if (isset($form_values['mods_state']) && trim($form_values['mods_state']) != '') { - $state = $dom->createElement('mods:state', htmlspecialchars($form_values['mods_state'])); + $state = $dom->createElement('mods:state', htmlspecialchars($form_values['mods_state'])); $geographic->appendChild($state); } - + if (isset($form_values['mods_city']) && trim($form_values['mods_city']) != '') { - $city = $dom->createElement('mods:city', htmlspecialchars($form_values['mods_city'])); + $city = $dom->createElement('mods:city', htmlspecialchars($form_values['mods_city'])); $geographic->appendChild($city); } - + if (isset($form_values['mods_area']) && trim($form_values['mods_area']) != '') { - $state = $dom->createElement('mods:area', htmlspecialchars($form_values['mods_area'])); + $state = $dom->createElement('mods:area', htmlspecialchars($form_values['mods_area'])); $geographic->appendChild($state); } - - + + $subject->appendChild($geographic); } - + if (isset($form_values['mods_date']) && trim($form_values['mods_date']) != '') { $hasSubject = TRUE; $temporal = $dom->createElement('mods:temporal', htmlspecialchars($form_values['mods_date'])); @@ -608,13 +600,13 @@ class ModsFormBuilder extends FormBuilder { if (isset($form_values['mods_subjtitle']) && trim($form_values['mods_subjtitle']) != '') { $hasSubject = TRUE; - $titleInfo= $dom->createElement('mods:titleInfo'); + $titleInfo = $dom->createElement('mods:titleInfo'); $title = $dom->createElement('mods:title', htmlspecialchars($form_values['mods_subjtitle'])); $titleInfo->appendChild($title); $subject->appendChild($titleInfo); - } - - + } + + if (isset($form_values['mods_topics']) && trim($form_values['mods_topics']) != '') { $hasSubject = TRUE; $topicList = explode(';', htmlspecialchars($form_values['mods_topics'])); @@ -622,102 +614,100 @@ class ModsFormBuilder extends FormBuilder { if (isset($form_values['mods_topicAuthority']) && trim($form_values['mods_topicAuthority']) != '') { $authority = htmlspecialchars($form_values['mods_topicAuthority']); } - + foreach ($topicList as $t) { $topic = $dom->createElement('mods:topic', $t); $topic->setAttribute('authority', $authority); $subject->appendChild($topic); } } - - + + if (isset($form_values['mods_cc']['cc']) && $form_values['mods_cc']['cc']['cc_enable']) { - $commercial = trim($form_values['mods_cc']['cc']['cc_commercial']); - $modifications = trim($form_values['mods_cc']['cc']['cc_modifications']); - $jurisdiction = trim($form_values['mods_cc']['cc']['cc_jurisdiction']); - - module_load_include('inc','islandora_form_elements','includes/creative_commons.inc'); - - if (!isset(CreativeCommons::$cc_jurisdiction_vals[$jurisdiction])) - $jurisdiction=''; - $version = CreativeCommons::$cc_versions[$jurisdiction]; - - $license = 'by'. ($commercial != ''?'-'.$commercial:'') . ($modifications != ''?'-'.$modifications:'') . '/' . $version . '/'.($jurisdiction != ''?$jurisdiction.'/':'') ; - + $commercial = trim($form_values['mods_cc']['cc']['cc_commercial']); + $modifications = trim($form_values['mods_cc']['cc']['cc_modifications']); + $jurisdiction = trim($form_values['mods_cc']['cc']['cc_jurisdiction']); + + module_load_include('inc', 'islandora_form_elements', 'includes/creative_commons.inc'); + + if (!isset(CreativeCommons::$cc_jurisdiction_vals[$jurisdiction])) + $jurisdiction = ''; + $version = CreativeCommons::$cc_versions[$jurisdiction]; + + $license = 'by' . ($commercial != '' ? '-' . $commercial : '') . ($modifications != '' ? '-' . $modifications : '') . '/' . $version . '/' . ($jurisdiction != '' ? $jurisdiction . '/' : ''); + $accessCondition = $dom->createElement('mods:accessCondition', htmlspecialchars($license)); $accessCondition->setAttribute('type', 'Creative Commons License'); $mods->appendChild($accessCondition); - - } - + if (isset($form_values['mods_rights']) && trim($form_values['mods_rights']) != '') { $accessCondition = $dom->createElement('mods:accessCondition', htmlspecialchars($form_values['mods_rights'])); $accessCondition->setAttribute('type', 'restriction on access; use and reproduction'); $mods->appendChild($accessCondition); } - - if (isset($form_values['mods_people']) && isset($form_values['mods_people']['people']) && is_array($form_values['mods_people']['people']) ) { + + if (isset($form_values['mods_people']) && isset($form_values['mods_people']['people']) && is_array($form_values['mods_people']['people'])) { foreach ($form_values['mods_people']['people'] as $key => $val) { $name = $dom->createElement('mods:name'); - $appendName=FALSE; + $appendName = FALSE; if (isset($val['role'])) { - $role = $dom->createElement('mods:role'); - $roleTerm = $dom->createElement('mods:roleTerm', htmlspecialchars(trim($val['role']))); - $roleTerm->setAttribute('type', 'text'); - $roleTerm->setAttribute('authority', 'marcrelator'); - $role->appendChild($roleTerm); - $name->appendChild($role); + $role = $dom->createElement('mods:role'); + $roleTerm = $dom->createElement('mods:roleTerm', htmlspecialchars(trim($val['role']))); + $roleTerm->setAttribute('type', 'text'); + $roleTerm->setAttribute('authority', 'marcrelator'); + $role->appendChild($roleTerm); + $name->appendChild($role); } - + if (isset($val['organization'])) { $name->setAttribute('type', 'organization'); if (trim($val['organization']) != '') { - $namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['organization']))); + $namePart = $dom->createElement('mods:namePart', htmlspecialchars(trim($val['organization']))); $name->appendChild($namePart); - $appendName=TRUE; + $appendName = TRUE; } - } + } elseif (isset($val['conference'])) { $name->setAttribute('type', 'conference'); if (trim($val['conference']) != '') { - $namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['conference']))); + $namePart = $dom->createElement('mods:namePart', htmlspecialchars(trim($val['conference']))); $name->appendChild($namePart); - $appendName=TRUE; + $appendName = TRUE; } - } + } else { $name->setAttribute('type', 'personal'); if (trim($val['name']) != '') { - $namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['name']))); + $namePart = $dom->createElement('mods:namePart', htmlspecialchars(trim($val['name']))); $name->appendChild($namePart); - $appendName=TRUE; - } + $appendName = TRUE; + } } - - if (isset($val['date'])) { - $namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['date']))); - $namePart->setAttribute('type','date'); + + if (isset($val['date'])) { + $namePart = $dom->createElement('mods:namePart', htmlspecialchars(trim($val['date']))); + $namePart->setAttribute('type', 'date'); $name->appendChild($namePart); } - + if ($appendName) { - if (isset($val['subject'])) { + if (isset($val['subject'])) { $subject->appendChild($name); - $hasSubject=TRUE; - } else { + $hasSubject = TRUE; + } + else { $mods->appendChild($name); } } + } + } - } - } - if ($hasSubject) { $mods->appendChild($subject); } - + return $mods; } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 9644dd71..f2fa3629 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -1,11 +1,13 @@ formatOutput = TRUE; @@ -23,22 +25,20 @@ class PersonalCollectionClass { $value = $this->createPolicyStream($theUser, $dom, $rootElement); if (!$value) { - return FALSE;//error should already be logged. + return FALSE; //error should already be logged. } $this->createCollectionPolicyStream($theUser, $dom, $rootElement); try { $params = array( - 'objectXML' => $dom->saveXML(), - 'format' => "foxml1.0", - 'logMessage' => "Fedora object ingested", + 'objectXML' => $dom->saveXML(), + 'format' => "foxml1.0", + 'logMessage' => "Fedora object ingested", ); $object = $soapClient->__soapCall('ingest', array( $params - )); - - } - catch (exception $e) { + )); + } catch (exception $e) { drupal_set_message(t('Error ingesting personal collection object: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; } @@ -49,8 +49,7 @@ class PersonalCollectionClass { $collectionTemplate = file_get_contents(drupal_get_path('module', 'Fedora_Repository') . '/collection_policies/PERSONAL-COLLECTION-POLICY.xml'); try { $xml = new SimpleXMLElement($collectionTemplate); - } - catch (Exception $e) { + } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem creating personal collection policy, could not parse collection policy stream."), NULL, WATCHDOG_ERROR); drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; @@ -113,7 +112,7 @@ class PersonalCollectionClass { $content->appendChild($policyStream); return $this->createChildPolicyStream($dom, $rootElement, $policyStream->cloneNode(TRUE)); } - + //right now this is the same as the policy stream for this object, may change //objects in this collection will reference this datastream as their own POLICY stream function createChildPolicyStream($dom, $rootElement, $policyStream) { @@ -136,7 +135,7 @@ class PersonalCollectionClass { } function createStandardFedoraStuff($user, & $dom, & $rootElement) { - /*foxml object properties section */ + /* foxml object properties section */ $objproperties = $dom->createElement("foxml:objectProperties"); $prop1 = $dom->createElement("foxml:property"); $prop1->setAttribute("NAME", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); diff --git a/plugins/QtFormBuilder.php b/plugins/QtFormBuilder.php index af66ed31..bc0afeb2 100644 --- a/plugins/QtFormBuilder.php +++ b/plugins/QtFormBuilder.php @@ -1,4 +1,5 @@ getType($file); - //$fileUrl = 'http://'.$_SERVER['HTTP_HOST'].$file; - $fileUrl = $base_url.'/'.drupal_urlencode($file); - $beginIndex = strrpos($fileUrl,'/'); - $dtitle = substr($fileUrl,$beginIndex+1); - $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); - $ds1 = $dom->createElement("foxml:datastream"); - $ds1->setAttribute("ID","OBJ"); - $ds1->setAttribute("STATE","A"); - $ds1->setAttribute("CONTROL_GROUP","M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); - $ds1v->setAttribute("ID","OBJ.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); + function QtFormBuilder() { + module_load_include('php', 'Fedora_Repository', 'plugins/FormBuilder'); + drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); + } -if(empty($_SESSION['fedora_ingest_files']) || !isset($_SESSION['fedora_ingest_files']['TN'])) { - $createdFile = drupal_get_path('module', 'Fedora_Repository').'/images/qtThumb.jpg'; - $fileUrl = $base_url.'/'.drupal_urlencode($createdFile);//'http://'.$_SERVER['HTTP_HOST'].'/'.$createdFile; - $ds1 = $dom->createElement("foxml:datastream"); - $ds1->setAttribute("ID","TN"); - $ds1->setAttribute("STATE","A"); - $ds1->setAttribute("CONTROL_GROUP","M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); - $ds1v->setAttribute("ID","TN.0"); - $ds1v->setAttribute("MIMETYPE","image/jpeg"); - $ds1v->setAttribute("LABEL","Thumbnail"); - $ds1content = $dom->createElement('foxml:contentLocation'); - $ds1content->setAttribute("REF","$fileUrl"); - $ds1content->setAttribute("TYPE","URL"); - $ds1->appendChild($ds1v); - $ds1v->appendChild($ds1content); - $rootElement->appendChild($ds1); -} + /* + * method overrides method in FormBuilder. We changed the dsid from OBJ to OBJ and added the TN datastream + */ + + 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']; + $dformat = $mimetype->getType($file); + //$fileUrl = 'http://'.$_SERVER['HTTP_HOST'].$file; + $fileUrl = $base_url . '/' . drupal_urlencode($file); + $beginIndex = strrpos($fileUrl, '/'); + $dtitle = substr($fileUrl, $beginIndex + 1); + $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); + $ds1 = $dom->createElement("foxml:datastream"); + $ds1->setAttribute("ID", "OBJ"); + $ds1->setAttribute("STATE", "A"); + $ds1->setAttribute("CONTROL_GROUP", "M"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); + $ds1v->setAttribute("ID", "OBJ.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); + + if (empty($_SESSION['fedora_ingest_files']) || !isset($_SESSION['fedora_ingest_files']['TN'])) { + $createdFile = drupal_get_path('module', 'Fedora_Repository') . '/images/qtThumb.jpg'; + $fileUrl = $base_url . '/' . drupal_urlencode($createdFile); //'http://'.$_SERVER['HTTP_HOST'].'/'.$createdFile; + $ds1 = $dom->createElement("foxml:datastream"); + $ds1->setAttribute("ID", "TN"); + $ds1->setAttribute("STATE", "A"); + $ds1->setAttribute("CONTROL_GROUP", "M"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); + $ds1v->setAttribute("ID", "TN.0"); + $ds1v->setAttribute("MIMETYPE", "image/jpeg"); + $ds1v->setAttribute("LABEL", "Thumbnail"); + $ds1content = $dom->createElement('foxml:contentLocation'); + $ds1content->setAttribute("REF", "$fileUrl"); + $ds1content->setAttribute("TYPE", "URL"); + $ds1->appendChild($ds1v); + $ds1v->appendChild($ds1content); + $rootElement->appendChild($ds1); + } - if (!empty($_SESSION['fedora_ingest_files'])) { + 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); + $fileUrl = $base_url . '/' . drupal_urlencode($createdFile); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -79,7 +82,7 @@ if(empty($_SESSION['fedora_ingest_files']) || !isset($_SESSION['fedora_ingest_fi $ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -91,12 +94,8 @@ if(empty($_SESSION['fedora_ingest_files']) || !isset($_SESSION['fedora_ingest_fi $rootElement->appendChild($ds1); } } + } +} - - } - - - - } ?> diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index f6e43f95..02745bce 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -1,5 +1,6 @@ romeoUrlString = "http://www.sherpa.ac.uk/romeo/api24.php?issn="; } - function buildForm( &$form, $ingest_form_definition, &$form_values) { + function buildForm(&$form, $ingest_form_definition, &$form_values) { $form['indicator2'] = array( - '#type' => 'fieldset', - '#title' => t('Ingest digital object step #2'), + '#type' => 'fieldset', + '#title' => t('Ingest digital object step #2'), ); foreach ($ingest_form_definition->form_elements->element as $element) { $name = strip_tags($element->name->asXML()); @@ -39,11 +41,11 @@ class Refworks { $type = strip_tags($element->type->asXML()); $form['indicator2']["$name"] = array( - '#title' => $title, - '#required' => $required, - '#description' => $description, - '#prefix' => $prefix, - '#type' => $type + '#title' => $title, + '#required' => $required, + '#description' => $description, + '#prefix' => $prefix, + '#type' => $type ); } @@ -68,21 +70,20 @@ class Refworks { //$xml=simplexml_load_string(trim(file_get_contents($file),NULL,TRUE)); //$dom = dom_import_simplexml($xml);//test to see if it behaves better //$xml = new SimpleXMLElement(trim(file_get_contents($file))); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t('Error processing Refworks file: ') . $e->getMessage()); return FALSE; } $this->referenceList = array(); foreach ($xml->reference as $reference) { - array_push( $this->referenceList, $reference ); + array_push($this->referenceList, $reference); } return $this->referenceList; } - + //create A DC stream with ID of DC - function createQDCStream( &$dom, &$rootElement, $reference ) { + function createQDCStream(&$dom, &$rootElement, $reference) { $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "DC"); $datastream->setAttribute("STATE", "A"); @@ -126,19 +127,19 @@ class Refworks { $oai->appendChild($element); } foreach ($reference->vo as $value) { - $source .= ' Volume: '. $value; + $source .= ' Volume: ' . $value; } foreach ($reference->is as $value) { - $source .= ' Issue: '. $value; + $source .= ' Issue: ' . $value; } foreach ($reference->sp as $value) { - $source .= ' Start Page: '. $value; + $source .= ' Start Page: ' . $value; } foreach ($reference->op as $value) { - $source .= ' Other Pages: '. $value; + $source .= ' Other Pages: ' . $value; } foreach ($reference->ul as $value) { - $source .= ' URL: '. $value; + $source .= ' URL: ' . $value; } foreach ($reference->k1 as $value) { $element = $dom->createElement('dc:subject', htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8')); @@ -174,17 +175,17 @@ class Refworks { $identifier .= ' ISSN/ISBN: ' . $value; //$this->romeoUrlString = $this->romeoUrlString . $value; if (!$this->issn == '') { - $this->issn=$value; + $this->issn = $value; } else { - $this->issn .= ','. $value; + $this->issn .= ',' . $value; } } foreach ($reference->ab as $value) { - $description = ' abstract: '. $value; + $description = ' abstract: ' . $value; } foreach ($reference->cr as $value) { - $description .= ' Cited reference: '. $value; + $description .= ' Cited reference: ' . $value; } $element = $dom->createElement('dc:description', htmlspecialchars($description, ENT_NOQUOTES, 'UTF-8')); $oai->appendChild($element); @@ -196,7 +197,7 @@ class Refworks { return $datastream; } - function handleForm( &$form_values ) { + function handleForm(&$form_values) { $errorMessage = NULL; module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'ContentModel'); @@ -204,10 +205,10 @@ class Refworks { $contentModelPid = ContentModel::getPidFromIdentifier($form_values['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_values['models']); $collectionHelper = new CollectionClass(); - $startTime=time(); + $startTime = time(); $collection_pid = $form_values['collection_pid']; - $this->parse_refworks_item( $form_values ); + $this->parse_refworks_item($form_values); $this->securityHelper = new SecurityClass(); @@ -231,18 +232,18 @@ class Refworks { $rootElement->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $rootElement->setAttribute('xsi:schemaLocation', "info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"); $dom->appendChild($rootElement); - + //create standard fedora stuff $qdc_element = $this->createQDCStream($dom, $rootElement, $reference); if (!$qdc_element) { drupal_set_message(t('Error creating DC for Refworks'), 'error'); continue; } - $item_title=''; + $item_title = ''; foreach ($reference->t1 as $value) { - $item_title .= ' --- '. $value; + $item_title .= ' --- ' . $value; } - $this->createStandardFedoraStuff($form_values, $dom, $rootElement, $reference ); + $this->createStandardFedoraStuff($form_values, $dom, $rootElement, $reference); $rootElement->appendChild($qdc_element); //create relationships $this->createRelationShips($form_values, $dom, $rootElement, $pid); @@ -250,14 +251,14 @@ class Refworks { $this->createFedoraDataStreams($form_values, $dom, $rootElement, $reference); - if (!empty ( $this->collectionPolicyStream)) { + if (!empty($this->collectionPolicyStream)) { $this->create_security_policies($dom, $rootElement, $reference); } $params = array( - 'objectXML' => $dom->saveXML(), - 'format' => 'info:fedora/fedora-system:FOXML-1.1', - 'logMessage' => "Fedora Object Ingested", + 'objectXML' => $dom->saveXML(), + 'format' => 'info:fedora/fedora-system:FOXML-1.1', + 'logMessage' => "Fedora Object Ingested", ); try { @@ -271,33 +272,32 @@ class Refworks { } $object = $client->__soapCall('ingest', array( $params - )); + )); watchdog(t("FEDORA_REPOSITORY"), t("Successfully added repository item !pid - !it", array('!pid' => $pid, '!it' => $item_title)), NULL, WATCHDOG_INFO); $deleteFiles = $form_values['delete_file']; //remove files from drupal file system if ($deleteFiles > 0) { unlink($form_values['fullpath']); } - } - catch (exception $e) { + } catch (exception $e) { $errors++; $errorMessage = 'yes'; watchdog(t("FEDORA_REPOSITORY"), t("Error during ingest !it !e", array('!it' => $item_title, '!e' => $e)), NULL, WATCHDOG_ERROR); - } + } $success++; } if (isset($errorMessage)) { - drupal_set_message(t('Error ingesting one or more records! Check Drupal watchdog logs for more info') , 'error'); + drupal_set_message(t('Error ingesting one or more records! Check Drupal watchdog logs for more info'), 'error'); } $endTime = time(); drupal_set_message(t('Successfull ingest of %success records. %errors records failed. Ingest took %seconds seconds', - array('%success' => $success-$errors, '%errors' => $errors, '%seconds' => $endTime-$startTime)) , 'info'); + array('%success' => $success - $errors, '%errors' => $errors, '%seconds' => $endTime - $startTime)), 'info'); } /** * Creates the RELS-EXT for the foxml */ - function createRelationShips( $form_values, &$dom, &$rootElement, $pid = NULL ) { + function createRelationShips($form_values, &$dom, &$rootElement, $pid = NULL) { $drdf = $dom->createElement("foxml:datastream"); $drdf->setAttribute("ID", "RELS-EXT"); $drdf->setAttribute("CONTROL_GROUP", "X"); @@ -326,7 +326,6 @@ class Refworks { $rdfdesc->appendChild($member); $rdfdesc->appendChild($model); $rootElement->appendChild($drdf); - } function createRomeoDataStream(&$dom, &$rootElement) { @@ -340,7 +339,7 @@ class Refworks { $ds1v->setAttribute("LABEL", "ROMEO"); $ds1content = $dom->createElement('foxml:contentLocation'); $url = $this->romeoUrlString . $this->issn; - $this->issn=''; //clear the issn's for next ingest in case we are doing batch + $this->issn = ''; //clear the issn's for next ingest in case we are doing batch $ds1content->setAttribute("REF", "$url"); $ds1content->setAttribute("TYPE", "URL"); $ds1->appendChild($ds1v); @@ -397,7 +396,6 @@ class Refworks { $rootElement->appendChild($objproperties); } - /** * Read the list of Users from the U1 field and Roles from the U2 field and add elements * to the security policy record for this item, then add the record as the security policy datastream. @@ -417,8 +415,8 @@ class Refworks { $ds1v->setAttribute("ID", "POLICY.0"); $ds1v->setAttribute("MIMETYPE", "text/xml"); $ds1v->setAttribute("LABEL", "POLICY Record"); - $ds1content = $dom->createElement( "foxml:xmlContent" ); - + $ds1content = $dom->createElement("foxml:xmlContent"); + $custom_policy = $this->collectionPolicyStream; $allowed_users_and_roles = array(); $allowed_users_and_roles['users'] = array(); @@ -428,11 +426,11 @@ class Refworks { array_push($allowed_users_and_roles['users'], $name); } } - if (empty( $reference->u1)) { + if (empty($reference->u1)) { // If no "u1" value exists, add the currently logged-in user to the item's security policy. array_push($allowed_users_and_roles['users'], $user->name); } - + foreach ($reference->u2 as $rolelist) { foreach (explode(';', strip_tags($rolelist->asXML())) as $role) { array_push($allowed_users_and_roles['roles'], $role); @@ -444,6 +442,7 @@ class Refworks { $ds1v->appendChild($ds1content); $rootElement->appendChild($ds1); - $ds1content->appendChild($dom->importNode( dom_import_simplexml($custom_policy_sxe), TRUE)); + $ds1content->appendChild($dom->importNode(dom_import_simplexml($custom_policy_sxe), TRUE)); } + } diff --git a/plugins/ShowDemoStreamsInFieldSets.inc b/plugins/ShowDemoStreamsInFieldSets.inc index dd81410f..ccc70c56 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -1,5 +1,6 @@ pid = $pid; } function showMediumSize() { global $base_url; $collection_fieldset = array( - '#collapsible' => FALSE, - '#value' => '', + '#collapsible' => FALSE, + '#value' => '', ); return theme('fieldset', $collection_fieldset); } + } diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index d0860ab2..caea2ca2 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -1,11 +1,14 @@ pid = $pid; } @@ -17,11 +20,11 @@ class ShowStreamsInFieldSets { $content = ""; $pathTojs = drupal_get_path('module', 'Fedora_Repository') . '/js/swfobject.js'; drupal_add_js("$pathTojs"); - $content .= '
      Get the Flash Player to see this player.
      '; - drupal_add_js('var s1 = new SWFObject("'. $fullPath . '/flash/flvplayer.swf","single","320","240","7"); + $content .= '
      Get the Flash Player to see this player.
      '; + drupal_add_js('var s1 = new SWFObject("' . $fullPath . '/flash/flvplayer.swf","single","320","240","7"); s1.addParam("allowfullscreen","TRUE"); - s1.addVariable("file","'. base_path() . 'fedora/repository/'. $this->pid . '/FLV/FLV.flv"); - s1.write("player'. $this->pid . 'FLV");', 'inline', 'footer'); + s1.addVariable("file","' . base_path() . 'fedora/repository/' . $this->pid . '/FLV/FLV.flv"); + s1.write("player' . $this->pid . 'FLV");', 'inline', 'footer'); $collection_fieldset = array( '#title' => t('Flash Video'), '#collapsible' => TRUE, @@ -36,18 +39,17 @@ class ShowStreamsInFieldSets { '#title' => '', '#attributes' => array(), '#collapsible' => FALSE, - '#value' => '', + '#value' => '', ); return theme('fieldset', $collection_fieldset); } - // Same as showTN but artinventory stores the image in a dsid of IMAGE instead of OBJ function showArtInventoryTN() { global $base_url; $collection_fieldset = array( '#collapsible' => FALSE, - '#value' => '', + '#value' => '', ); return theme('fieldset', $collection_fieldset); } @@ -74,21 +76,21 @@ class ShowStreamsInFieldSets { $objectHelper = new ObjectHelper(); $item = new Fedora_Item($this->pid); if (key_exists('TN', $item->datastreams)) { - $tn_url = $base_url.'/fedora/repository/'.$item->pid.'/TN'; + $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'; + $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('

      View Document
      ', 'fedora/repository/'.$this->pid.'/OBJ', array('html' => TRUE)); - + + $dl_link = l('

      View Document
      ', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); + $tabset['first_tab']['tabs']['view'] = array( '#type' => 'tabpage', '#title' => t('View'), '#content' => $dl_link . $dc_html, ); - + if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC'); $tabset['first_tab']['tabs']['edit'] = array( @@ -97,23 +99,22 @@ class ShowStreamsInFieldSets { '#content' => $editform, ); } - + $tabset['second_tab'] = array( '#type' => 'tabpage', '#title' => t('Read Online'), - '#content' => "" + '#content' => "" ); // Render the tabset. return $tabset; } - function showQdc() { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); - $content=$objectHelper->getQDC($this->pid); + $content = $objectHelper->getQDC($this->pid); $collection_fieldset = array( '#title' => t('Description'), '#collapsible' => TRUE, @@ -128,24 +129,21 @@ class ShowStreamsInFieldSets { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $streams = $item->get_datastreams_list_as_array(); - return "". $streams['OBJ']['label'] .""; + return "" . $streams['OBJ']['label'] . ""; } - - function showRefworks() { - $path=drupal_get_path('module', 'fedora_repository'); + $path = drupal_get_path('module', 'fedora_repository'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $collectionHelper = new CollectionClass(); - $xmlstr=$collectionHelper->getStream($this->pid, "refworks"); + $xmlstr = $collectionHelper->getStream($this->pid, "refworks"); html_entity_decode($xmlstr); if ($xmlstr == NULL || strlen($xmlstr) < 5) { return " "; } try { $proc = new XsltProcessor(); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); return " "; } @@ -166,8 +164,8 @@ class ShowStreamsInFieldSets { } function showJP2($collapsed = FALSE) { - $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'; - $html = ''; + $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer'; + $html = ''; $fieldset = array( '#title' => t('Viewer'), '#collapsible' => TRUE, @@ -189,8 +187,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); return; } @@ -210,4 +207,5 @@ class ShowStreamsInFieldSets { ); return theme('fieldset', $collection_fieldset); } + } diff --git a/plugins/fedoraObject.inc b/plugins/fedoraObject.inc index 198698e9..7290a776 100644 --- a/plugins/fedoraObject.inc +++ b/plugins/fedoraObject.inc @@ -1,7 +1,8 @@ item = new Fedora_Item($pid); } } - + public function showFieldSets() { global $user; $objectHelper = new ObjectHelper(); @@ -26,16 +27,16 @@ class FedoraObject { '#type' => 'tabset', ); $dc_html = $objectHelper->getFormattedDC($this->item); - + $ds_list = $objectHelper->get_formatted_datastream_list($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( @@ -44,7 +45,8 @@ class FedoraObject { '#content' => $editform, ); } - + return $tabset; } + } \ No newline at end of file diff --git a/plugins/fedora_attach/fedora_attach.admin.inc b/plugins/fedora_attach/fedora_attach.admin.inc index 30c378af..32971a37 100644 --- a/plugins/fedora_attach/fedora_attach.admin.inc +++ b/plugins/fedora_attach/fedora_attach.admin.inc @@ -1,11 +1,11 @@ filepath; // Need copy if file_move fails. $public = file_directory_path(); - + $file_is_ingested = _fedora_attach_is_file_in_repository($filepath); if (!empty($file->ingested) && !$file_is_ingested) { // Attach flag is set, but file is not listed as being in the repository. @@ -49,15 +50,15 @@ function fedora_attach_nodeapi(&$node, $op, $teaser) { } } } - // if (!empty($roles)) { - // Generate the security policy datastream. + // if (!empty($roles)) { + // Generate the security policy datastream. $policy_stream = _fedora_attach_create_policy($roles); - // } + // } } try { - $pid_namespace = variable_get('fedora_attach_pid_namespace','default:'); + $pid_namespace = variable_get('fedora_attach_pid_namespace', 'default:'); $pid_namespace = substr($pid_namespace, 0, strpos($pid_namespace, ":")); - $pid = fedora_item::get_next_PID_in_namespace( $pid_namespace ); + $pid = fedora_item::get_next_PID_in_namespace($pid_namespace); $new_item = fedora_item::ingest_new_item($pid, 'A', $file->description); // PID will be generated using getNextPID if (empty($new_item->objectProfile)) { drupal_set_message("Unable to create fedora object. Check Watchdog log for details.", "error"); @@ -68,7 +69,7 @@ function fedora_attach_nodeapi(&$node, $op, $teaser) { $new_item->add_datastream_from_string($policy_stream, 'POLICY', "Security Policy", "text/xml", "X"); } $new_item->add_datastream_from_file($file->filepath, 'OBJ', $file->filename, $file->filemime, 'M'); - $new_item->add_relationship("hasModel","islandora:genericCModel",FEDORA_MODEL_URI); + $new_item->add_relationship("hasModel", "islandora:genericCModel", FEDORA_MODEL_URI); module_load_include('inc', 'fedora_repository', 'api/dublin_core'); $dc = new Dublin_Core(); $dc->add_element('dc:title', $file->description); @@ -78,20 +79,18 @@ function fedora_attach_nodeapi(&$node, $op, $teaser) { $success = TRUE; } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t('An error occurred ingesting the file: ') . $e, 'error'); $new_item->purge(); drupal_set_message(t('The item has been removed from the repository')); } if ($success) { // We were able to ingest the file, so update the file path. - $new_filepath = '/fedora/repository/'. $new_item->pid . '/OBJ/'. $file->description; + $new_filepath = '/fedora/repository/' . $new_item->pid . '/OBJ/' . $file->description; _fedora_attach_update_filepath($new_filepath, $fid); file_delete($filepath); } } - // Convert file to object for compatibility - + // Convert file to object for compatibility // Remove file. Process removals first since no further processing // will be required. if (!empty($file->remove)) { @@ -109,7 +108,6 @@ function fedora_attach_nodeapi(&$node, $op, $teaser) { // Move on, so the removed file won't be added to new revisions. continue; } - } } } @@ -118,7 +116,6 @@ function fedora_attach_nodeapi(&$node, $op, $teaser) { // ****************************************************** // *** VIEW // Re-theme the file attachments table. - // Rebuild the files table and overwrite default. // Using the rules from upload.module. if (isset($node->files) && count($node->files) && user_access('view uploaded files') && !$teaser) { @@ -129,7 +126,7 @@ function fedora_attach_nodeapi(&$node, $op, $teaser) { } /** - *Implementation of hook_menu(). + * Implementation of hook_menu(). */ function fedora_attach_menu() { $items['admin/settings/fedora_repository/attach'] = array( @@ -143,7 +140,6 @@ function fedora_attach_menu() { return $items; } - function fedora_attach_save(&$node) { print ("FNARF!"); } @@ -169,40 +165,40 @@ function fedora_attach_form_alter(&$form, $form_state, $form_id) { $form['attachments']['wrapper']['files']['#theme'] = 'fedora_attach_form'; $form['#validate']['private_upload_form_validate'] = array(); foreach ($node->files as $fid => $file) { - + // Add ingest checkbox if (is_array($file) && isset($file['ingest'])) { // Preview $default_value = $file['ingest']; - } + } else { // Node load $default_value = _fedora_attach_is_file_in_repository($file->filepath); $disabled = $default_value; } - + $form['attachments']['wrapper']['files'][$fid]['ingested'] = array( '#type' => 'checkbox', '#default_value' => $default_value, '#disabled' => $disabled, ); - $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url.$file->filepath; + $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url . $file->filepath; } if (user_access('select file access by role')) { _fedora_attach_build_roles_form($form, FALSE); } } } - } + } elseif ($form_id == 'upload_js') { $form['files']['#theme'] = 'fedora_attach_form'; foreach ($form['files'] as $fid => $file) { - + if (!_fedora_attach_starts_with($fid, '#')) {// Ignore properties. if (!empty($_POST['files'][$fid])) { $ingested = (!empty($_POST['files'][$fid]['ingested']) ? $_POST['files'][$fid]['ingested'] : FALSE); //$form['files'][$fid]['list']['#default_value'] = (!empty($_POST['files'][$fid]['[$_POST['files'][$fid]['list']; //$form['files'][$fid]['remove']['#default_value'] = $_POST['files'][$fid]['remove']; - } + } else { $ingested = (variable_get('fedora_attach_default', 'ingested') == 'ingested'); } @@ -210,8 +206,8 @@ function fedora_attach_form_alter(&$form, $form_state, $form_id) { '#type' => 'checkbox', '#default_value' => $ingested, ); - - $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url.$file['filepath']; + + $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url . $file['filepath']; if (user_access('select file access by role')) { _fedora_attach_build_roles_form($form, TRUE); } @@ -232,13 +228,14 @@ function fedora_attach_form_validate($formid, $form_values) { if (!isset($file['ingested'])) { drupal_set_message(t('Fedora Attach cannot find add repository settings.'), 'error'); // Be sure we are going after core upload module - $upload_weight = (int)db_result(db_query("SELECT weight FROM {system} WHERE name = 'upload'")); - $attach_weight = (int)db_result(db_query("SELECT weight FROM {system} WHERE name = 'fedora_attach'")); + $upload_weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'upload'")); + $attach_weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'fedora_attach'")); if ($attach_weight <= $uplaod_weight) { $new_weight = $upload_weight + 1; drupal_set_message(t('Adjusting Fedora Attach module\'s weight to') . $new_weight, 'warning'); - db_query("UPDATE {system} SET weight = '%d' WHERE name = 'fedora_attach'", $new_weight);; - } + db_query("UPDATE {system} SET weight = '%d' WHERE name = 'fedora_attach'", $new_weight); + ; + } else { drupal_set_message(t('Please check for modules that conflict with Fedora Attach'), 'error'); } @@ -259,7 +256,7 @@ function fedora_attach_form_submit($form, &$form_state) { foreach ($form_state['values']['files'] as $fid => $file) { if ($file['remove'] && !empty($file['ingested']) && $file['ingested']) { - drupal_set_message("The attachment ${file['filename']} was removed from this node but it will remain in the repository until it is purged it directly."); + drupal_set_message("The attachment ${file['filename']} was removed from this node but it will remain in the repository until it is purged it directly."); } if (!isset($file->ingested)) { // Newly-inserted file. if (isset($form['attachments']['wrapper']['files'])) { @@ -306,11 +303,11 @@ function fedora_attach_theme() { function theme_fedora_attach_form(&$form) { $header = array(t('Delete'), t('List'), t('Add to Repository'), t('Label'), t('Weight'), t('Size'), ''); drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); - + foreach (element_children($form) as $key) { // Add class to group weight fields for drag and drop. $form[$key]['weight']['#attributes']['class'] = 'upload-weight'; - + $row = array(); $row[] = drupal_render($form[$key]['remove']); $row[] = drupal_render($form[$key]['list']); @@ -323,7 +320,7 @@ function theme_fedora_attach_form(&$form) { } $output = theme('table', $header, $rows, array('id' => 'upload-attachments')); $output .= drupal_render($form); - return $output; + return $output; } /** @@ -340,8 +337,8 @@ function theme_fedora_attach_attachments($files) { if ($file->list && empty($file->remove)) { $inspect_item = ''; if (_fedora_attach_is_file_in_repository($file->filepath)) { - $inspect_item = ' '. theme_image(drupal_get_path('module', 'Fedora_Repository') . '/images/view.gif', '', 'View the item\'s repository page' ) . ''; + $inspect_item = ' ' . theme_image(drupal_get_path('module', 'Fedora_Repository') . '/images/view.gif', '', 'View the item\'s repository page') . ''; } $href = _fedora_attach_create_url($file); // this is the changed line $text = $file->description ? $file->description : $file->filename; @@ -351,7 +348,7 @@ function theme_fedora_attach_attachments($files) { if (count($rows)) { return theme('table', $header, $rows, array('id' => 'attachments')); } - } + } } function _fedora_attach_build_roles_form(&$form, $inside_js = FALSE) { @@ -384,8 +381,7 @@ function _fedora_attach_build_roles_form(&$form, $inside_js = FALSE) { } function _fedora_attach_create_policy($roles) { - $policy_filename = !empty($roles) ? drupal_get_path('module', 'fedora_repository') . '/policies/viewANDeditbyrole.xml' - : drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml'; + $policy_filename = !empty($roles) ? drupal_get_path('module', 'fedora_repository') . '/policies/viewANDeditbyrole.xml' : drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml'; $policy_document = new DOMDocument(); $policy_document->load($policy_filename); $designators = $policy_document->getElementsByTagName("SubjectAttributeDesignator"); @@ -427,10 +423,10 @@ function fedora_attach_file_download($filepath) { if (!strstr($filepath, 'fedora/repository')) { return; } - $result = db_query("SELECT DISTINCT(u.nid) FROM {upload} u INNER JOIN {files} f ON u.fid = f.fid ". - "WHERE f.filepath LIKE '%s'", $filepath.'%'); + $result = db_query("SELECT DISTINCT(u.nid) FROM {upload} u INNER JOIN {files} f ON u.fid = f.fid " . + "WHERE f.filepath LIKE '%s'", $filepath . '%'); $has_results = FALSE; - while($row = db_fetch_array($result)) { + while ($row = db_fetch_array($result)) { $has_results = TRUE; $node = node_load($row['nid']); if (node_access('view', $node)) { @@ -452,9 +448,9 @@ function fedora_attach_file_download($filepath) { * @return str: the correct URL */ function _fedora_attach_create_url($file) { - if ( _fedora_attach_is_file_in_repository( $file->filepath)) { + if (_fedora_attach_is_file_in_repository($file->filepath)) { $href = $GLOBALS['base_url'] . $file->filepath; - } + } else { $href = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path()))); } @@ -486,6 +482,6 @@ function _fedora_attach_starts_with($str, $start) { * @param string $filepath * @param int $fid */ -function _fedora_attach_update_filepath( $filepath, $fid ) { +function _fedora_attach_update_filepath($filepath, $fid) { db_query("UPDATE {files} SET filepath = '%s' WHERE fid=%d", $filepath, $fid); } diff --git a/plugins/fedora_imageapi.module b/plugins/fedora_imageapi.module index 3f0a4a99..f3bd4481 100644 --- a/plugins/fedora_imageapi.module +++ b/plugins/fedora_imageapi.module @@ -1,5 +1,6 @@ getMimeType( $pid, $dsid); - $ext = substr( strstr($mimetype, '/'), 1); + $mimetype = $obj->getMimeType($pid, $dsid); + $ext = substr(strstr($mimetype, '/'), 1); $op = (!empty($_GET['op']) ? $_GET['op'] : ''); $safe_pid = str_replace(':', '_', $pid); - - $cache_key = 'fedora_repository_image_manip_'.md5($safe_pid.'_'.$dsid.'_'.$ext.'_'.$op.(isset($_GET['width'])?'_'.$_GET['width']:'').(isset($_GET['height'])?'_'.$_GET['height']:'')); - if (($file=cache_get($cache_key))===0) - { + + $cache_key = 'fedora_repository_image_manip_' . md5($safe_pid . '_' . $dsid . '_' . $ext . '_' . $op . (isset($_GET['width']) ? '_' . $_GET['width'] : '') . (isset($_GET['height']) ? '_' . $_GET['height'] : '')); + if (($file = cache_get($cache_key)) === 0) { //added the slash as sys_get_temp_dir in linux does not seem to include the slash - $tmp_file_name = sys_get_temp_dir() .'/'. $safe_pid . '_'. $dsid . '.'. $ext; - $handle = fopen( $tmp_file_name, "w"); + $tmp_file_name = sys_get_temp_dir() . '/' . $safe_pid . '_' . $dsid . '.' . $ext; + $handle = fopen($tmp_file_name, "w"); $numbytes = fwrite($handle, $obj->getStream($pid, $dsid)); fclose($handle); if ($numbytes == 0) { return; } - - - $image = imageapi_image_open( $tmp_file_name); - + + + $image = imageapi_image_open($tmp_file_name); + switch ($op) { case 'scale': - if (!empty( $_GET['height'] ) || !empty( $_GET['width'])) { - imageapi_image_scale($image, $_GET['width'], $_GET['height']); - } - case 'centerscale': - if (!empty($_GET['height']) && !empty($_GET['width'])) { - imageapi_image_scale_and_crop($image, $_GET['width'], $_GET['height']); - - } + if (!empty($_GET['height']) || !empty($_GET['width'])) { + imageapi_image_scale($image, $_GET['width'], $_GET['height']); + } + case 'centerscale': + if (!empty($_GET['height']) && !empty($_GET['width'])) { + imageapi_image_scale_and_crop($image, $_GET['width'], $_GET['height']); + } } imageapi_image_close($image); $file = file_get_contents($tmp_file_name); - cache_set($cache_key,$file,'cache',time()+variable_get('fedora_image_blocks_cache_time',3600)); + cache_set($cache_key, $file, 'cache', time() + variable_get('fedora_image_blocks_cache_time', 3600)); file_delete($tmp_file_name); - } else { + } + else { $file = $file->data; } - + header("Content-type: $mimetype"); - header('Content-Disposition: attachment; filename="'. $dsid . '.'. $ext . '"'); + header('Content-Disposition: attachment; filename="' . $dsid . '.' . $ext . '"'); echo $file; - - + + // return "$numbytes bytes written to ".sys_get_temp_dir()."$pid_$dsid.$ext\n"; } @@ -79,38 +79,38 @@ function fedora_repository_image_manip($pid = '', $dsid = '', $op = '', $params * @param unknown_type $form_state * @param unknown_type $form_id */ - /* -function fedora_imageapi_form_alter( &$form, $form_state, $form_id) { - +/* + function fedora_imageapi_form_alter( &$form, $form_state, $form_id) { + switch ( $form_id ) { - case 'fedora_repository_admin': - - $fedora_base_url = $form['fedora_base_url']['#default_value']; - - $fedora_server_url = substr($fedora_base_url,0,strpos($fedora_base_url,'/',7)); - // Add the Djatoka server location. Set it to default to the same server as fedora. - $form['djatoka_server_url'] = array ( - '#type' => 'textfield', - '#title' => '

      '.t('Fedora Image API Module').'


      '.t('aDORe Djatoka image server resolver URL'), - '#default_value' => variable_get('djatoka_server_url', $fedora_server_url.'/adore-djatoka/resolver' ), - '#description' => t('The location of your aDORe Djatoka image server, if you have one installed.'), - '#weight' => 1, - ); - $form['openlayers_server_url'] = array( - '#type' => 'textfield', - '#title' => t('OpenLayers servlet URL'), - '#default_value' => variable_get('openlayers_server_url', $fedora_server_url.'/islandora/OpenLayers'), - '#description' => t('URL of your installation of the OpenLayers servlet, if you have one.'), - '#weight' => 1, - ); - $form['buttons']['#weight'] = 2; - break; + case 'fedora_repository_admin': + + $fedora_base_url = $form['fedora_base_url']['#default_value']; + + $fedora_server_url = substr($fedora_base_url,0,strpos($fedora_base_url,'/',7)); + // Add the Djatoka server location. Set it to default to the same server as fedora. + $form['djatoka_server_url'] = array ( + '#type' => 'textfield', + '#title' => '

      '.t('Fedora Image API Module').'


      '.t('aDORe Djatoka image server resolver URL'), + '#default_value' => variable_get('djatoka_server_url', $fedora_server_url.'/adore-djatoka/resolver' ), + '#description' => t('The location of your aDORe Djatoka image server, if you have one installed.'), + '#weight' => 1, + ); + $form['openlayers_server_url'] = array( + '#type' => 'textfield', + '#title' => t('OpenLayers servlet URL'), + '#default_value' => variable_get('openlayers_server_url', $fedora_server_url.'/islandora/OpenLayers'), + '#description' => t('URL of your installation of the OpenLayers servlet, if you have one.'), + '#weight' => 1, + ); + $form['buttons']['#weight'] = 2; + break; + } } -} -function show_openlayers_viewer() { + function show_openlayers_viewer() { $output = 'Hi.'; - + return $output; -} -*/ + } + */ diff --git a/plugins/herbarium.inc b/plugins/herbarium.inc index 3af6f8bd..3393398d 100644 --- a/plugins/herbarium.inc +++ b/plugins/herbarium.inc @@ -1,9 +1,10 @@ pid = $pid; @@ -15,7 +16,7 @@ class Herbarium { // We don't need to add anything beyond the standard Darwin Core form so just pass this through // If we wanted to we could add other fields. module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); - + $dwc = new DarwinCore($this->item); return $dwc->buildDrupalForm($form); } @@ -34,7 +35,7 @@ class Herbarium { '#type' => 'hidden', '#value' => "DARWIN_CORE", ); - + return $this->buildDrupalForm($form); } @@ -52,7 +53,7 @@ class Herbarium { $dwc->handleForm($form_values); $this->item->purge_datastream('DARWIN_CORE'); $this->item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', - 'Darwin Core Metadata', 'text/xml', 'X'); + 'Darwin Core Metadata', 'text/xml', 'X'); return TRUE; } @@ -70,32 +71,31 @@ class Herbarium { $dwc = new DarwinCore(); $dwc->handleForm($form_values); $label = $form_values['dwc:institutionCode'] . ':' - . $form_values['dwc:collectionCode'] . ':' - . $form_values['dwc:catalogNumber']; + . $form_values['dwc:collectionCode'] . ':' + . $form_values['dwc:catalogNumber']; $new_item = Fedora_Item::ingest_new_item($form_values['pid'], 'A', $label, - $user->name); + $user->name); $new_item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', - 'Darwin Core Metadata', 'text/xml', 'X'); + 'Darwin Core Metadata', 'text/xml', 'X'); $file = $form_values['ingest-file-location']; - if (!empty( $file)) { + if (!empty($file)) { $dformat = $mimetype->getType($file); $new_item->add_datastream_from_file($file, 'FULL_SIZE', - "$label-full-size", $dformat, 'M'); + "$label-full-size", $dformat, 'M'); } $new_item->add_relationship('hasModel', $form_values['content_model_pid'], FEDORA_MODEL_URI); $new_item->add_relationship(!empty($form_values['relationship']) ? $form_values['relationship'] : 'isMemberOfCollection', $form_values['collection_pid']); - + if (!empty($_SESSION['fedora_ingest_files'])) { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $created_file) { $created_file_format = $mimetype->getType($created_file); $created_filename = strstr($created_file, $file); $new_item->add_datastream_from_file($created_file, $dsid, - $created_filename, $created_file_format, 'M'); - + $created_filename, $created_file_format, 'M'); } } } @@ -106,15 +106,15 @@ class Herbarium { global $base_url; $tabset = array(); - + global $user; $qs = ''; if ($user->uid != 0) { - $qs = '?uid='. base64_encode($user->name . ':'. $user->pass); + $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } - $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; - $html = ''; + $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; + $html = ''; $tabset['second_tab'] = array( // $collection_fieldset = array ( '#type' => 'tabpage', @@ -126,8 +126,8 @@ class Herbarium { '#type' => 'tabpage', '#title' => t('View'), // This will be the content of the tab. - '#content' => ''. '

      '. drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '

      ', + '#content' => '' . '

      ' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '

      ', ); $dwc = new DarwinCore($this->item); @@ -138,7 +138,7 @@ class Herbarium { $tabset['third_tab']['tabset'] = array( '#type' => 'tabset', ); - + $tabset['third_tab']['tabset']['view'] = array( '#type' => 'tabpage', '#title' => t('Darwin Core'), @@ -168,4 +168,5 @@ class Herbarium { } return $tabset; } + } diff --git a/plugins/islandora_newspaper/Newspaper.inc b/plugins/islandora_newspaper/Newspaper.inc index 980479a9..5f70dea4 100644 --- a/plugins/islandora_newspaper/Newspaper.inc +++ b/plugins/islandora_newspaper/Newspaper.inc @@ -1,10 +1,10 @@ 'textfield', '#title' => 'Custom PID', - '#description' => 'If you want to manually specify the PID for the new object, enter it here. '. - 'Leave it blank for an automatically-generated PID.', + '#description' => 'If you want to manually specify the PID for the new object, enter it here. ' . + 'Leave it blank for an automatically-generated PID.', ); - + $form['mods'] = array( '#tree' => TRUE, '#prefix' => '
      ', @@ -32,12 +32,11 @@ class Newspaper { '#type' => 'textarea', '#title' => 'MODS Record to Import', '#rows' => 20, - ); - + return $form; } - + public function handleIngestForm($form_values, &$form_state) { /* * process the metadata form @@ -53,22 +52,22 @@ class Newspaper { $mods_item = $mods_list_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'mods')->item(0); $new_mods_item = $mods_item_doc->importNode($mods_item, TRUE); $mods_item_doc->appendChild($new_mods_item); - + $title_info = $mods_item_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'titleInfo')->item(0); $title = ''; - foreach(array('nonSort', 'title') as $title_field) { + foreach (array('nonSort', 'title') as $title_field) { $title .= $title_info->getElementsByTagNameNS('http://www.loc.gov/mods/v3', $title_field)->item(0)->nodeValue; } - + $mods_text = $mods_item_doc->saveXML(); global $user; $mimetype = new MimeClass(); - + $new_item = Fedora_Item::ingest_new_item(!empty($form_values['custom_pid']) ? $form_values['custom_pid'] : $form_values['pid'], 'A', $title, - $user->name); - + $user->name); + $new_item->add_datastream_from_string($mods_text, 'MODS', - 'MODS Metadata', 'text/xml', 'X'); + 'MODS Metadata', 'text/xml', 'X'); $dc = transform_mods_to_dc($mods_text); if ($dc) { @@ -76,17 +75,16 @@ class Newspaper { $dc_doc = simplexml_load_string($dc); $dc_doc->registerXPathNamespace('oai_dc', 'http://www.openarchives.org/OAI/2.0/oai_dc/'); $dc_item = $dc_doc->xpath('//oai_dc:dc'); - foreach($dc_item as $node) { + foreach ($dc_item as $node) { $node->addChild('dc:identifier', $new_item->pid, 'http://purl.org/dc/elements/1.1/'); } $new_item->modify_datastream_by_value($dc_doc->saveXML(), 'DC', 'Dublin Core XML Metadata', 'text/xml'); } $new_item->add_relationship('hasModel', $form_values['content_model_pid'], FEDORA_MODEL_URI); $new_item->add_relationship(!empty($form_values['relationship']) ? $form_values['relationship'] : 'isMemberOfCollection', $form_values['collection_pid']); - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($new_item->pid, 'fedora/repository/'. $new_item->pid))), "status"); - + drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($new_item->pid, 'fedora/repository/' . $new_item->pid))), "status"); } - + public function showFieldSets() { module_load_include('inc', 'fedora_ilives', 'book'); global $base_url; @@ -100,11 +98,11 @@ class Newspaper { global $user; $qs = ''; if ($user->uid != 0) { - $qs = '?uid='. base64_encode($user->name . ':'. $user->pass); + $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } - $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; - $html = ''; + $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; + $html = ''; $tabset['read'] = array( '#type' => 'tabpage', @@ -114,7 +112,7 @@ class Newspaper { ); $item = new Fedora_Item($this->pid); - + $tabset['description'] = array( '#type' => 'tabpage', '#title' => 'Description', @@ -141,11 +139,11 @@ class Newspaper { global $user; $qs = ''; if ($user->uid != 0) { - $qs = '?uid='. base64_encode($user->name . ':'. $user->pass); + $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } - $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; - $html = ''; + $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; + $html = ''; $tabset['first_tab'] = array( '#type' => 'tabpage', @@ -162,8 +160,8 @@ class Newspaper { if (strstr($rel['predicate'], 'isPartOf')) { $parent_pid = $rel['object']; break; - } - } + } + } $parent_item = new Fedora_Item($parent_pid); $tabset['second_tab'] = array( '#type' => 'tabpage', @@ -173,4 +171,5 @@ class Newspaper { return $tabset; } + } diff --git a/plugins/islandora_newspaper/islandora_newspaper.module b/plugins/islandora_newspaper/islandora_newspaper.module index 00184676..03e67e66 100644 --- a/plugins/islandora_newspaper/islandora_newspaper.module +++ b/plugins/islandora_newspaper/islandora_newspaper.module @@ -40,17 +40,17 @@ function islandora_newspaper_required_fedora_objects() { 'datastream_file' => NULL, 'dsversion' => NULL, ), - array ( + array( 'pid' => 'newspapers:collection', 'label' => 'Newspapers Collection', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:demos', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/newspapers_collection_policy.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/Crystal_Clear_mimetype_document.png", 'mimetype' => 'image/png', diff --git a/plugins/islandora_newspaper/newspapers_collection_policy.xml b/plugins/islandora_newspaper/newspapers_collection_policy.xml index 3880f937..86f1027e 100644 --- a/plugins/islandora_newspaper/newspapers_collection_policy.xml +++ b/plugins/islandora_newspaper/newspapers_collection_policy.xml @@ -1,21 +1,22 @@ + - - - - - 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 - - isMemberOfCollection + + + + + 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 + + isMemberOfCollection diff --git a/plugins/islandora_newspaper/newspapers_guardian.xml b/plugins/islandora_newspaper/newspapers_guardian.xml index be9a63da..a198db9c 100644 --- a/plugins/islandora_newspaper/newspapers_guardian.xml +++ b/plugins/islandora_newspaper/newspapers_guardian.xml @@ -1,378 +1,379 @@ - - - - - - - - - + + + + + + + + - - - - - modifyDatastreamByValue - MODS - fedoraAdmin - 2010-05-28T18:38:36.223Z - - - - - ingest - - fedoraAdmin - 2010-05-31T15:14:58.313Z - Ingested from local file /Users/al/Desktop/newspapers_guardian.xml - - - - - - - - - + + + + modifyDatastreamByValue + MODS + fedoraAdmin + 2010-05-28T18:38:36.223Z + + + + + ingest + + fedoraAdmin + 2010-05-31T15:14:58.313Z + Ingested from local file /Users/al/Desktop/newspapers_guardian.xml + + + + + + + + + - This is an object-specific policy. It could be stored inside the digital object in the POLICY datastream OR in the directory for object-specific policies. (The directory location is set in the Authorization module configuration in the Fedora server configuration file (fedora.fcfg). By using multiple policy Rules, this policy shows how to deny access to all raw datastreams in the object except to particular users (e.g., the object owners). It also shows how to deny access to a particular disseminations to selected user roles. - - - - - - - - - - - urn:fedora:names:fedora:2.1:action:id-ingest - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByReference - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByValue - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeObject - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeDatastream - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-setDatastreamState - - - - - - urn:fedora:names:fedora:2.1:action:id-setDisseminatorState - - - - - - urn:fedora:names:fedora:2.1:action:id-setDatastreamVersionable - - - - - - urn:fedora:names:fedora:2.1:action:id-addDatastream - - - - - - urn:fedora:names:fedora:2.1:action:id-addDisseminator - - - - - - - - - - This is an object-specific policy. It could be stored inside the digital object in the POLICY datastream OR in the directory for object-specific policies. (The directory location is set in the Authorization module configuration in the Fedora server configuration file (fedora.fcfg). By using multiple policy Rules, this policy shows how to deny access to all raw datastreams in the object except to particular users (e.g., the object owners). It also shows how to deny access to a particular disseminations to selected user roles. + + + + + + + + + + + urn:fedora:names:fedora:2.1:action:id-ingest + + + + + + urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByReference + + + + + + urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByValue + + + + + + urn:fedora:names:fedora:2.1:action:id-modifyDisseminator + + + + + + urn:fedora:names:fedora:2.1:action:id-modifyDisseminator + + + + + + urn:fedora:names:fedora:2.1:action:id-purgeObject + + + + + + urn:fedora:names:fedora:2.1:action:id-purgeDatastream + + + + + + urn:fedora:names:fedora:2.1:action:id-purgeDisseminator + + + + + + urn:fedora:names:fedora:2.1:action:id-setDatastreamState + + + + + + urn:fedora:names:fedora:2.1:action:id-setDisseminatorState + + + + + + urn:fedora:names:fedora:2.1:action:id-setDatastreamVersionable + + + + + + urn:fedora:names:fedora:2.1:action:id-addDatastream + + + + + + urn:fedora:names:fedora:2.1:action:id-addDisseminator + + + + + + + + + + - - administrator - - - - + administrator + + + + - - fedoraAdmin - - - - - - - - - - - - - - - - - + fedoraAdmin + + + + + + + + + + + + + + + + + - - + - The Guardian - Guardian (Charlottetown, P.E.I.) - The Island guardian - The Charlottetown guardian - The Morning guardian - Newspapers - Newspapers - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. + The Guardian + Guardian (Charlottetown, P.E.I.) + The Island guardian + The Charlottetown guardian + The Morning guardian + Newspapers + Newspapers + The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. - .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - Hood, J. P. - 1887-1920 - Text - v. - microfilm - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - newspapers:guardian - eng - Prince Edward Island - Charlottetown (P.E.I.) - - - - - - - - + Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. + Ceased publication in 1920? + Missing issues. + Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. + Hood, J. P. + 1887-1920 + Text + v. + microfilm + http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 + newspapers:guardian + eng + Prince Edward Island + Charlottetown (P.E.I.) + + + + + + + + - - The - Guardian - - - Guardian (Charlottetown, P.E.I.) - - - The - Island guardian - - - The - Charlottetown guardian - - - The - Morning guardian - - - Hood, J. P. - - - Manager - - + + The + Guardian + + + Guardian (Charlottetown, P.E.I.) + + + The + Island guardian + + + The + Charlottetown guardian + + + The + Morning guardian + + + Hood, J. P. + + + Manager + + Business Manager from Dec. 29, 1891 - Mar. 9, 1903; Managing Director from July 2, 1912 - Jan. 30, 1913. - - - text - - - pic - - - Charlottetown, P.E.I - - 1887-1920 - 1887 - 1920 - continuing - - - eng - - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. + + + text + + + pic + + + Charlottetown, P.E.I + + 1887-1920 + 1887 + 1920 + continuing + + + eng + + The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - - - microfilm -
      microform
      - v. -
      - Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - - Prince Edward Island - Newspapers - - - Charlottetown (P.E.I.) - Newspapers - - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - - CaPCU - 760913 - 20090407151822.0 - -
      -
      -
      - - - + +
      microfilm
      +
      microform
      + v. +
      + Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. + Ceased publication in 1920? + Missing issues. + Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. + + Prince Edward Island + Newspapers + + + Charlottetown (P.E.I.) + Newspapers + + http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 + + CaPCU + 760913 + 20090407151822.0 + +
      +
      +
      + + + - - The - Guardian - - - Guardian (Charlottetown, P.E.I.) - - - The - Island guardian - - - The - Charlottetown guardian - - - The - Morning guardian - - - Hood, J. P. - - - Manager - - + + The + Guardian + + + Guardian (Charlottetown, P.E.I.) + + + The + Island guardian + + + The + Charlottetown guardian + + + The + Morning guardian + + + Hood, J. P. + + + Manager + + Business Manager from Dec. 29, 1891 - Mar. 9, 1903; Managing Director from July 2, 1912 - Jan. 30, 1913. - - - text - - - pic - - - Charlottetown, P.E.I - - 1887-1920 - 1887 - 1920 - continuing - - - eng - - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. + + + text + + + pic + + + Charlottetown, P.E.I + + 1887-1920 + 1887 + 1920 + continuing + + + eng + + The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - - -
      microfilm
      -
      microform
      - v. -
      - Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - - Prince Edward Island - Newspapers - - - Charlottetown (P.E.I.) - Newspapers - - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - - CaPCU - 760913 - 20090407151822.0 - -
      -
      -
      -
      - - + +
      microfilm
      +
      microform
      + v. +
      + Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. + Ceased publication in 1920? + Missing issues. + Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. + + Prince Edward Island + Newspapers + + + Charlottetown (P.E.I.) + Newspapers + + http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 + + CaPCU + 760913 + 20090407151822.0 + + + +
      +
      + + - - + - - - - - - - - + + + + + + +
      +
      diff --git a/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml b/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml index 81a8f894..3346fec8 100644 --- a/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml +++ b/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml @@ -1,24 +1,25 @@ + - - text/xml - - - - text/xml - - - - - - - - - - - - - - - - + + text/xml + + + + text/xml + + + + + + + + + + + + + + + + diff --git a/plugins/islandora_newspaper/newspapers_pageCModel.xml b/plugins/islandora_newspaper/newspapers_pageCModel.xml index 99e3f94e..00364347 100644 --- a/plugins/islandora_newspaper/newspapers_pageCModel.xml +++ b/plugins/islandora_newspaper/newspapers_pageCModel.xml @@ -1,81 +1,81 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2010-05-28T19:37:09.514Z - Created with Admin GUI "New Object" command - - - - ingest - - fedoraAdmin - 2010-05-31T15:15:26.657Z - Ingested from local file /Users/al/Desktop/newspapers_pageCModel.xml - - - - ingest - - fedoraAdmin - 2010-06-01T13:22:40.275Z - Ingested from local file /Users/aoneill/fedora_repository/plugins/newspaper/newspapers_pageCModel.xml - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-06-21T16:26:53.809Z - DatastreamsPane generated this logMessage. - - - - ingest - - fedoraAdmin - 2010-06-21T19:39:20.139Z - Ingested from source repository with pid newspapers:pageCModel - - - - - - - + + + + ingest + + fedoraAdmin + 2010-05-28T19:37:09.514Z + Created with Admin GUI "New Object" command + + + + ingest + + fedoraAdmin + 2010-05-31T15:15:26.657Z + Ingested from local file /Users/al/Desktop/newspapers_pageCModel.xml + + + + ingest + + fedoraAdmin + 2010-06-01T13:22:40.275Z + Ingested from local file /Users/aoneill/fedora_repository/plugins/newspaper/newspapers_pageCModel.xml + + + + addDatastream + ISLANDORACM + fedoraAdmin + 2010-06-21T16:26:53.809Z + DatastreamsPane generated this logMessage. + + + + ingest + + fedoraAdmin + 2010-06-21T19:39:20.139Z + Ingested from source repository with pid newspapers:pageCModel + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - + + + 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 @@ -88,62 +88,62 @@ demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - -
      - - - - - - - + + + + + + + + + - - + - Newspaper Page Content Model - newspapers:pageCModel - - - - - - Newspaper Page Content Model + newspapers:pageCModel + + + + + + - - - - - - - plugins/Newspaper.inc - Newspaper - showPageFieldSets - - - - - - - - - - - - plugins/Newspaper.inc - Newspaper - buildEditMetadataForm - - - plugins/Newspaper.inc - Newspaper - handleEditMetadataForm - - - - - - + + + + + + + plugins/Newspaper.inc + Newspaper + showPageFieldSets + + + + + + + + + + + + plugins/Newspaper.inc + Newspaper + buildEditMetadataForm + + + plugins/Newspaper.inc + Newspaper + handleEditMetadataForm + + + + + + diff --git a/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml b/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml index d6fd2349..d2879675 100644 --- a/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml +++ b/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml @@ -1,172 +1,172 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2010-05-31T20:54:30.053Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2010-05-31T20:55:13.521Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-05-31T20:55:35.100Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2010-05-31T20:55:59.039Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-31T20:57:54.728Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-05-31T20:59:03.704Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2010-05-31T20:54:30.053Z + Created with Admin GUI "New Object" command + + + + modifyDatastreamByValue + DSINPUTSPEC + fedoraAdmin + 2010-05-31T20:55:13.521Z + + + + + modifyDatastreamByValue + METHODMAP + fedoraAdmin + 2010-05-31T20:55:35.100Z + + + + + modifyDatastreamByValue + WSDL + fedoraAdmin + 2010-05-31T20:55:59.039Z + + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-05-31T20:57:54.728Z + + + + + modifyDatastreamByValue + METHODMAP + fedoraAdmin + 2010-05-31T20:59:03.704Z + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - + + This METHODMAP datastream is included as a starting point to assist in the creation of a service deployment. The METHODMAP should define the the mapping of the WSDL to Fedora object methods. - - - - + + + - - - - - + + + + - - - - - - - - + + + + + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - + + This DSINPUTSPEC datastream is included as a starting point to assist in the creation of a service deployment. The DSINPUTSPEC should define the datastreams to be used by WSDL-defined methods. - - - - + + + - - - - DC - text/xml - - - - - - - - + + + DC + text/xml + + + + + + + + - - + + This WSDL datastream is included as a starting point to assist in the creation of a service deployment. The WSDL should define the services provided by this @@ -178,64 +178,64 @@ demo:2, demo:13, demo:20, and demo:28. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - Viewer service deployment for Newspaper content model - newspapers:viewerSdep-issueCModel - - - - + Viewer service deployment for Newspaper content model + newspapers:viewerSdep-issueCModel + + + + diff --git a/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml b/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml index de804348..46908d60 100644 --- a/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml +++ b/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml @@ -1,148 +1,148 @@ - - - - - - - - - + + + + + + + + - - - - - ingest - - fedoraAdmin - 2010-06-21T17:47:30.096Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-21T17:49:00.674Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-06-21T17:50:01.411Z - - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2010-06-21T17:50:23.252Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2010-06-21T17:51:49.022Z - - - - - - - - + + + + ingest + + fedoraAdmin + 2010-06-21T17:47:30.096Z + Created with Admin GUI "New Object" command + + + + modifyDatastreamByValue + RELS-EXT + fedoraAdmin + 2010-06-21T17:49:00.674Z + + + + + modifyDatastreamByValue + METHODMAP + fedoraAdmin + 2010-06-21T17:50:01.411Z + + + + + modifyDatastreamByValue + DSINPUTSPEC + fedoraAdmin + 2010-06-21T17:50:23.252Z + + + + + modifyDatastreamByValue + WSDL + fedoraAdmin + 2010-06-21T17:51:49.022Z + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - + + This METHODMAP datastream is included as a starting point to assist in the creation of a service deployment. The METHODMAP should define the the mapping of the WSDL to Fedora object methods. - - - - + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - + + This DSINPUTSPEC datastream is included as a starting point to assist in the creation of a service deployment. The DSINPUTSPEC should define the datastreams to be used by WSDL-defined methods. - - - - + + + - - - - DC - text/xml - - - - - - - - + + + DC + text/xml + + + + + + + + - - + + This WSDL datastream is included as a starting point to assist in the creation of a service deployment. The WSDL should define the services provided by this @@ -154,64 +154,64 @@ demo:2, demo:13, demo:20, and demo:28. For more information about the demonstration objects, see: http://fedora-commons.org/confluence/x/AwFI. - - - - + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - Viewer for newspaper pages - newspapers:viewerSdep-pageCModel - - - - + Viewer for newspaper pages + newspapers:viewerSdep-pageCModel + + + + diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index 0a1bda62..7df4a2c1 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -1,8 +1,10 @@ pid = $pid; @@ -27,8 +29,8 @@ class ShowMapStreamsInFieldSets { $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } - $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; - $html = ''; + $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; + $html = ''; drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css'); @@ -46,9 +48,10 @@ class ShowMapStreamsInFieldSets { '#type' => 'tabpage', '#title' => t('Description'), '#content' => $item->get_dissemination('islandora:mods2htmlSdef', 'mods2html') - . $objectHelper->get_formatted_datastream_list($this->pid, NULL, $item), + . $objectHelper->get_formatted_datastream_list($this->pid, NULL, $item), ); // Render the tabset. return tabs_render($tabset); } + } diff --git a/plugins/pidfield/pidfield.install b/plugins/pidfield/pidfield.install index 2a45a34c..1ce6a073 100644 --- a/plugins/pidfield/pidfield.install +++ b/plugins/pidfield/pidfield.install @@ -1,5 +1,6 @@ t('Maximum length'), '#default_value' => is_numeric($field['max_length']) ? $field['max_length'] : 64, '#required' => FALSE, - // Use #element_validate to validate the settings. '#element_validate' => array('_pidfield_length_validate'), '#description' => t('The maximum length of the field in characters. Must be a number between 1 and 255'), @@ -94,7 +93,7 @@ function pidfield_field_settings($op, $field) { $data = content_views_field_views_data($field); $db_info = content_database_info($field); $table_alias = content_views_tablename($field); - $field_data = $data[$table_alias][$field['field_name'] .'_value']; + $field_data = $data[$table_alias][$field['field_name'] . '_value']; // Make changes to $data as needed here. return $data; } @@ -107,7 +106,7 @@ function pidfield_field_settings($op, $field) { */ function _pidfield_length_validate($element, &$form_state) { $value = $form_state['values']['max_length']; - if ($value && !is_numeric($value)|| $value < 1 || $value > 255) { + if ($value && !is_numeric($value) || $value < 1 || $value > 255) { form_set_error('max_length', t('"Max length" must be a number between 1 and 64.')); } } @@ -128,7 +127,8 @@ function pidfield_field($op, &$node, $field, &$items, $teaser, $page) { // set an error on the right sub-element when // fields are deeply nested in the form. $error_element = isset($item['_error_element']) ? $item['_error_element'] : ''; - if (is_array($item) && isset($item['_error_element'])) unset($item['_error_element']); + if (is_array($item) && isset($item['_error_element'])) + unset($item['_error_element']); if (!empty($item['value'])) { if (!empty($field['max_length']) && drupal_strlen($item['value']) > $field['max_length']) { form_set_error($error_element, t('%name: the value may not be longer than %max characters.', array('%name' => $field['widget']['label'], '%max' => $field['max_length']))); @@ -190,7 +190,7 @@ function pidfield_token_list($type = 'all') { if ($type == 'field' || $type == 'all') { $tokens = array(); - $tokens['pidfield']['raw'] = t('Just the PID itself.'); + $tokens['pidfield']['raw'] = t('Just the PID itself.'); $tokens['pidfield']['formatted'] = t('A PID with a hyperlink'); return $tokens; @@ -201,7 +201,7 @@ function pidfield_token_values($type, $object = NULL) { if ($type == 'field') { $item = $object[0]; - $tokens['raw'] = $item['value']; + $tokens['raw'] = $item['value']; $tokens['formatted'] = isset($item['view']) ? $item['view'] : ''; return $tokens; } @@ -274,7 +274,7 @@ function pidfield_field_formatter_info() { */ function theme_pidfield_formatter_default($element) { $pid = $element['#item']['safe']; - if(!empty($pid)) { + if (!empty($pid)) { return fedora_repository_get_items($pid); } return null; @@ -429,33 +429,31 @@ function get_node_references_for_fedora_item($item) { while ($field = db_fetch_array($result)) { - $db_info = content_database_info($field); + $db_info = content_database_info($field); - $ids = db_query("SELECT nid FROM {". $db_info['table'] ."} WHERE ". $field['field_name'] ."_value=\"". $item->pid."\""); + $ids = db_query("SELECT nid FROM {" . $db_info['table'] . "} WHERE " . $field['field_name'] . "_value=\"" . $item->pid . "\""); - $results = array(); - while ($data = db_fetch_object($ids)) { - //$additions[] = node_load($data->vid); + $results = array(); + while ($data = db_fetch_object($ids)) { + //$additions[] = node_load($data->vid); - $results[] = $data->nid; + $results[] = $data->nid; - //$referred_node = node_load(array('nid'=>$data->nid) ); - - } - return $results; + //$referred_node = node_load(array('nid'=>$data->nid) ); + } + return $results; } - } function fedora_pidfield_redirect_to_node($item) { $node_references = get_node_references_for_fedora_item($item); if (!empty($node_references)) { - if (strstr( drupal_get_destination(), urlencode('fedora/repository'))) { - drupal_goto(drupal_get_path_alias("node/".$node_references[0])); + if (strstr(drupal_get_destination(), urlencode('fedora/repository'))) { + drupal_goto(drupal_get_path_alias("node/" . $node_references[0])); } } } \ No newline at end of file diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index 996b12b6..d156f5e1 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -1,8 +1,10 @@ pid = $pid; @@ -16,26 +18,27 @@ class ShowQtStreamsInFieldSets { $data = $defaults; try { - $src = ObjectHelper::getStream($this->pid, $dsid); - - $doc = new SimpleXMLElement($src); - $doc->registerXPathNamespace('File', 'http://ns.exiftool.ca/File/1.0/'); - $doc->registerXPathNamespace('Composite', 'http://ns.exiftool.ca/Composite/1.0/'); - $mime = reset($doc->xpath('//File:MIMEType')); - $data['mime'] = $mime; - if(strpos($mime, 'audio/') !== false) { - $data['width'] = 300; - $data['height'] = 0; - } else { - $size = reset($doc->xpath('//Composite:ImageSize/text()')); - list($width, $height) = explode('x', $size); - $data['width'] = $width; - $data['height'] = $height; - } + $src = ObjectHelper::getStream($this->pid, $dsid); + + $doc = new SimpleXMLElement($src); + $doc->registerXPathNamespace('File', 'http://ns.exiftool.ca/File/1.0/'); + $doc->registerXPathNamespace('Composite', 'http://ns.exiftool.ca/Composite/1.0/'); + $mime = reset($doc->xpath('//File:MIMEType')); + $data['mime'] = $mime; + if (strpos($mime, 'audio/') !== FALSE) { + $data['width'] = 300; + $data['height'] = 0; + } + else { + $size = reset($doc->xpath('//Composite:ImageSize/text()')); + list($width, $height) = explode('x', $size); + $data['width'] = $width; + $data['height'] = $height; + } - $data['doc'] = $src; - } catch(Exception $e) { - $data = $defaults; + $data['doc'] = $src; + } catch (Exception $e) { + $data = $defaults; } return $data; @@ -43,27 +46,27 @@ class ShowQtStreamsInFieldSets { function getPosterFrameDatastreamInfo($dsid = 'FULL_SIZE') { $p = ObjectHelper::getDatastreamInfo($this->pid, $dsid); - if(empty($p) || $p == ' ' || $p === false) { - return false; + if (empty($p) || $p == ' ' || $p === FALSE) { + return FALSE; } return $p; } function getMediaDatastreamInfo($dsid = 'OBJ', $alt = array('')) { $p = ObjectHelper::getDatastreamInfo($this->pid, $dsid); - if(empty($p) || $p == ' ' || $p === false) { - if(!empty($alt)) { - $ds = array_shift($alt); - return $this->getMediaDatastreamInfo($ds, $alt); + if (empty($p) || $p == ' ' || $p === FALSE) { + if (!empty($alt)) { + $ds = array_shift($alt); + return $this->getMediaDatastreamInfo($ds, $alt); } - return false; + return FALSE; } return $p; } function enableDownload() { - return false; + return FALSE; } function showQt() { @@ -77,32 +80,32 @@ class ShowQtStreamsInFieldSets { $pframe = $this->getPosterFrameDatastreamInfo(); $media = $this->getMediaDatastreamInfo('PROXY', array('OBJ')); - if($media === false ) { + if ($media === FALSE) { return ''; } global $base_url; $path = drupal_get_path('module', 'Fedora_Repository'); - $fullPath=base_path().$path; - $content= ''; - $pathTojs = drupal_get_path('module', 'Fedora_Repository').'/js/AC_Quicktime.js'; + $fullPath = base_path() . $path; + $content = ''; + $pathTojs = drupal_get_path('module', 'Fedora_Repository') . '/js/AC_Quicktime.js'; drupal_add_js($pathTojs); - $divid = 'player'.md5($this->pid).'MOV'; - $content .= '
      '; - if($pframe !== false) { - $content .= '
      '; - $content .= ''; + $divid = 'player' . md5($this->pid) . 'MOV'; + $content .= '
      '; + if ($pframe !== FALSE) { + $content .= '
      '; + $content .= ''; $content .= '
      '; $content .= '
      '; } $content .= '
      '; - if($this->enableDownload()) { - $url = base_path().'fedora/repository/'.$this->pid.'/OBJ/MOV.mov'; + if ($this->enableDownload()) { + $url = base_path() . 'fedora/repository/' . $this->pid . '/OBJ/MOV.mov'; $content .= 'Download Media File'; } - $src = base_path().'fedora/repository/'.$this->pid.'/' . $media->ID. '/MOV.mov'; -$qtparams = ''; - $qtparams .= "'autostart', '" . ($pframe !== false ? 'true' : 'false') . "', "; + $src = base_path() . 'fedora/repository/' . $this->pid . '/' . $media->ID . '/MOV.mov'; + $qtparams = ''; + $qtparams .= "'autostart', '" . ($pframe !== FALSE ? 'true' : 'false') . "', "; $init = << t('Quicktime'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#value' => $content); + return theme('fieldset', $collection_fieldset); + } - $collection_fieldset = array( - '#title' => t('Quicktime'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#value' => $content); - return theme('fieldset',$collection_fieldset); - } } diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index 30d2eb01..26823ce9 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -1,5 +1,6 @@ pid = $pid; } - + function showJPG() { module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); @@ -17,14 +18,14 @@ class ShowSlideStreamsInFieldSets { global $user; $tabset = array(); - + $qs = ''; if ($user->uid != 0) { $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } - $viewer_url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; - $html = ''; + $viewer_url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; + $html = ''; drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); @@ -38,10 +39,11 @@ class ShowSlideStreamsInFieldSets { '#type' => 'tabpage', '#title' => t('View'), // This will be the content of the tab. - '#content' => ''. '

      '. drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '

      ', + '#content' => '' . '

      ' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '

      ', ); - + return $tabset; } + } diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index 2b374b3c..fe524172 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -1,7 +1,8 @@ tags)) { $output = "
      - + \ No newline at end of file diff --git a/xsl/refworks.xsl b/xsl/refworks.xsl index 2ef0c8df..e021ef2b 100644 --- a/xsl/refworks.xsl +++ b/xsl/refworks.xsl @@ -1,92 +1,216 @@ - + - - -

      General Information

      - - - - - - - - - - - - - - - -
      Periodical:
      Abbreviation:
      Volume:
      Issue:
      Publisher:
      Place of Publication:
      Edition:
      Year:
      Date:
      Start Page:
      Other Pages:
      ISSN/ISBN:
      Language:
      UL:
      -
      - -

      Titles

      -
        - -
      • -
        -
      -
      - -
        -

        Secondary Titles

        - -
      • -
        -
      -
      - -

      Authors

      -
        - -
      • -
        -
      -
      + + +

      General Information

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + Periodical: + + +
      + Abbreviation: + + +
      + Volume: + + +
      + Issue: + + +
      + Publisher: + + +
      + Place of Publication: + + +
      + Edition: + + +
      + Year: + + +
      + Date: + + +
      + Start Page: + + +
      + Other Pages: + + +
      + ISSN/ISBN: + + +
      + Language: + + +
      + UL: + + +
      +
      + +

      Titles

      +
        + +
      • + +
      • +
        +
      +
      + +
        +

        Secondary Titles

        + +
      • + +
      • +
        +
      +
      + +

      Authors

      +
        + +
      • + +
      • +
        +
      +
      - -
        -

        Secondary Authors

        - -
      • -
        -
      -
      - -

      Keywords

      -
        - -
      • -
        -
      -
      - -

      Abstract

      - -
      -
      -
      - -

      Notes

      - -
      -
      -
      - - - - - http://articles.library.upei.ca:7888/godot/hold_tab.cgi?hold_tab_branch=PCU&issn=&date=&volume=&issue=&spage=&atitle=&stitle= - -
      - - - -
      + +
        +

        Secondary Authors

        + +
      • + +
      • +
        +
      +
      + +

      Keywords

      +
        + +
      • + +
      • +
        +
      +
      + +

      Abstract

      + +
      + +
      +
      +
      + +

      Notes

      + +
      + +
      +
      +
      + + + + + http://articles.library.upei.ca:7888/godot/hold_tab.cgi?hold_tab_branch=PCU&issn= + &date= + &volume= + &issue= + &spage= + &atitle= + &stitle= + + +
      + + + +
      \ No newline at end of file diff --git a/xsl/results.xsl b/xsl/results.xsl index 829822db..c697bf8e 100644 --- a/xsl/results.xsl +++ b/xsl/results.xsl @@ -1,74 +1,74 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + Total Hits = - - , - + + , + Number of Hits/page = - -
      You may not have sufficient privileges to view any or all of the items found. The objects you have rights to view will be shown below. + +
      You may not have sufficient privileges to view any or all of the items found. The objects you have rights to view will be shown below. -
      +
      - + - + - + - - - - - - + + + + + + - - + + - - - -
      - -
      - -

      Your search yielded no results

      - -
      -
        -
      • Check if your spelling is correct.
      • - -
      • Remove quotes around phrases to match each word individually: - "blue smurf" will match less than - blue smurf. -
      • -
      • Consider loosening your query with - OR: - blue smurf will match less than - blue OR smurf. -
      • -
      -
      - -
      - -
      -
      -
      - - - - - - - -
      - - - - - - - - - - - - - - - - - - - - - - - -
      -
      + + + + +
      + +

      Your search yielded no results

      + +
      +
        +
      • Check if your spelling is correct.
      • + +
      • Remove quotes around phrases to match each word individually: + "blue smurf" will match less than + blue smurf. +
      • +
      • Consider loosening your query with + OR: + blue smurf will match less than + blue OR smurf. +
      • +
      +
      + +
      + +
      + +
      + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      +
      -
      - - - + + + + - - + + - + - + - + - + - + - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fedora/repository/ - /-/ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + fedora/repository/ + /-/ + + - - - fedora/repository/ - /TN - - - + + + fedora/repository/ + /TN + + + - + - - + + + + + + + + + + + + + + + + +
      + - - + + - + - - - + + + - - + - - - - - - - - - - - - - - - -
      +
      - - + + - + - - fedora/repository/ - /-/ - - - - - -
      -
      - - + + fedora/repository/ + /-/ + + + + + +
      + + + Score:( - ) - -
      - + ) +
      +
      +
      - - fedora/repository/ - /-/ - + + fedora/repository/ + /-/ + - - - -
      + + + +
      -
      - +
      + Text Stream - - - - - -
      - - - - - - - -
      + +
      + + + +
      + + + + + + + +
      - - -
      + + +
      diff --git a/xsl/romeo.xsl b/xsl/romeo.xsl index 8fa02d4e..0f1f3d3d 100644 --- a/xsl/romeo.xsl +++ b/xsl/romeo.xsl @@ -1,29 +1,82 @@ - - - - - - -
      - Journal:
      Published By:
      Publisher Url:
      Prearchiving:
      Postprints:
      -

      Conditions

      -
        - -
      • -
        -
      + + + + + + + + + + + + + + + + + + + + + + +
      + Journal: + + +
      + Published By: + + +
      +
      + Publisher Url: + + +
      + Prearchiving: + + +
      + Postprints: + + +
      +

      Conditions

      +
        + +
      • + +
      • +
        +
      - Rights:
      - - - - Romeo Colour:
      -
      - -
      If there are no results from ROMEO shown above you can try searching manually by clicking here.
      -
      -
      + + Rights: + + +
      + + + + + Romeo Colour: + + +
      +
      + + + +
      + +
      If there are no results from + ROMEO shown above you can try searching manually by clicking + here. +
      +
      +
      \ No newline at end of file diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index 0c037f3e..43d9aeef 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -1,76 +1,110 @@ - - - - - - - - - - - - - - - - - -
      + + + + + + + + + + + + + + + + + + + +
      + + - -
      - -
      -

      + +
      +
      - -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + /fedora/repository/ + /-/ + + + - /fedora/repository//-/ - - - - - - - - - - /fedora/repository//TN - - - -
      - - - - - + /fedora/repository/ + /-/ + + + + +
      + + + + + + + + /fedora/repository/ + /TN + + + + + + +
      + + + + + + - - - - - - -
      - - -   - - - - - - - - - - + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + +
      \ No newline at end of file diff --git a/xsl/specdwc.xsl b/xsl/specdwc.xsl index 84de97d9..725800b4 100644 --- a/xsl/specdwc.xsl +++ b/xsl/specdwc.xsl @@ -4,40 +4,157 @@ xmlns:dc="http://purl.org/dc/terms/" xmlns:dwr="http://rs.tdwg.org/dwc/xsd/simpledarwincore/" xmlns:dwc="http://rs.tdwg.org/dwc/terms/"> - + - + - + - - - - - - +
      Specimen
      Scientific Name
      Family
      Genus
      Common Name
      + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - -
      + Specimen +
      Scientific Name + +
      Family + +
      Genus + +
      Common Name + +
      Location
      Continent
      Country
      Country Code
      State/Province
      County
      Locality
      Habitat
      + Location +
      Continent + +
      Country + +
      Country Code + +
      State/Province + +
      County + +
      Locality + +
      Habitat + +
      Record
      Record Type
      Language-
      Record Basis
      Occurence Remarks
      Occurence ID
      Institution Code
      Collection Code
      Catalog Number
      Recorded By
      Event Date200
      -
      + + + Record + + + + Record Type + + + + + + Language- + + + + + + Record Basis + + + + + + Occurence Remarks + + + + + + Occurence ID + + + + + + Institution Code + + + + + + Collection Code + + + + + + Catalog Number + + + + + + Recorded By + + + + + + Event Date200 + + + + + +
      diff --git a/xsl/unfilteredresults.xsl b/xsl/unfilteredresults.xsl index 110f5ea5..e2f31114 100644 --- a/xsl/unfilteredresults.xsl +++ b/xsl/unfilteredresults.xsl @@ -1,70 +1,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Total Hits = - - , - + + , + Number of Hits/page = - + -
      +
      -
      + - + - + - - - - - - + + + + + + - - + + -
      - - -
      - -
      - -

      Your search yielded no results

      - -
      -
        -
      • Check if your spelling is correct.
      • - -
      • Remove quotes around phrases to match each word individually: - "blue smurf" will match less than - blue smurf. -
      • -
      • Consider loosening your query with - OR: - blue smurf will match less than - blue OR smurf. -
      • -
      -
      - -
      - -
      -
      -
      - - - - - - - -
      - - - - - - - - - - - - - - - - - - - - - -
      -
      + + +
      + +
      + +

      Your search yielded no results

      + +
      +
        +
      • Check if your spelling is correct.
      • + +
      • Remove quotes around phrases to match each word individually: + "blue smurf" will match less than + blue smurf. +
      • +
      • Consider loosening your query with + OR: + blue smurf will match less than + blue OR smurf. +
      • +
      +
      + +
      + +
      +
      +
      + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      +
      -
      + - - - - - + + + + + - - - - - - - - fedora/repository/ - /-/ - - + + + + + + + + fedora/repository/ + /-/ + + - - - fedora/repository/ - /TN - - - + + + fedora/repository/ + /TN + + + - + - - + + + + + + + + + + + + + + + + +
      + - - + + - + - - - + + + - - + - - - - - - - - - - - - - - - -
      +
      - - + + - + - - fedora/repository/ - /-/ - - - - - -
      -
      - - + + fedora/repository/ + /-/ + + + + + +
      + + + Score:( - ) - -
      - + ) +
      +
      +
      - - fedora/repository/ - /-/ - + + fedora/repository/ + /-/ + - - - -
      + + + +
      -
      - +
      + Text Stream - - - - - -
      - - - - - - - -
      + +
      + + + +
      + + + + + + + +
      - - -
      + + +
      From acad0a299e6239b9975775e3967511c0a14828c5 Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Fri, 17 Jun 2011 14:27:47 -0300 Subject: [PATCH 002/247] ISLANDORA-278 Updated files fixing Coder errors. Mostly t() errors. --- fedora_repository.module | 16 ++++++++-------- ilives/book.inc | 5 ++++- ilives/tests/fedora_ilives.test | 5 +++-- js/printer_tool.js | 2 +- plugins/CollectionFormBuilder.inc | 1 + plugins/CreateCollection.inc | 2 +- plugins/DarwinCore.inc | 4 ++++ plugins/DemoFormBuilder.inc | 2 +- plugins/DocumentConverter.inc | 8 ++++---- plugins/Exiftool.inc | 2 +- plugins/Ffmpeg.inc | 2 +- plugins/Flv.inc | 1 + plugins/FlvFormBuilder.inc | 1 + plugins/FormBuilder.inc | 9 +++++---- plugins/ImageManipulation.inc | 2 +- plugins/ModsFormBuilder.inc | 7 +++++-- plugins/PersonalCollectionClass.inc | 11 +++++++---- plugins/Refworks.inc | 11 ++++++----- plugins/ShowDemoStreamsInFieldSets.inc | 1 + plugins/ShowStreamsInFieldSets.inc | 5 +++-- plugins/fedoraObject.inc | 5 +++++ plugins/fedora_attach/fedora_attach.admin.inc | 6 +++--- plugins/herbarium.inc | 5 ++++- plugins/islandora_newspaper/Newspaper.inc | 4 +++- plugins/map_viewer.inc | 5 ++++- plugins/qt_viewer.inc | 5 ++++- plugins/slide_viewer.inc | 5 ++++- plugins/tagging_form.inc | 1 + tests/fedora_repository.test | 5 ++--- 29 files changed, 89 insertions(+), 49 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index d7765e01..f3ece0ad 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -720,7 +720,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU if (!fedora_available()) { - drupal_set_message('The Fedora repository server is currently unavailable. Please contact the site administrator.', 'warning', FALSE); + drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); return ''; } @@ -1365,7 +1365,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); - drupal_set_message("Successfully installed islandora:ContentModelCollection.", 'message'); + drupal_set_message(t("Successfully installed islandora:ContentModelCollection."), 'message'); } catch (exception $e) { } @@ -1377,7 +1377,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); try { $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message("Successfully installed islandora:top.", 'message'); + drupal_set_message(t("Successfully installed islandora:top."), 'message'); } catch (exception $e) { } @@ -1397,7 +1397,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message("Successfully installed islandora:demos.", 'message'); + drupal_set_message(t("Successfully installed islandora:demos."), 'message'); } catch (exception $e) { } @@ -1419,7 +1419,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $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'); + drupal_set_message(t("Successfully installed demo:SmileyStuff collection view."), 'message'); } catch (exception $e) { } @@ -1438,14 +1438,14 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { try { $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/islandora_largeimages.xml'); $tn = $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message("Successfully installed islandora:largeimages.", 'message'); + drupal_set_message(t("Successfully installed islandora:largeimages."), 'message'); } catch (exception $e) { $error .= " - Problem ingesting islandora:largeimages collection"; } } if (!empty($error)) { - drupal_set_message('Some problems occurred: ' . $error); + drupal_set_message(t('Some problems occurred: ' . $error)); } } } @@ -1893,7 +1893,7 @@ function _fedora_repository_empty_basket() { function fedora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) { if ($warn && _is_added_to_basket($pid)) { - drupal_set_message("Object already in basket"); + drupal_set_message(t("Object already in basket")); } if (!isset($_SESSION['basket'])) { diff --git a/ilives/book.inc b/ilives/book.inc index 6d057156..6480dec1 100644 --- a/ilives/book.inc +++ b/ilives/book.inc @@ -1,6 +1,9 @@ randomName(10) . '.html'; $rv = file_put_contents($output_path, $this->drupalGetContent()); - $this->pass("$description: Contents of result page are " . l('here', $output_path)); + $this->pass("$description: Contents of result page are " . l(t('here'), $output_path)); } protected function drupalCreateFedoraUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) { diff --git a/js/printer_tool.js b/js/printer_tool.js index 2d7da8dd..c76cf673 100644 --- a/js/printer_tool.js +++ b/js/printer_tool.js @@ -7,7 +7,7 @@ PrinterTool.print = function (tagID) { var target = document.getElementById(tagID); var title = document.title; if(!target || target.childNodes.length === 0) { - alert("Nothing to Print"); + alert(t("Nothing to Print")); return; } var content = target.innerHTML; diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index a76c9282..bc6c6282 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -4,6 +4,7 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /* + * @file * Created on 19-Feb-08 * * diff --git a/plugins/CreateCollection.inc b/plugins/CreateCollection.inc index 2fe5f8df..f537186b 100644 --- a/plugins/CreateCollection.inc +++ b/plugins/CreateCollection.inc @@ -2,7 +2,7 @@ -/* +/*@file * * * This Class implements the methods defined in the STANDARD_IMAGE content model diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index abf83f3d..ca34de17 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -1,7 +1,11 @@ 0) { - drupal_set_message("Conversion successful.", 'status'); + drupal_set_message(t("Conversion successful."), 'status'); $_SESSION['fedora_ingest_files']["$dsid"] = $outputFile; return $outputFile; } @@ -64,7 +64,7 @@ class DocumentConverter { } } else { - drupal_set_message("Conversion Failed. Webservice returned $code.", 'status'); + drupal_set_message(t("Conversion Failed. Webservice returned $code."), 'status'); return FALSE; } } diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index 8a524d61..b395d017 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -3,7 +3,7 @@ /* - * + *@file * * This Class implements the methods defined in the STANDARD_IMAGE content model */ diff --git a/plugins/Ffmpeg.inc b/plugins/Ffmpeg.inc index 6013a358..3936883e 100644 --- a/plugins/Ffmpeg.inc +++ b/plugins/Ffmpeg.inc @@ -3,7 +3,7 @@ /* - * + *@file * * This Class implements the methods defined in the STANDARD_QT content model */ diff --git a/plugins/Flv.inc b/plugins/Flv.inc index 80a8f086..556bdcbe 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -3,6 +3,7 @@ /* + *@file * Created on 19-Feb-08 * * diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index eee6eec3..65faf5c0 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -5,6 +5,7 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /* + *@file * implements methods from content model ingest form xml * builds a dc metadata form */ diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 990416d4..78dcd535 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -3,6 +3,7 @@ /* + * @file * Created on 19-Feb-08 * * @@ -78,21 +79,21 @@ class FormBuilder { try { $xml = new SimpleXMLElement($policyStreamDoc); } catch (Exception $e) { - watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem getting security policy.", NULL, WATCHDOG_ERROR); drupal_set_message(t('Problem getting security policy: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; } $policyElement = $dom->createDocumentFragment(); if (!$policyElement) { drupal_set_message(t('Error parsing security policy stream.')); - watchdog(t("Fedora_Repository"), t("Error parsing security policy stream, could not parse policy stream."), NULL, WATCHDOG_NOTICE); + watchdog(t("Fedora_Repository"), "Error parsing security policy stream, could not parse policy stream.", NULL, WATCHDOG_NOTICE); return FALSE; } $dom->importNode($policyElement, TRUE); $value = $policyElement->appendXML($policyStreamDoc); if (!$value) { drupal_set_message(t('Error creating security policy stream.')); - watchdog(t("Fedora_Repository"), t("Error creating security policy stream, could not parse collection policy template file."), NULL, WATCHDOG_NOTICE); + watchdog(t("Fedora_Repository"), "Error creating security policy stream, could not parse collection policy template file.", NULL, WATCHDOG_NOTICE); return FALSE; } @@ -161,7 +162,7 @@ class FormBuilder { file_delete($form_values['ingest-file-location']); } catch (exception $e) { drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); - watchdog(t("Fedora_Repository"), t("Error ingesting object: !e", array('!e' => $e->getMessage())), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => $e->getMessage()), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 4e3b65cb..b153d758 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -3,7 +3,7 @@ /* - * + *@file * * This Class implements the methods defined in the STANDARD_IMAGE content model */ diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index c0cca9a1..7466e2c6 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -1,6 +1,9 @@ $e->getMessage())), 'error'); - watchdog(t("Fedora_Repository"), t("Error ingesting object: !e", array('!e' => $e->getMessage())), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => $e->getMessage()), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index f2fa3629..911c65dd 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -1,6 +1,9 @@ $e->getMessage())), 'error'); return FALSE; } @@ -58,7 +61,7 @@ class PersonalCollectionClass { if (!$policyElement) { drupal_set_message(t('Error parsing policy stream.')); - watchdog(t("Fedora_Repository"), t("Error parsing policy stream, could not parse policy stream."), NULL, WATCHDOG_NOTICE); + watchdog(t("Fedora_Repository"), "Error parsing policy stream, could not parse policy stream.", NULL, WATCHDOG_NOTICE); return FALSE; } $dom->importNode($policyElement, TRUE); @@ -66,7 +69,7 @@ class PersonalCollectionClass { $value = $policyElement->appendXML($collectionTemplate); if (!$value) { drupal_set_message(t('Error creating collection policy stream.')); - watchdog(t("Fedora_Repository"), t("Error creating collection policy stream, could not parse collection policy template file."), NULL, WATCHDOG_NOTICE); + watchdog(t("Fedora_Repository"), "Error creating collection policy stream, could not parse collection policy template file.", NULL, WATCHDOG_NOTICE); return FALSE; } diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 02745bce..87de1b83 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -2,7 +2,8 @@ -/* +/** + * @file * Created on 26-Feb-08 * * To change the template for this generated file go to @@ -71,7 +72,7 @@ class Refworks { //$dom = dom_import_simplexml($xml);//test to see if it behaves better //$xml = new SimpleXMLElement(trim(file_get_contents($file))); } catch (Exception $e) { - drupal_set_message(t('Error processing Refworks file: ') . $e->getMessage()); + drupal_set_message(t('Error processing Refworks file:') . $e->getMessage()); return FALSE; } $this->referenceList = array(); @@ -267,13 +268,13 @@ class Refworks { if ($client == NULL) { drupal_set_message(t('Error getting SOAP client.'), 'error'); - watchdog(t("FEDORA_REPOSITORY"), t("Error getting SOAP client: !e", array('!e' => $e)), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error getting SOAP client: !e", array('!e' => $e), NULL, WATCHDOG_ERROR); return; } $object = $client->__soapCall('ingest', array( $params )); - watchdog(t("FEDORA_REPOSITORY"), t("Successfully added repository item !pid - !it", array('!pid' => $pid, '!it' => $item_title)), NULL, WATCHDOG_INFO); + watchdog(t("FEDORA_REPOSITORY"), "Successfully added repository item !pid - !it", array('!pid' => $pid, '!it' => $item_title), NULL, WATCHDOG_INFO); $deleteFiles = $form_values['delete_file']; //remove files from drupal file system if ($deleteFiles > 0) { @@ -282,7 +283,7 @@ class Refworks { } catch (exception $e) { $errors++; $errorMessage = 'yes'; - watchdog(t("FEDORA_REPOSITORY"), t("Error during ingest !it !e", array('!it' => $item_title, '!e' => $e)), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error during ingest !it !e", array('!it' => $item_title, '!e' => $e), NULL, WATCHDOG_ERROR); } $success++; } diff --git a/plugins/ShowDemoStreamsInFieldSets.inc b/plugins/ShowDemoStreamsInFieldSets.inc index ccc70c56..e06cd50b 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -3,6 +3,7 @@ /* + * @file * Created on 17-Apr-08 * * diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index caea2ca2..7292a926 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -2,7 +2,8 @@ -/* +/** + * @file * Created on 17-Apr-08 */ class ShowStreamsInFieldSets { @@ -83,7 +84,7 @@ class ShowStreamsInFieldSets { } $dc_html = $objectHelper->getFormattedDC($item); - $dl_link = l('

      View Document
      ', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); + $dl_link = l(t('

      View Document
      '), 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); $tabset['first_tab']['tabs']['view'] = array( '#type' => 'tabpage', diff --git a/plugins/fedoraObject.inc b/plugins/fedoraObject.inc index 7290a776..7270b715 100644 --- a/plugins/fedoraObject.inc +++ b/plugins/fedoraObject.inc @@ -1,5 +1,10 @@ randomName(10) . '.html'; $rv = file_put_contents($output_path, $this->drupalGetContent()); - $this->pass("$description: Contents of result page are " . l('here', $output_path)); + $this->pass("$description: Contents of result page are " . l(t('here'), $output_path)); } protected function drupalCreateFedoraUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) { From 192a15cd3f7f451870be95337059e381b8a9212f Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Mon, 20 Jun 2011 12:41:12 -0300 Subject: [PATCH 003/247] Changed formClass to render the XML Based form if xml_forms is enabled. --- formClass.inc | 58 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/formClass.inc b/formClass.inc index dc369357..43f1291c 100644 --- a/formClass.inc +++ b/formClass.inc @@ -37,12 +37,12 @@ class formClass { ); $items['admin/settings/fedora_repository/demoobjects'] = array( - 'title' => t('Solution Packs'), - 'description' => t('Install content models and collections required by installed solution packs.'), - 'page callback' => 'fedora_repository_solution_packs_page', - 'access arguments' => array('add fedora datastreams'), - 'file' => 'fedora_repository.solutionpacks.inc', - 'type' => MENU_LOCAL_TASK, + 'title' => t('Solution Packs'), + 'description' => t('Install content models and collections required by installed solution packs.'), + 'page callback' => 'fedora_repository_solution_packs_page', + 'access arguments' => array('add fedora datastreams'), + 'file' => 'fedora_repository.solutionpacks.inc', + 'type' => MENU_LOCAL_TASK, ); $items['islandoracm.xsd'] = array( @@ -241,8 +241,7 @@ class formClass { $form['fedora_repository_url'] = array( '#type' => 'textfield', '#title' => t('Fedora RISearch URL'), - '#default_value' => variable_get('fedora_repository_url', - 'http://localhost:8080/fedora/risearch'), + '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), '#description' => t('The url of the Fedora server'), '#required' => TRUE, '#weight' => 0 ); @@ -500,6 +499,10 @@ class formClass { $modelsForForm["$identifier"] = "$name"; } + if (module_exists('islandora_content_model_forms') && isset($contentModels[0])) { + $form_names = islandora_content_model_get_form_names($contentModels[0]->pid); + } + switch ($form_state['storage']['step']) { case 1: $form['indicator'] = array( @@ -514,14 +517,36 @@ class formClass { //'#description' => t('Content models available in this collection. A content model defines what is allowed in a collection and what to do with a file when it is uploaded (An example may creating a thumbnail from an image.).') '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.
      Additional information may be found here. ') ); + if (isset($form_names) && count($form_names) >= 1) { + $form['indicator']['forms'] = array( + '#type' => 'select', + '#title' => t('Forms'), + '#options' => $form_names, + '#description' => t('Select the form to populate the metadata of the new object.') + ); + } break; case 2: module_load_include('inc', 'fedora_repository', 'MimeClass'); // Why this include? --Zac, 2010-09-17 $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - - if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + if (isset($form_state['values']['forms'])) { + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + if (!$xml_form->isInitialized()) { + module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); + module_load_include('inc', 'xml_form_builder', 'FormBuilder'); + $form_name = $form_state['values']['forms']; + $definition = FormBuilder::GetFormDefinition($form_name); + $form = XMLFormDefinition::GetDrupalForm($definition); + $properties = XMLFormDefinition::GetFormProperties($definition); + $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema']); + $xml_form->initialize($form, $document); + } + $form = $xml_form->toArray(); + } + else if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { $form = $cm->buildIngestForm($form, $form_state); if ($form === FALSE) { @@ -577,7 +602,6 @@ class formClass { if (!empty($newElements)) { $available_dsids = array_merge($available_dsids, $newElements); } - } } @@ -640,19 +664,19 @@ class formClass { ); if (!empty($unused_dsids)) { - $dsidsForForm = array(); - foreach ($unused_dsids as $dsid){ - $dsidsForForm[$dsid]=$dsid; - } + $dsidsForForm = array(); + foreach ($unused_dsids as $dsid) { + $dsidsForForm[$dsid] = $dsid; + } $form['stream_id'] = array( '#type' => 'select', '#title' => t('Datastream ID'), '#default_value' => variable_get('feed_item_length', 'teaser'), '#weight' => '-1', '#description' => t('Datastream IDs defined by the content model.'), - ); + ); $form['stream_id']['#options'] = array_combine($unused_dsids, $unused_dsids); - } + } else { $form['stream_id'] = array( '#title' => 'Datastream ID', From 5d9027171a3f43c66130daa28dcdac8453de941a Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 21 Jun 2011 14:03:34 -0300 Subject: [PATCH 004/247] Fixed ahah problems with embedded form. --- formClass.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/formClass.inc b/formClass.inc index 43f1291c..e7e877f5 100644 --- a/formClass.inc +++ b/formClass.inc @@ -485,7 +485,6 @@ class formClass { return FALSE; } - $contentModels = $cp->getContentModels(); if (!$contentModels) { @@ -531,9 +530,10 @@ class formClass { module_load_include('inc', 'fedora_repository', 'MimeClass'); // Why this include? --Zac, 2010-09-17 $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - if (isset($form_state['values']['forms'])) { - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); + // XML Forms + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + if (isset($form_state['values']['forms']) || $xml_form->isInitialized()) { if (!$xml_form->isInitialized()) { module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); module_load_include('inc', 'xml_form_builder', 'FormBuilder'); @@ -546,6 +546,7 @@ class formClass { } $form = $xml_form->toArray(); } + // End XML forms else if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { $form = $cm->buildIngestForm($form, $form_state); if ($form === FALSE) { From 3c4de73302ca10ee01158931d4e7b7dd33ec00b9 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 21 Jun 2011 17:34:36 -0300 Subject: [PATCH 005/247] Added hooks for processing XMLBased form's during ingestion --- fedora_repository.module | 246 ++++++++++++++++++++------------------- formClass.inc | 31 ++--- 2 files changed, 143 insertions(+), 134 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 307f2ec2..bfcd7baf 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -22,8 +22,6 @@ function fedora_repository_admin() { return $adminForm->createAdminForm(); } - - /** * drupal hook * calls the fedora_repositorys_admin form @@ -55,10 +53,9 @@ function fedora_repository_purge_object($pid = NULL, $name = NULL) { drupal_set_message(t('You must specify an object pid to purge an object.'), 'error'); return ''; } - $output = t('Are you sure you wish to purge object %name %pid!
      This cannot be undone
      ', - array( - '%name' => $name, - '%pid' => $pid) + $output = t('Are you sure you wish to purge object %name %pid!
      This cannot be undone
      ', array( + '%name' => $name, + '%pid' => $pid) ); $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); @@ -122,42 +119,52 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label function fedora_repository_ingest_form_submit($form, &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH - if ($form_state['clicked_button']['#id'] == 'edit-submit') { - global $base_url; - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); - $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - $err = TRUE; - $redirect = TRUE; - if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['collection_pid'])) !== FALSE) { - $relationship = $cp->getRelationship(); - - if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { - $pid = $cp->getNextPid($contentModelDsid); - global $user; - $form_state['values']['user_id'] = $user->name; - $form_state['values']['pid'] = $pid; - $form_state['values']['content_model_pid'] = $contentModelPid; - $form_state['values']['relationship'] = $relationship; - - $err = (!$cm->execFormHandler($form_state['values'], $form_state)); - - $_SESSION['fedora_ingest_files'] = ''; //empty this variable - - $attr = $cm->getIngestFormAttributes(); - $redirect = $attr['redirect']; - - if ($redirect) { - $form_state['storage'] = NULL; + if (module_exists('xml_form_api')) { + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $form = new XMLForm($form_state); + $doc = $form->submit($drupal_form, $form_state); + $document = $doc->document; + dom_document_pretty_print($document); + exit(); + } + else { + if ($form_state['clicked_button']['#id'] == 'edit-submit') { + global $base_url; + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + + $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); + $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); + $err = TRUE; + $redirect = TRUE; + if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['collection_pid'])) !== FALSE) { + $relationship = $cp->getRelationship(); + + if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + $pid = $cp->getNextPid($contentModelDsid); + global $user; + $form_state['values']['user_id'] = $user->name; + $form_state['values']['pid'] = $pid; + $form_state['values']['content_model_pid'] = $contentModelPid; + $form_state['values']['relationship'] = $relationship; + + $err = (!$cm->execFormHandler($form_state['values'], $form_state)); + + $_SESSION['fedora_ingest_files'] = ''; //empty this variable + + $attr = $cm->getIngestFormAttributes(); + $redirect = $attr['redirect']; + + if ($redirect) { + $form_state['storage'] = NULL; + } } } - } - if ($redirect) { - $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; + if ($redirect) { + $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; + } } } } @@ -172,7 +179,12 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { break; case 2: - + // XML based form. + if (module_exists('xml_form_api')) { + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + $xml_form->validate($form, $form_state); + } // Get the uploaded file. $validators = array(); @@ -394,9 +406,8 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) return ' '; } - $output = t('Are you sure you wish to purge this datastream %name
      ', - array( - '%name' => $name) + $output = t('Are you sure you wish to purge this datastream %name
      ', array( + '%name' => $name) ); $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); return $output; @@ -435,7 +446,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { } elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { $collectionPid = $_SESSION['fedora_collection']; - + $form_state['redirect'] = "fedora/repository/$collectionPid/"; } else { @@ -527,14 +538,14 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $dsid = $form_state['values']['dsId']; $dsLabel = $form_state['values']['dsLabel']; // Remove the original file extension from the label and add the new one - $indexOfDot = strrpos($dsLabel,'.');//use strrpos to get the last dot - if($indexOfDot !== FALSE){ + $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot + if ($indexOfDot !== FALSE) { $dsLabel = substr($dsLabel, 0, $indexOfDot); $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; } module_load_include('inc', 'Fedora_Repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - + $file_basename = basename($file->filepath); $file_directory = dirname($file->filepath); $streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename); @@ -546,11 +557,10 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $dformat = $mimetype->getType($file->filepath); $item = new Fedora_Item($pid); - + $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); - - $form_state['redirect'] = 'fedora/repository/' . $pid; + $form_state['redirect'] = 'fedora/repository/' . $pid; } function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { @@ -608,7 +618,7 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { } function fedora_repository_edit_qdc_form_validate($form, &$form_state) { - + } /** @@ -726,8 +736,8 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU drupal_set_message('The Fedora repository server is currently unavailable. Please contact the site administrator.', 'warning', FALSE); return ''; } - - if ($pid &!validPid($pid)) { + + if ($pid & !validPid($pid)) { drupal_set_message(t("Invalid PID!"), 'error'); return ' '; @@ -806,8 +816,8 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $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 @@ -1180,7 +1190,6 @@ function fedora_repository_theme() { 'arguments' => array( 'element' => NULL ), - 'fedora_repository_solution_packs_list' => array( 'arguments' => array( 'solution_packs' => NULL, @@ -1263,10 +1272,10 @@ function fedora_repository_demo_objects_form() { ); foreach (array( - 'islandora:collectionCModel' => 'Islandora default content models', - 'islandora:top' => 'Islandora top-level collection', - 'islandora:demos' => 'Islandora demos collection', - 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', +'islandora:collectionCModel' => 'Islandora default content models', + 'islandora:top' => 'Islandora top-level collection', + 'islandora:demos' => 'Islandora demos collection', + 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', ) as $available_demo => $available_demo_desc) { try { @@ -1403,7 +1412,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); drupal_set_message("Successfully installed islandora:demos.", 'message'); } catch (exception $e) { - + } } @@ -1413,19 +1422,19 @@ 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) { - + } } @@ -1454,16 +1463,15 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { } } - function fedora_repository_required_fedora_objects() { // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) $module_path = drupal_get_path('module', 'fedora_repository'); - return array ( + return array( 'fedora_repository' => array( 'module' => 'fedora_repository', 'title' => 'Islandora Core', - 'objects' => array ( - array ( + 'objects' => array( + array( 'pid' => 'islandora:collectionCModel', 'label' => 'Islandora Collection Content Model', 'dsid' => 'ISLANDORACM', @@ -1471,7 +1479,7 @@ function fedora_repository_required_fedora_objects() { 'dsversion' => 2, 'cmodel' => 'fedora-system:ContentModel-3.0', ), - array ( + array( 'pid' => 'islandora:strict_pdf', 'label' => 'Islandora strict PDF content model', 'dsid' => 'ISLANDORACM', @@ -1482,85 +1490,85 @@ function fedora_repository_required_fedora_objects() { 'pid' => 'islandora:top', 'label' => 'Islandora Top-level Collection', 'cmodel' => 'islandora:collectionCModel', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - ), + ), ), - array ( + array( 'pid' => 'islandora:ContentModelCollection', 'label' => 'Collection of installed content models', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:top', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_VIEW', 'datastream_file' => "$module_path/collection_views/simple_list_view.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/contentModel.jpg", 'mimetype' => 'image/jpeg', ), - array ( + array( 'dsid' => 'QUERY', 'datastream_file' => "$module_path/collection_views/cmodel_collection_query.txt", 'mimetype' => 'text/plain', ), ), ), - array ( + array( 'pid' => 'islandora:demos', 'label' => 'Islandora demos collection', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:top', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", ), ), ), - array ( + array( 'pid' => 'islandora:pdf_collection', 'label' => 'Islandora Demo PDF Collection', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:demos', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Crystal_Clear_mimetype_pdf.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/PDF-COLLECTION POLICY.xml", ), ), ), - array ( + array( 'pid' => 'demo:DualResImage', 'foxml_file' => "$module_path/content_models/demo_DualResImage.xml", 'datastreams' => array( - array ( + array( 'dsid' => 'ISLANDORACM', 'datastream_file' => "$module_path/content_models/STANDARD JPG.xml", ), ), ), - array ( + array( 'pid' => 'demo:DualResImageCollection', 'foxml_file' => "$module_path/content_models/demo_DualResImageCollection.xml", 'datastreams' => array( @@ -1570,51 +1578,51 @@ function fedora_repository_required_fedora_objects() { ), ), ), - array ( + array( 'pid' => 'demo:DualResolution', 'foxml_file' => "$module_path/content_models/demo_DualResolution.xml", ), - array ( + array( 'pid' => 'demo:DualResImageImpl', 'foxml_file' => "$module_path/content_models/demo_DualResImageImpl.xml", ), - array ( + array( 'pid' => 'demo:CollectionImpl', 'foxml_file' => "$module_path/content_models/demo_CollectionImpl.xml", ), - array ( + array( 'pid' => 'demo:Collection', 'foxml_file' => "$module_path/content_models/demo_Collection.xml", ), - array ( + array( 'pid' => 'islandora:demo_image_collection', 'label' => 'Demo Image Collection', 'cmodel' => 'demo:DualResImageCollection', 'parent' => 'islandora:demos', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/JPG-COLLECTION POLICY.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_VIEW', 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml", ), - array ( + array( 'dsid' => 'QUERY', 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt", 'mimetype' => 'text/plain', ), - array ( + array( 'dsid' => 'DC', 'datastream_file' => "$module_path/collection_views/demo_image_collection_dc_record.xml", ), - ), + ), ), ), ), @@ -1792,7 +1800,7 @@ function theme_fedora_repository_basket_form($form) { } function fedora_repository_basket_form_validate($form, &$form_state) { - + } function fedora_repository_basket_form_submit($form, &$form_state) { @@ -1939,9 +1947,7 @@ function theme_add_to_basket_link($pid, $type = 'object') { */ if (!_is_added_to_basket($pid)) { return l( - theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), - "fedora/repository/addToBasket/" . $path, - array('html' => TRUE) + theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), "fedora/repository/addToBasket/" . $path, array('html' => TRUE) ); } @@ -1964,7 +1970,6 @@ function fedora_repository_display_schema($file) { return; } - function fedora_repository_batch_reingest_object($object, &$context) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -1989,8 +1994,8 @@ function fedora_repository_batch_reingest_object($object, &$context) { } } if (!empty($object['dsid']) && !empty($object['datastream_file'])) { - $datastreams = array ( - array ( + $datastreams = array( + array( 'dsid' => $object['dsid'], 'datastream_file' => $object['datastream_file'], ) @@ -1999,19 +2004,19 @@ function fedora_repository_batch_reingest_object($object, &$context) { elseif (!empty($object['datastreams'])) { $datastreams = $object['datastreams']; } - + if (!empty($datastreams) && is_array($datastreams)) { $label = !empty($object['label']) ? $object['label'] : ''; if (empty($object['foxml_file']) && !defined($new_item)) { $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); } if (!empty($object['cmodel'])) { - $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); + $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); } if (!empty($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'); } @@ -2037,13 +2042,14 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid $return = NULL; if (isset($item)) { $doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); - } elseif (isset($datastream_file)) { + } + elseif (isset($datastream_file)) { $doc = simplexml_load_file($datastream_file); } - + if (!empty($doc)) { $attrs = $doc->attributes(); - foreach($attrs as $name => $value) { + foreach ($attrs as $name => $value) { if ($name == 'version') { $return = (int) $value; break; @@ -2052,18 +2058,18 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid } return $return; } - + function theme_fedora_repository_solution_packs_list($solution_packs) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $output = ''; $header = array(); $rows = array(); - - - - - drupal_add_css(drupal_get_path('module', 'update') .'/update.css'); + + + + + drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); return $output; } diff --git a/formClass.inc b/formClass.inc index e7e877f5..b7387a43 100644 --- a/formClass.inc +++ b/formClass.inc @@ -531,23 +531,26 @@ class formClass { $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); // XML Forms - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - if (isset($form_state['values']['forms']) || $xml_form->isInitialized()) { - if (!$xml_form->isInitialized()) { - module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); - module_load_include('inc', 'xml_form_builder', 'FormBuilder'); - $form_name = $form_state['values']['forms']; - $definition = FormBuilder::GetFormDefinition($form_name); - $form = XMLFormDefinition::GetDrupalForm($definition); - $properties = XMLFormDefinition::GetFormProperties($definition); - $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema']); - $xml_form->initialize($form, $document); + if (module_exists('xml_form_api')) { + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + if (isset($form_state['values']['forms']) || $xml_form->isInitialized()) { + if (!$xml_form->isInitialized()) { + module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); + module_load_include('inc', 'xml_form_builder', 'FormBuilder'); + $form_name = $form_state['values']['forms']; + $definition = FormBuilder::GetFormDefinition($form_name); + $form = XMLFormDefinition::GetDrupalForm($definition); + $properties = XMLFormDefinition::GetFormProperties($definition); + $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema']); + $xml_form->initialize($form, $document); + } + $form = $xml_form->toArray(); + break; } - $form = $xml_form->toArray(); } // End XML forms - else if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { $form = $cm->buildIngestForm($form, $form_state); if ($form === FALSE) { From f6541b26c778833400a3574ef52d8eb8d02e4c4e Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 21 Jun 2011 19:13:41 -0300 Subject: [PATCH 006/247] Edit form correctly shows up in the right spot. --- fedora_repository.module | 234 ++++++++++++++++++++------------------- formClass.inc | 187 +++++++++++++++++++------------ plugins/fedoraObject.inc | 2 + 3 files changed, 240 insertions(+), 183 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index bfcd7baf..72f97b2a 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -118,7 +118,7 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label } function fedora_repository_ingest_form_submit($form, &$form_state) { - //only validate the form if the submit button was pressed (other buttons may be used for AHAH +//only validate the form if the submit button was pressed (other buttons may be used for AHAH if (module_exists('xml_form_api')) { module_load_include('inc', 'xml_form_api', 'XMLForm'); $form = new XMLForm($form_state); @@ -170,7 +170,7 @@ function fedora_repository_ingest_form_submit($form, &$form_state) { } function fedora_repository_ingest_form_validate($form, &$form_state) { - //only validate the form if the submit button was pressed (other buttons may be used for AHAH +//only validate the form if the submit button was pressed (other buttons may be used for AHAH if ($form_state['clicked_button']['#id'] == 'edit-submit') { switch ($form_state['storage']['step']) { case 1: @@ -179,13 +179,13 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { break; case 2: - // XML based form. +// XML based form. if (module_exists('xml_form_api')) { module_load_include('inc', 'xml_form_api', 'XMLForm'); $xml_form = new XMLForm($form_state); $xml_form->validate($form, $form_state); } - // Get the uploaded file. +// Get the uploaded file. $validators = array(); if (!empty($_FILES['files']['name']['ingest-file-location'])) { @@ -234,7 +234,7 @@ 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'); - // 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'])) { $form_state['storage']['step'] = 1; } @@ -263,7 +263,7 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NUL ); } if (!isset($form_state['storage']['confirm'])) { - // do your normal $form definition here +// do your normal $form definition here $form['submit'] = array( @@ -275,12 +275,12 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NUL if (!empty($collectionPid)) { $collectionPid = $_SESSION['fedora_collection']; } - //$form['#redirect'] = $referrer; +//$form['#redirect'] = $referrer; return $form; } else { - // ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form +// ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form return confirm_form($form, 'Confirm Purge Object', $referrer, 'Are you sure you want to delete this object? This action cannot be undone.', 'Delete', 'Cancel'); //Had better luck leaving off last param 'name' } @@ -380,17 +380,17 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } $validators = array( - // 'file_validate_is_image' => array(), - // 'file_validate_image_resolution' => array('85x85'), - // 'file_validate_size' => array(30 * 1024), +// 'file_validate_is_image' => array(), +// 'file_validate_image_resolution' => array('85x85'), +// 'file_validate_size' => array(30 * 1024), ); $fileObject = file_save_upload('add-stream-file-location', $validators); - // Move the uploaded file to Drupal's files directory. +// Move the uploaded file to Drupal's files directory. file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); $form_state['values']['add-stream-file-location'] = $fileObject->filepath; - // TODO: Add error checking here. +// TODO: Add error checking here. $form_state['rebuild'] = FALSE; } @@ -421,7 +421,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { $form_state['rebuild'] = TRUE; // along with this } else { - // this is where you do your processing after they have pressed the confirm button +// this is where you do your processing after they have pressed the confirm button $params = array( "pid" => $pid, "logMessage" => "Purged", @@ -475,7 +475,7 @@ function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) { function fedora_repository_purge_stream_form_submit($form, &$form_state) { global $base_url; module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - //$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $pid = $form_state['values']['pid']; $item = new Fedora_Item($pid); $dsid = $form_state['values']['dsid']; @@ -498,21 +498,21 @@ function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName } function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { - //module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); +//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); module_load_include('inc', 'Fedora_Repository', 'formClass'); - //$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $replaceDataStreamForm = new formClass(); return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state); } function fedora_repository_replace_stream_form_validate($form, &$form_state) { - // If a file was uploaded, process it. +// If a file was uploaded, process it. if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name']['file'])) { - // attempt to save the uploaded file +// attempt to save the uploaded file $file = file_save_upload('file', array(), file_directory_path()); - // set error is file was not uploaded +// set error is file was not uploaded if (!$file) { form_set_error('file', 'Error uploading file.'); return; @@ -526,7 +526,7 @@ function fedora_repository_replace_stream_form_validate($form, &$form_state) { return; } - // set files to form_state, to process when form is submitted +// set files to form_state, to process when form is submitted $form_state['values']['file'] = $file; } } @@ -537,7 +537,7 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $pid = $form_state['values']['pid']; $dsid = $form_state['values']['dsId']; $dsLabel = $form_state['values']['dsLabel']; - // Remove the original file extension from the label and add the new one +// Remove the original file extension from the label and add the new one $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot if ($indexOfDot !== FALSE) { $dsLabel = substr($dsLabel, 0, $indexOfDot); @@ -595,7 +595,7 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $soapHelper = new ConnectionHelper(); $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); - // Check if there is a custom edit metadata function defined in the content model. +// Check if there is a custom edit metadata function defined in the content model. $breadcrumbs = array(); $objectHelper = new ObjectHelper(); @@ -609,16 +609,19 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { } if (empty($output)) { - // There is no custom function, so just load the standard QDC form. +// There is no custom function, so just load the standard QDC form. $metaDataForm = new formClass(); - //currently we only edit the dc metadata. If you defined a custom form with a custom handler you are sol for now. - return $metaDataForm->createMetaDataForm($pid, $dsId, $client); +//currently we only edit the dc metadata. If you defined a custom form with a custom handler you are sol for now. + return $metaDataForm->createMetaDataForm($pid, $dsId, $client, $form_state); } return $output; } function fedora_repository_edit_qdc_form_validate($form, &$form_state) { - + if (isset($form_state['storage']['step']) && $form_state['storage']['step'] == 1) { + $form_state['storage']['step']++; + $form_state['rebuild'] = TRUE; + } } /** @@ -631,28 +634,33 @@ function fedora_repository_edit_qdc_form_validate($form, &$form_state) { * @return */ function fedora_repository_edit_qdc_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - global $base_url; - if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { - - //$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $soap_helper = new ConnectionHelper(); - $client = $soap_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - - // Check the content model for a custom edit metadata form submit function. - if (isset($form_state['values']['pid'])) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { - return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client); + if (true) { + + } + else { + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + global $base_url; + if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { + +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $soap_helper = new ConnectionHelper(); + $client = $soap_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + +// Check the content model for a custom edit metadata form submit function. + if (isset($form_state['values']['pid'])) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { + return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client); + } } - } - module_load_include('inc', 'fedora_repository', 'formClass'); - $metaDataForm = new formClass(); - $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); - $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; + module_load_include('inc', 'fedora_repository', 'formClass'); + $metaDataForm = new formClass(); + $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); + $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; - return $return_value; + return $return_value; + } } } @@ -748,7 +756,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU return ' '; } if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - //drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); +//drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); if (user_access('access administration pages')) { drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); @@ -769,7 +777,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU return ' '; } if ($dsId != NULL && $dsId != '-') { //if we have a dsID return the stream otherwise query for a collection of objects - //probably should check pid as well here. +//probably should check pid as well here. return makeObject($pid, $dsId); } @@ -777,12 +785,12 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); - //if(!isset($pageNumber)){ - // $pageNumber=0; - //} - //if(!isset($limit)){ - // $limit=20; - //} +//if(!isset($pageNumber)){ +// $pageNumber=0; +//} +//if(!isset($limit)){ +// $limit=20; +//} module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'plugins/fedoraObject'); @@ -791,15 +799,15 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU 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); +//$results = $collectionClass->getRelatedObjects($pid, $limit, $offset, NULL); //updated so we can do paging in query not in xslt +//$results = $collectionClass->getRelatedItems($pid, NULL); $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. +// 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_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); @@ -812,17 +820,17 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU ); } } - // Add a 'manage object' tab for all objects, where detailed list of content is shown. +// 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 - //$css=$path.'/stylesheets/container-large.css'; - //drupal_add_css($css); +//$content .= $objectHelper +//$content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); +//the below is for islandlives we should be able to do this in the xslt though +//$css=$path.'/stylesheets/container-large.css'; +//drupal_add_css($css); return tabs_render($cmodels_tabs); } @@ -849,8 +857,8 @@ function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { } function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNumber = NULL) { - //do security check at fedora_repository_get_items function as it has to be called there in case - //someone trys to come in a back door. +//do security check at fedora_repository_get_items function as it has to be called there in case +//someone trys to come in a back door. return fedora_repository_get_items($pid, $dsId, $collection, $pageNumber); } @@ -860,7 +868,7 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU global $user; if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - //drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); +//drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); drupal_access_denied(); if (user_access('access administration pages')) { drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'error'); @@ -908,7 +916,7 @@ function fedora_repository_search($op = 'search', $keys = NULL) { } case 'search': if (user_access('view fedora collection')) { - //demo search string ?operation=gfindObjects&indexName=DemoOnLucene&query=fgs.DS.first.text%3Achristmas&hitPageStart=11&hitPageSize=10 +//demo search string ?operation=gfindObjects&indexName=DemoOnLucene&query=fgs.DS.first.text%3Achristmas&hitPageStart=11&hitPageSize=10 $resultData = NULL; $numberOfHitsPerPage = NULL; $index = strpos($keys, '.'); @@ -937,7 +945,7 @@ function fedora_repository_search($op = 'search', $keys = NULL) { $xmlDoc->load($path . '/searchTerms.xml'); $nodeList = $xmlDoc->getElementsByTagName('default'); if (!$type) { - //$type = 'dc.description'; +//$type = 'dc.description'; $type = $nodeList->item(0)->nodeValue; } $nodeList = $xmlDoc->getElementsByTagName('number_of_results'); @@ -952,12 +960,12 @@ function fedora_repository_search($op = 'search', $keys = NULL) { else { $searchQuery = $keys; } - //$searchQuery.=" AND (PID:vre OR PID:vre:ref OR PID:demo OR PID:changeme)"; +//$searchQuery.=" AND (PID:vre OR PID:vre:ref OR PID:demo OR PID:changeme)"; $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=copyXml&query=' . $searchQuery; $searchString .= '&hitPageSize=' . $numberOfHitsPerPage . '&hitPageStart=' . $startPage; - //$searchString = htmlentities(urlencode($searchString)); +//$searchString = htmlentities(urlencode($searchString)); $searchUrl .= $searchString; $objectHelper = new ObjectHelper(); $resultData = do_curl($searchUrl); @@ -998,7 +1006,7 @@ function fedora_repository_search_page($resultData) { return $out; } - //inject into xsl stylesheet +//inject into xsl stylesheet $proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); @@ -1052,7 +1060,7 @@ function fedora_repository_search_page($resultData) { * allows the advanced search form in drupal */ function fedora_repository_form_alter(&$form, &$form_state, $form_id) { - // Advanced node search form +// Advanced node search form module_load_include('inc', 'fedora_repository', 'SearchClass'); $path = drupal_get_path('module', 'fedora_repository'); if ($form_id == 'search_form' && arg(1) == 'fedora_repository' && user_access('use advanced search')) { @@ -1066,7 +1074,7 @@ function fedora_repository_form_alter(&$form, &$form_state, $form_id) { $default_value = substr($default_value, $index + 1); } $form['basic']['inline']['keys']['#default_value'] = $default_value; - // Keyword boxes: +// Keyword boxes: $form['advanced'] = array( '#type' => 'fieldset', '#title' => t('Advanced search'), @@ -1106,7 +1114,7 @@ function fedora_repository_form_alter(&$form, &$form_state, $form_id) { * */ function fedora_repository_search_validate($form, &$form_state) { - // Initialise using any existing basic search keywords. +// Initialise using any existing basic search keywords. $keys = $form_state['values']['processed_keys']; if (isset($form_state['values']['type'])) { @@ -1122,26 +1130,26 @@ function fedora_repository_search_validate($form, &$form_state) { } function fedora_repository_block($op = 'list', $delta = 0, $edit = array()) { - // The $op parameter determines what piece of information is being requested. +// The $op parameter determines what piece of information is being requested. switch ($op) { case 'list': - // If $op is "list", we just need to return a list of block descriptions. - // This is used to provide a list of possible blocks to the administrator, - // end users will not see these descriptions. +// If $op is "list", we just need to return a list of block descriptions. +// This is used to provide a list of possible blocks to the administrator, +// end users will not see these descriptions. $blocks[0] = array( 'info' => t('Repository advanced search block'), ); return $blocks; case 'configure': - // If $op is "configure", we need to provide the administrator with a - // configuration form. The $delta parameter tells us which block is being - // configured. In this example, we'll allow the administrator to customize - // the text of the first block. +// If $op is "configure", we need to provide the administrator with a +// configuration form. The $delta parameter tells us which block is being +// configured. In this example, we'll allow the administrator to customize +// the text of the first block. $form = array(); switch ($delta) { case 0: - // All we need to provide is a text field, Drupal will take care of - // the other block configuration options and the save button. +// All we need to provide is a text field, Drupal will take care of +// the other block configuration options and the save button. $form['fedora_repository_advanced_block_repeat'] = array( '#type' => 'textfield', '#title' => t('Number of times to repeat search fields'), @@ -1153,25 +1161,25 @@ function fedora_repository_block($op = 'list', $delta = 0, $edit = array()) { } return $form; case 'save': - // If $op is "save", we need to save settings from the configuration form. - // Since the first block is the only one that allows configuration, we - // need to check $delta to make sure we only save it. +// If $op is "save", we need to save settings from the configuration form. +// Since the first block is the only one that allows configuration, we +// need to check $delta to make sure we only save it. switch ($delta) { case 0: - // Have Drupal save the string to the database. +// Have Drupal save the string to the database. variable_set('fedora_repository_advanced_block_repeat', $edit['fedora_repository_advanced_block_repeat']); break; } case 'view': default: - // If $op is "view", then we need to generate the block for display - // purposes. The $delta parameter tells us which block is being requested. +// If $op is "view", then we need to generate the block for display +// purposes. The $delta parameter tells us which block is being requested. switch ($delta) { case 0: - // The subject is displayed at the top of the block. Note that it - // should be passed through t() for translation. +// The subject is displayed at the top of the block. Note that it +// should be passed through t() for translation. $block['subject'] = t('Repository Advanced Search'); - // The content of the block is typically generated by calling a custom - // function. +// The content of the block is typically generated by calling a custom +// function. $block['content'] = drupal_get_form('fedora_repository_mnpl_advanced_search_form'); break; } @@ -1262,7 +1270,7 @@ function fedora_repository_demo_objects_form() { '#description' => t('Install demo image and document collections and content models.'), ); $demo_objects = array(); - // Check if the top-level islandora collection exists. If not, display a button to ingest. +// Check if the top-level islandora collection exists. If not, display a button to ingest. $form['install_demos']['demo_collections'] = array( '#type' => 'checkboxes', @@ -1285,7 +1293,7 @@ function fedora_repository_demo_objects_form() { } if (empty($demo_objects[$available_demo]->objectProfile)) { - //The demo objects collection does not exist in the repository, display a button to ingest them. +//The demo objects collection does not exist in the repository, display a button to ingest them. $form['install_demos']['demo_collections']['#options'][$available_demo] = $available_demo_desc; } else { @@ -1293,7 +1301,7 @@ function fedora_repository_demo_objects_form() { } } - // Check if the SmileyStuff collectoin exists, and if it has a COLLECTION_VIEW datastream. If it doesn't then we can add it. +// Check if the SmileyStuff collectoin exists, and if it has a COLLECTION_VIEW datastream. If it doesn't then we can add it. $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); if (!empty($smiley_stuff->objectProfile)) { @@ -1359,12 +1367,12 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { } - // Install a collection object that points to all content model objects +// Install a collection object that points to all content model objects try { $cmodel_collection_xml = Fedora_Item::create_object_FOXML('islandora:ContentModelCollection'); $cmodel_collection = Fedora_Item::ingest_from_FOXML($cmodel_collection_xml); - //$dc = new Dublin_Core(new Fedora_Item('islandora:ContentModelCollection')); +//$dc = new Dublin_Core(new Fedora_Item('islandora:ContentModelCollection')); $dc = new Dublin_Core($cmodel_collection); $dc->set_element('dc:title', array('Installed Content Model')); $dc->save(); @@ -1402,7 +1410,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); - // $cv = $new_item->add_datastream_from_file( drupal_get_path('module', 'fedora_repository') . '/collection_views/COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View.xml', 'text/xml', 'X'); +// $cv = $new_item->add_datastream_from_file( drupal_get_path('module', 'fedora_repository') . '/collection_views/COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View.xml', 'text/xml', 'X'); $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); try { $new_item = Fedora_Item::ingest_new_item('islandora:pdf_collection', 'A', 'PDF Collection'); @@ -1464,7 +1472,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { } function fedora_repository_required_fedora_objects() { - // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) +// array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) $module_path = drupal_get_path('module', 'fedora_repository'); return array( 'fedora_repository' => array( @@ -1643,8 +1651,8 @@ function fedora_repository_elements() { } function fedora_repository_expand_time($element) { - // Default to current time, check default_value but set value so that if - // default value is present it will override value +// Default to current time, check default_value but set value so that if +// default value is present it will override value if (empty($element['#default_value'])) { $element['#value'] = array( 'hour' => intval(format_date(time(), 'custom', 'h')), @@ -1698,16 +1706,16 @@ function fedora_repository_remove_item_from_basket($pid) { $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; $objectHelper = new ObjectHelper(); - // getting child PIDs if any +// getting child PIDs if any $cpids = $objectHelper->get_child_pids(array($pid)); if (array_key_exists($pid, $pids)) { - // remove item from basket +// remove item from basket unset($_SESSION['basket']['processed'][$pid]); } if (!empty($cpids)) { // there are children foreach ($cpids as $child_pid => $value) { - // remove child item from basket recursively +// remove child item from basket recursively fedora_repository_remove_item_from_basket($child_pid); } } @@ -1860,7 +1868,7 @@ function fedora_repository_basket_form_submit($form, &$form_state) { $msg .= ":
      " . implode("
      ", $log); drupal_set_message($msg, $success ? 'info' : 'error'); - //_fedora_repository_empty_basket(); +//_fedora_repository_empty_basket(); } else { drupal_set_message(t("No objects selected or basket empty"), 'error'); @@ -1875,7 +1883,7 @@ function fedora_repository_basket_form_submit($form, &$form_state) { function _fedora_repository_get_basket_pids() { - // Set empty defaults if basket elements are missing +// Set empty defaults if basket elements are missing $_SESSION['basket'] = isset($_SESSION['basket']) ? $_SESSION['basket'] : array('processed' => array(), 'unprocessed' => array()); $_SESSION['basket']['processed'] = isset($_SESSION['basket']['processed']) ? $_SESSION['basket']['processed'] : array(); $_SESSION['basket']['unprocessed'] = isset($_SESSION['basket']['unprocessed']) ? $_SESSION['basket']['unprocessed'] : array(); @@ -1885,7 +1893,7 @@ function _fedora_repository_get_basket_pids() { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $ob = new ObjectHelper(); foreach ($_SESSION['basket']['unprocessed'] as $pid) { - // Check if the pid already exists in the tree +// Check if the pid already exists in the tree if (array_key_exists($pid, $pids)) { continue; } @@ -1978,18 +1986,18 @@ function fedora_repository_batch_reingest_object($object, &$context) { if (!validPid($pid)) { return NULL; } - // Does the object exist? If so, purge it. +// Does the object exist? If so, purge it. $item = new Fedora_Item($pid); if ($item->exists()) { $item->purge(t('Remove during re-install batch job')); } - // Ingest the object from the source file. +// Ingest the object from the source file. if (!empty($object['foxml_file'])) { $foxml_file = $object['foxml_file']; $new_item = Fedora_Item::ingest_from_FOXML_file($foxml_file); if ($new_item->exists()) { - // Batch operation was successful. +// Batch operation was successful. $context['message'][] = "$new_item->pid installed."; } } diff --git a/formClass.inc b/formClass.inc index b7387a43..128724f4 100644 --- a/formClass.inc +++ b/formClass.inc @@ -696,93 +696,140 @@ class formClass { /** * Creates a drupal form to edit either the QDC or DC datastream */ - function createMetaDataForm($pid, $dsId = NULL, $client) { - if (!isset($dsId)) { - $dsId = 'QDC'; + function createMetaDataForm($pid, $dsId = NULL, $client, &$form_state) { + if (module_exists('islandora_content_model_forms')) { + // Get the content model. + $content_model = ContentModel::loadFromObject($pid); + $form_names = islandora_content_model_get_form_names($content_model->pid); } - - //$client = getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); - $params = array('pid' => "$pid", 'dsID' => "$dsId", 'asOfDateTime' => ""); - try { - $object = $client->__soapCAll('getDatastreamDissemination', array('parameters' => $params)); - } catch (Exception $e) { - return array(); + if (isset($form_state['storage']['step']) || (isset($form_names) && count($form_names) > 0)) { + // Form Exists... + $form_state['storage']['step'] = isset($form_state['storage']['step']) ? $form_state['storage']['step'] : 1; + switch ($form_state['storage']['step']) { + case 1: + $form['indicator'] = array( + '#type' => 'fieldset', + '#title' => t('Choose edit form.') + ); + $form['indicator']['forms'] = array( + '#type' => 'select', + '#title' => t('Forms'), + '#options' => $form_names, + '#description' => t('Select the form to populate the metadata of the new object.') + ); + $form['submit'] = array( + '#type' => 'submit', + '#submit' => array('fedora_repository_edit_qdc_form_submit'), + '#value' => 'Next' + ); + return $form; + case 2: + // XML Forms + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + if (isset($form_state['values']['forms']) || $xml_form->isInitialized()) { + if (!$xml_form->isInitialized()) { + module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); + module_load_include('inc', 'xml_form_builder', 'FormBuilder'); + $form_name = $form_state['values']['forms']; + $definition = FormBuilder::GetFormDefinition($form_name); + $form = XMLFormDefinition::GetDrupalForm($definition); + $properties = XMLFormDefinition::GetFormProperties($definition); + $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema']); + $xml_form->initialize($form, $document); + } + return $xml_form->toArray(); + } + break; + } } + else { + if (!isset($dsId)) { + $dsId = 'QDC'; + } + //$client = getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); + $params = array('pid' => "$pid", 'dsID' => "$dsId", 'asOfDateTime' => ""); + try { + $object = $client->__soapCAll('getDatastreamDissemination', array('parameters' => $params)); + } catch (Exception $e) { + return array(); + } - $content = $object->dissemination->stream; - $content = trim($content); - $doc = new DOMDocument(); - if (!$doc->loadXML($content)) { - echo "error loading xml"; - } + $content = $object->dissemination->stream; + $content = trim($content); + $doc = new DOMDocument(); + if (!$doc->loadXML($content)) { + echo "error loading xml"; + } - $oai_dc = $doc->getElementsByTagName('dc'); + $oai_dc = $doc->getElementsByTagName('dc'); - $dcItems = $oai_dc->item(0)->getElementsByTagName('*'); - $form = array(); - for ($i = 0; $i < $dcItems->length; $i++) { - $name = $dcItems->item($i)->nodeName; - if ($name == 'dc:description') { - $form["$name" . '-' . "$i"] = array( - '#title' => $name, - '#type' => 'textarea', - '#default_value' => $dcItems->item($i)->nodeValue, - '#description' => 'Dublin Core ' . substr($dcItems->item($i)->nodeName, 3) - ); - } - elseif ($name == 'dc:title') { - $form["$name" . '-' . "$i"] = array( - '#title' => $name, - '#type' => 'textfield', - '#required' => 'TRUE', - '#default_value' => $dcItems->item($i)->nodeValue, - '#description' => 'Dublin Core ' . substr($dcItems->item($i)->nodeName, 3) - ); - } - else { - if ($oai_dc->item(0)->nodeName != $dcItems->item($i)->parentNode->nodeName) { - $description = strstr($name, ':'); - $form['app_' . "$name" . '-' . "$i"] = array( + $dcItems = $oai_dc->item(0)->getElementsByTagName('*'); + $form = array(); + for ($i = 0; $i < $dcItems->length; $i++) { + $name = $dcItems->item($i)->nodeName; + if ($name == 'dc:description') { + $form["$name" . '-' . "$i"] = array( + '#title' => $name, + '#type' => 'textarea', + '#default_value' => $dcItems->item($i)->nodeValue, + '#description' => 'Dublin Core ' . substr($dcItems->item($i)->nodeName, 3) + ); + } + elseif ($name == 'dc:title') { + $form["$name" . '-' . "$i"] = array( '#title' => $name, '#type' => 'textfield', + '#required' => 'TRUE', '#default_value' => $dcItems->item($i)->nodeValue, - '#description' => 'Dublin Core ' . substr($description, 1) + '#description' => 'Dublin Core ' . substr($dcItems->item($i)->nodeName, 3) ); } else { - $field_type = 'textfield'; - $value = $dcItems->item($i)->nodeValue; - if ($name == 'dc:coverage') { - $value = ''; + if ($oai_dc->item(0)->nodeName != $dcItems->item($i)->parentNode->nodeName) { + $description = strstr($name, ':'); + $form['app_' . "$name" . '-' . "$i"] = array( + '#title' => $name, + '#type' => 'textfield', + '#default_value' => $dcItems->item($i)->nodeValue, + '#description' => 'Dublin Core ' . substr($description, 1) + ); } - if ($name == 'dc:rights') { - $field_type = 'textarea'; + else { + $field_type = 'textfield'; + $value = $dcItems->item($i)->nodeValue; + if ($name == 'dc:coverage') { + $value = ''; + } + if ($name == 'dc:rights') { + $field_type = 'textarea'; + } + $description = strstr($name, ':'); + $form["$name" . '-' . "$i"] = array( + '#title' => $name, + '#type' => $field_type, + '#default_value' => $value, + '#description' => 'Dublin Core ' . substr($description, 1) + ); } - $description = strstr($name, ':'); - $form["$name" . '-' . "$i"] = array( - '#title' => $name, - '#type' => $field_type, - '#default_value' => $value, - '#description' => 'Dublin Core ' . substr($description, 1) - ); } } - } - $form['pid'] = array( - '#type' => 'hidden', - '#value' => "$pid" - ); - $form['dsid'] = array( - '#type' => 'hidden', - '#value' => "$dsId" - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Update Metadata'), - ); + $form['pid'] = array( + '#type' => 'hidden', + '#value' => "$pid" + ); + $form['dsid'] = array( + '#type' => 'hidden', + '#value' => "$dsId" + ); + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Update Metadata'), + ); - return $form; + return $form; + } } /** diff --git a/plugins/fedoraObject.inc b/plugins/fedoraObject.inc index 198698e9..3520614c 100644 --- a/plugins/fedoraObject.inc +++ b/plugins/fedoraObject.inc @@ -15,6 +15,7 @@ class FedoraObject { $objectHelper = new ObjectHelper(); $tabset = array(); $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form'); + $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_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( @@ -41,6 +42,7 @@ class FedoraObject { $tabset['fedora_object_details']['tabset']['edit'] = array( '#type' => 'tabpage', '#title' => t('Edit'), + '#selected' => $show_edit_tab, '#content' => $editform, ); } From 1df56b1f87ee00925ca647f25bc4827dc92f21ab Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 21 Jun 2011 19:24:37 -0300 Subject: [PATCH 007/247] Edit form now populates correctly, --- formClass.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 128724f4..bcabc6bf 100644 --- a/formClass.inc +++ b/formClass.inc @@ -735,7 +735,18 @@ class formClass { $definition = FormBuilder::GetFormDefinition($form_name); $form = XMLFormDefinition::GetDrupalForm($definition); $properties = XMLFormDefinition::GetFormProperties($definition); - $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema']); + // XML + $dsid = islandora_content_model_get_dsid($content_model->pid, $form_name); + $params = array('pid' => "$pid", 'dsID' => "$dsid", 'asOfDateTime' => ""); + try { + $object = $client->__soapCAll('getDatastreamDissemination', array('parameters' => $params)); + } catch (Exception $e) { + return array(); // Empty form? + } + $xml = $object->dissemination->stream; + $xml = trim($xml); + // XML + $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema'], $xml); $xml_form->initialize($form, $document); } return $xml_form->toArray(); From 4e6dad81a413ac37ffd6ab55fbd590d774934337 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 21 Jun 2011 21:09:59 -0300 Subject: [PATCH 008/247] broken? --- fedora_repository.module | 108 ++++++++++++++++++++++----------------- formClass.inc | 4 ++ 2 files changed, 65 insertions(+), 47 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 72f97b2a..4ce0d7d2 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -119,52 +119,52 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label function fedora_repository_ingest_form_submit($form, &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH - if (module_exists('xml_form_api')) { + if ($form_state['storage']['xml']) { module_load_include('inc', 'xml_form_api', 'XMLForm'); - $form = new XMLForm($form_state); - $doc = $form->submit($drupal_form, $form_state); - $document = $doc->document; - dom_document_pretty_print($document); - exit(); + $xml_form = new XMLForm($form_state); + if ($xml_form->isInitialized()) { + $doc = $form->submit($drupal_form, $form_state); + $document = $doc->document; + dom_document_pretty_print($document); + exit(); + } } - else { - if ($form_state['clicked_button']['#id'] == 'edit-submit') { - global $base_url; - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); - $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - $err = TRUE; - $redirect = TRUE; - if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['collection_pid'])) !== FALSE) { - $relationship = $cp->getRelationship(); - - if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { - $pid = $cp->getNextPid($contentModelDsid); - global $user; - $form_state['values']['user_id'] = $user->name; - $form_state['values']['pid'] = $pid; - $form_state['values']['content_model_pid'] = $contentModelPid; - $form_state['values']['relationship'] = $relationship; - - $err = (!$cm->execFormHandler($form_state['values'], $form_state)); - - $_SESSION['fedora_ingest_files'] = ''; //empty this variable - - $attr = $cm->getIngestFormAttributes(); - $redirect = $attr['redirect']; - - if ($redirect) { - $form_state['storage'] = NULL; - } + else if ($form_state['clicked_button']['#id'] == 'edit-submit') { + global $base_url; + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + + $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); + $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); + $err = TRUE; + $redirect = TRUE; + if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['collection_pid'])) !== FALSE) { + $relationship = $cp->getRelationship(); + + if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + $pid = $cp->getNextPid($contentModelDsid); + global $user; + $form_state['values']['user_id'] = $user->name; + $form_state['values']['pid'] = $pid; + $form_state['values']['content_model_pid'] = $contentModelPid; + $form_state['values']['relationship'] = $relationship; + + $err = (!$cm->execFormHandler($form_state['values'], $form_state)); + + $_SESSION['fedora_ingest_files'] = ''; //empty this variable + + $attr = $cm->getIngestFormAttributes(); + $redirect = $attr['redirect']; + + if ($redirect) { + $form_state['storage'] = NULL; } } + } - if ($redirect) { - $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; - } + if ($redirect) { + $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; } } } @@ -180,7 +180,7 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { case 2: // XML based form. - if (module_exists('xml_form_api')) { + if ($form_state['storage']['xml']) { module_load_include('inc', 'xml_form_api', 'XMLForm'); $xml_form = new XMLForm($form_state); $xml_form->validate($form, $form_state); @@ -618,9 +618,16 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { } function fedora_repository_edit_qdc_form_validate($form, &$form_state) { - if (isset($form_state['storage']['step']) && $form_state['storage']['step'] == 1) { - $form_state['storage']['step']++; - $form_state['rebuild'] = TRUE; + if (isset($form_state['storage']['step'])) { + if ($form_state['storage']['step'] == 1) { + $form_state['storage']['step']++; + $form_state['rebuild'] = TRUE; + } + else { + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + $xml_form->validate($form, $form_state); + } } } @@ -634,8 +641,15 @@ function fedora_repository_edit_qdc_form_validate($form, &$form_state) { * @return */ function fedora_repository_edit_qdc_form_submit($form, &$form_state) { - if (true) { - + if ($form_state['storage']['xml']) { + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + if ($xml_form->isInitialized()) { + $doc = $form->submit($drupal_form, $form_state); + $document = $doc->document; + dom_document_pretty_print($document); + exit(); + } } else { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); diff --git a/formClass.inc b/formClass.inc index bcabc6bf..083deb7c 100644 --- a/formClass.inc +++ b/formClass.inc @@ -502,6 +502,8 @@ class formClass { $form_names = islandora_content_model_get_form_names($contentModels[0]->pid); } + $form_state['storage']['xml'] = false; + switch ($form_state['storage']['step']) { case 1: $form['indicator'] = array( @@ -535,6 +537,7 @@ class formClass { module_load_include('inc', 'xml_form_api', 'XMLForm'); $xml_form = new XMLForm($form_state); if (isset($form_state['values']['forms']) || $xml_form->isInitialized()) { + $form_state['storage']['xml'] = true; if (!$xml_form->isInitialized()) { module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); module_load_include('inc', 'xml_form_builder', 'FormBuilder'); @@ -749,6 +752,7 @@ class formClass { $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema'], $xml); $xml_form->initialize($form, $document); } + $form_state['storage']['xml'] = true; return $xml_form->toArray(); } break; From 1e7ae558b209cda2a9ee7cc0657c8ee1afb0f48f Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 21 Jun 2011 21:40:56 -0300 Subject: [PATCH 009/247] Fixed some bugs for the submission of xml forms. --- fedora_repository.module | 20 ++++++++------------ formClass.inc | 1 + 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 4ce0d7d2..1a95be07 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -122,12 +122,10 @@ function fedora_repository_ingest_form_submit($form, &$form_state) { if ($form_state['storage']['xml']) { module_load_include('inc', 'xml_form_api', 'XMLForm'); $xml_form = new XMLForm($form_state); - if ($xml_form->isInitialized()) { - $doc = $form->submit($drupal_form, $form_state); - $document = $doc->document; - dom_document_pretty_print($document); - exit(); - } + $doc = $xml_form->submit($form, $form_state); + $document = $doc->document; + dom_document_pretty_print($document); + exit(); } else if ($form_state['clicked_button']['#id'] == 'edit-submit') { global $base_url; @@ -644,12 +642,10 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) { if ($form_state['storage']['xml']) { module_load_include('inc', 'xml_form_api', 'XMLForm'); $xml_form = new XMLForm($form_state); - if ($xml_form->isInitialized()) { - $doc = $form->submit($drupal_form, $form_state); - $document = $doc->document; - dom_document_pretty_print($document); - exit(); - } + $doc = $xml_form->submit($form, $form_state); + $document = $doc->document; + dom_document_pretty_print($document); + exit(); } else { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); diff --git a/formClass.inc b/formClass.inc index 083deb7c..10921bf2 100644 --- a/formClass.inc +++ b/formClass.inc @@ -705,6 +705,7 @@ class formClass { $content_model = ContentModel::loadFromObject($pid); $form_names = islandora_content_model_get_form_names($content_model->pid); } + $form_state['storage']['xml'] = false; if (isset($form_state['storage']['step']) || (isset($form_names) && count($form_names) > 0)) { // Form Exists... $form_state['storage']['step'] = isset($form_state['storage']['step']) ? $form_state['storage']['step'] : 1; From 2bd1e56ebd83871b03b207c5c8207f6c75edc825 Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Wed, 22 Jun 2011 12:44:05 -0300 Subject: [PATCH 010/247] ISLANDORA-278 Updated files to meet Coder standards. Mostly t() tags. Also renamed a couple of functions. I did a find / replace for the 3 function name changes. validPid to valid_pid validDsid to valid_dsid fixDsid to fix_dsid One of the changes I've made has caused a minor bug in the islandora module. There are extra spaces in the collections URL. --- CollectionClass.inc | 7 +- CollectionPolicy.inc | 11 ++- ConnectionHelper.inc | 1 + ContentModel.inc | 57 +++++++------ MimeClass.inc | 2 +- ObjectHelper.inc | 16 ++-- SearchClass.inc | 9 +- SecurityClass.inc | 6 +- XMLDatastream.inc | 13 +-- api/dublin_core.inc | 3 +- api/fedora_collection.inc | 5 +- api/fedora_export.inc | 59 ++++++------- api/fedora_item.inc | 16 ++-- api/fedora_utils.inc | 6 +- api/rels-ext.inc | 3 +- api/tagging.inc | 2 +- fedora_repository.module | 16 ++-- fedora_repository.solutionpacks.inc | 1 + formClass.inc | 5 +- form_elements/includes/autocomplete.inc | 93 +++++++++++---------- form_elements/includes/creative_commons.inc | 7 +- form_elements/includes/filechooser.inc | 18 ++-- form_elements/includes/people.inc | 64 +++++++------- ilives/image_rotator_tagger_block.inc | 6 +- plugins/Refworks.inc | 2 +- plugins/ShowStreamsInFieldSets.inc | 2 +- 26 files changed, 238 insertions(+), 192 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index c90a5e89..78e9e857 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -2,7 +2,8 @@ -/* +/** + * @file * Created on 18-Feb-08 * * To change the template for this generated file go to @@ -284,7 +285,7 @@ class CollectionClass { $thisClass = new $phpClass (); $returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext); if (!$returnValue) { - drupal_set_message('Error! Failed running content model method !m !rv', array('!m' => $phpMethod, '!rv' => $returnValue)); + drupal_set_message(t('Error! Failed running content model method !m !rv'), array('!m' => $phpMethod, '!rv' => $returnValue)); return FALSE; } } @@ -393,7 +394,7 @@ class CollectionClass { module_load_include('inc', 'fedora_repository', 'plugins/PersonalCollectionClass'); $personalCollectionClass = new PersonalCollectionClass(); if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) { - drupal_set_message("Did not create a personal collection object for !u", array('!u' => $user->name)); + drupal_set_message(t("Did not create a personal collection object for !u"), array('!u' => $user->name)); return FALSE; //creation failed don't save the collection pid in drupal db } user_save($user, $personal_collection_pid); diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index 21002710..f102933b 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -1,6 +1,9 @@ validate()) { + if (self::valid_dsid($dsid) && $this->validate()) { $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); $namespace = FALSE; for ($i = 0; $namespace === FALSE && $i < $content_models->length; $i++) { @@ -568,7 +571,7 @@ class CollectionPolicy extends XMLDatastream { function addModel($cm, $namespace) { $ret = FALSE; - if (self::validPid($namespace) && $this->validate() && $cm->validate()) { + if (self::valid_pid($namespace) && $this->validate() && $cm->validate()) { $contentmodelsEl = $this->xml->getElementsByTagName('content_models'); $models = $contentmodelsEl->item(0)->getElementsByTagName('content_model'); $found = FALSE; diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 1de4cd01..9077d998 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -3,6 +3,7 @@ /* + * @file * Created on Jan 24, 2008 * * To change the template for this generated file go to diff --git a/ContentModel.inc b/ContentModel.inc index e4b112e0..c41540a6 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -1,6 +1,9 @@ get_datastream_dissemination($dsid); if (!empty($ds)) { $ret = new ContentModel($ds, $pid, $dsid, $pid_namespace, $name); @@ -468,7 +471,7 @@ class ContentModel extends XMLDatastream { */ private function getDSModel($dsid) { $ret = FALSE; - if (self::validDsid($dsid) && $this->validate()) { + if (self::valid_dsid($dsid) && $this->validate()) { $result = $this->xml->getElementsByTagName('datastreams'); if ($result->length > 0) { $result = $result->item(0)->getElementsByTagName('datastream'); @@ -579,23 +582,23 @@ class ContentModel extends XMLDatastream { $elementsEl = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0); $elements = $elementsEl->getElementsByTagName('element'); $found = FALSE; - $refEl = FALSE; + $ref_el = FALSE; for ($i = 0; $found === FALSE && $i < $elements->length; $i++) { if ($elements->item($i)->getAttribute('name') == trim($name)) { if ($reorder == 'inc') { $found = $elements->item($i); - $refEl = ($i > 0) ? $elements->item($i - 1) : false; + $ref_el = ($i > 0) ? $elements->item($i - 1) : FALSE; } else { $found = ($i + 1 < $elements->length) ? $elements->item($i + 1) : FALSE; - $refEl = $elements->item($i); + $ref_el = $elements->item($i); } } } if ($found !== FALSE) { $elementsEl->removeChild($found); - $elementsEl->insertBefore($found, $refEl); + $elementsEl->insertBefore($found, $ref_el); $ret = TRUE; } } @@ -867,23 +870,23 @@ class ContentModel extends XMLDatastream { $items = $authListEl->getElementsByTagName('item'); $found = FALSE; - $refEl = FALSE; + $ref_el = FALSE; for ($i = 0; $found === FALSE && $i < $items->length; $i++) { if ($items->item($i)->nodeValue == $value) { if ($reorder == 'inc') { - $refEl = ($i > 0) ? $items->item($i - 1) : FALSE; + $ref_el = ($i > 0) ? $items->item($i - 1) : FALSE; $found = $items->item($i); } else { - $refEl = $items->item($i); + $ref_el = $items->item($i); $found = ($i + 1 < $items->length) ? $items->item($i + 1) : FALSE; } } } - if ($found !== FALSE && $refEl !== FALSE) { + if ($found !== FALSE && $ref_el !== FALSE) { $authListEl->removeChild($found); - $authListEl->insertBefore($found, $refEl); + $authListEl->insertBefore($found, $ref_el); $ret = TRUE; } } @@ -1077,7 +1080,7 @@ class ContentModel extends XMLDatastream { */ public function buildEditMetadataForm($pid, $dsid) { $ret = FALSE; - if (self::validDsid($dsid) && $this->validate()) { + if (self::valid_dsid($dsid) && $this->validate()) { $method = $this->xml->getElementsByTagName('edit_metadata_method'); if ($method->length > 0 && $method->item(0)->getAttribute('dsid') == $dsid) { $method = $method->item(0); @@ -1210,7 +1213,7 @@ class ContentModel extends XMLDatastream { */ public function updateEditMetadataMethod($module, $file, $class, $method, $handler, $dsid) { $ret = FALSE; - if (self::validDsid($dsid) && $this->validate()) { + if (self::valid_dsid($dsid) && $this->validate()) { $methodEl = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); if ($methodEl->length > 0) { $methodEl = $methodEl->item(0); @@ -1240,7 +1243,7 @@ class ContentModel extends XMLDatastream { */ public function execAddDatastreamMethods($dsid, $file) { $ret = FALSE; - if (self::validDsid($dsid) && $this->validate() && ($ds = $this->getDSModel($dsid)) !== FALSE) { + if (self::valid_dsid($dsid) && $this->validate() && ($ds = $this->getDSModel($dsid)) !== FALSE) { $addMethod = $ds->getElementsByTagName('add_datastream_method'); if ($addMethod->length > 0) { $addMethod = $addMethod->item(0); @@ -1567,7 +1570,7 @@ class ContentModel extends XMLDatastream { public function addDs($dsid, $display_in_fieldset = FALSE) { $ret = FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) === FALSE) { + if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) === FALSE) { $datastreamsEl = $this->xml->getElementsByTagName('datastreams'); if ($datastreamsEl->length > 0) { $datastreamsEl = $datastreamsEl->item(0); @@ -1591,7 +1594,7 @@ class ContentModel extends XMLDatastream { public function removeDs($dsid) { $ret = FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { + if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $datastreamsEl = $this->xml->getElementsByTagName('datastreams')->item(0); $datastreamsEl->removeChild($ds); $ret = TRUE; @@ -1601,7 +1604,7 @@ class ContentModel extends XMLDatastream { public function displayInFieldset($dsid) { $ret = FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { + if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $ret = strtolower($ds->getAttribute('display_in_fieldset')) == 'true'; } return $ret; @@ -1609,7 +1612,7 @@ class ContentModel extends XMLDatastream { public function setDisplayInFieldset($dsid, $value = TRUE) { $ret = FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { + if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { if ($value == FALSE && $ds->attributes->getNamedItem('display_in_fieldset') !== NULL) { $ds->removeAttribute('display_in_fieldset'); $ret = TRUE; @@ -1625,7 +1628,7 @@ class ContentModel extends XMLDatastream { public function setDefaultDispMeth($dsid, $module, $file, $class, $method) { $ret = FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { + if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $found = FALSE; $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { @@ -1654,7 +1657,7 @@ class ContentModel extends XMLDatastream { public function removeDispMeth($dsid, $module, $file, $class, $method) { $ret = FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { + if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $found = FALSE; $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { @@ -1676,7 +1679,7 @@ class ContentModel extends XMLDatastream { public function addDispMeth($dsid, $module, $file, $class, $method, $default = FALSE) { $ret = FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { + if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $dispMethEl = $this->xml->createElement('display_method'); $dispMethEl->setAttribute('module', $module); $dispMethEl->setAttribute('file', $file); @@ -1757,7 +1760,7 @@ class ContentModel extends XMLDatastream { public function addIngestMethod($rule_id, $module, $file, $class, $method, $dsid, $modified_files_ext) { $ret = FALSE; - if (self::validDsid($dsid) && ($rule = $this->getIngestRule($rule_id)) !== FALSE) { + if (self::valid_dsid($dsid) && ($rule = $this->getIngestRule($rule_id)) !== FALSE) { $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $meth = $this->xml->createElement('ingest_method'); $meth->setAttribute('module', $module); @@ -1883,7 +1886,7 @@ class ContentModel extends XMLDatastream { public function addIngestRule($applies_to, $module, $file, $class, $method, $dsid, $modified_files_ext) { $ret = FALSE; - if (self::validDsid($dsid) && $this->validate()) { + if (self::valid_dsid($dsid) && $this->validate()) { $ingestRulesEl = $this->xml->getElementsByTagName('ingest_rules')->item(0); $rule = $this->xml->createElement('rule'); $ingestMethodsEl = $this->xml->createElement('ingest_methods'); @@ -1949,7 +1952,7 @@ class ContentModel extends XMLDatastream { public function editIngestFormAttributes($dsid, $page, $hide_file_chooser = FALSE, $redirect = TRUE) { $ret = FALSE; - if (self::validDsid($dsid) && $this->validate()) { + if (self::valid_dsid($dsid) && $this->validate()) { $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); $ingest_formEl->setAttribute('dsid', $dsid); $ingest_formEl->setAttribute('page', $page); diff --git a/MimeClass.inc b/MimeClass.inc index 7d2ae33e..bf944ee2 100644 --- a/MimeClass.inc +++ b/MimeClass.inc @@ -3,7 +3,7 @@ /** - * + * @file * This class inspired by Chris Jean's work, here: * http://chrisjean.com/2009/02/14/generating-mime-type-in-php-is-not-magic/ * diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 4f5044eb..7eafac82 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -3,8 +3,8 @@ /* + * @file * Created on Feb 1, 2008 - * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ @@ -48,7 +48,7 @@ class ObjectHelper { } $headers = module_invoke_all('file_download', "/fedora/repository/$pid/$dsID"); if (in_array(-1, $headers)) { - drupal_set_message('hello'); + drupal_set_message(t('hello')); drupal_access_denied(); return ' '; @@ -346,7 +346,7 @@ class ObjectHelper { $input = new DomDocument(); $input->loadXML(trim($xmlstr)); } catch (exception $e) { - watchdog(t("Fedora_Repository"), t("Problem loading XSL file: !e", array('!e' => $e)), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem loading XSL file: !e", array('!e' => $e), NULL, WATCHDOG_ERROR); } $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); @@ -521,7 +521,7 @@ class ObjectHelper { try { $sxml = new SimpleXMLElement($content_models); } catch (exception $e) { - watchdog(t("Fedora_Repository"), t("Could not find a parent object for %s", $pid), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Could not find a parent object for %s", $pid, NULL, WATCHDOG_ERROR); return $pids; } @@ -632,7 +632,7 @@ class ObjectHelper { // $ingestObject = ' $collectionName, '!collection_pid' => $collection_pid)) . '" href="' . base_path() . 'fedora/ingestObject/' . $collection_pid . '/' . $collectionName . '">' . t('Add a New Object') . '' . t(' Add to this Collection'); + '/images/ingest.png" alt="' . t('Add a New Object') . '" class="icon"> ' . t('Add to this Collection'); } } } @@ -715,7 +715,7 @@ class ObjectHelper { $parent_collections_HTML .= '' . $collection_label . '
      '; } if (!empty($parent_collections_HTML)) { - $parent_collections_HTML = '

      ' . t("Belongs to these collections: ") . '

      ' . $parent_collections_HTML . ''; + $parent_collections_HTML = '

      ' . t("Belongs to these collections:") . '

      ' . $parent_collections_HTML . ''; } return $parent_collections_HTML; @@ -899,8 +899,8 @@ class ObjectHelper { $warnMess = "Creation of one or more datastreams failed.
      "; $configMess = "Please ensure that %app is installed and configured for this site. "; - drupal_set_message($warnMess, 'warning', false); - drupal_set_message(t($configMess . "
      " . $messMap[$app] . "
      ", array('%app' => $app)), 'warning', false); + drupal_set_message($warnMess, 'warning', FALSE); + drupal_set_message(t($configMess . "
      " . $messMap[$app] . "
      ", array('%app' => $app)), 'warning', FALSE); } } diff --git a/SearchClass.inc b/SearchClass.inc index ef62ce91..84614145 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -1,6 +1,9 @@ $e->getMessage())), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Error getting solr search results class: !message", array('!message' => $e->getMessage()), NULL, WATCHDOG_ERROR); return 'Error getting solr search results class. Check watchdog for more info.'; } return $implementation->$solrFunction($query, $startPage, $fq, $dismax); @@ -363,7 +366,7 @@ class SearchClass { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t('Error loading results xslt! ') . $e->getMessage()); + drupal_set_message(t('Error loading results xslt!') . " " . $e->getMessage()); return ' '; } diff --git a/SecurityClass.inc b/SecurityClass.inc index 37a1a90c..c871895f 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -3,8 +3,8 @@ /* + * @file * Created on 22-Oct-08 - * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ @@ -58,7 +58,7 @@ class SecurityClass { try { $xml = new SimpleXMLElement($policyStream); } catch (Exception $e) { - watchdog(t("Fedora_Repository"), t("No roles found in security policy, could not parse policy stream."), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "No roles found in security policy, could not parse policy stream.", NULL, WATCHDOG_ERROR); //we may not want to send this to the screen. drupal_set_message(t('No roles found in security policy, could not parse policy stream: !message', array('!message' => $e->getMessage())), 'error'); return NULL; @@ -104,7 +104,7 @@ class SecurityClass { try { $doc->load(drupal_get_path('module', 'Fedora_Repository') . '/policies/noObjectEditPolicy.xml'); } catch (exception $e) { - watchdog(t("Fedora_Repository"), t("Problem loading policy file."), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem loading policy file.", NULL, WATCHDOG_ERROR); } $conditions = $doc->getElementsByTagName('Condition'); foreach ($conditions as $condition) { diff --git a/XMLDatastream.inc b/XMLDatastream.inc index c012be8a..d4c2d55d 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -1,6 +1,9 @@ registerNamespace('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); - $descNode = $xpath->query("//rdf:RDF/rdf:Description")->item(0); + $desc_node = $xpath->query("//rdf:RDF/rdf:Description")->item(0); - if ($model = $descNode->getElementsByTagName('hasModel')->item(0)) { - $descNode->removeChild($model); + if ($model = $desc_node->getElementsByTagName('hasModel')->item(0)) { + $desc_node->removeChild($model); } - if ($member = $descNode->getElementsByTagName('rel:isMemberOfCollection')->item(0)) { - $descNode->removeChild($member); + if ($member = $desc_node->getElementsByTagName('rel:isMemberOfCollection')->item(0)) { + $desc_node->removeChild($member); } } @@ -95,24 +98,24 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re // Update datastream uris $xpath->registerNamespace('foxml', 'info:fedora/fedora-system:def/foxml#'); - foreach ($xpath->query("//foxml:datastream[@ID]") as $dsNode) { + foreach ($xpath->query("//foxml:datastream[@ID]") as $ds_node) { // Don't update datastreams having external uris - if (in_array($dsNode->getAttribute('CONTROL_GROUP'), $disallowed_groups)) { + if (in_array($ds_node->getAttribute('CONTROL_GROUP'), $disallowed_groups)) { continue; } - $dsId = $dsNode->getAttribute('ID'); + $ds_id = $ds_node->getAttribute('ID'); // Remove QUERY datastream - if ($dsId == "QUERY") { - $parentNode = $xpath->query('/foxml:digitalObject')->item(0); - $parentNode->removeChild($dsNode); + if ($ds_id == "QUERY") { + $parent_node = $xpath->query('/foxml:digitalObject')->item(0); + $parent_node->removeChild($ds_node); } - foreach ($dsNode->getElementsByTagName('*') as $contentNode) { - if ($str = $contentNode->getAttribute('REF')) { - $contentNode->setAttribute('REF', url($paths[$dsId], array('absolute' => TRUE))); + foreach ($ds_node->getElementsByTagName('*') as $content_node) { + if ($str = $content_node->getAttribute('REF')) { + $content_node->setAttribute('REF', url($paths[$ds_id], array('absolute' => TRUE))); } } } @@ -122,29 +125,29 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re case METS_11: // Update datastream uris $xpath->registerNamespace('METS', 'http://www.loc.gov/METS/'); - foreach ($xpath->query('//METS:fileGrp[@ID="DATASTREAMS"]/METS:fileGrp') as $dsNode) { + foreach ($xpath->query('//METS:fileGrp[@ID="DATASTREAMS"]/METS:fileGrp') as $ds_node) { - $dsId = $dsNode->getAttribute('ID'); + $ds_id = $ds_node->getAttribute('ID'); // Remove QUERY datastream - if ($dsId == "QUERY") { - $parentNode = $xpath->query('//METS:fileGrp[@ID="DATASTREAMS"]')->item(0); - $parentNode->removeChild($dsNode); + if ($ds_id == "QUERY") { + $parent_node = $xpath->query('//METS:fileGrp[@ID="DATASTREAMS"]')->item(0); + $parent_node->removeChild($ds_node); } $xpath->registerNamespace('xlink', 'http://www.loc.gov/METS/'); - foreach ($xpath->query('METS:file[@OWNERID!="E"][@OWNERID!="R"]/METS:FLocat[@xlink:href]', $dsNode) as $Floc) { - $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => TRUE))); + foreach ($xpath->query('METS:file[@OWNERID!="E"][@OWNERID!="R"]/METS:FLocat[@xlink:href]', $ds_node) as $floc) { + $floc->setAttribute('xlink:href', url($paths[$ds_id], array('absolute' => TRUE))); } /* - foreach ($dsNode->getElementsByTagName('METS:file') as $contentNode) { + foreach ($ds_node->getElementsByTagName('METS:file') as $content_node) { // Don't update datastreams having external uris - if (in_array($dsNode->getAttribute('OWNERID'), $disallowed_groups)) { + if (in_array($ds_node->getAttribute('OWNERID'), $disallowed_groups)) { continue; } - foreach ($xpath->('METS:FLocat[@xlink:href]', $contentNode) as $Floc) { - $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => true))); + foreach ($xpath->('METS:FLocat[@xlink:href]', $content_node) as $floc) { + $floc->setAttribute('xlink:href', url($paths[$ds_id], array('absolute' => true))); } `} */ @@ -170,8 +173,8 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re return TRUE; } -function get_file_extension($mimeType) { - return substr(strstr($mimeType, '/'), 1); +function get_file_extension($mime_type) { + return substr(strstr($mime_type, '/'), 1); } function log_line($msg, $severity = 'info', $sep = "\t") { diff --git a/api/fedora_item.inc b/api/fedora_item.inc index ef07e4de..81ef669b 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -1,6 +1,10 @@ get_datastream_dissemination('RELS-EXT'); } catch (exception $e) { - drupal_set_message("Error retrieving RELS-EXT of object $pid", 'error'); + drupal_set_message(t("Error retrieving RELS-EXT of object $pid"), 'error'); return $relationships; } @@ -516,7 +520,7 @@ class Fedora_Item { foreach ($relationships as $rel) { if (empty($rel['subject']) || empty($rel['predicate']) || empty($rel['object']) || $rel['subject'] != 'info:fedora/' . $this->pid) { // drupal_set_message should use parameterized variables, not interpolated. - drupal_set_message("Error with relationship format: " . $rel['subject'] . " - " . $rel['predicate'] . ' - ' . $rel['object'], "error"); + drupal_set_message(t("Error with relationship format: " . $rel['subject'] . " - " . $rel['predicate'] . ' - ' . $rel['object']), "error"); return FALSE; } } @@ -683,7 +687,7 @@ class Fedora_Item { $result = $soap_client->__soapCall($function_name, array('parameters' => $params_array)); } else { - watchdog(t("FEDORA_REPOSITORY"), t("Error trying to get SOAP client connection.")); + watchdog(t("FEDORA_REPOSITORY"), "Error trying to get SOAP client connection."); return NULL; } } catch (exception $e) { @@ -696,7 +700,7 @@ class Fedora_Item { drupal_set_message(t("Error trying to call SOAP function $function_name. Check watchdog logs for more information."), 'error'); } - watchdog(t("FEDORA_REPOSITORY"), t("Error Trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e)), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error Trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e), NULL, WATCHDOG_ERROR); } return NULL; } @@ -709,13 +713,13 @@ class Fedora_Item { $result = $soap_client->__soapCall($function_name, array('parameters' => $params_array)); } else { - watchdog(t("FEDORA_REPOSITORY"), t("Error trying to get SOAP client connection.")); + watchdog(t("FEDORA_REPOSITORY"), "Error trying to get SOAP client connection."); return NULL; } } catch (exception $e) { if (!$quiet) { - watchdog(t("FEDORA_REPOSITORY"), t("Error trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e)), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e), NULL, WATCHDOG_ERROR); } return NULL; } diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 2ca9f6a4..f3362fb0 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -87,7 +87,7 @@ function fix_encoding($in_str) { } } -function validPid($pid) { +function valid_pid($pid) { $valid = FALSE; if (strlen(trim($pid)) <= 64 && preg_match('/^([A-Za-z0-9]|-|\.)+:(([A-Za-z0-9])|-|\.|~|_|(%[0-9A-F]{2}))+$/', trim($pid))) { $valid = TRUE; @@ -96,7 +96,7 @@ function validPid($pid) { return $valid; } -function validDsid($dsid) { +function valid_dsid($dsid) { $valid = FALSE; if (strlen(trim($dsid)) <= 64 && preg_match('/^[a-zA-Z0-9\_\-\.]+$/', trim($dsid))) { $valid = TRUE; @@ -105,7 +105,7 @@ function validDsid($dsid) { return $valid; } -function fixDsid($dsid) { +function fix_dsid($dsid) { $new_dsid = trim($dsid); $find = '/[^a-zA-Z0-9\.\_\-]/'; diff --git a/api/rels-ext.inc b/api/rels-ext.inc index 578a8760..de55c07f 100644 --- a/api/rels-ext.inc +++ b/api/rels-ext.inc @@ -2,7 +2,8 @@ -/* +/** + * @file * To change this template, choose Tools | Templates * and open the template in the editor. */ diff --git a/api/tagging.inc b/api/tagging.inc index da66e4db..a22caf76 100644 --- a/api/tagging.inc +++ b/api/tagging.inc @@ -62,7 +62,7 @@ class TagSet { $this->item->modify_datastream_by_value($tagdoc->saveXML(), $this->tagsDSID, 'Tags', 'text/xml', 'X'); } } catch (exception $e) { - drupal_set_message('There was an error saving the tags datastream: !e', array('!e' => $e), 'error'); + drupal_set_message(t('There was an error saving the tags datastream: !e'), array('!e' => $e), 'error'); return FALSE; } return TRUE; diff --git a/fedora_repository.module b/fedora_repository.module index f3ece0ad..bc4b69c3 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -94,8 +94,8 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label return ''; } - if (!validPid($collection_pid)) { - if (validPid(urldecode($collection_pid))) { + if (!valid_pid($collection_pid)) { + if (valid_pid(urldecode($collection_pid))) { $collection_pid = urldecode($collection_pid); } else { @@ -275,7 +275,7 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NUL function add_stream($collection_pid=NULL, $collectionName=NULL) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!validPid($collection_pid)) { + if (!valid_pid($collection_pid)) { drupal_set_message(t("This PID is not valid!"), 'error'); return ' '; } @@ -680,12 +680,12 @@ function fedora_repository_access($op, $node, $account) { */ function makeObject($pid, $dsID) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!validPid($pid)) { + if (!valid_pid($pid)) { drupal_set_message(t("Invalid PID!"), 'error'); return ' '; } - if (!validDsid($dsID)) { + if (!valid_dsid($dsID)) { drupal_set_message(t("Invalid dsID!"), 'error'); return ' '; } @@ -724,13 +724,13 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU return ''; } - if ($pid & !validPid($pid)) { + if ($pid & !valid_pid($pid)) { drupal_set_message(t("Invalid PID!"), 'error'); return ' '; } - if ($dsId & !validDsid($dsId)) { + if ($dsId & !valid_dsid($dsId)) { drupal_set_message(t("Invalid dsID!"), 'error'); return ' '; } @@ -1964,7 +1964,7 @@ function fedora_repository_batch_reingest_object($object, &$context) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!empty($object) && is_array($object)) { $pid = $object['pid']; - if (!validPid($pid)) { + if (!valid_pid($pid)) { return NULL; } // Does the object exist? If so, purge it. diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 28106517..de4ce137 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -1,6 +1,7 @@ __soapCall('ModifyDatastreamByValue', array($params)); } catch (exception $e) { - drupal_set_message(t("Error updating metadata ") . $e->getMessage(), 'error'); + drupal_set_message(t("Error updating metadata") . " " . $e->getMessage(), 'error'); } } @@ -512,7 +513,7 @@ class formClass { '#title' => t('Content models available'), '#options' => $modelsForForm, //'#description' => t('Content models available in this collection. A content model defines what is allowed in a collection and what to do with a file when it is uploaded (An example may creating a thumbnail from an image.).') - '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.
      Additional information may be found here. ') + '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.
      Additional information may be found here.') ); break; diff --git a/form_elements/includes/autocomplete.inc b/form_elements/includes/autocomplete.inc index 30b887a6..6a12ba58 100644 --- a/form_elements/includes/autocomplete.inc +++ b/form_elements/includes/autocomplete.inc @@ -1,6 +1,9 @@ escape($string); $query = 'name_personal_t:' . $string . '* OR name_organization_t:' . $string . '* OR name_conference_t:' . $string . '*'; - $additionalParams = array( + $additional_params = array( 'facet' => 'false', - 'qt' => $requestHandler, + 'qt' => $request_handler, ); try { - $results = $solr->search($query, 0, 10, $additionalParams); + $results = $solr->search($query, 0, 10, $additional_params); } catch (Exception $e) { - drupal_set_message(t('error searching ') . $e->getMessage()); + drupal_set_message(t('error searching') ." " . $e->getMessage()); } if (empty($results)) { drupal_set_message(t('Error searching solr index. Is the solr search block configured properly?'), 'error'); @@ -41,15 +44,15 @@ function ife_autocomplete_person($string) { $mods = $item->get_datastream_dissemination('MODS'); if (trim($mods) != '') { - $modsDom = new DomDocument(); - $modsDom->loadXML($mods); + $mods_dom = new DomDocument(); + $mods_dom->loadXML($mods); - $xpath = new DOMXPath($modsDom); + $xpath = new DOMXPath($mods_dom); $xpath->registerNamespace("php", "http://php.net/xpath"); $xpath->registerPHPFunctions(); // echo $mods; - $nodeList = $xpath->evaluate('/mods:mods/mods:name'); - foreach ($nodeList as $node) { + $node_list = $xpath->evaluate('/mods:mods/mods:name'); + foreach ($node_list as $node) { $type = $node->getAttribute('type'); $title = NULL; @@ -57,8 +60,8 @@ function ife_autocomplete_person($string) { $given = NULL; $family = NULL; $date = NULL; - $nameParts = $node->getElementsByTagName('namePart'); - foreach ($nameParts as $part) { + $name_parts = $node->getElementsByTagName('namePart'); + foreach ($name_parts as $part) { switch ($part->getAttribute('type')) { case 'given': $given = $part->nodeValue; break; @@ -78,9 +81,9 @@ function ife_autocomplete_person($string) { } $role = NULL; - $roleTerm = $node->getElementsByTagName('roleTerm'); - if ($roleTerm->length > 0) { - $role = $roleTerm->item(0)->nodeValue; + $role_term = $node->getElementsByTagName('roleTerm'); + if ($role_term->length > 0) { + $role = $role_term->item(0)->nodeValue; } if (strpos(strtolower($name), $string) !== FALSE) { @@ -95,7 +98,7 @@ function ife_autocomplete_person($string) { } function ife_autocomplete_marcrelator($collection, $string='') { - $moduleRoot = drupal_get_path('module', 'islandora_form_elements'); + $module_root = drupal_get_path('module', 'islandora_form_elements'); if ($string == '') { $string = $collection; @@ -104,30 +107,30 @@ function ife_autocomplete_marcrelator($collection, $string='') { $string = ucfirst(trim($string)); - $dom = DOMDocument::load($moduleRoot . '/xml/relators.rdf'); - $rootEl = $dom->getElementsByTagName('RDF'); - if ($rootEl->length > 0) { - $rootEl = $rootEl->item(0); + $dom = DOMDocument::load($module_root . '/xml/relators.rdf'); + $root_el = $dom->getElementsByTagName('RDF'); + if ($root_el->length > 0) { + $root_el = $root_el->item(0); $xpath = new DOMXPath($dom); - $xpath->registerNamespace('skos', $rootEl->getAttribute('xmlns:skos')); - $xpath->registerNamespace('rdf', $rootEl->getAttribute('xmlns:rdf')); + $xpath->registerNamespace('skos', $root_el->getAttribute('xmlns:skos')); + $xpath->registerNamespace('rdf', $root_el->getAttribute('xmlns:rdf')); $result = $xpath->query('/rdf:RDF/rdf:Description[starts-with(skos:prefLabel, "' . $string . '")]'); $terms = array(); foreach ($result as $term) { - $termVal = $term->getElementsByTagName('prefLabel')->item(0)->nodeValue; - $termVal = preg_replace('/\s+/', ' ', $termVal); - $terms[$term->getElementsByTagName('notation')->item(0)->nodeValue] = $termVal; + $term_val = $term->getElementsByTagName('prefLabel')->item(0)->nodeValue; + $term_val = preg_replace('/\s+/', ' ', $term_val); + $terms[$term->getElementsByTagName('notation')->item(0)->nodeValue] = $term_val; } echo drupal_json($terms); } } function ife_autocomplete_gacs($collection, $string='') { - $moduleRoot = drupal_get_path('module', 'islandora_form_elements'); + $module_root = drupal_get_path('module', 'islandora_form_elements'); if ($string == '') { $string = $collection; @@ -136,13 +139,13 @@ function ife_autocomplete_gacs($collection, $string='') { $string = ucwords(trim($string)); - $dom = DOMDocument::load($moduleRoot . '/xml/gacs.xml'); - $rootEl = $dom->getElementsByTagName('codelist'); - if ($rootEl->length > 0) { - $rootEl = $rootEl->item(0); + $dom = DOMDocument::load($module_root . '/xml/gacs.xml'); + $root_el = $dom->getElementsByTagName('codelist'); + if ($root_el->length > 0) { + $root_el = $root_el->item(0); $xpath = new DOMXPath($dom); - $xpath->registerNamespace('a', $rootEl->getAttribute('xmlns')); + $xpath->registerNamespace('a', $root_el->getAttribute('xmlns')); $result = $xpath->query('/a:codelist/a:gacs/a:gac[starts-with(a:name, "' . $string . '")]'); @@ -155,7 +158,7 @@ function ife_autocomplete_gacs($collection, $string='') { } function ife_autocomplete_language($collection, $string='') { - $moduleRoot = drupal_get_path('module', 'islandora_form_elements'); + $module_root = drupal_get_path('module', 'islandora_form_elements'); if ($string == '') { $string = $collection; @@ -164,13 +167,13 @@ function ife_autocomplete_language($collection, $string='') { $string = ucwords(trim($string)); - $dom = DOMDocument::load($moduleRoot . '/xml/languages.xml'); - $rootEl = $dom->getElementsByTagName('codelist'); - if ($rootEl->length > 0) { - $rootEl = $rootEl->item(0); + $dom = DOMDocument::load($module_root . '/xml/languages.xml'); + $root_el = $dom->getElementsByTagName('codelist'); + if ($root_el->length > 0) { + $root_el = $root_el->item(0); $xpath = new DOMXPath($dom); - $xpath->registerNamespace('a', $rootEl->getAttribute('xmlns')); + $xpath->registerNamespace('a', $root_el->getAttribute('xmlns')); $result = $xpath->query('/a:codelist/a:languages/a:language[starts-with(a:name, "' . $string . '")]'); @@ -192,10 +195,10 @@ function ife_autocomplete($field, $collection, $string='') { module_load_include('php', 'islandora_solr_search', 'Solr/Service'); $host = variable_get('islandora_solr_search_block_host', 'localhost'); $port = variable_get('islandora_solr_search_block_port', '8080'); - $appName = variable_get('islandora_solr_search_block_app_name', 'solr'); - $solr = new Apache_Solr_Service($host, $port, '/' . $appName . '/'); + $app_name = variable_get('islandora_solr_search_block_app_name', 'solr'); + $solr = new Apache_Solr_Service($host, $port, '/' . $app_name . '/'); - $additionalParams = array( + $additional_params = array( 'fl' => $field ); @@ -206,9 +209,9 @@ function ife_autocomplete($field, $collection, $string='') { } try { - $results = $solr->search($query, 0, 10, $additionalParams); + $results = $solr->search($query, 0, 10, $additional_params); } catch (Exception $e) { - drupal_set_message(t('error searching ') . $e->getMessage()); + drupal_set_message(t('error searching') . " " . $e->getMessage()); } $docs = $results->response->docs; diff --git a/form_elements/includes/creative_commons.inc b/form_elements/includes/creative_commons.inc index 38760c2d..041e9cdc 100644 --- a/form_elements/includes/creative_commons.inc +++ b/form_elements/includes/creative_commons.inc @@ -1,6 +1,11 @@ 'International', diff --git a/form_elements/includes/filechooser.inc b/form_elements/includes/filechooser.inc index c4b43717..a53cd836 100644 --- a/form_elements/includes/filechooser.inc +++ b/form_elements/includes/filechooser.inc @@ -1,5 +1,9 @@ @@ -26,7 +30,7 @@ function theme_filechooser($element) {

      - +
      '; return theme('form_element', $element, $output); } @@ -36,7 +40,7 @@ function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) { module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'MimeClass'); - $mimeClass = new MimeClass(); + $mime_class = new MimeClass(); $cm = ContentModel::loadFromModel($cm_pid); $cp = CollectionPolicy::loadFromCollection($cp_pid); @@ -45,7 +49,7 @@ function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) { if ($cm !== FALSE && $cp !== FALSE) { if (is_file($path . $file)) { - $mime = $mimeClass->getType($path . $file); + $mime = $mime_class->getType($path . $file); $allowed_types = $cm->getMimetypes(); @@ -57,7 +61,7 @@ function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) { $thumbnail = $_SESSION['fedora_ingest_files']['TN']; } - $thumbmime = $mimeClass->getType($thumbnail); + $thumbmime = $mime_class->getType($thumbnail); header('Pragma: no-cache'); header('Content-Type: ' . $thumbmime); @@ -85,7 +89,7 @@ function ife_filechooser_generate_thumbnails($cp_pid, $cm_pid) { exit(); } - $mimeClass = new MimeClass(); + $mime_class = new MimeClass(); $path = $cp->getStagingArea() . '/'; $start = isset($_GET['start']) ? intval($_GET['start']) : 0; $end = isset($_GET['end']) ? intval($_GET['end']) : 50; @@ -97,7 +101,7 @@ function ife_filechooser_generate_thumbnails($cp_pid, $cm_pid) { $dir = opendir($path); for ($i = $start; $i < $end && ($file = readdir($dir)) !== FALSE;) { if (is_file($path . $file)) { - $mime = $mimeClass->getType($path . $file); + $mime = $mime_class->getType($path . $file); if (in_array($mime, $allowed_types)) { $thumbnail = FALSE; diff --git a/form_elements/includes/people.inc b/form_elements/includes/people.inc index 421e0a3b..6ffbbc4f 100644 --- a/form_elements/includes/people.inc +++ b/form_elements/includes/people.inc @@ -1,11 +1,15 @@ 0) { @@ -82,17 +86,17 @@ function ife_remove_person_submit($form, &$form_state) { $keys = array(); $qt_form = _ife_find_people_element($form, $keys); - $peopleVals = &$form_state['values']; + $people_vals = &$form_state['values']; while (count($keys) > 0) { $key = array_pop($keys); - if (isset($peopleVals[$key])) { - $peopleVals = &$peopleVals[$key]; + if (isset($people_vals[$key])) { + $people_vals = &$people_vals[$key]; } } $people = array(); $i = 0; - foreach ($peopleVals['people'] as $key => $val) { + foreach ($people_vals['people'] as $key => $val) { if ($key != $delta) { $people[] = $val; } @@ -115,24 +119,24 @@ function ife_add_person_submit($form, &$form_state) { $people = array(); $keys = array(); $qt_form = _ife_find_people_element($form, $keys); - $peopleVals = &$form_state['values']; + $people_vals = &$form_state['values']; while (count($keys) > 0) { $key = array_pop($keys); - if (isset($peopleVals[$key])) { - $peopleVals = &$peopleVals[$key]; + if (isset($people_vals[$key])) { + $people_vals = &$people_vals[$key]; } } - if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); + if (!is_array($people_vals['people'])) + $people_vals['people'] = array(); - foreach ($peopleVals['people'] as $val) { + foreach ($people_vals['people'] as $val) { $people[] = $val; } //only add new person if we are not adding from repository. - $elName = isset($qt_form['entity0']['#parents'][0]) ? $qt_form['entity0']['#parents'][0] : NULL; - if ($elName == NULL || !isset($form_state['clicked_button']['#post'][$elName]['add_from_repository']) || trim($form_state['clicked_button']['#post'][$elName]['add_from_repository']) == '') { + $el_name = isset($qt_form['entity0']['#parents'][0]) ? $qt_form['entity0']['#parents'][0] : NULL; + if ($el_name == NULL || !isset($form_state['clicked_button']['#post'][$el_name]['add_from_repository']) || trim($form_state['clicked_button']['#post'][$el_name]['add_from_repository']) == '') { $people[] = array('name' => '', 'date' => '', 'role' => '', 'subject' => ''); } unset($form_state['submit_handlers']); @@ -148,19 +152,19 @@ function ife_add_org_submit($form, &$form_state) { $people = array(); $keys = array(); $qt_form = _ife_find_people_element($form, $keys); - $peopleVals = &$form_state['values']; + $people_vals = &$form_state['values']; while (count($keys) > 0) { $key = array_pop($keys); - if (isset($peopleVals[$key])) { - $peopleVals = &$peopleVals[$key]; + if (isset($people_vals[$key])) { + $people_vals = &$people_vals[$key]; } } - if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); + if (!is_array($people_vals['people'])) + $people_vals['people'] = array(); - foreach ($peopleVals['people'] as $val) { + foreach ($people_vals['people'] as $val) { $people[] = $val; } $people[] = array('role' => '', 'organization' => ''); @@ -178,17 +182,17 @@ function ife_add_conf_submit($form, &$form_state) { $people = array(); $keys = array(); $qt_form = _ife_find_people_element($form, $keys); - $peopleVals = &$form_state['values']; + $people_vals = &$form_state['values']; while (count($keys) > 0) { $key = array_pop($keys); - if (isset($peopleVals[$key])) { - $peopleVals = &$peopleVals[$key]; + if (isset($people_vals[$key])) { + $people_vals = &$people_vals[$key]; } } - if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); + if (!is_array($people_vals['people'])) + $people_vals['people'] = array(); - foreach ($peopleVals['people'] as $val) { + foreach ($people_vals['people'] as $val) { $people[] = $val; } diff --git a/ilives/image_rotator_tagger_block.inc b/ilives/image_rotator_tagger_block.inc index a86c4291..d5177101 100755 --- a/ilives/image_rotator_tagger_block.inc +++ b/ilives/image_rotator_tagger_block.inc @@ -2,7 +2,7 @@ -/* +/** * @file image_rotator_tagger_block.inc */ @@ -67,8 +67,12 @@ function _fedora_image_rotator_tagger_block_content() { $image_item = new Fedora_Item($result['pid']); } if (!empty($result)) { + + $image = theme_image( . $base_url . '/fedora/imageapi/' . $result['pid'] . '/JPG?op=scale&height=500&width=300'); + return '

      ' . l('', 'fedora/repository/' . $result['pid'], array('html' => TRUE, 'alias' => TRUE)) + //. l(t("!image", array(image => $image)) . '

      This image is from ' . l($result['title'], 'fedora/ilives_book_viewer/' . substr($image_item->pid, 0, strrpos($image_item->pid, '-')), array('html' => TRUE, 'alias' => TRUE)) . '.' . drupal_get_form('fedora_repository_image_tagging_form', $result['pid']) . '

      '; } diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 87de1b83..a097de73 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -72,7 +72,7 @@ class Refworks { //$dom = dom_import_simplexml($xml);//test to see if it behaves better //$xml = new SimpleXMLElement(trim(file_get_contents($file))); } catch (Exception $e) { - drupal_set_message(t('Error processing Refworks file:') . $e->getMessage()); + drupal_set_message(t('Error processing Refworks file:') . " " . $e->getMessage()); return FALSE; } $this->referenceList = array(); diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index 7292a926..be9c80b0 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -84,7 +84,7 @@ class ShowStreamsInFieldSets { } $dc_html = $objectHelper->getFormattedDC($item); - $dl_link = l(t('

      View Document
      '), 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); + $dl_link = l('

      View Document
      ', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); $tabset['first_tab']['tabs']['view'] = array( '#type' => 'tabpage', From 32b66440fd54f04cff52e159b090818bcc09ea25 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Mon, 27 Jun 2011 14:28:16 -0300 Subject: [PATCH 011/247] ISLANDORA 132 - added escaped quotation marks to --- plugins/ImageManipulation.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 9971c367..c780dcbd 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -98,7 +98,7 @@ class ImageManipulation { else { ObjectHelper::warnIfMisconfigured('ImageMagick'); } - exec("convert {$file}[0] -thumbnail x2000 -thumbnail x450 -resize '450x<' -resize 50% -fuzz 1% -trim +repage -gravity center -crop 200x200+0+0 +repage -format jpg -quality 100 $file-tn.jpg", $output, $returnValue); + exec("convert \"{$file}\"[0] -thumbnail x2000 -thumbnail x450 -resize '450x<' -resize 50% -fuzz 1% -trim +repage -gravity center -crop 200x200+0+0 +repage -format jpg -quality 100 $file-tn.jpg", $output, $returnValue); if ($returnValue == '0') { $_SESSION['fedora_ingest_files']["TN"] = $file . '-tn.jpg'; } From 8a1e300742b30d40fe6460448d2b1d9f4172e4de Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Mon, 27 Jun 2011 14:55:39 -0300 Subject: [PATCH 012/247] ISLANDORA-260 Missing PID now shows 404 page --- fedora_repository.module | 156 +++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 87 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 4ed5cb4b..6995d945 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -437,7 +437,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { } elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { $collectionPid = $_SESSION['fedora_collection']; - + $form_state['redirect'] = "fedora/repository/$collectionPid/"; } else { @@ -529,14 +529,14 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $dsid = $form_state['values']['dsId']; $dsLabel = $form_state['values']['dsLabel']; // Remove the original file extension from the label and add the new one - $indexOfDot = strrpos($dsLabel,'.');//use strrpos to get the last dot - if($indexOfDot !== FALSE){ + $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot + if ($indexOfDot !== FALSE) { $dsLabel = substr($dsLabel, 0, $indexOfDot); $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; } module_load_include('inc', 'Fedora_Repository', 'MimeClass'); module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - + $file_basename = basename($file->filepath); $file_directory = dirname($file->filepath); $streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename); @@ -548,11 +548,10 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $dformat = $mimetype->getType($file->filepath); $item = new Fedora_Item($pid); - + $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); - - $form_state['redirect'] = 'fedora/repository/' . $pid; + $form_state['redirect'] = 'fedora/repository/' . $pid; } function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { @@ -721,16 +720,20 @@ function makeObject($pid, $dsID) { 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', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $user; - if (!fedora_available()) { drupal_set_message('The Fedora repository server is currently unavailable. Please contact the site administrator.', 'warning', FALSE); return ''; } - - if ($pid &!validPid($pid)) { + $item = new fedora_item($pid); + if (!$item->exists()) { + drupal_not_found(); + } + + if ($pid & !validPid($pid)) { drupal_set_message(t("Invalid PID!"), 'error'); return ' '; } @@ -740,8 +743,6 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU return ' '; } if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - //drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); - if (user_access('access administration pages')) { drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); } @@ -769,13 +770,6 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); - //if(!isset($pageNumber)){ - // $pageNumber=0; - //} - //if(!isset($limit)){ - // $limit=20; - //} - module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'plugins/fedoraObject'); $breadcrumbs = array(); @@ -783,15 +777,12 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU 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); $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); @@ -808,13 +799,6 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $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 - //$css=$path.'/stylesheets/container-large.css'; - //drupal_add_css($css); return tabs_render($cmodels_tabs); } @@ -1182,7 +1166,6 @@ function fedora_repository_theme() { 'arguments' => array( 'element' => NULL ), - 'fedora_repository_solution_packs_list' => array( 'arguments' => array( 'solution_packs' => NULL, @@ -1265,10 +1248,10 @@ function fedora_repository_demo_objects_form() { ); foreach (array( - 'islandora:collectionCModel' => 'Islandora default content models', - 'islandora:top' => 'Islandora top-level collection', - 'islandora:demos' => 'Islandora demos collection', - 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', +'islandora:collectionCModel' => 'Islandora default content models', + 'islandora:top' => 'Islandora top-level collection', + 'islandora:demos' => 'Islandora demos collection', + 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', ) as $available_demo => $available_demo_desc) { try { @@ -1415,7 +1398,7 @@ 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'); @@ -1456,16 +1439,15 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { } } - function fedora_repository_required_fedora_objects() { // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) $module_path = drupal_get_path('module', 'fedora_repository'); - return array ( + return array( 'fedora_repository' => array( 'module' => 'fedora_repository', 'title' => 'Islandora Core', - 'objects' => array ( - array ( + 'objects' => array( + array( 'pid' => 'islandora:collectionCModel', 'label' => 'Islandora Collection Content Model', 'dsid' => 'ISLANDORACM', @@ -1473,7 +1455,7 @@ function fedora_repository_required_fedora_objects() { 'dsversion' => 2, 'cmodel' => 'fedora-system:ContentModel-3.0', ), - array ( + array( 'pid' => 'islandora:strict_pdf', 'label' => 'Islandora strict PDF content model', 'dsid' => 'ISLANDORACM', @@ -1484,85 +1466,85 @@ function fedora_repository_required_fedora_objects() { 'pid' => 'islandora:top', 'label' => 'Islandora Top-level Collection', 'cmodel' => 'islandora:collectionCModel', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - ), + ), ), - array ( + array( 'pid' => 'islandora:ContentModelCollection', 'label' => 'Collection of installed content models', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:top', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_VIEW', 'datastream_file' => "$module_path/collection_views/simple_list_view.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/contentModel.jpg", 'mimetype' => 'image/jpeg', ), - array ( + array( 'dsid' => 'QUERY', 'datastream_file' => "$module_path/collection_views/cmodel_collection_query.txt", 'mimetype' => 'text/plain', ), ), ), - array ( + array( 'pid' => 'islandora:demos', 'label' => 'Islandora demos collection', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:top', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", ), ), ), - array ( + array( 'pid' => 'islandora:pdf_collection', 'label' => 'Islandora Demo PDF Collection', 'cmodel' => 'islandora:collectionCModel', 'parent' => 'islandora:demos', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Crystal_Clear_mimetype_pdf.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/PDF-COLLECTION POLICY.xml", ), ), ), - array ( + array( 'pid' => 'demo:DualResImage', 'foxml_file' => "$module_path/content_models/demo_DualResImage.xml", 'datastreams' => array( - array ( + array( 'dsid' => 'ISLANDORACM', 'datastream_file' => "$module_path/content_models/STANDARD JPG.xml", ), ), ), - array ( + array( 'pid' => 'demo:DualResImageCollection', 'foxml_file' => "$module_path/content_models/demo_DualResImageCollection.xml", 'datastreams' => array( @@ -1572,51 +1554,51 @@ function fedora_repository_required_fedora_objects() { ), ), ), - array ( + array( 'pid' => 'demo:DualResolution', 'foxml_file' => "$module_path/content_models/demo_DualResolution.xml", ), - array ( + array( 'pid' => 'demo:DualResImageImpl', 'foxml_file' => "$module_path/content_models/demo_DualResImageImpl.xml", ), - array ( + array( 'pid' => 'demo:CollectionImpl', 'foxml_file' => "$module_path/content_models/demo_CollectionImpl.xml", ), - array ( + array( 'pid' => 'demo:Collection', 'foxml_file' => "$module_path/content_models/demo_Collection.xml", ), - array ( + array( 'pid' => 'islandora:demo_image_collection', 'label' => 'Demo Image Collection', 'cmodel' => 'demo:DualResImageCollection', 'parent' => 'islandora:demos', - 'datastreams' => array ( - array ( + 'datastreams' => array( + array( 'dsid' => 'COLLECTION_POLICY', 'datastream_file' => "$module_path/collection_policies/JPG-COLLECTION POLICY.xml", ), - array ( + array( 'dsid' => 'TN', 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), - array ( + array( 'dsid' => 'COLLECTION_VIEW', 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml", ), - array ( + array( 'dsid' => 'QUERY', 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt", 'mimetype' => 'text/plain', ), - array ( + array( 'dsid' => 'DC', 'datastream_file' => "$module_path/collection_views/demo_image_collection_dc_record.xml", ), - ), + ), ), ), ), @@ -1966,7 +1948,6 @@ function fedora_repository_display_schema($file) { return; } - function fedora_repository_batch_reingest_object($object, &$context) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -1991,8 +1972,8 @@ function fedora_repository_batch_reingest_object($object, &$context) { } } if (!empty($object['dsid']) && !empty($object['datastream_file'])) { - $datastreams = array ( - array ( + $datastreams = array( + array( 'dsid' => $object['dsid'], 'datastream_file' => $object['datastream_file'], ) @@ -2001,19 +1982,19 @@ function fedora_repository_batch_reingest_object($object, &$context) { elseif (!empty($object['datastreams'])) { $datastreams = $object['datastreams']; } - + if (!empty($datastreams) && is_array($datastreams)) { $label = !empty($object['label']) ? $object['label'] : ''; if (empty($object['foxml_file']) && !defined($new_item)) { $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); } if (!empty($object['cmodel'])) { - $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); + $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); } if (!empty($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'); } @@ -2039,13 +2020,14 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid $return = NULL; if (isset($item)) { $doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); - } elseif (isset($datastream_file)) { + } + elseif (isset($datastream_file)) { $doc = simplexml_load_file($datastream_file); } - + if (!empty($doc)) { $attrs = $doc->attributes(); - foreach($attrs as $name => $value) { + foreach ($attrs as $name => $value) { if ($name == 'version') { $return = (int) $value; break; @@ -2054,18 +2036,18 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid } return $return; } - + function theme_fedora_repository_solution_packs_list($solution_packs) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $output = ''; $header = array(); $rows = array(); - - - - - drupal_add_css(drupal_get_path('module', 'update') .'/update.css'); + + + + + drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); return $output; } From ec441096e47afedf70912cd31a607c9930fb8c26 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 28 Jun 2011 22:51:29 -0300 Subject: [PATCH 013/247] Fixes for ingesting objects. --- fedora_repository.module | 41 +++++++++++++++++++++++++++++++++++++--- formClass.inc | 23 +++++++++++++++++++--- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 1a95be07..81e9197b 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -124,8 +124,43 @@ function fedora_repository_ingest_form_submit($form, &$form_state) { $xml_form = new XMLForm($form_state); $doc = $xml_form->submit($form, $form_state); $document = $doc->document; - dom_document_pretty_print($document); - exit(); + // Get Hidden Values. + $dsid = $form_state['values']['dsid']; + $collection_pid = $form_state['values']['collection_pid']; + $content_model_pid = $form_state['values']['content_model_pid']; + $content_model_dsid = $form_state['values']['content_model_dsid']; + // + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + $error = TRUE; + $should_redirect = TRUE; + $collection_policy = CollectionPolicy::loadFromCollection($collection_pid); + if ($collection_policy !== FALSE) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + $relationship = $collection_policy->getRelationship(); + $content_model = ContentModel::loadFromModel($content_model_pid, $content_model_dsid); + if ($content_model !== FALSE) { + module_load_include('inc', 'islandora_content_model_forms', 'FOXML'); + $label = 'test'; //$form['#post']['form_builder'][0]; // use mods title as label + if (empty($form['#post']['active-toggle'])) { + $state = 'A'; + } + else { + $state = $form['#post']['active-toggle'] ? 'A' : 'I'; + } + $pid = $collection_policy->getNextPid($content_model_dsid); + $ingest_file_location = isset($form_state['values']['ingest-file-location']) ? $form_state['values']['ingest-file-location'] : NULL; + // hack + $transform = drupal_get_path('module', 'islandora_content_model_forms') . '/transforms/mods_to_dc.xsl'; + $foxml = new FOXML($label, $pid, $dsid, $content_model_pid, $collection_pid, $relationship, $ingest_file_location, $document, $transform, $state); + $error = $foxml->ingest(); + $_SESSION['fedora_ingest_files'] = ''; //empty this variable + $form_state['storage'] = NULL; + } + } + if ($should_redirect) { + global $base_url; + $form_state['redirect'] = ($error) ? '' : $base_url . "/fedora/repository/{$collection_pid}"; + } } else if ($form_state['clicked_button']['#id'] == 'edit-submit') { global $base_url; @@ -193,7 +228,7 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { $form_state['values']['ingest-file-location'] = $fileObject->filepath; } - if (file_exists($form_state['values']['ingest-file-location'])) { + if (isset($form_state['values']['ingest-file-location']) && file_exists($form_state['values']['ingest-file-location'])) { module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'MimeClass'); diff --git a/formClass.inc b/formClass.inc index 10921bf2..ef1fc0a7 100644 --- a/formClass.inc +++ b/formClass.inc @@ -461,11 +461,14 @@ class formClass { global $user; module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); // drupal_add_js("function _imce_ingest_ImceFinish(path, w, h, s, imceWin) {imceWin.close(); document.getElementById('edit-ingest-file-location').value = path;}",'inline','header'); + $content_model_pid = isset($form_state['values']['content_model_pid']) ? $form_state['values']['content_model_pid'] : NULL; + $content_model_dsid = isset($form_state['values']['content_model_dsid']) ? $form_state['values']['content_model_dsid'] : NULL; if (!user_access('ingest new fedora objects')) { drupal_set_message(t('You do not have permission to ingest.'), 'error'); return ''; } + if (empty($form_state['storage']['step'])) { // we are coming in without a step, so default to step 1 $form_state['storage']['step'] = 1; @@ -530,8 +533,8 @@ class formClass { case 2: module_load_include('inc', 'fedora_repository', 'MimeClass'); // Why this include? --Zac, 2010-09-17 - $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); - $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); + $content_model_pid = ContentModel::getPidFromIdentifier($form_state['values']['models']); + $content_model_dsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); // XML Forms if (module_exists('xml_form_api')) { module_load_include('inc', 'xml_form_api', 'XMLForm'); @@ -549,11 +552,17 @@ class formClass { $xml_form->initialize($form, $document); } $form = $xml_form->toArray(); + $form['dsid'] = array( + '#type' => 'hidden', + '#value' => isset($form_state['values']['dsid']) ? + $form_state['values']['dsid'] : + islandora_content_model_get_dsid($content_model_pid, $form_name) + ); break; } } // End XML forms - if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + if (($cm = ContentModel::loadFromModel($content_model_pid, $content_model_dsid)) !== FALSE) { $form = $cm->buildIngestForm($form, $form_state); if ($form === FALSE) { @@ -571,6 +580,14 @@ class formClass { '#type' => 'hidden', '#value' => $collection_pid ); + $form['content_model_pid'] = array( + '#type' => 'hidden', + '#value' => $content_model_pid + ); + $form['content_model_dsid'] = array( + '#type' => 'hidden', + '#value' => $content_model_dsid + ); if ($form_state['storage']['step'] < 2) { $button_name = t('Next'); From 479a050708f2033e750b33a81dd8936d3f7c52b9 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 5 Jul 2011 20:08:26 -0300 Subject: [PATCH 014/247] Changed islandora to call out to a class for building the xml based forms. --- fedora_repository.module | 48 +------- formClass.inc | 254 ++++++++++++++++++++------------------- 2 files changed, 134 insertions(+), 168 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 81e9197b..c9b6ad29 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -117,49 +117,13 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label return $output; } -function fedora_repository_ingest_form_submit($form, &$form_state) { +function fedora_repository_ingest_form_submit(array $form, array &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH if ($form_state['storage']['xml']) { - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - $doc = $xml_form->submit($form, $form_state); - $document = $doc->document; - // Get Hidden Values. - $dsid = $form_state['values']['dsid']; - $collection_pid = $form_state['values']['collection_pid']; - $content_model_pid = $form_state['values']['content_model_pid']; - $content_model_dsid = $form_state['values']['content_model_dsid']; - // - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - $error = TRUE; - $should_redirect = TRUE; - $collection_policy = CollectionPolicy::loadFromCollection($collection_pid); - if ($collection_policy !== FALSE) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - $relationship = $collection_policy->getRelationship(); - $content_model = ContentModel::loadFromModel($content_model_pid, $content_model_dsid); - if ($content_model !== FALSE) { - module_load_include('inc', 'islandora_content_model_forms', 'FOXML'); - $label = 'test'; //$form['#post']['form_builder'][0]; // use mods title as label - if (empty($form['#post']['active-toggle'])) { - $state = 'A'; - } - else { - $state = $form['#post']['active-toggle'] ? 'A' : 'I'; - } - $pid = $collection_policy->getNextPid($content_model_dsid); - $ingest_file_location = isset($form_state['values']['ingest-file-location']) ? $form_state['values']['ingest-file-location'] : NULL; - // hack - $transform = drupal_get_path('module', 'islandora_content_model_forms') . '/transforms/mods_to_dc.xsl'; - $foxml = new FOXML($label, $pid, $dsid, $content_model_pid, $collection_pid, $relationship, $ingest_file_location, $document, $transform, $state); - $error = $foxml->ingest(); - $_SESSION['fedora_ingest_files'] = ''; //empty this variable - $form_state['storage'] = NULL; - } - } - if ($should_redirect) { - global $base_url; - $form_state['redirect'] = ($error) ? '' : $base_url . "/fedora/repository/{$collection_pid}"; + if (module_exists('islandora_content_model_forms')) { + module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); + $xml_form = new IngestObjectMetadataForm(); + $xml_form->submit($form, $form_state); } } else if ($form_state['clicked_button']['#id'] == 'edit-submit') { @@ -656,7 +620,7 @@ function fedora_repository_edit_qdc_form_validate($form, &$form_state) { $form_state['storage']['step']++; $form_state['rebuild'] = TRUE; } - else { + else if ($form_state['storage']['xml']) { module_load_include('inc', 'xml_form_api', 'XMLForm'); $xml_form = new XMLForm($form_state); $xml_form->validate($form, $form_state); diff --git a/formClass.inc b/formClass.inc index ef1fc0a7..b4d91d12 100644 --- a/formClass.inc +++ b/formClass.inc @@ -445,9 +445,6 @@ class formClass { } } - // queries the collection object for a childsecurity datastream and if found parses it - // to determine if this user is allowed to ingest in this collection - // we assume if they are able to modify objects in the collection they can ingest as well. function can_ingest_here($collection_pid) { module_load_include('inc', 'fedora_repository', 'SecurityClass'); $securityClass = new SecurityClass(); @@ -455,155 +452,160 @@ class formClass { } /** - * Create a multi step form (wizard) for ingesting objects into Fedora + * Drupal's permissions at this point no xacml yet. xacml decisions are made by fedora + * + * @param type $collection_pid + * @return type */ - function createIngestForm($collection_pid, $collection_label, &$form_state) { - global $user; - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - // drupal_add_js("function _imce_ingest_ImceFinish(path, w, h, s, imceWin) {imceWin.close(); document.getElementById('edit-ingest-file-location').value = path;}",'inline','header'); - $content_model_pid = isset($form_state['values']['content_model_pid']) ? $form_state['values']['content_model_pid'] : NULL; - $content_model_dsid = isset($form_state['values']['content_model_dsid']) ? $form_state['values']['content_model_dsid'] : NULL; - + function canShowIngestForm($collection_pid) { if (!user_access('ingest new fedora objects')) { drupal_set_message(t('You do not have permission to ingest.'), 'error'); - return ''; - } - - if (empty($form_state['storage']['step'])) { - // we are coming in without a step, so default to step 1 - $form_state['storage']['step'] = 1; + return FALSE; } - //this uses drupal's permissions at this point no xacml yet. xacml decisions are made by fedora - if (!$this->can_ingest_here($collection_pid)) { + module_load_include('inc', 'fedora_repository', 'SecurityClass'); + $security_class = new SecurityClass(); + if (!$security_class->canIngestHere($collection_pid)) { + // Queries the collection object for a child security datastream and if found parses it + // to determine if this user is allowed to ingest in this collection + // we assume if they are able to modify objects in the collection they can ingest as well. drupal_set_message(t('You do not have premission to ingest here.')); - return ''; + return FALSE; } - if ($collection_pid == NULL) { drupal_set_message(t('You must specify an collection object pid to ingest an object.'), 'error'); return FALSE; } - if (($cp = CollectionPolicy::loadFromCollection($collection_pid)) === FALSE) { + return TRUE; + } + + /** + * Creates the first page of the ingest form for editing QDC. + * + * @param string $collection_pid + * @param string $collection_label + * @param array $form_state + * + * @return array + */ + function createQDCIngestFormPageOne($collection_pid, $collection_label, array &$form_state) { + if (($collection_policy = CollectionPolicy::loadFromCollection($collection_pid)) === FALSE) { drupal_set_message(t('Unable to load collection policy \'' . $collection_pid . '\'.')); return FALSE; } - - $contentModels = $cp->getContentModels(); - - if (!$contentModels) { + if (!($content_models = $collection_policy->getContentModels())) { drupal_set_message(t('No content models associated with this collection: !collection_label. Please contact your administrator.', array('!collection_label' => $collection_label)), 'error'); return FALSE; } - $modelsForForm = array(); - foreach ($contentModels as $contentModel) { - $identifier = $contentModel->getIdentifier(); - $name = $contentModel->name; - $modelsForForm["$identifier"] = "$name"; + $potential_models = array(); + foreach ($content_models as $content_model) { + $identifier = $content_model->getIdentifier(); + $name = $content_model->name; + $potential_models["$identifier"] = "$name"; } - - if (module_exists('islandora_content_model_forms') && isset($contentModels[0])) { - $form_names = islandora_content_model_get_form_names($contentModels[0]->pid); - } - - $form_state['storage']['xml'] = false; - - switch ($form_state['storage']['step']) { - case 1: - $form['indicator'] = array( - '#type' => 'fieldset', - '#title' => t('Ingest digital object into collection_pid !collection_label Step #1', array('collection_pid' => $collection_pid, '!collection_label' => $collection_label)) - ); - - $form['indicator']['models'] = array(// content models available + list($identifier, $name) = array_peek($potential_models); + $selected_model = isset($form_state['values']['models']) ? $form_state['values']['models'] : $identifier; + return array( + 'indicator' => array( + '#type' => 'fieldset', + '#title' => t('Ingest digital object into collection_pid !collection_label Step #1', array('collection_pid' => $collection_pid, '!collection_label' => $collection_label)), + 'models' => array( '#type' => 'select', '#title' => t('Content models available'), - '#options' => $modelsForForm, - //'#description' => t('Content models available in this collection. A content model defines what is allowed in a collection and what to do with a file when it is uploaded (An example may creating a thumbnail from an image.).') - '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.
      Additional information may be found here. ') - ); - if (isset($form_names) && count($form_names) >= 1) { - $form['indicator']['forms'] = array( - '#type' => 'select', - '#title' => t('Forms'), - '#options' => $form_names, - '#description' => t('Select the form to populate the metadata of the new object.') - ); - } - break; - - case 2: - module_load_include('inc', 'fedora_repository', 'MimeClass'); // Why this include? --Zac, 2010-09-17 - $content_model_pid = ContentModel::getPidFromIdentifier($form_state['values']['models']); - $content_model_dsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - // XML Forms - if (module_exists('xml_form_api')) { - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - if (isset($form_state['values']['forms']) || $xml_form->isInitialized()) { - $form_state['storage']['xml'] = true; - if (!$xml_form->isInitialized()) { - module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); - module_load_include('inc', 'xml_form_builder', 'FormBuilder'); - $form_name = $form_state['values']['forms']; - $definition = FormBuilder::GetFormDefinition($form_name); - $form = XMLFormDefinition::GetDrupalForm($definition); - $properties = XMLFormDefinition::GetFormProperties($definition); - $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema']); - $xml_form->initialize($form, $document); - } - $form = $xml_form->toArray(); - $form['dsid'] = array( - '#type' => 'hidden', - '#value' => isset($form_state['values']['dsid']) ? - $form_state['values']['dsid'] : - islandora_content_model_get_dsid($content_model_pid, $form_name) - ); - break; - } - } - // End XML forms - if (($cm = ContentModel::loadFromModel($content_model_pid, $content_model_dsid)) !== FALSE) { - $form = $cm->buildIngestForm($form, $form_state); - if ($form === FALSE) { - - drupal_set_message(t("Error Building Ingest Form."), 'error'); - foreach (ContentModel::$errors as $err) { - drupal_set_message($err, 'error'); - } - } - } + '#options' => $potential_models, + '#default_value' => $selected_model, + '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.
      Additional information may be found here. '), + ), + ), + 'collection_pid' => array( + '#type' => 'hidden', + '#value' => $collection_pid + ), + 'submit' => array( + '#type' => 'submit', + '#submit' => array('fedora_repository_ingest_form_submit'), + '#value' => t('Next') + ), + ); + } - break; + /** + * Create the second page of the ingest form for editing QDC + * + * @param string $collection_pid + * @param string $collection_label + * @param array $form_state + * + * @return array + */ + function createQDCIngestFormPageTwo($collection_pid, $collection_label, array &$form_state) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + $form = array(); + $content_model_pid = ContentModel::getPidFromIdentifier($form_state['values']['models']); + $content_model_dsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); + if (($content_model = ContentModel::loadFromModel($content_model_pid, $content_model_dsid)) !== FALSE) { + $form = $content_model->buildIngestForm($form, $form_state); + if ($form === FALSE) { + drupal_set_message(t("Error Building Ingest Form."), 'error'); + foreach (ContentModel::$errors as $error) { + drupal_set_message($error, 'error'); + } + } + $form['collection_pid'] = array( + '#type' => 'hidden', + '#value' => $collection_pid + ); + $form['submit'] = array( + '#type' => 'submit', + '#submit' => array('fedora_repository_ingest_form_submit'), + '#value' => t('Ingest') + ); } + return $form; + } - $form['collection_pid'] = array( - '#type' => 'hidden', - '#value' => $collection_pid - ); - $form['content_model_pid'] = array( - '#type' => 'hidden', - '#value' => $content_model_pid - ); - $form['content_model_dsid'] = array( - '#type' => 'hidden', - '#value' => $content_model_dsid - ); - - if ($form_state['storage']['step'] < 2) { - $button_name = t('Next'); + /** + * Create the QDC Ingest Form. + * + * @param type $collection_pid + * @param type $collection_label + * @param array $form_state + * + * @return array + */ + function createQDCIngestForm($collection_pid, $collection_label, array &$form_state) { + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + $form_state['storage']['step'] = empty($form_state['storage']['step']) ? 1 : $form_state['storage']['step']; + if ($form_state['storage']['step'] == 1) { + return $this->createQDCIngestFormPageOne($collection_pid, $collection_label, $form_state); } else { - $prefix = t('Please be patient. Once you click next there may be a number of files created. Depending on your content model this could take a few minutes to process.
      '); - $button_name = t('Ingest'); + return $this->createQDCIngestFormPageTwo($collection_pid, $collection_label, $form_state); } + } - $form['submit'] = array( - '#type' => 'submit', - '#submit' => array('fedora_repository_ingest_form_submit'), - '#value' => $button_name - ); - - return $form; + /** + * Create a multi step form (wizard) for ingesting objects into Fedora + * + * @param string $collection_pid + * @param string $collection_label + * @param array $form_state + * + * @return array + */ + function createIngestForm($collection_pid, $collection_label, array &$form_state) { + if (!$this->canShowIngestForm($collection_pid)) { + return FALSE; + } + if (module_exists('islandora_content_model_forms')) { + module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); + try { + $form = new IngestObjectMetadataForm(); + return $form->create($collection_pid, $collection_label, $form_state); + } catch (Exception $e) { + $form_state['storage']['xml'] = false; // An error occured revert back to the QDC Form. + } + } + return $this->createQDCIngestForm($collection_pid, $collection_label, $form_state); } // this function may not be being used From f6436d48326c1076efe82d6292b929c77b7a7fa6 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 5 Jul 2011 22:35:28 -0300 Subject: [PATCH 015/247] Fixes for editing --- fedora_repository.module | 9 +- formClass.inc | 220 ++++++++++++++++----------------------- 2 files changed, 90 insertions(+), 139 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index c9b6ad29..90c8b653 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -639,12 +639,9 @@ function fedora_repository_edit_qdc_form_validate($form, &$form_state) { */ function fedora_repository_edit_qdc_form_submit($form, &$form_state) { if ($form_state['storage']['xml']) { - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - $doc = $xml_form->submit($form, $form_state); - $document = $doc->document; - dom_document_pretty_print($document); - exit(); + module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); + $xml_form = new EditObjectMetadataForm($form_state); + $xml_form->submit($form, $form_state); } else { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); diff --git a/formClass.inc b/formClass.inc index b4d91d12..da62a37a 100644 --- a/formClass.inc +++ b/formClass.inc @@ -512,7 +512,7 @@ class formClass { '#type' => 'select', '#title' => t('Content models available'), '#options' => $potential_models, - '#default_value' => $selected_model, + '#default_value' => $selected_model, '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.
      Additional information may be found here. '), ), ), @@ -716,155 +716,109 @@ class formClass { } /** - * Creates a drupal form to edit either the QDC or DC datastream + * Create edit form. + * + * @param string $pid + * @param string $dsid + * @param object $client + * @param array $form_state + * + * @return string */ - function createMetaDataForm($pid, $dsId = NULL, $client, &$form_state) { - if (module_exists('islandora_content_model_forms')) { - // Get the content model. - $content_model = ContentModel::loadFromObject($pid); - $form_names = islandora_content_model_get_form_names($content_model->pid); + function createQDCEditForm($pid, $dsid, $client, &$form_state) { + $dsid = empty($dsid) ? 'QDC' : $dsid; + try { + $params = array('pid' => "$pid", 'dsID' => "$dsid", 'asOfDateTime' => ""); + $object = $client->__soapCall('getDatastreamDissemination', array('parameters' => $params)); + } catch (Exception $e) { + return array(); } - $form_state['storage']['xml'] = false; - if (isset($form_state['storage']['step']) || (isset($form_names) && count($form_names) > 0)) { - // Form Exists... - $form_state['storage']['step'] = isset($form_state['storage']['step']) ? $form_state['storage']['step'] : 1; - switch ($form_state['storage']['step']) { - case 1: - $form['indicator'] = array( - '#type' => 'fieldset', - '#title' => t('Choose edit form.') - ); - $form['indicator']['forms'] = array( - '#type' => 'select', - '#title' => t('Forms'), - '#options' => $form_names, - '#description' => t('Select the form to populate the metadata of the new object.') - ); - $form['submit'] = array( - '#type' => 'submit', - '#submit' => array('fedora_repository_edit_qdc_form_submit'), - '#value' => 'Next' - ); - return $form; - case 2: - // XML Forms - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - if (isset($form_state['values']['forms']) || $xml_form->isInitialized()) { - if (!$xml_form->isInitialized()) { - module_load_include('inc', 'xml_form_api', 'XMLFormDefinition'); - module_load_include('inc', 'xml_form_builder', 'FormBuilder'); - $form_name = $form_state['values']['forms']; - $definition = FormBuilder::GetFormDefinition($form_name); - $form = XMLFormDefinition::GetDrupalForm($definition); - $properties = XMLFormDefinition::GetFormProperties($definition); - // XML - $dsid = islandora_content_model_get_dsid($content_model->pid, $form_name); - $params = array('pid' => "$pid", 'dsID' => "$dsid", 'asOfDateTime' => ""); - try { - $object = $client->__soapCAll('getDatastreamDissemination', array('parameters' => $params)); - } catch (Exception $e) { - return array(); // Empty form? - } - $xml = $object->dissemination->stream; - $xml = trim($xml); - // XML - $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema'], $xml); - $xml_form->initialize($form, $document); - } - $form_state['storage']['xml'] = true; - return $xml_form->toArray(); - } - break; - } + $content = $object->dissemination->stream; + $content = trim($content); + $doc = new DOMDocument(); + if (!$doc->loadXML($content)) { + echo "error loading xml"; } - else { - if (!isset($dsId)) { - $dsId = 'QDC'; - } - //$client = getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); - $params = array('pid' => "$pid", 'dsID' => "$dsId", 'asOfDateTime' => ""); - try { - $object = $client->__soapCAll('getDatastreamDissemination', array('parameters' => $params)); - } catch (Exception $e) { - return array(); + $oai_dc = $doc->getElementsByTagName('dc'); + $dcItems = $oai_dc->item(0)->getElementsByTagName('*'); + $form = array(); + for ($i = 0; $i < $dcItems->length; $i++) { + $name = $dcItems->item($i)->nodeName; + if ($name == 'dc:description') { + $form["$name" . '-' . "$i"] = array( + '#title' => $name, + '#type' => 'textarea', + '#default_value' => $dcItems->item($i)->nodeValue, + '#description' => 'Dublin Core ' . substr($dcItems->item($i)->nodeName, 3) + ); } - - $content = $object->dissemination->stream; - $content = trim($content); - $doc = new DOMDocument(); - if (!$doc->loadXML($content)) { - echo "error loading xml"; + elseif ($name == 'dc:title') { + $form["$name" . '-' . "$i"] = array( + '#title' => $name, + '#type' => 'textfield', + '#required' => 'TRUE', + '#default_value' => $dcItems->item($i)->nodeValue, + '#description' => 'Dublin Core ' . substr($dcItems->item($i)->nodeName, 3) + ); } - - $oai_dc = $doc->getElementsByTagName('dc'); - - $dcItems = $oai_dc->item(0)->getElementsByTagName('*'); - $form = array(); - for ($i = 0; $i < $dcItems->length; $i++) { - $name = $dcItems->item($i)->nodeName; - if ($name == 'dc:description') { - $form["$name" . '-' . "$i"] = array( - '#title' => $name, - '#type' => 'textarea', - '#default_value' => $dcItems->item($i)->nodeValue, - '#description' => 'Dublin Core ' . substr($dcItems->item($i)->nodeName, 3) - ); - } - elseif ($name == 'dc:title') { - $form["$name" . '-' . "$i"] = array( + else { + if ($oai_dc->item(0)->nodeName != $dcItems->item($i)->parentNode->nodeName) { + $description = strstr($name, ':'); + $form['app_' . "$name" . '-' . "$i"] = array( '#title' => $name, '#type' => 'textfield', - '#required' => 'TRUE', '#default_value' => $dcItems->item($i)->nodeValue, - '#description' => 'Dublin Core ' . substr($dcItems->item($i)->nodeName, 3) + '#description' => 'Dublin Core ' . substr($description, 1) ); } else { - if ($oai_dc->item(0)->nodeName != $dcItems->item($i)->parentNode->nodeName) { - $description = strstr($name, ':'); - $form['app_' . "$name" . '-' . "$i"] = array( - '#title' => $name, - '#type' => 'textfield', - '#default_value' => $dcItems->item($i)->nodeValue, - '#description' => 'Dublin Core ' . substr($description, 1) - ); + $field_type = 'textfield'; + $value = $dcItems->item($i)->nodeValue; + if ($name == 'dc:coverage') { + $value = ''; } - else { - $field_type = 'textfield'; - $value = $dcItems->item($i)->nodeValue; - if ($name == 'dc:coverage') { - $value = ''; - } - if ($name == 'dc:rights') { - $field_type = 'textarea'; - } - $description = strstr($name, ':'); - $form["$name" . '-' . "$i"] = array( - '#title' => $name, - '#type' => $field_type, - '#default_value' => $value, - '#description' => 'Dublin Core ' . substr($description, 1) - ); + if ($name == 'dc:rights') { + $field_type = 'textarea'; } + $description = strstr($name, ':'); + $form["$name" . '-' . "$i"] = array( + '#title' => $name, + '#type' => $field_type, + '#default_value' => $value, + '#description' => 'Dublin Core ' . substr($description, 1) + ); } } + } + $form['pid'] = array( + '#type' => 'hidden', + '#value' => "$pid" + ); + $form['dsid'] = array( + '#type' => 'hidden', + '#value' => "$dsid" + ); + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Update Metadata'), + ); + return $form; + } - $form['pid'] = array( - '#type' => 'hidden', - '#value' => "$pid" - ); - $form['dsid'] = array( - '#type' => 'hidden', - '#value' => "$dsId" - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Update Metadata'), - ); - - return $form; + /** + * Creates a drupal form to edit either the QDC or DC datastream + */ + function createMetaDataForm($pid, $dsid, $client, &$form_state) { + if (module_exists('islandora_content_model_forms')) { + module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); + try { + $form = new EditObjectMetadataForm($form_state); + return $form->create($pid, $client, $form_state); + } catch (Exception $e) { + $form_state['storage']['xml'] = false; // An error occured revert back to the QDC Form. + } } + return $this->createQDCEditForm($pid, $dsid, $client, $form_state); } /** From 3259ae154c24815dfecca018ea20f0d25de03ac9 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Wed, 6 Jul 2011 21:16:00 -0300 Subject: [PATCH 016/247] Fix for editing DC, And redirecting the ingest form for XML forms. --- ContentModel.inc | 1 + fedora_repository.module | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ContentModel.inc b/ContentModel.inc index 9bac23eb..4ed21c3d 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -1162,6 +1162,7 @@ class ContentModel extends XMLDatastream { module_load_include('inc', 'fedora_repository', 'formClass'); $metaDataForm = new formClass(); $ret = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $soap_client); + $form_state['storage'] = NULL; $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; } diff --git a/fedora_repository.module b/fedora_repository.module index 90c8b653..4aba23cb 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -615,16 +615,14 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { } function fedora_repository_edit_qdc_form_validate($form, &$form_state) { - if (isset($form_state['storage']['step'])) { + if ($form_state['storage']['xml']) { if ($form_state['storage']['step'] == 1) { $form_state['storage']['step']++; $form_state['rebuild'] = TRUE; } - else if ($form_state['storage']['xml']) { - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - $xml_form->validate($form, $form_state); - } + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + $xml_form->validate($form, $form_state); } } @@ -663,6 +661,7 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) { module_load_include('inc', 'fedora_repository', 'formClass'); $metaDataForm = new formClass(); $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); + $form_state['storage'] = NULL; $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; return $return_value; From 260c9869cfbe39d4ede0581f35e103dacdb06ee6 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Thu, 14 Jul 2011 13:28:41 -0300 Subject: [PATCH 017/247] Removed unused form_elements module. This will break back compatiblity with mark roys original mods forms, but it will still allow the QDC forms and the new xml_forms to work. --- form_elements/css/copyright.css | 7 - form_elements/css/filechooser.css | 93 - form_elements/css/list.css | 25 - form_elements/css/people.css | 137 - form_elements/css/sticky.css | 18 - .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 260 -> 0 bytes .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 251 -> 0 bytes .../images/ui-bg_flat_10_000000_40x100.png | Bin 178 -> 0 bytes .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin 104 -> 0 bytes .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin 125 -> 0 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 105 -> 0 bytes .../ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 3762 -> 0 bytes .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 90 -> 0 bytes .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 129 -> 0 bytes .../images/ui-icons_222222_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_228ef1_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ef8c08_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ffd27a_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ffffff_256x240.png | Bin 4369 -> 0 bytes .../ui-lightness/jquery-ui-1.8.4.custom.css | 572 - form_elements/images/add_group.png | Bin 2575 -> 0 bytes form_elements/images/add_user.png | Bin 2261 -> 0 bytes form_elements/images/ajax-loader.gif | Bin 673 -> 0 bytes form_elements/images/application.png | Bin 9068 -> 0 bytes form_elements/images/date.png | Bin 3716 -> 0 bytes form_elements/images/editdelete.png | Bin 2975 -> 0 bytes form_elements/images/groupevent.png | Bin 2409 -> 0 bytes form_elements/images/image.png | Bin 18873 -> 0 bytes form_elements/images/lgpl-3.0.txt | 168 - form_elements/images/minus_small.png | Bin 560 -> 0 bytes form_elements/images/pushpin.png | Bin 580 -> 0 bytes form_elements/images/sound.png | Bin 9689 -> 0 bytes form_elements/images/txt.png | Bin 5765 -> 0 bytes form_elements/images/video.png | Bin 6865 -> 0 bytes form_elements/includes/autocomplete.inc | 234 - form_elements/includes/creative_commons.inc | 117 - form_elements/includes/filechooser.inc | 138 - form_elements/includes/people.inc | 288 - form_elements/islandora_form_elements.info | 7 - form_elements/islandora_form_elements.module | 1046 - form_elements/js/copyright.js | 48 - form_elements/js/filechooser.js | 89 - form_elements/js/jcarousellite_1.0.1.js | 343 - form_elements/js/jquery.breakly-1.0.js | 58 - form_elements/js/jquery.easing.1.1.js | 105 - form_elements/js/jquery.loadImages.1.0.1.js | 33 - .../js/jquery.loadImages.1.0.1.min.js | 1 - form_elements/js/jquery.loadImages.1.0.1.zip | Bin 906 -> 0 bytes form_elements/js/jquery.mousewheel.min.js | 11 - form_elements/js/jquery.tag.editor-min.js | 8 - form_elements/js/jquery.tag.editor.js | 214 - form_elements/js/jquery.ui.core.js | 281 - form_elements/js/jquery.ui.datepicker.js | 1732 -- form_elements/js/jquery.ui.widget.js | 237 - form_elements/js/otherselect.js | 30 - form_elements/js/people_ahah.js | 92 - form_elements/js/tageditor_1-4-1.zip | Bin 6803 -> 0 bytes form_elements/xml/gacs.xml | 5562 ----- form_elements/xml/languages.xml | 19575 ---------------- form_elements/xml/relators.rdf | 4297 ---- 60 files changed, 35566 deletions(-) delete mode 100644 form_elements/css/copyright.css delete mode 100644 form_elements/css/filechooser.css delete mode 100644 form_elements/css/list.css delete mode 100644 form_elements/css/people.css delete mode 100644 form_elements/css/sticky.css delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png delete mode 100644 form_elements/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png delete mode 100644 form_elements/css/ui-lightness/images/ui-icons_222222_256x240.png delete mode 100644 form_elements/css/ui-lightness/images/ui-icons_228ef1_256x240.png delete mode 100644 form_elements/css/ui-lightness/images/ui-icons_ef8c08_256x240.png delete mode 100644 form_elements/css/ui-lightness/images/ui-icons_ffd27a_256x240.png delete mode 100644 form_elements/css/ui-lightness/images/ui-icons_ffffff_256x240.png delete mode 100644 form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css delete mode 100755 form_elements/images/add_group.png delete mode 100755 form_elements/images/add_user.png delete mode 100644 form_elements/images/ajax-loader.gif delete mode 100644 form_elements/images/application.png delete mode 100755 form_elements/images/date.png delete mode 100755 form_elements/images/editdelete.png delete mode 100755 form_elements/images/groupevent.png delete mode 100644 form_elements/images/image.png delete mode 100644 form_elements/images/lgpl-3.0.txt delete mode 100644 form_elements/images/minus_small.png delete mode 100644 form_elements/images/pushpin.png delete mode 100644 form_elements/images/sound.png delete mode 100644 form_elements/images/txt.png delete mode 100644 form_elements/images/video.png delete mode 100644 form_elements/includes/autocomplete.inc delete mode 100644 form_elements/includes/creative_commons.inc delete mode 100644 form_elements/includes/filechooser.inc delete mode 100644 form_elements/includes/people.inc delete mode 100644 form_elements/islandora_form_elements.info delete mode 100644 form_elements/islandora_form_elements.module delete mode 100644 form_elements/js/copyright.js delete mode 100644 form_elements/js/filechooser.js delete mode 100644 form_elements/js/jcarousellite_1.0.1.js delete mode 100644 form_elements/js/jquery.breakly-1.0.js delete mode 100644 form_elements/js/jquery.easing.1.1.js delete mode 100644 form_elements/js/jquery.loadImages.1.0.1.js delete mode 100644 form_elements/js/jquery.loadImages.1.0.1.min.js delete mode 100644 form_elements/js/jquery.loadImages.1.0.1.zip delete mode 100644 form_elements/js/jquery.mousewheel.min.js delete mode 100644 form_elements/js/jquery.tag.editor-min.js delete mode 100644 form_elements/js/jquery.tag.editor.js delete mode 100644 form_elements/js/jquery.ui.core.js delete mode 100644 form_elements/js/jquery.ui.datepicker.js delete mode 100644 form_elements/js/jquery.ui.widget.js delete mode 100644 form_elements/js/otherselect.js delete mode 100755 form_elements/js/people_ahah.js delete mode 100644 form_elements/js/tageditor_1-4-1.zip delete mode 100644 form_elements/xml/gacs.xml delete mode 100644 form_elements/xml/languages.xml delete mode 100644 form_elements/xml/relators.rdf diff --git a/form_elements/css/copyright.css b/form_elements/css/copyright.css deleted file mode 100644 index cc663232..00000000 --- a/form_elements/css/copyright.css +++ /dev/null @@ -1,7 +0,0 @@ -.cc_preview -{ - width: 250px; - overflow: none; - border: 0px solid black; - float: right; -} \ No newline at end of file diff --git a/form_elements/css/filechooser.css b/form_elements/css/filechooser.css deleted file mode 100644 index f8b48594..00000000 --- a/form_elements/css/filechooser.css +++ /dev/null @@ -1,93 +0,0 @@ -.carousel .jCarouselLite { - border: 1px solid black; - float: left; - background-color: #dfdfdf; - - /* - position: relative; - visibility: hidden; - left: -5000px;*/ - - width: 680px; - height: 200px; - -} - -.carousel li -{ - cursor:pointer; -} - -.carousel li.selected -{ - background-color: #999; -} - -.carousel li div -{ - margin: 0 0 10px 10px; - font-size: 80%; -} - -.carousel li img.thumbnail -{ - width: 150px; - height: 118px; - margin: 10px 10px 0 10px; -} - -.carousel li div.textplaceholder -{ - width: 128px; - height: 128px; - margin: 10px 10px 0 10px; - background-image: url('../images/txt.png'); - background-repeat:no-repeat; -} - -.carousel li div.videoplaceholder -{ - width: 128px; - height: 128px; - margin: 10px 10px 0 10px; - background-image: url('../images/sound.png'); - background-repeat:no-repeat; -} - -.carousel li div.audioplaceholder -{ - width: 128px; - height: 128px; - margin: 10px 10px 0 10px; - background-image: url('../images/video.png'); - background-repeat:no-repeat; -} - -.carousel li div.imageplaceholder -{ - width: 128px; - height: 128px; - margin: 10px 10px 0 10px; - background-image: url('../images/image.png'); - background-repeat:no-repeat; -} - -.carousel li div.applicationplaceholder -{ - width: 128px; - height: 128px; - margin: 10px 10px 0 10px; - background-image: url('../images/application.png'); - background-repeat:no-repeat; -} - - -.carousel li.loading -{ - font-size: 150%; - margin: auto; - margin-top: 50px; - text-align: center; - - width: 250px; -} diff --git a/form_elements/css/list.css b/form_elements/css/list.css deleted file mode 100644 index 8e52d5ce..00000000 --- a/form_elements/css/list.css +++ /dev/null @@ -1,25 +0,0 @@ -.tagEditor -{ - margin: 4px 0; - padding: 0; -} - -.tagEditor li -{ - display: inline; - background-image: url('../images/minus_small.png'); - background-color: #efe; - background-position: right center; - background-repeat: no-repeat; - list-style-type: none; - padding: 0 18px 0 6px; - margin: 0 4px; - cursor: pointer; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -.tagEditor li:hover -{ - background-color: #eee; -} \ No newline at end of file diff --git a/form_elements/css/people.css b/form_elements/css/people.css deleted file mode 100644 index 06b54ad0..00000000 --- a/form_elements/css/people.css +++ /dev/null @@ -1,137 +0,0 @@ -/* $Id: ife-people-admin.css,v 1.1.2.7 2009/03/20 17:51:03 pasqualle Exp $ */ - -/* Admin form */ - -#ife-peoplelist-table -{ - margin-top: 15px; - width: 100%; -} - -#ife-peoplelist-table .form-item { - margin-bottom: 5px; -} -#ife-peoplelist-table .form-item .description { - margin-top: 3px; -} -#ife-peoplelist-table .ife-person-name { - width: auto; - height: 125px; -} - -#ife-peoplelist-table .ife-person-name label{ - font-weight: bold; - float: left; - clear: left; - width: 125px; -} - - -#ife-peoplelist-table .ife-person-role { - width: 150px; - padding-right: 50px; -} - -#ife-peoplelist-table .ife-person-remove { - width: 100px; -} - -#ife-peoplelist-table .description { - white-space: normal; -} - - -#ife-peoplelist-table .ife-person-content .form-item .form-text { - width: 150px; -} -#ife-peoplelist-table .ife-person-view-content input.form-submit { - display: none; -} -#ife-peoplelist-table .ife-person-content { - display: none; -} - -#ife-peoplelist-table .ife-person-remove label, -#add-more-people-button label, -#add-more-conf-button label, -#add-more-org-button label { - font-weight: bold; - float: left; - clear: left; - width: auto; -} - -#add-more-org-button, -#add-more-conf-button, -#add-more-people-button { - width: 150px; - display: block; - margin-top: 20px; - float: right; -} - - -.add-person, .add-conf, .add-org, -#ife-peoplelist-table .delete-person { - display: block; - overflow: hidden; - width: 32px; - height: 32px; - padding: 0; - margin: 0; - border: 0; - text-indent: -9999px; - cursor: pointer; /* hand-shaped cursor */ - cursor: hand; /* for IE 5.x */ -} - -.add-person { - background: transparent url(../images/add_user.png) no-repeat 0 0; -} -.delete-person { - background: transparent url(../images/editdelete.png) no-repeat 0 0; -} - -.add-org { - background: transparent url(../images/add_group.png) no-repeat 0 0; -} -.add-conf { - background: transparent url(../images/groupevent.png) no-repeat 0 0; -} - -/* QT style selection form */ - -div.ife-people-preview { - border: none; - width: 280px; - height: 80px; -} - -#ife-people-settings .ife-people-styles .form-item { - width: 280px; - float: left; - margin: 0 10px 10px 0; - border: 1px solid #ccc; - background-color: #fff; -} -#ife-people-settings .ife-people-styles .form-item .option { - display: block; - background-color: #bfe3ff; - font: bold 12px/18px verdana; - color: #0a5793; -} -#ife-people-settings .ife-people-styles .form-item .option:hover { - background-color: #aadaff; - cursor: pointer; - color: #003863; -} -#ife-people-settings .ife-people-styles .form-item .option .form-radio { - margin-right: 5px; - float: left; - height: 15px; - margin-top: 2px; -} -#ife-people-settings .ife-people_wrapper { - margin: 5px; - font: bold 12px/170% Verdana; -} diff --git a/form_elements/css/sticky.css b/form_elements/css/sticky.css deleted file mode 100644 index a58588c9..00000000 --- a/form_elements/css/sticky.css +++ /dev/null @@ -1,18 +0,0 @@ - -input.sticky { -height: 18px; -padding-left: 15px; -background: url(../images/pushpin.png) top left no-repeat; - filter:alpha(opacity=50); - -moz-opacity:0.5; - -khtml-opacity:0.5; - opacity:0.5; -} - -input.sticky:checked { - background-image: url(../images/pushpin.png); - filter:alpha(opacity=100); - -moz-opacity:1; - -khtml-opacity:1; - opacity:1; -} \ No newline at end of file diff --git a/form_elements/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/form_elements/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png deleted file mode 100644 index 954e22dbd99e8c6dd7091335599abf2d10bf8003..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dEr#)R9Ln2z=UU%d=WFXS=@V?HT z#xG*`>Yvsgk=}99w^d^D^d*@m74oMo<%#FcopJf?u00-~YVKV2wzrI*_R6;UORMea zBFVSEnN~eiVA6V&z`E)YLz5Aok^D)In}Yn=OzDpgR5Wv0XfT8pOkmV{sKAJ-PO9#T zZK}IXj&Q-V!U)!LcB_3K0&C*{ diff --git a/form_elements/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/form_elements/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png deleted file mode 100644 index 64ece5707d91a6edf9fad4bfcce0c4dbcafcf58d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 251 zcmVbvPcjKS|RKP(6sDcCAB(_QB%0978a<$Ah$!b|E zwn;|HO0i8cQj@~)s!ajF0S002ovPDHLkV1oEp BYH0uf diff --git a/form_elements/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/form_elements/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png deleted file mode 100644 index abdc01082bf3534eafecc5819d28c9574d44ea89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FsY*{5$B>N1x91EQ4=4yQY-ImG zFPf9b{J;c_6SHRK%WcbN_hZpM=(Ry;4Rxv2@@2Y=$K57eF$X$=!PC{xWt~$(69B)$ BI)4BF diff --git a/form_elements/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/form_elements/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png deleted file mode 100644 index 9b383f4d2eab09c0f2a739d6b232c32934bc620b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 104 zcmeAS@N?(olHy`uVBq!ia0vp^j6gJjgAK^akKnour1U*q978O6-yYw{%b*}|_(02F z@qbE9)0CJMo;*v*PWv`Vh2h6EmG8IS-Cm{3U~` zFlmZ}YMcJY=eo?o%*@I?2`NblNeMudl#t?{+tN>ySr~=F{k$>;_x^_y?afmf9pRKH0)6?eSP?3s5hEr>mdKI;Vst E0O;M1& diff --git a/form_elements/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/form_elements/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png deleted file mode 100644 index 39d5824d6af5456f1e89fc7847ea3599ea5fd815..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3762 zcmb_eYgiKKwx-=Q?Pdi0+w!yaC|_1uvA>yaxz|iX3eBv#HR0ASmSVIKMS&kf`CSAV4g0DJLgPkRO79xj%J<(hH6`bTGj zrr^$JeiHJI?;s&<5pRw-^kj}=E;X0OX+pgz+f5GVt0NQv_gbu0>-8J+F$O>HpW?Lx z+YFO`CV&6VV9fsEwG#js0_-|v*!ujZ*M=jfo457?0Do-z<^}+8bI+qk+W~+$zz%Z& z;L7&@&ns`l8Ofh*WdU0pO%RP^?Xa_h7I}7K#}4Xt`s%-(m-enaPWX$O&- zX~a1aOzn?!r?5wJVBNPJ_o8-(9Fz<_c1LYGxUl(E+Wdx?wkNHH2T%eWq9Kz00h#RB zYKI~=a<9_QqC^n<>hyWlS66waWgyAP#t&TfTWP=Sxa)ukRY%j7WH}(@r=B^W_;b&M zRzPYsb*j^Kou%%`K6VP+dKtR@x~qEHq4rXMxoX-gcSf&->lMY%TMXF!Gw_A)(tp6} z2A%kN3twbr%KyUrrmw24V3d%wzK<-q(M;MTr41}un`P!!xejADEv_CJ{CTif907B& zEP`pDJIZHVgnmxh$EZnBOUxz~Ap+ZzKbFmg39_n-)$wY!Q@i~5aGmHbN7&*gkq9zWgV|2(Zhxl zoDqJp&MxW(qX#C@oF8L)*r$RdSjVFSc$%z?*9%YoZ6sOZ!vtxXtBM<*r82vyC}_Eiz1PJ2L$bttko`=+fH{Ne@G#lMDxkKt_y)O(J5&Ak)w-I znm!vzYX3$kLDG$hOp-KJg~7}M;73BFWA{!a61fe?NJkjR_}Xw+*`O0=AGg7&dUA`A?9`whW zM{fkFf`G`P^9j*|-q9KLvS<191z9a^mK3Lss}W8O=sZ}N$V4Fh*SWF5NbZQ>p{0>$ z0pe}d$*s!y*R&NSXbjmld6{4Y;O89MuDTK0Hn0C?QdL9z1qGegXs! z7$MIGkPkwdHF2os-Z-e85B?5An>yc|m<}>!Iirg%H-%F11XY{{>@kgL>a#6fM9JzBE&an&F>eWh|b0^kJ zNBM5*nCa~(xwn~rG~>GSG9mz3h z9F~64y}giIrz^lfl|_5HpUsG}?Wpr*&f?bS=|9biqivN)-a~u>uK<{Lfcng{663QL zLXzO@*N5)q4C=j6E8nC+P%lEwI#~0wkt;M4Y8!+DYzN2rBuYao1*HRIa^NC9nFeep z+ns5$X9Bh48S-`ss!k&!J#Ddd=j1O-9}?`v(B|>R7wD97BV;nK~quUHx^mj^G6K2GZ1*uSN?iLm!7vHB7_1^TGbKhmnK+K`GYA zocp2=on8LxJH^`7^1ch0ft(MTU$vJB!R@gQ^R`qoX>(=iY#u++3K>oqSpG={?#YVw zp3m99FXk^~<6#X9X1oKYXEH%8t2btG65(u0zF-J)^>8dj0Evc+9_Bd^Y)k9AfW~FV z%iDV(ClS6)TC7eVzh{ml;p4cx8)$TV&qhRWp+dqiw>i32?1;5d>HLrNj=^OdJ<}L) zWxqw8aFI<~_TkMDQHS?`z+KQ?+{ASoy%}RBu6i9?BXbh%OEx1OuZ}?n(VjrT(!B1; zQ!#WA0NBx=^6rJrFVsDCuT4)OTGzZ3$Z4Yqz z&c9+7%g!%zxtv#p2fhHbo98KBwfE&Y(&2#=}qEEU`ECEjlCp=X^_tIoMx>%kBT5k)^c=zyV5w3 zc>DLKY6%=y0igWi9B@4hB}bR6K|+jYBt+}i6Ld|b`*s62c6Ge?zGYvdW)=p90~$Ad zxGB>c<3Dy~hPJ#vNXierOl41xBn_0L<5NhK6JO-LvtS&Z{xjGKfIC6*9%*?tv*?+! zv;Q{?mHN2b|3DEJO}R9w11ZT5QVC(H0u|0n9cVK_@2r%C<)OnZ(3aS0Ux^6G$ja*< z9R~o~9XjhPL)w@vYi6r;H$tR>wW`0-Z&Qed`X0LZY9-~mfso!@dt?5Q;@|K6$mAB& z$J41&y)<{N;QATPeU}BC{lM_@-LlQ2hjX;}6~qdglT zGm%qJm*F^in=w*?j;@C_PCMnXK5Fd^wXV**pZOdS1KbSJsC~s#R;tmXIMb` zHB>sxQg&E5Yf@}d#~Z9D4R{}ZpLm7S=bY0x#k<=H?=R+=W$=Bm2aU*n z)qgD*0#4>GGlHhQ`bx#k=Njc;+9D@{F5`xI^tMkBf{XIzwB=b9KbuuLF7jMTR~Mwt zN#!)9J4&^V@JRe9Y!b2!;$rCLPWZfG`C;Qz`u~TJdCzv->e`=R8uHX_2{Fp&pWJ*h z#A60&bY(j(^P@t_`_pktBV7{tFVoeNWlNA|zgNr&DMjJ_!k2%2s2~F@la$M6k%hWi z7}}hoDuoaN7?lchVk@4DunpEIS$72&uuF&F;&4uhC$L)6IzHHUryR9emzpxwsRXmj zfc}pI#oRCB7Y1;t=*58Gsv7x3PGuW^spn6V&dWf#?*TQ0(|*rr=EeE1o~y1wyQi%)e*oX6iX@$m0F1RtKUT0vgg!8^fWhYLqS zF@EOpFld7>f^kprb~YwMq=^<e|gw?QFyf8ck|ZC^>)3c`b$^C>jCB4Fne_1e$Cqt=4Ud#K~~8Nfa91W zwk17&D?X?4FRzR+5qCiIqPf0};K4$tW$}l~A?u_E=JSe;*f_DO>r{z=U4_<)dY)M! z7O#mizC+GN&#;)k)vkBUS@fZesb{v?YuFlCPRjsT5bxB4@+sqdq}xvvBhTngZ(N1LUCS-ei=5sgE-Tbc z7HK+A_O23MP@sUoc?I?*ZB|F)&%us|2O$#G7V$6z zq>G%6!cu7OEf+_#^A=23Hd6Db9-yK*NQ#S+kjJI7 zhLiLz{>zKKtHH>H;B-cALzj`>@+-~?X2aP7ypf9WMf8q0m)wS!Nkf+&R&&zEjFOUx zlq^>v#VAq}=)?dKRMe+010g9O;qAiaTA4dV+==mw%i3Re)DwZ$Wd5CK1m4Ivy&&Ef zO8W!SpcgA>zfTGAE!{IPJMhdZ`T4{K#7ndDT8K2&*jf=J8O>H*iDJ}ZK}z|$C3U62 z$nZhk4v$QIYzMaV+0`B8S!=9RSYzi*QG#tp>ZY|lY_`}A-zI7)(tV$B9G-tC#zt8m zre~pD7oIFkmIAM=s zw+Iili%nSC?yks)t~q4lTlZW(#5^yUV@+^KvIuQzZDO^*TBz!j#nX%*uiW|{x9q0w diff --git a/form_elements/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/form_elements/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png deleted file mode 100644 index f1273672d253263b7564e9e21d69d7d9d0b337d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 90 zcmeAS@N?(olHy`uVBq!ia0vp^j6j^i!3HGVb)pi0l%l7LV~E7mxPQ=F85a&M@g_{ d|GeK{$Y5lo%PMu^>wln`44$rjF6*2UngE4^EGqy2 diff --git a/form_elements/css/ui-lightness/images/ui-icons_222222_256x240.png b/form_elements/css/ui-lightness/images/ui-icons_222222_256x240.png deleted file mode 100644 index b273ff111d219c9b9a8b96d57683d0075fb7871a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4369 zcmd^?`8O2)_s3^phOrG}UnfiUEn8(9QW1?MNkxXVDEpFin2{xWrLx5kBC;k~GmPmYTG^FX}c% zlGE{DS1Q;~I7-6ze&TN@+F-xsI6sd%SwK#*O5K|pDRZqEy< zJg0Nd8F@!OxqElm`~U#piM22@u@8B<moyKE%ct`B(jysxK+1m?G)UyIFs1t0}L zemGR&?jGaM1YQblj?v&@0iXS#fi-VbR9zLEnHLP?xQ|=%Ihrc7^yPWR!tW$yH!zrw z#I2}_!JnT^(qk)VgJr`NGdPtT^dmQIZc%=6nTAyJDXk+^3}wUOilJuwq>s=T_!9V) zr1)DT6VQ2~rgd@!Jlrte3}}m~j}juCS`J4(d-5+e-3@EzzTJNCE2z)w(kJ90z*QE) zBtnV@4mM>jTrZZ*$01SnGov0&=A-JrX5Ge%Pce1Vj}=5YQqBD^W@n4KmFxxpFK`uH zP;(xKV+6VJ2|g+?_Lct7`uElL<&jzGS8Gfva2+=8A@#V+xsAj9|Dkg)vL5yhX@~B= zN2KZSAUD%QH`x>H+@Ou(D1~Pyv#0nc&$!1kI?IO01yw3jD0@80qvc?T*Nr8?-%rC8 z@5$|WY?Hqp`ixmEkzeJTz_`_wsSRi1%Zivd`#+T{Aib6-rf$}M8sz6v zb6ERbr-SniO2wbOv!M4)nb}6UVzoVZEh5kQWh_5x4rYy3c!871NeaM(_p=4(kbS6U#x<*k8Wg^KHs2ttCz<+pBxQ$Z zQMv;kVm5_fF_vH`Mzrq$Y&6u?j6~ftIV0Yg)Nw7JysIN_ z-_n*K_v1c&D}-1{NbBwS2h#m1y0a5RiEcYil+58$8IDh49bPnzE7R8In6P%V{2IZU z7#clr=V4yyrRe@oXNqbqo^^LvlLE?%8XaI&N(Np90-psU}7kqmbWk zZ;YBwJNnNs$~d!mx9oMGyT( znaBoj0d}gpQ^aRr?6nW)$4god*`@Uh2e+YpS@0(Mw{|z|6ko3NbTvDiCu3YO+)egL z>uW(^ahKFj>iJ-JF!^KhKQyPTznJa;xyHYwxJgr16&Wid_9)-%*mEwo{B_|M9t@S1 zf@T@q?b2Qgl!~_(Roe;fdK)y|XG0;ls;ZbT)w-aOVttk#daQcY7$cpY496H*`m@+L zeP#$&yRbBjFWv}B)|5-1v=(66M_;V1SWv6MHnO}}1=vby&9l+gaP?|pXwp0AFDe#L z&MRJ^*qX6wgxhA_`*o=LGZ>G_NTX%AKHPz4bO^R72ZYK}ale3lffDgM8H!Wrw{B7A z{?c_|dh2J*y8b04c37OmqUw;#;G<* z@nz@dV`;7&^$)e!B}cd5tl0{g(Q>5_7H^@bEJi7;fQ4B$NGZerH#Ae1#8WDTH`iB&) zC6Et3BYY#mcJxh&)b2C^{aLq~psFN)Q1SucCaBaBUr%5PYX{~-q{KGEh)*;n;?75k z=hq%i^I}rd;z-#YyI`8-OfMpWz5kgJE3I!3ean6=UZi!BxG7i(YBk? z02HM7wS0)Wni{dWbQMRtd-A)_Az!t>F;IwWf~!*)-Az4}yryNkz&9)w>ElA80Oc`6 zHo#9H!Y3*Qx9n@Jn)!w6G^hb;e_n8zpIyXCN`JFkPc)^Q?2MsLNFhMgrcZI-<#1ne zjH;KFf?4eAT9mQZ}ZfHLGA#d%s;SZK4p0FwZT2S^{ zQ2BG1xJsbK6?yrHTjJi|5C0u=!|r!?*4FL%y%3q#(d+e>b_2I9!*iI!30}42Ia0bq zUf`Z?LGSEvtz8s``Tg5o_CP(FbR0X$FlE0yCnB7suDPmI2=yOg^*2#cY9o`X z;NY-3VBHZjnVcGS){GZ98{e+lq~O$u6pEcgd0CrnIsWffN1MbCZDH<7c^hv+Z0Ucf0{w zSzi^qKuUHD9Dgp0EAGg@@$zr32dQx>N=ws`MESEsmzgT2&L;?MSTo&ky&!-JR3g~1 zPGTt515X)wr+Bx(G9lWd;@Y3^Vl}50Wb&6-Tiy;HPS0drF`rC}qYq22K4)G#AoD0X zYw$E+Bz@Zr^50MAwu@$?%f9$r4WHH?*2|67&FXFhXBrVFGmg)6?h3^-1?t;UzH0*I zNVf9wQLNLnG2@q>6CGm>&y|lC`iCFfYd}9i%+xkl^5oBJ?<;aneCfcHqJh7Yl5uLS z9Fx-(kMdcNyZejXh22N{mCw_rX1O!cOE&3>e(ZH81PR95wQC37En4O{w;{3q9n1t&;p)D%&Z%Nw$gSPa!nz8Slh7=ko2am)XARwOWw zpsz0~K!s{(dM$NB=(A=kkp>T(*yU6<_dwIx>cH4+LWl282hXa6-EUq>R3t?G2623< z*RwTN%-fgBmD{fu*ejNn)1@KG?Sg*8z3hYtkQJQjB6 zQ|x>wA=o$=O)+nLmgTXW3_6diA;b4EY{*i*R%6dO2EMg z@6g?M3rpbnfB@hOdUeb96=~I?OIA3@BWAGmTwiQ{x5Cqq<8c10L!P zd@Qk^BseTX%$Q7^s}5n%HB|)gKx}H$d8Sb$bBnq9-AglT2dGR2(+I;_fL|R4p$odJ zllfb0NqI)7=^z~qAm1V{(PkpxXsQ#4*NH9yYZ`Vf@)?#ueGgtCmGGY|9U#v|hRdg- zQ%0#cGIfXCd{Y)JB~qykO;KPvHu|5Ck&(Hn%DF~cct@}j+87xhs2ew;fLm5#2+mb| z8{9e*YI(u|gt|{x1G+U=DA3y)9s2w7@cvQ($ZJIA)x$e~5_3LKFV~ASci8W}jF&VeJoPDUy(BB>ExJpck;%;!`0AAo zAcHgcnT8%OX&UW_n|%{2B|<6Wp2MMGvd5`T2KKv;ltt_~H+w00x6+SlAD`{K4!9zx z*1?EpQ%Lwiik){3n{-+YNrT;fH_niD_Ng9|58@m8RsKFVF!6pk@qxa{BH-&8tsim0 zdAQ(GyC^9ane7_KW*#^vMIoeQdpJqmPp%%px3GIftbwESu#+vPyI*YTuJ6+4`z{s? zpkv~0x4c_PFH`-tqafw5)>4AuQ78SkZ!$8}INLK;Egr;2tS18hEO5=t;QDmZ-qu?I zG+=DN`nR72Xto{{bJp||`k}-2G;5#xg8E~xgz22)^_Z;=K|4@(E&5J)SY2of=olcw z5)@L)_Ntcm!*5nEy0M9v0`S33;pO4TN;>4(Z+19p_0>u#e-vE zXCU(6gAvu~I7Cw(xd%0e59MNLw^U37ZDbsBrj%eDCexw8a3G`nTcXVNL6{B7Hj@i& zbVB{;ApEtHk76q08DJ48dSxd$C(;$K6=FpU<~l9pVoT9arW^Vu{%Bcn4`eIpkOVC| z$)AKYG_`ypM{0@BUb3^9lqi_c?ONH|4UJMJWDowMVjacycX7}9g={O7swOB+{;+?; zjBo!9?+nd)ie#x5IbFW-zBOo0c4q@9wGVt5;pNt`=-~Zgcw#*`m($6ibxtZ`H=e=} zF#GZ~5$%AUn};8U#tRem0J(JTR}d4vR(dgK2ML~lZsPhayJ2h1%sD4FVst| zKF)+@`iNzLRjg4=K8@**0=5cE>%?FDc({I^+g9USk<8$&^qD~@%W0i4b|yMG*p4`N zh}I!ltTRI8Ex$+@V{02Br%xq#O?UlhO{r8WsaZnZCZq0MK9%AXU%MDLT;3=0A9(BV z9VxxxJd7jo$hw3q;3o?yBLmA=azBUrd9>-<_ANs0n3?-Ic*6&ytb@H~?0E(*d>T5n z-HiH2jsDf6uWhID%#n>SzOqrFCPDfUcu5QPd?<(=w6pv1BE#nsxS{n!UnC9qAha1< z;3cpZ9A-e$+Y)%b;w@!!YRA9p%Kf9IHGGg^{+p`mh;q8i7}&e@V3EQaMsItEMS&=X plT@$;k0WcB_jb;cn%_Idz4HO$QU*abf4}+wi?e96N>fbq{{i|W0@(ln diff --git a/form_elements/css/ui-lightness/images/ui-icons_228ef1_256x240.png b/form_elements/css/ui-lightness/images/ui-icons_228ef1_256x240.png deleted file mode 100644 index a641a371afa0fbb08ba599dc7ddf14b9bfc3c84f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4369 zcmd^?`8O2)_s3^phOrG}UnfiUEn8(9QW1?MNkxXVDEpFin2{xWrLx5kBC;k~Gmw z<@?HsG!Qg3zaV+-xQ3ldtad!U<6iGz_enGH*2akP_r)o1D&8p^5M)_c8IIj6Wy*7HJo&CBLuo~nj>(63pZzO(Vv^ZuB3 zMYigjkwA;FEy|G}1jpiMj6|NTm7Uyiw=@FDE*nX<>jR!W@9XIyf%$Fd*J5*D0Z0Lm z9}ZQxyT|x5ftNy?V>EbJz-K>bV9gs9RaXUP<^=;e?&Fqxj;6{ieR-a-@HycA1KMKhql8GOmcxwZ?_-(3hMK^^a*(gaFvBH ziIC!fgH4$W*NbKIaY&T?%&13``KbD@S-0`xQ%v3TV+B!;RC7O!+1a9QCA$H@3tR;k z)SSoR7(s4)f{zM}eWgFN{(ZH5d1O}l)f$ruT!)Q&NImXyZsTzOf9TwctcSfr+M)aJ z5otO+$jvm-P4)ykH)x|cO5xeb>?!`qGw$(>&axqLL6yoB${vsMXgL_-bz@2J_tS92 zdvZG-+vKl@K4Vr(EL{WQt@Z+Ea-hxX0}nTSZxnpi^#Kn8Ox8FgIS|hc}KJQ4tm*HO16ui{(O9} z1YN)GjiQt6fGq`Cj+^`zUf?8hk^(T{{cOQGWFP98am}is28A!5%{R#ENv8fCN!j69 zlMEK(2z?|BY=Je$XD9mB-Kkem*(d-j^9j$2#6r$Dz?s)-TCDCGCs z8>6Pvj{Y+YIeFA@qY22V$)awy@q!9A4rgk5b9TcC;s9Ig^G|6nDP+5=Fzg&?(L=vc zCbGd>fSu~@6!94td+o#d@sid!EIX$rx7*cawe6 z`dScJ+$HssdOjE)O#Ybs56vm-FQ$7yuJJD^Zqk%hMaIgAJ<2yb_MFQte_i;62ScT$ zpjifYyR_E=rQ+>H)pmlr-Udzg*-!|ssw(D7wJvC+Sf8bb9;;q8#z?0p!!bsd{wy|5 zpBaMHE-Ve>i#LLjHRaMLtp%9&(HCng7Sw96jVv!#0k%?F^K7&=T)mnYn)D9(i;4x5 z^NJTJwq~pv;kH@#ejTd*48~(J(r6j34|m`h9fEDj0im)~+%I5XphWymhT;_Zty|Q& zzjPg#-ufAHZ1M*Gccw?Kf|8Pnhtb0`!{N`Bqsa37J+>wC$!e z00k+2Egzz;rbcWoUB%Jvp8W1}$XD%e3>4y;;OZ1ccT-O#uW6Ys@C}Pa`nZrNKzR(2 z4e%3)@QI4SE&E!lW`5y14QhbepBG%_XBV-O(%5tj)@9#|;sC-MNev!zGDHk}JdpGC`iJF#8=8-P$Xoku_=Dw%Cv3{U7L>gf zRQ?<$t`cZ*MP5GQmbmx#!+*!zu>0MewRO9GFGS{b^m_fJ-N0?j@EqoFf>$khj+E|@ z7r3We&^tR^YZrxKe*d22agXqCO0l44&kqCv{u)T|(lv`~PK@DvE z{QI_TlCH5z*gR!>LO)k67{^R+vWx24U2^2ODXpwT;6y+6+$5m)_*w4WY&#do9dCeE z)>p+Ykdhq($DhmMiaYXey!@N%L26uz($aJ!QT{B^Wu}U$^9e#5)=c+XF9@Ill?ZmM zlNgHiz*9!vDc&uxOo;ZVxb`Q!Sk0*gnfxWzmbZh4(=%CD%qP?0=);n$&zaW_$UKV9 z8axdcN#AyZ{P)wj?V{P}vM)YY!>6@}^>U+iv$`9>nMTCPjN>z%yF&3yf%>+T@0vh4 zlC8Xa6zeo?%=o3}M8{aebLHcO{^1Ar8qiM=Gquf?Jo)q5`-+?sUpg?QXyEUpWSm+n z$K-UyqkIwHLquru~o(OF)hhz$Y*|X>ZIbswnxRvr~ z2=rdOGVuD|xRlpAZE<0!X1F(%Anpl^@V^D3vbM}qxe|NI;TTiZy7(IM;R69RkA>a& z6gwYE2sREzQ_LHmWqB+ogMk(fMaSFeoDq-!HkFB_nXt5+2ncFuk9BQL1I&oB1zZi) zYW{6_&-Ip1l*OVRA##1ILQS;5R{-K^0wGTiJbVSi@LA^$D$;@J>^G{6@&+%4{b3(s zC~LEHiTv(0b#zxt?YJ0r_~pUZM~mQ(??(n#>&tD%+@nq=Abj5*8R!~Ul1`G~=qFJ4 zfl|m8ZDCYgtr`4LcOpgiJYX9qRY5;DcWti~PmS$VB$E-Zt^f4)vLDOe_3XTq5^ylW zJ9PKm!V-8sAOJXnUfuFNIf0R9tK-pNs2hO04zr620}5B(Ok>yB)Of-3sP59qfQNbm zA4{w!2@cB;GbR(~szVrbO%(w=5S!X`o@o@x++wbN_tMPT0Vc)*I;Fgsbf^*g0 z2Di?HTApwKq3+YwfNsqd3iP%{hyK1iyuVZc@*0tO_3+N0#GFsz>8MjeJ2UJ%L!%hi zGYYAthH`E+ywA*u{(eJ=ia3h*%k?779rk-K<0VZAPkl;TFUbmei|$fqWO8!_zIvqt z$ly$VrlH46nnpX~X5Yk0iBJl;=WuA4>~X4-f&K0yWf42h&0b30t@NYX$7egQ1Fp!a zbui-D6cWCWV&|R1CY@G8(qOmWjWeX3eX7UggZPGimA}soOuQdXe4uZ#2>5zN>qlI0 z9xk}lE=tNpX1m6*nFr2EQ3xs79!^sCldDJYE$m(qYv3q7>}1R7?iZW7>$~*%zKaC| z=$N?ME$>#+%T&MZC`dW1wUl6Z)JgyCn~V%K&i0H|iwE%$>xsZW3tTfZxIUePci@p;cRu|d=ItIwF z1clVHy{hH?@SD|(Zfqi^0DQ1hczHN7xq85h)rzQqLHMX2^IkuK7FB!kI40s$|CY7~ zNX^{_UjN8}L%Med;|+=4RNTMozn8KT;2tb77bUPCmioh+rZBfIiM6f_P34cQ__o1G zWqQp3VL~~pE5?qODf%iiQQ3f42YF@09tQ*$4v_EKUx;t1KCPCBtgqg z@+Tn;O)a0uky_%jm+WjNB?=~VyH>V#L!*=l*@OS6SVyt_UEH&NA=?V2stHPyKkVNy z&jg<#cjros){#ji)dK z%)We0L_478=HZ8-@xnwsKrWs8)x`MB;(Y`Cmu2c-&SH(vN-F(*e`l?c%+l$|y_AJJ zhcDGnwLvN+bu;_sX|1AiePhx@u&%P$hf*xE+O=~D?_(_KGWQ!158YL-y9$*6mmPo;Rp*Dl5lm-mVM2i`h- zM@nxv590_tvMwPD_{l=b$iOm|+|S{D9&P%zeT$GgX6Akl-tfUF>tL@Ld!B&{pN39t zH>3Vhqkr}2Yul+jb7UiouWVGPNsxX7Ueba+9|~dz?d*QM$ng0DZfO0`7fAy?2yMm| zcnRzUhZ&IcwgjH9cuU!w+VStYa{p*)4IgBf|E8)sqMYtB2KH_}SfsFq(c9i(Q6S3U oBo%DI*Kv;w;*%(i9W@e{{5C=l}o! diff --git a/form_elements/css/ui-lightness/images/ui-icons_ef8c08_256x240.png b/form_elements/css/ui-lightness/images/ui-icons_ef8c08_256x240.png deleted file mode 100644 index 85e63e9f604ce042d59eb06a8428eeb7cb7896c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4369 zcmd^?`8O2)_s3^phOrG}UnfiUEn8(9QW1?MNkxXVDEpFin2{xWrLx5kBC;k~GmC-Ajq!3AfU8Dx90^_ zp3}MKjJzYC+`T(&egFXQ#9Ek{*oVAaa!zrZtmlRFnwQPRJXH<%pkK2*eP`pT=lwD7 zifq+4BY_rUTa+U|2#&?i7>PVvD?7R4ZfOLPT{e9G~G!Ls3s8JtQE`jMM9wl2V9&Q+K2DHW0M+uQmEr%nYJ^7cK?uIpU-)=wn71ZZ-=@ar0;3^AY z5+TI{2b(e%t{2PZ^HKF*vu@+Xr&BAc@2BC4 z_vCgww#i=)ea5Vo$glEEVBBg_VPBj!)OO>)f@}#dg6ULOeC>LBHz<;*5Y;YfE0lNx zg{N+4@lO~ozxpF69qV@VOGnc248Iuag4C1T)P^(hWkpP!{h!JekX}m^Q#b2B4f1oT zIjsGz)4}-$rQ*-tSuc%qG>%<4xM#E& zN)7lRK~^2VdiloY4>;#}A!yHOAXEmEi^+eA#05pawGXs>!z)gSoDuI#>bRCq-qjJe zZ)r=A`*EMX6+)~er1kdv1L^)0-PsAEM7JF$O6G8>496$24lkOSR^RTfUuIz%iSfn5b-t!##cs7sQI);gdAvqmn_v|%I9k;fCPl0Z)R1+hNQONJN zH%3jT9sOq*a`LF*MiY=zlSSQZ;{_FL9M07A=In+O!~wR}=bzGEQpk2!Vc0p)qKAH? zOk{(%06W#)DdICQ_S%Q@<0Y+!?9%#$gWJ%)EO->^YZP{<`oB4~9xh zL9-0*c4@B#O2ylYs_g`Ky$zb~v!M`NRaMNFYF*Gsu|7)=JyyMHjFC=HhGUE@{aI|B zJ~ITXU052%7jFb5Ys#fhS_?4kqc7H0EU49B8(Chg0&JzU=Gka#xOz1)H0d4m7ZnRA z=M^tdY|U6T!fmte{W?_r8H~qdq|q{5AMU_2It1I4143n~xL?4&K#BOB48l9_Rdm!(c^C?JU;tF0 zEh@o1y6Qa_>}#AwX{VY+`C^kNkxhgb1P5cB0%xupAXyg9NO=SnXrJUE?rQg{Lcsn+ zAZKctGLfbK_B#^&Nev|0^fB&?DN=ak8|0!np524LD25=s84BP8Vl(3=jflNp{X>e@ z637Ri5xx;&JNl+XYImA|{;XR~P*svYDEWYJ6I5!6uO~2twFC1ZQevB7#3z~(apxn& z^J@>Mc`>PJair{yT`iuan-V+i%|Ho-pA<1?V-k^R2Q<5;Co%XxmL` z018t4T0TTwO^w)Gx{9OSJ^9_|kgwX`7%0Rw!PO~@?xvnfUehvN;2Rc;^l>3kfbtk3 z8{j7p;S&{uTlTe9&HTc38q@%_KQFk<&n{vmrN7y&Cz{etcE->rq!6HL)2F!aa=0%! zM%Bwo!7TQ5t;@a_#Q}sjk{UebWQZ8{cp&HN^$*JfH#8spkhk{R@CVBiPuP@yEhu{} zsQfuhTqV%rioATpEphMfhyRYbVfVW`YwLFXUWm-===J(byMf!5;W^CV1g~2194Xx) zFK|z{pm%n-)-DRe{Qhk(d!QaoI*y%Wn6h7<6A{i*Sob&B^y|Spg!&J$`kN>zwUJ3x zaB$ciu*0FJKg}T ztgnh)ASF8njz5>h6?f#{c=*Yr4W_34$GmVIo8OLWjcZK4a0`+Yv-!*}9 zBwKm;DAsA(nDI-`iH@;`=gP+m{lgFLHK3m$W@?)&dGhDA_Z2xOzI0$p(ZJtH$vCxE zj>+kYNBJzs-TlSx!tSH}%I9fQv)mc!C7X0bKlZv4f&}C3+O-4k7AmVO|KYZ9ydP%(N1^uisV8y;~p`x4qFXD?!_OyN9=w(Od6W; zGrT?G;l2v@Ob5k^8w<9w%Jbjb^|H}PYKo}I~bobd!XrTbzp2Zp~H8lgJ)I3?l&(bDiWf8gE&6b z>)9GB=Iu-6%I((+>=jGP>CzD8c0oWITFZGgM!Q7|JrUYq4#^Y(vuDu-a>OWDa4Y4} z5a_*lW#IL_aVf8L+Ty}c&2VojLEIA-;eQK6Wo?xAuK>i;1VWx3c=!s2;j_*iRHOsb*>6-CgcYP+Ho=L@XLd*j~2ln-;WHg)|cCixksH$K={5rGSD@yB%LI|(NCc8 z1Er8H+QO)~S~K{g?nH|2dB8SKs)BxQ?%G}}o*LV!NG2m*TmR|pWj~g`>)ClJCE#F$ zcj)fBg(dKOKmc$Cy}IRlasngIR>z~kP&WW~9cC951{AKmnZ~ZMsqup6QQf7J0T1;C zK9*Qd5*(HxW=tl|RfjO>nkoW#AU3t>JkuzWxy4-l?xmTv15_r1X@p@dz^{&j&;{Mq z$^0$0q&y?kbdZh)kZ+NfXfqLTG}Q^j>qHlUH4VEK`3y^-z6Y<6O88Hf4v^;}!{t-a zDWg;znYu%6zA1~A5~w?fxO~i8-Ib(^02{c4pXjhDI^2 zXB1LP4dvWuc%PXQ{r!d#6>${rm+M8EJM8yf#!H$Kp8AxwUXm5`7Tu-J$mHeCG>vw|&Ay415}_1w&*9K8+2d3v1N+@a$|820o4u60Tj@u&kI!~q2V9X; z>tMvQDI|O$#m+m2O**ZHq`_{#8)ry6`&5s~2k{O4Du16Fn0P;&_(0!e5%Bel){nU0 zJX~<8U6hoI%yx}qGY_1Tq7YKDJ)ETOCs&W)TiCrK*1%DE*vXdD-7hwE*LUgjeHRM` z&@pkhTi>m#Kc+QIK+2Ybn9-sFVKNHyIgfob4H_77yYh))Rq$7Pw|+aD6&yZ|ki9 z8Zb6s{oBt1G+PgfIcxd}{m@~1nzhe;LH)5;!gS8@ddyabpdBc?7JVl?tS+<#bPSMT z2@0uYdsWN(;Ww)n-PlA-0r+62@bYkEa`k{0s})fJgYZ#5=DmIdEvok7aZJRi{w-|} zkea&6X}ZA3b7&vbDb7)v8CuI(+zzSf3z&P2eOrPNP?D~ zf zn0@)0h;~5F&BG5vOFU!=woW&ZSl~nrs{?1w>nWfW_dnpTd z4qvLDYJ*ft>Sp%M(^_xCZpNBnc66JX}A|ZL9IENM`U>`ph7d<+RQiI}@E8Y)70s zMC*_&))}GlmR}@{v9*nm)29-=rn`Q$rc^4G)GVQHlTr6BpGxtHuU(8AF7Ffh54?5w zj+EYT9>x)PWL-iQ@RNmT?R+|c@=FOmj)5Za6_ z@DkVy4l^L>Z3#SI@s_eVwd3D)<^Ivq8a~J{|4mhOL^<7M4D8){ut;GIqqn`oqCk|x pNh;Wa$C0(mdpqYz&F>xK-uVD=DT5%Jzh8ZT#aXmjr70%*{{RacS`YvL diff --git a/form_elements/css/ui-lightness/images/ui-icons_ffd27a_256x240.png b/form_elements/css/ui-lightness/images/ui-icons_ffd27a_256x240.png deleted file mode 100644 index e117effa3dca24e7978cfc5f8b967f661e81044f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4369 zcmd^?`8O2)_s3@pGmLE*`#M>&Z`mr_kcwz5Nh&g=McJ3E!;CE1E0ryV5Ro;>nvtvt zk&I==Xd;cVGZ@>q_xtnx{1u%7-D)N|5YqOB>i;(bZ#o62{J2Y9&^D3~R^$o+X? zwbxAEIb)xwCwK3TSR4QVym6N1rVgPmmt0caryBUceHP_&u}{?^Jn7f0PT$#h>UDqI zr!q(F&1jJ2_!jxdAB<)7H$foI*2zuncvu;;$SoU7br=AiJ@4=BC4vNO>DS`&UIB=K z;2)0F*t^FBvVfPuT4FVMSwUw%Xksjyl+;#*DDy%=ocFOyzDLvLR(`zCSOuJ=?FWYn z5ZD!UaoF>-$@=Vt?a&;UQYM$Oqe0ZB?Je?8ZnMxDe&uzzs*zlHd)V58nfJPc8S^({_4bj5HQ_B&EXHWj6wx@B;!mr04b_Mx)UFL)W7`V!c zpMp#C!a!!sh3h491y}^qfimXVY%!+sYu0_DWoJMqpN(FR9LM#jdZ{vJzEck`P^9(1N=4J za9%u4$2J8TAkUaJk_FX%iHuv#svL_mMmp{SR}ifc#ZcXv%CFsT?*>N^6r(%D?1YnU zAaT?UZGlOna6UXXs0m)3YDp}d%hb@)@Y!lK_A&D6{OPlNnj zYY*$b>vnRzL8=CDbQSi!DL3D!P^xhNtwrYByo?h-&OvQZYJ6ka{Re# zSc0ry_d(K$_Q2M{Y^O~DOK(szDOnMi_*h_Rx%eSRxA%n|FuC&=F=)B z_Qsgmj8g!GA+LZOX)gOW}vbo9|l8QW3iYw9qCD{o~xt^HIU>;dV5MJgc0#uHTA z80%Ee_r;G`GUjssm z*AhtwpW%Ly;X4Lq1Zq#ZpuwzrZE$sR087dN{w7PA6|Mo#6wwJP085K+h7+D>NyeX# zk|?MJ^Es)JtP-2eNr0EQe*ZM`&}OU zCD*uSSviE&p}uX|@1g_%|3*ra*MbBV#~cshdcFQ(dGLnTqaO-3{u==x1;Pp2im!#` zuZ2`ThfAmiSzb|4h`c4?^ZoGOF*oXYcV}(ge!v@^bse?daA`Ma+bSZLIg;pIN17vM zIOYfK=@s_Pj?~#lqnY2o?d1$MpoqsYQw%eX%X6Y4*^27{hMWGqILEMnVYUEMW#x7f zu^I*nzXQ@6HJ8n;26 zo^1+Ewi$fN$Unum1(FTb8I#cYgcGklwIExt#Mb(D=x~OTeZ^ubJ)S-ywfdZS?SRCq zDm=eU+CCWO@8S_m!W{alT)zj zZJbjxm5&No5xe_~Jw-i7`&G}=r)POGGfFq+c@kQbB#)ay`coj&C3- z(#&xV@Q3@VJd{qdH4g@4ZJi&mx9e@Io7@~(o5vTrkW>QEO1T-gmlTRHH+3)gcUC0P zk07rvDnf*7Y5J}8!>F_7D^Z3IoH^uGH}_a(ax{Q(IrvV$olf3WN&DY?uYZfvXI(;Vv&EAoQtfH;+4VI_a>yh*J+Cj!?h!QX?O`QXk@@G7AjloJe51Cw*rPXQ>#y?B^^ExRQFui zolmv*C5K|-p){rZiCNai^0H`1(Qr(Hz3v%7NnmriXu2tD>xsbN#*R3*wsZhRj6Lvb zn0Cu=qkC?*e4{NF_3=^bTb1f!g?@ryFH6Zw2tz%A zzz&o{w`dDv66!6Wk9w1-dglS#Sm{doxw&h5Z8&ONmlBBte{J)puaDzc!LC==rPRQK zQNH23?-rIo^MQdt3Tk!B@8l#}fxVtrlc8Y<>ORaVE($DKc{77qV^`+`%_DotrUD=8 z4}L7QnZi3RgUy*tteY-=$SqA2@IZWe(}mI`nzhAT{qC)my#rJsfoS*)xCXj!Tk6=3)cr@Jw#OcNqgS3pg7x|4!A$|w15X!huR*vB3q9Ya4 zF{xuzEQz{9YPl(gk`}Gffut%jotgqp$jZvzRO4EsExf~93vY~04AxH=lR>R3v3Qs2 zy$v4SN%ee@Kz#kDtARaQD`d!R%}#@T1=v8DAow*r>+0d1KS{ZtA~KMtgm)+$JHumW zw=;@qWk&MuG@LKx#K3@&WMw?r=jD2_)(*$LmkCm4_@};QZI|SPe8hIC6xqBy!LQyK z01_xmfNA9UlBU@Kzu7;zQYxHE>OCADA$gwaVqm`eN?XQF@NkrocB}lU4hcCf>wqir z>Ya=PcE!Xm#JG8v@G0lj&~)hScM}X57vGw3g<$^SUls53f|Bk>5FQwqE&{%u(f$!1 zl8+53vyYZ`mEEp&YT<=(krhKrw?~pS{N)?q{0qBR#2Y!w4!hWMdj`a(@A@r$zVB+u z06Hb@_9(cQ_AxbXI|-2w>#QUhp7k<+`z9+(jkh~v-Renr#C9U+&jL4vg6-E$f7@UU z(1fxB8{U2vq}h3rE!Z+n7=(>D&}@9~3mJ^R5}|WVG@!RSh3r{!>QHwg!t29YS&jiR ztyn_q*k9H0efZ7hO*b(WR|G!TDY`rol~Ob4&1OwdM8kbGj`^$~L5gdWYceWwL=PB{~NX=cu3p-{S;hqaE?bSHv$g+SA6bxy+VU3YVTPDj6CN zKLb_(9gM2Y#KW8ONxjH9To^Y)r?ql2cq8+WE438uIF$hjfdLs6-;!jv55jGcc3Ipg z;}aT32NAEGeU;J}&j5=+u`4?%xlwL7?NDn%2={4WS39yn3f;&r=|}5=M-Y2yrxeSw zv%*PmV{_{#Qk1sD>?M2KDapb~z3!E*-LPmCe9q86D%MGSe;4~~K-jKQxq6b^902_{ z%>4G>@Xqk8muR*|vGe5{@7sds2i|i;g}oMkd!o^0=HG+vcPrcN54A zLGv$PlTePRxp~-OSb_*aACO1qc{MpfS-fv(@UmRv%UO)cSt;ee@9(S)f>|~bwU@eZ z=kTS*sdjLclwMZG#?%U3)bq-uj?@@vj~6tq)ZS||Jxz`+di-M5SXM=h3EL`?pB>W9A;`V2vM)vk&%KFy|TAh#AQA zb_?J==3f@%LL{`vU$3Z@A2a9C3aC-YY43dR> pI7J0n@;b3~`)ubvsr|iU(l;L{A#E6J`}eC4usn-0uQEf&{2ws1m(ltoqJ#RmwV2==ic*rz7lOw=eaq=H~;_ux21)-Jpcgw zdj+hrf&W^f<%Qk9Zpqf#;q3n5{{POY;f!wmTR1An9(4&I0z1LNX50QSTV2M%4|y9c z#{ZQIVJKu~aY5?ZaZP*GIGqGs=e@q6o|EPhZB3CC?@LnORK8O@z{{<0KtSn5?#~OW zy=L;x8T&*%xqElS;s5~Pjk7d2bqIaA)xZbovnZd7eX17WNxx=w`p(8vulwUZ zl{so}MuRNJx5!8S5G;$o2?BApPHt+)!^#*Ww`?rcVE}mcyuY`X2o|uVUyI9o1t11O zemGWR?;aD#0$vJhiPhv~0iXS#iLq!>Qd$` zU{}<|Vb9Md>$4TMbL7C3GP#r;4Wc$}Z;^j;n}yc!E3d;`wry$!JkmJP0%(tIh!!TET8=+{rhUi^60G0t2HJSxXv-*DgC(HrJd8`|Dp3NvL5yg>xAvU zho|fEA~w^-HrW&H-JwkqNX2I-bEXBR&Uhp+y2^)1h1IIlNCzC!v-Mz@&z&VPz+cl1 z=f&f6Y*U~C`ixm4Sy1hl$hg(4%Dy;bq~k7d1<@K&%%NLT`L+A)-QXyKVswX?op90( zB#yeFEih@c{OXU8Oq~1CFI_38GXmns3(`;W(i+bslovCx4u7gvK>DrGOug*?G|1nz z_OR}|ZYS3pq-p?rS7G0qa`TM}r5XqDT4cV>%Qyk#9ES}`jc+Ww|DcbZrF6UG>CeXp zOVIV}K1e#z9@tu#?X)Ri=?zXMB`X3G-_I7FL-Zq`nbfWtX_EO1*!+U6pJW-_k&+vk zMd}THh}{(Ch_wPk(PI4vVB_KT76kGxVytLxpWg}&bHw`a3G#QzxV@ICNax&@hk3<_ zBh`Tq66G{-tCw$V{(y0v7l!tp20~@gdFXjzFbF#bJE7i>T4ux zQdrF3org^wFcnw$#bQMv@SfN3$Fuo7HnB_`2ZGB{ZqGr>%xP;2_!Q{=N-ZhU1c~^5 zdt=OO#wmcpkXJyCG?{{&n=R{Sn=Ytg;<09CH)l7TA&wkt{Q;>RrA2Ia6-QixEPLrU z%0)N$3Nh0?U825&v($Sz}0G_(!v&xSSAzje4{rup+^W@^}ByqOb95$E0sbwK*%#GP}!6`%*Z@L;&C z3^dE&>5%bWAXmP*X1 z_m}Pivs*u7@9i>qA!58fDCwj^M<1P(u^m;urVdlM@>aIf+E3-d9ZW>fc4cS7w5O3sCmKKn z+94A?VyfSBb9{}rEbCIYtXORJBCv__fnZ>?a}edaA%bP$jI?J^q0UKO!mduA8U!3b z0CJ_Js}NWQZoebapVUHP%pPOUm?1<)zd%`hzUM-Y6g1z|@@3G_kio?S0bcbjQuxJd>vU$Uyz(4*peEDSVc-G;O;% z9Y97%Tq}TRsH+oN%2u(oyC=W<9`e@&m;i;jC%L;sP(9RBDQnth3;ZMEQNFH3GEf0c zU<3RF!hNG-vCDooYFS^nPlFnv4(ElI1=vNcr42TF^uq67f{MoN>{f&>xA91r4pz5Zc&@P^i-9||`98v$Si!U@}ouZ88W zg;YL=OQ;4}UQtkpyd~lD{qWy0H|lwJXKmenz#E=*9kt$YX*X!wDk7ITlIUGWnj>a7 z<_GQR752@J)Y(U)ncu(dIit7P}oBq8x$FP85)&Nsw<#rOW z8U_x(1J)Zgm(8tZXU%+(yYcO+Z7#ZszPwa2`ygiMPayX9KondtFMRK!7x`9uWN;(f zfWW?8yOdj;GA3We0YAW92gWipn(d>zcbA+vZ_21BxF?-pfcW` zbqY??6ie(6M)p@6@WQ?Tl7 zoKrKEj|x~2yZehhMLkFRRnOC>XL&L+N;m0B{_OQ9gzzTYb!!Jct=bk?_hIpY9rOwY zMnr69R(?8EN52qR+k!~qnCYc-KmV&*d$&NY?t5cjR)V+ncMor=puTRoo?{5dH;@!* z<~RrV!+ljAN+;Qx2LraY&JWnz^|sYbZjP+Y;|pC#DuHUH+>F~x3PqTkx)=OAE0X9( z(AO6gp~AH^{nq+n)LHYDD8mQN?DDFcd!U&d4PaajzSD1~lXq3p{x=^vItrq3gD^4O z=hYS`?&C-0&KuAV>Jv}T?ba0IafL$~+bZ}p$9lwyyx=-uPN`Hpvv<)Ia>OWHa4+N4 z6zscrW$^XA32EJw^7hYtkRJr{Q8 zQ|*1pp_q6Mno|D6EX!kgSv0h0I3~ef_l%$DTFjL`0y16n%^dGNQn;2V82mqoIi9i{15vu zLq&(BTl9CInUjZlTIa>^!!HlMK3W8Sd_Ow0+E8IT?h$=55$^Z)$WYIuig=O;Lp_1Q z4wOT;XbWQ!>Mh`pdXuSo=KBba;wT!wK`Hf1Ueh04*%D7Kfj*#b~BNfvz zsbf?uiMm5-xhaQ|7Om2OrYbU>ngUM9%F5nU<65IFyu(`yZ;Vb1)=wCd!L2K?c$ezE z4IbS|^?Z>)eEp}ZfjwF)Waw?pPJ?{~*g%;efxO~Nx7dQGLWZ)cPQ*T!((W- zGm2?tM)K}7oG<0Xz<`ltWjxvE<$AH!4*R{A2~uYGr@m!vm*j+e#CE9^*}Oc#uihB| z5;#kMY2^8mrr80%*+02bDx6B{Jsch(d7kQGV7~iGTgFZBu$Pf`tNf`B2{|t7fGhIq zos0xF#l$bfxOtcGDd*MDbdKBaCKxgCEbr8JTNd_1bjWC{Ubgk z9~)9;A1&=FyIt$l!VBXfD~6VCk0fjO%QwLJ7k00RH*%I8cCqF542VzP^;`OU-_?=< zbV}OoQE)HqV`|)X5+WbgSxGWH>t+7-O;(l~Z+FJJ)sygu^+eF01#Suj+pnAcw!s>p z$-xF}c>7t9X6H$^V9hvT5H{jKv+=zzWHA0pgw8e5fZpm9vIphVq3%S4*N3%&jsY^Q zK%sSPuj=?d{ATs0o0y6#0w3%YT^@-_sTuTUwI(Q{;l3KjeAbVk#Wmi%PDxm`zoqQ~ z((<-}*FSP%5gt7uI3t1&75ne{@1^bpdW1;MMGNkSr~UAuDbB4+VQi|x(gdO^zin_) zncfs2hj8xdiiy)@vVkfkItLKvsGtJhrTb0T~tFl4Q3J!flauS==b& z6Bm!g%dDvlCf(St$kVofvH90|9yl-gmvRvcKS&Ye9DdoTK@2m}iSvC{3m%4E0 z@TJD7c1V?!URM7+t?f3)%{X(6JXg~A9TvGQyX6n(^Yt0NX;>vDPcr~mICPooLWA_` z<1A>FuXr|C)dtDr*PQt%Xs5WePWUB&gBj$zZ#BIY%?jDdpbSA-PV0`dGf^oa_Jp}Z zlrGV7oe`#B^+nPIQ`ZDJeJas=ru#=*YL#+n?Go}f33>1GsZ{TTy2bdBihj}mz*mp! zOzn%{WgLM=*CpiuKUs*GnHa{B$2siJqfNi|Z;|rH%stM*8b26kAMCYY&NHwPGtlYn z7UVx_^sgR$Z8x27foS63FCPt|gtcG_ zy#@C|!VQV~TY}G5e57qp?F4jRxqq~@h6^?-cvD>ySwVLl2m7=gERtEn>Fw_@ND%pO oiVC*mbz<%I+0K1Z`+LWvZ$3~$+A!Gm?^hpSc@||}WrmLVKLvuzv;Y7A diff --git a/form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css b/form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css deleted file mode 100644 index 11ede670..00000000 --- a/form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css +++ /dev/null @@ -1,572 +0,0 @@ -/* - * jQuery UI CSS Framework @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - -/* - * jQuery UI CSS Framework @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px - */ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* - * jQuery UI Resizable @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Resizable#theming - */ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* - * jQuery UI Selectable @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectable#theming - */ -.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } -/* - * jQuery UI Accordion @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Accordion#theming - */ -/* IE/Win - Fix animation bug - #4615 */ -.ui-accordion { width: 100%; } -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; }/* - * jQuery UI Autocomplete @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete#theming - */ -.ui-autocomplete { position: absolute; cursor: default; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* - * jQuery UI Menu @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} -/* - * jQuery UI Button @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Button#theming - */ -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } - -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } -/* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } - -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } - -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } - -/* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ -/* - * jQuery UI Dialog @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog#theming - */ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } -.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* - * jQuery UI Slider @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Slider#theming - */ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* - * jQuery UI Tabs @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs#theming - */ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } -/* - * jQuery UI Datepicker @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Datepicker#theming - */ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* - * jQuery UI Progressbar @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar#theming - */ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/form_elements/images/add_group.png b/form_elements/images/add_group.png deleted file mode 100755 index a45447d7d69cb4744ac60a6a42f3793a14e58971..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2575 zcmV+q3h?!bP)_;$dU7dkA*~W4Kn@TfX$ca6 zhltBVn}_m}B0!=@Jn#Y%FBAnt8$hM%1EQf^T(>C%*A`Cf+Hqpf*dC8P_FT@HbNjA) zZypj-sws|9vmUp!*8lgd{oi}9Pw+m(E)Ra|!ChS5=uEYu+LI0*>gB_zw06Oh`pcI( z>!;!%uwT49+>$GPSn)^d@WcoA(@pw&c5R#e)A8}?M>lUS>$g^~&@VEkDkIk{?z6xB zpBMl3**#5Od~5Uj^5qW;aAc;%w=aD+m}yRa?%<&hKlaEce^rk+Cy+>tvlwS*Vn6zW z&p&wY-aXBUE&1y1WcC58MAc_%)y9ubMb!sK{P3{J67o;%EE%uY_m5Ybzvm@I_2%nm zxNz+PHwPOOwge!Mdem97I96%=$Np;0E33)7mGyf`Pwf0Oc{;3(&wT0`FN{8!4U?J8 z)inYB(#+IPe(4Wa5B|jq6Q7w~>8*||t=%9q1-&w%v=$G6Dl<&dC4~Lismts&G{5Kh>FH7L#J^uAONJC#K3i{%KJx0m7>uzDM+}ad+*3$+;PJADaL0*p8{^<{!G(+rG0!S(Fr6PMPJT zgMk-T!(Try=XYd9-sK(f0KtUR>{LGYXrJ9WV3!WA?~tCGmfqcUAZ|U!!H<4~GsnO6 zSg$i^e)+3s=(RUlzId6eKfvJ_bh-!~OxzHA_U+}wiV||nI!7!O6VhW!dQ2;yx(=)o z>Kq96%{>7BwQzS^@Hc<-Gh+6>-<(~#aET(%D6^a*%RmUESD|!O`U6d(b~FNAc@x|L zYYOT}nnE!qHL;HH!bTgZF93*_zHoOP5JCWJE*&IUS!5J>`u3U-s4&K>PoOF-R2YMf z26o+kZL-q*X=`%7mSex`3?|Bzls-6 z;x%^=jLs5_%@MX{mQ;J??}ugf4J8yxNF*Q;SSfo2_D_b%W>0Ewi^~6b4`jpBgq08B zur1~5C&4L%!mE$tHKy?!+wn)HsEjnrpcegE8qd6@R$ks~t@&8RL5!qYsd8TCZ+vBK z;qw=>c5?KauWr$~qX)dm2Y5qy-m0_ybZI0itfQhPx;9FsS)<-m8&bvht2lry&E+^waomnCJQydS7>$D1&$9AV@7&2DpY;$U;z#6eU5x`D2b6Ew!Cjf7O| z;`rRZ{lf8km;UkRW_0xIqzcCB4#+ahpicu?lS0IOYliz;-s+6K_4*Vyi7gUXiP|+y5HcCBA?9S7l?KW3ldA2INPi<4)_%6T3PF-U{_>4%8 z)D~gimX8R*laZ813>0(9yYa-fdY079R)D8Z9An?F?AFOo^y}@%PelD=-wvi~m8^R@ zI%k!UjoyB4)aTLyxN=@Gy zavai$J#|w|YylV)L$E>^X>i(7$eh%q$hbv3cRwmnfS_I$^j5C(;;Q8z@|}FVvc|E> zD*JUG-;-G9a9E5jDQ!+^3o>UI3Q2;)S;iVt?ReJ%S|4TaqrXG<3m>@8*R|*OK3u;) z3PLeVhGgWN|Bl40@1i!=#ESxk>uvI02PdGf>bzdIIG(h)Mw7Xbh_Seih#IIcMh7vT zUnNjJ##*E)38mC+YhHa9U~KzStSnrge)#djUwrhZ=8l?e*M+AfNj4;R1#f;QBwd^& z?F~uVeexs+>7o1x>4iwoV<-d8nHGzQ;K!>SLSe8t5CS1JN{3v}hFnNHcv7emcUAxF z%SVqb4Bl!b^3P4}+}!=StRC5jC9!q%vK~p95a}Az_vNgHXA$!4_dp`4728?8yd9Gp zY?+|4KF$~}rh@CqB8?~q>u}D2bCf2dn|0|s%X*R8%-TqAWUIeBIWc`WuEx}M*HB^s z&-rLwr9Ipr&k7=4dIR^bYVbdnV;wXjAd zsNzYD)IL%RR+AN)Qx$9ylMM^9K}eY;80B+*Jzje_ySAJx}v>Mxz#yR{)mJl}t zx}hmcO?!Eh)rFhr$~Z5{`L9QdfBBiUAkI&0Y^0~#Wv(RF*zcXVo&kN&*j#aw8%0WD z5z3REl3o-LHDhjVtdN-q?>Kh^+i#TXcDCiK=fv1MjV)>$jl&c8U9XU-(tDc<=rawzeOSf``V zpO_CHf9U z3aKR4q^8WeNqgh=`qhQy&f>|ddH2K(Soz*38{RXv4kQI2K_F2|qdkqv6ocA7eJyGH z^NTlszw_Qz{~xhsCalUT6;Z*r9@=S?)%eb*u4!p|9UN~^9EPnSAhQpXpcdRFst&g0000bbVXQnWMOn=I%9HWVRU5xGB7bP zEigDOGB8vzGdeLcIy5;gFf}?bFtQH_&Hw-aC3HntbYx+4WjbwdWNBu305UKzHZ3tQ lEigG$F)}(cF*-0dEig4YFfdb|9jE{R002ovPDHLkV1h~Z;+p^f diff --git a/form_elements/images/add_user.png b/form_elements/images/add_user.png deleted file mode 100755 index 5172ecda668d5a9de06723903c1d932e77717cbe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2261 zcmV;`2rBo9P)UL?t|!pwWmAKA7l(+{7XYc)>D?2(*+krDZy2hR$?u=f3wjdw-t~Q>!Ml9g?o( z%X(OA@AdosduOdBScAF#?F{0UUcY&Kj~_)J&(dsXzti=zG@VvjJ(>>s4{0~wT%7&U zT3+{mCeD>mtbK;|(z3T>*A<_yZ5a8o{`Z_r(7QK;8qKMH@lGB^J<$Mt5X z4}I?~0jRSDz2Hu6{_GtLlHr}(-!XpgC-2x@y6UP6m~3=uEi4hYJ9uHJ!(#DrFN*Sw z1Bdn%>(^!d&cvDl4b5CVh>(v+k5 zYU$5L?xwf=)S3YF*@8l9Fm~he+)|iKO=GQP(CafylGAaaLz1CK))7E{+rjA_jO1Ti zvjS%Y7{mjN$;i?Uakq&zX7#p!&@MVCqrx)EFCd)&p&Yfjo{B84+4BU@2keXxvTq?e zU0gZnu!7Fl(NPs0l#p%?q0|YaV}K<`9aV91>(IG6I;x=k z$OaGo-x$po} z|2ja@>pv8gi%aDVqlBdr()E$rL%KeWukb^G=ZhzbWi{^wYrp-P6c{E6%O_rXCh7Ek zWsO0(E>bCw5+M{)3ZxK|z)!m!V}Jjx`uPQDE&ha3{nE5KfAW!)H|F9rNibQ8H7UlV z$TXpS^uWVnMI0J*x^JmCoZ~0_k6Dv}Wuez>#lBI#TZ+&OsrY^3*I%G+wjQf)%{B_OL{agmx_0F^>avT%?SM~{LN`kjvAV^4i>^tri-QqweTDJ+Q(jom!h zv+la7=5Qtb-1aZMHGo3p)7WgFlpAiB+PTpwZoET#VJNjjUutHT!5EKVbO*z3`!2gQ zRn8ifOK%$AyQ|%AnTWisIJKjHTHLqST6<#63WT}4$c8NsA$BP*`UFzngwz{^@`PI& zB`B8>O0TwLYe||b4Ey~p(v7}4JC)iSufI(6+cBcAIWj!l+PCzmsyJt!kf#AW|2C5N zIpG$f-9fJY1(TW^heKNyQX`a$$x;U04o)slpAbH8fj&Dxv3575u`zn>&DURj?PU*+U%qYAUnUw%AD$)4R(rqH9yZJ9o?Ikp zbx~R|h~rbm3kcT(#u&pt7aXO?WU&J$*sZmXRjIC^W;7M_|7VTP%eJ4 zT1+!{{fXlp+z7@l8Y3v=5!xlQ4uhd0P6Wm}P&rKQn%^)|@hJyo0v)1Ic!V_jP1^k? z$~cUc#<<~@QeDY+ebZAej&iZ7W#ZW1?)%8ad!L+HY^(w(FNejhQ(?I*yb{9G)ZVs^ zsFcSd8K#gVmf_GKrDjD9n4FnJwo{@gPu|T_aEb&nL}n5)fva3*yBRq@N9aaK0a_{g z! zR?m?xDwTT7-58gK6(Vx03dGCDiB}p8V8Jbn){KyxoM|J2Dy}D2mtFw~5F$gy6y!`SpCLg>o8KmM7bH(9*R42PSQ6I99@YQhT~gb=47ELj#J2A2@PDFA^n8SVDt z1XAF-F0SLzO54rW^ul+uBO899CT?AdlMk@Mr+AeH@Yt%V|1)*~18j|;Qd4eyJR04( ztF&pyrKJsTyC5jns@f0pQaPTGN`sJKGiyz1(zF+M+AG8Hd)HUr_xieKf1YZgO8ap4 zwf&DDye?N}rt`yd&H{7FAML`?ZZ=@5HTBrO)>Pm%)Mdr|$j*FzWJ})7*COrZTV)pBtQTF03~!qSaf7zbY(hYa%Ew3WdJfTF)%GK zI4v-E&+X?L671|4;A*62z|05~(g9+i(Eo-Y9KRk#1?d)^-5Z{DxfD7Dh9nqDDkS*0MoX=zk=a^$|81fKdxOGt ziAQbDlABajw1l7rF(Dgd#<9ytS^JdZi3w+>gz2-jCd=@Bk@WlM>6AEQb%D$Wt}~nW z${bsv%@p}o{10REVSb~PDN^(Ivp|hvMm7rQwY%Z|z>j*{aCHV(8MI zC?mMat!cwWdFG^`*w41|1{OL}{U??bS^B{I#)52)5y!3~b#1TbDIy;vKKnHCsFfW~ zh)D{W(%Q09E+f)O^ZY3X0cN?EHu8tnz~%%^f*He#Yz)vj3Wp|Gia#!SzUS6F1Ignu z4;1yBw#_{izGjgj4;!~gapLX`rr)PBHX3Z;?A$#+SJMk-4jZyLK7v|buPQc@5^a*iz-@+4#zvk`yW!eS76vIh_+fCUIr^pFoC z8NFN=6>ETq&5O)I{A!CHpWj7(jf#9slq&y&fdL3XoGaW`xBPw%IHCd6{fkVfd68v7 z6!iC=H)VhUFfALjRbn*KwThk_olw~=ORL1xRNL2Ng!ZAuM(5X=PXaNF&Z{@kt;@*Z z+i!6=gHLf7$X0?0tNE+oF5(~9NWVF!N-_Lf=D9<8szs8rM{b%HYkhyC+TBPFBN!cu z{l-F|oIsJN^cWWrSbac})M5)To({mhko}<5JcxUc$n&ydCy4a`6R_dA{H1t;6c@mU z8yx3J0svj7KEAM~1!T>}QqTi}sL4VJ<4@BDXfOal_+Tv@A?sjCnqZunAm)Z3F|W^z z!(m!qzli7oWR*hIe#-H1g}&3mX00HrlchWeGbjpI6v57iB*_l5Qjxv> z>fUYEjq3i;jj={Y9?{K|9A~KXIZp)o9QLFbUK2MZ50TqrI*;q^H?IgS=;cID+*o{!Hb@T{m$p};_cdD_toO{cSAcSuXxL{@EutGdFb<7@F?u88kE2n*+*WbTWzDit&e3#KA$#XRamJyvs~Fco15}H zMF5;Dhys@gYT8`5fTC%`#|Bp5&e2W|u99jKscRAn;uiPtULdltWjf{8WJj*QqSy^03wd!`uXur;d&SmkR;vVfEYOUpwdj`9TJ3JGM zh4cAh1%>6*S?q}UGEWUh`OMto{LF%Og-7^91;&tZ!sl+|$WBL?o6iQyYbvQ4vV>1kN>n(FRg={7G`4j%B={slyWr`=Lv zg}WaFT&roSYc07g<+cpA{7`-7o;gH)of4ap zlD|c@)wSI|h3;eEH82u32@^yd&4BD$>|N}h+uhiS)^*n5)N$AG9;h9x9SY65&-vGR zR*hAZ*9NX+t%ByWJF-Vsh2Ok>lWkVJKC(N!`+#__=9vEA5_bOd-}jFKN07=i*|fiq zS}}hY59b6iVF*ccQUgoVfm36bg=<$s{z7D#{Ch?uWf{BSaLcD<+n<)83mFUJQJwkL+lslVrkYthmhGSUV z?(NKv)x496lf9EdGGa1SW(c!>3?Va#Vq3&%1ZSiV2x(g8;^13j<0k9oe>P9EoOGJB zq}M!SQTcw&ZH>jb^xwwS&Q;S@rFQ_TZj?^RNrgkDL1Ni2VChbk(2dHROQccDJ==J7 zLf+I=ZLPEW#}_S`C}XaO%o=8xPX9B9XOh(35p`d~dKlJR{ux)jaq&LY`u1jU3%;r| zHuY_a?1?6n)jOFgsZQ+B-pBgp;Vj~N()R*26-(1C=i)H%$GMpN%=pA<=IR8>0Uzo{ z?ztvw9R`;2A;qd~t9s5Eg5(@kShivA!BBF%b~=hj7;FBJCDRe-J{w+ z%Idu`oNSwN+WnR9Kh%%O>OSiao$;96O9*mGoGV?Su$ z8s8aTImxbRTPS-YoOtLcs)UVO3d*|G?n^Y%|fmh~?BG^=_9&M?oqdOCJ2Z9T6} z`R1SJFM6BtR}twEFmzwnrcqdycZ3MoeOSUG!-MR7+}kJFW8kutrh^l8g_9G1ydAx4 z{;QbU+p3;c5ZmRX=Y2JM8L_-9N$!?+&v9wJPEsIsAkqubUHA^>bzrbpw%@gnvON@) zy!G-;^_{O|v=3Ye{Bt6It~?TFQD|LApsAiVDkb5e=wZ2GH#qxn5qd~6+LO^dOSUxO zFS&EqL-;^F>h9y2(YE9KubZ`AwU5`8x8BgXZE|6A%Kd=7Ff-a+%v0FNy>ZTGn6QldPwb=7zMkNU&N>-w#Qy+(=4i$$>~o<7Ilj))hB8ZJ)*M(_XOy=Ek5q>_UA z>ipBYbRHQ?kP<$JTxJ}g4)=Y?uQz1cD;}?u}^v}SF7*KjhYqB-r#*2G}5@!y-~THen1L*s{auhB@qyJZFy(^ zPwdbWZ^?DpGvMnrNF?Jn=C1NIZnLm%OeT|2!(2n{?ip4R>WUz#aF)d2t> zG!+X91^})f(Q+36a0dYZd&U3&BnbeZc8oRZQAGE}HC25h4|x3V$!aY`(@?+@CnbGX z0D$n>e+2`Ol1B62M-L|%E42Jy5(}VI===Zx(2y$2%jkH`9i}V0&MPJK1t!llL`Jd< zLG`QVrl*n7MMLt#;i*G@84tw%DMQ0Wigw5|-!#BW3wmK%<7AEVdZ zKBt+`yqK?hk7@lb2*bP(!3T$$Eu;zAjcQZjuLn}UNsK*1K$>>W`&!tuc2r4Ue9r0Hx&CcC(NuVk^@7Gh`q61 zF4a9Sm|oJThc*^hA|e@FdZ3LVD$@H|+)->RyViChQ|8mtjT)dkHw4I*LY0KBe*X)R z9~-I}ds!`{us>0|qi}pJ@j1 z*v>oJ3t*7=P){%H!7b|6iO;}i%ra-wCnytr`1DpGEpFFMkb&Q3G9Yb-fs}Br(7qq>5XBK?m z&2Z?EYMF~6Tk(#QDP-f}C|aXX-Md6hC{gwB+Qb0&zn=-(KJ;6Vkg?h>b)0h#3TW4? zp6#x)uWF?4F~uNN0`9n@78aMC-Tl?G^^9#xzQbq;&#ls57Lsv>2x5qrpoZE2DE`?x z`?*7*`%ff`;9`46Gkq$KAD_y9l-Zi2^woy4mh2{f3GaF|!G|abLdBtR&j=M62scjn zh*WS^Uj|8` zb{6#1!$#2HQ0QDS7=!epO(5bmcdH7}Lpv|2Qq7i#@PGGEE(9%ok^Qnuf9 zECHaSml*5PUUw%FRcq7gsNs5kj>{!$it1+Z87^n7B(MU@cj zhK%ri@0}(1F-FFAeXbUVX%f|lZrtVZGQy#@=&y}=^=$mjlYt?dTziAizrV~&C$B-? z8R6?94P}w=SUaZhg8i%llD-L7-k%1V*-8mZJ3~49kPja$nih#iEF(P%Rr3w9p*&_Z zy>rqU!GFulOZnMvEu$j$oA8R$sY=p){6`|0>A2VQuP<-20_gQ^q-Do zEy7T%Hz}66oui|~p|U2dse$P)%k95r6viPS$4xw)0gPcLS#(X09|fP7l5;%kTdg?Y ze`2|i_5!bIiUp0+k4RW;N?Jw+6qs0SkF5BuW@nUuAiVXQAKwxG8MxN%ZeE&-}KWN~N<;zQjmh|I(!})b#dpcv*^NH{a{N zIN_OFXLB_J^DIKriIlxz%FLX9R>$Kr34g(a-TLW=XZwRn^{hOiCcKeD=5^+_x3cSw z(|5*0JAO>hhS;$>d!I#~LyvHel1)4=Tr9(}VA{_B3<_0+=uhpvpr-+Mt9S+@e}~Cz z7vX4!^VZ0XCgiqROw!QEwIZ;ilNwJB(ZxJtu82R-m6pIIVRkMc>4}SGT6kv0xyliT z5U=R)^`-{7P#%1hm%W{81j{%oD@UWmx;#U(?HXQ}`(omn|E3uq8{j`A)zRDfnK6EuMhq@{-?)&Xwq*jeC%~sTT&g;AYtq&R7*B=6KfmTv$*&o zL%TcJWW{9WD7^Q3t?2INdHEC0c!FtzD8<%JsmI&EhUR9h4*t^0rpXgLaoP@)5M)3@ zSA{7bz%rs3{CIou;o|aAR9w6pJQCBmL9+aPYjnlu~ns7l5@Gj~L#q-!W67RLvMn;Gn zm)r8EZJ6@uwTTgftRLbTdM5ZH*TS5Dtmz(!$8ERKt<=0C;^MF3MuuBUWzv|9ieI|E zjoz9O8HiH!6dw~VIlZPA6BC=M>+)QF>S1AzFBW}a^({aIcn^IYx#BDS{?!A$;CCj#vfM%q*4Uv{oWwlaqC7jrS7}?eh9ZninF8+-Ke}%n}bdIah{}e zTm@>&5Fc#G7R#4H^XGR@egygr9Ue-^lD@88%`MmF>PrRh4h-j29%o5w7}b$+@YV|p z*L+YXzPR-MXX?mtU1^EJo>9REXJ?NXw`~KTBFvi&6oj8@XlOQyOZ9osyM0tmm^;BI z=i5%$9Qk!-4HUz`S{n@G95<9}DpR)WTU{(aZfI;>JvsR)+ZIxiCi)y7`b>$*%m`l- z$f5;IoaJ{hwG9;TM#)Om#W+qOV)u%+6qJ1%}x&6S;^tswZ=(VZV>le&PfBYV!4@pVgSFBcy?n0ar@Z6B|8Cs)HXC3_T5FL*ZT= zYU9i6EbJu9rVI!wJ-*>G%g?evRf zNoVAuL{mCL;`{cA<8xBkE5Z?_zl1r1@96uTgC2Q;iBL+mhK(IaNLSYxIBbmBVs(te zTFBtchn<2zL2HR)QP5Cx;kw2|WY;@D+dQxGUJnLDEeiu>Ocqyc@$JHma8jk z`Itm5G*-7-fz2#t$g(dX8{3|+UVy-lV&|m#&*dO%%}x}5oJ%A9eSj37pD=GfCyT=B zj+&wAr&u#44I2qf6Fs)gNh$!6QSxP8o(`vpg#egNeJ>a{)D!~&dTZ)Z`c}uZ%RX75 znkt4n^}dROo2a5}|Fxsou_{g551I(L3zsasyMe_*6+bY$9v*wDi)Kte?8O=e<&a=f zaweQvHC%0BSnb>tow^Hct2Kq<*O8hmq&n_`GkIAk8N7^a5m1Ee@ z8jEP+Pz*0+jC8r984Uz_)qV<;bB8tM83Ii%o~A^x1>ZvQP00}a&pK6`s7ArwG@)#i z-3nf38|3u%8=R|uvVEC#Z8Hir@+ra`v=%r`_L?%&i1iXalRgv$of&29Ea>%b4y4eg zjNqR8q^tGjXmPy~w1=C}S`mk$y8pbUj|1F%#HLF~e-8%$*8}mGjvn|dRb(XJXTe8I znu+gaNYn*-6~C-_`s7nsH(?9%TsLKF7wZnVHG`kKA2}RzBz#Ls5X5ki?sSWlkK}wi zrWpC@*E2bLq-K-q!@z9#J|;Xoo)1VtsAMv}?}-6=YJ0!{WF;66vy7BR1uOG;I7%k= zRq=!OF40UmW^5CyYxKXQjrJ0w4O97k3Ia!=otKIJ zOt7SXeI$I2L*4REc@(2LX)Y7wf!!z`y3?eXugi)Uc_SAptN2)SZrD~R|Q7!DV8RF2LOs<$nz~vWq?wz#MYsx`iQ{&tX#r!2z}c_!_90nhB^bQ?FVdKG6kUlFq3q|sQVP;WbFQ&*Xe(P-ze zrah zz%JmiH}NG!KneyAtXL(NS^6-Caff|D%i~r)(^Nvi^O3jrZizvm!qfS8W^JL+PectHk^+Gmg-sztq%Zf>r)e$(wPX+ zNdvR&tDpGlaw`6^Rezv#g(5h}wH)1)f|#-G-AlYPUw^}~o^c}V2TR`Sjs-n#ABGgX zjjX%7JBf_#a1`bYHHLr>x8D(gBbL=M+a=;?gGK(p9-$H1+%wLeH7In+@wulF4dk0vJ}395<0I_0cd zO!iVf^BJyN#@NHpqse`D=L3wCg39LRNDKW+o(To78qWN+ffT&{y!!VD@TXQEg+{}z zvom;Pr0d=YBplC3i|2jsRu!zvZL$&HZ``!V_=$ZDhj>MGmz>*V5g#{e5po|5hZA^? zAy0LE{Tsd%}VxQUr)Jy9mJjPxD1Td9vh)J+j#I1)hlH%UJW|O9Z zu8E@KsW`<&qphmu=B~(AiK=8fI|d|w%S=(wV@p(Kz1g*220FR)O(p-&?k;dS@KVCp z*O#8*Ma+n~Y211t(LAR(HJ+-rj^AIUtG1#k0;U~zv4y3ji9-({6+tdF|G~LIJT+_* zO@y2+R&0NvmH#u(!=rb4n)34UvPDvIt0$8BVNW7Ij7c%mbldo@2gV%wZNqS@VgKRn znuw6FFk@qTyBxxen3x#No;$%Ke8r1!=|E{s2R8NB+A1*v=3b~RqG_9WG}&x>T*Y&6 zbQF=4EcnU0!peddGIqb{arfA8@Lgp450>$`HMpUzsX%z=Eilph+9lJpQskek+CFk^ z6+y(1^L|&)Fq!lVIx5T7S~)$9MKATy@sTJ*a?3a{kc*E0>cOjl=R`r%;arNFITyMA z4{dgReZ5{m&%`Q|m{{|(*Z13p$ZCyQeW4t1eV-~&4Y9Ga^VOwsc%WV5YPXQFvGKY; zRjS3Lq(*R+!Ou%3j2Y9k;a$5C!=e&*f7qFL&*2EsF)wfB$JE0)A>PZ&fo&HvfAtUA zpTZ^XHY_LkEjC?}{Upb3FONl~q_!O&Z-t|yqrKd(Y{2Ze-~tK4lgn=bMZR_q^5Zu3 z4Gj$|4-e6HLPM#@H_Qn3(f|ovAw0XU$u+|QZXdTJdE012l>)pk6H-&@mi(?+YYp5_ z3ryM)x0`Z*pP^}?2Yp#tSwl+;cK(cSW8Y9~qB(zZEyvqxugVEmr@4#enwxJuYvVG| z)q{iY?T`14Ek5Vpa*^ftnT6U9Ke>9m9NvTIu@;t>oqc>1b7!+!YI{06so^U5dI+?9lI4Tpx6^Ew>6X-xlLqp@r%eRZM{VsO#aFMJ5)K*ZxeC+J(+=)g>Q<5p6^X#jTaeRl&DiMBDC8Rew!$78Vxz-Hy~B9JgKxVRANF^xf?TzPnSuboga>5Csd z>OHMJo6|BgoPAw`<14*T;lfjO_4hq6!i!Z=rPDbi8~6O`I~p8geX2fmkU3;AIyNRM zC7K`LIo9FfWS5%0_yUd8-hj@hTl4mg@%uwd)m##)0g}%3r=IR|DIe^#(z=`CLtjyp0=S0<0I%UEIqLQcFCz`JFt@^XejkgKU*uw zDTGVgaS~pm*4qoI7B!9nitPhz)9no|1u}k(X`VJK4<)E;Z|Rz>K<1J?=o0hU(X^u4 zZkF2kqrEapbO?QtmqQXIJZ1~=U4D_b0Hrlvr}kNDK1;GNs;jBlpJMT%WV17vtvT(( z7A3mL8_rW0EQsf2-qgf7t>%vtda?ntfXxk*Ork4)N51!E_2FJuCwKegdFhHJ!ut5( z1RW^rf>f;w;Fr5uwUp{M_gaf&4=&kal8IEzjVg;D63-=6xqY-d46J6&W(Hv6RsyiD z!;N>a-Jn2oRV+$F)tjRlABGaU7h?w6V)yAVXjZ(CEZxz?5fN^%PxIn~3@~0fH%>X3 zxCG>b9vGVOS3pobE?r|=xPuAjXX1r5(nb)HPFw(cUjC`|mz|^IF$r#P3v_)xkXztv z80r>#q>sErr(?MhW28@{cbkql@*Uc)w^CK->%_Y60qdAGF8zP1xJ>jDjzpqOXu|3^ z*3pUHRM={d=@4{b2jrOk15TC$hY}mF2RBd3AqKC=lhwjp8e1yN&wM24t)dw{83LA_ z>FwqfJ>`EE>~!U;~!sTmn=cNl3so|f3`9_Cz%BD2}W|2pr^jl~=#U@mrD zzR1NmA47|msKWXxTHIhr@X1i&+L{wRCIuOw8E&F~*_9YS*Vb>XV?xsObtfeV(CDTx zr|O(x;-m0u^l4w*fbB>mWEmf4KVg)6*Mh<=k%|(|CFi-+<${0)#J%Ao& zoLzUh2688om^lH8jqxdM@^)q?gbbjlrHn7ixWp(!VlIxO_-j!L!H>CnVvXaX<;($G z=cz%Wx~T9|Gvf<_6^u1-mbKW2#m}_l$VI%#`@UVQB_Eq-RYX}sP|HvnFI!GE28nMP z=5aE1s5HLOIR0;%PP~yiP^QPNyzx3Te45w}go8998q06iVO_v=$R+#x^gb0OLd}{%Qbc~&vKZ94xazx(1qqRb+0z<0G*5A!x%1j#sGeWWruYVt*reW z+Oz_pl5BN{inh1FD}#lvVeGpr?cS4@HnUgCyuVuic-M}9Jd8ZPiEsV_N3;TOA~cmp zK$uVXCYI?PH5GO5lPllo;M|X}o9P__M5eNMPYq@9lr(scAS>gYxPVssR#K})E7>9k zQ+z9LI>u7xae*9y9eJq)`w=s&0aGXP?qb?I9I9j{-mIxz5v1*)@nsBAIAl1KI)sIw zj$guyAjX`xPO-rWScGaxE@wgJTg#%$i1rd!QCs(vK&7t6i&?T!V(&haV8H5c7!XL>!T7M684!nJC>Obu6X9 z{*?Vlst>t?ho*?5zcW?+gLi$f{D8upX)3eVxu{Zqe6F&7BL5Bh8%e2rX_8c_^j+6I zU+Bwg&-y#(u|6-oJ^hpo1~L|vG!-3Bu>Gul5Zt#Ca(+{%F)D!t6D3f12aWaIEBKZa<<%? zLsK7ujJz~*^8es+3cqTeVNWZ_x@}V)x7wnckulD-H#S~4&nE{{DZ3WCL0pQZrrpLp z5MRWcWX>)#6JUBv}z&ghlk*+ zokX0}2@eV3q;L`?=^3j5?On7ct2C>uh;E8yw|{q5%Gi73J2y*BOI=G#M~kcR)vcjL z0sT^oQe((Lr1a3nIMn@%hp#)k`(JnYn&z5|H6k@)YX)nJ>oOAolMyvRRs9v^)lu`g z3(%>&ro7$-S?xR8dG^&yy{kQ|r$hG*ys}PxV|OoaJ-3qFfK_I~Ge=?73K716J}C;a zF#7tmT7l1N-gPaGel4}QY4it;``lwJA8uOC)yvo4ntoY(LiAk9-iZ7W;Zk^Lu+=k} ze!`{2MgFRRs{z0HARfQhL)?|xVGbS*R^F1>V+t7wp$oMLEehe@j$E++!@n<2Af+s~ zTeK@Ip${n!SdRjakO#fHrQ2a^UO#gd=jK(|=b0-6<_&nnp+ep!^Vb`>Y&y!9U-bp1 zH@F9CGw=&Z6yILatuU)ltQEOHmwvrU{^tVcko=&$NFGBM{S4<{p&mu|d*iPb3N|Y? ziJL`?R~YsAVf+tX)AG}6HO6np-$sW*$Lv1%dWL;;^@saM>`X!C(zerP&FjYEqDx))UgJRhkQroITd3^=EYuma8)k$g^D-(6F;JSZr>6 z6>Y5c!d5sw=OaJTwBxGhRb{r2_?o!bHm*hAE!!$>-;izN1nn*YcEPlNIANIa(p`jL zNIGj;jl#M|sLS8eo%rWz&kGIooa_ibC9zUgldo|($*Cj!_!O4TP_{ae$yHuyNRX z^&Kvv`%CJ&)l1>K4`&;{1#2!OJWeLNL;wD5nV!wA$>RvMkmlbb;-ynGyEOM%_sTDs z4;dFA1jIh$M|DxYgS^{XsC@Qshq)$II^c(nSez?&nb3Ouz^HNl3BMq(rda|z{!KzeL4^EK z_NdlaU}X16O`}oKhk}iv$ko$X3Pvgz(Tez+p2#Karpke(Yk9_W#p9f(j~Ic}pp zW$OzF4a#m@@!4t>{G|U~%uno-rBCDF^snK7wVOpbF9Q^UWNiZKCPRC7A6oSHWSfjB zmFF}pge`qDJng;ni7-v9Q`+B~QMeQo`X^!I%1n3d{&r;F$rjZeZYFM46-1cnmifL< zZ-0u4>@I9SdyTaIJCy10r`p$wvqP1tvn`+8&08d7TW+)MN#fFv_(x|8Zv6x$j$qL+ zWo5(;`mdORwfUEWh5O|;^;-7YRMuTKM#umB)jJwF9h0>F^y=vgrAW-7)3L{v!g>(Z ztlwNvWZWTCF8k>9apgAVS5ZyBS`N37gOS1URf;syv7o)=+w)+_W3PiS1R(T0ilJfv zI6OP&DgXgc0Eo5#z|sI<^GdR5(>kA}wA0ttIOq8}RIiUZ$0cu_2Yvw1Uj0{O;7umv z-^W02HRp5wH^c(V_OccLD1>x1)J)~N%`k>;mS!L}$FIL`zb{MIQv#FT`F(hB#elhh zosmwc^S0ZV(^dCjGd2VRBa7_C<}&80L?>Ps#wVYtHQ7YjqvIK@bP}4w$E6I3!%~vz zb)7v*`%ATPX2)cIT3Wh~Xi)d9vs!&EKSUlsQoD6@y`R)rzdcKJ2chTB?6aG{pVJvU z%hCA9rat`F%n^bbRz_K>QuY>9IPfO-{V3y35gis)+&XSr>i1 znXjTlRT`0!we;~cOx9?Sgu-3U&F=_Cq*cC-PQ;<9k(gC>8TRXxN^S9L&I%z34?jG! z#!(MS(W%q%n3C7Re=Oai$$o*^MGD%kism=!^ZuT%l`;FCx1#57=Pk*ExdDnHkX;W^ z!{<;5n8ADL3=50PiVqxe%@=_Br@tRxU$0+hSva)%V?B`Z8((TSu4w}MLR{mX1|(MJ)-`VK zB4eQ+E>c3tdY9?xmqNG@dPYV@tNqJ9R%42kkfzM+%mk-=-K0W;yLa=4CkzRM+1C9q zGMDS0Itji94a)62Toi*}xs=_-L`7??zO$r!G}hzAwN?qcPf=3nGA%htIN;@9X7uJ- zpW$hFK)tE3kr2+Bfx0`;-G1syjR!wYz|bT~fXqG)lcu8$9zj;8c0(hUytqfa`|A_= z@aG>$&|lNs-{FzJBh22{@f<(`Dh?Gnzff^gaY-0d4kjTl0+ohAp&zZ0BmZOY@Nz&p Xh5Ua*8^r+f+yHbnjWj;MZKMAK^>zGv diff --git a/form_elements/images/editdelete.png b/form_elements/images/editdelete.png deleted file mode 100755 index 33fef2261eb9d98eecdb2adad0e75a7d196d7801..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2975 zcmV;Q3t;q#P)Db|r8ukAP=goh*lrvzGqz_u9?$+}-kZ1G^_;^W zo{*H55OJjY&%M(3``z=M<@*HhaqO+YqK~+Ho>EuJ`V0(MPzJ0NS~1Mm1lP}JSzec- z9*^H!T=8xnM{k2K{U^+3@cTo4x@?OFiiP|gx$fRgnM$Q(XR|IKk~mJ|dcE0RuFkYt zjo0f@^3psU*{i7jN*VsX{{Im8st2nQduznqeZIH1Z+PV1p53>WiZ{O>cVGaS&mn9Z z0HZV}3`mx$w69!Y`G;r1`8Us=T3B9r?z-fk`%_jQTMt)e-h;q_ZrD+SwxoBxWgXZ& zJp5am@4c_9Yu7HM?}OH$4HyF$5NjcX04YIQ7^P@WOfY@;m1y$J=|eN^;PFQkXMeu{ zf8Kl-fnV*14=+MPuw}^4es#y5Js;n4*Im-d`j8|)3YGH4gSheDtckrP<2Yzw;q)oa zz5Md|tBZ@D{ZyKH^~qew7u!EUV1GAkYe1mcyeaSh&8_#|_u-AZb|JzD()0$zk|dr> z&5|s~F)gJ~#^6hfvg6PrE&L>fcx?qr3BFHlc9z#)JT!G_cJ@=FM!tI3(>&Gw9|B*= zLOZ3rCF4E&Ge7&GPmGM-1oirjDVLHk<8djCcw=sc$=MlIYcyI>nzofO%CcLHx#WIe-{3-$)~sP z*zxd|b$xJg43Y?Jhm}%+*JdU;efd&QUs*XBB*{yO;*2&_F(d{&DcKy?>-UWGRDLP` z*aP{@;qSqT0ey?rX2Xg$q!t zVLBazQZP5qhW>uG4Gn#K@$#i#9MbY@znRxq2Mh3x7;$^X`or5twtl34b^$dxiD}e{ z3O+~E7H?dhI6fPuzx(e2-^@Ytn1QLa)XjAP0k+rUJet|D;|WJ*eEaALSXh8g2PFk& zxr$h>B32vt-QCu7v)+F?PQG2S=t#>59+V9C=8F#wuC}R-UuLG+W*N!FjK#TY*UnGH z=D>5k99d_h52?3T@LV_O4z}In?6bCwJQ?P^!t%9?Ea@gyD`0VS6IXuWA+BdVs?9dl zxjFK)3k>B8Ka~^QQ`BHfY2!F*PhT#-sWUszgi<5|x_i4BYbXl@REweW{7ICboELG|2?Q%1g z{McV<{Z0D|jfAHv{+^;1@=CkS6#*IBMz}D$+&nR^`PMJ{@DH80;p0896k+E});_DZ z`(P&x^6|nF+8DGksA7eqtxz2wJMoW}?N_Hf`I&6al`09S#xa9Yg6}xDekhFk?aw$A zY|FmML@^UeF(aVYb;(2>R$}$?cZbCCJu~LN;YWJlYK+~Lllv$Y4tCNcAFQlxR|7g% z=?K0|~_T5iTxL&^}Bxp@OO7JXuy+gD`DnZFe*{ck!8t4GVwrIy; zyP-Mx*pi{XmiKS}Oq!2^4j6+lARLbi*yiL)0rBluZ?Jo{U3K^YZ8I2<#Yugx&SqPFt(=q$+_85Pr30K$Pd$Vxd6%1p3uD{&X zTbf_N2pAL+*L7$F;X-P-Dn;H^aTFcDmZo}rKF0T`FxOdhDi$>eSL@A#0U6bin0 zZ1c$QZ;!@U$<=8xz}Bo!)6a0Mxq7i~%u~y-VhuxA*iE`Z^)8Qb?`I zBnD3kN?S)5>Kio8rIl}-Xe0+l9A=)V!>P4H>R}6fgSFY>mi~hC<>8U7k8BqiS6&#$ z(waWorl(xwl~z+tC-KwY)qJNLj5VoXqXTuDIV)DBwl;fq7mKpc>7X!3z*Umsrfsx` zM|rc+s;VDus+a_A7vZQa^j<%H8g*>9WOkkl> zVQOg8v{Y(@!MC#6E-#bw+*qNm&l1;H(SVPjQY>)F^Y~7^c5POtpT5iH#ji(jK6yt? zczXtROIS4QE@|=19bJ{%9&}xt#U*NKN+2O)pi2t!eiqr?g((&gQX-NRT5Xc$6&me; z)wP&;+r}#vIga38S8EHi=s$Wx^SAwi^w`>>wcZk#Nx`$=rI5MJE^k(YVB4Z$<6u`= zY_KHdG^J=;fmRjr<17JU71$i#>PSCSuR zy?b+-fiZ))-=eRexjS#Tzbx&Ym8`$M=w|X6*R_R|#Br?at!7w@f@;I)iw(hRtCCly zHDhH#axDDc8Sg6a*6=Kd6zt64uajbZPRcDVY_JSjj3(74jbSkmOw|lm&m`2!60?;2 z-?9G-#=~GBX%PNY0000bbVXQnWMOn=I%9HWVRU5xGB7bPEigDOF*sB*Fgh_gIx#mb zFf}?bFtZX1-T(jqC3HntbYx+4WjbwdWNBu305UKzHZ3tQEigG$F)}(aIXW^jEig4Y VFfgu9$MXOH002ovPDHLkV1hKxqQC$E diff --git a/form_elements/images/groupevent.png b/form_elements/images/groupevent.png deleted file mode 100755 index 481304a66a16f914f5ffca977109430fc9944884..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2409 zcmV-v36}PWP)ZH!!18OQ(UoO|xu%)NJZW_P;XZo7SNX(=sL0=0^OHi%M6kZOX&2odQA z&}gifs9?bGfoP-!_WaKx?!Hou){`Ne~)b&O16bX{Gu^(1_l!pZAbv>i~)AvcOQ6fFDLu=e{TE3 z4_|$7aIi}Pk*t4j%XYr*@gv;wPrUl%Jda(9FGJx{ z4dmu5pH}_q<=6c2Tz>JE_gee2Z?4&RdVpJk04p|Zz>&uu`%33!mu*_~`s;pl^eE1` z@IrK~SaIdGaqIrITiLb=R`{$EiW#;E%Qa!U9FAlD{R{%4Nme*MkiH;f%G z^<&YpxmdSk{grPXfBjoGf8x8pz2)=YM|-pUAmY-eeB6 zcHymo0mP(*IvKW}d2!41Z`^Rx6O!r}$4*lLM{7`^JTf@g=QW!c8yP{f-NvD%uauOMw`RQUw9 z?SBFF_u73ZqO47fpSA@qrLYJQaTtmNQG`~SLTQbI{rwob^G;AokuJXAT&GxYVA^05 z7(3CxL__r0OJ-j{;(XtuTb_ng647V|ErIr^z)))(x(xvzf-pdz4!~gyQmJZ=^P@S_ z>@B!1;xt8+rZ`cnftm)!L}{f{F2ODNFgSw{5|*Opv}@T@;i1_)s`MjO63im7x+x5Y zLMtFM)KL=aDm4K4FFEOy3K#~iU$-tS`J zFf9g^NhqZWbG%|S(czJpfO5c@!4S-{ke_D4>o(zZ8rxU>s3)Yksji#y2>+UJRUc7eIRm-DlH8(aq z3^J_@t7|$$DxvI|2+o=hCJbnO3P5W>3WYRPh?BXnyo-=4?}uNYXvZO{?FsbE>Bw~k zh2`76G_ZTFD&xoxs#9BV4S)x(xB^)e71F`Mo82I|H5?iWqDBL%)xtaWLhM?7Jr2zO zG@7shXfR5^7y)GjhC#ti2HSGMqNQjao{5-MFdFYc8Y{SYZY-HSf7LSwA1BA_BkwHz z+N^l!Kn>?ekSyQRdwU;JWudEUHx-5}Ty9XsYnl?piLpp>E`sbL`*L(r@t)dt3? z2dOEP)~8w^HMCAa^Zig=e}U1r1r7BUz!WTpK|#Z?kPp1v#fC+f)kd1{j65`6x#Nx7 zLB@9Mz~LvJxMce3)xWAd_0)pNg9o9d1Z51&vOqb9GCAy0Cv4wCED8Q#t-_1W*`V(` zS}Ov#=LHn!{|OE=Fc~EnjYbiZCQ_9k%`!--z$n9lu6ej-!3_tt?|*f}`j4-Fp3Qjh z!9vgC#rN3x{COu|ei>O9!U+Q8%4Otxd*RKUi`=X}P|HHATE*zDoye!nBRlAV2U@Xs zC2J=yX36+-N!KrD92(hE@?0O&gX!q&>P1&jfbAF{43JtO3|mOr0<$`MOM~@+85{4t z{b};+j*iu)Y5qCqIHkPr!}UCP-QBP|JHdS)#4sS^7)hgnWO5QG_w9on`1@wenf;k~ zayO%u#C!Gi#1XD5hZAR8Y?QmKG3hP2)8Of@NzoL6yp9x5fp zVyD;H(_6yK&Te$)rlI6?L8uIsRt2$0U>Y2@Z6b~{XlRI3`C8&EN(fnETNbx$8>CenHxX|;+h3^SD^2ene0RF>VybGh2YzyRJoaTJbi z)Pxi_Dy=sqA~`sbgjuCEf@*sdlSvavmLL-XLMn(%LTL@c0BVvR@|#j=xno(^S(dfN zw5)EwRHAmF06PdI_q@=^<%Wo1?9oEJEL*Le$;8BQ%DGzh$RkrG+GSgoA`^lZT))@h z&iR}fpA=FokJ8qxFmC!`6tS?`LZjYRXo%Ba)@2yBh+*inAAJ;OqBWZrL1;;QGw&uME47k#q1kF1lg$`my)BZq90f26 zefq!R|MkD4e*o8u5Q!zfJ;49~03~!qSaf7zbY(hYa%Ew3WdJfTF)%GKI4v?TR53F; zF*7l001R)MObuXVRU6WZEs|0W_bWIFfcYPF)%GKIaDz)IyEvn bH8?FWH99abD4(pF00000NkvXXu0mjf7&~O+ diff --git a/form_elements/images/image.png b/form_elements/images/image.png deleted file mode 100644 index add1d30bcbf4e1200958b1f434d9f335e6bb6081..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18873 zcmV)uK$gFWP) z0tDdAZ9o73ZrB8d;W+$%P#4PN3IHSw0H%w?*+KxM5CAfA6*2_?G713fq;#1A03`qb zTOJ!14}fX`06S%pPXhpU(j@l+0JbPoDgr>G06-?n6o~-P4ggq}qZEq(uwVcv%8`h3 z0kE3@V3MKClmKAw0Dzq-7Gwhu7yw|R5DQZQ2=)NLkVi%E00=VyD2$Y^c+yu~A!AINCaVwW$9Z{ELWe@Q#JLh_3eL-t ziX;k2mK2vr|C5P-v+NI;ylVhp)qV!{LR(O~$_DJ0E+DYzfFK@c*+L|BM6Vt|+;)`%m*MP?y>NH7wC#36}D3L-_6$WmlAQi7BtRmfhX9{C7|KA|s2*yD+M!(38x2CE(D`Tzx(Llj3(*Z|C0c_XLYvXE z=oR!9+KWC%$1uR?7zZ=NY%ngy!$PrmEE$ty%dujt0;|Cqu{Nv|yMgs$BiMTaiNGS@ z1RH`oA&@YaAS5gzEGLu_st5-N&4doZ4MHDbl<=9zBT%>LK-$#>ix{Hrbl&K@KGg$O>{1 zc{}+K`84@Dd4T+mLZ=u|94Y>kc#4!#K&hY{q@1E$rwmfYscKYHsv9+wDxxl?mQib| zZPcsO0qQtSon}t+pheNrXsc+Iv_{%_+C$naI-PDrccq8ZCG?f_O8Q~?MS36oJwtCX;E#^kT*{70eCHdgeLiW9B;*mWr(kUqz&{LZw=zS>?LQ z3stJBsj9c?0@Zxg3e}^kS5-&UsA^_vJT-yZah$}`!vpJ^s_LQF^k6%vR1QdS?5^;Y!cg?&1a{vOW5DByV;|f8k#dS zqc!t1t2Iw*_HrV>*%V3s)#9)iTX@h6DChm=A;FWj>K5D3I z7-*<8+-ulvIBsNaG}oxWsLAM&G0m83oNT02{%vlz3rW-Vqz=33@_^L+CL^M@8p3r~wh7Bv<(ElHMK%XG_~me;IMD<`W|t7@yO z)~L0!wZwX-b`d(9?KatU+I_Zn zvd^%uwSVBC;V|2wz@g3IH%BW+p<}h<&FReP{?k`XZ=L>fhV=~bj9oMCI5S6S0C3Et|wgIyE(fl+>W^Y>Tctn?tajH zXr}p0@yyzp{T@ah0*}2Oy|eIHiL>_1>h(1A6nNHnKJha45_#2m4SHL8r+FXpe&J*9 zBlkJx^OonvTgE%%i}?ol7W;PlY52|ctMYs7Z{(li-{3zQ;1sYV;7lMfFeq?S;2pjm zU&ycLkIr_Py=-?QME!`u_BZjF^n3OiE^A=5eWpG+o+}rJt3T)g!Z(70G%Rxh>kd zXjC2~uggZV=V!Mn*b14VOKG88qwLF>l~bMbE;l;&Xr6kWG_Py1)#CMw2lM^&zg?sbH9l6Bqdr?20>{&TUY_;QJTNkz%WQeo-kZydg<{AOZ9 z@`mm*=dxWJNgJgbZ*TJ4bf8?lJiokubI9iAE%=t=Ew8sO++@f7m10b9ZmR-sT#!nu>j- zeL4G{)<)NMe#`x~zD}pEr0&yx>HgjW5eGWzUFz!(>K-g>KpT_|!-o^R0cR@{sWv6JT3QtX(&ObeNMs{Z8Y|7dG_J!>a&c&X)*%98+eLm>? z#S8uy&UJcsp1$aD@x&#!OUEyBFSlHAzS7*~)OGA9r=N~>J9jrbX7l_T4)PcY5!N?hf6{xcBmY&i(NRD<2Xc7C%yZRPk8% zam~+`KR5L{_nz$Y?dy6H`Q$;ru>bi#vj6dMpzta4X~m$yVEvHe(1~IH;cL(4JsWr~ zdp44_~BQtU%N(QM+aWYUrzj1`bzuN{?{{Jw~vL5J${q(_` zg8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fdMgRZ+24YJ`L;(K){{a7>y{D4^000Sa zNLh0L01FcU01FcV0GgZ_00009c5p#w0001Z0001Z02M{STL1t)T}ebiRCwC$z4?!2 z$(7&tiHN(sE%&UwdSBQJyN9HxA!mjfjYbP3K?B3E0oxE@L53m2umS(#e?fqMkpWwl zU>lHN2#{dQ1|(VXjHJ#J9<{))9$|16#V zQ4H{D?|B-+|Fq-$JOO^(^`}(?_xt+uY2W=c_pbgFLa51P@`K&o-JbyWf!qU>);a=0 zrIfJNdjC3vds@Q&QS|dib&uPA7DhhpwZ}2$Nk40ATK`-X?o$LHNYk_jC?Q1d0m51< zRtG7CK+4CGts>sfdcD1er@7~6zW&pcm)BRV3Iwh zM^XMJR&F`*zG|#BK}6@uX@h%mYr1LwKk@QYeibG8o$I!Hn{_|7%&X^YoqO8r?U$C4 zq{dpJK=I`lHwpZbr>g?$)r{&eOTc^gGX9ruPmxj}YRT(N(RNrMtIxLKjYU|OF&2Tq zU=g-_r*UQ~ti=dXUcNGOD@t0)W+tK)RfiTGo{O^AcJ7_08afIDqMEO zK{^b!)z4b_YUQlEHkEXpX6b4YSXVe4Zdg&i%VNuZDhAgKgqG3ud#$bd6OFxCu_hIP zMQc5zLo7@6WhIQ|wMs|?rEs4z7u%Ut%RJ%SAcSj3s!@qn34|4$xivI(g}V|MVFgB% zeah+yV<8A6Qp#%nT^9i0)r2_>T$G*B5T~K&3L$Grr6N%ME^AxOZW&}-EwNxLtp$+Q z5uRoYqANU<+U}0gRX&W$FUM|H-fd~Q zCb8ul8=-E*sw)81`&1>|78<72bCET38?RXkOlg7J5p)>L<60$7LbP+Yl~{}F3xh?` zN>$f;cD1S&4k;=l)QGM{3OZ~RSk#JP#Sx6gcsZ)NdUvf2(iu^AG^GhOq7*C;SlN17 zY&&-VB}B!@N{wvAuu1^CxT5_itE)z|!ekNUxJ2t#Kp-nIl}^94Itc;Fd4UzRGP!_O z;N~!_wOt0+Agdvx5RH_9MOfLGUh8zYij`^~yUK8fe3dzFHKlH~`4KL*s9qo`wT0?g z0VRW~+Zqk8_14i4S(&)z_evxMl&axc7G%i~TVWGX+7(p`Is&y~ero_IPRzFyM_FlO zZP6OKG>orD-dau&hzcDy0xN12C{cMC?TBi=kMY4LGdL9yMAxC$N>>Ai#q}mFMu&ow0(_2C1wfk^9-fH9~8-kV+?m(Sp!lM1y5YBzhIucr22kG2vE2|}h zJjtAjBjvnmw^@P7W-_Af-SN$}rgq(i=+LC;yZ$WN`;2S_rxe6f7<_u%*JMT-&><>8 zFJrkz&p_D57d3VVTTNC}OtK|-5{b+@ck|>KWVk ztlGqxhT)C=oj|q1`A=2|-@52cIByaydX~*7T2$Ox5(f=CjB@eJsx@?hUPJlD%~k$a zii-KCfUMI}VNJ)5d8$E*u%+*!F|U=TI;Nu|NsTr)F1N7+t1)&PWz^`>c6@sS<{W}G z0&iO{D=VT~O9eh^fh|9(mFL>AJ4|u?b|vTyqQwbjMCH4!=uAa5b8CHM$0Rq3+Cr}e zpEzA?Q4cc6hYk{o#u#IJ*bJaD7?X?DZQVNH( zRLHrjd38dgYb7evBOSdH6%B-F1h^LTIwY&zf}0RRR2p8-xFguDm1vVHq7gRN5|*H= z2E)yjCo{N1Dk19mbTU;fd=L$x>qLPO&TATi+C~UkZzr7iu{Dcrv`7_>b)RX?TrD2$ z%cQ8?jnhxA%vpn(jhWLf490DIo3KY6jMQHrC0O)<_5%3?Q7D zyB4?wTJ5}R1s1NP7#imOlnkzbkf_a9rLol{bVYn?9i}zD+IERlBWSydfLm>CgvRlU zb^KUk0Ov7k#L5bjT%oI-y>L-YL!B-$Dof{P8k_WN2`(GN&_t|Fs}t_uYnp3; zs{x0_#jOq4smET215O-On!M^M3qrQnI{i3cY2|`5(r#$dVMZ;`!p&NVW?YT=w=Hu! zqv#-D(S}a0Sjp-cYny~dEAlP?b1aK+!nRuIYZUE1z+*txDvGWrDL?mqm^*6kVuQ8;iD%V;v$ivqo6irLs$SXZ|i0=)kdBsM?GUop`sg zA+{m9Z91ou^r#upnEdKZrlv*Z&&7%5F$8LkN1WX5De;3hV0#_Wn=Ysi~0&3Q(49|kuc&@jFgs7}aKW1reu7}EmQw(>%q zv-lZMbXS9GiYteWuGwhfS=+LkMgmT*!0Va)SYhLXnC>>&Uii=GOsz&#=%>TL(dX1{x^sQ|*veD*_OK^o= zwzF$wOElvLfhVZcqN10jtt4?WMCvfOX0i*isLgwWU|l_G6r}YTwj_6BpoKFL>6k;? zCQ#h`sce+a6$b0*gX41rhTwFsZ@gUhH^)s+g{nxkgXT&=N9f?QS|8&-#k zkZs&r(Yq}IbxoS<@as6UO^`UI9}sFq(@v1BqI{KJErqbc3&J(tI9e|pZF9|hSyX6T zzYtCDu2i+Twf0kOL0q4@I#M?wQ-^IWz^gKZr{ueZaJe z@U>ZJO`9EQ=C+b%XfD}?-^$7=kSi7aih5!N}yB&&=*WooT&t%0jUlSYp!t6Hyz zd)#V{6AW&c+_;gdm<$+Emjp!TWi`k!?fR8=IgBItU5G}bvCdSTPonWJ^$gu&zbo@D z0ah1y)VgMCA6WNUv$J)vj{9h#QM0*nD*df`t5#$N* zzct71yj;I08b;P3s8d#K#vpK)%RV)O8|Fya#*iyXes?^g$}d;+Xcw8+V4>>I)HI|u z^R8!aR)n0C6F1s9aj~1gY^}qp0MunfQ3+b7FyVfvnA#*gT#)E!Sd+P;`@Yk**tofX zMw1(4Uq9JOvm11{Yr31?>vunyza_{zZ9lLO?ZY*ivyRrf+R?B`h^FWuoh3c(`lXuT zT|I66THBv%-fN%dc!6>p4a4Y!Aq@$eL_-VKSRpR9)yA4x7AL`ja!j|&%C4ZV0-{Df zI>Ocb)|lw_zS5O68L*BJ(J4E+z)U{I_cjc6f3Yh&2BdISX*hnUHbkPOa;r6`XrHN` zaaTLI8n-%d_xo;GVVkmDXB2`q3~J15dtW#D>ZUU5rM|1obIp2thj4!DPO=Fnn<2R9 zpq*Qrb8l0*v6aF$SaP>%m2qjicG|7qy3nM}8MkS~F7_;m-LA0~o#aF-v?uaT<=rPNfa7~b z7j(K~>DUrSlO=TUKnHAfUSFg1Dl_OLo7{CfPo=@9Eqq7NRFmqxsP!A#oN<@owcfM| z^*TA>tc~pWGwYbp>Kp5ZJ*^5EQSK~op|X%AWb=eZF*xm`{ zJ4U?=b}CMYMoMeZQnWcWhxr{cI^Mqn+-hI!dh}LAPGh)hDeDVO&Rw*w^RWy*b>kT{ ziH`bJM!TC3sXKgGb?oi|u95C(f+e~$J(UpkWZMd}!vHB*%#S(z z_;(2(e#pSj@dLwV=<&(@LmqCtz`2*dSV^_*77H3A>l*rQY0$1PqS5G+!*)fS20c4; z?utNHE8C^UIDJSbtm_JYtx5F)h}N|{CCEA*MGHrO1qkCDPvH8S&X89SU?;)Z`Pnku zI@c=WRj-KbkXeu=Q@Hs}UP*2uhaQ9e5HC>NzO%>mPam*3`)6!!Z4vA~16I=}G~D?$ z@m1fSKc0+xgS1;y8Iv>jd2Vb+?bzx_SL=oh__H)2Vq2$rD-J@xjgR z!s_i(wyP6t<;d#o6{`&EyvB7Wj;U#<>cT48o2@f(=`gwKPp3=F_21@F`heUhqEMiu zWjvmue2KyG$+b`T$-V!HU;R)13wAGE!s;3&)c#*M!|ZzAuBO%|v$9Yvc^iSOfiwW7z!oOcs=TUn)Y_>J1Gd?l7uFhPKLB zh?SgSt(A?}TQO&Kh_G5h6IiSi*lY>czs33ZHhHR_Sfhz5CDO)2}u_DGD)7zO|Nt2rK4HKMrR=7a4?$uqs zBRYPxUO>@hxIHn3I(gGwi2OMWuKQF?S2u`q#eBn_v4n z#u%!CbYm3U0rr3>n22mL&FwH*AYQO z_XcFSg76d!E=}}FX{}AQ6?LVjm8iBr??P6Wab2U{KG{tJx`~fsIYGSt&+#X>2|^E3 z6i8v&-W)KVF2P!MHX_165C)2)X=iJKI-FU|li6MGkFfS1uQ-B0-e11^2XQ=yOoCL^cb) zTS;+K35|bhY@ThaH>aYiYWVe8PfmWeHCyH6Op%ga`yGbk+ZZKKLXZ_XgGgaaLA*>s zK;VTWNsczKvoqu`{L1V6_=86rKD@*H=zzi1XEC-D5H&)NJ4_+4R#w5BXf);YaGtPOrEIO)Cj2=+e24ux$n~H62rm@8^4t~v z!(aVd42Pe?;C8`X3uTo%aY2(eHMImcBkP*J_Ie9C+{rh9tRtt*=F*b6`!}&SexIH% zS*8V^6r^d6wHD* zoU1Gypy(j^)rIs9m!18)4mGXYTl-~$p;%Sy%7RHS+M;#N^l*>6pS;KM(E&#f?=soH z&4cULn2aA1D$s>NL<%poEEk&n;{k^aYG=EE&Gj11 z8svIXjsIu`p)KHxMsR8+&ZZC0AAg&kO|U|N)kL1e7>SY=Pg;!8tgZK0>j$7U%2Py< z!e~vRHKTsW8_)0Zt$+4^^75D7;`dF;gxWRPC&QWM<6~ik>*4K+@HYW< zX?BGmT`swI<6}Pk$sh3G*2nDK{+Q|E1B5k5CD3_6mgaaq^aegXe8M0gF$uAsvUx5* zs`fm~r($qJ1O?KpK%!H83%J`x9Dr4yR?~>L1E;LhiPNc0rs$7DT2 z>GwT6DWEXqX^Etzu=D~Cp(H&UU`<)}==B9fS`e6+cfb8Ry!NFpm8TVmldf)+0xmFa zbX_<;+X=JWTKH-wov2&1i`3I3W&hzFZh!I~AO69&x&O&~ET#u!c}#B<5k-0Z-J?MK>+)LKR!tvJ-2IPAn^J zv7t-V_BaTzIwkq!yV(6($Uvb4c%H--3UZCsmPZe#n7rV<>koPJwM+B{J$zxvb4{QG zI`Xi>af)?C~ka_tA-XaC+^Eh>d+g~G-Z7Fi1EW) zeDK}hV*l=kERP-$%AEBeXL#Pn7b7lhonvdXj;{o^$k;zVA~gk8gHQ#BNz8-^e$Zo6 z_0c+~cQpcQ@H~rnoV4F2 zK%SSrcA4eGamojuKH|aNm`htdUVrI4KlhcFIloq!T;(yJ#}pR)zy})>#~C;79kMnG z==qk(;Xe0nUgO%2zR%HvhorMHNI`#dlS|LN%5$&0$<~F7L}36Gvm3<}C+FS9z3tSb zgrX>zPbYlxLA5p+M`D4?ew%v^nE>#_O+K;RW+78B^};-DiCmmFeTh`QX(rtZj3s<>v2t zJw|DKTGQMH`PRu=)tTzHPFd-^gHUZHJZ-VJAini3VXA5Z9RFh^F;e`|;#ORE?&}6wL@I9i)XPHjP3eCA4kBe7*9$fz>|KxA~3-<2Z z!)QYmYqW(R^7um)&|5ptGq1kI+rRJ)cCTFJ@-r`@sziJzC%3}XIw4f#1qb);^1*k0 zlN;}Sm*nUkL#enFM(hlC=?8s;5L|fX9GA}Taw~kmc(x!41lt>Z^63PfCS*y9@O_NX zZ0~H6rx9Ox+0wt|^X~j6*N^V-#hsV&W*d+navU!yYH2)0Nj;?$r!RgtNUPg0r>WI; zYoqPH0@2O!I-8#x<~LhIyRl*Z;3L$*O#)w{D?}_2Xln^Qu)5%ny>W@lm)5!V*#SqB zgx6o#VX!_R$qFQ;ZC%6#NWqPVd;Iv;9q#TO@yU^;w;|Z+9g?I4=gvnYOT$4HqogHW zCgkao`O$>M;b(mE{oiEs%2i%@`|CXag*Vx~^eh`YyY%}5>O+-0Up0(h%%<$$zs2%~_V?F|-_8F^6(nrbQgfBgTNB-&!s?K| zj@@2KshwWuM=klS(@Q_5^W9N|L8hLlQEBuj#*?m;XvUjNuVTsHDE9h>`f*_-hd*6@p4Ki zC7I5M20m73tXZ&k<9$B+@jHakkiphA&%E(PcFygVU{V_{zwiQC5|b>J+`jf>^5Z*P z9Q1ghzmD+&lrPCL!(iRV776`PP#$J#Ez9|mc)Bd>=sKeptfAAG#H2h-_PLuJpaOxK zDl%)?%tl<@-Qec&9jr8L4MQgLF_*3k`15al6=nM<9>28m31O0P_Q%j=sH>IGY#(jU zyIKhmocrrEB|?xK-evjG_wb9D!N4c<{pPs(OqO6M3?&kk00_`Zb%D(r^*9=g_4+};Ns?pue|Ug8^MrtnPLp z?BhSAn2s3@JVH-4{@>^_GLM&}B%FV44J!=ATqC7N5J*B(qX|o( z09%ePNfN?PG4K_;=g;%@mFF1w0YVyN-$z@E&J9LL6a`t9^6=4;jbWeR+K?hQs<$zsF$ddM^@cke`E0>5j`4hj)`m1O#EUUmnjn2!<{5xAEfB_585B#B z8S*$oOBnA@ndJ+%1_S1#c%jF}aF^L6;pVLg_IRHx%by-ayV~42V5C;b$Jqnh7O>q^ ze4RLGgGfOLcj6Cii&e>es=6JRw3M8|1i483CB%xSp zilQWtvS2cUFan8(vI4*F0fIso2r1ZFU&phGo~ZXnSOVW8o+e~Pjun>0EJm0N5ePQ7 zHb6rbr!40)gc3+22nP|?Q2jIbp@%Oe%Os;H3|{1sE)}8}@?bXMc5;`gT@V#}q;ZV! zY+09H$z**lgKOqWYn+<+$@EXN&RJ9i2I+UtPi^n(KrF!GKIzW1cNXF1!<9E zEck)s{`iO&H!pDe;U4F9cIfv*(j+5JQVMO6os*?mMOU| zFj^4x6c|AeD6(Zvl4Rv(KOvb+7I=|lRxEgUe1sYa%-o`5!KLjjp1*vNz*moBV-bl1}TBSXw7nZ$io{Sl1&eoE*3nT?s50wL-M@f z&Yc71S%xk&@iM~?Jc3Zt3w?}lDY6V9J+d^#3lxJe;H8}l1QBelZ*pa4hvb=@>vwN( zuD`=D7%++FJecgWyAfiw;o_wc{y_4{oh8Y_lr`2sA~g73nL@M1g0w8tjLo$H!ysUP zR$!$>7|VDv<44mui#X+NDcBhFm`>(oS%L4Brx|EzF(SYd9*5%@c#=3?psk^ocuW>C z_zI=VtcunaU%+CS5T_YoUr~sdBXi7BPcXV*C`R}Qp1*RDz6!XsagIwDE)WL(;~D(; zIJo(*{UaDonXK8LSMN$UPU1q86(?;h%h`hm@`w{nV++;aF;NI;|SS%MH3_2?l z6ehEzaX}RMC{JOm!Jx55fGxLc27yEsj5Zm~1m zB$ATlGA+Z!LX##b(|JnJlZerb8}oa}VW0E<7GWMS+#C=M6r-I!3d=LQmr-6+^5gS- z@Jah^OTsn@4b!d(0(yaD)KeTBPSJ(M3RPAyq~g(|hb(7PKD+Y?AHMS)jt(9%pB%EB zrzj;Tnyiz;R}xQpq$UGlD0Ge=d3dVC<5`}ejl}a5o~JNqgi)Md8`1XymWw5YTB2f) z$s*$6VvjKIGoPfSY0lAn%rCxip3G?GNzC|2lcbu>^^j2%vB(obgawW!OO{E7E-afHhBVC(XpRqO z_<_g%Y{H%KAzwQ8629F)8_2V~)Ou~fm!#f|S$@p9tzEWQW82$de7M9U1#3GaMyAJL z*rSLu4(AK>NwQ5O(@9oHSu!}wa<^ttxQ z2OK?oL^vqO;vAhDlo0g#K1rHmMTso(L^Im%6E6+M8rIJB8TNbzgFb1IFq_82%L1Z=1bw>|FfC0rPe7#YKK zS@7b8EvDmw2l{{=Zvz!bj4#+v4k@yfQE$kzTf1D?+-5e3$z@J#W(@oQH83oeIU7Tt zz2gPBD6ra)TZ1-+LYt}pV=!4xyo~W9k2qg2ixadh_-yikVGyFMB1tlOg8=2j@qEti z);h23K2PKc_U`YqcX$LwkZVn{$nbKB5{l_^4)jix3qKcRm3xuO0Ty|I6p|!QxqJIF zK6v-XJbHKso5tA1j2j={VG*bFc08gjiP08QXbN2rACxZ)13|AZnT}I}KtiA}2L;15 zpR~xB#~J;#KI@x3be5N43W8qbu^str$RVm9;zg1dFQ4brTeq2HQ*=_WVK=b-gmBnn zCpyQyhf|(^UvC)huX@lu6}Qj)?j3>BkI$^PPi-TsiGFiaN?LS2kDd_9e&CMwM|b3Wb=%~WazbwpudGI04wp#fIOX&r3rX~ zWSJ8f#kiQTcQ9tOx%>HhlUAERuvpA^@11wpzjK?57q)nKbc=6(>$f>Ro-jR_Aq&C! zMvp`n5W#eoktQDDz%Q4O6mV{5n?f6sWI|ea<=QHdlFSRXwj-WDcLgg79z8mwKNz8X z!?I9#1oVB0401%g;Q086A`TFthw$$6;;UcepMLXSg3NgRYj5+?mFMVTd2shG_FTxT zZ@{l><-r1(i@EA8q-+#0mJn^>uYQL@h`qbrX@E&`iL+8(l7Jq;E;dy&0pui;sK$F_%pxqD=hSk z3xfgEbix1rPkx(=o9B7urK`MnVHbqu_kQ?3;o5|&moBiivBL{5zeKJA!tebSmo_i( z%fIk7&R=?#@!dN-yzv=d`qIzwy&wLNTl?2|aPOF%t@CW{zQUh-`we_GVA)$|nZ@`8 zTzl_Be)D&K$mY(7xk}mXNzQMsV^u(rOI~{Jbut@+&bjl!eUw!wDOpY++*Mc~WT+@i z#{Kk=OQQkjcedCW_Bq-gGfxVlD5O7#c=oktFkIw&|L`Wp_ZjpRCew(((Ay4p^W_)W z=!N8Y!P@RNN(u7R5ZfN=U`C;RJTJs(gA$VQIA$4V47XeJ{M3n#lFNoGyPN!{|NgIW zn5OI>C;XLv=g;!eE3Yz3GXCIqzRP$2)wkFPdkiiN_=T^&&7b{qzXV3ITqHc)JL2$Y zf$s&p`ur=reC0fzwfxDiehu^HoUgq78XMbN1cMP@`O350y!9!wSn;J--{8_SmlFaOoI(aW5F??3(v{K;SXMc(`12IFx|;;-}b-}nZq z?<2#QXRo}(pZmtIG6+Vjt@n8LrDu8Y*?s)bV|KV?_m>8|{m0%Q(}HU^Zjdb#ddl+b zxgCaEyNq>@LP~bm`uxWK@lQEEIO5=V!lt)L-kY;Go^gJ-%V6X)jbk=0UEoi@{x-k< zFMflArDPP0$cvndFJ0v?{YQTZFV4vl%Z>ZT+_-atqv#P^qdv3bn2+z@;ZObYuMkN= zxVglMO&)WJ}XMbXVaAj%|v`t3LQ z$&HU$9xwRfE3c3)Gyd^E_=osw+uXT%i>$Ex+MoSXq@G4qN@%(FfPr-8|36g)0;yWI9i{d+(6j zpWI|P8t~c|pXcxVy}!@3>wD}SjL8$t{RemX$N%V`@CV=f2}iR-=2^zzAC0(rZky%9 zCI7)+{xx2B?iqgLpZ#;*d3TRXS{p!Ca=8qbG-H1FY;IZ%fHICAAd-ePB}Ur^UnM4bNRw$e(|es;Q2mTq1f~T zmTAm~;|WG6k^pu_A>aAryWIbqclk@-_!B%hyusc32TYPF)5VhcqnOEYjPXCi4*P6{ zf`9(4-)DSm_}VZ1NxuB0pJOpdxqZCHJf4!r33;+)_rhiV-Cz65Opo@k_NO$_V2NYP z-Mu;Q-T#QYcPBjm(LF9av&D}-{D`CbGX{eY8Ag2P-5+t~+&SL8cALZfeKyxdOr}fL z)tbANBid^y7UF};!G{KkNH-~Wj5!9EYtIs1n>NR7B=Sxyb_oV&n<%a{4| z?#FEY{yY4^_x_L|knBG=WIR4XMVhaE?dSQ6zx*e-aN!)It#c@$`0&T?a%t%EU;VYe z%HRB7{~iy`&%gyY_(1{tikAE}h@t^56>BKKP8^|NZZy$&ki!>HK+KzWOYeE^RZ{ z8S{xIi5JW#W1f5F3fo&(c=4r6eEF@f^WOW{`Mn=qG+R3_F+NCm=aWx~20l_Lg!Yjh%*F}UDsRe zpryqReV*BVmSt=pxA;*XseJsDRQ1YYpdX|T1hdtrmiFJD0UJ{Ml{cy4#Z;rN(YV%S-O@np*0B4TUM=b3Zm={laZ z1irxt!NKvIJhv>fn1{0o=g!SJ&K{tn2^;-_KXGZmS6}%m@v`9hr?<%Tg0KJl1*8&q zep$WInGZtq+8284tZnlb|IC~0k0<=_`~Mdg&+YQ&8*j0(zJ|f_=3Cpm_2o@Iz4<9& z7_z>hFmJs=94l_zo^kc10l76;p~y!ee()UD2&}TK4ToGhzeyPQ+<9=o{?VM#aKx1h z=kR32&h7?L;Bj!Av%7tPesq~Tx5oVUf9vma>HHSI{EKhknF3EQ_``31o6kOb#H&}n zfbVc#&eH%Kh_jNW2Is=?6J&Za%&lQKE2$qG={iZsX6Ec6miZ- z1PD=X!O@u^PBf{7wQZlUC&=@R#W=(FeKeLNDG2(CA~mQ0qykS$&hI`)Zpy^a(`T}5 znQPwOkW5ku#!_eiMbDFr`miW;xtdQyo*7gq$*m>ueaIk?1)IJi?}0BBLV4J{z&Dc6 zmuOKiNj1|V!wVzgsz!5EfvL*G;6)<7W2OsB9Uwj@UANo;PhNx8E_WDo=b&yz$_ zGD!_GloZ;MW|kz&@C!k)fFqNW3=JERVlvn4>y%zuD`B1*LLZiE1#2pT!XsG}gkA_( z(s<5du92BRZhBb1+^SPAZ<0ug*pg;oV(9lpxj=CwPC1A3b5S%PK>HvIftSM|^pL#( zugF-=bB;61THp~NNwb_Zw}=RgH1yXLX(qToF6a*=zGqNzju)1ja^`tXU_Am`E>4r4 zMfwqIMOj?PeM>ge<(5w&hq;8j~&7fXvT3~M8WAHg!VM1>#`1@Y35`<7lH zQ8^gTqCI$&TeOAjNHYV4P_^3iw3Ovzd@w9y!T11*%o0SF$v8(J z=dAT5T1XI@KnVQEqX-QiUbU?+JWqnOV!EfGDtR zZVIN;a@$JOFSpbtDac5aOMhdS7nWWGJ!6noGV(pPqXDBJBG(WSvKjSR9}YlR_Q!Kb z4Pu%RM&+DzZn0Wma>*>u8I4S1bx*7MKBm}U*w}m)>Fpr0ebQKv6y?rxKMd$clEZ@q z(=;b6G|?a=>`98aKxm5=mhCWPw#Y~li|)a>ZN==^;0u8t8bm0Fr6CZO07ahW9HpA& zR1=0Ju!|GJg+WBDjoW)X(~BR+ab`5Ljv8jeVbkRHUACD{oMD*QkW0>KLyVcs=;Bh= zgRr?%OlvN6=006D6V<79LL!FY9Etj+qY$TZQ0H*;@bh?_zkdJy{`x#Ve?0$r|Nnvw zlGy6Xh{=x96hDQ0ve{~d^~z4*+vYwLtnAeXKT66INr1bP%^ot4QIC9H6gCJDkkKL~ zy28paPtd<(#5i6*G0_%EPlCc4HQ#DCUBhi{bn5r4eAcG8)1<9Zw@6 z^-Be*noJf-rvgj6$IqzUq3pI;Pj_Yh*eKEAp&RS^2bBuW1%ysB_*&ki;TjeuPJsU0 z^5Nd1*}*9nZkMI9kMuoSEl3NT(Ut=~en#RNs(Kh$h(6g*;i)6ygeL<0uzqr8CbWaxt~8DNvGdhgf>vY9%`J?M0LG0RT6$W@{HM&_iOpCbmRw_$$OtBW#xu zTj<~)l#6*ahKvRj6>dRG1lp-b{*m^M6Yfo%zMNet{0yvm?twCV+Qc>L)x!PYi z>ukoGbL@!&YgwG0$Q4txkuU}Ov(b$gIgk!-gnCDVBLingaD9&F zpJ@*;1iq_(`>(Mx@n9vZ-2pF+ZQUs{y6FS`*7S5|#-^`)m#wnG2F7z!?JU=$1|N5R zv8XFkP%Co;?+>Yk!Yfvi9v_p-sEO>l9p^OdcJ(VQX-=o0!v5KbMo?R> z-sN&19jDQ^jE52UwKu=xS?Wq4vFl_{<986IyMyyEIZmHAoTM9zEiAcGa0bZP9r5CQ zeP&mr0$V!|K9_CIZ<3*(BbH1P6RJlZud$Mve9uSMfs05;P3~*OcOCx6->$hrcB&9T zNXXqpqb0qMu49lS)CKg@8uew^YX>2VwvkSOE zl|pIzxM00utxXCx5bJ&DAWnh=l#~PQRox0#5*0+WXSiGQ_Z2VL>K`=(^uiB<%Lrp- z%v9_ClpgH9yWF*gY@}Zp(o=hNQl15i0SR-OU)%SH9%kRf=iay3D!kJM4r%XRP2-HNsW7VD&aa_x z-zqB9xQz7LJ09{Z>HzP8|)?1K3^$|&86V zKw(|glCR8FL*^LyS_^!WGP7@uo1V%c#NAqlZZWBHuOK~v!Kg@Epof$9pJNm}A z7i6U`Qs_~)OCR6Wd0)9*tUm*okrjT|7S&aYw=Z5@G|VR3J06t=roCma`}je*HY5n{ zg;_q@i5AIP*-*htmH}zh1+S^(N-qqoTD}0H2CoeEhdg*x{NtEs41j9pA+_C1NB8!0 zO&QG27(|(}@10#wlRnyrn_uBt50m_4OS9kDMK5k>&1cwXmU(5|s62A$Qo{qI>CD^z z9DVTS<%iF@EoN5^ob@CRxwZ_aa5g)e2j|bM^FO&g+u?UhTw~2q+}zbow-trB$bKeY z?;kpGTI!zUXxTFF^?li7%Y&AWOSJGkNBUD2)1}vIFSSj#-0yR%zcJh~QoRHXkS@Nu zVR%*lA$J(WD+^pEkF-Cn`eR{Xp$84o+0ZRWa4jOZ4`r5xqrZ&b$$B-v6>vApVD<<4 zsgoy{J!)jSpQGKUr>CX!{Lwr;<4*F3X~Hcn-iP@Mb2Oj7$RFAR$NT1ArEGW{|8i_` zDeBn1Er<9Y>DBXmw_nnhCW32Zgu1+4f-V+%oMgn8o;d_{;ceCOzKFB_?^1g^=+63n zdTZx$$@AyGYV2LwuFkDey&0*o(Wx94b~0!CXb|xPJP!XI4!=K?h<715xe&KsCl@^a x%;Im%{{cxSV!3hrZGhj8+cpG3D1qogBDgs2{}*V~hCkT`8Z_@i)K*WH;J;}Isqg>* diff --git a/form_elements/images/lgpl-3.0.txt b/form_elements/images/lgpl-3.0.txt deleted file mode 100644 index da6e70b9..00000000 --- a/form_elements/images/lgpl-3.0.txt +++ /dev/null @@ -1,168 +0,0 @@ -Icons from the Crystal Project -http://www.everaldo.com/crystal - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/form_elements/images/minus_small.png b/form_elements/images/minus_small.png deleted file mode 100644 index bdb868c51e9e301a831d6436a676e06b9328b27e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 560 zcmV-00?+-4P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7<5HgbW?9;ba!ELWdKlNX>N2bPDNB8b~7$BHmT?0B>(^cib+I4 zR47w*kxwXtVI0SwR};IK{Hbx+%%4#*wTnVlL^5rLZPvWAsLcpTn!`#cmX+8L2j!+5 zX!kj}x;V&14wO=)NPB17^Y!et!`|?#Pd&fy^Zovwo_-w3DMTi;to0F&(-Ds35sF*Z zA96EC*SS9NjNr%&w%keV`+(g^V2^Py4TL8sf{rywfCfxDmH5Qv>f$!Pw5V7?n4<1IGw zI<6l}dfI?l7W%K)KsseW+||55?!CGJ!Knj$t-$#Xn|>_iY#Y?u3W3+-#na>=;m%6s z7hfMwICMxmoBu?-8*NBO&FV(+<9EZ#NP46epO!iZLs}%V2!mQtOWA7hU{#(nD<=l@ zB{IdMS#gnesvrz%@NQIz2$m|OoN7E&ua-0b0000Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RV3m6tGA2FU{5dZ)H8FWQhbVF}# zZDnqB07G(RVRU6=Aa`kWXdp*PO;A^X4i^9b0kKI$K~yNujgh}g8*v!MA1~p4B*tJ2 zc!f~0#RTODG(o`%HNH(B^LLIukZoT_&E^hlI3VNn_69U7lst&U~FtHlR3)g^VO=xm`3Dv96g(DIvfGN zHaGLj%aL*!hQT||ai#Jll^Pu%e{Jdcr6sRze~m`9i;J%Qel?MBFF`~^R4f*!CMN!t zO7s?wJEYTT01;WnTRaN3ZGRsb!8>^BaQpASX_|~N0Foq$q9BPrQRJHn@8khiZs1(N SS-QLc0000|ZneAF3WM!|AQTEUaK3LT^bKBcZKTzt5r_%g zpB0nX@P9mW6-7D3#pS{tI|j`u~?gkGn_}BRkPo@vXGep$O)Kn>CSXiH86J|L~{>hG#(b1G6FPt=4 z+EYr5sZr0Z^my2y;-kIk=dC=&%nc1DGk4-uI2w(env6>Wc!h-z?>aT^eD0~Mt6SI|lnPKeCDpptlI`=i=N9RaZ*zc0 zospQ8{%4z~Iz>7;T3qk73Vx2v%$#44FpBP(n0T+{)?!g&eW(>}#YWs?APE??t|Y!e zgy;Js$+$FPYEwbr1{Ky`Xvh48=SF$=xgke_*Q5BHg>s8-p}iFvgQL0$Q{JOJ@20@P zIV~NkEY9{dR~brqJycT09mAT_Ehqn7%mrm^H?hgt@5fGFfp-#>TqqFj1`M@ zW#OnckgqlfD=hq=&CQ#t`UY80+t6^*J$o{9*eoI>WPS8+ti`_<`ye4LJ#pn+AfYOGtV|MX9F($I!22gJ4pmS#SchpTWYb(%-%vjiOwRx^y9&r zyqjXYnn+kCWees*%W-n?JzG;M$gn7o;yy{+}_NztfA=@?zBbtRp3Woi(Lpnay;u=c!^ z#@KT{!{p-MSiKxu`O^^Lw6q_S#>VkpfmZs>B$kL^BpTnx$0y+L>F(f`Tf?-BX!;DU zC%dSAPJDH2uy#C3s%Xf zU36jD!`^ReuEGNH$Swp60rsA^1Q8yND#vvcbu{%azq7Nmi

      SjHx=ebzLq@fBV*< zlk&ELp@CvFB2UeXmo^1yh@#Fbk=LYz#pSoOTwF-*_VI@_xNpX14X<*v*2>hV+&+#j zu$Ly2(@#45GhV((^H5^{``n-DhFoI8ZJRr)1{+?=X2u@Zue@(tV{?1Pm&!sAjO_h8 z6BHC=BEJ9qk;mTN-b)NcV^AA3Nxzfjb&TpaR8&^Z*!tnY{{Go%!|d6glKsXlOzKA~ z?4PQ^m;(E&nM!F^`bm4{Q6YyEO^V(XN^gEksL{)nh3-K03O;xRT-H zc##)1gCNnZ6!}E;jHUN^h}!Z4YE_Pr6`A)#vHm;JCJcJLKDVEJwcNE-ti%j-ciuq{ z3c9J4_B*kqtKa%i==}lO8o%Xq>26DD;ct^4Y;nlq&jaTI6UP5C0)7@IxUs*v@4Qxy zm}`a!47oTRyf|epEIfCsmUg6@d&vI<*R~RgmutKB`7VvAWau|XT5pVZlmDmx&&t`_ z!;34e_kKHRVmW>3KMWfu~n+Jo>CMuTlrTz`a9?W>H zq_?N?+X$t996iWFdl&ps(RxxkW>#(BGWD!>{%B`$`{ZnBeV>?KmJFBUcuzutBXI3r z*Qo0g9FwvM2mBhx>3@~Xr*rs&8#7Hlv=92t%ULo9OIHIZ495{Qw=z5zt}!w)PJM~- zHArS5P&*@LVu|ezIXG}92ySg>YHl?Zxbc2$ec~pX!cspRi6)aL4`z8lDSsfID-0v} zypBORH(s4Almyf7t{4z-F?0z6SL8Lns}UOK-i%_yNy$m}_z1r`y9Ge#XzIN^z_~hBl!i+`BeQ;ue>Zu{$V^qn2J^+HTZ$jBg0 z_^^Z$gW}KH5?D&~;Y=fgO1TL+gM)+Yn0{p;%;vSiLP>lU;&&B}F5CT<9#wyv*Ejcf z3!l(SMQ43UNtx8sYj8odnwPh(xoT}N^sVfYApWM|G|mVY>jwj#8zrM`@lX?D=Xg9T zySp*uv!kslENEsl*OvJ3mc7n%{`LozheDWs=Z0x`+Vuv-*3IDwjyLVRJFF^JKkIT+ zQAW%E*J}mmU(fGb^3na*yM$LTFU%rQqlYRpDE?@vIPl82)Z}}dL0B{Z?us?+@5tJkkt)79D2)w4A? zS<=;I^GELK6mVX()OS?EF(}qO@|6sgVI?9WV!`yYF~zb|N3&8y&Mn4Dg?E_;&2A|g z8q!~0-dUuivhtVQ(`UCcBfq(`l_0MI-2&I%G%-_qi}J565zq$uPDn`jLDR1_~ zJ08hOd6gBO6$~9ytc9f|?&A`pw$4u65~I3cZSF85o-yYagr?^Tk7yU5jQifO=Aq%? zpa(3085v9)6P5UNMkKqtyD1qNpTB>nEHQ4nnmHIzQoeWQxxY)jFt8j6gw+PbLKtGhTF0>7C7Jgctr5)rFWnjlqBAG^SVA{ znqyR(sp*Uh3~GV43{SGfJ!|+@2-5|n;xTS~Nh*1SXz6-HMFf2sLJ3@yI(8@y2F{SR+akDx8?K?@BeIT zlZI;w&v@c=$1+D`aRQ)xS$fV%9o;wa)sinIGt=gGoe>ZJ19Txx!#q63cqHf&ejAvq zHdEer2E{U(l%0z%eFFmveX0B+&wmk+Fo*=2^1j?%8MJ_*$yZO8VT*eJOWJT3^EtCt zvp?PKZ_l*0OY38@n*TA1R~jxXEGbE%qf>A~63oKFK*Ha1*1>#^(4?Gq7I~wDH07l& zdp0Em$Y<2(Nq+3h1Vs$0r@ilZ&+v-}a)_fyw+N=$p@V!oP6_vx`rB5Rt(Yeb?(d;I zva+(DJa^dQdysz`chxNlEED-3Hp~v6a>-?DdNvtn@Z&;Rz`y+nXmsdJHot=U-U(N{4s3mv3VoiU7J zWmdgO>kpbWKUAf7F9){T_d-L5YI=Gaz@I+;?Wera9MIplAD6V6@&a3yX>gDcywgK1?5&MB zi>6;z(Y(K}kH~`MZ;vmN()j|`81*n_DatFc4wX8S~>R>>DHe=87d}FZjGQ}fJ8+YNRSC= z6bc2B{k=hPyRAUQo0loXy-l1Ksx)Erdx_0X3emaUqjrg5k0|4HxT%t6eAjZ5w?ET6 z0Uw!e%{0Nyz?`+_sw7iCyYr-A`=cR4BZZ+x(I~Hk1aZ20x6*7di^l8g@chd3P{2M8 z8`4M$Gj-a#bq0hS;h{g?&tKc^m!UMysy^i^u1xA(q75nm5=^qn8F~8MPOx$Rhamtf z3^>c5`gI=PqxlG0X6A@tTR9sW8`)+1`*iKqZ{`FwhhY}iTyI3m1*?U!+eB_`x3^=% zh_S^HT+`q4_LFr?wd)jbJ++9ZRZ3G@ZzRPkS9iVuttpFP>Q4LDK{#or9QWc!WM*$iFT)?zc zM)o1TR3aqWyz)-gFelC@gJK~{(l4o5$|MD@+-xH0>f@X4@W5C1y^~4@mYyqdB)pVk zyCj^A4F_2&rE6tB{2x_;M4O<^d0zKQ=6#^8KveCF_ciY(rpx=Mly3{WM#C#4gqJ-` zkUw%9S-lXhrbE#!oH^LxAhgTR$lCi{R^#D8QWOp@8x?ugyat$77P1E(9>Oy3$pBP$ zzdq%`E6_#9Yw#rB6Bdqu)-!c*AcAiB-G+#gyJYO z6Le{+@~@kEIyy&Z{=lQSA<{3izBtzOE}0jm{jEcQ;2jEw1R=x&`FG&_gq_Qz&h&2O&eR6=cEkou>=y4eXsGL z&L|v+rH?dgSD>N10%fr>kbX2d)*Qa&yCUWZkpwvbZi@Sm_sk^V>b;fdcvjGA$vjWm zr<__|LyewI)j+2LxUi+F&hQr1j7u1K-1V;GHkj({Qn`nKdV@ZNdg~S~*nWyKcpqvu7&sD!C9cwEG zK`}TVZ0Lh)oZFu701!<{OEb4Z7uwxksrw5z=#et{@pXGQ9w&P?c5Ciap~%+)Y#3!nHgDSrMCpu@%0 z;cNn2Y`B$nU~%y04nk9EYk2zC373U&u~f^;V8$T=;f&h$Zh|>M&8l7@!cJ?=9SYS- zY0SwVc}nd_{t_4U6oHPXO-zbS?r{bDb@lLA99CqOFV^koNw`I4+mB3BIH8G_hvC!x z3M4J!@rS{EV?4-N)(RMrN_~Yl`8iRrY7vId z$t|Z=pmGH$XT2_h9{R*T1@J==i^0&rorCaE*sc4aTH|obej1sgty?trXb^>Vmdv!l zSJ|15@3#(_a8Q7I@3AyzB@MfYY;z4~LEkB`ZKl1HhR%*Q=maHk3VvplrkvlOYOuK7dY)`l9V=6rcV8O zB9}-PNg>TbW@=mv>xNvb%`|X!tNZj+{9678RZcVo&VNyeP9JLdII5dUiAlXyDgD;E zi#NCGwF-Cxy@;jfKpKZ@F^6d}2b|smU2*O3s3hP#?-6#Wr*%};r6|_Z(`#*QML>B0 z8Uc*~iGG}HbPEzDXzN%_Z{a%E8CkDMV*10O5VWrq03HGNlfLF)dTgq`&}Cand3`_a zv4pA1)rx$wH-jAhZ)+JVzoi%&n?B396oAiSw%PBK>l%f%jZG>2T5B>_bQc?fmspFF za_Gm8aDXZpo7Sc0V5<~nob2uGCvYA0zQz<5I*Tw|iaSfbOB`0n1_$3a%u@Jj*ftbm zL~$mY-U~~El-wJpgbcQ;j)EVM$=lZ$yd6KMJM$l(4o5952mOoD#1odNdvhhIRb`N96J*-%{b) z?O|6268r=q{UksPm-+T9)Pw@;bQ(*qM5$jZut#;VLDT`j2|vSsv&ZteKJkXIAWd<# z{ABLfIzSqvu=w(tWYJw^Wo3cRB7M&Xq1(e`uz+ZIlCSkxR=gKXK->~+@;h;VE8>EE zDKQ6C_#~Etma%?ds|hf2hi|`L2BXtvN(M1sn5{uD;uxQj%7~u+l`2QamvG10239pl z(aJNr_exR{+_KYkiblaxn$=FxC40HLQU*N;^cw%Jr%*U)SIw3=DEx|bVbm2w@uimU z=|R^JdIow$E{_To*j4m5=Bvff3Z_1a=C-OQ5Gb}=7NfDXzzT#30iTXUD*4AWm1o&-bW?^-0}H@|IA0V+^SWtH@}l{@ypdRBM*bQ zB!9q>@bq{uk$ASAjR0FzRP>S;RXK1Fw2X}MytJW%Dx(y2`tVJ1G$^n5w`5Yu zSM|l|e(@B(nK0@=()HSZ7KCViK0Xk!h0F5s?#jHY=rFT*wjG z9@4*!yT{_H9FKZk)7?~D1*W`ur}dFt*REYdoDVniiHj2@^x$R=cAH!1=)@@@_3XKF zaWHO!D)FJ4Q?(sihuO8YG+WIlJOE{nawmrh^p)gkh+Wb7BOhs^w35ZcUfQ@(IOFnq zO(BM+rg}fk_DyZuav1J2{C{TuH8ny%J!bumR=wL{E0nwM2m&pilL9h-_OhgV0s4K8%jd3O_gE*`8FE=YF>j6_E64xFJ=r=!a z2B9duZc!roCMn<9om^(jYr>om%+%D>{O<8~-Jl-{_*I&_#+^&O$q+f{nT5#k#dhP= zP7!Ag;#W@eZJ^M1ytWLIZc%XpQbI#D8sB~KhlE*@sAYC=As~b8yWMcWlP25ZXG0{1 z1_R&L_W|4;c&}Ff_f07qOuaSfw4*RcbFDA=I8^daX(xvIkYtZVDX-4Y_-t8mV|czQ zlYj6PSEDGpiT!t`V${y+KSR5Yy4?Y>;n~?i85wLle}ATV=TEslV-A!%^Si*@_Z!ZpRbU`0&h340JLxOktc-=(Cqv1)-o#1_lNUv*%_VIId*MKKY%= zvWy#c6T%zVwQ>*w`=)C!RquA&SCTp5uLfr*ghLKOy)vY~S8_>ObC=ca)`XC`{mKaj z3lf<>-+gL=cu|9sm%Frku?@sRAjHm~^dLiBzHidxov0RR!gJG3cHH#e{V=|M(F@yQ z&vs}54nl#zzV&?}&mpkbZKiMHCVJF4Ch5L=FB*h~4&+k_{N z^__3gRn!GEWj6F4Ac{_=?SJNA$UhBjR zcd@>JNl5|czq+~_*kx`;-w8%5RkZ>w{@q`O?$$HUoM~I}yQ(T9x!N2~3CA)mS)8xL zZ7V0{_Pt?uk0j~8_s7gtE}y%*Q+xCW&KlO25?aVFB+ED%fnP%?&G?lDd-`})4DiW)NtRN}ckuXW?9=q$qA&i|y`c=PYddz3;7%nQLskpt39P8?QUV^-CpSl6~_- zbCJYgkaD25qd2JW^P_I5_Qjpc2;p|#%FimhZ+7umP!Hu?ioCo$y^Q-Xnvu6MTGvZk zVt}PdFIilcR3a1ypX6O}@#}(zUj=RW=-jmkrMQD_rF~ziP$;fQZa>=8o zj_d!u=({^n@F*XArpxx6bkbuJr|X|s5gdjLSHm9!%-iIq5@t*@`&{(8G~ zE{w*w6}Eu3=R!!$VP%lR5TDg|D&~#UcnRI2!u1qHV+!n{?T zwcKONSp0Om!$A(aKuvGWdfay#^=8S?FL;tW>Rznyii$=}Oz1-_ z0djG!H3(<*_wRpli-E#&DOG8`Ypz*9OcoXv4kFjkM>Wr;w)^-8=O9V?7?E7~@NhOj z>R@96C!%9`?l}I14vL!ITK*BiXrbkfU4wBcd*+~pnHkoL7can!$#5r{OG<+lJJ_7+ zR$vOyGWA?uzC+3z^mBGLHZqbB7C^lWQ8lPq2=z=seAC{z(cXKv<<(`CZavKCd{#Rh zo~;FFoAbTfLG znwkc_rkhb>CzjGIH>*zWx9$MzaH$E`)}Cq?>41q-7^u`kd9J>XaQ^j$oQRZk5ghE% z$?QeU@USL?43J7J%(aEUoA|KbXRpKhx;1k_jXp5ehpVNp_U*UaXNtvR>#OVQ9S{VL zGYpIx^oLhX|D{lk7X5RF`WnxZ`cO#NsYx^|Ak|&`62~s$y~hb!8ny-*-%9%3xXdU( zY~i-d#zF$X=;!Bm8ACu|ucE8*zQb0)Shy?VL-lv(4Dg07*+x8-V3Q~0oZ|@rb z`6DAEm)c7`U9{_;C)f2KqoY@9r}`0D2in}`5I2Kmg5dFoHKdG8xY$8??39mR2rgz8 zV{l8Yxz-g_O2;gmoypSE(>HRcZ{*A2>+hU$q2q^uwZUXidk;t2!5$SzAQ8WR0`&T- zmQtG+Hq{2ONdm;)GoWEGNZg!ey^|y&HNNKh|FW{hwSs2{$90dNzvKC&acMH69GX25 zY6@Z+;u=h%X0a|1XDo;&P)r`0qxIt==lcf2i8OxvG>k*TQ&Z8fDFeJIln|vZzG$d( zgbeFmgdL!6XgmGpUUtz0MO06 z)$ZA)ZZ@tCInyON?@1!E&FYH|sy6p;OgBtkEUJk$IA>#@Kh-ZPunJ8?G}bv1uRWn| z#k9_(x$BKLzNUW^{J6KrV7PI$zq+~5dwOwh^lO4+N!Qlh!TrgqHcZTqJmT|@C2I7i zTpm?IH$8Et=10rgZZox4aE;oN{;8js>$=e+G&YG^a4E$QFDEBiG}h@lk*_uDp-S#r zMJQRfN~u$1dugfM>~z|jKT@lpUTS#w?d(&=0LMj|YaaXbltFP`iDH(lu%Mt0=?3451JJV@*sIBgiVxAVho?#h`^Sh#7$#nJuxvmR<+s^+g3TJTZJ z3#i5EsV_3QS7(gElnNnvG#3&pDkesnqMA1cKmglw`Zk#d9m1G9P2;=KSa}ktc&8mB zqQ0)TQk$(Bo7PVcj4F5OXvEyrr*_Iy*e5s6sGi7CKyE?6ejK?W6r}AL8 zD8whjEweW@ooo5&v(D4Bh6XqnX z;o@fZ+ZQ-!7bFGOTd9EaU)$T;Ti3$cXAwqNZw#*m$|HCXW{BE`=|5s0b&DSAj6QUA z{o*b5lzy1Y=of#1XnIKrr!ogqY^*kSA~|9aVUAF?$0|d#B3f}+aNjWo?xtBf)qk_E z^Qv^A*;FZt?HWF@6hP5Fm5p;+(``Oa*VLK}1e3~qW$qBdP zLYZ}uKk?Al>hRDyZP5b#1KKXID7M>fi$#H=F9rJ0 zMIZ9e7D;ze#Cd5QKNOAazW8qwv5B2k1lyu5*kYo!C_9x&2bO5Wwg}7iik2XYW+bz; zC74tSnV=xpB2-nNfa!O>Irr*PqGO4d`g7`oxp#if%$@VioHJ+UQrC{N^51jL^FuG+ zm>M$aO{4*H-4x8dYd`&6=S$9p{(H{(^2NU|ngz4C$uw{BfZ)O7wm);8N3S;Q-}BB( zxz9FVe4zz%A9U~Wk?(IL1TQ$hUfdGm3(aBBqai z1qhyH0Q}=WgRvh(*$jYiA^6$oU;f&9LI41!wu}PIzyzjHR>oT3LXa{yM*sGk>*pYE z0RXK17xAafJ%}tm;VhR!3&DW7@#$Z!8w8sQz`O^*BLyI5`qeG2hTz(|K>z?IHxYoj zWdLMNpSLscLvVB5AgBT$fe}bR>vFtHkZYP{Ni9qH$_u!bv~F2zSUxF9^IAYz&TCoj z5fetO6vlPTd}gj-BkU@G0C3s2IjV-BZ(Sf*20+ThO^AXYK)eg$L`*Zq+l#y|6nu}&vD*m>k>eRGl$UV`8{?8D`TL$C~hMQ=*4jtW)rGHRD=mgjtV zWj@2T0h7KNP=p^CUvWy{LNEjflID{JLjVBsJ{3r!b2-&?8SkWaU#P^ggqB+yVC_T! z>5}TZloeFxtz9VTHAVi?G9&1Efi3{&YaEnV2u2lxL_;B{0-za_Ho_?!rv(sAEopv2 zP2XOm!m23EoY+F5+Xuk4$hr})R4hqIVLL$G&wVZcX>+#bS&<)tKGV}c2&w=GvC{%T zgq;>aQs|)AfjCW|h!m;;lkk7FP|y`367$0Pbz#frx)E zAOH-SQ=eO>8iGrvJ1_)W1b|u00GR`WFqMmIfS}j>XFv!5KyI0fvZyAjmdj(!S-Hw_ zDlc<%N~;E-qE=u@3GSF9Pp!8cg04^hJOBh$0K~aS6)*}p?h4X~rFG#7F<;jFH1i5{ zZN;%Iuv8qNH1`83ZiwQ@kJFh>s^iqfHgj~Atec%OG5GkS9smNtL7oV#1%e(E4FEwE z0L`3$Np{ov`Ejo47L+&z3VHjwFqgatcZ&i{TpcK>S*D*5XI_Y9al#^=!y?OVYcbOb z0sOu|+WfmYY>pv6Y)--=oQ7G9U~%k(htLH#sT;mxjJ1U>zz)DMGM#lp006Q+Kfrnd z39i>^hBUh@enFaJmR7DD9i2rw&x>?}ZMj=Br4DpT(>ZmrWxk{}mV<{sfbLhH3Kfwz zzzwiV*Q-*N29)bEfDurBS|4W3K{?aGB@5i?7Xn{BlIc&k{quj$0tdhwPTp@jy@9HA=r75;{j%lTV<=! zi+UK6q~;4p7q>#PuaI^NJ|4Gj9%gLip1_4*vI+thge4$sd=SbIHK+gE`G)i5Ish2; z#-fX6Fv0GMR)=-_65+m}K;`i70V15v337JPSSG0X2?ff6XX9b7MwmN;2)SiXvG4={ z{IlS`2Z0|1m+qmxORy5oZ#gdp0w7NNpVZB3N_TN3-P~GFzCfL}nr*Fvwex8jL%TV) zdA4Rr`3uZR)1W4G_M|y;!Zl8Z-8taSf~9%j!r-U-*hAchF?7D|yi^AO84rMh>T01% zXV-E>Qd;356rNH;Y|3(<&>oMuv%qf+@@7n7sHQvM88FUwonH(DK$7F1(g|)?fdY@Q zWF(U+R!9#|3OYy1x(1|})1}8KWgd!^u!yFapVGU)lGNjqgsvfJJtCdv@z_K22_P89 zVwZva7rF%zKgKAF6*-4m=kSaRxc7lB@TWDmQ4auo5Ap;7pjl7$a=M0#MTk&?t)AOu zFU(Pmt5cLDuU+ZWyyoZ}<#?8`$kGU54Y71lA-1kjoN5%I^7UdtJkBZIgqB8N*W2I; zoHR$V$ejlaADg!@&L4p~NiDP>5zdYw0C2Nj0Pc7Iq}1A%yfr-KS#s;Um2{q@> z(GSxCB-L+7vyHN@8}0#`^$&BLL#|E9X-<;!CSe``f@uhOku&NTK#)-$!d#G}vRepK zxLOb31SpBQa+X$N2+wN(08d)`{Tf@YsqL$`7^NrXR=+MS0S@aPkNehz9BslBfyjDs zu>o_KBY^=B@7js1WW!d0DqeDeo+(%yG8c zsT|$r>Zi%s?_=76QKawi1?dCR0TGAwv_R}aj!^jN9{2+QkoNXwVd`R-nwzFQknUQK zAgpV=^$;So0x7i(1${5jrRFoq9YcZFMLjlkErshr6xd2!y@xRO9BG~*#-IpI5a%>h z;S{I?s<7YO1qjl{+o(}oM&c07oBnzMxb5xEV<6d~RWKGJd=#k)JC~#u=Mm2{B|IaD zMRARw3l%*|Pth;TGZcBP=uRH?p5}HcQlBDd<4kPGPvE#>a@#Kuq?PL-bBojC(7OWQr;}bR$5L{%V$~7wvZ(hF@2)6 zCIHx43()^5{%GQ&{(`VfyKtKGZUjKw z0PYG;5Gu3}S-w=s5`cu-jJ&>RiK14RF-sMFxsp|!X{ZFwji(E67~c#_&?imkg`QRXDD>OVky0xIznfYA=Ca1qqU`)5=NS%0u*thRFo4lj3A3xN>2k)v<6Y;$2`r>QmbvLyeO@xZl`DoqHIxYjBW1#Cw_&Np~AP1 z_Lb@g&mu$Ql^jFT^1E3d=v||<3H9Ex(ThnAMKte4-isd6JylXAo(wLgV zC}&SpPli*3EwA6i*EtA5DWm> zdCB{?UeE~dt#CnGac?${Vb7c4j!Jk8Z(#uI^9VVGgll0#X>J7t0^oX00Qw-PI3>Ll zFN=F0#Lg0cJ~%2_Leq|G6!{w|{`?aFhzAGYD#TgX;#5ogh5<0YhK|HOw^a6TZv3Ga zd*I7mNyA>O-@JznZgpv|C;ml*36oLLFM0sP>IIxUA#&Q*Mi6giUW~sF=!N#~G9Q5Ko5BUN7Z7~JoI|)D z0vuuUIsn>**5(j9PMX6LUPovs0IeVaAglTw;+Ck7+fa##(9H-@l=M>f`}EkNkJh7) z{{I5wQP%4vcPlxq^{@c+DM<3PNeF4hJ;Zq+BKHG^56r8~|3H6QeURhbZuXGo%wb$D z0P@$*=Ys-Jh7q)Me7Z+Bzd6r0OUWF4YGKO5SCGrEPF>p0ew04vpKQBP-hmBZ! zk^C{$VV7^pt2M*p>*tdB{Aec=5X?^Q&-~5jes4>-km&PIZI2KbIGMxP5 z%+2t1odsZ_5dbv8223k3tE1W$;G8e+*Ys3X%1;77SG@pSApmonSgq8#F^rI4e~8+d zq!vav-H$NVL){b_M2$h@iqJMDyses+2^`_#Hb$O9)c78zTNxtSa+2zDi1T91vk2|b z@q;}57rj45{XfQ+B%=SvklKTBFYC|+24EHsIF4`_jqbujZsB^C&c|VPWDY?dD5(tH zk#?3#t+OcIg}dc`m8zZy?^yB2b1#0J$+R>xaq&E;| zk#mgsvk>*P(jJz~5`t)O05a&p1UgV;n8S5~VM1L`$?%4PM9w6&8-NQN1i+(p5q$}O)4>6-^r+!Ltf%Ofide!M20){L zaJ4h{#BSeiAOMr*RJ{PiJpkSTog(cykSnJp4FcdO0f-Z+o0w@sxP)uS3?nAjGkk}0hGo;Zw(z&xE#PY5y^VbRtY>5U5!%3YiDi<% z8#y7|Lug01?&98}CBx(oq3vN%8=qv$_TxItdmFC9%xwX03u{Y1Lj1vWAOK<>0Na6XY?vxAgzViif|OD7;VfGkoU7iNw=|$9Za|2zMrLS zoh)r3haHIh$Z-K^4Gutz`nR9DeTkzQV<%#&@zy4^FnxwPDkF85F`(V~_mrdCP*(CS_z0H{rc z&(*%WPu0(-aTK2Ngw?b%i528ny#RC*fJazMPXgx$W)$~9q^>ci1MxxLZH|2B<9%MQ zfd;`p$lPw!9c5a$q}Hgf?0vR!jjhj^(f3hI}yos<6dVLa|=|DJ1dJ}naO`t?NJBqZ#J8<2BPVCSw?n8}NSg(T}wlv7H zo#ea5vYiO~Q1T{X?<4;e1y{K3^Q5go+(QgS_G%x?b|R+(HTID!#CTCZz?&go?rOrOB*NuEBAJw>9YoAvtSNAzGwh4WLeSSBG zAVdhd87w8do}FZQU;xf~06d*!a<0rBt%{FUl?|?<)zJW@?q4K~n&#jD2%>J2-Bk~` zrkYyR>3)(xBvvKfMo`{l>Ib0913+}{O-|hRp|S6Ca_?0A?trH+pokqfiP8@0r|95T z0O39W_(?DTWJA$Jp>HAdLc9~y)}6?g>xU?n7niS@Bud_-89KrAhsb%j$s~V0+yDUT zqfs-l=>Xg_Y4hG@0k9P)5CG9<0)X4*$QK!aoEfSgfX-(GfWyH6kS*m$rib6?=!0dK z50sohdK~F-#4`MKmvG4aLw*5xYRga-i*elmobdo?;^OuZ#Qhh3qoa?h*C4DcfqndJ z*%b0VM4s?$B>+<9-9`a$!ULd*bb>yBz>(ok9$%v$(1ftH0B8yh!1kq4Gf+POA3P%f zyd4yP$!$y-bF+Q`BF_W>*Uel14?vv&v_As?+%f&;$6ss!l0g9|dY?_-j+Evv)4#v~ z48cvS8-UZg8QRVO$Orci1_Pj?AFkYvl!5pG0C?N`VDq(}lcK7l%>3&VR zSCeuz$^EYI5XHY>_WVzM0Q||1a{b2tKYz}9pD~;Be$_Wy^%=8i{pe}23Z}`bFTnc0 z23-A7WO;LtA>AR_uTaVlUWQ16q!hn1y7Y}{`*qQNP?FR~xonMZ#v(1{?Xa%yyg7IHl>jBW9Q$TzjMCp{PNmA zt^K_7Rp&QgJpRV{2j_>*kG3WK5W@ep^Bw0`ofp^sarNf_!B?DLaemwR1Lxb@mVV#) zP3IfV3-$gd3tz&-c@fs&rEN=JgYZAMk^g1;w*B{iMXW84%{@oI00000NkvXXu0mjf DzNOoX diff --git a/form_elements/images/video.png b/form_elements/images/video.png deleted file mode 100644 index dbfd3f8f7860699443411caa3feab1cd02be676f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6865 zcmV;?8ZPCDP);dH&A1x7V4mG>bG^Mv^6Y@P=i_mXW~= z5E7^g@L*ETLyAzmkcuIdR4OS_q>={;93Ys0otRYN6vhNx2_YtBpn@rbNg_K~rNpwW zu}90ul5Ba_o}S*9dzL($d+ySGXXf@cx;^Mtb@fb7ch5cNJOB3m|M?HW8rO$E{M*Ro zGW4E%ek*37zUzxjg4)c9vT|R0YXZN7Zw&W z|M-n>JU)H&=r7sK%nRs;YgH7+$0spAKSSd2y|D)${QU3l*|YQ0LqkJ*Vlfk@Nnsci zloA_YYCix%i2Y21{~^)O1cQSq?Ao<0%F`nlvrsD4z&W?-b?c=wXU>1>{`>#*#M!gw z7%(4sfX&tZaMMjkkW7xz_rCYt`$tEIKb%gd_LwFGrGRM~NT*W{$S%+X#3RlmShVfe z2~w#941-2_eyCx@VVWjZRtkxDJa*f`gL@x&=%FwE(FZ^H?&AP>Ujn>y=T1EH%y)48 z^|!~z#UfE0|&0gfde2{T{V`d*V$Eoh)XFUB``8Fgn@ws z00}7t0BQdWa4x~Qgb?a?Dfq~|pkYz?>&2moD13S24m zy$Ty(4#pTP%K~E@rb)p$M?QV>e%J-c`B`23H5 z{GWG8xqzKJe=XVo6QTeSLQ2l1bZwGwyvj~hpx0(c%h{41-#~g6y7D(T=OBb2k%%La zPzzlM4f6N{Pd)Xscg@beNFojJ^70BUT$q!bS0(2{3L&HrN<|C7JDx!QBu0<-(Y^*i zAf?pav;8v%KtQSCn4fsugp`sHLhstWd)F7f|NWmH0YIX#fCB-pRI1433fe=KjH#8Y zJZaH2X^Dy*_S#?f{``wjnH9jYI0#W>kCx(OGJ$wJ1}Q-)HSXHGclVdS_r3qPoe)AV zH^{51=tROqy)L9>aiJV7H{5Ce5{?J0!=@;yXSI0cnu|b5umU(9*G^;%i9`&Egb6}G zP1AVSzI_v4ed389-gebhdkg>=9UYIBlSK$1C4sG?Ap`?s%tLOp39;}JA(1A50;O7O zFiHtb(?mQTb5wOAq0}`XsbQE$4jkC`&?Arh-7QCs{6;L3naBS9*F}S>^ngsH6ktrL zX@Js+ZDS+#6N6(m@GKGv?TDooE4oTCHxFrumM^$pe3X|NZxWYH)Dy-*J_gnqvUIUd()T1#^bgb>3t z&D$p@4?gnIkN)0GhYsCln&xm+R5Y;%B_v~9DsVe#; z$UIQ;wN3WgWBs#X7-l?f9zJ;R>W4q`nFnqOLooH+i>A~BAxtvH1!G(?#=w{gl`54g zgpi?FEd3Bd!m^mh$%=}K_TC3^V&Byq$sm9=$fikQnlVR3H-a3C#g6RXzxScX9((fe zMu8mYWR=SmR4Nh!0~R=ELI|az3E^OjBa_L4b7^~wZa#Q*y9U&17D}axGnoqX=!vna zM!~9fcr}0<9j{c%EqHKAlbR8an|JKnH}T-NzV+m%KmPHL{PMB@ys)qYAP>_Vl~Qsj zqC@3Gg^;M%EzHknKq>V|smlbZfx6njs~Oxu%Lox2u7ls+e}wL}C%CF03h%RmWcjE7n*+9qo?tsF3waf`=eG?|Rwy<^AtUqAl%lReERn`>cD zDYrouHi+C4DoIc5$L$I5)@IQL$yF2Qt>20olhr86!8TZg)(DhR#9}c=?Q3ObFCZ$V zyk~rT{Bz&@=D+=wl=3-3$i@P!SS;x{SpXbIOG;^1Qj&%nSF4{=>9Nbiskqc8OaUw+ zpqfbo@j_Nr(S#tB1h1#AJ+_`oiTCW-vHf$8KKd_zDW!a#kX-;~HwNHZO@J{KCNZX* zEFHsAs`9&D+e>Z3>z2m4-=;z=>6_T~9F}N+FKulkK!~(WQMjVQMvxN;zawYopNW+6 z-4heL9{9#L{`oI}*{*Xc{*iI4qZlOAs- zlf&59)|Npw4CTBglcXsY2P73j-o0nf?k_+5@IU<-A>_D}QgjOPIsi*Mi=^UT1qw$h zm1wYAA^(|a!Y$b$wkHh`5>*wgR5PW3loauJ3_Evj!?VvG!{p>XY}+>MY`xJMsj>LK z(Ns~Y7B*uX^|}SiV&GgtN`hoEP66C`_0@a-_G@2z{Etm@^aKFDWy>gXxlFeKRyVD9 zXk~XfCw6s1`-tdr)F=@h+K*6iesi`=|J^hVyzOoKkVqu4yqrg&P=;kOtgPfvF4sT^ z5Q~`@9UVp@5qE0V{6q-#grd@M-0F2^3lV5CY2LAa|DK1x^rgS~!-pUK$}1NyzQ%eY z!8Q*qI9E&-rMhINJ=>}CsfraNp+k<11G(A3(qNk=0b>SIsRXXMW;ZNL-FrS?M6p;# zy)!B@WW**UaX zrD%qbIH}@a212BhaA@bU%WxeDj$TSw#qVk%uWo|Wo-7I}6`A367qYBdWZBU{W=D)sAxB;LM#``+b+g^SfLGFg5CKnP*Sznvur6cglqbXFa* z(Xnz6G2#bJHWUO<=h+P*S5L_3@3Jflxm*FYT0Lf2>|i_|OSNkk&Gl$I&KY!Fw3o?h z$9$^q@Jg_flqfk_YNC}Cs|ptCs9ANN1^^C9{d3^WK5ffO(dI3BMG zd%RU3!edv7{aHY5en1nrLI@wAjSiU*5|mO>sZ#z?+hJ;F;PhBm^QK+yUeAxxZUptZg<7o!&N=Ne zz;9`H0vcS-nX_N1UCC1_T0~xgy;7{4S66Kdq189F7l2hO=icqExCNnM`=bFIM%UITx6l%OIQ0`LJAG&Ve!3k&m(# zz*60hyXnj@RMFhb%p2gGBNmIT>uu^)TdUPDKfegeV$S>ep)Sj-K6MzSyk+U3AN^UP zT&{?0wh%a_u7fFk;gxqIpO*McCJW25dPP-geWEs>xg>?e%1QxKQ!|bPyTGp2!hyiD zn2*YfO0pqre5|WkR8HGf&1x*t8JimmlO}IjN;nA`y&bhNOw{i!7K^A<${qVD>k=Jy z6^0|pj46-0TCMwfa(IDlEYtB1p4t>0@i|<50W)#KN9}ldt3ZMjn7{LZXfUU%ZVsLP<<9iLEqPb&#m0I#|?eGKXttTc; zs@_ky)4m0`nG|yO4-+DB9PsLbenQ}>2qCLR2tnbcVNhf;85E14jIyoi-rS6cBMOxlzh#Qp?{q#gdi{0pJPQL$&HoZ#+&GL z1Gp;QW-~-t=KDv(+qP1dLve+pm@90_Cp(`*2g7%J0M!I-}aAUbO7HY*H}!BOQL8Qi@Wkj9jjW-MhDkjAd0V^_eplFgLg83!!ul zpvQ4Am);)ALI}*yXD~c`RZGD*Aq4q+!S2(+0nonc3cvb-_4gd9)#`ZRg_kftpFunx zTlKT$as^9E%TB@GnKS2c;libW%FCWhu)kr75CSj0_$nA<*tv6iNG_V-jW_0S_UuK} z>vaTmbKMM~k|sE2XBUyltgIpc1oe6y7cahn<>eJe#amY0mp9*F6)k->cy4Y9xm*#c zR5BnT9kg?f*o|GPzWnHBNjA8ojr4#RTyMrX$K2dJ=I0lDW-e&c+J?u$UfWP8lu#&? z){$IS#ZXF|st5JFnWQ&d$R~ur@^Ti7i;JP9wNpPO1i*gI*?Yi7D-2Jwv~G?#*jxC% z)|^NwQ7jfPH#ZC24x=@Otj7}U7IyQlwO(l45zv2Rh98BZwZ=b~2*sw!fs2Xx}O*Q}i_uq-rr)O~V=u+2m!7Vyj z?rJ)6QEJ-hKH?-H!f41;DyfeJ z@M+3U&0&b8;sT)uaq!?oXmGtDz}VQZUCN?Eu1zDqO+0<4nK$i0cPa#J=>pXbh_rRX za#PjWktR0IZS@$9)f+0=5M+!oQ6xCL>Qo4|<)mJ(bu=z_Tg%1(Y+qUm zdD|`d)n~Yq4~}L-(smZCfMr?8=ZjFs-_;RxR8K2{)GaT%Wfk42U2wO)h)q%Wu6toG zE-qtnamg-N@8$yPxdb=IeVw#$&@rQ~g6Q|lvMgjW%gAQ4T~)2!GG8>j`j8!~4P8~q znAjxSR#ZnEokZz=vY_))p3qEIH;%$-Jk7J8<6vDU?rmz;kv~q>p0l0;thY>R_Q@sJ zWy_PIsXao3qo#uj!J``%=`^Q=VNfR|(sNO*R_qps;Z-al1hcctSXn9f8j^2_4R-CY z8^|v%X6=d&(vrF<7E7Lev;9~2uA70o5k=!BGJ;B_f*<_gr}6X|p+ln@9ZFf;Qy zPM<#4Rhlw1z>QAUv(FyGz(5M)<0GLfI$nG29A19;G-|ba*O;D-42M*ItZ?sr{q+mD zbZNE)u+%{(x_^gXu*Aj!ETzE3i*Mqw$G-1t6STg!$xyA_yh+h8wQMJ@*{J=;+pUolru6dfmdYV<+(Z^T+LWhQxDkooUdP0j^eS7#SJH z4L4katy`}O&E8}(D>!xP9IDl7R|5Fi>~W58y)|dM^$gx;AvOo)ChGiE%6~ zWpMoXD_z|m+%mxVd>-$4&pUDNy}yZ6D((;fK+w*07r=74hVOp&hnSi=wQWo4j;Y|hN0Ts+OPUr>$;%3J+qR@ zIQH({jnk)Jw>#~0cISTQL-<~IPc7RBGa$Pr{f%ID!$)b$$x0^U4R(~<%#mBTIf}8dtw^U+p+8qHS1>j8 zT9*>xQ3e@!`Q<50O-;8{W$8V3*W2b|1E@;gq-I}z^%TDP)di$d$!Qz}e-kH9p6c3hF;SJ= zbUKaqz3*-uIdXI8aZ*Zg(@odm(MO-aOD|1%4wc@ZY?4+N`c#oyZ#{&2?|nbU$45g0 z{N|f;_|A9!9aB@&PAN+__B&l}KpWL)GMU7dE$Tq4u>G(AVB5A~Y~4E4P|(J5`*Hg8OxOBsMHTdRHr53t_bX(jw83{D7>l@f_T15c;@OdsOT%#MoMvKI~%S5yvZ-R{tCL{99=H2*)@Uf6GJ_$ zi~iNT7-RO14-&c{LLFFALb+T;w|i%|ymduNV0k$gs#?LPDk!mc_;1FF4(S0ZkK@Nr zA|8(;nT&_hev}fNI5CZL=iaa@Ixb^2NlJ;MNB*E8Skkp{#K70(1gXiiVTB-F@{%PJ%y7er(06dn`;l!`hd0T z-!R5K37*ajnz{asg4AjiqW2L|O6|NZ?a0|uE0%&%x+d_!DvGqQ_cpwv82p`b)$gQK zfuSl-+uif*uL4nLJLn`1k=1IY#5t2a16YV^wp1!)^7$1clSv0)g^6r?0u94JEM_8^ zjDu3|F?TZH5DtM^WoL!Qgv=H{z zsa300q|*cWVsUxavZ`&K9cZ%6b0ULWAu*#%@WSrm(fRp({3Ica=dpIXB? zLo%7FT)K4bC)w=WJOHZ~080Q2K($iIo>*G4{S=Y`;B z0h|M{2%y>vfGL244e~gE?Er=V#L=(EmGuD`2A~Ka17Oa6uAp%TLYDvr0K=B#G=KpB zDf_i60QZIx698%eO7^4HF1Tm`Bw|amVXNmWS*YHE%sr2en2!GkU*YYEOQEBA00000 LNkvXXu0mjf3~mVI diff --git a/form_elements/includes/autocomplete.inc b/form_elements/includes/autocomplete.inc deleted file mode 100644 index 90ead4cc..00000000 --- a/form_elements/includes/autocomplete.inc +++ /dev/null @@ -1,234 +0,0 @@ -escape($string); - $query = 'name_personal_t:'.$string.'* OR name_organization_t:'.$string.'* OR name_conference_t:'.$string.'*'; - - $additionalParams = array( - 'facet' => 'false', - 'qt' => $requestHandler, - ); - - try { - $results = $solr->search($query, 0, 10,$additionalParams); - }catch (Exception $e) { - drupal_set_message(t('error searching ').$e->getMessage()); - } - if(empty($results)){ - drupal_set_message(t('Error searching solr index. Is the solr search block configured properly?'),'error'); - return ' '; - } - - header('content-type: text/plain'); - $matches = array(); - - foreach($results->response->docs as $doc) { - - $item = new fedora_item($doc->id); - - $mods = $item->get_datastream_dissemination('MODS'); - if (trim($mods) != '') { - $modsDom = new DomDocument(); - $modsDom->loadXML($mods); - - $xpath = new DOMXPath($modsDom); - $xpath->registerNamespace("php", "http://php.net/xpath"); - $xpath->registerPHPFunctions(); -// echo $mods; - $nodeList = $xpath->evaluate('/mods:mods/mods:name'); - foreach ($nodeList as $node) { - - $type=$node->getAttribute('type'); - $title=null; - $name =null; - $given=null; - $family=null; - $date = null; - $nameParts = $node->getElementsByTagName('namePart'); - foreach ($nameParts as $part) { - switch ($part->getAttribute('type')) { - case 'given': $given = $part->nodeValue; break; - case 'family': $family = $part->nodeValue; break; - case 'termsOfAddress': $title= $part->nodeValue; break; - case 'date': $date = $part->nodeValue; break; - default: $name = $part->nodeValue; break; - } - } - - if ($name == null && isset($given) && isset($family)) { - $name = (isset($title)?$title.' ':'').$family.', '.$given; - } - - $role =null; - $roleTerm = $node->getElementsByTagName('roleTerm'); - if ($roleTerm->length > 0) { - $role=$roleTerm->item(0)->nodeValue; - } - - if (strpos(strtolower($name),$string)!==FALSE) { - $display = $name; - $matches[json_encode(array('type'=>trim($type),'name'=>trim($name),'role'=>trim($role),'date'=>trim($date)))]= $display.' - '.$role.' '.$date; - } - } - } - } - drupal_json($matches); exit(); - -} - -function ife_autocomplete_marcrelator($collection, $string='') { - $moduleRoot = drupal_get_path('module', 'islandora_form_elements'); - - if ($string == '') { - $string = $collection; - $collection = FALSE; - } - - $string=ucfirst(trim($string)); - - $dom = DOMDocument::load ( $moduleRoot .'/xml/relators.rdf' ); - $rootEl = $dom->getElementsByTagName('RDF'); - if ($rootEl->length > 0) { - $rootEl=$rootEl->item(0); - - $xpath = new DOMXPath($dom); - $xpath->registerNamespace ( 'skos' , $rootEl->getAttribute('xmlns:skos') ); - $xpath->registerNamespace ( 'rdf' , $rootEl->getAttribute('xmlns:rdf') ); - - - $result = $xpath->query('/rdf:RDF/rdf:Description[starts-with(skos:prefLabel, "'. $string .'")]'); - - $terms = array(); - foreach ($result as $term) { - $termVal =$term->getElementsByTagName('prefLabel')->item(0)->nodeValue; - $termVal = preg_replace('/\s+/', ' ', $termVal); - $terms[$term->getElementsByTagName('notation')->item(0)->nodeValue]= $termVal; - } - echo drupal_json($terms); - } - - -} - -function ife_autocomplete_gacs($collection, $string='') { - $moduleRoot = drupal_get_path('module', 'islandora_form_elements'); - - if ($string == '') { - $string = $collection; - $collection = FALSE; - } - - $string=ucwords(trim($string)); - - $dom = DOMDocument::load ( $moduleRoot .'/xml/gacs.xml' ); - $rootEl = $dom->getElementsByTagName('codelist'); - if ($rootEl->length > 0) { - $rootEl=$rootEl->item(0); - - $xpath = new DOMXPath($dom); - $xpath->registerNamespace ( 'a' , $rootEl->getAttribute('xmlns') ); - - $result = $xpath->query('/a:codelist/a:gacs/a:gac[starts-with(a:name, "'. $string .'")]'); - - $gacs = array(); - foreach ($result as $gac) { - $gacs[$gac->getElementsByTagName('name')->item(0)->nodeValue]= $gac->getElementsByTagName('name')->item(0)->nodeValue; - } - echo drupal_json($gacs); - } - - -} - -function ife_autocomplete_language($collection, $string='') { - $moduleRoot=drupal_get_path('module', 'islandora_form_elements'); - - if ($string == '') { - $string = $collection; - $collection = FALSE; - } - - $string=ucwords(trim($string)); - - $dom = DOMDocument::load ( $moduleRoot .'/xml/languages.xml' ); - $rootEl = $dom->getElementsByTagName('codelist'); - if ($rootEl->length > 0) { - $rootEl=$rootEl->item(0); - - $xpath = new DOMXPath($dom); - $xpath->registerNamespace ( 'a' , $rootEl->getAttribute('xmlns') ); - - $result = $xpath->query('/a:codelist/a:languages/a:language[starts-with(a:name, "'. $string .'")]'); - - $languages = array(); - foreach ($result as $lang) { - $languages[$lang->getElementsByTagName('name')->item(0)->nodeValue]= $lang->getElementsByTagName('name')->item(0)->nodeValue; - } - echo drupal_json($languages); - } - - -} - -function ife_autocomplete($field, $collection, $string='') { - - if ($string == '') { - $string=$collection; $collection=FALSE; - } - - module_load_include('php', 'islandora_solr_search', 'Solr/Service'); - $host = variable_get('islandora_solr_search_block_host', 'localhost'); - $port = variable_get('islandora_solr_search_block_port', '8080'); - $appName = variable_get('islandora_solr_search_block_app_name', 'solr'); - $solr = new Apache_Solr_Service($host, $port, '/'. $appName .'/'); - - $additionalParams = array( - 'fl' => $field - ); - - $query = $field .':'. $solr->escape(strtolower(trim($string))) .'*'; - - if ($collection != FALSE) { - $query .= ' AND related_item_identifier_t:'. $solr->escape($collection); - } - - try { - $results = $solr->search($query, 0, 10, $additionalParams); - } - catch (Exception $e) { - drupal_set_message(t('error searching ') . $e->getMessage()); - } - - $docs = $results->response->docs; - $values = array(); - if ($docs != NULL) { - foreach ($docs as $doc) { - $resfield=$doc->getField($field); - - if (is_array($resfield['value'])) { - foreach ($resfield['value'] as $val) { - if (preg_match('/^'.strtolower($string).'/i',$val)) { - $values[$val]=$val; - } - } - } else { - $values[$resfield['value']]=$resfield['value']; - } - } - } - - return drupal_json($values); -} diff --git a/form_elements/includes/creative_commons.inc b/form_elements/includes/creative_commons.inc deleted file mode 100644 index 7213cb74..00000000 --- a/form_elements/includes/creative_commons.inc +++ /dev/null @@ -1,117 +0,0 @@ - 'International', - 'ar' => 'Argentina', - 'au' => 'Australia', - 'at' => 'Austria', - 'be' => 'Belgium', - 'br' => 'Brazil', - 'bg' => 'Bulgaria', - 'ca' => 'Canada', - 'cl' => 'Chile', - 'cn' => 'ChinaMainland', - 'co' => 'Colombia', - 'hr' => 'Croatia', - 'cz' => 'CzechRepublic', - 'dk' => 'Denmark', - 'ec' => 'Ecuador', - 'fi' => 'Finland', - 'fr' => 'France', - 'de' => 'Germany', - 'gr' => 'Greece', - 'gt' => 'Guatemala', - 'hk' => 'HongKong', - 'hu' => 'Hungary', - 'in' => 'India', - 'il' => 'Israel', - 'it' => 'Italy', - 'jp' => 'Japan', - 'kr' => 'Korea', - 'lu' => 'Luxembourg', - 'mk' => 'Macedonia', - 'my' => 'Malaysia', - 'mt' => 'Malta', - 'mx' => 'Mexico', - 'nl' => 'Netherlands', - 'nz' => 'NewZealand', - 'no' => 'Norway', - 'pe' => 'Peru', - 'ph' => 'Philippines', - 'pl' => 'Poland', - 'pt' => 'Portugal', - 'pr' => 'PuertoRico', - 'ro' => 'Romania', - 'rs' => 'Serbia', - 'sg' => 'Singapore', - 'si' => 'Slovenia', - 'za' => 'SouthAfrica', - 'es' => 'Spain', - 'se' => 'Sweden', - 'ch' => 'Switzerland', - 'tw' => 'Taiwan', - 'th' => 'Thailand', - 'uk' => 'UK:England&Wales', - 'scotland' => 'UK:Scotland', - 'us' => 'UnitedStates', - 'vn' => 'Vietnam'); - - public static $cc_versions = array( - ''=>'3.0', - 'ar'=>'2.5', - 'au'=>'3.0', - 'at'=>'3.0', - 'be'=>'2.0', - 'br'=>'3.0', - 'bg'=>'2.5', - 'ca'=>'2.5', - 'cl'=>'2.0', - 'cn'=>'2.5', - 'co'=>'2.5', - 'hr'=>'3.0', - 'cz'=>'3.0', - 'dk'=>'2.5', - 'ec'=>'3.0', - 'fi'=>'1.0', - 'fr'=>'2.0', - 'de'=>'3.0', - 'gr'=>'3.0', - 'gt'=>'3.0', - 'hk'=>'3.0', - 'hu'=>'2.5', - 'in'=>'2.5', - 'il'=>'2.5', - 'it'=>'2.5', - 'jp'=>'2.0', - 'kr'=>'2.0', - 'lu'=>'3.0', - 'mk'=>'2.5', - 'my'=>'2.5', - 'mt'=>'2.5', - 'mx'=>'2.5', - 'nl'=>'3.0', - 'nz'=>'3.0', - 'no'=>'3.0', - 'pe'=>'2.5', - 'ph'=>'3.0', - 'pl'=>'3.0', - 'pt'=>'2.5', - 'pr'=>'3.0', - 'ro'=>'3.0', - 'rs'=>'3.0', - 'sg'=>'3.0', - 'si'=>'2.5', - 'za'=>'2.5', - 'es'=>'3.0', - 'se'=>'2.5', - 'ch'=>'2.5', - 'tw'=>'3.0', - 'th'=>'3.0', - 'uk'=>'2.0', - 'scotland'=>'2.5', - 'us'=>'3.0', - 'vn'=>'3.0'); - - } \ No newline at end of file diff --git a/form_elements/includes/filechooser.inc b/form_elements/includes/filechooser.inc deleted file mode 100644 index 6bd077fa..00000000 --- a/form_elements/includes/filechooser.inc +++ /dev/null @@ -1,138 +0,0 @@ - -

      -
        -
      • Generating File Previews...
        (this could take a minute or two.)
        Loading
      • -
      -
      -
      -
      - - '; - return theme('form_element', $element, $output); -} - - - -function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) { - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); - - $mimeClass = new MimeClass(); - - $cm = ContentModel::loadFromModel($cm_pid); - $cp = CollectionPolicy::loadFromCollection($cp_pid); - $path=$cp->getStagingArea() .'/'; - - if ($cm !== FALSE && $cp !== FALSE) { - if (is_file($path . $file)) { - - $mime=$mimeClass->getType($path . $file); - - $allowed_types = $cm->getMimetypes(); - - if (in_array($mime, $allowed_types)) { - - $thumbnail = ''; - //executes ingest rules with the "preview" parameter set. - if ($cm->execIngestRules($path . $file, $mime, TRUE) && isset($_SESSION['fedora_ingest_files']['TN']) && file_exists($_SESSION['fedora_ingest_files']['TN'])) { - $thumbnail=$_SESSION['fedora_ingest_files']['TN']; - } - - $thumbmime=$mimeClass->getType($thumbnail); - - header('Pragma: no-cache'); - header('Content-Type: '. $thumbmime); - echo file_get_contents($thumbnail); - exit(); - } - } - - } - -} -function ife_filechooser_cmp($a,$b) -{ - return strcmp($a['name'],$b['name']); -} - -function ife_filechooser_generate_thumbnails($cp_pid, $cm_pid) { - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); - - $cm = ContentModel::loadFromModel($cm_pid); - $cp = CollectionPolicy::loadFromCollection($cp_pid); - - if ($cm === FALSE || $cp === FALSE) { - echo '[]'; exit(); - } - - $mimeClass = new MimeClass(); - $path=$cp->getStagingArea() .'/'; - $start=isset($_GET['start'])?intval($_GET['start']):0; - $end=isset($_GET['end'])?intval($_GET['end']):50; - $thumbnails = array(); - $files = array(); - if ($cm !== FALSE && $cp !== FALSE) { - $allowed_types = $cm->getMimetypes(); - if (file_exists($path) && is_dir($path)) { - $dir = opendir($path); - for ($i=$start; $i < $end && ($file = readdir($dir)) !== FALSE;) { - if (is_file($path . $file)) { - $mime=$mimeClass->getType($path . $file); - if (in_array($mime, $allowed_types)) { - - $thumbnail = FALSE; - //executes ingest rules with the "preview" parameter set. - if ($cm->execIngestRules($path . $file, $mime, TRUE) && isset($_SESSION['fedora_ingest_files']['TN']) && file_exists($_SESSION['fedora_ingest_files']['TN'])) { - $thumbnail=$_SESSION['fedora_ingest_files']['TN']; - unset($_SESSION['fedora_ingest_files']['TN']); - } - - $res_array = getimagesize($path .'/'. $file); - $res = ''; - if (is_array($res_array)) { - $res = $res_array[0] .'x'. $res_array[1]; - } - - $size = filesize($path .'/'. $file); - $labels = array('kB', 'MB', 'GB', 'TB'); - $label = 'B'; - while ($size > 1024) { - $size=$size/1024; - $label=array_shift($labels); - } - $size = round($size, 2) .' '. $label; - - $files[] = array('name' => $file, 'mime' => $mime, 'size' => $size, 'resolution' => $res, 'thumb' => ($thumbnail != FALSE)); - $i++; - } - } - } - } - } - usort($files,'ife_filechooser_cmp'); - echo json_encode($files); - -} diff --git a/form_elements/includes/people.inc b/form_elements/includes/people.inc deleted file mode 100644 index 43cf52ad..00000000 --- a/form_elements/includes/people.inc +++ /dev/null @@ -1,288 +0,0 @@ - 0) { - foreach ($children as $key) { - $post = _dummy_post_info($form[$key], $post, $key); - } - } - if ($key!='' && isset($form['#required']) && $form['#required'] == TRUE && trim($post[$key]) == '') { - $post[$key] = 'not empty'; - } - - return $post; -} - -function _ife_find_people_element($form, &$keys = array()) { - if (isset($form['#type']) && $form['#type'] == 'people') { - return $form['people']; - } - - $children = element_children($form); - foreach ($children as $key) { - $found = _ife_find_people_element($form[$key], $keys); - if ($found !== FALSE) { - $keys[] = $key; - return $found; - } - } - - return FALSE; - -} - -function ife_people_ahah() { - - if (!isset($_POST['form_build_id'])) - return; - - $form_state = array('storage' => NULL, 'submitted' => FALSE); - $form_build_id = $_POST['form_build_id']; - $form = form_get_cache($form_build_id, $form_state); - - $args = $form['#parameters']; - $form_id = array_shift($args); - $form['#post'] = $_POST; - $form['#redirect'] = FALSE; - $form['#programmed'] = FALSE; - - $_POST = _dummy_post_info($form, $_POST); - $form_state['post'] = $_POST; - $form['#post'] = $_POST; - drupal_process_form($form_id, $form, $form_state); - - //ob_start(); echo '
      '; echo $_POST['form_build_id']."\n"; var_dump($form_state);   echo '
      '; $dump = ob_get_contents(); ob_end_clean(); - - $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id); - $qt_form = _ife_find_people_element($form); - - unset($qt_form['#prefix'], $qt_form['#suffix']); // Prevent duplicate wrappers. - $javascript = drupal_add_js(NULL, NULL, 'header'); - drupal_json(array( - 'status' => TRUE, - 'data' => $dump . theme('status_messages') . drupal_render($qt_form), - 'settings' => call_user_func_array('array_merge_recursive', $javascript['setting']), - )); -} - -/** - * Submit handler for the "Remove Person" button. - */ -function ife_remove_person_submit($form, &$form_state) { - - // Get the tab delta for the clicked button. - $delta = $form_state['clicked_button']['#parents'][2]; - - $keys=array(); - $qt_form = _ife_find_people_element($form, $keys); - - $peopleVals = &$form_state['values']; - while (count($keys) > 0) { - $key = array_pop($keys); - if (isset($peopleVals[$key])) { - $peopleVals = &$peopleVals[$key]; - } - } - - $people = array(); - $i = 0; - foreach ($peopleVals['people'] as $key => $val) { - if ($key != $delta) { - $people[] = $val; - } - $i++; - } - -// ob_start(); var_dump($form_state['clicked_button']['#parents'][1]); var_dump($people); $dump = ob_get_contents(); ob_end_clean(); -// watchdog('people_field','
      '.$dump.'
      ',array(),WATCHDOG_NOTICE); - - unset($form_state['submit_handlers']); - form_execute_handlers('submit', $form, $form_state); - $form_state['storage']['people'] = $people; - $form_state['rebuild'] = TRUE; -} - - -/** - * Submit handler for the "Add Person" button. - */ -function ife_add_person_submit($form, &$form_state) { - $people = array(); - $keys = array(); - $qt_form = _ife_find_people_element($form, $keys); - $peopleVals = &$form_state['values']; - - while (count($keys) > 0) { - $key = array_pop($keys); - if (isset($peopleVals[$key])) { - $peopleVals = &$peopleVals[$key]; - } - } - if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); - - foreach ($peopleVals['people'] as $val) { - $people[] = $val; - } - - //only add new person if we are not adding from repository. - $elName = isset($qt_form['entity0']['#parents'][0])?$qt_form['entity0']['#parents'][0]:null; - if ($elName == null || !isset($form_state['clicked_button']['#post'][$elName]['add_from_repository']) || trim($form_state['clicked_button']['#post'][$elName]['add_from_repository']) == '') { - $people[] = array('name' => '', 'date'=>'', 'role' => '', 'subject' => ''); - } - unset($form_state['submit_handlers']); - form_execute_handlers('submit', $form, $form_state); - $form_state['storage']['people'] = $people; - $form_state['rebuild'] = TRUE; -} - - - -/** - * Submit handler for the "Add Person" button. - */ -function ife_add_org_submit($form, &$form_state) { - $people = array(); - $keys = array(); - $qt_form = _ife_find_people_element($form, $keys); - $peopleVals = &$form_state['values']; - - while (count($keys) > 0) { - $key = array_pop($keys); - if (isset($peopleVals[$key])) { - $peopleVals = &$peopleVals[$key]; - } - } - - if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); - - foreach ($peopleVals['people'] as $val) { - $people[]=$val; - } - $people[] = array('role' => '', 'organization' => ''); - - unset($form_state['submit_handlers']); - form_execute_handlers('submit', $form, $form_state); - $form_state['storage']['people'] = $people; - //$form_state['rebuild'] = TRUE; -} - - - -/** - * Submit handler for the "Add Person" button. - */ -function ife_add_conf_submit($form, &$form_state) { - $people = array(); - $keys=array(); - $qt_form = _ife_find_people_element($form, $keys); - $peopleVals = &$form_state['values']; - while (count($keys) > 0) { - $key = array_pop($keys); - if (isset($peopleVals[$key])) { - $peopleVals=&$peopleVals[$key]; - } - } - if (!is_array($peopleVals['people'])) - $peopleVals['people'] = array(); - - foreach ($peopleVals['people'] as $val) { - $people[] = $val; - } - - $people[] = array('role' => '', 'conference' => '', 'subject' => ''); - - unset($form_state['submit_handlers']); - form_execute_handlers('submit', $form, $form_state); - $form_state['storage']['people'] = $people; - //$form_state['rebuild'] = TRUE; -} - - - -function theme_people($element) { - drupal_add_js(drupal_get_path('module', 'islandora_form_elements') .'/js/people_ahah.js'); - if (!empty($element['#collapsible'])) { - drupal_add_js('misc/collapse.js'); - - if (!isset($element['#attributes']['class'])) { - $element['#attributes']['class'] = ''; - } - - $element['#attributes']['class'] .= ' collapsible'; - if (!empty($element['#collapsed'])) { - $element['#attributes']['class'] .= ' collapsed'; - } - } - return ''. ($element['#title'] ? ''. $element['#title'] .'' : '') . (isset($element['#description']) && $element['#description'] ? '
      '. $element['#description'] .'
      ' : '') . (!empty($element['#children']) ? $element['#children'] : '') . "\n"; -} - - -function theme_people_items($form) { - $rows = array(); - $headers = array( - t('Entity Name'), - t('Role'), - t('Operations'), - ); - - foreach (element_children($form) as $key) { - if (isset($form[$key]['organization'])) { - $form[$key]['weight']['#attributes']['class'] = 'ife-people-weight'; - // Build the table row. - $row = array( - 'data' => array( - array('data' => drupal_render($form[$key]['organization']), 'class' => 'ife-person-name container-inline'), - array('data' => drupal_render($form[$key]['role']).drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), - array('data' => drupal_render($form[$key]['remove']), 'class' => 'ife-person-remove'), - ), - ); - } - elseif (isset($form[$key]['conference'])) { - $form[$key]['weight']['#attributes']['class'] = 'ife-people-weight'; - // Build the table row. - $row = array( - 'data' => array( - array('data' => drupal_render($form[$key]['conference']).'
      '. drupal_render($form[$key]['date']), 'class' => 'ife-person-name container-inline' ), - array('data' => drupal_render($form[$key]['role']).drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), - array('data' => drupal_render($form[$key]['remove']), 'class' => 'ife-person-remove'), - ), - ); - } - else { - $form[$key]['weight']['#attributes']['class'] = 'ife-people-weight'; - // Build the table row. - $row = array( - 'data' => array( - array('data' => drupal_render($form[$key]['name']) .'
      '. drupal_render($form[$key]['date']), 'class' => 'ife-person-name container-inline'), - array('data' => drupal_render($form[$key]['role']).drupal_render($form[$key]['subject']), 'class' => 'ife-person-role'), - array('data' => drupal_render($form[$key]['remove']), 'class' => 'ife-person-remove'), - ), - ); - } - - // Add additional attributes to the row, such as a class for this row. - if (isset($form[$key]['#attributes'])) { - $row = array_merge($row, $form[$key]['#attributes']); - } - $rows[] = $row; - } - - $output = theme('table', $headers, $rows, array('id' => 'ife-peoplelist-table')); - $output .= drupal_render($form); - - // Add our JS file, which has some Drupal core JS overrides, and ensures ahah behaviours get re-attached - drupal_add_css(drupal_get_path('module', 'islandora_form_elements') .'/css/people.css'); - return $output; -} - - diff --git a/form_elements/islandora_form_elements.info b/form_elements/islandora_form_elements.info deleted file mode 100644 index 70485b53..00000000 --- a/form_elements/islandora_form_elements.info +++ /dev/null @@ -1,7 +0,0 @@ -; $Id$ -name = Islandora Form Elements -dependencies[] = fedora_repository -description = Adds a set of form elements that extend/modify the drupal form elements available to the Ingest forms. -package = Fedora Repository -version = 6.1dev -core = 6.x diff --git a/form_elements/islandora_form_elements.module b/form_elements/islandora_form_elements.module deleted file mode 100644 index 094eff67..00000000 --- a/form_elements/islandora_form_elements.module +++ /dev/null @@ -1,1046 +0,0 @@ - TRUE, - '#process' => array('ife_fieldset_process'), - ); - - $type['textfield'] = array( - '#input' => TRUE, - '#sticky' => FALSE, - '#process' => array('ife_sticky_textfield_process'), - ); - - $type['textarea'] = array( - '#input'=> TRUE, - '#sticky ' => FALSE, - '#process' => array('ife_sticky_textarea_process'), - ); - - $type['select'] = array( - '#input'=> TRUE, - '#sticky ' => FALSE, - '#process' => array('ife_sticky_select_process'), - ); - - $type['list'] = array( - '#input'=>TRUE, - '#element_validate' => array('ife_list_validate'), - '#process' => array('ife_list_process'), - '#sticky' => FALSE, - ); - - $type['other_select'] = array( - '#input'=>TRUE, - '#process' => array('ife_other_select_process'), - ); - - - $type['copyright'] = array( - '#input' => TRUE, - '#process' => array('ife_copyright_process'), - '#element_validate' => array('ife_copyright_validate'), - ); - - - $type['filechooser'] = array( - '#input' => TRUE, - '#path' => '', - '#model' => '', - '#collection'=>'', - '#process' => array('ife_filechooser_process'), - '#element_validate' => array('ife_filechooser_validate'), - ); - - $type['person'] = array( - '#input' => TRUE, - '#process' => array('ife_person_process'), - '#default_value' => array('name'=>'', 'date'=>'', 'subject'=>'', 'role' => ''), - ); - - $type['organization'] = array( - '#input' => TRUE, - '#process' => array('ife_org_process'), - '#default_value' => array( 'organization' => '', 'date'=>'', 'subject'=>'', 'role' => ''), - ); - - $type['conference'] = array( - '#input' => TRUE, - '#process' => array('ife_conf_process'), - '#default_value' => array( 'conference' => '', 'date'=>'', 'subject'=>'', 'role' => ''), - ); - - $type['people'] = array( - '#input' => TRUE, - '#process' => array('ife_people_process'), - ); - - $type['datepicker'] = array( - '#input' => TRUE, - '#process' => array('ife_datepicker_process'), - ); - - return $type; -} - -function ife_fieldset_process($element,$edit,&$form_state) -{ -// echo 'fieldset process '. $element['#collapsible'].'
      '; - - if (isset($element['#collapsed']) && ife_fieldset_children_has_value($element)) - { - unset($element['#collapsed']); - } - return $element; -} - -function ife_fieldset_children_has_value($el) -{ - $ret = false; - - - if ((isset($el['#default_value']) && !is_array($el['#default_value']) && trim($el['#default_value']) != '') || - (isset($el['#value']) && trim($el['#value']) != '')) - { - $ret = true; - } else - { - foreach (element_children($el) as $key) - { - - if (!$ret) - { - $ret = (isset($_POST[$key]) && (is_array($_POST[$key]) || trim($_POST[$key]) != '')) || ife_fieldset_children_has_value($el[$key]); - } - } - } - - return $ret; -} - - -function ife_people_process($element,$edit,&$form_state) -{ - - $element['#tree'] = TRUE; - $element['#prefix'] = '
      '; - $element['#suffix'] = '
      '; - - $element['people'] = array( - '#tree' => TRUE, - '#prefix' => '
      ', - '#suffix' => '
      ', - '#theme' => 'people_items', - ); - - if (isset($form_state['post'][$element['#name']]['add_from_repository']) && trim($form_state['post'][$element['#name']]['add_from_repository']) != '') { - - $people= array(); - if (isset($form_state['storage']['people']) && !empty($form_state['storage']['people'])) { - foreach ($form_state['storage']['people'] as $ent) { - if ( trim($ent['name']) != '' || trim($ent['organization']) != '' || trim($ent['conference']) != '' || trim($ent['role']) != '' || trim($ent['date']) != '') { - $people[]=$ent; - } - } - } - - - $json = json_decode($form_state['post'][$element['#name']]['add_from_repository']); - $form_state['post'][$element['#name']]['add_from_repository'] = ''; // clear so that if the form is processed multiple times, it does not add twice. - $person=array(); - - - switch ($json->type) - { - case 'personal': - $person['name']=$json->name; - $person['role']=$json->role; - $person['subject']=$json->subject; - $person['date']=$json->date; - break; - case 'organization': - $person['organization'] = $json->name; - $person['role'] = $json->role; - $person['subject']=$json->subject; - break; - case 'conference': - $person['conference'] = $json->name; - $person['role'] = $json->role; - $person['date'] = $json->date; - $person['subject']=$json->subject; - break; - } - - $people[]=$person; - - $form_state['storage']['people']=$people; - - } else if (!isset($form_state['storage']['people']) || empty($form_state['storage']['people'])) - { - if ( (!isset($form_state['clicked_button']) || count($form_state['clicked_button']) == 0) && isset($element['#default_value']) && is_array($element['#default_value']) ) { - $form_state['storage']['people']=$element['#default_value']; - if (count($element['#default_value']) > 0) { - $element['#collapsed'] = FALSE; - } - - } else { - $form_state['storage']['people']=array( array('name'=>'', 'role'=>'', 'date'=>'', 'subject' => '')); - } - } - - $i=0; - foreach ($form_state['storage']['people'] as $person) - { - - $person['delta'] = $i; - $type='person'; - if (isset($person['organization'])) - { - $type='organization'; - } else if (isset($person['conference'])) - { - $type='conference'; - } - - $element['people']['entity'.$i] = array('#type'=>$type, '#default_value'=>$person); - $i++; - } - - $element['add_from_repository'] = array( - '#type' => 'textfield', - '#autocomplete_path' => 'autocomplete_person/', - '#weight' => 4, - '#size' => 30, - '#value' => '', - '#title'=> t('Add entity from repository'), - '#description'=>t('To add an existing entity, simply start typing the name of the person, organization or conference and select the desired name from the resulting dropdown list.') - ); - - $element['add_person'] = array( - '#type' => 'submit', - '#prefix' => '
      ', - '#suffix' => '
      ', - '#value' => t('Add Person'), - '#attributes' => array('class' => 'add-person', 'title' => t('Click here to add a person.')), - '#weight' => 3, - '#submit' => array('ife_add_person_submit'), // If no javascript action. - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - -$element['add_organization'] = array( - '#type' => 'submit', - '#prefix' => '
      ', - '#suffix' => '
      ', - '#value' => t('Add Organization'), - '#attributes' => array('class' => 'add-org', 'title' => t('Click here to add an organization.')), - '#weight' => 2, - '#submit' => array('ife_add_org_submit'), // If no javascript action. - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - - $element['add_conference'] = array( - '#type' => 'submit', - '#prefix' => '
      ', - '#suffix' => '
      ', - '#value' => t('Add Conference'), - '#attributes' => array('class' => 'add-conf', 'title' => t('Click here to add a conference.')), - '#weight' => 1, - '#submit' => array('ife_add_conf_submit'), // If no javascript action. - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - return $element; -} - -function ife_person_process($element) -{ - $element['#tree'] = TRUE; - - if (!isset($element['#value'])) - { - $element['#value'] = array('name'=>''); - } - - - $element['name'] = array( - '#type' => 'textfield', - '#title'=> t('Name(s)'), - '#size' => 30, - '#value' => $element['#value']['name'], - '#description' => t('Please enter last name first, followed by a comma and first name.'), - ); - - - $element['date'] = array( - '#type' => 'datepicker', - '#title' => t('Date'), - '#size'=> 30, - '#value' => $element['#value']['date'], - '#description' => '
      '.t('Use this field to express birth/death dates. You may use the date chooser, but the field is free-form') - ); - - $element['role'] = array( - '#type' => 'textfield', - '#size'=>30, - '#description'=>t('The role that this person plays with regards to the object.'), - '#value' => $element['#value']['role'], - '#autocomplete_path' => 'autocomplete_marcrelator/', - ); - - $element['subject'] = array( - '#type' => 'checkbox', - '#size'=>30, - '#description'=>t('If checked, this person will be listed as a subject term. If selected, role field does not apply.'), - '#title' => t('Subject'), - '#value' => $element['#value']['subject'], - ); - - - $element['remove'] = array( - '#type' => 'submit', - '#prefix' => '
      ', - '#suffix' => '
      ', - '#value' => 'remove_'. $element['#default_value']['delta'], - '#submit' => array('ife_remove_person_submit'), - '#attributes' => array('class' => 'delete-person', 'title' => t('Click here to delete this Person.')), - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - return $element; -} - - -function ife_org_process($element) -{ - $element['#tree'] = TRUE; - - if (!isset($element['#value'])) - { - $element['#value'] = array('name'=>''); - } - - - - $element['role'] = array( - '#type' => 'textfield', - '#size'=>30, - '#description'=>t('The role that this organization plays with regards to the object.'), - '#value' => $element['#value']['role'], - '#autocomplete_path' => 'autocomplete_marcrelator/', - ); - - $element['subject'] = array( - '#type' => 'checkbox', - '#size'=>30, - '#description'=>t('If checked, this organization will be listed as a subject term. If selected, role field does not apply.'), - '#title' => t('Subject'), - '#value' => $element['#value']['subject'], - ); - - $element['organization'] = array( - '#type' => 'textfield', - '#title' => t('Organization'), - '#size' => 30, - '#value' => $element['#value']['organization'], - ); - - - $element['remove'] = array( - '#type' => 'submit', - '#prefix' => '
      ', - '#suffix' => '
      ', - '#value' => 'remove_'. $element['#default_value']['delta'], - '#submit' => array('ife_remove_person_submit'), - '#attributes' => array('class' => 'delete-person', 'title' => t('Click here to delete this Person.')), - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - return $element; -} - - -function ife_conf_process($element) -{ - $element['#tree'] = TRUE; - - if (!isset($element['#value'])) - { - $element['#value'] = array('name'=>''); - } - - - $element['role'] = array( - '#type' => 'textfield', - '#size'=>30, - '#description'=>t('The role that this conference plays with regards to the object.'), - '#value' => $element['#value']['role'], - '#autocomplete_path' => 'autocomplete_marcrelator/', - ); - - $element['subject'] = array( - '#type' => 'checkbox', - '#size'=>30, - '#description'=>t('If checked, this conference will be listed as a subject term. If selected, role field does not apply.'), - '#title' => t('Subject'), - '#value' => $element['#value']['subject'], - ); - - $element['conference'] = array( - '#type' => 'textfield', - '#title' => t('Conference'), - '#size' => 30, - '#value' => $element['#value']['conference'], - ); - - - $element['date'] = array( - '#type' => 'datepicker', - '#title' => t('Date'), - '#size'=> 30, - '#value' => $element['#value']['date'] - ); - - $element['remove'] = array( - '#type' => 'submit', - '#prefix' => '
      ', - '#suffix' => '
      ', - '#value' => 'remove_'. $element['#default_value']['delta'], - '#submit' => array('ife_remove_person_submit'), - '#attributes' => array('class' => 'delete-person', 'title' => t('Click here to delete this Person.')), - '#ahah' => array( - 'path' => 'ife/people_ahah', - 'wrapper' => 'ife-people', - 'method' => 'replace', - 'effect' => 'fade', - ), - ); - return $element; -} - -/** - * Our process callback to expand the control. - */ -function ife_sticky_textfield_process($element,$edit,&$form_state) -{ - - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $element['#type'] = 'sticky_textfield'; - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { - $element['#value'] = $form_state['storage'][$element['#name']]; - $element['#sticky_on'] = TRUE; - } - } - - return $element; -} - -/** - * Our process callback to expand the control. - */ -function ife_datepicker_process($element,$edit,&$form_state) -{ - - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { - $element['#value'] = $form_state['storage'][$element['#name']]; - $element['#sticky_on'] = TRUE; - } - } - - return $element; -} - - - -/** - * Our process callback to expand the control. - */ -function ife_sticky_textarea_process($element,$edit,&$form_state) -{ - - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $element['#type'] = 'sticky_textarea'; - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { - $element['#value'] = $form_state['storage'][$element['#name']]; - $element['#sticky_on'] = TRUE; - } - } - - return $element; -} - - -/** - * Our process callback to expand the control. - */ -function ife_sticky_select_process($element,$edit,&$form_state) -{ - - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $element['#type'] = 'sticky_select'; - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { - $element['#value'] = $form_state['storage'][$element['#name']]; - $element['#sticky_on'] = TRUE; - } - } - - return $element; -} - -/** - * Our process callback to expand the control. - */ -function ife_copyright_process($element,$edit,&$form_state) { - - module_load_include('inc','islandora_form_elements','includes/creative_commons'); - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { - $element['#value'] = $form_state['storage'][$element['#name']]; - $element['#sticky_on'] = TRUE; - } - } - - if ($element['#sticky']) { - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
      ':''); - } - - $element['#tree'] = TRUE; - - if (isset($element['#value']) && !is_array($element['#value'])) { - $matches=array(); - if (preg_match('/by-*([a-z]+)-*([a-z]+)\/([\d\.]+)\/([a-z]*)/',$element['#value'],$matches)) { - $element['#value'] = array('cc_commercial' => $matches[1], 'cc_modifications' => $matches[2], 'cc_jurisdiction' => $matches[4]); - } else - $element['#value'] = array('cc_commercial' => '', 'cc_modifications' => '', 'cc_jurisdiction' => ''); - } else if (!isset($element['#value'])) { - $element['#value'] = array('cc_commercial' => '', 'cc_modifications' => '', 'cc_jurisdiction' => ''); - } - - $element['cc'] = array('#type' => 'fieldset', '#title'=>$element['#title'], '#description' => $sticky.'
      preview
      ' , '#collapsible' => TRUE); - - $element['cc']['cc_enable'] = array( - '#type' => 'checkbox', - '#title' => t('Use a CreativeCommons.org Licence'), - '#attributes' => array('class' => 'cc_enable'), - '#default_value' => TRUE, - ); - - $element['cc']['cc_commercial'] = array( - '#type' => 'select', - '#title' => t('Allow commercial uses of your work?'), - '#options' => array( ''=>'Yes', 'nc'=>'No'), - '#attributes' => array('class' => 'cc_field cc_commercial'), - '#default_value' => $element['#value']['cc_commercial'], - ); - $element['cc']['cc_modifications'] = array( - '#type' => 'select', - '#title' => t('Allow modifications of your work?'), - '#options' => array( ''=>'Yes', 'sa'=>'Yes, as long as others share alike', 'nd'=>'No'), - '#attributes' => array('class' => 'cc_field cc_modifications'), - '#default_value' => $element['#value']['cc_modifications'], - ); - - $element['cc']['cc_jurisdiction'] = array( - '#type' => 'select', - '#title' => t('Jurisdiction of your license'), - '#options' => CreativeCommons::$cc_jurisdiction_vals, - '#default_value' => $element['#value']['cc_jurisdiction'], - '#attributes' => array('class' => 'cc_field cc_jurisdiction'), - ); - - $element['#title'] = ''; - - return $element; - -} - - -/** - * Our process callback to expand the control. - */ -function ife_list_process($element,$edit,&$form_state) -{ - if (is_array($element['#default_value'])) { - $element['#default_value']=join('; ',$element['#default_value']); - } - - if (is_array($element['#value'])) { - $element['#value']=join('; ',$element['#value']); - } - - if (isset($element['#sticky']) && $element['#sticky'] == TRUE) - { - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - - if (isset($element['#post'][$stickyName]) && strtolower($element['#post'][$stickyName]) == 'on') - { - $form_state['storage'][$element['#name']]=$element['#value']; - } elseif (isset($form_state['storage'][$element['#name']])) - { - $element['#value'] = $form_state['storage'][$element['#name']]; - $element['#sticky_on'] = TRUE; - } - } - - return $element; -} - -/** - * Implementation of hook_theme(). - * - * This lets us tell Drupal about our theme functions and their arguments. - */ -function islandora_form_elements_theme() { - return array( - 'sticky_textfield' => array( - 'arguments' => array('element'), - ), - - 'sticky_textarea' => array( - 'arguments' => array('element'), - ), - - 'sticky_select' => array( - 'arguments' => array('element'), - ), - - 'filechooser' => array( - 'arguments' => array('element'), - 'file' => 'includes/filechooser.inc' - ), - 'list' => array( - 'arguments' => array('element'), - ), - 'other_select' => array( - 'arguments' => array('element'), - ), - - 'people' => array( - 'arguments' => array('element'), - 'file'=> 'includes/people.inc', - ), - 'people_items' => array( - 'arguments' => array('form' => NULL), - 'file'=> 'includes/people.inc', - ), - 'datepicker' => array( - 'arguments' => array('element'), - ), - 'copyright' => array( - 'arguments' => array('element'), - ), - ); -} - - -function ife_other_select_process($element,$edit,&$form_state) -{ - if (isset($element['#value']) && trim($element['#value']) != '' && !isset($element['#options'][$element['#value']])) - { - $element['#options'][$element['#value']]=$element['#value']; - } - return $element; -} - -function theme_copyright($element) -{ - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_js($path.'/js/copyright.js'); - drupal_add_css($path.'/css/copyright.css'); - - return theme('form_element', $element, $element['#children']); -} - -function theme_other_select($element) -{ - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_js($path.'/js/otherselect.js'); - $select = ''; - $size = $element['#size'] ? ' size="'. $element['#size'] .'"' : ''; - _form_set_class($element, array('otherSelect')); - return theme('form_element', $element, ''); -} - -function theme_list($element) -{ - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_js($path.'/js/jquery.tag.editor-min.js'); - drupal_add_js('$(document).ready(function () { $(\'#'.$element['#id'].'\').tagEditor({ separator: \';\', confirmRemoval: false, completeOnBlur: true }); }); ', 'inline'); - drupal_add_css($path.'/css/list.css'); - $output .= ''; - - //return theme('theme_form_element', $element, '
      ' . $element['#children'] . '
      '); - - $size = empty($element['#size']) ? 'size="25"' : ' size="'. $element['#size'] .'"'; - $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"'; - $class = array('form-text','listElement'); - $extra = ''; - $output='
      '; - - if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { - drupal_add_js('misc/autocomplete.js'); - $class[] = 'form-autocomplete'; - $extra = ''; - } - _form_set_class($element, $class); - - if (isset($element['#field_prefix'])) { - $output .= ''. $element['#field_prefix'] .' '; - } - - $output .= ''; - - if (isset($element['#field_suffix'])) { - $output .= ' '. $element['#field_suffix'] .''; - } - - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
      ':''); - - - return theme('form_element', $element, $output . $sticky ) . $extra; - - -} - - -/** - * Format a sticky textarea. - * - * @param $element - * An associative array containing the properties of the element. - * Properties used: title, value, description, rows, cols, required, attributes - * @return - * A themed HTML string representing the textarea. - * - * @ingroup themeable - */ -function theme_sticky_textarea($element) { - $class = array('form-textarea'); - - - // Add teaser behavior (must come before resizable) - if (!empty($element['#teaser'])) { - drupal_add_js('misc/teaser.js'); - // Note: arrays are merged in drupal_get_js(). - drupal_add_js(array('teaserCheckbox' => array($element['#id'] => $element['#teaser_checkbox'])), 'setting'); - drupal_add_js(array('teaser' => array($element['#id'] => $element['#teaser'])), 'setting'); - $class[] = 'teaser'; - } - - // Add resizable behavior - if ($element['#resizable'] !== FALSE) { - drupal_add_js('misc/textarea.js'); - $class[] = 'resizable'; - } - - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
      ':''); - - - _form_set_class($element, $class); - return theme('form_element', $element, ''.$sticky); -} - - - -/** - * Format a sticky select. - * - * @param $element - * An associative array containing the properties of the element. - * Properties used: title, value, description, rows, cols, required, attributes - * @return - * A themed HTML string representing the textarea. - * - * @ingroup themeable - */ -function theme_sticky_select($element) { - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
      ':''); - - - $select = ''; - $size = $element['#size'] ? ' size="'. $element['#size'] .'"' : ''; - _form_set_class($element, array('form-select')); - $multiple = $element['#multiple']; - return theme('form_element', $element, ''.$sticky); -} - - -/** - * Theme function to format the output. - * - * We use the container-inline class so that all three of the HTML elements - * are placed next to each other, rather than on separate lines. - */ -function theme_datepicker($element) { - global $base_url; - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_js($path.'/js/jquery.ui.core.js'); - drupal_add_js($path.'/js/jquery.ui.widget.js'); - drupal_add_js($path.'/js/jquery.ui.datepicker.js'); - drupal_add_css($path.'/css/ui-lightness/jquery-ui-1.8.4.custom.css'); - $js = '$(document).ready(function () { $(\'#'.$element['#id'].'\').datepicker({ buttonImage: \''.$base_url.'/'.$path.'/images/date.png\', constrainInput: false, showOn: \'button\', changeMonth: true, changeYear: true }); });'; - - $size = empty($element['#size']) ? '' : ' size="'. $element['#size'] .'"'; - $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"'; - $class = array('form-text','datepicker'); - $extra = ''; - $output= ''; - $output.='
      '; - - if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { - drupal_add_js('misc/autocomplete.js'); - $class[] = 'form-autocomplete'; - $extra = ''; - } - _form_set_class($element, $class); - - if (isset($element['#field_prefix'])) { - $output .= ''. $element['#field_prefix'] .' '; - } - - $output .= ''; - - if (isset($element['#field_suffix'])) { - $output .= ' '. $element['#field_suffix'] .''; - } - - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
      ':''); - - - - return theme('form_element', $element, $output.$sticky ) . $extra; - -} - - - -/** - * Theme function to format the output. - * - * We use the container-inline class so that all three of the HTML elements - * are placed next to each other, rather than on separate lines. - */ -function theme_sticky_textfield($element) { - - //echo '
      '; var_dump($element); echo '
      '; - - //return theme('theme_form_element', $element, '
      ' . $element['#children'] . '
      '); - $size = empty($element['#size']) ? '' : ' size="'. $element['#size'] .'"'; - $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="'. $element['#maxlength'] .'"'; - $class = array('form-text'); - $extra = ''; - $output='
      '; - - if ($element['#autocomplete_path'] && menu_valid_path(array('link_path' => $element['#autocomplete_path']))) { - drupal_add_js('misc/autocomplete.js'); - $class[] = 'form-autocomplete'; - $extra = ''; - } - _form_set_class($element, $class); - - if (isset($element['#field_prefix'])) { - $output .= ''. $element['#field_prefix'] .' '; - } - - $output .= ''; - - if (isset($element['#field_suffix'])) { - $output .= ' '. $element['#field_suffix'] .''; - } - - $path=drupal_get_path('module','islandora_form_elements'); - drupal_add_css($path.'/css/sticky.css'); - $stickyName = preg_replace('/\]/','',array_pop(preg_split('/\[/',$element['#name']))).'-sticky'; - $sticky = (isset($element['#sticky']) && $element['#sticky'] == TRUE?'
      ':''); - - - - return theme('form_element', $element, $output . $sticky) . $extra; - -} - -function ife_filechooser_validate($element,&$form_state) -{ - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - $cp = CollectionPolicy::loadFromCollection($form_state['storage']['collection_pid']); - if ($cp !== false) - { - $form_state['values'][$element['#name']] =$cp->getStagingArea().'/'.$element['#value']; - } -} - -function ife_filechooser_process($element, $edit, &$form_state) -{ - $element['#model_pid']=$form_state['values']['models']; - - return $element; -} - -function islandora_form_elements_menu() -{ - - module_load_include('inc','fedora_repository','ObjectHelper'); - - $items=array(); - - $items['ife/people_ahah'] = array( - 'page callback' => 'ife_people_ahah', - 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file' => 'includes/people.inc', - ); - - $items['autocomplete_marcrelator/%'] = array( - 'title' => 'autocomplete', - 'page callback' => 'ife_autocomplete_marcrelator', - 'page arguments'=> array(1), - 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc' - ); - - $items['autocomplete_gacs/%'] = array( - 'title' => 'autocomplete', - 'page callback' => 'ife_autocomplete_gacs', - 'page arguments'=> array(1), - 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc' - ); - - $items['autocomplete_language/%'] = array( - 'title' => 'autocomplete', - 'page callback' => 'ife_autocomplete_language', - 'page arguments'=> array(1), - 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc' - ); - - $items['autocomplete_person/%'] = array( - 'title' => 'autocomplete', - 'page callback' => 'ife_autocomplete_person', - 'page arguments'=> array(1), - 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc' - ); - - $items['autocomplete/%/%'] = array( - 'title' => 'autocomplete', - 'page callback' => 'ife_autocomplete', - 'page arguments'=> array(1,2), - 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file'=> 'includes/autocomplete.inc', - ); - - - $items['filechooser/getThumbnail/%/%/%'] = array( - 'title' => 'getThumbnail', - 'page callback' => 'ife_filechooser_get_thumbnail', - 'page arguments'=> array(2,3,4), - 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file' => 'includes/filechooser.inc' - ); - - $items['filechooser/generatePreview/%/%'] = array( - 'title' => 'generatePreview', - 'page callback' => 'ife_filechooser_generate_thumbnails', - 'page arguments'=> array(2,3), - 'type' => MENU_CALLBACK, - 'access arguments' => array(ObjectHelper::$INGEST_FEDORA_OBJECTS), - 'file' => 'includes/filechooser.inc' - ); - - - - return $items; -} - diff --git a/form_elements/js/copyright.js b/form_elements/js/copyright.js deleted file mode 100644 index 6c9ed082..00000000 --- a/form_elements/js/copyright.js +++ /dev/null @@ -1,48 +0,0 @@ -$(document).ready(function () { - - var cc_versions = new Array(); cc_versions[""]="3.0"; cc_versions["ar"]="2.5"; cc_versions["au"]="3.0"; cc_versions["at"]="3.0"; cc_versions["be"]="2.0"; cc_versions["br"]="3.0"; cc_versions["bg"]="2.5"; cc_versions["ca"]="2.5"; cc_versions["cl"]="2.0"; cc_versions["cn"]="2.5"; cc_versions["co"]="2.5"; cc_versions["hr"]="3.0"; cc_versions["cz"]="3.0"; cc_versions["dk"]="2.5"; cc_versions["ec"]="3.0"; cc_versions["fi"]="1.0"; cc_versions["fr"]="2.0"; cc_versions["de"]="3.0"; cc_versions["gr"]="3.0"; cc_versions["gt"]="3.0"; cc_versions["hk"]="3.0"; cc_versions["hu"]="2.5"; cc_versions["in"]="2.5"; cc_versions["il"]="2.5"; cc_versions["it"]="2.5"; cc_versions["jp"]="2.0"; cc_versions["kr"]="2.0"; cc_versions["lu"]="3.0"; cc_versions["mk"]="2.5"; cc_versions["my"]="2.5"; cc_versions["mt"]="2.5"; cc_versions["mx"]="2.5"; cc_versions["nl"]="3.0"; cc_versions["nz"]="3.0"; cc_versions["no"]="3.0"; cc_versions["pe"]="2.5"; cc_versions["ph"]="3.0"; cc_versions["pl"]="3.0"; cc_versions["pt"]="2.5"; cc_versions["pr"]="3.0"; cc_versions["ro"]="3.0"; cc_versions["rs"]="3.0"; cc_versions["sg"]="3.0"; cc_versions["si"]="2.5"; cc_versions["za"]="2.5"; cc_versions["es"]="3.0"; cc_versions["se"]="2.5"; cc_versions["ch"]="2.5"; cc_versions["tw"]="3.0"; cc_versions["th"]="3.0"; cc_versions["uk"]="2.0"; cc_versions["scotland"]="2.5"; cc_versions["us"]="3.0"; cc_versions["vn"]="3.0"; - - function updateCCPreview() - { - - var commercial = $('.cc_commercial').val(); - var modification = $('.cc_modifications').val(); - var jurisdiction= $('.cc_jurisdiction').val(); - var jurisdiction_name = jurisdiction; - var version = cc_versions[jurisdiction_name]; - - var params=""; - - if (commercial != '') - params+="-"+commercial; - if (modification != '') - params+="-"+modification; - - - if (jurisdiction != null) - jurisdiction+="/"; - else - { - jurisdiction = ""; - jurisdiction_name = ""; - } - - var html = "\"Creative
      This work is licensed under a Creative Commons License."; - - $('.cc_preview').html(html); - } - - $('.cc_enable').change(function () { - $('.cc_field').attr('disabled', !$(this).attr('checked')); - if ($(this).attr('checked')) - updateCCPreview(); - else - $('.cc_preview').html(''); - }); - - $('.cc_field').change(function () { - updateCCPreview(); - }); - - updateCCPreview(); -}); \ No newline at end of file diff --git a/form_elements/js/filechooser.js b/form_elements/js/filechooser.js deleted file mode 100644 index 7a9625ef..00000000 --- a/form_elements/js/filechooser.js +++ /dev/null @@ -1,89 +0,0 @@ -var files = new Array(); -var selectedFile = null; -var visibleFiles=4; - -$(document).ready(function () { - - var selectedValue = false; - var selectedIndex = 0; - var cp_pid; - var cm_pid; - var start=0; - var end = 50; - - if ($('#fileField').attr('value') != '') - { - selectedValue = $('#fileField').attr('value'); - } - - cp_pid = $('#edit-collection-pid').attr('value'); - cm_pid = $('#model_pid').attr('value'); - $.getJSON("/filechooser/generatePreview/"+cp_pid+"/"+cm_pid+"?start="+start+"&end="+end,function (data) - { - - $('#fileList').html(''); - if (data.length == 0) - { - $('#fileList').append('
      No files found in staging area.
      '); - - } else - { - $.each(data, function(i, item) - { - var html; - files[i]=item.name; - var selected= ""; - if (selectedValue == item.name) - { - selected='class="selected"'; - selectedFile='file'+i; - selectedIndex=i - (i%visibleFiles); - } - - if (item.thumb) - { - html='
    • '+item.name+'
      '+item.mime+'
      '+item.size+'  '+item.resolution+'
    • '; - } else - { - var type=item.mime.split('/',1).shift(); - html='
    •  
      '+item.name+'
      '+item.mime+'
      '+item.size+'
    • '; - } - - $('#fileList').append(html); - }); - - $('#fileList li div').breakly(15); - - } - - - $(".carousel .jCarouselLite").jCarouselLite({ - btnNext: ".carousel .next", - btnPrev: ".carousel .prev", - mouseWheel: true, - circular: false, - speed: 750, - visible: visibleFiles, - scroll: visibleFiles, - initial: selectedIndex - }); - - $(".carousel li").click(function() { - - if (selectedFile != this.id) - { - $('#fileField').attr('value',files[this.id.split('file',2).pop()]); - $("#"+(this.id)).addClass('selected'); - if (selectedFile != null) - { - $("#"+selectedFile).removeClass('selected'); - } - selectedFile=this.id; - } - }) - - }); - -}); - - diff --git a/form_elements/js/jcarousellite_1.0.1.js b/form_elements/js/jcarousellite_1.0.1.js deleted file mode 100644 index d51bca66..00000000 --- a/form_elements/js/jcarousellite_1.0.1.js +++ /dev/null @@ -1,343 +0,0 @@ -/** - * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget. - * @requires jQuery v1.2 or above - * - * http://gmarwaha.com/jquery/jcarousellite/ - * - * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com) - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * Version: 1.0.1 - * Note: Requires jquery 1.2 or above from version 1.0.1 - */ - -/** - * Creates a carousel-style navigation widget for images/any-content from a simple HTML markup. - * - * The HTML markup that is used to build the carousel can be as simple as... - * - * - * - * As you can see, this snippet is nothing but a simple div containing an unordered list of images. - * You don't need any special "class" attribute, or a special "css" file for this plugin. - * I am using a class attribute just for the sake of explanation here. - * - * To navigate the elements of the carousel, you need some kind of navigation buttons. - * For example, you will need a "previous" button to go backward, and a "next" button to go forward. - * This need not be part of the carousel "div" itself. It can be any element in your page. - * Lets assume that the following elements in your document can be used as next, and prev buttons... - * - * - * - * - * Now, all you need to do is call the carousel component on the div element that represents it, and pass in the - * navigation buttons as options. - * - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev" - * }); - * - * That's it, you would have now converted your raw div, into a magnificient carousel. - * - * There are quite a few other options that you can use to customize it though. - * Each will be explained with an example below. - * - * @param an options object - You can specify all the options shown below as an options object param. - * - * @option btnPrev, btnNext : string - no defaults - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev" - * }); - * @desc Creates a basic carousel. Clicking "btnPrev" navigates backwards and "btnNext" navigates forward. - * - * @option btnGo - array - no defaults - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * btnGo: [".0", ".1", ".2"] - * }); - * @desc If you don't want next and previous buttons for navigation, instead you prefer custom navigation based on - * the item number within the carousel, you can use this option. Just supply an array of selectors for each element - * in the carousel. The index of the array represents the index of the element. What i mean is, if the - * first element in the array is ".0", it means that when the element represented by ".0" is clicked, the carousel - * will slide to the first element and so on and so forth. This feature is very powerful. For example, i made a tabbed - * interface out of it by making my navigation elements styled like tabs in css. As the carousel is capable of holding - * any content, not just images, you can have a very simple tabbed navigation in minutes without using any other plugin. - * The best part is that, the tab will "slide" based on the provided effect. :-) - * - * @option mouseWheel : boolean - default is false - * @example - * $(".carousel").jCarouselLite({ - * mouseWheel: true - * }); - * @desc The carousel can also be navigated using the mouse wheel interface of a scroll mouse instead of using buttons. - * To get this feature working, you have to do 2 things. First, you have to include the mouse-wheel plugin from brandon. - * Second, you will have to set the option "mouseWheel" to true. That's it, now you will be able to navigate your carousel - * using the mouse wheel. Using buttons and mouseWheel or not mutually exclusive. You can still have buttons for navigation - * as well. They complement each other. To use both together, just supply the options required for both as shown below. - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * mouseWheel: true - * }); - * - * @option auto : number - default is null, meaning autoscroll is disabled by default - * @example - * $(".carousel").jCarouselLite({ - * auto: 800, - * speed: 500 - * }); - * @desc You can make your carousel auto-navigate itself by specfying a millisecond value in this option. - * The value you specify is the amount of time between 2 slides. The default is null, and that disables auto scrolling. - * Specify this value and magically your carousel will start auto scrolling. - * - * @option speed : number - 200 is default - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * speed: 800 - * }); - * @desc Specifying a speed will slow-down or speed-up the sliding speed of your carousel. Try it out with - * different speeds like 800, 600, 1500 etc. Providing 0, will remove the slide effect. - * - * @option easing : string - no easing effects by default. - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * easing: "bounceout" - * }); - * @desc You can specify any easing effect. Note: You need easing plugin for that. Once specified, - * the carousel will slide based on the provided easing effect. - * - * @option vertical : boolean - default is false - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * vertical: true - * }); - * @desc Determines the direction of the carousel. true, means the carousel will display vertically. The next and - * prev buttons will slide the items vertically as well. The default is false, which means that the carousel will - * display horizontally. The next and prev items will slide the items from left-right in this case. - * - * @option circular : boolean - default is true - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * circular: false - * }); - * @desc Setting it to true enables circular navigation. This means, if you click "next" after you reach the last - * element, you will automatically slide to the first element and vice versa. If you set circular to false, then - * if you click on the "next" button after you reach the last element, you will stay in the last element itself - * and similarly for "previous" button and first element. - * - * @option visible : number - default is 3 - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * visible: 4 - * }); - * @desc This specifies the number of items visible at all times within the carousel. The default is 3. - * You are even free to experiment with real numbers. Eg: "3.5" will have 3 items fully visible and the - * last item half visible. This gives you the effect of showing the user that there are more images to the right. - * - * @option start : number - default is 0 - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * start: 2 - * }); - * @desc You can specify from which item the carousel should start. Remember, the first item in the carousel - * has a start of 0, and so on. - * - * @option scrool : number - default is 1 - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * scroll: 2 - * }); - * @desc The number of items that should scroll/slide when you click the next/prev navigation buttons. By - * default, only one item is scrolled, but you may set it to any number. Eg: setting it to "2" will scroll - * 2 items when you click the next or previous buttons. - * - * @option beforeStart, afterEnd : function - callbacks - * @example - * $(".carousel").jCarouselLite({ - * btnNext: ".next", - * btnPrev: ".prev", - * beforeStart: function(a) { - * alert("Before animation starts:" + a); - * }, - * afterEnd: function(a) { - * alert("After animation ends:" + a); - * } - * }); - * @desc If you wanted to do some logic in your page before the slide starts and after the slide ends, you can - * register these 2 callbacks. The functions will be passed an argument that represents an array of elements that - * are visible at the time of callback. - * - * - * @cat Plugins/Image Gallery - * @author Ganeshji Marwaha/ganeshread@gmail.com - */ - -(function($) { // Compliant with jquery.noConflict() -$.fn.jCarouselLite = function(o) { - o = $.extend({ - btnPrev: null, - btnNext: null, - btnGo: null, - mouseWheel: false, - auto: null, - - speed: 200, - easing: null, - - vertical: false, - circular: true, - visible: 3, - start: 0, - scroll: 1, - - beforeStart: null, - afterEnd: null - }, o || {}); - - return this.each(function() { // Returns the element collection. Chainable. - - var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width"; - var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible; - - if(o.circular) { - ul.prepend(tLi.slice(tl-v-1+1).clone()) - .append(tLi.slice(0,v).clone()); - o.start += v; - } - - var li = $("li", ul), itemLength = li.size(), curr = o.start; - div.css("visibility", "visible"); - - li.css({overflow: "hidden", float: o.vertical ? "none" : "left"}); - ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"}); - div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"}); - - var liSize = o.vertical ? height(li) : width(li); // Full li size(incl margin)-Used for animation - var ulSize = liSize * itemLength; // size of full ul(total length, not just for the visible items) - var divSize = liSize * v; // size of entire div(total length for just the visible items) - - li.css({width: li.width(), height: li.height()}); - ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize)); - - div.css(sizeCss, divSize+"px"); // Width of the DIV. length of visible images - - if(o.btnPrev) - $(o.btnPrev).click(function() { - return go(curr-o.scroll); - }); - - if(o.btnNext) - $(o.btnNext).click(function() { - return go(curr+o.scroll); - }); - - if(o.btnGo) - $.each(o.btnGo, function(i, val) { - $(val).click(function() { - return go(o.circular ? o.visible+i : i); - }); - }); - if(o.initial && o.initial >= o.visible) - go(o.circular ? o.visible+o.initial : o.initial); - - if(o.mouseWheel && div.mousewheel) - div.mousewheel(function(e, d) { - return d>0 ? go(curr-o.scroll) : go(curr+o.scroll); - }); - - if(o.auto) - setInterval(function() { - go(curr+o.scroll); - }, o.auto+o.speed); - - function vis() { - return li.slice(curr).slice(0,v); - }; - - function go(to) { - if(!running) { - - if(o.beforeStart) - o.beforeStart.call(this, vis()); - - if(o.circular) { // If circular we are in first or last, then goto the other end - if(to<=o.start-v-1) { // If first, then goto last - ul.css(animCss, -((itemLength-(v*2))*liSize)+"px"); - // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements. - curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll; - } else if(to>=itemLength-v+1) { // If last, then goto first - ul.css(animCss, -( (v) * liSize ) + "px" ); - // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements. - curr = to==itemLength-v+1 ? v+1 : v+o.scroll; - } else curr = to; - } else { // If non-circular and to points to first or last, we just return. - if(to<0 || to>itemLength-v) return; - else curr = to; - } // If neither overrides it, the curr will still be "to" and we can proceed. - - running = true; - - ul.animate( - animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing, - function() { - if(o.afterEnd) - o.afterEnd.call(this, vis()); - running = false; - } - ); - // Disable buttons when the carousel reaches the last/first, and enable when not - if(!o.circular) { - $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); - $( (curr-o.scroll<0 && o.btnPrev) - || - (curr+o.scroll > itemLength-v && o.btnNext) - || - [] - ).addClass("disabled"); - } - - } - return false; - }; - }); -}; - -function css(el, prop) { - return parseInt($.css(el[0], prop)) || 0; -}; -function width(el) { - return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); -}; -function height(el) { - return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); -}; - -})(jQuery); \ No newline at end of file diff --git a/form_elements/js/jquery.breakly-1.0.js b/form_elements/js/jquery.breakly-1.0.js deleted file mode 100644 index e025a34d..00000000 --- a/form_elements/js/jquery.breakly-1.0.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * jQuery Breakly plugin - Breaks your texts. Gently. - * This plugin can be used to give the browser an "hint" on when (and eventually how) break - * some long texts that are wrapped in a container with an explicitely defined width. - * It works adding a "special" unicode character after the given number of characters. - * By default the plugin inserts U+200B (the zero width space), but you can specify any - * other character as the second parameter - * - * @name jquery-breakly-1.0.js - * @author Claudio Cicali - http://claudio.cicali.name - * @version 1.0 - * @date December 22, 2009 - * @category jQuery plugin - * @copyright (c) 2009 Claudio Cicali ( http://claudio.cicali.name ) - * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US - * @examples - * $('h3').breakly(3); // "breaks" any h3 text (and any h3's children text too) inserting a \U+200B after every 3 characters - * $('h3').breakly(3, 0x202f); // Same as above, but inserts a "NARROW NO-BREAK SPACE" (just for the fun of it) - - * Visit http://lab.web20.it/breakly/example.html - * List of Unicode spaces: http://www.cs.tut.fi/~jkorpela/chars/spaces.html - */ -$.fn.breakly = function(chopAt, spaceCode) { - spaceCode |= 8203; // U+200B ZERO WIDTH SPACE - var zw = String.fromCharCode(spaceCode), re = new RegExp(/\B/), orig, idx, chopped, ch; - function breakly(node) { - if (3 == node.nodeType && (orig = node.nodeValue).length > chopAt) { - idx = 0; - chopped=[]; - for (var i=0; i < orig.length; i++) { - ch = orig.substr(i,1); - chopped.push(ch); - if (null != ch.match(re)) { - idx=0; - continue; - } - if (++idx == chopAt) { - ch = orig.substr(i+1,1); // look ahead - if (ch && null == ch.match(re)) { - chopped.push(zw); - idx=0; - } - } - } - node.nodeValue = chopped.join(''); - } else { - for (var i=0; i < node.childNodes.length; i++) { - breakly(node.childNodes[i]); - } - } - } - - return this.each(function() { - breakly(this); - }) -} - - diff --git a/form_elements/js/jquery.easing.1.1.js b/form_elements/js/jquery.easing.1.1.js deleted file mode 100644 index f2ae8730..00000000 --- a/form_elements/js/jquery.easing.1.1.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * jQuery Easing v1.1 - http://gsgd.co.uk/sandbox/jquery.easing.php - * - * Uses the built in easing capabilities added in jQuery 1.1 - * to offer multiple easing options - * - * Copyright (c) 2007 George Smith - * Licensed under the MIT License: - * http://www.opensource.org/licenses/mit-license.php - */ - -jQuery.easing = { - easein: function(x, t, b, c, d) { - return c*(t/=d)*t + b; // in - }, - easeinout: function(x, t, b, c, d) { - if (t < d/2) return 2*c*t*t/(d*d) + b; - var ts = t - d/2; - return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b; - }, - easeout: function(x, t, b, c, d) { - return -c*t*t/(d*d) + 2*c*t/d + b; - }, - expoin: function(x, t, b, c, d) { - var flip = 1; - if (c < 0) { - flip *= -1; - c *= -1; - } - return flip * (Math.exp(Math.log(c)/d * t)) + b; - }, - expoout: function(x, t, b, c, d) { - var flip = 1; - if (c < 0) { - flip *= -1; - c *= -1; - } - return flip * (-Math.exp(-Math.log(c)/d * (t-d)) + c + 1) + b; - }, - expoinout: function(x, t, b, c, d) { - var flip = 1; - if (c < 0) { - flip *= -1; - c *= -1; - } - if (t < d/2) return flip * (Math.exp(Math.log(c/2)/(d/2) * t)) + b; - return flip * (-Math.exp(-2*Math.log(c/2)/d * (t-d)) + c + 1) + b; - }, - bouncein: function(x, t, b, c, d) { - return c - jQuery.easing['bounceout'](x, d-t, 0, c, d) + b; - }, - bounceout: function(x, t, b, c, d) { - if ((t/=d) < (1/2.75)) { - return c*(7.5625*t*t) + b; - } else if (t < (2/2.75)) { - return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; - } else if (t < (2.5/2.75)) { - return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; - } else { - return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; - } - }, - bounceinout: function(x, t, b, c, d) { - if (t < d/2) return jQuery.easing['bouncein'] (x, t*2, 0, c, d) * .5 + b; - return jQuery.easing['bounceout'] (x, t*2-d,0, c, d) * .5 + c*.5 + b; - }, - elasin: function(x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - }, - elasout: function(x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; - }, - elasinout: function(x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; - }, - backin: function(x, t, b, c, d) { - var s=1.70158; - return c*(t/=d)*t*((s+1)*t - s) + b; - }, - backout: function(x, t, b, c, d) { - var s=1.70158; - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; - }, - backinout: function(x, t, b, c, d) { - var s=1.70158; - if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; - }, - linear: function(x, t, b, c, d) { - return c*t/d + b; //linear - } -}; \ No newline at end of file diff --git a/form_elements/js/jquery.loadImages.1.0.1.js b/form_elements/js/jquery.loadImages.1.0.1.js deleted file mode 100644 index b2594ba3..00000000 --- a/form_elements/js/jquery.loadImages.1.0.1.js +++ /dev/null @@ -1,33 +0,0 @@ -(function($){ - //cache needed for overagressive garbage collectors. - var cache = []; - //images can either be an array of paths to images or a single image. - $.loadImages = function(images, ids, callback){ - - //convert to array if needed so rest of script works - if (!(images instanceof Array)) { - images = [images]; - } - - if (!(images instanceof Array)) { - ids = [ids]; - } - - var imagesLength = images.length; - var loadedCounter = 0; - - for (var i=0; i < imagesLength; i++) { - var cacheImage = document.createElement('img'); - //set the onload method before the src is called otherwise will fail to be called in IE - cacheImage.onload = function(){ - loadedCounter++; - if ($.isFunction(callback)) { - callback(this); - } - } - cacheImage.src = images[i]; - cacheImage.id = '#'+ids[i]; - cache.push(cacheImage); - } - } -})(jQuery) diff --git a/form_elements/js/jquery.loadImages.1.0.1.min.js b/form_elements/js/jquery.loadImages.1.0.1.min.js deleted file mode 100644 index b697758e..00000000 --- a/form_elements/js/jquery.loadImages.1.0.1.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(c){var h=[];c.loadImages=function(a,d){a instanceof Array||(a=[a]);for(var e=a.length,f=0,g=e;g--;){var b=document.createElement("img");b.onload=function(){f++;f>=e&&c.isFunction(d)&&d()};b.src=a[g];h.push(b)}}})(jQuery); \ No newline at end of file diff --git a/form_elements/js/jquery.loadImages.1.0.1.zip b/form_elements/js/jquery.loadImages.1.0.1.zip deleted file mode 100644 index 1444833db2ce237a2b58e58415f714500988b87f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 906 zcmWIWW@Zs#U|`^2;AY%nvwHR4_RT=vb0C%j;;h2b)S^ngoczQT&)mfH)M7nDJp&-l z&CJuwDt7HX*wt(x;#%*zYl2Od^Y@3MyIvg7N!QhzchY-HhLOrfg;)Ex8~N9 zVA&_D?+3YgPd6uBOuVb1+wSnJTID$BeeP8}Iw4=|Qa{aV)?H_KY0tW*4a?Z3@CLq- z?@?j@rdK}oXz|ktQ?2J-nZLkQ_>0M=^Fi**&TMb|uEO{C1>b@w$v=7jD-t&zU%W~D z$)+ot{Nw+(Hf}Ou+9p1Ek=v@+#a2J9m-=nlkSpEs`}~nYwy!J!aPOuvY_ZXg_IkLJ zk%2*og@Hi|k9V_*OM`s<4;%2<<_rBl=rK8iwdBrfMMV=86}>s?e37rVwdu^9R3hy3 z`@Mzl?sYjoEV%x>Od=rJAQo3sdE0ouW-cRtl!4+@)fz3*# zT!f*oWU0ZtRDtfZMyW0zr4qRxzF_v=xSl2H;j za{_+*M2W~v=Q^ynbD?kPJH& zJEzY(@Nwne*+PrlRbR52De^r(Uf;*}f0dBRyO--'); } item.click(function() { if (options.confirmRemoval) { if (!confirm(options.confirmRemovalText)) { return; } } item.remove(); parse(); }); listBase.append(item); return true; } function resetTags() { itemBase = []; listBase.html(""); textBase.val(""); hiddenText.val(""); for (var i = 0; i < options.items.length; i++) { addTag(jQuery.trim(options.items[i])); } parse(); } function buildArray() { itemBase = []; var items = jQuery("li", listBase); for (var i = 0; i < items.length; i++) { itemBase.push(jQuery.trim(jQuery(items[i]).text())); } if (options.continuousOutputBuild) { hiddenText.val(itemBase.join(options.separator)); } } function parse() { var items = textBase.val().split(options.separator); for (var i = 0; i < items.length; i++) { var trimmedItem = jQuery.trim(items[i]); if (trimmedItem.length > 0) { addTag(trimmedItem); } } textBase.val(""); buildArray(); } function handleKeys(ev) { var keyCode = (ev.which) ? ev.which : ev.keyCode; if (options.completeOnSeparator) { if (String.fromCharCode(keyCode) == options.separator) { parse(); return false; } } switch (keyCode) { case 13: if (jQuery.trim(textBase.val()) != "") { parse(); return false; } return true; default: return true; } } jQuery.fn.extend({ tagEditorGetTags: function() { return itemBase.join(options.separator); }, tagEditorResetTags: function() { resetTags(); }, tagEditorAddTag: function(tag) { return addTag(tag); } }); hiddenText = jQuery(document.createElement("input")); hiddenText.attr("type", "hidden"); if (options.continuousOutputBuild) { hiddenText.attr("name", textBase.attr("name")); textBase.attr("name", textBase.attr("name") + "_old"); } textBase.after(hiddenText); listBase = jQuery(document.createElement("ul")); listBase.attr("class", options.className); if (options.tagsBeforeField) { jQuery(this).before(listBase); } else { jQuery(this).after(listBase); } for (var i = 0; i < options.items.length; i++) { addTag(jQuery.trim(options.items[i])); } if (options.initialParse) { parse(); } if (options.completeOnBlur) { jQuery(this).blur(parse); } buildArray(); jQuery(this).keypress(handleKeys); var form = jQuery(this).parents("form"); if (!options.continuousOutputBuild) { form.submit(function() { parse(); hiddenText.val(itemBase.join(options.separator)); hiddenText.attr("id", textBase.attr("id")); hiddenText.attr("name", textBase.attr("name")); textBase.attr("id", textBase.attr("id") + "_old"); textBase.attr("name", textBase.attr("name") + "_old"); }); } }); }; })(jQuery); \ No newline at end of file diff --git a/form_elements/js/jquery.tag.editor.js b/form_elements/js/jquery.tag.editor.js deleted file mode 100644 index d34837ae..00000000 --- a/form_elements/js/jquery.tag.editor.js +++ /dev/null @@ -1,214 +0,0 @@ -/* -@inital author: Karl-Johan Sjögren / http://blog.crazybeavers.se/ -@contributor: Joost Elfering / http://yopefonic.wordpress.com/ -@url: http://blog.crazybeavers.se/wp-content/demos/jquery.tag.editor/ -@license: Creative Commons License - ShareAlike http://creativecommons.org/licenses/by-sa/3.0/ -@version: 1.4.1 -@changelog -1.4.1 -Karl-Johan Sjögren --Removed all references to $ to make sure that it is compatible even when using other libraries that bind to $ --Reorganized the code and cleaned it up to pass the JSLint-test to make sure that it works when minified --Switched minifier to YUI Compressor since Packer broke the script (even though it passes JSLint) -1.4 -Karl-Johan Sjögren --Normalized the string chars in the script to ' --Added a minified version of the script to the package using http://base2.googlecode.com/svn/trunk/src/apps/packer/packer.html -Joost Elfering --Major change in extension of the object --Moved getTags to tagEditorGetTags for naming convention --Changed tagEditor so that it can be called without arguments --Changed call for getTags to $(object).tagEditorGetTags() --Changed addTag to return a true or false value as a success indicator --Added resetTags method to clear the input and set the default given tags as start --Added tagEditorResetTags as API for resetTags: $(object).tagEditorResetTags() --Added tagEditorAddTag as API for addTag: $(object).tagEditorAddTag('string') --Added continuousOutputBuild option to allow continuous building for dynamic forms --Added tagsBeforeField option to switch places between tags added and the input field --Added imageTag option to add and image to the list for styling purposes --Added imageTagUrl option to define custom image for styling purposes -1.3 --Any string already in the textbox when enabling the tag editor is now parsed as tags --Added initialParse to stop the initial parsing --Added confirmRemovalText as an option to better support different localizations --Added the getTags method. --Fixed completeOnBlur that wasn't working -1.2 --Fixed bug with completeOnSeparator for Firefox --Fixed so that pressing return on an empty editor would submit the form -1.1 --Initial public release --Added the completeOnSeparator and completeOnBlur options -*/ -(function(jQuery) { - jQuery.fn.tagEditor = function(options) { - var defaults = { - separator: ',', - items: [], - className: 'tagEditor', - confirmRemoval: false, - confirmRemovalText: 'Do you really want to remove the tag?', - completeOnSeparator: false, - completeOnBlur: false, - tagsBeforeField: false, - initialParse: true, - imageTag: false, - imageTagUrl: '', - continuousOutputBuild: false - }; - - options = jQuery.extend(defaults, options); - - var listBase, textBase = this, hiddenText; - var itemBase = []; - - return this.each(function() { - function addTag(tag) { - tag = jQuery.trim(tag); - for (var i = 0; i < itemBase.length; i++) { - if (itemBase[i].toLowerCase() == tag.toLowerCase()) { - return false; - } - } - - var item = jQuery(document.createElement('li')); - item.text(tag); - item.attr('title', 'Remove tag'); - if (options.imageTag) { - item.append(''); - } - - item.click(function() { - if (options.confirmRemoval) { - if (!confirm(options.confirmRemovalText)) { - return; - } - } - - item.remove(); - parse(); - }); - - listBase.append(item); - return true; - } - - function resetTags() { - itemBase = []; - listBase.html(''); - textBase.val(''); - hiddenText.val(''); - for (var i = 0; i < options.items.length; i++) { - addTag(jQuery.trim(options.items[i])); - } - parse(); - } - - function buildArray() { - itemBase = []; - var items = jQuery('li', listBase); - - for (var i = 0; i < items.length; i++) { - itemBase.push(jQuery.trim(jQuery(items[i]).text())); - } - - if (options.continuousOutputBuild) { - hiddenText.val(itemBase.join(options.separator)); - } - } - - function parse() { - var items = textBase.val().split(options.separator); - - for (var i = 0; i < items.length; i++) { - var trimmedItem = jQuery.trim(items[i]); - if (trimmedItem.length > 0) { - addTag(trimmedItem); - } - } - - textBase.val(''); - buildArray(); - } - - function handleKeys(ev) { - var keyCode = (ev.which) ? ev.which : ev.keyCode; - - if (options.completeOnSeparator) { - if (String.fromCharCode(keyCode) == options.separator) { - parse(); - return false; - } - } - - switch (keyCode) { - case 13: - if (jQuery.trim(textBase.val()) != '') { - parse(); - return false; - } - return true; - default: - return true; - } - } - - jQuery.fn.extend({ - tagEditorGetTags: function() { - return itemBase.join(options.separator); - }, - tagEditorResetTags: function() { - resetTags(); - }, - tagEditorAddTag: function(tag) { - return addTag(tag); - } - }); - - hiddenText = jQuery(document.createElement('input')); - hiddenText.attr('type', 'hidden'); - if (options.continuousOutputBuild) { - hiddenText.attr('name', textBase.attr('name')); - textBase.attr('name', textBase.attr('name') + '_old'); - } - textBase.after(hiddenText); - - listBase = jQuery(document.createElement('ul')); - listBase.attr('class', options.className); - if (options.tagsBeforeField) { - jQuery(this).before(listBase); - } else { - jQuery(this).after(listBase); - } - - for (var i = 0; i < options.items.length; i++) { - addTag(jQuery.trim(options.items[i])); - } - - if (options.initialParse) { - parse(); - } - - if (options.completeOnBlur) { - jQuery(this).blur(parse); - } - - buildArray(); - jQuery(this).keypress(handleKeys); - - var form = jQuery(this).parents('form'); - - if (!options.continuousOutputBuild) { - form.submit(function() { - parse(); - hiddenText.val(itemBase.join(options.separator)); - hiddenText.attr('id', textBase.attr('id')); - hiddenText.attr("name", textBase.attr('name')); - textBase.attr('id', textBase.attr('id') + '_old'); - textBase.attr('name', textBase.attr('name') + '_old'); - - }); - } - }); - }; -})(jQuery); \ No newline at end of file diff --git a/form_elements/js/jquery.ui.core.js b/form_elements/js/jquery.ui.core.js deleted file mode 100644 index 7067cddf..00000000 --- a/form_elements/js/jquery.ui.core.js +++ /dev/null @@ -1,281 +0,0 @@ -/*! - * jQuery UI 1.8.4 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function( $, undefined ) { - -// prevent duplicate loading -// this is only a problem because we proxy existing functions -// and we don't want to double proxy them -$.ui = $.ui || {}; -if ( $.ui.version ) { - return; -} - -//Helper functions and ui object -$.extend( $.ui, { - version: "1.8.4", - - // $.ui.plugin is deprecated. Use the proxy pattern instead. - plugin: { - add: function( module, option, set ) { - var proto = $.ui[ module ].prototype; - for ( var i in set ) { - proto.plugins[ i ] = proto.plugins[ i ] || []; - proto.plugins[ i ].push( [ option, set[ i ] ] ); - } - }, - call: function( instance, name, args ) { - var set = instance.plugins[ name ]; - if ( !set || !instance.element[ 0 ].parentNode ) { - return; - } - - for ( var i = 0; i < set.length; i++ ) { - if ( instance.options[ set[ i ][ 0 ] ] ) { - set[ i ][ 1 ].apply( instance.element, args ); - } - } - } - }, - - contains: function( a, b ) { - return document.compareDocumentPosition ? - a.compareDocumentPosition( b ) & 16 : - a !== b && a.contains( b ); - }, - - hasScroll: function( el, a ) { - - //If overflow is hidden, the element might have extra content, but the user wants to hide it - if ( $( el ).css( "overflow" ) === "hidden") { - return false; - } - - var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", - has = false; - - if ( el[ scroll ] > 0 ) { - return true; - } - - // TODO: determine which cases actually cause this to happen - // if the element doesn't have the scroll set, see if it's possible to - // set the scroll - el[ scroll ] = 1; - has = ( el[ scroll ] > 0 ); - el[ scroll ] = 0; - return has; - }, - - isOverAxis: function( x, reference, size ) { - //Determines when x coordinate is over "b" element axis - return ( x > reference ) && ( x < ( reference + size ) ); - }, - - isOver: function( y, x, top, left, height, width ) { - //Determines when x, y coordinates is over "b" element - return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); - }, - - keyCode: { - ALT: 18, - BACKSPACE: 8, - CAPS_LOCK: 20, - COMMA: 188, - COMMAND: 91, - COMMAND_LEFT: 91, // COMMAND - COMMAND_RIGHT: 93, - CONTROL: 17, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - INSERT: 45, - LEFT: 37, - MENU: 93, // COMMAND_RIGHT - NUMPAD_ADD: 107, - NUMPAD_DECIMAL: 110, - NUMPAD_DIVIDE: 111, - NUMPAD_ENTER: 108, - NUMPAD_MULTIPLY: 106, - NUMPAD_SUBTRACT: 109, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SHIFT: 16, - SPACE: 32, - TAB: 9, - UP: 38, - WINDOWS: 91 // COMMAND - } -}); - -//jQuery plugins -$.fn.extend({ - _focus: $.fn.focus, - focus: function( delay, fn ) { - return typeof delay === "number" ? - this.each(function() { - var elem = this; - setTimeout(function() { - $( elem ).focus(); - if ( fn ) { - fn.call( elem ); - } - }, delay ); - }) : - this._focus.apply( this, arguments ); - }, - - enableSelection: function() { - return this - .attr( "unselectable", "off" ) - .css( "MozUserSelect", "" ); - }, - - disableSelection: function() { - return this - .attr( "unselectable", "on" ) - .css( "MozUserSelect", "none" ); - }, - - scrollParent: function() { - var scrollParent; - if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { - scrollParent = this.parents().filter(function() { - return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } else { - scrollParent = this.parents().filter(function() { - return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } - - return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; - }, - - zIndex: function( zIndex ) { - if ( zIndex !== undefined ) { - return this.css( "zIndex", zIndex ); - } - - if ( this.length ) { - var elem = $( this[ 0 ] ), position, value; - while ( elem.length && elem[ 0 ] !== document ) { - // Ignore z-index if position is set to a value where z-index is ignored by the browser - // This makes behavior of this function consistent across browsers - // WebKit always returns auto if the element is positioned - position = elem.css( "position" ); - if ( position === "absolute" || position === "relative" || position === "fixed" ) { - // IE returns 0 when zIndex is not specified - // other browsers return a string - // we ignore the case of nested elements with an explicit value of 0 - //
      - value = parseInt( elem.css( "zIndex" ) ); - if ( !isNaN( value ) && value != 0 ) { - return value; - } - } - elem = elem.parent(); - } - } - - return 0; - } -}); - -$.each( [ "Width", "Height" ], function( i, name ) { - var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], - type = name.toLowerCase(), - orig = { - innerWidth: $.fn.innerWidth, - innerHeight: $.fn.innerHeight, - outerWidth: $.fn.outerWidth, - outerHeight: $.fn.outerHeight - }; - - function reduce( elem, size, border, margin ) { - $.each( side, function() { - size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; - if ( border ) { - size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; - } - if ( margin ) { - size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; - } - }); - return size; - } - - $.fn[ "inner" + name ] = function( size ) { - if ( size === undefined ) { - return orig[ "inner" + name ].call( this ); - } - - return this.each(function() { - $.style( this, type, reduce( this, size ) + "px" ); - }); - }; - - $.fn[ "outer" + name] = function( size, margin ) { - if ( typeof size !== "number" ) { - return orig[ "outer" + name ].call( this, size ); - } - - return this.each(function() { - $.style( this, type, reduce( this, size, true, margin ) + "px" ); - }); - }; -}); - -//Additional selectors -function visible( element ) { - return !$( element ).parents().andSelf().filter(function() { - return $.curCSS( this, "visibility" ) === "hidden" || - $.expr.filters.hidden( this ); - }).length; -} - -$.extend( $.expr[ ":" ], { - data: function( elem, i, match ) { - return !!$.data( elem, match[ 3 ] ); - }, - - focusable: function( element ) { - var nodeName = element.nodeName.toLowerCase(), - tabIndex = $.attr( element, "tabindex" ); - if ( "area" === nodeName ) { - var map = element.parentNode, - mapName = map.name, - img; - if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { - return false; - } - img = $( "img[usemap=#" + mapName + "]" )[0]; - return !!img && visible( img ); - } - return ( /input|select|textarea|button|object/.test( nodeName ) - ? !element.disabled - : "a" == nodeName - ? element.href || !isNaN( tabIndex ) - : !isNaN( tabIndex )) - // the element and all of its ancestors must be visible - && visible( element ); - }, - - tabbable: function( element ) { - var tabIndex = $.attr( element, "tabindex" ); - return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" ); - } -}); - -})( jQuery ); diff --git a/form_elements/js/jquery.ui.datepicker.js b/form_elements/js/jquery.ui.datepicker.js deleted file mode 100644 index 8937b0f3..00000000 --- a/form_elements/js/jquery.ui.datepicker.js +++ /dev/null @@ -1,1732 +0,0 @@ -/* - * jQuery UI Datepicker 1.8.4 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Datepicker - * - * Depends: - * jquery.ui.core.js - */ -(function( $, undefined ) { - -$.extend($.ui, { datepicker: { version: "1.8.4" } }); - -var PROP_NAME = 'datepicker'; -var dpuuid = new Date().getTime(); - -/* Date picker manager. - Use the singleton instance of this class, $.datepicker, to interact with the date picker. - Settings for (groups of) date pickers are maintained in an instance object, - allowing multiple different settings on the same page. */ - -function Datepicker() { - this.debug = false; // Change this to true to start debugging - this._curInst = null; // The current instance in use - this._keyEvent = false; // If the last event was a key event - this._disabledInputs = []; // List of date picker inputs that have been disabled - this._datepickerShowing = false; // True if the popup picker is showing , false if not - this._inDialog = false; // True if showing within a "dialog", false if not - this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division - this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class - this._appendClass = 'ui-datepicker-append'; // The name of the append marker class - this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class - this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class - this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class - this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class - this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class - this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class - this.regional = []; // Available regional settings, indexed by language code - this.regional[''] = { // Default regional settings - closeText: 'Done', // Display text for close link - prevText: 'Prev', // Display text for previous month link - nextText: 'Next', // Display text for next month link - currentText: 'Today', // Display text for current month link - monthNames: ['January','February','March','April','May','June', - 'July','August','September','October','November','December'], // Names of months for drop-down and formatting - monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting - dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting - dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting - dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday - weekHeader: 'Wk', // Column header for week of the year - dateFormat: 'mm/dd/yy', // See format options on parseDate - firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... - isRTL: false, // True if right-to-left language, false if left-to-right - showMonthAfterYear: false, // True if the year select precedes month, false for month then year - yearSuffix: '' // Additional text to append to the year in the month headers - }; - this._defaults = { // Global defaults for all the date picker instances - showOn: 'focus', // 'focus' for popup on focus, - // 'button' for trigger button, or 'both' for either - showAnim: 'fadeIn', // Name of jQuery animation for popup - showOptions: {}, // Options for enhanced animations - defaultDate: null, // Used when field is blank: actual date, - // +/-number for offset from today, null for today - appendText: '', // Display text following the input box, e.g. showing the format - buttonText: '...', // Text for trigger button - buttonImage: '', // URL for trigger button image - buttonImageOnly: false, // True if the image appears alone, false if it appears on a button - hideIfNoPrevNext: false, // True to hide next/previous month links - // if not applicable, false to just disable them - navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links - gotoCurrent: false, // True if today link goes back to current selection instead - changeMonth: false, // True if month can be selected directly, false if only prev/next - changeYear: false, // True if year can be selected directly, false if only prev/next - yearRange: 'c-10:c+10', // Range of years to display in drop-down, - // either relative to today's year (-nn:+nn), relative to currently displayed year - // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) - showOtherMonths: false, // True to show dates in other months, false to leave blank - selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable - showWeek: false, // True to show week of the year, false to not show it - calculateWeek: this.iso8601Week, // How to calculate the week of the year, - // takes a Date and returns the number of the week for it - shortYearCutoff: '+10', // Short year values < this are in the current century, - // > this are in the previous century, - // string value starting with '+' for current year + value - minDate: null, // The earliest selectable date, or null for no limit - maxDate: null, // The latest selectable date, or null for no limit - duration: 'fast', // Duration of display/closure - beforeShowDay: null, // Function that takes a date and returns an array with - // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', - // [2] = cell title (optional), e.g. $.datepicker.noWeekends - beforeShow: null, // Function that takes an input field and - // returns a set of custom settings for the date picker - onSelect: null, // Define a callback function when a date is selected - onChangeMonthYear: null, // Define a callback function when the month or year is changed - onClose: null, // Define a callback function when the datepicker is closed - numberOfMonths: 1, // Number of months to show at a time - showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) - stepMonths: 1, // Number of months to step back/forward - stepBigMonths: 12, // Number of months to step back/forward for the big links - altField: '', // Selector for an alternate field to store selected dates into - altFormat: '', // The date format to use for the alternate field - constrainInput: true, // The input is constrained by the current date format - showButtonPanel: false, // True to show button panel, false to not show it - autoSize: false // True to size the input for the date format, false to leave as is - }; - $.extend(this._defaults, this.regional['']); - this.dpDiv = $('
      '); -} - -$.extend(Datepicker.prototype, { - /* Class name added to elements to indicate already configured with a date picker. */ - markerClassName: 'hasDatepicker', - - /* Debug logging (if enabled). */ - log: function () { - if (this.debug) - console.log.apply('', arguments); - }, - - // TODO rename to "widget" when switching to widget factory - _widgetDatepicker: function() { - return this.dpDiv; - }, - - /* Override the default settings for all instances of the date picker. - @param settings object - the new settings to use as defaults (anonymous object) - @return the manager object */ - setDefaults: function(settings) { - extendRemove(this._defaults, settings || {}); - return this; - }, - - /* Attach the date picker to a jQuery selection. - @param target element - the target input field or division or span - @param settings object - the new settings to use for this date picker instance (anonymous) */ - _attachDatepicker: function(target, settings) { - // check for settings on the control itself - in namespace 'date:' - var inlineSettings = null; - for (var attrName in this._defaults) { - var attrValue = target.getAttribute('date:' + attrName); - if (attrValue) { - inlineSettings = inlineSettings || {}; - try { - inlineSettings[attrName] = eval(attrValue); - } catch (err) { - inlineSettings[attrName] = attrValue; - } - } - } - var nodeName = target.nodeName.toLowerCase(); - var inline = (nodeName == 'div' || nodeName == 'span'); - if (!target.id) { - this.uuid += 1; - target.id = 'dp' + this.uuid; - } - var inst = this._newInst($(target), inline); - inst.settings = $.extend({}, settings || {}, inlineSettings || {}); - if (nodeName == 'input') { - this._connectDatepicker(target, inst); - } else if (inline) { - this._inlineDatepicker(target, inst); - } - }, - - /* Create a new instance object. */ - _newInst: function(target, inline) { - var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\$1'); // escape jQuery meta chars - return {id: id, input: target, // associated target - selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection - drawMonth: 0, drawYear: 0, // month being drawn - inline: inline, // is datepicker inline or not - dpDiv: (!inline ? this.dpDiv : // presentation div - $('
      '))}; - }, - - /* Attach the date picker to an input field. */ - _connectDatepicker: function(target, inst) { - var input = $(target); - inst.append = $([]); - inst.trigger = $([]); - if (input.hasClass(this.markerClassName)) - return; - this._attachments(input, inst); - input.addClass(this.markerClassName).keydown(this._doKeyDown). - keypress(this._doKeyPress).keyup(this._doKeyUp). - bind("setData.datepicker", function(event, key, value) { - inst.settings[key] = value; - }).bind("getData.datepicker", function(event, key) { - return this._get(inst, key); - }); - this._autoSize(inst); - $.data(target, PROP_NAME, inst); - }, - - /* Make attachments based on settings. */ - _attachments: function(input, inst) { - var appendText = this._get(inst, 'appendText'); - var isRTL = this._get(inst, 'isRTL'); - if (inst.append) - inst.append.remove(); - if (appendText) { - inst.append = $('' + appendText + ''); - input[isRTL ? 'before' : 'after'](inst.append); - } - input.unbind('focus', this._showDatepicker); - if (inst.trigger) - inst.trigger.remove(); - var showOn = this._get(inst, 'showOn'); - if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field - input.focus(this._showDatepicker); - if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked - var buttonText = this._get(inst, 'buttonText'); - var buttonImage = this._get(inst, 'buttonImage'); - inst.trigger = $(this._get(inst, 'buttonImageOnly') ? - $('').addClass(this._triggerClass). - attr({ src: buttonImage, alt: buttonText, title: buttonText }) : - $('').addClass(this._triggerClass). - html(buttonImage == '' ? buttonText : $('').attr( - { src:buttonImage, alt:buttonText, title:buttonText }))); - input[isRTL ? 'before' : 'after'](inst.trigger); - inst.trigger.click(function() { - if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) - $.datepicker._hideDatepicker(); - else - $.datepicker._showDatepicker(input[0]); - return false; - }); - } - }, - - /* Apply the maximum length for the date format. */ - _autoSize: function(inst) { - if (this._get(inst, 'autoSize') && !inst.inline) { - var date = new Date(2009, 12 - 1, 20); // Ensure double digits - var dateFormat = this._get(inst, 'dateFormat'); - if (dateFormat.match(/[DM]/)) { - var findMax = function(names) { - var max = 0; - var maxI = 0; - for (var i = 0; i < names.length; i++) { - if (names[i].length > max) { - max = names[i].length; - maxI = i; - } - } - return maxI; - }; - date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? - 'monthNames' : 'monthNamesShort')))); - date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? - 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); - } - inst.input.attr('size', this._formatDate(inst, date).length); - } - }, - - /* Attach an inline date picker to a div. */ - _inlineDatepicker: function(target, inst) { - var divSpan = $(target); - if (divSpan.hasClass(this.markerClassName)) - return; - divSpan.addClass(this.markerClassName).append(inst.dpDiv). - bind("setData.datepicker", function(event, key, value){ - inst.settings[key] = value; - }).bind("getData.datepicker", function(event, key){ - return this._get(inst, key); - }); - $.data(target, PROP_NAME, inst); - this._setDate(inst, this._getDefaultDate(inst), true); - this._updateDatepicker(inst); - this._updateAlternate(inst); - }, - - /* Pop-up the date picker in a "dialog" box. - @param input element - ignored - @param date string or Date - the initial date to display - @param onSelect function - the function to call when a date is selected - @param settings object - update the dialog date picker instance's settings (anonymous object) - @param pos int[2] - coordinates for the dialog's position within the screen or - event - with x/y coordinates or - leave empty for default (screen centre) - @return the manager object */ - _dialogDatepicker: function(input, date, onSelect, settings, pos) { - var inst = this._dialogInst; // internal instance - if (!inst) { - this.uuid += 1; - var id = 'dp' + this.uuid; - this._dialogInput = $(''); - this._dialogInput.keydown(this._doKeyDown); - $('body').append(this._dialogInput); - inst = this._dialogInst = this._newInst(this._dialogInput, false); - inst.settings = {}; - $.data(this._dialogInput[0], PROP_NAME, inst); - } - extendRemove(inst.settings, settings || {}); - date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); - this._dialogInput.val(date); - - this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); - if (!this._pos) { - var browserWidth = document.documentElement.clientWidth; - var browserHeight = document.documentElement.clientHeight; - var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; - var scrollY = document.documentElement.scrollTop || document.body.scrollTop; - this._pos = // should use actual width/height below - [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; - } - - // move input on screen for focus, but hidden behind dialog - this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); - inst.settings.onSelect = onSelect; - this._inDialog = true; - this.dpDiv.addClass(this._dialogClass); - this._showDatepicker(this._dialogInput[0]); - if ($.blockUI) - $.blockUI(this.dpDiv); - $.data(this._dialogInput[0], PROP_NAME, inst); - return this; - }, - - /* Detach a datepicker from its control. - @param target element - the target input field or division or span */ - _destroyDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - $.removeData(target, PROP_NAME); - if (nodeName == 'input') { - inst.append.remove(); - inst.trigger.remove(); - $target.removeClass(this.markerClassName). - unbind('focus', this._showDatepicker). - unbind('keydown', this._doKeyDown). - unbind('keypress', this._doKeyPress). - unbind('keyup', this._doKeyUp); - } else if (nodeName == 'div' || nodeName == 'span') - $target.removeClass(this.markerClassName).empty(); - }, - - /* Enable the date picker to a jQuery selection. - @param target element - the target input field or division or span */ - _enableDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - if (nodeName == 'input') { - target.disabled = false; - inst.trigger.filter('button'). - each(function() { this.disabled = false; }).end(). - filter('img').css({opacity: '1.0', cursor: ''}); - } - else if (nodeName == 'div' || nodeName == 'span') { - var inline = $target.children('.' + this._inlineClass); - inline.children().removeClass('ui-state-disabled'); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - }, - - /* Disable the date picker to a jQuery selection. - @param target element - the target input field or division or span */ - _disableDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - if (nodeName == 'input') { - target.disabled = true; - inst.trigger.filter('button'). - each(function() { this.disabled = true; }).end(). - filter('img').css({opacity: '0.5', cursor: 'default'}); - } - else if (nodeName == 'div' || nodeName == 'span') { - var inline = $target.children('.' + this._inlineClass); - inline.children().addClass('ui-state-disabled'); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - this._disabledInputs[this._disabledInputs.length] = target; - }, - - /* Is the first field in a jQuery collection disabled as a datepicker? - @param target element - the target input field or division or span - @return boolean - true if disabled, false if enabled */ - _isDisabledDatepicker: function(target) { - if (!target) { - return false; - } - for (var i = 0; i < this._disabledInputs.length; i++) { - if (this._disabledInputs[i] == target) - return true; - } - return false; - }, - - /* Retrieve the instance data for the target control. - @param target element - the target input field or division or span - @return object - the associated instance data - @throws error if a jQuery problem getting data */ - _getInst: function(target) { - try { - return $.data(target, PROP_NAME); - } - catch (err) { - throw 'Missing instance data for this datepicker'; - } - }, - - /* Update or retrieve the settings for a date picker attached to an input field or division. - @param target element - the target input field or division or span - @param name object - the new settings to update or - string - the name of the setting to change or retrieve, - when retrieving also 'all' for all instance settings or - 'defaults' for all global defaults - @param value any - the new value for the setting - (omit if above is an object or to retrieve a value) */ - _optionDatepicker: function(target, name, value) { - var inst = this._getInst(target); - if (arguments.length == 2 && typeof name == 'string') { - return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : - (inst ? (name == 'all' ? $.extend({}, inst.settings) : - this._get(inst, name)) : null)); - } - var settings = name || {}; - if (typeof name == 'string') { - settings = {}; - settings[name] = value; - } - if (inst) { - if (this._curInst == inst) { - this._hideDatepicker(); - } - var date = this._getDateDatepicker(target, true); - extendRemove(inst.settings, settings); - this._attachments($(target), inst); - this._autoSize(inst); - this._setDateDatepicker(target, date); - this._updateDatepicker(inst); - } - }, - - // change method deprecated - _changeDatepicker: function(target, name, value) { - this._optionDatepicker(target, name, value); - }, - - /* Redraw the date picker attached to an input field or division. - @param target element - the target input field or division or span */ - _refreshDatepicker: function(target) { - var inst = this._getInst(target); - if (inst) { - this._updateDatepicker(inst); - } - }, - - /* Set the dates for a jQuery selection. - @param target element - the target input field or division or span - @param date Date - the new date */ - _setDateDatepicker: function(target, date) { - var inst = this._getInst(target); - if (inst) { - this._setDate(inst, date); - this._updateDatepicker(inst); - this._updateAlternate(inst); - } - }, - - /* Get the date(s) for the first entry in a jQuery selection. - @param target element - the target input field or division or span - @param noDefault boolean - true if no default date is to be used - @return Date - the current date */ - _getDateDatepicker: function(target, noDefault) { - var inst = this._getInst(target); - if (inst && !inst.inline) - this._setDateFromField(inst, noDefault); - return (inst ? this._getDate(inst) : null); - }, - - /* Handle keystrokes. */ - _doKeyDown: function(event) { - var inst = $.datepicker._getInst(event.target); - var handled = true; - var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); - inst._keyEvent = true; - if ($.datepicker._datepickerShowing) - switch (event.keyCode) { - case 9: $.datepicker._hideDatepicker(); - handled = false; - break; // hide on tab out - case 13: var sel = $('td.' + $.datepicker._dayOverClass, inst.dpDiv). - add($('td.' + $.datepicker._currentClass, inst.dpDiv)); - if (sel[0]) - $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); - else - $.datepicker._hideDatepicker(); - return false; // don't submit the form - break; // select the value on enter - case 27: $.datepicker._hideDatepicker(); - break; // hide on escape - case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, 'stepBigMonths') : - -$.datepicker._get(inst, 'stepMonths')), 'M'); - break; // previous month/year on page up/+ ctrl - case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, 'stepBigMonths') : - +$.datepicker._get(inst, 'stepMonths')), 'M'); - break; // next month/year on page down/+ ctrl - case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); - handled = event.ctrlKey || event.metaKey; - break; // clear on ctrl or command +end - case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); - handled = event.ctrlKey || event.metaKey; - break; // current on ctrl or command +home - case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); - handled = event.ctrlKey || event.metaKey; - // -1 day on ctrl or command +left - if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, 'stepBigMonths') : - -$.datepicker._get(inst, 'stepMonths')), 'M'); - // next month/year on alt +left on Mac - break; - case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); - handled = event.ctrlKey || event.metaKey; - break; // -1 week on ctrl or command +up - case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); - handled = event.ctrlKey || event.metaKey; - // +1 day on ctrl or command +right - if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, 'stepBigMonths') : - +$.datepicker._get(inst, 'stepMonths')), 'M'); - // next month/year on alt +right - break; - case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); - handled = event.ctrlKey || event.metaKey; - break; // +1 week on ctrl or command +down - default: handled = false; - } - else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home - $.datepicker._showDatepicker(this); - else { - handled = false; - } - if (handled) { - event.preventDefault(); - event.stopPropagation(); - } - }, - - /* Filter entered characters - based on date format. */ - _doKeyPress: function(event) { - var inst = $.datepicker._getInst(event.target); - if ($.datepicker._get(inst, 'constrainInput')) { - var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); - var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); - return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); - } - }, - - /* Synchronise manual entry and field/alternate field. */ - _doKeyUp: function(event) { - var inst = $.datepicker._getInst(event.target); - if (inst.input.val() != inst.lastVal) { - try { - var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), - (inst.input ? inst.input.val() : null), - $.datepicker._getFormatConfig(inst)); - if (date) { // only if valid - $.datepicker._setDateFromField(inst); - $.datepicker._updateAlternate(inst); - $.datepicker._updateDatepicker(inst); - } - } - catch (event) { - $.datepicker.log(event); - } - } - return true; - }, - - /* Pop-up the date picker for a given input field. - @param input element - the input field attached to the date picker or - event - if triggered by focus */ - _showDatepicker: function(input) { - input = input.target || input; - if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger - input = $('input', input.parentNode)[0]; - if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here - return; - var inst = $.datepicker._getInst(input); - if ($.datepicker._curInst && $.datepicker._curInst != inst) { - $.datepicker._curInst.dpDiv.stop(true, true); - } - var beforeShow = $.datepicker._get(inst, 'beforeShow'); - extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); - inst.lastVal = null; - $.datepicker._lastInput = input; - $.datepicker._setDateFromField(inst); - if ($.datepicker._inDialog) // hide cursor - input.value = ''; - if (!$.datepicker._pos) { // position below input - $.datepicker._pos = $.datepicker._findPos(input); - $.datepicker._pos[1] += input.offsetHeight; // add the height - } - var isFixed = false; - $(input).parents().each(function() { - isFixed |= $(this).css('position') == 'fixed'; - return !isFixed; - }); - if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled - $.datepicker._pos[0] -= document.documentElement.scrollLeft; - $.datepicker._pos[1] -= document.documentElement.scrollTop; - } - var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; - $.datepicker._pos = null; - // determine sizing offscreen - inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); - $.datepicker._updateDatepicker(inst); - // fix width for dynamic number of date pickers - // and adjust position before showing - offset = $.datepicker._checkOffset(inst, offset, isFixed); - inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? - 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', - left: offset.left + 'px', top: offset.top + 'px'}); - if (!inst.inline) { - var showAnim = $.datepicker._get(inst, 'showAnim'); - var duration = $.datepicker._get(inst, 'duration'); - var postProcess = function() { - $.datepicker._datepickerShowing = true; - var borders = $.datepicker._getBorders(inst.dpDiv); - inst.dpDiv.find('iframe.ui-datepicker-cover'). // IE6- only - css({left: -borders[0], top: -borders[1], - width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); - }; - inst.dpDiv.zIndex($(input).zIndex()+1); - if ($.effects && $.effects[showAnim]) - inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); - else - inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); - if (!showAnim || !duration) - postProcess(); - if (inst.input.is(':visible') && !inst.input.is(':disabled')) - inst.input.focus(); - $.datepicker._curInst = inst; - } - }, - - /* Generate the date picker content. */ - _updateDatepicker: function(inst) { - var self = this; - var borders = $.datepicker._getBorders(inst.dpDiv); - inst.dpDiv.empty().append(this._generateHTML(inst)) - .find('iframe.ui-datepicker-cover') // IE6- only - .css({left: -borders[0], top: -borders[1], - width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) - .end() - .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') - .bind('mouseout', function(){ - $(this).removeClass('ui-state-hover'); - if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); - if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); - }) - .bind('mouseover', function(){ - if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) { - $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); - $(this).addClass('ui-state-hover'); - if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); - if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); - } - }) - .end() - .find('.' + this._dayOverClass + ' a') - .trigger('mouseover') - .end(); - var numMonths = this._getNumberOfMonths(inst); - var cols = numMonths[1]; - var width = 17; - if (cols > 1) - inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); - else - inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); - inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + - 'Class']('ui-datepicker-multi'); - inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + - 'Class']('ui-datepicker-rtl'); - if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && - inst.input.is(':visible') && !inst.input.is(':disabled')) - inst.input.focus(); - }, - - /* Retrieve the size of left and top borders for an element. - @param elem (jQuery object) the element of interest - @return (number[2]) the left and top borders */ - _getBorders: function(elem) { - var convert = function(value) { - return {thin: 1, medium: 2, thick: 3}[value] || value; - }; - return [parseFloat(convert(elem.css('border-left-width'))), - parseFloat(convert(elem.css('border-top-width')))]; - }, - - /* Check positioning to remain on screen. */ - _checkOffset: function(inst, offset, isFixed) { - var dpWidth = inst.dpDiv.outerWidth(); - var dpHeight = inst.dpDiv.outerHeight(); - var inputWidth = inst.input ? inst.input.outerWidth() : 0; - var inputHeight = inst.input ? inst.input.outerHeight() : 0; - var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); - var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); - - offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); - offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; - offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; - - // now check if datepicker is showing outside window viewport - move to a better place if so. - offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? - Math.abs(offset.left + dpWidth - viewWidth) : 0); - offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? - Math.abs(dpHeight + inputHeight) : 0); - - return offset; - }, - - /* Find an object's position on the screen. */ - _findPos: function(obj) { - var inst = this._getInst(obj); - var isRTL = this._get(inst, 'isRTL'); - while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { - obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; - } - var position = $(obj).offset(); - return [position.left, position.top]; - }, - - /* Hide the date picker from view. - @param input element - the input field attached to the date picker */ - _hideDatepicker: function(input) { - var inst = this._curInst; - if (!inst || (input && inst != $.data(input, PROP_NAME))) - return; - if (this._datepickerShowing) { - var showAnim = this._get(inst, 'showAnim'); - var duration = this._get(inst, 'duration'); - var postProcess = function() { - $.datepicker._tidyDialog(inst); - this._curInst = null; - }; - if ($.effects && $.effects[showAnim]) - inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); - else - inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : - (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); - if (!showAnim) - postProcess(); - var onClose = this._get(inst, 'onClose'); - if (onClose) - onClose.apply((inst.input ? inst.input[0] : null), - [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback - this._datepickerShowing = false; - this._lastInput = null; - if (this._inDialog) { - this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); - if ($.blockUI) { - $.unblockUI(); - $('body').append(this.dpDiv); - } - } - this._inDialog = false; - } - }, - - /* Tidy up after a dialog display. */ - _tidyDialog: function(inst) { - inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); - }, - - /* Close date picker if clicked elsewhere. */ - _checkExternalClick: function(event) { - if (!$.datepicker._curInst) - return; - var $target = $(event.target); - if ($target[0].id != $.datepicker._mainDivId && - $target.parents('#' + $.datepicker._mainDivId).length == 0 && - !$target.hasClass($.datepicker.markerClassName) && - !$target.hasClass($.datepicker._triggerClass) && - $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) - $.datepicker._hideDatepicker(); - }, - - /* Adjust one of the date sub-fields. */ - _adjustDate: function(id, offset, period) { - var target = $(id); - var inst = this._getInst(target[0]); - if (this._isDisabledDatepicker(target[0])) { - return; - } - this._adjustInstDate(inst, offset + - (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning - period); - this._updateDatepicker(inst); - }, - - /* Action for current link. */ - _gotoToday: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - if (this._get(inst, 'gotoCurrent') && inst.currentDay) { - inst.selectedDay = inst.currentDay; - inst.drawMonth = inst.selectedMonth = inst.currentMonth; - inst.drawYear = inst.selectedYear = inst.currentYear; - } - else { - var date = new Date(); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - } - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Action for selecting a new month/year. */ - _selectMonthYear: function(id, select, period) { - var target = $(id); - var inst = this._getInst(target[0]); - inst._selectingMonthYear = false; - inst['selected' + (period == 'M' ? 'Month' : 'Year')] = - inst['draw' + (period == 'M' ? 'Month' : 'Year')] = - parseInt(select.options[select.selectedIndex].value,10); - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Restore input focus after not changing month/year. */ - _clickMonthYear: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - if (inst.input && inst._selectingMonthYear) { - setTimeout(function() { - inst.input.focus(); - }, 0); - } - inst._selectingMonthYear = !inst._selectingMonthYear; - }, - - /* Action for selecting a day. */ - _selectDay: function(id, month, year, td) { - var target = $(id); - if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { - return; - } - var inst = this._getInst(target[0]); - inst.selectedDay = inst.currentDay = $('a', td).html(); - inst.selectedMonth = inst.currentMonth = month; - inst.selectedYear = inst.currentYear = year; - this._selectDate(id, this._formatDate(inst, - inst.currentDay, inst.currentMonth, inst.currentYear)); - }, - - /* Erase the input field and hide the date picker. */ - _clearDate: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - this._selectDate(target, ''); - }, - - /* Update the input field with the selected date. */ - _selectDate: function(id, dateStr) { - var target = $(id); - var inst = this._getInst(target[0]); - dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); - if (inst.input) - inst.input.val(inst.input.val()+dateStr); - this._updateAlternate(inst); - var onSelect = this._get(inst, 'onSelect'); - if (onSelect) - onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback - else if (inst.input) - inst.input.trigger('change'); // fire the change event - if (inst.inline) - this._updateDatepicker(inst); - else { - this._hideDatepicker(); - this._lastInput = inst.input[0]; - if (typeof(inst.input[0]) != 'object') - inst.input.focus(); // restore focus - this._lastInput = null; - } - }, - - /* Update any alternate field to synchronise with the main field. */ - _updateAlternate: function(inst) { - var altField = this._get(inst, 'altField'); - if (altField) { // update alternate field too - var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); - var date = this._getDate(inst); - var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); - $(altField).each(function() { $(this).val(dateStr); }); - } - }, - - /* Set as beforeShowDay function to prevent selection of weekends. - @param date Date - the date to customise - @return [boolean, string] - is this date selectable?, what is its CSS class? */ - noWeekends: function(date) { - var day = date.getDay(); - return [(day > 0 && day < 6), '']; - }, - - /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. - @param date Date - the date to get the week for - @return number - the number of the week within the year that contains this date */ - iso8601Week: function(date) { - var checkDate = new Date(date.getTime()); - // Find Thursday of this week starting on Monday - checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); - var time = checkDate.getTime(); - checkDate.setMonth(0); // Compare with Jan 1 - checkDate.setDate(1); - return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; - }, - - /* Parse a string value into a date object. - See formatDate below for the possible formats. - - @param format string - the expected format of the date - @param value string - the date in the above format - @param settings Object - attributes include: - shortYearCutoff number - the cutoff year for determining the century (optional) - dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) - dayNames string[7] - names of the days from Sunday (optional) - monthNamesShort string[12] - abbreviated names of the months (optional) - monthNames string[12] - names of the months (optional) - @return Date - the extracted date value or null if value is blank */ - parseDate: function (format, value, settings) { - if (format == null || value == null) - throw 'Invalid arguments'; - value = (typeof value == 'object' ? value.toString() : value + ''); - if (value == '') - return null; - var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; - var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; - var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; - var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; - var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; - var year = -1; - var month = -1; - var day = -1; - var doy = -1; - var literal = false; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - // Extract a number from the string value - var getNumber = function(match) { - lookAhead(match); - var size = (match == '@' ? 14 : (match == '!' ? 20 : - (match == 'y' ? 4 : (match == 'o' ? 3 : 2)))); - var digits = new RegExp('^\\d{1,' + size + '}'); - var num = value.substring(iValue).match(digits); - if (!num) - throw 'Missing number at position ' + iValue; - iValue += num[0].length; - return parseInt(num[0], 10); - }; - // Extract a name from the string value and convert to an index - var getName = function(match, shortNames, longNames) { - var names = (lookAhead(match) ? longNames : shortNames); - for (var i = 0; i < names.length; i++) { - if (value.substr(iValue, names[i].length) == names[i]) { - iValue += names[i].length; - return i + 1; - } - } - throw 'Unknown name at position ' + iValue; - }; - // Confirm that a literal character matches the string value - var checkLiteral = function() { - if (value.charAt(iValue) != format.charAt(iFormat)) - throw 'Unexpected literal at position ' + iValue; - iValue++; - }; - var iValue = 0; - for (var iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - checkLiteral(); - else - switch (format.charAt(iFormat)) { - case 'd': - day = getNumber('d'); - break; - case 'D': - getName('D', dayNamesShort, dayNames); - break; - case 'o': - doy = getNumber('o'); - break; - case 'm': - month = getNumber('m'); - break; - case 'M': - month = getName('M', monthNamesShort, monthNames); - break; - case 'y': - year = getNumber('y'); - break; - case '@': - var date = new Date(getNumber('@')); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case '!': - var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case "'": - if (lookAhead("'")) - checkLiteral(); - else - literal = true; - break; - default: - checkLiteral(); - } - } - if (year == -1) - year = new Date().getFullYear(); - else if (year < 100) - year += new Date().getFullYear() - new Date().getFullYear() % 100 + - (year <= shortYearCutoff ? 0 : -100); - if (doy > -1) { - month = 1; - day = doy; - do { - var dim = this._getDaysInMonth(year, month - 1); - if (day <= dim) - break; - month++; - day -= dim; - } while (true); - } - var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); - if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) - throw 'Invalid date'; // E.g. 31/02/* - return date; - }, - - /* Standard date formats. */ - ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) - COOKIE: 'D, dd M yy', - ISO_8601: 'yy-mm-dd', - RFC_822: 'D, d M y', - RFC_850: 'DD, dd-M-y', - RFC_1036: 'D, d M y', - RFC_1123: 'D, d M yy', - RFC_2822: 'D, d M yy', - RSS: 'D, d M y', // RFC 822 - TICKS: '!', - TIMESTAMP: '@', - W3C: 'yy-mm-dd', // ISO 8601 - - _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + - Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), - - /* Format a date object into a string value. - The format can be combinations of the following: - d - day of month (no leading zero) - dd - day of month (two digit) - o - day of year (no leading zeros) - oo - day of year (three digit) - D - day name short - DD - day name long - m - month of year (no leading zero) - mm - month of year (two digit) - M - month name short - MM - month name long - y - year (two digit) - yy - year (four digit) - @ - Unix timestamp (ms since 01/01/1970) - ! - Windows ticks (100ns since 01/01/0001) - '...' - literal text - '' - single quote - - @param format string - the desired format of the date - @param date Date - the date value to format - @param settings Object - attributes include: - dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) - dayNames string[7] - names of the days from Sunday (optional) - monthNamesShort string[12] - abbreviated names of the months (optional) - monthNames string[12] - names of the months (optional) - @return string - the date in the above format */ - formatDate: function (format, date, settings) { - if (!date) - return ''; - var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; - var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; - var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; - var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - // Format a number, with leading zero if necessary - var formatNumber = function(match, value, len) { - var num = '' + value; - if (lookAhead(match)) - while (num.length < len) - num = '0' + num; - return num; - }; - // Format a name, short or long as requested - var formatName = function(match, value, shortNames, longNames) { - return (lookAhead(match) ? longNames[value] : shortNames[value]); - }; - var output = ''; - var literal = false; - if (date) - for (var iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - output += format.charAt(iFormat); - else - switch (format.charAt(iFormat)) { - case 'd': - output += formatNumber('d', date.getDate(), 2); - break; - case 'D': - output += formatName('D', date.getDay(), dayNamesShort, dayNames); - break; - case 'o': - output += formatNumber('o', - (date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3); - break; - case 'm': - output += formatNumber('m', date.getMonth() + 1, 2); - break; - case 'M': - output += formatName('M', date.getMonth(), monthNamesShort, monthNames); - break; - case 'y': - output += (lookAhead('y') ? date.getFullYear() : - (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); - break; - case '@': - output += date.getTime(); - break; - case '!': - output += date.getTime() * 10000 + this._ticksTo1970; - break; - case "'": - if (lookAhead("'")) - output += "'"; - else - literal = true; - break; - default: - output += format.charAt(iFormat); - } - } - return output; - }, - - /* Extract all possible characters from the date format. */ - _possibleChars: function (format) { - var chars = ''; - var literal = false; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - for (var iFormat = 0; iFormat < format.length; iFormat++) - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - chars += format.charAt(iFormat); - else - switch (format.charAt(iFormat)) { - case 'd': case 'm': case 'y': case '@': - chars += '0123456789'; - break; - case 'D': case 'M': - return null; // Accept anything - case "'": - if (lookAhead("'")) - chars += "'"; - else - literal = true; - break; - default: - chars += format.charAt(iFormat); - } - return chars; - }, - - /* Get a setting value, defaulting if necessary. */ - _get: function(inst, name) { - return inst.settings[name] !== undefined ? - inst.settings[name] : this._defaults[name]; - }, - - /* Parse existing date and initialise date picker. */ - _setDateFromField: function(inst, noDefault) { - if (inst.input.val() == inst.lastVal) { - return; - } - var dateFormat = this._get(inst, 'dateFormat'); - var dates = inst.lastVal = inst.input ? inst.input.val() : null; - var date, defaultDate; - date = defaultDate = this._getDefaultDate(inst); - var settings = this._getFormatConfig(inst); - try { - date = this.parseDate(dateFormat, dates, settings) || defaultDate; - } catch (event) { - this.log(event); - dates = (noDefault ? '' : dates); - } - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - inst.currentDay = (dates ? date.getDate() : 0); - inst.currentMonth = (dates ? date.getMonth() : 0); - inst.currentYear = (dates ? date.getFullYear() : 0); - this._adjustInstDate(inst); - }, - - /* Retrieve the default date shown on opening. */ - _getDefaultDate: function(inst) { - return this._restrictMinMax(inst, - this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); - }, - - /* A date may be specified as an exact value or a relative one. */ - _determineDate: function(inst, date, defaultDate) { - var offsetNumeric = function(offset) { - var date = new Date(); - date.setDate(date.getDate() + offset); - return date; - }; - var offsetString = function(offset) { - try { - return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), - offset, $.datepicker._getFormatConfig(inst)); - } - catch (e) { - // Ignore - } - var date = (offset.toLowerCase().match(/^c/) ? - $.datepicker._getDate(inst) : null) || new Date(); - var year = date.getFullYear(); - var month = date.getMonth(); - var day = date.getDate(); - var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; - var matches = pattern.exec(offset); - while (matches) { - switch (matches[2] || 'd') { - case 'd' : case 'D' : - day += parseInt(matches[1],10); break; - case 'w' : case 'W' : - day += parseInt(matches[1],10) * 7; break; - case 'm' : case 'M' : - month += parseInt(matches[1],10); - day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); - break; - case 'y': case 'Y' : - year += parseInt(matches[1],10); - day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); - break; - } - matches = pattern.exec(offset); - } - return new Date(year, month, day); - }; - date = (date == null ? defaultDate : (typeof date == 'string' ? offsetString(date) : - (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); - date = (date && date.toString() == 'Invalid Date' ? defaultDate : date); - if (date) { - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - date.setMilliseconds(0); - } - return this._daylightSavingAdjust(date); - }, - - /* Handle switch to/from daylight saving. - Hours may be non-zero on daylight saving cut-over: - > 12 when midnight changeover, but then cannot generate - midnight datetime, so jump to 1AM, otherwise reset. - @param date (Date) the date to check - @return (Date) the corrected date */ - _daylightSavingAdjust: function(date) { - if (!date) return null; - date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); - return date; - }, - - /* Set the date(s) directly. */ - _setDate: function(inst, date, noChange) { - var clear = !(date); - var origMonth = inst.selectedMonth; - var origYear = inst.selectedYear; - date = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); - inst.selectedDay = inst.currentDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear(); - if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) - this._notifyChange(inst); - this._adjustInstDate(inst); - if (inst.input) { - inst.input.val(clear ? '' : this._formatDate(inst)); - } - }, - - /* Retrieve the date(s) directly. */ - _getDate: function(inst) { - var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : - this._daylightSavingAdjust(new Date( - inst.currentYear, inst.currentMonth, inst.currentDay))); - return startDate; - }, - - /* Generate the HTML for the current state of the date picker. */ - _generateHTML: function(inst) { - var today = new Date(); - today = this._daylightSavingAdjust( - new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time - var isRTL = this._get(inst, 'isRTL'); - var showButtonPanel = this._get(inst, 'showButtonPanel'); - var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); - var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); - var numMonths = this._getNumberOfMonths(inst); - var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); - var stepMonths = this._get(inst, 'stepMonths'); - var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); - var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : - new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - var drawMonth = inst.drawMonth - showCurrentAtPos; - var drawYear = inst.drawYear; - if (drawMonth < 0) { - drawMonth += 12; - drawYear--; - } - if (maxDate) { - var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), - maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); - maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); - while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { - drawMonth--; - if (drawMonth < 0) { - drawMonth = 11; - drawYear--; - } - } - } - inst.drawMonth = drawMonth; - inst.drawYear = drawYear; - var prevText = this._get(inst, 'prevText'); - prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), - this._getFormatConfig(inst))); - var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? - '' + prevText + '' : - (hideIfNoPrevNext ? '' : '' + prevText + '')); - var nextText = this._get(inst, 'nextText'); - nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), - this._getFormatConfig(inst))); - var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? - '' + nextText + '' : - (hideIfNoPrevNext ? '' : '' + nextText + '')); - var currentText = this._get(inst, 'currentText'); - var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); - currentText = (!navigationAsDateFormat ? currentText : - this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); - var controls = (!inst.inline ? '' : ''); - var buttonPanel = (showButtonPanel) ? '
      ' + (isRTL ? controls : '') + - (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
      ' : ''; - var firstDay = parseInt(this._get(inst, 'firstDay'),10); - firstDay = (isNaN(firstDay) ? 0 : firstDay); - var showWeek = this._get(inst, 'showWeek'); - var dayNames = this._get(inst, 'dayNames'); - var dayNamesShort = this._get(inst, 'dayNamesShort'); - var dayNamesMin = this._get(inst, 'dayNamesMin'); - var monthNames = this._get(inst, 'monthNames'); - var monthNamesShort = this._get(inst, 'monthNamesShort'); - var beforeShowDay = this._get(inst, 'beforeShowDay'); - var showOtherMonths = this._get(inst, 'showOtherMonths'); - var selectOtherMonths = this._get(inst, 'selectOtherMonths'); - var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; - var defaultDate = this._getDefaultDate(inst); - var html = ''; - for (var row = 0; row < numMonths[0]; row++) { - var group = ''; - for (var col = 0; col < numMonths[1]; col++) { - var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); - var cornerClass = ' ui-corner-all'; - var calender = ''; - if (isMultiMonth) { - calender += '
      '; - } - calender += '
      ' + - (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + - (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + - this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, - row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers - '
      ' + - ''; - var thead = (showWeek ? '' : ''); - for (var dow = 0; dow < 7; dow++) { // days of the week - var day = (dow + firstDay) % 7; - thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + - '' + dayNamesMin[day] + ''; - } - calender += thead + ''; - var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); - if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) - inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); - var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; - var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate - var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); - for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows - calender += ''; - var tbody = (!showWeek ? '' : ''); - for (var dow = 0; dow < 7; dow++) { // create date picker days - var daySettings = (beforeShowDay ? - beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); - var otherMonth = (printDate.getMonth() != drawMonth); - var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || - (minDate && printDate < minDate) || (maxDate && printDate > maxDate); - tbody += ''; // display selectable date - printDate.setDate(printDate.getDate() + 1); - printDate = this._daylightSavingAdjust(printDate); - } - calender += tbody + ''; - } - drawMonth++; - if (drawMonth > 11) { - drawMonth = 0; - drawYear++; - } - calender += '
      ' + this._get(inst, 'weekHeader') + '
      ' + - this._get(inst, 'calculateWeek')(printDate) + '' + // actions - (otherMonth && !showOtherMonths ? ' ' : // display for other months - (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
      ' + (isMultiMonth ? '
      ' + - ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
      ' : '') : ''); - group += calender; - } - html += group; - } - html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? - '' : ''); - inst._keyEvent = false; - return html; - }, - - /* Generate the month and year header. */ - _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, - secondary, monthNames, monthNamesShort) { - var changeMonth = this._get(inst, 'changeMonth'); - var changeYear = this._get(inst, 'changeYear'); - var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); - var html = '
      '; - var monthHtml = ''; - // month selection - if (secondary || !changeMonth) - monthHtml += '' + monthNames[drawMonth] + ''; - else { - var inMinYear = (minDate && minDate.getFullYear() == drawYear); - var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); - monthHtml += ''; - } - if (!showMonthAfterYear) - html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); - // year selection - if (secondary || !changeYear) - html += '' + drawYear + ''; - else { - // determine range of years to display - var years = this._get(inst, 'yearRange').split(':'); - var thisYear = new Date().getFullYear(); - var determineYear = function(value) { - var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : - (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : - parseInt(value, 10))); - return (isNaN(year) ? thisYear : year); - }; - var year = determineYear(years[0]); - var endYear = Math.max(year, determineYear(years[1] || '')); - year = (minDate ? Math.max(year, minDate.getFullYear()) : year); - endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); - html += ''; - } - html += this._get(inst, 'yearSuffix'); - if (showMonthAfterYear) - html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; - html += '
      '; // Close datepicker_header - return html; - }, - - /* Adjust one of the date sub-fields. */ - _adjustInstDate: function(inst, offset, period) { - var year = inst.drawYear + (period == 'Y' ? offset : 0); - var month = inst.drawMonth + (period == 'M' ? offset : 0); - var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + - (period == 'D' ? offset : 0); - var date = this._restrictMinMax(inst, - this._daylightSavingAdjust(new Date(year, month, day))); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - if (period == 'M' || period == 'Y') - this._notifyChange(inst); - }, - - /* Ensure a date is within any min/max bounds. */ - _restrictMinMax: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - date = (minDate && date < minDate ? minDate : date); - date = (maxDate && date > maxDate ? maxDate : date); - return date; - }, - - /* Notify change of month/year. */ - _notifyChange: function(inst) { - var onChange = this._get(inst, 'onChangeMonthYear'); - if (onChange) - onChange.apply((inst.input ? inst.input[0] : null), - [inst.selectedYear, inst.selectedMonth + 1, inst]); - }, - - /* Determine the number of months to show. */ - _getNumberOfMonths: function(inst) { - var numMonths = this._get(inst, 'numberOfMonths'); - return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); - }, - - /* Determine the current maximum date - ensure no time components are set. */ - _getMinMaxDate: function(inst, minMax) { - return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); - }, - - /* Find the number of days in a given month. */ - _getDaysInMonth: function(year, month) { - return 32 - new Date(year, month, 32).getDate(); - }, - - /* Find the day of the week of the first of a month. */ - _getFirstDayOfMonth: function(year, month) { - return new Date(year, month, 1).getDay(); - }, - - /* Determines if we should allow a "next/prev" month display change. */ - _canAdjustMonth: function(inst, offset, curYear, curMonth) { - var numMonths = this._getNumberOfMonths(inst); - var date = this._daylightSavingAdjust(new Date(curYear, - curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); - if (offset < 0) - date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); - return this._isInRange(inst, date); - }, - - /* Is the given date in the accepted range? */ - _isInRange: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - return ((!minDate || date.getTime() >= minDate.getTime()) && - (!maxDate || date.getTime() <= maxDate.getTime())); - }, - - /* Provide the configuration settings for formatting/parsing. */ - _getFormatConfig: function(inst) { - var shortYearCutoff = this._get(inst, 'shortYearCutoff'); - shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : - new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); - return {shortYearCutoff: shortYearCutoff, - dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), - monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; - }, - - /* Format the given date for display. */ - _formatDate: function(inst, day, month, year) { - if (!day) { - inst.currentDay = inst.selectedDay; - inst.currentMonth = inst.selectedMonth; - inst.currentYear = inst.selectedYear; - } - var date = (day ? (typeof day == 'object' ? day : - this._daylightSavingAdjust(new Date(year, month, day))) : - this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); - } -}); - -/* jQuery extend now ignores nulls! */ -function extendRemove(target, props) { - $.extend(target, props); - for (var name in props) - if (props[name] == null || props[name] == undefined) - target[name] = props[name]; - return target; -}; - -/* Determine whether an object is an array. */ -function isArray(a) { - return (a && (($.browser.safari && typeof a == 'object' && a.length) || - (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); -}; - -/* Invoke the datepicker functionality. - @param options string - a command, optionally followed by additional parameters or - Object - settings for attaching new datepicker functionality - @return jQuery object */ -$.fn.datepicker = function(options){ - - /* Initialise the date picker. */ - if (!$.datepicker.initialized) { - $(document).mousedown($.datepicker._checkExternalClick). - find('body').append($.datepicker.dpDiv); - $.datepicker.initialized = true; - } - - var otherArgs = Array.prototype.slice.call(arguments, 1); - if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - return this.each(function() { - typeof options == 'string' ? - $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this].concat(otherArgs)) : - $.datepicker._attachDatepicker(this, options); - }); -}; - -$.datepicker = new Datepicker(); // singleton instance -$.datepicker.initialized = false; -$.datepicker.uuid = new Date().getTime(); -$.datepicker.version = "1.8.4"; - -// Workaround for #4055 -// Add another global to avoid noConflict issues with inline event handlers -window['DP_jQuery_' + dpuuid] = $; - -})(jQuery); diff --git a/form_elements/js/jquery.ui.widget.js b/form_elements/js/jquery.ui.widget.js deleted file mode 100644 index 85e9293b..00000000 --- a/form_elements/js/jquery.ui.widget.js +++ /dev/null @@ -1,237 +0,0 @@ -/*! - * jQuery UI Widget 1.8.4 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ -(function( $, undefined ) { - -var _remove = $.fn.remove; - -$.fn.remove = function( selector, keepData ) { - return this.each(function() { - if ( !keepData ) { - if ( !selector || $.filter( selector, [ this ] ).length ) { - $( "*", this ).add( [ this ] ).each(function() { - $( this ).triggerHandler( "remove" ); - }); - } - } - return _remove.call( $(this), selector, keepData ); - }); -}; - -$.widget = function( name, base, prototype ) { - var namespace = name.split( "." )[ 0 ], - fullName; - name = name.split( "." )[ 1 ]; - fullName = namespace + "-" + name; - - if ( !prototype ) { - prototype = base; - base = $.Widget; - } - - // create selector for plugin - $.expr[ ":" ][ fullName ] = function( elem ) { - return !!$.data( elem, name ); - }; - - $[ namespace ] = $[ namespace ] || {}; - $[ namespace ][ name ] = function( options, element ) { - // allow instantiation without initializing for simple inheritance - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; - - var basePrototype = new base(); - // we need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from -// $.each( basePrototype, function( key, val ) { -// if ( $.isPlainObject(val) ) { -// basePrototype[ key ] = $.extend( {}, val ); -// } -// }); - basePrototype.options = $.extend( true, {}, basePrototype.options ); - $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { - namespace: namespace, - widgetName: name, - widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, - widgetBaseClass: fullName - }, prototype ); - - $.widget.bridge( name, $[ namespace ][ name ] ); -}; - -$.widget.bridge = function( name, object ) { - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string", - args = Array.prototype.slice.call( arguments, 1 ), - returnValue = this; - - // allow multiple hashes to be passed on init - options = !isMethodCall && args.length ? - $.extend.apply( null, [ true, options ].concat(args) ) : - options; - - // prevent calls to internal methods - if ( isMethodCall && options.substring( 0, 1 ) === "_" ) { - return returnValue; - } - - if ( isMethodCall ) { - this.each(function() { - var instance = $.data( this, name ), - methodValue = instance && $.isFunction( instance[options] ) ? - instance[ options ].apply( instance, args ) : - instance; - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue; - return false; - } - }); - } else { - this.each(function() { - var instance = $.data( this, name ); - if ( instance ) { - if ( options ) { - instance.option( options ); - } - instance._init(); - } else { - $.data( this, name, new object( options, this ) ); - } - }); - } - - return returnValue; - }; -}; - -$.Widget = function( options, element ) { - // allow instantiation without initializing for simple inheritance - if ( arguments.length ) { - this._createWidget( options, element ); - } -}; - -$.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - options: { - disabled: false - }, - _createWidget: function( options, element ) { - // $.widget.bridge stores the plugin instance, but we do it anyway - // so that it's stored even before the _create function runs - $.data( element, this.widgetName, this ); - this.element = $( element ); - this.options = $.extend( true, {}, - this.options, - $.metadata && $.metadata.get( element )[ this.widgetName ], - options ); - - var self = this; - this.element.bind( "remove." + this.widgetName, function() { - self.destroy(); - }); - - this._create(); - this._init(); - }, - _create: function() {}, - _init: function() {}, - - destroy: function() { - this.element - .unbind( "." + this.widgetName ) - .removeData( this.widgetName ); - this.widget() - .unbind( "." + this.widgetName ) - .removeAttr( "aria-disabled" ) - .removeClass( - this.widgetBaseClass + "-disabled " + - "ui-state-disabled" ); - }, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key, - self = this; - - if ( arguments.length === 0 ) { - // don't return a reference to the internal hash - return $.extend( {}, self.options ); - } - - if (typeof key === "string" ) { - if ( value === undefined ) { - return this.options[ key ]; - } - options = {}; - options[ key ] = value; - } - - $.each( options, function( key, value ) { - self._setOption( key, value ); - }); - - return self; - }, - _setOption: function( key, value ) { - this.options[ key ] = value; - - if ( key === "disabled" ) { - this.widget() - [ value ? "addClass" : "removeClass"]( - this.widgetBaseClass + "-disabled" + " " + - "ui-state-disabled" ) - .attr( "aria-disabled", value ); - } - - return this; - }, - - enable: function() { - return this._setOption( "disabled", false ); - }, - disable: function() { - return this._setOption( "disabled", true ); - }, - - _trigger: function( type, event, data ) { - var callback = this.options[ type ]; - - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); - data = data || {}; - - // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if ( event.originalEvent ) { - for ( var i = $.event.props.length, prop; i; ) { - prop = $.event.props[ --i ]; - event[ prop ] = event.originalEvent[ prop ]; - } - } - - this.element.trigger( event, data ); - - return !( $.isFunction(callback) && - callback.call( this.element[0], event, data ) === false || - event.isDefaultPrevented() ); - } -}; - -})( jQuery ); diff --git a/form_elements/js/otherselect.js b/form_elements/js/otherselect.js deleted file mode 100644 index a138aba7..00000000 --- a/form_elements/js/otherselect.js +++ /dev/null @@ -1,30 +0,0 @@ -$(document).ready(function () { - $('.otherSelect').each(function (index) - { - var name = $(this).attr('name').replace(/[\[\]]+/g,'-'); - $(this).attr('id',name); - - $('#'+name+' option:last').after(''); - $(this).after(''); - - $(this).removeAttr('name'); - - - $(this).change(function () - { - - if ($(this).val() == 'other') - { - $('#'+$(this).attr('id')+'_field').val(''); - $('#'+$(this).attr('id')+'_other').show('fast'); - } else - { - $('#'+$(this).attr('id')+'_field').val($(this).val()); - $('#'+$(this).attr('id')+'_other').hide('fast'); - } - }); - - }); - }); - - \ No newline at end of file diff --git a/form_elements/js/people_ahah.js b/form_elements/js/people_ahah.js deleted file mode 100755 index 0c545ba3..00000000 --- a/form_elements/js/people_ahah.js +++ /dev/null @@ -1,92 +0,0 @@ - -(function($) { - -if (Drupal.jsEnabled) { - $(document).ready(function() { - $('#edit-mods-people-add-from-repository').blur(function () { - if ($('#edit-mods-people-add-from-repository').val() != '') { - $('#edit-mods-people-add-person').mousedown(); - } - }); - - if (Drupal.ahah != undefined) { - -/** - * Override of Drupal.ahah.prototype.success. The only difference is that we - * allow for new Drupal.settings. - */ -Drupal.ahah.prototype.success = function (response, status) { - $('#edit-mods-people-add-from-repository').val(''); - - var wrapper = $(this.wrapper); - var form = $(this.element).parents('form'); - // Manually insert HTML into the jQuery object, using $() directly crashes - // Safari with long string lengths. http://dev.jquery.com/ticket/1152 - var new_content = $('
      ').html(response.data); - - // Restore the previous action and target to the form. - form.attr('action', this.form_action); - this.form_target ? form.attr('target', this.form_target) : form.removeAttr('target'); - this.form_encattr ? form.attr('target', this.form_encattr) : form.removeAttr('encattr'); - - // Remove the progress element. - if (this.progress.element) { - $(this.progress.element).remove(); - } - if (this.progress.object) { - this.progress.object.stopMonitoring(); - } - $(this.element).removeClass('progress-disabled').attr('disabled', false); - - // Add the new content to the page. - Drupal.freezeHeight(); - if (this.method == 'replace') { - wrapper.empty().append(new_content); - } - else { - wrapper[this.method](new_content); - } - - $('.datepicker').datepicker({ buttonImage: '/misc/date.png', constrainInput: false, showOn: 'button', changeMonth: true, changeYear: true }); - - // Immediately hide the new content if we're using any effects. - if (this.showEffect != 'show') { - new_content.hide(); - } - - // Determine what effect use and what content will receive the effect, then - // show the new content. For browser compatibility, Safari is excluded from - // using effects on table rows. - if (($.browser.safari && $("tr.ahah-new-content", new_content).size() > 0)) { - new_content.show(); - } - else if ($('.ahah-new-content', new_content).size() > 0) { - $('.ahah-new-content', new_content).hide(); - new_content.show(); - $(".ahah-new-content", new_content)[this.showEffect](this.showSpeed); - } - else if (this.showEffect != 'show') { - new_content[this.showEffect](this.showSpeed); - } - - // Merge in new and changed settings, if any. - if (response.settings) { - $.extend(Drupal.settings, response.settings); - } - - // Attach all javascript behaviors to the new content, if it was successfully - // added to the page, this if statement allows #ahah[wrapper] to be optional. - if (new_content.parents('html').length > 0) { - Drupal.attachBehaviors(new_content); - } - - Drupal.unfreezeHeight(); -}; - - } - - - }); -} - -})(jQuery); diff --git a/form_elements/js/tageditor_1-4-1.zip b/form_elements/js/tageditor_1-4-1.zip deleted file mode 100644 index 6264ff55ad9b24d188f29cfa1225655c7940c73e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6803 zcmZ{J1yCGav-YCF-Q9I@4G=82ySqykSs*~rEbcDB2@*(v#T^n@+}+)RL+}vflDhwY z->>Svccyx}y61FHO?CA-Pd%-njDSc0fCr!e_~p(->Iz*$-oXI?EC_%X4*+0e3v%VO z_V5TuR(0v-#tEC38KMN%I1o007!cMI2phY<)N#JVEb94MDEUf;dm&7SA8GBNpNC zSZmsqk@Z1d^k-2_Mhe=oyWp33cC#dSc-WPyIT*J3noq z7r5WN+AX^LZuW-BBL(H+a1>^*PK|p;gR+K2jnsAUoAvi))8)_cfutaXvDmF7R7gLU z*w$#=V0?&0jlo?^A=fNWIEd1uFrA)4&xFcBv@b#RIBY#gs8+8EFX_-dB)rJ)_O#`r zTIM84C#t_(IC)oh%(_Qu`cBT+z;-5ix!gxT4F%M^KpKzUQfn@|s4M!)H=i>}{FZ=7 z(;j`X@*}*~*5lRe_y!*fD5~gt`LqK9rMSx5j&LhKr%hi$%zpE++CwH|oh6c^I*3uk zC%byr_wC$vupgyY%^kQXkkr5~jPzf*m@k(;0KZju|U-9_l$cPS_t=W?mzWu_0SF zKf4ur)dgeKA9OZoRc4Ei(tQ0*IbccD@y6wx@wC$P=vXf#(~eY^V1zn_>OkO7k+%!O z?^9l-tgA+2dH@T!fsg=pQm`-F*1GVzhe&1m$*MW;*3aA(kI&AH3fsfl1}!BDF+sdu zh9$7fV(5yT)@N(x`nGD>iC=A-q`0Ye)#3W%?DScO1$qrbLE2*TnHN}^rvm{wF0h?b z_u7~P8mPl!OF)1jmNnpG2v!;4LQUwWLJWn2FP|E62qc&T@#EZtk2r{)u}>5GFqJ{ExCB?#GnF&7FU%co#e7+2 zDb!SJVc+qm(1Y;y5GRn5s=KF8towR{naYb`q7f;gEDciEy(~a#bJ=G(r0&CMUQZCs zF@x^MQd90SxP?)E;P&%7)7E=XN~>wJIZDQLyXgmL3PK>Qt!RkLUUo5ZA}fmk(q~}< zZt?8w?I;4Cc=o7@6p2SQt=$!clm(ChKJ!gY_$d)ekX^ZHLVenoRXxkzoz<0!>R;)? z75ATSKK6rzp^v`vn2lb33#h4&g4=`*X>xTbYq!RRP;0%j*iJw@?BL`sBVQAPyo6)^ za+)||&1hb6^ror$4`^5xVEesL!sipM?ZKYlu0K{BQQ-tv=4<+?D7=C|&V9r-Y{kze zw zf|1Xu(Z4nfc;BZm+cF5A?tLI<%&K$f^*-JFStg_}7&Y$&pS-kmry@t5x5qorRSCoP z;M{`ZnmYGJYNYe*XInWrM2+XX?STbm^HuBHAE-DX_;zgAxyZV+ukpWXW+Xd2@UYwC zJ=IaiXKt1wd8P2&ZgY433*ObrA| zRPD0(5=rI)P1!>h(VD>sy>Rp0OvbU61Ibf`N>O8iAbu6}tq4?;rW*U(ceGCteJg9& z^7suOXf??Dv`|C;<>V0V^z;V9SF;j?qF` z=n$C{Cv>UoNHXb*f_P$Y_AWwJjdaokds(5oZgfeXyU6S}_zwKFkW~P+4lcF->m69G z^%S$h)|_2Zj5Euo6WTc~mj#c^dGuG~MER~iwn#m*2m>5T9x)Zm48mncAkE42GsJs0 zp@|6HiHNuYsNngZ;@X4LTD-VG_2Z9CUIkBNH2&Qcq%6d0Ocki}@h3@*8jXfm_nRLS zp}MQ8V?v0@CdJZIci|z<3iQ2*MVY46r{wmV43Iuch%KM`iJiSnOh!hpv7Glz<>S^J zp*gRe5?%HywMAdWgKGXeD$nD`E&=ZnI?kMs_;-EnZq8{%!Qp9c2!TH{-g}s|V+1Q^ zBeFi5|8o`}rnHH*wUTZ@USN?6H2^^Hauz$ed)b10IXx}yIc;qmJzc?^P96=0N8n{a zqNg*`?+95380CGXTczKNTPwGjL>22mf-XVFHoT%Zs8Q8Y!RWzyGnC);%nP{YJS5MV z%!(O|T}<2XuFxX!+iEV3OI;i3VBj-98NaRPPuHdxO}6GLI`m{j<@8s3pbGM>@g=ra#krMtzm5lg(c8hsA0XYM5I5a zf>f(+>RV2f43(*# zq69+gTdmcKq6Ee{P*+cBen+cDf0&?K&~_XjdHsH*Qi45KQ}b-fAj1uZ0EChOVzkf! zVCXACG|Pk}{bizz&NR2Rv52NIFV&z^DP%WZ^_oufB(1Y0)h!tw-_U)9ghcYD#e^(4DK56bZ=Q>rHu8C6CaiAYwAw+5Mys_8bS1<2n04Q$;*=={9)5EEdfr^G zlu9oCbQzqyp^Xj>zFbmNCquTc0h##*mv#m8*0Pp`l=&|X(6DOMi%mN`=chXqEr+i5AF!q zV~lvV#2-}T7B!Ddx+%C9fL-w#OT(&dV5Whz^bXwVPR7F(qk+cgud==gajmL3$Hf%p z&H-JZeiv0k98IBVY9y&Tco9;czDv<#(IyN_6YgbncR%G3nlQ-hk{GUthsuDAb!@^A zGvUg37A-}3?%wc$@JIQ6SdN;x%_Z5Hu%?)3^pq0T8S9BwRgizG_wSIqF#?VkXt@n@ z93?0Ba_9;$3hMxj?2pw7N_-1FkdW3>uCj?ZEOAshX*JQUb@ybkVp<~eJ_B36od=@< z?rijFAz^gJ<=BkLJc|19>y^R3ZTX}g(l(YT5)p-5a>&W>3vIz{Ya3rLb97s7V~ySX zZNuh2nt0^42uk)sEj|vvUtFTOTZR|Qq8m?ZWY~0`X9D7~$;B2aETGXlEPEc(LK=u4 zLZ;JqA%-_G{!D15bNA_Fq^UHg7;TZARR{XLeQAL)zrwqSsvmMv%-tM}4&RPyz(peX zT;)NX7f_F*Y+F`!<5#}ICyx+(i_Nf&T8um_)X)1~v7#%9W0eTM`_8~V;Vn~(+}x`5 zfxO$e{=^rU7p=8Fmg{qvc6aQ<*;VL|FaEJ}wdHTXicU^k#Z3Lu{xf5FXbC)L#)Py~KOgqA@*%nGvMR|e-q% z!@ZI8Q{<#DsMfbJKX5kMm6O(|Q+}I%>KI*;$0K!EoR-LMe+1#4S^4e~1af4^Tv;G6 z6Au(C>+Q8w?T+5045Bu?HUfR>443DAzQ9vG=%gT=y$C~J0cRc;KHnFfj0Jp|k4M2L zY-42xzXIHtaQmYnbcHM?dL)W=qa^r_<7zm2kr=ojp^qt?&k<9Fb&B`EKVA3|>b`z+ zYQiir&chMn>f1=m4Kfo)8?dhBLdgDUjVE^RqH$CZl5<7kcIQI39e#Y;Jz*o3bb_uf z(Vfu1n@gZ-1?-QalB=`rZemmlufuI|AtNyf*oR18mj@T3k+G3lL6xX9+*}*%T}>}q zNhKn38WOmQN;d}?Fp#H5tneOAGhplITgR$j@mG()u9}(?xed~8p zrs?-vYuV?U&zm6GYaK5YvHqgHA~72!QJP#}zAO{*3RdQYkPHeb4-KiZS)-^nX^Du~ zuse#2yIhh?_HW>smXJI>XG^$$qTk>ze@a|U2>%s-QuXWo5gu3a zXVB2Lr(7rVtat4XXr6R{a2#*o1@eR!BM9YtIppN^6!ZA*|u>c1-@tm z^^oK(h~7G)gMFAT^(eb%Xk*5ifIiDB5K8N}Z_@lL^4No<^w?|gi`=}D7IOUJQDmrL z+3!8?3^rUk?wLdMPNY6IFjwkN~#*>mKS$`-kFrxSkIbtsK^B$ z40e`yDFvBs9!*AHM|7A(c0P`hoK$$;GD`(eB^>@qWz|13Rl*Qi%noNhGpq;qSo%pH z-9fn9Tf`YkJV(nC&CdQDEB@9l-N_@()pk7kY^SlE1iNy}?lmr^w}R6toc7Qd?J1tb zMFowonuU+1PO2NnBChERIvVqau->gFasTKo82=gHLT$do!odbrN)U#q3ynO(3f@GD ziXFg^+eM9j(D!7@Q^T1cYzWxFSlj|QQQ|4?#q4I6#gre{qZcvdgw0PJsCfn=q+d9QT%aL3}ZLmC4b_(|Zz>a-xkx zP%mSw!lKE@+UByceu#b5FY;D1)#m3E0Sg9f>fB8@gOBg(ZuCfhJzC3v3H2MO>MGRV z%7`jZ=QaD_?8$l%2S3+f=FXg6$}btiOO>w`A5z&v@oslht}K zEXRXmNVdthl1*H{MBzZ`pkiu;B9upi^DF*kP;=XKC=|k@wtfb zxb-RenS?nMU9|z8$8f6ef!D~PzuGyq(WmZii1}G*Z;O3DU*es#x$Pz4;{|{1rVbfk zoMzbe&{K8>fYmXenRcAJaa1(oF$F2_ zN_+ZotoA}MpMLSiEL+4I$?$qfrFSpz?HwaBhY$Rh*Sdp`XMxkR%$jP>Jr;sPc7u)Ox2FY#DWat3;K$oU4q zEAn;Ja)Yz`+sgY2J(GMGJ4FB(5`hucJe++5FThBCS1*nfvZYeu1=k=$dHp+V=Z;8T zO9quB$|BnGLaxo*t}>pUy<#UZZ+}WVoP$m#xLka#UbV!d>!gBhWaLRy6Bs#ppjfYt zH6TdAi#_$Y{}>3dYs+O#-CX5fdrS$(aMizUzr!WjYauRUk~ys}MY9s_l&;!>A$M|k z7)jt{d)5QQi{gJEI5@9BB$!+fCbqRE(w3$BaKo!g=#iGm6#M(tZg5l`thA`iHjK${`aoqbDV+ZP#f<1EmHKYNPKBe!F zgY38wZKi{8z-^`yuMl;5!i~JQgXM1Ej&t>c*nqyYDq~oH1N%fmc)F zDX8KfCOp~sM74`6r`TgM5Jcv`3P(i6`dLF^*Nv-@-F-i1SDEbfx*;67@qWp4wh8NM zE50FmVhWbhH)<9;V&y>^$ALX6jmAGpg>E1D!65~tGZOr!meR;4Bj0@DvkC%d%3I$V zkHptbd^^Gi5O;r`0TK4A_u@zIcKjGd*Q)Ryb@PUR{)*>K0?gvMjoYbAI2=+F48g7mRy7meo26)z67TO6_~S7XhE zRw1w3eiA4JYHmwI^Sp^r=r)G~`g}8Y@MDm+HTSt6ak~^Dh{_S!2ejgaA6m0~_#Vr6 z27t^M2v_czl)fWKQK+6&nY0FE>b|rJ*K|iAMI9bj4IukkNY47=Hx?`Q@qSW%Bby!Fg!OO9QILC=Ol> zM0+V!DFC1*0sX-e>BXk8R?t!f06s7Q0KuUE!2OFWcpm`p;syW?EdT(KOaOq`EvHpe z?BxZCr>udewyT||woEdt3&gikCRWZ{O1FQVg=nFx6LFrnF0JPOUENsUVvD zEYnU7Qji}#l>4>q4I5JUP)wAcE`svbh@loG#7I+l(dpbmH;VO&-wJfn+u|mWONp0aHbtxKsd|&i_(5fTFCLOqH|+L_--4p5TQS_`hZ;f7ikR zX#T2~>;F$y{xj;|`2N3Z|2r!AWiIm%`~RPD|He)H6Gw&m?@YyiX81Rx@K1&*+<(dN q|8T>9XZgRI>Ti~pR(O#UqW{%m8p=q2n+bsQa`V0Xo)YO_>%Ran!*rYg diff --git a/form_elements/xml/gacs.xml b/form_elements/xml/gacs.xml deleted file mode 100644 index dc9f4db7..00000000 --- a/form_elements/xml/gacs.xml +++ /dev/null @@ -1,5562 +0,0 @@ - - - - - - - - marcgac - MARC Code List for Geographic Areas - Network Development and MARC Standards Office - info:lc/vocabulary/gacs - - - info:lc/vocabulary/gacs/a-af - Afghanistan - a-af - - - info:lc/vocabulary/gacs/f - Africa - f - - Islamic countries - - - Sahel - - - - info:lc/vocabulary/gacs/fc - Africa, Central - fc - - Central Africa - - - - info:lc/vocabulary/gacs/fe - Africa, Eastern - fe - - Africa, East - - British East Africa - - - East Africa - - - - Eastern Africa - - - - info:lc/vocabulary/gacs/fq - Africa, French-speaking Equatorial - fq - - Chad, Lake - - - Africa, Equatorial - - - French Equatorial Africa - - - French-speaking Equatorial Africa - - - - info:lc/vocabulary/gacs/ff - Africa, North - ff - - Africa, Northwest - - Northwest Africa - - - - Islamic Empire - - - Rome - - Roman Empire - - - - North Africa - - - - info:lc/vocabulary/gacs/fh - Africa, Northeast - fh - - Africa, Italian East - - - East African Horn - - - Italian East Africa - - - Northeast Africa - - - - info:lc/vocabulary/gacs/fs - Africa, Southern - fs - - Southern Africa - - - - info:lc/vocabulary/gacs/fb - Africa, Sub-Saharan - fb - - Sub-Saharan Africa - - - - info:lc/vocabulary/gacs/fw - Africa, West - fw - - Africa, French-speaking West - - French-speaking West Africa - - - French West Africa - - - - Africa, Northwest - - Northwest Africa - - - - Ghana (Empire) - - - Mali (Empire) - - - British West Africa - - - West Africa - - - - info:lc/vocabulary/gacs/n-us-al - Alabama - n-us-al - - - info:lc/vocabulary/gacs/n-us-ak - Alaska - n-us-ak - - - info:lc/vocabulary/gacs/e-aa - Albania - e-aa - - People's Socialist Republic of Albania - - - - info:lc/vocabulary/gacs/n-cn-ab - Alberta - n-cn-ab - - - info:lc/vocabulary/gacs/f-ae - Algeria - f-ae - - People's Democratic Republic of Algeria - - - - info:lc/vocabulary/gacs/ea - Alps - ea - - - info:lc/vocabulary/gacs/sa - Amazon River - sa - - - info:lc/vocabulary/gacs/poas - American Samoa - poas - - Samoa, American - - - - info:lc/vocabulary/gacs/aa - Amur River (China and Russia) - aa - - Hei Ho (China and Russia) - - - Heilong Jiang (China and Russia) - - - Reka Amur (China and Russia) - - - Sakhalin Ula (China and Russia) - - - - info:lc/vocabulary/gacs/sn - Andes - sn - - Andean Area - - - - info:lc/vocabulary/gacs/e-an - Andorra - e-an - - - info:lc/vocabulary/gacs/f-ao - Angola - f-ao - - Kongo Kingdom - - Congo (Kingdom) - - - - People's Republic of Angola - - - Portuguese West Africa - - - West Africa, Portuguese - - - - info:lc/vocabulary/gacs/nwxa - Anguilla - nwxa - - Coded [nwxi] (Saint Kitts and Nevis) before Mar. 1988 - - - Saint Kitts-Nevis-Anguilla - - St. Christopher-Nevis-Anguilla - - - - - info:lc/vocabulary/gacs/a-cc-an - Anhui Sheng (China) - a-cc-an - - Anhwei Province (China) - - - - info:lc/vocabulary/gacs/t - Antarctic Ocean - t - - - info:lc/vocabulary/gacs/t - Antarctica - t - - Coded also [t-ay] (Antarctica) before Mar. 1988 - - - Polar regions - - - South Shetland Islands (Antarctica) - - Coded [lsfk] (Falkland Islands) before Mar. 1998 - - - - Antarctic regions - - - South Pole - - - - info:lc/vocabulary/gacs/nwaq - Antigua and Barbuda - nwaq - - Antigua - - - Barbuda - - Coded [nwbc] (Barbuda) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/nwla - Antilles, Lesser - nwla - - West Indies, French - - French West Indies - - - - Lesser Antilles - - - - info:lc/vocabulary/gacs/n-usa - Appalachian Mountains - n-usa - - Appalachian Mountains, Southern - - - Appalachian Region - - - Blue Ridge Mountains - - - - info:lc/vocabulary/gacs/ma - Arab countries - ma - - Arabic countries - - - - info:lc/vocabulary/gacs/ar - Arabian Peninsula - ar - - Persian Gulf States - - - Arabia - - - - info:lc/vocabulary/gacs/au - Arabian Sea - au - - Oman, Gulf of - - Gulf of Oman - - - - - info:lc/vocabulary/gacs/r - Arctic Ocean - r - - Barents Sea - - - Beaufort Sea - - - - info:lc/vocabulary/gacs/r - Arctic regions - r - - Polar regions - - - Northeast Passage - - - Northwest Passage - - - North Pole - - - - info:lc/vocabulary/gacs/s-ag - Argentina - s-ag - - - info:lc/vocabulary/gacs/n-us-az - Arizona - n-us-az - - - info:lc/vocabulary/gacs/n-us-ar - Arkansas - n-us-ar - - Ozark Mountains - - - - info:lc/vocabulary/gacs/a-ai - Armenia (Republic) - a-ai - - Coded [e-ur-ai] (Armenia (Republic)) before June 1998 - - - Armenia - - - Transcaucasia - - Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia - (Republic)) before June 1998] - - - - Armenian S.S.R. - - - - info:lc/vocabulary/gacs/nwaw - Aruba - nwaw - - Coded [nwco] (Curaçao) before Sept. 2002 - - - - info:lc/vocabulary/gacs/lsai - Ascension Island (Atlantic Ocean) - lsai - - - info:lc/vocabulary/gacs/u-ac - Ashmore and Cartier Islands - u-ac - - - info:lc/vocabulary/gacs/a - Asia - a - - Islamic countries - - - Orient - - East - - - - - info:lc/vocabulary/gacs/ac - Asia, Central - ac - - Central Asia - - - Soviet Central Asia - - - - info:lc/vocabulary/gacs/l - Atlantic Ocean - l - - Islands of the Atlantic - - - - info:lc/vocabulary/gacs/fa - Atlas Mountains - fa - - - info:lc/vocabulary/gacs/u - Australasia - u - - - info:lc/vocabulary/gacs/u-at - Australia - u-at - - Norfolk Island - - - - info:lc/vocabulary/gacs/u-at-ac - Australian Capital Territory - u-at-ac - - Coded [u-at-ne] (New South Wales) before Sept. 2002 - - - A.C.T. - - - Federal Capital Territory - - - - info:lc/vocabulary/gacs/e-au - Austria - e-au - - Pannonia - - - - info:lc/vocabulary/gacs/a-aj - Azerbaijan - a-aj - - Coded [e-ur-aj] (Azerbaijan) before June 1998 - - - Transcaucasia - - Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia - (Republic)) before June 1998] - - - - Azerbaijan S.S.R. - - - - info:lc/vocabulary/gacs/lnaz - Azores - lnaz - - Açores - - - - info:lc/vocabulary/gacs/nwbf - Bahamas - nwbf - - - info:lc/vocabulary/gacs/a-ba - Bahrain - a-ba - - Bahrein - - - - info:lc/vocabulary/gacs/ed - Balkan Peninsula - ed - - Europe, Southeastern - - - Southeastern Europe - - - - info:lc/vocabulary/gacs/eb - Baltic States - eb - - - info:lc/vocabulary/gacs/a-bg - Bangladesh - a-bg - - East Pakistan (Pakistan) - - - - info:lc/vocabulary/gacs/nwbb - Barbados - nwbb - - - info:lc/vocabulary/gacs/a-cc-pe - Beijing (China) - a-cc-pe - - Peiping (China) - - - Peking (China) - - - - info:lc/vocabulary/gacs/e-bw - Belarus - e-bw - - Coded [e-ur-bw] (Belarus) before June 1998 - - - Kievan Rus - - Coded [e-ur] (Soviet Union) before June 1998 - - - - Belorussian S.S.R. - - - Byelorussian S.S.R. - - - White Russia - - - - info:lc/vocabulary/gacs/e-be - Belgium - e-be - - - info:lc/vocabulary/gacs/ncbh - Belize - ncbh - - British Honduras - - - - info:lc/vocabulary/gacs/el - Benelux countries - el - - Low countries - - - - info:lc/vocabulary/gacs/ab - Bengal, Bay of - ab - - Bay of Bengal - - - - info:lc/vocabulary/gacs/f-dm - Benin - f-dm - - Dahomey - - - People's Republic of Benin - - - - info:lc/vocabulary/gacs/lnbm - Bermuda Islands - lnbm - - - info:lc/vocabulary/gacs/a-bt - Bhutan - a-bt - - - info:lc/vocabulary/gacs/mb - Black Sea - mb - - - info:lc/vocabulary/gacs/a-ccp - Bo Hai (China) - a-ccp - - Bohai (China : Gulf) - - - Chihli, Gulf of (China) - - - Po Gulf (China) - - - Po Hai (China) - - - - info:lc/vocabulary/gacs/s-bo - Bolivia - s-bo - - - info:lc/vocabulary/gacs/nwbn - Bonaire (Netherlands Antilles) - nwbn - - Coded [nwco] (Curaçao) before Sept. 200 - - - - info:lc/vocabulary/gacs/a-bn - Borneo - a-bn - - - info:lc/vocabulary/gacs/e-bn - Bosnia and Hercegovina - e-bn - - Coded [e-yu] (Yugoslavia) before Oct. 1992 - - - - info:lc/vocabulary/gacs/f-bs - Botswana - f-bs - - Bechuanaland - - - - info:lc/vocabulary/gacs/lsbv - Bouvet Island - lsbv - - - info:lc/vocabulary/gacs/s-bl - Brazil - s-bl - - - info:lc/vocabulary/gacs/n-cn-bc - British Columbia - n-cn-bc - - Canada, Western - - Western Canada - - - - Northwest, Pacific - - Northwest (U.S.) - - - Pacific Northwest - - - - - info:lc/vocabulary/gacs/i-bi - British Indian Ocean Territory - i-bi - - Diego Garcia (British Indian Ocean Territory) - - - Chagos Islands - - - Indian Ocean Territory, British - - - - info:lc/vocabulary/gacs/nwvb - British Virgin Islands - nwvb - - Virgin Islands - - Coded [nwvr] (Virgin Islands) before Mar. 1988 - - - - Virgin Islands, British - - - Virgin Islands (Great Britain) - - - Virgin Islands (Presidency) - - - - info:lc/vocabulary/gacs/a-bx - Brunei - a-bx - - - info:lc/vocabulary/gacs/e-bu - Bulgaria - e-bu - - Macedonia - - - Macedonia (Bulgaria) - - - People's Republic of Bulgaria - - - - info:lc/vocabulary/gacs/f-uv - Burkina Faso - f-uv - - Upper Volta - - - - info:lc/vocabulary/gacs/a-br - Burma - a-br - - Shan States - - - Myanmar - - - - info:lc/vocabulary/gacs/f-bd - Burundi - f-bd - - Ruanda-Urundi - - - German East Africa - - - - info:lc/vocabulary/gacs/n-us-ca - California - n-us-ca - - Pacific States - - - - info:lc/vocabulary/gacs/a-cb - Cambodia - a-cb - - Kampuchea - - - Khmer Republic - - - - info:lc/vocabulary/gacs/f-cm - Cameroon - f-cm - - Adamawa (Emirate) - - - Cameroons, French - - - Cameroons, Southern - - - Cameroun - - - French Cameroons - - - Southern Cameroons - - - - info:lc/vocabulary/gacs/n-cn - Canada - n-cn - - Canada, Eastern - - Eastern Canada - - - - Canada, Northern - - Northern Canada - - - - Northwest, Canadian - - Canadian Northwest - - - West (Canada) - - - - Saint Lawrence River - - - - info:lc/vocabulary/gacs/nccz - Canal Zone - nccz - - Panama Canal Zone - - - - info:lc/vocabulary/gacs/lnca - Canary Islands - lnca - - - info:lc/vocabulary/gacs/lncv - Cape Verde - lncv - - Cabo Verde - - - Republic of Cape Verde - - - - info:lc/vocabulary/gacs/cc - Caribbean Area - cc - - Spanish Main - - - Caribbean Sea Region - - - Circumcaribbean - - Coded [cr] (Circumcaribbean) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/cc - Caribbean Sea - cc - - - info:lc/vocabulary/gacs/poci - Caroline Islands - poci - - - info:lc/vocabulary/gacs/ak - Caspian Sea - ak - - - info:lc/vocabulary/gacs/e-urk - Caucasus - e-urk - - - info:lc/vocabulary/gacs/e-urr - Caucasus, Northern (Russia) - e-urr - - North Caucasus (Russia) - - - Northern Caucasus (Russia) - - - - info:lc/vocabulary/gacs/nwcj - Cayman Islands - nwcj - - - info:lc/vocabulary/gacs/f-cx - Central African Republic - f-cx - - Central African Empire - - - Ubangi Shari - - - - info:lc/vocabulary/gacs/nc - Central America - nc - - America, Central - - - Middle America - - Coded [cm] (Middle America) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/u-atc - Central Australia - u-atc - - Coded [u-at] (Australia) before September 2005 - - - Australia, Central - - - - info:lc/vocabulary/gacs/e-urc - Central Chernozem Region (Russia) - e-urc - - Central Black Earth Region (Russia) - - - Central Black Soil Region (Russia) - - - - info:lc/vocabulary/gacs/f-cd - Chad - f-cd - - Tibesti Mountains - - - - info:lc/vocabulary/gacs/s-cl - Chile - s-cl - - - info:lc/vocabulary/gacs/a-cc - China - a-cc - - Manchuria (China) - - - Mainland China - - - People's Republic of China - - - - info:lc/vocabulary/gacs/a-cc-cq - Chongqing (China) - a-cc-cq - - Coded [a-cc-sz] (Szechuan Province (China)) before Sept. 2000 - - - Ch'ung-ch'ing shih (China) - - - Chungking (China) - - - - info:lc/vocabulary/gacs/i-xa - Christmas Island (Indian Ocean) - i-xa - - - info:lc/vocabulary/gacs/i-xb - Cocos (Keeling) Islands - i-xb - - Keeling Islands - - - - info:lc/vocabulary/gacs/q - Cold regions - q - - - info:lc/vocabulary/gacs/s-ck - Colombia - s-ck - - - info:lc/vocabulary/gacs/n-us-co - Colorado - n-us-co - - - info:lc/vocabulary/gacs/b - Commonwealth countries - b - - British Commonwealth countries - - - British Dominions - - - Commonwealth nations - - - - info:lc/vocabulary/gacs/i-cq - Comoros - i-cq - - Comoro Islands - - - Îles Comores - - - - info:lc/vocabulary/gacs/f-cf - Congo (Brazzaville) - f-cf - - Kongo Kingdom - - Congo (Kingdom) - - - - Brazzaville - - - French Congo - - - Middle Congo - - - - info:lc/vocabulary/gacs/f-cg - Congo (Democratic Republic) - f-cg - - Kongo Kingdom - - Congo (Kingdom) - - - - Belgian Congo - - - Congo (Kinshasa) - - - Congo (Leopoldville) - - - Zaire - - - - info:lc/vocabulary/gacs/fg - Congo River - fg - - - info:lc/vocabulary/gacs/n-us-ct - Connecticut - n-us-ct - - - info:lc/vocabulary/gacs/pocw - Cook Islands - pocw - - - info:lc/vocabulary/gacs/u-cs - Coral Sea Islands - u-cs - - - info:lc/vocabulary/gacs/nccr - Costa Rica - nccr - - - info:lc/vocabulary/gacs/f-iv - Côte d'Ivoire - f-iv - - Ivory Coast - - - - info:lc/vocabulary/gacs/e-ci - Croatia - e-ci - - Coded [e-yu] (Yugoslavia) before Oct. 1992] - - - People's Republic of Croatia - - - - info:lc/vocabulary/gacs/nwcu - Cuba - nwcu - - - info:lc/vocabulary/gacs/nwco - Curaçao (Netherlands Antilles) - nwco - - - info:lc/vocabulary/gacs/a-cy - Cyprus - a-cy - - - info:lc/vocabulary/gacs/e-xr - Czech Republic [e-xr] - e-xr - - Coded [e-cs] (Czechoslovakia) before May 1993 - - - Czech Socialist Republic (Czechoslovakia) - - - - info:lc/vocabulary/gacs/e-cs - Czechoslovakia - e-cs - - Includes the Czech Republic and Slovakia treated collectively - - - - info:lc/vocabulary/gacs/eo - Danube River - eo - - - info:lc/vocabulary/gacs/zd - Deep space - zd - - - info:lc/vocabulary/gacs/n-us-de - Delaware - n-us-de - - - info:lc/vocabulary/gacs/e-dk - Denmark - e-dk - - - info:lc/vocabulary/gacs/dd - Developed countries - dd - - Advanced countries - - - Economically advanced countries - - - First World - - - Industrialized countries - - - - info:lc/vocabulary/gacs/d - Developing countries - d - - Emerging nations - - - Third World - - - Underdeveloped areas - - - - info:lc/vocabulary/gacs/f-ft - Djibouti - f-ft - - Afars and Issas, French Territory of the - - - French Somaliland - - - French Territory of the Afars and Issas - - - Somaliland, French - - - - info:lc/vocabulary/gacs/nwdq - Dominica - nwdq - - - info:lc/vocabulary/gacs/nwdr - Dominican Republic - nwdr - - - info:lc/vocabulary/gacs/x - Earth - x - - - info:lc/vocabulary/gacs/n-usr - East (U.S.) - n-usr - - - info:lc/vocabulary/gacs/ae - East Asia - ae - - Asia, East - - - East (Far East) - - - Far East - - - - info:lc/vocabulary/gacs/an - East China Sea - an - - - info:lc/vocabulary/gacs/a-em - East Timor - a-em - - Coded [a-pt] (Portuguese Timor) before April 21, 1980; coded [a-io] (Indonesia) from - 1980-Sept. 2002] - - - Lesser Sunda Islands (Indonesia and East Timor) - - Sunda Islands, Lesser (Indonesia and East Timor) - - - - Timor Island - - - Portuguese Timor - - - Timor, East - - - Timor, Portuguese - - - Timor Timur - - - - info:lc/vocabulary/gacs/poea - Easter Island - poea - - Isla de Pascua - - - Pascua Island - - - - info:lc/vocabulary/gacs/u-ate - Eastern Australia - u-ate - - Coded [u-at] (Australia) before September 2005 - - - Australia, Eastern - - - - info:lc/vocabulary/gacs/xa - Eastern Hemisphere - xa - - - info:lc/vocabulary/gacs/s-ec - Ecuador - s-ec - - - info:lc/vocabulary/gacs/f-ua - Egypt - f-ua - - United Arab Republic - - - - info:lc/vocabulary/gacs/nces - El Salvador - nces - - Salvador - - - - info:lc/vocabulary/gacs/e-uk-en - England - e-uk-en - - Brownsea Island (England) - - - Isle of Wight (England) - - Wight, Isle of - - - - - info:lc/vocabulary/gacs/f-eg - Equatorial Guinea - f-eg - - Fernando Po (Equatorial Guinea) - - Bioco (Equatorial Guinea) - - - Bioko (Equatorial Guinea) - - - Macias Nguema (Equatorial Guinea) - - - - Guinea, Equatorial - - - Guinea, Spanish - - - Río Muni - - - Spanish Guinea - - - - info:lc/vocabulary/gacs/f-ea - Eritrea - f-ea - - Coded [f-et] (Ethiopia) before Nov. 1993 - - - - info:lc/vocabulary/gacs/e-er - Estonia - e-er - - Coded [e-ur-er] (Estonia) before June 1998 - - - - info:lc/vocabulary/gacs/f-et - Ethiopia - f-et - - Abyssinia - - - - info:lc/vocabulary/gacs/me - Eurasia - me - - Asia and Europe (treated collectively) - - - Europe and Asia (treated collectively) - - - - info:lc/vocabulary/gacs/e - Europe - e - - European Economic Community countries - - - European Union countries - - - Holy Roman Empire - - - Rome - - Roman Empire - - - - - info:lc/vocabulary/gacs/ec - Europe, Central - ec - - Central Europe - - - Europe, East Central - - Coded [et] (Europe, East Central) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/ee - Europe, Eastern - ee - - Carpathian Mountains - - - Communist countries - - Coded [v] (Communist countries) before June 1998 - - - - Eastern Europe - - - Europe, East Central - - Coded [et] (Europe, East Central) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/en - Europe, Northern - en - - Northern Europe - - - - info:lc/vocabulary/gacs/es - Europe, Southern - es - - Southern Europe - - - - info:lc/vocabulary/gacs/ew - Europe, Western - ew - - Western Europe - - - - info:lc/vocabulary/gacs/lsfk - Falkland Islands - lsfk - - South Orkney Islands - - - Malvinas Islands - - - - info:lc/vocabulary/gacs/lnfa - Faroe Islands - lnfa - - Faeroe Islands - - - - info:lc/vocabulary/gacs/pofj - Fiji - pofj - - - info:lc/vocabulary/gacs/e-fi - Finland - e-fi - - Lapland - - - - info:lc/vocabulary/gacs/e-fr - France - e-fr - - Corsica (France) - - - - info:lc/vocabulary/gacs/h - French Community - h - - Communauté francaise - - - French Union - - - - info:lc/vocabulary/gacs/s-fg - French Guiana - s-fg - - Guiana, French - - - - info:lc/vocabulary/gacs/pofp - French Polynesia - pofp - - Austral Islands (French Polynesia) - - Tubuai Islands (French Polynesia) - - - - Gambier Islands (French Polynesia) - - - Marquesas Islands (French Polynesia) - - Archipel des Marquises (French Polynesia) - - - Îles Marquises de Mendoça (French Polynesia) - - - Islas Marquesas de Mendoza (French Polynesia) - - - Mendaña (French Polynesia) - - - - Society Islands (French Polynesia) - - - Tuamotu Archipelago (French Polynesia) - - - Oceania, French - - - Polynesia, French - - - - info:lc/vocabulary/gacs/a-cc-fu - Fujian Sheng (China) - a-cc-fu - - Fukien Province (China) - - - - info:lc/vocabulary/gacs/f-go - Gabon - f-go - - - info:lc/vocabulary/gacs/pogg - Galapagos Islands - pogg - - - info:lc/vocabulary/gacs/f-gm - Gambia - f-gm - - - info:lc/vocabulary/gacs/a-cc-ka - Gansu Sheng (China) [a-cc-ka] - a-cc-ka - - Kansu Province (China) - - - - info:lc/vocabulary/gacs/awgz - Gaza Strip - awgz - - Palestine - - - - info:lc/vocabulary/gacs/n-us-ga - Georgia - n-us-ga - - - info:lc/vocabulary/gacs/a-gs - Georgia (Republic) - a-gs - - Coded [e-ur-gs] (Georgia (Republic)) before June 1998 - - - Transcaucasia - - Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia - (Republic)) before June 1998] - - - - Georgia (Soviet Union) - - - Georgian S.S.R. - - - - info:lc/vocabulary/gacs/e-gx - Germany - e-gx - - For Germany as a whole regardless of time period; includes Germany (East) and Germany - (West) as a whole between 1949 and 1990] - - - Berlin (Germany) - - Coded [e-gx] (Germany) for Berlin as a whole; [e-ge] (Germany (East)) for East - Berlin; or [e-gw] (Germany (West)) for West Berlin before Jan. 1991] - - - East Berlin - - - West Berlin - - - - Germany, Northern - - Northern Germany - - - - Prussia (Germany) - - - Germany, Southern - - Southern Germany - - - - - info:lc/vocabulary/gacs/e-ge - Germany (East) - e-ge - - For the eastern part of Germany before 1949 or after 1990 and for the German - Democratic Republic between 1949-1990] - - - Democratic German Republic - - - East Germany - - - German Democratic Republic - - - Germany, Eastern - - - - info:lc/vocabulary/gacs/e-gw - Germany (West) - e-gw - - For the western part of Germany before 1949 or after 1990 and for the Federal Republic - of Germany between 1949-1990 - - - Federal German Republic - - - German Federal Republic - - - Germany, Western - - - West Germany - - - - info:lc/vocabulary/gacs/f-gh - Ghana - f-gh - - Togoland - - - Togoland (British) - - British Togoland - - - - Ashanti - - - Gold Coast - - - - info:lc/vocabulary/gacs/e-gi - Gibraltar - e-gi - - Gibraltar, Strait of - - Strait of Gibraltar - - - - - info:lc/vocabulary/gacs/e-uk - Great Britain - e-uk - - British Isles - - - United Kingdom - - - - info:lc/vocabulary/gacs/e-uk-ui - Great Britain Miscellaneous Island Dependencies - e-uk-ui - - Alderney (Channel Islands) - - - Calf of Man (Isle of Man) - - - Channel Islands - - - Guernsey (Channel Islands) - - - Isle of Man - - Man, Isle of - - - - Jersey (Channel Islands) - - - Island Dependencies of Great Britain - - - United Kingdom Miscellaneous Island Dependencies - - - - info:lc/vocabulary/gacs/nl - Great Lakes (North America) - nl - - - info:lc/vocabulary/gacs/np - Great Plains - np - - - info:lc/vocabulary/gacs/fr - Great Rift Valley - fr - - Rift Valley - - - - info:lc/vocabulary/gacs/e-gr - Greece - e-gr - - Aegean Islands (Greece and Turkey) - - Islands of the Aegean - - - - Aegean Sea - - - Crete (Greece) - - - Dodekanesos (Greece) - - - Macedonia - - - Macedonia (Greece) - - - - info:lc/vocabulary/gacs/n-gl - Greenland - n-gl - - - info:lc/vocabulary/gacs/nwgd - Grenada - nwgd - - Grenadines (Saint Vincent and the Grenadines and Grenada) - - - - info:lc/vocabulary/gacs/nwgp - Guadeloupe - nwgp - - Marie-Galante (Guadeloupe) - - - Saint-Barthélemy - - Coded [nwsb] (Saint-Barthelemy) before Mar. 1988 - - - Saint Bartholomew - - - Saint Barts - - - St. Barthélémy - - - - - info:lc/vocabulary/gacs/pogu - Guam - pogu - - - info:lc/vocabulary/gacs/a-cc-kn - Guangdong Sheng (China) - a-cc-kn - - Kwangtung Province (China) - - - - info:lc/vocabulary/gacs/a-cc-kc - Guangxi Zhuangzu Zizhiqu (China) - a-cc-kc - - Kuang-hsi Chuang tsu tzu chih ch'ü (China) - - - Kwangsi Chuang Autonomous Region - - - - info:lc/vocabulary/gacs/ncgt - Guatemala - ncgt - - - info:lc/vocabulary/gacs/f-gv - Guinea - f-gv - - French Guinea - - - Guinea, French - - - Guinée - - - Republique de Guinée - - - - info:lc/vocabulary/gacs/f-pg - Guinea-Bissau - f-pg - - Guinea, Portuguese - - - Portuguese Guinea - - - - info:lc/vocabulary/gacs/a-cc-kw - Guizhou Sheng (China) - a-cc-kw - - Kweichow Province (China) - - - - info:lc/vocabulary/gacs/s-gy - Guyana - s-gy - - British Guiana - - - Guiana, British - - - - info:lc/vocabulary/gacs/a-cc-ha - Hainan Sheng (China) - a-cc-ha - - Coded [a-cc-kn] (Kwangtung Province (China)) before June 1998 - - - Hainan Island (China) - - - Hainan Province (China) - - - - info:lc/vocabulary/gacs/nwht - Haiti - nwht - - - info:lc/vocabulary/gacs/n-us-hi - Hawaii - n-us-hi - - Sunbelt States - - - - info:lc/vocabulary/gacs/i-hm - Heard and McDonald Islands - i-hm - - Heard Island (Heard and McDonald Islands) - - - McDonald Island (Heard and McDonald Islands) - - - - info:lc/vocabulary/gacs/a-cc-hp - Hebei Sheng (China) - a-cc-hp - - Ho-pei sheng (China) - - - Hopeh Province (China) - - - - info:lc/vocabulary/gacs/a-cc-he - Heilongjiang Sheng (China) - a-cc-he - - Heilungkiang Province (China) - - - - info:lc/vocabulary/gacs/a-cc-ho - Henan Sheng (China) - a-cc-ho - - Honan Province (China) - - - - info:lc/vocabulary/gacs/ah - Himalaya Mountains - ah - - - info:lc/vocabulary/gacs/nwhi - Hispaniola - nwhi - - - info:lc/vocabulary/gacs/ncho - Honduras - ncho - - - info:lc/vocabulary/gacs/a-cc-hk - Hong Kong (China) - a-cc-hk - - Coded [a-hk] (Hong Kong) before June 1998 - - - Hong Kong - - - Hong Kong (China : Special Administrative Region) - - - - info:lc/vocabulary/gacs/a-cc-hh - Hubei Sheng (China) - a-cc-hh - - Hu-pei (China) - - - Hupeh Province (China) - - - - info:lc/vocabulary/gacs/n-cnh - Hudson Bay - n-cnh - - - info:lc/vocabulary/gacs/a-cc-hu - Hunan Sheng (China) - a-cc-hu - - Hunan Province (China) - - - - info:lc/vocabulary/gacs/e-hu - Hungary - e-hu - - Pannonia - - - - info:lc/vocabulary/gacs/e-ic - Iceland - e-ic - - - info:lc/vocabulary/gacs/n-us-id - Idaho - n-us-id - - - info:lc/vocabulary/gacs/n-us-il - Illinois - n-us-il - - - info:lc/vocabulary/gacs/a-ii - India - a-ii - - Andaman and Nicobar Islands (India) - - - French India - - India, French - - - - Jammu and Kashmir (India) - - Kashmir - - - Kashmir and Jammu (India) - - - - Lakshadweep (India) - - Laccadive, Minicoy, and Amindivi Islands (India) - - - - Sikkim (India) - - Coded [a-sk] (Sikkim) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/i - Indian Ocean - i - - Islands of the Indian Ocean - - - Timor Sea - - - - info:lc/vocabulary/gacs/n-us-in - Indiana - n-us-in - - - info:lc/vocabulary/gacs/ai - Indochina - ai - - French Indochina - - - - info:lc/vocabulary/gacs/a-io - Indonesia - a-io - - Celebes (Indonesia) - - Sulawesi (Indonesia) - - - - Java (Indonesia) - - - Kalimantan Barat (Indonesia) - - - Lesser Sunda Islands (Indonesia and East Timor) - - - Madura Island (Indonesia) - - - Maluku (Indonesia) - - Moluccas (Indonesia) - - - - Papua (Indonesia) - - Irian Barat (Indonesia) - - - Irian Jaya (Indonesia) - - - West Irian - - - West New Guinea - - - - Sunda Islands, Lesser (Indonesia and East Timor) - - - Sumatra (Indonesia) - - - Timor Island - - - Dutch East Indies - - - Netherlands East Indies - - - - info:lc/vocabulary/gacs/a-cc-im - Inner Mongolia (China) - a-cc-im - - Mongolia (Inner Mongolia) - - - - info:lc/vocabulary/gacs/m - Intercontinental areas (Eastern Hemisphere) - m - - - info:lc/vocabulary/gacs/c - Intercontinental areas (Western Hemisphere) - c - - - info:lc/vocabulary/gacs/n-us-ia - Iowa - n-us-ia - - - info:lc/vocabulary/gacs/a-ir - Iran - a-ir - - Armenia - - - Persia - - - - info:lc/vocabulary/gacs/a-iq - Iraq - a-iq - - Babylonia - - - - info:lc/vocabulary/gacs/e-ie - Ireland - e-ie - - Aran Islands (Ireland) - - - British Isles - - - Eire - - - Ireland (Eire) - - - Irish Republic - - - Republic of Ireland - - - - info:lc/vocabulary/gacs/a-is - Israel - a-is - - Jerusalem - - - Palestine - - - - info:lc/vocabulary/gacs/e-it - Italy - e-it - - Sardinia (Italy) - - - Sicily (Italy) - - - - info:lc/vocabulary/gacs/nwjm - Jamaica - nwjm - - - info:lc/vocabulary/gacs/lnjn - Jan Mayen Island - lnjn - - - info:lc/vocabulary/gacs/a-ja - Japan - a-ja - - Okinawa Island (Japan) - - Coded [a-ok] (Okinawa) before 1984] - - - - Ryukyu Islands - - - Ryukyu Islands, Southern - - Coded [pory] (Ryukyu Islands, Southern) before 1984 - - - - - info:lc/vocabulary/gacs/a-cc-ku - Jiangsu Sheng (China) - a-cc-ku - - Kiangsu Province (China) - - - - info:lc/vocabulary/gacs/a-cc-ki - Jiangxi Sheng (China) - a-cc-ki - - Kiangsi Province (China) - - - - info:lc/vocabulary/gacs/a-cc-kr - Jilin Sheng (China) - a-cc-kr - - Kirin Province (China) - - - - info:lc/vocabulary/gacs/poji - Johnston Island - poji - - - info:lc/vocabulary/gacs/a-jo - Jordan - a-jo - - Transjordan - - - - info:lc/vocabulary/gacs/zju - Jupiter (Planet) - zju - - - info:lc/vocabulary/gacs/n-us-ks - Kansas - n-us-ks - - - info:lc/vocabulary/gacs/a-kz - Kazakhstan - a-kz - - Coded [e-ur-kz] (Kazakhstan) before June 1998 - - - Kazakh S.S.R. - - - Kazakstan - - - - info:lc/vocabulary/gacs/n-us-ky - Kentucky - n-us-ky - - - info:lc/vocabulary/gacs/f-ke - Kenya - f-ke - - East Africa Protectorate - - - - info:lc/vocabulary/gacs/poki - Kermadec Islands - poki - - - info:lc/vocabulary/gacs/pokb - Kiribati - pokb - - Coded [pogn] (Gilbert and Ellice Islands) or [poln] (Line Islands) before Mar. - 1988 - - - Banaba (Kiribati) - - Ocean Island (Kiribati) - - - - Canton and Enderbury Islands - - Coded [pocp] (Canton and Enderbury Islands) before Mar. 1988 - - - Enderbury and Canton Islands - - - - Gilbert and Ellice Islands Colony - - Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 - - - - Kiritimati (Kiribati) - - Christmas Island (Pacific Ocean) - - - - Phoenix Islands (Kiribati) - - - Gilbert Islands - - - - info:lc/vocabulary/gacs/a-kr - Korea - a-kr - - - info:lc/vocabulary/gacs/a-kn - Korea (North) - a-kn - - Korean People's Republic - - - North Korea - - - - info:lc/vocabulary/gacs/a-ko - Korea (South) - a-ko - - Korea (Republic) - - - South Korea - - - - info:lc/vocabulary/gacs/e-kv - Kosovo - e-kv - - Coded [e-rb] (Serbia) before May 2008 and [e-yu] (Serbia and Montenegro) before April - 2007 - - - - info:lc/vocabulary/gacs/a-cck - Kunlun Mountains (China and India) - a-cck - - Kwenlun Mountains - - - - info:lc/vocabulary/gacs/a-ku - Kuwait - a-ku - - - info:lc/vocabulary/gacs/a-kg - Kyrgyzstan - a-kg - - Coded [e-ur-kg] (Kyrgystan) before June 1998 - - - Kirghiz S.S.R. - - - - info:lc/vocabulary/gacs/nl - Lake States - nl - - Great Lakes States - - - - info:lc/vocabulary/gacs/a-ls - Laos - a-ls - - - info:lc/vocabulary/gacs/cl - Latin America - cl - - Neotropics - - - - info:lc/vocabulary/gacs/e-lv - Latvia - e-lv - - Coded [e-ur-lv] (Latvia) before June 1998 - - - - info:lc/vocabulary/gacs/a-le - Lebanon - a-le - - - info:lc/vocabulary/gacs/nwli - Leeward Islands (West Indies) - nwli - - - info:lc/vocabulary/gacs/f-lo - Lesotho - f-lo - - Basutoland - - - - info:lc/vocabulary/gacs/a-cc-lp - Liaoning Sheng (China) - a-cc-lp - - Liaoning Province (China) - - - - info:lc/vocabulary/gacs/f-lb - Liberia - f-lb - - - info:lc/vocabulary/gacs/f-ly - Libya - f-ly - - Tibesti Mountains - - - - info:lc/vocabulary/gacs/e-lh - Liechtenstein - e-lh - - - info:lc/vocabulary/gacs/poln - Line Islands - poln - - - info:lc/vocabulary/gacs/e-li - Lithuania - e-li - - Coded [e-ur-li] (Lithuania) before March 1998 - - - - info:lc/vocabulary/gacs/n-us-la - Louisiana - n-us-la - - - info:lc/vocabulary/gacs/e-lu - Luxembourg - e-lu - - - info:lc/vocabulary/gacs/a-cc-mh - Macau (China : Special Administrative Region) - a-cc-mh - - Coded [a-mh] (Macao) before May 29, 2000 - - - Macao - - - - info:lc/vocabulary/gacs/e-xn - Macedonia (Republic)] - e-xn - - Coded [e-yu] (Yugoslavia) before Oct. 1992 - - - Macedonia - - - - info:lc/vocabulary/gacs/f-mg - Madagascar - f-mg - - Malagasy Republic - - - - info:lc/vocabulary/gacs/lnma - Madeira Islands - lnma - - Selvagens Islands (Madeira Islands) - - Salvage Islands (Madeira Islands) - - - Salvages (Madeira Islands) - - - - - info:lc/vocabulary/gacs/n-us-me - Maine - n-us-me - - - info:lc/vocabulary/gacs/f-mw - Malawi - f-mw - - Rhodesia and Nyasaland - - Federation of Rhodesia and Nyasaland - - - - Nyasaland - - - - info:lc/vocabulary/gacs/am - Malaya - am - - Malay Peninsula - - - - info:lc/vocabulary/gacs/a-my - Malaysia - a-my - - Sabah - - British North Borneo - - - North Borneo - - - - Sarawak - - - Straits Settlements - - - - info:lc/vocabulary/gacs/i-xc - Maldives - i-xc - - - info:lc/vocabulary/gacs/f-ml - Mali - f-ml - - Songhai Empire - - - French Sudan - - - Sudan, French - - - - info:lc/vocabulary/gacs/e-mm - Malta - e-mm - - - info:lc/vocabulary/gacs/n-cn-mb - Manitoba - n-cn-mb - - - info:lc/vocabulary/gacs/poxd - Mariana Islands - poxd - - Commonwealth of the Northern Mariana Islands - - - Northern Mariana Islands - - - - info:lc/vocabulary/gacs/n-cnm - Maritime Provinces - n-cnm - - - info:lc/vocabulary/gacs/zma - Mars (Planet) - zma - - Red Planet - - - - info:lc/vocabulary/gacs/poxe - Marshall Islands - poxe - - Bikini Atoll (Marshall Islands) - - - - info:lc/vocabulary/gacs/nwmq - Martinique - nwmq - - - info:lc/vocabulary/gacs/n-us-md - Maryland - n-us-md - - Chesapeake Bay (Md. and Va.) - - - Washington Region - - - - info:lc/vocabulary/gacs/n-us-m - Massachusetts - n-us-m - - - info:lc/vocabulary/gacs/f-mu - Mauritania - f-mu - - - info:lc/vocabulary/gacs/i-mf - Mauritius - i-mf - - - info:lc/vocabulary/gacs/i-my - Mayotte - i-my - - Coded [i-cq] (Comoros) before Mar. 1988 - - - - info:lc/vocabulary/gacs/mm - Mediterranean Region - mm - - Byzantine Empire - - - - info:lc/vocabulary/gacs/mm - Mediterranean Sea - mm - - Adriatic Sea - - - Gibraltar, Strait of - - Strait of Gibraltar - - - - Islands of the Mediterranean - - - - info:lc/vocabulary/gacs/ag - Mekong River - ag - - Dza-chu - - - Lan-ts'ang Chiang - - - Lancang Jiang - - - Song Tíên Giang - - - - info:lc/vocabulary/gacs/pome - Melanesia - pome - - - info:lc/vocabulary/gacs/zme - Mercury (Planet) - zme - - - info:lc/vocabulary/gacs/n-mx - Mexico - n-mx - - Colorado River (Colo.-Mexico) - - - Colorado River Delta (Mexico) - - - Middle America - - Coded [cm] (Middle America) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/nm - Mexico, Gulf of - nm - - Gulf of Mexico - - - - info:lc/vocabulary/gacs/n-us-mi - Michigan - n-us-mi - - - info:lc/vocabulary/gacs/pott - Micronesia - pott - - - info:lc/vocabulary/gacs/pomi - Micronesia (Federated States) - pomi - - Coded [pott] (Micronesia) before Mar. 1988 - - - Chuuk (Micronesia) - - Truk (Micronesia) - - - - Kosrae (Micronesia) - - Kusaie (Micronesia) - - - - Pohnpei (Micronesia) - - Ponape (Micronesia) - - - - Yap (Micronesia) - - - Federated States of Micronesia - - - - info:lc/vocabulary/gacs/n-usl - Middle Atlantic States - n-usl - - Middle States - - - - info:lc/vocabulary/gacs/aw - Middle East - aw - - Islamic Empire - - - Latin Orient - - - Rome - - Roman Empire - - - - Asia, Southwestern - - - Asia, Western - - - East (Near East) - - - Eastern Mediterranean - - - Levant - - - Mediterranean Region, Eastern - - - Mideast - - - Near East - - - - info:lc/vocabulary/gacs/n-usc - Middle West - n-usc - - Northwest, Old - - - Midwest - - - North Central States - - - - info:lc/vocabulary/gacs/poxf - Midway Islands - poxf - - - info:lc/vocabulary/gacs/n-us-mn - Minnesota - n-us-mn - - - info:lc/vocabulary/gacs/n-us-ms - Mississippi - n-us-ms - - - info:lc/vocabulary/gacs/n-usm - Mississippi River - n-usm - - - info:lc/vocabulary/gacs/n-us-mo - Missouri - n-us-mo - - Ozark Mountains - - - - info:lc/vocabulary/gacs/n-uss - Missouri River - n-uss - - - info:lc/vocabulary/gacs/e-mv - Moldova - e-mv - - Coded [e-ur-mv] (Moldova) before June 1998 - - - Moldavia - - - Moldavian S.S.R. - - - - info:lc/vocabulary/gacs/e-mc - Monaco - e-mc - - - info:lc/vocabulary/gacs/a-mp - Mongolia - a-mp - - Mongolian People's Republic - - - Outer Mongolia - - - - info:lc/vocabulary/gacs/n-us-mt - Montana - n-us-mt - - - info:lc/vocabulary/gacs/e-mo - Montenegro - e-mo - - Coded [e-yu] (Yugoslavia) before April 2007 - - - - info:lc/vocabulary/gacs/nwmj - Montserrat - nwmj - - - info:lc/vocabulary/gacs/zmo - Moon - zmo - - - info:lc/vocabulary/gacs/f-mr - Morocco - f-mr - - Ifni - - Coded [f-if] (Ifni) before Mar. 1988 - - - - Tangier (Morocco) - - - French Morocco - - - - info:lc/vocabulary/gacs/f-mz - Mozambique - f-mz - - East Africa, Portuguese German East Africa - - - People's Republic of Mozambique - - - Portuguese East Africa - - - - info:lc/vocabulary/gacs/f-sx - Namibia - f-sx - - Africa, Southwest - - - South-West Africa - - - - info:lc/vocabulary/gacs/ponu - Nauru - ponu - - Pleasant Island - - - - info:lc/vocabulary/gacs/n-us-nb - Nebraska - n-us-nb - - - info:lc/vocabulary/gacs/a-np - Nepal - a-np - - - info:lc/vocabulary/gacs/zne - Neptune (Planet) - zne - - - info:lc/vocabulary/gacs/e-ne - Netherlands - e-ne - - Holland - - - - info:lc/vocabulary/gacs/nwna - Netherlands Antilles - nwna - - Dutch West Indies - - - Netherlands West Indies - - - West Indies, Dutch - - - - info:lc/vocabulary/gacs/n-us-nv - Nevada - n-us-nv - - - info:lc/vocabulary/gacs/n-cn-nk - New Brunswick - n-cn-nk - - - info:lc/vocabulary/gacs/ponl - New Caledonia - ponl - - Loyalty Islands (New Caledonia) - - - - info:lc/vocabulary/gacs/n-usn - New England - n-usn - - - info:lc/vocabulary/gacs/a-nw - New Guinea - a-nw - - New Guinea Island - - - - info:lc/vocabulary/gacs/n-us-nh - New Hampshire - n-us-nh - - - info:lc/vocabulary/gacs/n-us-nj - New Jersey - n-us-nj - - - info:lc/vocabulary/gacs/n-us-nm - New Mexico - n-us-nm - - - info:lc/vocabulary/gacs/u-at-ne - New South Wales - u-at-ne - - - info:lc/vocabulary/gacs/n-us-ny - New York (State) - n-us-ny - - - info:lc/vocabulary/gacs/u-nz - New Zealand - u-nz - - - info:lc/vocabulary/gacs/n-cn-nf - Newfoundland and Labrador - n-cn-nf - - Labrador (N.L.) - - - - info:lc/vocabulary/gacs/ncnq - Nicaragua - ncnq - - - info:lc/vocabulary/gacs/f-ng - Niger - f-ng - - Songhai Empire - - - Tibesti Mountains - - - - info:lc/vocabulary/gacs/fi - Niger River - fi - - - info:lc/vocabulary/gacs/f-nr - Nigeria - f-nr - - Adamawa (Emirate) - - - Songhai Empire - - - Biafra - - Coded [f-by] (Biafra) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/fl - Nile River - fl - - - info:lc/vocabulary/gacs/a-cc-nn - Ningxia Huizu Zizhiqu (China) - a-cc-nn - - Ninghsia Province (China) - - - Ningsia Hui Autonomous Region (China) - - - - info:lc/vocabulary/gacs/poxh - Niue - poxh - - - info:lc/vocabulary/gacs/n - North America - n - - America - - - New France - - - Pacific Coast (North America) - - - - info:lc/vocabulary/gacs/ln - North Atlantic Ocean - ln - - Baltic Sea - - - Bermuda Triangle - - - English Channel - - - Fundy, Bay of - - Bay of Fundy - - - - Georges Bank - - - Irish Sea - - - North Sea - - - Norwegian Sea - - - Skagerrak (Denmark and Norway) - - - - info:lc/vocabulary/gacs/n-us-nc - North Carolina - n-us-nc - - - info:lc/vocabulary/gacs/n-us-nd - North Dakota - n-us-nd - - - info:lc/vocabulary/gacs/pn - North Pacific Ocean - pn - - Alaska, Gulf of (Alaska) - - Gulf of Alaska (Alaska) - - - - Bering Sea - - - Philippine Sea - - - Pacific Ocean, North - - - - info:lc/vocabulary/gacs/n-use - Northeastern States - n-use - - Northeast (U.S.) - - - - info:lc/vocabulary/gacs/u-atn - Northern Australia - u-atn - - Coded [u-at] (Australia) before September 2005 - - - Australia, Northern - - - - info:lc/vocabulary/gacs/xb - Northern Hemisphere - xb - - - info:lc/vocabulary/gacs/e-uk-ni - Northern Ireland - e-uk-ni - - Ireland, Northern - - - - info:lc/vocabulary/gacs/u-at-no - Northern Territory - u-at-no - - Carpentaria, Gulf of (N.T. and Qld.) - - Coded [ps] (South Pacific Ocean) before June 1998 - - - Gulf of Carpentaria (N.T. and Qld.) - - - - - info:lc/vocabulary/gacs/n-cn-nt - Northwest Territories - n-cn-nt - - - info:lc/vocabulary/gacs/e-no - Norway - e-no - - Lapland - - - - info:lc/vocabulary/gacs/n-cn-ns - Nova Scotia - n-cn-ns - - - info:lc/vocabulary/gacs/n-cn-nu - Nunavut - n-cn-nu - - - info:lc/vocabulary/gacs/po - Oceania - po - - Oceanica - - - - info:lc/vocabulary/gacs/n-us-oh - Ohio - n-us-oh - - - info:lc/vocabulary/gacs/n-uso - Ohio River - n-uso - - - info:lc/vocabulary/gacs/n-us-ok - Oklahoma - n-us-ok - - Indian Territory - - - Ozark Mountains - - - - info:lc/vocabulary/gacs/a-mk - Oman - a-mk - - Arabia, Southern - - - Muscat and Oman - - - - info:lc/vocabulary/gacs/n-cn-on - Ontario - n-cn-on - - - info:lc/vocabulary/gacs/n-us-or - Oregon - n-us-or - - Pacific States - - - - info:lc/vocabulary/gacs/zo - Outer space - zo - - Space, Outer - - - - info:lc/vocabulary/gacs/p - Pacific Ocean - p - - Pacific Area - - - - info:lc/vocabulary/gacs/a-pk - Pakistan - a-pk - - Azad Kashmir - - Azad Jammu and Kashmir - - - Kashmir - - - - West Pakistan - - - - info:lc/vocabulary/gacs/popl - Palau - popl - - Coded [poci] (Caroline Islands) before Mar. 1988 - - - Belau - - - Pelew - - - Republic of Palau - - - - info:lc/vocabulary/gacs/ncpn - Panama - ncpn - - - info:lc/vocabulary/gacs/a-pp - Papua New Guinea - a-pp - - Admiralty Islands (Papua New Guinea) - - - Bismarck Archipelago (Papua New Guinea) - - - Bougainville Island (Papua New Guinea) - - - D'Entrecasteaux Islands (Papua New Guinea) - - - Louisiade Archipelago (Papua New Guinea) - - - New Britain Island (Papua New Guinea) - - - New Guinea (Territory) - - - New Ireland Island (Papua New Guinea) - - - Papua - - - Trobriand Islands (Papua New Guinea) - - - Woodlark Islands (Papua New Guinea) - - - - info:lc/vocabulary/gacs/aopf - Paracel Islands - aopf - - Hoàng Sa - - - Hsi-sha Islands - - - Xisha Islands - - - - info:lc/vocabulary/gacs/s-py - Paraguay - s-py - - - info:lc/vocabulary/gacs/n-us-pa - Pennsylvania - n-us-pa - - - info:lc/vocabulary/gacs/ap - Persian Gulf - ap - - - info:lc/vocabulary/gacs/s-pe - Peru - s-pe - - - info:lc/vocabulary/gacs/a-ph - Philippines - a-ph - - Eastern Samar (Philippines) - - - Luzon (Philippines) - - - Mindanao Island (Philippines) - - - Negros Island (Philippines) - - - Northern Samar (Philippines) - - - Panay Island (Philippines) - - - Samar (Philippines) - - - Philippine Islands - - - - info:lc/vocabulary/gacs/popc - Pitcairn Island - popc - - - info:lc/vocabulary/gacs/zpl - Pluto (Planet) - zpl - - - info:lc/vocabulary/gacs/e-pl - Poland - e-pl - - - info:lc/vocabulary/gacs/pops - Polynesia - pops - - - info:lc/vocabulary/gacs/e-po - Portugal - e-po - - Iberian Peninsula - - Coded [ei] (Iberian Peninsula) before Mar. 1988 - - - - - info:lc/vocabulary/gacs/n-cnp - Prairie Provinces - n-cnp - - Canada, Western - - Western Canada - - - - - info:lc/vocabulary/gacs/n-cn-pi - Prince Edward Island - n-cn-pi - - - info:lc/vocabulary/gacs/nwpr - Puerto Rico - nwpr - - - info:lc/vocabulary/gacs/ep - Pyrenees - ep - - Pirineos - - - - info:lc/vocabulary/gacs/a-qa - Qatar - a-qa - - - info:lc/vocabulary/gacs/a-cc-ts - Qinghai Sheng (China) - a-cc-ts - - Tsinghai Province (China) - - - - info:lc/vocabulary/gacs/n-cn-qu - Québec (Province) - n-cn-qu - - - info:lc/vocabulary/gacs/u-at-qn - Queensland - u-at-qn - - Carpentaria, Gulf of (N.T. and Qld.) - - Coded [ps] (South Pacific Ocean) before June 1998 - - - Gulf of Carpentaria (N.T. and Qld.) - - - - Great Barrier Reef (Qld.) - - - Torres Strait Islands (Qld.) - - - - info:lc/vocabulary/gacs/mr - Red Sea - mr - - Aden, Gulf of - - Gulf of Aden - - - - Aqaba, Gulf of - - Gulf of Aqaba - - - - - info:lc/vocabulary/gacs/i-re - Réunion - i-re - - - info:lc/vocabulary/gacs/er - Rhine River - er - - - info:lc/vocabulary/gacs/n-us-ri - Rhode Island - n-us-ri - - - info:lc/vocabulary/gacs/su - Rio de la Plata (Argentina and Uruguay) - su - - La Plata River (Argentina and Uruguay) - - - Plata, Rio de la (Argentina and Uruguay) - - - Plate River (Argentina and Uruguay) - - - - info:lc/vocabulary/gacs/nr - Rocky Mountains - nr - - - info:lc/vocabulary/gacs/e-rm - Romania - e-rm - - Moldavia - - - Rumania - - - - info:lc/vocabulary/gacs/e-ru - Russia (Federation) - e-ru - - Coded [e-ur-ru] (Russia (Federation)) before June 1998 - - - Kievan Rus - - Coded [e-ur] (Soviet Union) before June 1998 - - - Kuril Islands (Russia) - - Coded [e-ur-ru] (Russia Federation) before June 1998 - - - Chishima-retto (Russia) - - - Kurile Islands (Russia) - - - Kuril'skie ostrova (Russia) - - - Non-Chernozem Region (Russia) - - Coded [e-ur-ru] (Russia Federation) before June 1998 - - - Non-Black Earth Region (Russia) - - - - Russia, Northern - - Coded [e-ur-ru] (Russia (Federation)) before June 1998 - - - Northern Russia - - - Northern Soviet Union - - - Soviet Union, Northern - - - - Sakha (Russia) - - Àkutskaíà A.S.S.R. (Russia) - - - Yakutia (Russia) - - - - Volgo-Viatskii Region (Russia) - - Coded [e-urv] (Volgo-Viatskii Region, RSFSR) before Mar. 1988 - - - - R.S.F.S.R. - - - Russian Republic - - - Russian S.F.S.R. - - - Russian Soviet Federated Socialist Republic - - - - info:lc/vocabulary/gacs/e-urf - Russian Far East (Russia) - e-urf - - Far East (Russia) - - - Far Eastern Region (Russia) - - - Soviet Far East (Russia) - - Coded [e-uro] (Soviet Central Asia) before 1994 - - - - - info:lc/vocabulary/gacs/f-rw - Rwanda - f-rw - - Ruanda-Urundi - - - German East Africa - - - - info:lc/vocabulary/gacs/nwsd - Saba (Netherlands Antilles) - nwsd - - - info:lc/vocabulary/gacs/fd - Sahara - fd - - Sahara Desert - - - - info:lc/vocabulary/gacs/lsxj - Saint Helena - lsxj - - St. Helena - - - - info:lc/vocabulary/gacs/nwxi - Saint Kitts and Nevis - nwxi - - Nevis - - - Saint Kitts - - - Saint Kitts-Nevis-Anguilla - - St. Christopher-Nevis-Anguilla - - - - Saint Christopher and Nevis - - - - info:lc/vocabulary/gacs/nwxk - Saint Lucia - nwxk - - St. Lucia - - - - info:lc/vocabulary/gacs/nwst - Saint Martin (West Indies) - nwst - - Sint Maarten (West Indies) - - - St. Martin (West Indies) - - - - info:lc/vocabulary/gacs/n-xl - Saint Pierre and Miquelon - n-xl - - Miquelon - - - Iles Saint-Pierre et Miquelon - - - St. Pierre and Miquelon - - - - info:lc/vocabulary/gacs/nwxm - Saint Vincent and the Grenadines - nwxm - - Grenadines (Saint Vincent and the Grenadines and Grenada) - - - Saint Vincent - - St. Vincent - - - - - info:lc/vocabulary/gacs/pows - Samoa - pows - - Western Samoa - - - - info:lc/vocabulary/gacs/posh - Samoan Islands - posh - - Samoa (Islands) - - - - info:lc/vocabulary/gacs/e-sm - San Marino - e-sm - - - info:lc/vocabulary/gacs/f-sf - Sao Tome and Principe - f-sf - - São Thomé e Pr¡ncipe - - - - info:lc/vocabulary/gacs/n-cn-sn - Saskatchewan - n-cn-sn - - - info:lc/vocabulary/gacs/zsa - Saturn (Planet) - zsa - - - info:lc/vocabulary/gacs/a-su - Saudi Arabia - a-su - - - info:lc/vocabulary/gacs/ev - Scandinavia - ev - - - info:lc/vocabulary/gacs/e-uk-st - Scotland - e-uk-st - - Shetland (Scotland) - - - Orkney (Scotland) - - - - info:lc/vocabulary/gacs/f-sg - Senegal - f-sg - - - info:lc/vocabulary/gacs/e-rb - Serbia - e-rb - - Coded [e-yu] (Yugoslavia) before April 2007 - - - - info:lc/vocabulary/gacs/i-se - Seychelles - i-se - - - info:lc/vocabulary/gacs/a-cc-ss - Shaanxi Sheng (China) - a-cc-ss - - Shensi Province (China) - - - - info:lc/vocabulary/gacs/a-cc-sp - Shandong Sheng (China) - a-cc-sp - - Shantung Province (China) - - - - info:lc/vocabulary/gacs/a-cc-sm - Shanghai (China) - a-cc-sm - - - info:lc/vocabulary/gacs/a-cc-sh - Shanxi Sheng (China) - a-cc-sh - - Shansi Province (China) - - - - info:lc/vocabulary/gacs/e-urs - Siberia (Russia) - e-urs - - Siberia, Northeastern (Russia) - - - Siberia, Northwestern (Russia) - - - - info:lc/vocabulary/gacs/e-ure - Siberia, Eastern (Russia) - e-ure - - East Siberian Region (Russia) - - - Eastern Siberia (Russia) - - - - info:lc/vocabulary/gacs/e-urw - Siberia, Western (Russia) - e-urw - - Western Siberia (Russia) - - - - info:lc/vocabulary/gacs/a-cc-sz - Sichuan Sheng (China) - a-cc-sz - - Szechwan Province (China) - - - - info:lc/vocabulary/gacs/f-sl - Sierra Leone - f-sl - - - info:lc/vocabulary/gacs/a-si - Singapore - a-si - - Straits Settlements - - - - info:lc/vocabulary/gacs/nweu - Sint Eustatius (Netherlands Antilles) - nweu - - Saint Eustatius (Netherlands Antilles) - - - St. Eustatius (Netherlands Antilles) - - - Statia (Netherlands Antilles) - - - - info:lc/vocabulary/gacs/e-xo - Slovakia - e-xo - - Coded [e-cs] (Czechoslovakia) before May 1993 - - - Slovak Socialist Republic (Czechoslovakia) - - - - info:lc/vocabulary/gacs/e-xv - Slovenia - e-xv - - Coded [e-yu] (Yugoslavia) before Oct. 1992 - - - - info:lc/vocabulary/gacs/zs - Solar system - zs - - - info:lc/vocabulary/gacs/pobp - Solomon Islands - pobp - - Coded also [posn] (Solomon Islands) before Mar. 1988 - - - Guadalcanal (Solomon Islands) - - - Santa Cruz Islands (Solomon Islands) - - Coded [posc] (Santa Cruz Islands) before Mar. 1988 - - - - British Solomon Islands - - - - info:lc/vocabulary/gacs/f-so - Somalia - f-so - - British Somaliland - - - Italian Somaliland - - - Somali Republic - - - - info:lc/vocabulary/gacs/f-sa - South Africa - f-sa - - Bophuthatswana (South Africa) - - - Homelands (South Africa) - - - Prince Edward Islands - - Froides, Îles - - - Îles Froides - - - - Africa, South - - - Union of South Africa - - - - info:lc/vocabulary/gacs/s - South America - s - - America - - - - info:lc/vocabulary/gacs/az - South Asia - az - - East Indies - - Indies, East - - - - Asia, South - - - - info:lc/vocabulary/gacs/ls - South Atlantic Ocean - ls - - Guinea, Gulf of - - Gulf of Guinea - - - - - info:lc/vocabulary/gacs/u-at-sa - South Australia - u-at-sa - - - info:lc/vocabulary/gacs/n-us-sc - South Carolina - n-us-sc - - - info:lc/vocabulary/gacs/ao - South China Sea - ao - - Islands of the South China Sea - - - - info:lc/vocabulary/gacs/n-us-sd - South Dakota - n-us-sd - - - info:lc/vocabulary/gacs/lsxs - South Georgia and South Sandwich Islands - lsxs - - Coded [lsfk] (Falkland Islands) before Oct. 1992 - - - Sandwich Islands, South - - Coded [lsfk] (Falkland Islands) before Oct. 1992 - - - - South Sandwich Islands - - Coded [lsfk] (Falkland Islands) before Oct. 1992 - - - - - info:lc/vocabulary/gacs/ps - South Pacific Ocean - ps - - Arafura Sea - - - Pacific Ocean, South - - - - info:lc/vocabulary/gacs/as - Southeast Asia - as - - East Indies - - Indies, East - - - - Malay Archipelagon - - - Asia, Southeastern - - - Southeastern Asia - - - - info:lc/vocabulary/gacs/xc - Southern Hemisphere - xc - - - info:lc/vocabulary/gacs/n-usu - Southern States - n-usu - - Confederate States of America - - - Cumberland Mountains - - - Gulf States - - - South Atlantic States - - Atlantic States, South - - - - Southwest, Old - - - Southwestern States - - - Sunbelt States - - - - info:lc/vocabulary/gacs/n-ust - Southwest, New - n-ust - - Southwestern States - - - Sunbelt States - - - - info:lc/vocabulary/gacs/e-ur - Soviet Union - e-ur - - Communist countries - - Coded [v] (Communist countries) before June 1998 - - - - Russia - - Russian Empire - - - - Soviet Union, Southern - - Southern Soviet Union - - - - Soviet Union, Western - - Western Soviet Union - - - - Commonwealth of Independent States countries - - - Former Soviet republics - - - U.S.S.R. - - - - info:lc/vocabulary/gacs/e-urn - Soviet Union, Northwestern - e-urn - - Northwestern Soviet Union - - - - info:lc/vocabulary/gacs/e-sp - Spain - e-sp - - Balearic Islands (Spain) - - - Iberian Peninsula - - Coded [ei] (Iberian Peninsula) before Mar. 1988 - - - - Islamic Empire - - - - info:lc/vocabulary/gacs/f-sh - Spanish North Africa - f-sh - - Ceuta (Spain) - - - Melilla (Spain) - - - Spanish Territories in Northern Morocco - - - - info:lc/vocabulary/gacs/aoxp - Spratly Islands - aoxp - - Nansha Islands - - - Shinnan Islands - - - - info:lc/vocabulary/gacs/a-ce - Sri Lanka - a-ce - - Ceylon - - - - info:lc/vocabulary/gacs/f-sj - Sudan - f-sj - - Anglo-Egyptian Sudan - - - - info:lc/vocabulary/gacs/fn - Sudan (Region) - fn - - - info:lc/vocabulary/gacs/fu - Suez Canal (Egypt) - fu - - - info:lc/vocabulary/gacs/zsu - Sun - zsu - - - info:lc/vocabulary/gacs/s-sr - Suriname - s-sr - - Dutch Guiana - - - Guiana, Dutch - - - Surinam - - - - info:lc/vocabulary/gacs/lnsb - Svalbard (Norway) - lnsb - - Bear Island (Norway) - - Bjørnøya (Norway) - - - - Spitsbergen Island (Norway) - - West Spitsbergen (Norway) - - - - - info:lc/vocabulary/gacs/nwsv - Swan Islands (Honduras) - nwsv - - - info:lc/vocabulary/gacs/f-sq - Swaziland - f-sq - - - info:lc/vocabulary/gacs/e-sw - Sweden - e-sw - - Lapland - - - - info:lc/vocabulary/gacs/e-sz - Switzerland - e-sz - - - info:lc/vocabulary/gacs/a-sy - Syria - a-sy - - United Arab Republic - - - - info:lc/vocabulary/gacs/a-ch - Taiwan - a-ch - - Pescadores Islands - - - Pratas Islands - - - Formosa - - - - info:lc/vocabulary/gacs/a-ta - Tajikistan - a-ta - - Coded [e-ur-ta] (Tajikistan) before June 1998 - - - Tadzik Soviet Socialist Republic - - - Tajik S.S.R. - - - - info:lc/vocabulary/gacs/f-tz - Tanzania - f-tz - - Pemba Island (Tanzania) - - Huthera (Tanzania) - - - - Tanganyika - - - Zanzibar - - - German East Africa - - - - info:lc/vocabulary/gacs/u-at-tm - Tasmania - u-at-tm - - - info:lc/vocabulary/gacs/n-us-tn - Tennessee - n-us-tn - - - info:lc/vocabulary/gacs/i-fs - Terres australes et antarctiques françaises - i-fs - - Kerguelen Islands - - Desolation Islands - - - Îles Kerguélen - - - - French Southern and Antarctic Lands - - - French Southern Indian Ocean Islands - - - Indian Ocean Islands, French - - - T.A.A.F. - - - - info:lc/vocabulary/gacs/n-us-tx - Texas - n-us-tx - - - info:lc/vocabulary/gacs/a-th - Thailand - a-th - - Malay Peninsula - - - Siam - - - - info:lc/vocabulary/gacs/af - Thailand, Gulf of - af - - Gulf of Thailand - - - Siam, Gulf of - - - - info:lc/vocabulary/gacs/a-cc-tn - Tianjin (China) - a-cc-tn - - Tientsin (China) - - - - info:lc/vocabulary/gacs/a-cc-ti - Tibet (China) - a-cc-ti - - Tibetan Autonomous Region (China) - - - - info:lc/vocabulary/gacs/at - Tien Shan - at - - Thian Shan - - - Tian Shan - - - Tien Mountains - - - - info:lc/vocabulary/gacs/f-tg - Togo - f-tg - - Togoland - - - French Togoland - - - Togoland (French) - - - - info:lc/vocabulary/gacs/potl - Tokelau - potl - - Union Islands - - - - info:lc/vocabulary/gacs/poto - Tonga - poto - - Friendly Islands - - - Tonga Islands - - - - info:lc/vocabulary/gacs/nwtr - Trinidad and Tobago - nwtr - - Tobago - - - Trinidad - - - - info:lc/vocabulary/gacs/lstd - Tristan da Cunha - lstd - - - info:lc/vocabulary/gacs/w - Tropics - w - - Equator - - - - info:lc/vocabulary/gacs/f-ti - Tunisia - f-ti - - - info:lc/vocabulary/gacs/a-tu - Turkey - a-tu - - Aegean Islands (Greece and Turkey) - - Islands of the Aegean - - - - Aegean Sea - - - Armenia - - - Asia Minor - - - - info:lc/vocabulary/gacs/a-tk - Turkmenistan - a-tk - - Coded [e-ur-tk] (Turkmenistan) before June 1998 - - - Turkmen S.S.R. - - - - info:lc/vocabulary/gacs/nwtc - Turks and Caicos Islands - nwtc - - Caicos Islands - - - - info:lc/vocabulary/gacs/potv - Tuvalu - potv - - Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 - - - Gilbert and Ellice Islands Colony - - Coded [pogn] (Gilbert and Ellice Islands) before Mar. 1988 - - - - Ellice Islands - - - - info:lc/vocabulary/gacs/f-ug - Uganda - f-ug - - - info:lc/vocabulary/gacs/e-un - Ukraine - e-un - - Coded [e-ur-un] (Ukraine) before June 1998 - - - Kievan Rus - - Coded [e-ur] (Soviet Union) before June 1998 - - - - - info:lc/vocabulary/gacs/a-ts - United Arab Emirates - a-ts - - Abū Ẓaby (United Arab Emirates: Emirate) - - Abu Dhabi (United Arab Emirates : Emirate) - - - - Dubayy (United Arab Emirates : Emirate) - - Dubai - - - - Trucial States - - - - info:lc/vocabulary/gacs/n-us - United States - n-us - - Atlantic Coast (U.S.) - - - Atlantic States - - - Saint Lawrence River - - - Snowbelt States - - Frostbelt (U.S.) - - - - - info:lc/vocabulary/gacs/nwuc - United States Miscellaneous Caribbean Islands - nwuc - - Caribbean Island Dependencies of the United States - - - Island Dependencies of the United States in the Caribbean - - - - info:lc/vocabulary/gacs/poup - United States Miscellaneous Pacific Islands - poup - - Includes American Samoa, Guam, Pacific Islands (Trust Territory) treated - collectively - - - Pacific Islands (Trust Territory) - - Pacific Islands (Ter.) - - - Trust Territory of the Pacific Islands - - - - Island Dependencies of the United States in the Pacific - - - Pacific Island Dependencies of the United States - - - - info:lc/vocabulary/gacs/e-uru - Ural Mountains (Russia) - e-uru - - - info:lc/vocabulary/gacs/zur - Uranus (Planet) - zur - - - info:lc/vocabulary/gacs/s-uy - Uruguay - s-uy - - - info:lc/vocabulary/gacs/n-us-ut - Utah - n-us-ut - - - info:lc/vocabulary/gacs/a-uz - Uzbekistan - a-uz - - Coded [e-ur-uz] (Uzbekistan) before June 1998 - - - Uzbek S.S.R. - - - - info:lc/vocabulary/gacs/ponn - Vanuatu - ponn - - Banks Islands (Vanuatu) - - - New Hebrides - - - Republic of Vanuatu - - - - info:lc/vocabulary/gacs/e-vc - Vatican City - e-vc - - Holy See - - - - info:lc/vocabulary/gacs/s-ve - Venezuela - s-ve - - - info:lc/vocabulary/gacs/zve - Venus (Planet) - zve - - - info:lc/vocabulary/gacs/n-us-vt - Vermont - n-us-vt - - - info:lc/vocabulary/gacs/u-at-vi - Victoria - u-at-vi - - - info:lc/vocabulary/gacs/a-vt - Vietnam - a-vt - - Vietnam (Democratic Republic) - - Coded [a-vn] (Vietnam, North) before Mar. 1988 - - - North Vietnam - - - Vietnam, North - - - - Vietnam (Republic) - - Coded [a-vs] (Viet Nam, South) before Mar. 1988 - - - South Vietnam - - - Vietnam, South - - - - - info:lc/vocabulary/gacs/nwvi - Virgin Islands of the United States - nwvi - - Virgin Islands - - Coded [nwvr] (Virgin Islands) before Mar. 1988 - - - - Virgin Islands (American) - - - Virgin Islands (Danish) - - - - info:lc/vocabulary/gacs/n-us-va - Virginia - n-us-va - - Chesapeake Bay (Md. and Va.) - - - Washington Region - - - - info:lc/vocabulary/gacs/e-urp - Volga River (Russia) - e-urp - - - info:lc/vocabulary/gacs/fv - Volta River (Ghana) - fv - - - info:lc/vocabulary/gacs/powk - Wake Island - powk - - - info:lc/vocabulary/gacs/e-uk-wl - Wales - e-uk-wl - - - info:lc/vocabulary/gacs/powf - Wallis and Futuna Islands - powf - - Futuna Islands (Wallis and Futuna Islands) - - - Uvea Island (Wallis and Futuna Islands) - - - - info:lc/vocabulary/gacs/n-us-dc - Washington (D.C.) - n-us-dc - - Washington Region - - - District of Columbia - - - - info:lc/vocabulary/gacs/n-us-wa - Washington (State) - n-us-wa - - Pacific States - - - - info:lc/vocabulary/gacs/n-usp - West (U.S.) - n-usp - - Colorado River (Colo.-Mexico) - - - Great Basin - - - Northwest, Pacific - - Northwest (U.S.) - - - Pacific Northwest - - - - Northwestern States - - - Far West (U.S.) - - - Pacific and Mountain States - - - Western States (U.S.) - - - - info:lc/vocabulary/gacs/awba - West Bank - awba - - Coded [a-is] (Israel) and/or [a-jo] (Jordan) before Mar. 1988 - - - Jerusalem - - - Palestine - - - Judaea and Samaria - - - West Bank of the Jordan River - - - - info:lc/vocabulary/gacs/nw - West Indies - nw - - Antilles, Greater - - Coded [nwga] (Greater Antilles) before Mar. 1988 - - - - Greater Antilles - - Coded [nwga] (Greater Antilles) before Mar. 1988 - - - - Indies, West - - - - info:lc/vocabulary/gacs/n-us-wv - West Virginia - n-us-wv - - - info:lc/vocabulary/gacs/u-at-we - Western Australia - u-at-we - - Australia, Western - - - - info:lc/vocabulary/gacs/xd - Western Hemisphere - xd - - - info:lc/vocabulary/gacs/f-ss - Western Sahara - f-ss - - Spanish Sahara - - - - info:lc/vocabulary/gacs/nwwi - Windward Islands (West Indies) [nwwi] - nwwi - - - info:lc/vocabulary/gacs/n-us-wi - Wisconsin - n-us-wi - - - info:lc/vocabulary/gacs/n-us-wy - Wyoming - n-us-wy - - - info:lc/vocabulary/gacs/a-ccs - Xi River (China) - a-ccs - - Hsi Chiang (China) - - - Si Kiang (China) - - - Si River (China) - - - West River (China) - - - - info:lc/vocabulary/gacs/a-cc-su - Xinjiang Uygur Zizhiqu (China) - a-cc-su - - Hsin-chiang-wei-wy-erh tzu chin chü (China) - - - Sinkiang Uighur Autonomous Region (China) - - - - info:lc/vocabulary/gacs/a-ccg - Yangtze River (China) - a-ccg - - Chang Chiang (China) - - - Long River (China) - - - - info:lc/vocabulary/gacs/a-ccy - Yellow River (China) - a-ccy - - Hoang Ho (China) - - - Huang Ho (China) - - - Hwang Ho (China) - - - - info:lc/vocabulary/gacs/ay - Yellow Sea - ay - - Huang Hai - - - Kwang Sea - - - - info:lc/vocabulary/gacs/a-ye - Yemen (Republic) - a-ye - - Aden - - Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992] - - - - Aden (Protectorate) - - Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992 - - - - Arabia, Southern - - - Federation of South Arabia - - South Arabia, Federation of - - - - Socotra (Yemen) - - Coded [i-xo] (Socotra Island) before Mar. 1988; Coded [a-ys] (Yemen (People's - Democratic Republic) before Oct. 1992 - - - Sokotra (Yemen) - - - - Arab Republic of Yemen - - - People's Democratic Republic of Yemen - - - Southern Yemen - - - Yemen (Arab Republic) - - - Yemen (People's Democratic Republic) - - Coded [a-ys] (Yemen (People's Democratic Republic) before Oct. 1992 - - - - - info:lc/vocabulary/gacs/e-yu - Yugoslavia - e-yu - - Pannonia - - - Former Yugoslav republics - - - - info:lc/vocabulary/gacs/n-cn-yk - Yukon Territory - n-cn-yk - - - info:lc/vocabulary/gacs/a-cc-yu - Yunnan Sheng (China) - a-cc-yu - - Yunnan Province (China) - - - - info:lc/vocabulary/gacs/fz - Zambezi River - fz - - Rio Zambezi - - - - info:lc/vocabulary/gacs/f-za - Zambia - f-za - - Rhodesia - - - Rhodesia and Nyasaland - - Federation of Rhodesia and Nyasaland - - - - Northern Rhodesia - - - - info:lc/vocabulary/gacs/a-cc-ch - Zhejiang Sheng (China) - a-cc-ch - - Chekiang Province (China) - - - - info:lc/vocabulary/gacs/f-rh - Zimbabwe - f-rh - - Rhodesia - - - Rhodesia and Nyasaland - - Federation of Rhodesia and Nyasaland - - - - Rhodesia, Southern - - - Southern Rhodesia - - - - diff --git a/form_elements/xml/languages.xml b/form_elements/xml/languages.xml deleted file mode 100644 index ef5e8eb3..00000000 --- a/form_elements/xml/languages.xml +++ /dev/null @@ -1,19575 +0,0 @@ - - - - - - - iso639-2b - MARC Code List for Languages - Network Development and MARC Standards Office, Library of Congress - info:lc/vocabulary/languages - - - - info:lc/vocabulary/languages/abk - Abkhaz - abk - - - info:lc/vocabulary/languages/ace - Achinese - ace - - Atjeh - - - - info:lc/vocabulary/languages/ach - Acoli - ach - - Acholi - - - Gang - - - Lwo - - - Shuli - - - - info:lc/vocabulary/languages/ada - Adangme - ada - - Dangme - - - - info:lc/vocabulary/languages/ady - Adygei - ady - - Circassian, Lower - - - Circassian, West - - - Kiakh - - - Kjax - - - Lower Circassian - - - West Circassian - - - - info:lc/vocabulary/languages/aar - Afar - aar - - Adaiel - - - Danakil - - - - info:lc/vocabulary/languages/afh - Afrihili (Artificial language) - afh - - - info:lc/vocabulary/languages/afr - Afrikaans - afr - - Afrikander - - - Cape Dutch - - - - info:lc/vocabulary/languages/afa - Afroasiatic (Other) - afa - - Angas - - Karan - - - Karang (Nigeria) - - - Ngas - - - - Bidiyo - - - Daba (Cameroon and Nigeria) - - - Dangaleat - - - Day (Chad) - - Dari (Chad) - - - Sara Dai - - - - Gabri - - - Gamo (Ethiopia) - - Gemu - - - - Glavda - - - Goemai - - Ankwe - - - Gamai (Nigeria) - - - Kemai - - - - Gude - - - Guruntum-Mbaaru - - Gurdung - - - Guruntum - - - - Hedi - - Hdi - - - - Huba - - Chobba - - - Kilba - - - - Jongor - - Dionkor - - - Djongor - - - - Kamwe - - Higi - - - Higgi - - - Hiji - - - Vacamwe - - - - Kanakuru - - Dera - - - - Kapsiki - - Kamsiki - - - Psikye - - - Ptsake - - - - Kera - - - Mada (Cameroon) - - - Mafa - - Matakam - - - Natakan - - - - Male (Ethiopia) - - Maale - - - - Masa (Chadic) - - Banaa - - - Banana (Masa) - - - Masana - - - Massa - - - Walai - - - - Miya - - - Musgu - - Masa - - - - Nancere - - - Ngizim - - Gwazum - - - Kirdiwat - - - Nugzum - - - Walu - - - - Paduko - - Podoko - - - - Ron - - Chala - - - Run - - - - Saya - - Sayanci - - - Sayara - - - Sayawa - - - Seiyara - - - Seya - - - Seyawa - - - - Southern Mofu - - Mofu, Southern - - - Mofu-Gudur - - - - Tera - - - Tumak - - Maga - - - Sara Toumak - - - Toumak - - - - Tupuri - - Ndore - - - Tuburi - - - - Uldeme - - Mizlime - - - Ouldémé - - - Udlam - - - Uzlam - - - Uzan - - - Wuzlam - - - - Wandala - - Mandara - - - - Yemsa - - Janjero - - - - Zaar - - Vigzar - - - Vikzar - - - - Zulgo - - Zelgwa - - - - - info:lc/vocabulary/languages/ain - Ainu - ain - - - info:lc/vocabulary/languages/aka - Akan - aka - - Twi-Fante - - - - info:lc/vocabulary/languages/akk - Akkadian - akk - - Assyro-Babylonian - - - Babylonian - - - - info:lc/vocabulary/languages/alb - Albanian - alb - - Calabrian Albanian - - Albanian, Calabrian - - - - - info:lc/vocabulary/languages/ale - Aleut - ale - - Eleuth - - - - info:lc/vocabulary/languages/alg - Algonquian (Other) - alg - - Abenaki - - Abnaki - - - - Algonquin - - Algonkin - - - - Atakapa - - - Atikamekw - - Attikamekw - - - Tête-de-Boule - - - - Fox - - - Illinois - - - Kickapoo - - - Mahican - - - Massachuset - - Natick - - - Niantic - - - Nonantum - - - - Menominee - - - Miami (Ind. and Okla.) - - - Mohegan - - Pequot - - - - Montagnais - - Innu (Montagnais) - - - Montagnais Innu - - - Montagnar - - - Montagnard - - - Montagnie - - - Mountainee - - - - Naskapi - - Nascapee - - - Naskapee - - - - Passamaquoddy - - Etchemin - - - Malecite - - - - Penobscot - - - Potawatomi - - - Powhatan - - - Quileute - - - Roanoak - - - Shawnee - - - Wampanoag - - - Yurok - - - - info:lc/vocabulary/languages/ajm - Aljamía - ajm - - - info:lc/vocabulary/languages/alt - Altai - alt - - Oirat (Turkic) - - - Southern Altai - - - - info:lc/vocabulary/languages/tut - Altaic (Other) - tut - - Turko-Tataric (Other) - - - Bulgaro-Turkic - - Turko-Bulgarian - - - (Altaic (Other)) - - - - Dagur - - Daghur - - - Daur - - - - Dolgan - - - Even - - Lamut - - - - Evenki - - O-wen-k`o - - - Tungus - - - - Gagauz - - - Greek Tatar - - Urum - - - - Karaim - - - Karakhanid - - Khakani - - - Qarakhanid - - - - Khakass - - Xakas - - - Xaqas - - - - Khalaj - - - Khitan - - Kitan - - - Liao - - - - Khorezmian Turkic - - Khwarezmian Turkic - - - - Kipchak - - Coman - - - Cuman - - - Falven - - - Kuman - - - Polovtsi - - - Walwen - - - - Moghol - - Mogol - - - - Mongolian, Middle (13th-16th centuries) - - Middle Mongolian (13th-16th centuries) - - - - Mongour - - Tu - - - - Nanai - - Goldi - - - - Northern Altai - - Altai, Northern - - - - Olcha - - Ulcha - - - - Old Turkic - - Turkic, Old - - - - Oroch - - - Oroqen - - Orochon - - - - Salar - - - Shor - - - Sibo - - Xive - - - - Teleut - - - Turkish, Old (to 1500) - - Anatolian Turkish, Old - - - Old Anatolian Turkish - - - Old Ottoman Turkish - - - Old Turkish - - - Ottoman Turkish, Old - - - - Udekhe - - - Western Yugur - - Yugur, Western - - - - - info:lc/vocabulary/languages/amh - Amharic - amh - - Amarigna - - - Amarinya - - - - info:lc/vocabulary/languages/anp - Angika - anp - - Anga - - - - info:lc/vocabulary/languages/apa - Apache languages - apa - - Chiricahua - - - Mescalero - - - White Mountain Apache - - - - info:lc/vocabulary/languages/ara - Arabic - ara - - Hassaniyya - - - - info:lc/vocabulary/languages/arg - Aragonese - arg - - Altoaragonés - - - Aragoieraz - - - Aragonés - - - Fabla Aragonesa - - - High Aragonese - - - Patués - - - Spanish, Aragonese - - - - info:lc/vocabulary/languages/arc - Aramaic - arc - - Aramean - - - Biblical Aramaic - - - Chaldaic - - - Chaldean (Aramaic) - - - Chaldee - - - - info:lc/vocabulary/languages/arp - Arapaho - arp - - - info:lc/vocabulary/languages/arw - Arawak - arw - - Loko (Arawakan) - - - Lokono - - - - info:lc/vocabulary/languages/arm - Armenian - arm - - Khayasa - - Hayasa - - - Khaiass - - - - - info:lc/vocabulary/languages/rup - Aromanian - rup - - Macedo-Romanian - - - - info:lc/vocabulary/languages/art - Artificial (Other) - art - - Ande (Artificial language) - - - Babm - - - Balaibalan - - Bâl-i bîlen - - - Bala-i-balan - - - Balabalan - - - Bâleybelen - - - Bali belen - - - Bâlibîlen - - - - Enochian - - - Europanto - - - Glosa (Artificial language) - - - International auxiliari linguo (Artificial language) - - INTAL (Artificial language) - - - - Loglan (Artificial language) - - - Neo (Artificial language) - - - Novial (Artificial language) - - - Tsolyáni (Artificial language) - - - Vela (Artificial language) - - - - info:lc/vocabulary/languages/asm - Assamese - asm - - Kāmrūpī - - - Rābhāmija - - Rābhāmiz - - - - - info:lc/vocabulary/languages/ath - Athapascan (Other) - ath - - Ahtena - - - Carrier - - Takulli - - - - Chilcotin - - Tsilkotin - - - - Dena'ina - - Tanaina - - - - Kaska - - - Kiowa Apache - - - Koyukon - - - Sarsi - - - Sekani-Beaver - - - Southern Tutchone - - Tutchone, Southern - - - - Tagish - - - Tahltan - - - Tanacross - - - Tsattine - - - Upper Tanana - - Tanana, Upper - - - - Upper Umpqua - - - - info:lc/vocabulary/languages/aus - Australian languages - aus - - Adnyamathanha - - Atynyamatana - - - Wailpi - - - - Alawa - - Galawa - - - - Alyawarra - - Iliaura - - - - Anindilyakwa - - Andilyaugwa - - - - Awabakal - - - Bandjalang - - Minyung - - - - Bidjara - - Pitjara - - - - Biri (Australia) - - Birri (Australia) - - - - Burarra - - Bara (Australia) - - - Jikai - - - Tchikai - - - - Butchulla - - - Darling River dialects - - Bagandji dialects - - - - Dhungutti - - Daingatti - - - Dyangadi - - - Thangatti - - - - Djaru - - Jaroo - - - Tjaru - - - - Djinang - - Jandjinung - - - Yandjinung - - - - Djingili - - Jingulu - - - Tjingili - - - - Eastern Arrernte - - Aranda, Eastern - - - Arrernte, Eastern - - - - Garawa - - Karawa (Australia) - - - Korrawa - - - Kurrawar - - - Leearrawa - - - - Gidabal - - Kitabul - - - - Gubbi-Gubbi - - Kabi Kabi - - - - Gugada - - Kukota - - - - Gumatj - - Gomadj - - - Kainyao - - - Komaits - - - Kumait - - - - Gungabula - - Kongabula - - - - Gunian - - Gooniyandi - - - - Gunwinggu - - - Gupapuyngu - - - Guugu Yimithirr - - - Iwaidja - - Jiwadja - - - Yiwadja - - - - Kala Lagaw Ya - - Mabuiaq - - - - Kalkatungu - - Galgadung - - - - Kattang - - Kutthung - - - - Kitja - - Gidja - - - Kija - - - - Kuku-Yalanji - - Gugu Yalanji - - - Koko Jelandji - - - - Kuuku Ya'u - - Koko Ya'o - - - - Kwini - - Belaa - - - Cuini - - - Goonan - - - Gunin - - - Gwiini - - - Gwini - - - Kunan (Kwini) - - - Kwini/Belaa - - - Wunambal (Kwini) - - - - Malgana - - Maldjana - - - Maljanna - - - Malkana - - - - Mandjildjara - - Mantjiltjara - - - - Mangarayi - - Manggarai (Australia) - - - Mungerry - - - - Maranunggu - - - Martu Wangka - - - Murrinhpatha - - - Nakara - - - Narangga - - Narungga - - - - Narrinyeri - - - Ngaanyatjarra - - - Ngandi - - - Ngarinyin - - Ungarinjin - - - Wungarinjin - - - - Ngarla - - - Ngarluma - - - Nukunu - - Nugunu - - - - Nunggubuyu - - Wubuy - - - - Pintupi - - Bindubi - - - - Pitjantjatjara - - - Proto Mirndi - - - Ritharrngu - - - Tharrkari - - Dhargari - - - - Tiwi (Australia) - - - Umpila - - - Walmajarri - - - Wandarang - - Andarang - - - Nawariyi - - - - Wanʼguri - - Wonguri - - - - Warlpiri - - Elpira - - - Ilpara - - - Ngaliya - - - Ngardilpa - - - Wailbri - - - Walbiri - - - Waljbiri - - - Walmama - - - Walpiri - - - Warnayaka - - - Warrmarla - - - - Warumungu - - - Western Arrernte - - Aranda, Western - - - Arrernte, Western - - - - Western Desert - - - Wik-Munkan - - Munggan - - - - Wik-Ngathan - - Wik-Ngathana - - - - Worora - - - Wunambal - - Jeidji - - - Jeithi - - - Unambal - - - Wumnabal - - - Wunambullu - - - Yeidji - - - Yeithi - - - - Yandruwandha - - - Yanyuwa - - - Yawuru - - Jaudjibara - - - Jawadjag - - - Jawdjibaia - - - Jawdjibara - - - Winjawindjagu - - - Yaudijbaia - - - Yaudjibara - - - Yawjibara - - - - Yidiny - - - Yindjibarndi - - Jindjibandji - - - - Yinhawangka - - Inawonga - - - - Yualyai - - Euahlayi - - - Jualjai - - - Ualari - - - Uollaroi - - - Wallaroi - - - Yerraleroi - - - Yowalri - - - Yuwaalaraay - - - - Yugambeh - - - - info:lc/vocabulary/languages/map - Austronesian (Other) - map - - Malayo-Polynesian (Other) - - - Adzera - - Acira - - - Atsera - - - Atzera - - - - Ajie - - Houailou - - - Wailu - - - - Ambrym - - - Amis - - Ami - - - - Anesu - - Canala - - - Kanala - - - Xaracuu - - - Yaracuu - - - - Apma - - - Areare - - - Arop-Lokep - - Lokep - - - Lokewe - - - - Arosi - - - Atayal - - Tayal - - - - Bajau - - Badjo - - - Bayo - - - Luaan - - - Orang Laut (Indonesia) - - - Sama (Indonesia) - - - Turije̕ne̕ - - - - Bakumpai - - - Balaesang - - Balaisang - - - Pajo - - - - Banjar Hulu - - Hulu - - - - Barangas - - Alalak - - - - Bareë - - - Begak - - - Berawan - - - Biliau - - - Bimanese - - - Bolaang Mongondow - - - Buang - - - Bugotu - - Mahaga - - - - Bukar Sadong - - Sadong - - - Serian - - - Tebakang - - - - Bunama - - - Bunun - - - Buol - - Bual - - - Bwuolo - - - Dia - - - - Bwaidoga - - - Bwatoo - - - Camuhi - - Cemuhi - - - Tyamuhi - - - Wagap - - - - Carolinian - - - Daa - - Pekawa - - - - Dawawa - - - Dehu - - Drehu - - - Lifu - - - Miny - - - - Dobel - - Kobroor - - - - Dobu - - - Dumbea - - Drubea - - - - Dusun - - Kadazan - - - - East Makian - - Inner Makian - - - Makian, East - - - Makian, Inner - - - Taba - - - - East Uvean - - Uvean, East - - - Wallisian - - - - Enggano - - Etaka - - - - Enim - - - Eromanga - - Sie - - - Sye - - - - Favorlang - - Babuza - - - - Futuna-Aniwa - - Erronan - - - West Futuna - - - - Gapapaiwa - - Manape - - - - Gedaged - - Graged - - - - Gumasi - - - Halia - - - Ham - - Dami - - - - Hote - - - Iai (Loyalty Islands) - - - Iamalele - - Yamalele - - - - Ida'an - - - Iduna - - - Irahutu - - - Kaidipang - - - Kaili - - Ledo' - - - Palu - - - - Kaiwa (Papua New Guinea) - - Iwal - - - - Kambera - - - Kapingamarangi - - - Kara (Papua New Guinea) - - Kara-Lemakot - - - Lemakot - - - Lemusmus - - - - Katingan - - - Kaulong - - - Kayan (Borneo) - - - Kayu Agung - - - Kemak - - Ema - - - - Kerinci - - Kinchai - - - Korintje - - - - Kiput - - - Kiriwinian - - Kilivila - - - Trobriand - - - - Koluwawa - - - Komodo - - - Kubu - - - Kuni - - - Kurada - - Auhelawa - - - Cauhelawa - - - Nuakata - - - - Kutai - - Tenggarong - - - - Kwara'ae - - Fiu - - - - Lamenu - - Lamen - - - Lewo (Lamenu) - - - Varmali - - - - Lampung - - Api - - - Lampong - - - - Lau - - - Lavongai - - Dang (Papua New Guinea) - - - Lavangai - - - New Hanover - - - Tungag - - - Tungak - - - - Lembak Bilide - - - Lenakel - - - Lewo - - Varsu - - - - - Lindrou - - - Lundayeh - - Lun Daya - - - Lun Daye - - - Lun Dayho - - - Lundaya - - - Southern Murut - - - - Manam - - - Mandak - - Lelet - - - - Mandara (Papua New Guinea) - - Madara - - - Tabar - - - - Mangap - - Mbula (Mangap) - - - - Manggarai (Indonesia) - - - Mangseng - - - Marquesan - - - Mekeo - - - Mele-Fila - - Fila - - - - Mentawai - - - Mokilese - - - Mori - - Aikoa - - - - Mortlockese - - Mortlock (Micronesia) - - - Nomoi - - - - Motu - - - Mouk - - - Mukawa - - Kapikapi - - - - Muna - - Mina (Indonesia) - - - Wuna - - - - Nakanai - - Lakalai - - - - Nali - - Yiru - - - - Napu - - Bara (Indonesia) - - - - Nemi - - - Nengone - - - Ngada - - - Ngaju - - Biadju - - - Ngaju Dayak - - - - Ngatik - - - Nguna - - - Notsi - - Nochi - - - - Nuaulu - - - Nukuoro - - - Numfor - - Mafor - - - Noemfoor - - - Nufor - - - - Paiwan - - - Pala - - - Paranan - - Palanan - - - - Pasir (Lawangan) - - - Pazeh - - Bazai - - - - Petats - - - Pileni - - - Puluwat - - - Puyuma - - Kadas language (Puyuma) - - - Panapanayan - - - Pelam - - - Pilam - - - Piyuma - - - Pyuma - - - Tipun - - - - Ramoaaina - - Malu (Papua New Guinea) - - - - Rejang (Sumatra, Indonesia) - - Redjang (Sumatra, Indonesia) - - - - Rennellese - - Bellonese - - - Munggava - - - - Roti - - Rottinese - - - - Rotuman - - - Rukai - - Drukai - - - - Rungus - - Dusun Dayak - - - Melobong Rungus - - - Memagun - - - Memogun - - - Momogun - - - Roongas - - - Rungus Dusun - - - - Saaroa - - La'alua - - - La'arua - - - Pachien - - - Paichien - - - Rarua - - - Saarua - - - Saroa - - - Shishaban - - - Sisyaban - - - - Sangen - - - Sangil - - Sangiré - - - - Sangir (Indonesia and Philippines) - - Sangihe - - - - Saposa - - - Sawu - - Havunese - - - Hawu - - - Sabu - - - Savu - - - - Sedik - - Sazek - - - Seedik - - - Shedekka - - - - Semendo - - - Serawai - - - Sigi - - Idja - - - - Sikka - - - Siladang - - - Sinagoro - - - Sio - - - Sissano - - - Sobei - - - Sokop - - - Sonsorol-Tobi - - Tobi - - - - Suau - - - Sumba - - - Sumbawa - - Semana - - - Soembawa - - - - Sursurunga - - - Suwawa - - Bunda (Indonesia) - - - - Tagal Murut - - Murut Tahol - - - Semambu - - - Semembu - - - Sumambu - - - Sumambu-Tagal - - - Sumambuq - - - - Tagula - - Sudest - - - - Takuu - - Mortlock (Papua New Guinea) - - - Nahoa - - - Taku - - - Taʻu - - - Tauu - - - - Talaud - - Talaoed - - - - Tamuan - - - Tanga (Tanga Islands) - - - Tavara (Papua New Guinea) - - Kehelala - - - Tawala - - - - Tawoyan - - - Teop - - Tiop - - - - Tidore - - - Tikopia - - - Timor - - Atoni - - - Timorese - - - - Timugon - - - Tinputz - - Timputs - - - Vasuii - - - Wasoi - - - - Tolai - - Blanche Bay - - - Gunantuna - - - Kuanua - - - New Britain - - - Raluana - - - Tinata Tuna - - - Tuna - - - - Tolaki - - Kendari - - - Toolaki - - - - Tombulu - - Toumbulu - - - - Tondano - - Tolou - - - Tolour - - - - Tonsea - - - Toraja - - Toradja - - - - Toraja Sa'dan - - Sadan (Indonesia) - - - Saqdab Toraja - - - South Toraja - - - Tae' - - - - Tuamotuan - - Paumotu - - - - Tubetube - - - Ulithi - - - Uma - - Pipikoro - - - - Urak Lawoi̕ - - Chāo Lē - - - Orak Lawoi' - - - Orang Laut (Thailand and Malaysia) - - - - Uripiv - - - Wampar - - - Wandamen - - Windesi - - - Wondama - - - - Wewewa - - Sumba, West - - - Waidjewa - - - West Sumba - - - - Woleaian - - Uleai - - - Woleai - - - - Wolio - - - Yabim - - Jabêm - - - - Yamdena - - Jamdena - - - - - info:lc/vocabulary/languages/ava - Avaric - ava - - - info:lc/vocabulary/languages/ave - Avestan - ave - - Avesta - - - Bactrian, Old (Avestan) - - - Old Bactrian (Avestan) - - - Zend - - - - info:lc/vocabulary/languages/awa - Awadhi - awa - - - info:lc/vocabulary/languages/aym - Aymara - aym - - Aimara - - - - info:lc/vocabulary/languages/aze - Azerbaijani - aze - - Azari - - - Azeri - - - Afshar - - - - info:lc/vocabulary/languages/ast - Bable - ast - - Asturian - - - - info:lc/vocabulary/languages/ban - Balinese - ban - - - info:lc/vocabulary/languages/bat - Baltic (Other) - bat - - Curonian - - - Proto-Baltic - - - Prussian - - Old Prussian - - - - - info:lc/vocabulary/languages/bal - Baluchi - bal - - Balochi - - - Beloutchi - - - Biluchi - - - - info:lc/vocabulary/languages/bam - Bambara - bam - - Bamana (Mandekan) - - - Bamanankan - - - - info:lc/vocabulary/languages/bai - Bamileke languages - bai - - Bandjoun - - Bamileke-Jo - - - - Fe'fe' - - Bafang - - - Bamileke-Fe'fe' - - - Bana (Bamileke) - - - Fa (Bamileke) - - - Fan (Bamileke) - - - Fanwe (Bamileke) - - - Fe'e fe'e - - - Fotouni - - - Kuu - - - Nufi - - - - Ngyemboon - - Nguemba (Bamileke) - - - - Yemba - - - - info:lc/vocabulary/languages/bad - Banda languages - bad - - Banda (Central Africa) - - - Linda - - - - info:lc/vocabulary/languages/bnt - Bantu (Other) - bnt - - Abo (Cameroon) - - Abaw - - - Bo (Cameroon) - - - Bon (Cameroon) - - - - Aka (Central African Republic) - - - Asu - - Athu - - - Chasu - - - Pare - - - - Bafia - - - Bakundu - - Kundu - - - - Bati - - - Bekwil - - Bakwele - - - Bakwil - - - Bekwel - - - Bekwie - - - Bekwyel - - - Kwele - - - Okpele - - - - Bembe (Congo (Brazzaville)) - - KiBembe - - - Mbembe - - - - Benga - - - Bobangi - - Rebu - - - - Bolia - - Bulia - - - - Boma (Congo) - - Buma (Congo) - - - - Bomitaba - - Mbomitaba - - - Mitaba - - - - Bondei - - Bonde - - - Boondei - - - Kibondei - - - Wabondei - - - - Bube - - Bubi (Equatorial Guinea) - - - Fernandian - - - - Bubi (Gabon) - - Pove - - - - Budu - - - Bukusu - - Lubukusu - - - - Bulu - - Boulou - - - - Camtho - - Iscamtho - - - Isicamtho - - - Shalambombo - - - Tsotsitaal (Camtho) - - - - Chaga - - Djaga - - - Dschagga - - - Jagga - - - Tschagga - - - - Chokwe - - Cibokwe - - - Cokwe - - - Jok - - - Katchokue - - - Kioko - - - Quioco - - - Tutchokue - - - - Chopi - - Lenge - - - - Comorian - - - Diriku - - Mbogedo - - - Rugciriku - - - Rumanyo - - - Shimbogedu - - - - Doko (Congo) - - - Duruma - - - Embu - - - Enahara - - Emathipane - - - Enaharra - - - Maharra - - - Nahara - - - Naharra - - - - Fipa - - - Fuliru - - - Ganguela - - Ngangela - - - - Geviya - - Avias - - - Eviya - - - Viya - - - - Giryama - - - Gisu - - Lugisu - - - Lumasaaba - - - Masaba - - - - Gungu - - Lugungu - - - Rugungu - - - - Gusii - - Ekegusii - - - Kisii - - - - Gweno - - Kigweno - - - - Gwere - - - Ha - - - Haya - - Luhaya - - - Lusiba - - - Ruhaya - - - Ziba - - - - Hehe - - - Hunde - - - Ikizu - - Ikiizo - - - Ikikizo - - - Ikikizu - - - Kiikizu - - - - Ila - - - Jita - - Echijita - - - Ecijita - - - Kijita - - - - Kahe - - Kikahe - - - - Kako - - Kaka (Northwest Bantu) - - - Yaka (Cameroon and Central African Republic) - - - - Kalanga (Botswana and Zimbabwe) - - - Kaonde - - Luba-Kaonde - - - - Kare - - Akare - - - Bakare - - - - Kele (Gabon) - - - Kete - - - Kom (Cameroon) - - Nkom - - - - Kombe - - - Komo (Congo) - - Kumu - - - - Koonzime - - Djimu - - - Dzimou - - - Konzime - - - Kooncimo - - - Koozhime - - - Koozime - - - Nzime - - - Zimu - - - - Kuria - - Ekiguria - - - Igikuria - - - Ikikuria - - - Kikoria - - - Kikouria - - - Kikuria - - - Kikuria cha juu - - - Kikuria cha Mashariki - - - Koria - - - Kurya - - - Kurye - - - Tende (Kuria) - - - - Kwangali - - - Kwese - - Kwezo - - - - Kwiri - - Mokpwe - - - - Lala - - - Lega - - - Lenje - - Bwine-Mukuni - - - Ci-Renje - - - - Logooli - - Ragoli - - - - Lomwe (Malawi) - - - Lucazi - - Ponda - - - - Luvale - - - Luyana - - - Luyia - - Oluluyia - - - - Maka (Cameroon) - - Makaa (Cameroon) - - - Mekaa - - - - Makhuwa - - Central Makhuwa - - - Emakhuwa - - - Emakua - - - Macua - - - Makhuwa-Makhuwana - - - Makhuwwa of Nampula - - - Makoane language - - - Makua (Mozambique) - - - Maquoua (Makhuwa) - - - - Makonde - - Chimakonde - - - Konde (Yao group) - - - - Makwe - - Kimakwe - - - Macue - - - Maraba (Makwe) - - - Palma - - - - Mashami - - Kimashami - - - Machambe - - - Machame - - - Madschame - - - - Mbala (Bandundu, Congo) - - - Mbo (Cameroon) - - - Mbosi - - - Mbukushu - - Goba - - - Mambukush - - - Mpukush - - - Thimbukushu - - - - Mbunda (Angola and Zambia) - - - Meru - - Kimeru - - - - Mijikenda languages - - Nika languages - - - Nyika languages - - - - Mituku - - - Mkaaʼ - - Bakaka - - - - Mochi - - Kimochi - - - Kimoshi - - - Moshi (Tanzania) - - - Mosi (Tanzania) - - - Old Moshi - - - - Mpiemo - - Bimu - - - Mbimou - - - Mbimu - - - Mbyemo - - - Mpo - - - Mpyemo - - - - Mpongwe - - Pongwe - - - - Mpur (Congo) - - - Nambya - - - Nande - - Nandi (Congo) - - - - Ndau - - Chindau - - - Shona, Southeastern - - - - Ndumu - - - Ngonde - - Ikinyi-Kiusa - - - Kiusa - - - Konde (Nyakyusa) - - - Mombe - - - Nkonde - - - Nyakyusa - - - Sochile - - - - Ngul - - Engwî - - - Ingul - - - Kingóli - - - Ngoli - - - Nguli - - - Ngulu (Congo (Democratic Republic)) - - - Ngwi (Congo (Democratic Republic)) - - - - Nsenga - - - Ntomba - - - Nyaneka - - Lunyaneka - - - Olunyaneka - - - - Nyanga - - - Nyole (Uganda) - - Lunyole (Uganda) - - - Nyule - - - Nyuli - - - - Nyungwe - - Tete - - - - Nzebi - - Bandzabi - - - Indzèbi - - - Injebi - - - Ndjabi - - - Ndjebi - - - Ndjevi - - - Njabi - - - Njevi - - - Nzabi - - - Yinzabi - - - - Pangwa - - - Pelende - - - Pende - - Kipende - - - Pindi (Pende) - - - - Pokomo - - - Punu - - Bapounou - - - Pounou - - - - Rangi - - Irangi - - - Kilangi - - - Kirangi - - - Langi (Tanzania) - - - - Ronga - - Landim - - - Shironga - - - Xironga - - - - Ruri - - Ciruuri - - - Kiruri - - - Ruuri - - - - Ruund - - Chiluwunda - - - Lunda, Northern - - - Luwunda - - - Muatiamvua - - - Northern Lunda - - - Uruund - - - - Saamia - - Luhya (Saamia) - - - Luluyia (Saamia) - - - Lusaamia - - - Luyia (Saamia) - - - Ólusaamya - - - Olusamia - - - Samia - - - Samya - - - - Sakata - - - Salampasu - - Chisalampasu - - - - Sanga - - Luba, Southern - - - Southern Luba - - - - Sena - - - Shambala - - - Shi - - Mashi - - - Nyabungu - - - - Shimaore - - Mahorais - - - - Simbiti - - Kisimbiti - - - - Songye - - Songe - - - - Subiya - - ciIkuhane - - - Ikuhane - - - Soubiya - - - - Suku (Congo) - - - Sumbwa - - Kisumbwa - - - Shisumbwa - - - Sisumbwa - - - Sisuumbwa - - - - Taita - - Sagalla - - - Teita - - - - Talinga-Bwisi - - Bwisi-Talinga - - - Kitalinga - - - - Teke - - Balali - - - Ilali - - - Itio - - - Lali - - - - Tembo (Sud-Kivu, Congo) - - KiTembo - - - - Temi - - Gitemi - - - Kisonjo - - - Sonjo - - - Sonyo - - - Wasonjo - - - Watemi - - - - Tetela - - - Tharaka - - Saraka - - - - Tiene - - Ketiine - - - Kitiene - - - Kitiini - - - Tende (Congo (Democratic Republic)) - - - - Tiriki - - - Tonga (Inhambane) - - Gitonga - - - - Tonga (Zambezi) - - - Tooro - - Toro - - - - Tsogo - - Apindji - - - Mitsogo - - - - Tswa - - Kitswa - - - Shitswa - - - Tshwa - - - Xitswa - - - - Tunen - - Banen - - - - Yaka (Congo and Angola) - - Iaka - - - - Yanzi - - - Yombe (Congo and Angola) - - - Zanaki - - Iki-Zanaki - - - IkiZanaki - - - - Zigula - - Kizigula - - - Seguha - - - Wayombo - - - Wazegua - - - Wazigua - - - Zeguha - - - Zegura - - - Zigoua - - - Zigua - - - Zigwa - - - - Zinza - - Dzinda - - - Dzindza - - - Echidzindza - - - Echijinja - - - Eciinja - - - Ecizinza - - - Jinja - - - Kizinza - - - Luzinza - - - Zinja - - - - - info:lc/vocabulary/languages/bas - Basa - bas - - - info:lc/vocabulary/languages/bak - Bashkir - bak - - - info:lc/vocabulary/languages/baq - Basque - baq - - Euskara - - - - info:lc/vocabulary/languages/btk - Batak - btk - - Batta (Sumatra) - - - Alas - - - Angkola - - - Dairi Pakpak - - Pakpak - - - - Karo-Batak - - - Mandailing - - Batak Mandailing - - - - Simelungun - - - Toba-Batak - - - - info:lc/vocabulary/languages/bej - Beja - bej - - Bedawiye - - - Bedja - - - Bishári - - - - info:lc/vocabulary/languages/bel - Belarusian - bel - - Belorussian - - - Byelorussian - - - Russian, White - - - White Russian - - - - info:lc/vocabulary/languages/bem - Bemba - bem - - - info:lc/vocabulary/languages/ben - Bengali - ben - - Banga-Bhasa - - - Bangala - - - Bangla - - - Sylheti - - Sylhet - - - Sylhetti Bangla - - - - - info:lc/vocabulary/languages/ber - Berber (Other) - ber - - Mzab - - Mozabite - - - - Rif - - Northern Shilha - - - Shilha, Northern - - - Tarifit - - - - Shilha - - Chleuh - - - Sölha - - - Tachelhait - - - Tashelhiyt - - - - Tamazight - - - - info:lc/vocabulary/languages/bho - Bhojpuri - bho - - Bajpuri - - - Bhojapuri - - - Bhozpuri - - - Bihari (Bhojpuri) - - - Deswali (Bhojpuri) - - - Khotla - - - Piscimas - - - Sadani - - Chota Nagpuri - - - Chotar Nagpuri - - - Dikku Kaji - - - Dikkukaji - - - Nagpuri (Bhojpuri) - - - Nagpuriā - - - Napuria - - - Sadan - - - Sadari - - - Sadati - - - Sadhan - - - Sadhana - - - Sadharan - - - Sadna - - - Sadri - - - Sadrik - - - Santri - - - Siddri - - - Sradri - - - - Western Standard Bhojpuri - - Benarsi - - - Bhojpuri, Western Standard - - - Purbi - - - - - info:lc/vocabulary/languages/bih - Bihari (Other) - bih - - Behari - - - Bajjika - - - Kudmali - - Bedia - - - Dharua - - - Khotta (Kurmali) - - - Kurma - - - Kurmali - - - Kurmali Thar - - - Kurmik - - - Kurni - - - Kurumali - - - - - info:lc/vocabulary/languages/bik - Bikol - bik - - Vikol - - - - info:lc/vocabulary/languages/byn - Bilin - byn - - - info:lc/vocabulary/languages/bis - Bislama - bis - - Beach-la-mar - - - Bêche-de-mer - - - Bichelamar - - - - info:lc/vocabulary/languages/zbl - Blissymbolics - zbl - - - info:lc/vocabulary/languages/bos - Bosnian - bos - - - info:lc/vocabulary/languages/bra - Braj - bra - - Braj bhākhā - - - Braj bhāshā - - - Pingal - - - - info:lc/vocabulary/languages/bre - Breton - bre - - Armoric - - - - info:lc/vocabulary/languages/bug - Bugis - bug - - Buginese - - - - info:lc/vocabulary/languages/bul - Bulgarian - bul - - - info:lc/vocabulary/languages/bua - Buriat - bua - - Buryat - - - Mongolian, Northern - - - Northern Mongolian - - - - info:lc/vocabulary/languages/bur - Burmese - bur - - - info:lc/vocabulary/languages/cad - Caddo - cad - - - info:lc/vocabulary/languages/car - Carib - car - - Galibi - - - - info:lc/vocabulary/languages/cat - Catalan - cat - - Majorcan Catalan - - Catalan, Majorcan - - - - Valencian Catalan - - Catalan, Valencian - - - - - info:lc/vocabulary/languages/cau - Caucasian (Other) - cau - - Abazin - - - Bats - - Bac - - - Tsova-Tush - - - Tush - - - - Bezhta - - - Botlikh - - - Budukh - - - Chamalal - - - Dido - - Tsez - - - - Ginukh - - Ginukhtsy - - - Ginux - - - Hinukh - - - Hinux - - - - Hunzib - - Gunzib - - - - Kubachi - - - Lak - - - Laz - - Chan - - - Chanuri - - - Chanzan - - - Laze - - - Lazian - - - Lazuri - - - Zan - - - - Mingrelian - - - Svan - - - Tabasaran - - - Tsakhur - - - Ubykh - - Oubykh - - - - Udi - - - - info:lc/vocabulary/languages/ceb - Cebuano - ceb - - Binisaya - - - Bisayan - - - Sebuano - - - Sinugboanon - - - Sugbuanon - - - Sugbuhanon - - - Visayan - - - - info:lc/vocabulary/languages/cel - Celtic (Other) - cel - - Celtiberian - - Celti-Iberian - - - Celto-Iberian - - - - Gaulish - - Gallic - - - - Proto-Celtic - - Common Celtic - - - - Welsh, Middle (ca. 1100-1400) - - Middle Welsh (ca. 1100-1400) - - - - Welsh, Old (to 1100) - - Old Welsh (to 1100) - - - - - info:lc/vocabulary/languages/cai - Central American Indian (Other) - cai - - Use for the other languages of Central America and Mexico, as well as for the - languages of the Azteco-Tanoan language phylum. - - - Amuzgo - - Amishgo - - - - Boruca - - Brunka - - - Burunca - - - - Bribri - - - Cabecar - - - Cahita - - - Cahuilla - - Coahuila - - - Kawia (Shoshone) - - - - Chatino - - - Chiapanec - - - Chinantecan languages - - - Chocho - - - Chontal - - Tequistlateca - - - - Cochimi - - - Comanche - - - Cora - - Chora - - - Nayarita - - - - Cuicatec - - - Cuitlateco - - Teco (Cuitlateco) - - - - Cupeño - - - Eudeve - - Batuco - - - Dohema - - - Hegue - - - - Garifuna - - Black Carib - - - Carib, Black - - - - Guarijío - - Huarijío - - - Warijío - - - - Guatuso - - Maléku Jaíka - - - - Guaymi - - - Hopi - - Moki - - - - Huave - - - Huichol - - Guichola - - - - Ixcateco - - - Jicaque - - Tol - - - Torrupan - - - Xicaque - - - - Kawaiisu - - - Kiowa - - Kayowe - - - - Lenca - - - Mangue - - Choluteca - - - - Matagalpa - - Cacaopera - - - - Mayo (Piman) - - - Mazateco - - - Miskito - - Mosquito - - - - Mixe - - Ayook - - - - Mixtec - - - Opata - - - Panamint - - Coso - - - Koso - - - Tümpisa - - - - Pima - - - Popoloca - - - Rama - - - Seri - - - Serrano - - Maarrenga'twich - - - - Shoshoni - - - Sierra Popoluca - - Highland Popoluca - - - Popoluca, Highland - - - Popoluca of Vera Cruz - - - - Southern Paiute - - Paiute, Southern - - - - Sumo - - - Tarahumara - - Rarámuri - - - - Tarascan - - Michoacana - - - Phurhembe - - - Purepecha - - - - Tepehuan - - O'dam - - - - Terraba - - Teribe - - - Tirribi - - - - Tewa - - - Tlapanec - - Chocho (Tlapanec) - - - Tiapaneco - - - - Tohono O'odham - - Papago - - - - Totonac - - - Trique - - - Ulva - - Woolwa - - - Wulwa - - - - Ute - - - Yaqui - - - Zoque - - Soke - - - - - info:lc/vocabulary/languages/chg - Chagatai - chg - - Dschagatai - - - Jagataic - - - Old Uzbek - - - Tschagatai - - - Uzbek, Old - - - - info:lc/vocabulary/languages/cmc - Chamic languages - cmc - - Cham - - Čam - - - - Haroi - - - Jarai - - - Rade - - Ede - - - Rhade - - - - Roglai - - - - info:lc/vocabulary/languages/cha - Chamorro - cha - - Tjamoro - - - - info:lc/vocabulary/languages/che - Chechen - che - - Tchetchen - - - - info:lc/vocabulary/languages/chr - Cherokee - chr - - - info:lc/vocabulary/languages/chy - Cheyenne - chy - - - info:lc/vocabulary/languages/chb - Chibcha - chb - - - info:lc/vocabulary/languages/chi - Chinese - chi - - Cantonese - - - Mandarin - - - - info:lc/vocabulary/languages/chn - Chinook jargon - chn - - Chinook pidgin - - - - info:lc/vocabulary/languages/chp - Chipewyan - chp - - Dene (Chipewyan) - - - Montagnais (Athapascan) - - - - info:lc/vocabulary/languages/cho - Choctaw - cho - - Chahta - - - - info:lc/vocabulary/languages/chu - Church Slavic - chu - - Bulgarian, Old (to 1100) - - - Old Bulgarian (to 1100) - - - Old Church Slavic - - - Old Slovenian - - - Slavonic, Old Church - - - Slovenian, Old - - - - info:lc/vocabulary/languages/chk - Chuukese - chk - - Truk - - - - info:lc/vocabulary/languages/chv - Chuvash - chv - - - info:lc/vocabulary/languages/cop - Coptic - cop - - - info:lc/vocabulary/languages/cor - Cornish - cor - - - info:lc/vocabulary/languages/cos - Corsican - cos - - Corse - - - Corsi - - - Corso - - - Corsu - - - - info:lc/vocabulary/languages/cre - Cree - cre - - Cris - - - Knistenaux - - - Maskegon - - - - info:lc/vocabulary/languages/mus - Creek - mus - - Maskoki - - - Muscogee - - - - info:lc/vocabulary/languages/crp - Creoles and Pidgins (Other) - crp - - Pidgins - - - Ambonese Malay - - Malay, Ambonese - - - - Betawi - - Batawi - - - Jakarta Malay - - - Malay, Jakarta - - - - Chabacano - - Chavacano - - - Zamboangueño - - - - Fanakalo - - Fanagalo - - - Pidgin Kaffir - - - - Kituba (Congo (Democratic Republic)) - - Kibulamatadi - - - Kikongo Commercial - - - Kikongo-Kutuba - - - Kikongo Simplifié - - - Kikongo ya Leta - - - Kikwango - - - Kileta - - - - Naga Pidgin - - Nagamese - - - - San Basilio del Palenque Spanish Creole - - Palenquero (Colombia) - - - Spanish Creole, San Basilio del Palenque - - - - Unami jargon - - - - info:lc/vocabulary/languages/cpe - Creoles and Pidgins, English-based (Other) - cpe - - Bamyili Creole - - - Djuka - - Aucaans - - - Aukan - - - Djoeka - - - Ndjuka - - - - English-based Creoles and Pidgins (Other) - - - Fitzroy Valley Kriol - - - Hawaiian Pidgin English - - - Jamaican Creole - - - Krio - - Aku (Creole) - - - - Kriol - - - Pijin - - Neo-Solomonic - - - Solomons Pidgin - - - - Pidgin English - - - Saramaccan - - - Sea Islands Creole - - Geechee - - - Gullah - - - - - info:lc/vocabulary/languages/cpf - Creoles and Pidgins, French-based (Other) - cpf - - French-based Creoles and Pidgins (Other) - - - Dominican French Creole - - French Creole, Dominican - - - - Louisiana French Creole - - French Creole, Louisiana - - - - Mauritian French Creole - - French Creole, Mauritian - - - - Michif - - Cree, French - - - French Cree - - - Mitchif - - - - Reunionese French Creole - - French Creole, Reunionese - - - - Seychellois French Creole - - French Creole, Seychellois - - - - - info:lc/vocabulary/languages/cpp - Creoles and Pidgins, Portuguese-based (Other) - cpp - - Portuguese-based Creoles and Pidgins (Other) - - - Annobon - - Ambu - - - - Cape Verde Creole - - Brava Island Creole - - - - Crioulo - - - Indo-Portuguese - - Ceylon Portuguese - - - - - info:lc/vocabulary/languages/crh - Crimean Tatar - crh - - Crimean Turkish - - - Tatar, Crimean - - - Turkish, Crimean - - - - info:lc/vocabulary/languages/hrv - Croatian - hrv - - - info:lc/vocabulary/languages/scr - Croatian - scr - - - info:lc/vocabulary/languages/cus - Cushitic (Other) - cus - - Alaba - - Alaaba - - - Allaaba - - - Halaba - - - - Burji - - - Dasenech - - Geleb - - - Marille - - - - Gedeo - - Darasa - - - Derasa - - - - Hadiya - - - Iraqw - - - Kambata - - - Qebena - - K'abena - - - Kebena - - - Qabena - - - Womba - - - Wombi Afoo - - - Wombisanat - - - - Rendille - - - Tunni - - - - info:lc/vocabulary/languages/cze - Czech - cze - - Bohemian - - - - info:lc/vocabulary/languages/dak - Dakota - dak - - Sioux - - - Assiniboine - - - Lakota - - Teton - - - - Santee - - - Yankton - - - - info:lc/vocabulary/languages/dan - Danish - dan - - - info:lc/vocabulary/languages/dar - Dargwa - dar - - Darghi - - - Dargin - - - - info:lc/vocabulary/languages/day - Dayak - day - - Bidayuh - - - Bideyu - - - Dajak - - - Dyak - - - Kendayan - - - Land Dayak - - - Biatah - - - - info:lc/vocabulary/languages/del - Delaware - del - - Lenape - - - Lenni Lenape - - - Munsee - - Minsi - - - - - info:lc/vocabulary/languages/din - Dinka - din - - Denca - - - - info:lc/vocabulary/languages/div - Divehi - div - - Dhivehi - - - Maldivian - - - - info:lc/vocabulary/languages/doi - Dogri - doi - - Dhogaryali - - - Dogari - - - Dogra - - - Dogri Jammu - - - Dogri-Kangri - - - Dogri Pahari - - - Dongari - - - Hindi Dogri - - - Tokkaru - - - Kangri - - Kangari - - - Kangra - - - - - info:lc/vocabulary/languages/dgr - Dogrib - dgr - - Thlingchadinne - - - - info:lc/vocabulary/languages/dra - Dravidian (Other) - dra - - Abujhmaria - - - Alu Kurumba - - - Brahui - - Berouhi - - - Birohi - - - Brohki - - - - Gadaba (Dravidian) - - Gadba (Dravidian) - - - Gudwa (Dravidian) - - - Gutob (Dravidian) - - - Konekor Gadaba - - - Ollari - - - Salur - - - - Kodagu - - Coorg - - - Kodava - - - Kurg - - - - Kolami - - - Kota (India) - - - Kui - - Kandh - - - - Kuvi - - - Malto - - - Pengo - - - Toda (India) - - Tuda (India) - - - - Tulu - - - - info:lc/vocabulary/languages/dua - Duala - dua - - Douala - - - - info:lc/vocabulary/languages/dut - Dutch - dut - - Flemish - - - Netherlandic - - - - info:lc/vocabulary/languages/dum - Dutch, Middle (ca. 1050-1350) - dum - - Diets - - - Middle Dutch - - - - info:lc/vocabulary/languages/dyu - Dyula - dyu - - Dioula - - - Diula - - - Jula - - - - info:lc/vocabulary/languages/dzo - Dzongkha - dzo - - Bhotia of Bhutan - - - Bhutanese - - - - info:lc/vocabulary/languages/frs - East Frisian - frs - - Frisian, East - - - - info:lc/vocabulary/languages/bin - Edo - bin - - Bini - - - - info:lc/vocabulary/languages/efi - Efik - efi - - Calabar - - - Ibibio - - - - info:lc/vocabulary/languages/egy - Egyptian - egy - - Demotic - - - Hieratic - - - Hieroglyphics (Egyptian) - - - - info:lc/vocabulary/languages/eka - Ekajuk - eka - - - info:lc/vocabulary/languages/elx - Elamite - elx - - Amardic - - - Anzanic - - - Susian - - - - info:lc/vocabulary/languages/eng - English - eng - - - info:lc/vocabulary/languages/enm - English, Middle (1100-1500) - enm - - Middle English - - - - info:lc/vocabulary/languages/ang - English, Old (ca. 450-1100) - ang - - Anglo-Saxon - - - Old English - - - West Saxon - - - - info:lc/vocabulary/languages/myv - Erzya - myv - - - info:lc/vocabulary/languages/esk - Eskimo languages - esk - - - info:lc/vocabulary/languages/epo - Esperanto - epo - - - info:lc/vocabulary/languages/esp - Esperanto - esp - - - info:lc/vocabulary/languages/est - Estonian - est - - Seto - - Setu - - - - Võro - - Võru - - - Werro - - - - - info:lc/vocabulary/languages/gez - Ethiopic - gez - - Geez - - - - info:lc/vocabulary/languages/eth - Ethiopic - eth - - - info:lc/vocabulary/languages/ewe - Ewe - ewe - - - info:lc/vocabulary/languages/ewo - Ewondo - ewo - - Jaunde - - - Yaounde - - - Yaunde - - - - info:lc/vocabulary/languages/fan - Fang - fan - - Fan (Bantu) - - - - info:lc/vocabulary/languages/fat - Fanti - fat - - - info:lc/vocabulary/languages/fao - Faroese - fao - - Faeroese - - - - info:lc/vocabulary/languages/far - Faroese - far - - - info:lc/vocabulary/languages/fij - Fijian - fij - - Viti - - - - info:lc/vocabulary/languages/fil - Filipino - fil - - - info:lc/vocabulary/languages/fin - Finnish - fin - - - info:lc/vocabulary/languages/fiu - Finno-Ugrian (Other) - fiu - - Ingrian - - Izhorskii - - - - Khanty - - Ostiak - - - Xanty - - - - Livonian - - - Ludic - - Lydi - - - - Mansi - - Vogul - - - - Mordvin - - Mordva - - - Mordvinian - - - - Veps - - - - info:lc/vocabulary/languages/fon - Fon - fon - - Dahoman - - - Djedji - - - Jeji - - - - info:lc/vocabulary/languages/fre - French - fre - - Allevard French - - French, Allevard - - - - Judeo-French - - Western Loez - - - Zarphatic - - - - Morvan French - - French, Morvan - - - - Poitevin French - - French, Poitevin - - - - Saintongeais French - - French, Saintongeais - - - - - info:lc/vocabulary/languages/frm - French, Middle (ca. 1300-1600) - frm - - Middle French - - - - info:lc/vocabulary/languages/fro - French, Old (ca. 842-1300) - fro - - Old French - - - - info:lc/vocabulary/languages/fry - Frisian - fry - - Friesian - - - West Frisian - - - Stadsfries - - Stadfries - - - Stedsk - - - Town Frisian - - - - - info:lc/vocabulary/languages/fri - Frisian - fri - - - info:lc/vocabulary/languages/fur - Friulian - fur - - - info:lc/vocabulary/languages/ful - Fula - ful - - Adamawa - - - Fulah - - - Fulani - - - Fulbe - - - Fulfulde - - - Peul - - - Poul - - - Bororo (West Africa) - - - Pular - - Poular - - - Toucouleur - - - Tukolor - - - - - info:lc/vocabulary/languages/gaa - - gaa - - Acra - - - Incran - - - - info:lc/vocabulary/languages/glg - Galician - glg - - Gallegan - - - - info:lc/vocabulary/languages/gag - Galician - gag - - - info:lc/vocabulary/languages/lug - Ganda - lug - - Luganda - - - - info:lc/vocabulary/languages/gay - Gayo - gay - - - info:lc/vocabulary/languages/gba - Gbaya - gba - - Baya - - - Gbeya - - - - info:lc/vocabulary/languages/geo - Georgian - geo - - Ingilo - - - - info:lc/vocabulary/languages/ger - German - ger - - Hochdeutsch - - - Alemannic - - Alamannic - - - Alemannisch - - - Allemannic - - - Allemannisch - - - Alsatian - - - Schwyzerdütsch - - - - Cimbrian - - Tzimbro - - - Zimbrisch - - - - - info:lc/vocabulary/languages/gmh - German, Middle High (ca. 1050-1500) - gmh - - Middle High German - - - - info:lc/vocabulary/languages/goh - German, Old High (ca. 750-1050) - goh - - Old High German - - - - info:lc/vocabulary/languages/gem - Germanic (Other) - gem - - Danish, Old (to 1500) - - Old Danish - - - - Dutch, Old (to 1050) - - Franconian, Old Low - - - Old Dutch - - - Old Low Franconian - - - - Frisian, Old (to 1500) - - Old Frisian - - - - Lombard - - - Old Saxon - - Low German, Old (ca. 850-1050) - - - Old Low German (ca. 850-1050) - - - Saxon, Old - - - - Pennsylvania German - - - Swedish, Old (to 1550) - - Old Swedish - - - - Walser - - - - info:lc/vocabulary/languages/gil - Gilbertese - gil - - Arorai - - - I-Kiribati - - - Kiribatese - - - - info:lc/vocabulary/languages/gon - Gondi - gon - - - info:lc/vocabulary/languages/gor - Gorontalo - gor - - - info:lc/vocabulary/languages/got - Gothic - got - - - info:lc/vocabulary/languages/grb - Grebo - grb - - Gdebo - - - Gedebo - - - Krebo - - - - info:lc/vocabulary/languages/grc - Greek, Ancient (to 1453) - grc - - Ancient Greek - - - Biblical Greek - - - Byzantine Greek - - - Classical Greek - - - Greek, Biblical - - - Greek, Byzantine - - - Greek, Classical - - - Greek, Hellenistic - - - Greek, Medieval - - - Greek, Patristic - - - Greek (Koine) - - - Hellenistic Greek - - - Koine (Greek) - - - Medieval Greek - - - Patristic Greek - - - Aeolic Greek - - Greek, Aeolic - - - - Attic Greek - - Greek, Attic - - - - Doric Greek - - Greek, Doric - - - - Ionic Greek - - Greek, Ionic - - - - - info:lc/vocabulary/languages/gre - Greek, Modern (1453- ) - gre - - East Cretan Greek - - Cretan Greek, East - - - Greek, East Cretan - - - - - info:lc/vocabulary/languages/grn - Guarani - grn - - Chiriguano - - Aba - - - Camba - - - Tembeta - - - - Chiripá - - Tsiripa - - - - Mbya - - - - info:lc/vocabulary/languages/gua - Guarani - gua - - - info:lc/vocabulary/languages/guj - Gujarati - guj - - Dhodia - - Dhobi - - - Dhoḍiyā - - - Dhore - - - Dhowari - - - Doria - - - - Gamit - - Gamati - - - Gāmīta - - - Gamta - - - Gavit - - - - Halari - - - Parsi-Gujarati - - - Saurashtri - - Patanuli - - - Patnuli - - - Saurashtra - - - Saurastra - - - Sawrashtra - - - Sourashtra - - - Sowrashtra - - - - Sidi - - - - info:lc/vocabulary/languages/gwi - Gwich'in - gwi - - Kutchin - - - Loucheux - - - Takudh - - - Tukudh - - - - info:lc/vocabulary/languages/hai - Haida - hai - - Skittagetan - - - - info:lc/vocabulary/languages/hat - Haitian French Creole - hat - - French Creole, Haitian - - - - info:lc/vocabulary/languages/hau - Hausa - hau - - - info:lc/vocabulary/languages/haw - Hawaiian - haw - - - info:lc/vocabulary/languages/heb - Hebrew - heb - - Ancient Hebrew - - - - info:lc/vocabulary/languages/her - Herero - her - - Himba - - Chimba - - - Cimba - - - Dhimba - - - Simba - - - Tjimba - - - - - info:lc/vocabulary/languages/hil - Hiligaynon - hil - - Ilongo - - - Panayan - - - - info:lc/vocabulary/languages/hin - Hindi - hin - - Badayuni - - - Bagheli - - Bagelkhandi - - - Bhugelkhud - - - Ganggai - - - Kawathi - - - Kenat - - - Kevat Boli - - - Kevati - - - Kewani - - - Kewat - - - Kewati - - - Kewot - - - Mandal - - - Mannadi - - - Riwai - - - - Bangaru - - Hariani - - - Jatu - - - - Bundeli - - Bundelkhandi - - - - Chattisgarhi - - Chhattisgarhi - - - Khalṭāhī - - - Khatahi - - - Laria - - - - Deswali - - - Kanauji - - Bhakha - - - Braj Kanauji - - - Kannaujī - - - - Khari Boli - - Kauravī - - - Khaṛībolī - - - Kourvi - - - - Marari - - - Pawari - - - Powari - - Povārī - - - - - info:lc/vocabulary/languages/hmo - Hiri Motu - hmo - - Police Motu - - - - info:lc/vocabulary/languages/hit - Hittite - hit - - - info:lc/vocabulary/languages/hmn - Hmong - hmn - - Humung - - - Meo - - - Miao - - - Mong - - - Hmong Njua - - Black Flowery Miao - - - Blue Miao - - - Green Hmong - - - Green Miao - - - Green Mong - - - Hmong Leng - - - Moob Ntsuab - - - Tak Meo - - - - She - - Ho Ne - - - Ho Nte - - - Huo Nte - - - She Yao - - - - White Hmong - - Hmong, White - - - Hmong Daw - - - Hmoob Dawb - - - Miao, White - - - White Miao - - - - - info:lc/vocabulary/languages/hun - Hungarian - hun - - Magyar - - - - info:lc/vocabulary/languages/hup - Hupa - hup - - - info:lc/vocabulary/languages/iba - Iban - iba - - Sea Dyak - - - - info:lc/vocabulary/languages/ice - Icelandic - ice - - - info:lc/vocabulary/languages/ido - Ido - ido - - - info:lc/vocabulary/languages/ibo - Igbo - ibo - - Ibo - - - - info:lc/vocabulary/languages/ijo - Ijo - ijo - - Djo - - - Dzo - - - Ejo - - - Ido (African) - - - Iyo (Nigeria) - - - Izo - - - Izon - - - Ojo - - - Oru - - - Udzo - - - Uzo - - - Ibani - - Bonny - - - Ubani - - - - Nembe - - Nimbi - - - - - info:lc/vocabulary/languages/ilo - Iloko - ilo - - Ilocano - - - - info:lc/vocabulary/languages/smn - Inari Sami - smn - - Finnish Lapp - - - Lapp, Finnish - - - Sami, Inari - - - - info:lc/vocabulary/languages/inc - Indic (Other) - inc - - Adiwasi Garasia - - Adivasi Garasia - - - Ādivāsī Garāsiyā - - - Adiwasi Girasia - - - Adiwasi Gujarati - - - Garasia Adivasi - - - - Ahirani - - Ahiri - - - - Apabhraṃśa - - Apabhramsha - - - - Avahattha - - - Bashgali - - Bashgal - - - Bashgari - - - Kamtoz - - - Katai - - - Kati - - - - Bhili - - - Bote-Majhi - - Bote-Mahi - - - Kushar - - - Pakhe-Bote - - - - Chakma - - - Changari - - - Chinali - - Chana (India) - - - Channali - - - Chinal - - - Dagi - - - Harijan - - - Shipi - - - - Danuwar Rai - - Denwar - - - Dhanvar - - - Dhanwar - - - Donwar - - - - Darai - - - Dehawali - - Dehavali - - - Dehwali - - - - Domaaki - - Bericho - - - Dom - - - Doma - - - Dumaki - - - - Dungra Bhil - - Dungari Bhili - - - Dungri Bhili - - - - Fiji Hindi - - Hindi, Fiji - - - - Garasiya - - Garahaiya - - - Girasia - - - - Garhwali - - Gadhavali - - - Gadhawala - - - Gadwahi - - - Gashwali - - - Girwali - - - Godauli - - - Gorwali - - - Gurvali - - - Pahari Garhwali - - - - Halbi - - Bastari - - - - Hindustani - - - Indus Kohistani - - Khili - - - Kohistani, Indus - - - Kohiste - - - Mair - - - Maiya - - - Maiyan - - - Maiyon - - - Shuthun - - - - Kalami - - Bashgharik - - - Bashkarik - - - Dir Kohistani - - - Diri (Kalami) - - - Dirwali - - - Gaawro - - - Garwa - - - Garwi - - - Gawri - - - Gowri - - - Kalam Kohistani - - - Kalami Kohistani - - - Kohistana - - - Kohistani, Dir - - - Kohistani, Kalam - - - Kohistani, Kalami - - - - Khandesi - - Dhed Gujari - - - Khandeshi - - - Khandish - - - - Khowar - - - Kumaoni - - Kamaoni - - - Kumau - - - Kumauni - - - Kumawani - - - Kumgoni - - - Kumman - - - Kunayaoni - - - - Kupia - - Valmiki - - - - Mawchi - - Mauchi - - - Māvacī - - - Mavchi - - - Mawachi - - - Mawchi Bhil - - - Mowchi - - - - Memoni - - - Parya - - Tajuzbeki - - - - Rajbangsi - - Kamtapuri - - - Rajbanshi - - - Rajbansi - - - Rajbongshi - - - - Rathvi - - Rāthavi - - - Rathwi - - - - Shina - - Sheena - - - Sina - - - - Suriname Hindustani - - Aili-Gaili - - - Hindustani, Suriname - - - Surinam Hindustani - - - Sarnami Hindi - - - - Tharu - - - Vaagri Boli - - - Veddah (Sinhalese) - - - Waigali - - Kalaṣa-alā - - - Vaigalī - - - Wai - - - Wai-alā - - - Waigelī - - - - Wotapuri-Katarqalai - - Katarqalai - - - - - info:lc/vocabulary/languages/ine - Indo-European (Other) - ine - - Carian - - - Dacian - - Daco-Mysian - - - North Thracian - - - - Luwian - - Luian - - - Lûish - - - Luvian - - - - Lycian - - - Lydian - - - Macedonian (Ancient) - - - Messapic - - Iapygian - - - Messapian - - - - Palaic - - Balaic - - - Palâ (Palaic) - - - Palaite - - - Palawi - - - - Phrygian - - - Proto-Indo-European - - Proto-Aryan - - - Protoindoeuropean - - - - Thracian - - - Tokharian - - Kuchean - - - Tocharian - - - Tocharish - - - Turfanish - - - - Venetic - - - Yuezhi - - Yüeh-chih - - - - - info:lc/vocabulary/languages/ind - Indonesian - ind - - Bahasa Indonesia - - - - info:lc/vocabulary/languages/inh - Ingush - inh - - - info:lc/vocabulary/languages/ina - Interlingua (International Auxiliary Language Association) - ina - - - info:lc/vocabulary/languages/int - Interlingua (International Auxiliary Language Association) - int - - - info:lc/vocabulary/languages/ile - Interlingue - ile - - Occidental - - - - info:lc/vocabulary/languages/iku - Inuktitut - iku - - Inuit - - - Inuvialuktun - - - Kopagmiut - - Chiglit - - - Siglit - - - - - info:lc/vocabulary/languages/ipk - Inupiaq - ipk - - Inuit - - - - info:lc/vocabulary/languages/ira - Iranian (Other) - ira - - Bactrian - - - Badzhuv - - Badschu - - - Badžū - - - Bāǰūī - - - - Bakhtiari - - Bakhtiyārī - - - Baxtīarī - - - Lori - - - Lori-ye Khaveri - - - Lur (Bakhtiari) - - - Luri (Bakhtiari) - - - - Bartang - - Bartangi - - - - Ephthalite - - Hephthalite - - - - Gilaki - - Gelaki - - - Gilan - - - - Gorani - - Awromani - - - Gurani - - - Hawramani - - - Hawrami - - - Hewrami - - - Howrami - - - Macho - - - - Hazaragi - - Azargi - - - Hazara - - - Hezareh - - - Hezareʼi - - - Khazara - - - Khezare - - - - Ishkashmi - - - Judeo-Tat - - Bik - - - Dzhuhuric - - - Hebrew Tat - - - Hebrew Tati - - - Jew-Tatish - - - Jewish Tat - - - Judeo-Tatic - - - - Khorezmi - - Choresmian - - - Khwarezmian - - - - Khuf - - Chuf - - - - Laki (Iran) - - Alaki - - - Leki - - - - Māzandarānī - - Mazanderani - - - Tabri - - - - Median - - Medic - - - - Munji - - Mundzhan - - - Munjani - - - - Natanzi - - Naṭanz - - - - Ormuri - - Baraks - - - Bargista - - - - Parthian - - - Roshan - - Rochani - - - Ruschan - - - - Sarikoli - - Sarykoli - - - - Sarmatian - - - Shughni - - Shugnan-Rushan - - - - Sivandi - - Sivendi - - - - Talysh - - - Tat - - - Wakhi - - - Yaghnobi - - Neo-Sogdian - - - Yaghnabi - - - Yaghnubi - - - Yagnabi - - - Yagnob - - - Yagnobi - - - Yagnubi - - - - Yazghulami - - - Zebaki - - Sanglici - - - - - info:lc/vocabulary/languages/gle - Irish - gle - - Erse (Irish) - - - Gaelic (Irish) - - - Irish Gaelic - - - - info:lc/vocabulary/languages/iri - Irish - iri - - - info:lc/vocabulary/languages/mga - Irish, Middle (ca. 1100-1550) - mga - - Middle Irish - - - - info:lc/vocabulary/languages/sga - Irish, Old (to 1100) - sga - - Old Irish - - - - info:lc/vocabulary/languages/iro - Iroquoian (Other) - iro - - Cayuga - - - Iroquois - - - Oneida - - - Onondaga - - - Seneca - - - Tuscarora - - - Wyandot - - Huron - - - - - info:lc/vocabulary/languages/ita - Italian - ita - - Judeo-Italian - - - Milanese - - - Modena Italian - - Italian, Modena - - - - Romagnol - - - Venetian Italian - - Italian, Venetian - - - - - info:lc/vocabulary/languages/jpn - Japanese - jpn - - Use for related Japanese languages and dialects - - - - info:lc/vocabulary/languages/jav - Javanese - jav - - - info:lc/vocabulary/languages/jrb - Judeo-Arabic - jrb - - - info:lc/vocabulary/languages/jpr - Judeo-Persian - jpr - - Judeo-Tajik - - - - info:lc/vocabulary/languages/kbd - Kabardian - kbd - - Cabardan - - - Circassian, East - - - Circassian, Upper - - - East Circassian - - - Qabardian - - - Upper Circassian - - - - info:lc/vocabulary/languages/kab - Kabyle - kab - - - info:lc/vocabulary/languages/kac - Kachin - kac - - Chingpaw - - - Jingpho - - - - info:lc/vocabulary/languages/kal - Kalâtdlisut - kal - - Ammassalimiut - - East Greenlandic - - - Greenlandic, East - - - Tunumiisut - - - - Greenlandic - - - Inuit - - - Kalaallisut - - - - info:lc/vocabulary/languages/kam - Kamba - kam - - - info:lc/vocabulary/languages/kan - Kannada - kan - - Canarese - - - Kanarese - - - Havyaka - - - - info:lc/vocabulary/languages/kau - Kanuri - kau - - Bornu - - - - info:lc/vocabulary/languages/krc - Karachay-Balkar - krc - - Balkar - - - - info:lc/vocabulary/languages/kaa - Kara-Kalpak - kaa - - Karakalpak - - - Qaraqalpaq - - - - info:lc/vocabulary/languages/krl - Karelian - krl - - Carelian - - - - info:lc/vocabulary/languages/kar - Karen languages - kar - - Kayah - - Karen, Red - - - Red Karen - - - - Pwo Karen - - - Sgaw Karen - - - Taungthu - - Pa-o - - - - - info:lc/vocabulary/languages/kas - Kashmiri - kas - - - info:lc/vocabulary/languages/csb - Kashubian - csb - - Cashubian - - - - info:lc/vocabulary/languages/kaw - Kawi - kaw - - Javanese, Old - - - Old Javanese - - - - info:lc/vocabulary/languages/kaz - Kazakh - kaz - - Kirghiz-Kaissak - - - - info:lc/vocabulary/languages/kha - Khasi - kha - - - info:lc/vocabulary/languages/khm - Khmer - khm - - Cambodian - - - Central Khmer - - - - info:lc/vocabulary/languages/cam - Khmer - cam - - - info:lc/vocabulary/languages/khi - Khoisan (Other) - khi - - Ju/'hoan - - !Xũ (!Kung) - - - Zjuc'hôa - - - Žu/'hõasi - - - - Khoikhoi - - Hottentot - - - - Korana - - - Nama - - - Nharo - - Naro - - - - San languages - - Bushman languages - - - - !Xõ - - Gxon - - - Hua-owani - - - !Kõ (Botswana and Namibia) - - - Koon - - - Magong - - - !Xong (Botswana and Namibia) - - - - - info:lc/vocabulary/languages/kho - Khotanese - kho - - Khotan-Saka - - - Khotanese-Sakan - - - Khotani - - - Khotansaka - - - Middle Khotanese - - - North Aryan - - - Old Khotanese - - - Saka - - - Sakan - - - - info:lc/vocabulary/languages/kik - Kikuyu - kik - - Gikuyu - - - - info:lc/vocabulary/languages/kmb - Kimbundu - kmb - - Angola - - - Bunda - - - Mbundu (Luanda Province, Angola) - - - Nbundu - - - Quimbundo (Luanda Province, Angola) - - - - info:lc/vocabulary/languages/kin - Kinyarwanda - kin - - Nyaruanda - - - Ruanda - - - Runyarwanda - - - Rwanda - - - Rufumbira - - - - info:lc/vocabulary/languages/tlh - Klingon (Artificial language) - tlh - - - info:lc/vocabulary/languages/kom - Komi - kom - - Syryenian - - - Zyrian - - - Komi-Permyak - - Permiak - - - - - info:lc/vocabulary/languages/kon - Kongo - kon - - Congo - - - Kikongo - - - Kituba (Congo (Brazzaville)) - - Kikoongo (Kituba (Congo (Brazzaville))) - - - Munukutuba - - - - Laadi - - Kilari - - - - Manyanga - - Kimanyanga - - - Kisi-Ngóombe - - - Manianga - - - - Ntaandu - - Kintaandu - - - Kisantu - - - Santu - - - - Vili - - Civili - - - Fiot - - - Fiote - - - Ki-vili - - - Ki-vumbu - - - Kivili - - - Kivumbu - - - Loango - - - Lu-wumbu - - - Luwumbu - - - Tsivili - - - - Zombo - - - - info:lc/vocabulary/languages/kok - Konkani - kok - - Concani - - - Komkani - - - Koṅkṇi - - - Agri - - Agari - - - - Chitapavani - - Chitpavani - - - Citpāvanī - - - - Jhāḍī - - - Kudali - - Malvani - - - - - info:lc/vocabulary/languages/kut - Kootenai - kut - - Kutenai - - - - info:lc/vocabulary/languages/kor - Korean - kor - - Use for related Korean languages and dialects - - - - info:lc/vocabulary/languages/kos - Kosraean - kos - - Kosrae - - - Kusaie - - - Kusaiean - - - - info:lc/vocabulary/languages/kpe - Kpelle - kpe - - Guerzé - - - - info:lc/vocabulary/languages/kro - Kru (Other) - kro - - Bete - - - Dadjriwalé - - Dadjrignoa - - - Dagli - - - Dajriwali - - - - Dida - - Wawi - - - - Godié - - Go (Côte d'Ivoire) - - - Godia - - - Godye - - - - Kru - - - Kuwaa - - Belle - - - Belleh - - - Kowaao - - - Kwaa - - - - Neyo - - Gwibwen - - - Néouolé - - - Néyau - - - Niyo - - - Towi - - - - Ngere - - Gere - - - Guéré - - - - Nyabwa - - Niaboua - - - - Tchien - - Gien - - - Kien - - - Tie - - - - Tepo - - Kroumen - - - Tewi - - - - Wobe - - Ouobe - - - - - info:lc/vocabulary/languages/kua - Kuanyama - kua - - Cuanhama - - - Kwanyama - - - Ovambo (Kuanyama) - - - - info:lc/vocabulary/languages/kum - Kumyk - kum - - - info:lc/vocabulary/languages/kur - Kurdish - kur - - Kurmanji - - - Mukri - - - - info:lc/vocabulary/languages/kru - Kurukh - kru - - Kurux - - - Oraon - - - Uraon - - - - info:lc/vocabulary/languages/kus - Kusaie - kus - - - info:lc/vocabulary/languages/kir - Kyrgyz - kir - - Kara-Kirghiz - - - Kirghiz - - - - info:lc/vocabulary/languages/lad - Ladino - lad - - Judeo-Spanish - - - Judesmo - - - Ḥakétia - - Ḥakétie - - - Haketiya - - - Ḥakitía - - - Haquetía - - - Haquetiya - - - - - info:lc/vocabulary/languages/lah - Lahndā - lah - - Jaṭkī - - - Lahndi - - - Panjabi, Western - - - Western Panjabi - - - Hindkōo - - - Khetrānī - - - Pōṭhwārī - - - Siraiki - - Bahawalpuri - - - Lahnda, Southern - - - Multani - - - Mutani - - - Panjabi, Southern - - - Reasati - - - Riasati - - - Saraiki - - - Southern Lahnda - - - Southern Panjabi - - - - Sirāikī Hindkī - - Siraiki Lahndi - - - - Sirāikī Sindhī - - Sindhi, Siraiki - - - - - info:lc/vocabulary/languages/lam - Lamba (Zambia and Congo) - lam - - - info:lc/vocabulary/languages/lao - Lao - lao - - - info:lc/vocabulary/languages/lat - Latin - lat - - Latin, Vulgar - - - Vulgar Latin - - - - info:lc/vocabulary/languages/lav - Latvian - lav - - Lettish - - - Latgalian - - East Latvian - - - High Latvian - - - Letgalian - - - - - info:lc/vocabulary/languages/lez - Lezgian - lez - - - info:lc/vocabulary/languages/lim - Limburgish - lim - - Limburger - - - - info:lc/vocabulary/languages/lin - Lingala - lin - - Bangala (Congo) - - - Mangala (Congo) - - - Ngala (Congo) - - - - info:lc/vocabulary/languages/lit - Lithuanian - lit - - - info:lc/vocabulary/languages/jbo - Lojban (Artificial language) - jbo - - - info:lc/vocabulary/languages/nds - Low German - nds - - German, Low - - - Low Saxon - - - Plattdeutsch - - - Plautdietsch - - - Saxon, Low - - - - info:lc/vocabulary/languages/dsb - Lower Sorbian - dsb - - Sorbian, Lower - - - - info:lc/vocabulary/languages/loz - Lozi - loz - - Kololo - - - Rozi - - - Sikololo - - - - info:lc/vocabulary/languages/lub - Luba-Katanga - lub - - Chiluba - - - Katanga - - - - info:lc/vocabulary/languages/lua - Luba-Lulua - lua - - Ciluba - - - Kalebwe (Luba-Lulua) - - - Luba, Western - - - Luba-Kasai - - - Western Luba - - - - info:lc/vocabulary/languages/lui - Luiseño - lui - - - info:lc/vocabulary/languages/smj - Lule Sami - smj - - Lapp, Swedish - - - Sami, Lule - - - Swedish Lapp - - - - info:lc/vocabulary/languages/lun - Lunda - lun - - - info:lc/vocabulary/languages/luo - Luo (Kenya and Tanzania) - luo - - Dho Luo - - - Gaya - - - Jo Luo - - - Kavirondo, Nilotic - - - Nife - - - Nilotic Kavirondo - - - Nyife - - - Wagaya - - - - info:lc/vocabulary/languages/lus - Lushai - lus - - Dulien - - - Mizo - - - Sailau - - - - info:lc/vocabulary/languages/ltz - Luxembourgish - ltz - - Letzebuergesch - - - Letzeburgesch - - - Luxembourgeois - - - Luxemburgian - - - - info:lc/vocabulary/languages/mac - Macedonian - mac - - Bǎlgarski (Macedonian) - - - Balgàrtzki (Macedonian) - - - Bolgàrtski (Macedonian) - - - Bulgàrtski (Macedonian) - - - Dópia - - - Entópia - - - Macedonian Slavic - - - Makedoniski - - - Makedonski - - - Slavic (Macedonian) - - - Slaviká (Macedonian) - - - Slavomacedonian - - - - info:lc/vocabulary/languages/mad - Madurese - mad - - - info:lc/vocabulary/languages/mag - Magahi - mag - - Bihari (Magahi) - - - Magadhi - - - Magaya - - - Maghadi - - - Maghai - - - Maghaya - - - Maghori - - - Magi (India) - - - Magodhi - - - Megahi - - - - info:lc/vocabulary/languages/mai - Maithili - mai - - Apabhramsa (Maithili) - - - Bihari (Maithili) - - - Maitili - - - Maitli - - - Methli - - - Tirahutia - - - Tirhuti - - - Tirhutia - - - Khotta (Maithili) - - Eastern Maithili - - - Khoratha - - - - - info:lc/vocabulary/languages/mak - Makasar - mak - - Macassarese - - - - info:lc/vocabulary/languages/mlg - Malagasy - mlg - - Hova - - - Madagascan - - - Malgache - - - Merina - - - Bara (Madagascar) - - - Betsileo - - - Masikoro - - - Sakalava - - - Tsimihety - - - - info:lc/vocabulary/languages/mla - Malagasy - mla - - - info:lc/vocabulary/languages/may - Malay - may - - Palembang Malay - - - - info:lc/vocabulary/languages/mal - Malayalam - mal - - Malabar - - - Moplah - - - - info:lc/vocabulary/languages/mlt - Maltese - mlt - - - info:lc/vocabulary/languages/mnc - Manchu - mnc - - - info:lc/vocabulary/languages/mdr - Mandar - mdr - - Andian - - - - info:lc/vocabulary/languages/man - Mandingo - man - - Malinka - - - Mandeka - - - Maninka - - - Meninka - - - - info:lc/vocabulary/languages/mni - Manipuri - mni - - Meithei - - - - info:lc/vocabulary/languages/mno - Manobo languages - mno - - Agusan Manobo - - - Ata Manobo - - - Binukid Manobo - - Binokid - - - Bukidnon - - - - Cotabato Manobo - - - Dibabawon - - Debabaon - - - Dibabaon - - - Mandaya - - - - Higaonon - - - Ilianen Manobo - - - Kagayanen - - Cagayano Cillo - - - - Manuvu - - Bagobo, Upper - - - Upper Bagobo - - - - MatigSalug - - - Sarangani Manobo - - Culamanes - - - Kulaman - - - - Western Bukidnon Manobo - - Bukidnon Manobo, Western - - - Central Manobo - - - Central Mindanao Manobo - - - - - info:lc/vocabulary/languages/glv - Manx - glv - - Manx Gaelic - - - - info:lc/vocabulary/languages/max - Manx - max - - - info:lc/vocabulary/languages/mao - Maori - mao - - South Island Maori - - Maori, South Island - - - - - info:lc/vocabulary/languages/arn - Mapuche - arn - - Araucanian - - - Mapudungun - - - - info:lc/vocabulary/languages/mar - Marathi - mar - - Mahratta - - - Mahratti - - - Murathee - - - Are - - Ade Basha - - - Aray - - - Arrey - - - Arya - - - Kalika Arya Bhasha - - - - Koshti (Marathi) - - Kosti (Marathi) - - - - Kunabi - - - Varhadi Nagpuri - - Berar Marathi - - - Berari - - - Dhanagari - - - Kumbhari - - - Madhya Pradesh Marathi - - - Nagpuri (Varhadi Nagpuri) - - - Nagpuri-Varhadi - - - Varhadi-Nagpuri Marathi - - - - - info:lc/vocabulary/languages/chm - Mari - chm - - Cheremissian - - - - info:lc/vocabulary/languages/mah - Marshallese - mah - - Ebon - - - - info:lc/vocabulary/languages/mwr - Marwari - mwr - - Bikaneri - - - Dingal - - - Mewari - - Mevadi - - - Mewa - - - Mewadi - - - - Shekhawati - - Sekhavati - - - - - info:lc/vocabulary/languages/mas - Massai - mas - - Maa (Kenya and Tanzania) - - - Masai - - - - info:lc/vocabulary/languages/myn - Mayan languages - myn - - Achi - - Cubulco Achi - - - Rabinal Achi - - - - Akatek - - Acateco - - - Kanjobal, Western - - - San Miguel Acatán Kanjobal - - - Western Kanjobal - - - - Awakateko - - Aguacatec - - - - Cakchikel - - Kacchiquel - - - - Chol - - - Chontal of Tabasco - - - Chorti - - - Chuj - - - Huastec - - Guastec - - - Wastek - - - - Itzá - - - Ixil - - - Jacalteca - - Jakalteka - - - - Kanjobal - - Conob - - - - Kekchi - - Cacchi - - - Ghec-chi - - - Quekchi - - - - Lacandon - - - Mam - - Zaklohpakap - - - - Maya - - Yucatecan - - - - Mochó - - Motozintlec - - - - Mopan - - Manche - - - - Pokomam - - Pocomam - - - Poqomam - - - - Pokonchi - - - Quiché - - Kiché - - - Utlateca - - - - Tectiteco - - Teco (Mayan) - - - - Tojolabal - - Chañabal - - - - Tzeltal - - Celdal - - - Tseltal - - - Zendal - - - - Tzotzil - - Chamula - - - Querene - - - Zotzil - - - - Tzutuhil - - Zutuhil - - - - Uspanteca - - - - info:lc/vocabulary/languages/men - Mende - men - - - info:lc/vocabulary/languages/mic - Micmac - mic - - - info:lc/vocabulary/languages/min - Minangkabau - min - - Menangkabau - - - - info:lc/vocabulary/languages/mwl - Mirandese - mwl - - - info:lc/vocabulary/languages/mis - Miscellaneous languages - mis - - Andamanese - - - Burushaski - - Boorishki - - - Khajuna - - - - Chukchi - - Tchuktchi - - - Tuski - - - - Etruscan - - - Gilyak - - Guiliak - - - Nivkh - - - - Hattic - - Hattian - - - Khattic - - - Khattili - - - Khattish - - - Proto-Hittite - - - - - Hurrian - - Mitani - - - Subarian - - - - Iberian - - - Indus script - - - Jarawa (India) - - - Kamchadal - - Itelmes - - - - Ket - - Yenisei-Ostiak - - - - Koryak - - - Manipravalam (Malayalam) - - - Mysian - - - Nancowry - - - Nenets - - Jurak - - - Yurak - - - - Nganasan - - Tavgi - - - - Nicobarese - - - Palan - - Pallan - - - - Shelta - - - Urartian - - Chaldean (Urartian) - - - Khaldian - - - Urartaean - - - Urartic - - - Vannic - - - - Yugh - - Sym-Ketish - - - - Yukaghir - - Jukaghir - - - - - info:lc/vocabulary/languages/moh - Mohawk - moh - - - info:lc/vocabulary/languages/mdf - Moksha - mdf - - - info:lc/vocabulary/languages/mol - Moldavian - mol - - - info:lc/vocabulary/languages/mkh - Mon-Khmer (Other) - mkh - - Bahnar - - - Blang - - Bulang - - - Plang - - - Pulang - - - Samtao - - - - Chrau - - - Cua - - Bong Miew - - - Kor - - - Traw - - - - Eastern Mnong - - Mnong, Eastern - - - - Hrê - - Davak - - - - Jah Hut - - Eastern Sakai - - - Sakai, Eastern - - - - Jeh - - Die - - - Yeh - - - - Katu - - Attouat - - - Khat - - - Ta River Van Kieu - - - Teu - - - Thap - - - - Khmu' - - Kamhmu - - - Phouteng - - - - Koho - - - Kui (Mon-Khmer) - - Khmer, Old (Kui) - - - Kuay - - - Kuy - - - Old Khmer (Kui) - - - Suai - - - Suay - - - - Laven - - Loven - - - - Lawa (Thailand) - - La-oop - - - Lava - - - Lavua - - - Luwa - - - - Mah Meri - - Besisi - - - Cellate - - - - Mon - - Peguan - - - Talaing - - - - Muong - - - Northern Khmer - - Khmer, Northern - - - - Nyah Kur - - Chao Bon - - - Niakuol - - - - Pacoh - - Bo - - - River Van Kieu - - - - Rengao - - - Sedang - - - Semai - - Central Sakai - - - Sakai, Central - - - Senoi - - - - Semang - - Kensiu - - - Ngok Pa - - - - Senoic languages - - Aslian languages, Central - - - Central Aslian languages - - - Sakai languages - - - - Srê - - - Stieng - - - Temiar - - Northern Sakai - - - Sakai, Northern - - - - Wa - - - - info:lc/vocabulary/languages/lol - Mongo-Nkundu - lol - - Lolo (Congo) - - - Lomongo - - - Lonkundu - - - Mongo - - - Nkundu - - - - info:lc/vocabulary/languages/mon - Mongolian - mon - - Mongol - - - Chahar - - Čakhar - - - - Dariganga - - Dar'ganga - - - Dariġangġ-a - - - Darigangga - - - - Khalkha - - - Ordos - - - - info:lc/vocabulary/languages/mos - Mooré - mos - - Mole - - - Moré - - - Moshi - - - Mossi - - - Yana (Burkina Faso and Togo) - - - - info:lc/vocabulary/languages/mul - Multiple languages - mul - - - info:lc/vocabulary/languages/mun - Munda (Other) - mun - - Asuri - - - Bhumij - - - Ho - - - Kharia - - - Korwa - - Korava (Munda) - - - - Kurku - - Bondeya - - - Bopchi - - - Kirku - - - Korakū - - - Korki - - - Korku - - - Kuri (India) - - - - Mundari - - Kohl - - - - Nihali - - Nahali - - - - Sora - - Sabara - - - Saora - - - Savara - - - Sawara - - - - - info:lc/vocabulary/languages/nah - Nahuatl - nah - - Aztec - - - Mexican - - - Pipil - - Nahuat - - - - - info:lc/vocabulary/languages/nau - Nauru - nau - - - info:lc/vocabulary/languages/nav - Navajo - nav - - - info:lc/vocabulary/languages/nbl - Ndebele (South Africa) - nbl - - Ndzundza - - - Nrebele (South Africa) - - - Transvaal Ndebele - - - - info:lc/vocabulary/languages/nde - Ndebele (Zimbabwe) - nde - - Nrebele (Zimbabwe) - - - Sindebele - - - Tebele - - - - info:lc/vocabulary/languages/ndo - Ndonga - ndo - - Ambo (Angola and Namibia) - - - Oshindonga - - - Oshiwambo - - - Ovambo (Ndonga) - - - - info:lc/vocabulary/languages/nap - Neapolitan Italian - nap - - - info:lc/vocabulary/languages/nep - Nepali - nep - - Gorkhali - - - Gurkhali - - - Khas - - - Naipali - - - Nepalese - - - Parbate - - - Parbatiya - - - Purbutti - - - Baitadi - - - Kumali - - - Parvati - - Parbati - - - - - info:lc/vocabulary/languages/new - Newari - new - - - info:lc/vocabulary/languages/nwc - Newari, Old - nwc - - Old Newari - - - - info:lc/vocabulary/languages/nia - Nias - nia - - - info:lc/vocabulary/languages/nic - Niger-Kordofanian (Other) - nic - - Niger-Congo (Other) - - - Abidji - - Adidji - - - Ari (Côte d'Ivoire) - - - - Abua - - - Ahanta - - - Aja (Benin and Togo) - - Adja - - - - Alladian - - Aladian - - - Aladyã - - - Aladyan - - - Alagia - - - Alagian - - - Alagya - - - Alajan - - - Alladyan - - - Allagia - - - Allagian language - - - - Anufo - - Chakosi - - - - Anyang - - Denya - - - Nyang (Cameroon) - - - - Anyi - - Agni - - - - Attie - - Akye - - - Kurobu - - - - Avikam - - - Awutu - - - Babungo - - Ngo - - - - Bafut - - - Baka (Cameroon and Gabon) - - - Balanta-Ganja - - Alante (Senegal) - - - Balanda (Senegal) - - - Balant (Senegal) - - - Balante (Senegal) - - - Balãt - - - Ballante (Senegal) - - - Belante (Senegal) - - - Brassa (Senegal) - - - Bulanda (Senegal) - - - Fca - - - Fjaa - - - Fraase - - - - Balanta-Kentohe - - Alante (Balanta-Kentohe) - - - Balanda (Balanta-Kentohe) - - - Balant (Balanta-Kentohe) - - - Balanta - - - Balante (Balanta-Kentohe) - - - Ballante (Balanta-Kentohe) - - - Belante (Balanta-Kentohe) - - - Brassa (Balanta-Kentohe) - - - Bulanda (Balanta-Kentohe) - - - Frase - - - - Bamun - - - Bandial - - Banjaal - - - Eegima - - - Eegimaa - - - - Bariba - - Bargu - - - Berba (Benin and Nigeria) - - - - Bassari - - Ayan - - - Biyan - - - Wo - - - - Baule - - Baoulé - - - - Bedik - - Budik - - - Tenda - - - - Bekwarra - - - Bena (Nigeria) - - Binna - - - Buna (Bena) - - - Ebina (Bena) - - - Ebuna (Bena) - - - Gbinna - - - Yangeru - - - Yongor - - - Yungur (Bena) - - - - Benue-Congo languages - - - Biali - - Berba (Benin and Burkina Faso) - - - Bieri - - - - Bijago - - Bidyogo - - - - Birifor - - - Birom - - Berom - - - Bouroum - - - Burum (Nigeria) - - - Kibo - - - Kibyen - - - Shosho - - - - Blowo - - Blo - - - Dan-blo - - - Western Dan - - - - Bobo Fing - - Black Bobo - - - Bulse - - - Finng - - - - Boomu - - Bomu - - - - Bozo - - Sorko - - - Sorogo - - - - Brissa - - Anufo (Côte d'Ivoire) - - - - Bua languages - - Boua languages - - - - Buli - - Builsa - - - Bulea - - - Bulugu - - - Guresha - - - Kanjaga - - - - Busa - - Boko - - - - Bwamu - - Bobo Wule - - - Bouamou - - - - Cross River Mbembe - - Ekokoma - - - Ifunubwa - - - Oderiga - - - Ofunobwam - - - Okam - - - Wakande - - - - Dagaare - - - Dagbani - - Dagomba - - - - Dan (Côte d'Ivoire) - - Gio - - - Yacouba - - - - Degema - - Atala - - - Udekama - - - - Diola - - Dyola - - - Yola - - - - Djimini - - Dyimini - - - Gimini - - - Jimini - - - Jinmini - - - - Dogon - - Habe - - - Tombo - - - - Ebira - - Egbira - - - Igbira - - - - Eggon - - - Ejagham - - Central Ekoi - - - Ekwe - - - Ezam - - - - Ekpeye - - - Engenni - - Egene - - - Ngene - - - - Esuulaalu - - - Etsako - - Afenmai - - - Iyekhee - - - Kukuruku - - - Yekhee - - - - Fali (Cameroon) - - Falli - - - - Falor - - Palor - - - - Farefare - - Frafra - - - Gurenne - - - Gurne - - - Gurune - - - Nankani - - - Nankanse - - - Ninkare - - - - Gbagyi - - - Gbandi - - Bandi - - - - Gen-Gbe - - Gẽ - - - Mina (Benin and Togo) - - - - Gikyode - - Chode - - - Kyode - - - - Gonja - - Guang - - - - Gua - - Gwa (Ghana) - - - - Gun-Gbe - - Alada - - - Egun - - - - Gurma - - Gourmantché - - - Gulmance - - - - Guyuk - - - Gweetaawu - - Dan-gouéta - - - Eastern Dan - - - Gouéta - - - Gwétaawo - - - - Hanga (Ghana) - - Anga (Ghana) - - - - Hõne - - Jukun of Gwana - - - - Idoma - - Oturkpo - - - - Igede - - - Igo - - Ahlon - - - Anlo - - - - Ikwere - - Oratta-Ikwerri - - - - Indenie - - Ndenie - - - Ndenye - - - Ndinian - - - Ndyenye - - - - Itsekiri - - Isekiri - - - - Izere - - Jarawa (Nigeria) - - - - Izi - - - Jju - - Ju (Benue-Congo) - - - Kaje - - - - Jowulu - - Jo - - - Samogho (Jowulu) - - - Samoighokan - - - - Jukun - - Kurorofa - - - - Kaansa - - Gã (Burkina Faso) - - - Gan (Burkina Faso) - - - Gane (Burkina Faso) - - - Kaan (Burkina Faso) - - - Kaanse - - - Kãasa (Burkina Faso) - - - Kan (Burkina Faso) - - - - Kabiye - - Kabre - - - Kabye - - - - Kagoro (Mali) - - - Kagoro (Nigeria) - - Gworok - - - - Karang (Cameroon) - - - Kasem - - Kasena - - - Kasim - - - Kassem - - - Kassene - - - - Kassonke - - Khassonke - - - - Kissi - - Kisi (West Africa) - - - - Konkomba - - - Konni - - Koma (Ghana) - - - - Kposo - - Akposo - - - Ikposo - - - - Krahn - - Kran - - - Northern Krahn - - - Western Krahn - - - - Krongo - - Kadumodi - - - Kurungu - - - - Kulango - - Koulango - - - Kpelego - - - Nabe - - - Ngwala - - - Nkurange - - - Zazere - - - - Kuo (Cameroon and Chad) - - Ko (Cameroon and Chad) - - - Koh - - - - Kuranko - - Koranko - - - - Kurumba - - Deforo - - - Foulse - - - Fulse - - - Koromfe - - - Kouroumba - - - Kurumfe - - - Lilse - - - - Kusaal - - Kusasi - - - - Kwanja - - - Kweni - - Gouro - - - - Lefana - - Bouem - - - Buem - - - Bwem - - - - Ligbi - - - Limba - - - Limbum - - Llimbumi - - - Ndzungle - - - Njungene - - - Nsugni - - - Wimbum - - - Zungle - - - - Lobi - - - Loko - - Landogo - - - - Loma - - Baru - - - Buzi - - - Lorma - - - - Longuda - - Nunguda - - - - Lorhon - - Loghon - - - - Lyele - - Lele (Burkina Faso) - - - - Mamara - - Bamana (Senufo) - - - Mianka - - - Minianka - - - Minyanka - - - - Mambila - - Lagubi - - - Nor - - - Tagbo - - - Torbi - - - - Mampruli - - - Mandjak - - - Mankanya - - Bola (Portuguese Guinea) - - - Brame - - - Bulama - - - - Mankon - - - Mano - - - Mayogo - - - Mbili - - - Mbum - - Mbam - - - - Mi Gangam - - Dye - - - Gangam - - - Ngangan - - - - Migili - - Koro Lafia - - - - Mo (Côte d'Ivoire and Ghana) - - Buru (Côte d'Ivoire and Ghana) - - - Deg - - - Mmfo - - - - Moba - - - Muana - - - Mumuye - - - Mundang - - Moundang - - - - Mungaka - - Bali (Cameroon) - - - Ngaaka - - - - Nafaanra - - - Nawuri - - - Nchumburu - - - Ndogo-Sere languages - - - Ngbaka - - - Ngbaka ma'bo - - Bwaka - - - Ngbaka limba - - - - Nirere - - - Ninzo - - Akiza - - - Amar Tita - - - Ancha - - - Fadan Wate - - - Gbhu D Amar Randfa - - - Hate (Ninzo) - - - Incha - - - Kwasu - - - Ninzam - - - Nunzo - - - Sambe - - - - Nkonya - - - Nomaante - - - Noon - - - Noone - - Noni - - - - Northern Bullom - - Bullom, Northern - - - - Nunuma - - Nibulu - - - Nouni - - - - Nupe - - Nope - - - - Ogbronuagum - - - Oku - - Bvukoo - - - Ebkuo - - - Ekpwo - - - Kuo (Oku) - - - Ukfwo - - - Uku (Oku) - - - - Oron - - - Pinyin - - - Safaliba - - Safalaba - - - Safalba - - - Safali - - - - Samo (West Africa) - - Goe - - - Matya - - - Maya (Burkina Faso) - - - Samogo-Sane - - - San (Eastern Mande) - - - Sane - - - - Sanwi - - - Sembla - - Sambla - - - Samogho-Senku - - - Samogo-Senku - - - Seeku - - - Sembila - - - Senku - - - Southern Samo (Western Mande) - - - - Senari - - Senufo - - - - Senya - - - Sherbro - - Bullom, Southern - - - Southern Bullom - - - - Sissala - - - Somba - - Betammadibe - - - Ditammari - - - Tamaba - - - - Tagbana - - - Tampulma - - Tamprusi - - - - Téén - - - Tem - - Cotocoli - - - Kotokoli - - - Tim - - - - Tigon Mbembe - - Akonto - - - Akwanto - - - Noale - - - Tigim - - - Tigon - - - Tigong - - - Tigum - - - Tigun - - - Tikun - - - Tukun - - - - Tikar - - - Tobote - - Basari (Togo and Ghana) - - - - Tofingbe - - - Toma (Burkina Faso) - - Makaa (Burkina Faso) - - - Nyaana - - - - Tura - - Toura - - - - Tusia - - Toussia - - - - Tuwunro - - - Tyembara - - - Ukaan - - Aika - - - Anyaran - - - Auga - - - Ikan - - - Kakumo - - - - Urhobo - - - Vagala - - Kira - - - Konosarola - - - Siti - - - - Vige - - - Winyé - - Kõ (Burkina Faso) - - - Kols - - - Kolsi - - - - Yakö - - Kö (Yakö) - - - Lukö - - - - Yom - - Kpilakpila - - - Pila - - - Pilapila - - - - - info:lc/vocabulary/languages/ssa - Nilo-Saharan (Other) - ssa - - Sub-Saharan African (Other) - - - Adhola - - Dhopadhola - - - Ludama - - - - Alur - - Aloro - - - Alua - - - Alulu - - - Aluru - - - Dho Alur - - - Jo Alur - - - Lur (Alur) - - - Luri (Alur) - - - - Anuak - - Yambo - - - - Aringa - - Low Lugbara - - - - Bagirmi - - Barma - - - - Baka - - Tara Baaka - - - - Bari - - Dzilio - - - - Birri (Central African Republic) - - Abiri - - - Ambili - - - Biri (Central African Republic) - - - Bviri - - - Viri language - - - - Bongo - - - Bongo-Bagirmi languages - - - Bor (Lwo) - - Belanda - - - - Dazaga - - Dasa - - - Dasaga - - - Daza (Nilo-Saharan) - - - Dazagada - - - Dazza - - - Dazzaga - - - Tebu (Dazaga) - - - Tibbu (Dazaga) - - - Toubou (Dazaga) - - - Tubu (Dazaga) - - - - Fur - - - Gambai - - Kabba Laka - - - Ngambai - - - Sara Gambai - - - - Ingassana - - Gaam - - - Ingessana - - - Kamanidi - - - Mamidza - - - Memedja - - - Metabi - - - Muntabi - - - Tabi (Ingassana) - - - - Jur Modo - - Jur (Jur Modo) - - - Modo - - - - Kaba (Central Sudanic) - - - Kalenjin - - - Kara (Central African Republic and Sudan) - - Fer - - - Gula (Central African Republic and Sudan) - - - Yama - - - Yamegi - - - - Karamojong - - Akarimojong - - - - Kenga - - - Kipsikis - - - Kreish - - - Kùláál - - Gula (Lake Iro, Chad) - - - - Kunama - - Cunama - - - - Lango (Uganda) - - - Lendu - - - Lese - - - Logo - - Logo Kuli - - - Logoti - - - - Lotuko - - Latuka - - - - Lugbara - - Logbara - - - Logbware - - - Luguaret - - - Lugware - - - - Lwo (Sudan) - - Dhe Lwo - - - Dyur - - - Giur - - - Jo Lwo - - - Jur (Lwo (Sudan)) - - - Luo (Sudan) - - - - Maban - - Meban - - - - Maʾdi (Uganda and Sudan) - - Madi-ti (Uganda and Sudan) - - - - Majingai - - Midjinngay - - - Moggingain - - - Sara-Majingai - - - - Mamvu - - Momvu - - - Monvu - - - Tengo - - - - Mangbetu - - Monbuttu - - - - Mbai (Moissala) - - Moissala Mbai - - - Sara Mbai (Moissala) - - - - Moru - - - Murle - - Beir - - - - Nandi - - - Nara - - Barea - - - Baria - - - Barya - - - Higir - - - Kolkotta - - - Koyta - - - Mogoreb - - - Morda - - - Nera - - - Nere - - - Santora - - - - Ngama - - Sara Ngama - - - - Ngiti - - Druna - - - Lendu, Southern - - - Ndruna - - - Southern Lendu - - - - Nuer - - Abigar - - - Nath - - - - Päri (Sudan) - - - Proto-Eastern Sudanic - - - Sabaot - - - Samburu - - Burkeneji - - - Lokop - - - Nkutuk - - - Sambur - - - Sampur - - - - Sara - - Majingai-Ngama - - - - Suk - - Pokot - - - - Tedaga - - Tebou - - - Tebu (Tedaga) - - - Teda - - - Tedagada - - - Tibbu (Tedaga) - - - Tibu - - - Toda (Africa) - - - Todaga - - - Todga - - - Toubou (Tedaga) - - - Tubu - - - Tuda (Africa) - - - Tuduga - - - - Teso - - Ateso - - - Iteso - - - - Toposa - - Abo (Sudan) - - - Akeroa - - - Dabossa - - - Huma (Sudan) - - - Kare (Sudan) - - - Khumi (Sudan) - - - Taposa - - - - Turkana - - - Uduk - - - Yulu - - - Zaghawa - - Beri-aa - - - Berri - - - Kebadi - - - Merida - - - Soghaua - - - Zeghawa - - - - - info:lc/vocabulary/languages/niu - Niuean - niu - - - info:lc/vocabulary/languages/nqo - N'Ko - nqo - - - info:lc/vocabulary/languages/nog - Nogai - nog - - - info:lc/vocabulary/languages/zxx - No linguistic content - zxx - - - info:lc/vocabulary/languages/nai - North American Indian (Other) - nai - - Use for the other languages of North America north of Mexico excluding the - languages of the Azteco-Tanoan language phylum. - - - Alabama - - - Arikara - - - Atsugewi - - - Beothuk - - - Chickasaw - - - Chimariko - - - Chitimacha - - Chetimacha - - - Shetimasha - - - - Chumash - - - Coahuilteco - - Tejano - - - - Cocopa - - - Coos - - Kaus - - - Kwokwoos - - - - Eastern Pomo - - Pomo, Eastern - - - - Eyak - - Ugalachmut - - - - Hualapai - - Jaguallapai - - - Mataveke-paya - - - Walapai - - - - Karok - - - Keres - - - Kiliwa - - Yukaliwa - - - - Konomihu - - - Kuitsh - - Lower Umpqua - - - Umpqua, Lower - - - - Kumiai - - Campo - - - Cochimi (Diegueño) - - - Comeya - - - Cuchimí - - - Diegueño - - - Digueño - - - Iipay - - - Kamia - - - Kamiai - - - Kamiyahi - - - Kamiyai - - - Ki-Miai - - - Ko'al - - - Ku'ahl - - - Kumeyaai - - - Kumeyaay - - - Kumia - - - Kw'aal - - - Quemayá - - - Tiipay - - - Tipai - - - - Maidu - - Pujunan - - - - Mikasuki - - Mekusuky - - - - Miwok languages - - Mewan - - - Moquelumnan - - - - Mutsun - - - Nez Percé - - Numipu - - - Sahaptin - - - - Northern Sierra Miwok - - Miwok, Northern Sierra - - - - Ohlone - - Costanoan - - - - Paipai - - - Pawnee - - - Southeastern Pomo - - Pomo, Southeastern - - - - Timucua - - - Tlakluit - - Echeloot - - - Wishram - - - - Tonkawa - - - Tunica - - Tonican - - - Yoron - - - Yuron - - - - Wappo - - - Wichita - - - Wikchamni - - Wükchamni - - - - Wintu - - - Wiyot - - - Yahi - - - Yakama - - Yakima - - - - Yuchi - - Uchee - - - - Yuki - - - - info:lc/vocabulary/languages/frr - North Frisian - frr - - Frisian, North - - - - info:lc/vocabulary/languages/sme - Northern Sami - sme - - Sami, Northern - - - - info:lc/vocabulary/languages/nso - Northern Sotho - nso - - Pedi - - - Sepedi - - - Sotho, Northern - - - Transvaal Sotho - - - Pai (South Africa) - - Eastern Sotho - - - - - info:lc/vocabulary/languages/nor - Norwegian - nor - - Bokmål - - - Dano-Norwegian - - - Riksmål - - - Trøndersk - - Trønder - - - Trøndesk - - - Trøndsk - - - - - info:lc/vocabulary/languages/nob - Norwegian (Bokmål) - nob - - Bokmål - - - Dano-Norwegian - - - Riksmål - - - - info:lc/vocabulary/languages/nno - Norwegian (Nynorsk) - nno - - Landsmaal - - - Landsmål - - - Nynorsk - - - - info:lc/vocabulary/languages/nub - Nubian languages - nub - - Dilling - - Delen - - - Warkimbe - - - - Dongola-Kenuz - - Kenuz - - - - Mahas-Fiyadikka - - Fadicca - - - Fiadidja - - - Fiyadikka - - - Nobiin - - - - Midob - - - Old Nubian (to 1300) - - Nubian, Old - - - - - info:lc/vocabulary/languages/nym - Nyamwezi - nym - - - info:lc/vocabulary/languages/nya - Nyanja - nya - - Chinyanja - - - Nyassa - - - Chewa - - Cewa - - - - - info:lc/vocabulary/languages/nyn - Nyankole - nyn - - Lunyankole - - - Nkole - - - Runyankore - - - - info:lc/vocabulary/languages/nyo - Nyoro - nyo - - Lunyoro - - - Urunyoro - - - - info:lc/vocabulary/languages/nzi - Nzima - nzi - - Nsima - - - Nzema - - - Zema - - - - info:lc/vocabulary/languages/oci - Occitan (post-1500) - oci - - Langue d'oc (post-1500) - - - Provençal, Modern (post-1500) - - - Béarnais (post-1500) - - - Gascon (post-1500) - - - - info:lc/vocabulary/languages/lan - Occitan (post 1500) - lan - - - info:lc/vocabulary/languages/xal - Oirat - xal - - Kalmyk - - Calmuck - - - - Oyrat - - - - info:lc/vocabulary/languages/oji - Ojibwa - oji - - Anishinabe - - - Chippewa - - - Otchipwe - - - Salteaux - - - Saulteaux - - - Ottawa - - - - info:lc/vocabulary/languages/non - Old Norse - non - - Altnordish - - - Icelandic, Old (to 1550) - - - Norse, Old - - - Norse, Western - - - Norwegian, Old (to 1350) - - - Old Icelandic (to 1550) - - - Old Norwegian (to 1350) - - - Western Norse - - - - info:lc/vocabulary/languages/peo - Old Persian (ca. 600-400 B.C.) - peo - - Persian, Old (ca. 600-400 B.C.) - - - - info:lc/vocabulary/languages/ori - Oriya - ori - - Uriya - - - Adiwasi Oriya - - Adibasi Oriyā - - - Ādivāsi Oriyā - - - Desai - - - Kotia - - - Kotia Oriya - - - Kotiya - - - Tribal Oriya - - - - Bhatri - - Basturia - - - Bhatra - - - Bhattra - - - Bhattri - - - Bhottada - - - Bhottara - - - - Sambalpuri - - - - info:lc/vocabulary/languages/orm - Oromo - orm - - Afan - - - Galla - - - Gallinya - - - Boran - - - Orma - - Uardai - - - Warday - - - - - info:lc/vocabulary/languages/gal - Oromo - gal - - - info:lc/vocabulary/languages/osa - Osage - osa - - - info:lc/vocabulary/languages/oss - Ossetic - oss - - Āsī - - - Oseti - - - Osi - - - Ūsatī - - - - info:lc/vocabulary/languages/oto - Otomian languages - oto - - Chichimeca-Jonaz - - - Matlatzinca - - Pirinda - - - - Mazahua - - - Ocuiltec - - Atzinca - - - Maclatzinca - - - Tlahuica - - - - Otomi - - Hñahñu - - - Othomi - - - - Pame - - Chichimeca Pame - - - - - info:lc/vocabulary/languages/pal - Pahlavi - pal - - Huzvaresh - - - Middle Persian (Pahlavi) - - - Parsi - - - Pazend - - - Pehlevi - - - Persian, Middle (Pahlavi) - - - - info:lc/vocabulary/languages/pau - Palauan - pau - - Pelew - - - - info:lc/vocabulary/languages/pli - Pali - pli - - - info:lc/vocabulary/languages/pam - Pampanga - pam - - Kapampangan - - - - info:lc/vocabulary/languages/pag - Pangasinan - pag - - - info:lc/vocabulary/languages/pan - Panjabi - pan - - Eastern Panjabi - - - Punjabi - - - - info:lc/vocabulary/languages/pap - Papiamento - pap - - - info:lc/vocabulary/languages/paa - Papuan (Other) - paa - - Abau - - Green River - - - - Abulas - - Ambulas - - - Maprik - - - - Agarabe - - - Alamblak - - - Ama (Papua New Guinea) - - Sawiyanu - - - - Amele - - - Ampale - - Ampeeli - - - Safeyoka - - - - Aneme Wake - - Abia - - - Musa, Upper - - - Upper Musa - - - - Anggor - - Bibriari - - - Senagi - - - Watapor - - - - Ankave - - Angave - - - - Aomie - - Omie - - - - Asaro - - Dano - - - Upper Asaro - - - - Asmat - - - Au - - - Auyana - - - Awa (Eastern Highlands Province, Papua New Guinea) - - - Bahinemo - - Gahom - - - Wogu - - - - Baining - - Kakat - - - Makakat - - - Maqaqet - - - Qaqet - - - - Barai - - - Baruya - - - Bauzi - - Baudi - - - Bauri - - - Pauwi - - - - Benabena - - Bena (Papua New Guinea) - - - Bena-bena - - - - Berik - - - Biangai - - Baingai - - - - Bimin - - - Binumarien - - - Bisorio - - Gadio - - - Iniai - - - - Blagar - - Belagar - - - Tarang - - - - Bom - - Anjam - - - Bogadjim - - - Lalok - - - - Buin - - Rugara - - - Telei - - - - Bunak - - Buna' (Indonesia) - - - Bunake - - - Bunaq - - - - Burum (Papua New Guinea) - - Bulum - - - - Chuave - - Tjuave - - - - Daga - - Dimuga - - - Nawp - - - - Daribi - - Elu - - - Karimui - - - Makarub - - - Mikaru - - - - Dedua - - - Duna - - Yuna - - - - Eipo - - - Enga - - Tsaga - - - - Ese - - Managalasi - - - Managulasi - - - - Faiwol - - Fegolmin - - - - Fasu - - - Folopa - - - Fore - - - Gadsup - - - Gahuku - - - Galela - - - Gimi - - - Gogodala - - - Golin - - - Gope - - Era River - - - Kope - - - - Gresi - - Glesi - - - Gresik - - - Klesi - - - - Guhu-Samane - - Mid-Waria - - - - Gwahatike - - - Gwedena - - Umanakaina - - - - Halopa - - Botelkude - - - Nobonob - - - Nupanob - - - - Huli - - - Iatmul - - Big Sepik - - - - Inanwatan - - Suabo - - - - Inoke - - Yate (Papua New Guinea) - - - - Irumu - - - Iwam - - - Iyo (Papua New Guinea) - - Bure (Papua New Guinea) - - - Nabu - - - Naho - - - Nahu - - - Ndo (Papua New Guinea) - - - - Kalabra - - - Kalam - - Karam - - - - Kaluli - - - Kamano - - Kafe - - - - Kamasau - - - Kamtuk - - Kemtuik - - - - Kanite - - Kemiju Jate - - - - Kapauku - - Ekagi - - - - Kasua - - - Kâte - - - Kelon - - Kalong - - - Kelong - - - Klon - - - Kolon - - - - Ketengban - - Oktengban - - - - Kewa - - - Kobon - - - Komba - - - Komunku - - - Kongara - - - Korape - - Kwarafe - - - Okeina - - - - Kosena - - - Kovai - - Alngubin - - - Kobai - - - Kowai - - - Umboi - - - - Kunimaipa - - - Kwerba - - - Lambau - - - Lunambe - - - Mai Brat - - Mey Brat - - - - Manambu - - - Mape - - - Meax - - - Medlpa - - Hagen - - - Moglei - - - - Menya - - Menyama - - - Menye - - - - Mianmin - - - Migabac - - Migaba' - - - - Monumbo - - - Mountain Arapesh - - Arapesh, Mountain - - - Bukiyup - - - - Mountain Koiari - - Koiali, Mountain - - - - Mpur (Indonesia) - - Amberbaken - - - - Mugil - - Bargam - - - Saker - - - - Nabak - - Wain - - - - Nankina - - - Narak - - Gandja - - - Kandawo - - - Kol (Papua New Guinea) - - - - Nasioi - - - Nek - - - Nii - - Ek Nii - - - - Notu - - Ewage - - - - Oksapmin - - - Olo - - Orlei - - - - Ono - - - Orokaiva - - - Orokolo - - - Orya - - Oria - - - Uria - - - - Pay - - - Pinai-Hagahai - - - Purari - - Eurika - - - Evora - - - Iai (Papua New Guinea) - - - Iare - - - Kaimare - - - Kaura (Papua New Guinea) - - - Kipaia - - - Koriki - - - Maipua - - - Namau - - - - Rawa - - Karo-Rawa - - - - Rotokas - - - Saberi - - Isirawa - - - Okwasar - - - - Sahu - - - Samo (Western Province, Papua New Guinea) - - Supei - - - - Sawos - - Tshwosh - - - - Selepet - - - Sentani - - - Siane - - - Siroi - - Pasa - - - Suroi - - - - Siwai - - Motuna - - - - Sona (Papua New Guinea) - - Kanasi - - - - Suena - - Yarawe - - - Yema - - - - Sulka - - - Tabla - - Tanahmerah (Northeast Irian Jaya) - - - - Tairora - - - Tani - - Miami (Papua New Guinea) - - - Miani - - - Suaru - - - - Tauya - - Inafosa - - - - Telefol - - - Tepera - - - Ternate - - - Tewa (Papuan) - - Teiwa - - - - Tifal - - - Timbe - - - Toaripi - - Motumotu - - - - Tobelo - - - Urii - - - Usarufa - - Usurufa - - - Uturupa - - - - Waffa - - - Wantoat - - - Washkuk - - Kwoma - - - - Wasi - - - Were - - - West Makian - - Desite - - - Makian, West - - - Titinec - - - - Wiru - - - Woisika - - - Yabiyufa - - Jafijufa - - - - Yagaria - - Frigano Jate - - - Kami (Papua New Guinea) - - - - Yangoru - - - Yareba - - - Yau - - - Yessan-Mayo - - Mayo (New Guinea) - - - - Yongkom - - - Yopno - - Yupna - - - - Yui - - Salt-Yui - - - - - info:lc/vocabulary/languages/per - Persian - per - - Farsi - - - Dari - - Kabuli - - - Kabuli-Persian - - - Khorasani - - - - - info:lc/vocabulary/languages/phi - Philippine (Other) - phi - - Abaknon - - Capul - - - Inabaknon - - - Kapul - - - Sama Abaknon - - - - Agta - - Cagayan Agta, Central - - - Central Cagayan Agta - - - - Agutaynon - - - Aklanon - - - Alangan - - - Amganad Ifugao - - Ifugao, Amganad - - - - Atta - - Northern Cagayan Negrito - - - - Ayangan Ifugao - - Ifugao, Ayangan - - - - Bagobo - - - Balangao - - - Balangingì - - Baangingi' - - - Bangingi - - - Northern Sinama - - - Sama Bangingì - - - Sea Samal - - - Sinama, Northern - - - - Banton - - Bantuanon - - - - Batad Ifugao - - Ifugao, Batad - - - - Bilaan - - - Bolinao - - Binubolinao - - - - Bontoc - - Finontok - - - - Botolan Sambal - - Aeta Negrito - - - Sambal Botolan - - - Sambali Botolan - - - - Caluyanun - - - Central Bontoc - - Bontoc, Central - - - - Central Subanen - - Sindangan Subanun - - - Subanen, Central - - - Subanun, Sindangan - - - - Cuyunon - - Kuyonon - - - - Dumagat (Casiguran) - - Agta (Casiguran) - - - Casiguran Agta - - - Casiguran Dumagat - - - - Dumagat (Umirey) - - Agta (Umirey) - - - Dingalan Dumagat - - - Umirey Agta - - - Umirey Dumagat - - - - Eastern Bontoc - - Bontoc, Eastern - - - - Eastern Ifugao - - Ifugao, Eastern - - - - Gaddang - - - Ibaloi - - Benguet Igorot - - - Nabaloi - - - - Ibanag - - - Ifugao - - - Ilongot - - - Isinay - - Inmeas - - - - Isneg - - Apayao - - - - Itawis - - - Itbayat - - - Ivatan - - - Jama Mapun - - Cagayanon - - - Mapun - - - Pullon Mapun - - - Sama Mapun - - - - Ivatan - - Batan - - - Ibatan - - - - Kalamian - - Calamian - - - - Kalinga languages - - - Kankanay - - Cancanai - - - Lepanto-Igorot - - - - Kinaray-a - - Antiqueno - - - Binukidnon - - - Hamtiknon - - - Hinaraya - - - Karay-a - - - - Lower Tanudan Kalinga - - Kalinga, Lower Tanudan - - - Tanudan Kalinga, Lower - - - - Magindanao - - Moro - - - - Mamanwa - - - Mangyan - - Iraya - - - - Mansaka - - - Maranao - - Moro - - - - Masbateno - - Minasbate - - - - Mayoyao Ifugao - - Ifugao, Mayoyao - - - - Melebuganon - - Milebuganon - - - Molbog - - - - Northern Kankanay - - Bontoc, Western - - - Kankanay, Northern - - - Sagada-Igorot - - - Western Bontoc - - - - Palawano - - - Pangutaran Sama - - Sama Pangutaran - - - - Sama Sibutu - - Sibutu Sama - - - Southern Sama - - - - Sambali - - Zambal - - - - Southern Bontoc - - Barlig Bontoc - - - Bontoc, Southern - - - Kadaklan Barlig Bontoc - - - - Southern Subanen - - Lapuyan Subanen - - - Margosatubig Subanun - - - Subanen, Southern - - - - Subanun - - Subano - - - - Sulod - - Mundu (Philippines) - - - - Sulu - - Joloano - - - Moro - - - Sooloo - - - - Tagakaolo - - Kalagan, Tagakaolo - - - - Tagbanua - - Aborlan Tagbanwa - - - Apurahuano - - - - Tausug - - - Tboli - - Tagabili - - - Tiboli - - - - Tina Sambal - - - Tiruray - - Teduray - - - - Tuwali - - - Western Subanon - - Siocan Subanon - - - Subanon, Western - - - - Yakan - - - - info:lc/vocabulary/languages/phn - Phoenician - phn - - Punic - - - - info:lc/vocabulary/languages/pon - Pohnpeian - pon - - Ponape - - - Ponapean - - - - info:lc/vocabulary/languages/pol - Polish - pol - - - info:lc/vocabulary/languages/por - Portuguese - por - - - info:lc/vocabulary/languages/pra - Prakrit languages - pra - - Gandhari Prakrit - - Gandhari - - - - Magadhi Prakrit - - - Maharashtri - - - Śaurasēnī - - - - info:lc/vocabulary/languages/pro - Provençal (to 1500) - pro - - Occitan, Old (to 1500) - - - Old Occitan (to 1500) - - - Old Provençal (to 1500) - - - - info:lc/vocabulary/languages/pus - Pushto - pus - - Afghan - - - Pakhto - - - Pakkhto - - - Pashto - - - Pashtu - - - Pukhtu - - - Pukkhto - - - Pukshto - - - Pushtu - - - Wanetsi - - Vanechi - - - Waneci - - - Wanesi - - - Wenetsi - - - - - info:lc/vocabulary/languages/que - Quechua - que - - Inca - - - Kechua - - - Quichua - - - Runasimi - - - Huanca - - Wanka - - - - Ingano - - Inga - - - - - info:lc/vocabulary/languages/roh - Raeto-Romance - roh - - Rhaeto-Romance - - - Romansh - - - Rumansh - - - - info:lc/vocabulary/languages/raj - Rajasthani - raj - - Bagri - - Bagari - - - Bahgri - - - Baorias - - - - Gujuri - - Gojari - - - Gojri - - - Gujar - - - Gujari - - - Gujer - - - Gujjari - - - Gujri (Gujuri) - - - - Harauti - - - Jaipurī - - Dhundhari - - - - Lambadi - - Banjara - - - Labhani - - - Lamani - - - Lambani - - - - Malvi - - Malavi - - - Mallow - - - Malwi - - - Ujjaini (Malvi) - - - - Nimadi - - Nemadi - - - Nimari - - - - Sondwari - - Sondhavāṛī - - - Sondhwadi - - - Sondhwari - - - Soudhwari - - - - Wagdi - - Vāgaḍī - - - Vāgarī - - - Vagdi - - - Vaged - - - Vageri - - - Vagi - - - Vagri - - - Wagadi - - - Waghari - - - Wagholi - - - - - info:lc/vocabulary/languages/rap - Rapanui - rap - - - info:lc/vocabulary/languages/rar - Rarotongan - rar - - Cook Islands Maori - - - Maori, Cook Islands - - - Manihiki Rarotongan - - Rarotongan, Manihiki - - - - - info:lc/vocabulary/languages/roa - Romance (Other) - roa - - Anglo-Norman - - Anglo-French - - - Norman-French - - - - Cajun French - - Acadian (Louisiana) - - - French, Cajun - - - Louisiana Acadian - - - Louisiana French - - - - Franco-Venetian - - Franco-Italian - - - - Italian, Old (to 1300) - - Old Italian - - - - Ladin - - - Portuñol - - Bayano - - - Brasilero - - - Brasilero - - - Brazilero - - - Fronteiriço - - - Fronterizo - - - Portanhol - - - Portunhol - - - - Spanish, Old (to 1500) - - Old Spanish - - - - - info:lc/vocabulary/languages/rom - Romani - rom - - Gipsy - - - Gypsy - - - Romany - - - Rommany - - - Caló (Romani) - - - Kalderash - - Coppersmith - - - Kaldaraš - - - Kalderaš - - - Kelderaš - - - Kelderashícko - - - - Lovari - - - Nuri - - - Spoitori - - Spoitari - - - - - info:lc/vocabulary/languages/rum - Romanian - rum - - Rumanian - - - Boyash - - - Moldovan - - Moldavian - - - Moldovean - - - Moldovian - - - - - info:lc/vocabulary/languages/run - Rundi - run - - Kirundi - - - - info:lc/vocabulary/languages/rus - Russian - rus - - - info:lc/vocabulary/languages/sal - Salishan languages - sal - - Bella Coola - - - Colville - - - Comox - - Komuk - - - - Cowlitz - - - Kalispel - - Pend d'Oreille - - - - Lillooet - - - Ntlakyapamuk - - Netlakapamuk - - - Thompson - - - - Okanagan - - Okinagan - - - - Quinault - - - Salish - - - Sechelt - - Seshelt - - - - Shuswap - - - Squawmish - - Skwamish - - - - Stalo - - Halkomelem - - - - - info:lc/vocabulary/languages/sam - Samaritan Aramaic - sam - - - info:lc/vocabulary/languages/smi - Sami - smi - - Lapp - - - - info:lc/vocabulary/languages/lap - Sami - lap - - - info:lc/vocabulary/languages/smo - Samoan - smo - - - info:lc/vocabulary/languages/sao - Samoan - sao - - - info:lc/vocabulary/languages/sad - Sandawe - sad - - Kissandaui - - - Wassandaui - - - - info:lc/vocabulary/languages/sag - Sango (Ubangi Creole) - sag - - - info:lc/vocabulary/languages/san - Sanskrit - san - - Sanscrit - - - Buddhist Hybrid Sanskrit - - Hybrid Sanskrit, Buddhist - - - - Epigraphical Hybrid Sanskrit - - Hybrid Sanskrit, Epigraphical - - - - Vedic - - Indic, Old - - - Old Indic - - - Vedic Sanskrit - - - - - info:lc/vocabulary/languages/sat - Santali - sat - - Sonthal - - - - info:lc/vocabulary/languages/srd - Sardinian - srd - - - info:lc/vocabulary/languages/sas - Sasak - sas - - - info:lc/vocabulary/languages/sco - Scots - sco - - Lallans - - - Lowland Scots - - - Scots (English) - - - Scottish (Germanic) - - - - info:lc/vocabulary/languages/gla - Scottish Gaelic - gla - - Erse (Scottish Gaelic) - - - Gaelic (Scots) - - - Scots Gaelic - - - - info:lc/vocabulary/languages/gae - Scottish Gaelix - gae - - - info:lc/vocabulary/languages/sel - Selkup - sel - - Ostiak Samoyed - - - - info:lc/vocabulary/languages/sem - Semitic (Other) - sem - - Ammonite - - - Canaanite - - - Eblaite - - Paleocanaanite - - - - Gurage languages - - - Harari - - Adari - - - Ararge - - - - Inor - - Ennemor - - - - Jibbali - - - Mahri - - Mehri - - - - Mandean - - - Sabaean - - - South Arabic - - Arabic, South - - - - Wolane - - Olane - - - Walane - - - Welene - - - Weleni - - - - Zay - - Gelilla - - - Lak'i (Ethiopia) - - - Laqi - - - Zai - - - Zway - - - - - info:lc/vocabulary/languages/srp - Serbian - srp - - - info:lc/vocabulary/languages/scc - Serbian - scc - - - info:lc/vocabulary/languages/srr - Serer - srr - - - info:lc/vocabulary/languages/shn - Shan - shn - - - info:lc/vocabulary/languages/sna - Shona - sna - - China (Africa) - - - Mashona - - - Karanga - - - Zezuru - - Central Shona - - - - - info:lc/vocabulary/languages/sho - Shona - sho - - - info:lc/vocabulary/languages/iii - Sichuan Yi - iii - - Yi, Sichuan - - - - info:lc/vocabulary/languages/scn - Sicilian Italian - scn - - Italian, Sicilian - - - - info:lc/vocabulary/languages/sid - Sidamo - sid - - - info:lc/vocabulary/languages/sgn - Sign languages - sgn - - American Sign Language - - Ameslan - - - - Australasian Signed English - - - Austrian Sign Language - - ÖGS (Sign language) - - - Österreichische Gebärdensprache - - - - British Sign Language - - - Czech Sign Language - - Český znakový jazyk - - - - Danish Sign Language - - DSL (Danish Sign Language) - - - - French Belgian Sign Language - - Belgian French Sign Language - - - Langue des signes Belge Francophone - - - Langue des signes française Belgique - - - LSFB (Sign language) - - - - Icelandic Sign Language - - ISL (Icelandic Sign Language) - - - - Jordanian Sign Language - - JSL (Sign Language) - - - Lughat al-Ishāra al-Urdunia - - - - Mauritian Sign Language - - - Quebec Sign Language - - Langue des signes québécoise - - - - - info:lc/vocabulary/languages/bla - Siksika - bla - - Blackfoot - - - - info:lc/vocabulary/languages/snd - Sindhi - snd - - Kachchhi - - Kacchī - - - Kutchi - - - - - info:lc/vocabulary/languages/sin - Sinhalese - sin - - Cingalese - - - Singhala - - - Singhalese - - - Sinhala - - - - info:lc/vocabulary/languages/snh - Sinhalese - snh - - - info:lc/vocabulary/languages/sit - Sino-Tibetan (Other) - sit - - Abor - - Adi - - - Miri - - - Miśing - - - - Achang - - A-ch‘ang - - - Atsang - - - - Angami - - - Ao - - Chungli - - - Hatigorria - - - Mongsen - - - Zungi - - - Zwingi - - - - Apatani - - Aka - - - Apa Tanang - - - Hruso - - - - Arakanese - - Maghi - - - Rakhaing - - - - Bai (China) - - Min-chia - - - Pai (China) - - - - Balti - - Baltistani - - - Bhotia of Baltistan - - - Sbalti - - - - Bantawa - - Bontawa - - - Kirāta Rāī - - - - Baram - - - Belhariya - - Athpagari - - - Athpahariya - - - Athpare (Belhariya) - - - Athpariya (Belhariya) - - - Belhare - - - Belhāreor - - - - Bodo - - Bara (India and Nepal) - - - Boro (India and Nepal) - - - Kachari, Plains - - - Mech - - - Plains Kachari - - - - Chamling - - Camling - - - - Chang - - Mojung - - - - Chepang - - - Chinbon - - - Chino - - Jino - - - - Chothe Naga - - Chawte - - - Chothe - - - Chowte - - - - Dafla - - Nisi - - - - Dänjong-kä - - Bhotic of Sikkim - - - Dé-jong ké - - - Sikkim Bhotia - - - Sikkimese - - - - Deori - - Chutia - - - Chutiya - - - Dari (India) - - - Deori Chutiya - - - Deuri - - - Dewri - - - Drori - - - - Dhimal - - - Digaro - - Taraon - - - Taying - - - - Dimasa - - Cachari - - - Hill Kachari - - - Kachari - - - - Dungan - - - Gallong - - - Garo - - - Gurung - - - Haka Chin - - Baungshè - - - Chin, Haka - - - Lai - - - - Jero - - - Kabui - - - Kaw - - Akha - - - Ekaw - - - - Khaling - - - Khiamniungan - - - Kok Borok - - Mrung - - - Tipura - - - Tripuri - - - - Konyak - - Kanyak - - - - Kuki - - - Kusunda - - - Ladakhi - - - Lahu - - Muhso - - - - Laizo (Burma) - - - Lepcha - - Rong - - - - Limbu - - - Lisu - - Yawyin - - - - Lopa - - - Magar - - - Miju - - - Mikir - - Karbi - - - - Mishmi - - - Moklum - - - Monpa - - - Mün Chin - - Chinbok - - - - Naga languages - - - Naxi - - Moso - - - - Nocte - - Borduaria - - - Mohongia - - - Paniduaria - - - - Padam - - - Paite - - - Pānkhū - - Paang (Pānkhū) - - - Pāṃkhoẏā - - - Pang Khua - - - Pang (Pānkhū) - - - Pangkhu - - - Pangkhua - - - Pankho - - - Panko - - - Pankua - - - - Rabha - - - Rawang - - - Rongmei - - - Sampang - - Sāmpāṅ Rāī - - - Sampang Rai - - - Sampange Rai - - - Sangpang Gîn - - - Sangpang Gun - - - Sangpang Kha - - - Sangpang - - - - Singpho - - - Sunwar - - - Tamang - - Murmi - - - - Tamu - - - Tangkhul - - Thankhul - - - - Tangsa - - Tengsa - - - - Tangut - - Hsi-hsia - - - Si-hia - - - Xixia - - - - Tenyidie - - - Thādo - - - Thakali - - - Thami - - - Thulung - - - Tiddim Chin - - Chin, Tiddim - - - Kamhau - - - Sokte - - - - Tshangla - - Canglo Monba - - - Cangluo Menba - - - Cangluo Monba - - - Central Monpa - - - Dirang - - - Dungsam - - - Memba - - - Menba (Tshangla) - - - Monba - - - Monpa (Tshangla) - - - Motuo - - - Motuo Menba - - - Sangla - - - Sarchapkkha - - - Schachop - - - Shachobiikha - - - Shachopkha - - - Sharchagpakha - - - Sharchhop-kha - - - Sharchopkha - - - Tashigang - - - Tsangla - - - Tsangla Monba - - - Tsanglo (Tshangla) - - - Tshalingpa (Tshangla) - - - - Vaiphei - - Bhaipei - - - Veiphei - - - - Wambule - - - Wayu - - Hayu - - - Vayu - - - Wayo - - - - Yao (Southeast Asia) - - Mien - - - - Yi - - Lolo (China) - - - Nosu - - - - Zang Zung - - Zhang-Zhung - - - - - info:lc/vocabulary/languages/sio - Siouan (Other) - sio - - Biloxi - - - Chiwere - - - Crow - - - Dhegiha - - Cegiha - - - - Hidatsa - - Grosventres (Hidatsa) - - - - Mandan - - - Ofo - - Ofogoula - - - - Omaha - - - Oto - - Watoto - - - - Tutelo - - - Winnebago - - Hocak - - - - Woccon - - - - info:lc/vocabulary/languages/sms - Skolt Sami - sms - - Lapp, Russian - - - Russian Lapp - - - Sami, Skolt - - - - info:lc/vocabulary/languages/den - Slavey - den - - Dené (Slavey) - - - Dené Tha - - - Ethchaottine - - - Mackenzian - - - North Slavey - - - Slave - - - Slavi - - - South Slavey - - - Kawchottine - - Hare - - - Peaux-de-Lièvre - - - - - info:lc/vocabulary/languages/sla - Slavic (Other) - sla - - Belarusian, Old (to 1700) - - Old Belarusian - - - - Čakavian - - - Carpatho-Rusyn - - Rusyn - - - - Czech, Old (to 1500) - - Old Czech - - - - Polabian - - - Russian, Old (to 1300) - - East Slavic - - - Old East Slavic - - - Old Russian - - - - Ukrainian, Old (ca. 1300-1700) - - Old Ukrainian - - - - - info:lc/vocabulary/languages/slo - Slovak - slo - - - info:lc/vocabulary/languages/slv - Slovenian - slv - - Windic (Slovenian) - - - - info:lc/vocabulary/languages/sog - Sogdian - sog - - - info:lc/vocabulary/languages/som - Somali - som - - - info:lc/vocabulary/languages/son - Songhai - son - - Dendi - - Dandawa - - - - Zarma - - Djerma - - - Dyerma - - - Zerma - - - - - info:lc/vocabulary/languages/snk - Soninke - snk - - Sarakole - - - - info:lc/vocabulary/languages/wen - Sorbian (Other) - wen - - Wendic (Other) - - - - info:lc/vocabulary/languages/sot - Sotho - sot - - Sesuto - - - Southern Sotho - - - Suto - - - - info:lc/vocabulary/languages/sso - Sotho - sso - - - info:lc/vocabulary/languages/sai - South American Indian (Other) - sai - - Achagua - - - Achuar - - Achuale - - - Achuara Jivaro - - - Jivaro, Achuara - - - - Aguaruna - - - Alacaluf - - Kawesqar - - - - Amahuaca - - Sayaco - - - - Amuesha - - Lorenzo - - - - Andoque - - - Apalai - - - Apinagé - - Apinajé - - - Apinayé - - - - Arabela - - Chiripuno - - - - Araona - - - Arecuna - - - Arekena - - Guarequena - - - Uarequena - - - Warekena - - - - Bakairi - - Bacairi - - - - Baniwa - - - Barasana del Norte - - Bara (Colombia) - - - Northern Barasano - - - - Barasana del Sur - - Bara (Colombia) - - - Southern Barasano - - - - Bora - - Boro (South America) - - - - Bororo (Brazil) - - - Cacua - - Macú de cubeo - - - Macú de desano - - - Macú de guanano - - - - Caduveo - - Kadiweu - - - - Caingua - - Cayua - - - Kaingua - - - Kaiwa (Brazil) - - - - Callahuaya - - Callawalla - - - Callawaya - - - Kallawaya - - - Qollahuaya - - - - Campa - - Ande - - - Asheninca - - - - Camsa - - Coche - - - Kamentzá - - - Kamsa - - - Sebondoy - - - Sibondoy - - - - Canamari (Tucanoan) - - Kanamari (Tucanoan) - - - - Cañari - - - Candoshi - - Kandoshi - - - Morato - - - Murato - - - Shapra - - - - Canella - - Kanela - - - - Capanahua - - - Caquinte - - - Caraja - - Karaja - - - - Carapana (Tucanoan) - - Karapana (Tucanoan) - - - Möchda (Tucanoan) - - - - Cashibo - - Comabo - - - - Cashinawa - - Kashinawa - - - Sheminawa - - - - Catio - - Embena, Northern - - - Epera, Northern - - - Katio - - - Northern Epera - - - - Cauqui - - Jacaru - - - Jaqaru - - - - Cavineño - - - Cayapa - - - Cayapo - - Kayapo - - - - Chacobo - - - Chamacoco - - - Chamí - - Embera Chamí - - - - Chamicuro - - - Chana (Uruguay) - - Čaná - - - Layuna - - - Tšaná - - - Tsaná-Bequá - - - Tschaná - - - Yaro - - - - Chayahuita - - Chawi - - - - Chimane - - Nawazi-Moñtji - - - Tsimane - - - - Chipaya - - Puquina (Chipaya) - - - - Chiquito - - - Cholon - - - Chontaquiro - - Chuntaquiro - - - Piro (Arawakan) - - - Simirenchi - - - - Choroti - - Yofuaha - - - - Chulupí - - Ashluslay - - - Nivacle - - - - Cocama - - Kokama - - - Ucayale - - - - Cofán - - A'i - - - Kofán - - - - Colorado - - Tsacela - - - Yumba - - - - Coreguaje - - Caqueta - - - - Cuaiquer - - Coaiker - - - Koaiker - - - - Cubeo - - - Cuiba - - Cuiva - - - - Culina - - - Cumana - - - Cuna - - Kuna - - - - Damana - - Arosario - - - Guamaca - - - Malayo - - - Maracasero - - - Sanja - - - Wiwa - - - - Desana - - Wira - - - - Emerillon - - Mereo - - - Teco (Tupi) - - - - Epena Saija - - Saija - - - Saixa - - - - Ese Ejja - - Chama (Tacanan) - - - Guacanahua - - - Guarayo (Tacanan) - - - Huarayo (Tacanan) - - - Tiatinagua - - - - Fulnio - - Carnijo - - - Iate - - - Yahthe - - - Yate (Brazil) - - - - Gavião (Pará, Brazil) - - - Goajiro - - Guajira - - - Wayunaiki - - - Wayuu - - - - Guahibo - - Wa-jibi - - - - Guanano - - Anano - - - Kotiria - - - Uanana - - - Wanana - - - - Guarayo - - - Guayabero - - Jiw - - - - Guayaki - - Ache - - - Guaiaqui - - - Guayaki-Ache - - - Guoyagui - - - - Hixkaryana - - - Huambisa - - Ssimaku - - - Wambisa - - - - Huao - - Waorani - - - - Ica - - Arhuaco - - - Aruaco - - - Bintukua - - - Ika (Chibchan) - - - Ike - - - - Ipurina - - Apurina - - - Hypurina - - - Jupurina - - - Kangütü - - - Kankiti - - - - Iquito - - - Itonama - - Machoto - - - - Jaminaua - - Nishinahua - - - Yaminahua - - - - Jaruára - - Jarawara - - - - Jupda - - Hupde Maku - - - Macú de tucano - - - - Kagaba - - Cagaba - - - - Kaingang - - Caingang - - - Taven - - - - Kariri - - Cariri - - - Kiriri - - - - Karitiana - - Caritiana - - - - Lengua - - - Lule - - - Maca - - Maka (Paraguay) - - - - Machiguenga - - - Macuna - - Buhágana - - - - Macusi - - Makushi - - - - Mamaindê - - Tamainde - - - - Masacali - - Machacali - - - Mashakali - - - Maxakali - - - - Mascoi - - Emok - - - Machicui - - - Toba-Emok - - - - Mashco - - Amarakaeri - - - Harakmbet - - - - Mataco - - - Maue - - Andira - - - Arapium - - - Maragua - - - Satere - - - - Mayoruna - - Matses - - - - Moguex - - Cuambia - - - Guambiano - - - - Mojo - - Ignaciano - - - Moxo - - - - Moro (South America) - - Ayoré - - - Ayoweo - - - - Moseten - - - Motilon - - Bari (Venezuela) - - - Yupe - - - - Muinane - - - Munduruku - - - Münkü - - - Murui - - Huitoto, Murui - - - - Nambicuara - - Nhambicuara - - - - Nomatsiguenga - - Pangoa - - - - Ocaina - - - Orejón - - Coto (Tucanoan) - - - Mai Huna - - - Payagua - - - - Paez - - - Palicur - - - Pamoa - - Juna - - - Oa - - - Tatutapuyo - - - - Panare - - - Panobo - - - Paraujano - - Añún - - - - Paressi - - Ariti - - - - Patamona - - Paramuni - - - - Pemón - - - Piapoco - - - Piaroa - - - Pilaga - - - Piratapuyo - - - Puinave - - - Puquina - - - Purupuru - - Paumari - - - - Resigero - - - Rikbaktsa - - Aripaktsa - - - Canoeiro - - - - Saliva - - Saliba (Colombia and Venezuela) - - - - Sanapaná - - Lanapsua - - - Quiativis - - - Quilyacmoc - - - Saapa - - - Sanam - - - - Secoya - - - Sharanahua - - Chandinahua - - - Marinahua - - - - Shipibo-Conibo - - Conibo - - - Sipibo - - - - Shuar - - Jibaro, Shuar - - - Jivaro, Shuar - - - Xivaro, Shuar - - - - Sicuane - - Sikuani - - - - Sioni - - Siona - - - - Siriano - - Chiranga - - - - Tacana (Bolivia) - - - Tanimuca-Retuama - - Letuana - - - Retuara - - - Ufaina - - - Yahuna - - - - Tapirapé - - - Tariana - - - Tenetehara - - Asurini - - - Guajajara - - - Tembe - - - - Tenharim - - - Toba (Indian) - - - Trio - - Tiriyo - - - - Tucano - - Dagsexe - - - Dase - - - Tukano - - - - Tucuna - - Ticuna - - - - Tunebo - - Pedrazá - - - Tame - - - - Tuyuca - - Dochkafuara - - - Tejuka - - - - Urarina - - Itucale - - - Shimacu - - - Simacu - - - - Uru - - Puquina (Uru) - - - - Urubu - - - Vilela - - - Waiwai - - Uaiuai - - - - Warao - - Guarauno - - - Warrau - - - - Waunana - - Chanco - - - Chocama - - - Noanama - - - - Wayampi - - Guayapi - - - Oiampi - - - Waiapi - - - Wayapi - - - - Witoto - - Huitoto - - - - Xavante - - Acuan-Shavante - - - Akwẽ-Shavante - - - Chavante Acuan - - - Oti - - - Shavante Akwe - - - - Yagua - - Yegua - - - - Yahgan - - Jagane - - - - Yanomamo - - - Yaruro - - Hapotein - - - Llaruro - - - Pumé - - - Yuapin - - - - Yecuana - - Maquiritare - - - - Yucuna - - Matapi - - - - Yunca - - Chimu - - - Mochica - - - - Yupa - - - Yuruti - - - Zoró - - - - info:lc/vocabulary/languages/sma - Southern Sami - sma - - Sami, Southern - - - - info:lc/vocabulary/languages/spa - Spanish - spa - - Castilian - - - Chicano - - - Cheso - - - - info:lc/vocabulary/languages/srn - Sranan - srn - - Taki-Taki - - - - info:lc/vocabulary/languages/suk - Sukuma - suk - - Gwe (Tanzania) - - - Kesukuma - - - Kisukuma - - - Suku (Tanzania) - - - - info:lc/vocabulary/languages/sux - Sumerian - sux - - - info:lc/vocabulary/languages/sun - Sundanese - sun - - - info:lc/vocabulary/languages/sus - Susu - sus - - Soso - - - - info:lc/vocabulary/languages/swa - Swahili - swa - - Kae - - - Kingwana - - - - info:lc/vocabulary/languages/ssw - Swazi - ssw - - Siswati - - - - info:lc/vocabulary/languages/swz - Swazi - swz - - - info:lc/vocabulary/languages/swe - Swedish - swe - - - info:lc/vocabulary/languages/gsw - Swiss German - gsw - - German, Swiss - - - - info:lc/vocabulary/languages/syc - Syriac - syc - - Classifical Syriac - - - - info:lc/vocabulary/languages/syr - Syriac, Modern - syr - - Neo-Syriac - - - - info:lc/vocabulary/languages/tgl - Tagalog - tgl - - Filipino (Tagalog) - - - Pilipino - - - - info:lc/vocabulary/languages/tag - Tagalog - tag - - - info:lc/vocabulary/languages/tah - Tahitian - tah - - - info:lc/vocabulary/languages/tai - Tai (Other) - tai - - Ahom - - - Be - - Ongbe - - - - Black Tai - - Tai, Black - - - Tai Dam - - - Tai Noir - - - - Bouyei - - Buyi (China and Vietnam) - - - Dioi (China and Vietnam) - - - Giáy - - - Nhang - - - Puyi - - - Yay - - - - Cao Lan - - - Dong (China) - - Gam (China) - - - Kam (China) - - - Tong (China) - - - T‘ung - - - - Khün - - Hkun - - - Tai Khün - - - - - - Lue - - - Pai-i - - - Tai Lü - - - - Lungming - - - Northern Thai - - Kammyang - - - Lanna Thai - - - Lao, Western - - - Myang - - - Phayap - - - Thai, Northern - - - Western Lao - - - Yuan - - - - Southern Thai - - Pak Thai - - - Thai, Southern - - - - Tai Nüa - - Dai Na - - - Dehong Dai - - - Shan, Yunnanese - - - Tay Nüa - - - Te-hung Tai - - - Yunnanese Shan - - - - Tay-Nung - - - Tho - - - White Tai - - Tai, White - - - - Ya - - Tai Chung - - - Tai Ya - - - - - info:lc/vocabulary/languages/tgk - Tajik - tgk - - Tadjik - - - Tadzhik - - - - info:lc/vocabulary/languages/taj - Tajik - taj - - - info:lc/vocabulary/languages/tmh - Tamashek - tmh - - Amazigh - - - Kidal - - - Kidal Tamasheq - - - Tăhăggart - - - Tahaggart Tamahaq - - - Tahoua - - - Tahoua Tamajeq - - - Tajag - - - Tamachek - - - Tamahaq - - - Tamajaq - - - Tamajeq - - - Tamashekin - - - Tamasheq - - - Tamashiqt - - - Tawallammat Tamajaq - - - Tawarek - - - Tayart Tamajeq - - - Temajaq - - - Tewellemet - - - Timbuktu - - - Tomacheck - - - Tomachek - - - Touareg - - - Touarègue - - - Tourage - - - Toureg - - - Tuareg - - - - info:lc/vocabulary/languages/tam - Tamil - tam - - - info:lc/vocabulary/languages/tat - Tatar - tat - - - info:lc/vocabulary/languages/tar - Tatar - tar - - - info:lc/vocabulary/languages/tel - Telugu - tel - - Andhra - - - Gentoo - - - Telegu - - - - info:lc/vocabulary/languages/tem - Temne - tem - - Timne - - - - info:lc/vocabulary/languages/ter - Terena - ter - - - info:lc/vocabulary/languages/tet - Tetum - tet - - Belu - - - - info:lc/vocabulary/languages/tha - Thai - tha - - Siamese - - - - info:lc/vocabulary/languages/tib - Tibetan - tib - - Bhotanta - - - Helambu Sherpa - - Hyolmo - - - Yohlmo - - - - Kagate - - - Khams Tibetan - - Kam - - - Kang (Tibetan) - - - Kham (China) - - - Khamba (Tibetan) - - - Khampa - - - Khams - - - Khams Bhotia - - - Khams-Yal - - - - Sherpa - - Sharpa - - - - - info:lc/vocabulary/languages/tig - Tigré - tig - - - info:lc/vocabulary/languages/tir - Tigrinya - tir - - Tigriña - - - Tña - - - - info:lc/vocabulary/languages/tiv - Tiv - tiv - - - info:lc/vocabulary/languages/tli - Tlingit - tli - - Koluschan - - - Tongass - - - - info:lc/vocabulary/languages/tpi - Tok Pisin - tpi - - Neo-Melanesian - - - Pisin - - - - info:lc/vocabulary/languages/tkl - Tokelauan - tkl - - - info:lc/vocabulary/languages/tog - Tonga (Nyasa) - tog - - - info:lc/vocabulary/languages/ton - Tongan - ton - - Tonga (Tonga Islands) - - - - info:lc/vocabulary/languages/tru - Truk - tru - - - info:lc/vocabulary/languages/tsi - Tsimshian - tsi - - Zimshīan - - - - info:lc/vocabulary/languages/tso - Tsonga - tso - - Changana - - - Gwamba - - - Shangaan - - - Thonga - - - Tonga (Tsonga) - - - Xitsonga - - - - info:lc/vocabulary/languages/tsn - Tswana - tsn - - Bechuana - - - Chuana - - - Coana - - - Cuana - - - Cwana - - - Sechuana - - - Setswana - - - - info:lc/vocabulary/languages/tsw - Tswana - tsw - - - info:lc/vocabulary/languages/tum - Tumbuka - tum - - Tamboka - - - - info:lc/vocabulary/languages/tup - Tupi languages - tup - - Parintintin - - - Tupi - - Ñeengatú - - - - - info:lc/vocabulary/languages/tur - Turkish - tur - - - info:lc/vocabulary/languages/ota - Turkish, Ottoman - ota - - Osmanli - - - Ottoman Turkish - - - - info:lc/vocabulary/languages/tuk - Turkmen - tuk - - Turkoman - - - - info:lc/vocabulary/languages/tvl - Tuvaluan - tvl - - Ellicean - - - - info:lc/vocabulary/languages/tyv - Tuvinian - tyv - - Soyot - - - Tannu-Tuva - - - Tuba - - - Uriankhai - - - - info:lc/vocabulary/languages/twi - Twi - twi - - Akuapem - - - Ashanti - - - Chwee - - - Odschi - - - Tshi - - - - info:lc/vocabulary/languages/udm - Udmurt - udm - - Votiak - - - Votyak - - - - info:lc/vocabulary/languages/uga - Ugaritic - uga - - - info:lc/vocabulary/languages/uig - Uighur - uig - - Eastern Turki - - - Kashgar-Yarkend - - - Turki, Eastern - - - Uigur - - - Uyghur - - - Wighor - - - Yarkend - - - - info:lc/vocabulary/languages/ukr - Ukrainian - ukr - - - info:lc/vocabulary/languages/umb - Umbundu - umb - - Benguela - - - Mbundu (Benguela Province, Angola) - - - Ovimbundu - - - Quimbundo (Benguela Province, Angola) - - - South Mbundu - - - - info:lc/vocabulary/languages/und - Undetermined - und - - - info:lc/vocabulary/languages/hsb - Upper Sorbian - hsb - - High Sorbian - - - Sorbian, Upper - - - - info:lc/vocabulary/languages/urd - Urdu - urd - - Bihari (Urdu) - - - Gujri (Urdu) - - - Gurjari - - - Islami - - - Moorish (India) - - - Undri - - - Urudu - - - Dakhini - - Dakani - - - Dakhani - - - Dakhini Hindi - - - Dakhini Hindustani - - - Dakhini Urdu - - - Dakhni - - - Dakini - - - Dakkani - - - Dakkhani - - - Deccan - - - Dehlavi - - - Gujari (Dakhini) - - - Hindavi - - - - - info:lc/vocabulary/languages/uzb - Uzbek - uzb - - - info:lc/vocabulary/languages/vai - Vai - vai - - Vei - - - - info:lc/vocabulary/languages/ven - Venda - ven - - Tshivenda - - - Wenda - - - - info:lc/vocabulary/languages/vie - Vietnamese - vie - - Annamese - - - - info:lc/vocabulary/languages/vol - Volapük - vol - - - info:lc/vocabulary/languages/vot - Votic - vot - - Vatjan - - - Vote - - - Votian - - - Votish - - - - info:lc/vocabulary/languages/wak - Wakashan languages - wak - - Bella Bella - - - Haisla - - - Heiltsuk - - Haeltzuk - - - - Kwakiutl - - - Nitinat - - - Nootka - - Aht - - - Noutka - - - Nutka - - - Nuuchahnulth - - - - - info:lc/vocabulary/languages/wln - Walloon - wln - - - info:lc/vocabulary/languages/war - Waray - war - - Leytean - - - Samar-Leyte - - - Samaron - - - - info:lc/vocabulary/languages/was - Washoe - was - - Washo - - - Washoan - - - - info:lc/vocabulary/languages/wel - Welsh - wel - - Cymric - - - - info:lc/vocabulary/languages/him - Western Pahari languages - him - - Himachali - - - Pahadi - - - Pahari, Western - - - Bhadrawahi - - Baderwali - - - Badrohi - - - Bahi - - - Bhadarwahi - - - Bhaderbhai Jamu - - - Bhaderwali Pahari - - - Bhadrava - - - Bhadravāhī - - - Bhadri - - - - Bhalesi - - - Bilaspuri - - Bilāsapurī - - - Bilaspuri Pahari - - - Kahalurī - - - Khalūrī - - - Kehloori - - - Kehloori Pahari - - - Kehluri - - - Pacchmi - - - - Chambeali - - Cameali - - - Chamaya - - - Chambiali - - - Chambiyali - - - Chamiyali - - - Chamiyali Pahari - - - Chamya - - - - Gaddi - - Bharmauri - - - Bharmauri Bhadi - - - Bharmouri - - - Brahmauri - - - Gaddhi - - - Gaddyalali - - - Gaddyali - - - Gadhi - - - Gadhiali - - - Gadi - - - Gadiali - - - Gadiyali - - - Pahari Bharmauri - - - Panchi - - - Panchi Brahmauri Rajput - - - - Jaunsari - - Gaunsari - - - Jansauri - - - Jaunsauri - - - Pahari (Jaunsari) - - - - Kullu Pahari - - Kauli - - - Kullui - - - Kulu - - - Kulu Boli - - - Kulu Pahari - - - Kuluhi - - - Kului - - - Kulvi - - - Kulwali - - - Pahari Kullu - - - Pahari (Kullu Pahari) - - - Phari Kulu - - - - Mandeali - - Himachali (Mandeali) - - - Mandi (Mandeali) - - - Mandiali - - - Pahari Mandiyali - - - - Sirmauri - - Himachali (Sirmauri) - - - Pahari (Sirmauri) - - - Sirmouri - - - Sirmuri - - - - - info:lc/vocabulary/languages/wal - Wolayta - wal - - Ometo - - - Uallamo - - - Walamo - - - - info:lc/vocabulary/languages/wol - Wolof - wol - - Jaloof - - - Jolof - - - Ouolof - - - Volof - - - Yolof - - - Lebou - - - - info:lc/vocabulary/languages/xho - Xhosa - xho - - isiXhosa - - - Kafir - - - Xosa - - - - info:lc/vocabulary/languages/sah - Yakut - sah - - Jakut - - - Sakha - - - - info:lc/vocabulary/languages/yao - Yao (Africa) - yao - - Adjaua - - - Ajawa - - - Ayo - - - Chi-yao - - - Ciyao - - - Djao - - - Hiao - - - Wayao - - - - info:lc/vocabulary/languages/yap - Yapese - yap - - - info:lc/vocabulary/languages/yid - Yiddish - yid - - German Hebrew - - - Jewish - - - Judeo-German - - - - info:lc/vocabulary/languages/yor - Yoruba - yor - - Aku - - - Eyo - - - Nago - - - Yariba - - - - info:lc/vocabulary/languages/ypk - Yupik languages - ypk - - Eskimo languages, Western - - - Western Eskimo languages - - - Central Yupik - - Eskimo, West Alaska - - - West Alaska Eskimo - - - - Cup´ig - - - Pacific Gulf Yupik - - Aleut (Eskimo) - - - Eskimo, South Alaska - - - Sugpiak Eskimo - - - Suk (Eskimo) - - - - Sirinek - - - Yuit - - Asiatic Eskimo - - - Eskimo, Asiatic - - - Saint Lawrence Island Yupik - - - Siberian Yupik - - - - - info:lc/vocabulary/languages/znd - Zande languages - znd - - Nzakara - - Sakara - - - - Zande - - Azande - - - - - info:lc/vocabulary/languages/zap - Zapotec - zap - - - info:lc/vocabulary/languages/zza - Zaza - zza - - Dimili - - - Dimli - - - Kirdki - - - Kirmanjki - - - Zazaki - - - - info:lc/vocabulary/languages/zen - Zenaga - zen - - Senhadja - - - - info:lc/vocabulary/languages/zha - Zhuang - zha - - Chuang - - - - info:lc/vocabulary/languages/zul - Zulu - zul - - - info:lc/vocabulary/languages/zun - Zuni - zun - - - diff --git a/form_elements/xml/relators.rdf b/form_elements/xml/relators.rdf deleted file mode 100644 index 66df3d04..00000000 --- a/form_elements/xml/relators.rdf +++ /dev/null @@ -1,4297 +0,0 @@ - - - - - MARC Code List for Relators - - <div class="relatorsAbout" title="About the Relator Codes:" datatype="rdf:XMLLiteral" property="rdfs:comment">Relator terms and their associated codes designate the relationship between a name and a bibliographic resource. The relator codes are three-character lowercase alphabetic strings that serve as identifiers. Either the term or the code may be used as controlled values.</div> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Actor - act - Use for a person or organization who - principally exhibits acting skills in a musical or - dramatic presentation or entertainment. - - stable - - - - - - - Adapter - adp - Use for a person or organization who 1) - reworks a musical composition, usually for a - different medium, or 2) rewrites novels or stories - for motion pictures or other audiovisual - medium. - - stable - - - - - - - Analyst - anl - Use for a person or organization that - reviews, examines and interprets data or information - in a specific area. - - stable - - - - - - Animator - anm - Use for a person or organization who draws - the two-dimensional figures, manipulates the three - dimensional objects and/or also programs the - computer to move objects and images for the purpose - of animated film processing. Animation cameras, - stands, celluloid screens, transparencies and inks - are some of the tools of the animator. - - stable - - - - - - - Annotator - ann - Use for a person who writes manuscript - annotations on a printed item. - - stable - - - - - - - Applicant - app - Use for a person or organization - responsible for the submission of an application or - who is named as eligible for the results of the - processing of the application (e.g., bestowing of - rights, reward, title, position). - - stable - - - - - - Architect - arc - Use for a person or organization who - designs structures or oversees their - construction. - - stable - - - - - - - Arranger - arr - Use for a person or organization who - transcribes a musical composition, usually for a - different medium from that of the original; in an - arrangement the musical substance remains - essentially unchanged. - - stable - - - - - - - Art copyist - acp - Use for a person (e.g., a painter or - sculptor) who makes copies of works of visual - art. - - stable - - - - - - Artist - art - Use for a person (e.g., a painter) or - organization who conceives, and perhaps also - implements, an original graphic design or work of - art, if specific codes (e.g., [egr], [etr]) are not - desired. For book illustrators, prefer Illustrator - [ill]. - - stable - Graphic technician - Relator term "Graphic technician" (coded [grt]) used before March 1988 only. - - - - - - - Artistic director - ard - Use for a person responsible for - controlling the development of the artistic style of - an entire production, including the choice of works - to be presented and selection of senior production - staff. - - stable - - - - - - Assignee - asg - Use for a person or organization to whom a - license for printing or publishing has been - transferred. - - stable - - - - - - Associated name - asn - Use for a person or organization - associated with or found in an item or collection, - which cannot be determined to be that of a Former - owner [fmo] or other designated relator indicative - of provenance. - - stable - - - - - - Attributed name - att - Use for an author, artist, etc., relating - him/her to a work for which there is or once was - substantial authority for designating that person as - author, creator, etc. of the work. - - stable - Supposed name - - - - - - Auctioneer - auc - Use for a person or organization in charge - of the estimation and public auctioning of goods, - particularly books, artistic works, - etc. - - stable - - - - - - Author - aut - Use for a person or organization chiefly - responsible for the intellectual or artistic content - of a work, usually printed text. This term may also - be used when more than one person or body bears such - responsibility. - - stable - Joint author - - - - - - - Author in quotations or text - extracts - aqt - Use for a person or organization whose - work is largely quoted or extracted in works to - which he or she did not contribute directly. Such - quotations are found particularly in exhibition - catalogs, collections of photographs, - etc. - - stable - - - - - - - Author of afterword, colophon, - etc. - aft - Use for a person or organization - responsible for an afterword, postface, colophon, - etc. but who is not the chief author of a - work. - - stable - - - - - - - Author of dialog - aud - Use for a person or organization - responsible for the dialog or spoken commentary for - a screenplay or sound recording. - - stable - - - - - - - Author of introduction, etc. - aui - Use for a person or organization - responsible for an introduction, preface, foreword, - or other critical introductory matter, but who is - not the chief author. - - stable - - - - - - - Author of screenplay, etc. - aus - Use for a person or organization - responsible for a motion picture screenplay, dialog, - spoken commentary, etc. - - stable - - - - - - - Bibliographic antecedent - ant - Use for a person or organization - responsible for a work upon which the work - represented by the catalog record is based. This may - be appropriate for adaptations, sequels, - continuations, indexes, etc. - - stable - - - - - - Binder - bnd - Use for a person or organization - responsible for the binding of printed or manuscript - materials. - - stable - - - - - - Binding designer - bdd - Use for a person or organization - responsible for the binding design of a book, - including the type of binding, the type of materials - used, and any decorative aspects of the binding. - - stable - Designer of binding - - - - - - Blurb writer - blw - Use for the named entity responsible for writing a commendation - or testimonial for a work, which appears on or within the publication - itself, frequently on the back or dust jacket of print publications or - on advertising material for all media. - - stable - - - - - - Book designer - bkd - Use for a person or organization - responsible for the entire graphic design of a book, - including arrangement of type and illustration, - choice of materials, and process used. - - stable - Designer of book - - - - - - Book producer - bkp - Use for a person or organization - responsible for the production of books and other - print media, if specific codes (e.g., [bkd], [egr], - [tyd], [prt]) are not desired. - - stable - Producer of book - - - - - - Bookjacket designer - bjd - Use for a person or organization - responsible for the design of flexible covers - designed for or published with a book, including the - type of materials used, and any decorative aspects - of the bookjacket. - - stable - Designer of bookjacket - - - - - - Bookplate designer - bpd - Use for a person or organization - responsible for the design of a book owner's - identification label that is most commonly pasted to - the inside front cover of a book. - - stable - Designer of bookplate - - - - - - Bookseller - bsl - Use for a person or organization who makes - books and other bibliographic materials available - for purchase. Interest in the materials is primarily - lucrative. - - stable - - - - - - Calligrapher - cll - Use for a person or organization who - writes in an artistic hand, usually as a copyist and - or engrosser. - - stable - - - - - - - Cartographer - ctg - Use for a person or organization - responsible for the creation of maps and other - cartographic materials. - - stable - - - - - - - Censor - cns - Use for a censor, bowdlerizer, expurgator, - etc., official or private. - - stable - Bowdlerizer - Expurgator - - - - - - Choreographer - chr - Use for a person or organization who - composes or arranges dances or other movements - (e.g., "master of swords") for a musical or dramatic - presentation or entertainment. - - stable - - - - - - - Cinematographer - cng - Use for a person or organization who is in - charge of the images captured for a motion picture - film. The cinematographer works under the - supervision of a director, and may also be referred - to as director of photography. Do not confuse with - videographer. - - stable - - - - - - - Client - cli - Use for a person or organization for whom - another person or organization is - acting. - - stable - - - - - - Collaborator - clb - Use for a person or organization that - takes a limited part in the elaboration of a work of - another person or organization that brings - complements (e.g., appendices, notes) to the - work. - - stable - - - - - - - Collector - col - Use for a person or organization who has - brought together material from various sources that - has been arranged, described, and cataloged as a - collection. A collector is neither the creator of - the material nor a person to whom manuscripts in the - collection may have been addressed. - - stable - - - - - - Collotyper - clt - Use for a person or organization - responsible for the production of photographic - prints from film or other colloid that has - ink-receptive and ink-repellent - surfaces. - - stable - - - - - - - Colorist - clr - Use for the named entity responsible for applying color to - drawings, prints, photographs, maps, moving images, etc. - - stable - - - - - - Commentator - cmm - Use for a person or organization who - provides interpretation, analysis, or a discussion - of the subject matter on a recording, motion - picture, or other audiovisual medium. - - stable - - - - - - - Commentator for written text - cwt - Use for a person or organization - responsible for the commentary or explanatory notes - about a text. For the writer of manuscript - annotations in a printed book, use Annotator - [ann]. - - stable - - - - - - - Compiler - com - Use for a person or organization who - produces a work or publication by selecting and - putting together material from the works of various - persons or bodies. - - stable - - - - - - - Complainant - cpl - Use for the party who applies to the - courts for redress, usually in an equity - proceeding. - - stable - - - - - - Complainant-appellant - cpt - Use for a complainant who takes an appeal - from one court or jurisdiction to another to reverse - the judgment, usually in an equity - proceeding. - - stable - - - - - - Complainant-appellee - cpe - Use for a complainant against whom an - appeal is taken from one court or jurisdiction to - another to reverse the judgment, usually in an - equity proceeding. - - stable - - - - - - Composer - cmp - Use for a person or organization who - creates a musical work, usually a piece of music in - manuscript or printed form. - - stable - - - - - - - Compositor - cmt - Use for a person or organization - responsible for the creation of metal slug, or molds - made of other materials, used to produce the text - and images in printed matter. - - stable - Typesetter - - - - - - Conceptor - ccp - Use for a person or organization - responsible for the original idea on which a work is - based, this includes the scientific author of an - audio-visual item and the conceptor of an - advertisement. - - stable - - - - - - - Conductor - cnd - Use for a person who directs a performing - group (orchestra, chorus, opera, etc.) in a musical - or dramatic presentation or - entertainment. - - stable - - - - - - - Conservator - con - Use for the named entity responsible for documenting, - preserving, or treating printed or manuscript material, works of art, - artifacts, or other media. - - stable - Preservationist - - - - - - Consultant - csl - Use for a person or organization relevant - to a resource, who is called upon for professional - advice or services in a specialized field of - knowledge or training. - - stable - - - - - - - Consultant to a project - csp - Use for a person or organization relevant - to a resource, who is engaged specifically to - provide an intellectual overview of a strategic or - operational task and by analysis, specification, or - instruction, to create or propose a cost-effective - course of action or solution. - - stable - - - - - - - Contestant - cos - Use for the party who opposes, resists, or - disputes, in a court of law, a claim, decision, - result, etc. - - stable - - - - - - Contestant-appellant - cot - Use for a contestant who takes an appeal - from one court of law or jurisdiction to another to - reverse the judgment. - - stable - - - - - - Contestant-appellee - coe - Use for a contestant against whom an - appeal is taken from one court of law or - jurisdiction to another to reverse the - judgment. - - stable - - - - - - Contestee - cts - Use for the party defending a claim, - decision, result, etc. being opposed, resisted, or - disputed in a court of law. - - stable - - - - - - Contestee-appellant - ctt - Use for a contestee who takes an appeal - from one court or jurisdiction to another to reverse - the judgment. - - stable - - - - - - Contestee-appellee - cte - Use for a contestee against whom an appeal - is taken from one court or jurisdiction to another - to reverse the judgment. - - stable - - - - - - Contractor - ctr - Use for a person or organization relevant - to a resource, who enters into a contract with - another person or organization to perform a specific - task. - - stable - - - - - - - Contributor - ctb - Use for a person or organization one whose - work has been contributed to a larger work, such as - an anthology, serial publication, or other - compilation of individual works. Do not use if the - sole function in relation to a work is as author, - editor, compiler or translator. - - stable - - - - - - - Copyright claimant - cpc - Use for a person or organization listed as - a copyright owner at the time of registration. - Copyright can be granted or later transferred to - another person or organization, at which time the - claimant becomes the copyright holder. - - stable - - - - - - Copyright holder - cph - Use for a person or organization to whom - copy and legal rights have been granted or - transferred for the intellectual content of a work. - The copyright holder, although not necessarily the - creator of the work, usually has the exclusive right - to benefit financially from the sale and use of the - work to which the associated copyright protection - applies. - - stable - - - - - - Corrector - crr - Use for a person or organization who is a - corrector of manuscripts, such as the scriptorium - official who corrected the work of a scribe. For - printed matter, use Proofreader [pfr]. - - stable - - - - - - Correspondent - crp - Use for a person or organization who was - either the writer or recipient of a letter or other - communication. - - stable - - - - - - - Costume designer - cst - Use for a person or organization who - designs or makes costumes, fixes hair, etc., for a - musical or dramatic presentation or - entertainment. - - stable - - - - - - - Cover designer - cov - Use for a person or organization - responsible for the graphic design of a book cover, - album cover, slipcase, box, container, etc. For a - person or organization responsible for the graphic - design of an entire book, use Book designer; for - book jackets, use Bookjacket designer. - - stable - Designer of cover - - - - - - Creator - cre - Use for a person or organization - responsible for the intellectual or artistic content - of a work. - - stable - - - - - - - - Curator of an exhibition - cur - Use for a person or organization - responsible for conceiving and organizing an - exhibition. - - stable - - - - - - - Dancer - dnc - Use for a person or organization who - principally exhibits dancing skills in a musical or - dramatic presentation or entertainment. - - stable - - - - - - - Data contributor - dtc - Use for a person or organization that - submits data for inclusion in a database or other - collection of data. - - stable - - - - - - Data manager - dtm - Use for a person or organization - responsible for managing databases or other data - sources. - - stable - - - - - - Dedicatee - dte - Use for a person or organization to whom a - book, manuscript, etc., is dedicated (not the - recipient of a gift). - - stable - - - - - - Dedicator - dto - Use for the author of a dedication, which - may be a formal statement or in epistolary or verse - form. - - stable - - - - - - Defendant - dfd - Use for the party defending or denying - allegations made in a suit and against whom relief - or recovery is sought in the courts, usually in a - legal action. - - stable - - - - - - Defendant-appellant - dft - Use for a defendant who takes an appeal - from one court or jurisdiction to another to reverse - the judgment, usually in a legal - action. - - stable - - - - - - Defendant-appellee - dfe - Use for a defendant against whom an appeal - is taken from one court or jurisdiction to another - to reverse the judgment, usually in a legal - action. - - stable - - - - - - Degree grantor - dgg - Use for the organization granting a degree - for which the thesis or dissertation described was - presented. - - stable - - - - - - Delineator - dln - Use for a person or organization executing - technical drawings from others' - designs. - - stable - - - - - - - Depicted - dpc - Use for an entity depicted or portrayed in - a work, particularly in a work of art. - - stable - - - - - - - Depositor - dpt - Use for a person or organization placing - material in the physical custody of a library or - repository without transferring the legal - title. - - stable - - - - - - Designer - dsr - Use for a person or organization - responsible for the design if more specific codes - (e.g., [bkd], [tyd]) are not desired. - - stable - - - - - - - Director - drt - Use for a person or organization who is - responsible for the general management of a work or - who supervises the production of a performance for - stage, screen, or sound recording. - - stable - - - - - - - Dissertant - dis - Use for a person who presents a thesis for - a university or higher-level educational - degree. - - stable - - - - - - - Distribution place - dbp - Use for the name of a place from which a resource, - e.g., a serial, is distributed. - - stable - - - - - - Distributor - dst - Use for a person or organization that has - exclusive or shared marketing rights for an - item. - - stable - - - - - - - Donor - dnr - Use for a person or organization who is - the donor of a book, manuscript, etc., to its - present owner. Donors to previous owners are - designated as Former owner[fmo] or Inscriber - [ins]. - - stable - - - - - - Draftsman - drm - Use for a person or organization who - prepares artistic or technical drawings. - - stable - Technical draftsman - - - - - - - Dubious author - dub - Use for a person or organization to which - authorship has been dubiously or incorrectly - ascribed. - - stable - - - - - - Editor - edt - Use for a person or organization who - prepares for publication a work not primarily - his/her own, such as by elucidating text, adding - introductory or other critical matter, or - technically directing an editorial - staff. - - stable - - - - - - - Electrician - elg - Use for a person responsible for setting - up a lighting rig and focusing the lights for a - production, and running the lighting at a - performance. - - stable - Chief electrician - House electrician - Master electrician - - - - - - Electrotyper - elt - Use for a person or organization who - creates a duplicate printing surface by pressure - molding and electrodepositing of metal that is then - backed up with lead for printing. - - stable - - - - - - Engineer - eng - Use for a person or organization that is - responsible for technical planning and design, - particularly with construction. - - stable - - - - - - - Engraver - egr - Use for a person or organization who cuts - letters, figures, etc. on a surface, such as a - wooden or metal plate, for printing. - - stable - - - - - - - Etcher - etr - Use for a person or organization who - produces text or images for printing by subjecting - metal, glass, or some other surface to acid or the - corrosive action of some other - substance. - - stable - - - - - - - Event place - evp - Use for the name of the place where an event such - as a conference or a concert took place. - - stable - - - - - - Expert - exp - Use for a person or organization in charge - of the description and appraisal of the value of - goods, particularly rare items, works of art, etc. - - stable - Appraiser - - - - - - Facsimilist - fac - Use for a person or organization that - executed the facsimile. - - stable - Copier - - - - - - - Field director - fld - Use for a person or organization that - manages or supervises the work done to collect raw - data or do research in an actual setting or - environment (typically applies to the natural and - social sciences). - - stable - - - - - - Film editor - flm - Use for a person or organization who is an - editor of a motion picture film. This term is used - regardless of the medium upon which the motion - picture is produced or manufactured (e.g., acetate - film, video tape). - - stable - Motion picture editor - - - - - - - First party - fpy - Use for a person or organization who is - identified as the only party or the party of the - first part. In the case of transfer of right, this - is the assignor, transferor, licensor, grantor, etc. - Multiple parties can be named jointly as the first - party - - stable - - - - - - Forger - frg - Use for a person or organization who makes - or imitates something of value or importance, - especially with the intent to defraud. - - stable - Copier - Counterfeiter - - - - - - - Former owner - fmo - Use for a person or organization who owned - an item at any time in the past. Includes those to - whom the material was once presented. A person or - organization giving the item to the present owner is - designated as Donor [dnr]. - - stable - - - - - - Funder - fnd - Use for a person or organization that - furnished financial support for the production of - the work. - - stable - - - - - - Geographic information - specialist - gis - Use for a person responsible for - geographic information system (GIS) development and - integration with global positioning system data.. - - - stable - Geospatial information specialist - - - - - - Honoree - hnr - Use for a person or organization in memory - or honor of whom a book, manuscript, etc. is - donated. - - stable - Memorial - - - - - - Host - hst - Use for a person who is invited or - regularly leads a program (often broadcast) that - includes other guests, performers, etc. (e.g., talk - show host). - - stable - - - - - - - Illuminator - ilu - Use for a person or organization - responsible for the decoration of a work (especially - manuscript material) with precious metals or color, - usually with elaborate designs and - motifs. - - stable - - - - - - - Illustrator - ill - Use for a person or organization who - conceives, and perhaps also implements, a design or - illustration, usually to accompany a written - text. - - stable - - - - - - - Inscriber - ins - Use for a person who signs a presentation - statement. - - stable - - - - - - Instrumentalist - itr - Use for a person or organization who - principally plays an instrument in a musical or - dramatic presentation or entertainment. - - stable - - - - - - - Interviewee - ive - Use for a person or organization who is - interviewed at a consultation or meeting, usually by - a reporter, pollster, or some other information - gathering agent. - - stable - - - - - - - Interviewer - ivr - Use for a person or organization who acts - as a reporter, pollster, or other information - gathering agent in a consultation or meeting - involving one or more individuals. - - stable - - - - - - - Inventor - inv - Use for a person or organization who first - produces a particular useful item, or develops a new - process for obtaining a known item or - result. - - stable - - - - - - - Laboratory - lbr - Use for an institution that provides - scientific analyses of material - samples. - - stable - - - - - - Laboratory director - ldr - Use for a person or organization that - manages or supervises work done in a controlled - setting or environment. - - stable - Lab director - - - - - - Lead - led - Use to indicate that a person or - organization takes primary responsibility for a - particular activity or endeavor. Use with another - relator term or code to show the greater importance - this person or organization has regarding that - particular role. If more than one relator is - assigned to a heading, use the Lead relator only if - it applies to all the relators. - - stable - - - - - - Landscape architect - lsa - Use for a person or organization whose - work involves coordinating the arrangement of - existing and proposed land features and - structures. - - stable - - - - - - - Lender - len - Use for a person or organization - permitting the temporary use of a book, manuscript, - etc., such as for photocopying or - microfilming. - - stable - - - - - - Libelant - lil - Use for the party who files a libel in an - ecclesiastical or admiralty case. - - stable - - - - - - Libelant-appellant - lit - Use for a libelant who takes an appeal - from one ecclesiastical court or admiralty to - another to reverse the judgment. - - stable - - - - - - Libelant-appellee - lie - Use for a libelant against whom an appeal - is taken from one ecclesiastical court or admiralty - to another to reverse the judgment. - - stable - - - - - - Libelee - lel - Use for a party against whom a libel has - been filed in an ecclesiastical court or - admiralty. - - stable - - - - - - Libelee-appellant - let - Use for a libelee who takes an appeal from - one ecclesiastical court or admiralty to another to - reverse the judgment. - - stable - - - - - - Libelee-appellee - lee - Use for a libelee against whom an appeal - is taken from one ecclesiastical court or admiralty - to another to reverse the judgment. - - stable - - - - - - Librettist - lbt - Use for a person or organization who is a - writer of the text of an opera, oratorio, - etc. - - stable - - - - - - - Licensee - lse - Use for a person or organization who is an - original recipient of the right to print or - publish. - - stable - - - - - - Licensor - lso - Use for person or organization who is a - signer of the license, imprimatur, etc. - - stable - Imprimatur - - - - - - Lighting designer - lgd - Use for a person or organization who - designs the lighting scheme for a theatrical - presentation, entertainment, motion picture, etc. - - - stable - - - - - - - Lithographer - ltg - Use for a person or organization who - prepares the stone or plate for lithographic - printing, including a graphic artist creating a - design directly on the surface from which printing - will be done. - - stable - - - - - - - Lyricist - lyr - Use for a person or organization who is - the a writer of the text of a song. - - stable - - - - - - - Manufacturer - mfr - Use for a person or organization that - makes an artifactual work (an object made or - modified by one or more persons). Examples of - artifactual works include vases, cannons or pieces - of furniture. - - stable - - - - - - - Marbler - mrb - Use for the named entity responsible for marbling paper, cloth, - leather, etc. used in construction of a resource. - - stable - - - - - - Markup editor - mrk - Use for a person or organization - performing the coding of SGML, HTML, or XML markup - of metadata, text, etc. - - stable - - - - - - Metadata contact - mdc - Use for a person or organization primarily - responsible for compiling and maintaining the - original description of a metadata set (e.g., - geospatial metadata set). - - stable - - - - - - Metal-engraver - mte - Use for a person or organization - responsible for decorations, illustrations, letters, - etc. cut on a metal surface for printing or - decoration. - - stable - - - - - - - Moderator - mod - Use for a person who leads a program - (often broadcast) where topics are discussed, - usually with participation of experts in fields - related to the discussion. - - stable - - - - - - - Monitor - mon - Use for a person or organization that - supervises compliance with the contract and is - responsible for the report and controls its - distribution. Sometimes referred to as the grantee, - or controlling agency. - - stable - - - - - - Music copyist - mcp - Use for a person who transcribes or copies - musical notation. - - stable - - - - - - Musical director - msd - Use for a person responsible for basic - music decisions about a production, including - coordinating the work of the composer, the sound - editor, and sound mixers, selecting musicians, and - organizing and/or conducting sound for rehearsals - and performances. - - stable - - - - - - Musician - mus - Use for a person or organization who - performs music or contributes to the musical content - of a work when it is not possible or desirable to - identify the function more precisely. - - stable - - - - - - - Narrator - nrt - Use for a person who is a speaker relating - the particulars of an act, occurrence, or course of - events. - - stable - - - - - - - Opponent - opn - Use for a person or organization - responsible for opposing a thesis or - dissertation. - - stable - - - - - - Organizer of meeting - orm - Use for a person or organization - responsible for organizing a meeting for which an - item is the report or proceedings. - - stable - - - - - - - Originator - org - Use for a person or organization - performing the work, i.e., the name of a person or - organization associated with the intellectual - content of the work. This category does not include - the publisher or personal affiliation, or sponsor - except where it is also the corporate author. - Includes a person designated in the work as - investigator or principal investigator. - - stable - Principal investigator - - - - - - - Other - oth - Use for relator codes from other lists - which have no equivalent in the MARC list or for - terms which have not been assigned a - code. - - stable - - - - - - Owner - own - Use for a person or organization that - currently owns an item or collection. - - stable - - - - - - Papermaker - ppm - Use for a person or organization - responsible for the production of paper, usually - from wood, cloth, or other fibrous - material. - - stable - - - - - - Patent applicant - pta - Use for a person or organization that - applied for a patent. - - stable - - - - - - Patent holder - pth - Use for a person or organization that was - granted the patent referred to by the item. - - stable - Patentee - - - - - - Patron - pat - Use for a person or organization - responsible for commissioning a work. Usually a - patron means or influence to support the work of - artists, writers, etc. This includes those who - commission and pay for individual - works. - - stable - - - - - - Performer - prf - Use for a person or organization who - exhibits musical or acting skills in a musical or - dramatic presentation or entertainment, if specific - codes for those functions ([act], [dnc], [itr], - [voc], etc.) are not used. If specific codes are - used, [prf] is used for a person whose principal - skill is not known or specified. - - stable - - - - - - - Permitting agency - pma - Use for an authority (usually a government - agency) that issues permits under which work is - accomplished. - - stable - - - - - - Photographer - pht - Use for a person or organization - responsible for taking photographs, whether they are - used in their original form or as - reproductions. - - stable - - - - - - - Plaintiff - ptf - Use for the party who complains or sues in - court in a personal action, usually in a legal - proceeding. - - stable - - - - - - Plaintiff-appellant - ptt - Use for a plaintiff who takes an appeal - from one court or jurisdiction to another to reverse - the judgment, usually in a legal - proceeding. - - stable - - - - - - Plaintiff-appellee - pte - Use for a plaintiff against whom an appeal - is taken from one court or jurisdiction to another - to reverse the judgment, usually in a legal - proceeding. - - stable - - - - - - Platemaker - plt - Use for a person or organization - responsible for the production of plates, usually - for the production of printed images and/or - text. - - stable - - - - - - - Printer - prt - Use for a person or organization who - prints texts, whether from type or - plates. - - stable - - - - - - Printer of plates - pop - Use for a person or organization who - prints illustrations from plates. - - stable - Plates, Printer of - - - - - - Printmaker - prm - Use for a person or organization who makes - a relief, intaglio, or planographic printing - surface. - - stable - - - - - - - Process contact - prc - Use for a person or organization primarily - responsible for performing or initiating a process, - such as is done with the collection of metadata - sets. - - stable - - - - - - Producer - pro - Use for a person or organization - responsible for the making of a motion picture, - including business aspects, management of the - productions, and the commercial success of the - work. - - stable - - - - - - - Production manager - pmm - Use for a person responsible for all - technical and business matters in a - production. - - stable - - - - - - Production personnel - prd - Use for a person or organization - associated with the production (props, lighting, - special effects, etc.) of a musical or dramatic - presentation or entertainment. - - stable - - - - - - - Programmer - prg - Use for a person or organization - responsible for the creation and/or maintenance of - computer program design documents, source code, and - machine-executable digital files and supporting - documentation. - - stable - - - - - - - Project director - pdr - Use for a person or organization with - primary responsibility for all essential aspects of - a project, or that manages a very large project that - demands senior level responsibility, or that has - overall responsibility for managing projects, or - provides overall direction to a project manager. - - stable - - - - - - Proofreader - pfr - Use for a person who corrects printed - matter. For manuscripts, use Corrector - [crr]. - - stable - - - - - - Publication place - pup - Use for the name of the place where a resource is published. - - stable - - - - - - Publisher - pbl - Use for a person or organization that - makes printed matter, often text, but also printed - music, artwork, etc. available to the - public. - - stable - - - - - - - Publishing director - pbd - Use for a person or organization who - presides over the elaboration of a collective work - to ensure its coherence or continuity. This includes - editors-in-chief, literary editors, editors of - series, etc. - - stable - - - - - - Puppeteer - ppt - Use for a person or organization who - manipulates, controls, or directs puppets or - marionettes in a musical or dramatic presentation or - entertainment. - - stable - - - - - - - Recipient - rcp - Use for a person or organization to whom - correspondence is addressed. - - stable - - - - - - Recording engineer - rce - Use for a person or organization who - supervises the technical aspects of a sound or video - recording session. - - stable - - - - - - - Redactor - red - Use for a person or organization who - writes or develops the framework for an item without - being intellectually responsible for its - content. - - stable - - - - - - Renderer - ren - Use for a person or organization who - prepares drawings of architectural designs (i.e., - renderings) in accurate, representational - perspective to show what the project will look like - when completed. - - stable - - - - - - - Reporter - rpt - Use for a person or organization who - writes or presents reports of news or current events - on air or in print. - - stable - - - - - - - Repository - rps - Use for an agency that hosts data or - material culture objects and provides services to - promote long term, consistent and shared use of - those data or objects. - - stable - - - - - - Research team head - rth - Use for a person who directed or managed a - research project. - - stable - - - - - - - Research team member - rtm - Use for a person who participated in a - research project but whose role did not involve - direction or management of it. - - stable - - - - - - - Researcher - res - Use for a person or organization - responsible for performing research. - - stable - Performer of research - - - - - - - Respondent - rsp - Use for the party who makes an answer to - the courts pursuant to an application for redress, - usually in an equity proceeding. - - stable - - - - - - Respondent-appellant - rst - Use for a respondent who takes an appeal - from one court or jurisdiction to another to reverse - the judgment, usually in an equity - proceeding. - - stable - - - - - - Respondent-appellee - rse - Use for a respondent against whom an - appeal is taken from one court or jurisdiction to - another to reverse the judgment, usually in an - equity proceeding. - - stable - - - - - - Responsible party - rpy - Use for a person or organization legally - responsible for the content of the published - material. - - stable - - - - - - - Restager - rsg - Use for a person or organization , other - than the original choreographer or director, - responsible for restaging a choreographic or - dramatic work and who contributes minimal new - content. - - stable - - - - - - - Reviewer - rev - Use for a person or organization - responsible for the review of a book, motion - picture, performance, etc. - - stable - - - - - - - Rubricator - rbr - Use for a person or organization - responsible for parts of a work, often headings or - opening parts of a manuscript, that appear in a - distinctive color, usually red - - stable - - - - - - Scenarist - sce - Use for a person or organization who is - the author of a motion picture - screenplay. - - stable - - - - - - - Scientific advisor - sad - Use for a person or organization who - brings scientific, pedagogical, or historical - competence to the conception and realization on a - work, particularly in the case of audio-visual - items. - - stable - - - - - - - Scribe - scr - Use for a person who is an amanuensis and - for a writer of manuscripts proper. For a person who - makes pen-facsimiles, use Facsimilist - [fac]. - - stable - - - - - - - Sculptor - scl - Use for a person or organization who - models or carves figures that are three-dimensional - representations. - - stable - - - - - - - Second party - spy - Use for a person or organization who is - identified as the party of the second part. In the - case of transfer of right, this is the assignee, - transferee, licensee, grantee, etc. Multiple parties - can be named jointly as the second - party - - stable - - - - - - Secretary - sec - Use for a person or organization who is a - recorder, redactor, or other person responsible for - expressing the views of a - organization.> - - stable - - - - - - - Set designer - std - Use for a person or organization who - translates the rough sketches of the art director - into actual architectural structures for a - theatrical presentation, entertainment, motion - picture, etc. Set designers draw the detailed guides - and specifications for building the - set. - - stable - - - - - - - Signer - sgn - Use for a person whose signature appears - without a presentation or other statement indicative - of provenance. When there is a presentation - statement, use Inscriber [ins]. - - stable - - - - - - Singer - sng - Use for a person or organization who uses - his/her/their voice with or without instrumental - accompaniment to produce music. A performance may or - may not include actual words. - - stable - - - - - - - Sound designer - sds - Use for a person who produces and - reproduces the sound score (both live and recorded), - the installation of microphones, the setting of - sound levels, and the coordination of sources of - sound for a production. - - stable - - - - - - Speaker - spk - Use for a person who participates in a - program (often broadcast) and makes a formalized - contribution or presentation generally prepared in - advance. - - stable - - - - - - - Sponsor - spn - Use for a person or organization that - issued a contract or under the auspices of which a - work has been written, printed, published, - etc. - - stable - - - - - - Stage manager - stm - Use for a person who is in charge of - everything that occurs on a performance stage, and - who acts as chief of all crews and assistant to a - director during rehearsals. - - stable - - - - - - Standards body - stn - Use for an organization responsible for - the development or enforcement of a - standard. - - stable - - - - - - - Stereotyper - str - Use for a person or organization who - creates a new plate for printing by molding or - copying another printing surface. - - stable - - - - - - Storyteller - stl - Use for a person relaying a story with - creative and/or theatrical - interpretation. - - stable - - - - - - - Supporting host - sht - Use for a person or organization that - supports (by allocating facilities, staff, or other - resources) a project, program, meeting, event, data - objects, material culture objects, or other entities - capable of support. - - stable - Host, Supporting - - - - - - Surveyor - srv - Use for a person or organization who does - measurements of tracts of land, etc. to determine - location, forms, and boundaries. - - stable - - - - - - - Teacher - tch - Use for a person who, in the context of a - resource, gives instruction in an intellectual - subject or demonstrates while teaching physical - skills. - - stable - Instructor - - - - - - - Technical director - tcd - Use for a person who is ultimately in - charge of scenery, props, lights and sound for a - production. - - stable - - - - - - Thesis advisor - ths - Use for a person under whose supervision a - degree candidate develops and presents a thesis, - mémoire, or text of a dissertation. - - stable - Promoter - - - - - - Transcriber - trc - Use for a person who prepares a - handwritten or typewritten copy from original - material, including from dictated or orally recorded - material. For makers of pen-facsimiles, use - Facsimilist [fac]. - - stable - - - - - - - Translator - trl - Use for a person or organization who - renders a text from one language into another, or - from an older form of a language into the modern - form. - - stable - - - - - - - Type designer - tyd - Use for a person or organization who - designed the type face used in a particular item. - - stable - Designer of type - - - - - - Typographer - tyg - Use for a person or organization primarily - responsible for choice and arrangement of type used - in an item. If the typographer is also responsible - for other aspects of the graphic design of a book - (e.g., Book designer [bkd]), codes for both - functions may be needed. - - stable - - - - - - University place - uvp - Use for the name of a place where a university that is associated - with a resource is located, for example, a university where an academic - dissertation or thesis was presented. - - stable - - - - - - Videographer - vdg - Use for a person or organization in charge - of a video production, e.g. the video recording of a - stage production as opposed to a commercial motion - picture. The videographer may be the camera operator - or may supervise one or more camera operators. Do - not confuse with cinematographer. - - stable - - - - - - - Vocalist - voc - Use for a person or organization who - principally exhibits singing skills in a musical or - dramatic presentation or entertainment. - - stable - - - - - - - Witness - wit - Use for a person who verifies the - truthfulness of an event or action. - - stable - Deponent - Eyewitness - Observer - Onlooker - Testifier - - - - - - Wood-engraver - wde - Use for a person or organization who makes - prints by cutting the image in relief on the - end-grain of a wood block. - - stable - - - - - - - Woodcutter - wdc - Use for a person or organization who makes - prints by cutting the image in relief on the plank - side of a wood block. - - stable - - - - - - - Writer of accompanying material - wam - Use for a person or organization who - writes significant material which accompanies a - sound recording or other audiovisual - material. - - stable - - - - - Actor - - - - - Adapter - - - - - Analyst - - - - - Animator - - - - - Annotator - - - - - Applicant - - - - - Architect - - - - - Arranger - - - - - Art copyist - - - - - Artist - - - - - Artistic director - - - - - Assignee - - - - - Associated name - - - - - Attributed name - - - - - Auctioneer - - - - - Author - - - - - Author in quotations or text - extracts - - - - - Author of afterword, colophon, - etc. - - - - - Author of dialog - - - - - Author of introduction, etc. - - - - - Author of screenplay, etc. - - - - - Bibliographic antecedent - - - - - Binder - - - - - Binding designer - - - - - Blurb writer - - - - - Book designer - - - - - Book producer - - - - - Bookjacket designer - - - - - Bookplate designer - - - - - Bookseller - - - - - Calligrapher - - - - - Cartographer - - - - - Censor - - - - - Choreographer - - - - - Cinematographer - - - - - Client - - - - - Collaborator - - - - - Collector - - - - - Collotyper - - - - - Colorist - - - - - Commentator - - - - - Commentator for written text - - - - - Compiler - - - - - Complainant - - - - - Complainant-appellant - - - - - Complainant-appellee - - - - - Composer - - - - - Compositor - - - - - Conceptor - - - - - Conductor - - - - - Conservator - - - - - Consultant - - - - - Consultant to a project - - - - - Contestant - - - - - Contestant-appellant - - - - - Contestant-appellee - - - - - Contestee - - - - - Contestee-appellant - - - - - Contestee-appellee - - - - - Contractor - - - - - Contributor - - - - - Copyright claimant - - - - - Copyright holder - - - - - Corrector - - - - - Correspondent - - - - - Costume designer - - - - - Cover designer - - - - - Creator - - - - - Curator of an exhibition - - - - - Dancer - - - - - Data contributor - - - - - Data manager - - - - - Dedicatee - - - - - Dedicator - - - - - Defendant - - - - - Defendant-appellant - - - - - Defendant-appellee - - - - - Degree grantor - - - - - Delineator - - - - - Depicted - - - - - Depositor - - - - - Designer - - - - - Director - - - - - Dissertant - - - - - Distribution place - - - - - Distributor - - - - - Donor - - - - - Draftsman - - - - - Dubious author - - - - - Editor - - - - - Electrician - - - - - Electrotyper - - - - - Engineer - - - - - Engraver - - - - - Etcher - - - - - Event place - - - - - Expert - - - - - Facsimilist - - - - - Field director - - - - - Film editor - - - - - First party - - - - - Forger - - - - - Former owner - - - - - Funder - - - - - Geographic information - specialist - - - - - Honoree - - - - - Host - - - - - Illuminator - - - - - Illustrator - - - - - Inscriber - - - - - Instrumentalist - - - - - Interviewee - - - - - Interviewer - - - - - Inventor - - - - - Laboratory - - - - - Laboratory director - - - - - Lead - - - - - Landscape architect - - - - - Lender - - - - - Libelant - - - - - Libelant-appellant - - - - - Libelant-appellee - - - - - Libelee - - - - - Libelee-appellant - - - - - Libelee-appellee - - - - - Librettist - - - - - Licensee - - - - - Licensor - - - - - Lighting designer - - - - - Lithographer - - - - - Lyricist - - - - - Manufacturer - - - - - Marbler - - - - - Markup editor - - - - - Metadata contact - - - - - Metal-engraver - - - - - Moderator - - - - - Monitor - - - - - Music copyist - - - - - Musical director - - - - - Musician - - - - - Narrator - - - - - Opponent - - - - - Organizer of meeting - - - - - Originator - - - - - Other - - - - - Owner - - - - - Papermaker - - - - - Patent applicant - - - - - Patent holder - - - - - Patron - - - - - Performer - - - - - Permitting agency - - - - - Photographer - - - - - Plaintiff - - - - - Plaintiff-appellant - - - - - Plaintiff-appellee - - - - - Platemaker - - - - - Printer - - - - - Printer of plates - - - - - Printmaker - - - - - Process contact - - - - - Producer - - - - - Production manager - - - - - Production personnel - - - - - Programmer - - - - - Project director - - - - - Proofreader - - - - - Publication place - - - - - Publisher - - - - - Publishing director - - - - - Puppeteer - - - - - Recipient - - - - - Recording engineer - - - - - Redactor - - - - - Renderer - - - - - Reporter - - - - - Repository - - - - - Research team head - - - - - Research team member - - - - - Researcher - - - - - Respondent - - - - - Respondent-appellant - - - - - Respondent-appellee - - - - - Responsible party - - - - - Restager - - - - - Reviewer - - - - - Rubricator - - - - - Scenarist - - - - - Scientific advisor - - - - - Scribe - - - - - Sculptor - - - - - Second party - - - - - Secretary - - - - - Set designer - - - - - Signer - - - - - Singer - - - - - Sound designer - - - - - Speaker - - - - - Sponsor - - - - - Stage manager - - - - - Standards body - - - - - Stereotyper - - - - - Storyteller - - - - - Supporting host - - - - - Surveyor - - - - - Teacher - - - - - Technical director - - - - - Thesis advisor - - - - - Transcriber - - - - - Translator - - - - - Type designer - - - - - Typographer - - - - - University place - - - - - Videographer - - - - - Vocalist - - - - - Witness - - - - - Wood-engraver - - - - - Woodcutter - - - - - Writer of accompanying material - - - From 25c5055ca58b436b4cfff8d8d4055d4b1847cc69 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Mon, 18 Jul 2011 09:38:16 -0300 Subject: [PATCH 018/247] Removed dependancy on PHP_LIB. --- formClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index da62a37a..8621eae5 100644 --- a/formClass.inc +++ b/formClass.inc @@ -502,7 +502,7 @@ class formClass { $name = $content_model->name; $potential_models["$identifier"] = "$name"; } - list($identifier, $name) = array_peek($potential_models); + $identifier = key($potential_models); $selected_model = isset($form_state['values']['models']) ? $form_state['values']['models'] : $identifier; return array( 'indicator' => array( From 2784a19a160288e334e017ef4f671e94ae3a127f Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Mon, 8 Aug 2011 16:13:07 -0300 Subject: [PATCH 019/247] Added doc tags --- plugins/CollectionFormBuilder.inc | 32 +- plugins/CreateCollection.inc | 30 +- plugins/DarwinCore.inc | 59 +- plugins/DemoFormBuilder.inc | 32 +- plugins/DocumentConverter.inc | 32 +- plugins/Exiftool.inc | 101 +-- plugins/Ffmpeg.inc | 37 +- plugins/Flv.inc | 109 ++-- plugins/FlvFormBuilder.inc | 24 +- plugins/FormBuilder.inc | 199 +++--- plugins/ImageManipulation.inc | 81 ++- plugins/ModsFormBuilder.inc | 863 +++++++++++++------------ plugins/PersonalCollectionClass.inc | 82 ++- plugins/QtFormBuilder.php | 143 ++-- plugins/Refworks.inc | 151 +++-- plugins/ShowDemoStreamsInFieldSets.inc | 22 +- plugins/ShowStreamsInFieldSets.inc | 111 +++- plugins/fedoraObject.inc | 33 +- plugins/herbarium.inc | 83 ++- plugins/map_viewer.inc | 29 +- plugins/qt_viewer.inc | 140 ++-- plugins/slide_viewer.inc | 34 +- plugins/tagging_form.inc | 44 +- 23 files changed, 1550 insertions(+), 921 deletions(-) diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index 6c5e33b6..26dbda26 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -1,37 +1,52 @@ getType($file); - $fileUrl = $base_url . '/'. drupal_urlencode($file); + $fileUrl = $base_url . '/' . drupal_urlencode($file); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); - $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); + $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); $ds1 = $dom->createElement("foxml:datastream"); $ds1->setAttribute("ID", "COLLECTION_POLICY"); //set the ID $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "COLLECTION_POLICY.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -42,4 +57,5 @@ class CollectionFormBuilder extends FormBuilder { $ds1v->appendChild($ds1content); $rootElement->appendChild($ds1); } + } diff --git a/plugins/CreateCollection.inc b/plugins/CreateCollection.inc index 0c185705..cec55648 100644 --- a/plugins/CreateCollection.inc +++ b/plugins/CreateCollection.inc @@ -1,22 +1,34 @@ owner = $item; - if ( array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) { + if (array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) { $dwc = $item->get_datastream_dissemination('DARWIN_CORE'); if (!empty($dwc)) { $this->darwinCoreXML = $dwc; @@ -17,10 +29,15 @@ class DarwinCore { } } + /** + * Build Drupal Form + * @param type $form + * @return int + */ public function buildDrupalForm($form = array()) { - + $dwc_xml = $this->darwinCoreXML; - + $dwc = DOMDocument::loadXML($dwc_xml); $form['dc:type'] = array( @@ -162,17 +179,22 @@ class DarwinCore { $date = $dwc->getElementsByTagNameNS('http://rs.tdwg.org/dwc/terms/', 'eventDate')->item(0)->nodeValue; $format = 'Y-m-d H:i:s'; $form['dwceventDate'] = array( - '#type' => 'date_popup', // types 'date_text' and 'date_timezone' are also supported. See .inc file. - '#title' => 'select a date', - '#default_value' => $date, - '#date_format' => $format, - '#date_label_position' => 'within', // See other available attributes and what they do in date_api_elements.inc - '#date_increment' => 15, // Optional, used by the date_select and date_popup elements to increment minutes and seconds. + '#type' => 'date_popup', // types 'date_text' and 'date_timezone' are also supported. See .inc file. + '#title' => 'select a date', + '#default_value' => $date, + '#date_format' => $format, + '#date_label_position' => 'within', // See other available attributes and what they do in date_api_elements.inc + '#date_increment' => 15, // Optional, used by the date_select and date_popup elements to increment minutes and seconds. '#description' => '', ); return $form; } + /** + * Handle Form ?? + * @global type $user + * @param type $form_values + */ public function handleForm($form_values) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $user; @@ -208,12 +230,20 @@ class DarwinCore { $this->darwinCoreXML = $dwc->saveXML(); } + /** + * asXML ?? + * @return type + */ public function asXML() { return $this->darwinCoreXML; } + /** + * asHTML ?? + * @return type + */ public function asHTML() { - $path=drupal_get_path('module', 'Fedora_Repository'); + $path = drupal_get_path('module', 'Fedora_Repository'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'CollectionClass'); @@ -226,8 +256,7 @@ class DarwinCore { try { $proc = new XsltProcessor(); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); return " "; } @@ -238,7 +267,7 @@ class DarwinCore { $input->loadXML(trim($xmlstr)); $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); - $content=$newdom->saveXML(); + $content = $newdom->saveXML(); return $content; } @@ -256,9 +285,7 @@ class DarwinCore { 'MachineObservation' => 'MachineObservation', 'NomenclaturalChecklist' => 'NomenclaturalChecklist', ), - ); - public $dwcFields = array( 'dc:type', 'dc:language', @@ -283,8 +310,6 @@ class DarwinCore { 'dwc:eventDate', 'dwc:eventTime', ); - - public $darwinCoreXML = ' diff --git a/plugins/DemoFormBuilder.inc b/plugins/DemoFormBuilder.inc index 913d8005..9b4219db 100644 --- a/plugins/DemoFormBuilder.inc +++ b/plugins/DemoFormBuilder.inc @@ -1,31 +1,44 @@ getType($file); - $fileUrl = $base_url .'/'. drupal_urlencode($file); + $fileUrl = $base_url . '/' . drupal_urlencode($file); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -50,7 +63,7 @@ class DemoFormBuilder extends FormBuilder { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { $createdFile = strstr($createdFile, $file); $dformat = $mimetype->getType($createdFile); - $fileUrl = $base_url .'/'. drupal_urlencode( $createdFile ); + $fileUrl = $base_url . '/' . drupal_urlencode($createdFile); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -60,7 +73,7 @@ class DemoFormBuilder extends FormBuilder { $ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -73,5 +86,6 @@ class DemoFormBuilder extends FormBuilder { } } } + } diff --git a/plugins/DocumentConverter.inc b/plugins/DocumentConverter.inc index 3aafb49f..5628cb16 100644 --- a/plugins/DocumentConverter.inc +++ b/plugins/DocumentConverter.inc @@ -3,20 +3,35 @@ // $Id$ /** - * + * @file + * Document Converter Class + */ + +/** * This class implements document (doc, odt, pdf, etc.) conversion for a generic * multi-format document collection. */ - class DocumentConverter { private $converter_service_url = "http://localhost:8080/converter/service"; + /** + * Constructor + * @param type $converter_url + */ public function __construct($converter_url = NULL) { if (!empty($converter_url)) $this->converter_service_url = $converter_url; } + /** + * Convert ??? + * @param type $parameterArray + * @param type $dsid + * @param type $file + * @param type $output_ext + * @return string + */ function convert($parameterArray = NULL, $dsid, $file, $output_ext) { module_load_include('inc', 'fedora_repository', 'MimeClass'); @@ -32,7 +47,7 @@ class DocumentConverter { $outputType = $helper->get_mimetype($output_ext); $inputData = file_get_contents($file); - $outputFile = $file ."_". $dsid .".". $output_ext; + $outputFile = $file . "_" . $dsid . "." . $output_ext; #debug: #drupal_set_message("inputType: $inputType", 'status'); @@ -40,8 +55,8 @@ class DocumentConverter { #drupal_set_message("outputFile: $outputFile", 'status'); $ch = curl_init($this->converter_service_url); - curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: $inputType", "Accept: $outputType" ) ); - curl_setopt($ch, CURLOPT_POST, 1 ); + curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: $inputType", "Accept: $outputType")); + curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 120); // times out after 2 minutes curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable curl_setopt($ch, CURLOPT_POSTFIELDS, $inputData); // add POST fields @@ -52,23 +67,24 @@ class DocumentConverter { $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - if (200 == $code) { + if (200 == $code) { $returnValue = file_put_contents($outputFile, $data); if ($returnValue > 0) { drupal_set_message("Conversion successful.", 'status'); $_SESSION['fedora_ingest_files']["$dsid"] = $outputFile; return $outputFile; - } + } else { return $returnValue; // a.k.a. FALSE. } - } + } else { drupal_set_message("Conversion Failed. Webservice returned $code.", 'status'); return FALSE; } } + } /* diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index ec6d7ad0..81cc46ef 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -1,17 +1,24 @@ pid = $pid; @@ -19,49 +26,61 @@ class Exiftool { $this->item = new Fedora_Item($this->pid); } + /** + * extract metadata ?? + * @param type $parameterArray + * @param type $dsid + * @param type $file + * @param type $file_ext + * @return type + */ function extractMetadata($parameterArray, $dsid, $file, $file_ext) { $system = getenv('System'); - $file_suffix = '_'. $dsid . '.xml'; - $returnValue=TRUE; - $output=array(); + $file_suffix = '_' . $dsid . '.xml'; + $returnValue = TRUE; + $output = array(); exec('exiftool -X ' . escapeshellarg($file) . '', $output); - file_put_contents($file.$file_suffix, implode("\n", $output)); + file_put_contents($file . $file_suffix, implode("\n", $output)); $_SESSION['fedora_ingest_files']["$dsid"] = $file . $file_suffix; return TRUE; } - - function displayMetadata() { - $output=''; - $exif = $this->item->get_datastream_dissemination('EXIF'); - if (trim($exif) != '') { - $exifDom = DOMDocument::loadXML($this->item->get_datastream_dissemination('EXIF')); - if ($exifDom != NULL) { - $description = $exifDom->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#','Description'); - if ($description->length > 0) { - $description=$description->item(0); - $output .= ''; - - $fieldset = array( - '#title' => t("!text", array('!text' => 'Technical Metadata')), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#value' => $output - ); - $output = theme('fieldset', $fieldset); - } - } - } + + /** + * display metadata ??? + * @return type + */ + function displayMetadata() { + $output = ''; + $exif = $this->item->get_datastream_dissemination('EXIF'); + if (trim($exif) != '') { + $exifDom = DOMDocument::loadXML($this->item->get_datastream_dissemination('EXIF')); + if ($exifDom != NULL) { + $description = $exifDom->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'Description'); + if ($description->length > 0) { + $description = $description->item(0); + $output .= ''; + + $fieldset = array( + '#title' => t("!text", array('!text' => 'Technical Metadata')), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#value' => $output + ); + $output = theme('fieldset', $fieldset); + } + } + } return $output; } - + } diff --git a/plugins/Ffmpeg.inc b/plugins/Ffmpeg.inc index f2faedac..90436808 100644 --- a/plugins/Ffmpeg.inc +++ b/plugins/Ffmpeg.inc @@ -1,26 +1,44 @@ '00:00:10', 's' => null); + $defaults = array('ss' => '00:00:10', 's' => null); $params = array_merge($defaults, $parameterArray); $system = getenv('System'); - $file_suffix = '_'. $dsid . '.' . $file_ext; - $returnValue=TRUE; - $output=array(); + $file_suffix = '_' . $dsid . '.' . $file_ext; + $returnValue = TRUE; + $output = array(); $size = ''; - if($params['s'] != null) { + if ($params['s'] != null) { $size = ' -s ' . escapeshellarg($params['s']); } exec('ffmpeg -i ' . escapeshellarg($file) . ' -r 1 -ss ' . escapeshellarg($params['ss']) . ' ' . $size . ' -t 1 ' . escapeshellarg($file . $file_suffix)); @@ -32,4 +50,5 @@ class Ffmpeg { $_SESSION['fedora_ingest_files']["$dsid"] = $file . $file_suffix; return TRUE; } + } diff --git a/plugins/Flv.inc b/plugins/Flv.inc index 4b16fe7d..4345428f 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -1,18 +1,31 @@ createElement("foxml:datastream"); $datastream->setAttribute("ID", "QDC"); @@ -33,7 +46,7 @@ class FormBuilder { $oai->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $content->appendChild($oai); //dc elements - $previousElement=NULL; //used in case we have to nest elements for qualified dublin core + $previousElement = NULL; //used in case we have to nest elements for qualified dublin core foreach ($form_values as $key => $value) { $index = strrpos($key, '-'); if ($index > 01) { @@ -42,7 +55,7 @@ class FormBuilder { $test = substr($key, 0, 2); - if ($test=='dc'||$test=='ap') {//don't try to process other form values + if ($test == 'dc' || $test == 'ap') {//don't try to process other form values try { if (!strcmp(substr($key, 0, 4), 'app_')) { $key = substr($key, 4); @@ -52,8 +65,7 @@ class FormBuilder { $previousElement = $dom->createElement($key, $value); $oai->appendChild($previousElement); } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); continue; } @@ -62,10 +74,15 @@ class FormBuilder { } } + /** + * Handle QDC Form ??? + * @param type $form_values + * @return type + */ function handleQDCForm($form_values) { $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; - $pid=$form_values['pid']; + $pid = $form_values['pid']; $rootElement = $dom->createElement("foxml:digitalObject"); $rootElement->setAttribute('PID', "$pid"); $rootElement->setAttribute('xmlns:foxml', "info:fedora/fedora-system:def/foxml#"); @@ -87,13 +104,13 @@ class FormBuilder { try { $soapHelper = new ConnectionHelper(); - $client=$soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); if ($client == NULL) { drupal_set_message(t('Error getting SOAP client.'), 'error'); return; } - $object=$client->__soapCall('ingest', array($params)); + $object = $client->__soapCall('ingest', array($params)); $deleteFiles = $form_values['delete_file']; //remove files from drupal file system if ($deleteFiles > 0) { @@ -102,20 +119,25 @@ class FormBuilder { } unlink($form_values['fullpath']); } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); return; } } + /** + * Create Fedora DataStream + * @param type $form_values + * @param type $dom + * @param type $rootElement + */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { module_load_include('inc', 'fedora_repository', 'MimeClass'); $mimetype = new MimeClass(); $server = NULL; - $file=$form_values['ingest-file-location']; + $file = $form_values['ingest-file-location']; $dformat = $mimetype->getType($file); - $fileUrl = 'http://'. $_SERVER['HTTP_HOST'] . $file; + $fileUrl = 'http://' . $_SERVER['HTTP_HOST'] . $file; $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); @@ -123,7 +145,7 @@ class FormBuilder { $ds1->setAttribute("ID", "OBJ"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "OBJ.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -137,16 +159,16 @@ class FormBuilder { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { $createdFile = strstr($createdFile, $file); $dformat = $mimetype->getType($createdFile); - $fileUrl = 'http://'. $_SERVER['HTTP_HOST'] . $createdFile; + $fileUrl = 'http://' . $_SERVER['HTTP_HOST'] . $createdFile; $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); - $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); - $dtitle = $dtitle . '_'. $dsid; + $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); + $dtitle = $dtitle . '_' . $dsid; $ds1 = $dom->createElement("foxml:datastream"); $ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -158,9 +180,12 @@ class FormBuilder { $rootElement->appendChild($ds1); } } - + /** * creates the RELS-EXT for the foxml + * @param type $form_values + * @param type $dom + * @param type $rootElement */ function createRelationShips($form_values, &$dom, &$rootElement) { $drdf = $dom->createElement("foxml:datastream"); @@ -190,14 +215,16 @@ class FormBuilder { $rdf->appendChild($rdfdesc); $rdfdesc->appendChild($member); $rootElement->appendChild($drdf); - } - + /** * creates the standard foxml properties + * @param type $form_values + * @param type $dom + * @param type $rootElement */ function createStandardFedoraStuff($form_values, &$dom, &$rootElement) { - /*foxml object properties section */ + /* foxml object properties section */ $objproperties = $dom->createElement("foxml:objectProperties"); $prop1 = $dom->createElement("foxml:property"); $prop1->setAttribute("NAME", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); @@ -222,11 +249,17 @@ class FormBuilder { $rootElement->appendChild($objproperties); } - + /** + * Build QDC Form + * @param type $form + * @param type $ingest_form_definition + * @param type $form_values + * @return type + */ function buildQDCForm(&$form, $ingest_form_definition, &$form_values) { $form['indicator2'] = array( - '#type' => 'fieldset', - '#title' => t('Ingest Digital Object Step #2') + '#type' => 'fieldset', + '#title' => t('Ingest Digital Object Step #2') ); foreach ($ingest_form_definition->form_elements->element as $element) { $name = strip_tags($element->name->asXML()); @@ -234,7 +267,7 @@ class FormBuilder { $required = strip_tags($element->required->asXML()); $required = strtolower($required); if ($required != 'TRUE') { - $required='0'; + $required = '0'; } $description = strip_tags($element->description->asXML()); @@ -247,20 +280,19 @@ class FormBuilder { $options["$field"] = $value; } $form['indicator2']["$name"] = array( - '#title' => $title, - '#required' => $required, - '#description' => $description, - '#type' => $type, - '#options' => $options, + '#title' => $title, + '#required' => $required, + '#description' => $description, + '#type' => $type, + '#options' => $options, ); - } else { $form['indicator2']["$name"] = array( - '#title' => $title, - '#required' => $required, - '#description' => $description, - '#type' => $type + '#title' => $title, + '#required' => $required, + '#description' => $description, + '#type' => $type ); } } @@ -269,3 +301,4 @@ class FormBuilder { } } + diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index 37b0e0d2..7f929fdd 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -1,20 +1,33 @@ getType($file); //$fileUrl = 'http://'.$_SERVER['HTTP_HOST'].$file; - $fileUrl = $base_url .'/'. drupal_urlencode($file); + $fileUrl = $base_url . '/' . drupal_urlencode($file); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); @@ -32,7 +45,7 @@ class FlvFormBuilder extends FormBuilder { $ds1->setAttribute("ID", "FLV"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "FLV.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -44,7 +57,7 @@ class FlvFormBuilder extends FormBuilder { $rootElement->appendChild($ds1); $createdFile = drupal_get_path('module', 'Fedora_Repository') . '/images/flashThumb.jpg'; - $fileUrl = $base_url .'/'. drupal_urlencode($createdFile); //'http://'.$_SERVER['HTTP_HOST'].'/'.$createdFile; + $fileUrl = $base_url . '/' . drupal_urlencode($createdFile); //'http://'.$_SERVER['HTTP_HOST'].'/'.$createdFile; $ds1 = $dom->createElement("foxml:datastream"); $ds1->setAttribute("ID", "TN"); $ds1->setAttribute("STATE", "A"); @@ -60,5 +73,6 @@ class FlvFormBuilder extends FormBuilder { $ds1v->appendChild($ds1content); $rootElement->appendChild($ds1); } + } diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 4fd3fa7d..075e0dfb 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -2,19 +2,31 @@ // $Id$ -/* - * Created on 19-Feb-08 - * - * +/** + * @file + * FormBuilder class + */ + +/** * implements methods from content model ingest form xml * builds a dc metadata form -*/ + */ class FormBuilder { + + /** + * Constructor + */ function FormBuilder() { module_load_include('inc', 'FormBuilder', ''); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } + /** + * Create QDC Stream ?? + * @param type $form_values + * @param type $dom + * @param type $rootElement + */ function createQDCStream($form_values, &$dom, &$rootElement) { $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "DC"); @@ -35,7 +47,7 @@ class FormBuilder { $oai->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $content->appendChild($oai); //dc elements - $previousElement=NULL;//used in case we have to nest elements for qualified dublin core + $previousElement = NULL; //used in case we have to nest elements for qualified dublin core foreach ($form_values as $key => $value) { $key = str_replace('_', ':', $key); $index = strrpos($key, '-'); @@ -55,18 +67,22 @@ class FormBuilder { $previousElement = $dom->createElement($key, $value); $oai->appendChild($previousElement); } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); continue; } } $rootElement->appendChild($datastream); } - } - //create the security Policy + /** + * Create the security policy + * @param type $collectionPid + * @param type $dom + * @param type $rootElement + * @return type + */ function createPolicy($collectionPid, &$dom, &$rootElement) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); @@ -78,8 +94,7 @@ class FormBuilder { } try { $xml = new SimpleXMLElement($policyStreamDoc); - } - catch (Exception $e) { + } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); drupal_set_message(t('Problem getting security policy: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; @@ -91,7 +106,7 @@ class FormBuilder { return FALSE; } $dom->importNode($policyElement, TRUE); - $value=$policyElement->appendXML($policyStreamDoc); + $value = $policyElement->appendXML($policyStreamDoc); if (!$value) { drupal_set_message(t('Error creating security policy stream.')); watchdog(t("Fedora_Repository"), t("Error creating security policy stream, could not parse collection policy template file."), NULL, WATCHDOG_NOTICE); @@ -114,14 +129,18 @@ class FormBuilder { return TRUE; } - + /** + * Handle QDC Form ?? + * @param type $form_values + * @return type + */ function handleQDCForm($form_values) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - + $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; - $pid=$form_values['pid']; + $pid = $form_values['pid']; $rootElement = $dom->createElement("foxml:digitalObject"); $rootElement->setAttribute('VERSION', '1.1'); $rootElement->setAttribute('PID', "$pid"); @@ -134,13 +153,13 @@ class FormBuilder { // Create relationships $this->createRelationShips($form_values, $dom, $rootElement); $collectionPid = $form_values['collection_pid']; - + if (($cp = CollectionPolicy::LoadFromCollection($collectionPid)) !== FALSE) { - $collectionName = trim($cp->getName()); + $collectionName = trim($cp->getName()); if (trim($collectionName) != '') { $form_values['dc_relation'] = $collectionName; } - } + } // Create dublin core $this->createQDCStream($form_values, $dom, $rootElement); @@ -150,43 +169,49 @@ class FormBuilder { $this->createPolicy($collectionPid, &$dom, &$rootElement); try { - + $object = Fedora_Item::ingest_from_FOXML($dom); if (!empty($object->pid)) { // drupal_set_message("Item ". l($object->pid, 'fedora/repository/'. $object->pid) . " created successfully.", "status"); - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/'. $object->pid))), "status"); + drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/' . $object->pid))), "status"); } - if (!empty( $_SESSION['fedora_ingest_files'])) { + if (!empty($_SESSION['fedora_ingest_files'])) { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { file_delete($createdFile); } } file_delete($form_values['ingest-file-location']); - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); watchdog(t("Fedora_Repository"), t("Error ingesting object: !e", array('!e' => $e->getMessage())), NULL, WATCHDOG_ERROR); return; } } + /** + * Create Fedora Data stream + * @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']; + $server = NULL; + $file = $form_values['ingest-file-location']; - if (!empty( $file)) { + if (!empty($file)) { $dformat = $mimetype->getType($file); - + $parts = explode('/', $file); foreach ($parts as $n => $part) { $parts[$n] = rawurlencode($part); } $path = implode('/', $parts); $fileUrl = $base_url . '/' . $path; - + $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -194,7 +219,7 @@ class FormBuilder { $ds1->setAttribute("ID", "OBJ"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $rootElement->appendChild($ds1); $ds1v->setAttribute("ID", "OBJ.0"); @@ -207,27 +232,24 @@ class FormBuilder { $ds1v->appendChild($ds1content); } if (!empty($_SESSION['fedora_ingest_files'])) { - - - + foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { - - - if (!empty($file)) { - $found = strstr($createdFile, $file); - if ($found !== FALSE) { - $createdFile = $found; - } - } + + if (!empty($file)) { + $found = strstr($createdFile, $file); + if ($found !== FALSE) { + $createdFile = $found; + } + } $dformat = $mimetype->getType($createdFile); - $parts = explode('/', $createdFile); + $parts = explode('/', $createdFile); foreach ($parts as $n => $part) { $parts[$n] = rawurlencode($part); } $path = implode('/', $parts); $fileUrl = $base_url . '/' . $path; - + $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -236,7 +258,7 @@ class FormBuilder { $ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -250,9 +272,11 @@ class FormBuilder { } } - /** * Creates the RELS-EXT for the foxml + * @param type $form_values + * @param type $dom + * @param type $rootElement */ function createRelationShips($form_values, &$dom, &$rootElement) { $drdf = $dom->createElement("foxml:datastream"); @@ -278,11 +302,11 @@ class FormBuilder { if (!isset($relationship)) { $relationship = 'isMemberOfCollection'; } - $member = $dom->createElement("fedora:". $relationship); + $member = $dom->createElement("fedora:" . $relationship); $membr = $form_values['collection_pid']; $member->setAttribute("rdf:resource", "info:fedora/$membr"); $rdfHasModel = $dom->createElement("fedora-model:hasModel"); - $contentModelPid=$form_values['content_model_pid']; + $contentModelPid = $form_values['content_model_pid']; $rdfHasModel->setAttribute("rdf:resource", "info:fedora/$contentModelPid"); $drdf->appendChild($dvrdf); $dvrdf->appendChild($dvcontent); @@ -293,9 +317,11 @@ class FormBuilder { $rootElement->appendChild($drdf); } - /** * Creates the standard foxml properties + * @param type $form_values + * @param type $dom + * @param type $rootElement */ function createStandardFedoraStuff($form_values, &$dom, &$rootElement) { // Foxml object properties section @@ -315,57 +341,66 @@ class FormBuilder { $rootElement->appendChild($objproperties); } - + /** + * Build QDC Form + * @param type $form + * @param type $elements + * @param type $form_values + * @return string + */ function buildQDCForm(&$form, $elements, &$form_values) { $form['#multistep'] = TRUE; // used so that it triggers a form rebuild every time. $form['indicator2'] = array( '#type' => 'fieldset', '#title' => t('Ingest digital object step #2'), ); - + foreach ($elements as $element) { - - if ($element['type'] == 'markup') { - $el = array('#value'=> $element['description']); - } else { - $el = array( - '#title' => $element['label'], - '#required' => ($element['required'] ? 1 : 0), - '#description' => $element['description'], - '#type' => $element['type'] - ); - } - $name = explode('][', $element['name']); - $elLocation = &$form['indicator2']; - while (isset($elLocation[$name[0]]) && ($partial = array_shift($name)) != NULL) { - $elLocation = &$elLocation[$partial]; - } - - $autocomplete_path = FALSE; - $autocomplete_omit_collection = FALSE; + if ($element['type'] == 'markup') { + $el = array('#value' => $element['description']); + } + else { + $el = array( + '#title' => $element['label'], + '#required' => ($element['required'] ? 1 : 0), + '#description' => $element['description'], + '#type' => $element['type'] + ); + } + + $name = explode('][', $element['name']); + $elLocation = &$form['indicator2']; + while (isset($elLocation[$name[0]]) && ($partial = array_shift($name)) != NULL) { + $elLocation = &$elLocation[$partial]; + } + + $autocomplete_path = FALSE; + $autocomplete_omit_collection = FALSE; foreach ($element['parameters'] as $key => $val) { if ($key == '#autocomplete_path') { - $autocomplete_path = $val; - } elseif ($key == '#autocomplete_omit_collection') { - $autocomplete_omit_collection = TRUE; - } else { - $el[$key]=$val; - } + $autocomplete_path = $val; + } + elseif ($key == '#autocomplete_omit_collection') { + $autocomplete_omit_collection = TRUE; + } + else { + $el[$key] = $val; + } } - if ($autocomplete_path !== FALSE) { - $el['#autocomplete_path'] = $autocomplete_path . (!$autocomplete_omit_collection?'/'.$form_values['storage']['collection_pid']:'/'); - } + if ($autocomplete_path !== FALSE) { + $el['#autocomplete_path'] = $autocomplete_path . (!$autocomplete_omit_collection ? '/' . $form_values['storage']['collection_pid'] : '/'); + } if ($element['type'] == 'select' || $element['type'] == 'other_select') { - $el['#options']= isset($element['authoritative_list'])?$element['authoritative_list']:array(); + $el['#options'] = isset($element['authoritative_list']) ? $element['authoritative_list'] : array(); } - + $elLocation[join('][', $name)] = $el; } - + return $form; } - + } diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 9971c367..c9125862 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -2,40 +2,54 @@ // $Id$ -/* - * - * - * This Class implements the methods defined in the STANDARD_IMAGE content model +/** + * @file + * Image Manipulation class */ +/** + * This Class implements the methods defined in the STANDARD_IMAGE content model + */ class ImageManipulation { + /** + * Constructor + */ function ImageManipulation() { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); } + /** + * Create a preview ?? + * @param type $parameterArray + * @param type $dsid + * @param type $file + * @param type $file_ext + * @return string + */ function createPreview($parameterArray, $dsid, $file, $file_ext) { $system = getenv('System'); $file_suffix = '_' . $dsid . '.' . $file_ext; - $width = $parameterArray['width']; + $width = $parameterArray['width']; if (!isset($parameterArray['height'])) { - $height = $width; - } else { - $height = $parameterArray['height']; + $height = $width; + } + else { + $height = $parameterArray['height']; } $returnValue = TRUE; $output = array(); - - $destDir = dirname($file).'/work'; - $destFile = $destDir .'/'. basename($file) . $file_suffix; - if (!is_dir($destDir)) { + + $destDir = dirname($file) . '/work'; + $destFile = $destDir . '/' . basename($file) . $file_suffix; + if (!is_dir($destDir)) { @mkdir($destDir); } if (!file_exists($destFile)) { - exec('convert -resize ' . $width . 'x'.$height.' -quality 85 "' . $file . '"[0] -strip "' .$destFile . '" 2>&1 &', $output, $returnValue); + exec('convert -resize ' . $width . 'x' . $height . ' -quality 85 "' . $file . '"[0] -strip "' . $destFile . '" 2>&1 &', $output, $returnValue); } else $returnValue = '0'; @@ -49,6 +63,14 @@ class ImageManipulation { } } + /** + * Create PNG + * @param type $parameterArray + * @param type $dsid + * @param type $file + * @param type $file_ext + * @return string + */ function createPNG($parameterArray = NULL, $dsid, $file, $file_ext) { $file_suffix = '_' . $dsid . '.' . $file_ext; $returnValue = TRUE; @@ -69,6 +91,14 @@ class ImageManipulation { } } + /** + * Create JPEG 2000 + * @param type $parameterArray + * @param type $dsid + * @param type $file + * @param type $file_ext + * @return type + */ function createJP2($parameterArray = NULL, $dsid, $file, $file_ext) { $file_suffix = "_$dsid.$file_ext"; $return_value = TRUE; @@ -115,7 +145,14 @@ class ImageManipulation { } } - //use imagemapi to manipulate images instead of going directly to imagemagick or whatever + /** + * use imagemapi to manipulate images instead of going directly to imagemagick or whatever + * @param type $parameterArray + * @param type $dsid + * @param type $file + * @param type $file_ext + * @return type + */ function manipulateImage($parameterArray = NULL, $dsid, $file, $file_ext) { $height = $parameterArray['height']; $width = $parameterArray['width']; @@ -151,6 +188,14 @@ class ImageManipulation { } } + /** + * Create Thumbnail from PDF + * @param type $parameterArray + * @param type $dsid + * @param type $file + * @param type $file_ext + * @return boolean + */ function createThumbnailFromPDF($parameterArray, $dsid, $file, $file_ext) { $height = $parameterArray['height']; $width = $parameterArray['width']; @@ -185,6 +230,14 @@ class ImageManipulation { } } + /** + * Create Thumbnail + * @param type $parameterArray + * @param type $dsid + * @param type $file + * @param type $file_ext + * @return boolean + */ function createThumbnail($parameterArray, $dsid, $file, $file_ext) { // var_dump($parameterArray);exit(0); $file_suffix = '_' . $dsid . '.' . $file_ext; diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index 6eb36d1b..b9741dca 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -2,244 +2,268 @@ // $Id$ +/** + * @file + * ModsFormBuilder class + */ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); + +/** + * ModsFormBuilder class ??? + */ class ModsFormBuilder extends FormBuilder { + static $MODS_NS = 'http://www.loc.gov/mods/v3'; protected $cm; protected $item; - protected $pid; - - function __construct($pid=null) - { - parent::__construct(); - if ($pid !== null) - { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - $this->pid=$pid; - $this->cm = ContentModel::loadFromObject($pid); - $this->item = new fedora_item($pid); - } - } - - function handleEditMetadataForm(&$form_id, &$form_values, &$soap_client) - { + protected $pid; + + /** + * Constructor + * @param type $pid + */ + function __construct($pid=null) { + parent::__construct(); + if ($pid !== null) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + + $this->pid = $pid; + $this->cm = ContentModel::loadFromObject($pid); + $this->item = new fedora_item($pid); + } + } + + /** + * Handle Edit Metadata Form ??? + * @param &$form_id + * @param &$form_values + * @param &$soap_client + */ + function handleEditMetadataForm(&$form_id, &$form_values, &$soap_client) { $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; - $mods = $this->modsFromForm($form_values,$dom); + $mods = $this->modsFromForm($form_values, $dom); $dom->appendChild($mods); - + if ($this->item->modify_datastream_by_value($dom->saveXML(), 'MODS', "MODS Record", 'text/xml') !== NULL) { - drupal_set_message(t('Successfully updated MODS datastream for object %pid', array('%pid'=>$this->pid))); - } - drupal_goto('/fedora/repository/'.$this->pid); - } - - function buildEditMetadataForm() - { - $form['#multistep'] = TRUE; // used so that it triggers a form rebuild every time. - $form['indicator2'] = array( - '#type' => 'fieldset', - '#title' => t('Edit metadata'), - ); - + drupal_set_message(t('Successfully updated MODS datastream for object %pid', array('%pid' => $this->pid))); + } + drupal_goto('/fedora/repository/' . $this->pid); + } + + /** + * Build Edit Metadata Form + * @return array + */ + function buildEditMetadataForm() { + $form['#multistep'] = TRUE; // used so that it triggers a form rebuild every time. + $form['indicator2'] = array( + '#type' => 'fieldset', + '#title' => t('Edit metadata'), + ); + if ($this->cm !== FALSE && $this->item != NULL) { - $form['pid'] = array('#type'=>'hidden','#value'=>$this->pid); - + $form['pid'] = array('#type' => 'hidden', '#value' => $this->pid); + $elements = $this->cm->getIngestFormElements(); - $content = $this->item->get_datastream_dissemination('MODS'); - - if (trim($content) != '') { - $dom = DOMDocument::loadXML($content); - $xpath = new DOMXPath($dom); - // Register the php: namespace (required) - $xpath->registerNamespace("php", "http://php.net/xpath"); - - // Register PHP functions (no restrictions) - $xpath->registerPHPFunctions(); - - foreach ($elements as $element) { - - $el = array( - '#title' => $element['label'], - '#required' => ($element['required'] ? 1 : 0), - '#description' => $element['description'], - '#type' => $element['type'] - ); - - $includeEl = true; - $elname = explode('][', $element['name']); - $elLocation = &$form['indicator2']; - while (isset($elLocation[$name[0]]) && ($partial = array_shift($elname)) != NULL) { - $elLocation = &$elLocation[$partial]; - } - - foreach ($element['parameters'] as $key => $val) { - switch ($key) { - case '#autocomplete_path': - $val .= '/'. $form_values['storage']['collection_pid']; - break; - - case '#exclude_from_edit_metadata': - $includeEl=FALSE; - break; - - - case '#edit_metadata_xpath': - $nodeList = $xpath->evaluate($val); + $content = $this->item->get_datastream_dissemination('MODS'); + + if (trim($content) != '') { + $dom = DOMDocument::loadXML($content); + $xpath = new DOMXPath($dom); + // Register the php: namespace (required) + $xpath->registerNamespace("php", "http://php.net/xpath"); + + // Register PHP functions (no restrictions) + $xpath->registerPHPFunctions(); + + foreach ($elements as $element) { + + $el = array( + '#title' => $element['label'], + '#required' => ($element['required'] ? 1 : 0), + '#description' => $element['description'], + '#type' => $element['type'] + ); + + $includeEl = true; + $elname = explode('][', $element['name']); + $elLocation = &$form['indicator2']; + while (isset($elLocation[$name[0]]) && ($partial = array_shift($elname)) != NULL) { + $elLocation = &$elLocation[$partial]; + } + + foreach ($element['parameters'] as $key => $val) { + switch ($key) { + case '#autocomplete_path': + $val .= '/' . $form_values['storage']['collection_pid']; + break; + + case '#exclude_from_edit_metadata': + $includeEl = FALSE; + break; + + + case '#edit_metadata_xpath': + $nodeList = $xpath->evaluate($val); // echo $val. ' '.$nodeList->length.' '; // echo $nodeList->item(0)->nodeValue.' '; // echo '
      '; - if (is_string($nodeList)) - { - $el['#default_value']=$nodeList; - } else if ($nodeList->length > 1) - { - $el['#default_value'] = array(); - foreach ($nodeList as $node) - { - $el['#default_value'][] = $node->nodeValue; - } - } else if ($nodeList->length > 0) - { - if ($el['#type'] == 'list') { - $values=array(); - for ($i=0;$i<$nodeList->length;$i++) { - $values[]=$nodeList->item($i)->nodeValue; - } - $el['#default_value']=join('; ',$values); - } else { - $el['#default_value'] = $nodeList->item(0)->nodeValue; - } - } - break; - } - - if ($key != '#sticky') { - $el[$key]=$val; - } - - } - - if ($element['type'] == 'people') - { - - $names = $xpath->evaluate('/mods:mods/mods:name'); - $people=array(); - foreach ($names as $mname) { - - $type = $mname->getAttribute('type'); - $role = $mname->getElementsByTagName('roleTerm')->item(0)->nodeValue; - - $nameParts = $mname->getElementsByTagName('namePart'); - foreach ($nameParts as $namePart) - { - switch ($namePart->getAttribute('type')) { - case 'given': $given = $namePart->nodeValue; break; - case 'family': $family = $namePart->nodeValue; break; - case 'termsOfAddress': $title = $namePart->nodeValue; break; - case 'date': $date = $namePart->nodeValue; break; - default: $name = $namePart->nodeValue; break; + if (is_string($nodeList)) { + $el['#default_value'] = $nodeList; + } + else if ($nodeList->length > 1) { + $el['#default_value'] = array(); + foreach ($nodeList as $node) { + $el['#default_value'][] = $node->nodeValue; + } + } + else if ($nodeList->length > 0) { + if ($el['#type'] == 'list') { + $values = array(); + for ($i = 0; $i < $nodeList->length; $i++) { + $values[] = $nodeList->item($i)->nodeValue; + } + $el['#default_value'] = join('; ', $values); + } + else { + $el['#default_value'] = $nodeList->item(0)->nodeValue; + } + } + break; + } + + if ($key != '#sticky') { + $el[$key] = $val; + } } - } - - $person=array('role'=>$role); - switch ($type) - { - case 'personal': - if (isset($given) && isset($family) && !isset($name)) { - $name = (isset($title)?$title.' ':'').$family.', '.$family; - } - $person['name']=$name; - $person['date']=$date; - break; - case 'organization': - $person['organization'] = $name; - break; - case 'conference': - $person['conference']=$name; - $person['date']=$date; - break; - } - $people[]=$person; - } - - $names = $xpath->evaluate('/mods:mods/mods:subject/mods:name'); - foreach ($names as $mname) { - - $type = $mname->getAttribute('type'); - - $nameParts = $mname->getElementsByTagName('namePart'); - foreach ($nameParts as $namePart) - { - switch ($namePart->getAttribute('type')) { - case 'given': $given = $namePart->nodeValue; break; - case 'family': $family = $namePart->nodeValue; break; - case 'termsOfAddress': $title = $namePart->nodeValue; break; - case 'date': $date = $namePart->nodeValue; break; - default: $name = $namePart->nodeValue; break; - } - } - - $person=array('subject'=>1); - switch ($type) - { - case 'personal': - if (isset($given) && isset($family) && !isset($name)) { - $name = (isset($title)?$title.' ':'').$family.', '.$family; - } - $person['name']=$name; - $person['date']=$date; - break; - case 'organization': - $person['organization'] = $name; - break; - case 'conference': - $person['conference']=$name; - $person['date']=$date; - break; - } - $people[]=$person; - } - - $el['#default_value'] = $people; - - } - - - if ($element['type'] == 'select' || $element['type'] == 'other_select') { - $el['#options']= isset($element['authoritative_list'])?$element['authoritative_list']:array(); - } - - if ($includeEl) { - $elLocation[join('][', $elname)] = $el; - } - } - - $form['submit'] = array( - '#type' => 'submit', - '#submit' => array('fedora_repository_edit_qdc_form_submit'), - '#value' => 'Save Metadata' - ); - - return $form; + if ($element['type'] == 'people') { + + $names = $xpath->evaluate('/mods:mods/mods:name'); + $people = array(); + foreach ($names as $mname) { + + $type = $mname->getAttribute('type'); + $role = $mname->getElementsByTagName('roleTerm')->item(0)->nodeValue; + + $nameParts = $mname->getElementsByTagName('namePart'); + foreach ($nameParts as $namePart) { + switch ($namePart->getAttribute('type')) { + case 'given': $given = $namePart->nodeValue; + break; + case 'family': $family = $namePart->nodeValue; + break; + case 'termsOfAddress': $title = $namePart->nodeValue; + break; + case 'date': $date = $namePart->nodeValue; + break; + default: $name = $namePart->nodeValue; + break; + } + } + + $person = array('role' => $role); + switch ($type) { + case 'personal': + if (isset($given) && isset($family) && !isset($name)) { + $name = (isset($title) ? $title . ' ' : '') . $family . ', ' . $family; + } + $person['name'] = $name; + $person['date'] = $date; + break; + case 'organization': + $person['organization'] = $name; + break; + case 'conference': + $person['conference'] = $name; + $person['date'] = $date; + break; + } + $people[] = $person; + } + + $names = $xpath->evaluate('/mods:mods/mods:subject/mods:name'); + foreach ($names as $mname) { + + $type = $mname->getAttribute('type'); + + $nameParts = $mname->getElementsByTagName('namePart'); + foreach ($nameParts as $namePart) { + switch ($namePart->getAttribute('type')) { + case 'given': $given = $namePart->nodeValue; + break; + case 'family': $family = $namePart->nodeValue; + break; + case 'termsOfAddress': $title = $namePart->nodeValue; + break; + case 'date': $date = $namePart->nodeValue; + break; + default: $name = $namePart->nodeValue; + break; + } + } + + $person = array('subject' => 1); + switch ($type) { + case 'personal': + if (isset($given) && isset($family) && !isset($name)) { + $name = (isset($title) ? $title . ' ' : '') . $family . ', ' . $family; + } + $person['name'] = $name; + $person['date'] = $date; + break; + case 'organization': + $person['organization'] = $name; + break; + case 'conference': + $person['conference'] = $name; + $person['date'] = $date; + break; + } + $people[] = $person; + } + + $el['#default_value'] = $people; + } + + + if ($element['type'] == 'select' || $element['type'] == 'other_select') { + $el['#options'] = isset($element['authoritative_list']) ? $element['authoritative_list'] : array(); + } + + if ($includeEl) { + $elLocation[join('][', $elname)] = $el; + } + } + + $form['submit'] = array( + '#type' => 'submit', + '#submit' => array('fedora_repository_edit_qdc_form_submit'), + '#value' => 'Save Metadata' + ); + + return $form; } } - - } - - function handleModsForm(&$form_values,&$form_state) { + } + + /** + * Handle Mods Form + * @param &$form_values + * @param &$form_state + */ + function handleModsForm(&$form_values, &$form_state) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - - $form_state['storage']['people']=NULL; //clears out old entities for the next run of the formbuilder. - + + $form_state['storage']['people'] = NULL; //clears out old entities for the next run of the formbuilder. + $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; - $pid=$form_values['pid']; + $pid = $form_values['pid']; $rootElement = $dom->createElement("foxml:digitalObject"); $rootElement->setAttribute('VERSION', '1.1'); $rootElement->setAttribute('PID', "$pid"); @@ -247,24 +271,24 @@ class ModsFormBuilder extends FormBuilder { $rootElement->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $rootElement->setAttribute('xsi:schemaLocation', "info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"); $dom->appendChild($rootElement); - + // Create standard fedora stuff $form_values['dc:title'] = $form_values['mods_title']; $this->createStandardFedoraStuff($form_values, $dom, $rootElement); - + // Create relationships $this->createRelationShips($form_values, $dom, $rootElement); $collectionPid = $form_values['collection_pid']; - + if (($cp = CollectionPolicy::LoadFromCollection($collectionPid)) !== FALSE) { - $collectionName =trim($cp->getName()); - if (trim($collectionName)!='') { - $form_values['dc_relation']=$collectionName; + $collectionName = trim($cp->getName()); + if (trim($collectionName) != '') { + $form_values['dc_relation'] = $collectionName; } - } + } // Create MODS $this->createModsStream($form_values, $dom, $rootElement); - $this->createCollectionPolicy($form_values, $dom, $rootElement); + $this->createCollectionPolicy($form_values, $dom, $rootElement); $this->createWorkflowStream($form_values, $dom, $rootElement); if (!empty($form_values['ingest-file-location'])) { @@ -274,33 +298,37 @@ class ModsFormBuilder extends FormBuilder { // header('Content-type: application/xml'); // echo $dom->saveXML(); exit(); - + try { - $object = Fedora_Item::ingest_from_FOXML($dom); - //for some reason, ingest_from_FOXML does not generate a JMS message - //I just modify the workflow DS and it sends a JMS message. - $item = new Fedora_Item($object->pid); - $item->modify_datastream_by_value( $item->get_datastream_dissemination('WORKFLOW'), 'WORKFLOW', "Workflow Record", 'text/xml'); - - if (!empty($object->pid)) { - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/'. $object->pid))), "status"); - } - if (!empty( $_SESSION['fedora_ingest_files'])) { - foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { - file_delete($createdFile); - } - } - file_delete($form_values['ingest-file-location']); - } - catch (exception $e) { + $object = Fedora_Item::ingest_from_FOXML($dom); + //for some reason, ingest_from_FOXML does not generate a JMS message + //I just modify the workflow DS and it sends a JMS message. + $item = new Fedora_Item($object->pid); + $item->modify_datastream_by_value($item->get_datastream_dissemination('WORKFLOW'), 'WORKFLOW', "Workflow Record", 'text/xml'); + + if (!empty($object->pid)) { + drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/' . $object->pid))), "status"); + } + if (!empty($_SESSION['fedora_ingest_files'])) { + foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { + file_delete($createdFile); + } + } + file_delete($form_values['ingest-file-location']); + } catch (exception $e) { drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); watchdog(t("Fedora_Repository"), t("Error ingesting object: !e", array('!e' => $e->getMessage())), NULL, WATCHDOG_ERROR); return; } - } - - - function createCollectionPolicy($form_values, &$dom, &$rootElement) { + } + + /** + * Create Collection Policy ?? + * @param $form_values + * @param &$dom + * @param &$rootElement + */ + function createCollectionPolicy($form_values, &$dom, &$rootElement) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $model = new fedora_item($form_values['content_model_pid']); $ds_list = $model->get_datastreams_list_as_array(); @@ -308,10 +336,10 @@ class ModsFormBuilder extends FormBuilder { $cp = $model->get_datastream_dissemination('COLLECTION_POLICY_TMPL'); $cpDom = DOMDocument::loadXML($cp); $cpRootEl = $cpDom->getElementsByTagName('collection_policy'); - if ($cpRootEl->length >0) { - $cpRootEl=$cpRootEl->item(0); + if ($cpRootEl->length > 0) { + $cpRootEl = $cpRootEl->item(0); $newNode = $dom->importNode($cpRootEl, TRUE); - + $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "COLLECTION_POLICY"); $datastream->setAttribute("STATE", "A"); @@ -328,7 +356,13 @@ class ModsFormBuilder extends FormBuilder { } } } - + + /** + * Create Workflow Stream ?? + * @param $form_values + * @param &$dom + * @param &$rootElement + */ function createWorkflowStream($form_values, &$dom, &$rootElement) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $model = new fedora_item($form_values['content_model_pid']); @@ -337,10 +371,10 @@ class ModsFormBuilder extends FormBuilder { $workflow = $model->get_datastream_dissemination('WORKFLOW_TMPL'); $workflowDom = DOMDocument::loadXML($workflow); $workflowRootEl = $workflowDom->getElementsByTagName('workflow'); - if ($workflowRootEl->length >0) { - $workflowRootEl=$workflowRootEl->item(0); + if ($workflowRootEl->length > 0) { + $workflowRootEl = $workflowRootEl->item(0); $newNode = $dom->importNode($workflowRootEl, TRUE); - + $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "WORKFLOW"); $datastream->setAttribute("STATE", "A"); @@ -357,9 +391,15 @@ class ModsFormBuilder extends FormBuilder { } } } - + + /** + * Create mods Stream ?? + * @param $form_values + * @param &$dom + * @param &$rootElement + */ function createModsStream($form_values, &$dom, &$rootElement) { - + $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "MODS"); $datastream->setAttribute("STATE", "A"); @@ -371,63 +411,67 @@ class ModsFormBuilder extends FormBuilder { $datastream->appendChild($version); $content = $dom->createElement("foxml:xmlContent"); $version->appendChild($content); - - $mods = $this->modsFromForm($form_values,$dom); + + $mods = $this->modsFromForm($form_values, $dom); $content->appendChild($mods); - - $rootElement->appendChild($datastream); - } + $rootElement->appendChild($datastream); + } - function modsFromForm(&$form_values,&$dom) - { + /** + * Mods From From ????? + * @param type $form_values + * @param type $dom + * @return type + */ + function modsFromForm(&$form_values, &$dom) { - ///begin writing MODS + ///begin writing MODS $mods = $dom->createElement("mods:mods"); $mods->setAttribute('version', '3.4'); $mods->setAttribute('xmlns:xlink', "http://www.w3.org/1999/xlink"); $mods->setAttribute('xmlns:mods', "http://www.loc.gov/mods/v3"); $mods->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $mods->setAttribute('xsi:schemaLocation', "http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd"); - - + + if (isset($form_values['mods_title']) && trim($form_values['mods_title']) != '') { $titleinfo = $dom->createElement('mods:titleInfo'); - $title = $dom->createElement('mods:title', htmlspecialchars($form_values['mods_title'])); + $title = $dom->createElement('mods:title', htmlspecialchars($form_values['mods_title'])); $titleinfo->appendChild($title); $mods->appendChild($titleinfo); } - - if (isset($form_values['mods_alternative_titles']) && trim($form_values['mods_alternative_titles']) != '') { - $titles=preg_split('/\s+\;\s+/',trim($form_values['mods_alternative_titles'])); + + if (isset($form_values['mods_alternative_titles']) && trim($form_values['mods_alternative_titles']) != '') { + $titles = preg_split('/\s+\;\s+/', trim($form_values['mods_alternative_titles'])); foreach ($titles as $t) { - $titleinfo = $dom->createElement('mods:titleInfo'); - $titleinfo->setAttribute('type','alternative') ; - $title = $dom->createElement('mods:title',$t); - $titleinfo->appendChild($title); - $mods->appendChild($titleinfo); + $titleinfo = $dom->createElement('mods:titleInfo'); + $titleinfo->setAttribute('type', 'alternative'); + $title = $dom->createElement('mods:title', $t); + $titleinfo->appendChild($title); + $mods->appendChild($titleinfo); } } - - if (isset($form_values['mods_alternative_title']) && trim($form_values['mods_alternative_title']) != '') { - $titleinfo = $dom->createElement('mods:titleInfo'); - $titleinfo->setAttribute('type','alternative') ; - $title = $dom->createElement('mods:title',trim($form_values['mods_alternative_title'])); - $titleinfo->appendChild($title); - $mods->appendChild($titleinfo); - } - + + if (isset($form_values['mods_alternative_title']) && trim($form_values['mods_alternative_title']) != '') { + $titleinfo = $dom->createElement('mods:titleInfo'); + $titleinfo->setAttribute('type', 'alternative'); + $title = $dom->createElement('mods:title', trim($form_values['mods_alternative_title'])); + $titleinfo->appendChild($title); + $mods->appendChild($titleinfo); + } + if (isset($form_values['mods_description']) && trim($form_values['mods_description']) != '') { - $abstract = $dom->createElement('mods:abstract', htmlspecialchars(trim($form_values['mods_description']))); - $mods->appendChild($abstract); + $abstract = $dom->createElement('mods:abstract', htmlspecialchars(trim($form_values['mods_description']))); + $mods->appendChild($abstract); } - + if (isset($form_values['pid']) && trim($form_values['pid']) != '') { - $identifier = $dom->createElement('mods:identifier', htmlspecialchars(trim(preg_replace('/\:/','\/',$form_values['pid'])))); + $identifier = $dom->createElement('mods:identifier', htmlspecialchars(trim(preg_replace('/\:/', '\/', $form_values['pid'])))); $identifier->setAttribute('type', 'hdl'); $mods->appendChild($identifier); } - + if (isset($form_values['collection_pid']) && trim($form_values['collection_pid']) != '') { $relatedItem = $dom->createElement('mods:relatedItem'); $relatedItem->setAttribute('type', 'isMemberOfCollection'); @@ -435,13 +479,13 @@ class ModsFormBuilder extends FormBuilder { $relatedItem->appendChild($identifier); $mods->appendChild($relatedItem); } - + if (isset($form_values['mods_identifier']) && trim($form_values['mods_identifier']) != '') { $identifier = $dom->createElement('mods:identifier', htmlspecialchars(trim($form_values['mods_identifier']))); $identifier->setAttribute('type', 'local'); $mods->appendChild($identifier); } - + if (isset($form_values['mods_physicalLocation']) && trim($form_values['mods_physicalLocation']) != '') { $location = $dom->createElement('mods:location'); $physLocation = $dom->createElement('mods:physicalLocation', htmlspecialchars(trim($form_values['mods_physicalLocation']))); @@ -452,154 +496,152 @@ class ModsFormBuilder extends FormBuilder { } $mods->appendChild($location); } - + $originInfo = $dom->createElement('mods:originInfo'); $addOriginInfo = FALSE; if (isset($form_values['mods_pubinfo_place']) && trim($form_values['mods_pubinfo_place']) != '') { $place = $dom->createElement('mods:place'); - $placeTerm=$dom->createElement('mods:placeTerm', htmlspecialchars(trim($form_values['mods_pubinfo_place']))); + $placeTerm = $dom->createElement('mods:placeTerm', htmlspecialchars(trim($form_values['mods_pubinfo_place']))); $placeTerm->setAttribute('type', 'text'); $place->appendChild($placeTerm); $originInfo->appendChild($place); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_pubinfo_publisher']) && trim($form_values['mods_pubinfo_publisher']) != '') { $publisher = $dom->createElement('mods:publisher', htmlspecialchars(trim($form_values['mods_pubinfo_publisher']))); $originInfo->appendChild($publisher); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_pubinfo_edition']) && trim($form_values['mods_pubinfo_edition']) != '') { $edition = $dom->createElement('mods:edition', htmlspecialchars(trim($form_values['mods_pubinfo_edition']))); $originInfo->appendChild($edition); $addOriginInfo = TRUE; } - - + + if (isset($form_values['mods_pubinfo_date']) && trim($form_values['mods_pubinfo_date']) != '' && isset($form_values['mods_pubinfo_dateType']) && trim($form_values['mods_pubinfo_dateType']) != '') { - if (in_array($form_values['mods_pubinfo_dateType'], array('issued', 'created', 'copyright', 'captured'))) { - $date = $dom->createElement('mods:'. trim($form_values['mods_pubinfo_dateType']) .'Date', htmlspecialchars(trim($form_values['mods_pubinfo_date']))); - } - else { - //how to handle other types? otherDate? - $date= $dom->createElement('mods:otherDate', htmlspecialchars(trim($form_values['mods_pubinfo_date']))); - $date->setAttribute('type', htmlspecialchars(trim($form_values['mods_pubinfo_dateType']))); - } - $originInfo->appendChild($date); - $addOriginInfo = TRUE; - } else { + if (in_array($form_values['mods_pubinfo_dateType'], array('issued', 'created', 'copyright', 'captured'))) { + $date = $dom->createElement('mods:' . trim($form_values['mods_pubinfo_dateType']) . 'Date', htmlspecialchars(trim($form_values['mods_pubinfo_date']))); + } + else { + //how to handle other types? otherDate? + $date = $dom->createElement('mods:otherDate', htmlspecialchars(trim($form_values['mods_pubinfo_date']))); + $date->setAttribute('type', htmlspecialchars(trim($form_values['mods_pubinfo_dateType']))); + } + $originInfo->appendChild($date); + $addOriginInfo = TRUE; + } + else { if (isset($form_values['mods_createdDate'])) { - $date = $dom->createElement('mods:createdDate',htmlspecialchars(trim($form_values['mods_createdDate']))); - $originInfo->appendChild($date); + $date = $dom->createElement('mods:createdDate', htmlspecialchars(trim($form_values['mods_createdDate']))); + $originInfo->appendChild($date); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_issuedDate'])) { - $date = $dom->createElement('mods:issuedDate',htmlspecialchars(trim($form_values['mods_issuedDate']))); - $originInfo->appendChild($date); + $date = $dom->createElement('mods:issuedDate', htmlspecialchars(trim($form_values['mods_issuedDate']))); + $originInfo->appendChild($date); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_copyrightDate'])) { - $date = $dom->createElement('mods:copyrightDate',htmlspecialchars(trim($form_values['mods_copyrightDate']))); - $originInfo->appendChild($date); + $date = $dom->createElement('mods:copyrightDate', htmlspecialchars(trim($form_values['mods_copyrightDate']))); + $originInfo->appendChild($date); $addOriginInfo = TRUE; } - + if (isset($form_values['mods_capturedDate'])) { - $date = $dom->createElement('mods:capturedDate',htmlspecialchars(trim($form_values['mods_capturedDate']))); - $originInfo->appendChild($date); + $date = $dom->createElement('mods:capturedDate', htmlspecialchars(trim($form_values['mods_capturedDate']))); + $originInfo->appendChild($date); $addOriginInfo = TRUE; } - } - + if (isset($form_values['mods_pubinfo_journalFreq']) && trim($form_values['mods_pubinfo_journalFreq']) != '') { $frequency = $dom->createElement('mods:frequency', htmlspecialchars(trim($form_values['mods_pubinfo_journalFreq']))); $originInfo->appendChild($frequency); - $issuance= $dom->createElement('mods:issuance', 'journal'); + $issuance = $dom->createElement('mods:issuance', 'journal'); $originInfo->appendChild($issuance); $addOriginInfo = TRUE; - } + } elseif (isset($form_values['mods_pubinfo_journalFreq'])) { - $issuance= $dom->createElement('mods:issuance', 'monographic'); + $issuance = $dom->createElement('mods:issuance', 'monographic'); $originInfo->appendChild($issuance); } - - + + if ($addOriginInfo) { $mods->appendChild($originInfo); } - + if (isset($form_values['mods_note']) && trim($form_values['mods_note']) != '') { $note = $dom->createElement('mods:note', htmlspecialchars(trim($form_values['mods_note']))); $mods->appendChild($note); - } - + } + if (isset($form_values['mods_caption']) && trim($form_values['mods_caption']) != '') { $note = $dom->createElement('mods:note', htmlspecialchars(trim($form_values['mods_caption']))); - $note->setAttribute('type','caption'); + $note->setAttribute('type', 'caption'); $mods->appendChild($note); - } - + } + if (isset($form_values['mods_format']) && trim($form_values['mods_format']) != '') { $typeOfResource = $dom->createElement('mods:typeOfResource', htmlspecialchars($form_values['mods_format'])); $mods->appendChild($typeOfResource); } - - - if (isset($form_values['mods_language']) && trim($form_values['mods_language']) != '') - { + + + if (isset($form_values['mods_language']) && trim($form_values['mods_language']) != '') { $languageList = explode(';', htmlspecialchars($form_values['mods_language'])); - foreach ($languageList as $lang) - { - $language = $dom->createElement('mods:language'); - $langTerm = $dom->createElement('mods:languageTerm',htmlspecialchars($lang)); - $langTerm->setAttribute('type','text'); - $language->appendChild($langTerm); - $mods->appendChild($language); + foreach ($languageList as $lang) { + $language = $dom->createElement('mods:language'); + $langTerm = $dom->createElement('mods:languageTerm', htmlspecialchars($lang)); + $langTerm->setAttribute('type', 'text'); + $language->appendChild($langTerm); + $mods->appendChild($language); } } - - + + $hasSubject = FALSE; $subject = $dom->createElement('mods:subject'); - - + + // Hierarchical Geographic Subject if (isset($form_values['mods_country']) && trim($form_values['mods_country']) != '') { $hasSubject = TRUE; $geographic = $dom->createElement('mods:hierarchicalGeographic'); - - $country=$dom->createElement('mods:country', htmlspecialchars($form_values['mods_country'])); + + $country = $dom->createElement('mods:country', htmlspecialchars($form_values['mods_country'])); $geographic->appendChild($country); - + if (isset($form_values['mods_province']) && trim($form_values['mods_province']) != '') { - $province = $dom->createElement('mods:province', htmlspecialchars($form_values['mods_province'])); + $province = $dom->createElement('mods:province', htmlspecialchars($form_values['mods_province'])); $geographic->appendChild($province); } - + if (isset($form_values['mods_state']) && trim($form_values['mods_state']) != '') { - $state = $dom->createElement('mods:state', htmlspecialchars($form_values['mods_state'])); + $state = $dom->createElement('mods:state', htmlspecialchars($form_values['mods_state'])); $geographic->appendChild($state); } - + if (isset($form_values['mods_city']) && trim($form_values['mods_city']) != '') { - $city = $dom->createElement('mods:city', htmlspecialchars($form_values['mods_city'])); + $city = $dom->createElement('mods:city', htmlspecialchars($form_values['mods_city'])); $geographic->appendChild($city); } - + if (isset($form_values['mods_area']) && trim($form_values['mods_area']) != '') { - $state = $dom->createElement('mods:area', htmlspecialchars($form_values['mods_area'])); + $state = $dom->createElement('mods:area', htmlspecialchars($form_values['mods_area'])); $geographic->appendChild($state); } - - + + $subject->appendChild($geographic); } - + if (isset($form_values['mods_date']) && trim($form_values['mods_date']) != '') { $hasSubject = TRUE; $temporal = $dom->createElement('mods:temporal', htmlspecialchars($form_values['mods_date'])); @@ -608,13 +650,13 @@ class ModsFormBuilder extends FormBuilder { if (isset($form_values['mods_subjtitle']) && trim($form_values['mods_subjtitle']) != '') { $hasSubject = TRUE; - $titleInfo= $dom->createElement('mods:titleInfo'); + $titleInfo = $dom->createElement('mods:titleInfo'); $title = $dom->createElement('mods:title', htmlspecialchars($form_values['mods_subjtitle'])); $titleInfo->appendChild($title); $subject->appendChild($titleInfo); - } - - + } + + if (isset($form_values['mods_topics']) && trim($form_values['mods_topics']) != '') { $hasSubject = TRUE; $topicList = explode(';', htmlspecialchars($form_values['mods_topics'])); @@ -622,102 +664,101 @@ class ModsFormBuilder extends FormBuilder { if (isset($form_values['mods_topicAuthority']) && trim($form_values['mods_topicAuthority']) != '') { $authority = htmlspecialchars($form_values['mods_topicAuthority']); } - + foreach ($topicList as $t) { $topic = $dom->createElement('mods:topic', $t); $topic->setAttribute('authority', $authority); $subject->appendChild($topic); } } - - + + if (isset($form_values['mods_cc']['cc']) && $form_values['mods_cc']['cc']['cc_enable']) { - $commercial = trim($form_values['mods_cc']['cc']['cc_commercial']); - $modifications = trim($form_values['mods_cc']['cc']['cc_modifications']); - $jurisdiction = trim($form_values['mods_cc']['cc']['cc_jurisdiction']); - - module_load_include('inc','islandora_form_elements','includes/creative_commons.inc'); - - if (!isset(CreativeCommons::$cc_jurisdiction_vals[$jurisdiction])) - $jurisdiction=''; - $version = CreativeCommons::$cc_versions[$jurisdiction]; - - $license = 'by'. ($commercial != ''?'-'.$commercial:'') . ($modifications != ''?'-'.$modifications:'') . '/' . $version . '/'.($jurisdiction != ''?$jurisdiction.'/':'') ; - + $commercial = trim($form_values['mods_cc']['cc']['cc_commercial']); + $modifications = trim($form_values['mods_cc']['cc']['cc_modifications']); + $jurisdiction = trim($form_values['mods_cc']['cc']['cc_jurisdiction']); + + // Include islandora form elements only if needed ?? + module_load_include('inc', 'islandora_form_elements', 'includes/creative_commons.inc'); + + if (!isset(CreativeCommons::$cc_jurisdiction_vals[$jurisdiction])) + $jurisdiction = ''; + $version = CreativeCommons::$cc_versions[$jurisdiction]; + + $license = 'by' . ($commercial != '' ? '-' . $commercial : '') . ($modifications != '' ? '-' . $modifications : '') . '/' . $version . '/' . ($jurisdiction != '' ? $jurisdiction . '/' : ''); + $accessCondition = $dom->createElement('mods:accessCondition', htmlspecialchars($license)); $accessCondition->setAttribute('type', 'Creative Commons License'); $mods->appendChild($accessCondition); - - } - + if (isset($form_values['mods_rights']) && trim($form_values['mods_rights']) != '') { $accessCondition = $dom->createElement('mods:accessCondition', htmlspecialchars($form_values['mods_rights'])); $accessCondition->setAttribute('type', 'restriction on access; use and reproduction'); $mods->appendChild($accessCondition); } - - if (isset($form_values['mods_people']) && isset($form_values['mods_people']['people']) && is_array($form_values['mods_people']['people']) ) { + + if (isset($form_values['mods_people']) && isset($form_values['mods_people']['people']) && is_array($form_values['mods_people']['people'])) { foreach ($form_values['mods_people']['people'] as $key => $val) { $name = $dom->createElement('mods:name'); - $appendName=FALSE; + $appendName = FALSE; if (isset($val['role'])) { - $role = $dom->createElement('mods:role'); - $roleTerm = $dom->createElement('mods:roleTerm', htmlspecialchars(trim($val['role']))); - $roleTerm->setAttribute('type', 'text'); - $roleTerm->setAttribute('authority', 'marcrelator'); - $role->appendChild($roleTerm); - $name->appendChild($role); + $role = $dom->createElement('mods:role'); + $roleTerm = $dom->createElement('mods:roleTerm', htmlspecialchars(trim($val['role']))); + $roleTerm->setAttribute('type', 'text'); + $roleTerm->setAttribute('authority', 'marcrelator'); + $role->appendChild($roleTerm); + $name->appendChild($role); } - + if (isset($val['organization'])) { $name->setAttribute('type', 'organization'); if (trim($val['organization']) != '') { - $namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['organization']))); + $namePart = $dom->createElement('mods:namePart', htmlspecialchars(trim($val['organization']))); $name->appendChild($namePart); - $appendName=TRUE; + $appendName = TRUE; } - } + } elseif (isset($val['conference'])) { $name->setAttribute('type', 'conference'); if (trim($val['conference']) != '') { - $namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['conference']))); + $namePart = $dom->createElement('mods:namePart', htmlspecialchars(trim($val['conference']))); $name->appendChild($namePart); - $appendName=TRUE; + $appendName = TRUE; } - } + } else { $name->setAttribute('type', 'personal'); if (trim($val['name']) != '') { - $namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['name']))); + $namePart = $dom->createElement('mods:namePart', htmlspecialchars(trim($val['name']))); $name->appendChild($namePart); - $appendName=TRUE; - } + $appendName = TRUE; + } } - - if (isset($val['date'])) { - $namePart=$dom->createElement('mods:namePart', htmlspecialchars(trim($val['date']))); - $namePart->setAttribute('type','date'); + + if (isset($val['date'])) { + $namePart = $dom->createElement('mods:namePart', htmlspecialchars(trim($val['date']))); + $namePart->setAttribute('type', 'date'); $name->appendChild($namePart); } - + if ($appendName) { - if (isset($val['subject'])) { + if (isset($val['subject'])) { $subject->appendChild($name); - $hasSubject=TRUE; - } else { + $hasSubject = TRUE; + } + else { $mods->appendChild($name); } } + } + } - } - } - if ($hasSubject) { $mods->appendChild($subject); } - + return $mods; } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 9644dd71..70d35827 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -1,11 +1,31 @@ formatOutput = TRUE; @@ -23,34 +43,38 @@ class PersonalCollectionClass { $value = $this->createPolicyStream($theUser, $dom, $rootElement); if (!$value) { - return FALSE;//error should already be logged. + return FALSE; //error should already be logged. } $this->createCollectionPolicyStream($theUser, $dom, $rootElement); try { $params = array( - 'objectXML' => $dom->saveXML(), - 'format' => "foxml1.0", - 'logMessage' => "Fedora object ingested", + 'objectXML' => $dom->saveXML(), + 'format' => "foxml1.0", + 'logMessage' => "Fedora object ingested", ); $object = $soapClient->__soapCall('ingest', array( - $params - )); - - } - catch (exception $e) { + $params + )); + } catch (exception $e) { drupal_set_message(t('Error ingesting personal collection object: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; } return TRUE; } + /** + * Create Collection Policy Stream ?? + * @param type $user + * @param type $dom + * @param type $rootElement + * @return type + */ function createCollectionPolicyStream($user, $dom, $rootElement) { $collectionTemplate = file_get_contents(drupal_get_path('module', 'Fedora_Repository') . '/collection_policies/PERSONAL-COLLECTION-POLICY.xml'); try { $xml = new SimpleXMLElement($collectionTemplate); - } - catch (Exception $e) { + } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem creating personal collection policy, could not parse collection policy stream."), NULL, WATCHDOG_ERROR); drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; @@ -88,6 +112,13 @@ class PersonalCollectionClass { return TRUE; } + /** + * Create Policy Stream ?? + * @param type $user + * @param type $dom + * @param type $rootElement + * @return type + */ function createPolicyStream($user, $dom, $rootElement) { module_load_include('inc', 'fedora_repository', 'SecurityClass'); @@ -113,9 +144,15 @@ class PersonalCollectionClass { $content->appendChild($policyStream); return $this->createChildPolicyStream($dom, $rootElement, $policyStream->cloneNode(TRUE)); } - - //right now this is the same as the policy stream for this object, may change - //objects in this collection will reference this datastream as their own POLICY stream + + /** + * right now this is the same as the policy stream for this object, may change + * objects in this collection will reference this datastream as their own POLICY stream ??? + * @param type $dom + * @param type $rootElement + * @param type $policyStream + * @return type + */ function createChildPolicyStream($dom, $rootElement, $policyStream) { $ds1 = $dom->createElement("foxml:datastream"); @@ -135,8 +172,14 @@ class PersonalCollectionClass { return TRUE; } + /** + * Create standard fedora stuff ?????????????????? + * @param type $user + * @param type $dom + * @param type $rootElement + */ function createStandardFedoraStuff($user, & $dom, & $rootElement) { - /*foxml object properties section */ + /* foxml object properties section */ $objproperties = $dom->createElement("foxml:objectProperties"); $prop1 = $dom->createElement("foxml:property"); $prop1->setAttribute("NAME", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); @@ -161,6 +204,13 @@ class PersonalCollectionClass { $rootElement->appendChild($objproperties); } + /** + * Create DC Stream ??? + * @global type $user + * @param type $theUser + * @param type $dom + * @param type $rootElement + */ function createDCStream($theUser, & $dom, & $rootElement) { global $user; $datastream = $dom->createElement("foxml:datastream"); diff --git a/plugins/QtFormBuilder.php b/plugins/QtFormBuilder.php index af66ed31..68c97644 100644 --- a/plugins/QtFormBuilder.php +++ b/plugins/QtFormBuilder.php @@ -1,76 +1,86 @@ getType($file); - //$fileUrl = 'http://'.$_SERVER['HTTP_HOST'].$file; - $fileUrl = $base_url.'/'.drupal_urlencode($file); - $beginIndex = strrpos($fileUrl,'/'); - $dtitle = substr($fileUrl,$beginIndex+1); - $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); - $ds1 = $dom->createElement("foxml:datastream"); - $ds1->setAttribute("ID","OBJ"); - $ds1->setAttribute("STATE","A"); - $ds1->setAttribute("CONTROL_GROUP","M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); - $ds1v->setAttribute("ID","OBJ.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); +module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); -if(empty($_SESSION['fedora_ingest_files']) || !isset($_SESSION['fedora_ingest_files']['TN'])) { - $createdFile = drupal_get_path('module', 'Fedora_Repository').'/images/qtThumb.jpg'; - $fileUrl = $base_url.'/'.drupal_urlencode($createdFile);//'http://'.$_SERVER['HTTP_HOST'].'/'.$createdFile; - $ds1 = $dom->createElement("foxml:datastream"); - $ds1->setAttribute("ID","TN"); - $ds1->setAttribute("STATE","A"); - $ds1->setAttribute("CONTROL_GROUP","M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); - $ds1v->setAttribute("ID","TN.0"); - $ds1v->setAttribute("MIMETYPE","image/jpeg"); - $ds1v->setAttribute("LABEL","Thumbnail"); - $ds1content = $dom->createElement('foxml:contentLocation'); - $ds1content->setAttribute("REF","$fileUrl"); - $ds1content->setAttribute("TYPE","URL"); - $ds1->appendChild($ds1v); - $ds1v->appendChild($ds1content); - $rootElement->appendChild($ds1); -} +/** + * Implements methods from content model ingest form xml + * builds a dc metadata form + */ +class QtFormBuilder extends FormBuilder { + + /** + * Constructor + */ + function QtFormBuilder() { + module_load_include('php', 'Fedora_Repository', 'plugins/FormBuilder'); + drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); + } - if (!empty($_SESSION['fedora_ingest_files'])) { + /** + * method overrides method in FormBuilder. We changed the dsid from OBJ to OBJ and added the TN datastream + * @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']; + $dformat = $mimetype->getType($file); + //$fileUrl = 'http://'.$_SERVER['HTTP_HOST'].$file; + $fileUrl = $base_url . '/' . drupal_urlencode($file); + $beginIndex = strrpos($fileUrl, '/'); + $dtitle = substr($fileUrl, $beginIndex + 1); + $dtitle = substr($dtitle, 0, strpos($dtitle, ".")); + $ds1 = $dom->createElement("foxml:datastream"); + $ds1->setAttribute("ID", "OBJ"); + $ds1->setAttribute("STATE", "A"); + $ds1->setAttribute("CONTROL_GROUP", "M"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); + $ds1v->setAttribute("ID", "OBJ.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); + if (empty($_SESSION['fedora_ingest_files']) || !isset($_SESSION['fedora_ingest_files']['TN'])) { + $createdFile = drupal_get_path('module', 'Fedora_Repository') . '/images/qtThumb.jpg'; + $fileUrl = $base_url . '/' . drupal_urlencode($createdFile); //'http://'.$_SERVER['HTTP_HOST'].'/'.$createdFile; + $ds1 = $dom->createElement("foxml:datastream"); + $ds1->setAttribute("ID", "TN"); + $ds1->setAttribute("STATE", "A"); + $ds1->setAttribute("CONTROL_GROUP", "M"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); + $ds1v->setAttribute("ID", "TN.0"); + $ds1v->setAttribute("MIMETYPE", "image/jpeg"); + $ds1v->setAttribute("LABEL", "Thumbnail"); + $ds1content = $dom->createElement('foxml:contentLocation'); + $ds1content->setAttribute("REF", "$fileUrl"); + $ds1content->setAttribute("TYPE", "URL"); + $ds1->appendChild($ds1v); + $ds1v->appendChild($ds1content); + $rootElement->appendChild($ds1); + } + 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); + $fileUrl = $base_url . '/' . drupal_urlencode($createdFile); $beginIndex = strrpos($fileUrl, '/'); $dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = urldecode($dtitle); @@ -79,7 +89,7 @@ if(empty($_SESSION['fedora_ingest_files']) || !isset($_SESSION['fedora_ingest_fi $ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("STATE", "A"); $ds1->setAttribute("CONTROL_GROUP", "M"); - $ds1v= $dom->createElement("foxml:datastreamVersion"); + $ds1v = $dom->createElement("foxml:datastreamVersion"); $ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("LABEL", "$dtitle"); @@ -91,12 +101,7 @@ if(empty($_SESSION['fedora_ingest_files']) || !isset($_SESSION['fedora_ingest_fi $rootElement->appendChild($ds1); } } + } +} - - - } - - - - } ?> diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index f6e43f95..6fc809e8 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -1,6 +1,11 @@ romeoUrlString = "http://www.sherpa.ac.uk/romeo/api24.php?issn="; } - function buildForm( &$form, $ingest_form_definition, &$form_values) { + /** + * Build Form ?? + * @param type $form + * @param type $ingest_form_definition + * @param type $form_values + * @return type + */ + function buildForm(&$form, $ingest_form_definition, &$form_values) { $form['indicator2'] = array( - '#type' => 'fieldset', - '#title' => t('Ingest digital object step #2'), + '#type' => 'fieldset', + '#title' => t('Ingest digital object step #2'), ); foreach ($ingest_form_definition->form_elements->element as $element) { $name = strip_tags($element->name->asXML()); @@ -39,11 +58,11 @@ class Refworks { $type = strip_tags($element->type->asXML()); $form['indicator2']["$name"] = array( - '#title' => $title, - '#required' => $required, - '#description' => $description, - '#prefix' => $prefix, - '#type' => $type + '#title' => $title, + '#required' => $required, + '#description' => $description, + '#prefix' => $prefix, + '#type' => $type ); } @@ -68,21 +87,26 @@ class Refworks { //$xml=simplexml_load_string(trim(file_get_contents($file),NULL,TRUE)); //$dom = dom_import_simplexml($xml);//test to see if it behaves better //$xml = new SimpleXMLElement(trim(file_get_contents($file))); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t('Error processing Refworks file: ') . $e->getMessage()); return FALSE; } $this->referenceList = array(); foreach ($xml->reference as $reference) { - array_push( $this->referenceList, $reference ); + array_push($this->referenceList, $reference); } return $this->referenceList; } - - //create A DC stream with ID of DC - function createQDCStream( &$dom, &$rootElement, $reference ) { + + /** + * Create a DC stream with ID of DC ??? + * @param type $dom + * @param type $rootElement + * @param type $reference + * @return type + */ + function createQDCStream(&$dom, &$rootElement, $reference) { $datastream = $dom->createElement("foxml:datastream"); $datastream->setAttribute("ID", "DC"); $datastream->setAttribute("STATE", "A"); @@ -126,19 +150,19 @@ class Refworks { $oai->appendChild($element); } foreach ($reference->vo as $value) { - $source .= ' Volume: '. $value; + $source .= ' Volume: ' . $value; } foreach ($reference->is as $value) { - $source .= ' Issue: '. $value; + $source .= ' Issue: ' . $value; } foreach ($reference->sp as $value) { - $source .= ' Start Page: '. $value; + $source .= ' Start Page: ' . $value; } foreach ($reference->op as $value) { - $source .= ' Other Pages: '. $value; + $source .= ' Other Pages: ' . $value; } foreach ($reference->ul as $value) { - $source .= ' URL: '. $value; + $source .= ' URL: ' . $value; } foreach ($reference->k1 as $value) { $element = $dom->createElement('dc:subject', htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8')); @@ -174,17 +198,17 @@ class Refworks { $identifier .= ' ISSN/ISBN: ' . $value; //$this->romeoUrlString = $this->romeoUrlString . $value; if (!$this->issn == '') { - $this->issn=$value; + $this->issn = $value; } else { - $this->issn .= ','. $value; + $this->issn .= ',' . $value; } } foreach ($reference->ab as $value) { - $description = ' abstract: '. $value; + $description = ' abstract: ' . $value; } foreach ($reference->cr as $value) { - $description .= ' Cited reference: '. $value; + $description .= ' Cited reference: ' . $value; } $element = $dom->createElement('dc:description', htmlspecialchars($description, ENT_NOQUOTES, 'UTF-8')); $oai->appendChild($element); @@ -196,7 +220,12 @@ class Refworks { return $datastream; } - function handleForm( &$form_values ) { + /** + * Handle Form ?? + * @param type $form_values + * @return type + */ + function handleForm(&$form_values) { $errorMessage = NULL; module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'ContentModel'); @@ -204,10 +233,10 @@ class Refworks { $contentModelPid = ContentModel::getPidFromIdentifier($form_values['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_values['models']); $collectionHelper = new CollectionClass(); - $startTime=time(); + $startTime = time(); $collection_pid = $form_values['collection_pid']; - $this->parse_refworks_item( $form_values ); + $this->parse_refworks_item($form_values); $this->securityHelper = new SecurityClass(); @@ -231,18 +260,18 @@ class Refworks { $rootElement->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $rootElement->setAttribute('xsi:schemaLocation', "info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"); $dom->appendChild($rootElement); - + //create standard fedora stuff $qdc_element = $this->createQDCStream($dom, $rootElement, $reference); if (!$qdc_element) { drupal_set_message(t('Error creating DC for Refworks'), 'error'); continue; } - $item_title=''; + $item_title = ''; foreach ($reference->t1 as $value) { - $item_title .= ' --- '. $value; + $item_title .= ' --- ' . $value; } - $this->createStandardFedoraStuff($form_values, $dom, $rootElement, $reference ); + $this->createStandardFedoraStuff($form_values, $dom, $rootElement, $reference); $rootElement->appendChild($qdc_element); //create relationships $this->createRelationShips($form_values, $dom, $rootElement, $pid); @@ -250,14 +279,14 @@ class Refworks { $this->createFedoraDataStreams($form_values, $dom, $rootElement, $reference); - if (!empty ( $this->collectionPolicyStream)) { + if (!empty($this->collectionPolicyStream)) { $this->create_security_policies($dom, $rootElement, $reference); } $params = array( - 'objectXML' => $dom->saveXML(), - 'format' => 'info:fedora/fedora-system:FOXML-1.1', - 'logMessage' => "Fedora Object Ingested", + 'objectXML' => $dom->saveXML(), + 'format' => 'info:fedora/fedora-system:FOXML-1.1', + 'logMessage' => "Fedora Object Ingested", ); try { @@ -270,34 +299,36 @@ class Refworks { return; } $object = $client->__soapCall('ingest', array( - $params - )); + $params + )); watchdog(t("FEDORA_REPOSITORY"), t("Successfully added repository item !pid - !it", array('!pid' => $pid, '!it' => $item_title)), NULL, WATCHDOG_INFO); $deleteFiles = $form_values['delete_file']; //remove files from drupal file system if ($deleteFiles > 0) { unlink($form_values['fullpath']); } - } - catch (exception $e) { + } catch (exception $e) { $errors++; $errorMessage = 'yes'; watchdog(t("FEDORA_REPOSITORY"), t("Error during ingest !it !e", array('!it' => $item_title, '!e' => $e)), NULL, WATCHDOG_ERROR); - } + } $success++; } if (isset($errorMessage)) { - drupal_set_message(t('Error ingesting one or more records! Check Drupal watchdog logs for more info') , 'error'); + drupal_set_message(t('Error ingesting one or more records! Check Drupal watchdog logs for more info'), 'error'); } $endTime = time(); - drupal_set_message(t('Successfull ingest of %success records. %errors records failed. Ingest took %seconds seconds', - array('%success' => $success-$errors, '%errors' => $errors, '%seconds' => $endTime-$startTime)) , 'info'); + drupal_set_message(t('Successfull ingest of %success records. %errors records failed. Ingest took %seconds seconds', array('%success' => $success - $errors, '%errors' => $errors, '%seconds' => $endTime - $startTime)), 'info'); } /** * Creates the RELS-EXT for the foxml + * @param type $form_values + * @param type $dom + * @param type $rootElement + * @param type $pid */ - function createRelationShips( $form_values, &$dom, &$rootElement, $pid = NULL ) { + function createRelationShips($form_values, &$dom, &$rootElement, $pid = NULL) { $drdf = $dom->createElement("foxml:datastream"); $drdf->setAttribute("ID", "RELS-EXT"); $drdf->setAttribute("CONTROL_GROUP", "X"); @@ -326,9 +357,13 @@ class Refworks { $rdfdesc->appendChild($member); $rdfdesc->appendChild($model); $rootElement->appendChild($drdf); - } + /** + * Create Romeo Datastream + * @param type $dom + * @param type $rootElement + */ function createRomeoDataStream(&$dom, &$rootElement) { $ds1 = $dom->createElement("foxml:datastream"); $ds1->setAttribute("ID", "ROMEO"); @@ -340,7 +375,7 @@ class Refworks { $ds1v->setAttribute("LABEL", "ROMEO"); $ds1content = $dom->createElement('foxml:contentLocation'); $url = $this->romeoUrlString . $this->issn; - $this->issn=''; //clear the issn's for next ingest in case we are doing batch + $this->issn = ''; //clear the issn's for next ingest in case we are doing batch $ds1content->setAttribute("REF", "$url"); $ds1content->setAttribute("TYPE", "URL"); $ds1->appendChild($ds1v); @@ -348,6 +383,14 @@ class Refworks { $rootElement->appendChild($ds1); } + /** + * Create Fedora Datastream + * @global type $base_url + * @param type $form_values + * @param type $dom + * @param type $rootElement + * @param type $reference + */ function createFedoraDataStreams($form_values, &$dom, &$rootElement, $reference) { global $base_url; module_load_include('inc', 'fedora_repository', 'MimeClass'); @@ -374,6 +417,10 @@ class Refworks { /** * Creates the standard foxml properties + * @param type $form_values + * @param type $dom + * @param type $rootElement + * @param type $reference */ function createStandardFedoraStuff($form_values, &$dom, &$rootElement, $reference) { // Foxml object properties section @@ -397,10 +444,9 @@ class Refworks { $rootElement->appendChild($objproperties); } - /** * Read the list of Users from the U1 field and Roles from the U2 field and add elements - * to the security policy record for this item, then add the record as the security policy datastream. + * to the security policy record for this item, then add the record as the security policy datastream. * * @param array $form_values * @param DOMDocument $dom @@ -417,8 +463,8 @@ class Refworks { $ds1v->setAttribute("ID", "POLICY.0"); $ds1v->setAttribute("MIMETYPE", "text/xml"); $ds1v->setAttribute("LABEL", "POLICY Record"); - $ds1content = $dom->createElement( "foxml:xmlContent" ); - + $ds1content = $dom->createElement("foxml:xmlContent"); + $custom_policy = $this->collectionPolicyStream; $allowed_users_and_roles = array(); $allowed_users_and_roles['users'] = array(); @@ -428,11 +474,11 @@ class Refworks { array_push($allowed_users_and_roles['users'], $name); } } - if (empty( $reference->u1)) { + if (empty($reference->u1)) { // If no "u1" value exists, add the currently logged-in user to the item's security policy. array_push($allowed_users_and_roles['users'], $user->name); } - + foreach ($reference->u2 as $rolelist) { foreach (explode(';', strip_tags($rolelist->asXML())) as $role) { array_push($allowed_users_and_roles['roles'], $role); @@ -444,6 +490,7 @@ class Refworks { $ds1v->appendChild($ds1content); $rootElement->appendChild($ds1); - $ds1content->appendChild($dom->importNode( dom_import_simplexml($custom_policy_sxe), TRUE)); + $ds1content->appendChild($dom->importNode(dom_import_simplexml($custom_policy_sxe), TRUE)); } + } diff --git a/plugins/ShowDemoStreamsInFieldSets.inc b/plugins/ShowDemoStreamsInFieldSets.inc index dd81410f..914c8bc5 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -1,18 +1,32 @@ pid = $pid; } + /** + * Show Medium Size ?? + * @global type $base_url + * @return type + */ function showMediumSize() { global $base_url; $collection_fieldset = array( diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index d0860ab2..77eada60 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -1,15 +1,31 @@ pid = $pid; } + /** + * Show the FLV ?? + * @return type + */ function showFlv() { //FLV is the datastream id $path = drupal_get_path('module', 'Fedora_Repository'); @@ -17,11 +33,11 @@ class ShowStreamsInFieldSets { $content = ""; $pathTojs = drupal_get_path('module', 'Fedora_Repository') . '/js/swfobject.js'; drupal_add_js("$pathTojs"); - $content .= '
      Get the Flash Player to see this player.
      '; - drupal_add_js('var s1 = new SWFObject("'. $fullPath . '/flash/flvplayer.swf","single","320","240","7"); + $content .= '
      Get the Flash Player to see this player.
      '; + drupal_add_js('var s1 = new SWFObject("' . $fullPath . '/flash/flvplayer.swf","single","320","240","7"); s1.addParam("allowfullscreen","TRUE"); - s1.addVariable("file","'. base_path() . 'fedora/repository/'. $this->pid . '/FLV/FLV.flv"); - s1.write("player'. $this->pid . 'FLV");', 'inline', 'footer'); + s1.addVariable("file","' . base_path() . 'fedora/repository/' . $this->pid . '/FLV/FLV.flv"); + s1.write("player' . $this->pid . 'FLV");', 'inline', 'footer'); $collection_fieldset = array( '#title' => t('Flash Video'), '#collapsible' => TRUE, @@ -30,30 +46,42 @@ class ShowStreamsInFieldSets { return theme('fieldset', $collection_fieldset); } + /** + * Show the TN ?? + * @global type $base_url + * @return type + */ function showTN() { global $base_url; $collection_fieldset = array( '#title' => '', '#attributes' => array(), '#collapsible' => FALSE, - '#value' => '', + '#value' => '', ); return theme('fieldset', $collection_fieldset); } - - // Same as showTN but artinventory stores the image in a dsid of IMAGE instead of OBJ + /** + * Same as showTN but artinventory stores the image in a dsid of IMAGE instead of OBJ + * @global type $base_url + * @return type + */ function showArtInventoryTN() { global $base_url; $collection_fieldset = array( '#collapsible' => FALSE, - '#value' => '', + '#value' => '', ); return theme('fieldset', $collection_fieldset); } /** * Embed Google Docs' PDF viewer into the page. + * @global type $base_url + * @global type $base_path + * @global type $user + * @return type */ function showPDFPreview() { global $base_url; @@ -74,21 +102,21 @@ class ShowStreamsInFieldSets { $objectHelper = new ObjectHelper(); $item = new Fedora_Item($this->pid); if (key_exists('TN', $item->datastreams)) { - $tn_url = $base_url.'/fedora/repository/'.$item->pid.'/TN'; + $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'; + $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('

      View Document
      ', 'fedora/repository/'.$this->pid.'/OBJ', array('html' => TRUE)); - + + $dl_link = l('

      View Document
      ', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); + $tabset['first_tab']['tabs']['view'] = array( '#type' => 'tabpage', '#title' => t('View'), '#content' => $dl_link . $dc_html, ); - + if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC'); $tabset['first_tab']['tabs']['edit'] = array( @@ -97,23 +125,26 @@ class ShowStreamsInFieldSets { '#content' => $editform, ); } - + $tabset['second_tab'] = array( '#type' => 'tabpage', '#title' => t('Read Online'), - '#content' => "" + '#content' => "" ); // Render the tabset. return $tabset; } - + /** + * Show QDC ?? + * @return type + */ function showQdc() { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); - $content=$objectHelper->getQDC($this->pid); + $content = $objectHelper->getQDC($this->pid); $collection_fieldset = array( '#title' => t('Description'), '#collapsible' => TRUE, @@ -123,29 +154,35 @@ class ShowStreamsInFieldSets { return theme('fieldset', $collection_fieldset); } + /** + * Show Object Link ?? + * @global type $base_url + * @return type + */ function showOBJLink() { global $base_url; module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $streams = $item->get_datastreams_list_as_array(); - return "". $streams['OBJ']['label'] .""; + return "" . $streams['OBJ']['label'] . ""; } - - + /** + * Show REF works ?? + * @return type + */ function showRefworks() { - $path=drupal_get_path('module', 'fedora_repository'); + $path = drupal_get_path('module', 'fedora_repository'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $collectionHelper = new CollectionClass(); - $xmlstr=$collectionHelper->getStream($this->pid, "refworks"); + $xmlstr = $collectionHelper->getStream($this->pid, "refworks"); html_entity_decode($xmlstr); if ($xmlstr == NULL || strlen($xmlstr) < 5) { return " "; } try { $proc = new XsltProcessor(); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); return " "; } @@ -165,9 +202,14 @@ class ShowStreamsInFieldSets { return theme('fieldset', $collection_fieldset); } + /** + * Show JP2000 + * @param type $collapsed + * @return type + */ function showJP2($collapsed = FALSE) { - $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'; - $html = ''; + $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer'; + $html = ''; $fieldset = array( '#title' => t('Viewer'), '#collapsible' => TRUE, @@ -177,6 +219,11 @@ class ShowStreamsInFieldSets { return theme('fieldset', $fieldset); } + /** + * Show Romeo ?? + * @param type $collapsed + * @return type + */ function showRomeo($collapsed = FALSE) { $path = drupal_get_path('module', 'Fedora_Repository'); module_load_include('inc', 'fedora_repository', 'CollectionClass'); @@ -189,8 +236,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); - } - catch (Exception $e) { + } catch (Exception $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); return; } @@ -210,4 +256,5 @@ class ShowStreamsInFieldSets { ); return theme('fieldset', $collection_fieldset); } + } diff --git a/plugins/fedoraObject.inc b/plugins/fedoraObject.inc index 3520614c..c5521242 100644 --- a/plugins/fedoraObject.inc +++ b/plugins/fedoraObject.inc @@ -1,7 +1,22 @@ item = new Fedora_Item($pid); } } - + + /** + * Show Field Sets + * @global type $user + * @return type + */ public function showFieldSets() { global $user; $objectHelper = new ObjectHelper(); @@ -27,16 +47,16 @@ class FedoraObject { '#type' => 'tabset', ); $dc_html = $objectHelper->getFormattedDC($this->item); - + $ds_list = $objectHelper->get_formatted_datastream_list($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( @@ -46,7 +66,8 @@ class FedoraObject { '#content' => $editform, ); } - + return $tabset; } + } \ No newline at end of file diff --git a/plugins/herbarium.inc b/plugins/herbarium.inc index 3af6f8bd..38d6b024 100644 --- a/plugins/herbarium.inc +++ b/plugins/herbarium.inc @@ -2,8 +2,17 @@ // $Id$ +/** + * @file + * Herbarium class + */ + +/** + * Herbarium ??? + */ class Herbarium { - function __construct($pid = '') { + + function __construct($pid = '') { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); if (!empty($pid)) { $this->pid = $pid; @@ -11,15 +20,26 @@ class Herbarium { } } + /** + * Build a drupal form ?? + * @param type $form + * @param type $form_state + * @return type + */ public function buildDrupalForm($form = array(), $form_state = array()) { // We don't need to add anything beyond the standard Darwin Core form so just pass this through // If we wanted to we could add other fields. module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); - + $dwc = new DarwinCore($this->item); return $dwc->buildDrupalForm($form); } + /** + * Build edit metadata form + * @param type $form + * @return type + */ public function buildEditMetadataForm($form = array()) { $form['submit'] = array( '#type' => 'submit', @@ -34,10 +54,17 @@ class Herbarium { '#type' => 'hidden', '#value' => "DARWIN_CORE", ); - + return $this->buildDrupalForm($form); } + /** + * handle edit metadata form ?? + * @global type $user + * @param type $form_id + * @param type $form_values + * @return type + */ public function handleEditMetadataForm($form_id, $form_values) { /* * Process the metadata form @@ -51,11 +78,15 @@ class Herbarium { $dwc = new DarwinCore($this->item); $dwc->handleForm($form_values); $this->item->purge_datastream('DARWIN_CORE'); - $this->item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', - 'Darwin Core Metadata', 'text/xml', 'X'); + $this->item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', 'Darwin Core Metadata', 'text/xml', 'X'); return TRUE; } + /** + * Handle Ingest Form + * @global type $user + * @param type $form_values + */ public function handleIngestForm($form_values) { /* * process the metadata form @@ -70,51 +101,52 @@ class Herbarium { $dwc = new DarwinCore(); $dwc->handleForm($form_values); $label = $form_values['dwc:institutionCode'] . ':' - . $form_values['dwc:collectionCode'] . ':' - . $form_values['dwc:catalogNumber']; + . $form_values['dwc:collectionCode'] . ':' + . $form_values['dwc:catalogNumber']; - $new_item = Fedora_Item::ingest_new_item($form_values['pid'], 'A', $label, - $user->name); + $new_item = Fedora_Item::ingest_new_item($form_values['pid'], 'A', $label, $user->name); - $new_item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', - 'Darwin Core Metadata', 'text/xml', 'X'); + $new_item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', 'Darwin Core Metadata', 'text/xml', 'X'); $file = $form_values['ingest-file-location']; - if (!empty( $file)) { + if (!empty($file)) { $dformat = $mimetype->getType($file); - $new_item->add_datastream_from_file($file, 'FULL_SIZE', - "$label-full-size", $dformat, 'M'); + $new_item->add_datastream_from_file($file, 'FULL_SIZE', "$label-full-size", $dformat, 'M'); } $new_item->add_relationship('hasModel', $form_values['content_model_pid'], FEDORA_MODEL_URI); $new_item->add_relationship(!empty($form_values['relationship']) ? $form_values['relationship'] : 'isMemberOfCollection', $form_values['collection_pid']); - + if (!empty($_SESSION['fedora_ingest_files'])) { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $created_file) { $created_file_format = $mimetype->getType($created_file); $created_filename = strstr($created_file, $file); - $new_item->add_datastream_from_file($created_file, $dsid, - $created_filename, $created_file_format, 'M'); - + $new_item->add_datastream_from_file($created_file, $dsid, $created_filename, $created_file_format, 'M'); } } } + /** + * Show Field Sets + * @global type $base_url + * @global type $user + * @return string + */ public function showFieldSets() { module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); global $base_url; $tabset = array(); - + global $user; $qs = ''; if ($user->uid != 0) { - $qs = '?uid='. base64_encode($user->name . ':'. $user->pass); + $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } - $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; - $html = ''; + $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; + $html = ''; $tabset['second_tab'] = array( // $collection_fieldset = array ( '#type' => 'tabpage', @@ -126,8 +158,8 @@ class Herbarium { '#type' => 'tabpage', '#title' => t('View'), // This will be the content of the tab. - '#content' => ''. '

      '. drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '

      ', + '#content' => '' . '

      ' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '

      ', ); $dwc = new DarwinCore($this->item); @@ -138,7 +170,7 @@ class Herbarium { $tabset['third_tab']['tabset'] = array( '#type' => 'tabset', ); - + $tabset['third_tab']['tabset']['view'] = array( '#type' => 'tabpage', '#title' => t('Darwin Core'), @@ -168,4 +200,5 @@ class Herbarium { } return $tabset; } + } diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index 0a1bda62..3e9bcfb6 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -1,13 +1,33 @@ pid = $pid; } + /** + * Show JPEG + * @global type $base_url + * @global type $user + * @return type + */ function showJPG() { module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); @@ -27,8 +47,8 @@ class ShowMapStreamsInFieldSets { $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } - $viewer_url = variable_get('fedora_base_url', '') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; - $html = ''; + $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; + $html = ''; drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css'); @@ -46,9 +66,10 @@ class ShowMapStreamsInFieldSets { '#type' => 'tabpage', '#title' => t('Description'), '#content' => $item->get_dissemination('islandora:mods2htmlSdef', 'mods2html') - . $objectHelper->get_formatted_datastream_list($this->pid, NULL, $item), + . $objectHelper->get_formatted_datastream_list($this->pid, NULL, $item), ); // Render the tabset. return tabs_render($tabset); } + } diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index 996b12b6..a61a6033 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -1,60 +1,96 @@ pid = $pid; } + /** + * Returna a new Fedora Object with the QT movie ??? + * @return fedora_item + */ function fedoraObject() { return new fedora_item($this->pid); } + /** + * Tecnical metadata ?? + * @param type $defaults + * @param type $dsid + * @return type + */ function technicalMetadata($defaults = array(), $dsid = 'OBJ_EXIFTOOL') { $data = $defaults; try { - $src = ObjectHelper::getStream($this->pid, $dsid); - - $doc = new SimpleXMLElement($src); - $doc->registerXPathNamespace('File', 'http://ns.exiftool.ca/File/1.0/'); - $doc->registerXPathNamespace('Composite', 'http://ns.exiftool.ca/Composite/1.0/'); - $mime = reset($doc->xpath('//File:MIMEType')); - $data['mime'] = $mime; - if(strpos($mime, 'audio/') !== false) { - $data['width'] = 300; - $data['height'] = 0; - } else { - $size = reset($doc->xpath('//Composite:ImageSize/text()')); - list($width, $height) = explode('x', $size); - $data['width'] = $width; - $data['height'] = $height; - } + $src = ObjectHelper::getStream($this->pid, $dsid); + + $doc = new SimpleXMLElement($src); + $doc->registerXPathNamespace('File', 'http://ns.exiftool.ca/File/1.0/'); + $doc->registerXPathNamespace('Composite', 'http://ns.exiftool.ca/Composite/1.0/'); + $mime = reset($doc->xpath('//File:MIMEType')); + $data['mime'] = $mime; + if (strpos($mime, 'audio/') !== false) { + $data['width'] = 300; + $data['height'] = 0; + } + else { + $size = reset($doc->xpath('//Composite:ImageSize/text()')); + list($width, $height) = explode('x', $size); + $data['width'] = $width; + $data['height'] = $height; + } - $data['doc'] = $src; - } catch(Exception $e) { - $data = $defaults; + $data['doc'] = $src; + } catch (Exception $e) { + $data = $defaults; } return $data; } + /** + * Get Poster Frame Datastream Information ?? + * @param type $dsid + * @return type + */ function getPosterFrameDatastreamInfo($dsid = 'FULL_SIZE') { $p = ObjectHelper::getDatastreamInfo($this->pid, $dsid); - if(empty($p) || $p == ' ' || $p === false) { + if (empty($p) || $p == ' ' || $p === false) { return false; } return $p; } + /** + * Get Media Datastream Information ?? + * @param type $dsid + * @param type $alt + * @return type + */ function getMediaDatastreamInfo($dsid = 'OBJ', $alt = array('')) { $p = ObjectHelper::getDatastreamInfo($this->pid, $dsid); - if(empty($p) || $p == ' ' || $p === false) { - if(!empty($alt)) { - $ds = array_shift($alt); - return $this->getMediaDatastreamInfo($ds, $alt); + if (empty($p) || $p == ' ' || $p === false) { + if (!empty($alt)) { + $ds = array_shift($alt); + return $this->getMediaDatastreamInfo($ds, $alt); } return false; } @@ -62,10 +98,19 @@ class ShowQtStreamsInFieldSets { return $p; } + /** + * Is download enabled. It always returns false. ??? + * @return FALSE + */ function enableDownload() { return false; } + /** + * Show the QT ??? + * @global type $base_url + * @return type + */ function showQt() { module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); @@ -77,32 +122,32 @@ class ShowQtStreamsInFieldSets { $pframe = $this->getPosterFrameDatastreamInfo(); $media = $this->getMediaDatastreamInfo('PROXY', array('OBJ')); - if($media === false ) { + if ($media === false) { return ''; } global $base_url; $path = drupal_get_path('module', 'Fedora_Repository'); - $fullPath=base_path().$path; - $content= ''; - $pathTojs = drupal_get_path('module', 'Fedora_Repository').'/js/AC_Quicktime.js'; + $fullPath = base_path() . $path; + $content = ''; + $pathTojs = drupal_get_path('module', 'Fedora_Repository') . '/js/AC_Quicktime.js'; drupal_add_js($pathTojs); - $divid = 'player'.md5($this->pid).'MOV'; - $content .= '
      '; - if($pframe !== false) { - $content .= '
      '; - $content .= ''; + $divid = 'player' . md5($this->pid) . 'MOV'; + $content .= '
      '; + if ($pframe !== false) { + $content .= '
      '; + $content .= ''; $content .= '
      '; $content .= '
      '; } $content .= '
      '; - if($this->enableDownload()) { - $url = base_path().'fedora/repository/'.$this->pid.'/OBJ/MOV.mov'; + if ($this->enableDownload()) { + $url = base_path() . 'fedora/repository/' . $this->pid . '/OBJ/MOV.mov'; $content .= 'Download Media File'; } - $src = base_path().'fedora/repository/'.$this->pid.'/' . $media->ID. '/MOV.mov'; -$qtparams = ''; - $qtparams .= "'autostart', '" . ($pframe !== false ? 'true' : 'false') . "', "; + $src = base_path() . 'fedora/repository/' . $this->pid . '/' . $media->ID . '/MOV.mov'; + $qtparams = ''; + $qtparams .= "'autostart', '" . ($pframe !== false ? 'true' : 'false') . "', "; $init = << t('Quicktime'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#value' => $content); + return theme('fieldset', $collection_fieldset); + } - $collection_fieldset = array( - '#title' => t('Quicktime'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#value' => $content); - return theme('fieldset',$collection_fieldset); - } } diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index 30d2eb01..1d23b227 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -1,15 +1,34 @@ pid = $pid; } - + + /** + * Show JPEG + * @global type $base_url + * @global type $user + * @return type + */ function showJPG() { module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); @@ -17,14 +36,14 @@ class ShowSlideStreamsInFieldSets { global $user; $tabset = array(); - + $qs = ''; if ($user->uid != 0) { $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } - $viewer_url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/get/'. $this->pid . '/ilives:viewerSdef/getViewer'. $qs; - $html = ''; + $viewer_url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; + $html = ''; drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); @@ -38,10 +57,11 @@ class ShowSlideStreamsInFieldSets { '#type' => 'tabpage', '#title' => t('View'), // This will be the content of the tab. - '#content' => ''. '

      '. drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '

      ', + '#content' => '' . '

      ' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '

      ', ); - + return $tabset; } + } diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index 2b374b3c..acc826fd 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -1,11 +1,21 @@ tags)) { $output = "
        "; foreach ($tags->tags as $tag) { - $output .= "
      • "; } return $output; } +/** + * Fedora repository image tagging form ???? + * @global type $base_url + * @param type $form_state + * @param type $pid + * @return type + */ function fedora_repository_image_tagging_form($form_state, $pid) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/dublin_core'); @@ -29,7 +46,7 @@ function fedora_repository_image_tagging_form($form_state, $pid) { global $base_url; if (!empty($form_state['post']['pid'])) { - $pid = $form_state['post']['pid']; + $pid = $form_state['post']['pid']; } $obj = new Fedora_Item($pid); $form['tags-wrapper'] = array( @@ -49,8 +66,8 @@ function fedora_repository_image_tagging_form($form_state, $pid) { '#prefix' => '
      • ', '#suffix' => '
      • ', ); - $form['tags-wrapper']['tags'][$tag['name']]['tag'] = array( - '#prefix' => '', + $form['tags-wrapper']['tags'][$tag['name']]['tag'] = array( + '#prefix' => '', '#value' => $tag['name'], '#suffix' => '', ); @@ -58,7 +75,7 @@ function fedora_repository_image_tagging_form($form_state, $pid) { // Delete button for each existing tag. $form['tags-wrapper']['tags'][$tag['name']]['delete'] = array( '#type' => 'imagebutton', - '#image' => $base_url . '/'. drupal_get_path('module', 'fedora_repository') . '/images/remove_icon.png', + '#image' => $base_url . '/' . drupal_get_path('module', 'fedora_repository') . '/images/remove_icon.png', '#default_value' => $tag['name'], '#title' => t('Delete this tag'), ); @@ -84,10 +101,15 @@ function fedora_repository_image_tagging_form($form_state, $pid) { if (empty($form_state['pid'])) { $form_state['pid'] = $pid; } - + return $form; } +/** + * Hook image button process ??? + * @param type $form + * @return string + */ function hook_imagebutton_process($form) { $form['op_x'] = array( '#name' => $form['#name'] . '_x', @@ -98,6 +120,12 @@ function hook_imagebutton_process($form) { return $form; } +/** + * Fedora repository image tagging from submit ??? + * @global type $user + * @param type $form + * @param type $form_state + */ function fedora_repository_image_tagging_form_submit($form, &$form_state) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/tagging'); @@ -110,7 +138,7 @@ function fedora_repository_image_tagging_form_submit($form, &$form_state) { array_push($tagset->tags, array('name' => $form_state['values']['addtag'], 'creator' => $user->name)); } elseif (!empty($form_state['values']['delete'])) { - for ( $i=0; $i < count($tagset->tags); $i++ ) { + for ($i = 0; $i < count($tagset->tags); $i++) { if ($tagset->tags[$i]['name'] == $form_state['clicked_button']['#value']) { unset($tagset->tags[$i]); } From 64fac18623c75803007ff1c2c794f7003543a2ee Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Tue, 9 Aug 2011 09:30:21 -0300 Subject: [PATCH 020/247] Added doc tags to the api --- api/dublin_core.inc | 41 ++++++--- api/fedora_collection.inc | 67 +++++++++------ api/fedora_export.inc | 90 ++++++++++++++------ api/fedora_item.inc | 170 ++++++++++++++++++++++++++++++++++++-- api/fedora_utils.inc | 77 +++++++++++------ api/rels-ext.inc | 70 ++++++++-------- api/tagging.inc | 25 ++++-- 7 files changed, 405 insertions(+), 135 deletions(-) diff --git a/api/dublin_core.inc b/api/dublin_core.inc index 04321677..af441436 100644 --- a/api/dublin_core.inc +++ b/api/dublin_core.inc @@ -1,13 +1,19 @@ array(), 'dc:creator' => array(), @@ -41,25 +47,25 @@ class Dublin_Core { } /** - * + * Add Elements * @param $element_name * @param $value */ - function add_element( $element_name, $value ) { + function add_element($element_name, $value) { if (is_string($value) && is_array($this->dc[$element_name])) { $this->dc[$element_name][] = $value; } } -/** - * Replace the given DC element with the values in $values - * @param string $elemnt_name - * @param array $values - */ + /** + * Replace the given DC element with the values in $values + * @param string $elemnt_name + * @param array $values + */ function set_element($element_name, $values) { if (is_array($values)) { $this->dc[$element_name] = $values; - } + } elseif (is_string($values)) { $this->dc[$element_name] = array($values); } @@ -67,8 +73,10 @@ class Dublin_Core { /** * Serialize this object to XML and return it. + * @param type $with_preamble + * @return type */ - function as_xml( $with_preamble = FALSE ) { + function as_xml($with_preamble = FALSE) { $dc_xml = new DomDocument(); $oai_dc = $dc_xml->createElementNS('http://www.openarchives.org/OAI/2.0/oai_dc/', 'oai_dc:dc'); $oai_dc->setAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); @@ -78,7 +86,7 @@ class Dublin_Core { $new_item = $dc_xml->createElement($dc_element, $value); $oai_dc->appendChild($new_item); } - } + } else { $new_item = $dc_xml->createElement($dc_element); $oai_dc->appendChild($new_item); @@ -88,10 +96,17 @@ class Dublin_Core { return $dc_xml->saveXML(); } + /** + * Create dc from dict ( does nothing ) + */ static function create_dc_from_dict() { - + } + /** + * Save ?? + * @param type $alt_owner + */ function save($alt_owner = NULL) { $item_to_update = (!empty($alt_owner) ? $alt_owner : $this->owner); // My Java roots showing, trying to do polymorphism in PHP. @@ -114,7 +129,7 @@ class Dublin_Core { array_push($new_dc->dc[$child->nodeName], $child->nodeValue); } return $new_dc; - } + } else { return NULL; } diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index 3db41018..54c4691c 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -1,10 +1,11 @@ $format + * @param type $collection_pid + * @param type $relationship + * @param type $format + * @return type */ -function export_collection($collection_pid, $relationship = 'isMemberOfCollection', $format = 'info:fedora/fedora-system:FOXML-1.1' ) { +function export_collection($collection_pid, $relationship = 'isMemberOfCollection', $format = 'info:fedora/fedora-system:FOXML-1.1') { $collection_item = new Fedora_Item($collection_pid); $foxml = $collection_item->export_as_foxml(); $file_dir = file_directory_path(); - + // Create a temporary directory to contain the exported FOXML files. $container = tempnam($file_dir, 'export_'); file_delete($container); print $container; - if (mkdir($container) && mkdir($container . '/'. $collection_pid)) { - $foxml_dir = $container . '/'. $collection_pid; - $file = fopen($foxml_dir . '/'. $collection_pid . '.xml', 'w'); + if (mkdir($container) && mkdir($container . '/' . $collection_pid)) { + $foxml_dir = $container . '/' . $collection_pid; + $file = fopen($foxml_dir . '/' . $collection_pid . '.xml', 'w'); fwrite($file, $foxml); fclose($file); - + $member_pids = get_related_items_as_array($collection_pid, $relationship); foreach ($member_pids as $member) { - $file = fopen($foxml_dir . '/'. $member . '.xml', 'w'); + $file = fopen($foxml_dir . '/' . $member . '.xml', 'w'); $item = new Fedora_Item($member); $item_foxml = $item->export_as_foxml(); fwrite($file, $item_foxml); @@ -41,16 +45,16 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio } if (system("cd $container;zip -r $collection_pid.zip $collection_pid/* >/dev/NULL") == 0) { header("Content-type: application/zip"); - header('Content-Disposition: attachment; filename="' . $collection_pid . '.zip'. '"'); - $fh = fopen($container . '/'. $collection_pid . '.zip', 'r'); - $the_data = fread($fh, filesize($container . '/'. $collection_pid . '.zip')); + header('Content-Disposition: attachment; filename="' . $collection_pid . '.zip' . '"'); + $fh = fopen($container . '/' . $collection_pid . '.zip', 'r'); + $the_data = fread($fh, filesize($container . '/' . $collection_pid . '.zip')); fclose($fh); echo $the_data; } - if (file_exists($container . '/'. $collection_pid)) { + if (file_exists($container . '/' . $collection_pid)) { system("rm -rf $container"); // I'm sorry. } - } + } else { drupal_set_message("Error creating temp directory for batch export.", 'error'); return FALSE; @@ -68,13 +72,13 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $collection_item = new Fedora_Item($collection_pid); - + global $user; if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return array(); } - + $query_string = 'select $object $title $content from <#ri> where ($object $title and $object $content @@ -82,41 +86,52 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb if (is_array($relationship)) { foreach ($relationship as $rel) { - $query_string .= '$object '; + $query_string .= '$object '; if (next($relationship)) { $query_string .= ' OR '; } } } elseif (is_string($relationship)) { - $query_string .= '$object '; + $query_string .= '$object '; } else { return ''; } $query_string .= ') '; - $query_string .= $active_objects_only ? 'and $object ' : ''; - + $query_string .= $active_objects_only ? 'and $object ' : ''; + if ($cmodel) { $query_string .= ' and $content '; } - + $query_string .= ') minus $content - order by '.$orderby; - + order by ' . $orderby; + $query_string = htmlentities(urlencode($query_string)); - + $content = ''; $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=". $query_string; + $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; $content .= do_curl($url); return $content; } +/** + * Get Related Items as Arrays + * @param type $collection_pid + * @param type $relationship + * @param type $limit + * @param type $offset + * @param type $active_objects_only + * @param type $cmodel + * @param type $orderby + * @return type + */ function get_related_items_as_array($collection_pid, $relationship = 'isMemberOfCollection', $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { $content = get_related_items_as_xml($collection_pid, $relationship, $limit, $offset, $active_objects_only, $cmodel, $orderby); if (empty($content)) { diff --git a/api/fedora_export.inc b/api/fedora_export.inc index d2b08baf..9782118a 100644 --- a/api/fedora_export.inc +++ b/api/fedora_export.inc @@ -2,6 +2,10 @@ // $Id$ +/** + * @file + * Fedora Export + */ define('FOXML_10', 'info:fedora/fedora-system:FOXML-1.0'); define('FOXML_11', 'info:fedora/fedora-system:FOXML-1.1'); define('METS_10', 'info:fedora/fedora-system:METSFedoraExt-1.0'); @@ -11,6 +15,11 @@ define('ATOMZip_11', 'info:fedora/fedora-system:ATOMZip-1.1'); /** * Function to to export all objects assocoiated with a given pid to the export area + * @param type $pid + * @param type $foxml_dir + * @param type $ob_dir + * @param type $log + * @return type */ function export_to_export_area($pid, $foxml_dir, $ob_dir, &$log = array()) { if (!$paths = export_objects_for_pid($pid, $ob_dir, $log)) { @@ -24,13 +33,20 @@ function export_to_export_area($pid, $foxml_dir, $ob_dir, &$log = array()) { return TRUE; } +/** + * Export objects for pids ?? + * @param type $pid + * @param type $dir + * @param type $log + * @return string + */ function export_objects_for_pid($pid, $dir, &$log) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($pid); if (!$object = $item->get_datastreams_list_as_SimpleXML($pid)) { $log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error'); return FALSE; - } + } // Datastreams added as a result of the ingest process $ignore_dsids = array('QUERY'); @@ -38,7 +54,7 @@ function export_objects_for_pid($pid, $dir, &$log) { $paths = array(); foreach ($object->datastreamDef as $ds) { if (!in_array($ds->ID, $ignore_dsids)) { - $file = $dir .'/'. $ds->label .'.'. get_file_extension($ds->MIMEType); + $file = $dir . '/' . $ds->label . '.' . get_file_extension($ds->MIMEType); $paths[$ds->ID] = $file; //$content = $ob_helper->getDatastreamDissemination($pid, $ds->ID); @@ -49,7 +65,7 @@ function export_objects_for_pid($pid, $dir, &$log) { } fwrite($fp, $content); fclose($fp); - } + } else { $log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error'); } @@ -58,6 +74,16 @@ function export_objects_for_pid($pid, $dir, &$log) { return $paths; } +/** + * Export foxml for pid + * @param type $pid + * @param type $dir + * @param type $paths + * @param type $log + * @param type $format + * @param type $remove_islandora + * @return type + */ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $remove_islandora = FALSE) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $ob_helper = new ObjectHelper(); @@ -65,7 +91,7 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re $log[] = log_line(t("Failed to get foxml for %pid", array('%pid' => $pid)), 'error'); return FALSE; } - + $foxml = new DOMDocument(); $foxml->loadXML($object_xml); @@ -75,11 +101,11 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re if ($remove_islandora) { $xpath->registerNamespace('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); $descNode = $xpath->query("//rdf:RDF/rdf:Description")->item(0); - + if ($model = $descNode->getElementsByTagName('hasModel')->item(0)) { $descNode->removeChild($model); } - + if ($member = $descNode->getElementsByTagName('rel:isMemberOfCollection')->item(0)) { $descNode->removeChild($member); } @@ -90,26 +116,26 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re switch ($format) { case FOXML_10: case FOXML_11: - + $disallowed_groups = array('E', 'R'); - + // Update datastream uris $xpath->registerNamespace('foxml', 'info:fedora/fedora-system:def/foxml#'); foreach ($xpath->query("//foxml:datastream[@ID]") as $dsNode) { - + // Don't update datastreams having external uris if (in_array($dsNode->getAttribute('CONTROL_GROUP'), $disallowed_groups)) { continue; } $dsId = $dsNode->getAttribute('ID'); - + // Remove QUERY datastream if ($dsId == "QUERY") { $parentNode = $xpath->query('/foxml:digitalObject')->item(0); $parentNode->removeChild($dsNode); } - + foreach ($dsNode->getElementsByTagName('*') as $contentNode) { if ($str = $contentNode->getAttribute('REF')) { $contentNode->setAttribute('REF', url($paths[$dsId], array('absolute' => TRUE))); @@ -117,52 +143,52 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re } } break; - + case METS_10: case METS_11: // Update datastream uris $xpath->registerNamespace('METS', 'http://www.loc.gov/METS/'); foreach ($xpath->query('//METS:fileGrp[@ID="DATASTREAMS"]/METS:fileGrp') as $dsNode) { - + $dsId = $dsNode->getAttribute('ID'); - + // Remove QUERY datastream if ($dsId == "QUERY") { $parentNode = $xpath->query('//METS:fileGrp[@ID="DATASTREAMS"]')->item(0); $parentNode->removeChild($dsNode); } - + $xpath->registerNamespace('xlink', 'http://www.loc.gov/METS/'); foreach ($xpath->query('METS:file[@OWNERID!="E"][@OWNERID!="R"]/METS:FLocat[@xlink:href]', $dsNode) as $Floc) { $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => TRUE))); } -/* - foreach ($dsNode->getElementsByTagName('METS:file') as $contentNode) { + /* + foreach ($dsNode->getElementsByTagName('METS:file') as $contentNode) { // Don't update datastreams having external uris if (in_array($dsNode->getAttribute('OWNERID'), $disallowed_groups)) { - continue; + continue; } foreach ($xpath->('METS:FLocat[@xlink:href]', $contentNode) as $Floc) { - $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => true))); + $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => true))); } - `} -*/ + `} + */ } - + break; - + default: - $log[] = log_line(t("Unknown or invalid format: ". $format), 'error'); + $log[] = log_line(t("Unknown or invalid format: " . $format), 'error'); return FALSE; } } //if $remove_islandora - $file = $dir .'/'. $pid .'.xml'; + $file = $dir . '/' . $pid . '.xml'; if (!$foxml->save($file)) { $log[] = log_line(t("Failed to write datastream %dsid for pid %pid to %file", array('%dsid' => $ds->ID, '%pid' => $pid, '%file' => $file)), 'error'); return FALSE; - } + } else { $log[] = log_line(t("Exported %pid to %file", array('%pid' => $pid, '%file' => $file)), 'info'); } @@ -170,10 +196,22 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re return TRUE; } +/** + * Get file extension + * @param type $mimeType + * @return type + */ function get_file_extension($mimeType) { return substr(strstr($mimeType, '/'), 1); } +/** + * Log line + * @param type $msg + * @param type $severity + * @param type $sep + * @return type + */ function log_line($msg, $severity = 'info', $sep = "\t") { return date("Y-m-d H:i:s") . $sep . ucfirst($severity) . $sep . $msg; } diff --git a/api/fedora_item.inc b/api/fedora_item.inc index aabe5d32..9750ec70 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -2,9 +2,16 @@ // $Id$ +/** + * @file + * Fedora Item + */ define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#'); define("FEDORA_MODEL_URI", 'info:fedora/fedora-system:def/model#'); +/** + * Fedora Item Class + */ class Fedora_Item { public $pid = NULL; // The $pid of the fedora object represented by an instance of this class. @@ -51,10 +58,24 @@ class Fedora_Item { } } + /** + * Exists + * @return type + */ function exists() { return (!empty($this->objectProfile)); } + /** + * Add datastream from file + * @param type $datastream_file + * @param type $datastream_id + * @param type $datastream_label + * @param type $datastream_mimetype + * @param type $controlGroup + * @param type $logMessage + * @return type + */ function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = null) { module_load_include('inc', 'fedora_repository', 'MimeClass'); if (empty($datastream_mimetype)) { @@ -76,6 +97,16 @@ class Fedora_Item { return $return_value; } + /** + * Add datastream from url + * @param type $datastream_url + * @param type $datastream_id + * @param type $datastream_label + * @param type $datastream_mimetype + * @param type $controlGroup + * @param type $logMessage + * @return type + */ function add_datastream_from_url($datastream_url, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = null) { if (empty($datastream_label)) { $datastream_label = $datastream_id; @@ -98,10 +129,19 @@ class Fedora_Item { ); - return $this->soap_call( 'addDataStream', $params ); - + return $this->soap_call('addDataStream', $params); } + /** + * Add datastream from string + * @param type $str + * @param type $datastream_id + * @param type $datastream_label + * @param type $datastream_mimetype + * @param type $controlGroup + * @param type $logMessage + * @return type + */ function add_datastream_from_string($str, $datastream_id, $datastream_label = NULL, $datastream_mimetype = 'text/xml', $controlGroup = 'M', $logMessage = null) { $dir = sys_get_temp_dir(); $tmpfilename = tempnam($dir, 'fedoratmp'); @@ -116,8 +156,9 @@ class Fedora_Item { /** * Add a relationship string to this object's RELS-EXT. * does not support rels-int yet. - * @param string $relationship - * @param $object + * @param type $relationship + * @param type $object + * @param type $namespaceURI */ function add_relationship($relationship, $object, $namespaceURI = RELS_EXT_URI) { $ds_list = $this->get_datastreams_list_as_array(); @@ -214,6 +255,10 @@ class Fedora_Item { //print ($description->dump_node()); } + /** + * Export as foxml + * @return type + */ function export_as_foxml() { $params = array( 'pid' => $this->pid, @@ -290,6 +335,12 @@ class Fedora_Item { return $results; } + /** + * Get datastream dissemination + * @param type $dsid + * @param type $as_of_date_time + * @return string + */ function get_datastream_dissemination($dsid, $as_of_date_time = "") { $params = array( 'pid' => $this->pid, @@ -307,6 +358,12 @@ class Fedora_Item { return $content; } + /** + * Get datastream + * @param type $dsid + * @param type $as_of_date_time + * @return type + */ function get_datastream($dsid, $as_of_date_time = "") { $params = array( 'pid' => $this->pid, @@ -318,6 +375,11 @@ class Fedora_Item { return $object->datastream; } + /** + * Get datastream history + * @param type $dsid + * @return type + */ function get_datastream_history($dsid) { $params = array( 'pid' => $this->pid, @@ -332,6 +394,14 @@ class Fedora_Item { return $ret; } + /** + * Get dissemination + * @param type $service_definition_pid + * @param type $method_name + * @param type $parameters + * @param type $as_of_date_time + * @return string + */ function get_dissemination($service_definition_pid, $method_name, $parameters = array(), $as_of_date_time = null) { $params = array( 'pid' => $this->pid, @@ -530,6 +600,9 @@ class Fedora_Item { /** * Removes this object form the repository. + * @param type $log_message + * @param type $force + * @return type */ function purge($log_message = 'Purged using Islandora API.', $force = FALSE) { $params = array( @@ -541,6 +614,15 @@ class Fedora_Item { return $this->soap_call('purgeObject', $params); } + /** + * Purge datastream + * @param type $dsID + * @param type $start_date + * @param type $end_date + * @param type $log_message + * @param type $force + * @return type + */ function purge_datastream($dsID, $start_date = NULL, $end_date = NULL, $log_message = 'Purged datastream using Islandora API', $force = FALSE) { $params = array( 'pid' => $this->pid, @@ -553,11 +635,21 @@ class Fedora_Item { return $this->soap_call('purgeDatastream', $params); } + /** + * URL + * @global type $base_url + * @return type + */ function url() { global $base_url; return $base_url . '/fedora/repository/' . $this->pid . (!empty($this->objectProfile) ? '/-/' . drupal_urlencode($this->objectProfile->objLabel) : ''); } + /** + * Get Next PID in Namespace + * @param type $pid_namespace + * @return type + */ static function get_next_PID_in_namespace($pid_namespace = '') { if (empty($pid_namespace)) { @@ -581,18 +673,32 @@ class Fedora_Item { return $result->pid; } + /** + * ingest from FOXML + * @param type $foxml + * @return Fedora_Item + */ static function ingest_from_FOXML($foxml) { $params = array('objectXML' => $foxml->saveXML(), 'format' => "info:fedora/fedora-system:FOXML-1.1", 'logMessage' => "Fedora Object Ingested"); $object = self::soap_call('ingest', $params); return new Fedora_Item($object->objectPID); } + /** + * ingest from FOXML file + * @param type $foxml_file + * @return type + */ static function ingest_from_FOXML_file($foxml_file) { $foxml = new DOMDocument(); $foxml->load($foxml_file); return self::ingest_from_FOXML($foxml); } + /** + * ingest from FOXML files in directory + * @param type $path + */ static function ingest_from_FOXML_files_in_directory($path) { // Open the directory $dir_handle = @opendir($path); @@ -605,13 +711,22 @@ class Fedora_Item { try { self::ingest_from_FOXML_file($path . '/' . $file); } catch (exception $e) { - + } } // Close closedir($dir_handle); } + /** + * Modify Object + * @param type $label + * @param type $state + * @param type $ownerId + * @param type $logMessage + * @param type $quiet + * @return type + */ function modify_object($label = '', $state = null, $ownerId = null, $logMessage = 'Modified by Islandora API', $quiet=TRUE) { $params = array( @@ -625,6 +740,17 @@ class Fedora_Item { return self::soap_call('modifyObject', $params, $quiet); } + /** + * Modify datastream by reference + * @param type $external_url + * @param type $dsid + * @param type $label + * @param type $mime_type + * @param type $force + * @param type $logMessage + * @param type $quiet + * @return type + */ function modify_datastream_by_reference($external_url, $dsid, $label, $mime_type, $force = FALSE, $logMessage = 'Modified by Islandora API', $quiet=FALSE) { $params = array( 'pid' => $this->pid, @@ -642,6 +768,17 @@ class Fedora_Item { return self::soap_call('modifyDatastreamByReference', $params, $quiet); } + /** + * Modify datastream by value + * @param type $content + * @param type $dsid + * @param type $label + * @param type $mime_type + * @param type $force + * @param type $logMessage + * @param type $quiet + * @return type + */ function modify_datastream_by_value($content, $dsid, $label, $mime_type, $force = FALSE, $logMessage = 'Modified by Islandora API', $quiet=FALSE) { $params = array( 'pid' => $this->pid, @@ -659,6 +796,13 @@ class Fedora_Item { return self::soap_call('modifyDatastreamByValue', $params, $quiet); } + /** + * Soap call + * @param type $function_name + * @param type $params_array + * @param type $quiet + * @return type + */ static function soap_call($function_name, $params_array, $quiet = FALSE) { if (!self::$connection_helper) { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); @@ -730,6 +874,9 @@ class Fedora_Item { * * @param string $pid if none given, getnextpid will be called. * @param string $state The initial state, A - Active, I - Inactive, D - Deleted + * @param type $label + * @param type $owner + * @return DOMDocument */ static function create_object_FOXML($pid = '', $state = 'A', $label = 'Untitled', $owner = '') { $foxml = new DOMDocument("1.0", "UTF-8"); @@ -778,10 +925,23 @@ class Fedora_Item { return $foxml; } + /** + * ingest new item + * @param type $pid + * @param type $state + * @param type $label + * @param type $owner + * @return type + */ static function ingest_new_item($pid = '', $state = 'A', $label = '', $owner = '') { return self::ingest_from_FOXML(self::create_object_FOXML($pid, $state, $label, $owner)); } + /** + * fedora item exists + * @param type $pid + * @return type + */ static function fedora_item_exists($pid) { $item = new Fedora_Item($pid); return $item->exists(); diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index d80ee701..20aeb2a3 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -1,35 +1,48 @@ uid == 0) { + if ((!isset($user)) || $user->uid == 0) { $fedora_user = 'anonymous'; $fedora_pass = 'anonymous'; } @@ -51,7 +64,7 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, "$fedora_user:$fedora_pass"); //curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); - if ($number_of_post_vars>0&&$post) { + if ($number_of_post_vars > 0 && $post) { curl_setopt($ch, CURLOPT_POST, $number_of_post_vars); curl_setopt($ch, CURLOPT_POSTFIELDS, "$post"); } @@ -65,29 +78,36 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post } } +/** + * Fedora available + * @return type + */ function fedora_available() { - $response = do_curl(variable_get('fedora_base_url', 'http://localhost:8080/fedora').'/describe'); + $response = do_curl(variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/describe'); return strstr($response, 'Repository Information HTML Presentation') !== FALSE; - } - /** * Returns a UTF-8-encoded transcripiton of the string given in $in_str. * @param string $in_str * @return string A UTF-8 encoded string. */ function fix_encoding($in_str) { - $cur_encoding = mb_detect_encoding($in_str) ; + $cur_encoding = mb_detect_encoding($in_str); if ($cur_encoding == "UTF-8" && mb_check_encoding($in_str, "UTF-8")) { return $in_str; } else { return utf8_encode($in_str); } -} +} +/** + * valid pid ?? + * @param type $pid + * @return boolean + */ function validPid($pid) { $valid = FALSE; if (strlen(trim($pid)) <= 64 && preg_match('/^([A-Za-z0-9]|-|\.)+:(([A-Za-z0-9])|-|\.|~|_|(%[0-9A-F]{2}))+$/', trim($pid))) { @@ -97,6 +117,11 @@ function validPid($pid) { return $valid; } +/** + * Valid Dsid ?? + * @param type $dsid + * @return boolean + */ function validDsid($dsid) { $valid = FALSE; if (strlen(trim($dsid)) <= 64 && preg_match('/^[a-zA-Z0-9\_\-\.]+$/', trim($dsid))) { @@ -106,6 +131,11 @@ function validDsid($dsid) { return $valid; } +/** + * fixDsid ?? + * @param type $dsid + * @return string + */ function fixDsid($dsid) { $new_dsid = trim($dsid); @@ -113,16 +143,15 @@ function fixDsid($dsid) { $replace = ''; $new_dsid = preg_replace($find, $replace, $new_dsid); - if( strlen($new_dsid) > 63 ) + if (strlen($new_dsid) > 63) $new_dsid = substr($new_dsid, -63); - if( preg_match('/^[^a-zA-Z]/', $dsid ) ) + if (preg_match('/^[^a-zA-Z]/', $dsid)) $new_dsid = 'x' . $new_dsid; - if( strlen($new_dsid) == 0 ) + if (strlen($new_dsid) == 0) $new_dsid = 'item' . rand(1, 100); return $new_dsid; - } diff --git a/api/rels-ext.inc b/api/rels-ext.inc index 06aa4cd5..7ddce028 100644 --- a/api/rels-ext.inc +++ b/api/rels-ext.inc @@ -1,43 +1,47 @@ get_datastream_dissemination('RELS-EXT'); - - } - - function modified() { - return !(empty(array_diff($this->relsExtArray, $this->originalRelsExtArray)) && - empty(array_diff($this->originalRelsExtArray, $this->relsExtArray))); - } - - /** - * Save the current state of the RELS-EXT array out to the repository item - * as a datastream. - */ - function save() { - - } + + // Instance variables + public $relsExtArray = array(); + private $originalRelsExtArray = array(); // Used to determine the result of modified() funciton. + + /** + * Constructor that builds itself by retrieving the RELS-EXT stream from + * the repository for the given Fedora_Item. + * @param Fedora_Item $item + */ + + function RelsExt($item) { + $relsextxml = $item->get_datastream_dissemination('RELS-EXT'); + } + + /** + * modified + * @return type + */ + function modified() { + return!(empty(array_diff($this->relsExtArray, $this->originalRelsExtArray)) && + empty(array_diff($this->originalRelsExtArray, $this->relsExtArray))); + } + + /** + * Save the current state of the RELS-EXT array out to the repository item + * as a datastream. + */ + function save() { + + } + } diff --git a/api/tagging.inc b/api/tagging.inc index 4156d7d4..a4191303 100644 --- a/api/tagging.inc +++ b/api/tagging.inc @@ -1,20 +1,25 @@ item = $item; @@ -22,8 +27,12 @@ class TagSet { } } + /** + * Load ?? + * @return type + */ function load() { - $tagsxml = isset($this->item->datastreams[$this->tagsDSID])? $this->item->get_datastream_dissemination($this->tagsDSID) : NULL; + $tagsxml = isset($this->item->datastreams[$this->tagsDSID]) ? $this->item->get_datastream_dissemination($this->tagsDSID) : NULL; if (empty($tagsxml)) { $this->tags = array(); return FALSE; @@ -59,11 +68,11 @@ class TagSet { else { $this->item->modify_datastream_by_value($tagdoc->saveXML(), $this->tagsDSID, 'Tags', 'text/xml', 'X'); } - } - catch (exception $e) { + } catch (exception $e) { drupal_set_message('There was an error saving the tags datastream: !e', array('!e' => $e), 'error'); return FALSE; } return TRUE; } + } From c05a9bfeb9970a96e72c90b6dbdae4eea61a2067 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Tue, 9 Aug 2011 10:21:32 -0300 Subject: [PATCH 021/247] Removed netbeans generated comments --- api/fedora_utils.inc | 1 + plugins/Refworks.inc | 7 +------ plugins/tagging_form.inc | 4 ---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 20aeb2a3..e722b8c4 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -6,6 +6,7 @@ * @file * Base utilities used by the Islandora fedora module. */ + /* * Functions that emulate php5.3 functionality for backwards compatiablity */ diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 6fc809e8..1a6ba96a 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -6,12 +6,7 @@ * @file * Refworks class */ -/* - * Created on 26-Feb-08 - * - * To change the template for this generated file go to - * Window - Preferences - PHPeclipse - PHP - Code Templates - */ + module_load_include('inc', 'fedora_repository', 'SecurityClass'); /** diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index acc826fd..0a421105 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -6,10 +6,6 @@ * @file * Tagging Form??? */ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ /** * Show subject tags ??? From d4a3ff7ec103757b4b9308bf62dfa1c79853a49f Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Mon, 15 Aug 2011 10:45:49 -0300 Subject: [PATCH 022/247] Documenting incs found in the root directory --- CollectionClass.inc | 88 +++- CollectionPolicy.inc | 386 +++++++------- ConnectionHelper.inc | 73 ++- ContentModel.inc | 1168 ++++++++++++++++++++++++------------------ MimeClass.inc | 384 +++++++------- ObjectHelper.inc | 159 ++++-- SearchClass.inc | 362 ++++++++----- SecurityClass.inc | 62 ++- XMLDatastream.inc | 23 +- formClass.inc | 4 - plugins/Flv.inc | 9 + 11 files changed, 1582 insertions(+), 1136 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index a7c369a3..c2929708 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -2,15 +2,18 @@ // $Id$ -/* - * Created on 18-Feb-08 - * - * To change the template for this generated file go to - * Window - Preferences - PHPeclipse - PHP - Code Templates +/** + * @file + * + * Collection Class Class + */ + +/** + * This CLASS caches the streams so once you call a getstream once it will always return + * the same stream as long as you are using the instance of this class. Cached to + * prevent mutiple hits to fedora. maybe a bit confusing though if this class is used in + * a different context. */ -// module_load_include('nc', 'CollectionClass', ''); -// This CLASS caches the streams so once you call a getstream once it will always return the same stream as long as you are using the -// instance of this class. Cached to prevent mutiple hits to fedora. maybe a bit confusing though if this class is used in a different context. class CollectionClass { public static $COLLECTION_CLASS_COLLECTION_POLICY_STREAM = 'COLLECTION_POLICY'; @@ -34,10 +37,10 @@ class CollectionClass { } } - /* gets objects related to this object. must include offset and limit + /** + * gets objects related to this object. must include offset and limit * calls getRelatedItems but enforces limit and offset */ - function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); @@ -96,6 +99,11 @@ class CollectionClass { return $content; } + /** + * getCollectionPolicyStream ?? + * @param type $collection_pid + * @return type + */ function getCollectionPolicyStream($collection_pid) { if ($this->collectionPolicyStream != NULL) { return $this->collectionPolicyStream; @@ -104,6 +112,11 @@ class CollectionClass { return $this->collectionPolicyStream; } + /** + * getRelationshipElement + * @param type $collection_pid + * @return type + */ function getRelationshipElement($collection_pid) { $stream = $this->getCollectionPolicyStream($collection_pid); try { @@ -116,17 +129,35 @@ class CollectionClass { return $relationship; } + /** + * getCollectionViewStream ?? + * @param type $collection_pid + * @return type + */ function getCollectionViewStream($collection_pid) { $this->collectionViewStream = $this->getStream($collection_pid, CollectionClass :: $COLLECTION_CLASS_COLLECTION_VIEW_STREAM, 0); return $this->collectionViewStream; } + /** + * getStream ?? + * @param type $pid + * @param type $dsid + * @param type $showError + * @return type + */ function getStream($pid, $dsid, $showError = 1) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new fedora_item($pid); return isset($item->datastreams[$dsid]) ? $item->get_datastream_dissemination($dsid) : NULL; } + /** + * getPidNameSpace ?? + * @param type $pid + * @param type $dsid + * @return type + */ function getPidNameSpace($pid, $dsid) { $stream = $this->getCollectionPolicyStream($pid); try { @@ -218,6 +249,12 @@ class CollectionClass { return NULL; } + /** + * getAllowedMimeType ?? + * @param type $contentModelPid + * @param type $contentModel_dsid + * @return type + */ function getAllowedMimeTypes($contentModelPid, $contentModel_dsid) { $stream = $this->getContentModelStream($contentModelPid, $contentModel_dsid); try { @@ -357,8 +394,13 @@ class CollectionClass { return $thisClass->$phpMethod($form, $ingest_form, $form_state['values'], $form_state); } - //this will also create a personal collection for an existing user if they don't have one - //not using this function currently + /** + * This will also create a personal collection for an existing user if they don't have one + * not using this function currently. + * + * @param type $user + * @return type + */ function createUserCollection(& $user) { if (isset($user->fedora_personal_pid)) { return; @@ -414,6 +456,13 @@ class CollectionClass { return $xslContent; } + /** + * showFieldSets ?? + * @global type $base_url + * @global type $user + * @param type $page_number + * @return string + */ function showFieldSets($page_number) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $base_url; @@ -451,6 +500,11 @@ class CollectionClass { return $tabset; } + /** + * getIngestInterface ?? + * @global type $base_url + * @return string + */ function getIngestInterface() { global $base_url; $objectHelper = new ObjectHelper(); @@ -474,6 +528,16 @@ class CollectionClass { return $ingestObject; } + /** + * renderCOllection ?? + * @global type $base_url + * @param type $content + * @param type $pid + * @param type $dsId + * @param type $collection + * @param int $pageNumber + * @return type + */ function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { $path = drupal_get_path('module', 'fedora_repository'); global $base_url; diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index 8997b42e..af28633e 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -2,15 +2,21 @@ // $Id$ +/** + * @file + * Collection Policy Class + */ module_load_include('inc', 'fedora_repository', 'XMLDatastream'); +/** + * Collection Policy class ?? + */ class CollectionPolicy extends XMLDatastream { - static $SCHEMA_URI = 'http://syn.lib.umanitoba.ca/collection_policy.xsd'; + static $SCHEMA_URI = 'http://syn.lib.umanitoba.ca/collection_policy.xsd'; static $DEFAULT_DSID = 'COLLECTION_POLICY'; + private $staging_area = NULL; - private $staging_area=NULL; - /** * Gets the default DSID to use for ContentModel datastreams. * @@ -33,31 +39,30 @@ class CollectionPolicy extends XMLDatastream { static function loadFromCollection($pid, $preFetch=TRUE) { $ret = FALSE; module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - + try { if (self::validPid($pid)) { - $dsid=CollectionPolicy::getDefaultDSID(); + $dsid = CollectionPolicy::getDefaultDSID(); if ($preFetch) { $fedoraItem = new Fedora_Item($pid); $ds = $fedoraItem->get_datastream_dissemination($dsid); - } else { - $ds=null; } - + else { + $ds = null; + } } - + if (!empty($ds) || !$preFetch) { - $ret=new CollectionPolicy($ds, $pid, $dsid); + $ret = new CollectionPolicy($ds, $pid, $dsid); } - } - catch (SOAPException $e) { - + } catch (SOAPException $e) { + $ret = FALSE; } return $ret; } - + /** * Ingests a new Collection Policy datastream to the specified * PID with the DSID specified. The file should be a valid collection @@ -68,24 +73,24 @@ class CollectionPolicy extends XMLDatastream { * @param string $cpDsid * @param string $file * @return CollectionPolicy $ret - */ + */ public static function ingestFromFile($pid, $name, $cpDsid, $file) { $ret = FALSE; - + if (($cp = self::loadFromCollection($pid, $cpDsid)) === FALSE && file_exists($file)) { $cp = new ContentModel(file_get_contents($file), $pid, $cpDsid); $rootEl = $cp->xml->getElementsByTagName('collection_policy')->item(0); $rootEl->setAttribute('name', $name); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $ret = $cp; } - + return $ret; } - + /** * Ingests a new Collection Policy datastream to the specified * PID with the DSID specified. Clones the collection policy from the @@ -96,26 +101,26 @@ class CollectionPolicy extends XMLDatastream { * @param string $cpDsid * @param string $copy_collection_pid * @return CollectionPolicy $ret - */ + */ public static function ingestFromCollection($pid, $name, $cpDsid, $copy_collection_pid) { $ret = FALSE; - + if (($cp = self::loadFromCollection($pid, $cpDsid)) === FALSE && ($copy_cp = self::loadFromCollection($copy_collection_pid)) !== FALSE && $copy_cp->validate()) { $newDom = $copy_cp->xml; $rootEl = $newDom->getElementsByTagName('collection_policy')->item(0); $rootEl->setAttribute('name', $name); - + $cp = new CollectionPolicy($newDom, $pid, $cpDsid); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $ret = $cp; } - + return $ret; - } - + } + /** * Ingests a new minimum Collection Policy datastream to the specified * PID with the DSID specified. Initializes the policy with the specified values. @@ -130,10 +135,10 @@ class CollectionPolicy extends XMLDatastream { * @param string $searchField * @param string $searchValue * @return CollectionPolicy $ret - */ + */ public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) { - $ret = FALSE; - if (($cp = self::loadFromCollection($pid )) === FALSE) { //removed second, non-existant variable + $ret = FALSE; + if (($cp = self::loadFromCollection($pid)) === FALSE) { //removed second, non-existant variable module_load_include('inc', 'fedora_repository', 'ContentModel'); if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) { $newDom = new DOMDocument('1.0', 'utf-8'); @@ -142,45 +147,43 @@ class CollectionPolicy extends XMLDatastream { $rootEl->setAttribute('name', $name); $rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS .' '. self::$SCHEMA_URI); - + $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS . ' ' . self::$SCHEMA_URI); + $modelsEl = $newDom->createElement('content_models'); - + $cmEl = $newDom->createElement('content_model'); $cmEl->setAttribute('name', $cm->getName()); $cmEl->setAttribute('dsid', $cm->dsid); $cmEl->setAttribute('namespace', $model_namespace); $cmEl->setAttribute('pid', $cm->pid); - - $modelsEl->appendChild($cmEl); + + $modelsEl->appendChild($cmEl); $rootEl->appendChild($modelsEl); - + $relEl = $newDom->createElement('relationship', $relationship); $rootEl->appendChild($relEl); - + $searchTermsEl = $newDom->createElement('search_terms'); $newTermEl = $newDom->createElement('term', $searchValue); $newTermEl->setAttribute('field', $searchField); $searchTermsEl->appendChild($newTermEl); $rootEl->appendChild($searchTermsEl); - + $newDom->appendChild($rootEl); - + $cp = new CollectionPolicy($newDom, $pid, $policyDsid); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - + + $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $policyDsid, $name, 'text/xml', 'X'); $ret = $cp; } - } - + return $ret; - } - + } /** * Constructor @@ -192,10 +195,10 @@ class CollectionPolicy extends XMLDatastream { * @return XMLDatastream $cm */ public function __construct($xmlStr, $pid = NULL, $dsid = NULL) { - parent::__construct($xmlStr,$pid,$dsid); - $this->name= 'Collection Policy'; + parent::__construct($xmlStr, $pid, $dsid); + $this->name = 'Collection Policy'; } - + /** * Attempts to convert from the old XML schema to the new by * traversing the XML DOM and building a new DOM. When done @@ -205,17 +208,17 @@ class CollectionPolicy extends XMLDatastream { */ protected function convertFromOldSchema() { if ($this->xml == NULL) { - $this->fetchXml(); + $this->fetchXml(); } $sXml = simplexml_load_string($this->xml->saveXML()); $newDom = new DOMDocument('1.0', 'utf-8'); $newDom->formatOutput = TRUE; - + $rootEl = $newDom->createElement('collection_policy'); $rootEl->setAttribute('name', $sXml['name']); $rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS .' '. self::$SCHEMA_URI); + $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS . ' ' . self::$SCHEMA_URI); $content_modelsEl = $newDom->createElement('content_models'); foreach ($sXml->contentmodels->contentmodel as $contentmodel) { @@ -227,13 +230,13 @@ class CollectionPolicy extends XMLDatastream { $content_modelsEl->appendChild($content_modelEl); } $rootEl->appendChild($content_modelsEl); - + $search_termsEl = $newDom->createElement('search_terms'); foreach ($sXml->search_terms->term as $term) { $termEl = $newDom->createElement('term', $term->value); $termEl->setAttribute('field', $term->field); if (strval($sXml->search_terms->default) == $term->field) { - $termEl->setAttribute('default', 'true'); + $termEl->setAttribute('default', 'true'); } $search_termsEl->appendChild($termEl); } @@ -241,13 +244,12 @@ class CollectionPolicy extends XMLDatastream { $relationshipEl = $newDom->createElement('relationship', $sXml->relationship); $rootEl->appendChild($relationshipEl); - + $newDom->appendChild($rootEl); $this->xml = DOMDocument::loadXML($newDom->saveXml()); } - /** * Gets the name of the relationship to use * for members of this collection. @@ -256,14 +258,14 @@ class CollectionPolicy extends XMLDatastream { * @return string $relationship */ public function getRelationship() { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { - $ret=trim($this->xml->getElementsByTagName('relationship')->item(0)->nodeValue); + $ret = trim($this->xml->getElementsByTagName('relationship')->item(0)->nodeValue); } return $ret; } - - /** + + /** * Sets the name of the relationship to use * for members of this collection. * Returns FALSE on failure. @@ -272,16 +274,16 @@ class CollectionPolicy extends XMLDatastream { * @return boolean $ret */ public function setRelationship($relationship) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { - $relationshipEl=$this->xml->getElementsByTagName('relationship')->item(0); - $relationshipEl->nodeValue=trim($relationship); + $relationshipEl = $this->xml->getElementsByTagName('relationship')->item(0); + $relationshipEl->nodeValue = trim($relationship); $ret = TRUE; } - return $ret; + return $ret; } - - /** + + /** * Gets the path to the staging area to use for this * collection. By default recurses to the parent collection * if the staging area is undefined @@ -290,17 +292,18 @@ class CollectionPolicy extends XMLDatastream { * @return string $path */ public function getStagingArea($recurse=TRUE) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { if ($this->staging_area === NULL) { - $stagingEl=$this->xml->getElementsByTagName('staging_area'); - + $stagingEl = $this->xml->getElementsByTagName('staging_area'); + if ($stagingEl->length > 0) { $this->staging_area = trim($stagingEl->item(0)->nodeValue); - } elseif ($recurse) { + } + elseif ($recurse) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $item=new Fedora_Item($this->pid); - $rels=$item->get_relationships(); + $item = new Fedora_Item($this->pid); + $rels = $item->get_relationships(); if (count($rels) > 0) { foreach ($rels as $rel) { $cp = CollectionPolicy::loadFromCollection($rel['object']); @@ -310,16 +313,15 @@ class CollectionPolicy extends XMLDatastream { } } } - } + } } - + $ret = $this->staging_area; - } return $ret; } - - /** + + /** * Sets the path to the staging area to use for this * collection. If specified path is blank (or false) it will * remove the staging are path element from the collection policy. @@ -329,84 +331,77 @@ class CollectionPolicy extends XMLDatastream { * @return string $relationship */ public function setStagingArea($path) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { - $rootEl=$this->xml->getElementsByTagName('collection_policy')->item(0); - $stagingEl=$this->xml->getElementsByTagName('staging_area'); + $rootEl = $this->xml->getElementsByTagName('collection_policy')->item(0); + $stagingEl = $this->xml->getElementsByTagName('staging_area'); if ($stagingEl->length > 0) { - $stagingEl=$stagingEl->item(0); - if (trim($path) == '') { - $rootEl->removeChild($stagingEl); - } + $stagingEl = $stagingEl->item(0); + if (trim($path) == '') { + $rootEl->removeChild($stagingEl); + } else { - $stagingEl->nodeValue=trim($path); - } - } + $stagingEl->nodeValue = trim($path); + } + } elseif (trim($path) != '') { - $stagingEl=$this->xml->createElement('staging_area', trim($path)); - $rootEl->appendChild($stagingEl); + $stagingEl = $this->xml->createElement('staging_area', trim($path)); + $rootEl->appendChild($stagingEl); } $ret = TRUE; } - return $ret; - } - - + return $ret; + } + /** - * Gets the next available PID for the - * content model specified by the DSID - * parameter. - * - * @param string $dsid - * @return string $nextPid - */ + * Gets the next available PID for the + * content model specified by the DSID + * parameter. + * + * @param string $dsid + * @return string $nextPid + */ public function getNextPid($dsid) { $ret = FALSE; if (self::validDsid($dsid) && $this->validate()) { $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); $namespace = FALSE; - for ($i=0; $namespace === FALSE && $i<$content_models->length;$i++) { + for ($i = 0; $namespace === FALSE && $i < $content_models->length; $i++) { if (strtolower($content_models->item($i)->getAttribute('dsid')) == strtolower($dsid)) { $namespace = $content_models->item($i)->getAttribute('namespace'); } } $pname = substr($namespace, 0, strpos($namespace, ":")); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $ret = Fedora_Item::get_next_pid_in_namespace($pname); } return $ret; } - + /** - * Gets a list of ContentModel objects supported by this collection. - * - * @return ContentModel[] $models - */ + * Gets a list of ContentModel objects supported by this collection. + * + * @return ContentModel[] $models + */ function getContentModels() { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { module_load_include('inc', 'Fedora_Repository', 'ContentModel'); - $ret=array(); + $ret = array(); $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); - for ($i=0;$i<$content_models->length;$i++) { - $cm=ContentModel::loadFromModel($content_models->item($i)->getAttribute('pid'), - $content_models->item($i)->getAttribute('dsid'), - $content_models->item($i)->getAttribute('namespace'), - $content_models->item($i)->getAttribute('name')); - if ($cm !== FALSE) { - $ret[]=$cm; - } - + for ($i = 0; $i < $content_models->length; $i++) { + $cm = ContentModel::loadFromModel($content_models->item($i)->getAttribute('pid'), $content_models->item($i)->getAttribute('dsid'), $content_models->item($i)->getAttribute('namespace'), $content_models->item($i)->getAttribute('name')); + if ($cm !== FALSE) { + $ret[] = $cm; + } } } return $ret; } - - /** * Gets a list of search terms from the Collection Policy. If asArray is set * it will return an associative array with the value, field name, and the default value. @@ -421,52 +416,51 @@ class CollectionPolicy extends XMLDatastream { */ function getSearchTerms($asArray = FALSE, $recurse = FALSE, $cache = FALSE) { $ret = FALSE; - - if ($cache == TRUE && ($cache = cache_get('collection_policy_search_terms-'.$this->pid)) !== 0 ) { - $ret=$cache->data; - } else { - + + if ($cache == TRUE && ($cache = cache_get('collection_policy_search_terms-' . $this->pid)) !== 0) { + $ret = $cache->data; + } + else { + if ($this->xml == NULL) { - $fedoraItem = new Fedora_Item($this->pid); - $ds = $fedoraItem->get_datastream_dissemination($this->dsid); - $this->xml = DOMDocument::loadXML($ds); + $fedoraItem = new Fedora_Item($this->pid); + $ds = $fedoraItem->get_datastream_dissemination($this->dsid); + $this->xml = DOMDocument::loadXML($ds); } - + if ($this->validate()) { - $ret=array(); - $terms= $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term'); - for ($i=0;$i<$terms->length;$i++) { - $default = $terms->item($i)->attributes->getNamedItem('default'); - $default = ($default !== NULL) ? (strtolower($default->nodeValue) == 'true') : FALSE; - $ret[] = ($asArray)?array( 'value' => $terms->item($i)->nodeValue, - 'field' => $terms->item($i)->getAttribute('field'), - 'default' => $default): $terms->item($i)->nodeValue; - } - - - if ($recurse && count($ret) == 0) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $item=new Fedora_Item($this->pid); - $rels=$item->get_relationships(); - if (count($rels) > 0) { - foreach ($rels as $rel) { - $cp = CollectionPolicy::loadFromCollection($rel['object']); - if ($cp !== FALSE) { - $ret = $cp->getSearchTerms($asArray, $recurse); - break; - } - } - } - } - cache_set('collection_policy_search_terms-'.$this->pid, $ret, 'cache', time()+3600); - + $ret = array(); + $terms = $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term'); + for ($i = 0; $i < $terms->length; $i++) { + $default = $terms->item($i)->attributes->getNamedItem('default'); + $default = ($default !== NULL) ? (strtolower($default->nodeValue) == 'true') : FALSE; + $ret[] = ($asArray) ? array('value' => $terms->item($i)->nodeValue, + 'field' => $terms->item($i)->getAttribute('field'), + 'default' => $default) : $terms->item($i)->nodeValue; + } + + + if ($recurse && count($ret) == 0) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $item = new Fedora_Item($this->pid); + $rels = $item->get_relationships(); + if (count($rels) > 0) { + foreach ($rels as $rel) { + $cp = CollectionPolicy::loadFromCollection($rel['object']); + if ($cp !== FALSE) { + $ret = $cp->getSearchTerms($asArray, $recurse); + break; + } + } + } + } + cache_set('collection_policy_search_terms-' . $this->pid, $ret, 'cache', time() + 3600); } } return $ret; } - /** * Adds a search term to the collection policy. * Returns fase on failure. @@ -476,17 +470,17 @@ class CollectionPolicy extends XMLDatastream { * @return boolean $success */ function addTerm($field, $value) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); - $terms= $search_termsEl->getElementsByTagName('term'); - $found=FALSE; - for ($i=0;!$found && $i<$terms->length;$i++) { + $terms = $search_termsEl->getElementsByTagName('term'); + $found = FALSE; + for ($i = 0; !$found && $i < $terms->length; $i++) { if ($terms->item($i)->getAttribute('field') == $field) { - $found = TRUE; + $found = TRUE; } } - + if (!$found) { $newTermEl = $this->xml->createElement('term', $value); $newTermEl->setAttribute('field', $field); @@ -502,19 +496,19 @@ class CollectionPolicy extends XMLDatastream { * * @param string $field * @return boolean $success - */ + */ function removeTerm($field) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); $terms = $search_termsEl->getElementsByTagName('term'); $found = FALSE; - for ($i=0; !$found && $i < $terms->length; $i++) { + for ($i = 0; !$found && $i < $terms->length; $i++) { if ($terms->item($i)->getAttribute('field') == $field) { - $found = $terms->item($i); + $found = $terms->item($i); } } - + if ($found !== FALSE) { $search_termsEl->removeChild($found); $ret = TRUE; @@ -523,21 +517,25 @@ class CollectionPolicy extends XMLDatastream { return $ret; } - - function setDefaultTerm($field) { + /** + * setDefaultTerm ?? + * @param type $field + * @return boolean + */ + function setDefaultTerm($field) { $ret = FALSE; if ($this->validate()) { $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); - $terms= $search_termsEl->getElementsByTagName('term'); - $found=FALSE; - for ($i=0;!$found && $i<$terms->length;$i++) { + $terms = $search_termsEl->getElementsByTagName('term'); + $found = FALSE; + for ($i = 0; !$found && $i < $terms->length; $i++) { if ($terms->item($i)->getAttribute('field') == $field) { - $found = $terms->item($i); + $found = $terms->item($i); } } - + if ($found !== FALSE) { - for ($i=0;$i<$terms->length;$i++) + for ($i = 0; $i < $terms->length; $i++) if ($terms->item($i)->attributes->getNamedItem('default') !== NULL) { $terms->item($i)->removeAttribute('default'); } @@ -547,8 +545,7 @@ class CollectionPolicy extends XMLDatastream { } return $ret; } - - + /** * Removes the specified content model from the collection policy. This will only * prevent future ingests of the removed model to the collection. $cm should be @@ -559,17 +556,17 @@ class CollectionPolicy extends XMLDatastream { * @return boolean $valid */ function removeModel($cm) { - $ret=FALSE; + $ret = FALSE; if ($this->validate() && $cm->validate()) { $contentmodelsEl = $this->xml->getElementsByTagName('content_models'); $models = $contentmodelsEl->item(0)->getElementsByTagName('content_model'); $found = FALSE; - for ($i=0; $found === FALSE && $i < $models->length; $i++) { + for ($i = 0; $found === FALSE && $i < $models->length; $i++) { if ($models->item($i)->getAttribute('pid') == $cm->pid) { - $found=$models->item($i); + $found = $models->item($i); } - } - + } + if ($found !== FALSE && $models->length > 1) { $contentmodelsEl->item(0)->removeChild($found); $ret = TRUE; @@ -577,21 +574,24 @@ class CollectionPolicy extends XMLDatastream { } return $ret; } - - - + /** + * addModel ?? + * @param type $cm + * @param type $namespace + * @return type + */ function addModel($cm, $namespace) { $ret = FALSE; if (self::validPid($namespace) && $this->validate() && $cm->validate()) { $contentmodelsEl = $this->xml->getElementsByTagName('content_models'); $models = $contentmodelsEl->item(0)->getElementsByTagName('content_model'); $found = FALSE; - for ($i=0;!$found && $i<$models->length;$i++) { + for ($i = 0; !$found && $i < $models->length; $i++) { if ($models->item($i)->getAttribute('pid') == $cm->pid) $found = TRUE; } - + if (!$found) { $cmEl = $this->xml->createElement('content_model'); $cmEl->setAttribute('name', $cm->getName()); @@ -600,16 +600,20 @@ class CollectionPolicy extends XMLDatastream { $cmEl->setAttribute('pid', $cm->pid); $contentmodelsEl->item(0)->appendChild($cmEl); } - + $ret = !$found; } return $ret; } - + + /** + * getName ?? + * @return type + */ function getName() { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { - $ret=$this->xml->getElementsByTagName('collection_policy')->item(0)->getAttribute('name'); + $ret = $this->xml->getElementsByTagName('collection_policy')->item(0)->getAttribute('name'); } return $ret; } diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 68ed4124..344fb6a9 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -1,57 +1,76 @@ $url))); return NULL; } - + return $new_url; } + /** + * getSoapClient + * @global type $user + * @param type $url + * @param type $exceptions + * @return SoapClient + */ function getSoapClient($url = NULL, $exceptions = TRUE) { if (empty($url)) { - $url=variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'); + $url = variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'); } - + global $user; if ($user->uid == 0) { //anonymous user. We will need an entry in the fedora users.xml file //with the appropriate entry for a username of anonymous password of anonymous try { $client = new SoapClient($this->_fixURL($url, 'anonymous', 'anonymous'), array( - 'login' => 'anonymous', - 'password' => 'anonymous', - 'exceptions' => $exceptions, - )); - } - catch (SoapFault $e) { + 'login' => 'anonymous', + 'password' => 'anonymous', + 'exceptions' => $exceptions, + )); + } catch (SoapFault $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage()))); return NULL; } @@ -59,17 +78,17 @@ class ConnectionHelper { else { try { $client = new SoapClient($this->_fixURL($url, $user->name, $user->pass), array( - 'login' => $user->name, - 'password' => $user->pass, - 'exceptions' => TRUE, - )); - } - catch (SoapFault $e) { + 'login' => $user->name, + 'password' => $user->pass, + 'exceptions' => TRUE, + )); + } catch (SoapFault $e) { drupal_set_message(t("!e", array('!e' => $e->getMessage()))); return NULL; } } return $client; } + } diff --git a/ContentModel.inc b/ContentModel.inc index 4ed21c3d..d0c07bbb 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -2,12 +2,19 @@ // $Id$ +/** + * @file + * Content Model Class + */ module_load_include('inc', 'fedora_repository', 'XMLDatastream'); +/** + * Conent Model ?? + */ class ContentModel extends XMLDatastream { + static $SCHEMA_URI = 'http://localhost/islandoracm.xsd'; static $DEFAULT_DSID = 'ISLANDORACM'; - private $mimes = NULL; public $pid_namespace; public $name; @@ -33,7 +40,7 @@ class ContentModel extends XMLDatastream { $ret = FALSE; if (self::validPid($pid)) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $objectHelper=new ObjectHelper(); + $objectHelper = new ObjectHelper(); $content_models = $objectHelper->get_content_models_list($pid); foreach ($content_models as $content_model) { @@ -58,21 +65,20 @@ class ContentModel extends XMLDatastream { */ public static function ingestFromFile($pid, $name, $modelDsid, $file) { $ret = FALSE; - + if (($cm = self::loadFromModel($pid, $modelDsid)) === FALSE && file_exists($file)) { $cm = new ContentModel(file_get_contents($file), $pid, $modelDsid); $rootEl = $cm->xml->getElementsByTagName('content_model')->item(0); $rootEl->setAttribute('name', $name); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); - $ret= $cm; - } + $ret = $cm; + } return $ret; } - /** * Ingests a Content Model from an existing model to the specified pid/dsid . @@ -86,24 +92,23 @@ class ContentModel extends XMLDatastream { */ public static function ingestFromModel($pid, $name, $modelDsid, $copy_model_pid) { $ret = FALSE; - + if (($cm = self::loadFromModel($pid, $modelDsid)) === FALSE && ($copy_cm = self::loadFromModel($copy_model_pid)) !== FALSE && $copy_cm->validate()) { $newDom = $copy_cm->xml; $rootEl = $newDom->getElementsByTagName('content_model')->item(0); $rootEl->setAttribute('name', $name); - + $cm = new ContentModel($newDom, $pid, $modelDsid); - + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $ret = $cm; -} + } - return $ret; + return $ret; } - - + /** * Ingests a minimum Content Model to the specified pid/dsid. * Returns false on failure. @@ -123,9 +128,9 @@ class ContentModel extends XMLDatastream { * @param string $ingestFormHandler * * @return ContentModel $cm - */ + */ public static function ingestBlankModel($pid, $name, $modelDsid, $defaultMimetype, $ingestFormDsid, $ingestFormPage, $ingestFormHideChooser, $ingestFormModule, $ingestFormModule, $ingestFormFile, $ingestFormClass, $ingestFormMethod, $ingestFormHandler) { - $ret = FALSE; + $ret = FALSE; if (($cm = self::loadFromModel($pid, $modelDsid)) === FALSE) { $newDom = new DOMDocument('1.0', 'utf-8'); $newDom->formatOutput = TRUE; @@ -133,48 +138,47 @@ class ContentModel extends XMLDatastream { $rootEl->setAttribute('name', $name); $rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS .' '. self::$SCHEMA_URI); - + $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS . ' ' . self::$SCHEMA_URI); + $mimeEl = $newDom->createElement('mimetypes'); - $typeEl=$newDom->createElement('type', $defaultMimetype); - $mimeEl->appendChild($typeEl); + $typeEl = $newDom->createElement('type', $defaultMimetype); + $mimeEl->appendChild($typeEl); $rootEl->appendChild($mimeEl); - + $ingestRulesEl = $newDom->createElement('ingest_rules'); $rootEl->appendChild($ingestRulesEl); - + $ingestFormEl = $newDom->createElement('ingest_form'); $ingestFormEl->setAttribute('dsid', $ingestFormDsid); $ingestFormEl->setAttribute('page', $ingestFormPage); if ($ingestFormHideChooser == 'true') { $ingestFormEl->setAttribute('hide_file_chooser', 'true'); } - - $builderEl= $newDom->createElement('form_builder_method'); + + $builderEl = $newDom->createElement('form_builder_method'); $builderEl->setAttribute('module', $ingestFormModule); $builderEl->setAttribute('file', $ingestFormFile); $builderEl->setAttribute('class', $ingestFormClass); $builderEl->setAttribute('method', $ingestFormMethod); $builderEl->setAttribute('handler', $ingestFormHandler); - $ingestFormEl->appendChild($builderEl); - + $ingestFormEl->appendChild($builderEl); + $elementsEl = $newDom->createElement('form_elements'); $ingestFormEl->appendChild($elementsEl); $rootEl->appendChild($ingestFormEl); $newDom->appendChild($rootEl); - + $cm = new ContentModel($newDom, $pid, $modelDsid); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $fedoraItem = new Fedora_Item($pid); - $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); - $ret = $cm; + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $fedoraItem = new Fedora_Item($pid); + $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); + $ret = $cm; } - + return $ret; } - - + /** * Constructs a ContentModel object from the PID of the model in Fedora. * If DSID is specified it will use that datastream as the model, otherwise it will @@ -200,11 +204,10 @@ class ContentModel extends XMLDatastream { $dsid = ($dsid != NULL && self::validDsid($dsid)) ? $dsid : ContentModel::getDefaultDSID(); $ds = $fedoraItem->get_datastream_dissemination($dsid); if (!empty($ds)) { - $ret=new ContentModel($ds, $pid, $dsid, $pid_namespace, $name); + $ret = new ContentModel($ds, $pid, $dsid, $pid_namespace, $name); } } - } - catch (SOAPException $e) { + } catch (SOAPException $e) { $ret = FALSE; } return $ret; @@ -224,7 +227,7 @@ class ContentModel extends XMLDatastream { public function __construct($xmlStr, $pid = NULL, $dsid = NULL, $pid_namespace = NULL, $name = NULL) { parent::__construct($xmlStr, $pid, $dsid); $this->pid_namespace = $pid_namespace; - $this->name = ($name == NULL)?'Islandora Content Model':$name; + $this->name = ($name == NULL) ? 'Islandora Content Model' : $name; $this->xpath = new DOMXPath($this->xml); $this->xpath->registerNamespace('cm', 'http://www.islandora.ca'); } @@ -244,7 +247,7 @@ class ContentModel extends XMLDatastream { $rootEl->setAttribute('name', $sXml['name']); $rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS .' ' . self::$SCHEMA_URI); + $rootEl->setAttribute('xsi:schemaLocation', self::$XMLNS . ' ' . self::$SCHEMA_URI); $mimeEl = $newDom->createElement('mimetypes'); foreach ($sXml->mimetypes->type as $mime) { @@ -270,7 +273,7 @@ class ContentModel extends XMLDatastream { $methodEl->setAttribute('method', $method->method_name); $methodEl->setAttribute('dsid', $method->datastream_id); $methodEl->setAttribute('modified_files_ext', $method->modified_files_ext); - + if (isset($method->parameters)) { $paramsEl = $newDom->createElement('parameters'); foreach ($method->parameters->parameter as $param) { @@ -280,14 +283,13 @@ class ContentModel extends XMLDatastream { } $methodEl->appendChild($paramsEl); } - - + + $methodsEl->appendChild($methodEl); } $ruleEl->appendChild($methodsEl); $ingestRulesEl->appendChild($ruleEl); } - } $rootEl->appendChild($ingestRulesEl); @@ -306,7 +308,7 @@ class ContentModel extends XMLDatastream { $add_ds_methodEl->setAttribute('method', $ds->add_datastream_method->method_name); $add_ds_methodEl->setAttribute('dsid', $ds->add_datastream_method->datastream_id); $add_ds_methodEl->setAttribute('modified_files_ext', $ds->add_datastream_method->modified_files_ext); - + if (isset($ds->add_datastream_method->parameters)) { $paramsEl = $newDom->createElement('parameters'); foreach ($ds->add_datastream_method->parameters->parameter as $param) { @@ -316,7 +318,7 @@ class ContentModel extends XMLDatastream { } $add_ds_methodEl->appendChild($paramsEl); } - + $dsEl->appendChild($add_ds_methodEl); } @@ -354,12 +356,12 @@ class ContentModel extends XMLDatastream { //I found an XML where the label was HTML.. this code will attempt to //walk the object setting the label to be the first string it finds. if (count(get_object_vars($element->label)) > 0) { - $obj=$element->label; + $obj = $element->label; while ($obj != NULL && !is_string($obj)) { $keys = get_object_vars($obj); $obj = array_shift($keys); } - $element->label=($obj == NULL) ? '' : $obj; + $element->label = ($obj == NULL) ? '' : $obj; } $elEl = $newDom->createElement('element'); @@ -390,15 +392,15 @@ class ContentModel extends XMLDatastream { $ingest_formEl->appendChild($form_elementsEl); $rootEl->appendChild($ingest_formEl); - if (isset($sXml->edit_metadata) && - trim($sXml->edit_metadata->build_form_method->module) != '' && - trim($sXml->edit_metadata->build_form_method->file) != '' && - trim($sXml->edit_metadata->build_form_method->class_name) != '' && - trim($sXml->edit_metadata->build_form_method->method_name) != '' && - trim($sXml->edit_metadata->submit_form_method->method_name) != '' && - trim($sXml->edit_metadata->build_form_method['dsid']) != '' - ) { - $edit_metadata_methodEl= $newDom->createElement('edit_metadata_method'); + if (isset($sXml->edit_metadata) && + trim($sXml->edit_metadata->build_form_method->module) != '' && + trim($sXml->edit_metadata->build_form_method->file) != '' && + trim($sXml->edit_metadata->build_form_method->class_name) != '' && + trim($sXml->edit_metadata->build_form_method->method_name) != '' && + trim($sXml->edit_metadata->submit_form_method->method_name) != '' && + trim($sXml->edit_metadata->build_form_method['dsid']) != '' + ) { + $edit_metadata_methodEl = $newDom->createElement('edit_metadata_method'); $edit_metadata_methodEl->setAttribute('module', $sXml->edit_metadata->build_form_method->module); $edit_metadata_methodEl->setAttribute('file', $sXml->edit_metadata->build_form_method->file); $edit_metadata_methodEl->setAttribute('class', $sXml->edit_metadata->build_form_method->class_name); @@ -411,39 +413,38 @@ class ContentModel extends XMLDatastream { $newDom->appendChild($rootEl); $this->xml = DOMDocument::loadXML($newDom->saveXml()); - } /** - * Gets a list of service deployments that this model has. - * - * NOTE: Not currently being used. - * - * @return String[] $serviceDepPids - */ + * Gets a list of service deployments that this model has. + * + * NOTE: Not currently being used. + * + * @return String[] $serviceDepPids + */ public function getServices() { - $query = 'select $object $title from <#ri> + $query = 'select $object $title from <#ri> where ($object $title and $object $deploymentOf and $object - and $object pid .'> + and $object pid . '> and $object ) order by $title'; - - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - - $collectionHelper = new CollectionClass(); - $xml = simplexml_load_string($collectionHelper->getRelatedItems($this->pid, $query)); - - $results = array(); - foreach ($xml->results->result as $result) { - $pid = strval(($result->object['uri'])); - $pid = substr($pid, strpos($pid, "/") + 1, strlen($pid)); - $results[] = $pid; - } - - return $results; - } + + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + + $collectionHelper = new CollectionClass(); + $xml = simplexml_load_string($collectionHelper->getRelatedItems($this->pid, $query)); + + $results = array(); + foreach ($xml->results->result as $result) { + $pid = strval(($result->object['uri'])); + $pid = substr($pid, strpos($pid, "/") + 1, strlen($pid)); + $results[] = $pid; + } + + return $results; + } /** * Gets the name of the ContentModel @@ -455,7 +456,7 @@ class ContentModel extends XMLDatastream { $ret = FALSE; if ($this->name != NULL) { $ret = $this->name; - } + } elseif ($this->validate()) { $rootEl = $this->xml->getElementsByTagName('content_model')->item(0); $this->name = $rootEl->getAttribute('name'); @@ -464,7 +465,6 @@ class ContentModel extends XMLDatastream { return $ret; } - /** * Gets the element corresponding to the datastream specified * in the element of the schema. @@ -476,12 +476,12 @@ class ContentModel extends XMLDatastream { private function getDSModel($dsid) { $ret = FALSE; if (self::validDsid($dsid) && $this->validate()) { - $result=$this->xml->getElementsByTagName('datastreams'); - if ($result->length > 0) { - $result=$result->item(0)->getElementsByTagName('datastream'); + $result = $this->xml->getElementsByTagName('datastreams'); + if ($result->length > 0) { + $result = $result->item(0)->getElementsByTagName('datastream'); for ($i = 0; $ret == FALSE && $i < $result->length; $i++) { if ($result->item($i)->getAttribute('dsid') == $dsid) - $ret=$result->item($i); + $ret = $result->item($i); } } } @@ -501,59 +501,59 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $elements_array = array(); $form_elements_wrapper = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements'); - + if ($form_elements_wrapper->length == 0) { return $ret; } $elements = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0)->getElementsByTagName('element'); - for ($i=0;$i<$elements->length;$i++) { + for ($i = 0; $i < $elements->length; $i++) { $desc = $elements->item($i)->getElementsByTagName('description'); - $desc = ($desc->length > 0)?$desc->item(0)->nodeValue:''; - + $desc = ($desc->length > 0) ? $desc->item(0)->nodeValue : ''; + $label = $elements->item($i)->getAttribute('label'); if ($label == NULL) { - $label=$elements->item($i)->getAttribute('name'); + $label = $elements->item($i)->getAttribute('name'); } - - $element=array('name' => $elements->item($i)->getAttribute('name'), - 'label' => $label, - 'type' => $elements->item($i)->getAttribute('type'), - 'required' => ($elements->item($i)->getAttribute('required') == 'true') ? TRUE : FALSE, - 'description' => $desc + + $element = array('name' => $elements->item($i)->getAttribute('name'), + 'label' => $label, + 'type' => $elements->item($i)->getAttribute('type'), + 'required' => ($elements->item($i)->getAttribute('required') == 'true') ? TRUE : FALSE, + 'description' => $desc ); - + $auth_list = $elements->item($i)->getElementsByTagName('authoritative_list'); if ($auth_list->length > 0) { $list = array(); $items = $auth_list->item(0)->getElementsByTagName('item'); for ($j = 0; $j < $items->length; $j++) { $field = $items->item($j)->attributes->getNamedItem('field'); - $list[ $items->item($j)->nodeValue ] = ($field !== NULL) ? $field->nodeValue : $items->item($j)->nodeValue; + $list[$items->item($j)->nodeValue] = ($field !== NULL) ? $field->nodeValue : $items->item($j)->nodeValue; } - $element['authoritative_list']=$list; + $element['authoritative_list'] = $list; } - + $params = $elements->item($i)->getElementsByTagName('parameters'); $list = array(); if ($params->length > 0) { $items = $params->item(0)->getElementsByTagName('parameter'); for ($j = 0; $j < $items->length; $j++) { - $value = $items-> item($j)->nodeValue; + $value = $items->item($j)->nodeValue; $list[$items->item($j)->getAttribute('name')] = (strtolower($value) == 'true' ? TRUE : (strtolower($value) == 'false' ? FALSE : $value)); } } $element['parameters'] = $list; - + $elements_array[] = $element; - } + } $ret = $elements_array; } - return $ret; + return $ret; } - /** + /** * Decrements an ingest form element in the list of elements. * Updates the "order". This method is simply an overload to the incIngestFormElement * which has a direction parameter. @@ -563,12 +563,12 @@ class ContentModel extends XMLDatastream { * * @param String $name * @return boolean $success - */ + */ public function decIngestFormElement($name) { return $this->incIngestFormElement($name, 'dec'); } - - /** + + /** * Increments (or decrements) ingest form element in the list of elements. * Updates the "order". The $reorder parameter accepts 'inc' or 'dec' to * specify the direction to move (defaults to increment.) @@ -579,7 +579,7 @@ class ContentModel extends XMLDatastream { * @param String $name * @param String $reorder * @return boolean $success - */ + */ public function incIngestFormElement($name, $reorder = 'inc') { $ret = FALSE; if ($this->validate()) { @@ -590,26 +590,26 @@ class ContentModel extends XMLDatastream { for ($i = 0; $found === FALSE && $i < $elements->length; $i++) { if ($elements->item($i)->getAttribute('name') == trim($name)) { if ($reorder == 'inc') { - $found=$elements->item($i); - $refEl = ($i > 0)?$elements->item($i-1):false; - } + $found = $elements->item($i); + $refEl = ($i > 0) ? $elements->item($i - 1) : false; + } else { $found = ($i + 1 < $elements->length) ? $elements->item($i + 1) : FALSE; $refEl = $elements->item($i); } } } - + if ($found !== FALSE) { $elementsEl->removeChild($found); $elementsEl->insertBefore($found, $refEl); $ret = TRUE; } - } + } return $ret; - } - - /** + } + + /** * Removes an ingest form element from the list of ingest form elements. * @param String $name * @return boolean $success @@ -622,18 +622,18 @@ class ContentModel extends XMLDatastream { $found = FALSE; for ($i = 0; $found === FALSE && $i < $elements->length; $i++) { if ($elements->item($i)->getAttribute('name') == trim($name)) { - $found=$elements->item($i); + $found = $elements->item($i); } } - + if ($found !== FALSE) { $elementsEl->removeChild($found); $ret = TRUE; } - } + } return $ret; } - + /** * Sets a parameter of an ingest form element. If the value of the element is FALSE the parameter * will be removed entirely (if you want to store false as a value, then send the String "false"). @@ -646,7 +646,7 @@ class ContentModel extends XMLDatastream { public function setIngestFormElementParam($name, $paramName, $paramValue) { $ret = FALSE; - if ($this->validate()) { + if ($this->validate()) { $elements = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0)->getElementsByTagName('element'); $element = FALSE; for ($i = 0; $element === FALSE && $i < $elements->length; $i++) { @@ -661,24 +661,24 @@ class ContentModel extends XMLDatastream { if ($paramValue !== FALSE) { $paramsEl = $this->xml->createElement('parameters'); $element->appendChild($paramsEl); - } + } else { $ret = TRUE; } - } + } else { - $paramsEl=$paramsEl->item(0); + $paramsEl = $paramsEl->item(0); } - + if (!$ret) { $params = $paramsEl->getElementsByTagName('parameter'); $found = FALSE; for ($i = 0; $found === FALSE && $i < $params->length; $i++) { if ($params->item($i)->getAttribute('name') == $paramName) { - $found=$params->item($i); + $found = $params->item($i); } } - + if ($paramValue === FALSE) { if ($found !== FALSE) { $paramsEl->removeChild($found); @@ -687,27 +687,26 @@ class ContentModel extends XMLDatastream { } } $ret = TRUE; - } + } else { if ($found !== FALSE) { $found->nodeValue = $paramValue; - } + } else { - $paramEl=$this->xml->createElement('parameter', $paramValue); + $paramEl = $this->xml->createElement('parameter', $paramValue); $paramEl->setAttribute('name', $paramName); $paramsEl->appendChild($paramEl); } $ret = TRUE; } } - } + } } return $ret; } - - -/** + + /** * Gets a list of all parameters that belong to the specified ingest form element. * * @param String $elementName @@ -719,7 +718,7 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $elements = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0)->getElementsByTagName('element'); $element = FALSE; - for ($i=0; $element === FALSE && $i < $elements->length; $i++) { + for ($i = 0; $element === FALSE && $i < $elements->length; $i++) { if ($elements->item($i)->getAttribute('name') == $name) { $element = $elements->item($i); } @@ -727,20 +726,20 @@ class ContentModel extends XMLDatastream { if ($element !== FALSE) { $ret = array(); - $paramsEl = $element->getElementsByTagName('parameters'); - + $paramsEl = $element->getElementsByTagName('parameters'); + if ($paramsEl->length > 0) { - $params = $paramsEl->item(0)->getElementsByTagName('parameter'); - for ($i = 0; $i < $params->length; $i++) { - $ret[$params->item($i)->getAttribute('name')]=$params->item($i)->nodeValue; - } - } - } + $params = $paramsEl->item(0)->getElementsByTagName('parameter'); + for ($i = 0; $i < $params->length; $i++) { + $ret[$params->item($i)->getAttribute('name')] = $params->item($i)->nodeValue; + } + } + } } return $ret; - } - + } + /** * Edits the ingest form element specified. * NOTE: The element name can not be changed. To update an elements name @@ -763,45 +762,44 @@ class ContentModel extends XMLDatastream { $found = $elements->item($i); } } - + $found->setAttribute('name', $name); $found->setAttribute('type', $type); $found->setAttribute('required', $required ? 'true' : 'false'); if (trim($label) != '' && trim($label) != trim($name)) { $found->setAttribute('label', $label); - } + } elseif ($found->getAttribute('label') != '') { $found->removeAttribute('label'); } - - $descEl=$found->getElementsByTagName('description'); + + $descEl = $found->getElementsByTagName('description'); if (trim($description) != '') { - if ($descEl->length > 0) { - $descEl=$descEl->item(0); - $descEl->nodeValue = $description; - } + if ($descEl->length > 0) { + $descEl = $descEl->item(0); + $descEl->nodeValue = $description; + } else { - $descEl = $this->xml->createElement('description', $description); - $found->appendChild($descEl); - } - } + $descEl = $this->xml->createElement('description', $description); + $found->appendChild($descEl); + } + } elseif ($descEl->length > 0) { - $found->removeChild($descEl->item(0)); + $found->removeChild($descEl->item(0)); } - - if ($found->getAttribute('type') != 'select' && $found->getAttribute('type') != 'radio') { + + if ($found->getAttribute('type') != 'select' && $found->getAttribute('type') != 'radio') { $authList = $found->getElementsByTagName('authoritative_list'); if ($authList->length > 0) { $found->removeChild($authList->item(0)); } } - + $ret = TRUE; } return $ret; } - - + /** * Add an ingest form element to the model. * @@ -822,19 +820,19 @@ class ContentModel extends XMLDatastream { $elementEl->setAttribute('required', $requiredi ? 'true' : 'false'); if (trim($label) != '' && trim($label) != trim($name)) { $elementEl->setAttribute('label', $label); - } + } if (trim($description) != '') { - $descEl=$this->xml->createElement('description', $description); - $elementEl->appendChild($descEl); + $descEl = $this->xml->createElement('description', $description); + $elementEl->appendChild($descEl); } $elements->appendChild($elementEl); - + $ret = TRUE; } return $ret; } - - /** + + /** * Decrements an authority list item from a form element in the list of elements. * Updates the "order". This method is simply an overload to the incAuthListItem * which has a direction parameter. @@ -843,12 +841,12 @@ class ContentModel extends XMLDatastream { * @param String $elementName * @param String $value * @return boolean $success - */ + */ public function decAuthListItem($elementName, $value) { return $this->incAuthListItem($elementName, $value, 'dec'); - } + } - /** + /** * Increments (or decrements) an authority list item from a form element in the list of elements. * Updates the "order". * @@ -856,7 +854,7 @@ class ContentModel extends XMLDatastream { * @param String $value * @param String $direction * @return boolean $success - */ + */ public function incAuthListItem($elementName, $value, $reorder = 'inc') { $ret = FALSE; if ($this->validate()) { @@ -869,43 +867,43 @@ class ContentModel extends XMLDatastream { } if ($found !== FALSE) { - - $authListEl = $found->getElementsByTagName('authoritative_list'); - if ($authListEl->length > 0) { - $authListEl = $authListEl->item(0); - - $items = $authListEl->getElementsByTagName('item'); - $found = FALSE; - $refEl = FALSE; - for ($i = 0; $found === FALSE && $i < $items->length; $i++) { - if ($items->item($i)->nodeValue == $value) { - if ($reorder == 'inc') { - $refEl = ($i > 0) ? $items->item($i - 1) : FALSE; - $found = $items->item($i); - } - else { - $refEl = $items->item($i); - $found = ($i + 1 < $items->length) ? $items->item($i + 1) : FALSE; - } - } - } - - if ($found !== FALSE && $refEl !== FALSE) { - $authListEl->removeChild($found); - $authListEl->insertBefore($found, $refEl); - $ret = TRUE; - } - } + + $authListEl = $found->getElementsByTagName('authoritative_list'); + if ($authListEl->length > 0) { + $authListEl = $authListEl->item(0); + + $items = $authListEl->getElementsByTagName('item'); + $found = FALSE; + $refEl = FALSE; + for ($i = 0; $found === FALSE && $i < $items->length; $i++) { + if ($items->item($i)->nodeValue == $value) { + if ($reorder == 'inc') { + $refEl = ($i > 0) ? $items->item($i - 1) : FALSE; + $found = $items->item($i); + } + else { + $refEl = $items->item($i); + $found = ($i + 1 < $items->length) ? $items->item($i + 1) : FALSE; + } + } + } + + if ($found !== FALSE && $refEl !== FALSE) { + $authListEl->removeChild($found); + $authListEl->insertBefore($found, $refEl); + $ret = TRUE; + } + } } } return $ret; - } + } /** * Removes an authority list item from a form element. - @param String $elementName - @param String $value - @return boolean $success + * @param String $elementName + * @param String $value + * @return boolean $success */ public function removeAuthListItem($elementName, $value) { $ret = FALSE; @@ -913,46 +911,46 @@ class ContentModel extends XMLDatastream { $elements = $this->xml->getElementsbyTagName('ingest_form')->item(0)->getElementsByTagName('form_elements')->item(0)->getElementsByTagName('element'); $found = FALSE; for ($i = 0; $found === FALSE && $i < $elements->length; $i++) { - if ($elements->item($i)->getAttribute('name') == $elementName) { - $found = $elements->item($i); - } + if ($elements->item($i)->getAttribute('name') == $elementName) { + $found = $elements->item($i); + } } if ($found !== FALSE) { - $authListEl = $found->getElementsByTagName('authoritative_list'); - if ($authListEl->length > 0) { - $authListEl = $authListEl->item(0); - $items = $authListEl->getElementsByTagName('item'); - $found = FALSE; - for ($i = 0; $found === FALSE && $i < $items->length; $i++) { - if ($items->item($i)->nodeValue == $value) { - $found=$items->item($i); - } - } - - if ($found !== FALSE) { - if ($items->length == 1) { - $found->removeChild($authListEl); - } - else { - $authListEl->removeChild($found); - } - - $ret = TRUE; - } - } + $authListEl = $found->getElementsByTagName('authoritative_list'); + if ($authListEl->length > 0) { + $authListEl = $authListEl->item(0); + $items = $authListEl->getElementsByTagName('item'); + $found = FALSE; + for ($i = 0; $found === FALSE && $i < $items->length; $i++) { + if ($items->item($i)->nodeValue == $value) { + $found = $items->item($i); + } + } + + if ($found !== FALSE) { + if ($items->length == 1) { + $found->removeChild($authListEl); + } + else { + $authListEl->removeChild($found); + } + + $ret = TRUE; + } + } } } return $ret; - } + } /** * Adds an authority list item to a form element. - @param String $elementName - @param String $value - @param String $label (optional) - @return boolean $success - */ + * @param String $elementName + * @param String $value + * @param String $label (optional) + * @return boolean $success + */ public function addAuthListItem($elementName, $value, $label = '') { $ret = FALSE; if ($this->validate()) { @@ -965,37 +963,36 @@ class ContentModel extends XMLDatastream { } if ($found !== FALSE) { - $authListEl = $found->getElementsByTagName('authoritative_list'); - if ($authListEl->length == 0) { - $authListEl = $this->xml->createElement('authoritative_list'); - $found->appendChild($authListEl); - } - else { - $authListEl = $authListEl->item(0); - } - - $items = $authListEl->getElementsByTagName('item'); - $found = FALSE; - for ($i = 0; $found == FALSE && $i < $items->length; $i++) { - if ($items->item($i)->nodeValue == $value) { - $found = TRUE; - } - } - - if (!$found) { - $itemEl = $this->xml->createElement('item', trim($value)); - if (trim($label) != '' && trim($label) != trim($value)) { - $itemEl->setAttribute('field', trim($label)); - } - $authListEl->appendChild($itemEl); - $ret = TRUE; - } - } - + $authListEl = $found->getElementsByTagName('authoritative_list'); + if ($authListEl->length == 0) { + $authListEl = $this->xml->createElement('authoritative_list'); + $found->appendChild($authListEl); + } + else { + $authListEl = $authListEl->item(0); + } + + $items = $authListEl->getElementsByTagName('item'); + $found = FALSE; + for ($i = 0; $found == FALSE && $i < $items->length; $i++) { + if ($items->item($i)->nodeValue == $value) { + $found = TRUE; + } + } + + if (!$found) { + $itemEl = $this->xml->createElement('item', trim($value)); + if (trim($label) != '' && trim($label) != trim($value)) { + $itemEl->setAttribute('field', trim($label)); + } + $authListEl->appendChild($itemEl); + $ret = TRUE; + } + } } return $ret; } - + /** * Builds an ingest form using the method specified in element of * Returns FALSE on failure. @@ -1009,9 +1006,9 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $docRoot = $_SERVER['DOCUMENT_ROOT']; $file = (isset($form_state['values']['ingest-file-location']) ? $form_state['values']['ingest-file-location'] : ''); - + $fullpath = $file; - + $form['step'] = array( '#type' => 'hidden', '#value' => (isset($form_state['values']['step']) ? $form_state['values']['step'] : 0) + 1, @@ -1024,7 +1021,7 @@ class ContentModel extends XMLDatastream { '#type' => 'hidden', '#value' => 'ISLANDORACM', ); - $form['models'] = array( //content models available + $form['models'] = array(//content models available '#type' => 'hidden', '#value' => $form_state['values']['models'], ); @@ -1050,27 +1047,27 @@ class ContentModel extends XMLDatastream { } $dsid = $ingest_form->getAttribute('dsid'); - $method=$ingest_form->getElementsByTagName('form_builder_method')->item(0); + $method = $ingest_form->getElementsByTagName('form_builder_method')->item(0); $module = $method->getAttribute('module'); - $path=drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[]='Build Ingest Form: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Build Ingest Form: file \'' . $path . '\' does not exist.'; + } else { @require_once($path); - $className=$method->getAttribute('class'); - $methodName=($method->getAttribute('method')); + $className = $method->getAttribute('class'); + $methodName = ($method->getAttribute('method')); if (!class_exists($className)) { - self::$errors[] = 'Build Ingest Form: class \''. $className .' does not exist.'; - } + self::$errors[] = 'Build Ingest Form: class \'' . $className . ' does not exist.'; + } else { $class = new $className; - $elements_array=$this->getIngestFormElements(); + $elements_array = $this->getIngestFormElements(); if (method_exists($class, $methodName)) { - $ret = $class->$methodName ($form, $elements_array, $form_state); - } + $ret = $class->$methodName($form, $elements_array, $form_state); + } else { - self::$errors[] = 'Build Ingest Form: method \''. $className .'->'. $methodName .'\' does not exist.'; + self::$errors[] = 'Build Ingest Form: method \'' . $className . '->' . $methodName . '\' does not exist.'; } } } @@ -1080,7 +1077,7 @@ class ContentModel extends XMLDatastream { /** * Builds an edit metadata form using the method specified in the element -= * The DSID specified must match the DSID attribute of . Returns FALSE on failure. + * The DSID specified must match the DSID attribute of . Returns FALSE on failure. * * @param string $dsid * @return $form @@ -1092,22 +1089,22 @@ class ContentModel extends XMLDatastream { if ($method->length > 0 && $method->item(0)->getAttribute('dsid') == $dsid) { $method = $method->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Build Edit Metadata Form: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Build Edit Metadata Form: file \'' . $path . '\' does not exist.'; + } else { @require_once($path ); - $className=$method->getAttribute('class'); - $methodName=($method->getAttribute('method')); + $className = $method->getAttribute('class'); + $methodName = ($method->getAttribute('method')); if (!class_exists($className)) { - self::$errors[] = 'Build Edit Metadata Form: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Build Edit Metadata Form: class \'' . $className . '\' does not exist.'; + } else { $class = new $className($pid); if (!method_exists($class, $methodName)) { - self::$errors[] = 'Build Edit Metadata Form: method \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Build Edit Metadata Form: method \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { $ret = $class->$methodName(); } @@ -1133,24 +1130,24 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $method = $this->xml->getElementsByTagName('edit_metadata_method'); if ($method->length > 0) { - $method=$method->item(0); + $method = $method->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Handle Edit Metadata Form: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Handle Edit Metadata Form: file \'' . $path . '\' does not exist.'; + } else { @require_once($path); $className = $method->getAttribute('class'); $methodName = ($method->getAttribute('handler')); if (!class_exists($className)) { - self::$errors[] = 'Handle Edit Metadata Form: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Handle Edit Metadata Form: class \'' . $className . '\' does not exist.'; + } else { $class = new $className($form_state['values']['pid']); if (!method_exists($class, $methodName)) { - self::$errors[] = 'Handle Edit Metadata Form: metho \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Handle Edit Metadata Form: metho \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { $ret = $class->$methodName($form_id, $form_state['values'], $soap_client); } @@ -1164,13 +1161,11 @@ class ContentModel extends XMLDatastream { $ret = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $soap_client); $form_state['storage'] = NULL; $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; - } } return $ret; } - /** * Gets an associative array describing the edit metadata method. * Array has the following keys: 'file', 'class', 'method', 'handler', 'dsid' @@ -1179,21 +1174,21 @@ class ContentModel extends XMLDatastream { public function getEditMetadataMethod() { $ret = FALSE; if ($this->validate()) { - $method=$this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); + $method = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); if ($method->length > 0) { $method = $method->item(0); $ret = array('module' => $method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module'), - 'file' => $method->getAttribute('file'), - 'class' => $method->getAttribute('class'), - 'method' => $method->getAttribute('method'), - 'handler' => $method->getAttribute('handler'), - 'dsid' => $method->getAttribute('dsid') + 'file' => $method->getAttribute('file'), + 'class' => $method->getAttribute('class'), + 'method' => $method->getAttribute('method'), + 'handler' => $method->getAttribute('handler'), + 'dsid' => $method->getAttribute('dsid') ); } } return $ret; - } - + } + /** * Removes the edit data method from the Content Model. * @return boolean $success @@ -1201,7 +1196,7 @@ class ContentModel extends XMLDatastream { public function removeEditMetadataMethod() { $ret = FALSE; if ($this->validate()) { - $rootEl=$this->xml->getElementsByTagName('content_model')->item(0); + $rootEl = $this->xml->getElementsByTagName('content_model')->item(0); $method = $rootEl->getElementsByTagName('edit_metadata_method'); if ($method->length > 0) { $rootEl->removeChild($method->item(0)); @@ -1210,8 +1205,8 @@ class ContentModel extends XMLDatastream { } return $ret; } - - /** + + /** * Update the Edit Metadata Method defined in the Content Model * @param String $module * @param String $file @@ -1226,8 +1221,8 @@ class ContentModel extends XMLDatastream { if (self::validDsid($dsid) && $this->validate()) { $methodEl = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); if ($methodEl->length > 0) { - $methodEl=$methodEl->item(0); - } + $methodEl = $methodEl->item(0); + } else { $methodEl = $this->xml->createElement('edit_metadata_method'); $this->xml->getElementsByTagName('content_model')->item(0)->appendChild($methodEl); @@ -1242,7 +1237,7 @@ class ContentModel extends XMLDatastream { } return $ret; } - + /** * Executes the add datastream method for the specified datastream on the specified file. * Returns FALSE on failure. @@ -1256,32 +1251,32 @@ class ContentModel extends XMLDatastream { if (self::validDsid($dsid) && $this->validate() && ($ds = $this->getDSModel($dsid)) !== FALSE) { $addMethod = $ds->getElementsByTagName('add_datastream_method'); if ($addMethod->length > 0) { - $addMethod=$addMethod->item(0); + $addMethod = $addMethod->item(0); $paramArray = array(); - $params= $addMethod->getElementsByTagName('parameters'); + $params = $addMethod->getElementsByTagName('parameters'); if ($params->length > 0) { - $params=$params->item(0)->getElementsByTagName('parameter'); + $params = $params->item(0)->getElementsByTagName('parameter'); for ($i = 0; $i < $params->length; $i++) { $paramsArray[$params->item($i)->getAttribute('name')] = $params->item($i)->nodeValue; } } $module = $addMethod->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $addMethod->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $addMethod->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Execute Add Datastream Methods: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Execute Add Datastream Methods: file \'' . $path . '\' does not exist.'; + } else { @require_once($path); $className = $addMethod->getAttribute('class'); $methodName = $addMethod->getAttribute('method'); if (!class_exists($className)) { - self::$errors[] = 'Execute Add Datastream Methods: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Execute Add Datastream Methods: class \'' . $className . '\' does not exist.'; + } else { $class = new $className; if (!method_exists($class, $methodName)) { - self::$errors[] = 'Execute Add Datastream Methods: method \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Execute Add Datastream Methods: method \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { $ret = $class->$methodName($paramsArray, $addMethod->getAttribute('dsid'), $file, $addMethod->getAttribute('modified_files_ext')); } @@ -1310,11 +1305,11 @@ class ContentModel extends XMLDatastream { $ret = TRUE; $rules = $this->xml->getElementsByTagName('ingest_rules')->item(0)->getElementsByTagName('rule'); for ($i = 0; $i < $rules->length; $i++) { - $rule=$rules->item($i); + $rule = $rules->item($i); $types = $rule->getElementsbyTagName('applies_to'); $valid_types = array(); for ($j = 0; $j < $types->length; $j++) { - $valid_types[]=trim($types->item($j)->nodeValue); + $valid_types[] = trim($types->item($j)->nodeValue); } if (in_array($mimetype, $valid_types)) { @@ -1322,38 +1317,39 @@ class ContentModel extends XMLDatastream { if ($methods->length > 0) { $methods = $methods->item(0)->getElementsbyTagName('ingest_method'); for ($j = 0; $j < $methods->length; $j++) { - $method=$methods->item($j); - $param_array=array(); - $params=$method->getElementsByTagName('parameters'); + $method = $methods->item($j); + $param_array = array(); + $params = $method->getElementsByTagName('parameters'); $param_array['model_pid'] = $this->pid; - if ($params->length > 0) { + if ($params->length > 0) { $params = $params->item(0)->getElementsByTagName('parameter'); for ($k = 0; $k < $params->length; $k++) - $param_array[$params->item($k)->getAttribute('name')]=$params->item($k)->nodeValue; + $param_array[$params->item($k)->getAttribute('name')] = $params->item($k)->nodeValue; } - - + + if (!$preview || isset($param_array['preview'])) { $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path) || substr_compare($path, 'fedora_repository/', -strlen('fedora_repository/'), strlen('fedora_repository/')) === 0) { - self::$errors[] = 'Execute Ingest Rules: file \''. $path .'\' does not exist.'; + self::$errors[] = 'Execute Ingest Rules: file \'' . $path . '\' does not exist.'; $ret = FALSE; - } + } else { require_once($path); - $className=$method->getAttribute('class'); - $methodName=($method->getAttribute('method')); + $className = $method->getAttribute('class'); + $methodName = ($method->getAttribute('method')); if (!class_exists($className)) { - self::$errors[] = 'Execute Ingest Rules: class \''. $className .'\' does not exist.'; + self::$errors[] = 'Execute Ingest Rules: class \'' . $className . '\' does not exist.'; $ret = FALSE; - } - else $class = new $className; + } + else + $class = new $className; if (!method_exists($class, $methodName)) { - self::$errors[] = 'Execute Ingest Rules: method \''. $className .'->' . $methodName .'\' does not exist.'; + self::$errors[] = 'Execute Ingest Rules: method \'' . $className . '->' . $methodName . '\' does not exist.'; $ret = FALSE; - } + } else { $status = $class->$methodName($param_array, $method->getAttribute('dsid'), $file, $method->getAttribute('modified_files_ext')); if ($status !== TRUE) { @@ -1366,7 +1362,6 @@ class ContentModel extends XMLDatastream { } } } - } return $ret; } @@ -1378,29 +1373,29 @@ class ContentModel extends XMLDatastream { * @param &$form_state * @return boolean $success */ - public function execFormHandler(&$data,&$form_state) { + public function execFormHandler(&$data, &$form_state) { $ret = FALSE; if ($this->validate()) { - $method =$this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); + $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); $module = $method->getAttribute('module'); - $path=drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Execute Form Handler: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; + } else { require_once($path); - $className=$method->getAttribute('class'); - $methodName=($method->getAttribute('handler')); + $className = $method->getAttribute('class'); + $methodName = ($method->getAttribute('handler')); if (!class_exists($className)) { - self::$errors[] = 'Execute Form Handler: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: class \'' . $className . '\' does not exist.'; + } else { $class = new $className; if (!method_exists($class, $methodName)) { - self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: method \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { - $class->$methodName($data,$form_state); + $class->$methodName($data, $form_state); $ret = TRUE; } } @@ -1420,13 +1415,13 @@ class ContentModel extends XMLDatastream { //only proceed if the xml is valid. if ($this->validate()) { if ($this->mimes === NULL) { - $result=$this->xml->getElementsByTagName('mimetypes'); - $result=$result->item(0)->getElementsByTagName('type'); + $result = $this->xml->getElementsByTagName('mimetypes'); + $result = $result->item(0)->getElementsByTagName('type'); $mimes = array(); for ($i = 0; $i < $result->length; $i++) { $mimes[] = trim($result->item($i)->nodeValue); } - $this->mimes=$mimes; + $this->mimes = $mimes; } return $this->mimes; } @@ -1446,29 +1441,29 @@ class ContentModel extends XMLDatastream { $datastreams = $this->xml->getElementsByTagName('datastreams'); if ($datastreams->length > 0) { $datastreams = $datastreams->item(0)->getElementsByTagName('datastream'); - for ($i=0; $i < $datastreams->length; $i++) { + for ($i = 0; $i < $datastreams->length; $i++) { $ds = $datastreams->item($i); - if ($ds->attributes->getNamedItem('display_in_fieldset') == NULL || strtolower($ds->getAttribute('display_in_fieldset')) != 'false' ) { + if ($ds->attributes->getNamedItem('display_in_fieldset') == NULL || strtolower($ds->getAttribute('display_in_fieldset')) != 'false') { $dispMethods = $ds->getElementsByTagName('display_method'); for ($j = 0; $j < $dispMethods->length; $j++) { $method = $dispMethods->item($j); $module = $method->getAttribute('module'); - $path=drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file') ; + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { - self::$errors[] = 'Execute Form Handler: file \''. $path .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; + } else { require_once($path); $className = $method->getAttribute('class'); $methodName = ($method->getAttribute('method')); if (!class_exists($className)) { - self::$errors[] = 'Execute Form Handler: class \''. $className .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: class \'' . $className . '\' does not exist.'; + } else { $class = new $className($pid); if (!method_exists($class, $methodName)) { - self::$errors[] = 'Execute Form Handler: method \''. $className .'->'. $methodName .'\' does not exist.'; - } + self::$errors[] = 'Execute Form Handler: method \'' . $className . '->' . $methodName . '\' does not exist.'; + } else { $output = $class->$methodName($page_number); } @@ -1491,17 +1486,17 @@ class ContentModel extends XMLDatastream { * @return string[] $datastreams */ public function listDatastreams() { - $ds_array=array(); + $ds_array = array(); if ($this->validate()) { $datastreams = $this->xml->getElementsByTagName('datastreams'); if ($datastreams->length > 0) { - $datastreams=$datastreams->item(0)->getElementsByTagName('datastream'); - for ($i=0;$i<$datastreams->length;$i++) { - $dsName=$datastreams->item($i)->getAttribute('dsid'); - // if ($dsName != 'QDC') - // { - $ds_array[]=$dsName; - // } + $datastreams = $datastreams->item(0)->getElementsByTagName('datastream'); + for ($i = 0; $i < $datastreams->length; $i++) { + $dsName = $datastreams->item($i)->getAttribute('dsid'); + // if ($dsName != 'QDC') + // { + $ds_array[] = $dsName; + // } } } } @@ -1509,30 +1504,29 @@ class ContentModel extends XMLDatastream { return $ds_array; } - /** + /** * Adds an allowed mimetype to the model. * * @param String $type * @return boolean $success */ public function addMimetype($type) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { $mimetypesEl = $this->xml->getElementsByTagName('mimetypes')->item(0); - $types= $mimetypesEl->getElementsByTagName('type'); + $types = $mimetypesEl->getElementsByTagName('type'); $found = FALSE; - for ($i=0;!$found && $i<$types->length;$i++) { + for ($i = 0; !$found && $i < $types->length; $i++) { if ($types->item($i)->nodeValue == $type) - $found = TRUE; + $found = TRUE; } if (!$found) { $newTypeEl = $this->xml->createElement('type', $type); $mimetypesEl->appendChild($newTypeEl); - $ret=TRUE; + $ret = TRUE; } - } return $ret; } @@ -1544,54 +1538,64 @@ class ContentModel extends XMLDatastream { * @return boolean $success */ public function removeMimetype($type) { - $ret=FALSE; + $ret = FALSE; if ($this->validate()) { $mimetypesEl = $this->xml->getElementsByTagName('mimetypes')->item(0); - $types= $mimetypesEl->getElementsByTagName('type'); - $found=FALSE; - for ($i=0;!$found && $i<$types->length;$i++) { + $types = $mimetypesEl->getElementsByTagName('type'); + $found = FALSE; + for ($i = 0; !$found && $i < $types->length; $i++) { if ($types->item($i)->nodeValue == $type) - $found=$types->item($i); + $found = $types->item($i); } if ($found !== FALSE && $types->length > 1) { $mimetypesEl->removeChild($found); $ret = TRUE; } - } return $ret; } + /** + * getDisplayMethods ?? + * @param type $ds + * @return type + */ public function getDisplayMethods($ds) { - $ret=FALSE; - if (($ds = $this->getDSModel($ds))!==FALSE) { - $ret=array(); - $dispMethods= $ds->getElementsByTagName('display_method'); - for ($i=0;$i<$dispMethods->length;$i++) { - $ret[] = array( 'module' => $dispMethods->item($i)->getAttribute('module')==''?'fedora_repository':$dispMethods->item($i)->getAttribute('module'), - 'file' => $dispMethods->item($i)->getAttribute('file'), - 'class' => $dispMethods->item($i)->getAttribute('class'), - 'method' => $dispMethods->item($i)->getAttribute('method'), - 'default' => ($dispMethods->item($i)->attributes->getNamedItem('default') !== NULL ? strtolower($dispMethods->item($i)->getAttribute('default')) == 'true' : FALSE)); + $ret = FALSE; + if (($ds = $this->getDSModel($ds)) !== FALSE) { + $ret = array(); + $dispMethods = $ds->getElementsByTagName('display_method'); + for ($i = 0; $i < $dispMethods->length; $i++) { + $ret[] = array('module' => $dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module'), + 'file' => $dispMethods->item($i)->getAttribute('file'), + 'class' => $dispMethods->item($i)->getAttribute('class'), + 'method' => $dispMethods->item($i)->getAttribute('method'), + 'default' => ($dispMethods->item($i)->attributes->getNamedItem('default') !== NULL ? strtolower($dispMethods->item($i)->getAttribute('default')) == 'true' : FALSE)); } } return $ret; } + /** + * addDs ?? + * @param type $dsid + * @param type $display_in_fieldset + * @return boolean + */ public function addDs($dsid, $display_in_fieldset = FALSE) { - $ret=FALSE; - + $ret = FALSE; + if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) === FALSE) { $datastreamsEl = $this->xml->getElementsByTagName('datastreams'); if ($datastreamsEl->length > 0) { - $datastreamsEl=$datastreamsEl->item(0); - } + $datastreamsEl = $datastreamsEl->item(0); + } else { $datastreamsEl = $this->xml->createElement('datastreams'); $this->xml->getElementsByTagName('content_model')->item(0)->appendChild($datastreamsEl); } - + $dsEl = $this->xml->createElement('datastream'); $dsEl->setAttribute('dsid', $dsid); if ($display_in_fieldset == TRUE) { @@ -1603,6 +1607,11 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * removeDs ?? + * @param type $dsid + * @return boolean + */ public function removeDs($dsid) { $ret = FALSE; @@ -1614,6 +1623,11 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * displayInFieldset ?? + * @param type $dsid + * @return type + */ public function displayInFieldset($dsid) { $ret = FALSE; if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { @@ -1622,13 +1636,19 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * setDisplayInFieldset ?? + * @param type $dsid + * @param type $value + * @return boolean + */ public function setDisplayInFieldset($dsid, $value = TRUE) { $ret = FALSE; if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { if ($value == FALSE && $ds->attributes->getNamedItem('display_in_fieldset') !== NULL) { $ds->removeAttribute('display_in_fieldset'); $ret = TRUE; - } + } elseif ($value == TRUE) { $ds->setAttribute('display_in_fieldset', 'true'); $ret = TRUE; @@ -1637,18 +1657,27 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * setDefaultDispMeth ?? + * @param type $dsid + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @return boolean + */ public function setDefaultDispMeth($dsid, $module, $file, $class, $method) { $ret = FALSE; - + if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $found = FALSE; $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module')) && - $file == $dispMethods->item($i)->getAttribute('file') && - $class == $dispMethods->item($i)->getAttribute('class') && - $method == $dispMethods->item($i)->getAttribute('method')) { - $found=$dispMethods->item($i); + $file == $dispMethods->item($i)->getAttribute('file') && + $class == $dispMethods->item($i)->getAttribute('class') && + $method == $dispMethods->item($i)->getAttribute('method')) { + $found = $dispMethods->item($i); } } @@ -1663,22 +1692,30 @@ class ContentModel extends XMLDatastream { $found->setAttribute('default', 'true'); $ret = TRUE; } - } return $ret; } + /** + * removeDispMeth ?? + * @param type $dsid + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @return boolean + */ public function removeDispMeth($dsid, $module, $file, $class, $method) { $ret = FALSE; if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $found = FALSE; - $dispMethods= $ds->getElementsByTagName('display_method'); - for ($i=0;!$found && $i<$dispMethods->length;$i++) { + $dispMethods = $ds->getElementsByTagName('display_method'); + for ($i = 0; !$found && $i < $dispMethods->length; $i++) { if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module') == '') && - $file == $dispMethods->item($i)->getAttribute('file') && - $class == $dispMethods->item($i)->getAttribute('class') && - $method == $dispMethods->item($i)->getAttribute('method')) { - $found=$dispMethods->item($i); + $file == $dispMethods->item($i)->getAttribute('file') && + $class == $dispMethods->item($i)->getAttribute('class') && + $method == $dispMethods->item($i)->getAttribute('method')) { + $found = $dispMethods->item($i); } } @@ -1686,20 +1723,29 @@ class ContentModel extends XMLDatastream { $ds->removeChild($found); $ret = TRUE; } - } return $ret; } + /** + * addDispMeth ?? + * @param type $dsid + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @param type $default + * @return boolean + */ public function addDispMeth($dsid, $module, $file, $class, $method, $default = FALSE) { - $ret=FALSE; - if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid))!==FALSE) { + $ret = FALSE; + if (self::validDsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { $dispMethEl = $this->xml->createElement('display_method'); $dispMethEl->setAttribute('module', $module); $dispMethEl->setAttribute('file', $file); $dispMethEl->setAttribute('class', $class); $dispMethEl->setAttribute('method', $method); - if ($default==TRUE) { + if ($default == TRUE) { $dispMethEl->setAttribute('default', TRUE); } $ds->appendChild($dispMethEl); @@ -1708,39 +1754,55 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * getAddDsMethod ?? + * @param type $ds + * @return type + */ public function getAddDsMethod($ds) { - $ret=FALSE; - if (($ds = $this->getDSModel($ds))!==FALSE) { - $addDsMethod= $ds->getElementsByTagName('add_datastream_method'); + $ret = FALSE; + if (($ds = $this->getDSModel($ds)) !== FALSE) { + $addDsMethod = $ds->getElementsByTagName('add_datastream_method'); if ($addDsMethod !== FALSE && $addDsMethod->length > 0) { $ret = array('module' => $addDsMethod->item(0)->getAttribute('module') == '' ? 'fedora_repository' : $addDsMethod->item(0)->getAttribute('module'), - 'file' => $addDsMethod->item(0)->getAttribute('file'), - 'class' => $addDsMethod->item(0)->getAttribute('class'), - 'method' => $addDsMethod->item(0)->getAttribute('method'), - 'modified_files_ext' => $addDsMethod->item(0)->getAttribute('modified_files_ext'), - 'dsid' => $addDsMethod->item(0)->getAttribute('dsid') + 'file' => $addDsMethod->item(0)->getAttribute('file'), + 'class' => $addDsMethod->item(0)->getAttribute('class'), + 'method' => $addDsMethod->item(0)->getAttribute('method'), + 'modified_files_ext' => $addDsMethod->item(0)->getAttribute('modified_files_ext'), + 'dsid' => $addDsMethod->item(0)->getAttribute('dsid') ); } } return $ret; } + /** + * getIngestRule ?? + * @param type $rule_id + * @return type + */ public function getIngestRule($rule_id) { $ret = FALSE; if ($this->validate()) { $rules = $this->xml->getElementsByTagName('ingest_rules')->item(0)->getElementsByTagName('rule'); if ($rule_id < $rules->length) - $ret = $rules->item($rule_id); + $ret = $rules->item($rule_id); } return $ret; } + /** + * removeAppliesTo ?? + * @param type $rule_id + * @param type $type + * @return boolean + */ public function removeAppliesTo($rule_id, $type) { $ret = FALSE; if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $applies = $rule->getElementsByTagName('applies_to'); $found = FALSE; - for ($i=0; $found === FALSE && $i < $applies->length; $i++) { + for ($i = 0; $found === FALSE && $i < $applies->length; $i++) { if ($type == $applies->item($i)->nodeValue) { $found = $applies->item($i); } @@ -1754,12 +1816,18 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * addAppliesTo ?? + * @param type $rule_id + * @param type $type + * @return boolean + */ public function addAppliesTo($rule_id, $type) { - $ret=FALSE; - if (($rule = $this->getIngestRule($rule_id))!==FALSE) { + $ret = FALSE; + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $applies = $rule->getElementsByTagName('applies_to'); $found = FALSE; - for ($i=0;!$found && $i<$applies->length;$i++) { + for ($i = 0; !$found && $i < $applies->length; $i++) { $found = ($type == $applies->item($i)->nodeValue); } @@ -1772,9 +1840,20 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * addIngestMethods ?? + * @param type $rule_id + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @param type $dsid + * @param type $modified_files_ext + * @return boolean + */ public function addIngestMethod($rule_id, $module, $file, $class, $method, $dsid, $modified_files_ext) { - $ret=FALSE; - if (self::validDsid($dsid) && ($rule=$this->getIngestRule($rule_id))!==FALSE) { + $ret = FALSE; + if (self::validDsid($dsid) && ($rule = $this->getIngestRule($rule_id)) !== FALSE) { $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $meth = $this->xml->createElement('ingest_method'); $meth->setAttribute('module', $module); @@ -1790,13 +1869,22 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * removeIngestMethod ?? + * @param type $rule_id + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @return boolean + */ public function removeIngestMethod($rule_id, $module, $file, $class, $method) { - $ret=FALSE; - if (($rule=$this->getIngestRule($rule_id))!==FALSE) { - $found=FALSE; + $ret = FALSE; + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { + $found = FALSE; $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $methods = $methodsEl->getElementsByTagName('ingest_method'); - for ($i=0;!$found && $i<$methods->length;$i++) { + for ($i = 0; !$found && $i < $methods->length; $i++) { if ($methods->item($i)->getAttribute('module') == $module && $methods->item($i)->getAttribute('file') == $file && $methods->item($i)->getAttribute('class') == $class && $methods->item($i)->getAttribute('method') == $method) { $found = $methods->item($i); } @@ -1809,33 +1897,44 @@ class ContentModel extends XMLDatastream { } return $ret; } - + + /** + * addIngestMethodParam ?? + * @param type $rule_id + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @param type $name + * @param type $value + * @return boolean + */ public function addIngestMethodParam($rule_id, $module, $file, $class, $method, $name, $value) { $ret = FALSE; - if (($rule=$this->getIngestRule($rule_id)) !== FALSE) { + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $methods = $rule->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); $found = FALSE; for ($i = 0; $found === FALSE && $i < $methods->length; $i++) { if (($methods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($i)->getAttribute('module')) == $module && - $methods->item($i)->getAttribute('file') == $file && - $methods->item($i)->getAttribute('class') == $class && - $methods->item($i)->getAttribute('method') == $method) { - $found=$methods->item($i); + $methods->item($i)->getAttribute('file') == $file && + $methods->item($i)->getAttribute('class') == $class && + $methods->item($i)->getAttribute('method') == $method) { + $found = $methods->item($i); } } if ($found !== FALSE) { $paramsEl = $found->getElementsByTagName('parameters'); if ($paramsEl->length == 0) { - $paramsEl=$found->appendChild($this->xml->createElement('parameters')); - } + $paramsEl = $found->appendChild($this->xml->createElement('parameters')); + } else { - $paramsEl=$paramsEl->item(0); + $paramsEl = $paramsEl->item(0); } $params = $paramsEl->getElementsByTagName('parameter'); $found = FALSE; - for ($i=0; $found === FALSE && $i < $params->length; $i++) { + for ($i = 0; $found === FALSE && $i < $params->length; $i++) { if ($params->item($i)->getAttribute('name') == $name) { $found = $params->item($i); } @@ -1852,14 +1951,24 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * removeIngestMethodParam ?? + * @param type $rule_id + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @param type $name + * @return boolean + */ public function removeIngestMethodParam($rule_id, $module, $file, $class, $method, $name) { $ret = FALSE; - if (($rule=$this->getIngestRule($rule_id)) !== FALSE) { + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $found = FALSE; $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $methods = $methodsEl->getElementsByTagName('ingest_method'); - for ($i=0; !$found && $i < $methods->length; $i++) { - if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'fedora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { + for ($i = 0; !$found && $i < $methods->length; $i++) { + if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'fedora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { $found = $methods->item($i); } } @@ -1867,38 +1976,53 @@ class ContentModel extends XMLDatastream { $methodEl = $found; $paramsEl = $found->getElementsByTagName('parameters'); if ($paramsEl->length > 0) { - $paramsEl=$paramsEl->item(0); + $paramsEl = $paramsEl->item(0); $params = $paramsEl->getElementsByTagName('parameter'); $found = FALSE; - for ($i=0; $found === FALSE && $i < $params->length; $i++) { + for ($i = 0; $found === FALSE && $i < $params->length; $i++) { if ($params->item($i)->getAttribute('name') == $name) { - $found=$params->item($i); + $found = $params->item($i); } } - + if ($found !== FALSE) { $paramsEl->removeChild($found); if ($params->length == 0) { $methodEl->removeChild($paramsEl); } - + $ret = TRUE; } } - } } return $ret; } + /** + * removeIngestRule ?? + * @param type $rule_id + * @return type + */ public function removeIngestRule($rule_id) { $ret = FALSE; - if (($rule = $this->getIngestRule($rule_id))!==FALSE) { + if (($rule = $this->getIngestRule($rule_id)) !== FALSE) { $ret = $this->xml->getElementsByTagName('ingest_rules')->item(0)->removeChild($rule); } return $ret; } + /** + * addIngestRule ?? + * @param type $applies_to + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @param type $dsid + * @param type $modified_files_ext + * @return type + */ public function addIngestRule($applies_to, $module, $file, $class, $method, $dsid, $modified_files_ext) { $ret = FALSE; if (self::validDsid($dsid) && $this->validate()) { @@ -1913,39 +2037,42 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * getIngestRules ?? + * @return type + */ public function getIngestRules() { $ret = FALSE; if ($this->validate()) { $ret = array(); $rules = $this->xml->getElementsByTagName('ingest_rules')->item(0)->getElementsByTagName('rule'); - for ($i=0; $i < $rules->length; $i++) { + for ($i = 0; $i < $rules->length; $i++) { $rule = array('applies_to' => array(), 'ingest_methods' => array()); $applies_to = $rules->item($i)->getElementsByTagName('applies_to'); - for ($j=0; $j < $applies_to->length; $j++) { + for ($j = 0; $j < $applies_to->length; $j++) { $rule['applies_to'][] = trim($applies_to->item($j)->nodeValue); } $methods = $rules->item($i)->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); - for ($j=0; $j < $methods->length; $j++) { + for ($j = 0; $j < $methods->length; $j++) { $method = array('module' => $methods->item($j)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($j)->getAttribute('module'), - 'file' => $methods->item($j)->getAttribute('file'), - 'class' => $methods->item($j)->getAttribute('class'), - 'method' => $methods->item($j)->getAttribute('method'), - 'dsid' => $methods->item($j)->getAttribute('dsid'), - 'modified_files_ext' => $methods->item($j)->getAttribute('modified_files_ext'), - 'parameters' => array()); - + 'file' => $methods->item($j)->getAttribute('file'), + 'class' => $methods->item($j)->getAttribute('class'), + 'method' => $methods->item($j)->getAttribute('method'), + 'dsid' => $methods->item($j)->getAttribute('dsid'), + 'modified_files_ext' => $methods->item($j)->getAttribute('modified_files_ext'), + 'parameters' => array()); + $params = $methods->item($j)->getElementsByTagName('parameters'); if ($params->length > 0) { - $params=$params->item(0)->getElementsByTagName('parameter'); - for ($k=0; $k < $params->length; $k++) { + $params = $params->item(0)->getElementsByTagName('parameter'); + for ($k = 0; $k < $params->length; $k++) { $method['parameters'][$params->item($k)->getAttribute('name')] = $params->item($k)->nodeValue; } } - + $rule['ingest_methods'][] = $method; - } $ret[] = $rule; @@ -1954,55 +2081,79 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * getIngestFormAttributes ?? + * @return type + */ public function getIngestFormAttributes() { $ret = FALSE; if ($this->validate()) { $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); - $ret=array('dsid' => $ingest_formEl->getAttribute('dsid'), - 'page' => $ingest_formEl->getAttribute('page'), - 'hide_file_chooser' => strtolower($ingest_formEl->getAttribute('hide_file_chooser')) == 'true', - 'redirect' => strtolower($ingest_formEl->getAttribute('redirect')) == 'false' ? FALSE : TRUE); - + $ret = array('dsid' => $ingest_formEl->getAttribute('dsid'), + 'page' => $ingest_formEl->getAttribute('page'), + 'hide_file_chooser' => strtolower($ingest_formEl->getAttribute('hide_file_chooser')) == 'true', + 'redirect' => strtolower($ingest_formEl->getAttribute('redirect')) == 'false' ? FALSE : TRUE); } return $ret; } - + + /** + * editIngestFormAttributes ?? + * @param type $dsid + * @param type $page + * @param type $hide_file_chooser + * @param type $redirect + * @return boolean + */ public function editIngestFormAttributes($dsid, $page, $hide_file_chooser = FALSE, $redirect = TRUE) { $ret = FALSE; if (self::validDsid($dsid) && $this->validate()) { - $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); - $ingest_formEl->setAttribute('dsid', $dsid); - $ingest_formEl->setAttribute('page', $page); - if (!$redirect) { - $ingest_formEl->setAttribute('redirect', 'false'); - } - else { - $ingest_formEl->removeAttribute('redirect'); - } - if ($hide_file_chooser) { + $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); + $ingest_formEl->setAttribute('dsid', $dsid); + $ingest_formEl->setAttribute('page', $page); + if (!$redirect) { + $ingest_formEl->setAttribute('redirect', 'false'); + } + else { + $ingest_formEl->removeAttribute('redirect'); + } + if ($hide_file_chooser) { $ingest_formEl->setAttribute('hide_file_chooser', 'true'); - } - else { + } + else { $ingest_formEl->removeAttribute('hide_file_chooser'); - } - $ret = TRUE; + } + $ret = TRUE; } return $ret; } + /** + * getIngestFormBuilderMethod + * @return type + */ public function getIngestFormBuilderMethod() { $ret = FALSE; if ($this->validate()) { $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); - $ret = array( 'module' => ($method->getAttribute('module')==''?'fedora_repository':$method->getAttribute('module')), - 'file' => $method->getAttribute('file'), - 'class' => $method->getAttribute('class'), - 'method' => $method->getAttribute('method'), - 'handler' => $method->getAttribute('handler')); + $ret = array('module' => ($method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module')), + 'file' => $method->getAttribute('file'), + 'class' => $method->getAttribute('class'), + 'method' => $method->getAttribute('method'), + 'handler' => $method->getAttribute('handler')); } return $ret; } - + + /** + * editIngestFormBuilderMethod ?? + * @param type $module + * @param type $file + * @param type $class + * @param type $method + * @param type $handler + * @return boolean + */ public function editIngestFormBuilderMethod($module, $file, $class, $method, $handler) { $ret = FALSE; if ($this->validate()) { @@ -2014,7 +2165,7 @@ class ContentModel extends XMLDatastream { $methodEl->setAttribute('handler', $handler); $ret = TRUE; } - return $ret; + return $ret; } /** @@ -2041,7 +2192,7 @@ class ContentModel extends XMLDatastream { } $names = FALSE; $result = $this->xpath->query('//cm:forms/cm:form/@name'); // Select the name attribute of all forms. - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $attribute = $result->item($i); $name = $attribute->value; $names[$name] = $name; @@ -2059,7 +2210,7 @@ class ContentModel extends XMLDatastream { return FALSE; } $result = $this->xpath->query('//cm:forms/cm:form[@ingest_class and @ingest_file and @ingest_module]/@name'); // Select the name attribute of all forms. - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $attribute = $result->item($i); $name = $attribute->value; $names[$name] = $name; @@ -2077,7 +2228,7 @@ class ContentModel extends XMLDatastream { return FALSE; } $result = $this->xpath->query('//cm:forms/cm:form[@edit_class and @edit_file and @edit_module]/@name'); // Select the name attribute of all forms. - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $attribute = $result->item($i); $name = $attribute->value; $names[$name] = $name; @@ -2131,7 +2282,6 @@ class ContentModel extends XMLDatastream { return FALSE; } - /** * Edits a form element with attribute name='$name' from the 'forms' element. * @@ -2142,11 +2292,11 @@ class ContentModel extends XMLDatastream { return FALSE; } $result = $this->xpath->query("//cm:form[@name='$name']"); - if($result->length == 1) { + if ($result->length == 1) { $form = $result->item(0); $result = $this->xpath->query("child::node()", $form); $element = $this->xml->importNode($element); - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $child = $result->item($i); $element->appendChild($child); } @@ -2177,10 +2327,10 @@ class ContentModel extends XMLDatastream { $new_element = $this->xml->importNode($new_element, TRUE); $name = $new_element->tagName; $result = $new_element->getElementsByTagName('content'); - if($result->length == 1) { + if ($result->length == 1) { $new_content = $result->item(0); $result = $this->xpath->query("child::cm:content/child::node()", $edit_element); - for($i = 0; $i < $result->length; $i++) { + for ($i = 0; $i < $result->length; $i++) { $child = $result->item($i); $new_content->appendChild($child); } diff --git a/MimeClass.inc b/MimeClass.inc index f1c5cb16..82ba3b7f 100644 --- a/MimeClass.inc +++ b/MimeClass.inc @@ -1,4 +1,5 @@ extension lookups in the context of Islandora collections. - * - * It has been cut from a much longer list. - * - * Two types of mimetypes should be put in this list: - * 1) Special emerging formats which may not yet be expressed in the system - * mime.types file. - * 2) Heavily used mimetypes of particular importance to the Islandora - * project, as lookups against this list will be quicker and less - * resource intensive than other methods. - * - * Lookups are first checked against this short list. If no results are found, - * then the lookup function may move on to check other sources, namely the - * system's mime.types file. - * - * In most cases though, this short list should suffice. - * - * If modifying this list, please note that for promiscuous mimetypes - * (those which map to multiple extensions, such as text/plain) - * The function get_extension will always return the *LAST* extension in this list, - * so you should put your preferred extension *LAST*. - * - * e.g... - * "jpeg" => "image/jpeg", - * "jpe" => "image/jpeg", - * "jpg" => "image/jpeg", - * - * $this->get_extension('image/jpeg') will always return 'jpg'. - * - */ + /** + * This is a shortlist of mimetypes which should catch most + * mimetype<-->extension lookups in the context of Islandora collections. + * + * It has been cut from a much longer list. + * + * Two types of mimetypes should be put in this list: + * 1) Special emerging formats which may not yet be expressed in the system + * mime.types file. + * 2) Heavily used mimetypes of particular importance to the Islandora + * project, as lookups against this list will be quicker and less + * resource intensive than other methods. + * + * Lookups are first checked against this short list. If no results are found, + * then the lookup function may move on to check other sources, namely the + * system's mime.types file. + * + * In most cases though, this short list should suffice. + * + * If modifying this list, please note that for promiscuous mimetypes + * (those which map to multiple extensions, such as text/plain) + * The function get_extension will always return the *LAST* extension in this list, + * so you should put your preferred extension *LAST*. + * + * e.g... + * "jpeg" => "image/jpeg", + * "jpe" => "image/jpeg", + * "jpg" => "image/jpeg", + * + * $this->get_extension('image/jpeg') will always return 'jpg'. + * + */ // openoffice: - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'ott' => 'application/vnd.oasis.opendocument.text-template', // staroffice: - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'std' => 'application/vnd.sun.xml.draw.template', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'sxc' => 'application/vnd.sun.xml.calc', + 'sxd' => 'application/vnd.sun.xml.draw', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', // k-office: - 'kil' => 'application/x-killustrator', - 'kpt' => 'application/x-kpresenter', - 'kpr' => 'application/x-kpresenter', - 'ksp' => 'application/x-kspread', - 'kwt' => 'application/x-kword', - 'kwd' => 'application/x-kword', + 'kil' => 'application/x-killustrator', + 'kpt' => 'application/x-kpresenter', + 'kpr' => 'application/x-kpresenter', + 'ksp' => 'application/x-kspread', + 'kwt' => 'application/x-kword', + 'kwd' => 'application/x-kword', // ms office 97: - 'doc' => 'application/msword', - 'xls' => 'application/vnd.ms-excel', - 'ppt' => 'application/vnd.ms-powerpoint', + 'doc' => 'application/msword', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', // office2007: - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12', // wordperfect (who cares?): - 'wpd' => 'application/wordperfect', + 'wpd' => 'application/wordperfect', // common and generic containers: - 'pdf' => 'application/pdf', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'rtf' => 'text/rtf', - 'rtx' => 'text/richtext', - 'latex' => 'application/x-latex', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', + 'pdf' => 'application/pdf', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'rtf' => 'text/rtf', + 'rtx' => 'text/richtext', + 'latex' => 'application/x-latex', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', // *ml: - 'css' => 'text/css', - 'htm' => 'text/html', - 'html' => 'text/html', - 'wbxml' => 'application/vnd.wap.wbxml', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xsl' => 'text/xml', - 'xml' => 'text/xml', - 'csv' => 'text/csv', - 'tsv' => 'text/tab-separated-values', - 'txt' => 'text/plain', + 'css' => 'text/css', + 'htm' => 'text/html', + 'html' => 'text/html', + 'wbxml' => 'application/vnd.wap.wbxml', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'xsl' => 'text/xml', + 'xml' => 'text/xml', + 'csv' => 'text/csv', + 'tsv' => 'text/tab-separated-values', + 'txt' => 'text/plain', // images: - "bmp" => "image/bmp", - "gif" => "image/gif", - "ief" => "image/ief", - "jpeg" => "image/jpeg", - "jpe" => "image/jpeg", - "jpg" => "image/jpeg", - "jp2" => "image/jp2", - "png" => "image/png", - "tiff" => "image/tiff", - "tif" => "image/tif", - "djvu" => "image/vnd.djvu", - "djv" => "image/vnd.djvu", - "wbmp" => "image/vnd.wap.wbmp", - "ras" => "image/x-cmu-raster", - "pnm" => "image/x-portable-anymap", - "pbm" => "image/x-portable-bitmap", - "pgm" => "image/x-portable-graymap", - "ppm" => "image/x-portable-pixmap", - "rgb" => "image/x-rgb", - "xbm" => "image/x-xbitmap", - "xpm" => "image/x-xpixmap", - "xwd" => "image/x-windowdump", + "bmp" => "image/bmp", + "gif" => "image/gif", + "ief" => "image/ief", + "jpeg" => "image/jpeg", + "jpe" => "image/jpeg", + "jpg" => "image/jpeg", + "jp2" => "image/jp2", + "png" => "image/png", + "tiff" => "image/tiff", + "tif" => "image/tif", + "djvu" => "image/vnd.djvu", + "djv" => "image/vnd.djvu", + "wbmp" => "image/vnd.wap.wbmp", + "ras" => "image/x-cmu-raster", + "pnm" => "image/x-portable-anymap", + "pbm" => "image/x-portable-bitmap", + "pgm" => "image/x-portable-graymap", + "ppm" => "image/x-portable-pixmap", + "rgb" => "image/x-rgb", + "xbm" => "image/x-xbitmap", + "xpm" => "image/x-xpixmap", + "xwd" => "image/x-windowdump", // videos: - "mpeg" => "video/mpeg", - "mpe" => "video/mpeg", - "mpg" => "video/mpeg", - "m4v" => "video/mp4", - "mp4" => "video/mp4", - "ogv" => "video/ogg", - "qt" => "video/quicktime", - "mov" => "video/quicktime", - "mxu" => "video/vnd.mpegurl", - "avi" => "video/x-msvideo", - "movie" => "video/x-sgi-movie", - "flv" => "video/x-flv", - "swf" => "application/x-shockwave-flash", + "mpeg" => "video/mpeg", + "mpe" => "video/mpeg", + "mpg" => "video/mpeg", + "m4v" => "video/mp4", + "mp4" => "video/mp4", + "ogv" => "video/ogg", + "qt" => "video/quicktime", + "mov" => "video/quicktime", + "mxu" => "video/vnd.mpegurl", + "avi" => "video/x-msvideo", + "movie" => "video/x-sgi-movie", + "flv" => "video/x-flv", + "swf" => "application/x-shockwave-flash", // audio: - "mp3" => "audio/mpeg", - "mp4a" => "audio/mp4", - "m4a" => "audio/mp4", - "oga" => "audio/ogg", - "ogg" => "audio/ogg", - "flac" => "audio/x-flac", - "wav" => "audio/vnd.wave", + "mp3" => "audio/mpeg", + "mp4a" => "audio/mp4", + "m4a" => "audio/mp4", + "oga" => "audio/ogg", + "ogg" => "audio/ogg", + "flac" => "audio/x-flac", + "wav" => "audio/vnd.wave", // compressed formats: (note: http://svn.cleancode.org/svn/email/trunk/mime.types) - "tgz" => "application/x-gzip", - "gz" => "application/x-gzip", - "tar" => "application/x-tar", - "gtar" => "application/x-gtar", - "zip" => "application/x-zip", + "tgz" => "application/x-gzip", + "gz" => "application/x-gzip", + "tar" => "application/x-tar", + "gtar" => "application/x-gtar", + "zip" => "application/x-zip", // others: - 'bin' => 'application/octet-stream', + 'bin' => 'application/octet-stream', ); - private $private_file_extensions; private $system_types; private $system_exts; private $etc_mime_types = '/etc/mime.types'; + /** + * Construtor + */ public function __construct() { // populate the reverse shortlist: - $this->private_file_extensions = array_flip( $this->private_mime_types ); + $this->private_file_extensions = array_flip($this->private_mime_types); // pick up a local mime.types file if it is available - if (is_readable('mime.types') ) { + if (is_readable('mime.types')) { $this->etc_mime_types = 'mime.types'; } - } - + /** * function: getType * description: An alias to get_mimetype, * for backwards-compatibility with our old mimetype class. + * + * @param type $filename + * @return type */ - public function getType( $filename ) { - return $this->get_mimetype( $filename ); + public function getType($filename) { + return $this->get_mimetype($filename); } /** * function: get_mimetype * description: returns a mimetype associated with the file extension of $filename + * + * @param type $filename + * @param type $debug + * @return type */ - public function get_mimetype( $filename, $debug = FALSE ) { + public function get_mimetype($filename, $debug = FALSE) { - $file_name_and_extension = explode( '.', $filename ); - $ext = strtolower( array_pop( $file_name_and_extension ) ); - - if ( ! empty( $this->private_mime_types[$ext] ) ) { - if ( TRUE === $debug ) - return array( 'mime_type' => $this->private_mime_types[$ext], 'method' => 'from_array' ); + $file_name_and_extension = explode('.', $filename); + $ext = strtolower(array_pop($file_name_and_extension)); + + if (!empty($this->private_mime_types[$ext])) { + if (TRUE === $debug) + return array('mime_type' => $this->private_mime_types[$ext], 'method' => 'from_array'); return $this->private_mime_types[$ext]; } - + if (function_exists('file_get_mimetype')) { - $drupal_mimetype = file_get_mimetype( $filename ); + $drupal_mimetype = file_get_mimetype($filename); if ('application/octet-stream' != $drupal_mimetype) { if (TRUE == $debug) return array('mime_type' => $drupal_mimetype, 'method' => 'file_get_mimetype'); return $drupal_mimetype; } } - - if (!isset( $this->system_types)) + + if (!isset($this->system_types)) $this->system_types = $this->system_extension_mime_types(); - if (isset( $this->system_types[$ext])) { + if (isset($this->system_types[$ext])) { if (TRUE == $debug) return array('mime_type' => $this->system_types[$ext], 'method' => 'mime.types'); return $this->system_types[$ext]; } - - if ( TRUE === $debug ) - return array( 'mime_type' => 'application/octet-stream', 'method' => 'last_resort' ); - return 'application/octet-stream'; + if (TRUE === $debug) + return array('mime_type' => 'application/octet-stream', 'method' => 'last_resort'); + return 'application/octet-stream'; } /** * function: get_extension * description: returns *one* valid file extension for a given $mime_type + * + * @param type $mime_type + * @param type $debug + * @return type */ - public function get_extension( $mime_type, $debug = FALSE ) { + public function get_extension($mime_type, $debug = FALSE) { - if (!empty( $this->private_file_extensions[$mime_type])) { + if (!empty($this->private_file_extensions[$mime_type])) { if (TRUE == $debug) - return array( 'extension' => $this->private_file_extensions[$mime_type], 'method' => 'from_array' ); + return array('extension' => $this->private_file_extensions[$mime_type], 'method' => 'from_array'); return $this->private_file_extensions[$mime_type]; } - if (!isset ( $this->system_exts)) + if (!isset($this->system_exts)) $this->system_exts = $this->system_mime_type_extensions(); - if (isset( $this->system_exts[$mime_type])) { + if (isset($this->system_exts[$mime_type])) { if (TRUE == $debug) - return array( 'extension' => $this->system_exts[$mime_type], 'method' => 'mime.types' ); + return array('extension' => $this->system_exts[$mime_type], 'method' => 'mime.types'); return $this->system_exts[$mime_type]; } if (TRUE == $debug) - return array( 'extension' => 'bin', 'method' => 'last_resort' ); + return array('extension' => 'bin', 'method' => 'last_resort'); return 'bin'; } @@ -297,11 +309,11 @@ class MimeClass { $parts = preg_split('/\s+/', $line); if (count($parts) == 1) continue; - // A single part means a mimetype without extensions, which we ignore. + // A single part means a mimetype without extensions, which we ignore. $type = array_shift($parts); if (!isset($out[$type])) $out[$type] = array_shift($parts); - // We take the first ext from the line if many are present. + // We take the first ext from the line if many are present. } fclose($file); return $out; @@ -324,7 +336,7 @@ class MimeClass { $parts = preg_split('/\s+/', $line); if (count($parts) == 1) continue; - // A single part means a mimetype without extensions, which we ignore. + // A single part means a mimetype without extensions, which we ignore. $type = array_shift($parts); foreach ($parts as $part) $out[$part] = $type; diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 0f8be1bb..734edab4 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -1,12 +1,13 @@ datastreams[$dsID]['label']; } - } else { + } + else { drupal_not_found(); exit(); } @@ -95,7 +108,8 @@ class ObjectHelper { $fedoraUser = 'anonymous'; $fedoraPass = 'anonymous'; $contentSize = 0; - } else { + } + else { $fedoraUser = $user->name; $fedoraPass = $user->pass; $dataStreamInfo = $item->get_datastream_info($dsID); @@ -135,7 +149,8 @@ class ObjectHelper { curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); fclose($fp); - } else { + } + else { header("Content-type: $mimeType"); if ($contentSize > 0) { @@ -145,7 +160,8 @@ class ObjectHelper { if ($asAttachment) { $suggestedFileName = "$label"; $pos = strpos($suggestedFileName, '.'); - /** + + /* * Here we used to take an object of, say, type application/pdf with label, say, "My Document" * and we assemble the output filename extension based on the post-slash portion of the mimetype. * (If the label has a period anywhere in it, we leave it alone.) @@ -168,17 +184,25 @@ class ObjectHelper { if ((isset($user) && $user->uid != 0) || $forceSoap || isset($_SERVER['HTTPS'])) { curl_exec($ch); - } else { + } + else { header('Location: ' . $url); } } curl_close($ch); - } else { + } + else { drupal_set_message(t('No curl support.'), 'error'); } } - //Gets collection objects t + /** + * Gets collection objects t + * + * @param type $pid + * @param type $query + * @return type + */ function getCollectionInfo($pid, $query = NULL) { module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); @@ -188,6 +212,11 @@ class ObjectHelper { /** * returns the mime type + * + * @global type $user + * @param type $pid + * @param type $dsID + * @return type */ function getMimeType($pid, $dsID) { global $user; @@ -217,6 +246,13 @@ class ObjectHelper { return ''; } + /** + * getDatastreamInfo ?? + * @global type $user + * @param type $pid + * @param type $dsID + * @return type + */ function getDatastreamInfo($pid, $dsID) { global $user; if (empty($pid) || empty($dsID)) { @@ -267,7 +303,8 @@ class ObjectHelper { $pid . '/' . $dataStreamValue->ID . '/' . $dataStreamValue->label . '">purge datastream'; } - } else { + } + else { $purgeImage = ' '; } $fullPath = base_path() . $path; @@ -311,6 +348,12 @@ class ObjectHelper { return $content; } + /** + * getFormattedDC ?? + * @global type $base_url + * @param type $item + * @return type + */ function getFormattedDC($item) { global $base_url; $path = drupal_get_path('module', 'fedora_repository'); @@ -322,9 +365,8 @@ class ObjectHelper { if (empty($xmlstr)) { return ''; - } - + try { $proc = new XsltProcessor(); } catch (Exception $e) { @@ -348,7 +390,7 @@ class ObjectHelper { $output = $newdom->saveHTML(); return $output; } - + /** * Queries fedora for what we call the qualified dublin core. Currently only dc.coverage has * any qualified fields @@ -364,7 +406,7 @@ class ObjectHelper { $output = $this->getFormattedDC($item); $dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC'; $path = drupal_get_path('module', 'fedora_repository'); - + //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1)); if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { $allow = TRUE; @@ -375,13 +417,11 @@ class ObjectHelper { $output .= '
        ' . t('Edit Meta Data') . ''; - } } return $output; } - /** * Gets a list of datastreams from an object using its pid * @@ -465,8 +505,6 @@ class ObjectHelper { } return ''; } - - /** * returns a stream from a fedora object given a pid and dsid @@ -499,11 +537,13 @@ class ObjectHelper { return $content; } - /* + /** * gets the name of the content models for the specified object * this now returns an array of pids as in Fedora 3 we can have more then one Cmodel for an object + * @param type $pid + * @param type $include_fedora_system_content_models + * @return array */ - function get_content_models_list($pid, $include_fedora_system_content_models = FALSE) { module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionHelper = new CollectionClass(); @@ -542,11 +582,14 @@ class ObjectHelper { return $cmodels; } - /* + /** * determines whether we can see the object or not * checks PID namespace permissions, and user permissions + * @global type $user + * @param type $op + * @param type $pid + * @return type */ - function fedora_repository_access($op, $pid) { global $user; @@ -572,7 +615,8 @@ class ObjectHelper { return FALSE; } return $user_access; - } else { + } + else { return FALSE; } } @@ -633,13 +677,13 @@ class ObjectHelper { '/images/ingest.png" alt="' . t('Add a New Object') . '" class="icon">' . t(' Add to this Collection'); } } - } else { + } + else { $ingestObject = ' '; } - } - $datastreams .= $ingestObject; + $datastreams .= $ingestObject; $output .= $datastreams; @@ -671,7 +715,7 @@ class ObjectHelper { $output .= theme('fieldset', $fieldset); } - + return $output; } @@ -691,6 +735,12 @@ class ObjectHelper { return $objects; } + /** + * get_parent_objects_asHTML ?? + * @global type $base_url + * @param type $pid + * @return string + */ function get_parent_objects_asHTML($pid) { global $base_url; $parent_collections = $this->get_parent_objects($pid); @@ -718,10 +768,15 @@ class ObjectHelper { return $parent_collections_HTML; } - + /** * 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 + * + * @param type $pid + * @param type $contentModel + * @param type $page_number + * @return type */ function createExtraFieldsets($pid, $contentModel, $page_number) { //$models = $collectionHelper->getContentModels($collectionPid, FALSE); @@ -760,6 +815,9 @@ class ObjectHelper { /** * Get a tree of related pids - for the basket functionality + * + * @param type $pid + * @return type */ function get_all_related_pids($pid) { if (!$pid) { @@ -789,6 +847,9 @@ class ObjectHelper { /** * Get children of PID - but only 2 levels deep + * + * @param type $pids + * @return type */ function get_child_pids($pids) { // Get pid, title and description for children of object $pid @@ -834,6 +895,11 @@ class ObjectHelper { /** * Returns XML description of the object (export). + * + * @param type $pid + * @param type $context + * @param type $format + * @return type */ function getObject($pid, $context = 'archive', $format = FOXML_11) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -845,15 +911,21 @@ class ObjectHelper { /** * Builds an array of drupal links for use in breadcrumbs. + * + * @global type $base_url + * @param type $pid + * @param type $breadcrumbs + * @param type $level */ function getBreadcrumbs($pid, &$breadcrumbs, $level=10) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; - if ($pid == variable_get('fedora_repository_pid', 'islandora:top')){ - $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(t('Home'), $base_url); - } else { + if ($pid == variable_get('fedora_repository_pid', 'islandora:top')) { + $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); + $breadcrumbs[] = l(t('Home'), $base_url); + } + else { $query_string = 'select $parentObject $title $content from <#ri> where ( $title and $parentObject $content @@ -868,23 +940,28 @@ class ObjectHelper { $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; - $result = preg_split('/[\r\n]+/',do_curl($url)); + $result = preg_split('/[\r\n]+/', do_curl($url)); array_shift($result); // throw away first line - $matches =str_getcsv(join("\n",$result)); + $matches = str_getcsv(join("\n", $result)); if ($matches !== FALSE) { - $parent = preg_replace('/^info:fedora\//','',$matches[0]); + $parent = preg_replace('/^info:fedora\//', '', $matches[0]); $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); - } elseif ($level > 0) { + } + elseif ($level > 0) { $this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); } } } } + /** + * warnIfMisconfigured ?? + * @param type $app + */ public static function warnIfMisconfigured($app) { $messMap = array( 'Kakadu' => 'Full installation instructions for Kakadu can be found diff --git a/SearchClass.inc b/SearchClass.inc index 85a91968..70e18b71 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -1,141 +1,186 @@ $e->getMessage())), NULL, WATCHDOG_ERROR); return 'Error getting solr search results class. Check watchdog for more info.'; - } + } return $implementation->$solrFunction($query, $startPage, $fq, $dismax); } + + /** + * build solr search form ?? + * @param type $repeat + * @param type $pathToSearchTerms + * @param type $query + * @return type + */ function build_solr_search_form($repeat = NULL, $pathToSearchTerms = NULL, $query = NULL) { $types = $this->get_search_terms_array(NULL, 'solrSearchTerms.xml'); - $queryArray=NULL; + $queryArray = NULL; if (isset($query)) { $queryArray = explode('AND', $query); } $andOrArray = array( - 'AND' => 'and', - //'OR' => 'or' //removed or for now as it would be a pain to parse + 'AND' => 'and', + //'OR' => 'or' //removed or for now as it would be a pain to parse ); $form = array(); if (!isset($repeat)) { - $repeat = variable_get('islandora_solr_search_block_repeat', t('3')); + $repeat = variable_get('islandora_solr_search_block_repeat', t('3')); } $var0 = explode(':', $queryArray[0]); $var1 = explode(':', $queryArray[1]); $form['search_type']['type1'] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => trim($var0[0]) + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => trim($var0[0]) ); $form['fedora_terms1'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#required' => TRUE, - '#default_value' => (count($var0) >= 2 ? trim($var0[1]) : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#required' => TRUE, + '#default_value' => (count($var0) >= 2 ? trim($var0[1]) : ''), ); $form['andor1'] = array( - '#title' => t(''), - '#type' => 'select', - '#default_value' => 'AND', - '#options' => $andOrArray + '#title' => t(''), + '#type' => 'select', + '#default_value' => 'AND', + '#options' => $andOrArray ); $form['search_type']['type2'] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => (count($var1) >= 2 ? trim($var1[0]) : ''), + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => (count($var1) >= 2 ? trim($var1[0]) : ''), ); $form['fedora_terms2'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#default_value' => (count($var1) >= 2 ? $var1[1] : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#default_value' => (count($var1) >= 2 ? $var1[1] : ''), ); - if ($repeat>2 && $repeat < 9) { //don't want less then 2 or more then 9 + if ($repeat > 2 && $repeat < 9) { //don't want less then 2 or more then 9 for ($i = 3; $i < $repeat + 1; $i++) { $t = $i - 1; $field_and_term = explode(':', $queryArray[$t]); $form["andor$t"] = array( - '#title' => t(''), - '#type' => 'select', - '#default_value' => 'AND', - '#options' => $andOrArray + '#title' => t(''), + '#type' => 'select', + '#default_value' => 'AND', + '#options' => $andOrArray ); $form['search_type']["type$i"] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => trim($field_and_term[0]) + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => trim($field_and_term[0]) ); $form["fedora_terms$i"] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), ); } } $form['submit'] = array( - '#type' => 'submit', - '#value' => t('search') + '#type' => 'submit', + '#value' => t('search') ); return $form; } + /** + * build simple solr form ?? + * @return string + */ function build_simple_solr_form() { //$form = array(); $form["search_query"] = array( - '#size' => '30', - '#type' => 'textfield', - '#title' => t(''), - // '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), - ); + '#size' => '30', + '#type' => 'textfield', + '#title' => t(''), + // '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), + ); $form['submit'] = array( - '#type' => 'submit', - '#value' => t('search') + '#type' => 'submit', + '#value' => t('search') ); return $form; } + + /** + * theme solr search form ?? + * @param type $form + * @return type + */ function theme_solr_search_form($form) { if (!isset($repeat)) { - $repeat = variable_get('islandora_solr_search_block_repeat', t('3')); + $repeat = variable_get('islandora_solr_search_block_repeat', t('3')); } - $output = drupal_render($form['search_type']['type1']) ; - $output .= drupal_render($form['fedora_terms1']) ; - $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']) ; + $output = drupal_render($form['search_type']['type1']); + $output .= drupal_render($form['fedora_terms1']); + $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']); $output .= drupal_render($form['fedora_terms2']); - if ($repeat>2 && $repeat < 9) { - for ($i=3;$i<$repeat+1;$i++) { + if ($repeat > 2 && $repeat < 9) { + for ($i = 3; $i < $repeat + 1; $i++) { $t = $i - 1; - $output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$i"]) ; - $output .= drupal_render($form["fedora_terms$i"]) ; + $output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$i"]); + $output .= drupal_render($form["fedora_terms$i"]); } } - $output .= drupal_render($form['submit']) ; + $output .= drupal_render($form['submit']); $output .= drupal_render($form); return $output; - - } + + /** + * quick search ?? + * @param type $type + * @param type $query + * @param type $showForm + * @param type $orderBy + * @param type $userArray + * @return type + */ function quickSearch($type, $query, $showForm = 1, $orderBy = 0, & $userArray) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -146,15 +191,15 @@ class SearchClass { $keywords = explode(' ', $query); foreach ($keywords as $keyword) { - $luceneQuery .= $type . ':'. $keyword . '+AND+'; + $luceneQuery .= $type . ':' . $keyword . '+AND+'; } $luceneQuery = substr($luceneQuery, 0, strlen($luceneQuery) - 5); $indexName = variable_get('fedora_index_name', 'DemoOnLucene'); $keys = htmlentities(urlencode($query)); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); - $searchString = '?operation=gfindObjects&indexName='. $indexName . '&restXslt=copyXml&query='. $luceneQuery; - $searchString .= '&hitPageSize='. $numberOfHistPerPage . '&hitPageStart=1'; + $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=copyXml&query=' . $luceneQuery; + $searchString .= '&hitPageSize=' . $numberOfHistPerPage . '&hitPageStart=1'; //$searchString = htmlentities($searchString); $searchUrl .= $searchString; @@ -169,20 +214,25 @@ class SearchClass { $nodeList = $xPath->query('//field[@name="refworks.u1"]'); foreach ($nodeList as $node) { if (!in_array($node->nodeValue, $userArray)) { - $userArray[]=$node->nodeValue; + $userArray[] = $node->nodeValue; } } } if ($showForm) { - $output = 'Quick Search
        '. drupal_get_form('fedora_repository_quick_search_form') . '
        '; + $output = 'Quick Search
        ' . drupal_get_form('fedora_repository_quick_search_form') . '
        '; } $output .= $this->applyXSLT($resultData, $orderBy); return $output; } } - - // gets term from a lucene index and displays them in a list + /** + * gets term from a lucene index and displays them in a list + * @param type $fieldName + * @param type $startTerm + * @param type $displayName + * @return type + */ function getTerms($fieldName, $startTerm, $displayName = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -192,10 +242,10 @@ class SearchClass { $startTerm = ""; } $startTerm = drupal_urlencode($startTerm); - $query = 'operation=browseIndex&startTerm='. $startTerm . '&fieldName='. $fieldName . '&termPageSize=20&indexName='. $indexName . '&restXslt=copyXml&resultPageXslt=copyXml'; + $query = 'operation=browseIndex&startTerm=' . $startTerm . '&fieldName=' . $fieldName . '&termPageSize=20&indexName=' . $indexName . '&restXslt=copyXml&resultPageXslt=copyXml'; // $query=drupal_urlencode($query); - $query = '?'. $query; - $searchString=$searchUrl . $query; + $query = '?' . $query; + $searchString = $searchUrl . $query; $objectHelper = new ObjectHelper(); @@ -205,11 +255,16 @@ class SearchClass { $output .= $this->applySpecifiedXSLT($resultData, $path . '/xsl/browseIndexToResultPage.xslt', $displayName); //$output .= '
        '.$alpha_out; return $output; - } - - + /** + * custom search ?? + * @param type $query + * @param type $startPage + * @param type $xslt + * @param type $numberOfHistPerPage + * @return type + */ function custom_search($query, $startPage=1, $xslt= '/xsl/advanced_search_results.xsl', $numberOfHistPerPage = 50) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -225,8 +280,8 @@ class SearchClass { $query = trim($query); $query = htmlentities(urlencode($query)); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); - $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt='. $copyXMLFile . '&query=' . $query; - $searchString .= '&hitPageSize='. $numberOfHistPerPage . '&hitPageStart='. $startPage; + $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=' . $copyXMLFile . '&query=' . $query; + $searchString .= '&hitPageSize=' . $numberOfHistPerPage . '&hitPageStart=' . $startPage; //$searchString = htmlentities($searchString); $searchUrl .= $searchString; @@ -242,7 +297,14 @@ class SearchClass { } } - + /** + * apply specified xslt ?? + * @global type $user + * @param type $resultData + * @param type $pathToXSLT + * @param type $displayName + * @return type + */ function applySpecifiedXSLT($resultData, $pathToXSLT, $displayName = NULL) { $proc = NULL; global $user; @@ -252,9 +314,8 @@ class SearchClass { } try { $proc = new XsltProcessor(); - } - catch (Exception $e) { - drupal_set_message(t('Error loading '. $pathToXSLT . ' xslt!') . $e->getMessage()); + } catch (Exception $e) { + drupal_set_message(t('Error loading ' . $pathToXSLT . ' xslt!') . $e->getMessage()); return ' '; } @@ -270,10 +331,10 @@ class SearchClass { $xsl = new DomDocument(); - $test= $xsl->load($pathToXSLT); + $test = $xsl->load($pathToXSLT); if (!isset($test)) { - drupal_set_message(t('Error loading '. $pathToXSLT . ' xslt!')); + drupal_set_message(t('Error loading ' . $pathToXSLT . ' xslt!')); return t('Error loading !pathToXSLT xslt.', array('!pathToXSLT' => $pathToXSLT)); } @@ -291,8 +352,8 @@ class SearchClass { return $newdom->saveXML(); } } - //default function for lucene results + //default function for lucene results /** * apply an xslt to lucene gsearch search results @@ -305,8 +366,8 @@ class SearchClass { function applyLuceneXSLT($resultData, $startPage = 1, $xslt_file = '/xsl/results.xsl', $query=NULL) { $path = drupal_get_path('module', 'Fedora_Repository'); $test = $xslt_file; - $isRestricted = variable_get('fedora_namespace_restriction_enforced',TRUE); - if(!isRestricted && $xslt_file == null){ + $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); + if (!isRestricted && $xslt_file == null) { $xslt_file = '/xsl/unfilteredresults.xsl'; } $proc = NULL; @@ -354,7 +415,12 @@ class SearchClass { } } - //xslt for islandscholar these xslt functions can probably be pulled into one + /** + * xslt for islandscholar these xslt functions can probably be pulled into one + * @param type $resultData + * @param type $orderBy + * @return type + */ function applyXSLT($resultData, $orderBy = 0) { $path = drupal_get_path('module', 'Fedora_Repository'); $proc = NULL; @@ -378,7 +444,7 @@ class SearchClass { $proc->setParameter('', 'orderBy', $orderBy); $xsl = new DomDocument(); - $test=$xsl->load($path . '/ir/xsl/results.xsl'); + $test = $xsl->load($path . '/ir/xsl/results.xsl'); if (!isset($test)) { drupal_set_message(t('Error loading search results xslt!')); return t('Error loading search results XSLT.'); @@ -398,110 +464,127 @@ class SearchClass { } } + /** + * theme advanced search form ?? + * @param type $form + * @param type $repeat + * @return type + */ function theme_advanced_search_form($form, $repeat=NULL) { if (!isset($repeat)) { - $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); } - $output = drupal_render($form['search_type']['type1']) ; - $output .= drupal_render($form['fedora_terms1']) ; - $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']) ; + $output = drupal_render($form['search_type']['type1']); + $output .= drupal_render($form['fedora_terms1']); + $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']); $output .= drupal_render($form['fedora_terms2']); - if ($repeat>2 && $repeat < 9) { - for ($i=3;$i<$repeat+1;$i++) { + if ($repeat > 2 && $repeat < 9) { + for ($i = 3; $i < $repeat + 1; $i++) { $t = $i - 1; - $output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$i"]) ; - $output .= drupal_render($form["fedora_terms$i"]) ; + $output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$i"]); + $output .= drupal_render($form["fedora_terms$i"]); } } - $output .= drupal_render($form['submit']) ; + $output .= drupal_render($form['submit']); $output .= drupal_render($form); return $output; } - //build search form, custom blocks should set the number of repeats or it will use the default + /** + * build search form, custom blocks should set the number of repeats or it will use the default + * @param type $repeat + * @param type $pathToSearchTerms + * @param type $query + * @return string + */ function build_advanced_search_form($repeat = NULL, $pathToSearchTerms = NULL, $query = NULL) { $types = $this->get_search_terms_array($pathToSearchTerms); - $queryArray=NULL; + $queryArray = NULL; if (isset($query)) { $queryArray = explode('AND', $query); } $andOrArray = array( - 'AND' => 'and', - //'OR' => 'or' //removed or for now as it would be a pain to parse + 'AND' => 'and', + //'OR' => 'or' //removed or for now as it would be a pain to parse ); $form = array(); if (!isset($repeat)) { - $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); } $var0 = explode(':', $queryArray[0]); $var1 = explode(':', $queryArray[1]); $form['search_type']['type1'] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => trim($var0[0]) + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => trim($var0[0]) ); $form['fedora_terms1'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#required' => TRUE, - '#default_value' => (count($var0) >= 2 ? trim($var0[1]) : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#required' => TRUE, + '#default_value' => (count($var0) >= 2 ? trim($var0[1]) : ''), ); $form['andor1'] = array( - '#title' => t(''), - '#type' => 'select', - '#default_value' => 'AND', - '#options' => $andOrArray + '#title' => t(''), + '#type' => 'select', + '#default_value' => 'AND', + '#options' => $andOrArray ); $form['search_type']['type2'] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => (count($var1) >= 2 ? trim($var1[0]) : ''), + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => (count($var1) >= 2 ? trim($var1[0]) : ''), ); $form['fedora_terms2'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#default_value' => (count($var1) >= 2 ? $var1[1] : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#default_value' => (count($var1) >= 2 ? $var1[1] : ''), ); - if ($repeat>2 && $repeat < 9) { //don't want less then 2 or more then 9 + if ($repeat > 2 && $repeat < 9) { //don't want less then 2 or more then 9 for ($i = 3; $i < $repeat + 1; $i++) { $t = $i - 1; $field_and_term = explode(':', $queryArray[$t]); $form["andor$t"] = array( - '#title' => t(''), - '#type' => 'select', - '#default_value' => 'AND', - '#options' => $andOrArray + '#title' => t(''), + '#type' => 'select', + '#default_value' => 'AND', + '#options' => $andOrArray ); $form['search_type']["type$i"] = array( - '#title' => t(''), - '#type' => 'select', - '#options' => $types, - '#default_value' => trim($field_and_term[0]) + '#title' => t(''), + '#type' => 'select', + '#options' => $types, + '#default_value' => trim($field_and_term[0]) ); $form["fedora_terms$i"] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), + '#size' => '24', + '#type' => 'textfield', + '#title' => t(''), + '#default_value' => (count($field_and_term) >= 2 ? trim($field_and_term[1]) : ''), ); } } $form['submit'] = array( - '#type' => 'submit', - '#value' => t('search') + '#type' => 'submit', + '#value' => t('search') ); return $form; } - + /** + * get search terms array + * @param type $path + * @param string $file + * @return type + */ function get_search_terms_array($path = NULL, $file = NULL) { if (!isset($path)) { $path = drupal_get_path('module', 'Fedora_Repository'); @@ -510,7 +593,7 @@ class SearchClass { if (!isset($file)) { $file = 'searchTerms.xml'; } - $xmlDoc->load($path . '/'. $file); + $xmlDoc->load($path . '/' . $file); $nodeList = $xmlDoc->getElementsByTagName('term'); $types = array(); for ($i = 0; $i < $nodeList->length; $i++) { @@ -522,4 +605,5 @@ class SearchClass { } return $types; } + } diff --git a/SecurityClass.inc b/SecurityClass.inc index c314cbd1..588239e5 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -1,20 +1,33 @@ $e->getMessage())), 'error'); @@ -68,7 +84,7 @@ class SecurityClass { foreach ($conditions as $condition) { $designator = $condition->Apply->SubjectAttributeDesignator; if (empty($designator)) {//$disignator may be wrapped by an or - $designator=$condition->Apply->Apply->SubjectAttributeDesignator; + $designator = $condition->Apply->Apply->SubjectAttributeDesignator; } $attributeId = strip_tags($designator['AttributeId']); @@ -92,17 +108,20 @@ class SecurityClass { $usersAndRoles['users'] = $allowedUsers; $usersAndRoles['roles'] = $allowedRoles; return $usersAndRoles; - } - // When a user's profile is saved in drupal we will attempt to create a collection for them in Fedora - // this will be their personal space. In the IR it is editable by users with the same role in the VRE - // it probably would not be. + + /** + * When a user's profile is saved in drupal we will attempt to create a collection for them in Fedora + * this will be their personal space. In the IR it is editable by users with the same role in the VRE + * it probably would not be. + * @param type $user + * @return DOMDocument + */ function createPersonalPolicy($user) { $doc = new DOMDocument(); try { $doc->load(drupal_get_path('module', 'Fedora_Repository') . '/policies/noObjectEditPolicy.xml'); - } - catch (exception $e) { + } catch (exception $e) { watchdog(t("Fedora_Repository"), t("Problem loading policy file."), NULL, WATCHDOG_ERROR); } $conditions = $doc->getElementsByTagName('Condition'); @@ -117,7 +136,7 @@ class SecurityClass { if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { foreach ($user->roles as $role) { if (!($role == 'authenticated user' || $role == 'administrator')) { //don't want authenticated user included administrator already is included' - $newAttributeValue=$doc->createElement('AttributeValue', ''); + $newAttributeValue = $doc->createElement('AttributeValue', ''); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); // $newAttributeValue->setAttribute('MustBePresent', 'FALSE'); $apply->appendChild($newAttributeValue); @@ -132,7 +151,7 @@ class SecurityClass { foreach ($applies as $apply) { $functionId = $apply->getAttribute('FunctionId'); if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { - $newAttributeValue=$doc->createElement('AttributeValue', $user->name); + $newAttributeValue = $doc->createElement('AttributeValue', $user->name); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); $apply->appendChild($newAttributeValue); @@ -145,7 +164,7 @@ class SecurityClass { return $doc; //NULL; //$xml; } - /** + /** * Add a list of allowed users and roles to the given policy stream and return it. * * @param string $policy_stream @@ -170,7 +189,7 @@ class SecurityClass { if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { foreach ($allowed_roles as $role) { if (!($role == 'authenticated user' || $role == 'administrator')) { //don't want authenticated user included administrator already is included' - $newAttributeValue=$dom->createElement('AttributeValue', $role); + $newAttributeValue = $dom->createElement('AttributeValue', $role); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); $apply->appendChild($newAttributeValue); @@ -186,8 +205,8 @@ class SecurityClass { foreach ($applies as $apply) { $functionId = $apply->getAttribute('FunctionId'); if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { - foreach ( $allowed_users as $username ) { - $newAttributeValue=$dom->createElement('AttributeValue', $username ); + foreach ($allowed_users as $username) { + $newAttributeValue = $dom->createElement('AttributeValue', $username); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); $apply->appendChild($newAttributeValue); @@ -200,4 +219,5 @@ class SecurityClass { // $this->collection_policy_stream = $dom->saveXML(); return $dom->saveXML(); } + } diff --git a/XMLDatastream.inc b/XMLDatastream.inc index f5efa4d2..611a54cb 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -2,6 +2,14 @@ // $Id$ +/** + * @file + * XMLDatastream Abstract Class + */ + +/** + * XMLDatastream class ?? + */ abstract class XMLDatastream { static $XMLNS = 'http://www.islandora.ca'; @@ -95,14 +103,14 @@ abstract class XMLDatastream { $this->pid = $pid; $this->dsid = $dsid; - if ($xmlStr !== NULL) { - if(is_object($xmlStr) && get_class($xmlStr) == DOMDocument) { + if ($xmlStr !== NULL) { + if (is_object($xmlStr) && get_class($xmlStr) == DOMDocument) { $this->xml = $xmlStr; } else { $this->xml = new DOMDocument(); $this->xml->loadXML($xmlStr); - } + } } } @@ -180,7 +188,8 @@ abstract class XMLDatastream { // a subclass. $vars = get_class_vars(get_class($this)); $schemaLocation = $vars['SCHEMA_URI']; - } elseif ($rootEl->attributes->getNamedItem('schemaLocation') !== NULL) { + } + elseif ($rootEl->attributes->getNamedItem('schemaLocation') !== NULL) { //figure out where the schema is located and validate. list(, $schemaLocation) = preg_split('/\s+/', $rootEl->attributes->getNamedItem('schemaLocation')->nodeValue); } @@ -193,10 +202,12 @@ abstract class XMLDatastream { foreach ($errors as $err) { self::$errors[] = 'XML Error: Line ' . $err->line . ': ' . $err->message; } - } else { + } + else { $this->name = $rootEl->attributes->getNamedItem('name')->nodeValue; } - } else { + } + else { $ret = FALSE; self::$errors[] = 'Unable to load schema.'; } diff --git a/formClass.inc b/formClass.inc index 8621eae5..f22be8dc 100644 --- a/formClass.inc +++ b/formClass.inc @@ -2,10 +2,6 @@ // $Id$ -/* - * Created on Jan 22, 2008 - */ - class formClass { function formClass() { diff --git a/plugins/Flv.inc b/plugins/Flv.inc index 4345428f..7b076d00 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -38,6 +38,7 @@ class FormBuilder { $datastream->appendChild($version); $content = $dom->createElement("foxml:xmlContent"); $version->appendChild($content); + ///begin writing qdc $oai = $dom->createElement("oai_dc:dc"); $oai->setAttribute('xmlns:oai_dc', "http://www.openarchives.org/OAI/2.0/oai_dc/"); @@ -45,10 +46,12 @@ class FormBuilder { $oai->setAttribute('xmlns:dcterms', "http://purl.org/dc/terms/"); $oai->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $content->appendChild($oai); + //dc elements $previousElement = NULL; //used in case we have to nest elements for qualified dublin core foreach ($form_values as $key => $value) { $index = strrpos($key, '-'); + if ($index > 01) { $key = substr($key, 0, $index); } @@ -89,10 +92,13 @@ class FormBuilder { $rootElement->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); $rootElement->setAttribute('xsi:schemaLocation', "info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-0.xsd"); $dom->appendChild($rootElement); + //create standard fedora stuff $this->createStandardFedoraStuff($form_values, $dom, $rootElement); + //create relationships $this->createRelationShips($form_values, $dom, $rootElement); + //create dublin core $this->createQDCStream($form_values, $dom, $rootElement); $this->createFedoraDataStreams($form_values, $dom, $rootElement); @@ -261,11 +267,13 @@ class FormBuilder { '#type' => 'fieldset', '#title' => t('Ingest Digital Object Step #2') ); + foreach ($ingest_form_definition->form_elements->element as $element) { $name = strip_tags($element->name->asXML()); $title = strip_tags($element->label->asXML()); $required = strip_tags($element->required->asXML()); $required = strtolower($required); + if ($required != 'TRUE') { $required = '0'; } @@ -273,6 +281,7 @@ class FormBuilder { $description = strip_tags($element->description->asXML()); $type = strip_tags($element->type->asXML()); $options = array(); + if ($element->type == 'select') { foreach ($element->authoritative_list->item as $item) { $field = strip_tags($item->field->asXML()); From e22cd00b17005dd4d0b451dff37ac4bf6c3f3e49 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 7 Sep 2011 13:17:08 -0300 Subject: [PATCH 023/247] fixed a typo --- formClass.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/formClass.inc b/formClass.inc index 5392a513..4b47ede9 100644 --- a/formClass.inc +++ b/formClass.inc @@ -17,10 +17,9 @@ class formClass { drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } - /* + /** * create the paths for urls and map them to php functions */ - function createMenu() { $items = array(); @@ -167,7 +166,6 @@ class formClass { 'type' => MENU_CALLBACK, ); - /* Export functionality */ $items['fedora/basket'] = array( 'title' => t('Fedora Basket'), @@ -453,7 +451,10 @@ class formClass { /** * queries the collection object for a childsecurity datastream and if found parses it * to determine if this user is allowed to ingest in this collection - */ we assume if they are able to modify objects in the collection they can ingest as well. + * we assume if they are able to modify objects in the collection they can ingest as well. + * @param type $collection_pid + * @return type + */ function can_ingest_here($collection_pid) { module_load_include('inc', 'fedora_repository', 'SecurityClass'); $securityClass = new SecurityClass(); @@ -462,7 +463,6 @@ class formClass { /** * Drupal's permissions at this point no xacml yet. xacml decisions are made by fedora - * * @param type $collection_pid * @return type */ From 4799653a60eb64dd8d0b155f95dbd3a598b433f1 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 7 Sep 2011 14:32:46 -0300 Subject: [PATCH 024/247] ISLANDORA-314: Changed names to Islandora from Fedora --- fedora_repository.info | 2 +- formClass.inc | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index 7c88f2c8..21f4e708 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -3,6 +3,6 @@ name = Digital Repository dependencies[] = imageapi dependencies[] = tabs description = Shows a list of items in a fedora collection. -package = Fedora Repository +package = Islandora version = 6.x-$Format:%h$-dev core = 6.x diff --git a/formClass.inc b/formClass.inc index 4b47ede9..de19e04b 100644 --- a/formClass.inc +++ b/formClass.inc @@ -24,8 +24,8 @@ class formClass { $items = array(); $items['admin/settings/fedora_repository'] = array( - 'title' => t('Fedora collection list'), - 'description' => t('Enter the Fedora Collection information here'), + 'title' => t('Configure Islandora'), + 'description' => t('Enter the Islandora Collection information here'), 'page callback' => 'drupal_get_form', 'page arguments' => array('fedora_repository_admin'), 'access arguments' => array('administer site configuration'), @@ -33,7 +33,7 @@ class formClass { ); $items['admin/settings/fedora_repository/collection'] = array( 'title' => t('Collection list'), - 'description' => t('Enter the Fedora collection information here.'), + 'description' => t('Enter the Islandora collection information here.'), 'access arguments' => array('administer site configuration'), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => 0, @@ -49,7 +49,7 @@ class formClass { ); $items['islandoracm.xsd'] = array( - 'title' => t('Islandoracm XML Schema Definition'), + 'title' => t('Islandora Content Model XML Schema Definition'), 'page callback' => 'fedora_repository_display_schema', 'page arguments' => array('islandoracm.xsd'), 'type' => MENU_CALLBACK, @@ -57,7 +57,7 @@ class formClass { ); $items['collection_policy.xsd'] = array( - 'title' => t('Islandoracm XML Schema Definition'), + 'title' => t('Islandora Content Model XML Schema Definition'), 'page callback' => 'fedora_repository_display_schema', 'page arguments' => array('collection_policy.xsd'), 'type' => MENU_CALLBACK, @@ -113,9 +113,7 @@ class formClass { $items['fedora/repository/replaceStream'] = array( 'title' => t('Replace Stream'), 'page callback' => 'fedora_repository_replace_stream', -// 'callback arguments' => array(3, 4), 'type' => MENU_CALLBACK, -// 'access callback' => 'fedora_repository_user_access', 'access arguments' => array('add fedora datastreams'), ); $items['fedora/repository/purgeObject'] = array( @@ -866,4 +864,4 @@ class formClass { return $form; } -} \ No newline at end of file +} From 792d709d671e4d17b3f990c12b2ded55799cf723 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 7 Sep 2011 14:45:21 -0300 Subject: [PATCH 025/247] Removed ILives. It's being replaced by solution packs. --- ilives/book.inc | 337 -------- ilives/fedora_ilives.info | 7 - ilives/fedora_ilives.install | 14 - ilives/fedora_ilives.module | 749 ------------------ ilives/image_rotator_tagger_block.inc | 110 --- ilives/searchTerms.xml | 67 -- ilives/tests/fedora_ilives.test | 133 ---- ilives/tests/test_files/mods_record.xml | 83 -- ilives/xml/book_collection_policy.xml | 22 - ilives/xml/ilives_CollectionModel.xml | 139 ---- ilives/xml/ilives_bookCModel.xml | 524 ------------ ilives/xml/ilives_collection.xml | 56 -- ilives/xml/ilives_figuresCModel.xml | 20 - ilives/xml/ilives_jp2Sdef.xml | 81 -- ilives/xml/ilives_jp2Sdep-pageCModel.xml | 179 ----- ilives/xml/ilives_pageCModel.xml | 101 --- ilives/xml/ilives_tei2htmlSdef.xml | 64 -- ilives/xml/ilives_tei2htmlSdep-pageCModel.xml | 233 ------ ilives/xml/ilives_viewerSdef.xml | 64 -- ilives/xml/ilives_viewerSdep-bookCModel.xml | 133 ---- ilives/xml/ilives_viewerSdep-pageCModel.xml | 133 ---- ilives/xsl/MODS3-22simpleDC.xsl | 412 ---------- ilives/xsl/book_view.xsl | 174 ---- ilives/xsl/book_view.xsl.bak | 45 -- ilives/xsl/book_view.xsl2009-05-26 | 44 - ilives/xsl/pageResults.xsl | 165 ---- ilives/xsl/results.xsl | 395 --------- 27 files changed, 4484 deletions(-) delete mode 100644 ilives/book.inc delete mode 100644 ilives/fedora_ilives.info delete mode 100644 ilives/fedora_ilives.install delete mode 100644 ilives/fedora_ilives.module delete mode 100755 ilives/image_rotator_tagger_block.inc delete mode 100644 ilives/searchTerms.xml delete mode 100644 ilives/tests/fedora_ilives.test delete mode 100644 ilives/tests/test_files/mods_record.xml delete mode 100644 ilives/xml/book_collection_policy.xml delete mode 100644 ilives/xml/ilives_CollectionModel.xml delete mode 100644 ilives/xml/ilives_bookCModel.xml delete mode 100644 ilives/xml/ilives_collection.xml delete mode 100644 ilives/xml/ilives_figuresCModel.xml delete mode 100644 ilives/xml/ilives_jp2Sdef.xml delete mode 100644 ilives/xml/ilives_jp2Sdep-pageCModel.xml delete mode 100644 ilives/xml/ilives_pageCModel.xml delete mode 100644 ilives/xml/ilives_tei2htmlSdef.xml delete mode 100644 ilives/xml/ilives_tei2htmlSdep-pageCModel.xml delete mode 100644 ilives/xml/ilives_viewerSdef.xml delete mode 100644 ilives/xml/ilives_viewerSdep-bookCModel.xml delete mode 100644 ilives/xml/ilives_viewerSdep-pageCModel.xml delete mode 100644 ilives/xsl/MODS3-22simpleDC.xsl delete mode 100644 ilives/xsl/book_view.xsl delete mode 100644 ilives/xsl/book_view.xsl.bak delete mode 100644 ilives/xsl/book_view.xsl2009-05-26 delete mode 100644 ilives/xsl/pageResults.xsl delete mode 100644 ilives/xsl/results.xsl diff --git a/ilives/book.inc b/ilives/book.inc deleted file mode 100644 index 6480dec1..00000000 --- a/ilives/book.inc +++ /dev/null @@ -1,337 +0,0 @@ -pid = $pid; - $this->item = new Fedora_Item($pid); - } - } - - public function buildDrupalForm($form = array(), $ingest_form = array(), &$form_state = array()) { - $mods_save = ''; - if (isset($form_state['mods_save'])) { - $mods_save = $form_state['mods_save']; - } - - // Set #cache to true to create the $form_state cache - $form['#cache'] = TRUE; - - // Give the user an option to enter a custom PID - $form['custom_pid'] = array( - '#type' => 'textfield', - '#title' => 'Custom PID', - '#description' => 'If you want to manually specify the PID for the new object, enter it here. ' . - 'Leave it blank for an automatically-generated PID.', - ); - - // Prompt the user to enter a record ID to be looked up in Evergreen. - $form['unapi_url'] = array( - '#type' => 'textfield', - '#title' => 'Catalogue item URL', - ); - $form['unapi_url_submit'] = array( - '#type' => 'submit', - '#value' => t('Retrieve MODS record'), - '#submit' => array('fedora_ilives_retrieve_unapi_submit'), - '#ahah' => array( - 'path' => 'fedora/ilives/retrieve_unapi/js', // path we defined in hook_menu - 'wrapper' => 'mods-wrapper', // the HTML that wraps the element that needs to be replaced - 'method' => 'replace', // the method we're going to use: a replace operation - //'effect' => 'fade', // the effect used when replacing the element (try fade!) - ), - '#suffix' => '
        ', - ); - drupal_add_js('', 'inline'); - // We define a
        wrapper. Everything in it will be replaced. - $form['mods'] = array( - '#tree' => TRUE, - '#prefix' => '
        ', - '#suffix' => '
        ', - ); - $form['mods']['mods_record'] = array( - '#type' => 'textarea', - '#title' => 'MODS Record to Import', - '#rows' => 20, - ); - - if (!empty($mods_save)) { - $form['mods']['mods_record']['#value'] = $mods_save['mods']['mods_record']; - } - return $form; - } - - public function buildEditMetadataForm($form = array()) { - - $form['submit'] = array( - '#type' => 'submit', - '#weight' => 10, - '#value' => 'Update' - ); - $form['pid'] = array( - '#type' => 'hidden', - '#value' => $this->pid, - ); - $form['dsid'] = array( - '#type' => 'hidden', - '#value' => "DARWIN_CORE", - ); - - return $this->buildDrupalForm($form); - } - - public function handleEditMetadataForm($form_id, $form_values) { - /* - * Process the metadata form - * Update the datastreams - */ - - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); - global $user; - $mimetype = new MimeClass(); - $dwc = new DarwinCore($this->item); - $dwc->handleForm($form_values); - $this->item->purge_datastream('DARWIN_CORE'); - $this->item->add_datastream_from_string($dwc->darwinCoreXML, 'DARWIN_CORE', - 'Darwin Core Metadata', 'text/xml', 'X'); - return TRUE; - } - - public function handleIngestForm($form_values, &$form_state) { - /* - * process the metadata form - * Create fedora object - * Add the datastreams - */ - module_load_include('inc', 'fedora_repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - if ($form_state['clicked_button']['#value'] == 'Retrieve MODS record') { - return; - } - - $mods_list_doc = new DomDocument(); - $mods_list_doc->loadXML($form_values['mods']['mods_record']); - $mods_item_doc = new DomDocument(); - $mods_item = $mods_list_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'mods')->item(0); - $new_mods_item = $mods_item_doc->importNode($mods_item, TRUE); - $mods_item_doc->appendChild($new_mods_item); - - $title_info = $mods_item_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'titleInfo')->item(0); - $title = ''; - foreach (array('nonSort', 'title') as $title_field) { - $title .= $title_info->getElementsByTagNameNS('http://www.loc.gov/mods/v3', $title_field)->item(0)->nodeValue . ' '; - } - $title = trim($title); - $mods_text = $mods_item_doc->saveXML(); - global $user; - $mimetype = new MimeClass(); - - $new_item = Fedora_Item::ingest_new_item(!empty($form_values['custom_pid']) ? $form_values['custom_pid'] : $form_values['pid'], 'A', $title, - $user->name); - - $new_item->add_datastream_from_string($mods_text, 'MODS', - 'MODS Metadata', 'text/xml', 'X'); - - $dc = transform_mods_to_dc($mods_text); - if ($dc) { - // Add the PID to a dc:identifier field. - $dc_doc = simplexml_load_string($dc); - $dc_doc->registerXPathNamespace('oai_dc', 'http://www.openarchives.org/OAI/2.0/oai_dc/'); - $dc_item = $dc_doc->xpath('//oai_dc:dc'); - foreach ($dc_item as $node) { - $node->addChild('dc:identifier', $new_item->pid, 'http://purl.org/dc/elements/1.1/'); - } - $new_item->modify_datastream_by_value($dc_doc->saveXML(), 'DC', 'Dublin Core XML Metadata', 'text/xml'); - } - $new_item->add_relationship('hasModel', $form_values['content_model_pid'], FEDORA_MODEL_URI); - $new_item->add_relationship(!empty($form_values['relationship']) ? $form_values['relationship'] : 'isMemberOfCollection', $form_values['collection_pid']); - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($new_item->pid, 'fedora/repository/' . $new_item->pid))), "status"); - } - - public function buildAddPagesForm($form = array()) { - - } - - public function showFieldSets() { - module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); - module_load_include('module', 'fedora_ilives'); - global $base_url; - $show_purge_tab = (!empty($_POST['form_id']) && ($_POST['form_id'] == 'fedora_ilives_purge_pages_form')); - $first_page = new Fedora_Item($this->pid . '-001'); - $hasPage = $first_page->exists(); - $tabset = array(); - - global $user; - $qs = ''; - if ($user->uid != 0) { - $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); - } - - $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; - $html = ''; - - $tabset['first_tab'] = array( - // #type and #title are the minimum requirements. - '#type' => 'tabpage', - '#title' => t('Description'), - // This will be the content of the tab. - '#content' => fedora_ilives_create_book_view($this->pid), - ); - - if ($hasPage) { - $tabset['second_tab'] = array( - '#type' => 'tabpage', - '#title' => t('Read'), - '#content' => $html - ); - } - - if (!$hasPage && user_access('ingest new fedora objects')) { - $tabset['third_tab'] = array( - '#type' => 'tabpage', - '#title' => t('Add pages'), - '#content' => drupal_get_form('book_add_pages_form', $this->pid), - ); - } - if ($hasPage && user_access('purge objects and datastreams')) { - $tabset['fourth_tab'] = array( - '#type' => 'tabpage', - '#title' => t('Purge all pages'), - '#selected' => $show_purge_tab, - '#content' => drupal_get_form('fedora_ilives_purge_pages_form', $this->pid), - ); - } - return $tabset; - } - -} - -function book_add_pages_form(&$form_state, $pid, $page_cmodel = 'ilives:pageCModel', $relation = 'isMemberOf') { - $form['pid'] = array( - '#type' => 'hidden', - '#value' => $pid, - ); - $form['page_cmodel'] = array( - '#type' => 'hidden', - '#value' => $page_cmodel, - ); - $form['relation'] = array( - '#type' => 'hidden', - '#value' => $relation, - ); - $form['tiff_dir'] = array( - '#type' => 'textfield', - '#title' => t('TIFF folder'), - '#required' => TRUE, - '#description' => t('Path to a web-accessible folder contining the book\'s page images in TIFF format on this server.'), - ); - - $form['submit'] = array( - '#type' => 'submit', - '#weight' => 10, - '#value' => 'Ingest Pages' - ); - return $form; -} - -function book_add_pages_form_validate($form, &$form_state) { - if ($form_state['values']['tiff_dir'] == '') { - form_set_error('', t('You must select a name for this group of settings.')); - } -} - -function book_add_pages_form_submit($form, &$form_state) { - $pid = $form_state['values']['pid']; - if (!empty($form_state['values']['tiff_dir'])) { - $file_list = array(); - if ($tiff_dir = opendir($form_state['values']['tiff_dir'])) { - while (FALSE !== ($file_name = readdir($tiff_dir))) { - $ext = strrchr($file_name, '.'); - if ($ext == '.tif' || $ext == '.tiff') { - array_push($file_list, $form_state['values']['tiff_dir'] . '/' . $file_name); - } - } - closedir($tiff_dir); - sort($file_list); - ilives_create_page_objects($pid, $file_list, $form_state['values']['page_cmodel'], $form_state['values']['relation']); - } - } -} - -/** - * Create a page object for each element in $image_list as a child object of $pid - */ -function ilives_create_page_objects($pid, $image_list = array(), $page_cmodel = 'ilives:pageCModel', $relation = 'isMemberOfCollection') { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $book = new Fedora_Item($pid); - if (!$book->exists()) { - return FALSE; - } - - - $page_pids = array(); - $batch = array( - 'title' => 'Creating page objects', - 'operations' => array(), - 'file' => drupal_get_path('module', 'fedora_ilives') . '/book.inc', - ); - $page_num = 1; - $book_title = $book->objectProfile->objLabel; - foreach ($image_list as $image_path) { - $batch['operations'][] = array('ilives_add_single_page_object', array($pid, $image_path, $page_num, "$book_title - Page " . sprintf("%03d", $page_num), $page_cmodel, $relation)); - $page_num++; - } - batch_set($batch); - $objectHelper = new ObjectHelper; - $dc_xml = $objectHelper->getStream($pid, 'DC'); - $xml = new DOMDocument(); - $xml->loadXML($dc_xml); - $root = $xml->documentElement; - $typeNode = $xml->createElement('dc:type', 'ingested'); - $typeNode = $xml->createElementNS("http://purl.org/dc/elements/1.1/", 'dc:type', 'ingested'); - $root->appendChild($typeNode); - $book->modify_datastream_by_value($xml->saveXML(), 'DC', 'Dublin core', 'text/xml', TRUE, "Added Type of Ingest", FALSE); -} - -function ilives_add_single_page_object($book_pid, $page_file, $page_num = 1, $page_title = NULL, $page_cmodel = 'ilives:pageCModel', $relation = 'isMemberOfCollection') { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $page_item = Fedora_Item::ingest_new_item("$book_pid-" . sprintf("%03d", $page_num), 'A', $page_title); - $page_item->add_relationship('hasModel', $page_cmodel, FEDORA_MODEL_URI); - $page_item->add_relationship($relation, $book_pid); - $page_item->add_datastream_from_file($page_file, 'TIFF', 'Archival TIFF', 'image/tiff', 'M'); -} - -function transform_mods_to_dc($mods) { - $xp = new XsltProcessor(); - // create a DOM document and load the XSL stylesheet - $xsl = new DomDocument; - $xsl->load(drupal_get_path('module', 'fedora_ilives') . '/xsl/MODS3-22simpleDC.xsl'); - - // import the XSL styelsheet into the XSLT process - $xp->importStylesheet($xsl); - - // create a DOM document and load the XML datat - $xml_doc = new DomDocument; - $xml_doc->loadXML($mods); - - // transform the XML into HTML using the XSL file - if ($dc = $xp->transformToXML($xml_doc)) { - return $dc; - } - else { - return FALSE; - } -} diff --git a/ilives/fedora_ilives.info b/ilives/fedora_ilives.info deleted file mode 100644 index 763adfdc..00000000 --- a/ilives/fedora_ilives.info +++ /dev/null @@ -1,7 +0,0 @@ -; $Id$ -name = Islandora Book -description = Provides book interface -package = Fedora Repository -dependencies[] = fedora_repository -version = 6.1dev -core = 6.x diff --git a/ilives/fedora_ilives.install b/ilives/fedora_ilives.install deleted file mode 100644 index 04ed6064..00000000 --- a/ilives/fedora_ilives.install +++ /dev/null @@ -1,14 +0,0 @@ - t('Book view'), - 'page callback' => 'fedora_ilives_create_book_view', - 'type' => MENU_CALLBACK, - 'access arguments' => array('view fedora collection'), - ); - $items['fedora/ilives_book_viewer'] = array( - 'title' => t('Book viewer'), - 'page callback' => 'fedora_ilives_book_viewer', - 'type' => MENU_CALLBACK, - 'access arguments' => array('view fedora collection'), - ); - $items['fedora/ilives_book_search'] = array( - 'title' => t('Book viewer'), - 'page callback' => 'fedora_ilives_book_search', - 'type' => MENU_CALLBACK, - 'access arguments' => array('view fedora collection'), - ); - $items['fedora/ilives_page_search'] = array( - 'title' => t('Book viewer'), - 'page callback' => 'fedora_ilives_page_search', - 'type' => MENU_CALLBACK, - 'access arguments' => array('view fedora collection'), - ); - // This block defines the path and the corresponding callback function. - $items['fedora/ilives/retrieve_unapi/js'] = array( - 'page callback' => 'fedora_ilives_button_retrieve_unapi_ahah', // the AHAH callback function - 'access arguments' => array('add fedora datastreams'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -//function fedora_ilives_book_search($query) { -//} -//function fedora_ilives_page_search($query) { -//} - -function fedora_ilives_block($op = 'list', $delta = 0, $edit = array()) { - // The $op parameter determines what piece of information is being requested. - switch ($op) { - case 'list': - // If $op is "list", we just need to return a list of block descriptions. - // This is used to provide a list of possible blocks to the administrator, - // end users will not see these descriptions. - $blocks[0] = array( - 'info' => t('Book search block'), - ); - $blocks[1] = array( - 'info' => t('Image rotator and tagger'), - ); - $blocks[2] = array( - 'info' => t('Simple book search block'), - ); - - return $blocks; - case 'configure': - // If $op is "configure", we need to provide the administrator with a - // configuration form. The $delta parameter tells us which block is being - // configured. In this example, we'll allow the administrator to customize - // the text of the first block. - // If $op is "configure", we need to provide the administrator with a - // configuration form. The $delta parameter tells us which block is being - // configured. In this example, we'll allow the administrator to customize - // the text of the first block. - $form = array(); - switch ($delta) { - case 0: - // All we need to provide is a text field, Drupal will take care of - // the other block configuration options and the save button. - $form['fedora_ilives_book_search_block_repeat'] = array( - '#type' => 'textfield', - '#title' => t('Number of times to repeat search fields'), - '#size' => 5, - '#description' => t('The number of times you would like the search blocks to be repeated'), - '#default_value' => variable_get('fedora_ilives_book_search_block_repeat', t('3')), - ); - break; - case 1: - // This is the image rotator block. - $form['fedora_ilives_image_rotator_block_query'] = array( - '#type' => 'textarea', - '#title' => t('ITQL Query'), - '#description' => t('The ITQL query to return a list of images.'), - '#default_value' => variable_get('fedora_ilives_image_rotator_tagger_block_query', 'select $object $title from <#ri> -where $object -and $object -and $object $title'), - ); - break; - case 2: - // All we need to provide is a text field, Drupal will take care of - // the other block configuration options and the save button. - $form['fedora_ilives_simple_book_search_block_title'] = array( - '#type' => 'textfield', - '#title' => t('Title'), - '#size' => 15, - '#description' => t('The title of the block'), - '#default_value' => variable_get('fedora_ilives_simple_book_search_block_title', t('Title')), - ); - break; - } - - return $form; - case 'save': - // If $op is "save", we need to save settings from the configuration form. - // Since the first block is the only one that allows configuration, we - // need to check $delta to make sure we only save it. - switch ($delta) { - case 0: - // Have Drupal save the string to the database. - variable_set('fedora_ilives_book_search_block_repeat', $edit['fedora_ilives_book_search_block_repeat']); - break; - case 1: - variable_set('fedora_ilives_image_rotator_tagger_block_query', $edit['fedora_ilives_image_rotator_block_query']); - break; - case 2: - // Have Drupal save the string to the database. - variable_set('fedora_ilives_simple_book_search_block_title', $edit['fedora_ilives_simple_book_search_block_title']); - break; - } - return; - case 'view': default: - // If $op is "view", then we need to generate the block for display - // purposes. The $delta parameter tells us which block is being requested. - switch ($delta) { - case 0: - // The subject is displayed at the top of the block. Note that it - // should be passed through t() for translation. - $block['subject'] = t('Book advanced search'); - // The content of the block is typically generated by calling a custom - // function. - $block['content'] = drupal_get_form('fedora_ilives_book_search_form'); - break; - case 1: - module_load_include('inc', 'fedora_ilives', 'image_rotator_tagger_block'); - $block['subject'] = t('Random repository image'); - $block['content'] = _fedora_image_rotator_tagger_block_content(); - break; - case 2: - // The subject is displayed at the top of the block. Note that it - // should be passed through t() for translation. - $block['subject'] = t('Simple Book Search'); - // The content of the block is typically generated by calling a custom - // function. - $block['content'] = drupal_get_form('fedora_ilives_simple_book_search_form'); - break; - } - - return $block; - } -} - -function fedora_ilives_book_viewer($pid) { - global $user; - $qs = ''; - if ($user->uid != 0) { -// $qs = '?uid=' . base64_encode($user->name . ':' . $user->sid); - $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); - } - - $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $pid . '/ilives:viewerSdef/getViewer' . $qs; - $html = ''; - $fieldset = array( - '#title' => t('Viewer - ') . $pid, - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#value' => $html); - drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); - return theme('fieldset', $fieldset); -} - -//loads an xslt for the main book page uses mods for most of the display. if there is a $query parameter -// it will execute it against the book. -function fedora_ilives_create_book_view($pid, $query = NULL) { - global $user; - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $path = drupal_get_path('module', 'Fedora_Repository'); - $objectHelper = new ObjectHelper; - $xml = $objectHelper->getStream($pid, 'MODS'); - $dc_xml = $objectHelper->getStream($pid, 'DC'); - if (!$dc_xml) { - drupal_set_message(t('Object does not exist.'), 'error'); - return ''; - } - $simpleDCxml = simplexml_load_string($dc_xml); - $types = $simpleDCxml->xpath('//dc:type'); - $ingested = 'false'; - if (!empty($types)) { - foreach ($types as $type) { - if ($type == 'ingested') { - $ingested = 'true'; - } - } - } - - if (!isset($pid)) { - drupal_set_message(t('Error getting book view, no identifier specified.')); - return; - } - $proc = NULL; - try { - $proc = new XsltProcessor(); - } catch (Exception $e) { - drupal_set_message(t('Error loading Book View XSLT: $e', array('!e' => $e->getMessage()))); - return; - } - - //inject into xsl stylesheet - $proc->setParameter('', 'userID', $user->uid); - $proc->setParameter('', 'objectsPage', base_path()); - $proc->setParameter('', 'pid', $pid); - $proc->setParameter('', 'ingested', $ingested); - $xsl = new DomDocument(); - $test = $xsl->load($path . '/ilives/xsl/book_view.xsl'); - if (!isset($test)) { - drupal_set_message(t('Error loading search results XSLT.')); - return t('Error loading search results XSLT.'); - } - - $input = new DomDocument(); - $didLoadOk = $input->loadXML($xml); - $output = NULL; - if (!isset($didLoadOk)) { - drupal_set_message(t('Error loading Book View XML.')); - return t('Error loading Book View XML.'); - } - else { - $xsl = $proc->importStylesheet($xsl); - $newdom = $proc->transformToDoc($input); - $output .= $newdom->saveXML(); - } - if (isset($query)) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - $pageQuery = convert_query_to_page_query($query, $pid); - $output .= '
        ' . $searchClass->custom_search($pageQuery, $startPage, '/ilives/xsl/pageResults.xsl', 500) . '
        '; //limit results to 500 pages of a book since there is no paging if we enable paging in xslt this can be changed - //return $output."
        used this query to find this page $query and new query = $pageQuery
        "; - - return $output; - } - else { - return $output; - } -} - -function convert_query_to_page_query($query, $pid) { - $newQuery = substr($query, 0, strlen($query) - 23); - $pid = str_replace(':', '?', $pid); - $newQuery = $newQuery . " AND PID:$pid* AND dc.type:Text"; - //$newQuery=htmlentities(urlencode($newQuery)); - return $newQuery; -} - -/** - * Custom form element to do our nice images. - */ -function fedora_ilives_elements() { // Change this line - $type['imagebutton'] = array( - '#input' => TRUE, - '#button_type' => 'submit', - '#executes_submit_callback' => TRUE, - '#name' => 'op', - '#process' => array('hook_imagebutton_process' => array()), - ); - return $type; -} - -function theme_imagebutton($element) { - return '\n"; -} - -/** - * Implementation of hook_theme() to register how to theme image buttons. - */ -function fedora_ilives_theme() { - return array( - 'imagebutton' => array( - 'arguments' => array('form' => NULL), - ), - 'fedora_ilives_book_search_form' => array( - 'arguments' => array('form' => NULL), - ), - 'fedora_ilives_simple_book_search_form' => array( - 'arguments' => array('form' => NULL), - ) - ); -} - -//return array( -// 'fedora_repository_mnpl_advanced_search_form' => array( -// 'arguments' => array('form' => NULL) -// ) -// ); - -function theme_fedora_ilives_book_search_form($form) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $advanced_search_form = new SearchClass(); - $repeats = variable_get('fedora_ilives_book_search_block_repeat', t('3')); - return $advanced_search_form->theme_advanced_search_form($form, $repeats); -} - -function fedora_ilives_simple_book_search_form($form) { - $form = array(); - $form['search_type']['type1'] = array( - '#title' => t(''), - '#type' => 'hidden', - '#default_value' => 'tei.fullText' - ); - $form['fedora_terms1'] = array( - '#size' => '24', - '#type' => 'textfield', - '#title' => t(''), - '#required' => TRUE, - '#default_value' => '' - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('search') - ); - return $form; -} - -function fedora_ilives_simple_book_search_form_submit($form, &$form_state) { - $type_id = $form_state['values']['type']; - - $searchString = $form_state['values']['type1'] . ':' . $form_state['values']['fedora_terms1']; - - $searchString = trim($searchString) . '+AND+dc.type:collection'; - $form_state['redirect'] = "fedora/ilives_book_search/$searchString"; - //drupal_goto("fedora/ilives_book_search/$searchString"); -} - -function fedora_ilives_book_search_form() { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - $repeats = variable_get('fedora_ilives_book_search_block_repeat', t('3')); - $path = drupal_get_path('module', 'Fedora_Repository') . '/ilives'; - $query = NULL; - if (arg(1) == 'ilives_book_search' && arg(2) != 'dc.type:ingested') { - $length = strlen(arg(2)); - if (($test = strpos(arg(2), 'dc.type:collection')) > 0) { - $length = $test - 5; //get rid of the AND - } - $query = trim(substr(arg(2), 0, $length)); - } - return $searchClass->build_advanced_search_form($repeats, $path, $query); -} - -function fedora_ilives_book_search_form_submit($form, &$form_state) { - $type_id = $form_state['values']['type']; - $repeat = variable_get('fedora_ilives_book_search_block_repeat', t('3')); - $searchString = $form_state['values']['type1'] . ':' . $form_state['values']['fedora_terms1']; - if ($form_state['values']['fedora_terms2'] != '') { - $searchString .= '+' . $form_state['values']['andor1'] . '+' . $form_state['values']['type2'] . ':' . $form_state['values']['fedora_terms2']; - } - if ($repeat > 2 && $repeat < 9) { - for ($i = 3; $i < $repeat + 1; $i++) { - $t = $i - 1; - if ($form_state['values']["fedora_terms$i"] != '') { - $searchString .= '+' . $form_state['values']["andor$t"] . '+' . $form_state['values']["type$i"] . ':' . $form_state['values']["fedora_terms$i"]; - } - } - } - $searchString = trim($searchString) . '+AND+dc.type:collection'; - $form_state['redirect'] = "fedora/ilives_book_search/$searchString"; - //drupal_goto("fedora/ilives_book_search/$searchString"); -} - -function fedora_ilives_book_search($query, $startPage = 1) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - return $searchClass->custom_search($query, $startPage, '/ilives/xsl/results.xsl', 10); -} - -function retrieve_unapi_MODS_record($url) { - $bib_response = drupal_http_request($url); - $bib_html = $bib_response->data; - $bib_doc = new DOMDocument; - @$bib_doc->loadHTML($bib_html); - $links = $bib_doc->getElementsByTagName('link'); - foreach ($links as $link) { - if ($link->getAttribute('rel') == 'unapi-server') { - $unapi_server = $link->getAttribute('href'); - break; - } - } - $attrs = $bib_doc->getElementsByTagName('abbr'); - foreach ($attrs as $attr) { - if ($attr->getAttribute('class') == 'unapi-id') { - - $unapi_id = $attr->getAttribute('title'); - break; - } - } - $mods_url = "$unapi_server?id=$unapi_id&format=mods3"; - $mods_resp = drupal_http_request($mods_url); - $mods_data = $mods_resp->data; - return $mods_data; -} - -/** - * AHAH callback for the 'match type' select. - * This function handles the actual replace and sets the $form and $form_state arrays. - * */ -function fedora_ilives_button_retrieve_unapi_ahah() { - - // this part is used to set up $form_state. - // In Drupal 7, these next 11 lines will be put in a core utility function. - // Just remember you'll need them in D6 when you do AHAH. - $form_state = array('storage' => NULL, 'submitted' => FALSE); - $form_build_id = $_POST['form_build_id']; - $form = form_get_cache($form_build_id, $form_state); - $args = $form['#parameters']; - $form_id = array_shift($args); - $form['#post'] = $_POST; - $form['#redirect'] = FALSE; - $form['#programmed'] = FALSE; - - $form_state['post'] = $_POST; - drupal_process_form($form_id, $form, $form_state); - $form_state['storage']['step'] = 2; - $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id); - // From here on, we'll add our own code. - // We just get the element of $form that needs to be refreshed, and just resubmit that - // part through the json call. In this case we want to rebuild the 'kind'
        wrapper and the - // select box it contains - $changed_elements = $form['mods']['mods_record']; - - - unset($changed_elements['#prefix'], $changed_elements['suffix']); // we'll unset the div to make sure it won't be repeated! - // the actual JSON call - $javascript = drupal_add_js(NULL, NULL, 'header'); - drupal_json(array( - 'status' => TRUE, - 'data' => theme('status_messages') . drupal_render($changed_elements), // rebuild just the part that needs to be changed - 'settings' => call_user_func_array('array_merge_recursive', $javascript['setting']), - )); -} - -/** - * This is the handler for the 'type' box: pressing this will refresh the
        kind wrapper. - * */ -function fedora_ilives_retrieve_unapi_submit($form, &$form_state) { - - unset($form_state['submit_handlers']); // unset all the submit handlers in the form - form_execute_handlers('submit', $form, $form_state); // execute submit handler - $url = $form_state['values']['unapi_url']; - $mods = retrieve_unapi_MODS_record($url); - $form_state['values']['mods']['mods_record'] = $mods; - $mods_save = $form_state['values']; // store all the submitted values in the form - $form_state['mods_save'] = $mods_save; // put the values in a new form - - $form_state['rebuild'] = TRUE; // set to true to make sure the form gets rebuild - return $mods_save; -} - -function fedora_ilives_form_alter(&$form, &$form_state, $form_id) { - if ($form_id == 'fedora_repository_admin') { - # Custom settings for book module. - } - elseif ($form_id == 'fedora_repository_demo_objects_form') { - if (!Fedora_Item::fedora_item_exists('ilives:bookCModel')) { - - $form['install_demos']['demo_collections']['#options']['ilives:bookCModel'] = 'Book-related content models and service objects'; - $form['install_demos']['ingest']['#disabled'] = FALSE; - $form['#submit'][] = 'fedora_ilives_install_demos_form_submit'; - } - else { - - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $book_item = new Fedora_Item('ilives:bookCModel'); - - $form['existing_demos']['ilives:bookCModel'] = array( - '#prefix' => '
      • ', - '#value' => l($book_item->pid, $book_item->url()), - '#suffix' => '
      • ', - ); - } - } -} - -function fedora_ilives_install_demos_form_submit($form, &$form_state) { - if ($form_state['values']['demo_collections']['ilives:bookCModel'] == 'ilives:bookCModel') { - # The ilives:bookCModel checkbox was checked - install_book_content_model_objects(); - } -} - -/** - * Implementation of hook_requirements(). - * - * @return - * An array describing the status of the site regarding available updates. - * If there is no update data, only one record will be returned, indicating - * that the status of core can't be determined. If data is available, there - * will be two records: one for core, and another for all of contrib - * (assuming there are any contributed modules or themes enabled on the - * site). In addition to the fields expected by hook_requirements ('value', - * 'severity', and optionally 'description'), this array will contain a - * 'reason' attribute, which is an integer constant to indicate why the - * given status is being returned (UPDATE_NOT_SECURE, UPDATE_NOT_CURRENT, or - * UPDATE_UNKNOWN). This is used for generating the appropriate e-mail - * notification messages during update_cron(), and might be useful for other - * modules that invoke update_requirements() to find out if the site is up - * to date or not. - * - * @see _update_message_text() - * @see _update_cron_notify() - */ -function fedora_ilives_requirements($phase) { - global $base_url; - if ($phase == 'runtime') { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $requirements['iiv-war'] = array(); - $requirements['iiv-war']['title'] = t("Islandora OpenLayers image viewer web app"); - if (!_fedora_ilives_viewer_available()) { - $requirements['iiv-war']['value'] = ("Not available"); - $requirements['iiv-war']['severity'] = REQUIREMENT_ERROR; - $requirements['iiv-war']['description'] = t('Ensure that Fedora is running and that the IIV app is deployed.', - array('@iiv-home' => 'http://github.com/islandora/iiv')); - } - else { - $requirements['iiv-war']['value'] = ("Available"); - $requirements['iiv-war']['severity'] = REQUIREMENT_OK; - } - } - return $requirements; -} - -function _fedora_ilives_viewer_available() { - $url = parse_url(variable_get('fedora_base_url', 'http://localhost:8080/fedora')); - $fedora_host = ("{$url['scheme']}://{$url['host']}" . (!empty($url['port']) ? ":{$url['port']}/" : '/')); - $response = drupal_http_request("$fedora_host/iiv/images/loading.gif"); - return empty($response->error); -} - -function fedora_ilives_required_fedora_objects() { - // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) - $module_path = drupal_get_path('module', 'fedora_ilives'); - return array( - 'fedora_ilives' => array( - 'module' => 'fedora_ilives', - 'title' => 'Island Lives Books', - 'objects' => array( - array( - 'foxml_file' => "$module_path/xml/ilives_pageCModel.xml", - 'pid' => 'ilives:pageCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_bookCModel.xml", - 'pid' => 'ilives:bookCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_jp2Sdef.xml", - 'pid' => 'ilives:jp2Sdef', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_viewerSdef.xml", - 'pid' => 'ilives:viewerSdef', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_viewerSdep-bookCModel.xml", - 'pid' => 'ilives:viewerSdep-bookCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_viewerSdep-pageCModel.xml", - 'pid' => 'ilives:viewerSdep-pageCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_tei2htmlSdef.xml", - 'pid' => 'ilives:tei2htmlSdef', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_tei2htmlSdep-pageCModel.xml", - 'pid' => 'ilives:tei2htmlSdep-pageCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_collection.xml", - 'pid' => 'ilives:collection', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/xml/ilives_CollectionModel.xml", - 'pid' => 'ilives:CollectionModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'pid' => 'books:collection', - 'label' => 'Book Collection', - 'cmodel' => 'islandora:collectionCModel', - 'parent' => 'islandora:demos', - 'datastreams' => array( - array( - 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/xml/book_collection_policy.xml", - ), - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/Crystal_Clear_mimetype_man.png", - 'mimetype' => 'image/png', - ), - ), - ), - ), - ), - ); -} - -function fedora_ilives_purge_pages_form(&$form_state, $pid, $referrer = NULL) { - global $base_url; - if (!user_access('purge objects and datastreams')) { - return NULL; - } - if ($pid == NULL) { - return NULL; - } - $form['pid'] = array( - '#type' => 'hidden', - '#value' => "$pid" - ); - if (!strstr(drupal_get_destination(), urlencode('fedora/repository'))) { - $form['referrer'] = array( - '#type' => 'hidden', - '#value' => $referrer, - ); - } - if (!isset($form_state['storage']['confirm'])) { - // do your normal $form definition here - - - $form['submit'] = array( - '#type' => 'image_button', - '#src' => drupal_get_path('module', 'fedora_repository') . '/images/purge_big.png', - '#value' => t('Purge'), - '#suffix' => 'Purge all pages associated with this book', - ); - - return $form; - } - else { - // ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form - - return confirm_form($form, 'Confirm Purge ALL pages?', $referrer, 'Are you sure you want to delete these objects? This action cannot be undone.', 'Purge Pages', 'Cancel'); //Had better luck leaving off last param 'name' - } - return $form; -} - -function fedora_ilives_purge_pages_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - $pid = $form_state['values']['pid']; - if (!isset($form_state['storage']['confirm'])) { - $form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form - $form_state['rebuild'] = TRUE; // along with this - } - else { - - $query = << - where (\$object \$title - and \$object - and \$object ) - order by \$title - -XML; - - // this is where you do your processing after they have pressed the confirm button - module_load_include('inc', 'fedora_repoitory', 'CollectionClass'); - $collection = new CollectionClass($pid); - $contents = $collection->getRelatedItems($pid, $query); - $results_xml = simplexml_load_string($contents); - $resultsarray = array(); - foreach ($results_xml->results->result as $result) { - $pid_to_delete = str_replace('info:fedora/', '', $result->object->attributes()->uri); - - //parse contents - - $params = array( - "pid" => $pid_to_delete, - "logMessage" => "Purged", - "force" => "" - ); - try { - $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $object = $client->__soapCall('purgeObject', array($params)); - unset($form_state['storage']['confirm']); - } catch (exception $e) { - if (preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage())) { - drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error'); - } - else { - drupal_set_message(t($e->getMessage()), 'error'); - } - return; - } - } - if (!empty($form_state['values']['referrer'])) { - $form_state['redirect'] = $form_state['values']['referrer']; - } - elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { - $collectionPid = $_SESSION['fedora_collection']; - - $form_state['redirect'] = "fedora/repository/$collectionPid/"; - } - else { - $form_state['redirect'] = 'fedora/repository/'; - } - } -} diff --git a/ilives/image_rotator_tagger_block.inc b/ilives/image_rotator_tagger_block.inc deleted file mode 100755 index d5177101..00000000 --- a/ilives/image_rotator_tagger_block.inc +++ /dev/null @@ -1,110 +0,0 @@ - -where $object -and $object -and $object $title'; - $collection = new CollectionClass('ilives:figures'); - $results = $collection->getRelatedItems('ilives:figures', $itqlquery); - //drupal_set_message($results); - - - if (empty($results)) { - return NULL; - } - $resultsdoc = new DomDocument(); - $resultsdoc->loadXML($results); - - $resultslist = $resultsdoc->getElementsByTagName('result'); - if ($resultslist->length == 0) { - return NULL; - } - //return htmlentities(substr($results, 0, 1000)); - $randresult = $resultslist->item(rand() % $resultslist->length); - if (empty($randresult)) { - return NULL; - } - $objs = $randresult->getElementsByTagName('object'); - $obj = $objs->item(0); - $pid = substr($obj->getAttribute('uri'), 12); - $titles = $randresult->getElementsByTagName('title'); - $title = $titles->item(0); - - return array('pid' => $pid, - //'title' => $randresult->textContent); - 'title' => $title->nodeValue); -} - -function _fedora_image_rotator_tagger_block_content() { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); - - global $base_url; - if (!empty($_POST['pid'])) { - $image_item = new Fedora_Item($_POST['pid']); - $result['pid'] = $_POST['pid']; - $result['title'] = $image_item->objectProfile->objLabel; - } - elseif (empty($_POST) && !empty($_SESSION['fedora_tagged_image']['pid'])) { - $image_item = new Fedora_Item($_SESSION['fedora_tagged_image']['pid']); - $result['pid'] = $_SESSION['fedora_tagged_image']['pid']; - $result['title'] = $image_item->objectProfile->objLabel; - unset($_SESSION['fedora_tagged_image']); - } - else { - $result = get_random_image(); - - $image_item = new Fedora_Item($result['pid']); - } - if (!empty($result)) { - - $image = theme_image( . $base_url . '/fedora/imageapi/' . $result['pid'] . '/JPG?op=scale&height=500&width=300'); - - return '

        ' - . l('', 'fedora/repository/' . $result['pid'], array('html' => TRUE, 'alias' => TRUE)) - //. l(t("!image", array(image => $image)) - . '

        This image is from ' . l($result['title'], 'fedora/ilives_book_viewer/' . substr($image_item->pid, 0, strrpos($image_item->pid, '-')), array('html' => TRUE, 'alias' => TRUE)) . '.' - . drupal_get_form('fedora_repository_image_tagging_form', $result['pid']) . '

        '; - } - else { - return ''; - } -} - -/* - function fedora_ilives_preprocess_page(&$variables) { - drupal_add_js(drupal_get_path('module', 'fedora_ilives').'/fedora_ilives_ajax.js', 'theme'); - return TRUE; - } */ - -class ShowILivesStreamsInFieldSets { - - private $pid = NULL; - - function ShowILivesStreamsInFieldSets($pid) { - //drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - $this->pid = $pid; - } - - function showJPG() { - module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); - global $base_url; - $collection_fieldset = array( - '#collapsible' => FALSE, - '#value' => '', - ); - return theme('fieldset', $collection_fieldset) - . drupal_get_form('fedora_repository_image_tagging_form', $this->pid); - } - -} diff --git a/ilives/searchTerms.xml b/ilives/searchTerms.xml deleted file mode 100644 index 651c96a1..00000000 --- a/ilives/searchTerms.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - dc.title - 1000 - - dc.title - Title - - - mods.sor - Author - - - mods.subject - Subject - - - - tei.fullText - Text - - - tei.persName - People - - - - - tei.placeName - Places - - - tei.orgName - Organization Name - - - - - - - - - - - - diff --git a/ilives/tests/fedora_ilives.test b/ilives/tests/fedora_ilives.test deleted file mode 100644 index 7b1fbae9..00000000 --- a/ilives/tests/fedora_ilives.test +++ /dev/null @@ -1,133 +0,0 @@ - 'Fedora Book', - 'description' => t('The Fedora repository book content model.'), - 'group' => t('fedora repository'), - ); - } - - function setUp() { - parent::setUp('fedora_repository', 'fedora_ilives', 'tabs'); - - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - // Create and login user. - $repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams', - 'edit fedora meta data', - 'edit tags datastream', - 'ingest new fedora objects', - 'purge objects and datastreams', - 'view fedora collection', - 'view detailed list of content')); - - - $this->drupalLogin($repository_user); - } - - public function testBookCModel() { - // First add a book collection - - $pid_list = array(); - // Create a collection for ingesting book content model objects. - - $ingest_form = array(); - $ingest_form['models'] = 'islandora:collectionCModel/ISLANDORACM'; - - $this->drupalPost('fedora/ingestObject/islandora:top/Islandora%20Top-Level%20Collection', $ingest_form, 'Next'); - - $ingest_title = $this->randomName(32); - $ingest_form_step_2['dc:title'] = $ingest_title; - $ingest_form_step_2['dc:description'] = $this->randomName(256); - $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_ilives') . '/xml/book_collection_policy.xml'); - $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); - $this->assertPattern('/Item .* created successfully./', "Verified item created."); - - $pid = $this->getIngestedPid(); - $this->drupalGet("fedora/repository/$pid"); - $pid_list[] = $pid; - - // Now add a book into the new collection - $this->pass("Create book collection $pid below top-level collection.", 'fedora book'); - $ingest_book_form = array(); - $ingest_book_form['models'] = 'ilives:bookCModel/ISLANDORACM'; - $this->drupalPost("fedora/ingestObject/$pid/", $ingest_book_form, 'Next'); - $ingest_book_form_step_2 = array(); - - $ingest_book_form_step_2['mods[mods_record]'] = file_get_contents(drupal_get_path('module', 'fedora_ilives') . '/tests/test_files/mods_record.xml'); - $this->outputScreenContents(); - $this->drupalPost(NULL, $ingest_book_form_step_2, 'Ingest'); - $this->outputScreenContents(); - $book_pid = $this->getIngestedPid(); - $pid_list[] = $book_pid; - if (!empty($book_pid)) { - $this->pass("Successfully ingested book object $book_pid."); - } - $this->cleanUpRepository($pid_list); - } - - private function cleanUpRepository($pid_list = array()) { - $this->pass("This is the PID list to purge: " . implode(", ", $pid_list)); - foreach ($pid_list as $pid) { - $this->drupalPost("fedora/repository/purgeObject/$pid", array(), 'Purge'); - $this->drupalPost(NULL, array(), 'Delete'); - } - } - - private function getIngestedPid() { - $subject = $this->drupalGetContent(); - $pattern = '/">(.*)<\/a> created successfully./'; - $matches = array(); - $res = preg_match($pattern, $subject, $matches); - return $matches[1]; - } - - private function outputScreenContents($description = '', $basename = '') { - // This is a hack to get a directory that won't be cleaned up by SimpleTest. - $file_dir = file_directory_path() . '../simpletest_output_pages'; - if (!is_dir($file_dir)) { - mkdir($file_dir, 0777, TRUE); - } - $output_path = "$file_dir/$basename." . $this->randomName(10) . '.html'; - $rv = file_put_contents($output_path, $this->drupalGetContent()); - $this->pass("$description: Contents of result page are " . l(t('here'), $output_path)); - } - - protected function drupalCreateFedoraUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) { - // Create a role with the given permission set. - if (!($rid = $this->drupalCreateRole($permissions))) { - return FALSE; - } - - // Create a user assigned to that role. - $edit = array(); - $edit['name'] = 'simpletestuser'; - $edit['mail'] = $edit['name'] . '@example.com'; - $edit['roles'] = array($rid => $rid); - $edit['pass'] = 'simpletestpass'; - $edit['status'] = 1; - - $account = user_save('', $edit); - - $this->assertTrue(!empty($account->uid), t('User created with name %name and pass %pass', array('%name' => $edit['name'], '%pass' => $edit['pass'])), t('User login')); - if (empty($account->uid)) { - return FALSE; - } - - // Add the raw password so that we can log in as this user. - $account->pass_raw = $edit['pass']; - return $account; - } - -} - diff --git a/ilives/tests/test_files/mods_record.xml b/ilives/tests/test_files/mods_record.xml deleted file mode 100644 index c9dc081b..00000000 --- a/ilives/tests/test_files/mods_record.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - The - amazing Maurice and his educated rodents - - - Pratchett, Terry. - - creator - - - text - novel - - - enk - - - London - - Corgi Books - 2002 - 2001 - monographic - - - eng - - -
        print
        - 269 p. ; 22 cm. -
        - A talking cat, intelligent rats, and a strange boy cooperate in a Pied Piper scam until they try to con the wrong town and are confronted by a deadly evil rat king. - juvenile - Terry Pratchett. - Carnegie Medal winner. - - Discworld (Imaginary place) - Fiction - - - Discworld (Imaginary place) - Fiction - - - Rats - Fiction - - - Cats - Fiction - - - Fantasy fiction - - - Humorous stories - - PZ7.P8865 Am 2002 - - - Discworld series - - - Pratchett, Terry. - - - 006001234X (library binding) - 0385601239 - 0552546933 (pbk.) - - CaNWHRN - 010730 - 20020314 .0 - - eng - - -
        -
        - diff --git a/ilives/xml/book_collection_policy.xml b/ilives/xml/book_collection_policy.xml deleted file mode 100644 index 07a01745..00000000 --- a/ilives/xml/book_collection_policy.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - 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 - - isMemberOfCollection - \ No newline at end of file diff --git a/ilives/xml/ilives_CollectionModel.xml b/ilives/xml/ilives_CollectionModel.xml deleted file mode 100644 index bc9d58a9..00000000 --- a/ilives/xml/ilives_CollectionModel.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-01-23T20:43:42.518Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2009-01-23T20:45:33.190Z - - - - - modifyDatastreamByValue - DC - fedoraAdmin - 2009-01-23T20:48:22.246Z - - - - - ingest - - fedoraAdmin - 2009-01-26T20:27:14.697Z - Ingested from local file /opt/fedora/export/ilives_CollectionModel.xml - - - - ingest - - fedoraAdmin - 2009-03-21T22:35:49.622Z - Ingested from local file /Volumes/iLives/iLivesTexts/215258_jpg/Content_Models/CollectionCModel.xml - - - - ingest - - admin - 2009-09-14T14:09:41.955Z - Fedora Object Ingested - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - -
        -
        -
        -
        -
        -
        - - - - - IslandLives Collection Model - ilives:CollectionModel - - - - - - - IslandLives Collection - Made possible through a generous private donation, the IslandLives project builds on the Robertson Library’s mission to preserve and share unique material relating to Prince Edward Island and demonstrates UPEI's ongoing commitment to making PEI's cultural and published heritage available to all. -Utilizing the library’s “Prince Edward Island Collection” and the latest in digitization technology, IslandLives will start by digitizing 300 or so published community histories dating from the mid-1800’s to the present day. These transformed community histories will form the basis of a rich online repository. -IslandLives will provide a variety of search interfaces that will allow users to browse and search the content by name, community, time period, and keyword. The Island community will have a whole new way to rediscover, search and share their stories. -This project will engage and build community – recruiting interested individuals from the cultural heritage community and everyday Islanders. Project staff will travel to communities and host ‘digitization days’, introducing community members to the project and its goals, providing them with an opportunity to digitize their own content, and to contribute their content to the IslandLives collection. - - Robertson Library, University of Prince Edward Island - ilives:CollectionModel - - - - -
        \ No newline at end of file diff --git a/ilives/xml/ilives_bookCModel.xml b/ilives/xml/ilives_bookCModel.xml deleted file mode 100644 index 99195fc5..00000000 --- a/ilives/xml/ilives_bookCModel.xml +++ /dev/null @@ -1,524 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:56:58.331Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_bookCModel.xml - - - - ingest - - fedoraAdmin - 2010-05-31T19:56:44.131Z - Ingested from source repository with pid ilives:bookCModel - - - - ingest - - fedoraAdmin - 2010-06-10T17:43:56.335Z - Ingested from local file /Users/aoneill/fedora_repository/content_models/ilives_bookCModel.xml - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-06-10T19:01:39.144Z - DatastreamsPane generated this logMessage. - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-10T19:29:20.220Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-10T19:46:24.930Z - - - - - ingest - - fedoraAdmin - 2010-06-16T11:27:32.059Z - Ingested from local file /Users/aoneill/Dropbox/fedora_repository/content_models/ilives_bookCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T11:29:54.285Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T18:36:16.581Z - - - - - ingest - - fedoraAdmin - 2010-06-16T16:14:12.989Z - Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/ilives_bookCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-09-16T17:43:54.445Z - - - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Book Content Model - ilives:bookCModel - - - - - - - - - - image/tiff - image/tif - - - - - ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - image/tif - - - - - fedora_ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - - - - - fedora_ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - text/xml - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - text/xml - - - - text/xml - - - - - - - - - - - - - - - - - - - - - - diff --git a/ilives/xml/ilives_collection.xml b/ilives/xml/ilives_collection.xml deleted file mode 100644 index a2803960..00000000 --- a/ilives/xml/ilives_collection.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-05-14T19:32:21.132Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - DC - fedoraAdmin - 2009-05-14T19:35:11.912Z - - - - - - - - - - - IslandLives Collection - ilives:collection - - - - - - - IslandLives Collection - Made possible through a generous private donation, IslandLives contains community and church histories and it builds on the Robertson Library's mission to preserve and share unique material relating to Prince Edward Island and demonstrates UPEI"s ongoing commitment to making PEI"s cultural and published heritage available to all. Welcome. - ilives:collection - - - - - \ No newline at end of file diff --git a/ilives/xml/ilives_figuresCModel.xml b/ilives/xml/ilives_figuresCModel.xml deleted file mode 100644 index 05ea5f02..00000000 --- a/ilives/xml/ilives_figuresCModel.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - image/jpeg - - - - - fedora_ilives - image_rotator_tagger_block.inc - ShowILivesStreamsInFieldSets - showJPG - - - - image/jpeg - - - - diff --git a/ilives/xml/ilives_jp2Sdef.xml b/ilives/xml/ilives_jp2Sdef.xml deleted file mode 100644 index 0f21ef52..00000000 --- a/ilives/xml/ilives_jp2Sdef.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:56:59.840Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdef.xml - - - - ingest - - admin - 2010-05-25T13:17:14.106Z - Fedora Object Ingested - - - - ingest - - fedoraAdmin - 2010-06-01T01:40:47.337Z - Ingested from local file /Users/al/fedora_repository/content_models/ilives_jp2Sdef.xml - - - - - - - - - - - - - - - - - - - - - ilives:jp2Sdef - ilives:jp2Sdef - - - - - - - - - - - - - - - diff --git a/ilives/xml/ilives_jp2Sdep-pageCModel.xml b/ilives/xml/ilives_jp2Sdep-pageCModel.xml deleted file mode 100644 index 0aa21432..00000000 --- a/ilives/xml/ilives_jp2Sdep-pageCModel.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:00.246Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdep-pageCModel.xml - - - - ingest - - fedoraAdmin - 2010-06-01T00:46:19.239Z - Ingested from local file /Users/al/Desktop/ilives_jp2Sdep-pageCModel.xml - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-01T00:48:39.302Z - - - - - - - - - - - ilives:jp2Sdep-pageCModel - ilives:jp2Sdep-pageCModel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DC - text/xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ilives/xml/ilives_pageCModel.xml b/ilives/xml/ilives_pageCModel.xml deleted file mode 100644 index 2e5e5638..00000000 --- a/ilives/xml/ilives_pageCModel.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:00.652Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_pageCModel.xml - - - - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page Content Model - ilives:pageCModel - - - - - diff --git a/ilives/xml/ilives_tei2htmlSdef.xml b/ilives/xml/ilives_tei2htmlSdef.xml deleted file mode 100644 index a387e512..00000000 --- a/ilives/xml/ilives_tei2htmlSdef.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:01.057Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdef.xml - - - - - - - - - - - - - - - - - - - - - ilives:tei2htmlSdef - ilives:tei2htmlSdef - - - - - - - - - - - - - - diff --git a/ilives/xml/ilives_tei2htmlSdep-pageCModel.xml b/ilives/xml/ilives_tei2htmlSdep-pageCModel.xml deleted file mode 100644 index 07351348..00000000 --- a/ilives/xml/ilives_tei2htmlSdep-pageCModel.xml +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:01.366Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdep-pageCModel.xml - - - - modifyDatastreamByValue - XSL - fedoraAdmin - 2009-12-11T19:09:52.417Z - - - - - modifyDatastreamByValue - XSL - fedoraAdmin - 2009-12-11T19:22:11.096Z - - - - - - - - - - - - - - - - - - - - - - - - ilives:tei2htmlSdep-pageCModel - ilives:tei2htmlSdep-pageCModel - - - - - - - - - - TEI - text/xml - - - - XSL - text/xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:value-of select="normalize-space(tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title)"/> - - - - - - - - -
        - -
        -
        - -

        - -

        -
        - - - - - - - - - - - search persName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22 - + - %22+AND+dc.type:collection - - - - - - - - - - - - - search placeName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22 - %22+AND+dc.type:collection - - - - - - - search orgName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22 - %22+AND+dc.type:collection - - - - - -
        -
        -
        -
        -
        diff --git a/ilives/xml/ilives_viewerSdef.xml b/ilives/xml/ilives_viewerSdef.xml deleted file mode 100644 index 18018cfa..00000000 --- a/ilives/xml/ilives_viewerSdef.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T17:09:29.912Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdef.xml - - - - - - - - - - - - - - - - - - - - - ilives:viewerSdef - ilives:viewerSdef - - - - - - - - - - - - - - diff --git a/ilives/xml/ilives_viewerSdep-bookCModel.xml b/ilives/xml/ilives_viewerSdep-bookCModel.xml deleted file mode 100644 index ec7993b1..00000000 --- a/ilives/xml/ilives_viewerSdep-bookCModel.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T17:09:41.797Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-bookCModel.xml - - - - - - - - - - ilives:viewerSdep-bookCModel - ilives:viewerSdep-bookCModel - - - - - - - - - - - - - - - - - - - - - - - DC - text/xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ilives/xml/ilives_viewerSdep-pageCModel.xml b/ilives/xml/ilives_viewerSdep-pageCModel.xml deleted file mode 100644 index e19fe7c5..00000000 --- a/ilives/xml/ilives_viewerSdep-pageCModel.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-24T14:52:27.296Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-pageCModel.xml - - - - - - - - - - - - - - - - - - - - - - - ilives:viewerSdep-pageCModel - ilives:viewerSdep-pageCModel - - - - - - - - - - - - - - - - - - - - - - - - - DC - text/xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ilives/xsl/MODS3-22simpleDC.xsl b/ilives/xsl/MODS3-22simpleDC.xsl deleted file mode 100644 index eb147a42..00000000 --- a/ilives/xsl/MODS3-22simpleDC.xsl +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - . - - - - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Collection - - - DataSet - - - Service - - - Software - - - Image - - - InteractiveResource - - - MovingImage - - - PhysicalObject - - - Sound - - - StillImage - - - Text - - - Text - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - , - - - - , - - - - - ( - - ) - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ilives/xsl/book_view.xsl b/ilives/xsl/book_view.xsl deleted file mode 100644 index 47559c12..00000000 --- a/ilives/xsl/book_view.xsl +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - -

        - - - - - : - - -

        - -

        - - - -

        -
        - - - - - - -
        - - - fedora/repository/ - /TN - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - By Statement: - - -
        - Place of Publication: - - -
        - Publisher: - - -
        - Date: - - -
        - Language: - - -
        - Pagination: - - -
        - ISBN 10: - - -
        - Subjects: - - - - - - fedora/ilives_book_search/mods.subject:" - "%20AND%20dc.type:collection%20AND%20dc.type:ingested - - - - - - -
        -
        -
        -
        -
        - - - - - - - - - - -
        - -
        -
        \ No newline at end of file diff --git a/ilives/xsl/book_view.xsl.bak b/ilives/xsl/book_view.xsl.bak deleted file mode 100644 index 4acce98b..00000000 --- a/ilives/xsl/book_view.xsl.bak +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - -

        - :

        -

        - -

        -
        -
        - - fedora/repository//TN - - - - - -
        - - - - - - - - -
        By Statement:
        Place of Publication:
        Publisher:
        Date:
        Language:
        Pagination:
        ISBN 10:
        Subjects: - - fedora/repository/mnpl_advanced_search/mods.subject:"" - - -
        -
        - -
        -
        \ No newline at end of file diff --git a/ilives/xsl/book_view.xsl2009-05-26 b/ilives/xsl/book_view.xsl2009-05-26 deleted file mode 100644 index d05a0341..00000000 --- a/ilives/xsl/book_view.xsl2009-05-26 +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - -

        - :

        -

        - -

        -
        -
        - - fedora/repository//TN - - - - - -
        - - - - - - - - -
        By Statement:
        Place of Publication:
        Publisher:
        Date:
        Language:
        Pagination:
        ISBN 10:
        Subjects: - - fedora/repository/mnpl_advanced_search/mods.subject:"" - - -
        -
        - -
        -
        \ No newline at end of file diff --git a/ilives/xsl/pageResults.xsl b/ilives/xsl/pageResults.xsl deleted file mode 100644 index e9476308..00000000 --- a/ilives/xsl/pageResults.xsl +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Total Hits = - - , - - -
        We have repeated your search within this book and found results on the following pages. - -
        - - - - -
        - -
        -
        - - - -
        - - - - - - - - - -
        -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fedora/ilives_book_viewer/ - - - - Thumbnail - - - - - fedora/repository/ - /TN - - - -
        - - - fedora/ilives_book_viewer/ - - - -
        -
        - - - - - - - -
        - - - - -   - - - - - - - -
        diff --git a/ilives/xsl/results.xsl b/ilives/xsl/results.xsl deleted file mode 100644 index c62fb169..00000000 --- a/ilives/xsl/results.xsl +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Total Hits = - - , - - Number of Hits/page = - - - -
        - -
        - - - - - - - - -
        - -
        - -

        Your search yielded no results

        - -
        -
          -
        • Check if your spelling is correct.
        • - -
        • Remove quotes around phrases to match each word individually: - "blue smurf" will match less than - blue smurf. -
        • -
        • Consider loosening your query with - OR: - blue smurf will match less than - blue OR smurf. -
        • -
        -
        - -
        - -
        -
        -
        - - - - -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - -
        - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fedora/ilives/ - / - - - - - - fedora/repository/ - /TN - - 100 - - - - - - - - - - - - - - - - fedora/ilives/ - / - - - - - - - - - - - - : - - - - - - - - - - - - / - - - - - - - - - - - - - - - - : - - - - - - - - , - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        From 4260762fc098e10cc0eecaa989183d8133c5b053 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Thu, 8 Sep 2011 00:24:20 +0100 Subject: [PATCH 026/247] Added set_datastream_state function. --- api/fedora_item.inc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 1ef687ec..683b31e6 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -1,11 +1,9 @@ resultList->objectFields); if (count($resultelements->resultList->objectFields) < $max_results - || count($resultelements->resultList->objectFields) == 0) { + || count($resultelements->resultList->objectFields) == 0) { $done = TRUE; } foreach ($resultelements->resultList->objectFields as $obj) { @@ -586,7 +584,7 @@ class Fedora_Item { // Verify the array format and that it isn't empty. if (!empty($relationships)) { $relsextxml = '' - . ''; + . ''; foreach ($relationships as $rel) { if (empty($rel['subject']) || empty($rel['predicate']) || empty($rel['object']) || $rel['subject'] != 'info:fedora/' . $this->pid) { @@ -800,6 +798,19 @@ class Fedora_Item { return self::soap_call('modifyDatastreamByValue', $params, $quiet); } + function set_datastream_state($dsid, $state, $log_message = 'Modified by Islandora API', $quiet = FALSE) { + $valid_states = array('A', 'D', 'I'); + if (key_exists($state, $valid_states)) { + $params = array( + 'pid' => $this->pid, + 'dsID' => $dsid, + 'dsState' => $state, + 'logMessage' => $log_message, + ); + return self::soap_call('setDatastreamState', $params, $quiet); + } + } + /** * Soap call * @param type $function_name @@ -826,6 +837,7 @@ class Fedora_Item { case 'purgeDatastream': case 'purgeObject': case 'modifyObject': + case 'setDatastreamState': $soap_client = self::$connection_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); try { if (!empty($soap_client)) { From 6ee39c150f357d7aae5477862edce870a1e34d87 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 8 Sep 2011 09:01:42 -0300 Subject: [PATCH 027/247] ISLANDORA-316: Fixed a naming bug --- fedora_repository.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index 83247bc2..41632fb1 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -757,7 +757,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU drupal_not_found(); } - if ($pid & !validPid($pid)) { + if ($pid & !valid_pid($pid)) { drupal_set_message(t("Invalid PID!"), 'error'); return ' '; } From 1681e031f3bd97c187a5ee752029c0aed2de992e Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Thu, 8 Sep 2011 13:32:13 +0100 Subject: [PATCH 028/247] Fixed datastream state check. --- api/fedora_item.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 683b31e6..07fa7ec2 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -800,7 +800,7 @@ class Fedora_Item { function set_datastream_state($dsid, $state, $log_message = 'Modified by Islandora API', $quiet = FALSE) { $valid_states = array('A', 'D', 'I'); - if (key_exists($state, $valid_states)) { + if (array_search($state, $valid_states) !== FALSE) { $params = array( 'pid' => $this->pid, 'dsID' => $dsid, From 956a1fc0237d138f00f4fcdd91c291c4fddb693a Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 8 Sep 2011 09:40:38 -0300 Subject: [PATCH 029/247] ISLANDORA-268: Added module install tests for xml, xslt and curl --- fedora_repository.install | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/fedora_repository.install b/fedora_repository.install index 27cd4ffe..82f182cc 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -41,6 +41,8 @@ function fedora_repository_requirements($phase) { $requirements = array(); if ($phase == 'install') { + + // Test for SOAP $requirements['fedora-soap']['title'] = t("PHP SOAP extension library"); if (!class_exists('SoapClient')) { $requirements['fedora-soap']['value'] = t("Not installed"); @@ -51,6 +53,43 @@ function fedora_repository_requirements($phase) { $requirements['fedora-soap']['value'] = t("Installed"); $requirements['fedora-soap']['severity'] = REQUIREMENT_OK; } + + // Test for Curl + $requirements['curl']['title'] = "PHP Curl extension library"; + if ( ! function_exists('curl_init') ) { + $requirements['curl']['value'] = t("Not installed"); + $requirements['curl']['severity'] = REQUIREMENT_ERROR; + $requirements['curl']['description'] = t("Ensure that the PHP Curl extension is installed."); + } + else { + $requirements['curl']['value'] = t("Installed"); + $requirements['curl']['serenity'] = REQUIREMENT_OK; + } + + // Test for DOM + $requirements['dom']['title'] = "PHP DOM XML extension library"; + if ( ! method_exists('DOMDocument', 'loadHTML') ) { + $requirements['dom']['value'] = t("Not installed"); + $requirements['dom']['severity'] = REQUIREMENT_ERROR; + $requirements['dom']['description'] = t("Ensure that the PHP DOM XML extension is installed."); + } + else { + $requirements['dom']['value'] = t("Installed"); + $requirements['dom']['serenity'] = REQUIREMENT_OK; + } + + // Test for XSLT + $requirements['xslt']['title'] = "PHP XSLT extension library"; + if ( ! function_exists('xslt_process') ) { + $requirements['xslt']['value'] = t("Not installed"); + $requirements['xslt']['severity'] = REQUIREMENT_ERROR; + $requirements['xslt']['description'] = t("Ensure that the PHP HMAC extension is installed."); + } + else { + $requirements['xslt']['value'] = t("Installed"); + $requirements['xslt']['serenity'] = REQUIREMENT_OK; + } + } elseif ($phase == 'runtime') { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); From a75de385b7afe1294627cb06444f465ba85001c7 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 8 Sep 2011 10:37:49 -0300 Subject: [PATCH 030/247] Added tests for Kakadu and ImageMagick --- fedora_repository.install | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/fedora_repository.install b/fedora_repository.install index 82f182cc..47ab7d3c 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -83,13 +83,37 @@ function fedora_repository_requirements($phase) { if ( ! function_exists('xslt_process') ) { $requirements['xslt']['value'] = t("Not installed"); $requirements['xslt']['severity'] = REQUIREMENT_ERROR; - $requirements['xslt']['description'] = t("Ensure that the PHP HMAC extension is installed."); + $requirements['xslt']['description'] = t("Ensure that the PHP XSLT extension is installed."); } else { $requirements['xslt']['value'] = t("Installed"); $requirements['xslt']['serenity'] = REQUIREMENT_OK; } + // Test for Imagick + $requirements['imagick']['title'] = t("Image Magick library"); + //if ( ! class_exists('Imagick') ) { + if ( ! file_exists('convert') ) { + $requirements['imagick']['value'] = t("Not installed"); + $requirements['imagick']['severity'] = REQUIREMENT_ERROR; + $requirements['imagick']['description'] = t('Ensure that the Image Magick library is installed.'); + } + else { + $requirements['imagick']['value'] = t("Installed"); + $requirements['imagick']['severity'] = REQUIREMENT_OK; + } + + // Test for Kakadu + $requirements['kakadu']['title'] = t("Kakadu library"); + if ( ! file_exists('kdu_compress') ) { + $requirements['kakadu']['value'] = t("Not installed"); + $requirements['kakadu']['severity'] = REQUIREMENT_ERROR; + $requirements['kakadu']['description'] = t('Ensure that the Kakadu library is installed.'); + } + else { + $requirements['kakadu']['value'] = t("Installed"); + $requirements['kakadu']['severity'] = REQUIREMENT_OK; + } } elseif ($phase == 'runtime') { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); From 20892604f3fdcdf46d32845a6116511a07cd2e65 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 8 Sep 2011 13:16:15 -0300 Subject: [PATCH 031/247] Added documentation tags to the class --- formClass.inc | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/formClass.inc b/formClass.inc index de19e04b..24ee6448 100644 --- a/formClass.inc +++ b/formClass.inc @@ -18,7 +18,8 @@ class formClass { } /** - * create the paths for urls and map them to php functions + * Create the paths for urls and map them to php functions + * @return array */ function createMenu() { $items = array(); @@ -194,6 +195,10 @@ class formClass { return $items; } + /** + * Create admin form + * @return type + */ function createAdminForm() { if (!user_access('administer site configuration')) { drupal_set_message(t('You must be a site administrator to edit the Fedora collecitons list.'), 'error'); @@ -384,6 +389,13 @@ class formClass { return system_settings_form($form); } + /** + * Update Metadata + * @param type $form_id + * @param type $form_values + * @param type $client + * @return type + */ function updateMetaData($form_id, $form_values, $client) { // ====================================== // = begin creation of foxml dom object = @@ -615,7 +627,12 @@ class formClass { return $this->createQDCIngestForm($collection_pid, $collection_label, $form_state); } - // this function may not be being used + /** + * this function may not be being used + * @param type $pid + * @param type $form_state + * @return string + */ function createAddDataStreamForm($pid, &$form_state) { //dump_vars($form_state); // Populate the list of datastream IDs. @@ -723,7 +740,7 @@ class formClass { } /** - * Create edit form. + * Create QDC Edit form. * * @param string $pid * @param string $dsid @@ -814,6 +831,11 @@ class formClass { /** * Creates a drupal form to edit either the QDC or DC datastream + * @param type $pid + * @param type $dsid + * @param type $client + * @param boolean $form_state + * @return type */ function createMetaDataForm($pid, $dsid, $client, &$form_state) { if (module_exists('islandora_content_model_forms')) { @@ -830,6 +852,11 @@ class formClass { /** * Creates a form for replacing datastream + * @param type $pid + * @param type $dsId + * @param type $dsLabel + * @param type $form_state + * @return type */ function createReplaceDataStreamForm($pid, $dsId, $dsLabel, &$form_state) { $form = array(); From 33f7e40156e0d76c050830f4de4ca0b1400bf21a Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Thu, 8 Sep 2011 19:32:39 +0100 Subject: [PATCH 032/247] ISLANDORA-317: fixed by checking the stuff. --- fedora_repository.module | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fedora_repository.module b/fedora_repository.module index 41632fb1..5372868f 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -751,6 +751,10 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); return ''; } + + if ($pid == NULL) { + $pid = variable_get('fedora_repository_pid', 'islandora:top'); + } $item = new fedora_item($pid); if (!$item->exists()) { From 36997226e6d7c999b3fe247af6230b383bff6bf7 Mon Sep 17 00:00:00 2001 From: jonathangreen Date: Fri, 9 Sep 2011 09:49:33 -0300 Subject: [PATCH 033/247] ISLANDORA-318 Updated the class in core which shows the detailed list of content. Renamed it from FedoraObject -> FedoraObjectDetailedContent. This will allow the new API to be used with the newest release of Islandora. --- fedora_repository.module | 4 ++-- ...edoraObject.inc => FedoraObjectDetailedContent.inc} | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) rename plugins/{fedoraObject.inc => FedoraObjectDetailedContent.inc} (86%) diff --git a/fedora_repository.module b/fedora_repository.module index 5372868f..884a801c 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -799,7 +799,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'plugins/fedoraObject'); + module_load_include('inc', 'fedora_repository', 'plugins/FedoraObjectDetailedContent'); $breadcrumbs = array(); $objectHelper->getBreadcrumbs($pid, $breadcrumbs); drupal_set_breadcrumb(array_reverse($breadcrumbs)); @@ -824,7 +824,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU } } // Add a 'manage object' tab for all objects, where detailed list of content is shown. - $obj = new FedoraObject($pid); + $obj = new FedoraObjectDetailedContent($pid); $object_details = $obj->showFieldSets(); $cmodels_tabs = array_merge($cmodels_tabs, $object_details); return tabs_render($cmodels_tabs); diff --git a/plugins/fedoraObject.inc b/plugins/FedoraObjectDetailedContent.inc similarity index 86% rename from plugins/fedoraObject.inc rename to plugins/FedoraObjectDetailedContent.inc index c5521242..855d508c 100644 --- a/plugins/fedoraObject.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -4,13 +4,15 @@ /** * @file - * FedoraObject class + * FedoraObjectDetailedContent class */ /** - * Fedora Object class ?? + * Fedora Object. This class is a plugin called from content models to display a detailed list of + * content of the Fedora Item. This is hard coded into Islandora core, and it can also be called + * from the IslandoraCM stream. */ -class FedoraObject { +class FedoraObjectDetailedContent { /** * Constructor @@ -70,4 +72,4 @@ class FedoraObject { return $tabset; } -} \ No newline at end of file +} From 5d865f19807f21d0670946958091c27035d039e4 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Fri, 9 Sep 2011 14:13:27 +0100 Subject: [PATCH 034/247] ISLANDORA-322: Can't Install Islandora with out XSLT (PHP4 extension) although XSLT is not used within islandora. (Fixed) --- fedora_repository.install | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fedora_repository.install b/fedora_repository.install index 47ab7d3c..86094893 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -78,18 +78,6 @@ function fedora_repository_requirements($phase) { $requirements['dom']['serenity'] = REQUIREMENT_OK; } - // Test for XSLT - $requirements['xslt']['title'] = "PHP XSLT extension library"; - if ( ! function_exists('xslt_process') ) { - $requirements['xslt']['value'] = t("Not installed"); - $requirements['xslt']['severity'] = REQUIREMENT_ERROR; - $requirements['xslt']['description'] = t("Ensure that the PHP XSLT extension is installed."); - } - else { - $requirements['xslt']['value'] = t("Installed"); - $requirements['xslt']['serenity'] = REQUIREMENT_OK; - } - // Test for Imagick $requirements['imagick']['title'] = t("Image Magick library"); //if ( ! class_exists('Imagick') ) { From 7e8f2f62c87a4b0ffb7ad3eab4749597d0740892 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Fri, 9 Sep 2011 14:26:31 +0100 Subject: [PATCH 035/247] ISLANDORA-322: Reopened ticket, added requirement that it test for a different xsl library. --- fedora_repository.install | 61 ++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/fedora_repository.install b/fedora_repository.install index 86094893..08c3e05f 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -1,7 +1,5 @@ collection settings are correct.', - array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); + $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the collection settings are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); } else { $requirements['fedora-repository']['value'] = t("Available"); From e56c7d85c8b19e0e9d7422669a5110e14f86b668 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Fri, 9 Sep 2011 13:14:43 -0300 Subject: [PATCH 036/247] ISLANDORA-323: Fixed naming --- SearchClass.inc | 5 ++++- tests/README_TESTING.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SearchClass.inc b/SearchClass.inc index 40334374..043a5e02 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -24,9 +24,12 @@ class SearchClass { */ function solr_search($query, $startPage=1, $fq = NULL, $dismax = NULL) { $solrFile = trim(variable_get('islandora_solr_search_block_handler_file', 'plugins/SolrResults.inc')); - if (strpos($solrField, '../')) { // Don't let us bust out of fedora_repository modules directory when looking for a handler + + // Don't let us bust out of fedora_repository modules directory when looking for a handler + if (strpos($solrField, '../')) { drupal_set_message(t('You have illegal characters in your solr handler function in the Islandora solr block config.'), 'error'); } + $solrClass = trim(variable_get('islandora_solr_search_block_handler_class', 'SolrResults')); $solrFunction = trim(variable_get('islandora_solr_search_block_handler_function', 'SearchAndDisplay')); require_once(drupal_get_path('module', 'fedora_repository') . '/' . $solrFile); diff --git a/tests/README_TESTING.txt b/tests/README_TESTING.txt index 18db5ba8..bd69c57e 100644 --- a/tests/README_TESTING.txt +++ b/tests/README_TESTING.txt @@ -2,7 +2,7 @@ There are a few things to set up to get the Simpletests to run properly. Fedora Installation -The test sets up the fedora_repository module with the default server settings. +The test sets up the islandora module with the default server settings. This means it will expect a Fedora server to be running on localhost:8080 with the usual defaults. The tests also expect the Islandora demo objects, i.e., islandora:top, islandora:demos collections, etc. to be installed. (Go to From 20ffe321d1c791247fd143d858382230cd009816 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Fri, 9 Sep 2011 18:19:18 +0100 Subject: [PATCH 037/247] ISLANDORA-322: fix the checks for convert and kdu_compress. --- fedora_repository.install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fedora_repository.install b/fedora_repository.install index 08c3e05f..d9b06b17 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -89,9 +89,9 @@ function fedora_repository_requirements($phase) { } // Test for Imagick + system("hash convert 2>&-", $return_value); $requirements['imagick']['title'] = t("Image Magick library"); - //if ( ! class_exists('Imagick') ) { - if (!file_exists('convert')) { + if ($return_value) { $requirements['imagick']['value'] = t("Not installed"); $requirements['imagick']['severity'] = REQUIREMENT_ERROR; $requirements['imagick']['description'] = t('Ensure that the Image Magick library is installed.'); @@ -102,8 +102,9 @@ function fedora_repository_requirements($phase) { } // Test for Kakadu + system("hash kdu_compress 2>&-", $return_value); $requirements['kakadu']['title'] = t("Kakadu library"); - if (!file_exists('kdu_compress')) { + if ($return_value) { $requirements['kakadu']['value'] = t("Not installed"); $requirements['kakadu']['severity'] = REQUIREMENT_ERROR; $requirements['kakadu']['description'] = t('Ensure that the Kakadu library is installed.'); From 4974e565b8f8c64ccfbb6c44db588b1d3247f3cd Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Mon, 12 Sep 2011 15:34:00 -0300 Subject: [PATCH 038/247] Removed spaces from .xslts --- xsl/results.xsl | 12 +++--------- xsl/sparql_to_html.xsl | 21 +++++---------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/xsl/results.xsl b/xsl/results.xsl index c697bf8e..bf165a12 100644 --- a/xsl/results.xsl +++ b/xsl/results.xsl @@ -199,9 +199,7 @@ - fedora/repository/ - /-/ - + fedora/repository//-/ - fedora/repository/ - /-/ - + fedora/repository//-/ @@ -253,9 +249,7 @@ - fedora/repository/ - /-/ - + fedora/repository//-/ diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index 43d9aeef..3743e1a7 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -42,10 +42,7 @@
      • - /fedora/repository/ - /-/ - / - + /fedora/repository//-// <Prev @@ -60,10 +57,7 @@
      • - /fedora/repository/ - /-/ - / - + /fedora/repository//-// Next> @@ -235,16 +229,12 @@ - /fedora/repository/ - /-/ - + /fedora/repository//-/ - /fedora/repository/ - /-/ - + /fedora/repository//-/ @@ -256,8 +246,7 @@ - /fedora/repository/ - /TN + /fedora/repository//TN From b5f1a87d30f6dfa3bb7de8afb0f5153ae8227638 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Mon, 12 Sep 2011 15:35:42 -0300 Subject: [PATCH 039/247] Added tab to create new child collections --- CollectionClass.inc | 234 ++++++++++++++++++++++++++++--------------- api/fedora_utils.inc | 77 +++++++++++++- 2 files changed, 228 insertions(+), 83 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index b486f2ce..70a273cd 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -1,18 +1,16 @@ collectionPolicyStream != NULL) { return $this->collectionPolicyStream; @@ -111,11 +104,6 @@ class CollectionClass { return $this->collectionPolicyStream; } - /** - * getRelationshipElement - * @param type $collection_pid - * @return type - */ function getRelationshipElement($collection_pid) { $stream = $this->getCollectionPolicyStream($collection_pid); try { @@ -128,35 +116,17 @@ class CollectionClass { return $relationship; } - /** - * getCollectionViewStream ?? - * @param type $collection_pid - * @return type - */ function getCollectionViewStream($collection_pid) { $this->collectionViewStream = $this->getStream($collection_pid, CollectionClass :: $COLLECTION_CLASS_COLLECTION_VIEW_STREAM, 0); return $this->collectionViewStream; } - /** - * getStream ?? - * @param type $pid - * @param type $dsid - * @param type $showError - * @return type - */ function getStream($pid, $dsid, $showError = 1) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new fedora_item($pid); return isset($item->datastreams[$dsid]) ? $item->get_datastream_dissemination($dsid) : NULL; } - /** - * getPidNameSpace ?? - * @param type $pid - * @param type $dsid - * @return type - */ function getPidNameSpace($pid, $dsid) { $stream = $this->getCollectionPolicyStream($pid); try { @@ -248,12 +218,6 @@ class CollectionClass { return NULL; } - /** - * getAllowedMimeType ?? - * @param type $contentModelPid - * @param type $contentModel_dsid - * @return type - */ function getAllowedMimeTypes($contentModelPid, $contentModel_dsid) { $stream = $this->getContentModelStream($contentModelPid, $contentModel_dsid); try { @@ -320,7 +284,7 @@ class CollectionClass { $thisClass = new $phpClass (); $returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext); if (!$returnValue) { - drupal_set_message(t('Error! Failed running content model method !m !rv'), array('!m' => $phpMethod, '!rv' => $returnValue)); + drupal_set_message('Error! Failed running content model method !m !rv', array('!m' => $phpMethod, '!rv' => $returnValue)); return FALSE; } } @@ -393,13 +357,8 @@ class CollectionClass { return $thisClass->$phpMethod($form, $ingest_form, $form_state['values'], $form_state); } - /** - * This will also create a personal collection for an existing user if they don't have one - * not using this function currently. - * - * @param type $user - * @return type - */ + //this will also create a personal collection for an existing user if they don't have one + //not using this function currently function createUserCollection(& $user) { if (isset($user->fedora_personal_pid)) { return; @@ -419,8 +378,8 @@ class CollectionClass { 'pidNamespace' => $pidNameSpace ); $object = $soapClient->__soapCall('getNextPID', array( - $params - )); + $params + )); } catch (exception $e) { drupal_set_message(t('Error getting Next PID: !e', array('!e' => $e->getMessage())), 'error'); return FALSE; @@ -434,7 +393,7 @@ class CollectionClass { module_load_include('inc', 'fedora_repository', 'plugins/PersonalCollectionClass'); $personalCollectionClass = new PersonalCollectionClass(); if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) { - drupal_set_message(t("Did not create a personal collection object for !u"), array('!u' => $user->name)); + drupal_set_message("Did not create a personal collection object for !u", array('!u' => $user->name)); return FALSE; //creation failed don't save the collection pid in drupal db } user_save($user, $personal_collection_pid); @@ -455,19 +414,10 @@ class CollectionClass { return $xslContent; } - /** - * showFieldSets ?? - * @global type $base_url - * @global type $user - * @param type $page_number - * @return string - */ 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); @@ -482,10 +432,16 @@ class CollectionClass { // 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(); + if (!$show_ingest_tab) { + $view_selected = true; + } + drupal_set_message(); + $tabset['view_tab'] = array( '#type' => 'tabpage', '#title' => 'View', + '#selected' => $view_selected, '#content' => $collection_items ); $tabset['add_tab'] = array( @@ -496,14 +452,17 @@ class CollectionClass { // This will be the content of the tab. '#content' => $add_to_collection, ); + + $tabset['add_collection_tab'] = array( + // #type and #title are the minimum requirements. + '#type' => 'tabpage', + '#title' => t('Add Child Collection'), + // This will be the content of the tab. + '#content' => drupal_get_form('collection_creation_form', $this->pid), + ); return $tabset; } - /** - * getIngestInterface ?? - * @global type $base_url - * @return string - */ function getIngestInterface() { global $base_url; $objectHelper = new ObjectHelper(); @@ -527,16 +486,6 @@ class CollectionClass { return $ingestObject; } - /** - * renderCOllection ?? - * @global type $base_url - * @param type $content - * @param type $pid - * @param type $dsId - * @param type $collection - * @param int $pageNumber - * @return type - */ function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { $path = drupal_get_path('module', 'fedora_repository'); global $base_url; @@ -605,3 +554,124 @@ class CollectionClass { } +function collection_creation_form(&$form_state, $parent_collection_pid) { + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + $restricted = FALSE; + if (variable_get('fedora_namespace_restriction_enforced', true)) { + $restricted = true; + $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); + $namespaces = explode(':', $allowed_string); + foreach ($namespaces as $namespace) { + if ($namespace) { + $allowed[trim($namespace)] = trim($namespace); + } + } + } + + $content_models = get_content_models_as_option_array(); + $form['titlebox'] = array( + '#type' => 'item', + '#value' => t("Create New Child Collection within $collection_pid"), + ); + + $form['collection_name'] = array( + '#title' => "Collection Name", + '#type' => 'textfield', + '#description' => t("Human readable name for this collection"), + ); + $form['collection_pid'] = array( + '#title' => "Collection PID", + '#type' => 'textfield', + '#size' => 15, + '#description' => t("Unique PID for this collection.
        Pids take the general form of namespace:collection eg islandora:pamphlets"), + ); + if (!$restricted) { + $form['collection_namespace'] = array( + '#title' => "Collection Namespace", + '#type' => 'textfield', + '#size' => 15, + '#default_value' => 'default', + '#description' => t("Namespace for objects in this collection."), + ); + } + else { + $form['collection_namespace'] = array( + '#title' => "Collection Namespace", + '#type' => 'select', + '#options' => $allowed, + '#default_value' => 'default', + '#description' => t("Namespace for objects in this collection."), + ); + } + $form['parent_collection'] = array( + '#type' => 'hidden', + '#value' => $parent_collection_pid, + ); + $form['all_content_models'] = array( + '#type' => 'hidden', + '#value' => implode('~~~',$content_models), + ); + + $form['content_models'] = array( + '#title' => "Choose allowable content models for this collection", + '#type' => 'checkboxes', + '#options' => $content_models, + '#description' => t("Content models describe the behaviours of objects with which they are associated."), + ); + + + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Submit') + ); + + + return($form); +} + +function collection_creation_form_validate($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $pid = $form_state['values']['collection_pid']; + $item = new fedora_item($pid); + if ($item->exists()) { + drupal_set_message("$pid already exists within your repository. the PID must be unique", 'warning'); + return; + } +} + +function collection_creation_form_submit($form, &$form_state) { + global $user; + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $module_path = drupal_get_path('module', 'fedora_repository'); + $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; + $collection_pid = $form_state['values']['collection_pid']; + $collection_name = $form_state['values']['collection_name']; + $parent_collection = $form_state['values']['parent_collection']; + $all_cModels = explode('~~~', $form_state['values']['all_content_models']); + $collection_policy = ' + + + + + + + isMemberOfCollection +'; + $content_models = $form_state['values']['content_models']; + $collection_policy_xml = simplexml_load_string($collection_policy); + foreach ($content_models as $content_model) { + if ($content_model) { + $node = $collection_policy_xml->content_models->addChild('content_model'); + $node->addAttribute('dsid', 'ISLANDORACM'); + $node->addAttribute('name', $all_cModels[$content_model]); + $node->addAttribute('namespace', $pid_namespace . '1'); + $node->addAttribute('pid', $content_model); + } + } + $item = fedora_item::ingest_new_item($collection_pid, 'A', $new_collections_label, $user->name); + $item->add_relationship('isMemberOfCollection', $parent_collection, RELS_EXT_URI); + $item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $item->add_datastream_from_string($collection_policy_xml->saveXML(), 'COLLECTION_POLICY'); + $item->add_datastream_from_file($thumbnail, 'TN'); + drupal_goto("/fedora/repository/$collection_pid"); +} \ No newline at end of file diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 1991e84c..6e7da113 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -6,7 +6,6 @@ * @file * Base utilities used by the Islandora fedora module. */ - /* * Functions that emulate php5.3 functionality for backwards compatiablity */ @@ -156,3 +155,79 @@ function fix_dsid($dsid) { return $new_dsid; } +/** + * Function: get_collections_as_option_array + * + * Description: Returns an associative array of all collection objects in Fedora instance + * + * @return array + */ +function get_collections_as_option_array() { + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + $query = 'select $object $title from <#ri> + where ($object $title + and $object + and $object ) + order by $title'; + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; + $content = do_curl($url . htmlentities(urlencode($query))); + $list = explode("\n", $content); + array_shift($list); + $list = preg_replace('/info:fedora\//', '', $list); + $options = array(); + foreach ($list as $item) { //removes blanks + if ($item) { + $parts = explode(',', $item); + $options[$parts[0]] = $parts[1]; + } + } + unset($options['islandora:ContentModelCollection']); + return $options; +} + +/** + * Function: get_content_models_as_option_array + * + * Description: Returns an associative array of all collection objects in Fedora instance + * + * @return array + */ +function get_content_models_as_option_array() { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + $restricted = variable_get('fedora_namespace_restriction_enforced', true); + $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); + $namespaces = explode(':', $allowed_string); + foreach ($namespaces as $namespace) { + if ($namespace) { + $allowed[] = trim($namespace); + } + } + $query = 'select $object $title from <#ri> + where ($object $title + and ($object + or $object ) + and $object ) + order by $title'; + + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; + $content = do_curl($url . htmlentities(urlencode($query))); + $list = explode("\n", $content); + array_shift($list); + $list = preg_replace('/info:fedora\//', '', $list); + foreach ($list as $item) { //removes blanks + if ($item) { + $parts = explode(',', $item); + $item = new fedora_item($parts[0]); + $nameparts = explode(':', $parts[0]); + if (!$restricted || in_array($nameparts[0], $allowed)) + if ($item->get_datastream_dissemination('ISLANDORACM')) { + $options[$parts[0]] = $parts[1]; + } + } + } + + return $options; +} \ No newline at end of file From d10b32e5752348d8fc163a0fc5738e4aa712e001 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Tue, 13 Sep 2011 13:14:55 -0300 Subject: [PATCH 040/247] fixed a typo --- fedora_repository.install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fedora_repository.install b/fedora_repository.install index 08c3e05f..0116b053 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -61,7 +61,7 @@ function fedora_repository_requirements($phase) { } else { $requirements['curl']['value'] = t("Installed"); - $requirements['curl']['serenity'] = REQUIREMENT_OK; + $requirements['curl']['severity'] = REQUIREMENT_OK; } // Test for DOM @@ -73,7 +73,7 @@ function fedora_repository_requirements($phase) { } else { $requirements['dom']['value'] = t("Installed"); - $requirements['dom']['serenity'] = REQUIREMENT_OK; + $requirements['dom']['severity'] = REQUIREMENT_OK; } // Test for XSLT @@ -85,7 +85,7 @@ function fedora_repository_requirements($phase) { } else { $requirements['xslt']['value'] = t("Installed"); - $requirements['xslt']['serenity'] = REQUIREMENT_OK; + $requirements['xslt']['severity'] = REQUIREMENT_OK; } // Test for Imagick @@ -154,4 +154,4 @@ function fedora_repository_requirements($phase) { } return $requirements; -} \ No newline at end of file +} From 84361d72845b1c7a49db038a47b2ca5ffae9eaf6 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Tue, 13 Sep 2011 15:25:32 -0300 Subject: [PATCH 041/247] added more documentation --- api/fedora_item.inc | 4 ---- api/fedora_utils.inc | 20 +++++++++----------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 07fa7ec2..06f65698 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -2,10 +2,6 @@ /** * @file - * - */ -/** - * @file * Fedora Item */ define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#'); diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 1991e84c..0bbd110f 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -7,11 +7,17 @@ * Base utilities used by the Islandora fedora module. */ -/* - * Functions that emulate php5.3 functionality for backwards compatiablity - */ if (!function_exists('str_getcsv')) { + /** + * Functions that emulate php5.3 functionality for backwards compatiablity + * @param type $input + * @param type $delimiter + * @param type $enclosure + * @param type $escape + * @param type $eol + * @return type + */ function str_getcsv($input, $delimiter=',', $enclosure='"', $escape=NULL, $eol=NULL) { $temp = fopen("php://memory", "rw"); fwrite($temp, $input); @@ -23,14 +29,6 @@ if (!function_exists('str_getcsv')) { } -/* - * Functions that emulate php5.3 functionality for backwards compatiablity - */ - -/* - * Static functions used by the Fedora PHP API. - */ - /** * do curl * @global type $user From c72a6a7d2f8fd5922e7317b347afb2ec1e37fa4d Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 12:48:48 -0300 Subject: [PATCH 042/247] Added documentation back in --- CollectionClass.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index c00164fe..eabfad80 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -38,8 +38,12 @@ class CollectionClass { /** * gets objects related to this object. must include offset and limit * calls getRelatedItems but enforces limit and offset + * @param type $pid + * @param type $limit + * @param type $offset + * @param type $itqlquery + * @return type */ - function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); @@ -249,7 +253,7 @@ class CollectionClass { } /** - * + * get Allowed Mime Types * @param type $contentModelPid * @param type $contentModel_dsid * @return type From edde1243a147868cfc86ac799de4bd8a60bb4f47 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 13:02:41 -0300 Subject: [PATCH 043/247] Fixed documentation --- CollectionClass.inc | 61 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index eabfad80..921bd4fd 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -57,6 +57,12 @@ class CollectionClass { /** * Gets objects related to this item. It will query the object for a Query stream and use that as a itql query * or if there is no query stream it will use the default. If you pass a query to this method it will use the passed in query no matter what + * @global type $user + * @param type $pid + * @param type $itqlquery + * @param int $limit + * @param int $offset + * @return type */ function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -103,7 +109,7 @@ class CollectionClass { } /** - * + * get Collection Policy Stream ? * @param type $collection_pid * @return type */ @@ -116,7 +122,7 @@ class CollectionClass { } /** - * + * get Relationship element ? * @param type $collection_pid * @return type */ @@ -133,7 +139,7 @@ class CollectionClass { } /** - * + * get Collection View Stream ? * @param type $collection_pid * @return type */ @@ -143,7 +149,7 @@ class CollectionClass { } /** - * + * get Stream ? * @param type $pid * @param type $dsid * @param type $showError @@ -156,7 +162,7 @@ class CollectionClass { } /** - * + * get Pid name space ? * @param type $pid * @param type $dsid * @return type @@ -182,6 +188,9 @@ class CollectionClass { /** * gets a list of content models from a collection policy + * @param type $collection_pid + * @param type $showError + * @return ContentModel */ function getContentModels($collection_pid, $showError = TRUE) { module_load_include('inc', 'Fedora_Repository', 'ContentModel'); @@ -275,6 +284,12 @@ class CollectionClass { /** * Grabs the rules from the content model stream * file the file that has been uploaded + * + * @param type $file + * @param type $mimetype + * @param type $pid + * @param type $dsid + * @return type */ function getAndDoRules($file, $mimetype, $pid, $dsid) { if (!user_access('ingest new fedora objects')) { @@ -302,6 +317,10 @@ class CollectionClass { /** * calls the methods defined in the content model rules .xml file stored in a Fedora object + * + * @param type $file + * @param type $methods + * @return type */ function callMethods($file, $methods) { foreach ($methods as $method) { @@ -334,6 +353,12 @@ class CollectionClass { /** * grabs a xml form definition from a content model and builds * the form using drupals forms api + * + * @param type $form + * @param type $form_state + * @param type $contentModelPid + * @param type $contentModelDsid + * @return type */ function build_ingest_form(&$form, &$form_state, $contentModelPid, $contentModelDsid) { $stream = $this->getContentModelStream($contentModelPid, $contentModelDsid); @@ -400,6 +425,7 @@ class CollectionClass { /** * this will also create a personal collection for an existing user if they don't have one * not using this function currently + * * @param type $user * @return type */ @@ -447,6 +473,11 @@ class CollectionClass { /** * Queries a collection object for an xslt to format how the * collection of objects is displayed. + * + * @param type $pid + * @param type $path + * @param type $canUseDefault + * @return type */ function getXslContent($pid, $path, $canUseDefault = TRUE) { module_load_include('inc', 'fedora_repository', 'CollectionClass'); @@ -459,7 +490,7 @@ class CollectionClass { } /** - * + * show field sets ? * @global type $base_url * @global type $user * @param type $page_number @@ -515,7 +546,7 @@ class CollectionClass { } /** - * + * get Ingest Interface ?? * @global type $base_url * @return string */ @@ -542,6 +573,16 @@ class CollectionClass { return $ingestObject; } + /** + * render collection + * @global type $base_url + * @param type $content + * @param type $pid + * @param type $dsId + * @param type $collection + * @param int $pageNumber + * @return type + */ function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { $path = drupal_get_path('module', 'fedora_repository'); global $base_url; @@ -611,7 +652,7 @@ class CollectionClass { } /** - * + * collection creation form ? * @param type $form_state * @param type $parent_collection_pid * @return type @@ -692,7 +733,7 @@ function collection_creation_form(&$form_state, $parent_collection_pid) { } /** - * + * collection creation form validate ? * @param type $form * @param type $form_state * @return type @@ -708,7 +749,7 @@ function collection_creation_form_validate($form, &$form_state) { } /** - * + * collection creation form submit * @global type $user * @param type $form * @param type $form_state From cfae7317a31ec1fcb63707f1656c3f35c6657fab Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 13:26:41 -0300 Subject: [PATCH 044/247] Deleted fedora attach, newspaper and pidfield --- plugins/fedora_attach/fedora_attach.admin.inc | 36 -- plugins/fedora_attach/fedora_attach.info | 8 - plugins/fedora_attach/fedora_attach.install | 14 - plugins/fedora_attach/fedora_attach.module | 487 ------------------ .../Crystal_Clear_mimetype_document.png | Bin 4847 -> 0 bytes plugins/islandora_newspaper/Newspaper.inc | 177 ------- .../islandora_newspaper.info | 7 - .../islandora_newspaper.module | 63 --- .../newspapers_collection_policy.xml | 22 - .../newspapers_guardian.xml | 379 -------------- .../newspapers_issueCModel_islandoracm.xml | 25 - .../newspapers_pageCModel.xml | 149 ------ .../newspapers_viewerSdep-issueCModel.xml | 241 --------- .../newspapers_viewerSdep-pageCModel.xml | 217 -------- plugins/pidfield/pidfield.info | 8 - plugins/pidfield/pidfield.install | 40 -- plugins/pidfield/pidfield.module | 459 ----------------- 17 files changed, 2332 deletions(-) delete mode 100644 plugins/fedora_attach/fedora_attach.admin.inc delete mode 100644 plugins/fedora_attach/fedora_attach.info delete mode 100644 plugins/fedora_attach/fedora_attach.install delete mode 100644 plugins/fedora_attach/fedora_attach.module delete mode 100644 plugins/islandora_newspaper/Crystal_Clear_mimetype_document.png delete mode 100644 plugins/islandora_newspaper/Newspaper.inc delete mode 100644 plugins/islandora_newspaper/islandora_newspaper.info delete mode 100644 plugins/islandora_newspaper/islandora_newspaper.module delete mode 100644 plugins/islandora_newspaper/newspapers_collection_policy.xml delete mode 100644 plugins/islandora_newspaper/newspapers_guardian.xml delete mode 100644 plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml delete mode 100644 plugins/islandora_newspaper/newspapers_pageCModel.xml delete mode 100644 plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml delete mode 100644 plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml delete mode 100644 plugins/pidfield/pidfield.info delete mode 100644 plugins/pidfield/pidfield.install delete mode 100644 plugins/pidfield/pidfield.module diff --git a/plugins/fedora_attach/fedora_attach.admin.inc b/plugins/fedora_attach/fedora_attach.admin.inc deleted file mode 100644 index 5dbd3a57..00000000 --- a/plugins/fedora_attach/fedora_attach.admin.inc +++ /dev/null @@ -1,36 +0,0 @@ - 'select', - '#title' => t('Fedora Attach PID namespace'), - '#options' => $options, - '#default_value' => $default_value, - '#description' => t('The PID namespace into which the Fedora Attach module will ingest objects.'), - ); - return (system_settings_form($form)); -} - diff --git a/plugins/fedora_attach/fedora_attach.info b/plugins/fedora_attach/fedora_attach.info deleted file mode 100644 index fc1c2aa7..00000000 --- a/plugins/fedora_attach/fedora_attach.info +++ /dev/null @@ -1,8 +0,0 @@ -; $Id$ -name = Fedora Attach -description = Allows users to attach files to node content which then get ingested into Fedora. -package = Fedora Repository -dependencies[] = fedora_repository -dependencies[] = upload -version = 6.1dev -core = 6.x diff --git a/plugins/fedora_attach/fedora_attach.install b/plugins/fedora_attach/fedora_attach.install deleted file mode 100644 index 15a28628..00000000 --- a/plugins/fedora_attach/fedora_attach.install +++ /dev/null @@ -1,14 +0,0 @@ -files)) { - foreach ($node->files as $fid => $file) { - $file = (object) $file; // Convert file to object type for compatibility. - $fid = $file->fid; // For the cases where we have temp fid for uplaoded files. - $success = FALSE; - $filepath = $file->filepath; // Need copy if file_move fails. - $public = file_directory_path(); - - $file_is_ingested = _fedora_attach_is_file_in_repository($filepath); - if (!empty($file->ingested) && !$file_is_ingested) { - // Attach flag is set, but file is not listed as being in the repository. - // so try and ingest it now. - if (user_access('select file access by role')) { - $roles = array(); - if (!empty($file->roles)) { - foreach ($file->roles as $rolename => $rolevalue) { - if (!empty($rolevalue)) { - array_push($roles, $rolevalue); - } - } - } - // if (!empty($roles)) { - // Generate the security policy datastream. - $policy_stream = _fedora_attach_create_policy($roles); - // } - } - try { - $pid_namespace = variable_get('fedora_attach_pid_namespace', 'default:'); - $pid_namespace = substr($pid_namespace, 0, strpos($pid_namespace, ":")); - $pid = fedora_item::get_next_PID_in_namespace($pid_namespace); - $new_item = fedora_item::ingest_new_item($pid, 'A', $file->description); // PID will be generated using getNextPID - if (empty($new_item->objectProfile)) { - drupal_set_message("Unable to create fedora object. Check Watchdog log for details.", "error"); - $success = FALSE; - } - else { - if (user_access('select file access by role')) { - $new_item->add_datastream_from_string($policy_stream, 'POLICY', "Security Policy", "text/xml", "X"); - } - $new_item->add_datastream_from_file($file->filepath, 'OBJ', $file->filename, $file->filemime, 'M'); - $new_item->add_relationship("hasModel", "islandora:genericCModel", FEDORA_MODEL_URI); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - $dc = new Dublin_Core(); - $dc->add_element('dc:title', $file->description); - $dc->add_element('dc:identifier', $new_item->pid); - - $new_item->modify_datastream_by_value($dc->as_xml(), 'DC', 'Default Dublin Core Metadata', 'text/xml', 'X'); - - $success = TRUE; - } - } catch (exception $e) { - drupal_set_message(t('An error occurred ingesting the file: ') . $e, 'error'); - $new_item->purge(); - drupal_set_message(t('The item has been removed from the repository')); - } - if ($success) { // We were able to ingest the file, so update the file path. - $new_filepath = '/fedora/repository/' . $new_item->pid . '/OBJ/' . $file->description; - _fedora_attach_update_filepath($new_filepath, $fid); - file_delete($filepath); - } - } - // Convert file to object for compatibility - // Remove file. Process removals first since no further processing - // will be required. - if (!empty($file->remove)) { - - // If the file isn't used by any other revisions warn the user. - $count = db_result(db_query('SELECT COUNT(fid) FROM {upload} WHERE fid = %d', $fid)); - if ($count < 1) { - file_delete($file->filepath); - db_query('DELETE FROM {files} WHERE fid = %d', $fid); - } - - // Remove it from the session in the case of new uploads, - // that you want to disassociate before node submission. - unset($node->files[$fid]); - // Move on, so the removed file won't be added to new revisions. - continue; - } - } - } - } - break; - case 'view': - // ****************************************************** - // *** VIEW - // Re-theme the file attachments table. - // Rebuild the files table and overwrite default. - // Using the rules from upload.module. - if (isset($node->files) && count($node->files) && user_access('view uploaded files') && !$teaser) { - $node->content['files']['#value'] = theme('fedora_attach_attachments', $node->files); - } - break; - } -} - -/** - * Implementation of hook_menu(). - */ -function fedora_attach_menu() { - $items['admin/settings/fedora_repository/attach'] = array( - 'title' => 'Fedora Attach', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('fedora_attach_admin'), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'fedora_attach.admin.inc', - ); - return $items; -} - -function fedora_attach_save(&$node) { - print ("FNARF!"); -} - -/** - * Implements hook_form_alter() - * - * Add a 'add to repository' checkbox to the file attach form. - * - * @param unknown_type $form - * @param unknown_type $form_state - * @param unknown_type $form_id - * Two paths, one for normal submit, one for JavaScript - */ -function fedora_attach_form_alter(&$form, $form_state, $form_id) { - $disabled = TRUE; - global $base_url; - if (isset($form['type'])) { - $node = $form['#node']; - if ($form['type']['#value'] . '_node_form' == $form_id && variable_get("upload_$node->type", TRUE)) { - $form['#submit'][] = 'fedora_attach_form_submit'; - if (!empty($node->files) && is_array($node->files) && count($node->files)) { // Hijack theme function. - $form['attachments']['wrapper']['files']['#theme'] = 'fedora_attach_form'; - $form['#validate']['private_upload_form_validate'] = array(); - foreach ($node->files as $fid => $file) { - - // Add ingest checkbox - if (is_array($file) && isset($file['ingest'])) { // Preview - $default_value = $file['ingest']; - } - else { // Node load - $default_value = _fedora_attach_is_file_in_repository($file->filepath); - $disabled = $default_value; - } - - $form['attachments']['wrapper']['files'][$fid]['ingested'] = array( - '#type' => 'checkbox', - '#default_value' => $default_value, - '#disabled' => $disabled, - ); - $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url . $file->filepath; - } - if (user_access('select file access by role')) { - _fedora_attach_build_roles_form($form, FALSE); - } - } - } - } - elseif ($form_id == 'upload_js') { - $form['files']['#theme'] = 'fedora_attach_form'; - - foreach ($form['files'] as $fid => $file) { - - if (!_fedora_attach_starts_with($fid, '#')) {// Ignore properties. - if (!empty($_POST['files'][$fid])) { - $ingested = (!empty($_POST['files'][$fid]['ingested']) ? $_POST['files'][$fid]['ingested'] : FALSE); - //$form['files'][$fid]['list']['#default_value'] = (!empty($_POST['files'][$fid]['[$_POST['files'][$fid]['list']; - //$form['files'][$fid]['remove']['#default_value'] = $_POST['files'][$fid]['remove']; - } - else { - $ingested = (variable_get('fedora_attach_default', 'ingested') == 'ingested'); - } - $form['files'][$fid]['ingested'] = array( - '#type' => 'checkbox', - '#default_value' => $ingested, - ); - - $form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url . $file['filepath']; - if (user_access('select file access by role')) { - _fedora_attach_build_roles_form($form, TRUE); - } - } - } - } -} - -/** - * Called to validate the attach form. - * - * @param string $formid - * @param array $form_values - */ -function fedora_attach_form_validate($formid, $form_values) { - if (is_array($form_values['files']) && count($form_values['files'])) { - $file = array_shift($form_values['files']); - if (!isset($file['ingested'])) { - drupal_set_message(t('Fedora Attach cannot find add repository settings.'), 'error'); - // Be sure we are going after core upload module - $upload_weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'upload'")); - $attach_weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'fedora_attach'")); - if ($attach_weight <= $uplaod_weight) { - $new_weight = $upload_weight + 1; - drupal_set_message(t('Adjusting Fedora Attach module\'s weight to') . $new_weight, 'warning'); - db_query("UPDATE {system} SET weight = '%d' WHERE name = 'fedora_attach'", $new_weight); - ; - } - else { - drupal_set_message(t('Please check for modules that conflict with Fedora Attach'), 'error'); - } - } - } -} - -/** - * Fixes edge case: When the node is first being created, the file->private info does not - * get moved automatically into the node. So we need to copy it by hand. - * - * @param array $form - * @param array $form_state - */ -function fedora_attach_form_submit($form, &$form_state) { - global $base_url; - if ($form_state['values'] && $form_state['values']['files']) { - - foreach ($form_state['values']['files'] as $fid => $file) { - if ($file['remove'] && !empty($file['ingested']) && $file['ingested']) { - drupal_set_message("The attachment ${file['filename']} was removed from this node but it will remain in the repository until it is purged it directly."); - } - if (!isset($file->ingested)) { // Newly-inserted file. - if (isset($form['attachments']['wrapper']['files'])) { - // I know it is naughty to look at the $_POST, but I can't find this value anywhere else. - // Seems like it should be in $form_state somewhere. - $ingested = !empty($_POST['files'][$fid]['ingested']); - } - else { - $ingested = (variable_get('fedora_attach_ingested', 'ingested') == 'ingested'); // Submit before attach - } - $form_state['values']['files'][$fid]['ingested'] = $ingested; - } - $form_state['values']['files'][$fid]['roles'] = (!empty($_POST['files']['roles']) ? $_POST['files']['roles'] : array()); - } - } -} - -// ***************************************************************************** -// Theme functions *********************************************************** -// ***************************************************************************** - -/** - * hook_theme = Theme registry - * - * @return array - */ -function fedora_attach_theme() { - return array( - 'fedora_attach_form' => array( - 'arguments' => array('form' => NULL), - ), - 'fedora_attach_attachments' => array( - 'arguments' => array('files' => NULL), - ), - ); -} - -/** - * Based on theme_upload_form_current - * Adds the Ingest checkbox. - * - * @param array $form - */ -function theme_fedora_attach_form(&$form) { - $header = array(t('Delete'), t('List'), t('Add to Repository'), t('Label'), t('Weight'), t('Size'), ''); - drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); - - foreach (element_children($form) as $key) { - // Add class to group weight fields for drag and drop. - $form[$key]['weight']['#attributes']['class'] = 'upload-weight'; - - $row = array(); - $row[] = drupal_render($form[$key]['remove']); - $row[] = drupal_render($form[$key]['list']); - $row[] = drupal_render($form[$key]['ingested']); - $row[] = drupal_render($form[$key]['description']); - $row[] = drupal_render($form[$key]['weight']); - $row[] = drupal_render($form[$key]['size']); - $row[] = drupal_render($form[$key]['msg']); - $rows[] = array('data' => $row, 'class' => 'draggable'); - } - $output = theme('table', $header, $rows, array('id' => 'upload-attachments')); - $output .= drupal_render($form); - return $output; -} - -/** - * Displays file attachments in table. - * - * @param array $files - */ -function theme_fedora_attach_attachments($files) { - $header = array(t('Attachment'), t('Size')); - $rows = array(); - if (is_array($files)) { - foreach ($files as $file) { - $file = (object) $file; - if ($file->list && empty($file->remove)) { - $inspect_item = ''; - if (_fedora_attach_is_file_in_repository($file->filepath)) { - $inspect_item = ' ' . theme_image(drupal_get_path('module', 'Fedora_Repository') . '/images/view.gif', '', 'View the item\'s repository page') . ''; - } - $href = _fedora_attach_create_url($file); // this is the changed line - $text = $file->description ? $file->description : $file->filename; - $rows[] = array(l($text, $href) . $inspect_item, format_size($file->filesize)); - } - } - if (count($rows)) { - return theme('table', $header, $rows, array('id' => 'attachments')); - } - } -} - -function _fedora_attach_build_roles_form(&$form, $inside_js = FALSE) { - //$result = db_query("SELECT {name} from {role}"); - global $user; - //while ($role = db_fetch_array($result)) { - foreach ($user->roles as $role) { - if ($role != 'anonymous user') { - $roles[] = $role; - } - } - if (empty($roles)) { - return ''; - } - $new_form_elements = array( - '#type' => 'checkboxes', - '#title' => t('Roles which can view the attached items'), - '#options' => array_combine($roles, $roles), - '#description' => t('This only applies to files which you add to the repository. If no roles are checked the item will be public.'), - ); - - if ($inside_js) { - $form['files']['roles'] = $new_form_elements; - } - else { - $form['attachments']['wrapper']['roles'] = $new_form_elements; - } -// var_dump($form['files']); - //return $output; -} - -function _fedora_attach_create_policy($roles) { - $policy_filename = !empty($roles) ? drupal_get_path('module', 'fedora_repository') . '/policies/viewANDeditbyrole.xml' : drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml'; - $policy_document = new DOMDocument(); - $policy_document->load($policy_filename); - $designators = $policy_document->getElementsByTagName("SubjectAttributeDesignator"); - - if (!empty($designators)) { - foreach ($designators as $designator) { - if ($designator->hasAttribute("AttributeId")) { - if ($designator->getAttribute('AttributeId') == 'fedoraRole') { - foreach ($roles as $role) { - //$apply = $designator->nextSibling; - foreach ($designator->parentNode->childNodes as $apply) { - if ($apply->nodeName == "Apply") { - $new_role_node = $policy_document->createElement('AttributeValue', $role); - $new_role_node->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); - $apply->appendChild($new_role_node); - } - } - } - } - elseif ($designator->getAttribute('AttributeId') == 'urn:fedora:names:fedora:2.1:subject:loginId') { - // $apply = $designator->nextSibling; - foreach ($designator->parentNode->childNodes as $apply) { - if ($apply->nodeName == "Apply") { - global $user; - $new_user_node = $policy_document->createElement('AttributeValue', $user->name); - $new_user_node->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); - $apply->appendChild($new_user_node); - } - } - } - } - } - } - return $policy_document->saveXML(); -} - -function fedora_attach_file_download($filepath) { - // Pass through if this isn't a repository item. - if (!strstr($filepath, 'fedora/repository')) { - return; - } - $result = db_query("SELECT DISTINCT(u.nid) FROM {upload} u INNER JOIN {files} f ON u.fid = f.fid " . - "WHERE f.filepath LIKE '%s'", $filepath . '%'); - $has_results = FALSE; - while ($row = db_fetch_array($result)) { - $has_results = TRUE; - $node = node_load($row['nid']); - if (node_access('view', $node)) { - return; // Access is ok as far as we are concerned. - } - } - if ($has_results) { - return -1; - } - else { - return; - } -} - -/** - * Create a URL to a file that changes if the file is in the repository. - * - * @param file object $file - * @return str: the correct URL - */ -function _fedora_attach_create_url($file) { - if (_fedora_attach_is_file_in_repository($file->filepath)) { - $href = $GLOBALS['base_url'] . $file->filepath; - } - else { - $href = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path()))); - } - return $href; -} - -/** - * Checks if the file path references a file in the repository. - * - * @param string $filepath - * @return boolean - */ -function _fedora_attach_is_file_in_repository($filepath) { - $repository_path = '/fedora/repository'; - $is_in = _fedora_attach_starts_with($filepath, $repository_path); - return $is_in; -} - -function _fedora_attach_starts_with($str, $start) { - if (count($str) == 0) { // Avoid FALSE positives. - return FALSE; - } - return strstr($str, $start) == $str; -} - -/** - * Alters the file's path in the files table to point to the repository datastream. - * - * @param string $filepath - * @param int $fid - */ -function _fedora_attach_update_filepath($filepath, $fid) { - db_query("UPDATE {files} SET filepath = '%s' WHERE fid=%d", $filepath, $fid); -} diff --git a/plugins/islandora_newspaper/Crystal_Clear_mimetype_document.png b/plugins/islandora_newspaper/Crystal_Clear_mimetype_document.png deleted file mode 100644 index f61fec3f64eace89ba6ee95097e3c27205d49f95..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4847 zcmV1to76T^6s1YiDymfVOQn8j z)DQcit=uN6*8Ng%`ytv{=!Yey$wF&;7bLUHc(oYg7;q?NjDWEg%*bX518B{_jx!lv z1cNIWfe_1xQiP?`|MNfR-g#kwnYr__6Z_G<=iYOkb2-oNJm)#*-nlcjEX#V%dVcoh z4>o31xQa5RCRAK4KKRk^S)Z~h`tLdG(?frkP>1SimE}OK0m16W@BXRvJX%$;f6rSl z#hz5(e33)71X=v}%C{+?dmOc2uy82l~5&V+%8nEq64swff6sPM=C_GKWb z6o9yjVV^A0r1*(>ab9&RL(2w`-v2x3`x%t&K+8t(lgMBEdN~mQz=qS@Ue&Au*e8P&6S}b13&_43(qB{v|u2OUSp&>L`2f%s;z!ZRb&JFc6y4i$8TVG;^1|R`2jJz-b zZ1G(5jtJmw&KM}^2qq98MoW$$3xG5}<^;e1eIn?@?M~#?vs4?{$+^G_ zjR1Q$r7wZ+q647UnE{@%UL1d?2LL7!1c%hEGywAqk+~7f0zpu{Ut$CRuvVe9Uv>~Y z%vc550PY;qv=KxMfP)$JU*nFz+!a0wAq8Nk6Y06jUiGZBobp^_m0fTgN> zzCZc39?geK#0HX%J~A(=g%a8{z=-0@Ucm7Ds7_*V!_+MoH#}5b##8 z5?I8z--8E;56p1+ls|$I_1`WL06?n8LR{cV8ZzrOFVh&8NTMP4cS+`4WEwEbrGPO! z#57JbW%budPx3NX-$Q!MLffwfkVdfx8X^Ea2fg;gb>Y^8d4&+Kz^18z zjZW5^L;p=?O@;}zsW#L)1LzurADR+*3{fLnrT{>Ep^b`p-VoQD4vQA@*a~(Rs>Hr>8sH z16qhKMh*RhNg(U11(~~s5&dCK0O?+^+$He;|1x_z=n`5^U#@6*4M3H zt}y^X4wz0QFX?n6+RLJ76_a0^dY4|%t8QS(jH&lw-gOR|Nu&bemTHB6-Qt;iptdIf zz6pD33xJm~LgIzQf&;7zC(xUNnBVWx3$7w}1_7=I6P*txuEXHV^oMThbaM`hV?neB zG(`fKKL%h53(RuJ)G+{Y&JQu;4O0k*LwrYM9{nyuVG_PDi<)BqbVp5NI83NM^_U>~ z;QE88B~fA)wMqzJq<}swoo?=rOIOsBw0S|t1d*t7w80p#4>UClAdrUOG5R|-C)oE0 z8bS(0x-8jKsdt6>?m(>qZ>ttlQra=`8**C6bS^p7MMDT z0GC9szJ+oAW6TTh6T-WY4{^)v$JsX0cU2dLz#<~V0qWNrfFl~c$L9iT*e3v_hd2(g ztXW|^7(+;$z)Y|R5Uc7YJYW~AzB$y~K^kNXSVI^*tW5yfk^m0-_%P!gGA;7}p(8^| z1VIA&*OcL0wTl@2u*Rc3=1C80tu=0<8+2BKlH*k$bE>of+^anRUP{pH2e<@kW+)Um@*2&Nc~zsC z&l0`nv05|W$ZI!~2#qVX4M0C)^YYPHGqx5kgre;K7KTG9jZ$-s0a8pC06hqR-B>g~ zb^weN3t*~h0M;CrUNf$)!{MG80tu7q?-3lCK$sw)RrLJ^%-<;wfXb``+{i(O2!P>I z0;uFluoyWkC4kAA1CVXL25{FM09kDxnB~y0N%N6%>7FM0$HWzYi5dfNZ~_4TvjHHN z`Ogr5+~#Wl1H}S(SVI8zD+M5bxml2QIeK42zWsd1Er28uhzuT^W=@uJ=^mHlDdGx1 zu*v`)pIL7kOW~BU%lu&eIDr1z1Tcx4njLkYcXc}$B(mMdvE)nwjyx-RtZt+3ePjN= z@=RX4SXS5hb!(RZ#;XWm2PSm$SzkNOhH-Z%TQ^L;&b$p(k9~+AiT(pkmE%opBKK7t z_WF_75wO%CfCHF!5oWdn!T~`%#x`tn1j-fl&osIY0PeHD8{q?kstx(Kanxu49M&p; zv*fxlF_{qsma}pMKyR@C#t2~l69!-gfp7oBsGl7MrRA;x?D0Y(cMFgk1!-r`-w`!| zZ3uCGNR6ok`g=%CQ{I8Qcko@n4)k}2n&*QOIom+m#=I%i8Dze+yr+}^#`Bh21?V0J zFbgwgVQd6jH;f-gDiE&Iyg|5sow@`w8*wg%j^TU?X&sHPL$9~F2QXSi01=oi5SB2B zO~3;#!>DnXI|!MF^dc1$jfAm>{U!QB8%x_*ssSYBHM!aYkSQxPU%wi0T;@;6cMag) zCkDX2WBlNWrY^%Pa+ln42OwD`0CoJvKqK70j?R7wCbp^b2z8fe>IU7v4f{s=KqK6imBuxIUE@mf3iSQFo<{*;js`!$z6Wi3f-*mj_4fmIu}S$= z?EO6U8}oNc3n2eH{H_9Ya{!T3)Y1-c?t+)a(a1220$p+sVd!_*_6%XLf z&k2C`XBoh{T71?4#8g|c0Qw1F*Li2J7A0O901eohvG-ugdKJ^kH5|+Sfs?bU&OzrI zH4`}YFujJ&16f6F(bjd&;ru-7^+UhaG_{{cqS3D+#|+We_n@Q!$EyVZh^njZ0o;TE z{RTh-jY-h#2PUT#rRP)tIn4$@YX*RuEbBJ_&ZEZ54uESYn;~QmYn(S%Y-Nq}sH^eF z^*!bq=TSp`e(yZ4QAPl_9RLwDcoj{OMN5ElzVUy@A@-pfiK|9$xV#_HzA%xxT)Zhu3eV-pw-r$nS}?xCfA+ zSu^;v;(if`Hc+3h(gZ1=p?j=sLu z)Frm|=>Qgr2he*)5R9CdfA$!SoOzYAOv_J}0N`zR0OW?k2WRV2)2a!_5hIeTQxOkC zSCHjRNE@IXQ6sFC(($MjM`s#kE7<#(jZ&!BE;f zL*(1TB?0gX4D>;!X_}7>_Hi_)0QgYWMKgmqZsJelijK$Vyh1du!ay0tLF$i~T0U+~ z=2|P<%U|*^!0Ixs6J%Y{>&F#G&H%8e!s@M30BB`HJp>Tsk@kyoIGc6=1dW!Y{nYe9 zqY2HNroM-Df(`(WG08{cTA|rR!&(U`NX;f*tCi^{HTCs3dEKUR0_br7M9?P@$9>a} zrqQ?+y6JS9){1i+F^;=Q{b@S=3I~fWpLVpgt9Maz+UTwjT#z{{)X{aO+4B+Rp9SEN zy5b(drZd`CoDscgnwXuNDcSkin#b#@w)o@{p|mUqa&V?9tJ(ew@wFe*&P76rSzy} z>|cR&v4LHxkEwjJ`wC1NXUH4I@i@P-+=sjcb-@HT31)VQj9}68u%wG)y2XUJK58_f z-U7=#)M(+c$OZHFeM~plE??U3MdXqwrqiMU+;RX6!-zii>o}vlZiWWnVXoc8VK%Lc zI=bQGZ0-f>Y;Y6v`e<~Q(U4>L3w_jRp}vpvz%Y&)933AzLh80Kt_XmQGXaFuCHDaG zmj(WyNiJD7K46P4N8N=I{GH)i|)CA`F|Y8c3MpUZ@LAruG%pYZ{tFPSXN%Z{e6}rT@>L`YS8; z+uO;sU-q+Ke$k)D$3y7}oIP=4csS;pT{ zZ>fJuSpQ;uweX+S{hamt*2~Xb`Sa+@8?`KdGG{ed-?o0&`b?n!e$o1p^)2fkt$OQ+ z)_>NhG+RHgUbFtz`nvVS!hc%(dF!**Zz6d7we|PbcdYN$q({Io3;%KT z=YZfd)~{N>WBsA^m70}5uzt(>g7reN|H;Cq;5aWL8oX4q@;Mm)3zhsY+kbBU{XY`6 VLE}14Da-%>002ovPDHLkV1h?o;kN() diff --git a/plugins/islandora_newspaper/Newspaper.inc b/plugins/islandora_newspaper/Newspaper.inc deleted file mode 100644 index 5f5212e8..00000000 --- a/plugins/islandora_newspaper/Newspaper.inc +++ /dev/null @@ -1,177 +0,0 @@ -pid = $pid; - $this->item = new Fedora_Item($pid); - } - } - - public function buildDrupalForm($form = array(), $ingest_form = array(), &$form_state = array()) { - - // Give the user an option to enter a custom PID - $form['custom_pid'] = array( - '#type' => 'textfield', - '#title' => 'Custom PID', - '#description' => 'If you want to manually specify the PID for the new object, enter it here. ' . - 'Leave it blank for an automatically-generated PID.', - ); - - $form['mods'] = array( - '#tree' => TRUE, - '#prefix' => '
        ', - '#suffix' => '
        ', - ); - $form['mods']['mods_record'] = array( - '#type' => 'textarea', - '#title' => 'MODS Record to Import', - '#rows' => 20, - ); - - return $form; - } - - public function handleIngestForm($form_values, &$form_state) { - /* - * process the metadata form - * Create fedora object - * Add the datastreams - */ - module_load_include('inc', 'fedora_repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_ilives', 'book'); - $mods_list_doc = new DomDocument(); - $mods_list_doc->loadXML($form_values['mods']['mods_record']); - $mods_item_doc = new DomDocument(); - $mods_item = $mods_list_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'mods')->item(0); - $new_mods_item = $mods_item_doc->importNode($mods_item, TRUE); - $mods_item_doc->appendChild($new_mods_item); - - $title_info = $mods_item_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'titleInfo')->item(0); - $title = ''; - foreach (array('nonSort', 'title') as $title_field) { - $title .= $title_info->getElementsByTagNameNS('http://www.loc.gov/mods/v3', $title_field)->item(0)->nodeValue; - } - - $mods_text = $mods_item_doc->saveXML(); - global $user; - $mimetype = new MimeClass(); - - $new_item = Fedora_Item::ingest_new_item(!empty($form_values['custom_pid']) ? $form_values['custom_pid'] : $form_values['pid'], 'A', $title, - $user->name); - - $new_item->add_datastream_from_string($mods_text, 'MODS', - 'MODS Metadata', 'text/xml', 'X'); - - $dc = transform_mods_to_dc($mods_text); - if ($dc) { - // Add the PID to a dc:identifier field. - $dc_doc = simplexml_load_string($dc); - $dc_doc->registerXPathNamespace('oai_dc', 'http://www.openarchives.org/OAI/2.0/oai_dc/'); - $dc_item = $dc_doc->xpath('//oai_dc:dc'); - foreach ($dc_item as $node) { - $node->addChild('dc:identifier', $new_item->pid, 'http://purl.org/dc/elements/1.1/'); - } - $new_item->modify_datastream_by_value($dc_doc->saveXML(), 'DC', 'Dublin Core XML Metadata', 'text/xml'); - } - $new_item->add_relationship('hasModel', $form_values['content_model_pid'], FEDORA_MODEL_URI); - $new_item->add_relationship(!empty($form_values['relationship']) ? $form_values['relationship'] : 'isMemberOfCollection', $form_values['collection_pid']); - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($new_item->pid, 'fedora/repository/' . $new_item->pid))), "status"); - } - - public function showFieldSets() { - module_load_include('inc', 'fedora_ilives', 'book'); - global $base_url; - - $tabset = array(); - - $tabset = array( - '#type' => 'tabset', - ); - - global $user; - $qs = ''; - if ($user->uid != 0) { - $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); - } - - $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; - $html = ''; - - $tabset['read'] = array( - '#type' => 'tabpage', - '#title' => t('Read'), - '#weight' => -1, - '#content' => $html - ); - - $item = new Fedora_Item($this->pid); - - $tabset['description'] = array( - '#type' => 'tabpage', - '#title' => 'Description', - '#content' => $item->get_dissemination('islandora:mods2htmlSdef', 'mods2html'), - ); - $tabset['add_pages'] = array( - '#type' => 'tabpage', - '#title' => t('Add pages'), - '#content' => drupal_get_form('book_add_pages_form', $this->pid, 'newspapers:pageCModel', 'isPartOf'), - ); - return $tabset; - } - - public function showPageFieldSets() { - - global $base_url; - - $tabset = array(); - - $tabset = array( - '#type' => 'tabset', - ); - - global $user; - $qs = ''; - if ($user->uid != 0) { - $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); - } - - $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; - $html = ''; - - $tabset['first_tab'] = array( - '#type' => 'tabpage', - '#title' => t('Read'), - '#content' => $html - ); - - $item = new Fedora_Item($this->pid); - - // Get this page's parent item to show the issue's metadata. - $rels = $item->get_relationships(); - $parent_pid = ''; - foreach ($rels as $rel) { - if (strstr($rel['predicate'], 'isPartOf')) { - $parent_pid = $rel['object']; - break; - } - } - $parent_item = new Fedora_Item($parent_pid); - $tabset['second_tab'] = array( - '#type' => 'tabpage', - '#title' => 'Description', - '#content' => $parent_item->get_dissemination('islandora:mods2htmlSdef', 'mods2html'), - ); - - return $tabset; - } - -} diff --git a/plugins/islandora_newspaper/islandora_newspaper.info b/plugins/islandora_newspaper/islandora_newspaper.info deleted file mode 100644 index bbc884a2..00000000 --- a/plugins/islandora_newspaper/islandora_newspaper.info +++ /dev/null @@ -1,7 +0,0 @@ -; $Id$ -name = Islandora Newspaper -description = Content models and support code for Newspapers -package = Fedora Repository -dependencies[] = fedora_repository -version = 6.1dev -core = 6.x diff --git a/plugins/islandora_newspaper/islandora_newspaper.module b/plugins/islandora_newspaper/islandora_newspaper.module deleted file mode 100644 index 03e67e66..00000000 --- a/plugins/islandora_newspaper/islandora_newspaper.module +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'module' => 'islandora_newspaper', - 'title' => 'Islandora Newspaper', - 'objects' => array( - array( - //'foxml_file' => "$module_path/newspapers_issueCModel.xml", - 'pid' => 'newspapers:issueCModel', - 'dsid' => 'ISLANDORACM', - 'cmodel' => 'fedora-system:ContentModel-3.0', - 'datastream_file' => "$module_path/newspapers_issueCModel_islandoracm.xml", - 'dsversion' => 2, - ), - array( - 'foxml_file' => "$module_path/newspapers_pageCModel.xml", - 'pid' => 'newspapers:pageCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/newspapers_viewerSdep-issueCModel.xml", - 'pid' => 'newspapers:viewerSdep-issueCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'foxml_file' => "$module_path/newspapers_viewerSdep-pageCModel.xml", - 'pid' => 'newspapers:viewerSdep-pageCModel', - 'dsid' => NULL, - 'datastream_file' => NULL, - 'dsversion' => NULL, - ), - array( - 'pid' => 'newspapers:collection', - 'label' => 'Newspapers Collection', - 'cmodel' => 'islandora:collectionCModel', - 'parent' => 'islandora:demos', - 'datastreams' => array( - array( - 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/newspapers_collection_policy.xml", - ), - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/Crystal_Clear_mimetype_document.png", - 'mimetype' => 'image/png', - ), - ), - ), - ), - ), - ); -} \ No newline at end of file diff --git a/plugins/islandora_newspaper/newspapers_collection_policy.xml b/plugins/islandora_newspaper/newspapers_collection_policy.xml deleted file mode 100644 index 86f1027e..00000000 --- a/plugins/islandora_newspaper/newspapers_collection_policy.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - 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 - - isMemberOfCollection - diff --git a/plugins/islandora_newspaper/newspapers_guardian.xml b/plugins/islandora_newspaper/newspapers_guardian.xml deleted file mode 100644 index a198db9c..00000000 --- a/plugins/islandora_newspaper/newspapers_guardian.xml +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - - - - - - - - - - modifyDatastreamByValue - MODS - fedoraAdmin - 2010-05-28T18:38:36.223Z - - - - - ingest - - fedoraAdmin - 2010-05-31T15:14:58.313Z - Ingested from local file /Users/al/Desktop/newspapers_guardian.xml - - - - - - - - - - This is an object-specific policy. It could be stored inside the digital object in the POLICY datastream OR in the directory for object-specific policies. (The directory location is set in the Authorization module configuration in the Fedora server configuration file (fedora.fcfg). By using multiple policy Rules, this policy shows how to deny access to all raw datastreams in the object except to particular users (e.g., the object owners). It also shows how to deny access to a particular disseminations to selected user roles. - - - - - - - - - - - urn:fedora:names:fedora:2.1:action:id-ingest - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByReference - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByValue - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-modifyDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeObject - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeDatastream - - - - - - urn:fedora:names:fedora:2.1:action:id-purgeDisseminator - - - - - - urn:fedora:names:fedora:2.1:action:id-setDatastreamState - - - - - - urn:fedora:names:fedora:2.1:action:id-setDisseminatorState - - - - - - urn:fedora:names:fedora:2.1:action:id-setDatastreamVersionable - - - - - - urn:fedora:names:fedora:2.1:action:id-addDatastream - - - - - - urn:fedora:names:fedora:2.1:action:id-addDisseminator - - - - - - - - - - - - administrator - - - - - - fedoraAdmin - - - - - - - - - - - - - - - - - - - - The Guardian - Guardian (Charlottetown, P.E.I.) - The Island guardian - The Charlottetown guardian - The Morning guardian - Newspapers - Newspapers - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. - - The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. - - .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - - Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - Hood, J. P. - 1887-1920 - Text - v. - microfilm - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - newspapers:guardian - eng - Prince Edward Island - Charlottetown (P.E.I.) - - - - - - - - - - The - Guardian - - - Guardian (Charlottetown, P.E.I.) - - - The - Island guardian - - - The - Charlottetown guardian - - - The - Morning guardian - - - Hood, J. P. - - - Manager - - - Business Manager from Dec. 29, 1891 - Mar. 9, 1903; Managing Director from July 2, 1912 - Jan. 30, 1913. - - - text - - - pic - - - Charlottetown, P.E.I - - 1887-1920 - 1887 - 1920 - continuing - - - eng - - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. - - The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. - - .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - - - microfilm -
        microform
        - v. -
        - Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - - Prince Edward Island - Newspapers - - - Charlottetown (P.E.I.) - Newspapers - - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - - CaPCU - 760913 - 20090407151822.0 - -
        -
        -
        - - - - - The - Guardian - - - Guardian (Charlottetown, P.E.I.) - - - The - Island guardian - - - The - Charlottetown guardian - - - The - Morning guardian - - - Hood, J. P. - - - Manager - - - Business Manager from Dec. 29, 1891 - Mar. 9, 1903; Managing Director from July 2, 1912 - Jan. 30, 1913. - - - text - - - pic - - - Charlottetown, P.E.I - - 1887-1920 - 1887 - 1920 - continuing - - - eng - - The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian. - - The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade. - - .... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers. - - -
        microfilm
        -
        microform
        - v. -
        - Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian. - Ceased publication in 1920? - Missing issues. - Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels. - - Prince Edward Island - Newspapers - - - Charlottetown (P.E.I.) - Newspapers - - http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634 - - CaPCU - 760913 - 20090407151822.0 - -
        -
        -
        -
        - - - - - - - - - - - - -
        diff --git a/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml b/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml deleted file mode 100644 index 3346fec8..00000000 --- a/plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - text/xml - - - - text/xml - - - - - - - - - - - - - - - - - diff --git a/plugins/islandora_newspaper/newspapers_pageCModel.xml b/plugins/islandora_newspaper/newspapers_pageCModel.xml deleted file mode 100644 index 00364347..00000000 --- a/plugins/islandora_newspaper/newspapers_pageCModel.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-05-28T19:37:09.514Z - Created with Admin GUI "New Object" command - - - - ingest - - fedoraAdmin - 2010-05-31T15:15:26.657Z - Ingested from local file /Users/al/Desktop/newspapers_pageCModel.xml - - - - ingest - - fedoraAdmin - 2010-06-01T13:22:40.275Z - Ingested from local file /Users/aoneill/fedora_repository/plugins/newspaper/newspapers_pageCModel.xml - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-06-21T16:26:53.809Z - DatastreamsPane generated this logMessage. - - - - ingest - - fedoraAdmin - 2010-06-21T19:39:20.139Z - Ingested from source repository with pid newspapers:pageCModel - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - -
        - - - - - - - - - - Newspaper Page Content Model - newspapers:pageCModel - - - - - - - - - - - - - plugins/Newspaper.inc - Newspaper - showPageFieldSets - - - - - - - - - - - - plugins/Newspaper.inc - Newspaper - buildEditMetadataForm - - - plugins/Newspaper.inc - Newspaper - handleEditMetadataForm - - - - - - - diff --git a/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml b/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml deleted file mode 100644 index d2879675..00000000 --- a/plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-05-31T20:54:30.053Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2010-05-31T20:55:13.521Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-05-31T20:55:35.100Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2010-05-31T20:55:59.039Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-31T20:57:54.728Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-05-31T20:59:03.704Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This METHODMAP datastream is included as a starting point to - assist in the creation of a service deployment. The METHODMAP - should define the the mapping of the WSDL to Fedora object methods. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This DSINPUTSPEC datastream is included as a starting point to - assist in the creation of a service deployment. The DSINPUTSPEC - should define the datastreams to be used by WSDL-defined methods. - - - - - - - - DC - text/xml - - - - - - - - - - - This WSDL datastream is included as a starting point to - assist in the creation of a service deployment. The WSDL - should define the services provided by this - service deployment. - For more information about service deployments, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed service deployment objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:2, demo:13, demo:20, and demo:28. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Viewer service deployment for Newspaper content model - newspapers:viewerSdep-issueCModel - - - - - diff --git a/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml b/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml deleted file mode 100644 index 46908d60..00000000 --- a/plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-06-21T17:47:30.096Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-21T17:49:00.674Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-06-21T17:50:01.411Z - - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2010-06-21T17:50:23.252Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2010-06-21T17:51:49.022Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This METHODMAP datastream is included as a starting point to - assist in the creation of a service deployment. The METHODMAP - should define the the mapping of the WSDL to Fedora object methods. - - - - - - - - - - - - - - - - - - - - - - This DSINPUTSPEC datastream is included as a starting point to - assist in the creation of a service deployment. The DSINPUTSPEC - should define the datastreams to be used by WSDL-defined methods. - - - - - - - - DC - text/xml - - - - - - - - - - - This WSDL datastream is included as a starting point to - assist in the creation of a service deployment. The WSDL - should define the services provided by this - service deployment. - For more information about service deployments, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed service deployment objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:2, demo:13, demo:20, and demo:28. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Viewer for newspaper pages - newspapers:viewerSdep-pageCModel - - - - - diff --git a/plugins/pidfield/pidfield.info b/plugins/pidfield/pidfield.info deleted file mode 100644 index e7b9d96f..00000000 --- a/plugins/pidfield/pidfield.info +++ /dev/null @@ -1,8 +0,0 @@ -; $Id$ -name = PID Field -description = Defines a field type for referencing a Fedora item from a node. -dependencies[] = content -dependencies[] = fedora_repository -package = Fedora Repository -core = 6.x - diff --git a/plugins/pidfield/pidfield.install b/plugins/pidfield/pidfield.install deleted file mode 100644 index 1ce6a073..00000000 --- a/plugins/pidfield/pidfield.install +++ /dev/null @@ -1,40 +0,0 @@ - array( - // The human-readable label of the field that will be - // seen in the Manage fields screen. - 'label' => t('Fedora PID field'), - // A description of what type of data the field stores. - 'description' => t('Store a reference to a PID in this site\'s Fedora repository.'), - // An icon to use in Panels. - 'content_icon' => 'icon_content_text.png', - ), - ); -} - -/** - * Implementation of hook_field_settings(). - */ -function pidfield_field_settings($op, $field) { - switch ($op) { - // Create the form element to be used on the field - // settings form. Field settings will be the same for - // all shared instances of the same field and should - // define the way the value will be stored - // in the database. - case 'form': - $form = array(); - $form['max_length'] = array( - '#type' => 'textfield', - '#title' => t('Maximum length'), - '#default_value' => is_numeric($field['max_length']) ? $field['max_length'] : 64, - '#required' => FALSE, - // Use #element_validate to validate the settings. - '#element_validate' => array('_pidfield_length_validate'), - '#description' => t('The maximum length of the field in characters. Must be a number between 1 and 255'), - ); - return $form; - - // Return an array of the names of the field settings - // defined by this module. These are the items that - // CCK will store in the field definition - // and they will be available in the $field array. - // This should match the items defined in 'form' above. - case 'save': - return array('max_length'); - - // Define the database storage for this field using - // the same construct used by schema API. Most fields - // have only one column, but there can be any number - // of different columns. After the schema API values, - // add two optional values to each column, - // 'views', to define a Views field - // 'sortable', to add a Views sort field - case 'database columns': - $columns['value'] = array( - 'type' => 'varchar', - 'length' => is_numeric($field['max_length']) ? $field['max_length'] : 64, - 'not null' => FALSE, - 'sortable' => TRUE, - 'views' => TRUE, - ); - return $columns; - - // Optional: Make changes to the default $data array - // created for Views. Omit this if no changes are - // needed, use it to add a custom handler or make - // other changes. - case 'views data': - // Start with the $data created by CCK - // and alter it as needed. The following - // code illustrates how you would retrieve - // the necessary data. - $data = content_views_field_views_data($field); - $db_info = content_database_info($field); - $table_alias = content_views_tablename($field); - $field_data = $data[$table_alias][$field['field_name'] . '_value']; - // Make changes to $data as needed here. - return $data; - } -} - -/** - * Custom validation of settings values. - * - * Create callbacks like this to do settings validation. - */ -function _pidfield_length_validate($element, &$form_state) { - $value = $form_state['values']['max_length']; - if ($value && !is_numeric($value) || $value < 1 || $value > 255) { - form_set_error('max_length', t('"Max length" must be a number between 1 and 64.')); - } -} - -/** - * Implementation of hook_field(). - */ -function pidfield_field($op, &$node, $field, &$items, $teaser, $page) { - switch ($op) { - // Do validation on the field values here. The widget - // will do its own validation and you cannot make any - // assumptions about what kind of widget has been used, - // so don't validate widget values, only field values. - case 'validate': - if (is_array($items)) { - foreach ($items as $delta => $item) { - // The error_element is needed so that CCK can - // set an error on the right sub-element when - // fields are deeply nested in the form. - $error_element = isset($item['_error_element']) ? $item['_error_element'] : ''; - if (is_array($item) && isset($item['_error_element'])) - unset($item['_error_element']); - if (!empty($item['value'])) { - if (!empty($field['max_length']) && drupal_strlen($item['value']) > $field['max_length']) { - form_set_error($error_element, t('%name: the value may not be longer than %max characters.', array('%name' => $field['widget']['label'], '%max' => $field['max_length']))); - } - } - } - } - return $items; - - // This is where you make sure that user-provided - // data is sanitized before being displayed. - case 'sanitize': - foreach ($items as $delta => $item) { - $pid_field_text = check_plain($item['value']); - $items[$delta]['safe'] = $pid_field_text; - } - } -} - -/** - * Implementation of hook_content_is_empty(). - * - * CCK has no way to know if something like a zero is - * an empty value or a valid value, so return - * TRUE or FALSE to a populated field $item array. - * CCK uses this to remove empty multi-value elements - * from forms. - */ -function pidfield_content_is_empty($item, $field) { - if (empty($item['value'])) { - return TRUE; - } - return FALSE; -} - -/** - * Implementation of hook content_generate(). - * - * Optional, provide dummy value for nodes created - * by the Devel Generate module. - */ -function pidfield_content_generate($node, $field) { - $node_field = array(); - // Generate a value that respects max_length. - if (empty($field['max_length'])) { - $field['max_length'] = 12; - } - $node_field['value'] = user_password($field['max_length']); - return $node_field; -} - -/** - * Implementation of hook_token_list() - * and hook_token_values(). - * - * Optional, provide token values for this field. - */ -function pidfield_token_list($type = 'all') { - if ($type == 'field' || $type == 'all') { - $tokens = array(); - - $tokens['pidfield']['raw'] = t('Just the PID itself.'); - $tokens['pidfield']['formatted'] = t('A PID with a hyperlink'); - - return $tokens; - } -} - -function pidfield_token_values($type, $object = NULL) { - if ($type == 'field') { - $item = $object[0]; - - $tokens['raw'] = $item['value']; - $tokens['formatted'] = isset($item['view']) ? $item['view'] : ''; - return $tokens; - } -} - -//==========================================// -// DEFINING A FORMATTER -//==========================================// - -/** - * Implementation of hook_theme(). - */ -function pidfield_theme() { - return array( - // Themes for the formatters. - 'pidfield_formatter_default' => array( - 'arguments' => array('element' => NULL), - ), - 'pidfield_formatter_plain' => array( - 'arguments' => array('element' => NULL), - ), - ); -} - -/** - * Implementation of hook_field_formatter_info(). - * - * All fields should have a 'default' formatter. - * Any number of other formatters can be defined as well. - * It's nice for there always to be a 'plain' option - * for the raw value, but that is not required. - * - */ -function pidfield_field_formatter_info() { - return array( - // The machine name of the formatter. - 'default' => array( - // The human-readable label shown on the Display - // fields screen. - 'label' => t('Default'), - // An array of the field types this formatter - // can be used on. - 'field types' => array('pidfield'), - // CONTENT_HANDLE_CORE: CCK will pass the formatter - // a single value. - // CONTENT_HANDLE_MODULE: CCK will pass the formatter - // an array of all the values. None of CCK's core - // formatters use multiple values, that is an option - // available to other modules that want it. - 'multiple values' => CONTENT_HANDLE_CORE, - ), - 'plain' => array( - 'label' => t('Plain text'), - 'field types' => array('pidfield'), - 'multiple values' => CONTENT_HANDLE_CORE, - ), - ); -} - -/** - * Theme function for 'default' example field formatter. - * - * $element['#item']: the sanitized $delta value for the item, - * $element['#field_name']: the field name, - * $element['#type_name']: the $node->type, - * $element['#formatter']: the $formatter_name, - * $element'#node']: the $node, - * $element['#delta']: the delta of this item, like '0', - * - */ -function theme_pidfield_formatter_default($element) { - $pid = $element['#item']['safe']; - if (!empty($pid)) { - return fedora_repository_get_items($pid); - } - return null; -} - -/** - * Theme function for 'plain' example field formatter. - */ -function theme_pidfield_formatter_plain($element) { - return strip_tags($element['#item']['safe']); -} - -//==========================================// -// DEFINING A WIDGET -//==========================================// - -/** - * Implementation of hook_widget_info(). - * - * Here we indicate that the content module will handle - * the default value and multiple values for these widgets. - * - * Callbacks can be omitted if default handing is used. - * They're included here just so this module can be used - * as an example for custom modules that might do things - * differently. - */ -function pidfield_widget_info() { - return array( - // The machine name of the widget, no more than 32 - // characters. - 'pidfield_widget' => array( - // The human-readable label of the field that will be - // seen in the Manage fields screen. - 'label' => t('PID Field widget'), - // An array of the field types this widget can be - // used with. - 'field types' => array('pidfield'), - // Who will handle multiple values, default is core. - // 'CONTENT_HANDLE_MODULE' means the module does it. - // See optionwidgets for an example of a module that - // handles its own multiple values. - 'multiple values' => CONTENT_HANDLE_CORE, - 'callbacks' => array( - // Who will create the default value, default is core. - // 'CONTENT_CALLBACK_CUSTOM' means the module does it. - // 'CONTENT_CALLBACK_NONE' means this widget has - // no default value. - 'default value' => CONTENT_CALLBACK_DEFAULT, - ), - ), - ); -} - -/** - * Implementation of hook_widget_settings(). - */ -function pidfield_widget_settings($op, $widget) { - switch ($op) { - // Create the form element to be used on the widget - // settings form. Widget settings can be different - // for each shared instance of the same field and - // should define the way the value is displayed to - // the user in the edit form for that content type. - case 'form': - $form = array(); - $size = (isset($widget['size']) && is_numeric($widget['size'])) ? $widget['size'] : 60; - $form['size'] = array( - '#type' => 'textfield', - '#title' => t('Size of textfield'), - '#default_value' => $size, - '#element_validate' => array('_element_validate_integer_positive'), - '#required' => TRUE, - ); - return $form; - - // Return an array of the names of the widget settings - // defined by this module. These are the items that - // CCK will store in the widget definition and they - // will be available in the $field['widget'] array. - // This should match the items defined in 'form' above. - case 'save': - return array('size'); - } -} - -/** - * Implementation of hook_widget(). - * - * Attach a single form element to the form. - * - * CCK core fields only add a stub element and builds - * the complete item in #process so reusable elements - * created by hook_elements can be plugged into any - * module that provides valid $field information. - * - * Custom widgets that don't care about using hook_elements - * can be built out completely at this time. - * - * If there are multiple values for this field and CCK is - * handling multiple values, the content module will call - * this function as many times as needed. - * - * @param $form - * the entire form array, - * $form['#node'] holds node information - * @param $form_state - * the form_state, - * $form_state['values'][$field['field_name']] - * holds the field's form values. - * @param $field - * the field array - * @param $items - * array of default values for this field - * @param $delta - * the order of this item in the array of - * subelements (0, 1, 2, etc) - * - * @return - * the form item for a single element for this field - */ -function pidfield_widget(&$form, &$form_state, $field, $items, $delta = 0) { - - $element['value'] = array( - '#type' => 'textfield', - '#title' => $field['widget']['label'], - '#default_value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : NULL, - '#autocomplete_path' => $element['#autocomplete_path'], - '#size' => !empty($field['widget']['size']) ? $field['widget']['size'] : 60, - '#attributes' => array('class' => 'pidfield'), - '#maxlength' => !empty($field['max_length']) ? $field['max_length'] : NULL, - ); - - // Used so that hook_field('validate') knows where to - // flag an error in deeply nested forms. - if (empty($form['#parents'])) { - $form['#parents'] = array(); - } - $element['_error_element'] = array( - '#type' => 'value', - '#value' => implode('][', array_merge($form['#parents'], array('value'))), - ); - - return $element; -} - -function get_node_references_for_fedora_item($item) { - $result = db_query("SELECT * - FROM {content_node_field} nf - INNER JOIN {content_node_field_instance} ni ON nf.field_name = ni.field_name - WHERE nf.type = 'pidfield'"); - while ($field = db_fetch_array($result)) { - - - $db_info = content_database_info($field); - - - - - - $ids = db_query("SELECT nid FROM {" . $db_info['table'] . "} WHERE " . $field['field_name'] . "_value=\"" . $item->pid . "\""); - - $results = array(); - while ($data = db_fetch_object($ids)) { - //$additions[] = node_load($data->vid); - - $results[] = $data->nid; - - //$referred_node = node_load(array('nid'=>$data->nid) ); - } - return $results; - } -} - -function fedora_pidfield_redirect_to_node($item) { - $node_references = get_node_references_for_fedora_item($item); - if (!empty($node_references)) { - if (strstr(drupal_get_destination(), urlencode('fedora/repository'))) { - drupal_goto(drupal_get_path_alias("node/" . $node_references[0])); - } - } -} \ No newline at end of file From fe062d14efa6dc9dc0ccfa1f91d2e3a9fa65f807 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 14:04:37 -0300 Subject: [PATCH 045/247] fixed documentation --- api/fedora_collection.inc | 2 - fedora_repository.module | 360 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 345 insertions(+), 17 deletions(-) diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index d2e07601..16659c7f 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -1,7 +1,5 @@ createIngestForm($collection_pid, $collection_label, $form_state); } +/** + * fedora repository purge object form + * @global type $base_url + * @param type $form_state + * @param type $pid + * @param type $referrer + * @return type + */ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { global $base_url; if (!user_access('purge objects and datastreams')) { @@ -285,6 +330,12 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NUL return $form; } +/** + * add stream + * @param type $collection_pid + * @param type $collectionName + * @return type + */ function add_stream($collection_pid=NULL, $collectionName=NULL) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!valid_pid($collection_pid)) { @@ -304,6 +355,13 @@ function add_stream($collection_pid=NULL, $collectionName=NULL) { return $output; } +/** + * add stream form submit + * @global type $base_url + * @param type $form + * @param type $form_state + * @return type + */ function add_stream_form_submit($form, &$form_state) { global $base_url; if (!empty($form_state['submit']) && $form_state['submit'] == 'OK') { @@ -348,12 +406,24 @@ function add_stream_form_submit($form, &$form_state) { $form_state['rebuild'] = TRUE; } +/** + * add stream form + * @param type $form_state + * @param type $pid + * @return type + */ function add_stream_form(&$form_state, $pid) { module_load_include('inc', 'fedora_repository', 'formClass'); $addDataStreamForm = new formClass(); return $addDataStreamForm->createAddDataStreamForm($pid, $form_state); } +/** + * add stream form validate + * @param type $form + * @param type $form_state + * @return type + */ function add_stream_form_validate($form, &$form_state) { if ($form_state['clicked_button']['#value'] == 'OK') { $form_state['rebuild'] = TRUE; @@ -392,6 +462,14 @@ function add_stream_form_validate($form, &$form_state) { $form_state['rebuild'] = FALSE; } +/** + * fedora repository purge stream + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $name + * @return type + */ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); global $user; @@ -412,6 +490,12 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) return $output; } +/** + * fedora repository purge object form submit + * @param type $form + * @param type $form_state + * @return type + */ function fedora_repository_purge_object_form_submit($form, &$form_state) { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $pid = $form_state['values']['pid']; @@ -454,6 +538,13 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { } } +/** + * fedora repository purge stream form + * @param type $form_state + * @param type $pid + * @param type $dsId + * @return type + */ function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) { $form['pid'] = array( '#type' => 'hidden', @@ -471,6 +562,12 @@ function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) { return $form; } +/** + * fedora repository purge stream form submit + * @global type $base_url + * @param type $form + * @param array $form_state + */ function fedora_repository_purge_stream_form_submit($form, &$form_state) { global $base_url; module_load_include('inc', 'fedora_repository', 'api/fedora_item'); @@ -486,6 +583,14 @@ function fedora_repository_purge_stream_form_submit($form, &$form_state) { $form_state['redirect'] = $base_url . "/fedora/repository/$pid"; } +/** + * fedora repository replace stream + * @param type $pid + * @param type $dsId + * @param type $dsLabel + * @param type $collectionName + * @return type + */ function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { if ($pid == NULL || $dsId == NULL) { drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error'); @@ -496,6 +601,14 @@ function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName return $output; } +/** + * fedora repository replace stream form + * @param type $form_state + * @param type $pid + * @param type $dsId + * @param type $dsLabel + * @return type + */ function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { //module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); module_load_include('inc', 'Fedora_Repository', 'formClass'); @@ -504,6 +617,12 @@ function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLab return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state); } +/** + * fedora repository replace stream form validate + * @param type $form + * @param type $form_state + * @return type + */ function fedora_repository_replace_stream_form_validate($form, &$form_state) { // If a file was uploaded, process it. if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name']['file'])) { @@ -530,6 +649,12 @@ function fedora_repository_replace_stream_form_validate($form, &$form_state) { } } +/** + * fedora repository replace stream form submit + * @global type $base_url + * @param type $form + * @param array $form_state + */ function fedora_repository_replace_stream_form_submit($form, &$form_state) { global $base_url; $file = $form_state['values']['file']; @@ -562,6 +687,13 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $form_state['redirect'] = 'fedora/repository/' . $pid; } +/** + * fedora repository edit qdc page + * @global type $user + * @param type $pid + * @param type $dsId + * @return type + */ function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); global $user; @@ -578,6 +710,14 @@ function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { return $output; } +/** + * fedora repository edit qdc form + * @global type $user + * @param type $form_state + * @param type $pid + * @param type $dsId + * @return type + */ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -616,6 +756,11 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { return $output; } +/** + * fedora repository edit qdc form validate + * @param type $form + * @param boolean $form_state + */ function fedora_repository_edit_qdc_form_validate($form, &$form_state) { if ($form_state['storage']['xml']) { if ($form_state['storage']['step'] == 1) { @@ -692,7 +837,10 @@ function fedora_repository_perm() { * drupal hook * determines if a user has access to what they are asking for * - * + * @param type $op + * @param type $node + * @param type $account + * @return type */ function fedora_repository_access($op, $node, $account) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -739,7 +887,14 @@ function makeObject($pid, $dsID) { * Sends an ITQL query to the Fedora Resource index (can only communicate with Kowari or mulgara) * Reads the pid and datastream id as url parameters. Queries the collection object for the query * if there is no query datastream falls back to the query shipped with the module. - * @return String + * + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $collection + * @param type $page_number + * @param type $limit + * @return type */ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $page_number = NULL, $limit = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -830,6 +985,11 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU return tabs_render($cmodels_tabs); } +/** + * fedora repository urlencode string + * @param type $str + * @return type + */ function fedora_repository_urlencode_string($str) { return htmlentities($str); } @@ -838,6 +998,12 @@ function fedora_repository_urlencode_string($str) { * Uses makeobject to get a stream. Sets the Content Disposition in the header so it suggests a filename * and sends it as an attachment. This should prompt for a download of the object. * + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $label + * @param type $version + * @return type */ function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { global $user; @@ -852,12 +1018,28 @@ function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { $objectHelper->makeObject($pid, $dsId, 1, $label, FALSE, $version); } +/** + * repository page + * @param type $pid + * @param type $dsId + * @param type $collection + * @param type $pageNumber + * @return type + */ function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNumber = NULL) { //do security check at fedora_repository_get_items function as it has to be called there in case //someone trys to come in a back door. return fedora_repository_get_items($pid, $dsId, $collection, $pageNumber); } +/** + * repository service + * @global type $user + * @param type $pid + * @param type $servicePid + * @param type $serviceMethod + * @return type + */ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NULL) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -900,6 +1082,9 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU * RI index to get a list of results without authorization but to view any * datastreams users must be authorized. * + * @param type $op + * @param type $keys + * @return array */ function fedora_repository_search($op = 'search', $keys = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -980,6 +1165,9 @@ function fedora_repository_search($op = 'search', $keys = NULL) { /** * Implementation of hook_search_page(). * Display the search results + * + * @param type $resultData + * @return array */ function fedora_repository_search_page($resultData) { $path = drupal_get_path('module', 'fedora_repository'); @@ -1054,6 +1242,10 @@ function fedora_repository_search_page($resultData) { /** * Implementation of hook_form_alter(). * allows the advanced search form in drupal + * + * @param type $form + * @param type $form_state + * @param type $form_id */ function fedora_repository_form_alter(&$form, &$form_state, $form_id) { // Advanced node search form @@ -1108,6 +1300,8 @@ function fedora_repository_form_alter(&$form, &$form_state, $form_id) { /** * Implementation of hook_search_validate() * + * @param type $form + * @param type $form_state */ function fedora_repository_search_validate($form, &$form_state) { // Initialise using any existing basic search keywords. @@ -1125,6 +1319,13 @@ function fedora_repository_search_validate($form, &$form_state) { } } +/** + * fedora repository block + * @param type $op + * @param type $delta + * @param type $edit + * @return type + */ function fedora_repository_block($op = 'list', $delta = 0, $edit = array()) { // The $op parameter determines what piece of information is being requested. switch ($op) { @@ -1183,6 +1384,10 @@ function fedora_repository_block($op = 'list', $delta = 0, $edit = array()) { } } +/** + * fedora repository theme + * @return type + */ function fedora_repository_theme() { return array( 'fedora_repository_mnpl_advanced_search_form' => array( @@ -1205,6 +1410,11 @@ function fedora_repository_theme() { /** * Get a list of terms from a lucene index + * + * @param type $field + * @param type $startTerm + * @param type $displayName + * @return type */ function fedora_repository_list_terms($field, $startTerm = NULL, $displayName = NULL) { module_load_include('inc', 'fedora_repository', 'SearchClass'); @@ -1212,18 +1422,33 @@ function fedora_repository_list_terms($field, $startTerm = NULL, $displayName = return $searchClass->getTerms($field, $startTerm, $displayName); } +/** + * fedora repository mnpl advanced search form + * @return type + */ function fedora_repository_mnpl_advanced_search_form() { module_load_include('inc', 'fedora_repository', 'SearchClass'); $searchClass = new SearchClass(); return $searchClass->build_advanced_search_form(); } +/** + * theme fedora repository mnpl advanced search form + * @param type $form + * @return type + */ function theme_fedora_repository_mnpl_advanced_search_form($form) { module_load_include('inc', 'fedora_repository', 'SearchClass'); $advanced_search_form = new SearchClass(); return $advanced_search_form->theme_advanced_search_form($form); } +/** + * fedora repository mnpl advanced search + * @param type $query + * @param type $startPage + * @return type + */ function fedora_repository_mnpl_advanced_search($query, $startPage = 1) { module_load_include('inc', 'fedora_repository', 'SearchClass'); $searchClass = new SearchClass(); @@ -1231,6 +1456,11 @@ function fedora_repository_mnpl_advanced_search($query, $startPage = 1) { return $searchClass->custom_search($query, $startPage); } +/** + * fedora repository mnpl_advanced search form submit + * @param type $form + * @param type $form_state + */ function fedora_repository_mnpl_advanced_search_form_submit($form, &$form_state) { $type_id = $form_state['values']['type']; $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); @@ -1249,11 +1479,19 @@ function fedora_repository_mnpl_advanced_search_form_submit($form, &$form_state) drupal_goto("fedora/repository/mnpl_advanced_search/$searchString"); } +/** + * fedora repository install demo page + * @return type + */ function fedora_repository_install_demos_page() { $output = drupal_get_form('fedora_repository_demo_objects_form'); return $output; } +/** + * fedora repository demo objects form + * @return string + */ function fedora_repository_demo_objects_form() { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_item'); @@ -1341,6 +1579,12 @@ function fedora_repository_demo_objects_form() { return $form; } +/** + * fedora repository demo objects form submit + * @global type $base_url + * @param type $form + * @param type $form_state + */ function fedora_repository_demo_objects_form_submit($form, &$form_state) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/dublin_core'); @@ -1467,6 +1711,10 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { } } +/** + * fedora repository required fedora objects + * @return type + */ function fedora_repository_required_fedora_objects() { // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) $module_path = drupal_get_path('module', 'fedora_repository'); @@ -1633,10 +1881,9 @@ function fedora_repository_required_fedora_objects() { ); } -/* +/** * Functions to create a time selector form element type. */ - function fedora_repository_elements() { $type['fedora_repository_time'] = array( "#input" => TRUE, @@ -1646,6 +1893,11 @@ function fedora_repository_elements() { return $type; } +/** + * fedora repository expand time + * @param type $element + * @return string + */ function fedora_repository_expand_time($element) { // Default to current time, check default_value but set value so that if // default value is present it will override value @@ -1684,11 +1936,21 @@ function fedora_repository_expand_time($element) { return $element; } +/** + * fedora repository time + * @param type $element + * @return type + */ function fedora_repository_time($element) { $output = '
        ' . $element['#children'] . '
        '; return theme('form_element', $element, $output); } +/** + * theme fedora repository time + * @param type $element + * @return type + */ function theme_fedora_repository_time($element) { $output = '
        ' . $element['#children'] . '
        '; return theme('form_element', $element, $output); @@ -1696,6 +1958,10 @@ function theme_fedora_repository_time($element) { /* Export (basket) functionality */ +/** + * fedora repository remove item from basket + * @param type $pid + */ function fedora_repository_remove_item_from_basket($pid) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -1717,6 +1983,10 @@ function fedora_repository_remove_item_from_basket($pid) { } } +/** + * fedora repository basket + * @return type + */ function fedora_repository_basket() { $pids = _fedora_repository_get_basket_pids(); $output = drupal_get_form('fedora_repository_basket_form', $pids); @@ -1773,6 +2043,11 @@ function fedora_repository_basket_form($form_state, $pids) { return $form; } +/** + * theme fedora repository basket form + * @param type $form + * @return string + */ function theme_fedora_repository_basket_form($form) { $header = array( theme('table_select_header_cell'), @@ -1803,10 +2078,22 @@ function theme_fedora_repository_basket_form($form) { return $output; } +/** + * fedora repository basket form validate + * @param type $form + * @param type $form_state + */ function fedora_repository_basket_form_validate($form, &$form_state) { } +/** + * fedora repository basket form submit + * @global type $user + * @param type $form + * @param type $form_state + * @return type + */ function fedora_repository_basket_form_submit($form, &$form_state) { if ($form_state['values']['op'] == $form_state['values']['remove_submit']) { $pids = $form_state['clicked_button']['#post']['remove']; @@ -1873,10 +2160,11 @@ function fedora_repository_basket_form_submit($form, &$form_state) { return; } -/* +/** * Get all pids saved to the basket. + * + * @return type */ - function _fedora_repository_get_basket_pids() { // Set empty defaults if basket elements are missing @@ -1904,10 +2192,19 @@ function _fedora_repository_get_basket_pids() { return $pids; } +/** + * fedora repository empty basket + */ function _fedora_repository_empty_basket() { unset($_SESSION['basket']); } +/** + * fedora repository add to basket + * @param type $pid + * @param type $warn + * @param type $searchResultsFlag + */ function fedora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) { if ($warn && _is_added_to_basket($pid)) { drupal_set_message(t("Object already in basket")); @@ -1926,6 +2223,11 @@ function fedora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag } } +/** + * fedora repository remove from basket + * @param type $pid + * @return type + */ function fedora_repository_remove_from_basket($pid) { if (isset($_SESSION['basket']['unprocessed'][$pid])) { unset($_SESSION['basket']['unprocessed'][$pid]); @@ -1937,6 +2239,12 @@ function fedora_repository_remove_from_basket($pid) { return; } +/** + * theme add to basket link + * @param type $pid + * @param type $type + * @return type + */ function theme_add_to_basket_link($pid, $type = 'object') { $object = t($type); $path = drupal_urlencode($pid); @@ -1960,11 +2268,22 @@ function theme_add_to_basket_link($pid, $type = 'object') { return theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $saved, t("In basket"), t("This @object is already in your basket", array('@object' => $object))); } +/** + * is added to basket + * @param type $pid + * @param type $account + * @return type + */ function _is_added_to_basket($pid, $account = NULL) { return isset($_SESSION['basket']['unprocessed'][$pid]) || isset($_SESSION['basket']['processed'][$pid]); // return db_result(db_query("SELECT uid FROM {repository_basket} WHERE uid = %d AND pid = '%s'", $account->uid, $pid)); } +/** + * fedora repository display schema + * @param type $file + * @return type + */ function fedora_repository_display_schema($file) { $path = drupal_get_path('module', 'fedora_repository'); if (strtolower(substr($file, -3)) == 'xsd' && file_exists($path . '/' . $file)) { @@ -1976,6 +2295,12 @@ function fedora_repository_display_schema($file) { return; } +/** + * fedora repository batch reingest object + * @param type $object + * @param type $context + * @return type + */ function fedora_repository_batch_reingest_object($object, &$context) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -2065,6 +2390,11 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid return $return; } +/** + * theme fedora repository solution pack list + * @param type $solution_packs + * @return string + */ function theme_fedora_repository_solution_packs_list($solution_packs) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); From 02c55906d0cbb599f4774b0314552e488372ea9e Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 14:13:30 -0300 Subject: [PATCH 046/247] Changed fedora to islandora --- fedora_repository.info | 4 ++-- formClass.inc | 2 +- plugins/fedora_imageapi.info | 7 +++---- tests/fedora_repository.test | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index 21f4e708..329ac5bc 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -4,5 +4,5 @@ dependencies[] = imageapi dependencies[] = tabs description = Shows a list of items in a fedora collection. package = Islandora -version = 6.x-$Format:%h$-dev -core = 6.x +version = 6.1 +core = 6.1 diff --git a/formClass.inc b/formClass.inc index 24ee6448..f2a2c8b1 100644 --- a/formClass.inc +++ b/formClass.inc @@ -338,7 +338,7 @@ class formClass { } $form['fedora_repository_title'] = array( '#type' => 'textfield', - '#title' => t('Fedora Repository Title'), + '#title' => t('Digital Repository Title'), '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index a83ef4e6..7fb4115f 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -1,8 +1,7 @@ -; $Id$ name = Fedora ImageAPI description = Adds image manipulation support through a REST interface -package = Fedora Repository +package = Islandora dependencies[] = fedora_repository dependencies[] = imageapi -version = 6.1dev -core = 6.x +version = 6.1 +core = 6.1 diff --git a/tests/fedora_repository.test b/tests/fedora_repository.test index d955c763..91d91b61 100644 --- a/tests/fedora_repository.test +++ b/tests/fedora_repository.test @@ -9,9 +9,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { public static function getInfo() { return array( - 'name' => 'Fedora Repository', - 'description' => t('The Fedora repository content models.'), - 'group' => t('fedora repository'), + 'name' => 'Digital Repository', + 'description' => t('The Digital repository content models.'), + 'group' => t('digital repository'), ); } @@ -144,7 +144,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { return $matches[1]; } - private function outputScreenContents($description = "Screen contents", $basename = 'Fedora Repository') { + private function outputScreenContents($description = "Screen contents", $basename = 'Digital Repository') { // This is a hack to get a directory that won't be cleaned up by SimpleTest. $file_dir = file_directory_path() . '../simpletest_output_pages'; if (!is_dir($file_dir)) { From 29db7ff3b4be1b7a346e5853c0b2a9608c7f9a82 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 14:19:30 -0300 Subject: [PATCH 047/247] fixed a version problem --- fedora_repository.info | 2 +- plugins/fedora_imageapi.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index 329ac5bc..1f31d60c 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -5,4 +5,4 @@ dependencies[] = tabs description = Shows a list of items in a fedora collection. package = Islandora version = 6.1 -core = 6.1 +core = 6.x diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index 7fb4115f..76f8688a 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -4,4 +4,4 @@ package = Islandora dependencies[] = fedora_repository dependencies[] = imageapi version = 6.1 -core = 6.1 +core = 6.x From 2c3d2379aa298990df68470c6fe27ce017c1f860 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 15:25:33 -0300 Subject: [PATCH 048/247] Changed to islandora:root and removed extra cmodel stuff --- fedora_repository.module | 134 +-------------------------------------- 1 file changed, 3 insertions(+), 131 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 8b4b4c05..40d6fc74 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1731,15 +1731,9 @@ function fedora_repository_required_fedora_objects() { 'dsversion' => 2, 'cmodel' => 'fedora-system:ContentModel-3.0', ), + array( - 'pid' => 'islandora:strict_pdf', - 'label' => 'Islandora strict PDF content model', - 'dsid' => 'ISLANDORACM', - 'datastream_file' => "$module_path/content_models/STRICT_PDFCM.xml", - 'cmodel' => 'fedora-system:ContentModel-3.0', - ), - array( - 'pid' => 'islandora:top', + 'pid' => 'islandora:root', 'label' => 'Islandora Top-level Collection', 'cmodel' => 'islandora:collectionCModel', 'datastreams' => array( @@ -1753,129 +1747,7 @@ function fedora_repository_required_fedora_objects() { 'mimetype' => 'image/png', ), ), - ), - array( - 'pid' => 'islandora:ContentModelCollection', - 'label' => 'Collection of installed content models', - 'cmodel' => 'islandora:collectionCModel', - 'parent' => 'islandora:top', - 'datastreams' => array( - array( - 'dsid' => 'COLLECTION_VIEW', - 'datastream_file' => "$module_path/collection_views/simple_list_view.xml", - ), - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/images/contentModel.jpg", - 'mimetype' => 'image/jpeg', - ), - array( - 'dsid' => 'QUERY', - 'datastream_file' => "$module_path/collection_views/cmodel_collection_query.txt", - 'mimetype' => 'text/plain', - ), - ), - ), - array( - 'pid' => 'islandora:demos', - 'label' => 'Islandora demos collection', - 'cmodel' => 'islandora:collectionCModel', - 'parent' => 'islandora:top', - 'datastreams' => array( - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", - 'mimetype' => 'image/png', - ), - array( - 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", - ), - ), - ), - array( - 'pid' => 'islandora:pdf_collection', - 'label' => 'Islandora Demo PDF Collection', - 'cmodel' => 'islandora:collectionCModel', - 'parent' => 'islandora:demos', - 'datastreams' => array( - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/images/Crystal_Clear_mimetype_pdf.png", - 'mimetype' => 'image/png', - ), - array( - 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/collection_policies/PDF-COLLECTION POLICY.xml", - ), - ), - ), - array( - 'pid' => 'demo:DualResImage', - 'foxml_file' => "$module_path/content_models/demo_DualResImage.xml", - 'datastreams' => array( - array( - 'dsid' => 'ISLANDORACM', - 'datastream_file' => "$module_path/content_models/STANDARD JPG.xml", - ), - ), - ), - array( - 'pid' => 'demo:DualResImageCollection', - 'foxml_file' => "$module_path/content_models/demo_DualResImageCollection.xml", - 'datastreams' => array( - array( - 'dsid' => 'ISLANDORACM', - 'datastream_file' => "$module_path/content_models/COLLECTIONCM.xml", - ), - ), - ), - array( - 'pid' => 'demo:DualResolution', - 'foxml_file' => "$module_path/content_models/demo_DualResolution.xml", - ), - array( - 'pid' => 'demo:DualResImageImpl', - 'foxml_file' => "$module_path/content_models/demo_DualResImageImpl.xml", - ), - array( - 'pid' => 'demo:CollectionImpl', - 'foxml_file' => "$module_path/content_models/demo_CollectionImpl.xml", - ), - array( - 'pid' => 'demo:Collection', - 'foxml_file' => "$module_path/content_models/demo_Collection.xml", - ), - array( - 'pid' => 'islandora:demo_image_collection', - 'label' => 'Demo Image Collection', - 'cmodel' => 'demo:DualResImageCollection', - 'parent' => 'islandora:demos', - 'datastreams' => array( - array( - 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/collection_policies/JPG-COLLECTION POLICY.xml", - ), - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", - 'mimetype' => 'image/png', - ), - array( - 'dsid' => 'COLLECTION_VIEW', - 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml", - ), - array( - 'dsid' => 'QUERY', - '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", - ), - ), - ), + ), ), ), ); From 393c37281de0db603078be4eace1573f29cc778e Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 15:45:23 -0300 Subject: [PATCH 049/247] cleanup form --- formClass.inc | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/formClass.inc b/formClass.inc index f2a2c8b1..9932b263 100644 --- a/formClass.inc +++ b/formClass.inc @@ -82,7 +82,7 @@ class formClass { 'page callback' => 'repository_page', 'type' => MENU_NORMAL_ITEM, 'access arguments' => array('view fedora collection'), - // 'access' => TRUE + // 'access' => TRUE ); $items['fedora/repository/service'] = array( @@ -246,19 +246,11 @@ class formClass { $form['fedora_repository_url'] = array( '#type' => 'textfield', '#title' => t('Fedora RISearch URL'), - '#default_value' => variable_get('fedora_repository_url', - 'http://localhost:8080/fedora/risearch'), + '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), '#description' => t('The url of the Fedora server'), '#required' => TRUE, '#weight' => 0 ); - $form['fedora_fgsearch_url'] = array( - '#type' => 'textfield', - '#title' => t('Fedora Lucene search URL'), - '#default_value' => variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'), - '#description' => t('The url of the Lucene Fedora server'), - '#required' => TRUE, - '#weight' => 0 - ); + $form['fedora_index_name'] = array( '#type' => 'textfield', '#title' => t('Fedora Lucene index name'), @@ -342,8 +334,14 @@ class formClass { '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); - - $form['fedora_object_display_title'] = array( + $form['advanced'] = array( + '#type' => 'fieldset', + '#title' => t('Advanced configuration option'), + '#description' => t('Advanced configuration. Under normal circumstances these will not be touched'), + '#collapsable' => true, + '#collapsed' => true, + ); + $form['advanced']['fedora_object_display_title'] = array( '#type' => 'select', '#title' => t('Display Object Title Behaviour'), '#default_value' => variable_get('fedora_object_display_title', ObjectHelper::$DISPLAY_ALWAYS), @@ -351,7 +349,7 @@ class formClass { '#description' => t('Determines when to display the object (or collection) title when viewing an object/collection page.'), ); - $form['fedora_object_display_description'] = array( + $form['advanced']['fedora_object_display_description'] = array( '#type' => 'select', '#title' => t('Display Object Description Behaviour'), '#default_value' => variable_get('fedora_object_display_description', ObjectHelper::$DISPLAY_ALWAYS), @@ -359,14 +357,14 @@ class formClass { '#description' => t('Determines when to display the default object (or collection) description fieldset when viewing an object/collection page.'), ); - $form['fedora_object_restrict_datastreams'] = array( + $form['advanced']['fedora_object_restrict_datastreams'] = array( '#type' => 'checkbox', '#title' => t('Restrict Access to Fedora Object Datastreams'), '#default_value' => variable_get('fedora_object_restrict_datastreams', FALSE), '#description' => t('When enabled, restricts access to fedora object datastreams that are not listed in the Islandora Content Model for the object (unless the user is an administrator).'), ); - $form['fedora_collection_display_list'] = array( + $form['advanced']['fedora_collection_display_list'] = array( '#type' => 'select', '#title' => t('Display Collection List Behaviour'), '#default_value' => variable_get('fedora_collection_display_list', ObjectHelper::$DISPLAY_ALWAYS), @@ -375,7 +373,7 @@ class formClass { ); //Export functionality - $form['module']['export_area'] = array( + $form['advanced']['module']['export_area'] = array( '#type' => 'textfield', '#title' => t('Export area'), '#default_value' => variable_get('export_area', file_directory_path() . '/fedora_export_area'), From bdf7c638aef7330ca218edf56631f323bc52d88d Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 15:47:47 -0300 Subject: [PATCH 050/247] fixed typo --- formClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 9932b263..99798a1e 100644 --- a/formClass.inc +++ b/formClass.inc @@ -338,7 +338,7 @@ class formClass { '#type' => 'fieldset', '#title' => t('Advanced configuration option'), '#description' => t('Advanced configuration. Under normal circumstances these will not be touched'), - '#collapsable' => true, + '#collapsible' => true, '#collapsed' => true, ); $form['advanced']['fedora_object_display_title'] = array( From f15397379543c1262b0b31c52de729c028552ead Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 15:55:34 -0300 Subject: [PATCH 051/247] more of alans changes --- formClass.inc | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/formClass.inc b/formClass.inc index 99798a1e..af8dc920 100644 --- a/formClass.inc +++ b/formClass.inc @@ -251,14 +251,7 @@ class formClass { '#weight' => 0 ); - $form['fedora_index_name'] = array( - '#type' => 'textfield', - '#title' => t('Fedora Lucene index name'), - '#default_value' => variable_get('fedora_index_name', 'BasicIndex'), - '#description' => t('The name of the Lucene index to search'), - '#required' => TRUE, - '#weight' => 0 - ); + $form['fedora_soap_url'] = array( '#type' => 'textfield', '#title' => t('Fedora SOAP Url'), @@ -285,13 +278,6 @@ class formClass { '#weight' => 0 ); - $form['fedora_solr_search_url'] = array( - '#type' => 'textfield', - '#title' => t('Fedora Solr search URL'), - '#default_value' => variable_get('fedora_solr_search_url', 'http://localhost:8080/solr'), '#description' => t('The URL to use for Solr searching'), - '#required' => TRUE, - '#weight' => 0 - ); // will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php if (variable_get('allow_open_namespace', TRUE)) { @@ -336,7 +322,7 @@ class formClass { ); $form['advanced'] = array( '#type' => 'fieldset', - '#title' => t('Advanced configuration option'), + '#title' => t('Advanced configuration options'), '#description' => t('Advanced configuration. Under normal circumstances these will not be touched'), '#collapsible' => true, '#collapsed' => true, From daab5f01b01b3d382120b6274a5d8a3a718ddfce Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:06:28 -0300 Subject: [PATCH 052/247] changed from islandora:top to islandora:root --- formClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index af8dc920..e56bf252 100644 --- a/formClass.inc +++ b/formClass.inc @@ -218,7 +218,7 @@ class formClass { $form['fedora_repository_pid'] = array( '#type' => 'textfield', '#title' => t('Default collection PID'), - '#default_value' => variable_get('fedora_repository_pid', 'islandora:top'), + '#default_value' => variable_get('fedora_repository_pid', 'islandora:root'), '#description' => t('The PID of the collection object to grab the list of items from'), '#required' => TRUE, '#weight' => -2 From bf6c5806a03f3f3b4622f94b94aec6ac13a73a43 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:10:36 -0300 Subject: [PATCH 053/247] Removed extra content models --- content_models/BASIC_AUDIO.xml | 218 -- content_models/BASIC_VIDEO.xml | 218 -- content_models/CRITTERS.xml | 105 - content_models/FAS_slideCModel.xml | 167 -- content_models/REFWORKSCM.xml | 76 - content_models/REFWORKSCM_1.xml | 76 - content_models/STANDARD JPG.xml | 95 - content_models/STANDARD PDF.xml | 236 --- content_models/STANDARD_FLVCM.xml | 218 -- content_models/STANDARD_IMAGECM.xml | 271 --- content_models/STANDARD_JPG.xml | 95 - content_models/STANDARD_QT.xml | 148 -- content_models/STRICT_PDFCM.xml | 108 - content_models/demo_Collection.xml | 65 - content_models/demo_CollectionImpl.xml | 196 -- content_models/demo_DualResImage.xml | 76 - .../demo_DualResImageCollection.xml | 73 - content_models/demo_DualResImageImpl.xml | 162 -- content_models/demo_DualResolution.xml | 65 - content_models/ilives_bookCModel.xml | 675 ------ content_models/ilives_jp2Sdef.xml | 73 - content_models/ilives_jp2Sdep-pageCModel.xml | 179 -- content_models/ilives_tei2htmlSdef.xml | 72 - .../ilives_tei2htmlSdep-pageCModel.xml | 241 --- content_models/ilives_viewerSdef.xml | 72 - .../ilives_viewerSdep-bookCModel.xml | 157 -- content_models/islandora_collectionCModel.xml | 584 ------ content_models/islandora_herbCModel.xml | 1851 ----------------- .../islandora_jp2Sdep-slideCModel.xml | 277 --- content_models/islandora_largeimages.xml | 247 --- content_models/islandora_mapCModel.xml | 366 ---- content_models/islandora_mods2htmlSdef.xml | 110 - content_models/islandora_mods2htmlSdep.xml | 472 ----- content_models/islandora_qtCModel.xml | 174 -- content_models/islandora_slideCModel.xml | 1466 ------------- .../islandora_viewerSdep-slideCModel.xml | 311 --- 36 files changed, 9995 deletions(-) delete mode 100644 content_models/BASIC_AUDIO.xml delete mode 100644 content_models/BASIC_VIDEO.xml delete mode 100644 content_models/CRITTERS.xml delete mode 100644 content_models/FAS_slideCModel.xml delete mode 100644 content_models/REFWORKSCM.xml delete mode 100644 content_models/REFWORKSCM_1.xml delete mode 100644 content_models/STANDARD JPG.xml delete mode 100644 content_models/STANDARD PDF.xml delete mode 100644 content_models/STANDARD_FLVCM.xml delete mode 100644 content_models/STANDARD_IMAGECM.xml delete mode 100644 content_models/STANDARD_JPG.xml delete mode 100644 content_models/STANDARD_QT.xml delete mode 100644 content_models/STRICT_PDFCM.xml delete mode 100644 content_models/demo_Collection.xml delete mode 100644 content_models/demo_CollectionImpl.xml delete mode 100644 content_models/demo_DualResImage.xml delete mode 100644 content_models/demo_DualResImageCollection.xml delete mode 100644 content_models/demo_DualResImageImpl.xml delete mode 100644 content_models/demo_DualResolution.xml delete mode 100644 content_models/ilives_bookCModel.xml delete mode 100644 content_models/ilives_jp2Sdef.xml delete mode 100644 content_models/ilives_jp2Sdep-pageCModel.xml delete mode 100644 content_models/ilives_tei2htmlSdef.xml delete mode 100644 content_models/ilives_tei2htmlSdep-pageCModel.xml delete mode 100644 content_models/ilives_viewerSdef.xml delete mode 100644 content_models/ilives_viewerSdep-bookCModel.xml delete mode 100644 content_models/islandora_collectionCModel.xml delete mode 100644 content_models/islandora_herbCModel.xml delete mode 100644 content_models/islandora_jp2Sdep-slideCModel.xml delete mode 100644 content_models/islandora_largeimages.xml delete mode 100644 content_models/islandora_mapCModel.xml delete mode 100644 content_models/islandora_mods2htmlSdef.xml delete mode 100644 content_models/islandora_mods2htmlSdep.xml delete mode 100644 content_models/islandora_qtCModel.xml delete mode 100644 content_models/islandora_slideCModel.xml delete mode 100644 content_models/islandora_viewerSdep-slideCModel.xml diff --git a/content_models/BASIC_AUDIO.xml b/content_models/BASIC_AUDIO.xml deleted file mode 100644 index 21dc668c..00000000 --- a/content_models/BASIC_AUDIO.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - video/quicktime - - - - - plugins/qt_viewer.inc - ShowQtStreamsInFieldSets - showQt - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - - - - - video/quicktime - - - - - - - plugins/QtFormBuilder.php - QtFormBuilder - buildQDCForm - handleQDCForm - - - - - - dc:title - textfield - The name given to the Video - true - - - - dc:creator - textfield - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - dc:subject - select - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - home recording - home recording - - - meeting - meeting - - - presentation - presentation - - - sound - sound - - - - - - - dc:description - textarea - Examples include an abstract, table of contents, or free-text account of the content of the resource. - true - - - - dc:publisher - textfield - An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - - dc:contributor - textfield - An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - - dc:date - textfield - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - - dc:type - select - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - - none - none - - - video - video - - - - event - event - - - image - image - - - interactive resource - interactive resource - - - model - model - - - party - party - - - physical object - physical object - - - place - place - - - service - service - - - software - software - - - sound - sound - - - text - text - - - - - - 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 - - - - diff --git a/content_models/BASIC_VIDEO.xml b/content_models/BASIC_VIDEO.xml deleted file mode 100644 index 21dc668c..00000000 --- a/content_models/BASIC_VIDEO.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - video/quicktime - - - - - plugins/qt_viewer.inc - ShowQtStreamsInFieldSets - showQt - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - - - - - video/quicktime - - - - - - - plugins/QtFormBuilder.php - QtFormBuilder - buildQDCForm - handleQDCForm - - - - - - dc:title - textfield - The name given to the Video - true - - - - dc:creator - textfield - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - dc:subject - select - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - home recording - home recording - - - meeting - meeting - - - presentation - presentation - - - sound - sound - - - - - - - dc:description - textarea - Examples include an abstract, table of contents, or free-text account of the content of the resource. - true - - - - dc:publisher - textfield - An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - - dc:contributor - textfield - An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - - dc:date - textfield - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - - dc:type - select - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - - none - none - - - video - video - - - - event - event - - - image - image - - - interactive resource - interactive resource - - - model - model - - - party - party - - - physical object - physical object - - - place - place - - - service - service - - - software - software - - - sound - sound - - - text - text - - - - - - 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 - - - - diff --git a/content_models/CRITTERS.xml b/content_models/CRITTERS.xml deleted file mode 100644 index c06e6b51..00000000 --- a/content_models/CRITTERS.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showCritter - - - - - text/xml - text/plain - application/xml - - - - - - text/xml - - - text/plain - - - - application/xml - - - - - - - dis1 - - - - 200 - - - - - - - - text/xml - - - - addCritterToDCStream - critter - - - another XMLFile - - someotherstream - - - - - - - plugins/Refworks.inc - Refworks - - buildForm - handleForm - - - - - - - hiddenvalue - hidden - hidden - We now have all the information we need to ingest. - The name given to the resource - false - - - - - - - - - - dc.title - - - - - - - diff --git a/content_models/FAS_slideCModel.xml b/content_models/FAS_slideCModel.xml deleted file mode 100644 index aa4e5b4a..00000000 --- a/content_models/FAS_slideCModel.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - image/tiff - image/tif - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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 - - - - diff --git a/content_models/REFWORKSCM.xml b/content_models/REFWORKSCM.xml deleted file mode 100644 index ecab1543..00000000 --- a/content_models/REFWORKSCM.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showRefworks - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showRomeo - - - - - - - - - - - text/xml - text/plain - application/xml - - - - - text/xml - - - text/plain - - - application/xml - - - - - - - - - - - plugins/Refworks.inc - Refworks - buildForm - handleForm - - - - - - hiddenvalue - hidden - hidden - We now have all the information we need to ingest. - The name given to the resource - false - - - - - diff --git a/content_models/REFWORKSCM_1.xml b/content_models/REFWORKSCM_1.xml deleted file mode 100644 index ecab1543..00000000 --- a/content_models/REFWORKSCM_1.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showRefworks - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showRomeo - - - - - - - - - - - text/xml - text/plain - application/xml - - - - - text/xml - - - text/plain - - - application/xml - - - - - - - - - - - plugins/Refworks.inc - Refworks - buildForm - handleForm - - - - - - hiddenvalue - hidden - hidden - We now have all the information we need to ingest. - The name given to the resource - false - - - - - diff --git a/content_models/STANDARD JPG.xml b/content_models/STANDARD JPG.xml deleted file mode 100644 index fd3f49ec..00000000 --- a/content_models/STANDARD JPG.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - 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 PDF.xml b/content_models/STANDARD PDF.xml deleted file mode 100644 index 0d1b5ec4..00000000 --- a/content_models/STANDARD PDF.xml +++ /dev/null @@ -1,236 +0,0 @@ - - - - application/pdf - - - - - application/pdf - - - - plugins/ImageManipulation.inc - ImageManipulation - createThumbnailFromPDF - jpg - TN - - 100 - 120 - - - - - - dis1 - - - 200 - - - - - - a868aef684fa34923d4fe697db1e785b - - - plugins/FormBuilder.inc - FormBuilder - buildQDCForm - handleQDCForm - - - - - - dc:title - textfield - The name given to the resource - true - - - - dc:creator - textfield - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - dc:subject - select - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - experiment session - experiment session - - - home recording - home recording - - - image - image - - - meeting - meeting - - - presentation - presentation - - - sound - sound - - - text - text - - - - - - dc:description - textarea - Examples include an abstract, table of contents, or free-text account of the content of the resource. - true - - - - dc:publisher - textfield - An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - - dc:contributor - textfield - An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - - dc:date - textfield - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - - dc:type - select - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - - none - none - - - collection - collection - - - dataset - dataset - - - event - event - - - image - image - - - interactive resource - interactive resource - - - model - model - - - party - party - - - physical object - physical object - - - place - place - - - service - service - - - software - software - - - sound - sound - - - text - text - - - - - - 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 - - - - diff --git a/content_models/STANDARD_FLVCM.xml b/content_models/STANDARD_FLVCM.xml deleted file mode 100644 index 6089f8a1..00000000 --- a/content_models/STANDARD_FLVCM.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - video/x-flv - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showFLV - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - - - - - video/x-flv - - - - - - - plugins/FlvFormBuilder.inc - FlvFormBuilder - buildQDCForm - handleQDCForm - - - - - - dc:title - textfield - The name given to the Video - true - - - - dc:creator - textfield - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - dc:subject - select - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - home recording - home recording - - - meeting - meeting - - - presentation - presentation - - - sound - sound - - - - - - - dc:description - textarea - Examples include an abstract, table of contents, or free-text account of the content of the resource. - true - - - - dc:publisher - textfield - An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - - dc:contributor - textfield - An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - - dc:date - textfield - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - - dc:type - select - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - - none - none - - - video - video - - - - event - event - - - image - image - - - interactive resource - interactive resource - - - model - model - - - party - party - - - physical object - physical object - - - place - place - - - service - service - - - software - software - - - sound - sound - - - text - text - - - - - - 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 - - - - diff --git a/content_models/STANDARD_IMAGECM.xml b/content_models/STANDARD_IMAGECM.xml deleted file mode 100644 index 9d48ebc0..00000000 --- a/content_models/STANDARD_IMAGECM.xml +++ /dev/null @@ -1,271 +0,0 @@ - - - - image/jpeg - image/gif - image/png - image/tiff - image/tif - - - - - image/jpeg - - - image/gif - - - image/png - - - image/tiff - - - image/tif - - - - - plugins/ImageManipulation.inc - ImageManipulation - createThumbnail - jpg - TN - - 100 - 120 - - - - plugins/ImageManipulation.inc - ImageManipulation - createPNG - png - PNG - - - plugins/ImageManipulation.inc - ImageManipulation - createPreview - jpg - PRE - - 240 - 300 - - - - - - dis1 - - - 200 - - - - - - a868aef684fa34923d4fe697db1e785b - - - plugins/FormBuilder.inc - FormBuilder - buildQDCForm - handleQDCForm - - - - - - dc:title - textfield - The name given to the resource - true - - - - dc:creator - textfield - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - - dc:subject - select - An entity primarily responsible for making the content of the resource such as a person, organization or service. - false - - - experiment session - experiment session - - - home recording - home recording - - - image - image - - - meeting - meeting - - - presentation - presentation - - - sound - sound - - - text - text - - - - - - dc:description - textarea - Examples include an abstract, table of contents, or free-text account of the content of the resource. - true - - - - dc:publisher - textfield - An entity, (including persons, organizations, or services), responsible for making the resource available. - false - - - - dc:contributor - textfield - An entity responsible for contributing to the content of the resource such as a person, organization or service. - false - - - - dc:date - textfield - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - false - - - - dc:type - select - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - false - - - none - none - - - collection - collection - - - dataset - dataset - - - event - event - - - image - image - - - interactive resource - interactive resource - - - model - model - - - party - party - - - physical object - physical object - - - place - place - - - service - service - - - software - software - - - sound - sound - - - text - text - - - - - - 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 - - - - diff --git a/content_models/STANDARD_JPG.xml b/content_models/STANDARD_JPG.xml deleted file mode 100644 index fd3f49ec..00000000 --- a/content_models/STANDARD_JPG.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - 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_QT.xml b/content_models/STANDARD_QT.xml deleted file mode 100644 index 39a16543..00000000 --- a/content_models/STANDARD_QT.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - video/quicktime - video/mp4 - - audio/mp3 - audio/x-aiff - - - - video/quicktime - video/mp4 - - audio/mp3 - audio/x-aiff - - - - - - - - - - - - - 92x92 - - - - - - - - - - - - - - - - - - - - - - The name given to the file - - - An entity primarily responsible for making the - content of the resource such as a person, organization or - service. - - - - An entity primarily responsible for making the - content of the resource such as a person, organization or - service. - - - home recording - meeting - presentation - sound - - - - Examples include an abstract, table of - contents, or free-text account of the content of the - resource. - - - - An entity, (including persons, organizations, - or services), responsible for making the resource - available. - - - - An entity responsible for contributing to the - content of the resource such as a person, organization or - service. - - - - Temporal scope of the content if known. Date - format is YYYY-MM-DD (e.g. 1890,1910-10,or - 2007-10-23) - - - - Genre of the content of the resource. Examples - include: home page, novel, poem, working paper, technical - report, essay, dictionary. - - - none - video - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the - present resource is derived. - - - - A unique reference to the resource; In this - instance, the accession number or collection - number. - - - - The language of the intellectual content of - the resource. - - - English - French - - - - Reference to a related resource. - - - Information about intellectual property - rights, copyright, and various property - rights. - - - - - - diff --git a/content_models/STRICT_PDFCM.xml b/content_models/STRICT_PDFCM.xml deleted file mode 100644 index bd9a5450..00000000 --- a/content_models/STRICT_PDFCM.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - application/pdf - - - - application/pdf - - - - 100 - 120 - - - - - - - - - - - - - 100 - 120 - - - - - - - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - experiment session - home recording - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - diff --git a/content_models/demo_Collection.xml b/content_models/demo_Collection.xml deleted file mode 100644 index 05b32730..00000000 --- a/content_models/demo_Collection.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:20.712Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDefObjects/demo_Collection.xml - - - - - - - - - - Service Definition Object (Collection) for Image Collection Demo - demo:Collection - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/demo_CollectionImpl.xml b/content_models/demo_CollectionImpl.xml deleted file mode 100644 index 071e9923..00000000 --- a/content_models/demo_CollectionImpl.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:20.819Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDepObjects/demo_CollectionImpl.xml - - - - - - - - - - Service Deployment Object (Collection) for Image Collection Demo - demo:ImageCollectionImpl - demo:CollectionImpl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - XSLT Binding - text/xml - - - - LIST Binding - text/xml - - - - QUERY Binding - text/plain - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/demo_DualResImage.xml b/content_models/demo_DualResImage.xml deleted file mode 100644 index 6dbbca0f..00000000 --- a/content_models/demo_DualResImage.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:19.456Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/cModelObjects/demo_DualResImage.xml - - - - - - - - - - Content Model Object (Image) for Image Collection Demo - demo:DualResImage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/demo_DualResImageCollection.xml b/content_models/demo_DualResImageCollection.xml deleted file mode 100644 index b9eb819e..00000000 --- a/content_models/demo_DualResImageCollection.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:19.509Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/cModelObjects/demo_DualResImageCollection.xml - - - - - - - - - - Content Model Object (Image Collection) for Image Collection Demo - demo:DualResImageCollection - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/demo_DualResImageImpl.xml b/content_models/demo_DualResImageImpl.xml deleted file mode 100644 index 6019aaab..00000000 --- a/content_models/demo_DualResImageImpl.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:20.881Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDepObjects/demo_DualResImageImpl.xml - - - - - - - - - - Service Deployment Object (Image) for Image Collection Demo - demo:DualResImageImpl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FULL_SIZE Binding - image/jpeg - - - - MEDIUM_SIZE Binding - image/jpeg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/demo_DualResolution.xml b/content_models/demo_DualResolution.xml deleted file mode 100644 index d8bacfe8..00000000 --- a/content_models/demo_DualResolution.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2011-03-29T14:15:20.765Z - Ingested from local file /usr/local/fedora/client/demo/foxml/local-server-demos/image-collection-demo/sDefObjects/demo_DualResolution.xml - - - - - - - - - - Service Definition Object (Image) for Image Collection Demo - demo:DualResolution - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/ilives_bookCModel.xml b/content_models/ilives_bookCModel.xml deleted file mode 100644 index 7f95b8ca..00000000 --- a/content_models/ilives_bookCModel.xml +++ /dev/null @@ -1,675 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:56:58.331Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_bookCModel.xml - - - - ingest - - fedoraAdmin - 2010-05-31T19:56:44.131Z - Ingested from source repository with pid ilives:bookCModel - - - - ingest - - fedoraAdmin - 2010-06-10T17:43:56.335Z - Ingested from local file /Users/aoneill/fedora_repository/content_models/ilives_bookCModel.xml - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-06-10T19:01:39.144Z - DatastreamsPane generated this logMessage. - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-10T19:29:20.220Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-10T19:46:24.930Z - - - - - ingest - - fedoraAdmin - 2010-06-15T07:01:30.019Z - Ingested from local file /Users/al/fedora_repository/content_models/ilives_bookCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T08:56:09.156Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T08:59:35.673Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T08:59:52.831Z - - - - - addDatastream - MODS - fedoraAdmin - 2010-06-16T09:13:08.428Z - DatastreamsPane generated this logMessage. - - - - purgeDatastream - MODS - fedoraAdmin - 2010-06-16T09:13:32.732Z - DatastreamPane generated this logMessage. . . . Purged datastream (ID=MODS), versions ranging from 2010-06-16T06:13:08.428Z to 2010-06-16T06:13:08.428Z. This resulted in the permanent removal of 1 datastream version(s) (2010-06-16T06:13:08.428Z) and all associated audit records. - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-16T09:21:14.357Z - - - - - ingest - - fedoraAdmin - 2010-08-30T13:14:03.487Z - Ingested from local file /Users/aoneill/fedora_repository/ilives/xml/ilives_bookCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-11-26T15:24:13.742Z - - - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Book Content Model - ilives:bookCModel - - - - - - - - - - image/tiff - image/tif - - - - - ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - image/tif - - - - - fedora_ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - - - - - fedora_ilives - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSet - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - - - - - fedora_ilives - book.inc - IslandoraBook - showFieldSets - - - - - - - - - text/xml - - - fedora_ilives - book.inc - IslandoraBook - ingestBook - MODS - - - - - - - fedora_ilives - book.inc - IslandoraBook - buildDrupalForm - handleIngestForm - - - - - fedora_ilives - book.inc - IslandoraBook - buildEditMetadataForm - - - fedora_ilives - book.inc - IslandoraBook - handleEditMetadataForm - - - - - - - - - - image/tiff - - - - text/xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/ilives_jp2Sdef.xml b/content_models/ilives_jp2Sdef.xml deleted file mode 100644 index e7580656..00000000 --- a/content_models/ilives_jp2Sdef.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:56:59.840Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdef.xml - - - - ingest - - admin - 2010-05-25T13:17:14.106Z - Fedora Object Ingested - - - - - - - - - - - - - - - - - - - - - ilives:jp2Sdef - ilives:jp2Sdef - - - - - - - - - - - - - - - diff --git a/content_models/ilives_jp2Sdep-pageCModel.xml b/content_models/ilives_jp2Sdep-pageCModel.xml deleted file mode 100644 index 0aa21432..00000000 --- a/content_models/ilives_jp2Sdep-pageCModel.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:00.246Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_jp2Sdep-pageCModel.xml - - - - ingest - - fedoraAdmin - 2010-06-01T00:46:19.239Z - Ingested from local file /Users/al/Desktop/ilives_jp2Sdep-pageCModel.xml - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-01T00:48:39.302Z - - - - - - - - - - - ilives:jp2Sdep-pageCModel - ilives:jp2Sdep-pageCModel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DC - text/xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/ilives_tei2htmlSdef.xml b/content_models/ilives_tei2htmlSdef.xml deleted file mode 100644 index 225df813..00000000 --- a/content_models/ilives_tei2htmlSdef.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:01.057Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdef.xml - - - - ingest - - fedoraAdmin - 2010-06-01T00:46:19.652Z - Ingested from local file /Users/al/Desktop/ilives_tei2htmlSdef.xml - - - - - - - - - - - - - - - - - - - - - ilives:tei2htmlSdef - ilives:tei2htmlSdef - - - - - - - - - - - - - - diff --git a/content_models/ilives_tei2htmlSdep-pageCModel.xml b/content_models/ilives_tei2htmlSdep-pageCModel.xml deleted file mode 100644 index fbc8f585..00000000 --- a/content_models/ilives_tei2htmlSdep-pageCModel.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T14:57:01.366Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_tei2htmlSdep-pageCModel.xml - - - - modifyDatastreamByValue - XSL - fedoraAdmin - 2009-12-11T19:09:52.417Z - - - - - modifyDatastreamByValue - XSL - fedoraAdmin - 2009-12-11T19:22:11.096Z - - - - - ingest - - fedoraAdmin - 2010-06-01T00:46:19.847Z - Ingested from local file /Users/al/Desktop/ilives_tei2htmlSdep-pageCModel.xml - - - - - - - - - - - - - - - - - - - - - - - ilives:tei2htmlSdep-pageCModel - ilives:tei2htmlSdep-pageCModel - - - - - - - - - - TEI - text/xml - - - - XSL - text/xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:value-of select="normalize-space(tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title)"/> - - - - - - - - -
        - -
        -
        - -

        - -

        -
        - - - - - - - - - - - search persName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22 - + - %22+AND+dc.type:collection - - - - - - - - - - - - - search placeName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22 - %22+AND+dc.type:collection - - - - - - - search orgName - _blank - http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22 - %22+AND+dc.type:collection - - - - - -
        -
        -
        -
        -
        diff --git a/content_models/ilives_viewerSdef.xml b/content_models/ilives_viewerSdef.xml deleted file mode 100644 index c0031d70..00000000 --- a/content_models/ilives_viewerSdef.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T17:09:29.912Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdef.xml - - - - ingest - - admin - 2010-05-25T13:17:14.247Z - Fedora Object Ingested - - - - - - - - - - - - - - - - - - - - - ilives:viewerSdef - ilives:viewerSdef - - - - - - - - - - - - - - diff --git a/content_models/ilives_viewerSdep-bookCModel.xml b/content_models/ilives_viewerSdep-bookCModel.xml deleted file mode 100644 index 1332ac82..00000000 --- a/content_models/ilives_viewerSdep-bookCModel.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-12T17:09:41.797Z - Ingested from local file /Users/aoneill/dev/iiv/iiv/etc/fedora-objects/ilives_viewerSdep-bookCModel.xml - - - - ingest - - fedoraAdmin - 2010-05-31T20:03:42.709Z - Ingested from source repository with pid ilives:viewerSdep-bookCModel - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-31T20:04:57.893Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-31T20:57:49.117Z - - - - - - - - - - - ilives:viewerSdep-bookCModel - ilives:viewerSdep-bookCModel - - - - - - - - - - DC - text/xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/islandora_collectionCModel.xml b/content_models/islandora_collectionCModel.xml deleted file mode 100644 index 129d2f50..00000000 --- a/content_models/islandora_collectionCModel.xml +++ /dev/null @@ -1,584 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - admin - 2010-12-20T16:14:50.165Z - Fedora Object Ingested - - - - addDatastream - RELS-EXT - admin - 2010-12-20T16:14:50.352Z - Ingested object RELS-EXT - - - - modifyDatastreamByValue - RELS-EXT - admin - 2010-12-20T16:14:50.407Z - Modified by Islandora API - - - - addDatastream - ISLANDORACM - admin - 2010-12-20T16:14:50.475Z - Ingested object ISLANDORACM - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2011-01-17T15:04:59.169Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2011-01-17T15:06:08.023Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2011-01-21T19:40:39.790Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2011-01-21T19:41:19.709Z - - - - - - - - - - - Islandora Collection Content Model - islandora:collectionCModel - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/xml - text/plain - application/xml - - - - - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - - - - - text/xml - text/plain - application/xml - - - - - - - - - - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - - - - - text/xml - text/plain - application/xml - - - - - - - - - - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - - - - - text/xml - text/plain - application/xml - - - - - - - - - - - - - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - - - - - text/xml - text/plain - application/xml - - - - - - - - - - - - - - The name given to the resource - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - - An entity primarily responsible for making the content of the resource such as a person, organization or service. - - none - Multi Media - image - meeting - presentation - sound - text - - - - Examples include an abstract, table of contents, or free-text account of the content of the resource. - - - An entity, (including persons, organizations, or services), responsible for making the resource available. - - - An entity responsible for contributing to the content of the resource such as a person, organization or service. - - - Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g. 1890,1910-10,or 2007-10-23) - - - Genre of the content of the resource. Examples include: home page, novel, poem, working paper, technical report, essay, dictionary. - - none - collection - dataset - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the present resource is derived. - - - A unique reference to the resource; In this instance, the accession number or collection number. - - - The language of the intellectual content of the resource. - - English - French - - - - Reference to a related resource. - - - Information about intellectual property rights, copyright, and various property rights. - - - - - - - - diff --git a/content_models/islandora_herbCModel.xml b/content_models/islandora_herbCModel.xml deleted file mode 100644 index 6763cdc6..00000000 --- a/content_models/islandora_herbCModel.xml +++ /dev/null @@ -1,1851 +0,0 @@ - - - - - - - - - - - - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-03-05T19:52:46.133Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-10T06:43:54.714Z - - - - - ingest - - fedoraAdmin - 2010-05-10T15:42:10.930Z - Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/islandora_herbCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-10T16:56:37.065Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-10T16:58:56.685Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-10T19:07:11.023Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-11T19:12:28.380Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-13T19:30:13.540Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-17T20:10:15.478Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-18T18:58:52.382Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-19T18:16:39.272Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-19T18:36:31.560Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-19T19:52:41.316Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-19T20:06:17.332Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-05-20T19:12:33.099Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-06-07T14:01:43.997Z - - - - - ingest - - fedoraAdmin - 2010-09-16T16:15:28.762Z - Ingested from local file /Applications/MAMP/htdocs/f3/sites/default/modules/fedora_repository/content_models/islandora_herbCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-09-16T17:32:21.037Z - - - - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - Herbarium Content Model - islandora:herbCModel - - - - - - - - - - image/tiff - - - - - plugins/slide_viewer.php - ShowSlideStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - - plugins/ImageManipulation.php - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/DemoFormBuilder.php - 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/tiff - - - - - plugins/herb_viewer.php - HerbStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - - plugins/ImageManipulation.php - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/DemoFormBuilder.php - 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/tiff - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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/tiff - - - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/DarwinCore.inc - DarwinCore - buildDrupalForm - handleDarwinCoreForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/DarwinCore.inc - DarwinCore - buildDrupalForm - handleIngestForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herb_viewer.inc - HerbStreamsInFieldSets - showJPG - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/Herbarium.inc - Herbarium - buildEditMetadataForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/Herbarium.inc - Herbarium - buildEditMetadataForm - - - plugins/Herbarium.inc - Herbarium - handleEditMetadataForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/Herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/herbarium.inc - Herbarium - buildEditMetadataForm - - - plugins/herbarium.inc - Herbarium - handleEditMetadataForm - - - - - - - - - - image/tiff - image/tif - - - - - plugins/herbarium.inc - Herbarium - showFieldSets - - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - plugins/herbarium.inc - Herbarium - buildDrupalForm - handleIngestForm - - - - - plugins/herbarium.inc - Herbarium - buildEditMetadataForm - - - plugins/herbarium.inc - Herbarium - handleEditMetadataForm - - - - - - - - - - image/tiff - image/tif - - - - image/tiff - image/tif - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content_models/islandora_jp2Sdep-slideCModel.xml b/content_models/islandora_jp2Sdep-slideCModel.xml deleted file mode 100644 index 67cbe24d..00000000 --- a/content_models/islandora_jp2Sdep-slideCModel.xml +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-27T18:25:48.654Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2009-11-27T18:30:03.064Z - - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2009-11-27T18:30:34.272Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2009-11-27T18:31:33.967Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2009-11-27T18:36:14.648Z - - - - - ingest - - fedoraAdmin - 2010-01-26T20:06:07.452Z - Ingested from local file /Users/aoneill/Desktop/tmp/islandora_jp2Sdep-slideCModel.xml - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-03-05T16:47:23.192Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-03-11T20:58:05.234Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This METHODMAP datastream is included as a starting point to - assist in the creation of a service deployment. The METHODMAP - should define the the mapping of the WSDL to Fedora object methods. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This DSINPUTSPEC datastream is included as a starting point to - assist in the creation of a service deployment. The DSINPUTSPEC - should define the datastreams to be used by WSDL-defined methods. - - - - - - - - DC - text/xml - - - - - - - - - - - This WSDL datastream is included as a starting point to - assist in the creation of a service deployment. The WSDL - should define the services provided by this - service deployment. - For more information about service deployments, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed service deployment objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:2, demo:13, demo:20, and demo:28. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - islandora:jp2Sdep-slideCModel - islandora:jp2Sdep-slideCModel - - - - - \ No newline at end of file diff --git a/content_models/islandora_largeimages.xml b/content_models/islandora_largeimages.xml deleted file mode 100644 index e4d59de4..00000000 --- a/content_models/islandora_largeimages.xml +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - admin - 2010-12-20T16:02:16.800Z - Fedora Object Ingested - - - - addDatastream - RELS-EXT - admin - 2010-12-20T16:02:17.020Z - Ingested object RELS-EXT - - - - modifyDatastreamByValue - RELS-EXT - admin - 2010-12-20T16:02:17.091Z - Modified by Islandora API - - - - modifyDatastreamByValue - RELS-EXT - admin - 2010-12-20T16:02:17.142Z - Modified by Islandora API - - - - addDatastream - COLLECTION_POLICY - admin - 2010-12-20T16:02:17.213Z - Ingested object COLLECTION_POLICY - - - - ingest - - admin - 2010-12-20T16:08:27.075Z - Fedora Object Ingested - - - - addDatastream - TN - admin - 2010-12-20T16:08:27.131Z - Ingested object TN - - - - purgeDatastream - TN - fedoraAdmin - 2010-12-20T16:09:24.726Z - DatastreamPane generated this logMessage. . . . Purged datastream (ID=TN), versions ranging from 2010-12-20T12:08:27.131Z to 2010-12-20T12:08:27.131Z. This resulted in the permanent removal of 1 datastream version(s) (2010-12-20T12:08:27.131Z) and all associated audit records. - - - - modifyDatastreamByValue - COLLECTION_POLICY - fedoraAdmin - 2010-12-20T16:09:32.544Z - - - - - - - - - - - Large Images Collection - islandora:largeimages - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - islandora:slide - islandora:slideCModel - ISLANDORACM - - - islandora:map - islandora:mapCModel - ISLANDORACM - - - islandora:herb - islandora:herbCModel - ISLANDORACM - - - isMemberOfCollection - - 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 - - isMemberOfCollection - - - - - diff --git a/content_models/islandora_mapCModel.xml b/content_models/islandora_mapCModel.xml deleted file mode 100644 index 4820b6cf..00000000 --- a/content_models/islandora_mapCModel.xml +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-05-25T12:52:58.656Z - Created with Admin GUI "New Object" command - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2010-05-25T12:53:38.788Z - DatastreamsPane generated this logMessage. - - - - ingest - - fedoraAdmin - 2010-09-16T16:13:13.388Z - Ingested from local file /Users/aoneill/fedora_repository/content_models/islandora_mapCModel.xml - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-09-16T16:13:49.927Z - - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - Islandora Map Content Model - islandora:mapCModel - - - - - - - - - - image/tiff - image/tif - - - - - plugins/map_viewer.inc - ShowMapStreamsInFieldSets - showJPG - - - - - - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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/tiff - image/tif - - - - image/tiff - image/tif - - - - - - - - - - - - - - - - - - - - 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. - - - - - - - - diff --git a/content_models/islandora_mods2htmlSdef.xml b/content_models/islandora_mods2htmlSdef.xml deleted file mode 100644 index ac9a5bf6..00000000 --- a/content_models/islandora_mods2htmlSdef.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-03-12T14:57:03.509Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-03-12T15:12:03.341Z - - - - - ingest - - fedoraAdmin - 2010-03-12T17:28:34.323Z - Ingested from local file /Users/aoneill/fedora_repository/content_models/islandora-mods2htmlSdef.xml - - - - ingest - - admin - 2010-05-25T13:17:13.492Z - Fedora Object Ingested - - - - - - - - - - - - - - - - - - - - - - This METHODMAP datastream is included as a starting point to - assist in the creation of a service definition. The METHODMAP - should define the methods and method parameters for this - service definition. - For more information about service definitions, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed service definition objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:1, demo:12, demo: 19, and demo:27. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - MODS to HTML Disseminator - islandora:mods2htmlSdef - - - - - diff --git a/content_models/islandora_mods2htmlSdep.xml b/content_models/islandora_mods2htmlSdep.xml deleted file mode 100644 index af4e67e3..00000000 --- a/content_models/islandora_mods2htmlSdep.xml +++ /dev/null @@ -1,472 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2010-03-12T15:14:29.138Z - Created with Admin GUI "New Object" command - - - - addDatastream - XSL - fedoraAdmin - 2010-03-12T15:17:20.270Z - DatastreamsPane generated this logMessage. - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-03-12T15:18:27.234Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2010-03-12T15:21:44.430Z - - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2010-03-12T15:23:21.361Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2010-03-12T15:27:58.299Z - - - - - ingest - - admin - 2010-05-25T13:17:13.612Z - Fedora Object Ingested - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-06-01T01:05:17.111Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This METHODMAP datastream is included as a starting point to - assist in the creation of a service deployment. The METHODMAP - should define the the mapping of the WSDL to Fedora object methods. - - - - - - - - - - - - - - - - - - - - - This DSINPUTSPEC datastream is included as a starting point to - assist in the creation of a service deployment. The DSINPUTSPEC - should define the datastreams to be used by WSDL-defined methods. - - - - - - - - MODS - text/xml - - - - XSL - text/xml - - - - - - - - - - - This WSDL datastream is included as a starting point to - assist in the creation of a service deployment. The WSDL - should define the services provided by this - service deployment. - For more information about service deployments, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed service deployment objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:2, demo:13, demo:20, and demo:28. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MODS to HTML Disseminator Service Deployment - islandora:mods2htmlSdep - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        - - - - - - -

        - - - -
        - - - -

        - - - - - - -

        - - - - - -
        -
        -
        - - - - - -

        - - - - - - -

        - - - -
        - - - -

        - - - - - - -

        - - - - - -
        -
        -
        - - - -

        - - - - - - -

        - - - - - -
        - - - - - - - - - - - - - : - - - - - - - - ( - - - - - - - Edition - - ) - - - - =" - ", - - - - ( - ) - - -
        -
        -
        -
        -
        diff --git a/content_models/islandora_qtCModel.xml b/content_models/islandora_qtCModel.xml deleted file mode 100644 index e1798417..00000000 --- a/content_models/islandora_qtCModel.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - Quicktime Content Model - islandora:qtCModel - - - - - - - - - - video/quicktime - video/mp4 - audio/mp3 - audio/x-aiff - - - - video/quicktime - video/mp4 - - audio/mp3 - audio/x-aiff - - - - - - - - - - - - - 92x92 - - - - - - - - - - - - - - - - - - - - - - The name given to the file - - - An entity primarily responsible for making the - content of the resource such as a person, organization or - service. - - - - An entity primarily responsible for making the - content of the resource such as a person, organization or - service. - - - home recording - meeting - presentation - sound - - - - Examples include an abstract, table of - contents, or free-text account of the content of the - resource. - - - - An entity, (including persons, organizations, - or services), responsible for making the resource - available. - - - - An entity responsible for contributing to the - content of the resource such as a person, organization or - service. - - - - Temporal scope of the content if known. Date - format is YYYY-MM-DD (e.g. 1890,1910-10,or - 2007-10-23) - - - - Genre of the content of the resource. Examples - include: home page, novel, poem, working paper, technical - report, essay, dictionary. - - - none - video - event - image - interactive resource - model - party - physical object - place - service - software - sound - text - - - - A reference to a resource from which the - present resource is derived. - - - - A unique reference to the resource; In this - instance, the accession number or collection - number. - - - - The language of the intellectual content of - the resource. - - - English - French - - - - Reference to a related resource. - - - Information about intellectual property - rights, copyright, and various property - rights. - - - - - - - - - diff --git a/content_models/islandora_slideCModel.xml b/content_models/islandora_slideCModel.xml deleted file mode 100644 index b11eaa2f..00000000 --- a/content_models/islandora_slideCModel.xml +++ /dev/null @@ -1,1466 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-10-15T16:00:27.323Z - Created with Admin GUI "New Object" command - - - - addDatastream - ISLANDORACM - fedoraAdmin - 2009-10-15T16:01:56.633Z - DatastreamsPane generated this logMessage. - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-10-16T16:30:09.592Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-10-16T16:40:10.323Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-10-16T17:50:03.365Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-10-16T17:59:16.270Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2009-11-27T15:22:48.433Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2009-11-27T15:47:29.716Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-01-12T20:39:20.430Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-01-13T17:59:36.652Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-01-13T19:08:21.266Z - - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-01-13T19:56:37.843Z - - - - - ingest - - fedoraAdmin - 2010-01-26T20:06:21.726Z - Ingested from local file /Users/aoneill/Desktop/tmp/islandora_slideCModel.xml - - - - ingest - - aoneill - 2010-03-31T22:51:13.964Z - Fedora Object Ingested - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-03-31T22:54:03.479Z - - - - - ingest - - aoneill - 2010-04-01T18:17:22.725Z - Fedora Object Ingested - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-04-01T18:25:12.904Z - - - - - ingest - - admin - 2010-08-26T18:57:07.237Z - Fedora Object Ingested - - - - modifyDatastreamByValue - ISLANDORACM - fedoraAdmin - 2010-09-16T16:01:27.415Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This DS-COMPOSITE-MODEL datastream is included as a starting point to - assist in the creation of a content model. The DS-COMPOSITE-MODEL - should define the datastreams that are required for any objects - conforming to this content model. - For more information about content models, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed content model objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection, - demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - Slide Content Model - islandora:slideCModel - - - - - - - - - - image/jpeg - - - - - plugins/image_rotator_tagger_block.inc - ShowILivesStreamsInFieldSets - showJPG - - - - image/jpeg - - - - - - - - - - - image/jpeg - - - - - plugins/image_rotator_tagger_block.inc - ShowILivesStreamsInFieldSets - showJPG - - - - - - - - - - - - image/jpeg - - - - - ilives/image_rotator_tagger_block.inc - ShowILivesStreamsInFieldSets - showJPG - - - - - - - - - - - - image/jpeg - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - - - - - - image/jpeg - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - plugins/ShowStreamsInFieldSets.inc - ShowStreamsInFieldSets - showQdc - - - - - - - - - - - - image/jpeg - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - - - - - - image/tiff - image/tif - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - 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/tiff - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jpg - JP2 - - - - - - - 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/tiff - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - 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/tiff - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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/tiff - image/tif - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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/tiff - image/tif - - - - - plugins/slide_viewer.inc - ShowSlideStreamsInFieldSets - showJPG - - - - - - - image/tiff - - - image/tif - - - - plugins/ImageManipulation.inc - ImageManipulation - createJP2 - jp2 - JP2 - - - - - - - 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/tiff - image/tif - - - - image/tiff - image/tif - - - - - - - - - - - - - - - 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. - - - - - - - - diff --git a/content_models/islandora_viewerSdep-slideCModel.xml b/content_models/islandora_viewerSdep-slideCModel.xml deleted file mode 100644 index 694c66f8..00000000 --- a/content_models/islandora_viewerSdep-slideCModel.xml +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - - - - - - - - - - ingest - - fedoraAdmin - 2009-11-27T17:57:45.462Z - Created with Admin GUI "New Object" command - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2009-11-27T18:02:20.095Z - - - - - modifyDatastreamByValue - METHODMAP - fedoraAdmin - 2009-11-27T18:17:31.165Z - - - - - modifyDatastreamByValue - DSINPUTSPEC - fedoraAdmin - 2009-11-27T18:20:50.036Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2009-11-27T18:22:44.560Z - - - - - modifyDatastreamByValue - WSDL - fedoraAdmin - 2009-11-27T18:37:33.153Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-03-11T21:01:10.851Z - - - - - modifyDatastreamByValue - RELS-EXT - fedoraAdmin - 2010-05-14T20:05:44.278Z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This METHODMAP datastream is included as a starting point to - assist in the creation of a service deployment. The METHODMAP - should define the the mapping of the WSDL to Fedora object methods. - - - - - - - - - - - - - - - - - - - - - - This DSINPUTSPEC datastream is included as a starting point to - assist in the creation of a service deployment. The DSINPUTSPEC - should define the datastreams to be used by WSDL-defined methods. - - - - - - - - DC - text/xml - - - - - - - - - - - This WSDL datastream is included as a starting point to - assist in the creation of a service deployment. The WSDL - should define the services provided by this - service deployment. - For more information about service deployments, see: - http://fedora-commons.org/confluence/x/dgBI. - For examples of completed service deployment objects, see the demonstration - objects included with your Fedora distribution, such as: - demo:2, demo:13, demo:20, and demo:28. - For more information about the demonstration objects, see: - http://fedora-commons.org/confluence/x/AwFI. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - viewerSdep-slideCModel - islandora:viewerSdep-slideCModel - - - - - From a46a98bd4429807cdd78f53faed61b7e12f28d82 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:22:11 -0300 Subject: [PATCH 054/247] fixed descriptions --- formClass.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/formClass.inc b/formClass.inc index e56bf252..da4256cb 100644 --- a/formClass.inc +++ b/formClass.inc @@ -209,33 +209,33 @@ class formClass { $form = array(); $form['fedora_repository_name'] = array( '#type' => 'textfield', - '#title' => t('Default collection name'), + '#title' => t('Root Collection Name'), '#default_value' => variable_get('fedora_repository_name', 'Islandora demos collection'), - '#description' => t('The Name of the collection to grab the list of items from'), + '#description' => t('The Name of the Root Collection Object'), '#required' => TRUE, '#weight' => -2 ); $form['fedora_repository_pid'] = array( '#type' => 'textfield', - '#title' => t('Default collection PID'), + '#title' => t('Root Collection PID'), '#default_value' => variable_get('fedora_repository_pid', 'islandora:root'), - '#description' => t('The PID of the collection object to grab the list of items from'), + '#description' => t('The PID of the Root Collection Object'), '#required' => TRUE, '#weight' => -2 ); $form['fedora_collection_model_pid'] = array( '#type' => 'textfield', - '#title' => t('Default Collection Model PID'), + '#title' => t('Root Collection Model PID'), '#default_value' => variable_get('fedora_collection_model_pid', 'islandora:collectionCModel'), - '#description' => t('The PID of the default Collection Model Object'), + '#description' => t('The PID of the Root Collection Model Object'), '#required' => TRUE, '#weight' => -2 ); $form['fedora_content_model_collection_pid'] = array( '#type' => 'textfield', - '#title' => t('Default Content Model Collection PID'), + '#title' => t('Root Content Model Collection PID'), '#default_value' => variable_get('fedora_content_model_collection_pid', 'islandora:ContentModelCollection'), '#description' => t('The PID of the Content Model Collection Object'), '#required' => TRUE, From 5bf687759e9ae74cfe4c742960e72035588d92dc Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:25:03 -0300 Subject: [PATCH 055/247] changed the ordering --- formClass.inc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/formClass.inc b/formClass.inc index da4256cb..69d721e8 100644 --- a/formClass.inc +++ b/formClass.inc @@ -242,7 +242,6 @@ class formClass { '#weight' => -2 ); - $form['fedora_repository_url'] = array( '#type' => 'textfield', '#title' => t('Fedora RISearch URL'), @@ -251,16 +250,6 @@ class formClass { '#weight' => 0 ); - - $form['fedora_soap_url'] = array( - '#type' => 'textfield', - '#title' => t('Fedora SOAP Url'), - '#default_value' => variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'), - '#description' => t('The URL to use for SOAP connections'), - '#required' => TRUE, - '#weight' => 0, - '#suffix' => '

        ' . (fedora_available() ? '' . t('Successfully connected to Fedora server at !fedora_soap_url', array('!fedora_soap_url' => variable_get('fedora_soap_url', ''))) : ' ' . t('Unable to connect to Fedora server at !fedora_soap_url

        ', array('!fedora_soap_url' => variable_get('fedora_soap_url', '')))), - ); $form['fedora_base_url'] = array( '#type' => 'textfield', '#title' => t('Fedora base URL'), @@ -277,7 +266,16 @@ class formClass { '#required' => TRUE, '#weight' => 0 ); - + + $form['fedora_soap_url'] = array( + '#type' => 'textfield', + '#title' => t('Fedora SOAP Url'), + '#default_value' => variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'), + '#description' => t('The URL to use for SOAP connections'), + '#required' => TRUE, + '#weight' => 0, + '#suffix' => '

        ' . (fedora_available() ? '' . t('Successfully connected to Fedora server at !fedora_soap_url', array('!fedora_soap_url' => variable_get('fedora_soap_url', ''))) : ' ' . t('Unable to connect to Fedora server at !fedora_soap_url

        ', array('!fedora_soap_url' => variable_get('fedora_soap_url', '')))), + ); // will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php if (variable_get('allow_open_namespace', TRUE)) { From d618a0c727f7a21fa4d2bbb92d770782219e87c2 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:27:44 -0300 Subject: [PATCH 056/247] changed the order by adding weights --- formClass.inc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/formClass.inc b/formClass.inc index 69d721e8..c3a3e14e 100644 --- a/formClass.inc +++ b/formClass.inc @@ -213,7 +213,7 @@ class formClass { '#default_value' => variable_get('fedora_repository_name', 'Islandora demos collection'), '#description' => t('The Name of the Root Collection Object'), '#required' => TRUE, - '#weight' => -2 + '#weight' => 1 ); $form['fedora_repository_pid'] = array( '#type' => 'textfield', @@ -221,7 +221,7 @@ class formClass { '#default_value' => variable_get('fedora_repository_pid', 'islandora:root'), '#description' => t('The PID of the Root Collection Object'), '#required' => TRUE, - '#weight' => -2 + '#weight' => 2 ); $form['fedora_collection_model_pid'] = array( @@ -230,7 +230,7 @@ class formClass { '#default_value' => variable_get('fedora_collection_model_pid', 'islandora:collectionCModel'), '#description' => t('The PID of the Root Collection Model Object'), '#required' => TRUE, - '#weight' => -2 + '#weight' => 3 ); $form['fedora_content_model_collection_pid'] = array( @@ -239,7 +239,7 @@ class formClass { '#default_value' => variable_get('fedora_content_model_collection_pid', 'islandora:ContentModelCollection'), '#description' => t('The PID of the Content Model Collection Object'), '#required' => TRUE, - '#weight' => -2 + '#weight' => 4 ); $form['fedora_repository_url'] = array( @@ -247,7 +247,7 @@ class formClass { '#title' => t('Fedora RISearch URL'), '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), '#description' => t('The url of the Fedora server'), '#required' => TRUE, - '#weight' => 0 + '#weight' => 5 ); $form['fedora_base_url'] = array( @@ -256,15 +256,7 @@ class formClass { '#default_value' => variable_get('fedora_base_url', 'http://localhost:8080/fedora'), '#description' => t('The URL to use for REST-type connections'), '#required' => TRUE, - '#weight' => 0, - ); - - $form['fedora_soap_manage_url'] = array( - '#type' => 'textfield', - '#title' => t('Fedora SOAP management URL'), - '#default_value' => variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'), '#description' => t('The URL to use for SOAP API-M connections'), - '#required' => TRUE, - '#weight' => 0 + '#weight' => 6, ); $form['fedora_soap_url'] = array( @@ -273,10 +265,18 @@ class formClass { '#default_value' => variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'), '#description' => t('The URL to use for SOAP connections'), '#required' => TRUE, - '#weight' => 0, + '#weight' => 7, '#suffix' => '

        ' . (fedora_available() ? '' . t('Successfully connected to Fedora server at !fedora_soap_url', array('!fedora_soap_url' => variable_get('fedora_soap_url', ''))) : ' ' . t('Unable to connect to Fedora server at !fedora_soap_url

        ', array('!fedora_soap_url' => variable_get('fedora_soap_url', '')))), ); + $form['fedora_soap_manage_url'] = array( + '#type' => 'textfield', + '#title' => t('Fedora SOAP management URL'), + '#default_value' => variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'), '#description' => t('The URL to use for SOAP API-M connections'), + '#required' => TRUE, + '#weight' => 8 + ); + // will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php if (variable_get('allow_open_namespace', TRUE)) { $form['fedora_namespace'] = array( From 0f03463b96e3ab7544b15452d6472814b87cfc9f Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:29:23 -0300 Subject: [PATCH 057/247] removed an root content collection model --- formClass.inc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/formClass.inc b/formClass.inc index c3a3e14e..b94ba544 100644 --- a/formClass.inc +++ b/formClass.inc @@ -233,15 +233,6 @@ class formClass { '#weight' => 3 ); - $form['fedora_content_model_collection_pid'] = array( - '#type' => 'textfield', - '#title' => t('Root Content Model Collection PID'), - '#default_value' => variable_get('fedora_content_model_collection_pid', 'islandora:ContentModelCollection'), - '#description' => t('The PID of the Content Model Collection Object'), - '#required' => TRUE, - '#weight' => 4 - ); - $form['fedora_repository_url'] = array( '#type' => 'textfield', '#title' => t('Fedora RISearch URL'), From 0625e37cd0d1a4e609fdd92e741f92bc88b27681 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:31:33 -0300 Subject: [PATCH 058/247] changed weights --- formClass.inc | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/formClass.inc b/formClass.inc index b94ba544..69961b22 100644 --- a/formClass.inc +++ b/formClass.inc @@ -213,7 +213,7 @@ class formClass { '#default_value' => variable_get('fedora_repository_name', 'Islandora demos collection'), '#description' => t('The Name of the Root Collection Object'), '#required' => TRUE, - '#weight' => 1 + '#weight' => -20 ); $form['fedora_repository_pid'] = array( '#type' => 'textfield', @@ -221,16 +221,7 @@ class formClass { '#default_value' => variable_get('fedora_repository_pid', 'islandora:root'), '#description' => t('The PID of the Root Collection Object'), '#required' => TRUE, - '#weight' => 2 - ); - - $form['fedora_collection_model_pid'] = array( - '#type' => 'textfield', - '#title' => t('Root Collection Model PID'), - '#default_value' => variable_get('fedora_collection_model_pid', 'islandora:collectionCModel'), - '#description' => t('The PID of the Root Collection Model Object'), - '#required' => TRUE, - '#weight' => 3 + '#weight' => -18 ); $form['fedora_repository_url'] = array( @@ -238,7 +229,7 @@ class formClass { '#title' => t('Fedora RISearch URL'), '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), '#description' => t('The url of the Fedora server'), '#required' => TRUE, - '#weight' => 5 + '#weight' => -16 ); $form['fedora_base_url'] = array( @@ -247,7 +238,7 @@ class formClass { '#default_value' => variable_get('fedora_base_url', 'http://localhost:8080/fedora'), '#description' => t('The URL to use for REST-type connections'), '#required' => TRUE, - '#weight' => 6, + '#weight' => -14, ); $form['fedora_soap_url'] = array( @@ -256,7 +247,7 @@ class formClass { '#default_value' => variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'), '#description' => t('The URL to use for SOAP connections'), '#required' => TRUE, - '#weight' => 7, + '#weight' => -12, '#suffix' => '

        ' . (fedora_available() ? '' . t('Successfully connected to Fedora server at !fedora_soap_url', array('!fedora_soap_url' => variable_get('fedora_soap_url', ''))) : ' ' . t('Unable to connect to Fedora server at !fedora_soap_url

        ', array('!fedora_soap_url' => variable_get('fedora_soap_url', '')))), ); @@ -265,7 +256,7 @@ class formClass { '#title' => t('Fedora SOAP management URL'), '#default_value' => variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'), '#description' => t('The URL to use for SOAP API-M connections'), '#required' => TRUE, - '#weight' => 8 + '#weight' => -10 ); // will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php From d0ebf93be3686be50f7cf18eb9711b6cb14bde15 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:37:11 -0300 Subject: [PATCH 059/247] more reordering --- formClass.inc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/formClass.inc b/formClass.inc index 69961b22..4c0c5be0 100644 --- a/formClass.inc +++ b/formClass.inc @@ -224,21 +224,22 @@ class formClass { '#weight' => -18 ); - $form['fedora_repository_url'] = array( - '#type' => 'textfield', - '#title' => t('Fedora RISearch URL'), - '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), - '#description' => t('The url of the Fedora server'), '#required' => TRUE, - '#weight' => -16 - ); - $form['fedora_base_url'] = array( '#type' => 'textfield', '#title' => t('Fedora base URL'), '#default_value' => variable_get('fedora_base_url', 'http://localhost:8080/fedora'), '#description' => t('The URL to use for REST-type connections'), '#required' => TRUE, - '#weight' => -14, + '#weight' => -16, + ); + + + $form['fedora_repository_url'] = array( + '#type' => 'textfield', + '#title' => t('Fedora RISearch URL'), + '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), + '#description' => t('The url of the Fedora server'), '#required' => TRUE, + '#weight' => -14 ); $form['fedora_soap_url'] = array( @@ -250,7 +251,7 @@ class formClass { '#weight' => -12, '#suffix' => '

        ' . (fedora_available() ? '' . t('Successfully connected to Fedora server at !fedora_soap_url', array('!fedora_soap_url' => variable_get('fedora_soap_url', ''))) : ' ' . t('Unable to connect to Fedora server at !fedora_soap_url

        ', array('!fedora_soap_url' => variable_get('fedora_soap_url', '')))), ); - + $form['fedora_soap_manage_url'] = array( '#type' => 'textfield', '#title' => t('Fedora SOAP management URL'), @@ -258,7 +259,7 @@ class formClass { '#required' => TRUE, '#weight' => -10 ); - + // will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php if (variable_get('allow_open_namespace', TRUE)) { $form['fedora_namespace'] = array( From 4efd40c507fb49a7624f7e2c4494a70107a9fc44 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Wed, 14 Sep 2011 16:41:19 -0300 Subject: [PATCH 060/247] another grammar fix --- formClass.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/formClass.inc b/formClass.inc index 4c0c5be0..866e2e5f 100644 --- a/formClass.inc +++ b/formClass.inc @@ -282,7 +282,7 @@ class formClass { '#type' => 'textfield', '#title' => t('PID namespaces allowed in this Drupal install'), '#default_value' => variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: '), - '#description' => t('A space separated list PID namespaces that users are permitted to access from this Drupal installation.
        This could be more than a simple namespace ie demo:mydemos.'), + '#description' => t('A space separated list of PID namespaces that users are permitted to access from this Drupal installation.
        This could be more than a simple namespace ie demo:mydemos.'), '#weight' => 0 ); } @@ -291,7 +291,7 @@ class formClass { '#type' => 'textfield', '#title' => t('PID namespaces allowed in this Drupal install'), '#default_value' => variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: '), - '#description' => t('A space separated list PID namespaces that users are permitted to access from this Drupal installation.
        This could be more than a simple namespace ie demo:mydemos.'), + '#description' => t('A space separated list of PID namespaces that users are permitted to access from this Drupal installation.
        This could be more than a simple namespace ie demo:mydemos.'), '#weight' => 0 ); } From da46bfb18b924611a1bcaa866966803043c6497d Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 15 Sep 2011 12:02:46 -0300 Subject: [PATCH 061/247] Set the version to 11.2.beta1 --- fedora_repository.info | 2 +- plugins/fedora_imageapi.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index 1f31d60c..7e808460 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -4,5 +4,5 @@ dependencies[] = imageapi dependencies[] = tabs description = Shows a list of items in a fedora collection. package = Islandora -version = 6.1 +version = 11.2.beta1 core = 6.x diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index 76f8688a..7cf3ea54 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -3,5 +3,5 @@ description = Adds image manipulation support through a REST interface package = Islandora dependencies[] = fedora_repository dependencies[] = imageapi -version = 6.1 +version = 11.2.beta1 core = 6.x From cf58cec0bfe1eada3ff733e9b570cd23d6362e65 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 15 Sep 2011 12:20:59 -0300 Subject: [PATCH 062/247] Alans changes --- .CollectionClass.inc.swp | Bin 0 -> 40960 bytes CollectionClass.inc | 8 ++------ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 .CollectionClass.inc.swp diff --git a/.CollectionClass.inc.swp b/.CollectionClass.inc.swp new file mode 100644 index 0000000000000000000000000000000000000000..be96c5845215ffe475318a8f005b7360401f9414 GIT binary patch literal 40960 zcmeI533OyvdFLy(SsWGvjspZHd99Yas+*S7ZG-K|Ej4Ym+Lr0flG?N*cZw&~lT>sq za=ofn3&tTKI5?QaY&I~lAp|Bd;1H7#U?$*09OihN5EBN50ZzbdHrNL|8HO<@A@lq0 zckf%OUX`St@f-~H~l-S6I--Erl_0q?@W^K$$=E0=rjIgNu~{M9pZ z_qB4lM!nvY%d7oNgcZM5syF;q9vnL1H-?s%mxoG?){CYhx8Z3+Og=Aw85)x3PX|-rukGJ_ z-1ym`zy<|2D6m0+4GL^fV1oi16xg7^1_d@Kut9+h3T#l|38H{s%H?)a_s7L4XZ>Gd z06#q|mwO!i7(4j>8}J^`0EfUq za2fd8({s5mgPXytKocAU7l0o=EtmTQxD~t$yaT))yb0_DPXj;x#a!;|;BUa6fOmqo zfXl$?;Hv~1J`GNSUkB%dM+rzg3?2dx0>U1-ZxFP&8+;7h1YQFcz%)1r9w*507vMO! z0_*}8fER$Lg44i{2#mZ9JPG_GL6b+p=fDTS>%b-8*TB~Zc-#u6!9&D6UJqUXgzkSK zv|rDU*XyTRuC+q1f399@2DPTQtJ6pf2EG2Ja*1F0)f$kODYU;$MiX&9O0ULx zzf5<+E&AaBp~`49c)e>{UJM#RqTi*t;bys6f%g68cT~FnnpV(QDTd8Pxwhbqc=<4p zw3>*h`gqi;H{YmNyM&=?q92%1yP zM&MTqGA7%-{1r#WC$GwH_jYW(*wi3RY$}Ig&`h_q)iu%4K)HEM#q>!lu*0Vf@{+Y+ z*;8)TO9k7|wYI~JpxJ8Fyu6p!@}8$zNkzI)tOjA|F9d~Vq3^1C%PZBrTD|El`X>U< zpPS>R*Q|RwV?3P%p|@OaE|zOvbCGA7%&4ViQ1WU%RW12*fd>Lf|k89}X}aOjfD$H%5G8{dC;e9{{p_WJcgQLhxQoEU$3ao_mf zLz8>9n<>EmtuSarq+F=fXZ?y^)R%We>95bv^Zt-;N9VBUy{ML`Or=~cOOc&Bc4U+? zccVg@<5jHG{Zf%^u1c#E6!Lt46Y?GJD;NExvK3UtR+l})3(iDdltXygGZV){A}}RAMsK-XsdyAH z?2CN%Tb1UZ=S|FeEAamk$#3nQCOaZ@tFzQ28~r^J~X`LMZc;2 zxin~o(Y!&<3h8A=nR>|wtV+|iQ(BA6DywbgWhQx7h)8oUATm`u?>9YPx+-I*9iYXb zZQFAEQiip|(l2cpxzuy$-I(*+vVYrzNis=F1g$~l(X%11L$2v-o|5270uul;Q1&l6;8zJF>0`wEB$Du~KGxsm?kr)NOi2Q)rG%)UaJ5c(bjh7hpOy zko}$t0pYo1GYFCHJgs92S65qMleu98pDk`oDc7$Qt40!5c~y*=5hKu@#kL0vnAjYHq~{Ov`eSP%Rd*KoKylIW)R$N{OWZp4`vzqyDHG-V?QF?t70d97p&5l4nGG9mG>8;?Uvl3dJ?uXuBQ z4bc(S=gK^;Qmwg2sSul~5+nB;du2k20~?T#^-?2E3Yw!??^PmEnv%&brEQDbgSa=g7ZP7niARO&W{ zqEw!rM}?t2jdOES#(5jm3{J?kD)zw=Behs&BEk)7PRN||S7x!vyjk=d1?O8br0AM@ zYhh9KBHBzF=L34gXfLT+v`)w{M|y_IU#Bc8M%1E@I(3!7GH|jrntn zM!iXm({jU58;0XLJ(V_$9uB>*?$xCRsaymRoffg8TH4%ks@ktC`zs+FFGg%mSx?Cn z)6X+gN&lC&1uva1R|0*0*Y2gorJVTxXW@s|Psahp|CcrSPvY0#0d5Dc2Q{z{>;W$Y z{|0;sAOBO}CQtyIK_A!zo(vwv&wl{i5AFl^f=_`@fWHJE12=#ZUpCd!&B3A6Fh0EB9>rm^D#V1 zp@9v*?P)@3>__}u22(1uk+~vPSWq!#rDSG_D12aEv|K7i7bL8;)0tvDN=rdBNpa2) zJ)B9meyn%%rO@;^KQXm`&q0YNj2&oe5}I~nq10>QYBBf57R!}VA)mVADim`v-8qf? zU~~s)%J!QWba9Z=lF|gDvb#e+!*Uh#0Pa@1x9bE@E==_?l-HyqRbpruZZr84ex((J z`C~Kbcj3y#xm`msw-lGmoEo(;rd`R2GMdHEyO3nK!*(ud{B0MFF2Jls7~LP;HI(`@ zC%nV8z;Dbg7O_XGp)1vSiJlqrQ0e6!Y`?gxqyHXMtA!(di_PZJ@Q`fb8;mCQ;GEy5 z_lHl0<C{aBnC|$>@1G-SyO3|QrdQ;QYhy%C9l5ZHx~Nq=cuPP~%>-k!mD$5rmf_b0-<$?lW$+U*UC1D_(H29O6CMP&RHz zL!4?GejYTw%HfH<8pXh;YSqew=lbA*Wxr8l)+qIiC|83^D=gUHfU!pyR*B6gRI$bn z47;zJN&jz*_v+(|yf0%nVrB`YyN_@>=8L=4KCG%h%;2`)l8Z5edFior9q@L?KtOzFO{#d@9SHgdea?9ZBbjxLYd zZZoWOMx6G@jO zh<{yklDE=OS11AbwilFjC*%J=mqGrrUH?DM=LhibWu5;nAhCcZcoz6Ya3=WA`1kh% z@&A7lJc!SJ7x-&%JGc$}33xyFEpQBof4>(z9efp^{-fYF;DP^%zy9CBW8eqiKJX!M zGk7bw8oU5J8+-?U{%$Z1E(ANllffhS^$&sXfp3C4!L8s1a2+@V?#1VSKe!d#0&WJ^ zfjT$}c7d&6Gx#C?{~v?bfz9C8z^{Vmfu9ivcnCZIJ_9}p-VBa{gP;#Q3H$-Efj5Ke z!8mvdcz_teO<)@A2m8Pu5*xS?yb;_0t^*UG0G!+vK{qKLPX<{$mZc)>VBsROxG@$@m1I;h zRWVF&YwabcI}Hf&I#sS55V4|aB@)xvU&*_yFC;oD^UUiH7wgO8vZ6|lrzek$+g0TD z#kpiP=wVMHWJ$RkRg-Zq-KIWZ76E)#2#E3{@vPX8c)Q3(v#y?sL#um0*;L%$Y7rMM z&eYq8b$vgYY@&HR(aVu{xXH#P<375m`6kh@vUZW`n{;-Q_4ZWm=jB0_yoREAy)7E0 zUmo1rv1YC2h7(cH(ncpGx>;T-;=`DMisRD*qtqOGw0MZ22{}a4P3#B?H|q%Ppb>e8 zrg?7!k1laf`xK`m*w>TGut4`Nm~v_z>2jPcX!uSf=}5P-GkLYMZFiBi)=y>94UF1q zbmY^2COucvj7xEF6ik|Ir!e^5CNaz1FscIVCl~>z9I$x}TQi1_h;vi??D3Oxfzj|@ zf8ctyiYS3Z2!~Gjq1V?WG++f&J~_z`mrF7NQ<6X77UgyDjeKgK%w~m8=V59ROOcGr zw5V61i$_yt_IRo|cXKCeO4(XSF#kw%Vf^>)jmrbHU4G>SA5b1O+nGP8`& zP|z9V4V$zAWxiES<5O6*OXN<(u1%7_Q)b+fq-_(OJG;ouZlvxdFV`{*+98bGZ1Q)k zcgD+RmWryJVzC!Lkm5r3;_-vVKI>R~lH{61__NnCnM-9#(swM^5V=66Bmd@{Q3n|vO13}G%-a~FRCiEOJV;iMOb=h zI;7cTBCwZbgoy-H{k2xXmToZSg=9++k=Hz@lEz$@S(SX`37J=^1!Fg}+WF3zqA?kg z{nDNIvFmN@g-fUs*1*8;_xN${u{TJlu3nsLH7bRE{oXs@2XTtN8@l@34mbVkbBBn7^`#Q5CA2om)l_YEM2xXX$W&_dI;%U^ z#NbR2#h+`o$kvRxTugn_TYQSZTD-2~?zd1PvMa5fs2V;4C1y{r7;kftP>> z@zbvdJHgrD+xX)j2iJpR;1VGD{1=1U@yo?me;2qJycM*-6c_?81iuVEkFS0$2*IUb z8~8B(`7PjPum}!=%fW@%j)F-be!YytgV{bkBXdeW z!UrM;H<8-Xa5=;z-OB1`A{6T)MfvtjE+*`rT4`^6QchJY6l5{)8~$BW%w9 zPk?2fGUHu?IbNsDO*cs`a#`=mpJwXV4{}Wax@fph$edK+dnDW&ln(IL(=td=2*H%; zR?B*gu()5Q7s`Vv)=l=5R`m&SJ8cI&>7i%3*oDbfi3RngV?m++?Up|&G11wtU}ai*~nC{o_8^IC@c7(-Ez zOUQqjQh#7n{wU72NPIx}Y9|LqtEQ>Wh?lEYGxye8tD%<(sCBPdsJ-s)%9wSpQpvpj zN`)|%^xZ4p+Zn)1kas38^FHs=Sd6uwxSclc;l$)U=i#a%H0!uJ_G!7Bh|%{jm}k4qua&^F&H;_Kk*2F0VAQoW zNo0^TgWCn;WpWYXHYSFtGp*qEPN_j0Sq1KS-X`O5Yd%|J0Wqu=fHWHm%Ir={|5ciq zGP0M4V7dwi$dzRt*u{+rlX6C5z*He4K^_22`OmEC68SuQgv5Vnx{ob{|wV_PEKJK>KlNs<@t zrCDQZ!Ed@2nK9c=LMyhzIS_Bv(6LU z?ovatKa6ol2TUbvC~Ngay7vR4q9!s+(~xANj3rhZ-A+*i!YQoiBy$lv%%j+hi*I$& zDt((IvBueDYhA@rPcL5njC_f1t2^TVUx-`z1MB}U^7&)<`L}|1ft$f^f@5F`Ati#wJi7V|rzEM-`N>!B(Vj7#*4T&|PXoqOm*}Y|(quCpKbhlKu#1{9+MW5$ zoDH#reJu-{y&hmKbH`TiMc&S}4v5wp4TpKjp`kNPBhgi7gE)@ih6z8ZB$v&za_2C- zCwEHqxk8f;SWLzebN--k>0PGO~D?oo?QS^>nCouBVKfH-V2WtX9o z(+eA*EyN=e&M-t|5*n`>Gumw95bi8!=50DZv#pvg6`y+0#|eVS`w&qYnNP-~qD|q3 zwkP8G)a9nRtoOv8mFKMistiHAl1uD_SSssN3nrZDOFF(j%})L@`SFN?IQhuX-3B(r z=rmLesUXX`l*J+CLgy8`-%-dX#i^ObjB@HGZyyqtosf-IO>%|XVyxCJ+*I{8HBKb* zSE@E1wYa2l2G)q=0h5TNbLC3ejN$wh8|t<(C%t9YNKinD0wOVFVbFwH21fhY45dKm5MeO!SoW>PVtC*8go5paQF)8G_rd4hPMcKz$=#fsZ-a+En z51US}2ihzy?SqI>%g8`f8)2)ovuHXX4??X>XUlU-XtCf)eu7kOM40L87tf~81k8+j zcEZWyr{7%R<;C-Mxn5BXozWdrM(XQU#Q7W1ixP{7%<-sV-2@c<>5N_F0jt)cyJ2)F zLg(Aj4K)j*_SBP1zmT#h&V=1TNM4T>N#=dxmZ+}ZJse-fg>j7KXcw_k8y#F>#= zfa!W-(MkXA5_2+wH^*4C30m7!#vSRRxvcl3NsS%2-WdU^8^Sx6g>=nm&`4V$L&zaL z`mCQm9EjRe!qv%8_d7lHtOekboqCYLv607*WjM1{O*%%9S&8L7#1EUrKxXP(b*aF7 zW#^+%j)YGA!>vn^Bp6A~c-*vZA{7-P9z}u_?aNm2qb7mKs%Jy1fl>KoO2`LSy(7b^ znm*QUNG;a=Ttr@ltH?!GYs~5!n>yWT{VXLzucqYs>2g)uVO5;HRYeYp{%54DiD-8O z46@Lx>;JN=a)$ri`1cka{uqb&;K-dEf@e#2j9S-|8L+;;Mc*o z@ZmoWLU1lP4g3Q5Ab$KGg7<;%pr)6C4Aw{(la56#xDM zpb1_H{vJR6&EOIse*Sa7_wn1m2|fUB1g`}F$bm=j-@gkaXa5~w6g&_74}ADX!8^gr z!IQyz@ZTrE7&sf827ZR0{?Fhi;FI7jKz#ZpI0i<*HqZ~ggTH)E?oU+WDo+pOI&6_TD?j1N9QQJk5P4uFTRP?IH#({3CCPi%_ zSeq)6ma;Be2SIPeL``m+B0xQ^Ct;j z9@`=$Hcs)BLb8%Kw)Rb`h#Uey78zM1*uIF8P>#w;?1h(A3_GTdl~W=dR*QGBsqJ4P zC;{WiL3*lB-I$vgIIAgY7<;8zc|(3OT;IOE#E0cPK2y1z?Be>COp;2FVN)v+No}d? zAa7-N@7q@}S}}UfHZCGWPB6F`#Ft~j7`YwReJuVm(u++FO_I5S_FOQK^2OvN*t?NLA!0)9;tqhf41hq-UefXOY0xYgb{B zA)(rn6ICo9;Wc78TEOg)3fAc+N)h4yZJz!wD#jh}h4PIZ(^f-HoT;qnV-iGCBg(H} zQT0?xRw$V?~!4 zWO<21B+Rm5X8>!B;j4bDu+?nSgCH^@S6$*(c_IqJMp-c{>5@bnEMsN`XcBMVmKoGF zNRlYhEmy01_#~!MI(V{rrQO3S?ll<*bY2upTfNGxaEqH|=~1C-r~Kp79nA3?>O@90m$m6JSSR>~P=oCpfQNqgGi!X{VnuEKIu*Lp3Vse$ez4f`4sFGx1@juLC znop?}n2Eh667c5Mf|K=s-0IwSt^Y6I*(c}ye;dd?fUkr91U>}b24p`#5nKg!fQRt^ zzX1LtxDEUcI10wWx*;`G z)ea5$^KuL-URbNKV9q($X{RT$nnTuYD$`sY#mTwzarMTJr3(6H)F_%X%a=8QRpT%k zlOH!xoX3#O%o5om0O^j!oU8K!+?J$5qn^=-VQd)C^TcYE*o1P1(*fO`&wH!GkT`nT z#bDeqPqMM!xFJpn5sTrx&^UM#C-|f)qhT@b4w>&u(E6QWmms!yU_yR=iNJHQ8HC*& zFNAX^rHKoCsTl=#V9~4}8dKFdNV+s`CAm0A5`ah^-egUzgdQ-j78yHO zIwUT~B#ct%B_v=YmJ_;E>s)!c6LFbkmNlDV=5X}5xV&6j2qos8jGLu!B5SFYo@P93 z$KT#b9k%4?sP~iz3BKiWR{X@OF&*aiEoC|@^d3}^4Qn1hJvVVV{VflsDyM?Ppo;3t z+Eb@Zn$%{jD!ZTnEh25DQb7&~tS>uxAZ?}EHFs&yvdVlA5(JXdc8ZO<*%74sD-Ac~ zmm6#~cfN*HC1S_M@a$nw&i0Us+-4(rl2>$1#epa*x2#DLkG<}a95?4xMG+TiOH69F z$tgMC%oin09K3XVYTAA|LQ%gqVQQ;q;-rzxOI2<4dt#O*Z$p*TJl8`O>~<45lT(gL zF@%X{kd_}FW;WWWtmH3qM3(Y{rB&tuW?5!22c@`)r!_m`r#ePQy9uBy(Gg95IyqtT zD<%+?jd|Jr*kvk<8Hj+&F^o*u9+QbGJ*|^pwo-3*_wC8-&>M=>o3#}^ivJ=n90jgwu$%Tax&XXh9M66q{&4D zpd`x&ap_Z~gno}qV8e!T_=C&Fp*yb9PJ;bEqfZ-AdeI~%hB*w@1>G>y&3EOvcRaz_ z3VcJ1e0@$}&+|&NL|)cBqA}*(BSW3eB*s4)M^j^4N7dxAY@Ix<&rSd*p8HeXVUBa$ zzD;>kYp-ocoQUt_01;#=t+HmkwIaB zK^CHKYqAf=2{3U|jrNUhBurrG5LZO=^rmw?VHn#2N!{&iWv8k{$6KCc<}g7hlgi(5 z4>~h$b=BIzl@f-^+*T9mMwt%#%0ZOeSl9nwh>v%__5T<6{4jpK`2G)qJHa*JIJf}3 z1bhYGUh)9m4z2;0gJ**u;@f`{{0GnigW$*b_;-L4-~iYPP6vOEKmQsaYyW3~f53nL z2>3AA1UzsWcmUu1b3oSor@$z9G1v~afER$zE<-h~t=RXICum242_xSC931knzl|a4+;4s(@&II!P zf46}TfZqW{Ao&A3faL$ncK}`wBv(Mr2RH}hz*q6x-wxggt_QCH(_kBr?`L?7@sTmQ zFY@Ur*Y+d&O|%h7OY;3qtb&mksZk<(DWRBBhie+UJEhPfwWZ1~Q7|@t`o<#D)05DF zSyAd!y>DYt385=%0J`QRfwyP@G4g*@saeUSuhDVXXw-^X-d3s6^=Qj=kt2%6?R-hX zaEYiO!8!kE?095Y*6%Ha{4J84XL~gnlnz2U^HUFY-N+!%Kd3X|aMtk@G^8!#b#yGIZK# zl{5g8EW_fWVU|u-!DC7qvymm6NrlVg3~(%Ezhn+}mG?2+(MFEA^9hq|jXf2%>(W(e zF4%Q2q71Ir?qCJ+Cab!82*IDQcO!wQl=0Ryja|9!<*(#H{{hF#<8(fGVwZ1gGYWLMe zw=@kj`ZKaqqbriu7@X8~eliO%vaHCm2mM%@w_T-B=9(qM4U4t{(eqY14s&{OwLYxT zHjXA6PD}!4n2Nz>C#ZRGwYO#NX0{Z)0QuZnPJB`ORbsMgEf%|tU!<#!0+qc20;^dq z(N`u$MoTOo(yp=HI-#qDCW0qxoCzP%B>Tt+idBPwVl#bgB2-(94%?=)v?-Rfdc>~R z2IW@Vv$nIZqa&{)_Oxx=2*-YGROL9wt{I*aGmvvI)TqqT81ns`vwlgxGmw*!Eki}x z$<2)Tck)xT8Nx;NL`-%|D>p3_qK!*8mKyar4$yIpP1jj2!>Oq)wc`C5 zruVcIKTpn3y}?(~t`NXn4CG5^xeYOL@~Hmcf;u@$IVNwB-5YuWSf2N5`#y~1cU^?b zLwngGu*ZB;>`-HV=a71NeIjc_c3JV9B0kMcNI+i`0A4BI6KD=BnhhkZ7II`8V?amn!`d4N1X$ymTYt_r=E>y6_|%}55BFBoee;!a4FteNmdHudF1eL{qR zQ3*ZDLA;4n&s0z4IusGM+FP%>)k){0Y47Z?aBLcU6f_QBc6gutw$(86K^&IDZgWII zXvD%SS0r4PTun&#Lx;YzsH|~FIp_VE)LBhJ;Lh6Wkg`Y2k#tctYbzM@?X)?5-VC>k z&>qBESZ_6lO?Fe8ZO~bX9g(9X_8w+Rur^k2BuO2o9$CGtJV|_-Bk>lb=0m(Jr`v{^7h{pn<%n*?c0{Zct3?t#YFDBZy8cU>J1@@tZ#PVK AOaK4? literal 0 HcmV?d00001 diff --git a/CollectionClass.inc b/CollectionClass.inc index 921bd4fd..7f191c80 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -710,10 +710,6 @@ function collection_creation_form(&$form_state, $parent_collection_pid) { '#type' => 'hidden', '#value' => $parent_collection_pid, ); - $form['all_content_models'] = array( - '#type' => 'hidden', - '#value' => implode('~~~',$content_models), - ); $form['content_models'] = array( '#title' => "Choose allowable content models for this collection", @@ -762,7 +758,7 @@ function collection_creation_form_submit($form, &$form_state) { $collection_pid = $form_state['values']['collection_pid']; $collection_name = $form_state['values']['collection_name']; $parent_collection = $form_state['values']['parent_collection']; - $all_cModels = explode('~~~', $form_state['values']['all_content_models']); + $all_cModels = get_content_models_as_option_array(); $collection_policy = ' @@ -789,4 +785,4 @@ function collection_creation_form_submit($form, &$form_state) { $item->add_datastream_from_string($collection_policy_xml->saveXML(), 'COLLECTION_POLICY'); $item->add_datastream_from_file($thumbnail, 'TN'); drupal_goto("/fedora/repository/$collection_pid"); -} \ No newline at end of file +} From 592e8a689bca8c2597d29fda3c4d3766dd71df94 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 15 Sep 2011 12:49:26 -0300 Subject: [PATCH 063/247] Fixed naming and version --- plugins/fedora_imageapi.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index 7cf3ea54..e54e3f05 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -1,6 +1,6 @@ name = Fedora ImageAPI description = Adds image manipulation support through a REST interface -package = Islandora +package = Islandora Dependencies dependencies[] = fedora_repository dependencies[] = imageapi version = 11.2.beta1 From 22ed8b376b2b91cb31457eff2d27120171d8d389 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 15 Sep 2011 13:30:31 -0300 Subject: [PATCH 064/247] Visiblity Problem --- .CollectionClass.inc.swp | Bin 40960 -> 40960 bytes CollectionClass.inc | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.CollectionClass.inc.swp b/.CollectionClass.inc.swp index be96c5845215ffe475318a8f005b7360401f9414..4672c0ca8df7d485e2e91c61f6282cda6530a653 100644 GIT binary patch delta 419 zcmZoTz|?SnNg>G~%+puFT+fIB2m}}yPO2CA{pDw22w`MkD9X<-nYdA9ql<+AW60)O zfp&S`gFs|$$|!_>pQp@7~FyQGA9GWG$0NFVtydL!NI^V6Npc+Gcarh;<-TF z1;k}Q90J60K+F!rr`Q-6T7WnNh^>J5B`X8Nb|5YTVhbQ<17Zds{=>q+FbjxXf%qNJ z1rvcdhM7T%K^@2dIcXmg14A1ShXSz`5TBpCaia9Z1NM^@jU^{{7^`dN=BH$)RmP_z zmLwLJ6s0ES#wS(AmnG(urfR69BdKB zzq!MB1>Y9`1 MO?TMLWBnxs02FI$bN~PV delta 337 zcmZoTz|?SnNg>G~%+puFT+fIB2m}}y#6^qzuE?=4oGxWxD9X<-nYdA9ql<+AWANr$ zfp&RbekKNnd}fH!;K_mpr|WyU7#Jjh_zoun!(1Sa0%Bz#e!{`PAPmI+*cljJ0P$5I zJ_y9~fjAS0gMe5Rh|jYD#eldKh)sZ)35XA}GB7j)aUc+T1F<_0KVe~D=m%m8AifQB z!7?B&WM+^CJ0}asu>xX6ApQk(;yNIn&9rf&Dx+{MCYXHQ&|&f{V;&%_4#bi`Y`|K} zprDWfl@ZxoX`IW*SiJd}Nj{5Ua(+%uYH~?teqMZDVs5H}?d17M5|h{1aBuFjG-RCo Mz+G^&nDwg^06#!dW&i*H diff --git a/CollectionClass.inc b/CollectionClass.inc index 7f191c80..964cd457 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -753,10 +753,11 @@ function collection_creation_form_validate($form, &$form_state) { function collection_creation_form_submit($form, &$form_state) { global $user; module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/dublin_core'); $module_path = drupal_get_path('module', 'fedora_repository'); $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; $collection_pid = $form_state['values']['collection_pid']; - $collection_name = $form_state['values']['collection_name']; + $new_collection_label = $form_state['values']['collection_name']; $parent_collection = $form_state['values']['parent_collection']; $all_cModels = get_content_models_as_option_array(); $collection_policy = ' @@ -779,7 +780,7 @@ function collection_creation_form_submit($form, &$form_state) { $node->addAttribute('pid', $content_model); } } - $item = fedora_item::ingest_new_item($collection_pid, 'A', $new_collections_label, $user->name); + $item = fedora_item::ingest_new_item($collection_pid, 'A', $new_collection_label, $user->name); $item->add_relationship('isMemberOfCollection', $parent_collection, RELS_EXT_URI); $item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $item->add_datastream_from_string($collection_policy_xml->saveXML(), 'COLLECTION_POLICY'); From 5d5cd0024e7493ff8e39644d754a67e9a665d151 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 15 Sep 2011 16:03:48 -0300 Subject: [PATCH 065/247] added namespances --- ObjectHelper.inc | 2 +- SearchClass.inc | 4 ++-- api/fedora_item.inc | 2 +- fedora_repository.module | 2 +- formClass.inc | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 4bf1c31d..e575fb7d 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -601,7 +601,7 @@ class ObjectHelper { if ($pid == NULL) { $pid = variable_get('fedora_repository_pid', 'islandora:top'); } - $nameSpaceAllowed = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: ')); + $nameSpaceAllowed = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $pos = NULL; foreach ($nameSpaceAllowed as $nameSpace) { $pos = stripos($pid, $nameSpace); diff --git a/SearchClass.inc b/SearchClass.inc index 043a5e02..3f1c78d5 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -393,7 +393,7 @@ class SearchClass { $proc->setParameter('', 'searchToken', drupal_get_token('fedora_repository_advanced_search')); //token generated by Drupal, keeps tack of what tab etc we are on $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); - $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: ')); + $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->setParameter('', 'hitPageStart', $startPage); $proc->registerPHPFunctions(); $xsl = new DomDocument(); @@ -443,7 +443,7 @@ class SearchClass { $proc->setParameter('', 'userID', $user->uid); $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); - $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: ')); + $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->setParameter('', 'orderBy', $orderBy); $xsl = new DomDocument(); diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 06f65698..836e5b53 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -652,7 +652,7 @@ class Fedora_Item { if (empty($pid_namespace)) { // Just get the first one in the config settings. - $allowed_namespaces = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: ')); + $allowed_namespaces = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $pid_namespace = $allowed_namespaces[0]; if (!empty($pid_namespace)) { $pid_namespace = substr($pid_namespace, 0, strpos($pid_namespace, ":")); diff --git a/fedora_repository.module b/fedora_repository.module index 40d6fc74..4b6470c5 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1194,7 +1194,7 @@ function fedora_repository_search_page($resultData) { $proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); - $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: Islandora: ilives: ')); + $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->registerPHPFunctions(); $xsl = new DomDocument(); if ($isRestricted) { diff --git a/formClass.inc b/formClass.inc index 866e2e5f..c28a4a53 100644 --- a/formClass.inc +++ b/formClass.inc @@ -281,7 +281,7 @@ class formClass { $form['fedora_namespace']['fedora_pids_allowed'] = array( '#type' => 'textfield', '#title' => t('PID namespaces allowed in this Drupal install'), - '#default_value' => variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: '), + '#default_value' => variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: '), '#description' => t('A space separated list of PID namespaces that users are permitted to access from this Drupal installation.
        This could be more than a simple namespace ie demo:mydemos.'), '#weight' => 0 ); @@ -290,7 +290,7 @@ class formClass { $form['fedora_pids_allowed'] = array( '#type' => 'textfield', '#title' => t('PID namespaces allowed in this Drupal install'), - '#default_value' => variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: '), + '#default_value' => variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: '), '#description' => t('A space separated list of PID namespaces that users are permitted to access from this Drupal installation.
        This could be more than a simple namespace ie demo:mydemos.'), '#weight' => 0 ); From 4ec17434659e70e3a299a33b9d318b7454e4454e Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 15 Sep 2011 17:27:58 -0300 Subject: [PATCH 066/247] Fixed child collection --- .CollectionClass.inc.swp | Bin 40960 -> 40960 bytes CollectionClass.inc | 11 +++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.CollectionClass.inc.swp b/.CollectionClass.inc.swp index 4672c0ca8df7d485e2e91c61f6282cda6530a653..123bc8be17bb1a4e9c734830c761c06d0e4902ad 100644 GIT binary patch delta 664 zcmY+=O=uHA6bJCPNn^WRlcp+uRK+m_l9ej0p;&DirRc$f7D^FH(Pi76;7XcJC%b}3 zNEM`>gmi?UqK2a2K@aI7c+5ehH$h6li`O2C2%aod^uH~NKKQ|#nfK-mGuH~uwL)yF z@5;qX?9_>qgoqP)hPeDG-bPD3M8a|0S~J-^KNwdg{YrfPNOTcZiO_cGr0nj?R4Xx} zF6aamI^b)RXa(MZ4@=O520VkO@CXE4g%Rk7<=TrOT>#QbkENFi8 z^h&781b01A9KuzIyd!3eGItFwgd@_aR4;SWiDb#Pm|bQ?$7LqFX%>Q|#fz?;x4B5@ zdeCj>S^DVKnSt_j(4*_OaS*(X{Ws>HDeB)b^4HJ>MVF)5H}Xqem5qAN-^@0YZoy|g STW~AIhI7mn9`_&S3g&M$j+wRq delta 567 zcma*jPfJu`6vy#1*KssQb0XJu8z=4rnK}jyGa-Uz7}mmWEh@M?cE>+7Nl<>gcA{2H{5$il|eBBBCg})r;tzh|Bi@B&M8>%E zz(x#J*eny7#BKaOBQlK+RAQ@?LaddD_?X9Q6ky^4O0W?U8H0%wc8VDQ1tbxI6gP+* z21RCZ3;XP53Qu6*WLGPi$T%J#g&*F_`bS+%T{^SpLa7VXLSx)1(hAh z#AEi;nnu-cy~t(bSFY;Du;{w&4m?*`tJ}#t@n~&V#&%p)>t=|mNAe`nIAx?CO|)yi ybA6%6zn|RHyjSURZ?XBj_deYcrrV%$`+EDj4eucR!D~;I`nxx00{&d1t&Rb0cz@Oa diff --git a/CollectionClass.inc b/CollectionClass.inc index 964cd457..f9d906e8 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -715,6 +715,7 @@ function collection_creation_form(&$form_state, $parent_collection_pid) { '#title' => "Choose allowable content models for this collection", '#type' => 'checkboxes', '#options' => $content_models, + '#required' => true, '#description' => t("Content models describe the behaviours of objects with which they are associated."), ); @@ -736,12 +737,17 @@ function collection_creation_form(&$form_state, $parent_collection_pid) { */ function collection_creation_form_validate($form, &$form_state) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $pid = $form_state['values']['collection_pid']; $item = new fedora_item($pid); if ($item->exists()) { - drupal_set_message("$pid already exists within your repository. the PID must be unique", 'warning'); + form_set_error('', t("$pid already exists within your repository. the PID must be unique")); return; } + if (!valid_pid($pid)){ + form_set_error('', t("$pid is not a valid identifier")); + return; + } } /** @@ -759,6 +765,7 @@ function collection_creation_form_submit($form, &$form_state) { $collection_pid = $form_state['values']['collection_pid']; $new_collection_label = $form_state['values']['collection_name']; $parent_collection = $form_state['values']['parent_collection']; + $pid_namespace = $form_state['values']['collection_namespace']; $all_cModels = get_content_models_as_option_array(); $collection_policy = ' @@ -776,7 +783,7 @@ function collection_creation_form_submit($form, &$form_state) { $node = $collection_policy_xml->content_models->addChild('content_model'); $node->addAttribute('dsid', 'ISLANDORACM'); $node->addAttribute('name', $all_cModels[$content_model]); - $node->addAttribute('namespace', $pid_namespace . '1'); + $node->addAttribute('namespace', $pid_namespace . ':1'); $node->addAttribute('pid', $content_model); } } From 07399ce31483ee860e74457ffe972bba39138df3 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 15 Sep 2011 17:41:38 -0300 Subject: [PATCH 067/247] removed edit tag datastream --- formClass.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/formClass.inc b/formClass.inc index c28a4a53..762f1252 100644 --- a/formClass.inc +++ b/formClass.inc @@ -97,6 +97,7 @@ class formClass { 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection') ); + $items['fedora/repository/editmetadata'] = array( 'title' => t('Edit metadata'), 'page callback' => 'fedora_repository_edit_qdc_page', @@ -105,18 +106,21 @@ class formClass { 'type' => MENU_CALLBACK, 'access arguments' => array('edit fedora meta data') ); + $items['fedora/repository/purgeStream'] = array( 'title' => t('Purge data stream'), 'page callback' => 'fedora_repository_purge_stream', 'type' => MENU_CALLBACK, 'access arguments' => array('purge objects and datastreams') ); + $items['fedora/repository/replaceStream'] = array( 'title' => t('Replace Stream'), 'page callback' => 'fedora_repository_replace_stream', 'type' => MENU_CALLBACK, 'access arguments' => array('add fedora datastreams'), ); + $items['fedora/repository/purgeObject'] = array( 'title' => t('Purge object'), 'page callback' => 'fedora_repository_purge_object', @@ -124,6 +128,7 @@ class formClass { 'type' => MENU_CALLBACK, 'access arguments' => array('purge objects and datastreams') ); + $items['fedora/repository/addStream'] = array( 'title' => t('Add stream'), 'page callback' => 'add_stream', @@ -138,6 +143,7 @@ class formClass { 'type' => MENU_CALLBACK, 'access argruments' => array('view fedora collection') ); + //new for mnpl****************************************** $items['fedora/repository/mnpl_advanced_search'] = array( 'title' => t('Repository advanced search'), @@ -145,6 +151,7 @@ class formClass { 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection') ); + $items['fedora/ingestObject'] = array( 'title' => t('Ingest object'), 'page callback' => 'fedora_repository_ingest_object', @@ -159,12 +166,6 @@ class formClass { 'access arguments' => array('view fedora collection') ); - $items['fedora/tagging/add_tag/js'] = array( - 'page callback' => 'fedora_tagging_add_tag_js', - 'access arguments' => array('edit tags datastream'), - 'type' => MENU_CALLBACK, - ); - /* Export functionality */ $items['fedora/basket'] = array( 'title' => t('Fedora Basket'), From c0e183fe1693ec25a90dde07fc16065c193a9cc2 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 15 Sep 2011 18:01:43 -0300 Subject: [PATCH 068/247] Removed the fedora search block --- fedora_repository.module | 65 ---------------------------------------- 1 file changed, 65 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 4b6470c5..3ffb32ac 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1319,71 +1319,6 @@ function fedora_repository_search_validate($form, &$form_state) { } } -/** - * fedora repository block - * @param type $op - * @param type $delta - * @param type $edit - * @return type - */ -function fedora_repository_block($op = 'list', $delta = 0, $edit = array()) { -// The $op parameter determines what piece of information is being requested. - switch ($op) { - case 'list': -// If $op is "list", we just need to return a list of block descriptions. -// This is used to provide a list of possible blocks to the administrator, -// end users will not see these descriptions. - $blocks[0] = array( - 'info' => t('Repository advanced search block'), - ); - return $blocks; - case 'configure': -// If $op is "configure", we need to provide the administrator with a -// configuration form. The $delta parameter tells us which block is being -// configured. In this example, we'll allow the administrator to customize -// the text of the first block. - $form = array(); - switch ($delta) { - case 0: -// All we need to provide is a text field, Drupal will take care of -// the other block configuration options and the save button. - $form['fedora_repository_advanced_block_repeat'] = array( - '#type' => 'textfield', - '#title' => t('Number of times to repeat search fields'), - '#size' => 5, - '#description' => t('The number of times you would like the search blocks to be repeated'), - '#default_value' => variable_get('fedora_repository_advanced_block_repeat', t('3')), - ); - break; - } - return $form; - case 'save': -// If $op is "save", we need to save settings from the configuration form. -// Since the first block is the only one that allows configuration, we -// need to check $delta to make sure we only save it. - switch ($delta) { - case 0: -// Have Drupal save the string to the database. - variable_set('fedora_repository_advanced_block_repeat', $edit['fedora_repository_advanced_block_repeat']); - break; - } - case 'view': default: -// If $op is "view", then we need to generate the block for display -// purposes. The $delta parameter tells us which block is being requested. - switch ($delta) { - case 0: -// The subject is displayed at the top of the block. Note that it -// should be passed through t() for translation. - $block['subject'] = t('Repository Advanced Search'); -// The content of the block is typically generated by calling a custom -// function. - $block['content'] = drupal_get_form('fedora_repository_mnpl_advanced_search_form'); - break; - } - return $block; - } -} - /** * fedora repository theme * @return type From 5912f5141e7af2fd09232a41ab6df8718759ab8e Mon Sep 17 00:00:00 2001 From: William Panting Date: Fri, 16 Sep 2011 14:55:42 -0300 Subject: [PATCH 069/247] ISLANDORA-336 I removed the unnecesary object creation. --- api/fedora_collection.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index 16659c7f..b8afc5c4 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -69,7 +69,6 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio */ function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $collection_item = new Fedora_Item($collection_pid); global $user; if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { From 4945479b9eabd378c9584f06831c0a1f3bb39dea Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Sat, 17 Sep 2011 10:22:35 -0300 Subject: [PATCH 070/247] Added file validity check to function add_datastream_from_file --- api/fedora_item.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 836e5b53..13f126aa 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -76,6 +76,11 @@ class Fedora_Item { */ function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { module_load_include('inc', 'fedora_repository', 'MimeClass'); + if (!is_file($datastream_file)){ + drupal_set_message("$datastream_file not found
        ", 'warning'); + return; + + } if (empty($datastream_mimetype)) { // Get mime type from the file extension. $mimetype_helper = new MimeClass(); From 5c3d8989549c976db6a37e068ebe5922acbffbb3 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Mon, 19 Sep 2011 13:59:57 -0300 Subject: [PATCH 071/247] server changes --- .CollectionClass.inc.swp | Bin 40960 -> 0 bytes api/fedora_item.inc | 5 +++++ 2 files changed, 5 insertions(+) delete mode 100644 .CollectionClass.inc.swp diff --git a/.CollectionClass.inc.swp b/.CollectionClass.inc.swp deleted file mode 100644 index 123bc8be17bb1a4e9c734830c761c06d0e4902ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40960 zcmeI53vgstdFMNrhYc7TyaWQy=8i_5)(j){j2%BBk2D@@G`5_1d89G+j)$hDzLJ{h zhupV&G=g;q-Z(fAz`Sf=W5;oz5(6$`h!fZiacvw@wqch*C|EC~0w#a~yTF@eS*H@R zzwdnK+3anFLodW9=Sf{``1=cC>|1kwxOQ+}lh4*_FxE}nR z#k2W+3>>w8KZoD11rOQ3pUdw>Fhl_<^E_}JxYhoBI-i^1yY}xh_`Cp)(2zWTntTR- zVgKgi`p-HA)+w+~fprS3Q(&C}>l9e0z&ZuiDX>m~bqcIgV4VWb5Cux*Ty8sc-!D!% z>;Do1_{Xzyxu?O8z!Ttc@ZZ2A;9>9?PzA3554i@|&*lCW{3ZB9 z@Luo^a3weme3f9sr@;yEE8qg~Bms%jW(x0v`vrfj5E$Fa!33rwMZW zF*pXU20Oq-;FaKX@GS5{0weDN&jJ5H(Bw(*8So+S8{l&AOWwy-d~^S{8qKbznqf5>4o|drt9@Z@Hf$c4?`Sd~j0A&Al`_BbCu=}nW~lRRGMY&8 zQTjF3|7Cg;Zm|^Y6RM2IgV(>N<;AcWdi^fXjkYSSDzqOozvI$_H?+g%N-=6REA@q7 zEXYTpq}9Yk)yLyjgZXBo7VOyAtT-O1%+pM|lCfa_;k|n|2XC;gbli4zUl~@H!shV! zLfD#aHN#SENXBGqkiYuybWZFWs`HBf2YP&Iwh3heM{ zgS=!tTn?0*_0o`S=tkS&X4q;s>p?!qYxyA1tfV4cDAvL#DlLRVt)YSI8ttIm2X#{VbObWEpeG@rB;z5 z+qZ4YC}r-(g*3;jSZ$QbMY6f7?Q%Gj=L4LO?|NUkSX!!BK~-$GD%HqQXw4P*yr7lL zx9cXiEPy!=g;k_hd5Uq1EQ=1t492?&vqMJrs`k&ATHajPQV<5)5?p2(thKTf2KLet za<~>$kjj?O-PcVEsmrEJ@R#1|z z%GhZKXtA(mOO9X4uy$Amr7a_u`VPGtbADU)@0c(?lcYq@Dr6o#D+FC~O<(hr1ZUit zc)q2&)JG~lGt)`uTs)x+Z^xA6L)_o7HBF$C&j=kWWwy(7)@h+$(<`1rb7Z1Mof09K zZMT9D)2WH<4^#*U&-u+DM0)eIjwxJSYey~Sh7o+WxG|+%zf!CkOIYPqF=ob$KzAC; zGVxrTCaVO`8fQ_vR=Lm%lWDsKDXjG>PdW)~G`6U@6(cY$%f&*qSi}NFz_jPk=-Tx@ zgPd4aCet@Ha@KA!mCPUqq_Tz)XF>AjB0kWR%`n2~9Wmv#k_ki{8OF#2?_oC{2bLtc zm?2*Y=1O%$N7R_B@VH8~)*_`MY^G}H7Zyd2NJNx}BG#l|(x4r>rS@#KGAG8A%UzBK zMc!YAZmC&0E{%B4TvG{`)j+b!rpI#!8&tm1?@43z?-M(+`zh_380gZ&i35B0Vn<9J z*k7F3yK8#7=v^>2#PrOe$zA*CP`=}iF`4X(uBNtw2lh@)TvyDjPw!D>3)Bpc%e5Nz!4f02SYaZ<4QfuvoGY!&Vv_~4=s60` zw`EAtHI4SdqUuGonKsS`^oY@3QnhHEh+&TP43ob>SyYUu#S-e&RR+tz?WMX{dcvEo z%8_8AG`DEfo76ZXHw?95IIh!EX~XE@D2N(CLu!!9MG(t%^jzzOV#DlN(9G? z5t~!iQ!*v=3(Qo~|D|ogW%HG4sL$`%xwN>H6aW8ie9r-VQStv}P5zVk_4k2$!J9!H z>;b#LW#AXVm+|pG1#Sa3g0sN$!5QFm@Fafzm%t~%C&0(Sec&!|C%6N=A4qKAD7YMK z2gBg|!~s48UIVs*7l8kX-~Uc10Upb8O(qe zfrp3(ycwJWzDyk8UElyX6MPxJ|90?K`1bdK{|IgYEpP~&3!VcW!r#9M90Hes@8IL# z4_e?ta2ojM(}*E}+rj1F`_TC9;5sk}gyv7L)%RaZoFL=b8{;1Yk@a{M8m-3AfHkuV zO;I~~$9ziuEOtB?J0=BBk`)n$14h%J-ox7Pc&S`2mP@UYvT;$I%c5}M5ZbFPSSFn;wesbB6Vl^3g}*$^5VCvbRNTvF3*H81r4 zfI{dDGg`Y^5E_dI&y2B@`fMzzh}{rYP1%5-%o4G~Yu>X`F2)xm5Hq^nSr2`ROG$)Z zan2AuI+AYwX#e)hk?C@NYI^Uk{o(>o?CWR}n)YI$)O+F`z`7HQm1=n?pSt5J6bmTb zISp1|Cx!_3&YRdENnFm-(!@`)yF)*tN)3$$cdMz^a{?$ArurDkYtoS#VIORbBl+W{ zYCDYbM~|f6g)5ilb`(5rSu%5K+=fMV_!DJ3i=lTEQjZ`!f?x-YF2Jls7`-&UqmcSj zpD09OsX4b;#DuCv8fe;)afzN8i$>|?9_+lhqpSY`RI5j01BAK$uLUqHCpLr`iWhJZEfx(otnJGB@`&<}jxk^;9)} zQ-SS5v{E0bR%S=qwNjmM&TNTpbklw0L{uISa&$8VBbwi_llKaaht0?|xqW2Y0FKFA zqYSaf1`f~c8NOs-rz!5uAPQneh&?V5VN1zkDJnLM`O6?RODh^56Jyq!vVC~SiLT^n z;UxOqCER**V%MX#iY)onyB2TkMcCLnysNy^s!EHr(|3q96Xl$egn~<@*5XheDabxW zq*Q*7iJ2D<#fmV$S)^Q{QX_a66(*X5)=SmmL={#yI!|Nm#ra0H95#y!&2VL8slH&Q z+Mrfz+UVbEcbv@3e_MWSp|!HO1a(-W8LCt}rCK~4rM09ZjImGXjmez2W$-Yx5E<2; zC5AX;1lHDIlP9>0L{-Z+<;W+ZP3>Caj|J-F%ROW4W`x7G_@12WL?9&s?SvY~q7|)X zR2y4Zn;&f!Rxsh(p*&nbjM%uQ81@n*E(J(h7_LHaw^f<1gw27?W_*mlZ0?DPWPN75 zn^as%o9WX^sS4rBD?xao65;3Apfe6bQ`}!0C>}9h#lflF8gIb+Y1bq> zvd+7?2=hto+#6Hvt4{8WXG1eOXv>o^Vmh>oSJlaVs&owx zcHWYU$vg`d5D8`CcF781!c{1gQFjXd8D^TF6ST$rCWlPIr?Y59#Z7tF1^ zGIo9|CC$t_;;tNJtX24@t1XAoT(e@7gROjE!Y(H=5G=g~`UH$6?(1yG%18wkBmg!a z$8}AZWO=cIA;d!~##@d9EN0Pz{>V!-!yDR_W?0syn(a_JDmPR;Mdo_i&WhY4$xEV) z=Z?)bPGIB2H)S=6EGNCNU5FDUCy#{YjA zqyH7V{(p?mU%QmBsHLvI~V8tYOo^$iIDjMJFX_t)l5_<7dU6>S=-mZVPOUCo zj~--#q0>s9thUcC+5U1Y6w`k8dYYU8R_|KTAQY7OtEyj~JpeZwZ0#%$ldrV22prV1z zB&bP@N*X!3IoK(SniBPd*nZTrEG5azGCt3ceTz|(R-nvxQq%hsR_(mp31jsG(0et*pdG^c&6bE=>z&E6nWdtbI5OK@bRu~m#f9$0 zlLu9AOvD9s?L?AmyjXI-Wipq_+cYIB6=7wt|yU(vR6$+WD7+ zT1Jlf7msW+(Gh2bIsvc6SEr@?>H@OR#1v7zsH)H|h5by5u=LP$NwY(e=VDhJvWzg1 zfU3V%E7;NvCcNOc6cc&XbILd7ddw>Sk!NIHr523c%kG0w? zD@2>-tL*X3Hp-Z0yKT}Wmoc0Fw27nM7RDrTXH#Uf$5^Aj z$>eB_4G{ZGWiwgsk+#Q(iZv_Zc^A=)L*2Q4MV^w7stuM`iKg$In#ubA0et>%TL1sG@);lhv*6zY@%>BS z2zVKI5`X_=AOhRLQ~2|L4ITl10^BNkQ2TmiO#kKmu*0c4GT z5gY_pfs4Tf;C!$ZJdMBpdGHAM1b82~2^<60fK=P4$99q-=ie_n6Q*fH{a%zc4NYhGJ_1vvd zLgiU*`k+uDQd#GwpI$p6aYFM^?{>I|?u9T|jXf=^!}7s7U9PgVyMtN1m!*q9nly_f z(Z6yFD~S>$rh0M>Zw-dCZ)sfUqTxOvv#-K;Nw_yG@8hj!WRT(zf+^FhmbDsTNxw`l zlm}C+>-Usa^$Dg`U^^H{4+GQ19!z$USkOQ^79`pnmamtqVRIzd-*BJdfi`KY!U-l0 zG^{}%RFsPrFqKyw^pV$ai)1d=GpNkEOIDPX>Cw{OwIg|%lO}*ZXgj!v3)zpFoV?Vt z#w*KySkuu{Pwz7s>OCIUMO-sOZAV}Vgh1BgOk*Wbth`<4wG8($hT-j(m} z4&Zs@J(8DspLaPy#@hF8r;U3!(ZAbO@9~n3LA*slZ^i8&zzKH z{ySAJ#PEfw_g;R)sE5yL<_qbrVIa)2)#leq(!9hsbpCuVXRyev0JIiG*eM9b>&sonhyqKLyx_1(F2$m#c4)@ZmvBX0vIafi+ z7}(HIoGwY}7CzS0ioAJ1xWSYY)+#M6g>^~glKlr}KUA2k>Ga?)$s58EOp7jiQ4LVv z`q0N1R{vtWJh4xz5(bfhwohofm|N`VQQk6%2G2Xonspwj)!gn;gWn&{B+XP0@Dm~qLi9$IB!L+IIMt6jxWPcMn# z$G$|b)gAHwFUGC>zV-hX`TTMG{5!$>!0q5Q;3${|c_4WJAHetjP4MerKiB}Cz~6rW z{1$j4SOzzM8mNMKa5^{*JV6ZLi{Jt9Dew+(49FP(|41C*&%g;Fd;TS-|A+Yhe+}*i zOJE0(T>fW+f5QL&6exq8;5+#Lp953i0`Mwu9{4xlY;YDh1IXV0yTKjcH$eql0S3W~ z!3%)w0eCIA25bRmg5M<;@K$g$I0F71_y)0nKLvMzTR;sQ0zbs}|1S7*@cZB`;6H$y zz;$38yaJp9zJ~w*Ux4fpkn;f+!9K7JYz9L>#_4;f79T)>x%{7v?8wv{Z<7&BOiUb4 zV?5_MFMy3SrDm%j8gW>psEe(|=C7Z5G&tX`RwXl1(_17d#Z)Fs#d$BmC2rh3Z<sP&mUh5?{6bjX8`PCj6w5TsF@NFCB#ULuin;DfP^Qp&8 zb6M|+X)4cK15_D;cqNzERP^l5hTSJ-TTC`giz4Bc&DQ;beS#fS>B zycbyFMp+G<57!C z8fTDHBpxt{NIFW_ND{2(SO@%=P`8aa=`FiPf&%gih{TYEK@(~j9v@^gq&9$i;r8}M zyCjZf9b$f|D{FogvD;&Dnp8xsVopkJ8pCnMq>#&`xfW#~=TM(b1?nAm$9~vN1$v;( z;?f?77`KcJM70sNN;`|D1M(o$%5=5@w}h4m9{&@h>L9|AfkE+X228-rsAngfgyw_h z3NJ67x6Ad4Yv_*dm@-mduOiOhh+ovC-dl4#u2^?e#eX_uS9!pywfJrnABxcZc639{ zg19~PB-1aXEQ&Lc>}Iqg$-Ga}64ed5hm)(gFpjYt?P6Bypo1&S*jCs=P}a>O!gJlU zOgOh!B_<5oD=rvwYWBPKjVV%An5;*;GFv*ki@>sjsIRCasGoKCV(Bj4@;=jbZ_!Er z?h$k9C9Q2!IYy~NNJ|&ZWxXd&YV5%E&InN55Z)C%K#<9r(TI_@LWYP#di2>+`fwm> zPYG8iL*4K6)U&$BB|G&YgJUCJ%rTtV_a_}A$gIS2ACiZSgk+}9)s}{suWTa~%8}5i zf4Frik_2PPnT(s(O{Ahq#G^=%qI20QdDJ8jS@mpaH9RiAObPkms&{0tFTQ5e$J!04 z#kzkLkyqg=66%b3BQik~QHTpoc;N!+E#UQ_1&#t)|9>fX694{# zpaotB{suq(?cj1Ce*R0q_wd`l0X_(B1vh~ZZDGHtO^N#&PCQy}|y~YD}{26XCdBMLvXH`smd8nS>{dO6T>FbUFzODaBWO&7fCkJiw;uJt3DeCda0TewS{0E z3P)PXx@;W;y_FEv-%mwUn=E1yhE_N-P9MCQL$D<7oZ3^M(_8F+S(-2d&D`ft61)Po zMMxN&;wgn>C2wNwn^X}wQGqNnvPQ6d5halvmE#{Qkc_Eg<&+4A)spRPYWtT7O2Bw> zke=#OH|8b=&T5Jp#zA>j-jJUR*LPqy@nP9&X)2eKU0mP%Bq@&!8`@qZwXLp$yp=r* z!Lp_L4X&yVE+RyZ;nE6|%L!qO+>RP0EdC19Cf1rU$&y0q6DYqQv;^(Ad&+#jRBf~6 zJ}UI6*BSh=h3j(g+#Ac9RJ`_|6WYfw&@tvr4KHkGR!mTC6qg`BDTHLS$ypELu;dRD z^cXg-OG0tEZm#*uQXB;$e74;Q38~Ipqct=r|Lkm)#VNIAY|FB zoBD_I3^Q5Oyk{ntk))VTs*u$uNxl1N7j?tT{S`uQ*Hif{Kk9>tYc4%-5JYPI%hcercDvBJ}z;6Ck z<)w{RGf)RZo6uK2_JCL@JS|(lImm(Gn9~Prtji^!; zi>j|uvP#+Px|a}`G-;3KTp@2;bfYI~^i7%RTa zAe(8O)N0wVJAk#y@YSGI*lM=vaTpnqs~&NyJP`$9qpX;fbV;HOmNByeG~U~HWCryN zl6XaWYwM-*MQ2#Z=UaNGTaUa~z7$iEy=Cnxc^q{PYvkYoog$tSC0u<3&!Ajk z@r$FBIq67i=v)&!VizbSl<5{I69LrK_V751n4yWl73a(`0tik@im^;+_6=qNCDJlu zM}B?}t5iV?`ytPc`@sC~Z^2)I4}*6B*$+?z*MV)|as2-; zg8vNe0dE4=f=Tc+v4B4VvM=Bb;Pv1az_*A6yc^`fQ~3U00&?d6eL(j7-v-_bTHsnR z4&;o#f1smJfX{*VfD_<)a3Ode_&eeO{~dev^@@NGc$|36HO;CH~y;5r~NgBOASL!96)a2s%Y{cq&+95@QD z2bY6!Fa|CL0eCj}9`S@PflmX;8<6h{xB(mkF9nYhLwFF}2o8f$@MGc#k|*%%U<~X4 za+csmAm<5g06$?YWjwznV`_ec<*a{$Eu(g|V_nZ37b8%n-(2iMqaUn>P+cr(Y&@ZP zEIFyRP$^E+RQ$oaII4?8_-XsY=smf?rjJpHo`x3N%XV`hf77t9w&o2>pE;fU( zo8yIW?&Q=`J^xmY%qE>*PBt~8;0|1xEk(vubq;s)5$55 zUonNKY|hK}#~xEz%s>QGj$vfN_L)pn8EBpSvXurqdv8x>hgR59+QfXD-)QHqv4Of~ zLc%6RPX=ST-S;MW;tg0%L>=hp?g^jkWTn@|`q29sO*@hZ* zh+K;UDKu*m<;-a;8;#+IQKoTG+~-QIU2{1DV*N$hfkCQ)9!K(WtgiQ-T=uiQWEhg5 zPnujr0Lrp_kd!`EO6d2<*ps_V(y7bFp*yZptnChh{Xe5m2T}UbBq4@5S=R;KFw@O< z<+yh|&e;l_!y{jx6Wa5<(kzjeHII0Vt*2p9A?b`a{_!}P8aq0wCYNPv|KJxp0i1Xq zOm&Aj&T;!T@=r+9)%$!3yT$!2{DXZ0?fCg4vK` zWNPPC<2Q9#9Ik^>*a7iXj<=Sa|cYa3zz)nu0aXQDb45ynU8D zRO`8s)iiAwvb`f7aK;~@Z>)EZwPl4`VXbi*@&r9)g1&C{RG4bL#P1$^D@Y-OjaM8{j6 zWacnID3i+HaSu8(?&PYqiz_7zmAS1Z){Qb9_Ef@Zd73RmvPesm*p9AR4V~wBq*bIz z2C^rXdS!(zIu&RVne3-nr9Z45(;+4ao0@v6)MSNN*ZwPQH-M|ai@^`@?Y{y36KI1G@FRTu`@nIq4{QdffluJizY)mV z|5@Pg@ZUcQJ_0s?06YtP0pI;IK-T=H!8rJ3uoY|quLPgRUw;_f2kr$Q1s?|D>wgHm z8C1a@AZG(?2j9V`zYF{p*bTOVNATz04;tXrAOPa$zXXV{e*?U>lJ9fB6o;TY%&W$oT*-1v&6l{PuT)-v+mUH-Z_k1)K$* zVtizbJ{$Y=l7aRg$x}?J!!?cFolI`39iRGAu3{X6a@XJSN|mjV;+sDqJZCs$(ga%I08Kc^|_a9pp$lpTtf(N3~Z^ zh3$HDRhskr3W4GwOXeSEL{FIffndLEHk0oZ@cadnXoDr=n;VcItH+{I4GUVLnaRkh zw|*D!qpka5!&Xc;tcuQ9R>t}7bY5qnGcet6=bDG*Bbp-^bIoR%%$?U%-P+(n@~HKt z;Z>Uh8sE}1(D={TPK~cfT4Q)Z*ZIjTz{s*9%O3P&Y2I;_LYZrp5H~8?3PjIa={U-< z#&utSlpFXP@%QdX%o+_OA!FSl5^;>gZ3!Z6>VI)vD9qLae$6%Y^K3-8BR@o zsh#Z4FukXxZJamn!`d4N1X$ymTYt_i)D8_i=%%~%GRFBoeg;*Lv|teNn&K#gUu zJ|V*JxP%_%AYL!kGu2bM4n>5mb~kEnb<+80+B-We9GeCoh0TLk9^7Nk9gQ*{#9=w; zHbIx=&J7dCL zX1HC1c0bm_TB|u|vYR?=gYHV~h+Ioz??I*nYh#V3PwFJ~$m(U~N#fHSiMK$0@wn{Z ze1qi%KQ3YBl8J2FV=JS}S7u5J@-9Ppt;K0agoJ(CF_D@Ej^X2O>tnsSNJNoM1#)F= zlwP;5acZMckgmsR+2o{fp&-HLWJL5}ZrSu^Gihyp4-DNJUj2_s32%Dv9!d0!5tz`0 zML)gRzPXdn-f#*XsUXvQNS5Vv+c5HDBKEl)(T&)SiIrltSc1pxN~A&8e`$03rMdqL D34Nub diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 836e5b53..811e186d 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -76,6 +76,11 @@ class Fedora_Item { */ function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { module_load_include('inc', 'fedora_repository', 'MimeClass'); + if (!is_file($datastream_file)){ + drupal_set_message("$datastream_file not found.", 'warning'); + return; + + } if (empty($datastream_mimetype)) { // Get mime type from the file extension. $mimetype_helper = new MimeClass(); From 2819abd5f8b68ca4455cf97b9105b07d710e060c Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Mon, 19 Sep 2011 15:14:06 -0300 Subject: [PATCH 072/247] Copied from 1.1 --- xsl/advanced_search_results.xsl | 515 ++++++++---------- xsl/browseIndexToResultPage.xslt | 893 ++++++++++++------------------- xsl/convertQDC.xsl | 72 +-- xsl/refworks.xsl | 298 +++-------- xsl/results.xsl | 476 ++++++++-------- xsl/romeo.xsl | 101 +--- xsl/sparql_to_html.xsl | 455 +++++++--------- xsl/specdwc.xsl | 177 ++---- xsl/unfilteredresults.xsl | 416 +++++++------- 9 files changed, 1379 insertions(+), 2024 deletions(-) diff --git a/xsl/advanced_search_results.xsl b/xsl/advanced_search_results.xsl index d94ca7e9..bb57c47d 100644 --- a/xsl/advanced_search_results.xsl +++ b/xsl/advanced_search_results.xsl @@ -1,48 +1,48 @@ - - - - + + + + - + - + - + - - - - + + + + - + mnpl_advanced_search - - - - - - - - - - - - - - - - - - - - - - - Total Hits = - - , - - Number of Hits/page = - -
        You may not have sufficient privileges to view any or all of the items found. The objects you have rights to view will be shown below. + + + Total Hits = , + Number of Hits/page = +
        You may not have sufficient privileges to view any or all of the items found. The objects you have rights to view will be shown below. -
        - - + - - -
        - +
        +
        +
        + +
        + +

        Your search yielded no results

        + +
          +
        • Check if your spelling is correct.
        • + +
        • Remove quotes around phrases to match each word individually: "blue smurf" will match less than blue smurf.
        • +
        • Consider loosening your query with OR: blue smurf will match less than blue OR smurf.
        • +
        + +
        + +
        +
        +
        + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + + + - - + + - + - + - + - + - + - + - - + - - - - + + + - - - - - - - - - + + + + + + + + + - - + + - - - - - fedora/repository/ - /-/ - - + + + fedora/repository//-/ + @@ -261,111 +224,99 @@ http://islandlives.ca:8080/adore-djatoka/resolver?url_ver=Z39.88-2004&rft_id=http://islandlives.ca/fedora/repository//JPG/jpg.jpg&svc_id=info:lanl-repo/svc/getRegion&svc_val_fmt=info:ofi/fmt:kev:mtx:jpeg&svc.format=image/jpeg&svc.level=0&svc.rotate=0&svc.region=0,0,100,100 --> - - - fedora/repository/ - /TN - - - + + fedora/repository//TN + + + - + - - + - - + + + + + + + + + + + + + + + + + +
        + - - + + - + - - - + + + - - + - - - - - - - - - - - - - - - -
        +
        - - + + - + - - fedora/repository/ - /-/ - - - - - -
        -
        - - - Score:( - ) - -
        - + fedora/repository//-/ + + + +
        +
        + + + Score:() +
        + - - fedora/repository/ - /-/ - + fedora/repository//-/ - - - -
        + + + +
        -
        - +
        + Text Stream - - - - - -
        - - - - - - - -
        - -
        + + + +
        + + + + + + + +
        + + +
        diff --git a/xsl/browseIndexToResultPage.xslt b/xsl/browseIndexToResultPage.xslt index dc65ec6c..9d03d470 100644 --- a/xsl/browseIndexToResultPage.xslt +++ b/xsl/browseIndexToResultPage.xslt @@ -16,7 +16,7 @@ - + @@ -32,569 +32,352 @@ termPageSize="{$TERMPAGESIZE}" resultPageXslt="{$RESULTPAGEXSLT}" termTotal="{$TERMTOTAL}"> -

        - -

        +

        -
        -
        -
        -
        +


        -
        -
        @@ -609,10 +392,8 @@ - - fedora/ilives_book_search/ - :" - " AND dc.type:collection + + fedora/ilives_book_search/:"" AND dc.type:collection diff --git a/xsl/convertQDC.xsl b/xsl/convertQDC.xsl index 740a4b21..e7e0d627 100644 --- a/xsl/convertQDC.xsl +++ b/xsl/convertQDC.xsl @@ -1,55 +1,33 @@ - - - - - - - + + + + + + + -
        - - - - - - - - - - - - - - - - - +
        -

        MetaData

        -
        - - - - - - -
        - = - -
        -
        -
        - - Find Similar by {$FIELD} - -
        + + + + + + + + + - -

        MetaData

        + +
        + = +
        +
        +
        Find Similar by {$FIELD}
        -
        +
      • - + \ No newline at end of file diff --git a/xsl/refworks.xsl b/xsl/refworks.xsl index e021ef2b..2ef0c8df 100644 --- a/xsl/refworks.xsl +++ b/xsl/refworks.xsl @@ -1,216 +1,92 @@ - + - - -

        General Information

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - Periodical: - - -
        - Abbreviation: - - -
        - Volume: - - -
        - Issue: - - -
        - Publisher: - - -
        - Place of Publication: - - -
        - Edition: - - -
        - Year: - - -
        - Date: - - -
        - Start Page: - - -
        - Other Pages: - - -
        - ISSN/ISBN: - - -
        - Language: - - -
        - UL: - - -
        -
        - -

        Titles

        -
          - -
        • - -
        • -
          -
        -
        - -
          -

          Secondary Titles

          - -
        • - -
        • -
          -
        -
        - -

        Authors

        -
          - -
        • - -
        • -
          -
        -
        + + +

        General Information

        + + + + + + + + + + + + + + + +
        Periodical:
        Abbreviation:
        Volume:
        Issue:
        Publisher:
        Place of Publication:
        Edition:
        Year:
        Date:
        Start Page:
        Other Pages:
        ISSN/ISBN:
        Language:
        UL:
        +
        + +

        Titles

        +
          + +
        • +
          +
        +
        + +
          +

          Secondary Titles

          + +
        • +
          +
        +
        + +

        Authors

        +
          + +
        • +
          +
        +
        - -
          -

          Secondary Authors

          - -
        • - -
        • -
          -
        -
        - -

        Keywords

        -
          - -
        • - -
        • -
          -
        -
        - -

        Abstract

        - -
        - -
        -
        -
        - -

        Notes

        - -
        - -
        -
        -
        - - - - - http://articles.library.upei.ca:7888/godot/hold_tab.cgi?hold_tab_branch=PCU&issn= - &date= - &volume= - &issue= - &spage= - &atitle= - &stitle= - - -
        - - - -
        + +
          +

          Secondary Authors

          + +
        • +
          +
        +
        + +

        Keywords

        +
          + +
        • +
          +
        +
        + +

        Abstract

        + +
        +
        +
        + +

        Notes

        + +
        +
        +
        + + + + + http://articles.library.upei.ca:7888/godot/hold_tab.cgi?hold_tab_branch=PCU&issn=&date=&volume=&issue=&spage=&atitle=&stitle= + +
        + + + +
        \ No newline at end of file diff --git a/xsl/results.xsl b/xsl/results.xsl index bf165a12..829822db 100644 --- a/xsl/results.xsl +++ b/xsl/results.xsl @@ -1,74 +1,74 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + Total Hits = - - , - + + , + Number of Hits/page = - -
        You may not have sufficient privileges to view any or all of the items found. The objects you have rights to view will be shown below. + +
        You may not have sufficient privileges to view any or all of the items found. The objects you have rights to view will be shown below. -
        +
        - + - + - + - - - - - - + + + + + + - - + + - - - -
        - -
        - -

        Your search yielded no results

        - -
        -
          -
        • Check if your spelling is correct.
        • - -
        • Remove quotes around phrases to match each word individually: - "blue smurf" will match less than - blue smurf. -
        • -
        • Consider loosening your query with - OR: - blue smurf will match less than - blue OR smurf. -
        • -
        -
        - -
        - -
        -
        -
        - - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - - - -
        -
        + + + + +
        + +

        Your search yielded no results

        + +
        +
          +
        • Check if your spelling is correct.
        • + +
        • Remove quotes around phrases to match each word individually: + "blue smurf" will match less than + blue smurf. +
        • +
        • Consider loosening your query with + OR: + blue smurf will match less than + blue OR smurf. +
        • +
        +
        + +
        + +
        + +
        + + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + +
        +
        -
        - - - + + + + - - + + - + - + - + - + - + - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fedora/repository//-/ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + fedora/repository/ + /-/ + + - - - fedora/repository/ - /TN - - - + + + fedora/repository/ + /TN + + + - + - - + + + + + + + + + + + + + + + - - - +
        + - - + + - + - - - + + + - - + - - - - - - - - - - - - - - - -
        +
        - - + + - + - - fedora/repository//-/ - - - - -
        -
        - - + + fedora/repository/ + /-/ + + + + + +
        + + + Score:( - ) - -
        - + ) +
        +
        +
        - - fedora/repository//-/ + + fedora/repository/ + /-/ + - - - -
        + + + +
        -
        - +
        + Text Stream - - - - - -
        - - - - - - - -
        + +
        + + + +
        + + + + + + + +
        + + + +
        diff --git a/xsl/romeo.xsl b/xsl/romeo.xsl index 0f1f3d3d..8fa02d4e 100644 --- a/xsl/romeo.xsl +++ b/xsl/romeo.xsl @@ -1,82 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - - -
        - Journal: - - -
        - Published By: - - -
        -
        - Publisher Url: - - -
        - Prearchiving: - - -
        - Postprints: - - -
        -

        Conditions

        -
          - -
        • - -
        • -
          -
        + + + + + + +
        + Journal:
        Published By:
        Publisher Url:
        Prearchiving:
        Postprints:
        +

        Conditions

        +
          + +
        • +
          +
        - - Rights: - - -
        - - - - - Romeo Colour: - - -
        -
        - - - -
        - -
        If there are no results from - ROMEO shown above you can try searching manually by clicking - here. -
        -
        -
        + Rights:
        + + + + Romeo Colour:
        +
        + +
        If there are no results from ROMEO shown above you can try searching manually by clicking here.
        +
        +
        \ No newline at end of file diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index 3743e1a7..0c037f3e 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -1,104 +1,76 @@ - - - - - - - - - - - - - - - - - - -
        + + + + + + + + + + + + + + + + + + - +
        + - -
        - -
        -
        -
        + +

        - -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - /fedora/repository//-/ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + /fedora/repository//-/ + + - /fedora/repository//-/ - - - - - - - - - - - - /fedora/repository//TN - - - - - - -
        - - - - - - + /fedora/repository//-/ + + + +
        + + + + + + /fedora/repository//TN + + + +
        + + + + + - - - - - - -
        - - -   - - - - - - - - - - + + + + + + + + + +   + + + + + + + + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + +
        \ No newline at end of file diff --git a/xsl/specdwc.xsl b/xsl/specdwc.xsl index 725800b4..84de97d9 100644 --- a/xsl/specdwc.xsl +++ b/xsl/specdwc.xsl @@ -4,157 +4,40 @@ xmlns:dc="http://purl.org/dc/terms/" xmlns:dwr="http://rs.tdwg.org/dwc/xsd/simpledarwincore/" xmlns:dwc="http://rs.tdwg.org/dwc/terms/"> - + - + - + - - - - - - - - - - - - - - - - - - - - +
        - Specimen -
        Scientific Name - -
        Family - -
        Genus - -
        Common Name - -
        + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        Specimen
        Scientific Name
        Family
        Genus
        Common Name
        - Location -
        Continent - -
        Country - -
        Country Code - -
        State/Province - -
        County - -
        Locality - -
        Habitat - -
        Location
        Continent
        Country
        Country Code
        State/Province
        County
        Locality
        Habitat
        - Record -
        Record Type - -
        Language- - -
        Record Basis - -
        Occurence Remarks - -
        Occurence ID - -
        Institution Code - -
        Collection Code - -
        Catalog Number - -
        Recorded By - -
        Event Date200 - -
        -
        + Record + Record Type + Language- + Record Basis + Occurence Remarks + Occurence ID + Institution Code + Collection Code + Catalog Number + Recorded By + Event Date200 + +
        diff --git a/xsl/unfilteredresults.xsl b/xsl/unfilteredresults.xsl index e2f31114..110f5ea5 100644 --- a/xsl/unfilteredresults.xsl +++ b/xsl/unfilteredresults.xsl @@ -1,70 +1,70 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + Total Hits = - - , - + + , + Number of Hits/page = - + -
        +
        -
        + - + - + - - - - - - + + + + + + - - + + -
        - - -
        - -
        - -

        Your search yielded no results

        - -
        -
          -
        • Check if your spelling is correct.
        • - -
        • Remove quotes around phrases to match each word individually: - "blue smurf" will match less than - blue smurf. -
        • -
        • Consider loosening your query with - OR: - blue smurf will match less than - blue OR smurf. -
        • -
        -
        - -
        - -
        -
        -
        - - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - -
        -
        + + + + +
        - +

        Your search yielded no results

        +
        +
          +
        • Check if your spelling is correct.
        • - - - - - +
        • Remove quotes around phrases to match each word individually: + "blue smurf" will match less than + blue smurf. +
        • +
        • Consider loosening your query with + OR: + blue smurf will match less than + blue OR smurf. +
        • +
        +
        - - - - - - - - fedora/repository/ - /-/ - - +
        + +
        + +
        + + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + +
        +
        + +
        + + + + + + + + + + + + + +
        + + fedora/repository/ + /-/ + + - - - fedora/repository/ - /TN - - - + + + fedora/repository/ + /TN + + + - + - - + + + + + + + + + + + + + + + - - - +
        + - - + + - + - - - + + + - - + - - - - - - - - - - - - - - - -
        +
        - - + + - + - - fedora/repository/ - /-/ - - - - - -
        -
        - - + + fedora/repository/ + /-/ + + + + + +
        + + + Score:( - ) - -
        - + ) +
        +
        +
        - - fedora/repository/ - /-/ - + + fedora/repository/ + /-/ + - - - -
        + + + +
        -
        - +
        + Text Stream - - - - - -
        - - - - - - - -
        + +
        + + + +
        + + + + + + + +
        + + + +
        From 79ac5bb00f25691b7cb6a0d42ec4a74cba40478c Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Mon, 19 Sep 2011 20:52:42 +0100 Subject: [PATCH 073/247] ISLANDORA-348: Undefined variable Error generated during bulk ingest --- fedora_repository.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index 3ffb32ac..a8534d76 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -2145,7 +2145,7 @@ function fedora_repository_batch_reingest_object($object, &$context) { if (!empty($datastreams) && is_array($datastreams)) { $label = !empty($object['label']) ? $object['label'] : ''; - if (empty($object['foxml_file']) && !defined($new_item)) { + if (empty($object['foxml_file']) && !isset($new_item)) { $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); } if (!empty($object['cmodel'])) { From 2691a5c0c4f588f8d4fbd0e2816373401807fff8 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 20 Sep 2011 00:37:37 +0100 Subject: [PATCH 074/247] ISLANDORA-304: Islandora Fails to install Solution Packs when installed on OSX with MAMP 2 --- api/fedora_item.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 13f126aa..dfd39523 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -146,7 +146,7 @@ class Fedora_Item { * @return type */ function add_datastream_from_string($str, $datastream_id, $datastream_label = NULL, $datastream_mimetype = 'text/xml', $controlGroup = 'M', $logMessage = NULL) { - $dir = sys_get_temp_dir(); + $dir = file_directory_temp(); $tmpfilename = tempnam($dir, 'fedoratmp'); $tmpfile = fopen($tmpfilename, 'w'); fwrite($tmpfile, $str, strlen($str)); From ab909dfcd69a9f42f46ff48d372b49e52c4c453b Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 20 Sep 2011 00:48:02 +0100 Subject: [PATCH 075/247] ISLANDORA-349: Remove references to islandora:top which has now become islandora:root. --- ObjectHelper.inc | 6 +++--- fedora_repository.module | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index e575fb7d..1baf5be5 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -599,7 +599,7 @@ class ObjectHelper { $namespaceAccess = TRUE; } if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:top'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $nameSpaceAllowed = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $pos = NULL; @@ -921,7 +921,7 @@ class ObjectHelper { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; - if ($pid == variable_get('fedora_repository_pid', 'islandora:top')) { + if ($pid == variable_get('fedora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } @@ -947,7 +947,7 @@ class ObjectHelper { $parent = preg_replace('/^info:fedora\//', '', $matches[0]); $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); - if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) { + if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } diff --git a/fedora_repository.module b/fedora_repository.module index 3ffb32ac..d78ef85a 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -82,7 +82,7 @@ function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pag $objectHelper = new ObjectHelper(); if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:top'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $content = ''; @@ -908,7 +908,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU } if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:top'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $item = new fedora_item($pid); @@ -936,7 +936,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $objectHelper = new ObjectHelper(); if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:top'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); if (in_array(-1, $headers)) { @@ -1054,7 +1054,7 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU return ' '; } if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:top'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); if (in_array(-1, $headers)) { @@ -1450,7 +1450,7 @@ function fedora_repository_demo_objects_form() { foreach (array( 'islandora:collectionCModel' => 'Islandora default content models', - 'islandora:top' => 'Islandora top-level collection', + 'islandora:root' => 'Islandora top-level collection', 'islandora:demos' => 'Islandora demos collection', 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', ) @@ -1557,7 +1557,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { or $object ) and $object ) order by $title', 'QUERY', 'Content Model Collection Query', 'text/plain'); - $cmodel_collection->add_relationship('isMemberOfCollection', 'islandora:top'); + $cmodel_collection->add_relationship('isMemberOfCollection', 'islandora:root'); $cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); @@ -1567,13 +1567,13 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { } } - if (!empty($form_state['values']['demo_collections']['islandora:top'])) { - $new_item = Fedora_Item::ingest_new_item('islandora:top', 'A', 'Islandora Top-level Collection'); + if (!empty($form_state['values']['demo_collections']['islandora:root'])) { + $new_item = Fedora_Item::ingest_new_item('islandora:root', 'A', 'Islandora Top-level Collection'); $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); try { $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed islandora:top."), 'message'); + drupal_set_message(t("Successfully installed islandora:root."), 'message'); } catch (exception $e) { } @@ -1581,7 +1581,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { if (!empty($form_state['values']['demo_collections']['islandora:demos'])) { $new_item = fedora_item::ingest_new_item('islandora:demos', 'A', 'Islandora Demo Collection'); - $new_item->add_relationship('isMemberOfCollection', 'islandora:top'); + $new_item->add_relationship('isMemberOfCollection', 'islandora:root'); $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); From 54140f84fff0c1cda12b940b2e4ad7c54810cf94 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 20 Sep 2011 01:04:06 +0100 Subject: [PATCH 076/247] ISLANDORA-350: When viewing non-existing objects the Drupal not found page renders along with a failed attempt at rendering the missing object. --- fedora_repository.module | 1 + 1 file changed, 1 insertion(+) diff --git a/fedora_repository.module b/fedora_repository.module index 894e91e3..cc285122 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -914,6 +914,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $item = new fedora_item($pid); if (!$item->exists()) { drupal_not_found(); + exit(); } if ($pid & !valid_pid($pid)) { From f78015f674689b9db6a5c4f67c1940e4a252188a Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 20 Sep 2011 01:11:45 +0100 Subject: [PATCH 077/247] ISLANDORA-351: Undefined variable Error collection_pid in collection_creation_form() --- CollectionClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index f9d906e8..e6d2fbf2 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -674,7 +674,7 @@ function collection_creation_form(&$form_state, $parent_collection_pid) { $content_models = get_content_models_as_option_array(); $form['titlebox'] = array( '#type' => 'item', - '#value' => t("Create New Child Collection within $collection_pid"), + '#value' => t("Create New Child Collection within $parent_collection_pid"), ); $form['collection_name'] = array( From 8481819a08f3668cacb143267125556cf2dc3f86 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 20 Sep 2011 10:20:40 +0100 Subject: [PATCH 078/247] ISLANDORA-352: Fedora Repository now requires Islandora Content Model Forms --- fedora_repository.info | 1 + 1 file changed, 1 insertion(+) diff --git a/fedora_repository.info b/fedora_repository.info index 7e808460..20ff4d30 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -2,6 +2,7 @@ name = Digital Repository dependencies[] = imageapi dependencies[] = tabs +dependencies[] = islandora_content_model_forms description = Shows a list of items in a fedora collection. package = Islandora version = 11.2.beta1 From 35aa418c020997700d5712802d8dc72ede80c9b1 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 20 Sep 2011 11:34:54 +0100 Subject: [PATCH 079/247] ISLANDORA-355: Undefined variable error when adding to the pdf collection --- CollectionClass.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index e6d2fbf2..7013e77d 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -514,9 +514,7 @@ class CollectionClass { // 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(); - if (!$show_ingest_tab) { - $view_selected = true; - } + $view_selected = !$show_ingest_tab; drupal_set_message(); From 40bca09dcbaec68ad2b474fed6a9c4869ac9ec38 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 20 Sep 2011 11:45:15 +0100 Subject: [PATCH 080/247] ISLANDORA-356: Warnings issued when MIMEClass is trying to determine the MIME type of a file via non-existent system files. --- MimeClass.inc | 58 +++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/MimeClass.inc b/MimeClass.inc index 73e7be26..119a8f97 100644 --- a/MimeClass.inc +++ b/MimeClass.inc @@ -301,21 +301,23 @@ class MimeClass { */ private function system_mime_type_extensions() { $out = array(); - $file = fopen($this->etc_mime_types, 'r'); - while (($line = fgets($file)) !== FALSE) { - $line = trim(preg_replace('/#.*/', '', $line)); - if (!$line) - continue; - $parts = preg_split('/\s+/', $line); - if (count($parts) == 1) - continue; - // A single part means a mimetype without extensions, which we ignore. - $type = array_shift($parts); - if (!isset($out[$type])) - $out[$type] = array_shift($parts); - // We take the first ext from the line if many are present. + if (file_exists($this->etc_mime_types)) { + $file = fopen($this->etc_mime_types, 'r'); + while (($line = fgets($file)) !== FALSE) { + $line = trim(preg_replace('/#.*/', '', $line)); + if (!$line) + continue; + $parts = preg_split('/\s+/', $line); + if (count($parts) == 1) + continue; + // A single part means a mimetype without extensions, which we ignore. + $type = array_shift($parts); + if (!isset($out[$type])) + $out[$type] = array_shift($parts); + // We take the first ext from the line if many are present. + } + fclose($file); } - fclose($file); return $out; } @@ -328,20 +330,22 @@ class MimeClass { */ private function system_extension_mime_types() { $out = array(); - $file = fopen($this->etc_mime_types, 'r'); - while (($line = fgets($file)) !== FALSE) { - $line = trim(preg_replace('/#.*/', '', $line)); - if (!$line) - continue; - $parts = preg_split('/\s+/', $line); - if (count($parts) == 1) - continue; - // A single part means a mimetype without extensions, which we ignore. - $type = array_shift($parts); - foreach ($parts as $part) - $out[$part] = $type; + if (file_exists($this->etc_mime_types)) { + $file = fopen($this->etc_mime_types, 'r'); + while (($line = fgets($file)) !== FALSE) { + $line = trim(preg_replace('/#.*/', '', $line)); + if (!$line) + continue; + $parts = preg_split('/\s+/', $line); + if (count($parts) == 1) + continue; + // A single part means a mimetype without extensions, which we ignore. + $type = array_shift($parts); + foreach ($parts as $part) + $out[$part] = $type; + } + fclose($file); } - fclose($file); return $out; } From 6620c2e51bb5f610af58abcdcab29633d101c621 Mon Sep 17 00:00:00 2001 From: discoverygnoye Date: Fri, 23 Sep 2011 15:54:16 -0300 Subject: [PATCH 081/247] ISLANDORA-362 updated the do_curl method to be renamed do_curl_ext and return additional information to determine the success of curl_exec. do_curl was modified to call do_curl_ext and retain historical method call correctness. fedora_repository.module was updated to test for the existence of risearch and output a message when it is not available. --- api/fedora_utils.inc | 96 +++++++++++++++++++++++++++++++++++----- fedora_repository.module | 5 +++ 2 files changed, 91 insertions(+), 10 deletions(-) diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 7c70dad9..c430d37d 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -30,17 +30,76 @@ if (!function_exists('str_getcsv')) { } /** - * do curl - * @global type $user - * @param type $url - * @param type $return_to_variable - * @param type $number_of_post_vars - * @param type $post - * @return type + * + * Utility method to get data from a url location using curl_exec and return + * + * This method takes identical parameters to do_curl_ext and passes them + * directly to do_curl_ext. The output from do_curl_ext is processed into + * either a TRUE, FALSE, or NULL value. + * + * This method exists for historical reasons as existing code makes use of + * do_curl directly and expects a simple return value and not an array. + * + * @param $url + * URL to be accessed by the function + * @param $return_to_variable + * Indicates whether the resource accessed by the curl call (HTML page, + * XML page, etc.) is returned directly from the function to the calling + * program or if it is sent directly to output. + * @param $number_of_post_vars + * Number of variable sot be posted + * @param $post + * Whether the curl_exec is done as a "get" or a "post" + * + * @return + * TRUE, FALSE, NULL, or the data returned from accessing the URL */ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post = NULL) { + $return_array = do_curl_ext($url, $return_to_variable, $number_of_post_vars, $post); + return ($return_array != NULL) ? $return_array[0] : NULL; +} + +/** + * + * Utility method to get data from a url location using curl_exec + * + * This method takes a URL and three associated parameters and initializes the + * structure required to make a call to curl_exec. As a part of the + * initialization the permissions associated with the (global) user are added + * to the call. This ensures access to any potentially user restricted URLs. + * + * Various defaults are used for the parameters required by curl_exec including + * the user agent and timeout. These are hard-coded. + * + * @param $url + * URL to be accessed by the function + * @param $return_to_variable + * Indicates whether the resource accessed by the curl call (HTML page, + * XML page, etc.) is returned directly from the function to the calling + * program or if it is sent directly to output. + * @param $number_of_post_vars + * Number of variable sot be posted + * @param $post + * Whether the curl_exec is done as a "get" or a "post" + * + * @return + * an array that consists of three value or NULL if curl is not suported: + * - element 0: + * The value returned from the curl_exec function call. + * This is either a TRUE or FALSE value or the actual data returned from + * accessing the URL. + * - element 1: + * The error code reslting from attempting to access the URL with curl_exec + * - element 2: + * A string representing a textual representation of the error code that + * resulted from attempting to access the URL with curl_exec + */ +function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $post = NULL) { global $user; + // Check if we are inside Drupal and there is a valid user. + + // If the user is not valid for a Fedora call curl will throw an exception. if ((!isset($user)) || $user->uid == 0) { $fedora_user = 'anonymous'; $fedora_pass = 'anonymous'; @@ -67,8 +126,14 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post curl_setopt($ch, CURLOPT_POST, $number_of_post_vars); curl_setopt($ch, CURLOPT_POSTFIELDS, "$post"); } - return curl_exec($ch); + + $ret_val = curl_exec($ch); + + $error_code = curl_errno($ch); + $error_string = curl_error($ch); + return array ($ret_val, $error_code, $error_string); } + else { if (function_exists(drupal_set_message)) { drupal_set_message(t('No curl support.'), 'error'); @@ -83,10 +148,21 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post */ function fedora_available() { - $response = do_curl(variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/describe'); - return strstr($response, 'Repository Information HTML Presentation') !== FALSE; + $response = do_curl_ext(variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/describe'); + return ($response != NULL) ? ($response[1] == 0) : FALSE; +} + +/** + * Resource index search available + * @return type + */ +function risearch_available() { + + $response = do_curl_ext(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch')); + return ($response != NULL) ? ($response[1] == 0): FALSE; } + /** * Returns a UTF-8-encoded transcripiton of the string given in $in_str. * @param string $in_str diff --git a/fedora_repository.module b/fedora_repository.module index cc285122..99eba2f1 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -907,6 +907,11 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU return ''; } + if (!risearch_available()) { + drupal_set_message(t('The Fedora resource index search is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); + return ''; + } + if ($pid == NULL) { $pid = variable_get('fedora_repository_pid', 'islandora:root'); } From a2f1627031cedb606bb662fae63329c17a5fcd90 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Tue, 27 Sep 2011 13:32:29 -0300 Subject: [PATCH 082/247] Edited README via GitHub --- README | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README b/README index 71ece32c..f4980bb4 100644 --- a/README +++ b/README @@ -4,10 +4,6 @@ For installation and customization instructions please see the documentation and https://wiki.duraspace.org/display/ISLANDORA/Islandora -Specifically the Islandora Guide: - -https://wiki.duraspace.org/display/ISLANDORA/Islandora+Guide - All bugs, feature requests and improvement suggestions are tracked at the DuraSpace JIRA: https://jira.duraspace.org/browse/ISLANDORA \ No newline at end of file From ebd8a5096b18dcc1dc529905c57ea0816e542e44 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Wed, 28 Sep 2011 09:21:04 -0300 Subject: [PATCH 083/247] Added management tab to collections --- CollectionClass.inc | 297 +++++++++++++++++++++++---------------- CollectionManagement.inc | 276 ++++++++++++++++++++++++++++++++++++ ObjectHelper.inc | 22 +-- api/fedora_item.inc | 8 +- fedora_repository.module | 2 + 5 files changed, 474 insertions(+), 131 deletions(-) create mode 100644 CollectionManagement.inc diff --git a/CollectionClass.inc b/CollectionClass.inc index f9d906e8..f40aff4d 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -498,6 +498,7 @@ class CollectionClass { */ function showFieldSets($page_number) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'CollectionManagement'); global $base_url; $tabset = array(); global $user; @@ -514,10 +515,15 @@ class CollectionClass { // 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(); + $show_batch_tab = TRUE; + $policy = CollectionPolicy::loadFromCollection($this->pid, TRUE); + $content_models = $policy->getContentModels(); + if (count($content_models) == 1 && $content_models[0]->pid == "islandora:collectionCModel") { + $show_batch_tab = FALSE; + } if (!$show_ingest_tab) { $view_selected = true; } - drupal_set_message(); $tabset['view_tab'] = array( @@ -534,14 +540,24 @@ class CollectionClass { // This will be the content of the tab. '#content' => $add_to_collection, ); - - $tabset['add_collection_tab'] = array( - // #type and #title are the minimum requirements. - '#type' => 'tabpage', - '#title' => t('Add Child Collection'), - // This will be the content of the tab. - '#content' => drupal_get_form('collection_creation_form', $this->pid), - ); + if (user_access('manage collections')) { + $tabset['add_collection_tab'] = array( + // #type and #title are the minimum requirements. + '#type' => 'tabpage', + '#title' => t('Manage This Collection'), + // This will be the content of the tab. + '#content' => drupal_get_form('collection_management_form', $this->pid, $content_models), + ); + } + if ($show_batch_tab) { + $tabset['batch_ingest_tab'] = array( + // #type and #title are the minimum requirements. + '#type' => 'tabpage', + '#title' => t('Batch Ingest'), + // This will be the content of the tab. + '#content' => drupal_get_form('batch_creation_form', $this->pid, $content_models), + ); + } return $tabset; } @@ -651,74 +667,55 @@ class CollectionClass { } -/** - * collection creation form ? - * @param type $form_state - * @param type $parent_collection_pid - * @return type - */ -function collection_creation_form(&$form_state, $parent_collection_pid) { +function batch_creation_form(&$form_state, $collection_pid, $content_models) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $restricted = FALSE; - if (variable_get('fedora_namespace_restriction_enforced', true)) { - $restricted = true; - $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); - $namespaces = explode(':', $allowed_string); - foreach ($namespaces as $namespace) { - if ($namespace) { - $allowed[trim($namespace)] = trim($namespace); - } + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + $cm_options = array(); + $name_mappings = array(); + foreach ($content_models as $content_model) { + if ($content_model->pid != "islandora:collectionCModel") { + $cm_options[$content_model->pid] = $content_model->name; + $name_mappings[] = $content_model->pid . '^' . $content_model->pid_namespace; } } + $mappings = implode('~~~', $name_mappings); + $form['#attributes']['enctype'] = 'multipart/form-data'; - $content_models = get_content_models_as_option_array(); $form['titlebox'] = array( '#type' => 'item', - '#value' => t("Create New Child Collection within $collection_pid"), + '#value' => t("Batch ingest into $collection_pid"), ); - $form['collection_name'] = array( - '#title' => "Collection Name", - '#type' => 'textfield', - '#description' => t("Human readable name for this collection"), - ); - $form['collection_pid'] = array( - '#title' => "Collection PID", - '#type' => 'textfield', - '#size' => 15, - '#description' => t("Unique PID for this collection.
        Pids take the general form of namespace:collection eg islandora:pamphlets"), - ); - if (!$restricted) { - $form['collection_namespace'] = array( - '#title' => "Collection Namespace", - '#type' => 'textfield', - '#size' => 15, - '#default_value' => 'default', - '#description' => t("Namespace for objects in this collection."), - ); - } - else { - $form['collection_namespace'] = array( - '#title' => "Collection Namespace", - '#type' => 'select', - '#options' => $allowed, - '#default_value' => 'default', - '#description' => t("Namespace for objects in this collection."), - ); - } $form['parent_collection'] = array( '#type' => 'hidden', - '#value' => $parent_collection_pid, + '#value' => $collection_pid, ); - - $form['content_models'] = array( - '#title' => "Choose allowable content models for this collection", - '#type' => 'checkboxes', - '#options' => $content_models, + $form['namespace_mappings'] = array( + '#type' => 'hidden', + '#value' => $mappings, + ); + $form['metadata_type'] = array( + '#title' => "Choose Metadata Type", + '#type' => 'radios', + '#options' => array('MODS' => 'MODS', "DC" => "DUBLIN CORE"), + '#required' => true, + '#description' => t("Select primary metadata schema"), + ); + $form['content_model'] = array( + '#title' => "Choose content model to be associated with objects ingested", + '#type' => 'select', + '#options' => $cm_options, '#required' => true, '#description' => t("Content models describe the behaviours of objects with which they are associated."), ); - + $form['indicator']['file-location'] = array( + '#type' => 'file', + '#title' => t('Upload zipped folder'), + '#size' => 48, + '#description' => t('The zipped folder should contain all files necessary to build objects.
        + Related files must have the same filename, but with diffening extensions to indicate mimetypes.
        + ie. myFile.xml and myFile.jpg'), + ); $form['submit'] = array( '#type' => 'submit', @@ -729,68 +726,130 @@ function collection_creation_form(&$form_state, $parent_collection_pid) { return($form); } -/** - * collection creation form validate ? - * @param type $form - * @param type $form_state - * @return type - */ -function collection_creation_form_validate($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $pid = $form_state['values']['collection_pid']; - $item = new fedora_item($pid); - if ($item->exists()) { - form_set_error('', t("$pid already exists within your repository. the PID must be unique")); - return; +function batch_creation_form_validate($form, &$form_state) { + + $fieldName = 'file-location'; + if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name'][$fieldName])) { + $file = file_save_upload($fieldName); + if ($file->filemime != 'application/zip') { + form_set_error($fieldName, 'Input file must be a .zip file'); + return; + } + if (!$file) { + form_set_error($fieldName, 'Error uploading file.'); + return; + } + $form_state['values']['file'] = $file; } - if (!valid_pid($pid)){ - form_set_error('', t("$pid is not a valid identifier")); - return; + else { + // set error + form_set_error($fieldName, 'Error uploading file.'); + return; } } -/** - * collection creation form submit - * @global type $user - * @param type $form - * @param type $form_state - */ -function collection_creation_form_submit($form, &$form_state) { +function batch_creation_form_submit($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); global $user; + $namespace_mappings = array(); + $content_model = $form_state['values']['content_model']; + $metadata = $form_state['values']['meta_data_type']; + $namespace_process = explode('~~~', $form_state['values']['namespace_mappings']); + foreach ($namespace_process as $line) { + $line_parts = explode('^', $line); + $namespace_mappings[$line_parts[0]] = $line_parts[1]; + } + $namespace = $namespace_mappings[$content_model]; + $dirName = "temp" . $user->uid; + $tmpDir = file_directory_path() . '/' . $dirName . '/'; + mkdir($tmpDir); + $file = $form_state['values']['file']; + $fileName = $file->filepath; + $file_list = array(); + $cmdString = "unzip -q -o -d $tmpDir \"$fileName\""; + system($cmdString, $retVal); + $dirs = array(); + $doNotAdd = array('.', '..', '__MACOSX'); + array_push($dirs, $tmpDir); + $files = scandir($tmpDir); + foreach ($files as $file) { + if (is_dir("$tmpDir/$file") & !in_array($file, $doNotAdd)) { + array_push($dirs, $tmpDir . $file); + } + } + + foreach ($dirs as $directory) { + if ($inputs = opendir($directory)) { + while (FALSE !== ($file_name = readdir($inputs))) { + if (!in_array($file_name, $doNotAdd)) { + $ext = strrchr($file_name, '.'); + $base = preg_replace("/$ext$/", '', $file_name); + $ext = substr($ext, 1); + $file_list[$base][$ext] = "$directory" . $file_name; + } + } + closedir($inputs); + } + } + + /** + * use the content model class to construct a class representing the selected content model + * call execIngestmethods on each mimetype passed in + */ + create_fedora_batch($file_list, $content_model, $metadata, $namespace); +} + +function create_fedora_batch($file_list, $content_model, $metadata, $namespace) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - $module_path = drupal_get_path('module', 'fedora_repository'); - $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; - $collection_pid = $form_state['values']['collection_pid']; - $new_collection_label = $form_state['values']['collection_name']; - $parent_collection = $form_state['values']['parent_collection']; - $pid_namespace = $form_state['values']['collection_namespace']; - $all_cModels = get_content_models_as_option_array(); - $collection_policy = ' - - - - - - - isMemberOfCollection -'; - $content_models = $form_state['values']['content_models']; - $collection_policy_xml = simplexml_load_string($collection_policy); - foreach ($content_models as $content_model) { - if ($content_model) { - $node = $collection_policy_xml->content_models->addChild('content_model'); - $node->addAttribute('dsid', 'ISLANDORACM'); - $node->addAttribute('name', $all_cModels[$content_model]); - $node->addAttribute('namespace', $pid_namespace . ':1'); - $node->addAttribute('pid', $content_model); + if (($cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM')) !== FALSE) { + $allowedMimeTypes = $cm->getMimetypes(); + + if (!in_array($dformat, $allowedMimeTypes)) { + form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . + implode(' ', $allowedMimeTypes))); + return; } + elseif (!$cm->execIngestRules($file, $dformat)) { + drupal_set_message(t('Error following Content Model Rules'), 'error'); + foreach (ContentModel::$errors as $err) { + drupal_set_message($err, 'error'); + } + } + } + + $batch = array( + 'title' => 'Ingesting Objects', + 'operations' => array(), + 'file' => drupal_get_path('module', 'fedora_repository') . '/CollectionClass.inc', + ); + + + foreach ($file_list as $label => $object_files) { + + $batch['operations'][] = array('create_fedora_objects', array($label, $content_model, $object_files, $collection_pid, $metadata)); } - $item = fedora_item::ingest_new_item($collection_pid, 'A', $new_collection_label, $user->name); - $item->add_relationship('isMemberOfCollection', $parent_collection, RELS_EXT_URI); - $item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $item->add_datastream_from_string($collection_policy_xml->saveXML(), 'COLLECTION_POLICY'); - $item->add_datastream_from_file($thumbnail, 'TN'); - drupal_goto("/fedora/repository/$collection_pid"); + + batch_set($batch); } + +function create_fedora_objects($lable, $content_model, $object_files, $collection_pid, $namespace, $metadata, $content_model) { + $namespace = preg_replace('/:.*/', '', $namespace); + $pid = fedora_item::get_next_PID_in_namespace($namespace); + module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); + $item = Fedora_item::ingest_new_item($pid, 'A', $label, $owner); + $item->add_relationship('hasModel', $content_model, FEDORA_MODEL_URI); + if ($metadata == 'DC') { + $dc_xml = file_get_contents($object_files['xml']); + $object_files['xml'] = null; + $item->modify_datastream_by_value($dc_xml, 'DC', "Dublin Core", 'tex/xml'); + } + if ($metadata == 'MODS') { + $item->add_datastream_from_file($object_files['xml'], 'MODS'); + //add crosswalk to dc logic + } + + foreach ($object_files as $file) { + + } +} + diff --git a/CollectionManagement.inc b/CollectionManagement.inc new file mode 100644 index 00000000..aac1fc69 --- /dev/null +++ b/CollectionManagement.inc @@ -0,0 +1,276 @@ +objectProfile->objLabel; + $new_content_models = get_content_models_as_option_array(); + $cm_options = array(); + $name_mappings = array(); + foreach ($content_models as $content_model) { + if ($content_model->pid != "islandora:collectionCModel") { + $cm_options[$content_model->pid] = $content_model->name; + } + } + + $content_models = get_content_models_as_option_array(); + $form['child_creation'] = array( + '#title' => "Create Child Collection", + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['child_creation']['titlebox'] = array( + '#type' => 'item', + '#value' => t("Create New Child Collection within $parent_collection_pid"), + ); + + $form['child_creation']['collection_name'] = array( + '#title' => "Collection Name", + '#type' => 'textfield', + '#description' => t("Human readable name for this collection"), + ); + $form['child_creation']['new_collection_pid'] = array( + '#title' => "Collection PID", + '#type' => 'textfield', + '#size' => 15, + '#description' => t("Unique PID for this collection.
        Pids take the general form of namespace:collection eg islandora:pamphlets"), + ); + if (!$restricted) { + $form['child_creation']['collection_namespace'] = array( + '#title' => "Collection Namespace", + '#type' => 'textfield', + '#size' => 15, + '#default_value' => 'default', + '#description' => t("Namespace for objects in this collection."), + ); + } + else { + $form['child_creation']['collection_namespace'] = array( + '#title' => "Collection Namespace", + '#type' => 'select', + '#options' => $allowed, + '#default_value' => 'default', + '#description' => t("Namespace for objects in this collection."), + ); + } + $form['child_creation']['parent_collection'] = array( + '#type' => 'hidden', + '#value' => $parent_collection_pid, + ); + + $form['child_creation']['content_models'] = array( + '#title' => "Choose allowable content models for this collection", + '#type' => 'checkboxes', + '#options' => $content_models, + '#description' => t("Content models describe the behaviours of objects with which they are associated."), + ); + + + $form['child_creation']['submit'] = array( + '#type' => 'submit', + '#value' => t('Create Collection'), + '#id' => 'create_class' + ); + $form['change_cmodel'] = array( + '#title' => "Change Content Models", + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['change_cmodel']['titlebox'] = array( + '#type' => 'item', + '#value' => t("Change Content Models within $parent_collection_pid"), + ); + + $form['change_cmodel']['current_content_model'] = array( + '#title' => "Choose content model to be changed", + '#type' => 'select', + '#options' => $cm_options, + '#description' => t("All objects in this collection with the selected content model will be changed."), + ); + $form['change_cmodel']['new_content_model'] = array( + '#title' => "Choose new content model", + '#type' => 'select', + '#options' => $new_content_models, + '#description' => t("The new content model to be assigned to selected objects."), + ); + $form['change_cmodel']['collection_pid'] = array( + '#type' => 'hidden', + '#value' => $parent_collection_pid, + ); + $form['change_cmodel']['submit'] = array( + '#type' => 'submit', + '#value' => t('Change Content Model Associations'), + '#id' => 'change_model', + ); + if (user_access('delete entire collections')) { + $form['delete_collection'] = array( + '#title' => "Permanently Delete $collection_name", + '#type' => 'fieldset', + '#description' => t("Clicking this button will delete $collection_name and all objects within.
        This action cannot be undone."), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['delete_collection']['confirm'] = array( + '#title' => "Are you sure?", + '#type' => 'fieldset', + '#description' => t('Clicking the delete button will permanantly remove all objects from this collection.
        This action cannot be undone. '), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['delete_collection']['confirm']['submit'] = array( + '#type' => 'submit', + '#value' => t('Delete this collection'), + '#id' => 'delete_collection', + ); + } + return($form); +} + +/** + * collection creation form validate + * @param array $form + * @param array $form_state + */ +function collection_management_form_validate($form, &$form_state) { + if ($form_state['clicked_button']['#id'] == 'create_class') { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + $pid = $form_state['values']['new_collection_pid']; + $item = new fedora_item($pid); + if ($item->exists()) { + form_set_error('', t("$pid already exists within your repository. the PID must be unique")); + return; + } + if (!valid_pid($pid)) { + form_set_error('', t("$pid is not a valid identifier")); + return; + } + } +} + +/** + * collection creation form submit + * @global type $user + * @param type $form + * @param type $form_state + */ +function collection_management_form_submit($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'api/fedora_collection'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/dublin_core'); + global $user; + $collection_pid = $form_state['values']['parent_collection']; + if ($form_state['clicked_button']['#id'] == 'create_class') { + $module_path = drupal_get_path('module', 'fedora_repository'); + $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; + $new_collection_pid = $form_state['values']['new_collection_pid']; + $new_collection_label = $form_state['values']['collection_name']; + $pid_namespace = $form_state['values']['collection_namespace']; + $all_cModels = get_content_models_as_option_array(); + $collection_policy = ' + + + + + + + isMemberOfCollection +'; + $content_models = $form_state['values']['content_models']; + $collection_policy_xml = simplexml_load_string($collection_policy); + foreach ($content_models as $content_model) { + if ($content_model) { + $node = $collection_policy_xml->content_models->addChild('content_model'); + $node->addAttribute('dsid', 'ISLANDORACM'); + $node->addAttribute('name', $all_cModels[$content_model]); + $node->addAttribute('namespace', $pid_namespace . ':1'); + $node->addAttribute('pid', $content_model); + } + } + $item = fedora_item::ingest_new_item($new_collection_pid, 'A', $new_collection_label, $user->name); + $item->add_relationship('isMemberOfCollection', $collection_pid, RELS_EXT_URI); + $item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $item->add_datastream_from_string($collection_policy_xml->saveXML(), 'COLLECTION_POLICY'); + $item->add_datastream_from_file($thumbnail, 'TN'); + drupal_goto("/fedora/repository/$new_collection_pid"); + } + + if ($form_state['clicked_button']['#id'] == 'change_model') { + $current_content_model = $form_state['values']['current_content_model']; + $new_content_model = $form_state['values']['new_content_model']; + $policy = CollectionPolicy::loadFromCollection($collection_pid, TRUE); + $add_to_policy = TRUE; + $policy_cms = $policy->getContentModels(); + foreach ($policy_cms as $policy_cm) { + if ($policy_cm->pid == $current_content_model) { + $namespace = $policy_cm->pid_namespace; + } + if ($policy_cm->pid == $new_content_model) { + $add_to_policy = FALSE; + } + } + if ($add_to_policy) { + $policy->addModel(ContentModel::loadFromModel($new_content_model), $namespace); + $policy->saveToFedora(); + } + $query = "select \$object from <#ri> + where (\$object + and \$object + and \$object )"; + $query = htmlentities(urlencode($query)); + $content = ''; + + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url .= "?type=tuples&flush=TRUE&format=csv&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query; + $content .= do_curl($url); + $results = explode("\n", $content); + $object_pids = preg_replace('/^info:fedora\/|"object"/', '', $results); + $count = 0; + foreach ($object_pids as $object_pid) { + if (!$object_pid) { + continue; + } + $item = new fedora_item($object_pid); + $item->purge_relationship('hasModel', $current_content_model); + $item->add_relationship('hasModel', $new_content_model, FEDORA_MODEL_URI); + $count++; + } + drupal_set_message("$current_content_model changed to $new_content_model on $count objects"); + } + + if ($form_state['clicked_button']['#id'] == 'delete_collection') { + $name = $user->name; + $objects = get_related_items_as_array($collection_pid, $relationship); + $objects[] = $collection_pid; + foreach ($objects as $object) { + $item_to_delete = new Fedora_Item($object); + $item_to_delete->purge("$object purged by $name"); + } + drupal_goto('fedora/repository'); + } +} + diff --git a/ObjectHelper.inc b/ObjectHelper.inc index e575fb7d..eb7ccecf 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -19,6 +19,8 @@ class ObjectHelper { public static $INGEST_FEDORA_OBJECTS = 'ingest new fedora objects'; public static $EDIT_TAGS_DATASTREAM = 'edit tags datastream'; public static $VIEW_DETAILED_CONTENT_LIST = 'view detailed list of content'; + public static $MANAGE_COLLECTIONS = 'manage collections'; + public static $DELETE_ENTIRE_COLLECTIONS = 'delete entire collections'; public static $DISPLAY_ALWAYS = 0; public static $DISPLAY_NEVER = 1; public static $DISPLAY_NO_MODEL_OUTPUT = 2; @@ -160,7 +162,7 @@ class ObjectHelper { if ($asAttachment) { $suggestedFileName = "$label"; $pos = strpos($suggestedFileName, '.'); - + /* * Here we used to take an object of, say, type application/pdf with label, say, "My Document" * and we assemble the output filename extension based on the post-slash portion of the mimetype. @@ -300,8 +302,8 @@ class ObjectHelper { } if ($allow) { $purgeImage = 'purge datastream'; + $pid . '/' . $dataStreamValue->ID . '/' . $dataStreamValue->label . '">purge datastream'; } } else { @@ -329,7 +331,7 @@ class ObjectHelper { $mimeType = $dataStreamValue->MIMEType; $view = '' . t('View') . ''; + '" target="_blank" >' . t('View') . ''; $action = "$base_url/fedora/repository/object_download/" . drupal_urlencode($pid) . '/' . $id . '/' . drupal_urlencode(preg_replace('/\//i', '${1}_', $label)); // Necessary to handle the case of Datastream labels that contain slashes. Ugh. $downloadVersion = '
        '; if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { @@ -416,7 +418,7 @@ class ObjectHelper { if ($allow) { $output .= '
        ' . t('Edit Meta Data') . ''; + $dsid . '">' . t('Edit Meta Data') . ''; } } return $output; @@ -673,8 +675,8 @@ class ObjectHelper { if ($allow) { // $ingestObject = ' $collectionName, '!collection_pid' => $collection_pid)) . '" href="' . base_path() . - 'fedora/ingestObject/' . $collection_pid . '/' . $collectionName . '">' . t('Add a New Object') . ' ' . t('Add to this Collection'); + 'fedora/ingestObject/' . $collection_pid . '/' . $collectionName . '">' . t('Add a New Object') . ' ' . t('Add to this Collection'); } } } @@ -855,10 +857,10 @@ class ObjectHelper { // Get pid, title and description for children of object $pid $query_string = 'select $o $title from <#ri> ' . // $query_string = 'select $o $title $desc from <#ri> '. - 'where $s $o ' . - 'and $o $title ' . + 'where $s $o ' . + 'and $o $title ' . // 'and $o $desc '. - 'and ( '; + 'and ( '; foreach ($pids as $pid) { $query_string .= '$s or '; diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 13f126aa..2625568b 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -76,10 +76,9 @@ class Fedora_Item { */ function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { module_load_include('inc', 'fedora_repository', 'MimeClass'); - if (!is_file($datastream_file)){ + if (!is_file($datastream_file)) { drupal_set_message("$datastream_file not found
        ", 'warning'); return; - } if (empty($datastream_mimetype)) { // Get mime type from the file extension. @@ -233,6 +232,11 @@ class Fedora_Item { $relationship = "isPartOf"; $namespaceURI = 'info:fedora/fedora-system:def/relations-external#'; break; + case "rel:hasModel": + case "hasModel": + $relationship = "hasModel"; + $namespaceURI = FEDORA_MODEL_URI; + break; } if (substr($object, 0, 12) != 'info:fedora/') { diff --git a/fedora_repository.module b/fedora_repository.module index 3ffb32ac..3f46f4b8 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -830,6 +830,8 @@ function fedora_repository_perm() { OBJECTHELPER::$INGEST_FEDORA_OBJECTS, OBJECTHELPER::$EDIT_TAGS_DATASTREAM, OBJECTHELPER::$VIEW_DETAILED_CONTENT_LIST, + OBJECTHELPER::$MANAGE_COLLECTIONS, + OBJECTHELPER::$DELETE_ENTIRE_COLLECTIONS, ); } From 351d44ed4dc95b04d7ec3f00d01cf7e76315cd08 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Thu, 29 Sep 2011 14:05:19 -0300 Subject: [PATCH 084/247] Added management and batch capabilites to Collections --- BatchIngest.inc | 241 ++++++++++++++++++++++ CollectionClass.inc | 203 +----------------- CollectionManagement.inc | 55 +++-- ContentModel.inc | 48 +++-- ObjectHelper.inc | 1 + api/fedora_item.inc | 35 +++- fedora_repository.module | 11 + xsl/mods_to_dc.xsl | 436 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 799 insertions(+), 231 deletions(-) create mode 100644 BatchIngest.inc create mode 100644 xsl/mods_to_dc.xsl diff --git a/BatchIngest.inc b/BatchIngest.inc new file mode 100644 index 00000000..2f3f6e57 --- /dev/null +++ b/BatchIngest.inc @@ -0,0 +1,241 @@ +pid != "islandora:collectionCModel") { + $cm_options[$content_model->pid] = $content_model->name; + $name_mappings[] = $content_model->pid . '^' . $content_model->pid_namespace; + } + } + $mappings = implode('~~~', $name_mappings); + $form['#attributes']['enctype'] = 'multipart/form-data'; + + $form['titlebox'] = array( + '#type' => 'item', + '#value' => t("Batch ingest into $collection_pid"), + ); + + $form['collection_pid'] = array( + '#type' => 'hidden', + '#value' => $collection_pid, + ); + $form['namespace_mappings'] = array( + '#type' => 'hidden', + '#value' => $mappings, + ); + $form['metadata_type'] = array( + '#title' => "Choose Metadata Type", + '#type' => 'radios', + '#options' => array('MODS' => 'MODS', "DC" => "DUBLIN CORE"), + '#required' => true, + '#description' => t("Select primary metadata schema"), + ); + $form['content_model'] = array( + '#title' => "Choose content model to be associated with objects ingested", + '#type' => 'select', + '#options' => $cm_options, + '#required' => true, + '#description' => t("Content models describe the behaviours of objects with which they are associated."), + ); + $form['indicator']['file-location'] = array( + '#type' => 'file', + '#title' => t('Upload zipped folder'), + '#size' => 48, + '#description' => t('The zipped folder should contain all files necessary to build objects.
        + Related files must have the same filename, but with differing extensions to indicate mimetypes.
        + ie. myFile.xml and myFile.jpg'), + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Create Objects ') + ); + + + return($form); +} + +function batch_creation_form_validate($form, &$form_state) { + + $fieldName = 'file-location'; + if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name'][$fieldName])) { + $file = file_save_upload($fieldName); + if ($file->filemime != 'application/zip') { + form_set_error($fieldName, 'Input file must be a .zip file'); + return; + } + if (!$file) { + form_set_error($fieldName, 'Error uploading file.'); + return; + } + $form_state['values']['file'] = $file; + } + else { + // set error + form_set_error($fieldName, 'Error uploading file.'); + return; + } +} + +function batch_creation_form_submit($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + global $user; + $namespace_mappings = array(); + $content_model = $form_state['values']['content_model']; + $metadata = $form_state['values']['metadata_type']; + $collection_pid = $form_state['values']['collection_pid']; + $namespace_process = explode('~~~', $form_state['values']['namespace_mappings']); + foreach ($namespace_process as $line) { + $line_parts = explode('^', $line); + $namespace_mappings[$line_parts[0]] = $line_parts[1]; + } + $namespace = $namespace_mappings[$content_model]; + $namespace = preg_replace('/:.*/', '', $namespace); + $dirName = "temp" . $user->uid; + $tmpDir = file_directory_path() . '/' . $dirName . '/'; + mkdir($tmpDir); + $file = $form_state['values']['file']; + $fileName = $file->filepath; + $file_list = array(); + $cmdString = "unzip -q -o -d $tmpDir \"$fileName\""; + system($cmdString, $retVal); + $dirs = array(); + $doNotAdd = array('.', '..', '__MACOSX'); + array_push($dirs, $tmpDir); + $files = scandir($tmpDir); + foreach ($files as $file) { + if (is_dir("$tmpDir/$file") & !in_array($file, $doNotAdd)) { + array_push($dirs, $tmpDir . $file); + } + } + foreach ($dirs as $directory) { + if ($inputs = opendir($directory)) { + while (FALSE !== ($file_name = readdir($inputs))) { + if (!in_array($file_name, $doNotAdd) && is_dir($file_name) == FALSE) { + $ext = strrchr($file_name, '.'); + $base = preg_replace("/$ext$/", '', $file_name); + $ext = substr($ext, 1); + if ($ext) { + $file_list[$base][$ext] = "$directory/" . $file_name; + } + } + } + closedir($inputs); + } + } + + /** + * use the content model class to construct a class representing the selected content model + * call execIngestmethods on each mimetype passed in + */ + if (($cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM')) === FALSE) { + drupal_set_message("$content_model not found", "error"); + return; + } + + $batch = array( + 'title' => 'Ingesting Objects', + 'operations' => array(), + 'file' => drupal_get_path('module', 'fedora_repository') . '/BatchIngest.inc', + ); + + + foreach ($file_list as $label => $object_files) { + if ($object_files['xml']) { + $batch['operations'][] = array('create_batch_objects', array($label, $content_model, $object_files, $collection_pid, $namespace, $metadata)); + } + } + $batch['operations'][] = array('recursive_directory_delete', array($tmpDir)); + batch_set($batch); + batch_process(); +} + +function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); + $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); + $allowedMimeTypes = $cm->getMimetypes(); + $mime_helper = new MimeClass(); + $pid = fedora_item::get_next_PID_in_namespace($namespace); + module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); + $item = Fedora_item::ingest_new_item($pid, 'A', $label, $owner); + $item->add_relationship('hasModel', $content_model, FEDORA_MODEL_URI); + $item->add_relationship('isMemberOfCollection', $collection_pid); + if ($metadata == 'DC') { + $dc_xml = file_get_contents($object_files['xml']); + $item->modify_datastream_by_value($dc_xml, 'DC', "Dublin Core", 'text/xml'); + } + if ($metadata == 'MODS') { + $mods_xml = file_get_contents($object_files['xml']); + $item->add_datastream_from_string($mods_xml, 'MODS'); + $dc_xml = batch_create_dc_from_mods($mods_xml); + } + unset($object_files['xml']); + $use_primary = TRUE; + foreach ($object_files as $ext => $filename) { + $file_mimetype = $mime_helper->get_mimetype($filename); + if (in_array($file_mimetype, $allowedMimeTypes)) { + $added = $cm->execIngestRules($filename, $file_mimetype); + } + else { + $item->purge("$pid $label not ingested. $file_mimetype not permitted in objects associated with $content_model"); + continue; + } + $ds_label = $use_primary ? $cm->getDatastreamNameDSID():$ext; + $item->add_datastream_from_file($filename, $ds_label); + $use_primary = FALSE; + + if (!empty($_SESSION['fedora_ingest_files'])) { + foreach ($_SESSION['fedora_ingest_files'] as $dsid => $datastream_file) { + $item->add_datastream_from_file($datastream_file, $dsid); + } + } + } +} + +function batch_create_dc_from_mods($mods_xml) { + $path = drupal_get_path('module', 'fedora_repository'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + + if ($xmlstr == NULL || strlen($xmlstr) < 5) { + return " "; + } + + try { + $proc = new XsltProcessor(); + } catch (Exception $e) { + drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + return " "; + } + + $xsl = new DomDocument(); + $xsl->load($path . '/xsl/mods_to_dc.xsl'); + $input = new DomDocument(); + $input->loadXML(trim($xmlstr)); + $xsl = $proc->importStylesheet($xsl); + $newdom = $proc->transformToDoc($input); + $dc_xml = $newdom->saveXML(); + + return $dc_xml; +} + + +function recursive_directory_delete($dir) { + if (!file_exists($dir)) + return true; + if (!is_dir($dir)) + return unlink($dir); + foreach (scandir($dir) as $item) { + if ($item == '.' || $item == '..') + continue; + if (!recursive_directory_delete($dir . DIRECTORY_SEPARATOR . $item)) + return false; + } + return rmdir($dir); +} \ No newline at end of file diff --git a/CollectionClass.inc b/CollectionClass.inc index f537a3cc..4251eea4 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -499,6 +499,7 @@ class CollectionClass { function showFieldSets($page_number) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'CollectionManagement'); + module_load_include('inc', 'fedora_repository', 'BatchIngest'); global $base_url; $tabset = array(); global $user; @@ -525,23 +526,24 @@ class CollectionClass { if (!$show_ingest_tab) { $view_selected = true; } - + if(!$collection_items){ + $view_selected = false; + $add_selected = true; + } $view_selected = !$show_ingest_tab; - drupal_set_message(); - $tabset['view_tab'] = array( '#type' => 'tabpage', '#title' => 'View', '#selected' => $view_selected, - '#content' => $collection_items + '#content' => $collection_items, + ); $tabset['add_tab'] = array( - // #type and #title are the minimum requirements. '#type' => 'tabpage', '#title' => t('Add'), - '#selected' => $show_ingest_tab, + '#selected' => $add_selected, // This will be the content of the tab. '#content' => $add_to_collection, ); @@ -552,9 +554,10 @@ class CollectionClass { '#title' => t('Manage This Collection'), // This will be the content of the tab. '#content' => drupal_get_form('collection_management_form', $this->pid, $content_models), + '#selected' => false, ); } - if ($show_batch_tab) { + if ($show_batch_tab && user_access('create batch process')) { $tabset['batch_ingest_tab'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', @@ -672,189 +675,3 @@ class CollectionClass { } -function batch_creation_form(&$form_state, $collection_pid, $content_models) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - $cm_options = array(); - $name_mappings = array(); - foreach ($content_models as $content_model) { - if ($content_model->pid != "islandora:collectionCModel") { - $cm_options[$content_model->pid] = $content_model->name; - $name_mappings[] = $content_model->pid . '^' . $content_model->pid_namespace; - } - } - $mappings = implode('~~~', $name_mappings); - $form['#attributes']['enctype'] = 'multipart/form-data'; - - $form['titlebox'] = array( - '#type' => 'item', - '#value' => t("Batch ingest into $collection_pid"), - ); - - $form['parent_collection'] = array( - '#type' => 'hidden', - '#value' => $collection_pid, - ); - $form['namespace_mappings'] = array( - '#type' => 'hidden', - '#value' => $mappings, - ); - $form['metadata_type'] = array( - '#title' => "Choose Metadata Type", - '#type' => 'radios', - '#options' => array('MODS' => 'MODS', "DC" => "DUBLIN CORE"), - '#required' => true, - '#description' => t("Select primary metadata schema"), - ); - $form['content_model'] = array( - '#title' => "Choose content model to be associated with objects ingested", - '#type' => 'select', - '#options' => $cm_options, - '#required' => true, - '#description' => t("Content models describe the behaviours of objects with which they are associated."), - ); - $form['indicator']['file-location'] = array( - '#type' => 'file', - '#title' => t('Upload zipped folder'), - '#size' => 48, - '#description' => t('The zipped folder should contain all files necessary to build objects.
        - Related files must have the same filename, but with diffening extensions to indicate mimetypes.
        - ie. myFile.xml and myFile.jpg'), - ); - - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Submit') - ); - - - return($form); -} - -function batch_creation_form_validate($form, &$form_state) { - - $fieldName = 'file-location'; - if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name'][$fieldName])) { - $file = file_save_upload($fieldName); - if ($file->filemime != 'application/zip') { - form_set_error($fieldName, 'Input file must be a .zip file'); - return; - } - if (!$file) { - form_set_error($fieldName, 'Error uploading file.'); - return; - } - $form_state['values']['file'] = $file; - } - else { - // set error - form_set_error($fieldName, 'Error uploading file.'); - return; - } -} - -function batch_creation_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - global $user; - $namespace_mappings = array(); - $content_model = $form_state['values']['content_model']; - $metadata = $form_state['values']['meta_data_type']; - $namespace_process = explode('~~~', $form_state['values']['namespace_mappings']); - foreach ($namespace_process as $line) { - $line_parts = explode('^', $line); - $namespace_mappings[$line_parts[0]] = $line_parts[1]; - } - $namespace = $namespace_mappings[$content_model]; - $dirName = "temp" . $user->uid; - $tmpDir = file_directory_path() . '/' . $dirName . '/'; - mkdir($tmpDir); - $file = $form_state['values']['file']; - $fileName = $file->filepath; - $file_list = array(); - $cmdString = "unzip -q -o -d $tmpDir \"$fileName\""; - system($cmdString, $retVal); - $dirs = array(); - $doNotAdd = array('.', '..', '__MACOSX'); - array_push($dirs, $tmpDir); - $files = scandir($tmpDir); - foreach ($files as $file) { - if (is_dir("$tmpDir/$file") & !in_array($file, $doNotAdd)) { - array_push($dirs, $tmpDir . $file); - } - } - - foreach ($dirs as $directory) { - if ($inputs = opendir($directory)) { - while (FALSE !== ($file_name = readdir($inputs))) { - if (!in_array($file_name, $doNotAdd)) { - $ext = strrchr($file_name, '.'); - $base = preg_replace("/$ext$/", '', $file_name); - $ext = substr($ext, 1); - $file_list[$base][$ext] = "$directory" . $file_name; - } - } - closedir($inputs); - } - } - - /** - * use the content model class to construct a class representing the selected content model - * call execIngestmethods on each mimetype passed in - */ - create_fedora_batch($file_list, $content_model, $metadata, $namespace); -} - -function create_fedora_batch($file_list, $content_model, $metadata, $namespace) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - if (($cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM')) !== FALSE) { - $allowedMimeTypes = $cm->getMimetypes(); - - if (!in_array($dformat, $allowedMimeTypes)) { - form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . - implode(' ', $allowedMimeTypes))); - return; - } - elseif (!$cm->execIngestRules($file, $dformat)) { - drupal_set_message(t('Error following Content Model Rules'), 'error'); - foreach (ContentModel::$errors as $err) { - drupal_set_message($err, 'error'); - } - } - } - - $batch = array( - 'title' => 'Ingesting Objects', - 'operations' => array(), - 'file' => drupal_get_path('module', 'fedora_repository') . '/CollectionClass.inc', - ); - - - foreach ($file_list as $label => $object_files) { - - $batch['operations'][] = array('create_fedora_objects', array($label, $content_model, $object_files, $collection_pid, $metadata)); - } - - batch_set($batch); -} - -function create_fedora_objects($lable, $content_model, $object_files, $collection_pid, $namespace, $metadata, $content_model) { - $namespace = preg_replace('/:.*/', '', $namespace); - $pid = fedora_item::get_next_PID_in_namespace($namespace); - module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); - $item = Fedora_item::ingest_new_item($pid, 'A', $label, $owner); - $item->add_relationship('hasModel', $content_model, FEDORA_MODEL_URI); - if ($metadata == 'DC') { - $dc_xml = file_get_contents($object_files['xml']); - $object_files['xml'] = null; - $item->modify_datastream_by_value($dc_xml, 'DC', "Dublin Core", 'tex/xml'); - } - if ($metadata == 'MODS') { - $item->add_datastream_from_file($object_files['xml'], 'MODS'); - //add crosswalk to dc logic - } - - foreach ($object_files as $file) { - - } -} - diff --git a/CollectionManagement.inc b/CollectionManagement.inc index aac1fc69..8b2c04d1 100644 --- a/CollectionManagement.inc +++ b/CollectionManagement.inc @@ -7,7 +7,7 @@ * @param string $content_models * @return array */ -function collection_management_form(&$form_state, $parent_collection_pid, $content_models) { +function collection_management_form(&$form_state, $this_collection_pid, $content_models) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $restricted = FALSE; if (variable_get('fedora_namespace_restriction_enforced', true)) { @@ -22,7 +22,7 @@ function collection_management_form(&$form_state, $parent_collection_pid, $conte } module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - $item = new Fedora_Item($parent_collection_pid); + $item = new Fedora_Item($this_collection_pid); $collection_name = $item->objectProfile->objLabel; $new_content_models = get_content_models_as_option_array(); $cm_options = array(); @@ -43,7 +43,7 @@ function collection_management_form(&$form_state, $parent_collection_pid, $conte $form['child_creation']['titlebox'] = array( '#type' => 'item', - '#value' => t("Create New Child Collection within $parent_collection_pid"), + '#value' => t("Create New Child Collection within $this_collection_pid"), ); $form['child_creation']['collection_name'] = array( @@ -75,11 +75,14 @@ function collection_management_form(&$form_state, $parent_collection_pid, $conte '#description' => t("Namespace for objects in this collection."), ); } - $form['child_creation']['parent_collection'] = array( + $form['parent_collection'] = array( '#type' => 'hidden', - '#value' => $parent_collection_pid, + '#value' => $this_collection_pid, + ); + $form['collection_pid'] = array( + '#type' => 'hidden', + '#value' => $this_collection_pid, ); - $form['child_creation']['content_models'] = array( '#title' => "Choose allowable content models for this collection", '#type' => 'checkboxes', @@ -101,7 +104,7 @@ function collection_management_form(&$form_state, $parent_collection_pid, $conte ); $form['change_cmodel']['titlebox'] = array( '#type' => 'item', - '#value' => t("Change Content Models within $parent_collection_pid"), + '#value' => t("Change Content Models within $this_collection_pid"), ); $form['change_cmodel']['current_content_model'] = array( @@ -118,7 +121,7 @@ function collection_management_form(&$form_state, $parent_collection_pid, $conte ); $form['change_cmodel']['collection_pid'] = array( '#type' => 'hidden', - '#value' => $parent_collection_pid, + '#value' => $this_collection_pid, ); $form['change_cmodel']['submit'] = array( '#type' => 'submit', @@ -129,7 +132,7 @@ function collection_management_form(&$form_state, $parent_collection_pid, $conte $form['delete_collection'] = array( '#title' => "Permanently Delete $collection_name", '#type' => 'fieldset', - '#description' => t("Clicking this button will delete $collection_name and all objects within.
        This action cannot be undone."), + '#description' => t("Clicking this button will delete all objects within $collection_name.
        This action cannot be undone."), '#collapsible' => TRUE, '#collapsed' => TRUE, ); @@ -263,14 +266,34 @@ function collection_management_form_submit($form, &$form_state) { } if ($form_state['clicked_button']['#id'] == 'delete_collection') { - $name = $user->name; - $objects = get_related_items_as_array($collection_pid, $relationship); - $objects[] = $collection_pid; - foreach ($objects as $object) { - $item_to_delete = new Fedora_Item($object); - $item_to_delete->purge("$object purged by $name"); + $collection_name = $form_state['values']['collection_name']; + $pids = get_related_items_as_array($collection_pid, 'isMemberOfCollection'); + + $batch = array( + 'title' => "Deleting Objects from $name", + 'operations' => array(), + 'file' => drupal_get_path('module', 'fedora_repository') . '/CollectionManagement.inc', + ); + + + foreach ($pids as $pid) { + + $batch['operations'][] = array('delete_objects_as_batch', array($pid)); } - drupal_goto('fedora/repository'); + + batch_set($batch); + batch_process('/fedora/repository'); } } +function delete_objects_as_batch($pid) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $name = $user->name; + $item_to_delete = new Fedora_Item($pid); + $models = $item_to_delete->get_models(); + foreach ($models as $model) { + if ($model['object'] != 'islandora:collectionCModel') { + $item_to_delete->purge("$object purged by $name"); + } + } +} \ No newline at end of file diff --git a/ContentModel.inc b/ContentModel.inc index 64b71980..ccc0fb82 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -4,7 +4,6 @@ * @file * */ - /** * @file * Content Model Class @@ -396,12 +395,12 @@ class ContentModel extends XMLDatastream { $rootEl->appendChild($ingest_formEl); if (isset($sXml->edit_metadata) && - trim($sXml->edit_metadata->build_form_method->module) != '' && - trim($sXml->edit_metadata->build_form_method->file) != '' && - trim($sXml->edit_metadata->build_form_method->class_name) != '' && - trim($sXml->edit_metadata->build_form_method->method_name) != '' && - trim($sXml->edit_metadata->submit_form_method->method_name) != '' && - trim($sXml->edit_metadata->build_form_method['dsid']) != '' + trim($sXml->edit_metadata->build_form_method->module) != '' && + trim($sXml->edit_metadata->build_form_method->file) != '' && + trim($sXml->edit_metadata->build_form_method->class_name) != '' && + trim($sXml->edit_metadata->build_form_method->method_name) != '' && + trim($sXml->edit_metadata->submit_form_method->method_name) != '' && + trim($sXml->edit_metadata->build_form_method['dsid']) != '' ) { $edit_metadata_methodEl = $newDom->createElement('edit_metadata_method'); $edit_metadata_methodEl->setAttribute('module', $sXml->edit_metadata->build_form_method->module); @@ -491,6 +490,23 @@ class ContentModel extends XMLDatastream { return $ret; } + /** + * Gets the DSID of the default datastream + * from the element of the schema. + * Returns FALSE on failure. + * + * @return String + */ + + public function getDatastreamNameDSID() { + $datastreams = $this->xml->getElementsByTagName('datastreams'); + $datastream = $datastreams->item(0); + if ($datastreams->length > 0) { + $datastream = $datastreams->item(0)->getElementsByTagName('datastream'); + return $datastream->item(0)->getAttribute('dsid'); + } + } + /** * Gets an array of form elements to use in the ingest form. The results of this array are passed * to the specified ingest form builder. The form builder can optionally not use the elements as defined @@ -1677,9 +1693,9 @@ class ContentModel extends XMLDatastream { $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module')) && - $file == $dispMethods->item($i)->getAttribute('file') && - $class == $dispMethods->item($i)->getAttribute('class') && - $method == $dispMethods->item($i)->getAttribute('method')) { + $file == $dispMethods->item($i)->getAttribute('file') && + $class == $dispMethods->item($i)->getAttribute('class') && + $method == $dispMethods->item($i)->getAttribute('method')) { $found = $dispMethods->item($i); } } @@ -1715,9 +1731,9 @@ class ContentModel extends XMLDatastream { $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module') == '') && - $file == $dispMethods->item($i)->getAttribute('file') && - $class == $dispMethods->item($i)->getAttribute('class') && - $method == $dispMethods->item($i)->getAttribute('method')) { + $file == $dispMethods->item($i)->getAttribute('file') && + $class == $dispMethods->item($i)->getAttribute('class') && + $method == $dispMethods->item($i)->getAttribute('method')) { $found = $dispMethods->item($i); } } @@ -1919,9 +1935,9 @@ class ContentModel extends XMLDatastream { $found = FALSE; for ($i = 0; $found === FALSE && $i < $methods->length; $i++) { if (($methods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($i)->getAttribute('module')) == $module && - $methods->item($i)->getAttribute('file') == $file && - $methods->item($i)->getAttribute('class') == $class && - $methods->item($i)->getAttribute('method') == $method) { + $methods->item($i)->getAttribute('file') == $file && + $methods->item($i)->getAttribute('class') == $class && + $methods->item($i)->getAttribute('method') == $method) { $found = $methods->item($i); } } diff --git a/ObjectHelper.inc b/ObjectHelper.inc index e6e0bb69..9e9995b7 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -21,6 +21,7 @@ class ObjectHelper { public static $VIEW_DETAILED_CONTENT_LIST = 'view detailed list of content'; public static $MANAGE_COLLECTIONS = 'manage collections'; public static $DELETE_ENTIRE_COLLECTIONS = 'delete entire collections'; + public static $CREATE_BATCH_PROCESS = 'create batch process'; public static $DISPLAY_ALWAYS = 0; public static $DISPLAY_NEVER = 1; public static $DISPLAY_NO_MODEL_OUTPUT = 2; diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 4c78ce97..4dacca8c 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -562,7 +562,6 @@ class Fedora_Item { $relsextxml->loadXML($relsext); $relsextxml->normalizeDocument(); $rels = $relsextxml->getElementsByTagNameNS('info:fedora/fedora-system:def/relations-external#', '*'); - foreach ($rels as $child) { if (empty($relationship) || preg_match("/$relationship/", $child->tagName)) { $relationships[] = array( @@ -572,12 +571,36 @@ class Fedora_Item { ); } } + + return $relationships; + } + + + function get_models() { + $relationships = array(); + try { + $relsext = $this->get_datastream_dissemination('RELS-EXT'); + } catch (exception $e) { + drupal_set_message(t("Error retrieving RELS-EXT of object $pid"), 'error'); + return $relationships; + } + + // Parse the RELS-EXT into an associative array. + $relsextxml = new DOMDocument(); + $relsextxml->loadXML($relsext); + $relsextxml->normalizeDocument(); + $mods = $relsextxml->getElementsByTagNameNS(FEDORA_MODEL_URI, '*'); + foreach ($mods as $child) { + if (empty($relationship) || preg_match("/$relationship/", $child->tagName)) { + $relationships[] = array( + 'subject' => $this->pid, + 'predicate' => $child->tagName, + 'object' => substr($child->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource'), 12), + ); + } + } + return $relationships; - //$children = $relsextxml->RDF->description; - //$children = $relsextxml->RDF->description; - //$params = array( 'pid' => $this->pid, - // 'relationship' => 'NULL' ); - //return $this->soap_call( 'getRelationships', $params ); } /** diff --git a/fedora_repository.module b/fedora_repository.module index 06c2d6d4..ea1c15c5 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -832,6 +832,7 @@ function fedora_repository_perm() { OBJECTHELPER::$VIEW_DETAILED_CONTENT_LIST, OBJECTHELPER::$MANAGE_COLLECTIONS, OBJECTHELPER::$DELETE_ENTIRE_COLLECTIONS, + OBJECTHELPER::$CREATE_BATCH_PROCESS, ); } @@ -989,7 +990,17 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU // Add a 'manage object' tab for all objects, where detailed list of content is shown. $obj = new FedoraObjectDetailedContent($pid); $object_details = $obj->showFieldSets(); + if ($object_details['fedora_object_details']['#selected'] == true){ + foreach($cmodels_tabs as $cmodel_tab){ + if (is_array($cmodel_tab)){ + $cmodel_tab['#selected'] = FALSE; + } + + } + } $cmodels_tabs = array_merge($cmodels_tabs, $object_details); + + return tabs_render($cmodels_tabs); } diff --git a/xsl/mods_to_dc.xsl b/xsl/mods_to_dc.xsl new file mode 100644 index 00000000..4c007469 --- /dev/null +++ b/xsl/mods_to_dc.xsl @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + : + + + + + . + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- + + + + + -- + + + + + + + + + + + + + + + + + + + + + + + + + + -- + + + + + + + + + + + + + + + + - + + + + + + + + + + -- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Collection + + + DataSet + + + Service + + + + Software + + + Image + + + + InteractiveResource + + + MovingImage + + + PhysicalObject + + + + Sound + + + StillImage + + + + Text + + + Text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- + + + + + + + + + + + + + -- + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + , + + + + + ( + + + ) + + + ( + + ) + + + + + + + + + + - + + + + + + - + + + + + + + + + + + + + From 24f7bfb1e9dc8c4685e2fc1fe652ca76ae62db32 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Fri, 30 Sep 2011 08:12:38 -0300 Subject: [PATCH 085/247] Changed the way ContentModel assigned names to objects --- ContentModel.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ContentModel.inc b/ContentModel.inc index ccc0fb82..b1f28074 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -203,6 +203,9 @@ class ContentModel extends XMLDatastream { try { if (self::valid_pid($pid)) { $fedoraItem = new Fedora_Item($pid); + if (!$name) { + $name = $fedoraItem->objectProfile->objLabel; + } $dsid = ($dsid != NULL && self::valid_dsid($dsid)) ? $dsid : ContentModel::getDefaultDSID(); $ds = $fedoraItem->get_datastream_dissemination($dsid); if (!empty($ds)) { @@ -497,7 +500,6 @@ class ContentModel extends XMLDatastream { * * @return String */ - public function getDatastreamNameDSID() { $datastreams = $this->xml->getElementsByTagName('datastreams'); $datastream = $datastreams->item(0); From 3b3891ebd7fbc692282deba92eee4f2c40f98569 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Fri, 30 Sep 2011 09:53:26 -0300 Subject: [PATCH 086/247] Added documentation --- BatchIngest.inc | 42 +++++++++++++++++++++++++++++++++++----- CollectionManagement.inc | 9 +++++++-- api/fedora_utils.inc | 2 +- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/BatchIngest.inc b/BatchIngest.inc index 2f3f6e57..31daa608 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -1,5 +1,13 @@ $label + * @param $content_model + * @param $object_files + * @param $collection_pid + * @param $namespace + * @param $metadata + */ + + function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) { module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'MimeClass'); @@ -198,6 +218,14 @@ function create_batch_objects($label, $content_model, $object_files, $collection } } +/** + * transforms mods to dc + * @param $mods_xml + * @return + */ + + + function batch_create_dc_from_mods($mods_xml) { $path = drupal_get_path('module', 'fedora_repository'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); @@ -225,7 +253,11 @@ function batch_create_dc_from_mods($mods_xml) { return $dc_xml; } - +/** + * + * @param $dir + * @return + */ function recursive_directory_delete($dir) { if (!file_exists($dir)) return true; diff --git a/CollectionManagement.inc b/CollectionManagement.inc index 8b2c04d1..148fab84 100644 --- a/CollectionManagement.inc +++ b/CollectionManagement.inc @@ -29,7 +29,9 @@ function collection_management_form(&$form_state, $this_collection_pid, $content $name_mappings = array(); foreach ($content_models as $content_model) { if ($content_model->pid != "islandora:collectionCModel") { - $cm_options[$content_model->pid] = $content_model->name; + $item = new fedora_item($content_model->pid); + $cm_name = $item->objectProfile->objLabel; + $cm_options[$content_model->pid] = $cm_name; } } @@ -285,7 +287,10 @@ function collection_management_form_submit($form, &$form_state) { batch_process('/fedora/repository'); } } - +/** + * deletes PID if pid is not collection + * @param $pid + */ function delete_objects_as_batch($pid) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $name = $user->name; diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index c430d37d..c8ce7d0e 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -299,7 +299,7 @@ function get_content_models_as_option_array() { $nameparts = explode(':', $parts[0]); if (!$restricted || in_array($nameparts[0], $allowed)) if ($item->get_datastream_dissemination('ISLANDORACM')) { - $options[$parts[0]] = $parts[1]; + $options[$parts[0]] = $parts[1]. ' ~ ' . $parts[0] ; } } } From 3e7f6cfcde4a7888d87cd741e6c4a0dcec0ca0d2 Mon Sep 17 00:00:00 2001 From: ppound Date: Fri, 30 Sep 2011 11:48:45 -0300 Subject: [PATCH 087/247] updated install file so kakadu and imagemagick checks are warnings not errors --- fedora_repository.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.install b/fedora_repository.install index b7d02c4a..43bbcf70 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -93,7 +93,7 @@ function fedora_repository_requirements($phase) { $requirements['imagick']['title'] = t("Image Magick library"); if ($return_value) { $requirements['imagick']['value'] = t("Not installed"); - $requirements['imagick']['severity'] = REQUIREMENT_ERROR; + $requirements['imagick']['severity'] = REQUIREMENT_WARNING; $requirements['imagick']['description'] = t('Ensure that the Image Magick library is installed.'); } else { @@ -106,7 +106,7 @@ function fedora_repository_requirements($phase) { $requirements['kakadu']['title'] = t("Kakadu library"); if ($return_value) { $requirements['kakadu']['value'] = t("Not installed"); - $requirements['kakadu']['severity'] = REQUIREMENT_ERROR; + $requirements['kakadu']['severity'] = REQUIREMENT_WARNING; $requirements['kakadu']['description'] = t('Ensure that the Kakadu library is installed.'); } else { From df36a7a00c70b88f8f19e1039c6e51943dcf5771 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Fri, 30 Sep 2011 16:44:50 -0300 Subject: [PATCH 088/247] Added collection policy management to collection tabs --- CollectionManagement.inc | 103 +++++++++++++++++++++++++++++++++++++-- CollectionPolicy.inc | 2 +- 2 files changed, 101 insertions(+), 4 deletions(-) diff --git a/CollectionManagement.inc b/CollectionManagement.inc index 148fab84..83bb9952 100644 --- a/CollectionManagement.inc +++ b/CollectionManagement.inc @@ -34,6 +34,10 @@ function collection_management_form(&$form_state, $this_collection_pid, $content $cm_options[$content_model->pid] = $cm_name; } } + if (!empty($cm_options)) { + $show_delete = true; + } + $content_models = get_content_models_as_option_array(); $form['child_creation'] = array( @@ -53,6 +57,7 @@ function collection_management_form(&$form_state, $this_collection_pid, $content '#type' => 'textfield', '#description' => t("Human readable name for this collection"), ); + $form['child_creation']['new_collection_pid'] = array( '#title' => "Collection PID", '#type' => 'textfield', @@ -81,6 +86,7 @@ function collection_management_form(&$form_state, $this_collection_pid, $content '#type' => 'hidden', '#value' => $this_collection_pid, ); + $form['collection_pid'] = array( '#type' => 'hidden', '#value' => $this_collection_pid, @@ -98,6 +104,62 @@ function collection_management_form(&$form_state, $this_collection_pid, $content '#value' => t('Create Collection'), '#id' => 'create_class' ); + $form['manage_collection_policy'] = array( + '#title' => "Manage Collection Policies", + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['manage_collection_policy']['add'] = array( + '#title' => "Add Content Model", + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => $show_delete, + ); + + + $form ['manage_collection_policy']['add']['content_model_to_add'] = array( + '#title' => "Choose Content Model", + '#type' => 'select', + '#options' => array_diff_key($content_models, $cm_options), + '#description' => t("Choose content model to add to this collection policy."), + ); + + $form ['manage_collection_policy']['add']['new_cp_namespace'] = array( + '#title' => "Choose Namespace", + '#type' => 'textfield', + '#size' => 15, + '#description' => t("Choose namespace for objects in this collection associated with this content model"), + ); + $form['manage_collection_policy']['add']['submit'] = array( + '#type' => 'submit', + '#value' => t('Add Content Model to Collection Policy'), + '#id' => 'add_cm' + ); + + if ($show_delete) { + $form['manage_collection_policy']['remove'] = array( + '#title' => "Delete Content Model", + '#type' => 'fieldset', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form ['manage_collection_policy']['remove']['content_models_to_remove'] = array( + '#title' => "Choose Content Model to Remove", + '#type' => 'checkboxes', + '#options' => $cm_options, + '#description' => t("Choose content models to remove from this collection policy."), + ); + + + $form['manage_collection_policy']['remove']['submit'] = array( + '#type' => 'submit', + '#value' => t('Remove Content Collection Policy'), + '#id' => 'remove_cm' + ); + } $form['change_cmodel'] = array( '#title' => "Change Content Models", '#type' => 'fieldset', @@ -167,11 +229,17 @@ function collection_management_form_validate($form, &$form_state) { $pid = $form_state['values']['new_collection_pid']; $item = new fedora_item($pid); if ($item->exists()) { - form_set_error('', t("$pid already exists within your repository. the PID must be unique")); + form_set_error('new_collection_pid', t("$pid already exists within your repository. the PID must be unique")); return; } if (!valid_pid($pid)) { - form_set_error('', t("$pid is not a valid identifier")); + form_set_error('new_collection_pid', t("$pid is not a valid identifier")); + return; + } + } + if ($form_state['clicked_button']['#id'] == 'add_cm') { + if (!valid_pid($form_state['values']['new_cp_namespace'])) { + form_set_error('new_cp_namespace', t("Namespace must be a valid PID")); return; } } @@ -189,6 +257,7 @@ function collection_management_form_submit($form, &$form_state) { module_load_include('inc', 'fedora_repository', 'api/dublin_core'); global $user; $collection_pid = $form_state['values']['parent_collection']; + $policy = CollectionPolicy::loadFromCollection($collection_pid, TRUE); if ($form_state['clicked_button']['#id'] == 'create_class') { $module_path = drupal_get_path('module', 'fedora_repository'); $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; @@ -224,10 +293,37 @@ function collection_management_form_submit($form, &$form_state) { drupal_goto("/fedora/repository/$new_collection_pid"); } + if ($form_state['clicked_button']['#id'] == 'add_cm') { + + $cp_namespace = $form_state['values']['new_cp_namespace']; + $cp_content_model = $form_state['values']['content_model_to_add']; + $policy->addModel(ContentModel::loadFromModel($cp_content_model), $cp_namespace); + $policy->saveToFedora(); + drupal_set_message("Collection model successfully added"); + } + + if ($form_state['clicked_button']['#id'] == 'remove_cm') { + $candidates = $form_state['values']['content_models_to_remove']; + $count = 0; + foreach ($candidates as $candidate) { + if (is_string($candidate)) { + $policy->removeModel(ContentModel::loadFromModel($candidate)); + $count++; + } + } + if ($count > 0) { + $policy->saveToFedora(); + if ($count > 1) { + $s = 's'; + } + drupal_set_message("$count collection model$s removed"); + } + } + if ($form_state['clicked_button']['#id'] == 'change_model') { $current_content_model = $form_state['values']['current_content_model']; $new_content_model = $form_state['values']['new_content_model']; - $policy = CollectionPolicy::loadFromCollection($collection_pid, TRUE); + $add_to_policy = TRUE; $policy_cms = $policy->getContentModels(); foreach ($policy_cms as $policy_cm) { @@ -287,6 +383,7 @@ function collection_management_form_submit($form, &$form_state) { batch_process('/fedora/repository'); } } + /** * deletes PID if pid is not collection * @param $pid diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index b4993563..b801eaff 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -578,7 +578,7 @@ class CollectionPolicy extends XMLDatastream { /** * addModel ?? - * @param type $cm + * @param ContentModel $cm * @param type $namespace * @return type */ From b765fbb65b51a70adcac38e09f5d17cc640e40c1 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Mon, 3 Oct 2011 13:17:34 -0300 Subject: [PATCH 089/247] Moved the files to the appropriate name --- digital_repository.info | 9 + digital_repository.install | 158 ++ digital_repository.module | 2251 ++++++++++++++++++++++++++ digital_repository.solutionpacks.inc | 175 ++ 4 files changed, 2593 insertions(+) create mode 100644 digital_repository.info create mode 100644 digital_repository.install create mode 100644 digital_repository.module create mode 100644 digital_repository.solutionpacks.inc diff --git a/digital_repository.info b/digital_repository.info new file mode 100644 index 00000000..20ff4d30 --- /dev/null +++ b/digital_repository.info @@ -0,0 +1,9 @@ +; $Id$ +name = Digital Repository +dependencies[] = imageapi +dependencies[] = tabs +dependencies[] = islandora_content_model_forms +description = Shows a list of items in a fedora collection. +package = Islandora +version = 11.2.beta1 +core = 6.x diff --git a/digital_repository.install b/digital_repository.install new file mode 100644 index 00000000..43bbcf70 --- /dev/null +++ b/digital_repository.install @@ -0,0 +1,158 @@ +&-", $return_value); + $requirements['imagick']['title'] = t("Image Magick library"); + if ($return_value) { + $requirements['imagick']['value'] = t("Not installed"); + $requirements['imagick']['severity'] = REQUIREMENT_WARNING; + $requirements['imagick']['description'] = t('Ensure that the Image Magick library is installed.'); + } + else { + $requirements['imagick']['value'] = t("Installed"); + $requirements['imagick']['severity'] = REQUIREMENT_OK; + } + + // Test for Kakadu + system("hash kdu_compress 2>&-", $return_value); + $requirements['kakadu']['title'] = t("Kakadu library"); + if ($return_value) { + $requirements['kakadu']['value'] = t("Not installed"); + $requirements['kakadu']['severity'] = REQUIREMENT_WARNING; + $requirements['kakadu']['description'] = t('Ensure that the Kakadu library is installed.'); + } + else { + $requirements['kakadu']['value'] = t("Installed"); + $requirements['kakadu']['severity'] = REQUIREMENT_OK; + } + } + elseif ($phase == 'runtime') { + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + + $requirements['fedora-repository']['title'] = t("Fedora server"); + if (!fedora_available()) { + $requirements['fedora-repository']['value'] = t("Not available"); + $requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; + $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the collection settings are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); + } + else { + $requirements['fedora-repository']['value'] = t("Available"); + $requirements['fedora-repository']['severity'] = REQUIREMENT_OK; + } + + // Check for ImageMagick + $requirements['fedora-imagemagick']['title'] = t("ImageMagick convert in \$PATH"); + $result = exec('convert'); + if (!$result) { + $requirements['fedora-imagemagick']['value'] = t('Not in $PATH'); + $requirements['fedora-imagemagick']['description'] = t('Islandora will not be able to create thumbnails. Ensure that ImageMagick is installed and the convert command is executable by the web server user.'); + $requirements['fedora-imagemagick']['severity'] = REQUIREMENT_WARNING; + } + else { + $requirements['fedora-imagemagick']['value'] = t("Available"); + $requirements['fedora-imagemagick']['severity'] = REQUIREMENT_OK; + } + + $requirements['fedora-kakadu']['title'] = 'Kakadu kdu_compress in $PATH'; + $kdu_res = exec('kdu_compress -v'); + if (!$kdu_res) { + $requirements['fedora-kakadu']['value'] = ('Not in $PATH'); + $requirements['fedora-kakadu']['description'] = t('Islandora cannot convert TIFF image files to JPEG2000 format. Ensure Kakadu is installed and the kdu_compress command is executable by the web server user.'); + $requirements['fedora-kakadu']['severity'] = REQUIREMENT_WARNING; + } + else { + $requirements['fedora-kakadu']['value'] = t("Available"); + $requirements['fedora-kakadu']['severity'] = REQUIREMENT_OK; + } + } + + return $requirements; +} diff --git a/digital_repository.module b/digital_repository.module new file mode 100644 index 00000000..ea1c15c5 --- /dev/null +++ b/digital_repository.module @@ -0,0 +1,2251 @@ +createAdminForm(); +} + +/** + * drupal hook + * calls the fedora_repositorys_admin form + */ +function fedora_repository_menu() { + module_load_include('inc', 'fedora_repository', 'formClass'); + $adminMenu = new formClass(); + return $adminMenu->createMenu(); +} + +/** + * drupal hook to show help + * + * @param type $path + * @param type $arg + * @return type + */ +function fedora_repository_help($path, $arg) { + switch ($path) { + case 'admin/modules#description' : + return t('Grabs a list of items from a collection in Drupal that are presented on the home page.'); + case 'node/add#fedora_repository' : + return t('Use this page to grab a list of items from a Fedora collection.'); + } +} + +/** + * fedora repository purge object + * @param type $pid + * @param type $name + * @return type + */ +function fedora_repository_purge_object($pid = NULL, $name = NULL) { + if (!user_access('purge objects and datastreams')) { + drupal_set_message(t('You do not have access to add a datastream to this object.'), 'error'); + return ''; + } + if ($pid == NULL) { + drupal_set_message(t('You must specify an object pid to purge an object.'), 'error'); + return ''; + } + $output = t('Are you sure you wish to purge object %name %pid!
        This cannot be undone
        ', + array( + '%name' => $name, + '%pid' => $pid) + ); + + $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); + return $output; +} + +/** + * fedora repository collection view + * @global type $user + * @param type $pid + * @param type $collection + * @param type $pageNumber + * @return type + */ +function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pageNumber = NULL) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + global $user; + if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); + return ' '; + } + + $objectHelper = new ObjectHelper(); + if ($pid == NULL) { + $pid = variable_get('fedora_repository_pid', 'islandora:root'); + } + + $content = ''; + + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + $collectionClass = new CollectionClass(); + $results = $collectionClass->getRelatedItems($pid, NULL); + $content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); + + return $content; +} + +/** + * fedora repository ingest object + * @param type $collection_pid + * @param type $collection_label + * @param type $content_model + * @return type + */ +function fedora_repository_ingest_object($collection_pid=NULL, $collection_label = NULL, $content_model = NULL) { + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + if (!user_access('ingest new fedora objects')) { + drupal_set_message(t('You do not have permission to ingest.'), 'error'); + return ''; + } + + if (!valid_pid($collection_pid)) { + if (valid_pid(urldecode($collection_pid))) { + $collection_pid = urldecode($collection_pid); + } + else { + drupal_set_message(t("This collection PID $collection_pid is not valid"), 'error'); + return ' '; + } + } + + if ($collection_pid == NULL) { + drupal_set_message(t('You must specify a collection object pid to ingest an object.'), 'error'); + return ''; + } + $output = drupal_get_form('fedora_repository_ingest_form', $collection_pid, $collection_label, $content_model); + + $breadcrumbs = array(); + $objectHelper = new ObjectHelper(); + $objectHelper->getBreadcrumbs($collection_pid, $breadcrumbs); + drupal_set_breadcrumb(array_reverse($breadcrumbs)); + + return $output; +} + +/** + * fedora repository ingest form submit + * @global type $base_url + * @global type $user + * @param array $form + * @param array $form_state + */ +function fedora_repository_ingest_form_submit(array $form, array &$form_state) { +//only validate the form if the submit button was pressed (other buttons may be used for AHAH + if ($form_state['storage']['xml']) { + if (module_exists('islandora_content_model_forms')) { + module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); + $xml_form = new IngestObjectMetadataForm(); + $xml_form->submit($form, $form_state); + } + } + else if ($form_state['clicked_button']['#id'] == 'edit-submit') { + global $base_url; + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + + $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); + $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); + $err = TRUE; + $redirect = TRUE; + if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['collection_pid'])) !== FALSE) { + $relationship = $cp->getRelationship(); + + if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + $pid = $cp->getNextPid($contentModelDsid); + global $user; + $form_state['values']['user_id'] = $user->name; + $form_state['values']['pid'] = $pid; + $form_state['values']['content_model_pid'] = $contentModelPid; + $form_state['values']['relationship'] = $relationship; + + $err = (!$cm->execFormHandler($form_state['values'], $form_state)); + + $_SESSION['fedora_ingest_files'] = ''; //empty this variable + + $attr = $cm->getIngestFormAttributes(); + $redirect = $attr['redirect']; + + if ($redirect) { + $form_state['storage'] = NULL; + } + } + } + + if ($redirect) { + $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; + } + } +} + +/** + * fedora repository ingest form validate + * @param type $form + * @param type $form_state + * @return type + */ +function fedora_repository_ingest_form_validate($form, &$form_state) { +//only validate the form if the submit button was pressed (other buttons may be used for AHAH + if ($form_state['clicked_button']['#id'] == 'edit-submit') { + switch ($form_state['storage']['step']) { + case 1: + $form_state['storage']['step']++; + $form_state['rebuild'] = TRUE; + break; + + case 2: +// XML based form. + if ($form_state['storage']['xml']) { + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + $xml_form->validate($form, $form_state); + } +// Get the uploaded file. + $validators = array(); + + if (!empty($_FILES['files']['name']['ingest-file-location'])) { + $fileObject = file_save_upload('ingest-file-location', $validators); + + file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); + $form_state['values']['ingest-file-location'] = $fileObject->filepath; + } + + if (isset($form_state['values']['ingest-file-location']) && file_exists($form_state['values']['ingest-file-location'])) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); + + $file = $form_state['values']['ingest-file-location']; + + $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); + $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); + + if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + $allowedMimeTypes = $cm->getMimetypes(); + + $mimetype = new MimeClass(); + $dformat = $mimetype->getType($file); + + if (!empty($file)) { + if (!in_array($dformat, $allowedMimeTypes)) { + form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . + implode(' ', $allowedMimeTypes))); + file_delete($file); + return; + } + elseif (!$cm->execIngestRules($file, $dformat)) { + drupal_set_message(t('Error following Content Model Rules'), 'error'); + foreach (ContentModel::$errors as $err) { + drupal_set_message($err, 'error'); + } + } + } + } + } + $form_state['rebuild'] = FALSE; + break; + } + } +} + +/** + * fedora repository ingest form + * @param type $form_state + * @param type $collection_pid + * @param type $collection_label + * @param type $content_model + * @return type + */ +function fedora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) { + module_load_include('inc', 'fedora_repository', 'formClass'); +// 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; + } + $ingestForm = new formClass(); + $form_state['storage']['content_model'] = $content_model; + $form_state['storage']['collection_pid'] = $collection_pid; + return $ingestForm->createIngestForm($collection_pid, $collection_label, $form_state); +} + +/** + * fedora repository purge object form + * @global type $base_url + * @param type $form_state + * @param type $pid + * @param type $referrer + * @return type + */ +function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { + global $base_url; + if (!user_access('purge objects and datastreams')) { + return NULL; + } + if ($pid == NULL) { + return NULL; + } + $form['pid'] = array( + '#type' => 'hidden', + '#value' => "$pid" + ); + if (!strstr(drupal_get_destination(), urlencode('fedora/repository'))) { + $form['referrer'] = array( + '#type' => 'hidden', + '#value' => $referrer, + ); + } + if (!isset($form_state['storage']['confirm'])) { +// do your normal $form definition here + + + $form['submit'] = array( + '#type' => 'image_button', + '#src' => drupal_get_path('module', 'fedora_repository') . '/images/purge_big.png', + '#value' => t('Purge'), + '#suffix' => 'Purge this object', + ); + if (!empty($collectionPid)) { + $collectionPid = $_SESSION['fedora_collection']; + } +//$form['#redirect'] = $referrer; + + return $form; + } + else { +// ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form + + return confirm_form($form, 'Confirm Purge Object', $referrer, 'Are you sure you want to delete this object? This action cannot be undone.', 'Delete', 'Cancel'); //Had better luck leaving off last param 'name' + } + return $form; +} + +/** + * add stream + * @param type $collection_pid + * @param type $collectionName + * @return type + */ +function add_stream($collection_pid=NULL, $collectionName=NULL) { + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + if (!valid_pid($collection_pid)) { + drupal_set_message(t("This PID is not valid!"), 'error'); + return ' '; + } + if (!user_access('ingest new fedora objects')) { + drupal_set_message(t('You do not have permission to ingest.'), 'error'); + return ''; + } + if ($collection_pid == NULL) { + drupal_set_message(t('You must specify an collection object pid to ingest an object.'), 'error'); + return ''; + } + $output .= drupal_get_form('fedora_repository_add_stream_form', $pid); + + return $output; +} + +/** + * add stream form submit + * @global type $base_url + * @param type $form + * @param type $form_state + * @return type + */ +function add_stream_form_submit($form, &$form_state) { + global $base_url; + if (!empty($form_state['submit']) && $form_state['submit'] == 'OK') { + $form_state['rebuild'] = TRUE; + return; + } + module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $pathToModule = drupal_get_path('module', 'fedora_repository'); + + $file = $form_state['values']['add-stream-file-location']; + + $pid = $form_state['values']['pid']; + $dsid = $form_state['values']['stream_id']; + $dsLabel = $form_state['values']['stream_label'] . substr($file, strrpos($file, '.')); // Add the file extention to the end of the label.; + $file_basename = basename($file); + $file_directory = dirname($file); + $streamUrl = $base_url . '/' . $file_directory . '/' . drupal_urlencode($file_basename); + + /* ----------------------------------------------------------------- + * need a better way to get mimetypes + */ + $mimetype = new MimeClass(); + $dformat = $mimetype->getType($file); + $controlGroup = "M"; + if ($dformat == 'text/xml') { + $controlGroup = 'X'; + } + try { + $item = new Fedora_Item($pid); + $item->add_datastream_from_url($streamUrl, $dsid, $dsLabel, $dformat, $controlGroup); + + $object_helper = new ObjectHelper(); + $object_helper->get_and_do_datastream_rules($pid, $dsid, $file); + + file_delete($file); + } catch (exception $e) { + drupal_set_message(t($e->getMessage()), 'error'); + return; + } + $form_state['rebuild'] = TRUE; +} + +/** + * add stream form + * @param type $form_state + * @param type $pid + * @return type + */ +function add_stream_form(&$form_state, $pid) { + module_load_include('inc', 'fedora_repository', 'formClass'); + $addDataStreamForm = new formClass(); + return $addDataStreamForm->createAddDataStreamForm($pid, $form_state); +} + +/** + * add stream form validate + * @param type $form + * @param type $form_state + * @return type + */ +function add_stream_form_validate($form, &$form_state) { + if ($form_state['clicked_button']['#value'] == 'OK') { + $form_state['rebuild'] = TRUE; + return; + } + $dsid = $form_state['values']['stream_id']; + $dsLabel = $form_state['values']['stream_label']; + if (strlen($dsid) > 64) { + form_set_error('', t('Data stream ID cannot be more than 64 characters.')); + return FALSE; + } + if (!(preg_match("/^[a-zA-Z]/", $dsid))) { + form_set_error('', t("Data stream ID ($dsid) has to start with a letter.")); + return FALSE; + } + if (strlen($dsLabel) > 64) { + form_set_error('', t('Data stream Label cannot be more than 64 characters.')); + return FALSE; + } + if (strpos($dsLabel, '/')) { + form_set_error('', t('Data stream Label cannot contain a "/".')); + return FALSE; + } + $validators = array( + // 'file_validate_is_image' => array(), + // 'file_validate_image_resolution' => array('85x85'), + // 'file_validate_size' => array(30 * 1024), + ); + + $fileObject = file_save_upload('add-stream-file-location', $validators); + +// Move the uploaded file to Drupal's files directory. + file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); + $form_state['values']['add-stream-file-location'] = $fileObject->filepath; +// TODO: Add error checking here. + $form_state['rebuild'] = FALSE; +} + +/** + * fedora repository purge stream + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $name + * @return type + */ +function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + global $user; + if ($pid == NULL || $dsId == NULL) { + drupal_set_message(t('You must specify an object pid and DataStream ID to purge a datastream'), 'error'); + return ' '; + } + if (!fedora_repository_access(OBJECTHELPER :: $PURGE_FEDORA_OBJECTSANDSTREAMS, $pid, $user)) { + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to purge objects."), 'error'); + return ' '; + } + + $output = t('Are you sure you wish to purge this datastream %name
        ', + array( + '%name' => $name) + ); + $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); + return $output; +} + +/** + * fedora repository purge object form submit + * @param type $form + * @param type $form_state + * @return type + */ +function fedora_repository_purge_object_form_submit($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + $pid = $form_state['values']['pid']; + if (!isset($form_state['storage']['confirm'])) { + $form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form + $form_state['rebuild'] = TRUE; // along with this + } + else { +// this is where you do your processing after they have pressed the confirm button + $params = array( + "pid" => $pid, + "logMessage" => "Purged", + "force" => "" + ); + try { + $soapHelper = new ConnectionHelper(); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $object = $client->__soapCall('purgeObject', array($params)); + unset($form_state['storage']['confirm']); + } catch (exception $e) { + if (preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage())) { + drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error'); + } + else { + drupal_set_message(t($e->getMessage()), 'error'); + } + return; + } + if (!empty($form_state['values']['referrer'])) { + $form_state['redirect'] = $form_state['values']['referrer']; + } + elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { + $collectionPid = $_SESSION['fedora_collection']; + + $form_state['redirect'] = "fedora/repository/$collectionPid/"; + } + else { + $form_state['redirect'] = 'fedora/repository/'; + } + } +} + +/** + * fedora repository purge stream form + * @param type $form_state + * @param type $pid + * @param type $dsId + * @return type + */ +function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) { + $form['pid'] = array( + '#type' => 'hidden', + '#value' => "$pid" + ); + $form['dsid'] = array( + '#type' => 'hidden', + '#value' => "$dsId" + ); + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Purge') + ); + + return $form; +} + +/** + * fedora repository purge stream form submit + * @global type $base_url + * @param type $form + * @param array $form_state + */ +function fedora_repository_purge_stream_form_submit($form, &$form_state) { + global $base_url; + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $pid = $form_state['values']['pid']; + $item = new Fedora_Item($pid); + $dsid = $form_state['values']['dsid']; + try { + $item->purge_datastream($dsid); + } catch (exception $e) { + drupal_set_message(t($e->getMessage()), 'error'); + } + $form_state['redirect'] = $base_url . "/fedora/repository/$pid"; +} + +/** + * fedora repository replace stream + * @param type $pid + * @param type $dsId + * @param type $dsLabel + * @param type $collectionName + * @return type + */ +function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { + if ($pid == NULL || $dsId == NULL) { + drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error'); + return ''; + } + $output = drupal_get_form('fedora_repository_replace_stream_form', $pid, $dsId, $dsLabel); + + return $output; +} + +/** + * fedora repository replace stream form + * @param type $form_state + * @param type $pid + * @param type $dsId + * @param type $dsLabel + * @return type + */ +function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { +//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); + module_load_include('inc', 'Fedora_Repository', 'formClass'); +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $replaceDataStreamForm = new formClass(); + return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state); +} + +/** + * fedora repository replace stream form validate + * @param type $form + * @param type $form_state + * @return type + */ +function fedora_repository_replace_stream_form_validate($form, &$form_state) { +// If a file was uploaded, process it. + if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name']['file'])) { + +// attempt to save the uploaded file + $file = file_save_upload('file', array(), file_directory_path()); + +// set error is file was not uploaded + if (!$file) { + form_set_error('file', 'Error uploading file.'); + return; + } + + $doc = new DOMDocument(); + module_load_include('inc', 'Fedora_Repository', 'MimeClass'); + $mime = new MimeClass(); + if ($mime->getType($file->filepath) == 'text/xml' && !$doc->load($file->filepath)) { + form_set_error('file', 'Invalid XML format.'); + return; + } + +// set files to form_state, to process when form is submitted + $form_state['values']['file'] = $file; + } +} + +/** + * fedora repository replace stream form submit + * @global type $base_url + * @param type $form + * @param array $form_state + */ +function fedora_repository_replace_stream_form_submit($form, &$form_state) { + global $base_url; + $file = $form_state['values']['file']; + $pid = $form_state['values']['pid']; + $dsid = $form_state['values']['dsId']; + $dsLabel = $form_state['values']['dsLabel']; + // Remove the original file extension from the label and add the new one + $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot + if ($indexOfDot !== FALSE) { + $dsLabel = substr($dsLabel, 0, $indexOfDot); + $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; + } + module_load_include('inc', 'Fedora_Repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + + $file_basename = basename($file->filepath); + $file_directory = dirname($file->filepath); + $streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename); + + /* ----------------------------------------------------------------- + * TODO: need a better way to get mimetypes + */ + $mimetype = new MimeClass(); + $dformat = $mimetype->getType($file->filepath); + + $item = new Fedora_Item($pid); + + $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); + + $form_state['redirect'] = 'fedora/repository/' . $pid; +} + +/** + * fedora repository edit qdc page + * @global type $user + * @param type $pid + * @param type $dsId + * @return type + */ +function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + global $user; + if ($pid == NULL || $dsId == NULL) { + drupal_set_message(t('You must specify an object pid and a Dublin Core DataStream ID to edit metadata'), 'error'); + return ' '; + } + if (!fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); + return ' '; + } + $output = drupal_get_form('fedora_repository_edit_qdc_form', $pid, $dsId); + + return $output; +} + +/** + * fedora repository edit qdc form + * @global type $user + * @param type $form_state + * @param type $pid + * @param type $dsId + * @return type + */ +function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + if ($pid == NULL) { + drupal_set_message(t('You must specify an object pid!'), 'error'); + } + global $user; + if (!fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); + return ' '; + } + + module_load_include('inc', 'fedora_repository', 'formClass'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + $soapHelper = new ConnectionHelper(); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); +// Check if there is a custom edit metadata function defined in the content model. + + $breadcrumbs = array(); + $objectHelper = new ObjectHelper(); + $objectHelper->getBreadcrumbs($pid, $breadcrumbs); + drupal_set_breadcrumb(array_reverse($breadcrumbs)); + + + $output = ''; + if (($cm = ContentModel::loadFromObject($pid)) !== FALSE) { + $output = $cm->buildEditMetadataForm($pid, $dsId); + } + + if (empty($output)) { +// There is no custom function, so just load the standard QDC form. + $metaDataForm = new formClass(); +//currently we only edit the dc metadata. If you defined a custom form with a custom handler you are sol for now. + return $metaDataForm->createMetaDataForm($pid, $dsId, $client, $form_state); + } + return $output; +} + +/** + * fedora repository edit qdc form validate + * @param type $form + * @param boolean $form_state + */ +function fedora_repository_edit_qdc_form_validate($form, &$form_state) { + if ($form_state['storage']['xml']) { + if ($form_state['storage']['step'] == 1) { + $form_state['storage']['step']++; + $form_state['rebuild'] = TRUE; + } + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + $xml_form->validate($form, $form_state); + } +} + +/** + * Check if there is a custom edit metadata function defined in the content model. If so, + * call it, if not do the submit action for the standard QDC metadata. Custom forms will + * need to implement their own equivalent to the FormClass->updateMetaData function + * + * @param array $form + * @param array $form_state + * @return + */ +function fedora_repository_edit_qdc_form_submit($form, &$form_state) { + if ($form_state['storage']['xml']) { + module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); + $xml_form = new EditObjectMetadataForm($form_state); + $xml_form->submit($form, $form_state); + } + else { + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + global $base_url; + if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { + +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $soap_helper = new ConnectionHelper(); + $client = $soap_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + +// Check the content model for a custom edit metadata form submit function. + if (isset($form_state['values']['pid'])) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { + return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client); + } + } + + module_load_include('inc', 'fedora_repository', 'formClass'); + $metaDataForm = new formClass(); + $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); + $form_state['storage'] = NULL; + $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; + + return $return_value; + } + } +} + +/** + * drupal hook + * creates a new permission than can be assigned to roles + */ +function fedora_repository_perm() { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + return array( + OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, + OBJECTHELPER::$EDIT_FEDORA_METADATA, + OBJECTHELPER::$PURGE_FEDORA_OBJECTSANDSTREAMS, + OBJECTHELPER::$ADD_FEDORA_STREAMS, + OBJECTHELPER::$INGEST_FEDORA_OBJECTS, + OBJECTHELPER::$EDIT_TAGS_DATASTREAM, + OBJECTHELPER::$VIEW_DETAILED_CONTENT_LIST, + OBJECTHELPER::$MANAGE_COLLECTIONS, + OBJECTHELPER::$DELETE_ENTIRE_COLLECTIONS, + OBJECTHELPER::$CREATE_BATCH_PROCESS, + ); +} + +/** + * drupal hook + * determines if a user has access to what they are asking for + * + * @param type $op + * @param type $node + * @param type $account + * @return type + */ +function fedora_repository_access($op, $node, $account) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + $objectHelper = new ObjectHelper(); + return $objectHelper->fedora_repository_access($op, $node, $account); +} + +/** + * Grabs a stream from fedora sets the mimetype and returns it. $dsID is the + * datastream id. + * @param $pid String + * @param $dsID String + */ +function makeObject($pid, $dsID) { + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + if (!valid_pid($pid)) { + drupal_set_message(t("Invalid PID!"), 'error'); + return ' '; + } + + if (!valid_dsid($dsID)) { + drupal_set_message(t("Invalid dsID!"), 'error'); + return ' '; + } + + if ($pid == NULL || $dsID == NULL) { + drupal_set_message(t("No pid or dsid given to create an object with.")); + return ' '; + } + global $user; + if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + drupal_access_denied(); + return; + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace."), 'error'); + return ' '; + } + + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + $objectHelper = new ObjectHelper(); + $objectHelper->makeObject($pid, $dsID); +} + +/** + * Sends an ITQL query to the Fedora Resource index (can only communicate with Kowari or mulgara) + * Reads the pid and datastream id as url parameters. Queries the collection object for the query + * if there is no query datastream falls back to the query shipped with the module. + * + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $collection + * @param type $page_number + * @param type $limit + * @return type + */ +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', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + global $user; + + if (!fedora_available()) { + drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); + return ''; + } + + if (!risearch_available()) { + drupal_set_message(t('The Fedora resource index search is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); + return ''; + } + + if ($pid == NULL) { + $pid = variable_get('fedora_repository_pid', 'islandora:root'); + } + + $item = new fedora_item($pid); + if (!$item->exists()) { + drupal_not_found(); + exit(); + } + + if ($pid & !valid_pid($pid)) { + drupal_set_message(t("Invalid PID!"), 'error'); + return ' '; + } + + if ($dsId & !valid_dsid($dsId)) { + drupal_set_message(t("Invalid dsID!"), 'error'); + return ' '; + } + if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (user_access('access administration pages')) { + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); + } + drupal_access_denied(); + exit; + return ' '; + } + + $objectHelper = new ObjectHelper(); + if ($pid == NULL) { + $pid = variable_get('fedora_repository_pid', 'islandora:root'); + } + $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); + if (in_array(-1, $headers)) { + drupal_access_denied(); + exit; + return ' '; + } + if ($dsId != NULL && $dsId != '-') { //if we have a dsID return the stream otherwise query for a collection of objects +//probably should check pid as well here. + return makeObject($pid, $dsId); + } + + $content = '
        '; + + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + $collectionClass = new CollectionClass(); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'plugins/FedoraObjectDetailedContent'); + $breadcrumbs = array(); + $objectHelper->getBreadcrumbs($pid, $breadcrumbs); + drupal_set_breadcrumb(array_reverse($breadcrumbs)); + + $offset = $limit * $page_number; + $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_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 FedoraObjectDetailedContent($pid); + $object_details = $obj->showFieldSets(); + if ($object_details['fedora_object_details']['#selected'] == true){ + foreach($cmodels_tabs as $cmodel_tab){ + if (is_array($cmodel_tab)){ + $cmodel_tab['#selected'] = FALSE; + } + + } + } + $cmodels_tabs = array_merge($cmodels_tabs, $object_details); + + + return tabs_render($cmodels_tabs); +} + +/** + * fedora repository urlencode string + * @param type $str + * @return type + */ +function fedora_repository_urlencode_string($str) { + return htmlentities($str); +} + +/** + * Uses makeobject to get a stream. Sets the Content Disposition in the header so it suggests a filename + * and sends it as an attachment. This should prompt for a download of the object. + * + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $label + * @param type $version + * @return type + */ +function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { + global $user; + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + + if ($pid == NULL || $dsId == NULL) { + drupal_set_message(t("no pid or dsid given to create an object with!")); + return ' '; + } + + $objectHelper = new ObjectHelper(); + $objectHelper->makeObject($pid, $dsId, 1, $label, FALSE, $version); +} + +/** + * repository page + * @param type $pid + * @param type $dsId + * @param type $collection + * @param type $pageNumber + * @return type + */ +function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNumber = NULL) { +//do security check at fedora_repository_get_items function as it has to be called there in case +//someone trys to come in a back door. + return fedora_repository_get_items($pid, $dsId, $collection, $pageNumber); +} + +/** + * repository service + * @global type $user + * @param type $pid + * @param type $servicePid + * @param type $serviceMethod + * @return type + */ +function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NULL) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + global $user; + + if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { +//drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); + drupal_access_denied(); + if (user_access('access administration pages')) { + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'error'); + } + return ' '; + } + if ($pid == NULL) { + $pid = variable_get('fedora_repository_pid', 'islandora:root'); + } + $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); + if (in_array(-1, $headers)) { + drupal_access_denied(); + exit; + return ' '; + } + + + $item = new Fedora_Item($pid); + if ($item !== FALSE) { + echo $item->get_dissemination($servicePid, $serviceMethod); + } + + exit(); +} + +//Search Stuff ******************************************************************** + +/** + * Implementation of hook_search(). + * sends a search query to fedora fgsearch which is backed by Lucene + * In our implementation of Fedora we have api-a and api-m locked down + * to authorized users but at the object level. We can query Lucene and the + * RI index to get a list of results without authorization but to view any + * datastreams users must be authorized. + * + * @param type $op + * @param type $keys + * @return array + */ +function fedora_repository_search($op = 'search', $keys = NULL) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + + switch ($op) { + case 'name': + if (user_access('view fedora collection')) { + return t('Digital Repository', array('-9')); + } + case 'search': + if (user_access('view fedora collection')) { +//demo search string ?operation=gfindObjects&indexName=DemoOnLucene&query=fgs.DS.first.text%3Achristmas&hitPageStart=11&hitPageSize=10 + $resultData = NULL; + $numberOfHitsPerPage = NULL; + $index = strpos($keys, '.'); + $test = substr($keys, 0, $index + 1); + $type = NULL; + if ($index > 0) { + $index = strpos($keys, ':'); + $type = substr($keys, 0, $index); + $keys = substr($keys, $index + 1); + } + + $index = strpos($keys, ':'); + $startPage = substr($keys, 0, $index); + if ($index > 1) { + $keys = substr($keys, $index + 1); + } + + if (!$startPage) { + $startPage = 1; + } + + $xmlDoc = NULL; + + $path = drupal_get_path('module', 'fedora_repository'); + $xmlDoc = new DomDocument(); + $xmlDoc->load($path . '/searchTerms.xml'); + $nodeList = $xmlDoc->getElementsByTagName('default'); + if (!$type) { +//$type = 'dc.description'; + $type = $nodeList->item(0)->nodeValue; + } + $nodeList = $xmlDoc->getElementsByTagName('number_of_results'); + $numberOfHitsPerPage = $nodeList->item(0)->nodeValue; + + $indexName = variable_get('fedora_index_name', 'DemoOnLucene'); + $keys = htmlentities(urlencode($keys)); + $searchQuery = NULL; + if (isset($type) && strcmp($type, ':')) { + $searchQuery = $type . ':' . $keys; + } + else { + $searchQuery = $keys; + } +//$searchQuery.=" AND (PID:vre OR PID:vre:ref OR PID:demo OR PID:changeme)"; + + $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); + $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=copyXml&query=' . $searchQuery; + $searchString .= '&hitPageSize=' . $numberOfHitsPerPage . '&hitPageStart=' . $startPage; +//$searchString = htmlentities(urlencode($searchString)); + $searchUrl .= $searchString; + $objectHelper = new ObjectHelper(); + $resultData = do_curl($searchUrl); + + $results[] = array( + array( + 'data' => $resultData, + 'colspan' => 2 + ) + ); + return $results; + } + } // switch ($op) +} + +/** + * Implementation of hook_search_page(). + * Display the search results + * + * @param type $resultData + * @return array + */ +function fedora_repository_search_page($resultData) { + $path = drupal_get_path('module', 'fedora_repository'); + $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); + $proc = NULL; + if (!$resultData[0][0]['data']) { + return ''; //no results + } + $text = utf8_encode($resultData[0][0]['data']); + + try { + $proc = new XsltProcessor(); + } catch (Exception $e) { + $out[] = array( + array( + 'data' => $e->getMessage(), + 'colspan' => 2 + ) + ); + return $out; + } + +//inject into xsl stylesheet + $proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on + $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl + $proc->setParameter('', 'objectsPage', base_path()); + $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); + $proc->registerPHPFunctions(); + $xsl = new DomDocument(); + if ($isRestricted) { + $xsl->load($path . '/xsl/results.xsl'); + } + else { + $xsl->load($path . '/xsl/unfilteredresults.xsl'); + } + + $input = new DomDocument(); + $didLoadOk = $input->loadXML(utf8_encode($resultData[0][0]['data'])); + + if (!$didLoadOk) { + $results[] = array( + array( + 'data' => 'Error parsing results', + 'colspan' => 2 + ) + ); + } + else { + $xsl = $proc->importStylesheet($xsl); + $newdom = $proc->transformToDoc($input); + + $results[] = array( + array( + 'data' => $newdom->saveHTML(), + 'colspan' => 2 + ) + ); + } + + $header = array( + array( + 'data' => t('Collection results'), + NULL, + ), + (NULL) + ); + + $output .= theme('table', $header, $results); + return $output; +} + +/** + * Implementation of hook_form_alter(). + * allows the advanced search form in drupal + * + * @param type $form + * @param type $form_state + * @param type $form_id + */ +function fedora_repository_form_alter(&$form, &$form_state, $form_id) { +// Advanced node search form + module_load_include('inc', 'fedora_repository', 'SearchClass'); + $path = drupal_get_path('module', 'fedora_repository'); + if ($form_id == 'search_form' && arg(1) == 'fedora_repository' && user_access('use advanced search')) { + $default_value = $form['basic']['inline']['keys']['#default_value']; + $index = strpos($default_value, '.'); + $test = substr($default_value, 0, $index + 1); + $type = NULL; + if ($index > 0) { + $index = strpos($default_value, ':'); + $type = substr($default_value, 0, $index); + $default_value = substr($default_value, $index + 1); + } + $form['basic']['inline']['keys']['#default_value'] = $default_value; +// Keyword boxes: + $form['advanced'] = array( + '#type' => 'fieldset', + '#title' => t('Advanced search'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#attributes' => array( + 'class' => 'search-advanced' + ), + ); + $form['advanced']['keywords'] = array( + '#prefix' => '
        ', + '#suffix' => '
        ', + ); + $xmlDoc = new DomDocument(); + $xmlDoc->load($path . '/searchTerms.xml'); + $nodeList = $xmlDoc->getElementsByTagName('term'); + $searchClass = new SearchClass(); + $types = $searchClass->get_search_terms_array(); + + $form['advanced']['type'] = array( + '#type' => 'select', + '#title' => t('Choose a field to search'), + '#prefix' => '
        ', '#suffix' => '
        ', '#options' => $types, + '#default_value' => $type, + ); + $form['advanced']['submit'] = array( + '#type' => 'submit', + '#value' => t('Advanced search'), + '#prefix' => '
        ', '#suffix' => '
        ', + ); + $form['#validate'][] = 'fedora_repository_search_validate'; + } +} + +/** + * Implementation of hook_search_validate() + * + * @param type $form + * @param type $form_state + */ +function fedora_repository_search_validate($form, &$form_state) { +// Initialise using any existing basic search keywords. + $keys = $form_state['values']['processed_keys']; + + if (isset($form_state['values']['type'])) { + $type = $form_state['values']['type']; + if ($type) { + $keys = $type . ':' . $keys; + } + } + + if (!empty($keys)) { + form_set_value($form['basic']['inline']['processed_keys'], trim($keys), $form_state); //set the form string + } +} + +/** + * fedora repository theme + * @return type + */ +function fedora_repository_theme() { + return array( + 'fedora_repository_mnpl_advanced_search_form' => array( + 'arguments' => array( + 'form' => NULL, + ), + ), + 'fedora_repository_time' => array( + 'arguments' => array( + 'element' => NULL + ), + 'fedora_repository_solution_packs_list' => array( + 'arguments' => array( + 'solution_packs' => NULL, + ), + ), + ), + ); +} + +/** + * Get a list of terms from a lucene index + * + * @param type $field + * @param type $startTerm + * @param type $displayName + * @return type + */ +function fedora_repository_list_terms($field, $startTerm = NULL, $displayName = NULL) { + module_load_include('inc', 'fedora_repository', 'SearchClass'); + $searchClass = new SearchClass(); + return $searchClass->getTerms($field, $startTerm, $displayName); +} + +/** + * fedora repository mnpl advanced search form + * @return type + */ +function fedora_repository_mnpl_advanced_search_form() { + module_load_include('inc', 'fedora_repository', 'SearchClass'); + $searchClass = new SearchClass(); + return $searchClass->build_advanced_search_form(); +} + +/** + * theme fedora repository mnpl advanced search form + * @param type $form + * @return type + */ +function theme_fedora_repository_mnpl_advanced_search_form($form) { + module_load_include('inc', 'fedora_repository', 'SearchClass'); + $advanced_search_form = new SearchClass(); + return $advanced_search_form->theme_advanced_search_form($form); +} + +/** + * fedora repository mnpl advanced search + * @param type $query + * @param type $startPage + * @return type + */ +function fedora_repository_mnpl_advanced_search($query, $startPage = 1) { + module_load_include('inc', 'fedora_repository', 'SearchClass'); + $searchClass = new SearchClass(); + $retVal = $searchClass->custom_search($query, $startPage); + return $searchClass->custom_search($query, $startPage); +} + +/** + * fedora repository mnpl_advanced search form submit + * @param type $form + * @param type $form_state + */ +function fedora_repository_mnpl_advanced_search_form_submit($form, &$form_state) { + $type_id = $form_state['values']['type']; + $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); + $searchString = $form_state['values']['type1'] . ':' . $form_state['values']['fedora_terms1']; + if ($form_state['values']['fedora_terms2'] != '') { + $searchString .=' +' . $form_state['values']['andor1'] . '+' . $form_state['values']['type2'] . ':' . $form_state['values']['fedora_terms2']; + } + if ($repeat > 2 && $repeat < 9) { + for ($i = 3; $i < $repeat + 1; $i++) { + $t = $i - 1; + if ($form_state['values']["fedora_terms$i"] != '') { + $searchString .= '+' . $form_state['values']["andor$t"] . '+' . $form_state['values']["type$i"] . ':' . $form_state['values']["fedora_terms$i"]; + } + } + } + drupal_goto("fedora/repository/mnpl_advanced_search/$searchString"); +} + +/** + * fedora repository install demo page + * @return type + */ +function fedora_repository_install_demos_page() { + $output = drupal_get_form('fedora_repository_demo_objects_form'); + return $output; +} + +/** + * fedora repository demo objects form + * @return string + */ +function fedora_repository_demo_objects_form() { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $form = array(); + $existing_demos = array(); + + $form['install_demos'] = array( + '#title' => t('Islandora Demo Collections'), + '#type' => 'fieldset', + '#description' => t('Install demo image and document collections and content models.'), + ); + $demo_objects = array(); +// Check if the top-level islandora collection exists. If not, display a button to ingest. + + $form['install_demos']['demo_collections'] = array( + '#type' => 'checkboxes', + '#title' => t('Collections to ingest'), + '#options' => array(), + '#description' => t('Choose which demo collections you would like ingested into the repository.'), + ); + + foreach (array( + 'islandora:collectionCModel' => 'Islandora default content models', + 'islandora:root' => 'Islandora top-level collection', + 'islandora:demos' => 'Islandora demos collection', + 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', + ) + as $available_demo => $available_demo_desc) { + try { + $demo_objects[$available_demo] = new Fedora_Item($available_demo); + } catch (exception $e) { + + } + + if (empty($demo_objects[$available_demo]->objectProfile)) { +//The demo objects collection does not exist in the repository, display a button to ingest them. + $form['install_demos']['demo_collections']['#options'][$available_demo] = $available_demo_desc; + } + else { + array_push($existing_demos, $demo_objects[$available_demo]); + } + } + +// Check if the SmileyStuff collectoin exists, and if it has a COLLECTION_VIEW datastream. If it doesn't then we can add it. + + $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); + if (!empty($smiley_stuff->objectProfile)) { + $datastreams_list = $smiley_stuff->get_datastreams_list_as_array(); + if (empty($datastreams_list['COLLECTION_VIEW'])) { + $form['install_demos']['demo_collections']['#options']['demo:SmileyStuff'] = 'Add Islandora Collection View to Fedora Smiley Stuff Collection'; + } + else { + $demo_objects['demo:SmileyStuff'] = $smiley_stuff; + } + } + else { + $form['install_demos']['smileynote'] = array( + '#value' => '

        If you install the ' . l('fedora demo objects', 'https://wiki.duraspace.org/display/FCR30/Demonstration+Objects') . ' Islandora can display them as a collection.

        ' + ); + } + + $form['install_demos']['ingest'] = array( + '#type' => 'submit', + '#name' => 'install_demos', + '#value' => 'Install Selected Demos', + '#disabled' => (empty($form['install_demos']['demo_collections']['#options'])) ? TRUE : FALSE, + ); + + $form['existing_demos'] = array( + '#prefix' => '

        Demo collections already installed in this repository:

          ', + '#suffix' => '
        ', + ); + + if (!empty($existing_demos)) { + foreach ($existing_demos as $pid => $demo_object) { + + $form['existing_demos'][$demo_object->pid] = array( + '#prefix' => '
      • ', + '#value' => l($demo_object->pid, $demo_object->url()), + '#suffix' => '
      • ', + ); + } + } + + return $form; +} + +/** + * fedora repository demo objects form submit + * @global type $base_url + * @param type $form + * @param type $form_state + */ +function fedora_repository_demo_objects_form_submit($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/dublin_core'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + global $base_url; + if ($form_state['clicked_button']['#name'] == 'install_demos') { + if (!empty($form_state['values']['demo_collections']['islandora:collectionCModel'])) { + try { + $collectioncm = Fedora_Item::ingest_new_item('islandora:collectionCModel', 'A', 'Islandora Collection Content Model'); + $collectioncm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); + $collectioncm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); + } catch (exception $e) { + + } + try { + $strictpdfcm = Fedora_Item::ingest_new_item('islandora:strict_pdf', 'A', 'Strict PDF Content Model'); + $strictpdfcm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); + $strictpdfcm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STRICT_PDFCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); + } catch (exception $e) { + + } + +// Install a collection object that points to all content model objects + try { + $cmodel_collection_xml = Fedora_Item::create_object_FOXML('islandora:ContentModelCollection'); + $cmodel_collection = Fedora_Item::ingest_from_FOXML($cmodel_collection_xml); + +//$dc = new Dublin_Core(new Fedora_Item('islandora:ContentModelCollection')); + $dc = new Dublin_Core($cmodel_collection); + $dc->set_element('dc:title', array('Installed Content Model')); + $dc->save(); + $cmodel_collection->add_datastream_from_string('select $object $title from <#ri> + where ($object $title + and ($object + or $object ) + and $object ) + order by $title', 'QUERY', 'Content Model Collection Query', 'text/plain'); + $cmodel_collection->add_relationship('isMemberOfCollection', 'islandora:root'); + $cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); + $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); + drupal_set_message(t("Successfully installed islandora:ContentModelCollection."), 'message'); + } catch (exception $e) { + + } + } + + if (!empty($form_state['values']['demo_collections']['islandora:root'])) { + $new_item = Fedora_Item::ingest_new_item('islandora:root', 'A', 'Islandora Top-level Collection'); + $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + try { + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + drupal_set_message(t("Successfully installed islandora:root."), 'message'); + } catch (exception $e) { + + } + } + + if (!empty($form_state['values']['demo_collections']['islandora:demos'])) { + $new_item = fedora_item::ingest_new_item('islandora:demos', 'A', 'Islandora Demo Collection'); + $new_item->add_relationship('isMemberOfCollection', 'islandora:root'); + $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + +// $cv = $new_item->add_datastream_from_file( drupal_get_path('module', 'fedora_repository') . '/collection_views/COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View.xml', 'text/xml', 'X'); + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + try { + $new_item = Fedora_Item::ingest_new_item('islandora:pdf_collection', 'A', 'PDF Collection'); + $new_item->add_relationship('isMemberOfCollection', 'islandora:demos'); + $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + drupal_set_message(t("Successfully installed islandora:demos."), 'message'); + } catch (exception $e) { + + } + } + + if (!empty($form_state['values']['demo_collections']['demo:SmileyStuff'])) { + $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); + $new_item = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/SmileyStuff-COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); + $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(t("Successfully installed demo:SmileyStuff collection view."), 'message'); + } catch (exception $e) { + + } + } + + if (!empty($form_state['values']['demo_collections']['islandora:largeimages'])) { + $error = ''; + foreach (array('islandora_jp2Sdep-slideCModel.xml', 'islandora_mods2htmlSdef.xml', 'islandora_mods2htmlSdep.xml', + 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { + try { + $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/' . $foxml_file); + } catch (exception $e) { + $error .= " - Problem ingesting $foxml_file"; + } + } + try { + $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/islandora_largeimages.xml'); + $tn = $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + drupal_set_message(t("Successfully installed islandora:largeimages."), 'message'); + } catch (exception $e) { + $error .= " - Problem ingesting islandora:largeimages collection"; + } + } + + if (!empty($error)) { + drupal_set_message(t('Some problems occurred: ' . $error)); + } + } +} + +/** + * fedora repository required fedora objects + * @return type + */ +function fedora_repository_required_fedora_objects() { +// array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) + $module_path = drupal_get_path('module', 'fedora_repository'); + return array( + 'fedora_repository' => array( + 'module' => 'fedora_repository', + 'title' => 'Islandora Core', + 'objects' => array( + array( + 'pid' => 'islandora:collectionCModel', + 'label' => 'Islandora Collection Content Model', + 'dsid' => 'ISLANDORACM', + 'datastream_file' => "$module_path/content_models/COLLECTIONCM.xml", + 'dsversion' => 2, + 'cmodel' => 'fedora-system:ContentModel-3.0', + ), + + array( + 'pid' => 'islandora:root', + 'label' => 'Islandora Top-level Collection', + 'cmodel' => 'islandora:collectionCModel', + 'datastreams' => array( + array( + 'dsid' => 'COLLECTION_POLICY', + 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", + ), + array( + 'dsid' => 'TN', + 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", + 'mimetype' => 'image/png', + ), + ), + ), + ), + ), + ); +} + +/** + * Functions to create a time selector form element type. + */ +function fedora_repository_elements() { + $type['fedora_repository_time'] = array( + "#input" => TRUE, + "#process" => array("fedora_repository_expand_time"), + ); + + return $type; +} + +/** + * fedora repository expand time + * @param type $element + * @return string + */ +function fedora_repository_expand_time($element) { +// Default to current time, check default_value but set value so that if +// default value is present it will override value + if (empty($element['#default_value'])) { + $element['#value'] = array( + 'hour' => intval(format_date(time(), 'custom', 'h')), + 'minute' => intval(format_date(time(), 'custom', 'i')), + ); + } + + $element['#tree'] = TRUE; + + foreach ($element['#value'] as $type => $value) { + switch ($type) { + case 'hour': + $options = drupal_map_assoc(range(1, 24)); + break; + case 'minute': + $options = range(0, 59); + break; + } + + if ($type != 'meridiem') { + foreach ($options as $option) { + strlen($option) <= 1 ? $options[$option] = 0 . $option : ''; + } + } + + $element[$type] = array( + '#type' => 'select', + '#default_value' => $element['#value'][$type], + '#options' => $options, + ); + } + + return $element; +} + +/** + * fedora repository time + * @param type $element + * @return type + */ +function fedora_repository_time($element) { + $output = '
        ' . $element['#children'] . '
        '; + return theme('form_element', $element, $output); +} + +/** + * theme fedora repository time + * @param type $element + * @return type + */ +function theme_fedora_repository_time($element) { + $output = '
        ' . $element['#children'] . '
        '; + return theme('form_element', $element, $output); +} + +/* Export (basket) functionality */ + +/** + * fedora repository remove item from basket + * @param type $pid + */ +function fedora_repository_remove_item_from_basket($pid) { + + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; + + $objectHelper = new ObjectHelper(); +// getting child PIDs if any + $cpids = $objectHelper->get_child_pids(array($pid)); + + if (array_key_exists($pid, $pids)) { +// remove item from basket + unset($_SESSION['basket']['processed'][$pid]); + } + if (!empty($cpids)) { // there are children + foreach ($cpids as $child_pid => $value) { +// remove child item from basket recursively + fedora_repository_remove_item_from_basket($child_pid); + } + } +} + +/** + * fedora repository basket + * @return type + */ +function fedora_repository_basket() { + $pids = _fedora_repository_get_basket_pids(); + $output = drupal_get_form('fedora_repository_basket_form', $pids); + + return $output; +} + +function fedora_repository_basket_form($form_state, $pids) { + $form = array(); + + if (!empty($pids)) { + $form['pid'] = array(); + $form['title'] = array(); + $form['desc'] = array(); + } + else { + return; + } + + ksort($pids); + foreach ($pids as $pid => $arr) { + $cbs[$pid] = ''; + + $form['pid'][$pid] = array('#value' => l($pid, "fedora/repository/$pid")); + $form['title'][$pid] = array('#value' => $arr['title']); + $form['desc'][$pid] = array('#value' => $arr['desc']); + } + + $form['remove'] = array( + '#type' => 'checkboxes', + '#options' => $cbs, + ); + + $form['remove_submit'] = array( + '#type' => 'submit', + '#value' => t('Remove selected'), + ); + + $form['remove_all'] = array( + '#type' => 'submit', + '#value' => t('Empty basket'), + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Export selected'), + ); + + $form['submit_all'] = array( + '#type' => 'submit', + '#value' => t('Export all'), + ); + + return $form; +} + +/** + * theme fedora repository basket form + * @param type $form + * @return string + */ +function theme_fedora_repository_basket_form($form) { + $header = array( + theme('table_select_header_cell'), + t('PID'), + t('Title'), + t('Description'), + ); + + if (isset($form['pid']) && is_array($form['pid'])) { + foreach (element_children($form['pid']) as $key) { + $rows[] = array( + drupal_render($form['remove'][$key]), + drupal_render($form['pid'][$key]), + drupal_render($form['title'][$key]), + drupal_render($form['desc'][$key]), + ); + } + } + else { + $rows[] = array(array('data' => t('Your basket is empty.'), 'colspan' => '4')); + } + + $output = theme('table', $header, $rows); + + $frm = drupal_render($form); + $output = $frm . $output . $frm; + + return $output; +} + +/** + * fedora repository basket form validate + * @param type $form + * @param type $form_state + */ +function fedora_repository_basket_form_validate($form, &$form_state) { + +} + +/** + * fedora repository basket form submit + * @global type $user + * @param type $form + * @param type $form_state + * @return type + */ +function fedora_repository_basket_form_submit($form, &$form_state) { + if ($form_state['values']['op'] == $form_state['values']['remove_submit']) { + $pids = $form_state['clicked_button']['#post']['remove']; + + if (isset($pids)) { + foreach ($pids as $pid) { + fedora_repository_remove_from_basket($pid); + } + drupal_set_message(t("Selected objects removed")); + return; + } + } + + if ($form_state['values']['op'] == $form_state['values']['remove_all']) { + _fedora_repository_empty_basket(); + drupal_set_message(t("Basket emptied")); + return; + } + + if ($form_state['values']['op'] == $form_state['values']['submit_all']) { + $msg = t("All objects exported to staging area"); + $pids = _fedora_repository_get_basket_pids(); + } + elseif ($form_state['values']['op'] == $form_state['values']['submit']) { + $msg = t("Selected objects exported to staging area"); + $pids = array_filter($form_state['values']['remove']); + } + + if (!empty($pids)) { + global $user; + $log = array(); + $success = TRUE; + $export_dir = variable_get('export_area', file_directory_path() . '/fedora_export_area') . '/' . $user->name . '/' . date("Ymd-His"); + $foxml_dir = $export_dir . '/foxml'; + + if (!file_exists($foxml_dir) && !@mkdir($foxml_dir, 0775, TRUE)) { + drupal_set_message(t("Failed to create foxml dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $foxml_dir)), 'error'); + return FALSE; + } + + module_load_include('inc', 'fedora_repository', 'api/fedora_export'); + foreach ($pids as $pid => $arr) { + + $objects_dir = $export_dir . '/objects/' . $pid; + if (!file_exists($objects_dir) && !@mkdir($objects_dir, 0775, TRUE)) { + drupal_set_message(t("Failed to create objects dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $objects_dir)), 'error'); + return FALSE; + } + + if (!export_to_export_area($pid, $foxml_dir, $objects_dir, $log)) { + $success = FALSE; + } + } + $msg = $success ? $msg : t("Failed to export objects to staging area"); + $msg .= ":
        " . implode("
        ", $log); + + drupal_set_message($msg, $success ? 'info' : 'error'); +//_fedora_repository_empty_basket(); + } + else { + drupal_set_message(t("No objects selected or basket empty"), 'error'); + } + + return; +} + +/** + * Get all pids saved to the basket. + * + * @return type + */ +function _fedora_repository_get_basket_pids() { + +// Set empty defaults if basket elements are missing + $_SESSION['basket'] = isset($_SESSION['basket']) ? $_SESSION['basket'] : array('processed' => array(), 'unprocessed' => array()); + $_SESSION['basket']['processed'] = isset($_SESSION['basket']['processed']) ? $_SESSION['basket']['processed'] : array(); + $_SESSION['basket']['unprocessed'] = isset($_SESSION['basket']['unprocessed']) ? $_SESSION['basket']['unprocessed'] : array(); + + $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; + + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + $ob = new ObjectHelper(); + foreach ($_SESSION['basket']['unprocessed'] as $pid) { +// Check if the pid already exists in the tree + if (array_key_exists($pid, $pids)) { + continue; + } + + $pids += $ob->get_all_related_pids($pid); +// $pids += array($pid); + } + + $_SESSION['basket']['processed'] = $pids; + $_SESSION['basket']['unprocessed'] = array(); + + return $pids; +} + +/** + * fedora repository empty basket + */ +function _fedora_repository_empty_basket() { + unset($_SESSION['basket']); +} + +/** + * fedora repository add to basket + * @param type $pid + * @param type $warn + * @param type $searchResultsFlag + */ +function fedora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) { + if ($warn && _is_added_to_basket($pid)) { + drupal_set_message(t("Object already in basket")); + } + + if (!isset($_SESSION['basket'])) { + $_SESSION['basket'] = array(); + $_SESSION['basket']['unprocessed'] = array($pid => $pid); + } + else { + $_SESSION['basket']['unprocessed'][$pid] = $pid; + } + + if (!$searchResultsFlag) { + drupal_goto('fedora/basket'); + } +} + +/** + * fedora repository remove from basket + * @param type $pid + * @return type + */ +function fedora_repository_remove_from_basket($pid) { + if (isset($_SESSION['basket']['unprocessed'][$pid])) { + unset($_SESSION['basket']['unprocessed'][$pid]); + } + + if (isset($_SESSION['basket']['processed'][$pid])) { + unset($_SESSION['basket']['processed'][$pid]); + } + return; +} + +/** + * theme add to basket link + * @param type $pid + * @param type $type + * @return type + */ +function theme_add_to_basket_link($pid, $type = 'object') { + $object = t($type); + $path = drupal_urlencode($pid); + + $save = "export_big.png"; + $saved = "exported_big.png"; +// $path = drupal_get_path('module', 'Fedora_Repository').'/images/'.$save ; + /* + var_dump($path); + var_dump(theme('image',drupal_get_path('module', 'Fedora_Repository').'/images/'.$save)); + die(); + */ + if (!_is_added_to_basket($pid)) { + return l( + theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), + "fedora/repository/addToBasket/" . $path, + array('html' => TRUE) + ); + } + + return theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $saved, t("In basket"), t("This @object is already in your basket", array('@object' => $object))); +} + +/** + * is added to basket + * @param type $pid + * @param type $account + * @return type + */ +function _is_added_to_basket($pid, $account = NULL) { + return isset($_SESSION['basket']['unprocessed'][$pid]) || isset($_SESSION['basket']['processed'][$pid]); +// return db_result(db_query("SELECT uid FROM {repository_basket} WHERE uid = %d AND pid = '%s'", $account->uid, $pid)); +} + +/** + * fedora repository display schema + * @param type $file + * @return type + */ +function fedora_repository_display_schema($file) { + $path = drupal_get_path('module', 'fedora_repository'); + if (strtolower(substr($file, -3)) == 'xsd' && file_exists($path . '/' . $file)) { + drupal_goto($path . '/' . $file); + } + else { + drupal_goto(); + } + return; +} + +/** + * fedora repository batch reingest object + * @param type $object + * @param type $context + * @return type + */ +function fedora_repository_batch_reingest_object($object, &$context) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + if (!empty($object) && is_array($object)) { + $pid = $object['pid']; + if (!valid_pid($pid)) { + return NULL; + } +// Does the object exist? If so, purge it. + $item = new Fedora_Item($pid); + if ($item->exists()) { + $item->purge(t('Remove during re-install batch job')); + } + +// Ingest the object from the source file. + if (!empty($object['foxml_file'])) { + $foxml_file = $object['foxml_file']; + $new_item = Fedora_Item::ingest_from_FOXML_file($foxml_file); + if ($new_item->exists()) { +// Batch operation was successful. + $context['message'][] = "$new_item->pid installed."; + } + } + if (!empty($object['dsid']) && !empty($object['datastream_file'])) { + $datastreams = array( + array( + 'dsid' => $object['dsid'], + 'datastream_file' => $object['datastream_file'], + ) + ); + } + elseif (!empty($object['datastreams'])) { + $datastreams = $object['datastreams']; + } + + if (!empty($datastreams) && is_array($datastreams)) { + $label = !empty($object['label']) ? $object['label'] : ''; + if (empty($object['foxml_file']) && !isset($new_item)) { + $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); + } + if (!empty($object['cmodel'])) { + $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); + } + if (!empty($object['parent'])) { + $new_item->add_relationship('isMemberOfCollection', $object['parent']); + } + 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'); + } + } + } + } +} + +/** + * Content model, collection view and collection policy datastreams may now optionally define a version + * number in their top-level XML element as an attribute, as in: + * get_datastream_dissemination($dsid)); + } + elseif (isset($datastream_file)) { + $doc = simplexml_load_file($datastream_file); + } + + if (!empty($doc)) { + $attrs = $doc->attributes(); + foreach ($attrs as $name => $value) { + if ($name == 'version') { + $return = (int) $value; + break; + } + } + } + return $return; +} + +/** + * theme fedora repository solution pack list + * @param type $solution_packs + * @return string + */ +function theme_fedora_repository_solution_packs_list($solution_packs) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + $output = ''; + $header = array(); + $rows = array(); + + + + + drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); + return $output; +} + +/** + * Implementation of hook_forms() + * @param string $form_id + * @return array + */ +function fedora_repository_forms($form_id) { + $forms = array(); + if (strpos($form_id, 'fedora_repository_solution_pack_form_') === 0) { + $forms[$form_id] = array( + 'callback' => 'fedora_repository_solution_pack_form', + ); + } + return $forms; +} diff --git a/digital_repository.solutionpacks.inc b/digital_repository.solutionpacks.inc new file mode 100644 index 00000000..de4ce137 --- /dev/null +++ b/digital_repository.solutionpacks.inc @@ -0,0 +1,175 @@ + $solution_pack_info) { + $objects = array(); + foreach ($solution_pack_info as $field => $value) { + switch ($field) { + case 'title': + $solution_pack_name = $value; + break; + case 'objects': + $objects = $value; + break; + } + } + $output .= drupal_get_form('fedora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects); + } + + return $output; +} + +/** + * Check for installed objects and add a 'Update' or 'Install' button if some objects are missing. + * @param array $solution_pack + */ +function fedora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { + // Check each object to see if it is in the repository. + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + global $base_path; + $needs_update = FALSE; + $needs_install = FALSE; + $form = array(); + $form['solution_pack_module'] = array( + '#type' => 'hidden', + '#value' => $solution_pack_module, + ); + + if (!$form_state['submitted']) { + $form['soluction_pack_name'] = array( + '#type' => 'markup', + '#value' => t($solution_pack_name), + '#prefix' => '

        ', + '#suffix' => '

        ', + ); + $form['objects'] = array( + '#type' => 'fieldset', + '#title' => "Objects", + '#weight' => 10, + '#attributes' => array('class' => 'collapsed'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $table_header = array('PID', 'Status'); + $table_rows = array(); + + + foreach ($objects as $object) { + $datastreams = NULL; + if (isset($object['pid'])) { + $pid = $object['pid']; + + $item = new Fedora_Item($pid); + $table_row = array($object['pid']); + $object_status = t('Up-to-date'); + if (!$item->exists()) { + $object_status = 'Missing'; + $needs_install = TRUE; + } + else { + if (isset($object['dsid']) && isset($object['datastream_file']) && isset($object['dsversion'])) { + $datastreams = array( + array( + 'dsid' => $object['dsid'], + 'datastream_file' => $object['datastream_file'], + 'dsversion' => $object['dsversion'], + ), + ); + } + elseif (!empty($object['datastreams'])) { + $datastreams = $object['datastreams']; + } + if (!empty($datastreams) && is_array($datastreams)) { + foreach ($datastreams as $ds) { + $ds_list = $item->get_datastreams_list_as_array(); + if (!array_key_exists($ds['dsid'], $ds_list)) { + $needs_update = TRUE; + $object_status = 'Missing datastream'; + break; + } + if (isset($ds['dsversion'])) { + // Check if the datastream is versioned and needs updating. + $installed_version = fedora_repository_get_islandora_datastream_version($item, $ds['dsid']); + $available_version = fedora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); + if ($available_version > $installed_version) { + $needs_update = TRUE; + $object_status = 'Out of date'; + break; + } + } + } + } + } + array_push($table_row, $object_status); + $table_rows[] = $table_row; + } + } + $form['objects']['table'] = array( + '#type' => 'markup', + '#value' => theme_table($table_header, $table_rows), + ); + } + + $form['install_status'] = array( + '#type' => 'markup', + '#prefix' => '' . t('Object status:') . ' ', + '#suffix' => ' ', + ); + if (!$needs_install && !$needs_update) { + $form['install_status']['#value'] = theme_image('misc/watchdog-ok.png') . t('All required objects are installed and up-to-date.'); + } + else { + $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); + } + $form['submit'] = array( + '#value' => t('Install'), + '#disabled' => !$needs_install && !$needs_update, + '#type' => 'submit', + '#name' => $solution_pack_module, + ); + + $form['#submit'] = array( + 'fedora_repository_solution_pack_form_submit', + ); + return $form; +} + +function fedora_repository_solution_pack_form_submit($form, &$form_state) { + $what = $form_state; + $module_name = $form_state['values']['solution_pack_module']; + $solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); + $batch = array( + 'title' => t('Installing / updating solution pack objects'), + 'file' => drupal_get_path('module', 'fedora_repository') . '/fedora_repository.module', + 'operations' => array(), + ); + + + foreach ($solution_pack_info[$module_name]['objects'] as $object) { + // Add this object to the batch job queue. + $batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object)); + } + batch_set($batch); +} From 19f735cd49820349b134d45e9d30638ac122b3f0 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Mon, 3 Oct 2011 13:18:21 -0300 Subject: [PATCH 090/247] Removed old file names --- fedora_repository.info | 9 - fedora_repository.install | 158 -- fedora_repository.module | 2251 --------------------------- fedora_repository.solutionpacks.inc | 175 --- 4 files changed, 2593 deletions(-) delete mode 100644 fedora_repository.info delete mode 100644 fedora_repository.install delete mode 100644 fedora_repository.module delete mode 100644 fedora_repository.solutionpacks.inc diff --git a/fedora_repository.info b/fedora_repository.info deleted file mode 100644 index 20ff4d30..00000000 --- a/fedora_repository.info +++ /dev/null @@ -1,9 +0,0 @@ -; $Id$ -name = Digital Repository -dependencies[] = imageapi -dependencies[] = tabs -dependencies[] = islandora_content_model_forms -description = Shows a list of items in a fedora collection. -package = Islandora -version = 11.2.beta1 -core = 6.x diff --git a/fedora_repository.install b/fedora_repository.install deleted file mode 100644 index 43bbcf70..00000000 --- a/fedora_repository.install +++ /dev/null @@ -1,158 +0,0 @@ -&-", $return_value); - $requirements['imagick']['title'] = t("Image Magick library"); - if ($return_value) { - $requirements['imagick']['value'] = t("Not installed"); - $requirements['imagick']['severity'] = REQUIREMENT_WARNING; - $requirements['imagick']['description'] = t('Ensure that the Image Magick library is installed.'); - } - else { - $requirements['imagick']['value'] = t("Installed"); - $requirements['imagick']['severity'] = REQUIREMENT_OK; - } - - // Test for Kakadu - system("hash kdu_compress 2>&-", $return_value); - $requirements['kakadu']['title'] = t("Kakadu library"); - if ($return_value) { - $requirements['kakadu']['value'] = t("Not installed"); - $requirements['kakadu']['severity'] = REQUIREMENT_WARNING; - $requirements['kakadu']['description'] = t('Ensure that the Kakadu library is installed.'); - } - else { - $requirements['kakadu']['value'] = t("Installed"); - $requirements['kakadu']['severity'] = REQUIREMENT_OK; - } - } - elseif ($phase == 'runtime') { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - - $requirements['fedora-repository']['title'] = t("Fedora server"); - if (!fedora_available()) { - $requirements['fedora-repository']['value'] = t("Not available"); - $requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; - $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the collection settings are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); - } - else { - $requirements['fedora-repository']['value'] = t("Available"); - $requirements['fedora-repository']['severity'] = REQUIREMENT_OK; - } - - // Check for ImageMagick - $requirements['fedora-imagemagick']['title'] = t("ImageMagick convert in \$PATH"); - $result = exec('convert'); - if (!$result) { - $requirements['fedora-imagemagick']['value'] = t('Not in $PATH'); - $requirements['fedora-imagemagick']['description'] = t('Islandora will not be able to create thumbnails. Ensure that ImageMagick is installed and the convert command is executable by the web server user.'); - $requirements['fedora-imagemagick']['severity'] = REQUIREMENT_WARNING; - } - else { - $requirements['fedora-imagemagick']['value'] = t("Available"); - $requirements['fedora-imagemagick']['severity'] = REQUIREMENT_OK; - } - - $requirements['fedora-kakadu']['title'] = 'Kakadu kdu_compress in $PATH'; - $kdu_res = exec('kdu_compress -v'); - if (!$kdu_res) { - $requirements['fedora-kakadu']['value'] = ('Not in $PATH'); - $requirements['fedora-kakadu']['description'] = t('Islandora cannot convert TIFF image files to JPEG2000 format. Ensure Kakadu is installed and the kdu_compress command is executable by the web server user.'); - $requirements['fedora-kakadu']['severity'] = REQUIREMENT_WARNING; - } - else { - $requirements['fedora-kakadu']['value'] = t("Available"); - $requirements['fedora-kakadu']['severity'] = REQUIREMENT_OK; - } - } - - return $requirements; -} diff --git a/fedora_repository.module b/fedora_repository.module deleted file mode 100644 index ea1c15c5..00000000 --- a/fedora_repository.module +++ /dev/null @@ -1,2251 +0,0 @@ -createAdminForm(); -} - -/** - * drupal hook - * calls the fedora_repositorys_admin form - */ -function fedora_repository_menu() { - module_load_include('inc', 'fedora_repository', 'formClass'); - $adminMenu = new formClass(); - return $adminMenu->createMenu(); -} - -/** - * drupal hook to show help - * - * @param type $path - * @param type $arg - * @return type - */ -function fedora_repository_help($path, $arg) { - switch ($path) { - case 'admin/modules#description' : - return t('Grabs a list of items from a collection in Drupal that are presented on the home page.'); - case 'node/add#fedora_repository' : - return t('Use this page to grab a list of items from a Fedora collection.'); - } -} - -/** - * fedora repository purge object - * @param type $pid - * @param type $name - * @return type - */ -function fedora_repository_purge_object($pid = NULL, $name = NULL) { - if (!user_access('purge objects and datastreams')) { - drupal_set_message(t('You do not have access to add a datastream to this object.'), 'error'); - return ''; - } - if ($pid == NULL) { - drupal_set_message(t('You must specify an object pid to purge an object.'), 'error'); - return ''; - } - $output = t('Are you sure you wish to purge object %name %pid!
        This cannot be undone
        ', - array( - '%name' => $name, - '%pid' => $pid) - ); - - $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); - return $output; -} - -/** - * fedora repository collection view - * @global type $user - * @param type $pid - * @param type $collection - * @param type $pageNumber - * @return type - */ -function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pageNumber = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - global $user; - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); - return ' '; - } - - $objectHelper = new ObjectHelper(); - if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); - } - - $content = ''; - - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - $collectionClass = new CollectionClass(); - $results = $collectionClass->getRelatedItems($pid, NULL); - $content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); - - return $content; -} - -/** - * fedora repository ingest object - * @param type $collection_pid - * @param type $collection_label - * @param type $content_model - * @return type - */ -function fedora_repository_ingest_object($collection_pid=NULL, $collection_label = NULL, $content_model = NULL) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - if (!user_access('ingest new fedora objects')) { - drupal_set_message(t('You do not have permission to ingest.'), 'error'); - return ''; - } - - if (!valid_pid($collection_pid)) { - if (valid_pid(urldecode($collection_pid))) { - $collection_pid = urldecode($collection_pid); - } - else { - drupal_set_message(t("This collection PID $collection_pid is not valid"), 'error'); - return ' '; - } - } - - if ($collection_pid == NULL) { - drupal_set_message(t('You must specify a collection object pid to ingest an object.'), 'error'); - return ''; - } - $output = drupal_get_form('fedora_repository_ingest_form', $collection_pid, $collection_label, $content_model); - - $breadcrumbs = array(); - $objectHelper = new ObjectHelper(); - $objectHelper->getBreadcrumbs($collection_pid, $breadcrumbs); - drupal_set_breadcrumb(array_reverse($breadcrumbs)); - - return $output; -} - -/** - * fedora repository ingest form submit - * @global type $base_url - * @global type $user - * @param array $form - * @param array $form_state - */ -function fedora_repository_ingest_form_submit(array $form, array &$form_state) { -//only validate the form if the submit button was pressed (other buttons may be used for AHAH - if ($form_state['storage']['xml']) { - if (module_exists('islandora_content_model_forms')) { - module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); - $xml_form = new IngestObjectMetadataForm(); - $xml_form->submit($form, $form_state); - } - } - else if ($form_state['clicked_button']['#id'] == 'edit-submit') { - global $base_url; - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); - $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - $err = TRUE; - $redirect = TRUE; - if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['collection_pid'])) !== FALSE) { - $relationship = $cp->getRelationship(); - - if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { - $pid = $cp->getNextPid($contentModelDsid); - global $user; - $form_state['values']['user_id'] = $user->name; - $form_state['values']['pid'] = $pid; - $form_state['values']['content_model_pid'] = $contentModelPid; - $form_state['values']['relationship'] = $relationship; - - $err = (!$cm->execFormHandler($form_state['values'], $form_state)); - - $_SESSION['fedora_ingest_files'] = ''; //empty this variable - - $attr = $cm->getIngestFormAttributes(); - $redirect = $attr['redirect']; - - if ($redirect) { - $form_state['storage'] = NULL; - } - } - } - - if ($redirect) { - $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; - } - } -} - -/** - * fedora repository ingest form validate - * @param type $form - * @param type $form_state - * @return type - */ -function fedora_repository_ingest_form_validate($form, &$form_state) { -//only validate the form if the submit button was pressed (other buttons may be used for AHAH - if ($form_state['clicked_button']['#id'] == 'edit-submit') { - switch ($form_state['storage']['step']) { - case 1: - $form_state['storage']['step']++; - $form_state['rebuild'] = TRUE; - break; - - case 2: -// XML based form. - if ($form_state['storage']['xml']) { - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - $xml_form->validate($form, $form_state); - } -// Get the uploaded file. - $validators = array(); - - if (!empty($_FILES['files']['name']['ingest-file-location'])) { - $fileObject = file_save_upload('ingest-file-location', $validators); - - file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); - $form_state['values']['ingest-file-location'] = $fileObject->filepath; - } - - if (isset($form_state['values']['ingest-file-location']) && file_exists($form_state['values']['ingest-file-location'])) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); - - $file = $form_state['values']['ingest-file-location']; - - $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); - $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - - if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { - $allowedMimeTypes = $cm->getMimetypes(); - - $mimetype = new MimeClass(); - $dformat = $mimetype->getType($file); - - if (!empty($file)) { - if (!in_array($dformat, $allowedMimeTypes)) { - form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . - implode(' ', $allowedMimeTypes))); - file_delete($file); - return; - } - elseif (!$cm->execIngestRules($file, $dformat)) { - drupal_set_message(t('Error following Content Model Rules'), 'error'); - foreach (ContentModel::$errors as $err) { - drupal_set_message($err, 'error'); - } - } - } - } - } - $form_state['rebuild'] = FALSE; - break; - } - } -} - -/** - * fedora repository ingest form - * @param type $form_state - * @param type $collection_pid - * @param type $collection_label - * @param type $content_model - * @return type - */ -function fedora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) { - module_load_include('inc', 'fedora_repository', 'formClass'); -// 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; - } - $ingestForm = new formClass(); - $form_state['storage']['content_model'] = $content_model; - $form_state['storage']['collection_pid'] = $collection_pid; - return $ingestForm->createIngestForm($collection_pid, $collection_label, $form_state); -} - -/** - * fedora repository purge object form - * @global type $base_url - * @param type $form_state - * @param type $pid - * @param type $referrer - * @return type - */ -function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { - global $base_url; - if (!user_access('purge objects and datastreams')) { - return NULL; - } - if ($pid == NULL) { - return NULL; - } - $form['pid'] = array( - '#type' => 'hidden', - '#value' => "$pid" - ); - if (!strstr(drupal_get_destination(), urlencode('fedora/repository'))) { - $form['referrer'] = array( - '#type' => 'hidden', - '#value' => $referrer, - ); - } - if (!isset($form_state['storage']['confirm'])) { -// do your normal $form definition here - - - $form['submit'] = array( - '#type' => 'image_button', - '#src' => drupal_get_path('module', 'fedora_repository') . '/images/purge_big.png', - '#value' => t('Purge'), - '#suffix' => 'Purge this object', - ); - if (!empty($collectionPid)) { - $collectionPid = $_SESSION['fedora_collection']; - } -//$form['#redirect'] = $referrer; - - return $form; - } - else { -// ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form - - return confirm_form($form, 'Confirm Purge Object', $referrer, 'Are you sure you want to delete this object? This action cannot be undone.', 'Delete', 'Cancel'); //Had better luck leaving off last param 'name' - } - return $form; -} - -/** - * add stream - * @param type $collection_pid - * @param type $collectionName - * @return type - */ -function add_stream($collection_pid=NULL, $collectionName=NULL) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!valid_pid($collection_pid)) { - drupal_set_message(t("This PID is not valid!"), 'error'); - return ' '; - } - if (!user_access('ingest new fedora objects')) { - drupal_set_message(t('You do not have permission to ingest.'), 'error'); - return ''; - } - if ($collection_pid == NULL) { - drupal_set_message(t('You must specify an collection object pid to ingest an object.'), 'error'); - return ''; - } - $output .= drupal_get_form('fedora_repository_add_stream_form', $pid); - - return $output; -} - -/** - * add stream form submit - * @global type $base_url - * @param type $form - * @param type $form_state - * @return type - */ -function add_stream_form_submit($form, &$form_state) { - global $base_url; - if (!empty($form_state['submit']) && $form_state['submit'] == 'OK') { - $form_state['rebuild'] = TRUE; - return; - } - module_load_include('inc', 'fedora_repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $pathToModule = drupal_get_path('module', 'fedora_repository'); - - $file = $form_state['values']['add-stream-file-location']; - - $pid = $form_state['values']['pid']; - $dsid = $form_state['values']['stream_id']; - $dsLabel = $form_state['values']['stream_label'] . substr($file, strrpos($file, '.')); // Add the file extention to the end of the label.; - $file_basename = basename($file); - $file_directory = dirname($file); - $streamUrl = $base_url . '/' . $file_directory . '/' . drupal_urlencode($file_basename); - - /* ----------------------------------------------------------------- - * need a better way to get mimetypes - */ - $mimetype = new MimeClass(); - $dformat = $mimetype->getType($file); - $controlGroup = "M"; - if ($dformat == 'text/xml') { - $controlGroup = 'X'; - } - try { - $item = new Fedora_Item($pid); - $item->add_datastream_from_url($streamUrl, $dsid, $dsLabel, $dformat, $controlGroup); - - $object_helper = new ObjectHelper(); - $object_helper->get_and_do_datastream_rules($pid, $dsid, $file); - - file_delete($file); - } catch (exception $e) { - drupal_set_message(t($e->getMessage()), 'error'); - return; - } - $form_state['rebuild'] = TRUE; -} - -/** - * add stream form - * @param type $form_state - * @param type $pid - * @return type - */ -function add_stream_form(&$form_state, $pid) { - module_load_include('inc', 'fedora_repository', 'formClass'); - $addDataStreamForm = new formClass(); - return $addDataStreamForm->createAddDataStreamForm($pid, $form_state); -} - -/** - * add stream form validate - * @param type $form - * @param type $form_state - * @return type - */ -function add_stream_form_validate($form, &$form_state) { - if ($form_state['clicked_button']['#value'] == 'OK') { - $form_state['rebuild'] = TRUE; - return; - } - $dsid = $form_state['values']['stream_id']; - $dsLabel = $form_state['values']['stream_label']; - if (strlen($dsid) > 64) { - form_set_error('', t('Data stream ID cannot be more than 64 characters.')); - return FALSE; - } - if (!(preg_match("/^[a-zA-Z]/", $dsid))) { - form_set_error('', t("Data stream ID ($dsid) has to start with a letter.")); - return FALSE; - } - if (strlen($dsLabel) > 64) { - form_set_error('', t('Data stream Label cannot be more than 64 characters.')); - return FALSE; - } - if (strpos($dsLabel, '/')) { - form_set_error('', t('Data stream Label cannot contain a "/".')); - return FALSE; - } - $validators = array( - // 'file_validate_is_image' => array(), - // 'file_validate_image_resolution' => array('85x85'), - // 'file_validate_size' => array(30 * 1024), - ); - - $fileObject = file_save_upload('add-stream-file-location', $validators); - -// Move the uploaded file to Drupal's files directory. - file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); - $form_state['values']['add-stream-file-location'] = $fileObject->filepath; -// TODO: Add error checking here. - $form_state['rebuild'] = FALSE; -} - -/** - * fedora repository purge stream - * @global type $user - * @param type $pid - * @param type $dsId - * @param type $name - * @return type - */ -function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - global $user; - if ($pid == NULL || $dsId == NULL) { - drupal_set_message(t('You must specify an object pid and DataStream ID to purge a datastream'), 'error'); - return ' '; - } - if (!fedora_repository_access(OBJECTHELPER :: $PURGE_FEDORA_OBJECTSANDSTREAMS, $pid, $user)) { - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to purge objects."), 'error'); - return ' '; - } - - $output = t('Are you sure you wish to purge this datastream %name
        ', - array( - '%name' => $name) - ); - $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); - return $output; -} - -/** - * fedora repository purge object form submit - * @param type $form - * @param type $form_state - * @return type - */ -function fedora_repository_purge_object_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - $pid = $form_state['values']['pid']; - if (!isset($form_state['storage']['confirm'])) { - $form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form - $form_state['rebuild'] = TRUE; // along with this - } - else { -// this is where you do your processing after they have pressed the confirm button - $params = array( - "pid" => $pid, - "logMessage" => "Purged", - "force" => "" - ); - try { - $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $object = $client->__soapCall('purgeObject', array($params)); - unset($form_state['storage']['confirm']); - } catch (exception $e) { - if (preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage())) { - drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error'); - } - else { - drupal_set_message(t($e->getMessage()), 'error'); - } - return; - } - if (!empty($form_state['values']['referrer'])) { - $form_state['redirect'] = $form_state['values']['referrer']; - } - elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { - $collectionPid = $_SESSION['fedora_collection']; - - $form_state['redirect'] = "fedora/repository/$collectionPid/"; - } - else { - $form_state['redirect'] = 'fedora/repository/'; - } - } -} - -/** - * fedora repository purge stream form - * @param type $form_state - * @param type $pid - * @param type $dsId - * @return type - */ -function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) { - $form['pid'] = array( - '#type' => 'hidden', - '#value' => "$pid" - ); - $form['dsid'] = array( - '#type' => 'hidden', - '#value' => "$dsId" - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Purge') - ); - - return $form; -} - -/** - * fedora repository purge stream form submit - * @global type $base_url - * @param type $form - * @param array $form_state - */ -function fedora_repository_purge_stream_form_submit($form, &$form_state) { - global $base_url; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $pid = $form_state['values']['pid']; - $item = new Fedora_Item($pid); - $dsid = $form_state['values']['dsid']; - try { - $item->purge_datastream($dsid); - } catch (exception $e) { - drupal_set_message(t($e->getMessage()), 'error'); - } - $form_state['redirect'] = $base_url . "/fedora/repository/$pid"; -} - -/** - * fedora repository replace stream - * @param type $pid - * @param type $dsId - * @param type $dsLabel - * @param type $collectionName - * @return type - */ -function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { - if ($pid == NULL || $dsId == NULL) { - drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error'); - return ''; - } - $output = drupal_get_form('fedora_repository_replace_stream_form', $pid, $dsId, $dsLabel); - - return $output; -} - -/** - * fedora repository replace stream form - * @param type $form_state - * @param type $pid - * @param type $dsId - * @param type $dsLabel - * @return type - */ -function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { -//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); - module_load_include('inc', 'Fedora_Repository', 'formClass'); -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $replaceDataStreamForm = new formClass(); - return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state); -} - -/** - * fedora repository replace stream form validate - * @param type $form - * @param type $form_state - * @return type - */ -function fedora_repository_replace_stream_form_validate($form, &$form_state) { -// If a file was uploaded, process it. - if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name']['file'])) { - -// attempt to save the uploaded file - $file = file_save_upload('file', array(), file_directory_path()); - -// set error is file was not uploaded - if (!$file) { - form_set_error('file', 'Error uploading file.'); - return; - } - - $doc = new DOMDocument(); - module_load_include('inc', 'Fedora_Repository', 'MimeClass'); - $mime = new MimeClass(); - if ($mime->getType($file->filepath) == 'text/xml' && !$doc->load($file->filepath)) { - form_set_error('file', 'Invalid XML format.'); - return; - } - -// set files to form_state, to process when form is submitted - $form_state['values']['file'] = $file; - } -} - -/** - * fedora repository replace stream form submit - * @global type $base_url - * @param type $form - * @param array $form_state - */ -function fedora_repository_replace_stream_form_submit($form, &$form_state) { - global $base_url; - $file = $form_state['values']['file']; - $pid = $form_state['values']['pid']; - $dsid = $form_state['values']['dsId']; - $dsLabel = $form_state['values']['dsLabel']; - // Remove the original file extension from the label and add the new one - $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot - if ($indexOfDot !== FALSE) { - $dsLabel = substr($dsLabel, 0, $indexOfDot); - $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; - } - module_load_include('inc', 'Fedora_Repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - $file_basename = basename($file->filepath); - $file_directory = dirname($file->filepath); - $streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename); - - /* ----------------------------------------------------------------- - * TODO: need a better way to get mimetypes - */ - $mimetype = new MimeClass(); - $dformat = $mimetype->getType($file->filepath); - - $item = new Fedora_Item($pid); - - $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); - - $form_state['redirect'] = 'fedora/repository/' . $pid; -} - -/** - * fedora repository edit qdc page - * @global type $user - * @param type $pid - * @param type $dsId - * @return type - */ -function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - global $user; - if ($pid == NULL || $dsId == NULL) { - drupal_set_message(t('You must specify an object pid and a Dublin Core DataStream ID to edit metadata'), 'error'); - return ' '; - } - if (!fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); - return ' '; - } - $output = drupal_get_form('fedora_repository_edit_qdc_form', $pid, $dsId); - - return $output; -} - -/** - * fedora repository edit qdc form - * @global type $user - * @param type $form_state - * @param type $pid - * @param type $dsId - * @return type - */ -function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - if ($pid == NULL) { - drupal_set_message(t('You must specify an object pid!'), 'error'); - } - global $user; - if (!fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); - return ' '; - } - - module_load_include('inc', 'fedora_repository', 'formClass'); - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); -// Check if there is a custom edit metadata function defined in the content model. - - $breadcrumbs = array(); - $objectHelper = new ObjectHelper(); - $objectHelper->getBreadcrumbs($pid, $breadcrumbs); - drupal_set_breadcrumb(array_reverse($breadcrumbs)); - - - $output = ''; - if (($cm = ContentModel::loadFromObject($pid)) !== FALSE) { - $output = $cm->buildEditMetadataForm($pid, $dsId); - } - - if (empty($output)) { -// There is no custom function, so just load the standard QDC form. - $metaDataForm = new formClass(); -//currently we only edit the dc metadata. If you defined a custom form with a custom handler you are sol for now. - return $metaDataForm->createMetaDataForm($pid, $dsId, $client, $form_state); - } - return $output; -} - -/** - * fedora repository edit qdc form validate - * @param type $form - * @param boolean $form_state - */ -function fedora_repository_edit_qdc_form_validate($form, &$form_state) { - if ($form_state['storage']['xml']) { - if ($form_state['storage']['step'] == 1) { - $form_state['storage']['step']++; - $form_state['rebuild'] = TRUE; - } - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - $xml_form->validate($form, $form_state); - } -} - -/** - * Check if there is a custom edit metadata function defined in the content model. If so, - * call it, if not do the submit action for the standard QDC metadata. Custom forms will - * need to implement their own equivalent to the FormClass->updateMetaData function - * - * @param array $form - * @param array $form_state - * @return - */ -function fedora_repository_edit_qdc_form_submit($form, &$form_state) { - if ($form_state['storage']['xml']) { - module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); - $xml_form = new EditObjectMetadataForm($form_state); - $xml_form->submit($form, $form_state); - } - else { - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - global $base_url; - if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { - -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $soap_helper = new ConnectionHelper(); - $client = $soap_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - -// Check the content model for a custom edit metadata form submit function. - if (isset($form_state['values']['pid'])) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { - return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client); - } - } - - module_load_include('inc', 'fedora_repository', 'formClass'); - $metaDataForm = new formClass(); - $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); - $form_state['storage'] = NULL; - $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; - - return $return_value; - } - } -} - -/** - * drupal hook - * creates a new permission than can be assigned to roles - */ -function fedora_repository_perm() { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - return array( - OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, - OBJECTHELPER::$EDIT_FEDORA_METADATA, - OBJECTHELPER::$PURGE_FEDORA_OBJECTSANDSTREAMS, - OBJECTHELPER::$ADD_FEDORA_STREAMS, - OBJECTHELPER::$INGEST_FEDORA_OBJECTS, - OBJECTHELPER::$EDIT_TAGS_DATASTREAM, - OBJECTHELPER::$VIEW_DETAILED_CONTENT_LIST, - OBJECTHELPER::$MANAGE_COLLECTIONS, - OBJECTHELPER::$DELETE_ENTIRE_COLLECTIONS, - OBJECTHELPER::$CREATE_BATCH_PROCESS, - ); -} - -/** - * drupal hook - * determines if a user has access to what they are asking for - * - * @param type $op - * @param type $node - * @param type $account - * @return type - */ -function fedora_repository_access($op, $node, $account) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $objectHelper = new ObjectHelper(); - return $objectHelper->fedora_repository_access($op, $node, $account); -} - -/** - * Grabs a stream from fedora sets the mimetype and returns it. $dsID is the - * datastream id. - * @param $pid String - * @param $dsID String - */ -function makeObject($pid, $dsID) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!valid_pid($pid)) { - drupal_set_message(t("Invalid PID!"), 'error'); - return ' '; - } - - if (!valid_dsid($dsID)) { - drupal_set_message(t("Invalid dsID!"), 'error'); - return ' '; - } - - if ($pid == NULL || $dsID == NULL) { - drupal_set_message(t("No pid or dsid given to create an object with.")); - return ' '; - } - global $user; - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - drupal_access_denied(); - return; - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace."), 'error'); - return ' '; - } - - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $objectHelper = new ObjectHelper(); - $objectHelper->makeObject($pid, $dsID); -} - -/** - * Sends an ITQL query to the Fedora Resource index (can only communicate with Kowari or mulgara) - * Reads the pid and datastream id as url parameters. Queries the collection object for the query - * if there is no query datastream falls back to the query shipped with the module. - * - * @global type $user - * @param type $pid - * @param type $dsId - * @param type $collection - * @param type $page_number - * @param type $limit - * @return type - */ -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', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - global $user; - - if (!fedora_available()) { - drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); - return ''; - } - - if (!risearch_available()) { - drupal_set_message(t('The Fedora resource index search is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); - return ''; - } - - if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); - } - - $item = new fedora_item($pid); - if (!$item->exists()) { - drupal_not_found(); - exit(); - } - - if ($pid & !valid_pid($pid)) { - drupal_set_message(t("Invalid PID!"), 'error'); - return ' '; - } - - if ($dsId & !valid_dsid($dsId)) { - drupal_set_message(t("Invalid dsID!"), 'error'); - return ' '; - } - if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); - } - drupal_access_denied(); - exit; - return ' '; - } - - $objectHelper = new ObjectHelper(); - if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); - } - $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); - if (in_array(-1, $headers)) { - drupal_access_denied(); - exit; - return ' '; - } - if ($dsId != NULL && $dsId != '-') { //if we have a dsID return the stream otherwise query for a collection of objects -//probably should check pid as well here. - return makeObject($pid, $dsId); - } - - $content = '
        '; - - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - $collectionClass = new CollectionClass(); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'plugins/FedoraObjectDetailedContent'); - $breadcrumbs = array(); - $objectHelper->getBreadcrumbs($pid, $breadcrumbs); - drupal_set_breadcrumb(array_reverse($breadcrumbs)); - - $offset = $limit * $page_number; - $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_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 FedoraObjectDetailedContent($pid); - $object_details = $obj->showFieldSets(); - if ($object_details['fedora_object_details']['#selected'] == true){ - foreach($cmodels_tabs as $cmodel_tab){ - if (is_array($cmodel_tab)){ - $cmodel_tab['#selected'] = FALSE; - } - - } - } - $cmodels_tabs = array_merge($cmodels_tabs, $object_details); - - - return tabs_render($cmodels_tabs); -} - -/** - * fedora repository urlencode string - * @param type $str - * @return type - */ -function fedora_repository_urlencode_string($str) { - return htmlentities($str); -} - -/** - * Uses makeobject to get a stream. Sets the Content Disposition in the header so it suggests a filename - * and sends it as an attachment. This should prompt for a download of the object. - * - * @global type $user - * @param type $pid - * @param type $dsId - * @param type $label - * @param type $version - * @return type - */ -function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { - global $user; - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - - if ($pid == NULL || $dsId == NULL) { - drupal_set_message(t("no pid or dsid given to create an object with!")); - return ' '; - } - - $objectHelper = new ObjectHelper(); - $objectHelper->makeObject($pid, $dsId, 1, $label, FALSE, $version); -} - -/** - * repository page - * @param type $pid - * @param type $dsId - * @param type $collection - * @param type $pageNumber - * @return type - */ -function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNumber = NULL) { -//do security check at fedora_repository_get_items function as it has to be called there in case -//someone trys to come in a back door. - return fedora_repository_get_items($pid, $dsId, $collection, $pageNumber); -} - -/** - * repository service - * @global type $user - * @param type $pid - * @param type $servicePid - * @param type $serviceMethod - * @return type - */ -function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NULL) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - global $user; - - if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { -//drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); - drupal_access_denied(); - if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'error'); - } - return ' '; - } - if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); - } - $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); - if (in_array(-1, $headers)) { - drupal_access_denied(); - exit; - return ' '; - } - - - $item = new Fedora_Item($pid); - if ($item !== FALSE) { - echo $item->get_dissemination($servicePid, $serviceMethod); - } - - exit(); -} - -//Search Stuff ******************************************************************** - -/** - * Implementation of hook_search(). - * sends a search query to fedora fgsearch which is backed by Lucene - * In our implementation of Fedora we have api-a and api-m locked down - * to authorized users but at the object level. We can query Lucene and the - * RI index to get a list of results without authorization but to view any - * datastreams users must be authorized. - * - * @param type $op - * @param type $keys - * @return array - */ -function fedora_repository_search($op = 'search', $keys = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - - switch ($op) { - case 'name': - if (user_access('view fedora collection')) { - return t('Digital Repository', array('-9')); - } - case 'search': - if (user_access('view fedora collection')) { -//demo search string ?operation=gfindObjects&indexName=DemoOnLucene&query=fgs.DS.first.text%3Achristmas&hitPageStart=11&hitPageSize=10 - $resultData = NULL; - $numberOfHitsPerPage = NULL; - $index = strpos($keys, '.'); - $test = substr($keys, 0, $index + 1); - $type = NULL; - if ($index > 0) { - $index = strpos($keys, ':'); - $type = substr($keys, 0, $index); - $keys = substr($keys, $index + 1); - } - - $index = strpos($keys, ':'); - $startPage = substr($keys, 0, $index); - if ($index > 1) { - $keys = substr($keys, $index + 1); - } - - if (!$startPage) { - $startPage = 1; - } - - $xmlDoc = NULL; - - $path = drupal_get_path('module', 'fedora_repository'); - $xmlDoc = new DomDocument(); - $xmlDoc->load($path . '/searchTerms.xml'); - $nodeList = $xmlDoc->getElementsByTagName('default'); - if (!$type) { -//$type = 'dc.description'; - $type = $nodeList->item(0)->nodeValue; - } - $nodeList = $xmlDoc->getElementsByTagName('number_of_results'); - $numberOfHitsPerPage = $nodeList->item(0)->nodeValue; - - $indexName = variable_get('fedora_index_name', 'DemoOnLucene'); - $keys = htmlentities(urlencode($keys)); - $searchQuery = NULL; - if (isset($type) && strcmp($type, ':')) { - $searchQuery = $type . ':' . $keys; - } - else { - $searchQuery = $keys; - } -//$searchQuery.=" AND (PID:vre OR PID:vre:ref OR PID:demo OR PID:changeme)"; - - $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); - $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=copyXml&query=' . $searchQuery; - $searchString .= '&hitPageSize=' . $numberOfHitsPerPage . '&hitPageStart=' . $startPage; -//$searchString = htmlentities(urlencode($searchString)); - $searchUrl .= $searchString; - $objectHelper = new ObjectHelper(); - $resultData = do_curl($searchUrl); - - $results[] = array( - array( - 'data' => $resultData, - 'colspan' => 2 - ) - ); - return $results; - } - } // switch ($op) -} - -/** - * Implementation of hook_search_page(). - * Display the search results - * - * @param type $resultData - * @return array - */ -function fedora_repository_search_page($resultData) { - $path = drupal_get_path('module', 'fedora_repository'); - $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); - $proc = NULL; - if (!$resultData[0][0]['data']) { - return ''; //no results - } - $text = utf8_encode($resultData[0][0]['data']); - - try { - $proc = new XsltProcessor(); - } catch (Exception $e) { - $out[] = array( - array( - 'data' => $e->getMessage(), - 'colspan' => 2 - ) - ); - return $out; - } - -//inject into xsl stylesheet - $proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on - $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl - $proc->setParameter('', 'objectsPage', base_path()); - $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); - $proc->registerPHPFunctions(); - $xsl = new DomDocument(); - if ($isRestricted) { - $xsl->load($path . '/xsl/results.xsl'); - } - else { - $xsl->load($path . '/xsl/unfilteredresults.xsl'); - } - - $input = new DomDocument(); - $didLoadOk = $input->loadXML(utf8_encode($resultData[0][0]['data'])); - - if (!$didLoadOk) { - $results[] = array( - array( - 'data' => 'Error parsing results', - 'colspan' => 2 - ) - ); - } - else { - $xsl = $proc->importStylesheet($xsl); - $newdom = $proc->transformToDoc($input); - - $results[] = array( - array( - 'data' => $newdom->saveHTML(), - 'colspan' => 2 - ) - ); - } - - $header = array( - array( - 'data' => t('Collection results'), - NULL, - ), - (NULL) - ); - - $output .= theme('table', $header, $results); - return $output; -} - -/** - * Implementation of hook_form_alter(). - * allows the advanced search form in drupal - * - * @param type $form - * @param type $form_state - * @param type $form_id - */ -function fedora_repository_form_alter(&$form, &$form_state, $form_id) { -// Advanced node search form - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $path = drupal_get_path('module', 'fedora_repository'); - if ($form_id == 'search_form' && arg(1) == 'fedora_repository' && user_access('use advanced search')) { - $default_value = $form['basic']['inline']['keys']['#default_value']; - $index = strpos($default_value, '.'); - $test = substr($default_value, 0, $index + 1); - $type = NULL; - if ($index > 0) { - $index = strpos($default_value, ':'); - $type = substr($default_value, 0, $index); - $default_value = substr($default_value, $index + 1); - } - $form['basic']['inline']['keys']['#default_value'] = $default_value; -// Keyword boxes: - $form['advanced'] = array( - '#type' => 'fieldset', - '#title' => t('Advanced search'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#attributes' => array( - 'class' => 'search-advanced' - ), - ); - $form['advanced']['keywords'] = array( - '#prefix' => '
        ', - '#suffix' => '
        ', - ); - $xmlDoc = new DomDocument(); - $xmlDoc->load($path . '/searchTerms.xml'); - $nodeList = $xmlDoc->getElementsByTagName('term'); - $searchClass = new SearchClass(); - $types = $searchClass->get_search_terms_array(); - - $form['advanced']['type'] = array( - '#type' => 'select', - '#title' => t('Choose a field to search'), - '#prefix' => '
        ', '#suffix' => '
        ', '#options' => $types, - '#default_value' => $type, - ); - $form['advanced']['submit'] = array( - '#type' => 'submit', - '#value' => t('Advanced search'), - '#prefix' => '
        ', '#suffix' => '
        ', - ); - $form['#validate'][] = 'fedora_repository_search_validate'; - } -} - -/** - * Implementation of hook_search_validate() - * - * @param type $form - * @param type $form_state - */ -function fedora_repository_search_validate($form, &$form_state) { -// Initialise using any existing basic search keywords. - $keys = $form_state['values']['processed_keys']; - - if (isset($form_state['values']['type'])) { - $type = $form_state['values']['type']; - if ($type) { - $keys = $type . ':' . $keys; - } - } - - if (!empty($keys)) { - form_set_value($form['basic']['inline']['processed_keys'], trim($keys), $form_state); //set the form string - } -} - -/** - * fedora repository theme - * @return type - */ -function fedora_repository_theme() { - return array( - 'fedora_repository_mnpl_advanced_search_form' => array( - 'arguments' => array( - 'form' => NULL, - ), - ), - 'fedora_repository_time' => array( - 'arguments' => array( - 'element' => NULL - ), - 'fedora_repository_solution_packs_list' => array( - 'arguments' => array( - 'solution_packs' => NULL, - ), - ), - ), - ); -} - -/** - * Get a list of terms from a lucene index - * - * @param type $field - * @param type $startTerm - * @param type $displayName - * @return type - */ -function fedora_repository_list_terms($field, $startTerm = NULL, $displayName = NULL) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - return $searchClass->getTerms($field, $startTerm, $displayName); -} - -/** - * fedora repository mnpl advanced search form - * @return type - */ -function fedora_repository_mnpl_advanced_search_form() { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - return $searchClass->build_advanced_search_form(); -} - -/** - * theme fedora repository mnpl advanced search form - * @param type $form - * @return type - */ -function theme_fedora_repository_mnpl_advanced_search_form($form) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $advanced_search_form = new SearchClass(); - return $advanced_search_form->theme_advanced_search_form($form); -} - -/** - * fedora repository mnpl advanced search - * @param type $query - * @param type $startPage - * @return type - */ -function fedora_repository_mnpl_advanced_search($query, $startPage = 1) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - $retVal = $searchClass->custom_search($query, $startPage); - return $searchClass->custom_search($query, $startPage); -} - -/** - * fedora repository mnpl_advanced search form submit - * @param type $form - * @param type $form_state - */ -function fedora_repository_mnpl_advanced_search_form_submit($form, &$form_state) { - $type_id = $form_state['values']['type']; - $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); - $searchString = $form_state['values']['type1'] . ':' . $form_state['values']['fedora_terms1']; - if ($form_state['values']['fedora_terms2'] != '') { - $searchString .=' +' . $form_state['values']['andor1'] . '+' . $form_state['values']['type2'] . ':' . $form_state['values']['fedora_terms2']; - } - if ($repeat > 2 && $repeat < 9) { - for ($i = 3; $i < $repeat + 1; $i++) { - $t = $i - 1; - if ($form_state['values']["fedora_terms$i"] != '') { - $searchString .= '+' . $form_state['values']["andor$t"] . '+' . $form_state['values']["type$i"] . ':' . $form_state['values']["fedora_terms$i"]; - } - } - } - drupal_goto("fedora/repository/mnpl_advanced_search/$searchString"); -} - -/** - * fedora repository install demo page - * @return type - */ -function fedora_repository_install_demos_page() { - $output = drupal_get_form('fedora_repository_demo_objects_form'); - return $output; -} - -/** - * fedora repository demo objects form - * @return string - */ -function fedora_repository_demo_objects_form() { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $form = array(); - $existing_demos = array(); - - $form['install_demos'] = array( - '#title' => t('Islandora Demo Collections'), - '#type' => 'fieldset', - '#description' => t('Install demo image and document collections and content models.'), - ); - $demo_objects = array(); -// Check if the top-level islandora collection exists. If not, display a button to ingest. - - $form['install_demos']['demo_collections'] = array( - '#type' => 'checkboxes', - '#title' => t('Collections to ingest'), - '#options' => array(), - '#description' => t('Choose which demo collections you would like ingested into the repository.'), - ); - - foreach (array( - 'islandora:collectionCModel' => 'Islandora default content models', - 'islandora:root' => 'Islandora top-level collection', - 'islandora:demos' => 'Islandora demos collection', - 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', - ) - as $available_demo => $available_demo_desc) { - try { - $demo_objects[$available_demo] = new Fedora_Item($available_demo); - } catch (exception $e) { - - } - - if (empty($demo_objects[$available_demo]->objectProfile)) { -//The demo objects collection does not exist in the repository, display a button to ingest them. - $form['install_demos']['demo_collections']['#options'][$available_demo] = $available_demo_desc; - } - else { - array_push($existing_demos, $demo_objects[$available_demo]); - } - } - -// Check if the SmileyStuff collectoin exists, and if it has a COLLECTION_VIEW datastream. If it doesn't then we can add it. - - $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); - if (!empty($smiley_stuff->objectProfile)) { - $datastreams_list = $smiley_stuff->get_datastreams_list_as_array(); - if (empty($datastreams_list['COLLECTION_VIEW'])) { - $form['install_demos']['demo_collections']['#options']['demo:SmileyStuff'] = 'Add Islandora Collection View to Fedora Smiley Stuff Collection'; - } - else { - $demo_objects['demo:SmileyStuff'] = $smiley_stuff; - } - } - else { - $form['install_demos']['smileynote'] = array( - '#value' => '

        If you install the ' . l('fedora demo objects', 'https://wiki.duraspace.org/display/FCR30/Demonstration+Objects') . ' Islandora can display them as a collection.

        ' - ); - } - - $form['install_demos']['ingest'] = array( - '#type' => 'submit', - '#name' => 'install_demos', - '#value' => 'Install Selected Demos', - '#disabled' => (empty($form['install_demos']['demo_collections']['#options'])) ? TRUE : FALSE, - ); - - $form['existing_demos'] = array( - '#prefix' => '

        Demo collections already installed in this repository:

          ', - '#suffix' => '
        ', - ); - - if (!empty($existing_demos)) { - foreach ($existing_demos as $pid => $demo_object) { - - $form['existing_demos'][$demo_object->pid] = array( - '#prefix' => '
      • ', - '#value' => l($demo_object->pid, $demo_object->url()), - '#suffix' => '
      • ', - ); - } - } - - return $form; -} - -/** - * fedora repository demo objects form submit - * @global type $base_url - * @param type $form - * @param type $form_state - */ -function fedora_repository_demo_objects_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - global $base_url; - if ($form_state['clicked_button']['#name'] == 'install_demos') { - if (!empty($form_state['values']['demo_collections']['islandora:collectionCModel'])) { - try { - $collectioncm = Fedora_Item::ingest_new_item('islandora:collectionCModel', 'A', 'Islandora Collection Content Model'); - $collectioncm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); - $collectioncm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); - } catch (exception $e) { - - } - try { - $strictpdfcm = Fedora_Item::ingest_new_item('islandora:strict_pdf', 'A', 'Strict PDF Content Model'); - $strictpdfcm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); - $strictpdfcm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STRICT_PDFCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); - } catch (exception $e) { - - } - -// Install a collection object that points to all content model objects - try { - $cmodel_collection_xml = Fedora_Item::create_object_FOXML('islandora:ContentModelCollection'); - $cmodel_collection = Fedora_Item::ingest_from_FOXML($cmodel_collection_xml); - -//$dc = new Dublin_Core(new Fedora_Item('islandora:ContentModelCollection')); - $dc = new Dublin_Core($cmodel_collection); - $dc->set_element('dc:title', array('Installed Content Model')); - $dc->save(); - $cmodel_collection->add_datastream_from_string('select $object $title from <#ri> - where ($object $title - and ($object - or $object ) - and $object ) - order by $title', 'QUERY', 'Content Model Collection Query', 'text/plain'); - $cmodel_collection->add_relationship('isMemberOfCollection', 'islandora:root'); - $cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); - $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); - drupal_set_message(t("Successfully installed islandora:ContentModelCollection."), 'message'); - } catch (exception $e) { - - } - } - - if (!empty($form_state['values']['demo_collections']['islandora:root'])) { - $new_item = Fedora_Item::ingest_new_item('islandora:root', 'A', 'Islandora Top-level Collection'); - $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); - try { - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed islandora:root."), 'message'); - } catch (exception $e) { - - } - } - - if (!empty($form_state['values']['demo_collections']['islandora:demos'])) { - $new_item = fedora_item::ingest_new_item('islandora:demos', 'A', 'Islandora Demo Collection'); - $new_item->add_relationship('isMemberOfCollection', 'islandora:root'); - $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); - -// $cv = $new_item->add_datastream_from_file( drupal_get_path('module', 'fedora_repository') . '/collection_views/COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View.xml', 'text/xml', 'X'); - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - try { - $new_item = Fedora_Item::ingest_new_item('islandora:pdf_collection', 'A', 'PDF Collection'); - $new_item->add_relationship('isMemberOfCollection', 'islandora:demos'); - $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed islandora:demos."), 'message'); - } catch (exception $e) { - - } - } - - if (!empty($form_state['values']['demo_collections']['demo:SmileyStuff'])) { - $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); - $new_item = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/SmileyStuff-COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); - $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(t("Successfully installed demo:SmileyStuff collection view."), 'message'); - } catch (exception $e) { - - } - } - - if (!empty($form_state['values']['demo_collections']['islandora:largeimages'])) { - $error = ''; - foreach (array('islandora_jp2Sdep-slideCModel.xml', 'islandora_mods2htmlSdef.xml', 'islandora_mods2htmlSdep.xml', - 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { - try { - $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/' . $foxml_file); - } catch (exception $e) { - $error .= " - Problem ingesting $foxml_file"; - } - } - try { - $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/islandora_largeimages.xml'); - $tn = $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed islandora:largeimages."), 'message'); - } catch (exception $e) { - $error .= " - Problem ingesting islandora:largeimages collection"; - } - } - - if (!empty($error)) { - drupal_set_message(t('Some problems occurred: ' . $error)); - } - } -} - -/** - * fedora repository required fedora objects - * @return type - */ -function fedora_repository_required_fedora_objects() { -// array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) - $module_path = drupal_get_path('module', 'fedora_repository'); - return array( - 'fedora_repository' => array( - 'module' => 'fedora_repository', - 'title' => 'Islandora Core', - 'objects' => array( - array( - 'pid' => 'islandora:collectionCModel', - 'label' => 'Islandora Collection Content Model', - 'dsid' => 'ISLANDORACM', - 'datastream_file' => "$module_path/content_models/COLLECTIONCM.xml", - 'dsversion' => 2, - 'cmodel' => 'fedora-system:ContentModel-3.0', - ), - - array( - 'pid' => 'islandora:root', - 'label' => 'Islandora Top-level Collection', - 'cmodel' => 'islandora:collectionCModel', - 'datastreams' => array( - array( - 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", - ), - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", - 'mimetype' => 'image/png', - ), - ), - ), - ), - ), - ); -} - -/** - * Functions to create a time selector form element type. - */ -function fedora_repository_elements() { - $type['fedora_repository_time'] = array( - "#input" => TRUE, - "#process" => array("fedora_repository_expand_time"), - ); - - return $type; -} - -/** - * fedora repository expand time - * @param type $element - * @return string - */ -function fedora_repository_expand_time($element) { -// Default to current time, check default_value but set value so that if -// default value is present it will override value - if (empty($element['#default_value'])) { - $element['#value'] = array( - 'hour' => intval(format_date(time(), 'custom', 'h')), - 'minute' => intval(format_date(time(), 'custom', 'i')), - ); - } - - $element['#tree'] = TRUE; - - foreach ($element['#value'] as $type => $value) { - switch ($type) { - case 'hour': - $options = drupal_map_assoc(range(1, 24)); - break; - case 'minute': - $options = range(0, 59); - break; - } - - if ($type != 'meridiem') { - foreach ($options as $option) { - strlen($option) <= 1 ? $options[$option] = 0 . $option : ''; - } - } - - $element[$type] = array( - '#type' => 'select', - '#default_value' => $element['#value'][$type], - '#options' => $options, - ); - } - - return $element; -} - -/** - * fedora repository time - * @param type $element - * @return type - */ -function fedora_repository_time($element) { - $output = '
        ' . $element['#children'] . '
        '; - return theme('form_element', $element, $output); -} - -/** - * theme fedora repository time - * @param type $element - * @return type - */ -function theme_fedora_repository_time($element) { - $output = '
        ' . $element['#children'] . '
        '; - return theme('form_element', $element, $output); -} - -/* Export (basket) functionality */ - -/** - * fedora repository remove item from basket - * @param type $pid - */ -function fedora_repository_remove_item_from_basket($pid) { - - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; - - $objectHelper = new ObjectHelper(); -// getting child PIDs if any - $cpids = $objectHelper->get_child_pids(array($pid)); - - if (array_key_exists($pid, $pids)) { -// remove item from basket - unset($_SESSION['basket']['processed'][$pid]); - } - if (!empty($cpids)) { // there are children - foreach ($cpids as $child_pid => $value) { -// remove child item from basket recursively - fedora_repository_remove_item_from_basket($child_pid); - } - } -} - -/** - * fedora repository basket - * @return type - */ -function fedora_repository_basket() { - $pids = _fedora_repository_get_basket_pids(); - $output = drupal_get_form('fedora_repository_basket_form', $pids); - - return $output; -} - -function fedora_repository_basket_form($form_state, $pids) { - $form = array(); - - if (!empty($pids)) { - $form['pid'] = array(); - $form['title'] = array(); - $form['desc'] = array(); - } - else { - return; - } - - ksort($pids); - foreach ($pids as $pid => $arr) { - $cbs[$pid] = ''; - - $form['pid'][$pid] = array('#value' => l($pid, "fedora/repository/$pid")); - $form['title'][$pid] = array('#value' => $arr['title']); - $form['desc'][$pid] = array('#value' => $arr['desc']); - } - - $form['remove'] = array( - '#type' => 'checkboxes', - '#options' => $cbs, - ); - - $form['remove_submit'] = array( - '#type' => 'submit', - '#value' => t('Remove selected'), - ); - - $form['remove_all'] = array( - '#type' => 'submit', - '#value' => t('Empty basket'), - ); - - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Export selected'), - ); - - $form['submit_all'] = array( - '#type' => 'submit', - '#value' => t('Export all'), - ); - - return $form; -} - -/** - * theme fedora repository basket form - * @param type $form - * @return string - */ -function theme_fedora_repository_basket_form($form) { - $header = array( - theme('table_select_header_cell'), - t('PID'), - t('Title'), - t('Description'), - ); - - if (isset($form['pid']) && is_array($form['pid'])) { - foreach (element_children($form['pid']) as $key) { - $rows[] = array( - drupal_render($form['remove'][$key]), - drupal_render($form['pid'][$key]), - drupal_render($form['title'][$key]), - drupal_render($form['desc'][$key]), - ); - } - } - else { - $rows[] = array(array('data' => t('Your basket is empty.'), 'colspan' => '4')); - } - - $output = theme('table', $header, $rows); - - $frm = drupal_render($form); - $output = $frm . $output . $frm; - - return $output; -} - -/** - * fedora repository basket form validate - * @param type $form - * @param type $form_state - */ -function fedora_repository_basket_form_validate($form, &$form_state) { - -} - -/** - * fedora repository basket form submit - * @global type $user - * @param type $form - * @param type $form_state - * @return type - */ -function fedora_repository_basket_form_submit($form, &$form_state) { - if ($form_state['values']['op'] == $form_state['values']['remove_submit']) { - $pids = $form_state['clicked_button']['#post']['remove']; - - if (isset($pids)) { - foreach ($pids as $pid) { - fedora_repository_remove_from_basket($pid); - } - drupal_set_message(t("Selected objects removed")); - return; - } - } - - if ($form_state['values']['op'] == $form_state['values']['remove_all']) { - _fedora_repository_empty_basket(); - drupal_set_message(t("Basket emptied")); - return; - } - - if ($form_state['values']['op'] == $form_state['values']['submit_all']) { - $msg = t("All objects exported to staging area"); - $pids = _fedora_repository_get_basket_pids(); - } - elseif ($form_state['values']['op'] == $form_state['values']['submit']) { - $msg = t("Selected objects exported to staging area"); - $pids = array_filter($form_state['values']['remove']); - } - - if (!empty($pids)) { - global $user; - $log = array(); - $success = TRUE; - $export_dir = variable_get('export_area', file_directory_path() . '/fedora_export_area') . '/' . $user->name . '/' . date("Ymd-His"); - $foxml_dir = $export_dir . '/foxml'; - - if (!file_exists($foxml_dir) && !@mkdir($foxml_dir, 0775, TRUE)) { - drupal_set_message(t("Failed to create foxml dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $foxml_dir)), 'error'); - return FALSE; - } - - module_load_include('inc', 'fedora_repository', 'api/fedora_export'); - foreach ($pids as $pid => $arr) { - - $objects_dir = $export_dir . '/objects/' . $pid; - if (!file_exists($objects_dir) && !@mkdir($objects_dir, 0775, TRUE)) { - drupal_set_message(t("Failed to create objects dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $objects_dir)), 'error'); - return FALSE; - } - - if (!export_to_export_area($pid, $foxml_dir, $objects_dir, $log)) { - $success = FALSE; - } - } - $msg = $success ? $msg : t("Failed to export objects to staging area"); - $msg .= ":
        " . implode("
        ", $log); - - drupal_set_message($msg, $success ? 'info' : 'error'); -//_fedora_repository_empty_basket(); - } - else { - drupal_set_message(t("No objects selected or basket empty"), 'error'); - } - - return; -} - -/** - * Get all pids saved to the basket. - * - * @return type - */ -function _fedora_repository_get_basket_pids() { - -// Set empty defaults if basket elements are missing - $_SESSION['basket'] = isset($_SESSION['basket']) ? $_SESSION['basket'] : array('processed' => array(), 'unprocessed' => array()); - $_SESSION['basket']['processed'] = isset($_SESSION['basket']['processed']) ? $_SESSION['basket']['processed'] : array(); - $_SESSION['basket']['unprocessed'] = isset($_SESSION['basket']['unprocessed']) ? $_SESSION['basket']['unprocessed'] : array(); - - $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; - - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $ob = new ObjectHelper(); - foreach ($_SESSION['basket']['unprocessed'] as $pid) { -// Check if the pid already exists in the tree - if (array_key_exists($pid, $pids)) { - continue; - } - - $pids += $ob->get_all_related_pids($pid); -// $pids += array($pid); - } - - $_SESSION['basket']['processed'] = $pids; - $_SESSION['basket']['unprocessed'] = array(); - - return $pids; -} - -/** - * fedora repository empty basket - */ -function _fedora_repository_empty_basket() { - unset($_SESSION['basket']); -} - -/** - * fedora repository add to basket - * @param type $pid - * @param type $warn - * @param type $searchResultsFlag - */ -function fedora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) { - if ($warn && _is_added_to_basket($pid)) { - drupal_set_message(t("Object already in basket")); - } - - if (!isset($_SESSION['basket'])) { - $_SESSION['basket'] = array(); - $_SESSION['basket']['unprocessed'] = array($pid => $pid); - } - else { - $_SESSION['basket']['unprocessed'][$pid] = $pid; - } - - if (!$searchResultsFlag) { - drupal_goto('fedora/basket'); - } -} - -/** - * fedora repository remove from basket - * @param type $pid - * @return type - */ -function fedora_repository_remove_from_basket($pid) { - if (isset($_SESSION['basket']['unprocessed'][$pid])) { - unset($_SESSION['basket']['unprocessed'][$pid]); - } - - if (isset($_SESSION['basket']['processed'][$pid])) { - unset($_SESSION['basket']['processed'][$pid]); - } - return; -} - -/** - * theme add to basket link - * @param type $pid - * @param type $type - * @return type - */ -function theme_add_to_basket_link($pid, $type = 'object') { - $object = t($type); - $path = drupal_urlencode($pid); - - $save = "export_big.png"; - $saved = "exported_big.png"; -// $path = drupal_get_path('module', 'Fedora_Repository').'/images/'.$save ; - /* - var_dump($path); - var_dump(theme('image',drupal_get_path('module', 'Fedora_Repository').'/images/'.$save)); - die(); - */ - if (!_is_added_to_basket($pid)) { - return l( - theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), - "fedora/repository/addToBasket/" . $path, - array('html' => TRUE) - ); - } - - return theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $saved, t("In basket"), t("This @object is already in your basket", array('@object' => $object))); -} - -/** - * is added to basket - * @param type $pid - * @param type $account - * @return type - */ -function _is_added_to_basket($pid, $account = NULL) { - return isset($_SESSION['basket']['unprocessed'][$pid]) || isset($_SESSION['basket']['processed'][$pid]); -// return db_result(db_query("SELECT uid FROM {repository_basket} WHERE uid = %d AND pid = '%s'", $account->uid, $pid)); -} - -/** - * fedora repository display schema - * @param type $file - * @return type - */ -function fedora_repository_display_schema($file) { - $path = drupal_get_path('module', 'fedora_repository'); - if (strtolower(substr($file, -3)) == 'xsd' && file_exists($path . '/' . $file)) { - drupal_goto($path . '/' . $file); - } - else { - drupal_goto(); - } - return; -} - -/** - * fedora repository batch reingest object - * @param type $object - * @param type $context - * @return type - */ -function fedora_repository_batch_reingest_object($object, &$context) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!empty($object) && is_array($object)) { - $pid = $object['pid']; - if (!valid_pid($pid)) { - return NULL; - } -// Does the object exist? If so, purge it. - $item = new Fedora_Item($pid); - if ($item->exists()) { - $item->purge(t('Remove during re-install batch job')); - } - -// Ingest the object from the source file. - if (!empty($object['foxml_file'])) { - $foxml_file = $object['foxml_file']; - $new_item = Fedora_Item::ingest_from_FOXML_file($foxml_file); - if ($new_item->exists()) { -// Batch operation was successful. - $context['message'][] = "$new_item->pid installed."; - } - } - if (!empty($object['dsid']) && !empty($object['datastream_file'])) { - $datastreams = array( - array( - 'dsid' => $object['dsid'], - 'datastream_file' => $object['datastream_file'], - ) - ); - } - elseif (!empty($object['datastreams'])) { - $datastreams = $object['datastreams']; - } - - if (!empty($datastreams) && is_array($datastreams)) { - $label = !empty($object['label']) ? $object['label'] : ''; - if (empty($object['foxml_file']) && !isset($new_item)) { - $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); - } - if (!empty($object['cmodel'])) { - $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); - } - if (!empty($object['parent'])) { - $new_item->add_relationship('isMemberOfCollection', $object['parent']); - } - 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'); - } - } - } - } -} - -/** - * Content model, collection view and collection policy datastreams may now optionally define a version - * number in their top-level XML element as an attribute, as in: - * get_datastream_dissemination($dsid)); - } - elseif (isset($datastream_file)) { - $doc = simplexml_load_file($datastream_file); - } - - if (!empty($doc)) { - $attrs = $doc->attributes(); - foreach ($attrs as $name => $value) { - if ($name == 'version') { - $return = (int) $value; - break; - } - } - } - return $return; -} - -/** - * theme fedora repository solution pack list - * @param type $solution_packs - * @return string - */ -function theme_fedora_repository_solution_packs_list($solution_packs) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $output = ''; - $header = array(); - $rows = array(); - - - - - drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); - return $output; -} - -/** - * Implementation of hook_forms() - * @param string $form_id - * @return array - */ -function fedora_repository_forms($form_id) { - $forms = array(); - if (strpos($form_id, 'fedora_repository_solution_pack_form_') === 0) { - $forms[$form_id] = array( - 'callback' => 'fedora_repository_solution_pack_form', - ); - } - return $forms; -} diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc deleted file mode 100644 index de4ce137..00000000 --- a/fedora_repository.solutionpacks.inc +++ /dev/null @@ -1,175 +0,0 @@ - $solution_pack_info) { - $objects = array(); - foreach ($solution_pack_info as $field => $value) { - switch ($field) { - case 'title': - $solution_pack_name = $value; - break; - case 'objects': - $objects = $value; - break; - } - } - $output .= drupal_get_form('fedora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects); - } - - return $output; -} - -/** - * Check for installed objects and add a 'Update' or 'Install' button if some objects are missing. - * @param array $solution_pack - */ -function fedora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { - // Check each object to see if it is in the repository. - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - global $base_path; - $needs_update = FALSE; - $needs_install = FALSE; - $form = array(); - $form['solution_pack_module'] = array( - '#type' => 'hidden', - '#value' => $solution_pack_module, - ); - - if (!$form_state['submitted']) { - $form['soluction_pack_name'] = array( - '#type' => 'markup', - '#value' => t($solution_pack_name), - '#prefix' => '

        ', - '#suffix' => '

        ', - ); - $form['objects'] = array( - '#type' => 'fieldset', - '#title' => "Objects", - '#weight' => 10, - '#attributes' => array('class' => 'collapsed'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - $table_header = array('PID', 'Status'); - $table_rows = array(); - - - foreach ($objects as $object) { - $datastreams = NULL; - if (isset($object['pid'])) { - $pid = $object['pid']; - - $item = new Fedora_Item($pid); - $table_row = array($object['pid']); - $object_status = t('Up-to-date'); - if (!$item->exists()) { - $object_status = 'Missing'; - $needs_install = TRUE; - } - else { - if (isset($object['dsid']) && isset($object['datastream_file']) && isset($object['dsversion'])) { - $datastreams = array( - array( - 'dsid' => $object['dsid'], - 'datastream_file' => $object['datastream_file'], - 'dsversion' => $object['dsversion'], - ), - ); - } - elseif (!empty($object['datastreams'])) { - $datastreams = $object['datastreams']; - } - if (!empty($datastreams) && is_array($datastreams)) { - foreach ($datastreams as $ds) { - $ds_list = $item->get_datastreams_list_as_array(); - if (!array_key_exists($ds['dsid'], $ds_list)) { - $needs_update = TRUE; - $object_status = 'Missing datastream'; - break; - } - if (isset($ds['dsversion'])) { - // Check if the datastream is versioned and needs updating. - $installed_version = fedora_repository_get_islandora_datastream_version($item, $ds['dsid']); - $available_version = fedora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); - if ($available_version > $installed_version) { - $needs_update = TRUE; - $object_status = 'Out of date'; - break; - } - } - } - } - } - array_push($table_row, $object_status); - $table_rows[] = $table_row; - } - } - $form['objects']['table'] = array( - '#type' => 'markup', - '#value' => theme_table($table_header, $table_rows), - ); - } - - $form['install_status'] = array( - '#type' => 'markup', - '#prefix' => '' . t('Object status:') . ' ', - '#suffix' => ' ', - ); - if (!$needs_install && !$needs_update) { - $form['install_status']['#value'] = theme_image('misc/watchdog-ok.png') . t('All required objects are installed and up-to-date.'); - } - else { - $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); - } - $form['submit'] = array( - '#value' => t('Install'), - '#disabled' => !$needs_install && !$needs_update, - '#type' => 'submit', - '#name' => $solution_pack_module, - ); - - $form['#submit'] = array( - 'fedora_repository_solution_pack_form_submit', - ); - return $form; -} - -function fedora_repository_solution_pack_form_submit($form, &$form_state) { - $what = $form_state; - $module_name = $form_state['values']['solution_pack_module']; - $solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); - $batch = array( - 'title' => t('Installing / updating solution pack objects'), - 'file' => drupal_get_path('module', 'fedora_repository') . '/fedora_repository.module', - 'operations' => array(), - ); - - - foreach ($solution_pack_info[$module_name]['objects'] as $object) { - // Add this object to the batch job queue. - $batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object)); - } - batch_set($batch); -} From 625edabf3977e775ae30d3b03bd770cf9d204d14 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Fri, 7 Oct 2011 16:25:13 -0300 Subject: [PATCH 091/247] Remote the extra tests --- digital_repository.install | 51 -------------------------------------- 1 file changed, 51 deletions(-) diff --git a/digital_repository.install b/digital_repository.install index 43bbcf70..164ce02e 100644 --- a/digital_repository.install +++ b/digital_repository.install @@ -87,32 +87,6 @@ function fedora_repository_requirements($phase) { $requirements['xslt']['value'] = t("Installed"); $requirements['xslt']['severity'] = REQUIREMENT_OK; } - - // Test for Imagick - system("hash convert 2>&-", $return_value); - $requirements['imagick']['title'] = t("Image Magick library"); - if ($return_value) { - $requirements['imagick']['value'] = t("Not installed"); - $requirements['imagick']['severity'] = REQUIREMENT_WARNING; - $requirements['imagick']['description'] = t('Ensure that the Image Magick library is installed.'); - } - else { - $requirements['imagick']['value'] = t("Installed"); - $requirements['imagick']['severity'] = REQUIREMENT_OK; - } - - // Test for Kakadu - system("hash kdu_compress 2>&-", $return_value); - $requirements['kakadu']['title'] = t("Kakadu library"); - if ($return_value) { - $requirements['kakadu']['value'] = t("Not installed"); - $requirements['kakadu']['severity'] = REQUIREMENT_WARNING; - $requirements['kakadu']['description'] = t('Ensure that the Kakadu library is installed.'); - } - else { - $requirements['kakadu']['value'] = t("Installed"); - $requirements['kakadu']['severity'] = REQUIREMENT_OK; - } } elseif ($phase == 'runtime') { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); @@ -127,31 +101,6 @@ function fedora_repository_requirements($phase) { $requirements['fedora-repository']['value'] = t("Available"); $requirements['fedora-repository']['severity'] = REQUIREMENT_OK; } - - // Check for ImageMagick - $requirements['fedora-imagemagick']['title'] = t("ImageMagick convert in \$PATH"); - $result = exec('convert'); - if (!$result) { - $requirements['fedora-imagemagick']['value'] = t('Not in $PATH'); - $requirements['fedora-imagemagick']['description'] = t('Islandora will not be able to create thumbnails. Ensure that ImageMagick is installed and the convert command is executable by the web server user.'); - $requirements['fedora-imagemagick']['severity'] = REQUIREMENT_WARNING; - } - else { - $requirements['fedora-imagemagick']['value'] = t("Available"); - $requirements['fedora-imagemagick']['severity'] = REQUIREMENT_OK; - } - - $requirements['fedora-kakadu']['title'] = 'Kakadu kdu_compress in $PATH'; - $kdu_res = exec('kdu_compress -v'); - if (!$kdu_res) { - $requirements['fedora-kakadu']['value'] = ('Not in $PATH'); - $requirements['fedora-kakadu']['description'] = t('Islandora cannot convert TIFF image files to JPEG2000 format. Ensure Kakadu is installed and the kdu_compress command is executable by the web server user.'); - $requirements['fedora-kakadu']['severity'] = REQUIREMENT_WARNING; - } - else { - $requirements['fedora-kakadu']['value'] = t("Available"); - $requirements['fedora-kakadu']['severity'] = REQUIREMENT_OK; - } } return $requirements; From fae0efb144f7edc8635df821e38dfda567240229 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Tue, 11 Oct 2011 10:20:35 -0300 Subject: [PATCH 092/247] switched to islandora_repository --- BatchIngest.inc | 20 +-- CollectionClass.inc | 42 +++--- CollectionManagement.inc | 24 ++-- CollectionPolicy.inc | 18 +-- ContentModel.inc | 50 +++---- ObjectHelper.inc | 68 +++++----- SearchClass.inc | 30 ++--- SecurityClass.inc | 2 +- XMLDatastream.inc | 8 +- formClass.inc | 78 +++++------ islandora_repository.solutionpacks.inc | 175 +++++++++++++++++++++++++ 11 files changed, 345 insertions(+), 170 deletions(-) create mode 100644 islandora_repository.solutionpacks.inc diff --git a/BatchIngest.inc b/BatchIngest.inc index 31daa608..f3d63cc0 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -9,8 +9,8 @@ * @param array $content_models */ function batch_creation_form(&$form_state, $collection_pid, $content_models) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); $cm_options = array(); $name_mappings = array(); foreach ($content_models as $content_model) { @@ -95,8 +95,8 @@ function batch_creation_form_validate($form, &$form_state) { } function batch_creation_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); global $user; $namespace_mappings = array(); $content_model = $form_state['values']['content_model']; @@ -150,7 +150,7 @@ function batch_creation_form_submit($form, &$form_state) { $batch = array( 'title' => 'Ingesting Objects', 'operations' => array(), - 'file' => drupal_get_path('module', 'fedora_repository') . '/BatchIngest.inc', + 'file' => drupal_get_path('module', 'islandora_repository') . '/BatchIngest.inc', ); @@ -176,8 +176,8 @@ function batch_creation_form_submit($form, &$form_state) { function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); $allowedMimeTypes = $cm->getMimetypes(); $mime_helper = new MimeClass(); @@ -227,9 +227,9 @@ function create_batch_objects($label, $content_model, $object_files, $collection function batch_create_dc_from_mods($mods_xml) { - $path = drupal_get_path('module', 'fedora_repository'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'CollectionClass'); + $path = drupal_get_path('module', 'islandora_repository'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'CollectionClass'); if ($xmlstr == NULL || strlen($xmlstr) < 5) { return " "; diff --git a/CollectionClass.inc b/CollectionClass.inc index 4251eea4..df438aca 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -29,7 +29,7 @@ class CollectionClass { */ function __construct($pid = NULL) { if (!empty($pid)) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $this->collectionObject = new ObjectHelper($pid); $this->pid = $pid; } @@ -45,7 +45,7 @@ class CollectionClass { * @return type */ function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); if (!isset($itqlquery)) { // $query_string = $objectHelper->getStream($pid, 'QUERY', 0); @@ -65,8 +65,8 @@ class CollectionClass { * @return type */ function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); if (!isset($limit)) { $limit = 1000; } @@ -74,7 +74,7 @@ class CollectionClass { $offset = 0; } global $user; - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return ' '; } @@ -101,7 +101,7 @@ class CollectionClass { $query_string = htmlentities(urlencode($query_string)); $content = ''; - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; $content .= do_curl($url); @@ -156,7 +156,7 @@ class CollectionClass { * @return type */ function getStream($pid, $dsid, $showError = 1) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $item = new fedora_item($pid); return isset($item->datastreams[$dsid]) ? $item->get_datastream_dissemination($dsid) : NULL; } @@ -223,7 +223,7 @@ class CollectionClass { module_load_include('inc', 'Fedora_Repository', 'ConnectionHelper'); $pidNameSpace = $this->getPidNameSpace($pid, $dsid); $pname = substr($pidNameSpace, 0, strpos($pidNameSpace, ":")); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); return Fedora_Item::get_next_pid_in_namespace($pname); } @@ -339,7 +339,7 @@ class CollectionClass { } } // module_load_include( $phpFile, 'Fedora_Repository', ' '); - require_once(drupal_get_path('module', 'fedora_repository') . '/' . $phpFile); + require_once(drupal_get_path('module', 'islandora_repository') . '/' . $phpFile); $thisClass = new $phpClass (); $returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext); if (!$returnValue) { @@ -409,7 +409,7 @@ class CollectionClass { $ingest_form = $xml->ingest_form; //should only be one $drupal_module = strip_tags($ingest_form->form_builder_method->module->asXML()); if (empty($drupal_module)) { - $drupal_module = 'fedora_repository'; + $drupal_module = 'islandora_repository'; } $phpFile = strip_tags($ingest_form->form_builder_method->file->asXML()); $phpClass = strip_tags($ingest_form->form_builder_method->class_name->asXML()); @@ -437,11 +437,11 @@ class CollectionClass { 'name' => variable_get('fedora_admin_user', 'fedoraAdmin') ); $admin_user = user_load($username); - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); $connectionHelper = new ConnectionHelper(); try { $soapClient = $connectionHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $pidNameSpace = variable_get('fedora_repository_pid', 'vre:'); + $pidNameSpace = variable_get('islandora_repository_pid', 'vre:'); $pidNameSpace = substr($pidNameSpace, 0, strpos($pidNameSpace, ":")); $params = array( 'numPIDs' => '', @@ -460,7 +460,7 @@ class CollectionClass { $personal_collection_pid = array( 'fedora_personal_pid' => $pid ); - module_load_include('inc', 'fedora_repository', 'plugins/PersonalCollectionClass'); + module_load_include('inc', 'islandora_repository', 'plugins/PersonalCollectionClass'); $personalCollectionClass = new PersonalCollectionClass(); if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) { drupal_set_message("Did not create a personal collection object for !u", array('!u' => $user->name)); @@ -480,7 +480,7 @@ class CollectionClass { * @return type */ function getXslContent($pid, $path, $canUseDefault = TRUE) { - module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'islandora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); $xslContent = $collectionClass->getCollectionViewStream($pid); if (!$xslContent && $canUseDefault) { //no xslt so we will use the default sent with the module @@ -497,9 +497,9 @@ class CollectionClass { * @return string */ function showFieldSets($page_number) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'CollectionManagement'); - module_load_include('inc', 'fedora_repository', 'BatchIngest'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'CollectionManagement'); + module_load_include('inc', 'islandora_repository', 'BatchIngest'); global $base_url; $tabset = array(); global $user; @@ -514,7 +514,7 @@ class CollectionClass { $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'); + $show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_ingest_form'); $add_to_collection = $this->getIngestInterface(); $show_batch_tab = TRUE; @@ -586,7 +586,7 @@ class CollectionClass { $allow = fedora_fesl_check_roles($this->pid, 'write'); } if ($allow) { - $ingestObject = drupal_get_form('fedora_repository_ingest_form', $this->pid); + $ingestObject = drupal_get_form('islandora_repository_ingest_form', $this->pid); } } } @@ -608,7 +608,7 @@ class CollectionClass { * @return type */ function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { - $path = drupal_get_path('module', 'fedora_repository'); + $path = drupal_get_path('module', 'islandora_repository'); global $base_url; $collection_pid = $pid; //we will be changing the pid later maybe $objectHelper = new ObjectHelper(); @@ -628,7 +628,7 @@ class CollectionClass { } if (!isset($collectionName)) { - $collectionName = variable_get('fedora_repository_name', 'Collection'); + $collectionName = variable_get('islandora_repository_name', 'Collection'); } $xslContent = $this->getXslContent($pid, $path); diff --git a/CollectionManagement.inc b/CollectionManagement.inc index 83bb9952..bb89a9fd 100644 --- a/CollectionManagement.inc +++ b/CollectionManagement.inc @@ -8,7 +8,7 @@ * @return array */ function collection_management_form(&$form_state, $this_collection_pid, $content_models) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); $restricted = FALSE; if (variable_get('fedora_namespace_restriction_enforced', true)) { $restricted = true; @@ -20,8 +20,8 @@ function collection_management_form(&$form_state, $this_collection_pid, $content } } } - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); $item = new Fedora_Item($this_collection_pid); $collection_name = $item->objectProfile->objLabel; $new_content_models = get_content_models_as_option_array(); @@ -224,8 +224,8 @@ function collection_management_form(&$form_state, $this_collection_pid, $content */ function collection_management_form_validate($form, &$form_state) { if ($form_state['clicked_button']['#id'] == 'create_class') { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); $pid = $form_state['values']['new_collection_pid']; $item = new fedora_item($pid); if ($item->exists()) { @@ -252,14 +252,14 @@ function collection_management_form_validate($form, &$form_state) { * @param type $form_state */ function collection_management_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'api/fedora_collection'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); + module_load_include('inc', 'islandora_repository', 'api/fedora_collection'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/dublin_core'); global $user; $collection_pid = $form_state['values']['parent_collection']; $policy = CollectionPolicy::loadFromCollection($collection_pid, TRUE); if ($form_state['clicked_button']['#id'] == 'create_class') { - $module_path = drupal_get_path('module', 'fedora_repository'); + $module_path = drupal_get_path('module', 'islandora_repository'); $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; $new_collection_pid = $form_state['values']['new_collection_pid']; $new_collection_label = $form_state['values']['collection_name']; @@ -345,7 +345,7 @@ function collection_management_form_submit($form, &$form_state) { $query = htmlentities(urlencode($query)); $content = ''; - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=csv&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query; $content .= do_curl($url); $results = explode("\n", $content); @@ -370,7 +370,7 @@ function collection_management_form_submit($form, &$form_state) { $batch = array( 'title' => "Deleting Objects from $name", 'operations' => array(), - 'file' => drupal_get_path('module', 'fedora_repository') . '/CollectionManagement.inc', + 'file' => drupal_get_path('module', 'islandora_repository') . '/CollectionManagement.inc', ); @@ -389,7 +389,7 @@ function collection_management_form_submit($form, &$form_state) { * @param $pid */ function delete_objects_as_batch($pid) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $name = $user->name; $item_to_delete = new Fedora_Item($pid); $models = $item_to_delete->get_models(); diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index b801eaff..0612a733 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -4,7 +4,7 @@ * @file * Collection Policy Class */ -module_load_include('inc', 'fedora_repository', 'XMLDatastream'); +module_load_include('inc', 'islandora_repository', 'XMLDatastream'); /** * Collection Policy class ?? @@ -36,7 +36,7 @@ class CollectionPolicy extends XMLDatastream { */ static function loadFromCollection($pid, $preFetch=TRUE) { $ret = FALSE; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); try { if (self::valid_pid($pid)) { @@ -80,7 +80,7 @@ class CollectionPolicy extends XMLDatastream { $rootEl = $cp->xml->getElementsByTagName('collection_policy')->item(0); $rootEl->setAttribute('name', $name); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $ret = $cp; @@ -110,7 +110,7 @@ class CollectionPolicy extends XMLDatastream { $cp = new CollectionPolicy($newDom, $pid, $cpDsid); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $ret = $cp; @@ -137,7 +137,7 @@ class CollectionPolicy extends XMLDatastream { public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) { $ret = FALSE; if (($cp = self::loadFromCollection($pid)) === FALSE) { //removed second, non-existant variable - module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) { $newDom = new DOMDocument('1.0', 'utf-8'); $newDom->formatOutput = TRUE; @@ -171,7 +171,7 @@ class CollectionPolicy extends XMLDatastream { $cp = new CollectionPolicy($newDom, $pid, $policyDsid); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); @@ -299,7 +299,7 @@ class CollectionPolicy extends XMLDatastream { $this->staging_area = trim($stagingEl->item(0)->nodeValue); } elseif ($recurse) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $rels = $item->get_relationships(); if (count($rels) > 0) { @@ -373,7 +373,7 @@ class CollectionPolicy extends XMLDatastream { $pname = substr($namespace, 0, strpos($namespace, ":")); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $ret = Fedora_Item::get_next_pid_in_namespace($pname); } return $ret; @@ -443,7 +443,7 @@ class CollectionPolicy extends XMLDatastream { if ($recurse && count($ret) == 0) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $rels = $item->get_relationships(); if (count($rels) > 0) { diff --git a/ContentModel.inc b/ContentModel.inc index b1f28074..66bd9569 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -8,7 +8,7 @@ * @file * Content Model Class */ -module_load_include('inc', 'fedora_repository', 'XMLDatastream'); +module_load_include('inc', 'islandora_repository', 'XMLDatastream'); /** * Conent Model ?? @@ -41,7 +41,7 @@ class ContentModel extends XMLDatastream { public static function loadFromObject($pid) { $ret = FALSE; if (self::valid_pid($pid)) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); $content_models = $objectHelper->get_content_models_list($pid); @@ -73,7 +73,7 @@ class ContentModel extends XMLDatastream { $rootEl = $cm->xml->getElementsByTagName('content_model')->item(0); $rootEl->setAttribute('name', $name); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $ret = $cm; @@ -102,7 +102,7 @@ class ContentModel extends XMLDatastream { $cm = new ContentModel($newDom, $pid, $modelDsid); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $ret = $cm; @@ -172,7 +172,7 @@ class ContentModel extends XMLDatastream { $cm = new ContentModel($newDom, $pid, $modelDsid); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $ret = $cm; @@ -199,7 +199,7 @@ class ContentModel extends XMLDatastream { */ public static function loadFromModel($pid, $dsid = NULL, $pid_namespace = NULL, $name = NULL) { $ret = FALSE; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); try { if (self::valid_pid($pid)) { $fedoraItem = new Fedora_Item($pid); @@ -436,7 +436,7 @@ class ContentModel extends XMLDatastream { and $object ) order by $title'; - module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'islandora_repository', 'CollectionClass'); $collectionHelper = new CollectionClass(); $xml = simplexml_load_string($collectionHelper->getRelatedItems($this->pid, $query)); @@ -1070,7 +1070,7 @@ class ContentModel extends XMLDatastream { $method = $ingest_form->getElementsByTagName('form_builder_method')->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Build Ingest Form: file \'' . $path . '\' does not exist.'; } @@ -1110,7 +1110,7 @@ class ContentModel extends XMLDatastream { if ($method->length > 0 && $method->item(0)->getAttribute('dsid') == $dsid) { $method = $method->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Build Edit Metadata Form: file \'' . $path . '\' does not exist.'; } @@ -1153,7 +1153,7 @@ class ContentModel extends XMLDatastream { if ($method->length > 0) { $method = $method->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Handle Edit Metadata Form: file \'' . $path . '\' does not exist.'; } @@ -1177,7 +1177,7 @@ class ContentModel extends XMLDatastream { } else { // Assume DC form if none is specified. - module_load_include('inc', 'fedora_repository', 'formClass'); + module_load_include('inc', 'islandora_repository', 'formClass'); $metaDataForm = new formClass(); $ret = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $soap_client); $form_state['storage'] = NULL; @@ -1198,7 +1198,7 @@ class ContentModel extends XMLDatastream { $method = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); if ($method->length > 0) { $method = $method->item(0); - $ret = array('module' => $method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module'), + $ret = array('module' => $method->getAttribute('module') == '' ? 'islandora_repository' : $method->getAttribute('module'), 'file' => $method->getAttribute('file'), 'class' => $method->getAttribute('class'), 'method' => $method->getAttribute('method'), @@ -1282,7 +1282,7 @@ class ContentModel extends XMLDatastream { } } $module = $addMethod->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $addMethod->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $addMethod->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Execute Add Datastream Methods: file \'' . $path . '\' does not exist.'; } @@ -1351,9 +1351,9 @@ class ContentModel extends XMLDatastream { if (!$preview || isset($param_array['preview'])) { $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); - if (!file_exists($path) || substr_compare($path, 'fedora_repository/', -strlen('fedora_repository/'), strlen('fedora_repository/')) === 0) { + if (!file_exists($path) || substr_compare($path, 'islandora_repository/', -strlen('islandora_repository/'), strlen('islandora_repository/')) === 0) { self::$errors[] = 'Execute Ingest Rules: file \'' . $path . '\' does not exist.'; $ret = FALSE; } @@ -1399,7 +1399,7 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; } @@ -1469,7 +1469,7 @@ class ContentModel extends XMLDatastream { for ($j = 0; $j < $dispMethods->length; $j++) { $method = $dispMethods->item($j); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; } @@ -1588,7 +1588,7 @@ class ContentModel extends XMLDatastream { $ret = array(); $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; $i < $dispMethods->length; $i++) { - $ret[] = array('module' => $dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module'), + $ret[] = array('module' => $dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module'), 'file' => $dispMethods->item($i)->getAttribute('file'), 'class' => $dispMethods->item($i)->getAttribute('class'), 'method' => $dispMethods->item($i)->getAttribute('method'), @@ -1694,7 +1694,7 @@ class ContentModel extends XMLDatastream { $found = FALSE; $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { - if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module')) && + if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module')) && $file == $dispMethods->item($i)->getAttribute('file') && $class == $dispMethods->item($i)->getAttribute('class') && $method == $dispMethods->item($i)->getAttribute('method')) { @@ -1732,7 +1732,7 @@ class ContentModel extends XMLDatastream { $found = FALSE; $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { - if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module') == '') && + if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module') == '') && $file == $dispMethods->item($i)->getAttribute('file') && $class == $dispMethods->item($i)->getAttribute('class') && $method == $dispMethods->item($i)->getAttribute('method')) { @@ -1785,7 +1785,7 @@ class ContentModel extends XMLDatastream { if (($ds = $this->getDSModel($ds)) !== FALSE) { $addDsMethod = $ds->getElementsByTagName('add_datastream_method'); if ($addDsMethod !== FALSE && $addDsMethod->length > 0) { - $ret = array('module' => $addDsMethod->item(0)->getAttribute('module') == '' ? 'fedora_repository' : $addDsMethod->item(0)->getAttribute('module'), + $ret = array('module' => $addDsMethod->item(0)->getAttribute('module') == '' ? 'islandora_repository' : $addDsMethod->item(0)->getAttribute('module'), 'file' => $addDsMethod->item(0)->getAttribute('file'), 'class' => $addDsMethod->item(0)->getAttribute('class'), 'method' => $addDsMethod->item(0)->getAttribute('method'), @@ -1936,7 +1936,7 @@ class ContentModel extends XMLDatastream { $methods = $rule->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); $found = FALSE; for ($i = 0; $found === FALSE && $i < $methods->length; $i++) { - if (($methods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($i)->getAttribute('module')) == $module && + if (($methods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $methods->item($i)->getAttribute('module')) == $module && $methods->item($i)->getAttribute('file') == $file && $methods->item($i)->getAttribute('class') == $class && $methods->item($i)->getAttribute('method') == $method) { @@ -1989,7 +1989,7 @@ class ContentModel extends XMLDatastream { $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $methods = $methodsEl->getElementsByTagName('ingest_method'); for ($i = 0; !$found && $i < $methods->length; $i++) { - if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'fedora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { + if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'islandora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { $found = $methods->item($i); } } @@ -2077,7 +2077,7 @@ class ContentModel extends XMLDatastream { $methods = $rules->item($i)->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); for ($j = 0; $j < $methods->length; $j++) { - $method = array('module' => $methods->item($j)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($j)->getAttribute('module'), + $method = array('module' => $methods->item($j)->getAttribute('module') == '' ? 'islandora_repository' : $methods->item($j)->getAttribute('module'), 'file' => $methods->item($j)->getAttribute('file'), 'class' => $methods->item($j)->getAttribute('class'), 'method' => $methods->item($j)->getAttribute('method'), @@ -2157,7 +2157,7 @@ class ContentModel extends XMLDatastream { $ret = FALSE; if ($this->validate()) { $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); - $ret = array('module' => ($method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module')), + $ret = array('module' => ($method->getAttribute('module') == '' ? 'islandora_repository' : $method->getAttribute('module')), 'file' => $method->getAttribute('file'), 'class' => $method->getAttribute('class'), 'method' => $method->getAttribute('method'), diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 9e9995b7..da56852b 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -33,7 +33,7 @@ class ObjectHelper { */ function ObjectHelper() { drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); $connectionHelper = new ConnectionHelper(); //$this->fedoraUser = $connectionHelper->getUser(); //$this->fedoraPass = $connectionHelper->getPassword(); @@ -56,7 +56,7 @@ class ObjectHelper { */ function makeObject($pid, $dsID, $asAttachment = FALSE, $label = NULL, $filePath=FALSE, $version=NULL, $forceSoap = TRUE) { global $user; - module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); if ($pid == NULL || $dsID == NULL) { drupal_set_message(t("no pid or dsid given to create an object with"), 'error'); return ' '; @@ -69,7 +69,7 @@ class ObjectHelper { return ' '; } - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access Fedora objects within the attempted namespace."), 'error'); drupal_access_denied(); return ' '; @@ -91,7 +91,7 @@ class ObjectHelper { } } - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $item = new Fedora_Item($pid); @@ -176,7 +176,7 @@ class ObjectHelper { * for the mimetype in question. */ if ($pos === FALSE) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); $mimeclass = new MimeClass(); $ext = $mimeclass->get_extension($mimeType); $suggestedFileName = "$label.$ext"; @@ -207,7 +207,7 @@ class ObjectHelper { * @return type */ function getCollectionInfo($pid, $query = NULL) { - module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'islandora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); $results = $collectionClass->getRelatedItems($pid, $query); return $results; @@ -227,12 +227,12 @@ class ObjectHelper { drupal_set_message(t('You must specify an object pid and datastream ID.'), 'error'); return ''; } - if (!fedora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!islandora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t('You do not have the appropriate permissions'), 'error'); return; } - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $item = new fedora_item($pid); $datastream_list = $item->get_datastreams_list_as_SimpleXML(); if (!isset($datastream_list)) { @@ -262,12 +262,12 @@ class ObjectHelper { drupal_set_message(t('You must specify an object pid and datastream ID.'), 'error'); return ''; } - if (!fedora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!islandora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t('You do not have the appropriate permissions'), 'error'); return; } - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $item = new fedora_item($pid); $datastream_list = $item->get_datastreams_list_as_SimpleXML(); if (!isset($datastream_list)) { @@ -291,7 +291,7 @@ class ObjectHelper { */ function create_link_for_ds($pid, $dataStreamValue) { global $base_url; - $path = drupal_get_path('module', 'fedora_repository'); + $path = drupal_get_path('module', 'islandora_repository'); require_once($path . '/api/fedora_item.inc'); $item = new Fedora_Item($pid); @@ -359,8 +359,8 @@ class ObjectHelper { */ function getFormattedDC($item) { global $base_url; - $path = drupal_get_path('module', 'fedora_repository'); - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + $path = drupal_get_path('module', 'islandora_repository'); + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); $dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC'; $xmlstr = $item->get_datastream_dissemination($dsid); @@ -408,7 +408,7 @@ class ObjectHelper { $ds_list = $item->get_datastreams_list_as_array(); $output = $this->getFormattedDC($item); $dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC'; - $path = drupal_get_path('module', 'fedora_repository'); + $path = drupal_get_path('module', 'islandora_repository'); //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1)); if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { @@ -440,12 +440,12 @@ class ObjectHelper { */ 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'); + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); - $path = drupal_get_path('module', 'fedora_repository'); + $path = drupal_get_path('module', 'islandora_repository'); $dataStreamBody = ''; $fedoraItem = new Fedora_Item($object_pid); @@ -514,7 +514,7 @@ class ObjectHelper { * */ function getStream($pid, $dsid, $showError = FALSE) { - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); $soapHelper = new ConnectionHelper(); try { $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); @@ -548,7 +548,7 @@ class ObjectHelper { * @return array */ function get_content_models_list($pid, $include_fedora_system_content_models = FALSE) { - module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'islandora_repository', 'CollectionClass'); $collectionHelper = new CollectionClass(); $pids = array(); $query = 'select $object from <#ri> @@ -593,7 +593,7 @@ class ObjectHelper { * @param type $pid * @return type */ - function fedora_repository_access($op, $pid) { + function islandora_repository_access($op, $pid) { global $user; $returnValue = FALSE; @@ -602,7 +602,7 @@ class ObjectHelper { $namespaceAccess = TRUE; } if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); + $pid = variable_get('islandora_repository_pid', 'islandora:root'); } $nameSpaceAllowed = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $pos = NULL; @@ -632,7 +632,7 @@ class ObjectHelper { * @param $content String */ function parseContent($content, $pid, $dsId, $collection, $pageNumber = NULL) { - $path = drupal_get_path('module', 'fedora_repository'); + $path = drupal_get_path('module', 'islandora_repository'); global $base_url; $collection_pid = $pid; //we will be changing the pid later maybe //module_load_include('php', ''Fedora_Repository'', 'ObjectHelper'); @@ -790,7 +790,7 @@ class ObjectHelper { return NULL; } $output = ''; - module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) { $output .= $cm->displayExtraFieldset($pid, $page_number); } @@ -810,7 +810,7 @@ class ObjectHelper { return FALSE; } - module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); if ($dsid != NULL && $pid != NULL && ($cm = ContentModel::loadFromObject($pid)) !== FALSE) { $cm->execAddDatastreamMethods($dsid, $file); } @@ -826,7 +826,7 @@ class ObjectHelper { if (!$pid) { return FALSE; } - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); // Get title and descriptions for $pid $query_string = 'select $title $desc from <#ri> @@ -834,7 +834,7 @@ class ObjectHelper { and $o $desc and $o '; - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query_string))); @@ -868,7 +868,7 @@ class ObjectHelper { } $query_string = substr($query_string, 0, -3) . ' )'; - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= htmlentities(urlencode($query_string)); $content = $this->doCurl($url); @@ -905,7 +905,7 @@ class ObjectHelper { * @return type */ function getObject($pid, $context = 'archive', $format = FOXML_11) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/objects/' . $pid . '/export?context=' . $context . '&format=' . $format; $result_data = do_curl($url); @@ -921,10 +921,10 @@ class ObjectHelper { * @param type $level */ function getBreadcrumbs($pid, &$breadcrumbs, $level=10) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; - if ($pid == variable_get('fedora_repository_pid', 'islandora:root')) { + if ($pid == variable_get('islandora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } @@ -940,7 +940,7 @@ class ObjectHelper { order by $title'; $query_string = htmlentities(urlencode($query_string)); - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; $result = preg_split('/[\r\n]+/', do_curl($url)); @@ -950,7 +950,7 @@ class ObjectHelper { $parent = preg_replace('/^info:fedora\//', '', $matches[0]); $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); - if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { + if ($parent == variable_get('islandora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } diff --git a/SearchClass.inc b/SearchClass.inc index 3f1c78d5..794d292a 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -25,14 +25,14 @@ class SearchClass { function solr_search($query, $startPage=1, $fq = NULL, $dismax = NULL) { $solrFile = trim(variable_get('islandora_solr_search_block_handler_file', 'plugins/SolrResults.inc')); - // Don't let us bust out of fedora_repository modules directory when looking for a handler + // Don't let us bust out of islandora_repository modules directory when looking for a handler if (strpos($solrField, '../')) { drupal_set_message(t('You have illegal characters in your solr handler function in the Islandora solr block config.'), 'error'); } $solrClass = trim(variable_get('islandora_solr_search_block_handler_class', 'SolrResults')); $solrFunction = trim(variable_get('islandora_solr_search_block_handler_function', 'SearchAndDisplay')); - require_once(drupal_get_path('module', 'fedora_repository') . '/' . $solrFile); + require_once(drupal_get_path('module', 'islandora_repository') . '/' . $solrFile); try { $implementation = new $solrClass(); } catch (Exception $e) { @@ -185,8 +185,8 @@ class SearchClass { * @return type */ function quickSearch($type, $query, $showForm = 1, $orderBy = 0, & $userArray) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); if (user_access('view fedora collection')) { $numberOfHistPerPage = '5000'; //hack for IR they do not want next button $luceneQuery = NULL; @@ -222,7 +222,7 @@ class SearchClass { } } if ($showForm) { - $output = 'Quick Search
        ' . drupal_get_form('fedora_repository_quick_search_form') . '
        '; + $output = 'Quick Search
        ' . drupal_get_form('islandora_repository_quick_search_form') . '
        '; } $output .= $this->applyXSLT($resultData, $orderBy); return $output; @@ -237,8 +237,8 @@ class SearchClass { * @return type */ function getTerms($fieldName, $startTerm, $displayName = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); $indexName = variable_get('fedora_index_name', 'DemoOnLucene'); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); if ($startTerm == NULL) { @@ -269,8 +269,8 @@ class SearchClass { * @return type */ function custom_search($query, $startPage=1, $xslt= '/xsl/advanced_search_results.xsl', $numberOfHistPerPage = 50) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); if (user_access('view fedora collection')) { //$numberOfHistPerPage = '50';//hack for IR they do not want next button @@ -322,7 +322,7 @@ class SearchClass { return ' '; } - //$proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl + //$proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'userID', $user->uid); if (isset($displayName)) { @@ -390,8 +390,8 @@ class SearchClass { //inject into xsl stylesheet global $user; $proc->setParameter('', 'userID', $user->uid); - $proc->setParameter('', 'searchToken', drupal_get_token('fedora_repository_advanced_search')); //token generated by Drupal, keeps tack of what tab etc we are on - $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl + $proc->setParameter('', 'searchToken', drupal_get_token('islandora_repository_advanced_search')); //token generated by Drupal, keeps tack of what tab etc we are on + $proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->setParameter('', 'hitPageStart', $startPage); @@ -441,7 +441,7 @@ class SearchClass { //inject into xsl stylesheet //$proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on $proc->setParameter('', 'userID', $user->uid); - $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl + $proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->setParameter('', 'orderBy', $orderBy); @@ -475,7 +475,7 @@ class SearchClass { */ function theme_advanced_search_form($form, $repeat=NULL) { if (!isset($repeat)) { - $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('islandora_repository_advanced_block_repeat', t('3')); } $output = drupal_render($form['search_type']['type1']); @@ -515,7 +515,7 @@ class SearchClass { $form = array(); if (!isset($repeat)) { - $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('islandora_repository_advanced_block_repeat', t('3')); } $var0 = explode(':', $queryArray[0]); $var1 = explode(':', $queryArray[1]); diff --git a/SecurityClass.inc b/SecurityClass.inc index 0cdb2cbe..fbc6d3b8 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -30,7 +30,7 @@ class SecurityClass { */ function canIngestHere($collection_pid) { global $user; - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); // get the childsecurity policy from the collection. $policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS :: $SECURITY_CLASS_SECURITY_STREAM, FALSE); diff --git a/XMLDatastream.inc b/XMLDatastream.inc index d3afed09..9376aa83 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -168,7 +168,7 @@ abstract class XMLDatastream { //$tmpname = substr($this->pid, strpos($this->pid, ':') + 1); $tmpname = user_password(10); $this->convertFromOldSchema(); - drupal_add_js("fedora_repository_print_new_schema_$tmpname = function(tagID) { + drupal_add_js("islandora_repository_print_new_schema_$tmpname = function(tagID) { var target = document.getElementById(tagID); var content = target.innerHTML; var text = 'Title' + @@ -179,7 +179,7 @@ abstract class XMLDatastream { }", 'inline'); if (user_access('administer site configuration')) { - drupal_set_message('<span id="new_schema_' . $tmpname . '" style="display: none;">' . htmlentities($this->xml->saveXML()) . '</span>Warning: XMLDatastream performed conversion of \'' . $this->getIdentifier() . '\' from old schema. Please update the datastream. The new datastream contents are <a href="javascript:fedora_repository_print_new_schema_' . $tmpname . '(\'new_schema_' . $tmpname . '\')">here.</a> '); + drupal_set_message('<span id="new_schema_' . $tmpname . '" style="display: none;">' . htmlentities($this->xml->saveXML()) . '</span>Warning: XMLDatastream performed conversion of \'' . $this->getIdentifier() . '\' from old schema. Please update the datastream. The new datastream contents are <a href="javascript:islandora_repository_print_new_schema_' . $tmpname . '(\'new_schema_' . $tmpname . '\')">here.</a> '); } $rootEl = $this->xml->firstChild; @@ -246,7 +246,7 @@ abstract class XMLDatastream { * @return boolean $valid */ public function purgeVersions($start_date, $end_date = NULL) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $fedora_item = new Fedora_Item($this->pid); return $fedora_item->purge_datastream($this->dsid, $start_date, $end_date); } @@ -258,7 +258,7 @@ abstract class XMLDatastream { * @return string[] $ret */ public function getHistory() { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $fedora_item = new Fedora_Item($this->pid); $history = $fedora_item->get_datastream_history($this->dsid); diff --git a/formClass.inc b/formClass.inc index 762f1252..93b68316 100644 --- a/formClass.inc +++ b/formClass.inc @@ -24,15 +24,15 @@ class formClass { function createMenu() { $items = array(); - $items['admin/settings/fedora_repository'] = array( + $items['admin/settings/islandora_repository'] = array( 'title' => t('Configure Islandora'), 'description' => t('Enter the Islandora Collection information here'), 'page callback' => 'drupal_get_form', - 'page arguments' => array('fedora_repository_admin'), + 'page arguments' => array('islandora_repository_admin'), 'access arguments' => array('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); - $items['admin/settings/fedora_repository/collection'] = array( + $items['admin/settings/islandora_repository/collection'] = array( 'title' => t('Collection list'), 'description' => t('Enter the Islandora collection information here.'), 'access arguments' => array('administer site configuration'), @@ -40,18 +40,18 @@ class formClass { 'weight' => 0, ); - $items['admin/settings/fedora_repository/demoobjects'] = array( + $items['admin/settings/islandora_repository/demoobjects'] = array( 'title' => t('Solution Packs'), 'description' => t('Install content models and collections required by installed solution packs.'), - 'page callback' => 'fedora_repository_solution_packs_page', + 'page callback' => 'islandora_repository_solution_packs_page', 'access arguments' => array('add fedora datastreams'), - 'file' => 'fedora_repository.solutionpacks.inc', + 'file' => 'islandora_repository.solutionpacks.inc', 'type' => MENU_LOCAL_TASK, ); $items['islandoracm.xsd'] = array( 'title' => t('Islandora Content Model XML Schema Definition'), - 'page callback' => 'fedora_repository_display_schema', + 'page callback' => 'islandora_repository_display_schema', 'page arguments' => array('islandoracm.xsd'), 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), @@ -59,7 +59,7 @@ class formClass { $items['collection_policy.xsd'] = array( 'title' => t('Islandora Content Model XML Schema Definition'), - 'page callback' => 'fedora_repository_display_schema', + 'page callback' => 'islandora_repository_display_schema', 'page arguments' => array('collection_policy.xsd'), 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), @@ -70,7 +70,7 @@ class formClass { 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); - $repository_title = variable_get('fedora_repository_title', 'Digital repository'); + $repository_title = variable_get('islandora_repository_title', 'Digital repository'); if (trim($repository_title) != '') { $respository_title = t($repository_title); } @@ -100,7 +100,7 @@ class formClass { $items['fedora/repository/editmetadata'] = array( 'title' => t('Edit metadata'), - 'page callback' => 'fedora_repository_edit_qdc_page', + 'page callback' => 'islandora_repository_edit_qdc_page', // 'page arguments' => array(1), //'type' => MENU_LOCAL_TASK, 'type' => MENU_CALLBACK, @@ -109,21 +109,21 @@ class formClass { $items['fedora/repository/purgeStream'] = array( 'title' => t('Purge data stream'), - 'page callback' => 'fedora_repository_purge_stream', + 'page callback' => 'islandora_repository_purge_stream', 'type' => MENU_CALLBACK, 'access arguments' => array('purge objects and datastreams') ); $items['fedora/repository/replaceStream'] = array( 'title' => t('Replace Stream'), - 'page callback' => 'fedora_repository_replace_stream', + 'page callback' => 'islandora_repository_replace_stream', 'type' => MENU_CALLBACK, 'access arguments' => array('add fedora datastreams'), ); $items['fedora/repository/purgeObject'] = array( 'title' => t('Purge object'), - 'page callback' => 'fedora_repository_purge_object', + 'page callback' => 'islandora_repository_purge_object', // 'type' => MENU_LOCAL_TASK, 'type' => MENU_CALLBACK, 'access arguments' => array('purge objects and datastreams') @@ -147,21 +147,21 @@ class formClass { //new for mnpl****************************************** $items['fedora/repository/mnpl_advanced_search'] = array( 'title' => t('Repository advanced search'), - 'page callback' => 'fedora_repository_mnpl_advanced_search', + 'page callback' => 'islandora_repository_mnpl_advanced_search', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection') ); $items['fedora/ingestObject'] = array( 'title' => t('Ingest object'), - 'page callback' => 'fedora_repository_ingest_object', + 'page callback' => 'islandora_repository_ingest_object', 'type' => MENU_CALLBACK, 'access arguments' => array('add fedora datastreams') ); $items['fedora/repository/list_terms'] = array( 'title' => t('List terms'), - 'page callback' => 'fedora_repository_list_terms', + 'page callback' => 'islandora_repository_list_terms', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection') ); @@ -170,25 +170,25 @@ class formClass { $items['fedora/basket'] = array( 'title' => t('Fedora Basket'), 'description' => t('View and download objects added to your basket'), - 'page callback' => 'fedora_repository_basket', + 'page callback' => 'islandora_repository_basket', 'access arguments' => array('view fedora collection'), 'type' => MENU_CALLBACK, ); $items['fedora/repository/addToBasket'] = array( - 'page callback' => 'fedora_repository_add_to_basket', + 'page callback' => 'islandora_repository_add_to_basket', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); $items['fedora/repository/removeFromBasket'] = array( - 'page callback' => 'fedora_repository_remove_from_basket', + 'page callback' => 'islandora_repository_remove_from_basket', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); $items['fedora/repository/add_search_results_to_basket'] = array( - 'page callback' => 'fedora_repository_add_search_results_to_basket', + 'page callback' => 'islandora_repository_add_search_results_to_basket', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); @@ -205,21 +205,21 @@ class formClass { drupal_set_message(t('You must be a site administrator to edit the Fedora collecitons list.'), 'error'); return; } - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $form = array(); - $form['fedora_repository_name'] = array( + $form['islandora_repository_name'] = array( '#type' => 'textfield', '#title' => t('Root Collection Name'), - '#default_value' => variable_get('fedora_repository_name', 'Islandora demos collection'), + '#default_value' => variable_get('islandora_repository_name', 'Islandora demos collection'), '#description' => t('The Name of the Root Collection Object'), '#required' => TRUE, '#weight' => -20 ); - $form['fedora_repository_pid'] = array( + $form['islandora_repository_pid'] = array( '#type' => 'textfield', '#title' => t('Root Collection PID'), - '#default_value' => variable_get('fedora_repository_pid', 'islandora:root'), + '#default_value' => variable_get('islandora_repository_pid', 'islandora:root'), '#description' => t('The PID of the Root Collection Object'), '#required' => TRUE, '#weight' => -18 @@ -235,10 +235,10 @@ class formClass { ); - $form['fedora_repository_url'] = array( + $form['islandora_repository_url'] = array( '#type' => 'textfield', '#title' => t('Fedora RISearch URL'), - '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), + '#default_value' => variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'), '#description' => t('The url of the Fedora server'), '#required' => TRUE, '#weight' => -14 ); @@ -296,10 +296,10 @@ class formClass { '#weight' => 0 ); } - $form['fedora_repository_title'] = array( + $form['islandora_repository_title'] = array( '#type' => 'textfield', '#title' => t('Digital Repository Title'), - '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), + '#default_value' => variable_get('islandora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); $form['advanced'] = array( @@ -432,7 +432,7 @@ class formClass { * @return type */ function can_ingest_here($collection_pid) { - module_load_include('inc', 'fedora_repository', 'SecurityClass'); + module_load_include('inc', 'islandora_repository', 'SecurityClass'); $securityClass = new SecurityClass(); return $securityClass->canIngestHere($collection_pid); } @@ -447,7 +447,7 @@ class formClass { drupal_set_message(t('You do not have permission to ingest.'), 'error'); return FALSE; } - module_load_include('inc', 'fedora_repository', 'SecurityClass'); + module_load_include('inc', 'islandora_repository', 'SecurityClass'); $security_class = new SecurityClass(); if (!$security_class->canIngestHere($collection_pid)) { // Queries the collection object for a child security datastream and if found parses it @@ -507,7 +507,7 @@ class formClass { ), 'submit' => array( '#type' => 'submit', - '#submit' => array('fedora_repository_ingest_form_submit'), + '#submit' => array('islandora_repository_ingest_form_submit'), '#value' => t('Next') ), ); @@ -523,7 +523,7 @@ class formClass { * @return array */ function createQDCIngestFormPageTwo($collection_pid, $collection_label, array &$form_state) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); $form = array(); $content_model_pid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $content_model_dsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); @@ -541,7 +541,7 @@ class formClass { ); $form['submit'] = array( '#type' => 'submit', - '#submit' => array('fedora_repository_ingest_form_submit'), + '#submit' => array('islandora_repository_ingest_form_submit'), '#value' => t('Ingest') ); } @@ -558,7 +558,7 @@ class formClass { * @return array */ function createQDCIngestForm($collection_pid, $collection_label, array &$form_state) { - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); $form_state['storage']['step'] = empty($form_state['storage']['step']) ? 1 : $form_state['storage']['step']; if ($form_state['storage']['step'] == 1) { return $this->createQDCIngestFormPageOne($collection_pid, $collection_label, $form_state); @@ -603,9 +603,9 @@ class formClass { //dump_vars($form_state); // Populate the list of datastream IDs. - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $obj_helper = new ObjectHelper(); $content_models = $obj_helper->get_content_models_list($pid); diff --git a/islandora_repository.solutionpacks.inc b/islandora_repository.solutionpacks.inc new file mode 100644 index 00000000..633d28fe --- /dev/null +++ b/islandora_repository.solutionpacks.inc @@ -0,0 +1,175 @@ +<?php + +/** + * @file + * Invokes a hook to any dependent modules asking them if their installations require + * any fedora objects to be present. Modules implementing this hook should return an array + * of arrays of the form: + * + * array( 'pid', 'path-to-foxml-file', 'dsid', 'path-to-datastream-file', int dsversion) + * + * where the last three options are optional. A module can either point to a simple + * foxml file to install, or can specify a datastreamstream to check for, with a + * path to load the datastream from if it isn't there. Optionally a version number + * can be included, to enable updating of content model or collection policy streams + * that may have been updated. THis is a simple whole number that should be incremented + * when changed. This value appears in as an attribute of the topmost element of the stream, + * e.g.,: + * + * <?xml version="1.0" encoding="utf-8"?> <content_model name="Collection" version="2" ... + * + * Datastreams which don't have this element are assumed to be at version 0. + */ +function islandora_repository_solution_packs_page() { + $enabled_solution_packs = module_invoke_all('required_fedora_objects'); + $output = ''; + foreach ($enabled_solution_packs as $solution_pack_module => $solution_pack_info) { + $objects = array(); + foreach ($solution_pack_info as $field => $value) { + switch ($field) { + case 'title': + $solution_pack_name = $value; + break; + case 'objects': + $objects = $value; + break; + } + } + $output .= drupal_get_form('islandora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects); + } + + return $output; +} + +/** + * Check for installed objects and add a 'Update' or 'Install' button if some objects are missing. + * @param array $solution_pack + */ +function islandora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { + // Check each object to see if it is in the repository. + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + global $base_path; + $needs_update = FALSE; + $needs_install = FALSE; + $form = array(); + $form['solution_pack_module'] = array( + '#type' => 'hidden', + '#value' => $solution_pack_module, + ); + + if (!$form_state['submitted']) { + $form['soluction_pack_name'] = array( + '#type' => 'markup', + '#value' => t($solution_pack_name), + '#prefix' => '<h3>', + '#suffix' => '</h3>', + ); + $form['objects'] = array( + '#type' => 'fieldset', + '#title' => "Objects", + '#weight' => 10, + '#attributes' => array('class' => 'collapsed'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $table_header = array('PID', 'Status'); + $table_rows = array(); + + + foreach ($objects as $object) { + $datastreams = NULL; + if (isset($object['pid'])) { + $pid = $object['pid']; + + $item = new Fedora_Item($pid); + $table_row = array($object['pid']); + $object_status = t('Up-to-date'); + if (!$item->exists()) { + $object_status = 'Missing'; + $needs_install = TRUE; + } + else { + if (isset($object['dsid']) && isset($object['datastream_file']) && isset($object['dsversion'])) { + $datastreams = array( + array( + 'dsid' => $object['dsid'], + 'datastream_file' => $object['datastream_file'], + 'dsversion' => $object['dsversion'], + ), + ); + } + elseif (!empty($object['datastreams'])) { + $datastreams = $object['datastreams']; + } + if (!empty($datastreams) && is_array($datastreams)) { + foreach ($datastreams as $ds) { + $ds_list = $item->get_datastreams_list_as_array(); + if (!array_key_exists($ds['dsid'], $ds_list)) { + $needs_update = TRUE; + $object_status = 'Missing datastream'; + break; + } + if (isset($ds['dsversion'])) { + // Check if the datastream is versioned and needs updating. + $installed_version = islandora_repository_get_islandora_datastream_version($item, $ds['dsid']); + $available_version = islandora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); + if ($available_version > $installed_version) { + $needs_update = TRUE; + $object_status = 'Out of date'; + break; + } + } + } + } + } + array_push($table_row, $object_status); + $table_rows[] = $table_row; + } + } + $form['objects']['table'] = array( + '#type' => 'markup', + '#value' => theme_table($table_header, $table_rows), + ); + } + + $form['install_status'] = array( + '#type' => 'markup', + '#prefix' => '<strong>' . t('Object status:') . ' </strong>', + '#suffix' => ' ', + ); + if (!$needs_install && !$needs_update) { + $form['install_status']['#value'] = theme_image('misc/watchdog-ok.png') . t('All required objects are installed and up-to-date.'); + } + else { + $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); + } + $form['submit'] = array( + '#value' => t('Install'), + '#disabled' => !$needs_install && !$needs_update, + '#type' => 'submit', + '#name' => $solution_pack_module, + ); + + $form['#submit'] = array( + 'islandora_repository_solution_pack_form_submit', + ); + return $form; +} + +function islandora_repository_solution_pack_form_submit($form, &$form_state) { + $what = $form_state; + $module_name = $form_state['values']['solution_pack_module']; + $solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); + $batch = array( + 'title' => t('Installing / updating solution pack objects'), + 'file' => drupal_get_path('module', 'islandora_repository') . '/islandora_repository.module', + 'operations' => array(), + ); + + + foreach ($solution_pack_info[$module_name]['objects'] as $object) { + // Add this object to the batch job queue. + $batch['operations'][] = array('islandora_repository_batch_reingest_object', array($object)); + } + batch_set($batch); +} From ab131a672fa427db1fbeb9476488e5bc60b7bf0e Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 11 Oct 2011 10:21:27 -0300 Subject: [PATCH 093/247] switched to islandora repository --- api/fedora_collection.inc | 14 +- api/fedora_export.inc | 4 +- api/fedora_item.inc | 10 +- api/fedora_utils.inc | 12 +- islandora_repository.info | 9 + islandora_repository.install | 107 ++ islandora_repository.module | 2251 +++++++++++++++++++++++ islandoracm.xsd | 10 +- plugins/CollectionFormBuilder.inc | 4 +- plugins/DarwinCore.inc | 8 +- plugins/DemoFormBuilder.inc | 6 +- plugins/DocumentConverter.inc | 2 +- plugins/Exiftool.inc | 2 +- plugins/FedoraObjectDetailedContent.inc | 12 +- plugins/Flv.inc | 2 +- plugins/FlvFormBuilder.inc | 6 +- plugins/FormBuilder.inc | 8 +- plugins/ImageManipulation.inc | 2 +- plugins/ModsFormBuilder.inc | 16 +- plugins/PersonalCollectionClass.inc | 2 +- plugins/QtFormBuilder.php | 4 +- plugins/Refworks.inc | 12 +- plugins/ShowStreamsInFieldSets.inc | 18 +- plugins/herbarium.inc | 28 +- plugins/islandora_imageapi.info | 7 + plugins/islandora_imageapi.module | 116 ++ plugins/map_viewer.inc | 10 +- plugins/qt_viewer.inc | 6 +- plugins/slide_viewer.inc | 6 +- plugins/tagging_form.inc | 22 +- tests/README_TESTING.txt | 2 +- tests/fedora_repository.test | 20 +- 32 files changed, 2614 insertions(+), 124 deletions(-) create mode 100644 islandora_repository.info create mode 100644 islandora_repository.install create mode 100644 islandora_repository.module create mode 100644 plugins/islandora_imageapi.info create mode 100644 plugins/islandora_imageapi.module diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index b8afc5c4..2efd2acb 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -4,10 +4,10 @@ * @file * Operations that affect a Fedora repository at a collection level. */ -module_load_include('inc', 'fedora_repository', 'CollectionClass'); -module_load_include('inc', 'fedora_repository', 'api/fedora_item'); -module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); -module_load_include('module', 'fedora_repository'); +module_load_include('inc', 'islandora_repository', 'CollectionClass'); +module_load_include('inc', 'islandora_repository', 'api/fedora_item'); +module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); +module_load_include('module', 'islandora_repository'); /** * Exports a fedora collection object and all of its children in a format @@ -68,10 +68,10 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio * @param <type> $query_format R */ function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); global $user; - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return array(); } @@ -111,7 +111,7 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb $content = ''; - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; $content .= do_curl($url); diff --git a/api/fedora_export.inc b/api/fedora_export.inc index e1ed3cbd..bc4fd00f 100644 --- a/api/fedora_export.inc +++ b/api/fedora_export.inc @@ -41,7 +41,7 @@ function export_to_export_area($pid, $foxml_dir, $ob_dir, &$log = array()) { * @return string */ function export_objects_for_pid($pid, $dir, &$log) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $item = new Fedora_Item($pid); if (!$object = $item->get_datastreams_list_as_SimpleXML($pid)) { $log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error'); @@ -85,7 +85,7 @@ function export_objects_for_pid($pid, $dir, &$log) { * @return type */ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $remove_islandora = FALSE) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $ob_helper = new ObjectHelper(); if (!$object_xml = $ob_helper->getObject($pid, 'migrate', $format)) { $log[] = log_line(t("Failed to get foxml for %pid", array('%pid' => $pid)), 'error'); diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 4dacca8c..fdf7074c 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -28,8 +28,8 @@ class Fedora_Item { */ function __construct($pid) { drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); $this->pid = $pid; if (isset(Fedora_Item::$instantiated_pids[$pid])) { @@ -75,7 +75,7 @@ class Fedora_Item { * @return type */ function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); if (!is_file($datastream_file)) { drupal_set_message("$datastream_file not found<br />", 'warning'); return; @@ -285,7 +285,7 @@ class Fedora_Item { * @return Array of pid => title pairs that match the results */ static function find_objects_by_pattern($pattern = '*', $field = 'pid', $max_results = 100, $resultFields = array()) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); $pattern = drupal_urlencode($pattern); $done = FALSE; @@ -848,7 +848,7 @@ class Fedora_Item { */ static function soap_call($function_name, $params_array, $quiet = FALSE) { if (!self::$connection_helper) { - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); self::$connection_helper = new ConnectionHelper(); } switch ($function_name) { diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index c8ce7d0e..91a8f05f 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -158,7 +158,7 @@ function fedora_available() { */ function risearch_available() { - $response = do_curl_ext(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch')); + $response = do_curl_ext(variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch')); return ($response != NULL) ? ($response[1] == 0): FALSE; } @@ -238,13 +238,13 @@ function fix_dsid($dsid) { * @return array */ function get_collections_as_option_array() { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); $query = 'select $object $title from <#ri> where ($object <dc:title> $title and $object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/islandora:collectionCModel> and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query))); $list = explode("\n", $content); @@ -269,8 +269,8 @@ function get_collections_as_option_array() { * @return array */ function get_content_models_as_option_array() { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); $restricted = variable_get('fedora_namespace_restriction_enforced', true); $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); $namespaces = explode(':', $allowed_string); @@ -286,7 +286,7 @@ function get_content_models_as_option_array() { and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query))); $list = explode("\n", $content); diff --git a/islandora_repository.info b/islandora_repository.info new file mode 100644 index 00000000..6fcf223f --- /dev/null +++ b/islandora_repository.info @@ -0,0 +1,9 @@ +; $Id$ +name = Islandora Repository +dependencies[] = imageapi +dependencies[] = tabs +dependencies[] = islandora_content_model_forms +description = Shows a list of items in a fedora collection. +package = Islandora +version = 11.2.beta2 +core = 6.x diff --git a/islandora_repository.install b/islandora_repository.install new file mode 100644 index 00000000..e8e26ad2 --- /dev/null +++ b/islandora_repository.install @@ -0,0 +1,107 @@ +<?php + +/** + * @file islandora_repository.install + */ + +/** + * Implementation of hook_enable(). + */ +function fedora_collections_enable() { + //nothing to do as we do not currently touch the drupal database. + //other than the variables table +} + +/** + * Implementation of hook_requirements(). + * + * @return + * An array describing the status of the site regarding available updates. + * If there is no update data, only one record will be returned, indicating + * that the status of core can't be determined. If data is available, there + * will be two records: one for core, and another for all of contrib + * (assuming there are any contributed modules or themes enabled on the + * site). In addition to the fields expected by hook_requirements ('value', + * 'severity', and optionally 'description'), this array will contain a + * 'reason' attribute, which is an integer constant to indicate why the + * given status is being returned (UPDATE_NOT_SECURE, UPDATE_NOT_CURRENT, or + * UPDATE_UNKNOWN). This is used for generating the appropriate e-mail + * notification messages during update_cron(), and might be useful for other + * modules that invoke update_requirements() to find out if the site is up + * to date or not. + * + * @see _update_message_text() + * @see _update_cron_notify() + */ +function islandora_repository_requirements($phase) { + global $base_url; + + $requirements = array(); + + if ($phase == 'install') { + + // Test for SOAP + $requirements['fedora-soap']['title'] = t("PHP SOAP extension library"); + if (!class_exists('SoapClient')) { + $requirements['fedora-soap']['value'] = t("Not installed"); + $requirements['fedora-soap']['severity'] = REQUIREMENT_ERROR; + $requirements['fedora-soap']['description'] = t('Ensure that the PHP SOAP extension is installed.'); + } + else { + $requirements['fedora-soap']['value'] = t("Installed"); + $requirements['fedora-soap']['severity'] = REQUIREMENT_OK; + } + + // Test for Curl + $requirements['curl']['title'] = "PHP Curl extension library"; + if (!function_exists('curl_init')) { + $requirements['curl']['value'] = t("Not installed"); + $requirements['curl']['severity'] = REQUIREMENT_ERROR; + $requirements['curl']['description'] = t("Ensure that the PHP Curl extension is installed."); + } + else { + $requirements['curl']['value'] = t("Installed"); + $requirements['curl']['severity'] = REQUIREMENT_OK; + } + + // Test for DOM + $requirements['dom']['title'] = "PHP DOM XML extension library"; + if (!method_exists('DOMDocument', 'loadHTML')) { + $requirements['dom']['value'] = t("Not installed"); + $requirements['dom']['severity'] = REQUIREMENT_ERROR; + $requirements['dom']['description'] = t("Ensure that the PHP DOM XML extension is installed."); + } + else { + $requirements['dom']['value'] = t("Installed"); + $requirements['dom']['severity'] = REQUIREMENT_OK; + } + + // Test for XSLT + $requirements['xsl']['title'] = "PHP XSL extension library"; + if (!class_exists('XSLTProcessor')) { + $requirements['xslt']['value'] = t("Not installed"); + $requirements['xslt']['severity'] = REQUIREMENT_ERROR; + $requirements['xslt']['description'] = t("Ensure that the PHP XSL extension is installed."); + } + else { + $requirements['xslt']['value'] = t("Installed"); + $requirements['xslt']['severity'] = REQUIREMENT_OK; + } + } + elseif ($phase == 'runtime') { + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + + $requirements['fedora-repository']['title'] = t("Fedora server"); + if (!fedora_available()) { + $requirements['fedora-repository']['value'] = t("Not available"); + $requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; + $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/islandora_repository')); + } + else { + $requirements['fedora-repository']['value'] = t("Available"); + $requirements['fedora-repository']['severity'] = REQUIREMENT_OK; + } + } + + return $requirements; +} diff --git a/islandora_repository.module b/islandora_repository.module new file mode 100644 index 00000000..6fa13988 --- /dev/null +++ b/islandora_repository.module @@ -0,0 +1,2251 @@ +<?php + +/** + * Drupal hook for admin form + * islandora_repository_name is the name of the top level collection this module will query + * islandora_repository_pid is the name of the top level pid. + * Stores this info in the drupal variables table. + * the name and pid can also be passed as url parameters + */ +function islandora_repository_admin() { + module_load_include('inc', 'islandora_repository', 'formClass'); + $adminForm = new formClass(); + return $adminForm->createAdminForm(); +} + +/** + * drupal hook + * calls the islandora_repositorys_admin form + */ +function islandora_repository_menu() { + module_load_include('inc', 'islandora_repository', 'formClass'); + $adminMenu = new formClass(); + return $adminMenu->createMenu(); +} + +/** + * drupal hook to show help + * + * @param type $path + * @param type $arg + * @return type + */ +function islandora_repository_help($path, $arg) { + switch ($path) { + case 'admin/modules#description' : + return t('Grabs a list of items from a collection in Drupal that are presented on the home page.'); + case 'node/add#islandora_repository' : + return t('Use this page to grab a list of items from a Fedora collection.'); + } +} + +/** + * fedora repository purge object + * @param type $pid + * @param type $name + * @return type + */ +function islandora_repository_purge_object($pid = NULL, $name = NULL) { + if (!user_access('purge objects and datastreams')) { + drupal_set_message(t('You do not have access to add a datastream to this object.'), 'error'); + return ''; + } + if ($pid == NULL) { + drupal_set_message(t('You must specify an object pid to purge an object.'), 'error'); + return ''; + } + $output = t('Are you sure you wish to purge object %name %pid!<br /><b>This cannot be undone</b><br />', + array( + '%name' => $name, + '%pid' => $pid) + ); + + $output .= drupal_get_form('islandora_repository_purge_object_form', $pid); + return $output; +} + +/** + * fedora repository collection view + * @global type $user + * @param type $pid + * @param type $collection + * @param type $pageNumber + * @return type + */ +function islandora_repository_collection_view($pid = NULL, $collection = NULL, $pageNumber = NULL) { + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + global $user; + if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); + return ' '; + } + + $objectHelper = new ObjectHelper(); + if ($pid == NULL) { + $pid = variable_get('islandora_repository_pid', 'islandora:root'); + } + + $content = ''; + + module_load_include('inc', 'islandora_repository', 'CollectionClass'); + $collectionClass = new CollectionClass(); + $results = $collectionClass->getRelatedItems($pid, NULL); + $content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); + + return $content; +} + +/** + * fedora repository ingest object + * @param type $collection_pid + * @param type $collection_label + * @param type $content_model + * @return type + */ +function islandora_repository_ingest_object($collection_pid=NULL, $collection_label = NULL, $content_model = NULL) { + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + if (!user_access('ingest new fedora objects')) { + drupal_set_message(t('You do not have permission to ingest.'), 'error'); + return ''; + } + + if (!valid_pid($collection_pid)) { + if (valid_pid(urldecode($collection_pid))) { + $collection_pid = urldecode($collection_pid); + } + else { + drupal_set_message(t("This collection PID $collection_pid is not valid"), 'error'); + return ' '; + } + } + + if ($collection_pid == NULL) { + drupal_set_message(t('You must specify a collection object pid to ingest an object.'), 'error'); + return ''; + } + $output = drupal_get_form('islandora_repository_ingest_form', $collection_pid, $collection_label, $content_model); + + $breadcrumbs = array(); + $objectHelper = new ObjectHelper(); + $objectHelper->getBreadcrumbs($collection_pid, $breadcrumbs); + drupal_set_breadcrumb(array_reverse($breadcrumbs)); + + return $output; +} + +/** + * fedora repository ingest form submit + * @global type $base_url + * @global type $user + * @param array $form + * @param array $form_state + */ +function islandora_repository_ingest_form_submit(array $form, array &$form_state) { +//only validate the form if the submit button was pressed (other buttons may be used for AHAH + if ($form_state['storage']['xml']) { + if (module_exists('islandora_content_model_forms')) { + module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); + $xml_form = new IngestObjectMetadataForm(); + $xml_form->submit($form, $form_state); + } + } + else if ($form_state['clicked_button']['#id'] == 'edit-submit') { + global $base_url; + module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); + + $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); + $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); + $err = TRUE; + $redirect = TRUE; + if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['collection_pid'])) !== FALSE) { + $relationship = $cp->getRelationship(); + + if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + $pid = $cp->getNextPid($contentModelDsid); + global $user; + $form_state['values']['user_id'] = $user->name; + $form_state['values']['pid'] = $pid; + $form_state['values']['content_model_pid'] = $contentModelPid; + $form_state['values']['relationship'] = $relationship; + + $err = (!$cm->execFormHandler($form_state['values'], $form_state)); + + $_SESSION['fedora_ingest_files'] = ''; //empty this variable + + $attr = $cm->getIngestFormAttributes(); + $redirect = $attr['redirect']; + + if ($redirect) { + $form_state['storage'] = NULL; + } + } + } + + if ($redirect) { + $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; + } + } +} + +/** + * fedora repository ingest form validate + * @param type $form + * @param type $form_state + * @return type + */ +function islandora_repository_ingest_form_validate($form, &$form_state) { +//only validate the form if the submit button was pressed (other buttons may be used for AHAH + if ($form_state['clicked_button']['#id'] == 'edit-submit') { + switch ($form_state['storage']['step']) { + case 1: + $form_state['storage']['step']++; + $form_state['rebuild'] = TRUE; + break; + + case 2: +// XML based form. + if ($form_state['storage']['xml']) { + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + $xml_form->validate($form, $form_state); + } +// Get the uploaded file. + $validators = array(); + + if (!empty($_FILES['files']['name']['ingest-file-location'])) { + $fileObject = file_save_upload('ingest-file-location', $validators); + + file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); + $form_state['values']['ingest-file-location'] = $fileObject->filepath; + } + + if (isset($form_state['values']['ingest-file-location']) && file_exists($form_state['values']['ingest-file-location'])) { + module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); + + $file = $form_state['values']['ingest-file-location']; + + $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); + $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); + + if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { + $allowedMimeTypes = $cm->getMimetypes(); + + $mimetype = new MimeClass(); + $dformat = $mimetype->getType($file); + + if (!empty($file)) { + if (!in_array($dformat, $allowedMimeTypes)) { + form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . + implode(' ', $allowedMimeTypes))); + file_delete($file); + return; + } + elseif (!$cm->execIngestRules($file, $dformat)) { + drupal_set_message(t('Error following Content Model Rules'), 'error'); + foreach (ContentModel::$errors as $err) { + drupal_set_message($err, 'error'); + } + } + } + } + } + $form_state['rebuild'] = FALSE; + break; + } + } +} + +/** + * fedora repository ingest form + * @param type $form_state + * @param type $collection_pid + * @param type $collection_label + * @param type $content_model + * @return type + */ +function islandora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) { + module_load_include('inc', 'islandora_repository', 'formClass'); +// 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; + } + $ingestForm = new formClass(); + $form_state['storage']['content_model'] = $content_model; + $form_state['storage']['collection_pid'] = $collection_pid; + return $ingestForm->createIngestForm($collection_pid, $collection_label, $form_state); +} + +/** + * fedora repository purge object form + * @global type $base_url + * @param type $form_state + * @param type $pid + * @param type $referrer + * @return type + */ +function islandora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { + global $base_url; + if (!user_access('purge objects and datastreams')) { + return NULL; + } + if ($pid == NULL) { + return NULL; + } + $form['pid'] = array( + '#type' => 'hidden', + '#value' => "$pid" + ); + if (!strstr(drupal_get_destination(), urlencode('fedora/repository'))) { + $form['referrer'] = array( + '#type' => 'hidden', + '#value' => $referrer, + ); + } + if (!isset($form_state['storage']['confirm'])) { +// do your normal $form definition here + + + $form['submit'] = array( + '#type' => 'image_button', + '#src' => drupal_get_path('module', 'islandora_repository') . '/images/purge_big.png', + '#value' => t('Purge'), + '#suffix' => 'Purge this object', + ); + if (!empty($collectionPid)) { + $collectionPid = $_SESSION['fedora_collection']; + } +//$form['#redirect'] = $referrer; + + return $form; + } + else { +// ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form + + return confirm_form($form, 'Confirm Purge Object', $referrer, 'Are you sure you want to delete this object? This action cannot be undone.', 'Delete', 'Cancel'); //Had better luck leaving off last param 'name' + } + return $form; +} + +/** + * add stream + * @param type $collection_pid + * @param type $collectionName + * @return type + */ +function add_stream($collection_pid=NULL, $collectionName=NULL) { + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + if (!valid_pid($collection_pid)) { + drupal_set_message(t("This PID is not valid!"), 'error'); + return ' '; + } + if (!user_access('ingest new fedora objects')) { + drupal_set_message(t('You do not have permission to ingest.'), 'error'); + return ''; + } + if ($collection_pid == NULL) { + drupal_set_message(t('You must specify an collection object pid to ingest an object.'), 'error'); + return ''; + } + $output .= drupal_get_form('islandora_repository_add_stream_form', $pid); + + return $output; +} + +/** + * add stream form submit + * @global type $base_url + * @param type $form + * @param type $form_state + * @return type + */ +function add_stream_form_submit($form, &$form_state) { + global $base_url; + if (!empty($form_state['submit']) && $form_state['submit'] == 'OK') { + $form_state['rebuild'] = TRUE; + return; + } + module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + $pathToModule = drupal_get_path('module', 'islandora_repository'); + + $file = $form_state['values']['add-stream-file-location']; + + $pid = $form_state['values']['pid']; + $dsid = $form_state['values']['stream_id']; + $dsLabel = $form_state['values']['stream_label'] . substr($file, strrpos($file, '.')); // Add the file extention to the end of the label.; + $file_basename = basename($file); + $file_directory = dirname($file); + $streamUrl = $base_url . '/' . $file_directory . '/' . drupal_urlencode($file_basename); + + /* ----------------------------------------------------------------- + * need a better way to get mimetypes + */ + $mimetype = new MimeClass(); + $dformat = $mimetype->getType($file); + $controlGroup = "M"; + if ($dformat == 'text/xml') { + $controlGroup = 'X'; + } + try { + $item = new Fedora_Item($pid); + $item->add_datastream_from_url($streamUrl, $dsid, $dsLabel, $dformat, $controlGroup); + + $object_helper = new ObjectHelper(); + $object_helper->get_and_do_datastream_rules($pid, $dsid, $file); + + file_delete($file); + } catch (exception $e) { + drupal_set_message(t($e->getMessage()), 'error'); + return; + } + $form_state['rebuild'] = TRUE; +} + +/** + * add stream form + * @param type $form_state + * @param type $pid + * @return type + */ +function add_stream_form(&$form_state, $pid) { + module_load_include('inc', 'islandora_repository', 'formClass'); + $addDataStreamForm = new formClass(); + return $addDataStreamForm->createAddDataStreamForm($pid, $form_state); +} + +/** + * add stream form validate + * @param type $form + * @param type $form_state + * @return type + */ +function add_stream_form_validate($form, &$form_state) { + if ($form_state['clicked_button']['#value'] == 'OK') { + $form_state['rebuild'] = TRUE; + return; + } + $dsid = $form_state['values']['stream_id']; + $dsLabel = $form_state['values']['stream_label']; + if (strlen($dsid) > 64) { + form_set_error('', t('Data stream ID cannot be more than 64 characters.')); + return FALSE; + } + if (!(preg_match("/^[a-zA-Z]/", $dsid))) { + form_set_error('', t("Data stream ID ($dsid) has to start with a letter.")); + return FALSE; + } + if (strlen($dsLabel) > 64) { + form_set_error('', t('Data stream Label cannot be more than 64 characters.')); + return FALSE; + } + if (strpos($dsLabel, '/')) { + form_set_error('', t('Data stream Label cannot contain a "/".')); + return FALSE; + } + $validators = array( + // 'file_validate_is_image' => array(), + // 'file_validate_image_resolution' => array('85x85'), + // 'file_validate_size' => array(30 * 1024), + ); + + $fileObject = file_save_upload('add-stream-file-location', $validators); + +// Move the uploaded file to Drupal's files directory. + file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); + $form_state['values']['add-stream-file-location'] = $fileObject->filepath; +// TODO: Add error checking here. + $form_state['rebuild'] = FALSE; +} + +/** + * fedora repository purge stream + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $name + * @return type + */ +function islandora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) { + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + global $user; + if ($pid == NULL || $dsId == NULL) { + drupal_set_message(t('You must specify an object pid and DataStream ID to purge a datastream'), 'error'); + return ' '; + } + if (!islandora_repository_access(OBJECTHELPER :: $PURGE_FEDORA_OBJECTSANDSTREAMS, $pid, $user)) { + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to purge objects."), 'error'); + return ' '; + } + + $output = t('Are you sure you wish to purge this datastream %name<br />', + array( + '%name' => $name) + ); + $output .= drupal_get_form('islandora_repository_purge_stream_form', $pid, $dsId); + return $output; +} + +/** + * fedora repository purge object form submit + * @param type $form + * @param type $form_state + * @return type + */ +function islandora_repository_purge_object_form_submit($form, &$form_state) { + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + $pid = $form_state['values']['pid']; + if (!isset($form_state['storage']['confirm'])) { + $form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form + $form_state['rebuild'] = TRUE; // along with this + } + else { +// this is where you do your processing after they have pressed the confirm button + $params = array( + "pid" => $pid, + "logMessage" => "Purged", + "force" => "" + ); + try { + $soapHelper = new ConnectionHelper(); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $object = $client->__soapCall('purgeObject', array($params)); + unset($form_state['storage']['confirm']); + } catch (exception $e) { + if (preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage())) { + drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error'); + } + else { + drupal_set_message(t($e->getMessage()), 'error'); + } + return; + } + if (!empty($form_state['values']['referrer'])) { + $form_state['redirect'] = $form_state['values']['referrer']; + } + elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { + $collectionPid = $_SESSION['fedora_collection']; + + $form_state['redirect'] = "fedora/repository/$collectionPid/"; + } + else { + $form_state['redirect'] = 'fedora/repository/'; + } + } +} + +/** + * fedora repository purge stream form + * @param type $form_state + * @param type $pid + * @param type $dsId + * @return type + */ +function islandora_repository_purge_stream_form(&$form_state, $pid, $dsId) { + $form['pid'] = array( + '#type' => 'hidden', + '#value' => "$pid" + ); + $form['dsid'] = array( + '#type' => 'hidden', + '#value' => "$dsId" + ); + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Purge') + ); + + return $form; +} + +/** + * fedora repository purge stream form submit + * @global type $base_url + * @param type $form + * @param array $form_state + */ +function islandora_repository_purge_stream_form_submit($form, &$form_state) { + global $base_url; + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $pid = $form_state['values']['pid']; + $item = new Fedora_Item($pid); + $dsid = $form_state['values']['dsid']; + try { + $item->purge_datastream($dsid); + } catch (exception $e) { + drupal_set_message(t($e->getMessage()), 'error'); + } + $form_state['redirect'] = $base_url . "/fedora/repository/$pid"; +} + +/** + * fedora repository replace stream + * @param type $pid + * @param type $dsId + * @param type $dsLabel + * @param type $collectionName + * @return type + */ +function islandora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { + if ($pid == NULL || $dsId == NULL) { + drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error'); + return ''; + } + $output = drupal_get_form('islandora_repository_replace_stream_form', $pid, $dsId, $dsLabel); + + return $output; +} + +/** + * fedora repository replace stream form + * @param type $form_state + * @param type $pid + * @param type $dsId + * @param type $dsLabel + * @return type + */ +function islandora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { +//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'islandora_repository', ''); + module_load_include('inc', 'Fedora_Repository', 'formClass'); +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $replaceDataStreamForm = new formClass(); + return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state); +} + +/** + * fedora repository replace stream form validate + * @param type $form + * @param type $form_state + * @return type + */ +function islandora_repository_replace_stream_form_validate($form, &$form_state) { +// If a file was uploaded, process it. + if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name']['file'])) { + +// attempt to save the uploaded file + $file = file_save_upload('file', array(), file_directory_path()); + +// set error is file was not uploaded + if (!$file) { + form_set_error('file', 'Error uploading file.'); + return; + } + + $doc = new DOMDocument(); + module_load_include('inc', 'Fedora_Repository', 'MimeClass'); + $mime = new MimeClass(); + if ($mime->getType($file->filepath) == 'text/xml' && !$doc->load($file->filepath)) { + form_set_error('file', 'Invalid XML format.'); + return; + } + +// set files to form_state, to process when form is submitted + $form_state['values']['file'] = $file; + } +} + +/** + * fedora repository replace stream form submit + * @global type $base_url + * @param type $form + * @param array $form_state + */ +function islandora_repository_replace_stream_form_submit($form, &$form_state) { + global $base_url; + $file = $form_state['values']['file']; + $pid = $form_state['values']['pid']; + $dsid = $form_state['values']['dsId']; + $dsLabel = $form_state['values']['dsLabel']; + // Remove the original file extension from the label and add the new one + $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot + if ($indexOfDot !== FALSE) { + $dsLabel = substr($dsLabel, 0, $indexOfDot); + $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; + } + module_load_include('inc', 'Fedora_Repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + + $file_basename = basename($file->filepath); + $file_directory = dirname($file->filepath); + $streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename); + + /* ----------------------------------------------------------------- + * TODO: need a better way to get mimetypes + */ + $mimetype = new MimeClass(); + $dformat = $mimetype->getType($file->filepath); + + $item = new Fedora_Item($pid); + + $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); + + $form_state['redirect'] = 'fedora/repository/' . $pid; +} + +/** + * fedora repository edit qdc page + * @global type $user + * @param type $pid + * @param type $dsId + * @return type + */ +function islandora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + global $user; + if ($pid == NULL || $dsId == NULL) { + drupal_set_message(t('You must specify an object pid and a Dublin Core DataStream ID to edit metadata'), 'error'); + return ' '; + } + if (!islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); + return ' '; + } + $output = drupal_get_form('islandora_repository_edit_qdc_form', $pid, $dsId); + + return $output; +} + +/** + * fedora repository edit qdc form + * @global type $user + * @param type $form_state + * @param type $pid + * @param type $dsId + * @return type + */ +function islandora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { + module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + if ($pid == NULL) { + drupal_set_message(t('You must specify an object pid!'), 'error'); + } + global $user; + if (!islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); + return ' '; + } + + module_load_include('inc', 'islandora_repository', 'formClass'); + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + $soapHelper = new ConnectionHelper(); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); +// Check if there is a custom edit metadata function defined in the content model. + + $breadcrumbs = array(); + $objectHelper = new ObjectHelper(); + $objectHelper->getBreadcrumbs($pid, $breadcrumbs); + drupal_set_breadcrumb(array_reverse($breadcrumbs)); + + + $output = ''; + if (($cm = ContentModel::loadFromObject($pid)) !== FALSE) { + $output = $cm->buildEditMetadataForm($pid, $dsId); + } + + if (empty($output)) { +// There is no custom function, so just load the standard QDC form. + $metaDataForm = new formClass(); +//currently we only edit the dc metadata. If you defined a custom form with a custom handler you are sol for now. + return $metaDataForm->createMetaDataForm($pid, $dsId, $client, $form_state); + } + return $output; +} + +/** + * fedora repository edit qdc form validate + * @param type $form + * @param boolean $form_state + */ +function islandora_repository_edit_qdc_form_validate($form, &$form_state) { + if ($form_state['storage']['xml']) { + if ($form_state['storage']['step'] == 1) { + $form_state['storage']['step']++; + $form_state['rebuild'] = TRUE; + } + module_load_include('inc', 'xml_form_api', 'XMLForm'); + $xml_form = new XMLForm($form_state); + $xml_form->validate($form, $form_state); + } +} + +/** + * Check if there is a custom edit metadata function defined in the content model. If so, + * call it, if not do the submit action for the standard QDC metadata. Custom forms will + * need to implement their own equivalent to the FormClass->updateMetaData function + * + * @param array $form + * @param array $form_state + * @return + */ +function islandora_repository_edit_qdc_form_submit($form, &$form_state) { + if ($form_state['storage']['xml']) { + module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); + $xml_form = new EditObjectMetadataForm($form_state); + $xml_form->submit($form, $form_state); + } + else { + module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + global $base_url; + if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { + +//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $soap_helper = new ConnectionHelper(); + $client = $soap_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + +// Check the content model for a custom edit metadata form submit function. + if (isset($form_state['values']['pid'])) { + module_load_include('inc', 'islandora_repository', 'ContentModel'); + if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { + return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client); + } + } + + module_load_include('inc', 'islandora_repository', 'formClass'); + $metaDataForm = new formClass(); + $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); + $form_state['storage'] = NULL; + $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; + + return $return_value; + } + } +} + +/** + * drupal hook + * creates a new permission than can be assigned to roles + */ +function islandora_repository_perm() { + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + return array( + OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, + OBJECTHELPER::$EDIT_FEDORA_METADATA, + OBJECTHELPER::$PURGE_FEDORA_OBJECTSANDSTREAMS, + OBJECTHELPER::$ADD_FEDORA_STREAMS, + OBJECTHELPER::$INGEST_FEDORA_OBJECTS, + OBJECTHELPER::$EDIT_TAGS_DATASTREAM, + OBJECTHELPER::$VIEW_DETAILED_CONTENT_LIST, + OBJECTHELPER::$MANAGE_COLLECTIONS, + OBJECTHELPER::$DELETE_ENTIRE_COLLECTIONS, + OBJECTHELPER::$CREATE_BATCH_PROCESS, + ); +} + +/** + * drupal hook + * determines if a user has access to what they are asking for + * + * @param type $op + * @param type $node + * @param type $account + * @return type + */ +function islandora_repository_access($op, $node, $account) { + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + $objectHelper = new ObjectHelper(); + return $objectHelper->islandora_repository_access($op, $node, $account); +} + +/** + * Grabs a stream from fedora sets the mimetype and returns it. $dsID is the + * datastream id. + * @param $pid String + * @param $dsID String + */ +function makeObject($pid, $dsID) { + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + if (!valid_pid($pid)) { + drupal_set_message(t("Invalid PID!"), 'error'); + return ' '; + } + + if (!valid_dsid($dsID)) { + drupal_set_message(t("Invalid dsID!"), 'error'); + return ' '; + } + + if ($pid == NULL || $dsID == NULL) { + drupal_set_message(t("No pid or dsid given to create an object with.")); + return ' '; + } + global $user; + if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + drupal_access_denied(); + return; + drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace."), 'error'); + return ' '; + } + + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + $objectHelper = new ObjectHelper(); + $objectHelper->makeObject($pid, $dsID); +} + +/** + * Sends an ITQL query to the Fedora Resource index (can only communicate with Kowari or mulgara) + * Reads the pid and datastream id as url parameters. Queries the collection object for the query + * if there is no query datastream falls back to the query shipped with the module. + * + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $collection + * @param type $page_number + * @param type $limit + * @return type + */ +function islandora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $page_number = NULL, $limit = NULL) { + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + global $user; + + if (!fedora_available()) { + drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); + return ''; + } + + if (!risearch_available()) { + drupal_set_message(t('The Fedora resource index search is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); + return ''; + } + + if ($pid == NULL) { + $pid = variable_get('islandora_repository_pid', 'islandora:root'); + } + + $item = new fedora_item($pid); + if (!$item->exists()) { + drupal_not_found(); + exit(); + } + + if ($pid & !valid_pid($pid)) { + drupal_set_message(t("Invalid PID!"), 'error'); + return ' '; + } + + if ($dsId & !valid_dsid($dsId)) { + drupal_set_message(t("Invalid dsID!"), 'error'); + return ' '; + } + if (!islandora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (user_access('access administration pages')) { + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/islandora_repository'))), 'warning'); + } + drupal_access_denied(); + exit; + return ' '; + } + + $objectHelper = new ObjectHelper(); + if ($pid == NULL) { + $pid = variable_get('islandora_repository_pid', 'islandora:root'); + } + $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); + if (in_array(-1, $headers)) { + drupal_access_denied(); + exit; + return ' '; + } + if ($dsId != NULL && $dsId != '-') { //if we have a dsID return the stream otherwise query for a collection of objects +//probably should check pid as well here. + return makeObject($pid, $dsId); + } + + $content = '<div id="content-fedora">'; + + module_load_include('inc', 'islandora_repository', 'CollectionClass'); + $collectionClass = new CollectionClass(); + module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'plugins/FedoraObjectDetailedContent'); + $breadcrumbs = array(); + $objectHelper->getBreadcrumbs($pid, $breadcrumbs); + drupal_set_breadcrumb(array_reverse($breadcrumbs)); + + $offset = $limit * $page_number; + $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_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 FedoraObjectDetailedContent($pid); + $object_details = $obj->showFieldSets(); + if ($object_details['fedora_object_details']['#selected'] == true){ + foreach($cmodels_tabs as $cmodel_tab){ + if (is_array($cmodel_tab)){ + $cmodel_tab['#selected'] = FALSE; + } + + } + } + $cmodels_tabs = array_merge($cmodels_tabs, $object_details); + + + return tabs_render($cmodels_tabs); +} + +/** + * fedora repository urlencode string + * @param type $str + * @return type + */ +function islandora_repository_urlencode_string($str) { + return htmlentities($str); +} + +/** + * Uses makeobject to get a stream. Sets the Content Disposition in the header so it suggests a filename + * and sends it as an attachment. This should prompt for a download of the object. + * + * @global type $user + * @param type $pid + * @param type $dsId + * @param type $label + * @param type $version + * @return type + */ +function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { + global $user; + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + + if ($pid == NULL || $dsId == NULL) { + drupal_set_message(t("no pid or dsid given to create an object with!")); + return ' '; + } + + $objectHelper = new ObjectHelper(); + $objectHelper->makeObject($pid, $dsId, 1, $label, FALSE, $version); +} + +/** + * repository page + * @param type $pid + * @param type $dsId + * @param type $collection + * @param type $pageNumber + * @return type + */ +function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNumber = NULL) { +//do security check at islandora_repository_get_items function as it has to be called there in case +//someone trys to come in a back door. + return islandora_repository_get_items($pid, $dsId, $collection, $pageNumber); +} + +/** + * repository service + * @global type $user + * @param type $pid + * @param type $servicePid + * @param type $serviceMethod + * @return type + */ +function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NULL) { + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + global $user; + + if (!islandora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { +//drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); + drupal_access_denied(); + if (user_access('access administration pages')) { + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/islandora_repository'))), 'error'); + } + return ' '; + } + if ($pid == NULL) { + $pid = variable_get('islandora_repository_pid', 'islandora:root'); + } + $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); + if (in_array(-1, $headers)) { + drupal_access_denied(); + exit; + return ' '; + } + + + $item = new Fedora_Item($pid); + if ($item !== FALSE) { + echo $item->get_dissemination($servicePid, $serviceMethod); + } + + exit(); +} + +//Search Stuff ******************************************************************** + +/** + * Implementation of hook_search(). + * sends a search query to fedora fgsearch which is backed by Lucene + * In our implementation of Fedora we have api-a and api-m locked down + * to authorized users but at the object level. We can query Lucene and the + * RI index to get a list of results without authorization but to view any + * datastreams users must be authorized. + * + * @param type $op + * @param type $keys + * @return array + */ +function islandora_repository_search($op = 'search', $keys = NULL) { + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + + switch ($op) { + case 'name': + if (user_access('view fedora collection')) { + return t('Digital Repository', array('-9')); + } + case 'search': + if (user_access('view fedora collection')) { +//demo search string ?operation=gfindObjects&indexName=DemoOnLucene&query=fgs.DS.first.text%3Achristmas&hitPageStart=11&hitPageSize=10 + $resultData = NULL; + $numberOfHitsPerPage = NULL; + $index = strpos($keys, '.'); + $test = substr($keys, 0, $index + 1); + $type = NULL; + if ($index > 0) { + $index = strpos($keys, ':'); + $type = substr($keys, 0, $index); + $keys = substr($keys, $index + 1); + } + + $index = strpos($keys, ':'); + $startPage = substr($keys, 0, $index); + if ($index > 1) { + $keys = substr($keys, $index + 1); + } + + if (!$startPage) { + $startPage = 1; + } + + $xmlDoc = NULL; + + $path = drupal_get_path('module', 'islandora_repository'); + $xmlDoc = new DomDocument(); + $xmlDoc->load($path . '/searchTerms.xml'); + $nodeList = $xmlDoc->getElementsByTagName('default'); + if (!$type) { +//$type = 'dc.description'; + $type = $nodeList->item(0)->nodeValue; + } + $nodeList = $xmlDoc->getElementsByTagName('number_of_results'); + $numberOfHitsPerPage = $nodeList->item(0)->nodeValue; + + $indexName = variable_get('fedora_index_name', 'DemoOnLucene'); + $keys = htmlentities(urlencode($keys)); + $searchQuery = NULL; + if (isset($type) && strcmp($type, ':')) { + $searchQuery = $type . ':' . $keys; + } + else { + $searchQuery = $keys; + } +//$searchQuery.=" AND (PID:vre OR PID:vre:ref OR PID:demo OR PID:changeme)"; + + $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); + $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=copyXml&query=' . $searchQuery; + $searchString .= '&hitPageSize=' . $numberOfHitsPerPage . '&hitPageStart=' . $startPage; +//$searchString = htmlentities(urlencode($searchString)); + $searchUrl .= $searchString; + $objectHelper = new ObjectHelper(); + $resultData = do_curl($searchUrl); + + $results[] = array( + array( + 'data' => $resultData, + 'colspan' => 2 + ) + ); + return $results; + } + } // switch ($op) +} + +/** + * Implementation of hook_search_page(). + * Display the search results + * + * @param type $resultData + * @return array + */ +function islandora_repository_search_page($resultData) { + $path = drupal_get_path('module', 'islandora_repository'); + $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); + $proc = NULL; + if (!$resultData[0][0]['data']) { + return ''; //no results + } + $text = utf8_encode($resultData[0][0]['data']); + + try { + $proc = new XsltProcessor(); + } catch (Exception $e) { + $out[] = array( + array( + 'data' => $e->getMessage(), + 'colspan' => 2 + ) + ); + return $out; + } + +//inject into xsl stylesheet + $proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on + $proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl + $proc->setParameter('', 'objectsPage', base_path()); + $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); + $proc->registerPHPFunctions(); + $xsl = new DomDocument(); + if ($isRestricted) { + $xsl->load($path . '/xsl/results.xsl'); + } + else { + $xsl->load($path . '/xsl/unfilteredresults.xsl'); + } + + $input = new DomDocument(); + $didLoadOk = $input->loadXML(utf8_encode($resultData[0][0]['data'])); + + if (!$didLoadOk) { + $results[] = array( + array( + 'data' => 'Error parsing results', + 'colspan' => 2 + ) + ); + } + else { + $xsl = $proc->importStylesheet($xsl); + $newdom = $proc->transformToDoc($input); + + $results[] = array( + array( + 'data' => $newdom->saveHTML(), + 'colspan' => 2 + ) + ); + } + + $header = array( + array( + 'data' => t('Collection results'), + NULL, + ), + (NULL) + ); + + $output .= theme('table', $header, $results); + return $output; +} + +/** + * Implementation of hook_form_alter(). + * allows the advanced search form in drupal + * + * @param type $form + * @param type $form_state + * @param type $form_id + */ +function islandora_repository_form_alter(&$form, &$form_state, $form_id) { +// Advanced node search form + module_load_include('inc', 'islandora_repository', 'SearchClass'); + $path = drupal_get_path('module', 'islandora_repository'); + if ($form_id == 'search_form' && arg(1) == 'islandora_repository' && user_access('use advanced search')) { + $default_value = $form['basic']['inline']['keys']['#default_value']; + $index = strpos($default_value, '.'); + $test = substr($default_value, 0, $index + 1); + $type = NULL; + if ($index > 0) { + $index = strpos($default_value, ':'); + $type = substr($default_value, 0, $index); + $default_value = substr($default_value, $index + 1); + } + $form['basic']['inline']['keys']['#default_value'] = $default_value; +// Keyword boxes: + $form['advanced'] = array( + '#type' => 'fieldset', + '#title' => t('Advanced search'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#attributes' => array( + 'class' => 'search-advanced' + ), + ); + $form['advanced']['keywords'] = array( + '#prefix' => '<div class="criterion">', + '#suffix' => '</div>', + ); + $xmlDoc = new DomDocument(); + $xmlDoc->load($path . '/searchTerms.xml'); + $nodeList = $xmlDoc->getElementsByTagName('term'); + $searchClass = new SearchClass(); + $types = $searchClass->get_search_terms_array(); + + $form['advanced']['type'] = array( + '#type' => 'select', + '#title' => t('Choose a field to search'), + '#prefix' => '<div class="criterion">', '#suffix' => '</div>', '#options' => $types, + '#default_value' => $type, + ); + $form['advanced']['submit'] = array( + '#type' => 'submit', + '#value' => t('Advanced search'), + '#prefix' => '<div class="action clear-block">', '#suffix' => '</div>', + ); + $form['#validate'][] = 'islandora_repository_search_validate'; + } +} + +/** + * Implementation of hook_search_validate() + * + * @param type $form + * @param type $form_state + */ +function islandora_repository_search_validate($form, &$form_state) { +// Initialise using any existing basic search keywords. + $keys = $form_state['values']['processed_keys']; + + if (isset($form_state['values']['type'])) { + $type = $form_state['values']['type']; + if ($type) { + $keys = $type . ':' . $keys; + } + } + + if (!empty($keys)) { + form_set_value($form['basic']['inline']['processed_keys'], trim($keys), $form_state); //set the form string + } +} + +/** + * fedora repository theme + * @return type + */ +function islandora_repository_theme() { + return array( + 'islandora_repository_mnpl_advanced_search_form' => array( + 'arguments' => array( + 'form' => NULL, + ), + ), + 'islandora_repository_time' => array( + 'arguments' => array( + 'element' => NULL + ), + 'islandora_repository_solution_packs_list' => array( + 'arguments' => array( + 'solution_packs' => NULL, + ), + ), + ), + ); +} + +/** + * Get a list of terms from a lucene index + * + * @param type $field + * @param type $startTerm + * @param type $displayName + * @return type + */ +function islandora_repository_list_terms($field, $startTerm = NULL, $displayName = NULL) { + module_load_include('inc', 'islandora_repository', 'SearchClass'); + $searchClass = new SearchClass(); + return $searchClass->getTerms($field, $startTerm, $displayName); +} + +/** + * fedora repository mnpl advanced search form + * @return type + */ +function islandora_repository_mnpl_advanced_search_form() { + module_load_include('inc', 'islandora_repository', 'SearchClass'); + $searchClass = new SearchClass(); + return $searchClass->build_advanced_search_form(); +} + +/** + * theme fedora repository mnpl advanced search form + * @param type $form + * @return type + */ +function theme_islandora_repository_mnpl_advanced_search_form($form) { + module_load_include('inc', 'islandora_repository', 'SearchClass'); + $advanced_search_form = new SearchClass(); + return $advanced_search_form->theme_advanced_search_form($form); +} + +/** + * fedora repository mnpl advanced search + * @param type $query + * @param type $startPage + * @return type + */ +function islandora_repository_mnpl_advanced_search($query, $startPage = 1) { + module_load_include('inc', 'islandora_repository', 'SearchClass'); + $searchClass = new SearchClass(); + $retVal = $searchClass->custom_search($query, $startPage); + return $searchClass->custom_search($query, $startPage); +} + +/** + * fedora repository mnpl_advanced search form submit + * @param type $form + * @param type $form_state + */ +function islandora_repository_mnpl_advanced_search_form_submit($form, &$form_state) { + $type_id = $form_state['values']['type']; + $repeat = variable_get('islandora_repository_advanced_block_repeat', t('3')); + $searchString = $form_state['values']['type1'] . ':' . $form_state['values']['fedora_terms1']; + if ($form_state['values']['fedora_terms2'] != '') { + $searchString .=' +' . $form_state['values']['andor1'] . '+' . $form_state['values']['type2'] . ':' . $form_state['values']['fedora_terms2']; + } + if ($repeat > 2 && $repeat < 9) { + for ($i = 3; $i < $repeat + 1; $i++) { + $t = $i - 1; + if ($form_state['values']["fedora_terms$i"] != '') { + $searchString .= '+' . $form_state['values']["andor$t"] . '+' . $form_state['values']["type$i"] . ':' . $form_state['values']["fedora_terms$i"]; + } + } + } + drupal_goto("fedora/repository/mnpl_advanced_search/$searchString"); +} + +/** + * fedora repository install demo page + * @return type + */ +function islandora_repository_install_demos_page() { + $output = drupal_get_form('islandora_repository_demo_objects_form'); + return $output; +} + +/** + * fedora repository demo objects form + * @return string + */ +function islandora_repository_demo_objects_form() { + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + $form = array(); + $existing_demos = array(); + + $form['install_demos'] = array( + '#title' => t('Islandora Demo Collections'), + '#type' => 'fieldset', + '#description' => t('Install demo image and document collections and content models.'), + ); + $demo_objects = array(); +// Check if the top-level islandora collection exists. If not, display a button to ingest. + + $form['install_demos']['demo_collections'] = array( + '#type' => 'checkboxes', + '#title' => t('Collections to ingest'), + '#options' => array(), + '#description' => t('Choose which demo collections you would like ingested into the repository.'), + ); + + foreach (array( + 'islandora:collectionCModel' => 'Islandora default content models', + 'islandora:root' => 'Islandora top-level collection', + 'islandora:demos' => 'Islandora demos collection', + 'islandora:largeimages' => 'Sample large image content model (requires <a href="http://sourceforge.net/projects/djatoka/">Djatoka</a> and <a href="http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22">Kakadu</a>.)', + ) + as $available_demo => $available_demo_desc) { + try { + $demo_objects[$available_demo] = new Fedora_Item($available_demo); + } catch (exception $e) { + + } + + if (empty($demo_objects[$available_demo]->objectProfile)) { +//The demo objects collection does not exist in the repository, display a button to ingest them. + $form['install_demos']['demo_collections']['#options'][$available_demo] = $available_demo_desc; + } + else { + array_push($existing_demos, $demo_objects[$available_demo]); + } + } + +// Check if the SmileyStuff collectoin exists, and if it has a COLLECTION_VIEW datastream. If it doesn't then we can add it. + + $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); + if (!empty($smiley_stuff->objectProfile)) { + $datastreams_list = $smiley_stuff->get_datastreams_list_as_array(); + if (empty($datastreams_list['COLLECTION_VIEW'])) { + $form['install_demos']['demo_collections']['#options']['demo:SmileyStuff'] = 'Add Islandora Collection View to Fedora Smiley Stuff Collection'; + } + else { + $demo_objects['demo:SmileyStuff'] = $smiley_stuff; + } + } + else { + $form['install_demos']['smileynote'] = array( + '#value' => '<p>If you install the ' . l('fedora demo objects', 'https://wiki.duraspace.org/display/FCR30/Demonstration+Objects') . ' Islandora can display them as a collection.</p>' + ); + } + + $form['install_demos']['ingest'] = array( + '#type' => 'submit', + '#name' => 'install_demos', + '#value' => 'Install Selected Demos', + '#disabled' => (empty($form['install_demos']['demo_collections']['#options'])) ? TRUE : FALSE, + ); + + $form['existing_demos'] = array( + '#prefix' => '<p>Demo collections already installed in this repository:</p><ul>', + '#suffix' => '</ul>', + ); + + if (!empty($existing_demos)) { + foreach ($existing_demos as $pid => $demo_object) { + + $form['existing_demos'][$demo_object->pid] = array( + '#prefix' => '<li>', + '#value' => l($demo_object->pid, $demo_object->url()), + '#suffix' => '</li>', + ); + } + } + + return $form; +} + +/** + * fedora repository demo objects form submit + * @global type $base_url + * @param type $form + * @param type $form_state + */ +function islandora_repository_demo_objects_form_submit($form, &$form_state) { + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/dublin_core'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + global $base_url; + if ($form_state['clicked_button']['#name'] == 'install_demos') { + if (!empty($form_state['values']['demo_collections']['islandora:collectionCModel'])) { + try { + $collectioncm = Fedora_Item::ingest_new_item('islandora:collectionCModel', 'A', 'Islandora Collection Content Model'); + $collectioncm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); + $collectioncm->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); + } catch (exception $e) { + + } + try { + $strictpdfcm = Fedora_Item::ingest_new_item('islandora:strict_pdf', 'A', 'Strict PDF Content Model'); + $strictpdfcm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); + $strictpdfcm->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/content_models/STRICT_PDFCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); + } catch (exception $e) { + + } + +// Install a collection object that points to all content model objects + try { + $cmodel_collection_xml = Fedora_Item::create_object_FOXML('islandora:ContentModelCollection'); + $cmodel_collection = Fedora_Item::ingest_from_FOXML($cmodel_collection_xml); + +//$dc = new Dublin_Core(new Fedora_Item('islandora:ContentModelCollection')); + $dc = new Dublin_Core($cmodel_collection); + $dc->set_element('dc:title', array('Installed Content Model')); + $dc->save(); + $cmodel_collection->add_datastream_from_string('select $object $title from <#ri> + where ($object <dc:title> $title + and ($object <fedora-model:hasModel> <info:fedora/fedora-system:ContentModel-3.0> + or $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:ContentModelsCollection>) + and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) + order by $title', 'QUERY', 'Content Model Collection Query', 'text/plain'); + $cmodel_collection->add_relationship('isMemberOfCollection', 'islandora:root'); + $cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); + $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); + drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:ContentModelCollection\">islandora:ContentModelCollection</a>."), 'message'); + } catch (exception $e) { + + } + } + + if (!empty($form_state['values']['demo_collections']['islandora:root'])) { + $new_item = Fedora_Item::ingest_new_item('islandora:root', 'A', 'Islandora Top-level Collection'); + $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + try { + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:root\">islandora:root</a>."), 'message'); + } catch (exception $e) { + + } + } + + if (!empty($form_state['values']['demo_collections']['islandora:demos'])) { + $new_item = fedora_item::ingest_new_item('islandora:demos', 'A', 'Islandora Demo Collection'); + $new_item->add_relationship('isMemberOfCollection', 'islandora:root'); + $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + +// $cv = $new_item->add_datastream_from_file( drupal_get_path('module', 'islandora_repository') . '/collection_views/COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View.xml', 'text/xml', 'X'); + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + try { + $new_item = Fedora_Item::ingest_new_item('islandora:pdf_collection', 'A', 'PDF Collection'); + $new_item->add_relationship('isMemberOfCollection', 'islandora:demos'); + $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:demos\">islandora:demos</a>."), 'message'); + } catch (exception $e) { + + } + } + + if (!empty($form_state['values']['demo_collections']['demo:SmileyStuff'])) { + $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); + $new_item = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_views/SmileyStuff-COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); + $smiley_stuff->add_relationship('isMemberOfCollection', 'info:fedora/islandora:demos'); + $tn = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/smileytn.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + $cp = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'islandora_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', 'islandora_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', 'islandora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); + drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/demo:SmileyStuff\">demo:SmileyStuff</a> collection view."), 'message'); + } catch (exception $e) { + + } + } + + if (!empty($form_state['values']['demo_collections']['islandora:largeimages'])) { + $error = ''; + foreach (array('islandora_jp2Sdep-slideCModel.xml', 'islandora_mods2htmlSdef.xml', 'islandora_mods2htmlSdep.xml', + 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { + try { + $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'islandora_repository') . '/content_models/' . $foxml_file); + } catch (exception $e) { + $error .= " - Problem ingesting $foxml_file"; + } + } + try { + $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'islandora_repository') . '/content_models/islandora_largeimages.xml'); + $tn = $item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:largeimages\">islandora:largeimages</a>."), 'message'); + } catch (exception $e) { + $error .= " - Problem ingesting islandora:largeimages collection"; + } + } + + if (!empty($error)) { + drupal_set_message(t('Some problems occurred: ' . $error)); + } + } +} + +/** + * fedora repository required fedora objects + * @return type + */ +function islandora_repository_required_fedora_objects() { +// array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) + $module_path = drupal_get_path('module', 'islandora_repository'); + return array( + 'islandora_repository' => array( + 'module' => 'islandora_repository', + 'title' => 'Islandora Core', + 'objects' => array( + array( + 'pid' => 'islandora:collectionCModel', + 'label' => 'Islandora Collection Content Model', + 'dsid' => 'ISLANDORACM', + 'datastream_file' => "$module_path/content_models/COLLECTIONCM.xml", + 'dsversion' => 2, + 'cmodel' => 'fedora-system:ContentModel-3.0', + ), + + array( + 'pid' => 'islandora:root', + 'label' => 'Islandora Top-level Collection', + 'cmodel' => 'islandora:collectionCModel', + 'datastreams' => array( + array( + 'dsid' => 'COLLECTION_POLICY', + 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", + ), + array( + 'dsid' => 'TN', + 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", + 'mimetype' => 'image/png', + ), + ), + ), + ), + ), + ); +} + +/** + * Functions to create a time selector form element type. + */ +function islandora_repository_elements() { + $type['islandora_repository_time'] = array( + "#input" => TRUE, + "#process" => array("islandora_repository_expand_time"), + ); + + return $type; +} + +/** + * fedora repository expand time + * @param type $element + * @return string + */ +function islandora_repository_expand_time($element) { +// Default to current time, check default_value but set value so that if +// default value is present it will override value + if (empty($element['#default_value'])) { + $element['#value'] = array( + 'hour' => intval(format_date(time(), 'custom', 'h')), + 'minute' => intval(format_date(time(), 'custom', 'i')), + ); + } + + $element['#tree'] = TRUE; + + foreach ($element['#value'] as $type => $value) { + switch ($type) { + case 'hour': + $options = drupal_map_assoc(range(1, 24)); + break; + case 'minute': + $options = range(0, 59); + break; + } + + if ($type != 'meridiem') { + foreach ($options as $option) { + strlen($option) <= 1 ? $options[$option] = 0 . $option : ''; + } + } + + $element[$type] = array( + '#type' => 'select', + '#default_value' => $element['#value'][$type], + '#options' => $options, + ); + } + + return $element; +} + +/** + * fedora repository time + * @param type $element + * @return type + */ +function islandora_repository_time($element) { + $output = '<div class="container-inline">' . $element['#children'] . '</div>'; + return theme('form_element', $element, $output); +} + +/** + * theme fedora repository time + * @param type $element + * @return type + */ +function theme_islandora_repository_time($element) { + $output = '<div class="container-inline">' . $element['#children'] . '</div>'; + return theme('form_element', $element, $output); +} + +/* Export (basket) functionality */ + +/** + * fedora repository remove item from basket + * @param type $pid + */ +function islandora_repository_remove_item_from_basket($pid) { + + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; + + $objectHelper = new ObjectHelper(); +// getting child PIDs if any + $cpids = $objectHelper->get_child_pids(array($pid)); + + if (array_key_exists($pid, $pids)) { +// remove item from basket + unset($_SESSION['basket']['processed'][$pid]); + } + if (!empty($cpids)) { // there are children + foreach ($cpids as $child_pid => $value) { +// remove child item from basket recursively + islandora_repository_remove_item_from_basket($child_pid); + } + } +} + +/** + * fedora repository basket + * @return type + */ +function islandora_repository_basket() { + $pids = _islandora_repository_get_basket_pids(); + $output = drupal_get_form('islandora_repository_basket_form', $pids); + + return $output; +} + +function islandora_repository_basket_form($form_state, $pids) { + $form = array(); + + if (!empty($pids)) { + $form['pid'] = array(); + $form['title'] = array(); + $form['desc'] = array(); + } + else { + return; + } + + ksort($pids); + foreach ($pids as $pid => $arr) { + $cbs[$pid] = ''; + + $form['pid'][$pid] = array('#value' => l($pid, "fedora/repository/$pid")); + $form['title'][$pid] = array('#value' => $arr['title']); + $form['desc'][$pid] = array('#value' => $arr['desc']); + } + + $form['remove'] = array( + '#type' => 'checkboxes', + '#options' => $cbs, + ); + + $form['remove_submit'] = array( + '#type' => 'submit', + '#value' => t('Remove selected'), + ); + + $form['remove_all'] = array( + '#type' => 'submit', + '#value' => t('Empty basket'), + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Export selected'), + ); + + $form['submit_all'] = array( + '#type' => 'submit', + '#value' => t('Export all'), + ); + + return $form; +} + +/** + * theme fedora repository basket form + * @param type $form + * @return string + */ +function theme_islandora_repository_basket_form($form) { + $header = array( + theme('table_select_header_cell'), + t('PID'), + t('Title'), + t('Description'), + ); + + if (isset($form['pid']) && is_array($form['pid'])) { + foreach (element_children($form['pid']) as $key) { + $rows[] = array( + drupal_render($form['remove'][$key]), + drupal_render($form['pid'][$key]), + drupal_render($form['title'][$key]), + drupal_render($form['desc'][$key]), + ); + } + } + else { + $rows[] = array(array('data' => t('Your basket is empty.'), 'colspan' => '4')); + } + + $output = theme('table', $header, $rows); + + $frm = drupal_render($form); + $output = $frm . $output . $frm; + + return $output; +} + +/** + * fedora repository basket form validate + * @param type $form + * @param type $form_state + */ +function islandora_repository_basket_form_validate($form, &$form_state) { + +} + +/** + * fedora repository basket form submit + * @global type $user + * @param type $form + * @param type $form_state + * @return type + */ +function islandora_repository_basket_form_submit($form, &$form_state) { + if ($form_state['values']['op'] == $form_state['values']['remove_submit']) { + $pids = $form_state['clicked_button']['#post']['remove']; + + if (isset($pids)) { + foreach ($pids as $pid) { + islandora_repository_remove_from_basket($pid); + } + drupal_set_message(t("Selected objects removed")); + return; + } + } + + if ($form_state['values']['op'] == $form_state['values']['remove_all']) { + _islandora_repository_empty_basket(); + drupal_set_message(t("Basket emptied")); + return; + } + + if ($form_state['values']['op'] == $form_state['values']['submit_all']) { + $msg = t("All objects exported to staging area"); + $pids = _islandora_repository_get_basket_pids(); + } + elseif ($form_state['values']['op'] == $form_state['values']['submit']) { + $msg = t("Selected objects exported to staging area"); + $pids = array_filter($form_state['values']['remove']); + } + + if (!empty($pids)) { + global $user; + $log = array(); + $success = TRUE; + $export_dir = variable_get('export_area', file_directory_path() . '/fedora_export_area') . '/' . $user->name . '/' . date("Ymd-His"); + $foxml_dir = $export_dir . '/foxml'; + + if (!file_exists($foxml_dir) && !@mkdir($foxml_dir, 0775, TRUE)) { + drupal_set_message(t("Failed to create foxml dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $foxml_dir)), 'error'); + return FALSE; + } + + module_load_include('inc', 'islandora_repository', 'api/fedora_export'); + foreach ($pids as $pid => $arr) { + + $objects_dir = $export_dir . '/objects/' . $pid; + if (!file_exists($objects_dir) && !@mkdir($objects_dir, 0775, TRUE)) { + drupal_set_message(t("Failed to create objects dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $objects_dir)), 'error'); + return FALSE; + } + + if (!export_to_export_area($pid, $foxml_dir, $objects_dir, $log)) { + $success = FALSE; + } + } + $msg = $success ? $msg : t("Failed to export objects to staging area"); + $msg .= ":<br/>" . implode("<br/>", $log); + + drupal_set_message($msg, $success ? 'info' : 'error'); +//_islandora_repository_empty_basket(); + } + else { + drupal_set_message(t("No objects selected or basket empty"), 'error'); + } + + return; +} + +/** + * Get all pids saved to the basket. + * + * @return type + */ +function _islandora_repository_get_basket_pids() { + +// Set empty defaults if basket elements are missing + $_SESSION['basket'] = isset($_SESSION['basket']) ? $_SESSION['basket'] : array('processed' => array(), 'unprocessed' => array()); + $_SESSION['basket']['processed'] = isset($_SESSION['basket']['processed']) ? $_SESSION['basket']['processed'] : array(); + $_SESSION['basket']['unprocessed'] = isset($_SESSION['basket']['unprocessed']) ? $_SESSION['basket']['unprocessed'] : array(); + + $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; + + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + $ob = new ObjectHelper(); + foreach ($_SESSION['basket']['unprocessed'] as $pid) { +// Check if the pid already exists in the tree + if (array_key_exists($pid, $pids)) { + continue; + } + + $pids += $ob->get_all_related_pids($pid); +// $pids += array($pid); + } + + $_SESSION['basket']['processed'] = $pids; + $_SESSION['basket']['unprocessed'] = array(); + + return $pids; +} + +/** + * fedora repository empty basket + */ +function _islandora_repository_empty_basket() { + unset($_SESSION['basket']); +} + +/** + * fedora repository add to basket + * @param type $pid + * @param type $warn + * @param type $searchResultsFlag + */ +function islandora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) { + if ($warn && _is_added_to_basket($pid)) { + drupal_set_message(t("Object already in basket")); + } + + if (!isset($_SESSION['basket'])) { + $_SESSION['basket'] = array(); + $_SESSION['basket']['unprocessed'] = array($pid => $pid); + } + else { + $_SESSION['basket']['unprocessed'][$pid] = $pid; + } + + if (!$searchResultsFlag) { + drupal_goto('fedora/basket'); + } +} + +/** + * fedora repository remove from basket + * @param type $pid + * @return type + */ +function islandora_repository_remove_from_basket($pid) { + if (isset($_SESSION['basket']['unprocessed'][$pid])) { + unset($_SESSION['basket']['unprocessed'][$pid]); + } + + if (isset($_SESSION['basket']['processed'][$pid])) { + unset($_SESSION['basket']['processed'][$pid]); + } + return; +} + +/** + * theme add to basket link + * @param type $pid + * @param type $type + * @return type + */ +function theme_add_to_basket_link($pid, $type = 'object') { + $object = t($type); + $path = drupal_urlencode($pid); + + $save = "export_big.png"; + $saved = "exported_big.png"; +// $path = drupal_get_path('module', 'Fedora_Repository').'/images/'.$save ; + /* + var_dump($path); + var_dump(theme('image',drupal_get_path('module', 'Fedora_Repository').'/images/'.$save)); + die(); + */ + if (!_is_added_to_basket($pid)) { + return l( + theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), + "fedora/repository/addToBasket/" . $path, + array('html' => TRUE) + ); + } + + return theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $saved, t("In basket"), t("This @object is already in your basket", array('@object' => $object))); +} + +/** + * is added to basket + * @param type $pid + * @param type $account + * @return type + */ +function _is_added_to_basket($pid, $account = NULL) { + return isset($_SESSION['basket']['unprocessed'][$pid]) || isset($_SESSION['basket']['processed'][$pid]); +// return db_result(db_query("SELECT uid FROM {repository_basket} WHERE uid = %d AND pid = '%s'", $account->uid, $pid)); +} + +/** + * fedora repository display schema + * @param type $file + * @return type + */ +function islandora_repository_display_schema($file) { + $path = drupal_get_path('module', 'islandora_repository'); + if (strtolower(substr($file, -3)) == 'xsd' && file_exists($path . '/' . $file)) { + drupal_goto($path . '/' . $file); + } + else { + drupal_goto(); + } + return; +} + +/** + * fedora repository batch reingest object + * @param type $object + * @param type $context + * @return type + */ +function islandora_repository_batch_reingest_object($object, &$context) { + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + if (!empty($object) && is_array($object)) { + $pid = $object['pid']; + if (!valid_pid($pid)) { + return NULL; + } +// Does the object exist? If so, purge it. + $item = new Fedora_Item($pid); + if ($item->exists()) { + $item->purge(t('Remove during re-install batch job')); + } + +// Ingest the object from the source file. + if (!empty($object['foxml_file'])) { + $foxml_file = $object['foxml_file']; + $new_item = Fedora_Item::ingest_from_FOXML_file($foxml_file); + if ($new_item->exists()) { +// Batch operation was successful. + $context['message'][] = "$new_item->pid installed."; + } + } + if (!empty($object['dsid']) && !empty($object['datastream_file'])) { + $datastreams = array( + array( + 'dsid' => $object['dsid'], + 'datastream_file' => $object['datastream_file'], + ) + ); + } + elseif (!empty($object['datastreams'])) { + $datastreams = $object['datastreams']; + } + + if (!empty($datastreams) && is_array($datastreams)) { + $label = !empty($object['label']) ? $object['label'] : ''; + if (empty($object['foxml_file']) && !isset($new_item)) { + $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); + } + if (!empty($object['cmodel'])) { + $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); + } + if (!empty($object['parent'])) { + $new_item->add_relationship('isMemberOfCollection', $object['parent']); + } + 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'); + } + } + } + } +} + +/** + * Content model, collection view and collection policy datastreams may now optionally define a version + * number in their top-level XML element as an attribute, as in: + * <content_model name="Collection" version="2" ... + * + * @param Fedora_Item $item + * @param string $dsid + * @param string $datastream_file + * @return int, or NULL if no version attribute was found. + */ +function islandora_repository_get_islandora_datastream_version($item = NULL, $dsid = NULL, $datastream_file = NULL) { + $return = NULL; + if (isset($item)) { + $doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); + } + elseif (isset($datastream_file)) { + $doc = simplexml_load_file($datastream_file); + } + + if (!empty($doc)) { + $attrs = $doc->attributes(); + foreach ($attrs as $name => $value) { + if ($name == 'version') { + $return = (int) $value; + break; + } + } + } + return $return; +} + +/** + * theme fedora repository solution pack list + * @param type $solution_packs + * @return string + */ +function theme_islandora_repository_solution_packs_list($solution_packs) { + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + $output = ''; + $header = array(); + $rows = array(); + + + + + drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); + return $output; +} + +/** + * Implementation of hook_forms() + * @param string $form_id + * @return array + */ +function islandora_repository_forms($form_id) { + $forms = array(); + if (strpos($form_id, 'islandora_repository_solution_pack_form_') === 0) { + $forms[$form_id] = array( + 'callback' => 'islandora_repository_solution_pack_form', + ); + } + return $forms; +} diff --git a/islandoracm.xsd b/islandoracm.xsd index bce83136..21ab6661 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -48,14 +48,14 @@ </xsd:complexType> <xsd:complexType name="form_builder_methodType"> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="handler" type="xsd:normalizedString" use="required"/> </xsd:complexType> <xsd:complexType name="edit_metadata_methodType"> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="handler" type="xsd:normalizedString" use="required"/> @@ -118,7 +118,7 @@ </xsd:all> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/> @@ -149,7 +149,7 @@ <xsd:element name="parameters" type="parametersType" minOccurs="0"/> </xsd:all> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/> @@ -171,7 +171,7 @@ <xsd:complexContent> <xsd:restriction base="xsd:anyType"> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="default" type="xsd:boolean" default="false"/> diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index a385aa26..6d901b21 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -7,7 +7,7 @@ * Collection Form Builder */ -module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml @@ -32,7 +32,7 @@ class CollectionFormBuilder extends FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index 5ab525b6..814e9dfb 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -21,7 +21,7 @@ class DarwinCore { * @param type $item */ function __construct($item = NULL) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); if (!empty($item)) { $this->owner = $item; if (array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) { @@ -200,7 +200,7 @@ class DarwinCore { * @param type $form_values */ public function handleForm($form_values) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); global $user; //$new_item = Fedora_Item::ingest_new_item($form_values['pid'], 'A', $form_values['dwc:institutionCode'].':'.$form_values['dwc:collectionCode'].':'.$form_values['dwc:catalogNumber'], $user->name); //$new_item->add_datastream_from_string($this->darwinCoreXML, 'DARWIN_CORE', 'Darwin Core Metadata', 'text/xml', 'X'); @@ -248,8 +248,8 @@ class DarwinCore { */ public function asHTML() { $path = drupal_get_path('module', 'Fedora_Repository'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'CollectionClass'); $xmlstr = $this->darwinCoreXML; html_entity_decode($xmlstr); diff --git a/plugins/DemoFormBuilder.inc b/plugins/DemoFormBuilder.inc index ccc74ba2..d2d7f738 100644 --- a/plugins/DemoFormBuilder.inc +++ b/plugins/DemoFormBuilder.inc @@ -6,7 +6,7 @@ * @file * */ -module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml @@ -19,7 +19,7 @@ class DemoFormBuilder extends FormBuilder { * Constructor */ function DemoFormBuilder() { - module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); + module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } @@ -31,7 +31,7 @@ class DemoFormBuilder extends FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); $server = NULL; diff --git a/plugins/DocumentConverter.inc b/plugins/DocumentConverter.inc index f258441a..e64517c6 100644 --- a/plugins/DocumentConverter.inc +++ b/plugins/DocumentConverter.inc @@ -32,7 +32,7 @@ class DocumentConverter { * @return string */ function convert($parameterArray = NULL, $dsid, $file, $output_ext) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); #debug: #drupal_set_message("Sending $file to ". $this->converter_service_url ." for convertsion to $output_ext", 'status'); diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index c0b98981..5db3d600 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -22,7 +22,7 @@ class Exiftool { function __construct($pid) { //drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); $this->pid = $pid; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $this->item = new Fedora_Item($this->pid); } diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 855d508c..de8d10a7 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -19,7 +19,7 @@ class FedoraObjectDetailedContent { * @param type $pid */ function __construct($pid = '') { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); if (!empty($pid)) { $this->pid = $pid; @@ -36,9 +36,9 @@ class FedoraObjectDetailedContent { global $user; $objectHelper = new ObjectHelper(); $tabset = array(); - $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form'); - $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_form'); - $purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path())))); + $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_purge_object_form'); + $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_edit_qdc_form'); + $purge_form = drupal_get_form('islandora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path())))); $tabset['fedora_object_details'] = array( '#type' => 'tabpage', @@ -59,8 +59,8 @@ class FedoraObjectDetailedContent { '#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'); + if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { + $editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DC'); $tabset['fedora_object_details']['tabset']['edit'] = array( '#type' => 'tabpage', '#title' => t('Edit'), diff --git a/plugins/Flv.inc b/plugins/Flv.inc index d8f2b06b..d1dc03d3 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -138,7 +138,7 @@ class FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); $mimetype = new MimeClass(); $server = NULL; $file = $form_values['ingest-file-location']; diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index c259328c..f9d13e56 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -6,7 +6,7 @@ * @file * FLVFormBuilder */ -module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml @@ -19,7 +19,7 @@ class FlvFormBuilder extends FormBuilder { * Constructor */ function FlvFormBuilder() { - module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); + module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } @@ -32,7 +32,7 @@ class FlvFormBuilder extends FormBuilder { */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); $server = NULL; diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 382733b4..695fa2c6 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -84,7 +84,7 @@ class FormBuilder { * @return type */ function createPolicy($collectionPid, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); $dsid = 'CHILD_SECURITY'; @@ -135,8 +135,8 @@ class FormBuilder { * @return type */ function handleQDCForm($form_values) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; @@ -196,7 +196,7 @@ class FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); $server = NULL; diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 8f97ab94..c67e4911 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -16,7 +16,7 @@ class ImageManipulation { * Constructor */ function ImageManipulation() { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); } /** diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index d49869e2..26662cf2 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -6,7 +6,7 @@ * @file * ModsFormBuilder class */ -module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); /** * ModsFormBuilder class ??? @@ -25,8 +25,8 @@ class ModsFormBuilder extends FormBuilder { function __construct($pid=NULL) { parent::__construct(); if ($pid !== NULL) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $this->pid = $pid; $this->cm = ContentModel::loadFromObject($pid); @@ -241,7 +241,7 @@ class ModsFormBuilder extends FormBuilder { $form['submit'] = array( '#type' => 'submit', - '#submit' => array('fedora_repository_edit_qdc_form_submit'), + '#submit' => array('islandora_repository_edit_qdc_form_submit'), '#value' => 'Save Metadata' ); @@ -256,8 +256,8 @@ class ModsFormBuilder extends FormBuilder { * @param &$form_state */ function handleModsForm(&$form_values, &$form_state) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); $form_state['storage']['people'] = NULL; //clears out old entities for the next run of the formbuilder. @@ -329,7 +329,7 @@ class ModsFormBuilder extends FormBuilder { * @param &$rootElement */ function createCollectionPolicy($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $model = new fedora_item($form_values['content_model_pid']); $ds_list = $model->get_datastreams_list_as_array(); if (isset($ds_list['COLLECTION_POLICY_TMPL'])) { @@ -364,7 +364,7 @@ class ModsFormBuilder extends FormBuilder { * @param &$rootElement */ function createWorkflowStream($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $model = new fedora_item($form_values['content_model_pid']); $ds_list = $model->get_datastreams_list_as_array(); if (isset($ds_list['WORKFLOW_TMPL'])) { diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 68ae5528..b4742711 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -120,7 +120,7 @@ class PersonalCollectionClass { * @return type */ function createPolicyStream($user, $dom, $rootElement) { - module_load_include('inc', 'fedora_repository', 'SecurityClass'); + module_load_include('inc', 'islandora_repository', 'SecurityClass'); $securityClass = new SecurityClass(); $policyStreamDoc = $securityClass->createPersonalPolicy($user); diff --git a/plugins/QtFormBuilder.php b/plugins/QtFormBuilder.php index 28645d6b..954f28e4 100644 --- a/plugins/QtFormBuilder.php +++ b/plugins/QtFormBuilder.php @@ -6,7 +6,7 @@ * @file * QTFormBuilder class */ -module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); /** * Implements methods from content model ingest form xml @@ -30,7 +30,7 @@ class QtFormBuilder extends FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); $server = null; diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 592a7e99..4f0d6fc3 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -7,7 +7,7 @@ * Refworks class */ -module_load_include('inc', 'fedora_repository', 'SecurityClass'); +module_load_include('inc', 'islandora_repository', 'SecurityClass'); /** * Refworks class ??? @@ -222,9 +222,9 @@ class Refworks { */ function handleForm(&$form_values) { $errorMessage = NULL; - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $contentModelPid = ContentModel::getPidFromIdentifier($form_values['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_values['models']); $collectionHelper = new CollectionClass(); @@ -238,7 +238,7 @@ class Refworks { $collection_item = new Fedora_Item($collection_pid); $this->collectionPolicyStream = $collection_item->get_datastream_dissemination('CHILD_SECURITY'); if (empty($this->collectionPolicyStream)) { - $this->collectionPolicyStream = file_get_contents(drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml'); + $this->collectionPolicyStream = file_get_contents(drupal_get_path('module', 'islandora_repository') . '/policies/noObjectEditPolicy.xml'); } $success = 0; $errors = 0; @@ -388,7 +388,7 @@ class Refworks { */ function createFedoraDataStreams($form_values, &$dom, &$rootElement, $reference) { global $base_url; - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); $mimetype = new MimeClass(); $server = NULL; $this->createRomeoDataStream($dom, $rootElement); diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index 77eada60..efa1ab7e 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -87,7 +87,7 @@ class ShowStreamsInFieldSets { global $base_url; global $base_path; global $user; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $tabset = array(); @@ -105,7 +105,7 @@ class ShowStreamsInFieldSets { $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'; + $tn_url = $base_path . drupal_get_path('module', 'islandora_repository') . '/images/Crystal_Clear_app_download_manager.png'; } $dc_html = $objectHelper->getFormattedDC($item); @@ -117,8 +117,8 @@ class ShowStreamsInFieldSets { '#content' => $dl_link . $dc_html, ); - if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { - $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC'); + if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { + $editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DC'); $tabset['first_tab']['tabs']['edit'] = array( '#type' => 'tabpage', '#title' => t('Edit'), @@ -142,7 +142,7 @@ class ShowStreamsInFieldSets { * @return type */ function showQdc() { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); $content = $objectHelper->getQDC($this->pid); $collection_fieldset = array( @@ -161,7 +161,7 @@ class ShowStreamsInFieldSets { */ function showOBJLink() { global $base_url; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $streams = $item->get_datastreams_list_as_array(); return "<a href='" . $base_url . "/fedora/repository/" . $this->pid . "/OBJ/" . $streams['OBJ']['label'] . "'>" . $streams['OBJ']['label'] . "</a>"; @@ -172,8 +172,8 @@ class ShowStreamsInFieldSets { * @return type */ function showRefworks() { - $path = drupal_get_path('module', 'fedora_repository'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + $path = drupal_get_path('module', 'islandora_repository'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $collectionHelper = new CollectionClass(); $xmlstr = $collectionHelper->getStream($this->pid, "refworks"); html_entity_decode($xmlstr); @@ -226,7 +226,7 @@ class ShowStreamsInFieldSets { */ function showRomeo($collapsed = FALSE) { $path = drupal_get_path('module', 'Fedora_Repository'); - module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'islandora_repository', 'CollectionClass'); $collectionHelper = new CollectionClass(); $xmlstr = $collectionHelper->getStream($this->pid, "ROMEO", 0); diff --git a/plugins/herbarium.inc b/plugins/herbarium.inc index f7a6d685..f831bc59 100644 --- a/plugins/herbarium.inc +++ b/plugins/herbarium.inc @@ -16,7 +16,7 @@ class Herbarium { function __construct($pid = '') { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); if (!empty($pid)) { $this->pid = $pid; $this->item = new Fedora_Item($pid); @@ -32,7 +32,7 @@ class Herbarium { public function buildDrupalForm($form = array(), $form_state = array()) { // We don't need to add anything beyond the standard Darwin Core form so just pass this through // If we wanted to we could add other fields. - module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); + module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); $dwc = new DarwinCore($this->item); return $dwc->buildDrupalForm($form); @@ -73,9 +73,9 @@ class Herbarium { * Process the metadata form * Update the datastreams */ - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); global $user; $mimetype = new MimeClass(); $dwc = new DarwinCore($this->item); @@ -97,9 +97,9 @@ class Herbarium { * Create fedora object * Add the datastreams */ - module_load_include('inc', 'fedora_repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); + module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); global $user; $mimetype = new MimeClass(); $dwc = new DarwinCore(); @@ -141,8 +141,8 @@ class Herbarium { * @return string */ public function showFieldSets() { - module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); + module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); + module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); global $base_url; $tabset = array(); @@ -167,7 +167,7 @@ class Herbarium { '#title' => t('View'), // This will be the content of the tab. '#content' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/FULL_JPG/"><img src="' . $base_url . '/fedora/imageapi/' . - $this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>', + $this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('islandora_repository_image_tagging_form', $this->pid) . '</p>', ); $dwc = new DarwinCore($this->item); @@ -184,10 +184,10 @@ class Herbarium { '#title' => t('Darwin Core'), '#content' => $dwc->asHTML(), ); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_repository', 'ObjectHelper'); $obj = new ObjectHelper(); - if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { - $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE'); + if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { + $editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE'); $tabset['third_tab']['tabset']['edit'] = array( '#type' => 'tabpage', '#title' => t('Edit'), diff --git a/plugins/islandora_imageapi.info b/plugins/islandora_imageapi.info new file mode 100644 index 00000000..5519ad85 --- /dev/null +++ b/plugins/islandora_imageapi.info @@ -0,0 +1,7 @@ +name = Fedora ImageAPI +description = Adds image manipulation support through a REST interface +package = Islandora Dependencies +dependencies[] = islandora_repository +dependencies[] = imageapi +version = 11.2.beta2 +core = 6.x diff --git a/plugins/islandora_imageapi.module b/plugins/islandora_imageapi.module new file mode 100644 index 00000000..cbe6225d --- /dev/null +++ b/plugins/islandora_imageapi.module @@ -0,0 +1,116 @@ +<?php + + + +function fedora_imageapi_menu() { + $items = array(); + $items['fedora/imageapi'] = array( + 'title' => t('Image manipulation functions'), + 'page callback' => 'islandora_repository_image_manip', + 'type' => MENU_CALLBACK, + 'access arguments' => array('view fedora collection'), + ); + return $items; +} + +/** + * Call out to the Drupal ImageAPI module and return the resulting image as a stream. + * + * @param string $pid + * @param string $dsid + * @param string $op + * @param string $params + */ +function islandora_repository_image_manip($pid = '', $dsid = '', $op = '', $params = '') { + module_load_include('inc', 'Fedora_Repository', 'ObjectHelper'); + module_load_include('module', 'imageapi'); + $obj = new ObjectHelper(); + $mimetype = $obj->getMimeType($pid, $dsid); + $ext = substr(strstr($mimetype, '/'), 1); + $op = (!empty($_GET['op']) ? $_GET['op'] : ''); + $safe_pid = str_replace(':', '_', $pid); + + $cache_key = 'islandora_repository_image_manip_' . md5($safe_pid . '_' . $dsid . '_' . $ext . '_' . $op . (isset($_GET['width']) ? '_' . $_GET['width'] : '') . (isset($_GET['height']) ? '_' . $_GET['height'] : '')); + if (($file = cache_get($cache_key)) === 0) { + //added the slash as sys_get_temp_dir in linux does not seem to include the slash + $tmp_file_name = sys_get_temp_dir() . '/' . $safe_pid . '_' . $dsid . '.' . $ext; + $handle = fopen($tmp_file_name, "w"); + $numbytes = fwrite($handle, $obj->getStream($pid, $dsid)); + fclose($handle); + if ($numbytes == 0) { + return; + } + + + $image = imageapi_image_open($tmp_file_name); + + switch ($op) { + case 'scale': + if (!empty($_GET['height']) || !empty($_GET['width'])) { + imageapi_image_scale($image, $_GET['width'], $_GET['height']); + } + case 'centerscale': + if (!empty($_GET['height']) && !empty($_GET['width'])) { + imageapi_image_scale_and_crop($image, $_GET['width'], $_GET['height']); + } + } + imageapi_image_close($image); + $file = file_get_contents($tmp_file_name); + cache_set($cache_key, $file, 'cache', time() + variable_get('fedora_image_blocks_cache_time', 3600)); + file_delete($tmp_file_name); + } + else { + $file = $file->data; + } + + + header("Content-type: $mimetype"); + header('Content-Disposition: attachment; filename="' . $dsid . '.' . $ext . '"'); + echo $file; + + +// return "$numbytes bytes written to ".sys_get_temp_dir()."$pid_$dsid.$ext\n"; +} + +/** + * Implementation of hook_form_alter + * + * @param unknown_type $form + * @param unknown_type $form_state + * @param unknown_type $form_id + */ +/* + function fedora_imageapi_form_alter( &$form, $form_state, $form_id) { + + switch ( $form_id ) { + case 'islandora_repository_admin': + + $fedora_base_url = $form['fedora_base_url']['#default_value']; + + $fedora_server_url = substr($fedora_base_url,0,strpos($fedora_base_url,'/',7)); + // Add the Djatoka server location. Set it to default to the same server as fedora. + $form['djatoka_server_url'] = array ( + '#type' => 'textfield', + '#title' => '<h3>'.t('Fedora Image API Module').'</h3><br />'.t('aDORe Djatoka image server resolver URL'), + '#default_value' => variable_get('djatoka_server_url', $fedora_server_url.'/adore-djatoka/resolver' ), + '#description' => t('The location of your <a href="http://african.lanl.gov/aDORe/projects/djatoka/" title="aDORe Djatoka Home Page">aDORe Djatoka</a> image server, if you have one installed.'), + '#weight' => 1, + ); + $form['openlayers_server_url'] = array( + '#type' => 'textfield', + '#title' => t('OpenLayers servlet URL'), + '#default_value' => variable_get('openlayers_server_url', $fedora_server_url.'/islandora/OpenLayers'), + '#description' => t('URL of your installation of the <a href="http://openlayers.org/">OpenLayers</a> servlet, if you have one.'), + '#weight' => 1, + ); + $form['buttons']['#weight'] = 2; + break; + } + } + + function show_openlayers_viewer() { + $output = 'Hi.'; + + return $output; + } + */ diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index 3e9bcfb6..2ad56c0a 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -29,9 +29,9 @@ class ShowMapStreamsInFieldSets { * @return type */ function showJPG() { - module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); + module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); global $base_url; @@ -51,8 +51,8 @@ class ShowMapStreamsInFieldSets { $html = '<iframe src="' . $viewer_url . '" scrolling="no" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>'; drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); - drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css'); - drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/iiv.css'); + drupal_add_css(drupal_get_path('module', 'islandora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css'); + drupal_add_css(drupal_get_path('module', 'islandora_repository') . '/js/iiv/css/iiv.css'); $tabset['my_tabset']['second_tab'] = array( diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index ec321ca1..09d24cca 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -112,9 +112,9 @@ class ShowQtStreamsInFieldSets { * @return type */ function showQt() { - module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); + module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); $info = $this->technicalMetadata(array('width' => 640, 'height' => 480)); $width = $info['width']; diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index 1d23b227..ef569487 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -30,8 +30,8 @@ class ShowSlideStreamsInFieldSets { * @return type */ function showJPG() { - module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); + module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); + module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); global $base_url; global $user; @@ -58,7 +58,7 @@ class ShowSlideStreamsInFieldSets { '#title' => t('View'), // This will be the content of the tab. '#content' => '<img src="' . $base_url . - '/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('islandora_repository_image_tagging_form', $this->pid) . '</p>', ); return $tabset; diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index 0a421105..ca32ecd5 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -13,9 +13,9 @@ * @return string */ function _show_subject_tags($pid) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - module_load_include('inc', 'fedora_repository', 'api/tagging'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/dublin_core'); + module_load_include('inc', 'islandora_repository', 'api/tagging'); $obj = new Fedora_Item($pid); $tags = new TagSet($obj); if (!empty($tags->tags)) { @@ -35,10 +35,10 @@ function _show_subject_tags($pid) { * @param type $pid * @return type */ -function fedora_repository_image_tagging_form($form_state, $pid) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - module_load_include('inc', 'fedora_repository', 'api/tagging'); +function islandora_repository_image_tagging_form($form_state, $pid) { + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/dublin_core'); + module_load_include('inc', 'islandora_repository', 'api/tagging'); global $base_url; if (!empty($form_state['post']['pid'])) { @@ -71,7 +71,7 @@ function fedora_repository_image_tagging_form($form_state, $pid) { // Delete button for each existing tag. $form['tags-wrapper']['tags'][$tag['name']]['delete'] = array( '#type' => 'imagebutton', - '#image' => $base_url . '/' . drupal_get_path('module', 'fedora_repository') . '/images/remove_icon.png', + '#image' => $base_url . '/' . drupal_get_path('module', 'islandora_repository') . '/images/remove_icon.png', '#default_value' => $tag['name'], '#title' => t('Delete this tag'), ); @@ -122,9 +122,9 @@ function hook_imagebutton_process($form) { * @param type $form * @param type $form_state */ -function fedora_repository_image_tagging_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/tagging'); +function islandora_repository_image_tagging_form_submit($form, &$form_state) { + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/tagging'); global $user; $item = new Fedora_Item($form_state['values']['pid']); diff --git a/tests/README_TESTING.txt b/tests/README_TESTING.txt index bd69c57e..a88a244c 100644 --- a/tests/README_TESTING.txt +++ b/tests/README_TESTING.txt @@ -21,7 +21,7 @@ $FEDORA_HOME/server/config/fedora-users.xml: </attribute> </user> -If you look in the fedora_repository.test file we see that we are creating +If you look in the islandora_repository.test file we see that we are creating a user with a password set to 'simpletestpass'. Fedora requires the hashed version of this password to do a servlet filter-based authentication. diff --git a/tests/fedora_repository.test b/tests/fedora_repository.test index 91d91b61..2bfab51f 100644 --- a/tests/fedora_repository.test +++ b/tests/fedora_repository.test @@ -16,9 +16,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { } function setUp() { - parent::setUp('tabs', 'fedora_repository'); + parent::setUp('tabs', 'islandora_repository'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'islandora_repository', 'api/fedora_item'); // Create and login user. $repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams', @@ -57,11 +57,11 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $ingest_form_step_2['dc:title'] = $this->randomName(32); $ingest_form_step_2['dc:description'] = $this->randomName(256); - $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf'); + $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/tests/test_files/lorem_ipsum.pdf'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); $this->assertText('mimetype (application/pdf) is not associated with this Content Model', 'PDF mime type not accepted in collection content model.', 'message'); - $this->outputScreenContents('Initial ingest form submit step 2', 'fedora_repository'); + $this->outputScreenContents('Initial ingest form submit step 2', 'islandora_repository'); // Now try ingesting a proper collection policy. $ingest_form = array(); @@ -72,9 +72,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $ingest_form_step_2 = array(); $ingest_form_step_2['dc:title'] = $this->randomName(32); $ingest_form_step_2['dc:description'] = $this->randomName(256); - $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml'); + $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); - //$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'fedora_repository'); + //$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'islandora_repository'); $this->assertPattern('/Item .* created successfully./', "Verified item created."); $pid = $this->getIngestedPid(); @@ -88,7 +88,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $ingest_form_step_2 = array(); $ingest_form_step_2['dc:title'] = "Lorem Ipsum"; $ingest_form_step_2['dc:description'] = $this->randomName(256); - $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf'); + $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/tests/test_files/lorem_ipsum.pdf'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); $pid = $this->getIngestedPid(); $pid_list[] = $pid; @@ -104,7 +104,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $admin_tester = $this->drupalCreateUser(array('administer site configuration', 'view fedora collection')); $this->drupalLogin($admin_tester); - $pageContent = $this->drupalGet('admin/settings/fedora_repository'); + $pageContent = $this->drupalGet('admin/settings/islandora_repository'); $hasOption = preg_match('/Enforce namespace restrictions/', $pageContent); @@ -115,13 +115,13 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $this->pass('Removal of namespace restrictions is enabled'); $inVal['fedora_namespace_restriction_enforced'] = TRUE; $inVal['fedora_pids_allowed'] = 'simpletest:'; - $this->drupalPost('admin/settings/fedora_repository', $inVal, 'Save configuration'); + $this->drupalPost('admin/settings/islandora_repository', $inVal, 'Save configuration'); $this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.'); $this->drupalGet('fedora/repository/islandora:largeimages/'); $this->assertPattern('/Access denied/', 'No access to Large image Collection Collection'); $inVal['fedora_namespace_restriction_enforced'] = 0; - $this->drupalPost('admin/settings/fedora_repository', $inVal, 'Save configuration'); + $this->drupalPost('admin/settings/islandora_repository', $inVal, 'Save configuration'); $this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.'); $this->drupalLogin($this->repository_user); $this->drupalGet('fedora/repository/islandora:largeimages/'); From 0a45be6b3d78af6daeaaae342e23851f0dfbc15e Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 11 Oct 2011 10:22:44 -0300 Subject: [PATCH 094/247] Renamed the files --- digital_repository.info | 9 - digital_repository.install | 107 -- digital_repository.module | 2251 -------------------------- digital_repository.solutionpacks.inc | 175 -- plugins/fedora_imageapi.info | 7 - plugins/fedora_imageapi.module | 116 -- 6 files changed, 2665 deletions(-) delete mode 100644 digital_repository.info delete mode 100644 digital_repository.install delete mode 100644 digital_repository.module delete mode 100644 digital_repository.solutionpacks.inc delete mode 100644 plugins/fedora_imageapi.info delete mode 100644 plugins/fedora_imageapi.module diff --git a/digital_repository.info b/digital_repository.info deleted file mode 100644 index 20ff4d30..00000000 --- a/digital_repository.info +++ /dev/null @@ -1,9 +0,0 @@ -; $Id$ -name = Digital Repository -dependencies[] = imageapi -dependencies[] = tabs -dependencies[] = islandora_content_model_forms -description = Shows a list of items in a fedora collection. -package = Islandora -version = 11.2.beta1 -core = 6.x diff --git a/digital_repository.install b/digital_repository.install deleted file mode 100644 index 164ce02e..00000000 --- a/digital_repository.install +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -/** - * @file fedora_repository.install - */ - -/** - * Implementation of hook_enable(). - */ -function fedora_collections_enable() { - //nothing to do as we do not currently touch the drupal database. - //other than the variables table -} - -/** - * Implementation of hook_requirements(). - * - * @return - * An array describing the status of the site regarding available updates. - * If there is no update data, only one record will be returned, indicating - * that the status of core can't be determined. If data is available, there - * will be two records: one for core, and another for all of contrib - * (assuming there are any contributed modules or themes enabled on the - * site). In addition to the fields expected by hook_requirements ('value', - * 'severity', and optionally 'description'), this array will contain a - * 'reason' attribute, which is an integer constant to indicate why the - * given status is being returned (UPDATE_NOT_SECURE, UPDATE_NOT_CURRENT, or - * UPDATE_UNKNOWN). This is used for generating the appropriate e-mail - * notification messages during update_cron(), and might be useful for other - * modules that invoke update_requirements() to find out if the site is up - * to date or not. - * - * @see _update_message_text() - * @see _update_cron_notify() - */ -function fedora_repository_requirements($phase) { - global $base_url; - - $requirements = array(); - - if ($phase == 'install') { - - // Test for SOAP - $requirements['fedora-soap']['title'] = t("PHP SOAP extension library"); - if (!class_exists('SoapClient')) { - $requirements['fedora-soap']['value'] = t("Not installed"); - $requirements['fedora-soap']['severity'] = REQUIREMENT_ERROR; - $requirements['fedora-soap']['description'] = t('Ensure that the PHP SOAP extension is installed.'); - } - else { - $requirements['fedora-soap']['value'] = t("Installed"); - $requirements['fedora-soap']['severity'] = REQUIREMENT_OK; - } - - // Test for Curl - $requirements['curl']['title'] = "PHP Curl extension library"; - if (!function_exists('curl_init')) { - $requirements['curl']['value'] = t("Not installed"); - $requirements['curl']['severity'] = REQUIREMENT_ERROR; - $requirements['curl']['description'] = t("Ensure that the PHP Curl extension is installed."); - } - else { - $requirements['curl']['value'] = t("Installed"); - $requirements['curl']['severity'] = REQUIREMENT_OK; - } - - // Test for DOM - $requirements['dom']['title'] = "PHP DOM XML extension library"; - if (!method_exists('DOMDocument', 'loadHTML')) { - $requirements['dom']['value'] = t("Not installed"); - $requirements['dom']['severity'] = REQUIREMENT_ERROR; - $requirements['dom']['description'] = t("Ensure that the PHP DOM XML extension is installed."); - } - else { - $requirements['dom']['value'] = t("Installed"); - $requirements['dom']['severity'] = REQUIREMENT_OK; - } - - // Test for XSLT - $requirements['xsl']['title'] = "PHP XSL extension library"; - if (!class_exists('XSLTProcessor')) { - $requirements['xslt']['value'] = t("Not installed"); - $requirements['xslt']['severity'] = REQUIREMENT_ERROR; - $requirements['xslt']['description'] = t("Ensure that the PHP XSL extension is installed."); - } - else { - $requirements['xslt']['value'] = t("Installed"); - $requirements['xslt']['severity'] = REQUIREMENT_OK; - } - } - elseif ($phase == 'runtime') { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - - $requirements['fedora-repository']['title'] = t("Fedora server"); - if (!fedora_available()) { - $requirements['fedora-repository']['value'] = t("Not available"); - $requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; - $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); - } - else { - $requirements['fedora-repository']['value'] = t("Available"); - $requirements['fedora-repository']['severity'] = REQUIREMENT_OK; - } - } - - return $requirements; -} diff --git a/digital_repository.module b/digital_repository.module deleted file mode 100644 index ea1c15c5..00000000 --- a/digital_repository.module +++ /dev/null @@ -1,2251 +0,0 @@ -<?php - -/** - * Drupal hook for admin form - * fedora_repository_name is the name of the top level collection this module will query - * fedora_repository_pid is the name of the top level pid. - * Stores this info in the drupal variables table. - * the name and pid can also be passed as url parameters - */ -function fedora_repository_admin() { - module_load_include('inc', 'fedora_repository', 'formClass'); - $adminForm = new formClass(); - return $adminForm->createAdminForm(); -} - -/** - * drupal hook - * calls the fedora_repositorys_admin form - */ -function fedora_repository_menu() { - module_load_include('inc', 'fedora_repository', 'formClass'); - $adminMenu = new formClass(); - return $adminMenu->createMenu(); -} - -/** - * drupal hook to show help - * - * @param type $path - * @param type $arg - * @return type - */ -function fedora_repository_help($path, $arg) { - switch ($path) { - case 'admin/modules#description' : - return t('Grabs a list of items from a collection in Drupal that are presented on the home page.'); - case 'node/add#fedora_repository' : - return t('Use this page to grab a list of items from a Fedora collection.'); - } -} - -/** - * fedora repository purge object - * @param type $pid - * @param type $name - * @return type - */ -function fedora_repository_purge_object($pid = NULL, $name = NULL) { - if (!user_access('purge objects and datastreams')) { - drupal_set_message(t('You do not have access to add a datastream to this object.'), 'error'); - return ''; - } - if ($pid == NULL) { - drupal_set_message(t('You must specify an object pid to purge an object.'), 'error'); - return ''; - } - $output = t('Are you sure you wish to purge object %name %pid!<br /><b>This cannot be undone</b><br />', - array( - '%name' => $name, - '%pid' => $pid) - ); - - $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); - return $output; -} - -/** - * fedora repository collection view - * @global type $user - * @param type $pid - * @param type $collection - * @param type $pageNumber - * @return type - */ -function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pageNumber = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - global $user; - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); - return ' '; - } - - $objectHelper = new ObjectHelper(); - if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); - } - - $content = ''; - - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - $collectionClass = new CollectionClass(); - $results = $collectionClass->getRelatedItems($pid, NULL); - $content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); - - return $content; -} - -/** - * fedora repository ingest object - * @param type $collection_pid - * @param type $collection_label - * @param type $content_model - * @return type - */ -function fedora_repository_ingest_object($collection_pid=NULL, $collection_label = NULL, $content_model = NULL) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - if (!user_access('ingest new fedora objects')) { - drupal_set_message(t('You do not have permission to ingest.'), 'error'); - return ''; - } - - if (!valid_pid($collection_pid)) { - if (valid_pid(urldecode($collection_pid))) { - $collection_pid = urldecode($collection_pid); - } - else { - drupal_set_message(t("This collection PID $collection_pid is not valid"), 'error'); - return ' '; - } - } - - if ($collection_pid == NULL) { - drupal_set_message(t('You must specify a collection object pid to ingest an object.'), 'error'); - return ''; - } - $output = drupal_get_form('fedora_repository_ingest_form', $collection_pid, $collection_label, $content_model); - - $breadcrumbs = array(); - $objectHelper = new ObjectHelper(); - $objectHelper->getBreadcrumbs($collection_pid, $breadcrumbs); - drupal_set_breadcrumb(array_reverse($breadcrumbs)); - - return $output; -} - -/** - * fedora repository ingest form submit - * @global type $base_url - * @global type $user - * @param array $form - * @param array $form_state - */ -function fedora_repository_ingest_form_submit(array $form, array &$form_state) { -//only validate the form if the submit button was pressed (other buttons may be used for AHAH - if ($form_state['storage']['xml']) { - if (module_exists('islandora_content_model_forms')) { - module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); - $xml_form = new IngestObjectMetadataForm(); - $xml_form->submit($form, $form_state); - } - } - else if ($form_state['clicked_button']['#id'] == 'edit-submit') { - global $base_url; - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - - $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); - $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - $err = TRUE; - $redirect = TRUE; - if (($cp = CollectionPolicy::loadFromCollection($form_state['values']['collection_pid'])) !== FALSE) { - $relationship = $cp->getRelationship(); - - if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { - $pid = $cp->getNextPid($contentModelDsid); - global $user; - $form_state['values']['user_id'] = $user->name; - $form_state['values']['pid'] = $pid; - $form_state['values']['content_model_pid'] = $contentModelPid; - $form_state['values']['relationship'] = $relationship; - - $err = (!$cm->execFormHandler($form_state['values'], $form_state)); - - $_SESSION['fedora_ingest_files'] = ''; //empty this variable - - $attr = $cm->getIngestFormAttributes(); - $redirect = $attr['redirect']; - - if ($redirect) { - $form_state['storage'] = NULL; - } - } - } - - if ($redirect) { - $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; - } - } -} - -/** - * fedora repository ingest form validate - * @param type $form - * @param type $form_state - * @return type - */ -function fedora_repository_ingest_form_validate($form, &$form_state) { -//only validate the form if the submit button was pressed (other buttons may be used for AHAH - if ($form_state['clicked_button']['#id'] == 'edit-submit') { - switch ($form_state['storage']['step']) { - case 1: - $form_state['storage']['step']++; - $form_state['rebuild'] = TRUE; - break; - - case 2: -// XML based form. - if ($form_state['storage']['xml']) { - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - $xml_form->validate($form, $form_state); - } -// Get the uploaded file. - $validators = array(); - - if (!empty($_FILES['files']['name']['ingest-file-location'])) { - $fileObject = file_save_upload('ingest-file-location', $validators); - - file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); - $form_state['values']['ingest-file-location'] = $fileObject->filepath; - } - - if (isset($form_state['values']['ingest-file-location']) && file_exists($form_state['values']['ingest-file-location'])) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); - - $file = $form_state['values']['ingest-file-location']; - - $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); - $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); - - if (($cm = ContentModel::loadFromModel($contentModelPid, $contentModelDsid)) !== FALSE) { - $allowedMimeTypes = $cm->getMimetypes(); - - $mimetype = new MimeClass(); - $dformat = $mimetype->getType($file); - - if (!empty($file)) { - if (!in_array($dformat, $allowedMimeTypes)) { - form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . - implode(' ', $allowedMimeTypes))); - file_delete($file); - return; - } - elseif (!$cm->execIngestRules($file, $dformat)) { - drupal_set_message(t('Error following Content Model Rules'), 'error'); - foreach (ContentModel::$errors as $err) { - drupal_set_message($err, 'error'); - } - } - } - } - } - $form_state['rebuild'] = FALSE; - break; - } - } -} - -/** - * fedora repository ingest form - * @param type $form_state - * @param type $collection_pid - * @param type $collection_label - * @param type $content_model - * @return type - */ -function fedora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) { - module_load_include('inc', 'fedora_repository', 'formClass'); -// 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; - } - $ingestForm = new formClass(); - $form_state['storage']['content_model'] = $content_model; - $form_state['storage']['collection_pid'] = $collection_pid; - return $ingestForm->createIngestForm($collection_pid, $collection_label, $form_state); -} - -/** - * fedora repository purge object form - * @global type $base_url - * @param type $form_state - * @param type $pid - * @param type $referrer - * @return type - */ -function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { - global $base_url; - if (!user_access('purge objects and datastreams')) { - return NULL; - } - if ($pid == NULL) { - return NULL; - } - $form['pid'] = array( - '#type' => 'hidden', - '#value' => "$pid" - ); - if (!strstr(drupal_get_destination(), urlencode('fedora/repository'))) { - $form['referrer'] = array( - '#type' => 'hidden', - '#value' => $referrer, - ); - } - if (!isset($form_state['storage']['confirm'])) { -// do your normal $form definition here - - - $form['submit'] = array( - '#type' => 'image_button', - '#src' => drupal_get_path('module', 'fedora_repository') . '/images/purge_big.png', - '#value' => t('Purge'), - '#suffix' => 'Purge this object', - ); - if (!empty($collectionPid)) { - $collectionPid = $_SESSION['fedora_collection']; - } -//$form['#redirect'] = $referrer; - - return $form; - } - else { -// ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form - - return confirm_form($form, 'Confirm Purge Object', $referrer, 'Are you sure you want to delete this object? This action cannot be undone.', 'Delete', 'Cancel'); //Had better luck leaving off last param 'name' - } - return $form; -} - -/** - * add stream - * @param type $collection_pid - * @param type $collectionName - * @return type - */ -function add_stream($collection_pid=NULL, $collectionName=NULL) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!valid_pid($collection_pid)) { - drupal_set_message(t("This PID is not valid!"), 'error'); - return ' '; - } - if (!user_access('ingest new fedora objects')) { - drupal_set_message(t('You do not have permission to ingest.'), 'error'); - return ''; - } - if ($collection_pid == NULL) { - drupal_set_message(t('You must specify an collection object pid to ingest an object.'), 'error'); - return ''; - } - $output .= drupal_get_form('fedora_repository_add_stream_form', $pid); - - return $output; -} - -/** - * add stream form submit - * @global type $base_url - * @param type $form - * @param type $form_state - * @return type - */ -function add_stream_form_submit($form, &$form_state) { - global $base_url; - if (!empty($form_state['submit']) && $form_state['submit'] == 'OK') { - $form_state['rebuild'] = TRUE; - return; - } - module_load_include('inc', 'fedora_repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $pathToModule = drupal_get_path('module', 'fedora_repository'); - - $file = $form_state['values']['add-stream-file-location']; - - $pid = $form_state['values']['pid']; - $dsid = $form_state['values']['stream_id']; - $dsLabel = $form_state['values']['stream_label'] . substr($file, strrpos($file, '.')); // Add the file extention to the end of the label.; - $file_basename = basename($file); - $file_directory = dirname($file); - $streamUrl = $base_url . '/' . $file_directory . '/' . drupal_urlencode($file_basename); - - /* ----------------------------------------------------------------- - * need a better way to get mimetypes - */ - $mimetype = new MimeClass(); - $dformat = $mimetype->getType($file); - $controlGroup = "M"; - if ($dformat == 'text/xml') { - $controlGroup = 'X'; - } - try { - $item = new Fedora_Item($pid); - $item->add_datastream_from_url($streamUrl, $dsid, $dsLabel, $dformat, $controlGroup); - - $object_helper = new ObjectHelper(); - $object_helper->get_and_do_datastream_rules($pid, $dsid, $file); - - file_delete($file); - } catch (exception $e) { - drupal_set_message(t($e->getMessage()), 'error'); - return; - } - $form_state['rebuild'] = TRUE; -} - -/** - * add stream form - * @param type $form_state - * @param type $pid - * @return type - */ -function add_stream_form(&$form_state, $pid) { - module_load_include('inc', 'fedora_repository', 'formClass'); - $addDataStreamForm = new formClass(); - return $addDataStreamForm->createAddDataStreamForm($pid, $form_state); -} - -/** - * add stream form validate - * @param type $form - * @param type $form_state - * @return type - */ -function add_stream_form_validate($form, &$form_state) { - if ($form_state['clicked_button']['#value'] == 'OK') { - $form_state['rebuild'] = TRUE; - return; - } - $dsid = $form_state['values']['stream_id']; - $dsLabel = $form_state['values']['stream_label']; - if (strlen($dsid) > 64) { - form_set_error('', t('Data stream ID cannot be more than 64 characters.')); - return FALSE; - } - if (!(preg_match("/^[a-zA-Z]/", $dsid))) { - form_set_error('', t("Data stream ID ($dsid) has to start with a letter.")); - return FALSE; - } - if (strlen($dsLabel) > 64) { - form_set_error('', t('Data stream Label cannot be more than 64 characters.')); - return FALSE; - } - if (strpos($dsLabel, '/')) { - form_set_error('', t('Data stream Label cannot contain a "/".')); - return FALSE; - } - $validators = array( - // 'file_validate_is_image' => array(), - // 'file_validate_image_resolution' => array('85x85'), - // 'file_validate_size' => array(30 * 1024), - ); - - $fileObject = file_save_upload('add-stream-file-location', $validators); - -// Move the uploaded file to Drupal's files directory. - file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME'); - $form_state['values']['add-stream-file-location'] = $fileObject->filepath; -// TODO: Add error checking here. - $form_state['rebuild'] = FALSE; -} - -/** - * fedora repository purge stream - * @global type $user - * @param type $pid - * @param type $dsId - * @param type $name - * @return type - */ -function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - global $user; - if ($pid == NULL || $dsId == NULL) { - drupal_set_message(t('You must specify an object pid and DataStream ID to purge a datastream'), 'error'); - return ' '; - } - if (!fedora_repository_access(OBJECTHELPER :: $PURGE_FEDORA_OBJECTSANDSTREAMS, $pid, $user)) { - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to purge objects."), 'error'); - return ' '; - } - - $output = t('Are you sure you wish to purge this datastream %name<br />', - array( - '%name' => $name) - ); - $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); - return $output; -} - -/** - * fedora repository purge object form submit - * @param type $form - * @param type $form_state - * @return type - */ -function fedora_repository_purge_object_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - $pid = $form_state['values']['pid']; - if (!isset($form_state['storage']['confirm'])) { - $form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form - $form_state['rebuild'] = TRUE; // along with this - } - else { -// this is where you do your processing after they have pressed the confirm button - $params = array( - "pid" => $pid, - "logMessage" => "Purged", - "force" => "" - ); - try { - $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $object = $client->__soapCall('purgeObject', array($params)); - unset($form_state['storage']['confirm']); - } catch (exception $e) { - if (preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage())) { - drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error'); - } - else { - drupal_set_message(t($e->getMessage()), 'error'); - } - return; - } - if (!empty($form_state['values']['referrer'])) { - $form_state['redirect'] = $form_state['values']['referrer']; - } - elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { - $collectionPid = $_SESSION['fedora_collection']; - - $form_state['redirect'] = "fedora/repository/$collectionPid/"; - } - else { - $form_state['redirect'] = 'fedora/repository/'; - } - } -} - -/** - * fedora repository purge stream form - * @param type $form_state - * @param type $pid - * @param type $dsId - * @return type - */ -function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) { - $form['pid'] = array( - '#type' => 'hidden', - '#value' => "$pid" - ); - $form['dsid'] = array( - '#type' => 'hidden', - '#value' => "$dsId" - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Purge') - ); - - return $form; -} - -/** - * fedora repository purge stream form submit - * @global type $base_url - * @param type $form - * @param array $form_state - */ -function fedora_repository_purge_stream_form_submit($form, &$form_state) { - global $base_url; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $pid = $form_state['values']['pid']; - $item = new Fedora_Item($pid); - $dsid = $form_state['values']['dsid']; - try { - $item->purge_datastream($dsid); - } catch (exception $e) { - drupal_set_message(t($e->getMessage()), 'error'); - } - $form_state['redirect'] = $base_url . "/fedora/repository/$pid"; -} - -/** - * fedora repository replace stream - * @param type $pid - * @param type $dsId - * @param type $dsLabel - * @param type $collectionName - * @return type - */ -function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { - if ($pid == NULL || $dsId == NULL) { - drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error'); - return ''; - } - $output = drupal_get_form('fedora_repository_replace_stream_form', $pid, $dsId, $dsLabel); - - return $output; -} - -/** - * fedora repository replace stream form - * @param type $form_state - * @param type $pid - * @param type $dsId - * @param type $dsLabel - * @return type - */ -function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { -//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); - module_load_include('inc', 'Fedora_Repository', 'formClass'); -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $replaceDataStreamForm = new formClass(); - return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state); -} - -/** - * fedora repository replace stream form validate - * @param type $form - * @param type $form_state - * @return type - */ -function fedora_repository_replace_stream_form_validate($form, &$form_state) { -// If a file was uploaded, process it. - if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name']['file'])) { - -// attempt to save the uploaded file - $file = file_save_upload('file', array(), file_directory_path()); - -// set error is file was not uploaded - if (!$file) { - form_set_error('file', 'Error uploading file.'); - return; - } - - $doc = new DOMDocument(); - module_load_include('inc', 'Fedora_Repository', 'MimeClass'); - $mime = new MimeClass(); - if ($mime->getType($file->filepath) == 'text/xml' && !$doc->load($file->filepath)) { - form_set_error('file', 'Invalid XML format.'); - return; - } - -// set files to form_state, to process when form is submitted - $form_state['values']['file'] = $file; - } -} - -/** - * fedora repository replace stream form submit - * @global type $base_url - * @param type $form - * @param array $form_state - */ -function fedora_repository_replace_stream_form_submit($form, &$form_state) { - global $base_url; - $file = $form_state['values']['file']; - $pid = $form_state['values']['pid']; - $dsid = $form_state['values']['dsId']; - $dsLabel = $form_state['values']['dsLabel']; - // Remove the original file extension from the label and add the new one - $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot - if ($indexOfDot !== FALSE) { - $dsLabel = substr($dsLabel, 0, $indexOfDot); - $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; - } - module_load_include('inc', 'Fedora_Repository', 'MimeClass'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - - $file_basename = basename($file->filepath); - $file_directory = dirname($file->filepath); - $streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename); - - /* ----------------------------------------------------------------- - * TODO: need a better way to get mimetypes - */ - $mimetype = new MimeClass(); - $dformat = $mimetype->getType($file->filepath); - - $item = new Fedora_Item($pid); - - $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); - - $form_state['redirect'] = 'fedora/repository/' . $pid; -} - -/** - * fedora repository edit qdc page - * @global type $user - * @param type $pid - * @param type $dsId - * @return type - */ -function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - global $user; - if ($pid == NULL || $dsId == NULL) { - drupal_set_message(t('You must specify an object pid and a Dublin Core DataStream ID to edit metadata'), 'error'); - return ' '; - } - if (!fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); - return ' '; - } - $output = drupal_get_form('fedora_repository_edit_qdc_form', $pid, $dsId); - - return $output; -} - -/** - * fedora repository edit qdc form - * @global type $user - * @param type $form_state - * @param type $pid - * @param type $dsId - * @return type - */ -function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - if ($pid == NULL) { - drupal_set_message(t('You must specify an object pid!'), 'error'); - } - global $user; - if (!fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); - return ' '; - } - - module_load_include('inc', 'fedora_repository', 'formClass'); - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); -// Check if there is a custom edit metadata function defined in the content model. - - $breadcrumbs = array(); - $objectHelper = new ObjectHelper(); - $objectHelper->getBreadcrumbs($pid, $breadcrumbs); - drupal_set_breadcrumb(array_reverse($breadcrumbs)); - - - $output = ''; - if (($cm = ContentModel::loadFromObject($pid)) !== FALSE) { - $output = $cm->buildEditMetadataForm($pid, $dsId); - } - - if (empty($output)) { -// There is no custom function, so just load the standard QDC form. - $metaDataForm = new formClass(); -//currently we only edit the dc metadata. If you defined a custom form with a custom handler you are sol for now. - return $metaDataForm->createMetaDataForm($pid, $dsId, $client, $form_state); - } - return $output; -} - -/** - * fedora repository edit qdc form validate - * @param type $form - * @param boolean $form_state - */ -function fedora_repository_edit_qdc_form_validate($form, &$form_state) { - if ($form_state['storage']['xml']) { - if ($form_state['storage']['step'] == 1) { - $form_state['storage']['step']++; - $form_state['rebuild'] = TRUE; - } - module_load_include('inc', 'xml_form_api', 'XMLForm'); - $xml_form = new XMLForm($form_state); - $xml_form->validate($form, $form_state); - } -} - -/** - * Check if there is a custom edit metadata function defined in the content model. If so, - * call it, if not do the submit action for the standard QDC metadata. Custom forms will - * need to implement their own equivalent to the FormClass->updateMetaData function - * - * @param array $form - * @param array $form_state - * @return - */ -function fedora_repository_edit_qdc_form_submit($form, &$form_state) { - if ($form_state['storage']['xml']) { - module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); - $xml_form = new EditObjectMetadataForm($form_state); - $xml_form->submit($form, $form_state); - } - else { - module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); - global $base_url; - if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { - -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $soap_helper = new ConnectionHelper(); - $client = $soap_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - -// Check the content model for a custom edit metadata form submit function. - if (isset($form_state['values']['pid'])) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { - return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client); - } - } - - module_load_include('inc', 'fedora_repository', 'formClass'); - $metaDataForm = new formClass(); - $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); - $form_state['storage'] = NULL; - $form_state['redirect'] = $base_url . '/fedora/repository/' . $form_state['values']['pid']; - - return $return_value; - } - } -} - -/** - * drupal hook - * creates a new permission than can be assigned to roles - */ -function fedora_repository_perm() { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - return array( - OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, - OBJECTHELPER::$EDIT_FEDORA_METADATA, - OBJECTHELPER::$PURGE_FEDORA_OBJECTSANDSTREAMS, - OBJECTHELPER::$ADD_FEDORA_STREAMS, - OBJECTHELPER::$INGEST_FEDORA_OBJECTS, - OBJECTHELPER::$EDIT_TAGS_DATASTREAM, - OBJECTHELPER::$VIEW_DETAILED_CONTENT_LIST, - OBJECTHELPER::$MANAGE_COLLECTIONS, - OBJECTHELPER::$DELETE_ENTIRE_COLLECTIONS, - OBJECTHELPER::$CREATE_BATCH_PROCESS, - ); -} - -/** - * drupal hook - * determines if a user has access to what they are asking for - * - * @param type $op - * @param type $node - * @param type $account - * @return type - */ -function fedora_repository_access($op, $node, $account) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $objectHelper = new ObjectHelper(); - return $objectHelper->fedora_repository_access($op, $node, $account); -} - -/** - * Grabs a stream from fedora sets the mimetype and returns it. $dsID is the - * datastream id. - * @param $pid String - * @param $dsID String - */ -function makeObject($pid, $dsID) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!valid_pid($pid)) { - drupal_set_message(t("Invalid PID!"), 'error'); - return ' '; - } - - if (!valid_dsid($dsID)) { - drupal_set_message(t("Invalid dsID!"), 'error'); - return ' '; - } - - if ($pid == NULL || $dsID == NULL) { - drupal_set_message(t("No pid or dsid given to create an object with.")); - return ' '; - } - global $user; - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - drupal_access_denied(); - return; - drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace."), 'error'); - return ' '; - } - - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $objectHelper = new ObjectHelper(); - $objectHelper->makeObject($pid, $dsID); -} - -/** - * Sends an ITQL query to the Fedora Resource index (can only communicate with Kowari or mulgara) - * Reads the pid and datastream id as url parameters. Queries the collection object for the query - * if there is no query datastream falls back to the query shipped with the module. - * - * @global type $user - * @param type $pid - * @param type $dsId - * @param type $collection - * @param type $page_number - * @param type $limit - * @return type - */ -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', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - global $user; - - if (!fedora_available()) { - drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); - return ''; - } - - if (!risearch_available()) { - drupal_set_message(t('The Fedora resource index search is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); - return ''; - } - - if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); - } - - $item = new fedora_item($pid); - if (!$item->exists()) { - drupal_not_found(); - exit(); - } - - if ($pid & !valid_pid($pid)) { - drupal_set_message(t("Invalid PID!"), 'error'); - return ' '; - } - - if ($dsId & !valid_dsid($dsId)) { - drupal_set_message(t("Invalid dsID!"), 'error'); - return ' '; - } - if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { - if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); - } - drupal_access_denied(); - exit; - return ' '; - } - - $objectHelper = new ObjectHelper(); - if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); - } - $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); - if (in_array(-1, $headers)) { - drupal_access_denied(); - exit; - return ' '; - } - if ($dsId != NULL && $dsId != '-') { //if we have a dsID return the stream otherwise query for a collection of objects -//probably should check pid as well here. - return makeObject($pid, $dsId); - } - - $content = '<div id="content-fedora">'; - - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - $collectionClass = new CollectionClass(); - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'plugins/FedoraObjectDetailedContent'); - $breadcrumbs = array(); - $objectHelper->getBreadcrumbs($pid, $breadcrumbs); - drupal_set_breadcrumb(array_reverse($breadcrumbs)); - - $offset = $limit * $page_number; - $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_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 FedoraObjectDetailedContent($pid); - $object_details = $obj->showFieldSets(); - if ($object_details['fedora_object_details']['#selected'] == true){ - foreach($cmodels_tabs as $cmodel_tab){ - if (is_array($cmodel_tab)){ - $cmodel_tab['#selected'] = FALSE; - } - - } - } - $cmodels_tabs = array_merge($cmodels_tabs, $object_details); - - - return tabs_render($cmodels_tabs); -} - -/** - * fedora repository urlencode string - * @param type $str - * @return type - */ -function fedora_repository_urlencode_string($str) { - return htmlentities($str); -} - -/** - * Uses makeobject to get a stream. Sets the Content Disposition in the header so it suggests a filename - * and sends it as an attachment. This should prompt for a download of the object. - * - * @global type $user - * @param type $pid - * @param type $dsId - * @param type $label - * @param type $version - * @return type - */ -function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { - global $user; - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - - if ($pid == NULL || $dsId == NULL) { - drupal_set_message(t("no pid or dsid given to create an object with!")); - return ' '; - } - - $objectHelper = new ObjectHelper(); - $objectHelper->makeObject($pid, $dsId, 1, $label, FALSE, $version); -} - -/** - * repository page - * @param type $pid - * @param type $dsId - * @param type $collection - * @param type $pageNumber - * @return type - */ -function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNumber = NULL) { -//do security check at fedora_repository_get_items function as it has to be called there in case -//someone trys to come in a back door. - return fedora_repository_get_items($pid, $dsId, $collection, $pageNumber); -} - -/** - * repository service - * @global type $user - * @param type $pid - * @param type $servicePid - * @param type $serviceMethod - * @return type - */ -function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NULL) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - global $user; - - if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { -//drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); - drupal_access_denied(); - if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'error'); - } - return ' '; - } - if ($pid == NULL) { - $pid = variable_get('fedora_repository_pid', 'islandora:root'); - } - $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); - if (in_array(-1, $headers)) { - drupal_access_denied(); - exit; - return ' '; - } - - - $item = new Fedora_Item($pid); - if ($item !== FALSE) { - echo $item->get_dissemination($servicePid, $serviceMethod); - } - - exit(); -} - -//Search Stuff ******************************************************************** - -/** - * Implementation of hook_search(). - * sends a search query to fedora fgsearch which is backed by Lucene - * In our implementation of Fedora we have api-a and api-m locked down - * to authorized users but at the object level. We can query Lucene and the - * RI index to get a list of results without authorization but to view any - * datastreams users must be authorized. - * - * @param type $op - * @param type $keys - * @return array - */ -function fedora_repository_search($op = 'search', $keys = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - - switch ($op) { - case 'name': - if (user_access('view fedora collection')) { - return t('Digital Repository', array('-9')); - } - case 'search': - if (user_access('view fedora collection')) { -//demo search string ?operation=gfindObjects&indexName=DemoOnLucene&query=fgs.DS.first.text%3Achristmas&hitPageStart=11&hitPageSize=10 - $resultData = NULL; - $numberOfHitsPerPage = NULL; - $index = strpos($keys, '.'); - $test = substr($keys, 0, $index + 1); - $type = NULL; - if ($index > 0) { - $index = strpos($keys, ':'); - $type = substr($keys, 0, $index); - $keys = substr($keys, $index + 1); - } - - $index = strpos($keys, ':'); - $startPage = substr($keys, 0, $index); - if ($index > 1) { - $keys = substr($keys, $index + 1); - } - - if (!$startPage) { - $startPage = 1; - } - - $xmlDoc = NULL; - - $path = drupal_get_path('module', 'fedora_repository'); - $xmlDoc = new DomDocument(); - $xmlDoc->load($path . '/searchTerms.xml'); - $nodeList = $xmlDoc->getElementsByTagName('default'); - if (!$type) { -//$type = 'dc.description'; - $type = $nodeList->item(0)->nodeValue; - } - $nodeList = $xmlDoc->getElementsByTagName('number_of_results'); - $numberOfHitsPerPage = $nodeList->item(0)->nodeValue; - - $indexName = variable_get('fedora_index_name', 'DemoOnLucene'); - $keys = htmlentities(urlencode($keys)); - $searchQuery = NULL; - if (isset($type) && strcmp($type, ':')) { - $searchQuery = $type . ':' . $keys; - } - else { - $searchQuery = $keys; - } -//$searchQuery.=" AND (PID:vre OR PID:vre:ref OR PID:demo OR PID:changeme)"; - - $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); - $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=copyXml&query=' . $searchQuery; - $searchString .= '&hitPageSize=' . $numberOfHitsPerPage . '&hitPageStart=' . $startPage; -//$searchString = htmlentities(urlencode($searchString)); - $searchUrl .= $searchString; - $objectHelper = new ObjectHelper(); - $resultData = do_curl($searchUrl); - - $results[] = array( - array( - 'data' => $resultData, - 'colspan' => 2 - ) - ); - return $results; - } - } // switch ($op) -} - -/** - * Implementation of hook_search_page(). - * Display the search results - * - * @param type $resultData - * @return array - */ -function fedora_repository_search_page($resultData) { - $path = drupal_get_path('module', 'fedora_repository'); - $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); - $proc = NULL; - if (!$resultData[0][0]['data']) { - return ''; //no results - } - $text = utf8_encode($resultData[0][0]['data']); - - try { - $proc = new XsltProcessor(); - } catch (Exception $e) { - $out[] = array( - array( - 'data' => $e->getMessage(), - 'colspan' => 2 - ) - ); - return $out; - } - -//inject into xsl stylesheet - $proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on - $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl - $proc->setParameter('', 'objectsPage', base_path()); - $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); - $proc->registerPHPFunctions(); - $xsl = new DomDocument(); - if ($isRestricted) { - $xsl->load($path . '/xsl/results.xsl'); - } - else { - $xsl->load($path . '/xsl/unfilteredresults.xsl'); - } - - $input = new DomDocument(); - $didLoadOk = $input->loadXML(utf8_encode($resultData[0][0]['data'])); - - if (!$didLoadOk) { - $results[] = array( - array( - 'data' => 'Error parsing results', - 'colspan' => 2 - ) - ); - } - else { - $xsl = $proc->importStylesheet($xsl); - $newdom = $proc->transformToDoc($input); - - $results[] = array( - array( - 'data' => $newdom->saveHTML(), - 'colspan' => 2 - ) - ); - } - - $header = array( - array( - 'data' => t('Collection results'), - NULL, - ), - (NULL) - ); - - $output .= theme('table', $header, $results); - return $output; -} - -/** - * Implementation of hook_form_alter(). - * allows the advanced search form in drupal - * - * @param type $form - * @param type $form_state - * @param type $form_id - */ -function fedora_repository_form_alter(&$form, &$form_state, $form_id) { -// Advanced node search form - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $path = drupal_get_path('module', 'fedora_repository'); - if ($form_id == 'search_form' && arg(1) == 'fedora_repository' && user_access('use advanced search')) { - $default_value = $form['basic']['inline']['keys']['#default_value']; - $index = strpos($default_value, '.'); - $test = substr($default_value, 0, $index + 1); - $type = NULL; - if ($index > 0) { - $index = strpos($default_value, ':'); - $type = substr($default_value, 0, $index); - $default_value = substr($default_value, $index + 1); - } - $form['basic']['inline']['keys']['#default_value'] = $default_value; -// Keyword boxes: - $form['advanced'] = array( - '#type' => 'fieldset', - '#title' => t('Advanced search'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#attributes' => array( - 'class' => 'search-advanced' - ), - ); - $form['advanced']['keywords'] = array( - '#prefix' => '<div class="criterion">', - '#suffix' => '</div>', - ); - $xmlDoc = new DomDocument(); - $xmlDoc->load($path . '/searchTerms.xml'); - $nodeList = $xmlDoc->getElementsByTagName('term'); - $searchClass = new SearchClass(); - $types = $searchClass->get_search_terms_array(); - - $form['advanced']['type'] = array( - '#type' => 'select', - '#title' => t('Choose a field to search'), - '#prefix' => '<div class="criterion">', '#suffix' => '</div>', '#options' => $types, - '#default_value' => $type, - ); - $form['advanced']['submit'] = array( - '#type' => 'submit', - '#value' => t('Advanced search'), - '#prefix' => '<div class="action clear-block">', '#suffix' => '</div>', - ); - $form['#validate'][] = 'fedora_repository_search_validate'; - } -} - -/** - * Implementation of hook_search_validate() - * - * @param type $form - * @param type $form_state - */ -function fedora_repository_search_validate($form, &$form_state) { -// Initialise using any existing basic search keywords. - $keys = $form_state['values']['processed_keys']; - - if (isset($form_state['values']['type'])) { - $type = $form_state['values']['type']; - if ($type) { - $keys = $type . ':' . $keys; - } - } - - if (!empty($keys)) { - form_set_value($form['basic']['inline']['processed_keys'], trim($keys), $form_state); //set the form string - } -} - -/** - * fedora repository theme - * @return type - */ -function fedora_repository_theme() { - return array( - 'fedora_repository_mnpl_advanced_search_form' => array( - 'arguments' => array( - 'form' => NULL, - ), - ), - 'fedora_repository_time' => array( - 'arguments' => array( - 'element' => NULL - ), - 'fedora_repository_solution_packs_list' => array( - 'arguments' => array( - 'solution_packs' => NULL, - ), - ), - ), - ); -} - -/** - * Get a list of terms from a lucene index - * - * @param type $field - * @param type $startTerm - * @param type $displayName - * @return type - */ -function fedora_repository_list_terms($field, $startTerm = NULL, $displayName = NULL) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - return $searchClass->getTerms($field, $startTerm, $displayName); -} - -/** - * fedora repository mnpl advanced search form - * @return type - */ -function fedora_repository_mnpl_advanced_search_form() { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - return $searchClass->build_advanced_search_form(); -} - -/** - * theme fedora repository mnpl advanced search form - * @param type $form - * @return type - */ -function theme_fedora_repository_mnpl_advanced_search_form($form) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $advanced_search_form = new SearchClass(); - return $advanced_search_form->theme_advanced_search_form($form); -} - -/** - * fedora repository mnpl advanced search - * @param type $query - * @param type $startPage - * @return type - */ -function fedora_repository_mnpl_advanced_search($query, $startPage = 1) { - module_load_include('inc', 'fedora_repository', 'SearchClass'); - $searchClass = new SearchClass(); - $retVal = $searchClass->custom_search($query, $startPage); - return $searchClass->custom_search($query, $startPage); -} - -/** - * fedora repository mnpl_advanced search form submit - * @param type $form - * @param type $form_state - */ -function fedora_repository_mnpl_advanced_search_form_submit($form, &$form_state) { - $type_id = $form_state['values']['type']; - $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); - $searchString = $form_state['values']['type1'] . ':' . $form_state['values']['fedora_terms1']; - if ($form_state['values']['fedora_terms2'] != '') { - $searchString .=' +' . $form_state['values']['andor1'] . '+' . $form_state['values']['type2'] . ':' . $form_state['values']['fedora_terms2']; - } - if ($repeat > 2 && $repeat < 9) { - for ($i = 3; $i < $repeat + 1; $i++) { - $t = $i - 1; - if ($form_state['values']["fedora_terms$i"] != '') { - $searchString .= '+' . $form_state['values']["andor$t"] . '+' . $form_state['values']["type$i"] . ':' . $form_state['values']["fedora_terms$i"]; - } - } - } - drupal_goto("fedora/repository/mnpl_advanced_search/$searchString"); -} - -/** - * fedora repository install demo page - * @return type - */ -function fedora_repository_install_demos_page() { - $output = drupal_get_form('fedora_repository_demo_objects_form'); - return $output; -} - -/** - * fedora repository demo objects form - * @return string - */ -function fedora_repository_demo_objects_form() { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $form = array(); - $existing_demos = array(); - - $form['install_demos'] = array( - '#title' => t('Islandora Demo Collections'), - '#type' => 'fieldset', - '#description' => t('Install demo image and document collections and content models.'), - ); - $demo_objects = array(); -// Check if the top-level islandora collection exists. If not, display a button to ingest. - - $form['install_demos']['demo_collections'] = array( - '#type' => 'checkboxes', - '#title' => t('Collections to ingest'), - '#options' => array(), - '#description' => t('Choose which demo collections you would like ingested into the repository.'), - ); - - foreach (array( - 'islandora:collectionCModel' => 'Islandora default content models', - 'islandora:root' => 'Islandora top-level collection', - 'islandora:demos' => 'Islandora demos collection', - 'islandora:largeimages' => 'Sample large image content model (requires <a href="http://sourceforge.net/projects/djatoka/">Djatoka</a> and <a href="http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22">Kakadu</a>.)', - ) - as $available_demo => $available_demo_desc) { - try { - $demo_objects[$available_demo] = new Fedora_Item($available_demo); - } catch (exception $e) { - - } - - if (empty($demo_objects[$available_demo]->objectProfile)) { -//The demo objects collection does not exist in the repository, display a button to ingest them. - $form['install_demos']['demo_collections']['#options'][$available_demo] = $available_demo_desc; - } - else { - array_push($existing_demos, $demo_objects[$available_demo]); - } - } - -// Check if the SmileyStuff collectoin exists, and if it has a COLLECTION_VIEW datastream. If it doesn't then we can add it. - - $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); - if (!empty($smiley_stuff->objectProfile)) { - $datastreams_list = $smiley_stuff->get_datastreams_list_as_array(); - if (empty($datastreams_list['COLLECTION_VIEW'])) { - $form['install_demos']['demo_collections']['#options']['demo:SmileyStuff'] = 'Add Islandora Collection View to Fedora Smiley Stuff Collection'; - } - else { - $demo_objects['demo:SmileyStuff'] = $smiley_stuff; - } - } - else { - $form['install_demos']['smileynote'] = array( - '#value' => '<p>If you install the ' . l('fedora demo objects', 'https://wiki.duraspace.org/display/FCR30/Demonstration+Objects') . ' Islandora can display them as a collection.</p>' - ); - } - - $form['install_demos']['ingest'] = array( - '#type' => 'submit', - '#name' => 'install_demos', - '#value' => 'Install Selected Demos', - '#disabled' => (empty($form['install_demos']['demo_collections']['#options'])) ? TRUE : FALSE, - ); - - $form['existing_demos'] = array( - '#prefix' => '<p>Demo collections already installed in this repository:</p><ul>', - '#suffix' => '</ul>', - ); - - if (!empty($existing_demos)) { - foreach ($existing_demos as $pid => $demo_object) { - - $form['existing_demos'][$demo_object->pid] = array( - '#prefix' => '<li>', - '#value' => l($demo_object->pid, $demo_object->url()), - '#suffix' => '</li>', - ); - } - } - - return $form; -} - -/** - * fedora repository demo objects form submit - * @global type $base_url - * @param type $form - * @param type $form_state - */ -function fedora_repository_demo_objects_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - global $base_url; - if ($form_state['clicked_button']['#name'] == 'install_demos') { - if (!empty($form_state['values']['demo_collections']['islandora:collectionCModel'])) { - try { - $collectioncm = Fedora_Item::ingest_new_item('islandora:collectionCModel', 'A', 'Islandora Collection Content Model'); - $collectioncm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); - $collectioncm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); - } catch (exception $e) { - - } - try { - $strictpdfcm = Fedora_Item::ingest_new_item('islandora:strict_pdf', 'A', 'Strict PDF Content Model'); - $strictpdfcm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); - $strictpdfcm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STRICT_PDFCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); - } catch (exception $e) { - - } - -// Install a collection object that points to all content model objects - try { - $cmodel_collection_xml = Fedora_Item::create_object_FOXML('islandora:ContentModelCollection'); - $cmodel_collection = Fedora_Item::ingest_from_FOXML($cmodel_collection_xml); - -//$dc = new Dublin_Core(new Fedora_Item('islandora:ContentModelCollection')); - $dc = new Dublin_Core($cmodel_collection); - $dc->set_element('dc:title', array('Installed Content Model')); - $dc->save(); - $cmodel_collection->add_datastream_from_string('select $object $title from <#ri> - where ($object <dc:title> $title - and ($object <fedora-model:hasModel> <info:fedora/fedora-system:ContentModel-3.0> - or $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:ContentModelsCollection>) - and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) - order by $title', 'QUERY', 'Content Model Collection Query', 'text/plain'); - $cmodel_collection->add_relationship('isMemberOfCollection', 'islandora:root'); - $cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); - $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); - drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:ContentModelCollection\">islandora:ContentModelCollection</a>."), 'message'); - } catch (exception $e) { - - } - } - - if (!empty($form_state['values']['demo_collections']['islandora:root'])) { - $new_item = Fedora_Item::ingest_new_item('islandora:root', 'A', 'Islandora Top-level Collection'); - $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); - try { - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:root\">islandora:root</a>."), 'message'); - } catch (exception $e) { - - } - } - - if (!empty($form_state['values']['demo_collections']['islandora:demos'])) { - $new_item = fedora_item::ingest_new_item('islandora:demos', 'A', 'Islandora Demo Collection'); - $new_item->add_relationship('isMemberOfCollection', 'islandora:root'); - $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); - -// $cv = $new_item->add_datastream_from_file( drupal_get_path('module', 'fedora_repository') . '/collection_views/COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View.xml', 'text/xml', 'X'); - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - try { - $new_item = Fedora_Item::ingest_new_item('islandora:pdf_collection', 'A', 'PDF Collection'); - $new_item->add_relationship('isMemberOfCollection', 'islandora:demos'); - $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:demos\">islandora:demos</a>."), 'message'); - } catch (exception $e) { - - } - } - - if (!empty($form_state['values']['demo_collections']['demo:SmileyStuff'])) { - $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); - $new_item = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/SmileyStuff-COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); - $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(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/demo:SmileyStuff\">demo:SmileyStuff</a> collection view."), 'message'); - } catch (exception $e) { - - } - } - - if (!empty($form_state['values']['demo_collections']['islandora:largeimages'])) { - $error = ''; - foreach (array('islandora_jp2Sdep-slideCModel.xml', 'islandora_mods2htmlSdef.xml', 'islandora_mods2htmlSdep.xml', - 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { - try { - $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/' . $foxml_file); - } catch (exception $e) { - $error .= " - Problem ingesting $foxml_file"; - } - } - try { - $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/islandora_largeimages.xml'); - $tn = $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:largeimages\">islandora:largeimages</a>."), 'message'); - } catch (exception $e) { - $error .= " - Problem ingesting islandora:largeimages collection"; - } - } - - if (!empty($error)) { - drupal_set_message(t('Some problems occurred: ' . $error)); - } - } -} - -/** - * fedora repository required fedora objects - * @return type - */ -function fedora_repository_required_fedora_objects() { -// array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) - $module_path = drupal_get_path('module', 'fedora_repository'); - return array( - 'fedora_repository' => array( - 'module' => 'fedora_repository', - 'title' => 'Islandora Core', - 'objects' => array( - array( - 'pid' => 'islandora:collectionCModel', - 'label' => 'Islandora Collection Content Model', - 'dsid' => 'ISLANDORACM', - 'datastream_file' => "$module_path/content_models/COLLECTIONCM.xml", - 'dsversion' => 2, - 'cmodel' => 'fedora-system:ContentModel-3.0', - ), - - array( - 'pid' => 'islandora:root', - 'label' => 'Islandora Top-level Collection', - 'cmodel' => 'islandora:collectionCModel', - 'datastreams' => array( - array( - 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", - ), - array( - 'dsid' => 'TN', - 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", - 'mimetype' => 'image/png', - ), - ), - ), - ), - ), - ); -} - -/** - * Functions to create a time selector form element type. - */ -function fedora_repository_elements() { - $type['fedora_repository_time'] = array( - "#input" => TRUE, - "#process" => array("fedora_repository_expand_time"), - ); - - return $type; -} - -/** - * fedora repository expand time - * @param type $element - * @return string - */ -function fedora_repository_expand_time($element) { -// Default to current time, check default_value but set value so that if -// default value is present it will override value - if (empty($element['#default_value'])) { - $element['#value'] = array( - 'hour' => intval(format_date(time(), 'custom', 'h')), - 'minute' => intval(format_date(time(), 'custom', 'i')), - ); - } - - $element['#tree'] = TRUE; - - foreach ($element['#value'] as $type => $value) { - switch ($type) { - case 'hour': - $options = drupal_map_assoc(range(1, 24)); - break; - case 'minute': - $options = range(0, 59); - break; - } - - if ($type != 'meridiem') { - foreach ($options as $option) { - strlen($option) <= 1 ? $options[$option] = 0 . $option : ''; - } - } - - $element[$type] = array( - '#type' => 'select', - '#default_value' => $element['#value'][$type], - '#options' => $options, - ); - } - - return $element; -} - -/** - * fedora repository time - * @param type $element - * @return type - */ -function fedora_repository_time($element) { - $output = '<div class="container-inline">' . $element['#children'] . '</div>'; - return theme('form_element', $element, $output); -} - -/** - * theme fedora repository time - * @param type $element - * @return type - */ -function theme_fedora_repository_time($element) { - $output = '<div class="container-inline">' . $element['#children'] . '</div>'; - return theme('form_element', $element, $output); -} - -/* Export (basket) functionality */ - -/** - * fedora repository remove item from basket - * @param type $pid - */ -function fedora_repository_remove_item_from_basket($pid) { - - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; - - $objectHelper = new ObjectHelper(); -// getting child PIDs if any - $cpids = $objectHelper->get_child_pids(array($pid)); - - if (array_key_exists($pid, $pids)) { -// remove item from basket - unset($_SESSION['basket']['processed'][$pid]); - } - if (!empty($cpids)) { // there are children - foreach ($cpids as $child_pid => $value) { -// remove child item from basket recursively - fedora_repository_remove_item_from_basket($child_pid); - } - } -} - -/** - * fedora repository basket - * @return type - */ -function fedora_repository_basket() { - $pids = _fedora_repository_get_basket_pids(); - $output = drupal_get_form('fedora_repository_basket_form', $pids); - - return $output; -} - -function fedora_repository_basket_form($form_state, $pids) { - $form = array(); - - if (!empty($pids)) { - $form['pid'] = array(); - $form['title'] = array(); - $form['desc'] = array(); - } - else { - return; - } - - ksort($pids); - foreach ($pids as $pid => $arr) { - $cbs[$pid] = ''; - - $form['pid'][$pid] = array('#value' => l($pid, "fedora/repository/$pid")); - $form['title'][$pid] = array('#value' => $arr['title']); - $form['desc'][$pid] = array('#value' => $arr['desc']); - } - - $form['remove'] = array( - '#type' => 'checkboxes', - '#options' => $cbs, - ); - - $form['remove_submit'] = array( - '#type' => 'submit', - '#value' => t('Remove selected'), - ); - - $form['remove_all'] = array( - '#type' => 'submit', - '#value' => t('Empty basket'), - ); - - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Export selected'), - ); - - $form['submit_all'] = array( - '#type' => 'submit', - '#value' => t('Export all'), - ); - - return $form; -} - -/** - * theme fedora repository basket form - * @param type $form - * @return string - */ -function theme_fedora_repository_basket_form($form) { - $header = array( - theme('table_select_header_cell'), - t('PID'), - t('Title'), - t('Description'), - ); - - if (isset($form['pid']) && is_array($form['pid'])) { - foreach (element_children($form['pid']) as $key) { - $rows[] = array( - drupal_render($form['remove'][$key]), - drupal_render($form['pid'][$key]), - drupal_render($form['title'][$key]), - drupal_render($form['desc'][$key]), - ); - } - } - else { - $rows[] = array(array('data' => t('Your basket is empty.'), 'colspan' => '4')); - } - - $output = theme('table', $header, $rows); - - $frm = drupal_render($form); - $output = $frm . $output . $frm; - - return $output; -} - -/** - * fedora repository basket form validate - * @param type $form - * @param type $form_state - */ -function fedora_repository_basket_form_validate($form, &$form_state) { - -} - -/** - * fedora repository basket form submit - * @global type $user - * @param type $form - * @param type $form_state - * @return type - */ -function fedora_repository_basket_form_submit($form, &$form_state) { - if ($form_state['values']['op'] == $form_state['values']['remove_submit']) { - $pids = $form_state['clicked_button']['#post']['remove']; - - if (isset($pids)) { - foreach ($pids as $pid) { - fedora_repository_remove_from_basket($pid); - } - drupal_set_message(t("Selected objects removed")); - return; - } - } - - if ($form_state['values']['op'] == $form_state['values']['remove_all']) { - _fedora_repository_empty_basket(); - drupal_set_message(t("Basket emptied")); - return; - } - - if ($form_state['values']['op'] == $form_state['values']['submit_all']) { - $msg = t("All objects exported to staging area"); - $pids = _fedora_repository_get_basket_pids(); - } - elseif ($form_state['values']['op'] == $form_state['values']['submit']) { - $msg = t("Selected objects exported to staging area"); - $pids = array_filter($form_state['values']['remove']); - } - - if (!empty($pids)) { - global $user; - $log = array(); - $success = TRUE; - $export_dir = variable_get('export_area', file_directory_path() . '/fedora_export_area') . '/' . $user->name . '/' . date("Ymd-His"); - $foxml_dir = $export_dir . '/foxml'; - - if (!file_exists($foxml_dir) && !@mkdir($foxml_dir, 0775, TRUE)) { - drupal_set_message(t("Failed to create foxml dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $foxml_dir)), 'error'); - return FALSE; - } - - module_load_include('inc', 'fedora_repository', 'api/fedora_export'); - foreach ($pids as $pid => $arr) { - - $objects_dir = $export_dir . '/objects/' . $pid; - if (!file_exists($objects_dir) && !@mkdir($objects_dir, 0775, TRUE)) { - drupal_set_message(t("Failed to create objects dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $objects_dir)), 'error'); - return FALSE; - } - - if (!export_to_export_area($pid, $foxml_dir, $objects_dir, $log)) { - $success = FALSE; - } - } - $msg = $success ? $msg : t("Failed to export objects to staging area"); - $msg .= ":<br/>" . implode("<br/>", $log); - - drupal_set_message($msg, $success ? 'info' : 'error'); -//_fedora_repository_empty_basket(); - } - else { - drupal_set_message(t("No objects selected or basket empty"), 'error'); - } - - return; -} - -/** - * Get all pids saved to the basket. - * - * @return type - */ -function _fedora_repository_get_basket_pids() { - -// Set empty defaults if basket elements are missing - $_SESSION['basket'] = isset($_SESSION['basket']) ? $_SESSION['basket'] : array('processed' => array(), 'unprocessed' => array()); - $_SESSION['basket']['processed'] = isset($_SESSION['basket']['processed']) ? $_SESSION['basket']['processed'] : array(); - $_SESSION['basket']['unprocessed'] = isset($_SESSION['basket']['unprocessed']) ? $_SESSION['basket']['unprocessed'] : array(); - - $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; - - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $ob = new ObjectHelper(); - foreach ($_SESSION['basket']['unprocessed'] as $pid) { -// Check if the pid already exists in the tree - if (array_key_exists($pid, $pids)) { - continue; - } - - $pids += $ob->get_all_related_pids($pid); -// $pids += array($pid); - } - - $_SESSION['basket']['processed'] = $pids; - $_SESSION['basket']['unprocessed'] = array(); - - return $pids; -} - -/** - * fedora repository empty basket - */ -function _fedora_repository_empty_basket() { - unset($_SESSION['basket']); -} - -/** - * fedora repository add to basket - * @param type $pid - * @param type $warn - * @param type $searchResultsFlag - */ -function fedora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) { - if ($warn && _is_added_to_basket($pid)) { - drupal_set_message(t("Object already in basket")); - } - - if (!isset($_SESSION['basket'])) { - $_SESSION['basket'] = array(); - $_SESSION['basket']['unprocessed'] = array($pid => $pid); - } - else { - $_SESSION['basket']['unprocessed'][$pid] = $pid; - } - - if (!$searchResultsFlag) { - drupal_goto('fedora/basket'); - } -} - -/** - * fedora repository remove from basket - * @param type $pid - * @return type - */ -function fedora_repository_remove_from_basket($pid) { - if (isset($_SESSION['basket']['unprocessed'][$pid])) { - unset($_SESSION['basket']['unprocessed'][$pid]); - } - - if (isset($_SESSION['basket']['processed'][$pid])) { - unset($_SESSION['basket']['processed'][$pid]); - } - return; -} - -/** - * theme add to basket link - * @param type $pid - * @param type $type - * @return type - */ -function theme_add_to_basket_link($pid, $type = 'object') { - $object = t($type); - $path = drupal_urlencode($pid); - - $save = "export_big.png"; - $saved = "exported_big.png"; -// $path = drupal_get_path('module', 'Fedora_Repository').'/images/'.$save ; - /* - var_dump($path); - var_dump(theme('image',drupal_get_path('module', 'Fedora_Repository').'/images/'.$save)); - die(); - */ - if (!_is_added_to_basket($pid)) { - return l( - theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), - "fedora/repository/addToBasket/" . $path, - array('html' => TRUE) - ); - } - - return theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $saved, t("In basket"), t("This @object is already in your basket", array('@object' => $object))); -} - -/** - * is added to basket - * @param type $pid - * @param type $account - * @return type - */ -function _is_added_to_basket($pid, $account = NULL) { - return isset($_SESSION['basket']['unprocessed'][$pid]) || isset($_SESSION['basket']['processed'][$pid]); -// return db_result(db_query("SELECT uid FROM {repository_basket} WHERE uid = %d AND pid = '%s'", $account->uid, $pid)); -} - -/** - * fedora repository display schema - * @param type $file - * @return type - */ -function fedora_repository_display_schema($file) { - $path = drupal_get_path('module', 'fedora_repository'); - if (strtolower(substr($file, -3)) == 'xsd' && file_exists($path . '/' . $file)) { - drupal_goto($path . '/' . $file); - } - else { - drupal_goto(); - } - return; -} - -/** - * fedora repository batch reingest object - * @param type $object - * @param type $context - * @return type - */ -function fedora_repository_batch_reingest_object($object, &$context) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!empty($object) && is_array($object)) { - $pid = $object['pid']; - if (!valid_pid($pid)) { - return NULL; - } -// Does the object exist? If so, purge it. - $item = new Fedora_Item($pid); - if ($item->exists()) { - $item->purge(t('Remove during re-install batch job')); - } - -// Ingest the object from the source file. - if (!empty($object['foxml_file'])) { - $foxml_file = $object['foxml_file']; - $new_item = Fedora_Item::ingest_from_FOXML_file($foxml_file); - if ($new_item->exists()) { -// Batch operation was successful. - $context['message'][] = "$new_item->pid installed."; - } - } - if (!empty($object['dsid']) && !empty($object['datastream_file'])) { - $datastreams = array( - array( - 'dsid' => $object['dsid'], - 'datastream_file' => $object['datastream_file'], - ) - ); - } - elseif (!empty($object['datastreams'])) { - $datastreams = $object['datastreams']; - } - - if (!empty($datastreams) && is_array($datastreams)) { - $label = !empty($object['label']) ? $object['label'] : ''; - if (empty($object['foxml_file']) && !isset($new_item)) { - $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); - } - if (!empty($object['cmodel'])) { - $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); - } - if (!empty($object['parent'])) { - $new_item->add_relationship('isMemberOfCollection', $object['parent']); - } - 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'); - } - } - } - } -} - -/** - * Content model, collection view and collection policy datastreams may now optionally define a version - * number in their top-level XML element as an attribute, as in: - * <content_model name="Collection" version="2" ... - * - * @param Fedora_Item $item - * @param string $dsid - * @param string $datastream_file - * @return int, or NULL if no version attribute was found. - */ -function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid = NULL, $datastream_file = NULL) { - $return = NULL; - if (isset($item)) { - $doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); - } - elseif (isset($datastream_file)) { - $doc = simplexml_load_file($datastream_file); - } - - if (!empty($doc)) { - $attrs = $doc->attributes(); - foreach ($attrs as $name => $value) { - if ($name == 'version') { - $return = (int) $value; - break; - } - } - } - return $return; -} - -/** - * theme fedora repository solution pack list - * @param type $solution_packs - * @return string - */ -function theme_fedora_repository_solution_packs_list($solution_packs) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $output = ''; - $header = array(); - $rows = array(); - - - - - drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); - return $output; -} - -/** - * Implementation of hook_forms() - * @param string $form_id - * @return array - */ -function fedora_repository_forms($form_id) { - $forms = array(); - if (strpos($form_id, 'fedora_repository_solution_pack_form_') === 0) { - $forms[$form_id] = array( - 'callback' => 'fedora_repository_solution_pack_form', - ); - } - return $forms; -} diff --git a/digital_repository.solutionpacks.inc b/digital_repository.solutionpacks.inc deleted file mode 100644 index de4ce137..00000000 --- a/digital_repository.solutionpacks.inc +++ /dev/null @@ -1,175 +0,0 @@ -<?php - -/** - * @file - * Invokes a hook to any dependent modules asking them if their installations require - * any fedora objects to be present. Modules implementing this hook should return an array - * of arrays of the form: - * - * array( 'pid', 'path-to-foxml-file', 'dsid', 'path-to-datastream-file', int dsversion) - * - * where the last three options are optional. A module can either point to a simple - * foxml file to install, or can specify a datastreamstream to check for, with a - * path to load the datastream from if it isn't there. Optionally a version number - * can be included, to enable updating of content model or collection policy streams - * that may have been updated. THis is a simple whole number that should be incremented - * when changed. This value appears in as an attribute of the topmost element of the stream, - * e.g.,: - * - * <?xml version="1.0" encoding="utf-8"?> <content_model name="Collection" version="2" ... - * - * Datastreams which don't have this element are assumed to be at version 0. - */ -function fedora_repository_solution_packs_page() { - $enabled_solution_packs = module_invoke_all('required_fedora_objects'); - $output = ''; - foreach ($enabled_solution_packs as $solution_pack_module => $solution_pack_info) { - $objects = array(); - foreach ($solution_pack_info as $field => $value) { - switch ($field) { - case 'title': - $solution_pack_name = $value; - break; - case 'objects': - $objects = $value; - break; - } - } - $output .= drupal_get_form('fedora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects); - } - - return $output; -} - -/** - * Check for installed objects and add a 'Update' or 'Install' button if some objects are missing. - * @param array $solution_pack - */ -function fedora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { - // Check each object to see if it is in the repository. - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - global $base_path; - $needs_update = FALSE; - $needs_install = FALSE; - $form = array(); - $form['solution_pack_module'] = array( - '#type' => 'hidden', - '#value' => $solution_pack_module, - ); - - if (!$form_state['submitted']) { - $form['soluction_pack_name'] = array( - '#type' => 'markup', - '#value' => t($solution_pack_name), - '#prefix' => '<h3>', - '#suffix' => '</h3>', - ); - $form['objects'] = array( - '#type' => 'fieldset', - '#title' => "Objects", - '#weight' => 10, - '#attributes' => array('class' => 'collapsed'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - $table_header = array('PID', 'Status'); - $table_rows = array(); - - - foreach ($objects as $object) { - $datastreams = NULL; - if (isset($object['pid'])) { - $pid = $object['pid']; - - $item = new Fedora_Item($pid); - $table_row = array($object['pid']); - $object_status = t('Up-to-date'); - if (!$item->exists()) { - $object_status = 'Missing'; - $needs_install = TRUE; - } - else { - if (isset($object['dsid']) && isset($object['datastream_file']) && isset($object['dsversion'])) { - $datastreams = array( - array( - 'dsid' => $object['dsid'], - 'datastream_file' => $object['datastream_file'], - 'dsversion' => $object['dsversion'], - ), - ); - } - elseif (!empty($object['datastreams'])) { - $datastreams = $object['datastreams']; - } - if (!empty($datastreams) && is_array($datastreams)) { - foreach ($datastreams as $ds) { - $ds_list = $item->get_datastreams_list_as_array(); - if (!array_key_exists($ds['dsid'], $ds_list)) { - $needs_update = TRUE; - $object_status = 'Missing datastream'; - break; - } - if (isset($ds['dsversion'])) { - // Check if the datastream is versioned and needs updating. - $installed_version = fedora_repository_get_islandora_datastream_version($item, $ds['dsid']); - $available_version = fedora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); - if ($available_version > $installed_version) { - $needs_update = TRUE; - $object_status = 'Out of date'; - break; - } - } - } - } - } - array_push($table_row, $object_status); - $table_rows[] = $table_row; - } - } - $form['objects']['table'] = array( - '#type' => 'markup', - '#value' => theme_table($table_header, $table_rows), - ); - } - - $form['install_status'] = array( - '#type' => 'markup', - '#prefix' => '<strong>' . t('Object status:') . ' </strong>', - '#suffix' => ' ', - ); - if (!$needs_install && !$needs_update) { - $form['install_status']['#value'] = theme_image('misc/watchdog-ok.png') . t('All required objects are installed and up-to-date.'); - } - else { - $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); - } - $form['submit'] = array( - '#value' => t('Install'), - '#disabled' => !$needs_install && !$needs_update, - '#type' => 'submit', - '#name' => $solution_pack_module, - ); - - $form['#submit'] = array( - 'fedora_repository_solution_pack_form_submit', - ); - return $form; -} - -function fedora_repository_solution_pack_form_submit($form, &$form_state) { - $what = $form_state; - $module_name = $form_state['values']['solution_pack_module']; - $solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); - $batch = array( - 'title' => t('Installing / updating solution pack objects'), - 'file' => drupal_get_path('module', 'fedora_repository') . '/fedora_repository.module', - 'operations' => array(), - ); - - - foreach ($solution_pack_info[$module_name]['objects'] as $object) { - // Add this object to the batch job queue. - $batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object)); - } - batch_set($batch); -} diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info deleted file mode 100644 index e54e3f05..00000000 --- a/plugins/fedora_imageapi.info +++ /dev/null @@ -1,7 +0,0 @@ -name = Fedora ImageAPI -description = Adds image manipulation support through a REST interface -package = Islandora Dependencies -dependencies[] = fedora_repository -dependencies[] = imageapi -version = 11.2.beta1 -core = 6.x diff --git a/plugins/fedora_imageapi.module b/plugins/fedora_imageapi.module deleted file mode 100644 index f3bd4481..00000000 --- a/plugins/fedora_imageapi.module +++ /dev/null @@ -1,116 +0,0 @@ -<?php - - - -function fedora_imageapi_menu() { - $items = array(); - $items['fedora/imageapi'] = array( - 'title' => t('Image manipulation functions'), - 'page callback' => 'fedora_repository_image_manip', - 'type' => MENU_CALLBACK, - 'access arguments' => array('view fedora collection'), - ); - return $items; -} - -/** - * Call out to the Drupal ImageAPI module and return the resulting image as a stream. - * - * @param string $pid - * @param string $dsid - * @param string $op - * @param string $params - */ -function fedora_repository_image_manip($pid = '', $dsid = '', $op = '', $params = '') { - module_load_include('inc', 'Fedora_Repository', 'ObjectHelper'); - module_load_include('module', 'imageapi'); - $obj = new ObjectHelper(); - $mimetype = $obj->getMimeType($pid, $dsid); - $ext = substr(strstr($mimetype, '/'), 1); - $op = (!empty($_GET['op']) ? $_GET['op'] : ''); - $safe_pid = str_replace(':', '_', $pid); - - $cache_key = 'fedora_repository_image_manip_' . md5($safe_pid . '_' . $dsid . '_' . $ext . '_' . $op . (isset($_GET['width']) ? '_' . $_GET['width'] : '') . (isset($_GET['height']) ? '_' . $_GET['height'] : '')); - if (($file = cache_get($cache_key)) === 0) { - //added the slash as sys_get_temp_dir in linux does not seem to include the slash - $tmp_file_name = sys_get_temp_dir() . '/' . $safe_pid . '_' . $dsid . '.' . $ext; - $handle = fopen($tmp_file_name, "w"); - $numbytes = fwrite($handle, $obj->getStream($pid, $dsid)); - fclose($handle); - if ($numbytes == 0) { - return; - } - - - $image = imageapi_image_open($tmp_file_name); - - switch ($op) { - case 'scale': - if (!empty($_GET['height']) || !empty($_GET['width'])) { - imageapi_image_scale($image, $_GET['width'], $_GET['height']); - } - case 'centerscale': - if (!empty($_GET['height']) && !empty($_GET['width'])) { - imageapi_image_scale_and_crop($image, $_GET['width'], $_GET['height']); - } - } - imageapi_image_close($image); - $file = file_get_contents($tmp_file_name); - cache_set($cache_key, $file, 'cache', time() + variable_get('fedora_image_blocks_cache_time', 3600)); - file_delete($tmp_file_name); - } - else { - $file = $file->data; - } - - - header("Content-type: $mimetype"); - header('Content-Disposition: attachment; filename="' . $dsid . '.' . $ext . '"'); - echo $file; - - -// return "$numbytes bytes written to ".sys_get_temp_dir()."$pid_$dsid.$ext\n"; -} - -/** - * Implementation of hook_form_alter - * - * @param unknown_type $form - * @param unknown_type $form_state - * @param unknown_type $form_id - */ -/* - function fedora_imageapi_form_alter( &$form, $form_state, $form_id) { - - switch ( $form_id ) { - case 'fedora_repository_admin': - - $fedora_base_url = $form['fedora_base_url']['#default_value']; - - $fedora_server_url = substr($fedora_base_url,0,strpos($fedora_base_url,'/',7)); - // Add the Djatoka server location. Set it to default to the same server as fedora. - $form['djatoka_server_url'] = array ( - '#type' => 'textfield', - '#title' => '<h3>'.t('Fedora Image API Module').'</h3><br />'.t('aDORe Djatoka image server resolver URL'), - '#default_value' => variable_get('djatoka_server_url', $fedora_server_url.'/adore-djatoka/resolver' ), - '#description' => t('The location of your <a href="http://african.lanl.gov/aDORe/projects/djatoka/" title="aDORe Djatoka Home Page">aDORe Djatoka</a> image server, if you have one installed.'), - '#weight' => 1, - ); - $form['openlayers_server_url'] = array( - '#type' => 'textfield', - '#title' => t('OpenLayers servlet URL'), - '#default_value' => variable_get('openlayers_server_url', $fedora_server_url.'/islandora/OpenLayers'), - '#description' => t('URL of your installation of the <a href="http://openlayers.org/">OpenLayers</a> servlet, if you have one.'), - '#weight' => 1, - ); - $form['buttons']['#weight'] = 2; - break; - } - } - - function show_openlayers_viewer() { - $output = 'Hi.'; - - return $output; - } - */ From 7b550d7346bb73029f084aca9a791581dd4982e1 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Tue, 11 Oct 2011 11:01:11 -0300 Subject: [PATCH 095/247] Modified BatchIngest to allow collections without metadata to be batch ingested --- BatchIngest.inc | 49 +++++++++++++++++------------------------- CollectionClass.inc | 1 + xsl/sparql_to_html.xsl | 5 +++-- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/BatchIngest.inc b/BatchIngest.inc index 31daa608..ed768294 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -1,13 +1,12 @@ <?php - /** * batch creation form submit * @global type $user * @param array $form * @param array $form_state * @param array $content_models -*/ + */ function batch_creation_form(&$form_state, $collection_pid, $content_models) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); @@ -35,13 +34,6 @@ function batch_creation_form(&$form_state, $collection_pid, $content_models) { '#type' => 'hidden', '#value' => $mappings, ); - $form['metadata_type'] = array( - '#title' => "Choose Metadata Type", - '#type' => 'radios', - '#options' => array('MODS' => 'MODS', "DC" => "DUBLIN CORE"), - '#required' => true, - '#description' => t("Select primary metadata schema"), - ); $form['content_model'] = array( '#title' => "Choose content model to be associated with objects ingested", '#type' => 'select', @@ -70,8 +62,7 @@ function batch_creation_form(&$form_state, $collection_pid, $content_models) { /** * @param array $form * @param array $form_state -*/ - + */ function batch_creation_form_validate($form, &$form_state) { $fieldName = 'file-location'; @@ -155,9 +146,7 @@ function batch_creation_form_submit($form, &$form_state) { foreach ($file_list as $label => $object_files) { - if ($object_files['xml']) { - $batch['operations'][] = array('create_batch_objects', array($label, $content_model, $object_files, $collection_pid, $namespace, $metadata)); - } + $batch['operations'][] = array('create_batch_objects', array($label, $content_model, $object_files, $collection_pid, $namespace, $metadata)); } $batch['operations'][] = array('recursive_directory_delete', array($tmpDir)); batch_set($batch); @@ -173,28 +162,33 @@ function batch_creation_form_submit($form, &$form_state) { * @param <string> $namespace * @param <string> $metadata */ - - function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) { module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); + $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); $allowedMimeTypes = $cm->getMimetypes(); $mime_helper = new MimeClass(); $pid = fedora_item::get_next_PID_in_namespace($namespace); - module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); + $item = Fedora_item::ingest_new_item($pid, 'A', $label, $owner); $item->add_relationship('hasModel', $content_model, FEDORA_MODEL_URI); $item->add_relationship('isMemberOfCollection', $collection_pid); - if ($metadata == 'DC') { - $dc_xml = file_get_contents($object_files['xml']); - $item->modify_datastream_by_value($dc_xml, 'DC', "Dublin Core", 'text/xml'); - } - if ($metadata == 'MODS') { - $mods_xml = file_get_contents($object_files['xml']); - $item->add_datastream_from_string($mods_xml, 'MODS'); - $dc_xml = batch_create_dc_from_mods($mods_xml); + if ($object_files['xml']) { + $data = file_get_contents($object_files['xml']); + $xml = simplexml_load_string($data); + $identifier = $xml->getName(); + if ($identifier == 'dc') { + $item->modify_datastream_by_value($data, 'DC', "Dublin Core", 'text/xml'); + } + if ($identifier == 'mods') { + $item->add_datastream_from_string($mods_xml, 'MODS'); + $dc_xml = batch_create_dc_from_mods($mods_xml); + $item->modify_datastream_by_value($dc_xml, 'DC', "Dublin Core", 'text/xml'); + } } + unset($object_files['xml']); $use_primary = TRUE; foreach ($object_files as $ext => $filename) { @@ -206,7 +200,7 @@ function create_batch_objects($label, $content_model, $object_files, $collection $item->purge("$pid $label not ingested. $file_mimetype not permitted in objects associated with $content_model"); continue; } - $ds_label = $use_primary ? $cm->getDatastreamNameDSID():$ext; + $ds_label = $use_primary ? $cm->getDatastreamNameDSID() : $ext; $item->add_datastream_from_file($filename, $ds_label); $use_primary = FALSE; @@ -223,9 +217,6 @@ function create_batch_objects($label, $content_model, $object_files, $collection * @param <string> $mods_xml * @return <string> */ - - - function batch_create_dc_from_mods($mods_xml) { $path = drupal_get_path('module', 'fedora_repository'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); diff --git a/CollectionClass.inc b/CollectionClass.inc index 4251eea4..4216733d 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -623,6 +623,7 @@ class CollectionClass { $collectionName = $collection; + if (!$pageNumber) { $pageNumber = 1; } diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index 0c037f3e..71f94a30 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -8,7 +8,7 @@ <xsl:value-of select="$path"/> </xsl:variable> <xsl:variable name="thisPid" select="$collectionPid"/> - <xsl:variable name="thisTitle" select="$collectionTitle"/> + <xsl:variable name="thisTitle" select="Collection"/> <xsl:variable name="size" select="20"/> <xsl:variable name="page" select="$hitPage"/> <xsl:variable name="start" select="((number($page) - 1) * number($size)) + 1"/> @@ -161,6 +161,7 @@ <xsl:with-param name="from" select="'_'"/> <xsl:with-param name="to" select="' '"/> </xsl:call-template> + </xsl:variable> <xsl:variable name="cleanTitle"> <xsl:value-of select="php:functionString('fedora_repository_urlencode_string', $newTitle)"/> @@ -168,7 +169,7 @@ <xsl:variable name="linkUrl"> <xsl:choose> <xsl:when test="($CONTENTMODEL='islandora:collectionCModel')"> - <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="$cleanTitle"/> + <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="'collection'"/> </xsl:when> <xsl:otherwise> <!--the below is an example of going straight to a datastream instead of the details page. From e6e30cb5014d502d957a5d98138dc23e6c7ae6e0 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 11 Oct 2011 11:04:17 -0300 Subject: [PATCH 096/247] Changed the configuration name --- formClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 93b68316..a7abe947 100644 --- a/formClass.inc +++ b/formClass.inc @@ -25,7 +25,7 @@ class formClass { $items = array(); $items['admin/settings/islandora_repository'] = array( - 'title' => t('Configure Islandora'), + 'title' => t('Islandora Configure'), 'description' => t('Enter the Islandora Collection information here'), 'page callback' => 'drupal_get_form', 'page arguments' => array('islandora_repository_admin'), From 2f8563224a220329f5d1d2dfeacb466df67a1546 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 11 Oct 2011 11:09:19 -0300 Subject: [PATCH 097/247] Changed from islandora top to islandora root --- .../foxml/{islandora-top.xml => islandora-root.xml} | 8 ++++---- tests/README_TESTING.txt | 2 +- tests/fedora_repository.test | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) rename installer_files/foxml/{islandora-top.xml => islandora-root.xml} (97%) diff --git a/installer_files/foxml/islandora-top.xml b/installer_files/foxml/islandora-root.xml similarity index 97% rename from installer_files/foxml/islandora-top.xml rename to installer_files/foxml/islandora-root.xml index 5d8c69b3..8c7fa1ac 100644 --- a/installer_files/foxml/islandora-top.xml +++ b/installer_files/foxml/islandora-root.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<foxml:digitalObject PID="islandora:top" VERSION="1.1" xmlns:foxml="info:fedora/fedora-system:def/foxml#" +<foxml:digitalObject PID="islandora:root" VERSION="1.1" xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"> <foxml:objectProperties> <foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/> @@ -97,7 +97,7 @@ 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>Islandora Top-Level Collection</dc:title> - <dc:identifier>islandora:top</dc:identifier> + <dc:identifier>islandora:root</dc:identifier> </oai_dc:dc> </foxml:xmlContent> </foxml:datastreamVersion> @@ -107,7 +107,7 @@ ID="RELS-EXT.0" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" SIZE="314"> <foxml:xmlContent> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <rdf:Description rdf:about="info:fedora/islandora:top"> + <rdf:Description rdf:about="info:fedora/islandora:root"> <hasModel rdf:resource="info:fedora/islandora:collectionCModel" xmlns="info:fedora/fedora-system:def/model#"/> </rdf:Description> </rdf:RDF> @@ -144,7 +144,7 @@ </foxml:datastream> <foxml:datastream CONTROL_GROUP="M" ID="TN" STATE="A" VERSIONABLE="true"> <foxml:datastreamVersion CREATED="2010-10-11T23:08:15.373Z" ID="TN.0" LABEL="Thumbnail.png" MIMETYPE="image/png" SIZE="16243"> - <foxml:contentLocation REF="http://localhost:8080/fedora/get/islandora:top/TN/2010-10-11T23:08:15.373Z" TYPE="INTERNAL_ID"/> + <foxml:contentLocation REF="http://localhost:8080/fedora/get/islandora:root/TN/2010-10-11T23:08:15.373Z" TYPE="INTERNAL_ID"/> </foxml:datastreamVersion> </foxml:datastream> </foxml:digitalObject> diff --git a/tests/README_TESTING.txt b/tests/README_TESTING.txt index a88a244c..f38af855 100644 --- a/tests/README_TESTING.txt +++ b/tests/README_TESTING.txt @@ -5,7 +5,7 @@ Fedora Installation The test sets up the islandora module with the default server settings. This means it will expect a Fedora server to be running on localhost:8080 with the usual defaults. The tests also expect the Islandora demo objects, i.e., -islandora:top, islandora:demos collections, etc. to be installed. (Go to +islandora:root, islandora:demos collections, etc. to be installed. (Go to Administer -> Site Configuration -> Fedora Colleciton List and click the Install Demos tab and follow the instructions.) diff --git a/tests/fedora_repository.test b/tests/fedora_repository.test index 2bfab51f..d5e59bc8 100644 --- a/tests/fedora_repository.test +++ b/tests/fedora_repository.test @@ -45,11 +45,11 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $pid_list = array(); // Create a collection for ingesting PDF content model objects. - //$this->drupalGet('fedora/ingestObject/islandora:top/Islandora%20Top-Level%20Collection'); + //$this->drupalGet('fedora/ingestObject/islandora:root/Islandora%20Top-Level%20Collection'); $ingest_form = array(); $ingest_form['models'] = 'islandora:collectionCModel/ISLANDORACM'; - $this->drupalPost('fedora/ingestObject/islandora:top/Islandora%20Top-Level%20Collection', $ingest_form, 'Next'); + $this->drupalPost('fedora/ingestObject/islandora:root/Islandora%20Top-Level%20Collection', $ingest_form, 'Next'); // Add a sample PDF object via the web ingest form. // Required fields are file location, dc:title and dc:description @@ -67,7 +67,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $ingest_form = array(); $ingest_form['models'] = 'islandora:collectionCModel/ISLANDORACM'; - $this->drupalPost('fedora/ingestObject/islandora:top/Islandora%20Top-Level%20Collection', $ingest_form, 'Next'); + $this->drupalPost('fedora/ingestObject/islandora:root/Islandora%20Top-Level%20Collection', $ingest_form, 'Next'); // Required fields are file location, dc:title and dc:description $ingest_form_step_2 = array(); $ingest_form_step_2['dc:title'] = $this->randomName(32); From 8a80b1913488e6f3f622a81cee4009ac3a6ba0c6 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Tue, 11 Oct 2011 12:16:19 -0300 Subject: [PATCH 098/247] Added installation methods for xml_forms and associations --- fedora_repository.solutionpacks.inc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index de4ce137..fb09528d 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -173,3 +173,30 @@ function fedora_repository_solution_pack_form_submit($form, &$form_state) { } batch_set($batch); } + +function solution_pack_add_form($form_name, $form_xml) { + $result = db_result(db_query('Select name from {xml_forms} where name = "%s"', $form_name)); + if (!$result) { + $object = new stdClass(); + $object->name = $form_name; + $object->form = $form_xml; + $result = drupal_write_record('xml_forms', $object); + drupal_set_message("Added $name"); + } +} + +function solution_pack_add_form_association($content_model, $form_name) { + $result = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', + $content_model, $form_name)); + if (!$result) { + $object = new stdClass(); + $object->content_model = $content_model; + $object->form_name = $form_name; + $object->dsid = 'MODS'; + $object->title_field = "['titleInfo']['title']"; + $object->transform = 'mods_to_dc.xsl'; + $result = drupal_write_record('islandora_content_model_forms', $object); + drupal_set_message("Added association between $content_model$name"); + } +} + From 27d9520519e3ab8115cd97247ef43e106a87084b Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 11 Oct 2011 13:34:45 -0300 Subject: [PATCH 099/247] Swiched back to fedora_repository --- BatchIngest.inc | 20 +- CollectionClass.inc | 42 +- CollectionManagement.inc | 24 +- CollectionPolicy.inc | 18 +- ContentModel.inc | 50 +-- ObjectHelper.inc | 68 +-- SearchClass.inc | 30 +- SecurityClass.inc | 2 +- XMLDatastream.inc | 8 +- api/fedora_collection.inc | 14 +- api/fedora_export.inc | 4 +- api/fedora_item.inc | 10 +- api/fedora_utils.inc | 12 +- ..._repository.info => fedora_repository.info | 0 ...itory.install => fedora_repository.install | 8 +- ...ository.module => fedora_repository.module | 388 +++++++++--------- ...inc => fedora_repository.solutionpacks.inc | 20 +- formClass.inc | 78 ++-- islandoracm.xsd | 10 +- plugins/CollectionFormBuilder.inc | 4 +- plugins/DarwinCore.inc | 8 +- plugins/DemoFormBuilder.inc | 6 +- plugins/DocumentConverter.inc | 2 +- plugins/Exiftool.inc | 2 +- plugins/FedoraObjectDetailedContent.inc | 12 +- plugins/Flv.inc | 2 +- plugins/FlvFormBuilder.inc | 6 +- plugins/FormBuilder.inc | 8 +- plugins/ImageManipulation.inc | 2 +- plugins/ModsFormBuilder.inc | 16 +- plugins/PersonalCollectionClass.inc | 2 +- plugins/QtFormBuilder.php | 4 +- plugins/Refworks.inc | 12 +- plugins/ShowStreamsInFieldSets.inc | 18 +- ...ora_imageapi.info => fedora_imageapi.info} | 2 +- ...imageapi.module => fedora_imageapi.module} | 8 +- plugins/herbarium.inc | 28 +- plugins/map_viewer.inc | 10 +- plugins/qt_viewer.inc | 6 +- plugins/slide_viewer.inc | 6 +- plugins/tagging_form.inc | 22 +- tests/README_TESTING.txt | 2 +- tests/fedora_repository.test | 20 +- 43 files changed, 507 insertions(+), 507 deletions(-) rename islandora_repository.info => fedora_repository.info (100%) rename islandora_repository.install => fedora_repository.install (92%) rename islandora_repository.module => fedora_repository.module (81%) rename islandora_repository.solutionpacks.inc => fedora_repository.solutionpacks.inc (84%) rename plugins/{islandora_imageapi.info => fedora_imageapi.info} (82%) rename plugins/{islandora_imageapi.module => fedora_imageapi.module} (89%) diff --git a/BatchIngest.inc b/BatchIngest.inc index f3d63cc0..31daa608 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -9,8 +9,8 @@ * @param array $content_models */ function batch_creation_form(&$form_state, $collection_pid, $content_models) { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); - module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); $cm_options = array(); $name_mappings = array(); foreach ($content_models as $content_model) { @@ -95,8 +95,8 @@ function batch_creation_form_validate($form, &$form_state) { } function batch_creation_form_submit($form, &$form_state) { - module_load_include('inc', 'islandora_repository', 'ContentModel'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $user; $namespace_mappings = array(); $content_model = $form_state['values']['content_model']; @@ -150,7 +150,7 @@ function batch_creation_form_submit($form, &$form_state) { $batch = array( 'title' => 'Ingesting Objects', 'operations' => array(), - 'file' => drupal_get_path('module', 'islandora_repository') . '/BatchIngest.inc', + 'file' => drupal_get_path('module', 'fedora_repository') . '/BatchIngest.inc', ); @@ -176,8 +176,8 @@ function batch_creation_form_submit($form, &$form_state) { function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) { - module_load_include('inc', 'islandora_repository', 'ContentModel'); - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); $allowedMimeTypes = $cm->getMimetypes(); $mime_helper = new MimeClass(); @@ -227,9 +227,9 @@ function create_batch_objects($label, $content_model, $object_files, $collection function batch_create_dc_from_mods($mods_xml) { - $path = drupal_get_path('module', 'islandora_repository'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + $path = drupal_get_path('module', 'fedora_repository'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); if ($xmlstr == NULL || strlen($xmlstr) < 5) { return " "; diff --git a/CollectionClass.inc b/CollectionClass.inc index df438aca..4251eea4 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -29,7 +29,7 @@ class CollectionClass { */ function __construct($pid = NULL) { if (!empty($pid)) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $this->collectionObject = new ObjectHelper($pid); $this->pid = $pid; } @@ -45,7 +45,7 @@ class CollectionClass { * @return type */ function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); if (!isset($itqlquery)) { // $query_string = $objectHelper->getStream($pid, 'QUERY', 0); @@ -65,8 +65,8 @@ class CollectionClass { * @return type */ function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!isset($limit)) { $limit = 1000; } @@ -74,7 +74,7 @@ class CollectionClass { $offset = 0; } global $user; - if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return ' '; } @@ -101,7 +101,7 @@ class CollectionClass { $query_string = htmlentities(urlencode($query_string)); $content = ''; - $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; $content .= do_curl($url); @@ -156,7 +156,7 @@ class CollectionClass { * @return type */ function getStream($pid, $dsid, $showError = 1) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new fedora_item($pid); return isset($item->datastreams[$dsid]) ? $item->get_datastream_dissemination($dsid) : NULL; } @@ -223,7 +223,7 @@ class CollectionClass { module_load_include('inc', 'Fedora_Repository', 'ConnectionHelper'); $pidNameSpace = $this->getPidNameSpace($pid, $dsid); $pname = substr($pidNameSpace, 0, strpos($pidNameSpace, ":")); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); return Fedora_Item::get_next_pid_in_namespace($pname); } @@ -339,7 +339,7 @@ class CollectionClass { } } // module_load_include( $phpFile, 'Fedora_Repository', ' '); - require_once(drupal_get_path('module', 'islandora_repository') . '/' . $phpFile); + require_once(drupal_get_path('module', 'fedora_repository') . '/' . $phpFile); $thisClass = new $phpClass (); $returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext); if (!$returnValue) { @@ -409,7 +409,7 @@ class CollectionClass { $ingest_form = $xml->ingest_form; //should only be one $drupal_module = strip_tags($ingest_form->form_builder_method->module->asXML()); if (empty($drupal_module)) { - $drupal_module = 'islandora_repository'; + $drupal_module = 'fedora_repository'; } $phpFile = strip_tags($ingest_form->form_builder_method->file->asXML()); $phpClass = strip_tags($ingest_form->form_builder_method->class_name->asXML()); @@ -437,11 +437,11 @@ class CollectionClass { 'name' => variable_get('fedora_admin_user', 'fedoraAdmin') ); $admin_user = user_load($username); - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $connectionHelper = new ConnectionHelper(); try { $soapClient = $connectionHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - $pidNameSpace = variable_get('islandora_repository_pid', 'vre:'); + $pidNameSpace = variable_get('fedora_repository_pid', 'vre:'); $pidNameSpace = substr($pidNameSpace, 0, strpos($pidNameSpace, ":")); $params = array( 'numPIDs' => '', @@ -460,7 +460,7 @@ class CollectionClass { $personal_collection_pid = array( 'fedora_personal_pid' => $pid ); - module_load_include('inc', 'islandora_repository', 'plugins/PersonalCollectionClass'); + module_load_include('inc', 'fedora_repository', 'plugins/PersonalCollectionClass'); $personalCollectionClass = new PersonalCollectionClass(); if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) { drupal_set_message("Did not create a personal collection object for !u", array('!u' => $user->name)); @@ -480,7 +480,7 @@ class CollectionClass { * @return type */ function getXslContent($pid, $path, $canUseDefault = TRUE) { - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + 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 @@ -497,9 +497,9 @@ class CollectionClass { * @return string */ function showFieldSets($page_number) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'CollectionManagement'); - module_load_include('inc', 'islandora_repository', 'BatchIngest'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'CollectionManagement'); + module_load_include('inc', 'fedora_repository', 'BatchIngest'); global $base_url; $tabset = array(); global $user; @@ -514,7 +514,7 @@ class CollectionClass { $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'] == 'islandora_repository_ingest_form'); + $show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_ingest_form'); $add_to_collection = $this->getIngestInterface(); $show_batch_tab = TRUE; @@ -586,7 +586,7 @@ class CollectionClass { $allow = fedora_fesl_check_roles($this->pid, 'write'); } if ($allow) { - $ingestObject = drupal_get_form('islandora_repository_ingest_form', $this->pid); + $ingestObject = drupal_get_form('fedora_repository_ingest_form', $this->pid); } } } @@ -608,7 +608,7 @@ class CollectionClass { * @return type */ function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { - $path = drupal_get_path('module', 'islandora_repository'); + $path = drupal_get_path('module', 'fedora_repository'); global $base_url; $collection_pid = $pid; //we will be changing the pid later maybe $objectHelper = new ObjectHelper(); @@ -628,7 +628,7 @@ class CollectionClass { } if (!isset($collectionName)) { - $collectionName = variable_get('islandora_repository_name', 'Collection'); + $collectionName = variable_get('fedora_repository_name', 'Collection'); } $xslContent = $this->getXslContent($pid, $path); diff --git a/CollectionManagement.inc b/CollectionManagement.inc index bb89a9fd..83bb9952 100644 --- a/CollectionManagement.inc +++ b/CollectionManagement.inc @@ -8,7 +8,7 @@ * @return array */ function collection_management_form(&$form_state, $this_collection_pid, $content_models) { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $restricted = FALSE; if (variable_get('fedora_namespace_restriction_enforced', true)) { $restricted = true; @@ -20,8 +20,8 @@ function collection_management_form(&$form_state, $this_collection_pid, $content } } } - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); - module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); $item = new Fedora_Item($this_collection_pid); $collection_name = $item->objectProfile->objLabel; $new_content_models = get_content_models_as_option_array(); @@ -224,8 +224,8 @@ function collection_management_form(&$form_state, $this_collection_pid, $content */ function collection_management_form_validate($form, &$form_state) { if ($form_state['clicked_button']['#id'] == 'create_class') { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $pid = $form_state['values']['new_collection_pid']; $item = new fedora_item($pid); if ($item->exists()) { @@ -252,14 +252,14 @@ function collection_management_form_validate($form, &$form_state) { * @param type $form_state */ function collection_management_form_submit($form, &$form_state) { - module_load_include('inc', 'islandora_repository', 'api/fedora_collection'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/dublin_core'); + module_load_include('inc', 'fedora_repository', 'api/fedora_collection'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/dublin_core'); global $user; $collection_pid = $form_state['values']['parent_collection']; $policy = CollectionPolicy::loadFromCollection($collection_pid, TRUE); if ($form_state['clicked_button']['#id'] == 'create_class') { - $module_path = drupal_get_path('module', 'islandora_repository'); + $module_path = drupal_get_path('module', 'fedora_repository'); $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; $new_collection_pid = $form_state['values']['new_collection_pid']; $new_collection_label = $form_state['values']['collection_name']; @@ -345,7 +345,7 @@ function collection_management_form_submit($form, &$form_state) { $query = htmlentities(urlencode($query)); $content = ''; - $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=csv&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query; $content .= do_curl($url); $results = explode("\n", $content); @@ -370,7 +370,7 @@ function collection_management_form_submit($form, &$form_state) { $batch = array( 'title' => "Deleting Objects from $name", 'operations' => array(), - 'file' => drupal_get_path('module', 'islandora_repository') . '/CollectionManagement.inc', + 'file' => drupal_get_path('module', 'fedora_repository') . '/CollectionManagement.inc', ); @@ -389,7 +389,7 @@ function collection_management_form_submit($form, &$form_state) { * @param <type> $pid */ function delete_objects_as_batch($pid) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $name = $user->name; $item_to_delete = new Fedora_Item($pid); $models = $item_to_delete->get_models(); diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index 0612a733..b801eaff 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -4,7 +4,7 @@ * @file * Collection Policy Class */ -module_load_include('inc', 'islandora_repository', 'XMLDatastream'); +module_load_include('inc', 'fedora_repository', 'XMLDatastream'); /** * Collection Policy class ?? @@ -36,7 +36,7 @@ class CollectionPolicy extends XMLDatastream { */ static function loadFromCollection($pid, $preFetch=TRUE) { $ret = FALSE; - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); try { if (self::valid_pid($pid)) { @@ -80,7 +80,7 @@ class CollectionPolicy extends XMLDatastream { $rootEl = $cp->xml->getElementsByTagName('collection_policy')->item(0); $rootEl->setAttribute('name', $name); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $ret = $cp; @@ -110,7 +110,7 @@ class CollectionPolicy extends XMLDatastream { $cp = new CollectionPolicy($newDom, $pid, $cpDsid); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $cpDsid, $name, 'text/xml', 'X'); $ret = $cp; @@ -137,7 +137,7 @@ class CollectionPolicy extends XMLDatastream { public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) { $ret = FALSE; if (($cp = self::loadFromCollection($pid)) === FALSE) { //removed second, non-existant variable - module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) { $newDom = new DOMDocument('1.0', 'utf-8'); $newDom->formatOutput = TRUE; @@ -171,7 +171,7 @@ class CollectionPolicy extends XMLDatastream { $cp = new CollectionPolicy($newDom, $pid, $policyDsid); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); @@ -299,7 +299,7 @@ class CollectionPolicy extends XMLDatastream { $this->staging_area = trim($stagingEl->item(0)->nodeValue); } elseif ($recurse) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $rels = $item->get_relationships(); if (count($rels) > 0) { @@ -373,7 +373,7 @@ class CollectionPolicy extends XMLDatastream { $pname = substr($namespace, 0, strpos($namespace, ":")); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $ret = Fedora_Item::get_next_pid_in_namespace($pname); } return $ret; @@ -443,7 +443,7 @@ class CollectionPolicy extends XMLDatastream { if ($recurse && count($ret) == 0) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $rels = $item->get_relationships(); if (count($rels) > 0) { diff --git a/ContentModel.inc b/ContentModel.inc index 66bd9569..b1f28074 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -8,7 +8,7 @@ * @file * Content Model Class */ -module_load_include('inc', 'islandora_repository', 'XMLDatastream'); +module_load_include('inc', 'fedora_repository', 'XMLDatastream'); /** * Conent Model ?? @@ -41,7 +41,7 @@ class ContentModel extends XMLDatastream { public static function loadFromObject($pid) { $ret = FALSE; if (self::valid_pid($pid)) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); $content_models = $objectHelper->get_content_models_list($pid); @@ -73,7 +73,7 @@ class ContentModel extends XMLDatastream { $rootEl = $cm->xml->getElementsByTagName('content_model')->item(0); $rootEl->setAttribute('name', $name); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $ret = $cm; @@ -102,7 +102,7 @@ class ContentModel extends XMLDatastream { $cm = new ContentModel($newDom, $pid, $modelDsid); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $ret = $cm; @@ -172,7 +172,7 @@ class ContentModel extends XMLDatastream { $cm = new ContentModel($newDom, $pid, $modelDsid); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedoraItem = new Fedora_Item($pid); $fedoraItem->add_datastream_from_string($cm->dumpXml(), $modelDsid, $name, 'text/xml', 'X'); $ret = $cm; @@ -199,7 +199,7 @@ class ContentModel extends XMLDatastream { */ public static function loadFromModel($pid, $dsid = NULL, $pid_namespace = NULL, $name = NULL) { $ret = FALSE; - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); try { if (self::valid_pid($pid)) { $fedoraItem = new Fedora_Item($pid); @@ -436,7 +436,7 @@ class ContentModel extends XMLDatastream { and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionHelper = new CollectionClass(); $xml = simplexml_load_string($collectionHelper->getRelatedItems($this->pid, $query)); @@ -1070,7 +1070,7 @@ class ContentModel extends XMLDatastream { $method = $ingest_form->getElementsByTagName('form_builder_method')->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Build Ingest Form: file \'' . $path . '\' does not exist.'; } @@ -1110,7 +1110,7 @@ class ContentModel extends XMLDatastream { if ($method->length > 0 && $method->item(0)->getAttribute('dsid') == $dsid) { $method = $method->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Build Edit Metadata Form: file \'' . $path . '\' does not exist.'; } @@ -1153,7 +1153,7 @@ class ContentModel extends XMLDatastream { if ($method->length > 0) { $method = $method->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Handle Edit Metadata Form: file \'' . $path . '\' does not exist.'; } @@ -1177,7 +1177,7 @@ class ContentModel extends XMLDatastream { } else { // Assume DC form if none is specified. - module_load_include('inc', 'islandora_repository', 'formClass'); + module_load_include('inc', 'fedora_repository', 'formClass'); $metaDataForm = new formClass(); $ret = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $soap_client); $form_state['storage'] = NULL; @@ -1198,7 +1198,7 @@ class ContentModel extends XMLDatastream { $method = $this->xml->getElementsByTagName('content_model')->item(0)->getElementsByTagName('edit_metadata_method'); if ($method->length > 0) { $method = $method->item(0); - $ret = array('module' => $method->getAttribute('module') == '' ? 'islandora_repository' : $method->getAttribute('module'), + $ret = array('module' => $method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module'), 'file' => $method->getAttribute('file'), 'class' => $method->getAttribute('class'), 'method' => $method->getAttribute('method'), @@ -1282,7 +1282,7 @@ class ContentModel extends XMLDatastream { } } $module = $addMethod->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $addMethod->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $addMethod->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Execute Add Datastream Methods: file \'' . $path . '\' does not exist.'; } @@ -1351,9 +1351,9 @@ class ContentModel extends XMLDatastream { if (!$preview || isset($param_array['preview'])) { $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); - if (!file_exists($path) || substr_compare($path, 'islandora_repository/', -strlen('islandora_repository/'), strlen('islandora_repository/')) === 0) { + if (!file_exists($path) || substr_compare($path, 'fedora_repository/', -strlen('fedora_repository/'), strlen('fedora_repository/')) === 0) { self::$errors[] = 'Execute Ingest Rules: file \'' . $path . '\' does not exist.'; $ret = FALSE; } @@ -1399,7 +1399,7 @@ class ContentModel extends XMLDatastream { if ($this->validate()) { $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; } @@ -1469,7 +1469,7 @@ class ContentModel extends XMLDatastream { for ($j = 0; $j < $dispMethods->length; $j++) { $method = $dispMethods->item($j); $module = $method->getAttribute('module'); - $path = drupal_get_path('module', !empty($module) ? $module : 'islandora_repository') . '/' . $method->getAttribute('file'); + $path = drupal_get_path('module', !empty($module) ? $module : 'fedora_repository') . '/' . $method->getAttribute('file'); if (!file_exists($path)) { self::$errors[] = 'Execute Form Handler: file \'' . $path . '\' does not exist.'; } @@ -1588,7 +1588,7 @@ class ContentModel extends XMLDatastream { $ret = array(); $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; $i < $dispMethods->length; $i++) { - $ret[] = array('module' => $dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module'), + $ret[] = array('module' => $dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module'), 'file' => $dispMethods->item($i)->getAttribute('file'), 'class' => $dispMethods->item($i)->getAttribute('class'), 'method' => $dispMethods->item($i)->getAttribute('method'), @@ -1694,7 +1694,7 @@ class ContentModel extends XMLDatastream { $found = FALSE; $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { - if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module')) && + if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module')) && $file == $dispMethods->item($i)->getAttribute('file') && $class == $dispMethods->item($i)->getAttribute('class') && $method == $dispMethods->item($i)->getAttribute('method')) { @@ -1732,7 +1732,7 @@ class ContentModel extends XMLDatastream { $found = FALSE; $dispMethods = $ds->getElementsByTagName('display_method'); for ($i = 0; !$found && $i < $dispMethods->length; $i++) { - if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $dispMethods->item($i)->getAttribute('module') == '') && + if ($module == ($dispMethods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $dispMethods->item($i)->getAttribute('module') == '') && $file == $dispMethods->item($i)->getAttribute('file') && $class == $dispMethods->item($i)->getAttribute('class') && $method == $dispMethods->item($i)->getAttribute('method')) { @@ -1785,7 +1785,7 @@ class ContentModel extends XMLDatastream { if (($ds = $this->getDSModel($ds)) !== FALSE) { $addDsMethod = $ds->getElementsByTagName('add_datastream_method'); if ($addDsMethod !== FALSE && $addDsMethod->length > 0) { - $ret = array('module' => $addDsMethod->item(0)->getAttribute('module') == '' ? 'islandora_repository' : $addDsMethod->item(0)->getAttribute('module'), + $ret = array('module' => $addDsMethod->item(0)->getAttribute('module') == '' ? 'fedora_repository' : $addDsMethod->item(0)->getAttribute('module'), 'file' => $addDsMethod->item(0)->getAttribute('file'), 'class' => $addDsMethod->item(0)->getAttribute('class'), 'method' => $addDsMethod->item(0)->getAttribute('method'), @@ -1936,7 +1936,7 @@ class ContentModel extends XMLDatastream { $methods = $rule->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); $found = FALSE; for ($i = 0; $found === FALSE && $i < $methods->length; $i++) { - if (($methods->item($i)->getAttribute('module') == '' ? 'islandora_repository' : $methods->item($i)->getAttribute('module')) == $module && + if (($methods->item($i)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($i)->getAttribute('module')) == $module && $methods->item($i)->getAttribute('file') == $file && $methods->item($i)->getAttribute('class') == $class && $methods->item($i)->getAttribute('method') == $method) { @@ -1989,7 +1989,7 @@ class ContentModel extends XMLDatastream { $methodsEl = $rule->getElementsByTagName('ingest_methods')->item(0); $methods = $methodsEl->getElementsByTagName('ingest_method'); for ($i = 0; !$found && $i < $methods->length; $i++) { - if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'islandora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { + if (( trim($methods->item($i)->getAttribute('module')) == $module || (trim($methods->item($i)->getAttribute('module')) == '' && $module == 'fedora_repository')) && trim($methods->item($i)->getAttribute('file')) == $file && trim($methods->item($i)->getAttribute('class')) == $class && trim($methods->item($i)->getAttribute('method')) == $method) { $found = $methods->item($i); } } @@ -2077,7 +2077,7 @@ class ContentModel extends XMLDatastream { $methods = $rules->item($i)->getElementsByTagName('ingest_methods')->item(0)->getElementsByTagName('ingest_method'); for ($j = 0; $j < $methods->length; $j++) { - $method = array('module' => $methods->item($j)->getAttribute('module') == '' ? 'islandora_repository' : $methods->item($j)->getAttribute('module'), + $method = array('module' => $methods->item($j)->getAttribute('module') == '' ? 'fedora_repository' : $methods->item($j)->getAttribute('module'), 'file' => $methods->item($j)->getAttribute('file'), 'class' => $methods->item($j)->getAttribute('class'), 'method' => $methods->item($j)->getAttribute('method'), @@ -2157,7 +2157,7 @@ class ContentModel extends XMLDatastream { $ret = FALSE; if ($this->validate()) { $method = $this->xml->getElementsByTagName('ingest_form')->item(0)->getElementsByTagName('form_builder_method')->item(0); - $ret = array('module' => ($method->getAttribute('module') == '' ? 'islandora_repository' : $method->getAttribute('module')), + $ret = array('module' => ($method->getAttribute('module') == '' ? 'fedora_repository' : $method->getAttribute('module')), 'file' => $method->getAttribute('file'), 'class' => $method->getAttribute('class'), 'method' => $method->getAttribute('method'), diff --git a/ObjectHelper.inc b/ObjectHelper.inc index da56852b..9e9995b7 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -33,7 +33,7 @@ class ObjectHelper { */ function ObjectHelper() { drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $connectionHelper = new ConnectionHelper(); //$this->fedoraUser = $connectionHelper->getUser(); //$this->fedoraPass = $connectionHelper->getPassword(); @@ -56,7 +56,7 @@ class ObjectHelper { */ function makeObject($pid, $dsID, $asAttachment = FALSE, $label = NULL, $filePath=FALSE, $version=NULL, $forceSoap = TRUE) { global $user; - module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); if ($pid == NULL || $dsID == NULL) { drupal_set_message(t("no pid or dsid given to create an object with"), 'error'); return ' '; @@ -69,7 +69,7 @@ class ObjectHelper { return ' '; } - if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access Fedora objects within the attempted namespace."), 'error'); drupal_access_denied(); return ' '; @@ -91,7 +91,7 @@ class ObjectHelper { } } - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($pid); @@ -176,7 +176,7 @@ class ObjectHelper { * for the mimetype in question. */ if ($pos === FALSE) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); $mimeclass = new MimeClass(); $ext = $mimeclass->get_extension($mimeType); $suggestedFileName = "$label.$ext"; @@ -207,7 +207,7 @@ class ObjectHelper { * @return type */ function getCollectionInfo($pid, $query = NULL) { - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); $results = $collectionClass->getRelatedItems($pid, $query); return $results; @@ -227,12 +227,12 @@ class ObjectHelper { drupal_set_message(t('You must specify an object pid and datastream ID.'), 'error'); return ''; } - if (!islandora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t('You do not have the appropriate permissions'), 'error'); return; } - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new fedora_item($pid); $datastream_list = $item->get_datastreams_list_as_SimpleXML(); if (!isset($datastream_list)) { @@ -262,12 +262,12 @@ class ObjectHelper { drupal_set_message(t('You must specify an object pid and datastream ID.'), 'error'); return ''; } - if (!islandora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(ObjectHelper :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t('You do not have the appropriate permissions'), 'error'); return; } - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new fedora_item($pid); $datastream_list = $item->get_datastreams_list_as_SimpleXML(); if (!isset($datastream_list)) { @@ -291,7 +291,7 @@ class ObjectHelper { */ function create_link_for_ds($pid, $dataStreamValue) { global $base_url; - $path = drupal_get_path('module', 'islandora_repository'); + $path = drupal_get_path('module', 'fedora_repository'); require_once($path . '/api/fedora_item.inc'); $item = new Fedora_Item($pid); @@ -359,8 +359,8 @@ class ObjectHelper { */ function getFormattedDC($item) { global $base_url; - $path = drupal_get_path('module', 'islandora_repository'); - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + $path = drupal_get_path('module', 'fedora_repository'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC'; $xmlstr = $item->get_datastream_dissemination($dsid); @@ -408,7 +408,7 @@ class ObjectHelper { $ds_list = $item->get_datastreams_list_as_array(); $output = $this->getFormattedDC($item); $dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC'; - $path = drupal_get_path('module', 'islandora_repository'); + $path = drupal_get_path('module', 'fedora_repository'); //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1)); if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { @@ -440,12 +440,12 @@ class ObjectHelper { */ function get_formatted_datastream_list($object_pid, $contentModels, &$fedoraItem) { global $fedoraUser, $fedoraPass, $base_url, $user; - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'ContentModel'); + 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', 'islandora_repository'); + $path = drupal_get_path('module', 'fedora_repository'); $dataStreamBody = ''; $fedoraItem = new Fedora_Item($object_pid); @@ -514,7 +514,7 @@ class ObjectHelper { * */ function getStream($pid, $dsid, $showError = FALSE) { - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $soapHelper = new ConnectionHelper(); try { $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); @@ -548,7 +548,7 @@ class ObjectHelper { * @return array */ function get_content_models_list($pid, $include_fedora_system_content_models = FALSE) { - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionHelper = new CollectionClass(); $pids = array(); $query = 'select $object from <#ri> @@ -593,7 +593,7 @@ class ObjectHelper { * @param type $pid * @return type */ - function islandora_repository_access($op, $pid) { + function fedora_repository_access($op, $pid) { global $user; $returnValue = FALSE; @@ -602,7 +602,7 @@ class ObjectHelper { $namespaceAccess = TRUE; } if ($pid == NULL) { - $pid = variable_get('islandora_repository_pid', 'islandora:root'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $nameSpaceAllowed = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $pos = NULL; @@ -632,7 +632,7 @@ class ObjectHelper { * @param $content String */ function parseContent($content, $pid, $dsId, $collection, $pageNumber = NULL) { - $path = drupal_get_path('module', 'islandora_repository'); + $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'); @@ -790,7 +790,7 @@ class ObjectHelper { return NULL; } $output = ''; - module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); if (($cm = ContentModel :: loadFromModel($contentModel)) !== FALSE && $cm->validate()) { $output .= $cm->displayExtraFieldset($pid, $page_number); } @@ -810,7 +810,7 @@ class ObjectHelper { return FALSE; } - module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); if ($dsid != NULL && $pid != NULL && ($cm = ContentModel::loadFromObject($pid)) !== FALSE) { $cm->execAddDatastreamMethods($dsid, $file); } @@ -826,7 +826,7 @@ class ObjectHelper { if (!$pid) { return FALSE; } - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Get title and descriptions for $pid $query_string = 'select $title $desc from <#ri> @@ -834,7 +834,7 @@ class ObjectHelper { and $o <dc:description> $desc and $o <mulgara:is> <info:fedora/' . $pid . '>'; - $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query_string))); @@ -868,7 +868,7 @@ class ObjectHelper { } $query_string = substr($query_string, 0, -3) . ' )'; - $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= htmlentities(urlencode($query_string)); $content = $this->doCurl($url); @@ -905,7 +905,7 @@ class ObjectHelper { * @return type */ function getObject($pid, $context = 'archive', $format = FOXML_11) { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/objects/' . $pid . '/export?context=' . $context . '&format=' . $format; $result_data = do_curl($url); @@ -921,10 +921,10 @@ class ObjectHelper { * @param type $level */ function getBreadcrumbs($pid, &$breadcrumbs, $level=10) { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; - if ($pid == variable_get('islandora_repository_pid', 'islandora:root')) { + if ($pid == variable_get('fedora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } @@ -940,7 +940,7 @@ class ObjectHelper { order by $title'; $query_string = htmlentities(urlencode($query_string)); - $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; $result = preg_split('/[\r\n]+/', do_curl($url)); @@ -950,7 +950,7 @@ class ObjectHelper { $parent = preg_replace('/^info:fedora\//', '', $matches[0]); $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); - if ($parent == variable_get('islandora_repository_pid', 'islandora:root')) { + if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } diff --git a/SearchClass.inc b/SearchClass.inc index 794d292a..3f1c78d5 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -25,14 +25,14 @@ class SearchClass { function solr_search($query, $startPage=1, $fq = NULL, $dismax = NULL) { $solrFile = trim(variable_get('islandora_solr_search_block_handler_file', 'plugins/SolrResults.inc')); - // Don't let us bust out of islandora_repository modules directory when looking for a handler + // Don't let us bust out of fedora_repository modules directory when looking for a handler if (strpos($solrField, '../')) { drupal_set_message(t('You have illegal characters in your solr handler function in the Islandora solr block config.'), 'error'); } $solrClass = trim(variable_get('islandora_solr_search_block_handler_class', 'SolrResults')); $solrFunction = trim(variable_get('islandora_solr_search_block_handler_function', 'SearchAndDisplay')); - require_once(drupal_get_path('module', 'islandora_repository') . '/' . $solrFile); + require_once(drupal_get_path('module', 'fedora_repository') . '/' . $solrFile); try { $implementation = new $solrClass(); } catch (Exception $e) { @@ -185,8 +185,8 @@ class SearchClass { * @return type */ function quickSearch($type, $query, $showForm = 1, $orderBy = 0, & $userArray) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (user_access('view fedora collection')) { $numberOfHistPerPage = '5000'; //hack for IR they do not want next button $luceneQuery = NULL; @@ -222,7 +222,7 @@ class SearchClass { } } if ($showForm) { - $output = '<Strong>Quick Search</strong><br /><table class="table-form"><tr>' . drupal_get_form('islandora_repository_quick_search_form') . '</tr></table>'; + $output = '<Strong>Quick Search</strong><br /><table class="table-form"><tr>' . drupal_get_form('fedora_repository_quick_search_form') . '</tr></table>'; } $output .= $this->applyXSLT($resultData, $orderBy); return $output; @@ -237,8 +237,8 @@ class SearchClass { * @return type */ function getTerms($fieldName, $startTerm, $displayName = NULL) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $indexName = variable_get('fedora_index_name', 'DemoOnLucene'); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); if ($startTerm == NULL) { @@ -269,8 +269,8 @@ class SearchClass { * @return type */ function custom_search($query, $startPage=1, $xslt= '/xsl/advanced_search_results.xsl', $numberOfHistPerPage = 50) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (user_access('view fedora collection')) { //$numberOfHistPerPage = '50';//hack for IR they do not want next button @@ -322,7 +322,7 @@ class SearchClass { return ' '; } - //$proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl + //$proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'userID', $user->uid); if (isset($displayName)) { @@ -390,8 +390,8 @@ class SearchClass { //inject into xsl stylesheet global $user; $proc->setParameter('', 'userID', $user->uid); - $proc->setParameter('', 'searchToken', drupal_get_token('islandora_repository_advanced_search')); //token generated by Drupal, keeps tack of what tab etc we are on - $proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl + $proc->setParameter('', 'searchToken', drupal_get_token('fedora_repository_advanced_search')); //token generated by Drupal, keeps tack of what tab etc we are on + $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->setParameter('', 'hitPageStart', $startPage); @@ -441,7 +441,7 @@ class SearchClass { //inject into xsl stylesheet //$proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on $proc->setParameter('', 'userID', $user->uid); - $proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl + $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->setParameter('', 'orderBy', $orderBy); @@ -475,7 +475,7 @@ class SearchClass { */ function theme_advanced_search_form($form, $repeat=NULL) { if (!isset($repeat)) { - $repeat = variable_get('islandora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); } $output = drupal_render($form['search_type']['type1']); @@ -515,7 +515,7 @@ class SearchClass { $form = array(); if (!isset($repeat)) { - $repeat = variable_get('islandora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); } $var0 = explode(':', $queryArray[0]); $var1 = explode(':', $queryArray[1]); diff --git a/SecurityClass.inc b/SecurityClass.inc index fbc6d3b8..0cdb2cbe 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -30,7 +30,7 @@ class SecurityClass { */ function canIngestHere($collection_pid) { global $user; - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); // get the childsecurity policy from the collection. $policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS :: $SECURITY_CLASS_SECURITY_STREAM, FALSE); diff --git a/XMLDatastream.inc b/XMLDatastream.inc index 9376aa83..d3afed09 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -168,7 +168,7 @@ abstract class XMLDatastream { //$tmpname = substr($this->pid, strpos($this->pid, ':') + 1); $tmpname = user_password(10); $this->convertFromOldSchema(); - drupal_add_js("islandora_repository_print_new_schema_$tmpname = function(tagID) { + drupal_add_js("fedora_repository_print_new_schema_$tmpname = function(tagID) { var target = document.getElementById(tagID); var content = target.innerHTML; var text = '<html><head><title>Title' + @@ -179,7 +179,7 @@ abstract class XMLDatastream { }", 'inline'); if (user_access('administer site configuration')) { - drupal_set_message('<span id="new_schema_' . $tmpname . '" style="display: none;">' . htmlentities($this->xml->saveXML()) . '</span>Warning: XMLDatastream performed conversion of \'' . $this->getIdentifier() . '\' from old schema. Please update the datastream. The new datastream contents are <a href="javascript:islandora_repository_print_new_schema_' . $tmpname . '(\'new_schema_' . $tmpname . '\')">here.</a> '); + drupal_set_message('<span id="new_schema_' . $tmpname . '" style="display: none;">' . htmlentities($this->xml->saveXML()) . '</span>Warning: XMLDatastream performed conversion of \'' . $this->getIdentifier() . '\' from old schema. Please update the datastream. The new datastream contents are <a href="javascript:fedora_repository_print_new_schema_' . $tmpname . '(\'new_schema_' . $tmpname . '\')">here.</a> '); } $rootEl = $this->xml->firstChild; @@ -246,7 +246,7 @@ abstract class XMLDatastream { * @return boolean $valid */ public function purgeVersions($start_date, $end_date = NULL) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedora_item = new Fedora_Item($this->pid); return $fedora_item->purge_datastream($this->dsid, $start_date, $end_date); } @@ -258,7 +258,7 @@ abstract class XMLDatastream { * @return string[] $ret */ public function getHistory() { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $fedora_item = new Fedora_Item($this->pid); $history = $fedora_item->get_datastream_history($this->dsid); diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index 2efd2acb..b8afc5c4 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -4,10 +4,10 @@ * @file * Operations that affect a Fedora repository at a collection level. */ -module_load_include('inc', 'islandora_repository', 'CollectionClass'); -module_load_include('inc', 'islandora_repository', 'api/fedora_item'); -module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); -module_load_include('module', 'islandora_repository'); +module_load_include('inc', 'fedora_repository', 'CollectionClass'); +module_load_include('inc', 'fedora_repository', 'api/fedora_item'); +module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); +module_load_include('module', 'fedora_repository'); /** * Exports a fedora collection object and all of its children in a format @@ -68,10 +68,10 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio * @param <type> $query_format R */ function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); global $user; - if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return array(); } @@ -111,7 +111,7 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb $content = ''; - $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; $content .= do_curl($url); diff --git a/api/fedora_export.inc b/api/fedora_export.inc index bc4fd00f..e1ed3cbd 100644 --- a/api/fedora_export.inc +++ b/api/fedora_export.inc @@ -41,7 +41,7 @@ function export_to_export_area($pid, $foxml_dir, $ob_dir, &$log = array()) { * @return string */ function export_objects_for_pid($pid, $dir, &$log) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($pid); if (!$object = $item->get_datastreams_list_as_SimpleXML($pid)) { $log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error'); @@ -85,7 +85,7 @@ function export_objects_for_pid($pid, $dir, &$log) { * @return type */ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $remove_islandora = FALSE) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $ob_helper = new ObjectHelper(); if (!$object_xml = $ob_helper->getObject($pid, 'migrate', $format)) { $log[] = log_line(t("Failed to get foxml for %pid", array('%pid' => $pid)), 'error'); diff --git a/api/fedora_item.inc b/api/fedora_item.inc index fdf7074c..4dacca8c 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -28,8 +28,8 @@ class Fedora_Item { */ function __construct($pid) { drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $this->pid = $pid; if (isset(Fedora_Item::$instantiated_pids[$pid])) { @@ -75,7 +75,7 @@ class Fedora_Item { * @return type */ function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); if (!is_file($datastream_file)) { drupal_set_message("$datastream_file not found<br />", 'warning'); return; @@ -285,7 +285,7 @@ class Fedora_Item { * @return Array of pid => title pairs that match the results */ static function find_objects_by_pattern($pattern = '*', $field = 'pid', $max_results = 100, $resultFields = array()) { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $pattern = drupal_urlencode($pattern); $done = FALSE; @@ -848,7 +848,7 @@ class Fedora_Item { */ static function soap_call($function_name, $params_array, $quiet = FALSE) { if (!self::$connection_helper) { - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); self::$connection_helper = new ConnectionHelper(); } switch ($function_name) { diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 91a8f05f..c8ce7d0e 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -158,7 +158,7 @@ function fedora_available() { */ function risearch_available() { - $response = do_curl_ext(variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch')); + $response = do_curl_ext(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch')); return ($response != NULL) ? ($response[1] == 0): FALSE; } @@ -238,13 +238,13 @@ function fix_dsid($dsid) { * @return array */ function get_collections_as_option_array() { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $query = 'select $object $title from <#ri> where ($object <dc:title> $title and $object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/islandora:collectionCModel> and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; - $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query))); $list = explode("\n", $content); @@ -269,8 +269,8 @@ function get_collections_as_option_array() { * @return array */ function get_content_models_as_option_array() { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $restricted = variable_get('fedora_namespace_restriction_enforced', true); $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); $namespaces = explode(':', $allowed_string); @@ -286,7 +286,7 @@ function get_content_models_as_option_array() { and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; - $url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query))); $list = explode("\n", $content); diff --git a/islandora_repository.info b/fedora_repository.info similarity index 100% rename from islandora_repository.info rename to fedora_repository.info diff --git a/islandora_repository.install b/fedora_repository.install similarity index 92% rename from islandora_repository.install rename to fedora_repository.install index e8e26ad2..164ce02e 100644 --- a/islandora_repository.install +++ b/fedora_repository.install @@ -1,7 +1,7 @@ <?php /** - * @file islandora_repository.install + * @file fedora_repository.install */ /** @@ -33,7 +33,7 @@ function fedora_collections_enable() { * @see _update_message_text() * @see _update_cron_notify() */ -function islandora_repository_requirements($phase) { +function fedora_repository_requirements($phase) { global $base_url; $requirements = array(); @@ -89,13 +89,13 @@ function islandora_repository_requirements($phase) { } } elseif ($phase == 'runtime') { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $requirements['fedora-repository']['title'] = t("Fedora server"); if (!fedora_available()) { $requirements['fedora-repository']['value'] = t("Not available"); $requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; - $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/islandora_repository')); + $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); } else { $requirements['fedora-repository']['value'] = t("Available"); diff --git a/islandora_repository.module b/fedora_repository.module similarity index 81% rename from islandora_repository.module rename to fedora_repository.module index 6fa13988..ea1c15c5 100644 --- a/islandora_repository.module +++ b/fedora_repository.module @@ -2,23 +2,23 @@ /** * Drupal hook for admin form - * islandora_repository_name is the name of the top level collection this module will query - * islandora_repository_pid is the name of the top level pid. + * fedora_repository_name is the name of the top level collection this module will query + * fedora_repository_pid is the name of the top level pid. * Stores this info in the drupal variables table. * the name and pid can also be passed as url parameters */ -function islandora_repository_admin() { - module_load_include('inc', 'islandora_repository', 'formClass'); +function fedora_repository_admin() { + module_load_include('inc', 'fedora_repository', 'formClass'); $adminForm = new formClass(); return $adminForm->createAdminForm(); } /** * drupal hook - * calls the islandora_repositorys_admin form + * calls the fedora_repositorys_admin form */ -function islandora_repository_menu() { - module_load_include('inc', 'islandora_repository', 'formClass'); +function fedora_repository_menu() { + module_load_include('inc', 'fedora_repository', 'formClass'); $adminMenu = new formClass(); return $adminMenu->createMenu(); } @@ -30,11 +30,11 @@ function islandora_repository_menu() { * @param type $arg * @return type */ -function islandora_repository_help($path, $arg) { +function fedora_repository_help($path, $arg) { switch ($path) { case 'admin/modules#description' : return t('Grabs a list of items from a collection in Drupal that are presented on the home page.'); - case 'node/add#islandora_repository' : + case 'node/add#fedora_repository' : return t('Use this page to grab a list of items from a Fedora collection.'); } } @@ -45,7 +45,7 @@ function islandora_repository_help($path, $arg) { * @param type $name * @return type */ -function islandora_repository_purge_object($pid = NULL, $name = NULL) { +function fedora_repository_purge_object($pid = NULL, $name = NULL) { if (!user_access('purge objects and datastreams')) { drupal_set_message(t('You do not have access to add a datastream to this object.'), 'error'); return ''; @@ -60,7 +60,7 @@ function islandora_repository_purge_object($pid = NULL, $name = NULL) { '%pid' => $pid) ); - $output .= drupal_get_form('islandora_repository_purge_object_form', $pid); + $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); return $output; } @@ -72,22 +72,22 @@ function islandora_repository_purge_object($pid = NULL, $name = NULL) { * @param type $pageNumber * @return type */ -function islandora_repository_collection_view($pid = NULL, $collection = NULL, $pageNumber = NULL) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); +function fedora_repository_collection_view($pid = NULL, $collection = NULL, $pageNumber = NULL) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); global $user; - if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return ' '; } $objectHelper = new ObjectHelper(); if ($pid == NULL) { - $pid = variable_get('islandora_repository_pid', 'islandora:root'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $content = ''; - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); $results = $collectionClass->getRelatedItems($pid, NULL); $content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber); @@ -102,9 +102,9 @@ function islandora_repository_collection_view($pid = NULL, $collection = NULL, $ * @param type $content_model * @return type */ -function islandora_repository_ingest_object($collection_pid=NULL, $collection_label = NULL, $content_model = NULL) { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); +function fedora_repository_ingest_object($collection_pid=NULL, $collection_label = NULL, $content_model = NULL) { + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); if (!user_access('ingest new fedora objects')) { drupal_set_message(t('You do not have permission to ingest.'), 'error'); return ''; @@ -124,7 +124,7 @@ function islandora_repository_ingest_object($collection_pid=NULL, $collection_la drupal_set_message(t('You must specify a collection object pid to ingest an object.'), 'error'); return ''; } - $output = drupal_get_form('islandora_repository_ingest_form', $collection_pid, $collection_label, $content_model); + $output = drupal_get_form('fedora_repository_ingest_form', $collection_pid, $collection_label, $content_model); $breadcrumbs = array(); $objectHelper = new ObjectHelper(); @@ -141,7 +141,7 @@ function islandora_repository_ingest_object($collection_pid=NULL, $collection_la * @param array $form * @param array $form_state */ -function islandora_repository_ingest_form_submit(array $form, array &$form_state) { +function fedora_repository_ingest_form_submit(array $form, array &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH if ($form_state['storage']['xml']) { if (module_exists('islandora_content_model_forms')) { @@ -152,9 +152,9 @@ function islandora_repository_ingest_form_submit(array $form, array &$form_state } else if ($form_state['clicked_button']['#id'] == 'edit-submit') { global $base_url; - module_load_include('inc', 'islandora_repository', 'CollectionClass'); - module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); - module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); $contentModelPid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); @@ -196,7 +196,7 @@ function islandora_repository_ingest_form_submit(array $form, array &$form_state * @param type $form_state * @return type */ -function islandora_repository_ingest_form_validate($form, &$form_state) { +function fedora_repository_ingest_form_validate($form, &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH if ($form_state['clicked_button']['#id'] == 'edit-submit') { switch ($form_state['storage']['step']) { @@ -223,8 +223,8 @@ function islandora_repository_ingest_form_validate($form, &$form_state) { } if (isset($form_state['values']['ingest-file-location']) && file_exists($form_state['values']['ingest-file-location'])) { - module_load_include('inc', 'islandora_repository', 'ContentModel'); - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); $file = $form_state['values']['ingest-file-location']; @@ -267,8 +267,8 @@ function islandora_repository_ingest_form_validate($form, &$form_state) { * @param type $content_model * @return type */ -function islandora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) { - module_load_include('inc', 'islandora_repository', 'formClass'); +function fedora_repository_ingest_form(&$form_state, $collection_pid, $collection_label = NULL, $content_model = NULL) { + module_load_include('inc', 'fedora_repository', 'formClass'); // 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; @@ -287,7 +287,7 @@ function islandora_repository_ingest_form(&$form_state, $collection_pid, $collec * @param type $referrer * @return type */ -function islandora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { +function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { global $base_url; if (!user_access('purge objects and datastreams')) { return NULL; @@ -311,7 +311,7 @@ function islandora_repository_purge_object_form(&$form_state, $pid, $referrer = $form['submit'] = array( '#type' => 'image_button', - '#src' => drupal_get_path('module', 'islandora_repository') . '/images/purge_big.png', + '#src' => drupal_get_path('module', 'fedora_repository') . '/images/purge_big.png', '#value' => t('Purge'), '#suffix' => 'Purge this object', ); @@ -337,7 +337,7 @@ function islandora_repository_purge_object_form(&$form_state, $pid, $referrer = * @return type */ function add_stream($collection_pid=NULL, $collectionName=NULL) { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!valid_pid($collection_pid)) { drupal_set_message(t("This PID is not valid!"), 'error'); return ' '; @@ -350,7 +350,7 @@ function add_stream($collection_pid=NULL, $collectionName=NULL) { drupal_set_message(t('You must specify an collection object pid to ingest an object.'), 'error'); return ''; } - $output .= drupal_get_form('islandora_repository_add_stream_form', $pid); + $output .= drupal_get_form('fedora_repository_add_stream_form', $pid); return $output; } @@ -368,10 +368,10 @@ function add_stream_form_submit($form, &$form_state) { $form_state['rebuild'] = TRUE; return; } - module_load_include('inc', 'islandora_repository', 'MimeClass'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - $pathToModule = drupal_get_path('module', 'islandora_repository'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $pathToModule = drupal_get_path('module', 'fedora_repository'); $file = $form_state['values']['add-stream-file-location']; @@ -413,7 +413,7 @@ function add_stream_form_submit($form, &$form_state) { * @return type */ function add_stream_form(&$form_state, $pid) { - module_load_include('inc', 'islandora_repository', 'formClass'); + module_load_include('inc', 'fedora_repository', 'formClass'); $addDataStreamForm = new formClass(); return $addDataStreamForm->createAddDataStreamForm($pid, $form_state); } @@ -470,14 +470,14 @@ function add_stream_form_validate($form, &$form_state) { * @param type $name * @return type */ -function islandora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); +function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); global $user; if ($pid == NULL || $dsId == NULL) { drupal_set_message(t('You must specify an object pid and DataStream ID to purge a datastream'), 'error'); return ' '; } - if (!islandora_repository_access(OBJECTHELPER :: $PURGE_FEDORA_OBJECTSANDSTREAMS, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER :: $PURGE_FEDORA_OBJECTSANDSTREAMS, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to purge objects."), 'error'); return ' '; } @@ -486,7 +486,7 @@ function islandora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NU array( '%name' => $name) ); - $output .= drupal_get_form('islandora_repository_purge_stream_form', $pid, $dsId); + $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); return $output; } @@ -496,8 +496,8 @@ function islandora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NU * @param type $form_state * @return type */ -function islandora_repository_purge_object_form_submit($form, &$form_state) { - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); +function fedora_repository_purge_object_form_submit($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $pid = $form_state['values']['pid']; if (!isset($form_state['storage']['confirm'])) { $form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form @@ -545,7 +545,7 @@ function islandora_repository_purge_object_form_submit($form, &$form_state) { * @param type $dsId * @return type */ -function islandora_repository_purge_stream_form(&$form_state, $pid, $dsId) { +function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) { $form['pid'] = array( '#type' => 'hidden', '#value' => "$pid" @@ -568,9 +568,9 @@ function islandora_repository_purge_stream_form(&$form_state, $pid, $dsId) { * @param type $form * @param array $form_state */ -function islandora_repository_purge_stream_form_submit($form, &$form_state) { +function fedora_repository_purge_stream_form_submit($form, &$form_state) { global $base_url; - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); //$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $pid = $form_state['values']['pid']; $item = new Fedora_Item($pid); @@ -591,12 +591,12 @@ function islandora_repository_purge_stream_form_submit($form, &$form_state) { * @param type $collectionName * @return type */ -function islandora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { +function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { if ($pid == NULL || $dsId == NULL) { drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error'); return ''; } - $output = drupal_get_form('islandora_repository_replace_stream_form', $pid, $dsId, $dsLabel); + $output = drupal_get_form('fedora_repository_replace_stream_form', $pid, $dsId, $dsLabel); return $output; } @@ -609,8 +609,8 @@ function islandora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionN * @param type $dsLabel * @return type */ -function islandora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { -//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'islandora_repository', ''); +function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { +//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); module_load_include('inc', 'Fedora_Repository', 'formClass'); //$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $replaceDataStreamForm = new formClass(); @@ -623,7 +623,7 @@ function islandora_repository_replace_stream_form(&$form_state, $pid, $dsId, $ds * @param type $form_state * @return type */ -function islandora_repository_replace_stream_form_validate($form, &$form_state) { +function fedora_repository_replace_stream_form_validate($form, &$form_state) { // If a file was uploaded, process it. if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name']['file'])) { @@ -655,7 +655,7 @@ function islandora_repository_replace_stream_form_validate($form, &$form_state) * @param type $form * @param array $form_state */ -function islandora_repository_replace_stream_form_submit($form, &$form_state) { +function fedora_repository_replace_stream_form_submit($form, &$form_state) { global $base_url; $file = $form_state['values']['file']; $pid = $form_state['values']['pid']; @@ -668,7 +668,7 @@ function islandora_repository_replace_stream_form_submit($form, &$form_state) { $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; } module_load_include('inc', 'Fedora_Repository', 'MimeClass'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $file_basename = basename($file->filepath); $file_directory = dirname($file->filepath); @@ -694,18 +694,18 @@ function islandora_repository_replace_stream_form_submit($form, &$form_state) { * @param type $dsId * @return type */ -function islandora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); +function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); global $user; if ($pid == NULL || $dsId == NULL) { drupal_set_message(t('You must specify an object pid and a Dublin Core DataStream ID to edit metadata'), 'error'); return ' '; } - if (!islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); return ' '; } - $output = drupal_get_form('islandora_repository_edit_qdc_form', $pid, $dsId); + $output = drupal_get_form('fedora_repository_edit_qdc_form', $pid, $dsId); return $output; } @@ -718,20 +718,20 @@ function islandora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { * @param type $dsId * @return type */ -function islandora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { - module_load_include('inc', 'islandora_repository', 'ContentModel'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); +function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); if ($pid == NULL) { drupal_set_message(t('You must specify an object pid!'), 'error'); } global $user; - if (!islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $pid, $user)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or you do not have permission to edit meta data for this object."), 'error'); return ' '; } - module_load_include('inc', 'islandora_repository', 'formClass'); - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + module_load_include('inc', 'fedora_repository', 'formClass'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $soapHelper = new ConnectionHelper(); $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); // Check if there is a custom edit metadata function defined in the content model. @@ -761,7 +761,7 @@ function islandora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { * @param type $form * @param boolean $form_state */ -function islandora_repository_edit_qdc_form_validate($form, &$form_state) { +function fedora_repository_edit_qdc_form_validate($form, &$form_state) { if ($form_state['storage']['xml']) { if ($form_state['storage']['step'] == 1) { $form_state['storage']['step']++; @@ -782,14 +782,14 @@ function islandora_repository_edit_qdc_form_validate($form, &$form_state) { * @param array $form_state * @return */ -function islandora_repository_edit_qdc_form_submit($form, &$form_state) { +function fedora_repository_edit_qdc_form_submit($form, &$form_state) { if ($form_state['storage']['xml']) { module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); $xml_form = new EditObjectMetadataForm($form_state); $xml_form->submit($form, $form_state); } else { - module_load_include('inc', 'islandora_repository', 'ConnectionHelper'); + module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); global $base_url; if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { @@ -799,13 +799,13 @@ function islandora_repository_edit_qdc_form_submit($form, &$form_state) { // Check the content model for a custom edit metadata form submit function. if (isset($form_state['values']['pid'])) { - module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { return $cm->handleEditMetadataForm($form_state['values']['form_id'], $form_state, $client); } } - module_load_include('inc', 'islandora_repository', 'formClass'); + module_load_include('inc', 'fedora_repository', 'formClass'); $metaDataForm = new formClass(); $return_value = $metaDataForm->updateMetaData($form_state['values']['form_id'], $form_state['values'], $client); $form_state['storage'] = NULL; @@ -820,8 +820,8 @@ function islandora_repository_edit_qdc_form_submit($form, &$form_state) { * drupal hook * creates a new permission than can be assigned to roles */ -function islandora_repository_perm() { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); +function fedora_repository_perm() { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); return array( OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, OBJECTHELPER::$EDIT_FEDORA_METADATA, @@ -845,10 +845,10 @@ function islandora_repository_perm() { * @param type $account * @return type */ -function islandora_repository_access($op, $node, $account) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); +function fedora_repository_access($op, $node, $account) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); - return $objectHelper->islandora_repository_access($op, $node, $account); + return $objectHelper->fedora_repository_access($op, $node, $account); } /** @@ -858,7 +858,7 @@ function islandora_repository_access($op, $node, $account) { * @param $dsID String */ function makeObject($pid, $dsID) { - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!valid_pid($pid)) { drupal_set_message(t("Invalid PID!"), 'error'); return ' '; @@ -874,14 +874,14 @@ function makeObject($pid, $dsID) { return ' '; } global $user; - if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_access_denied(); return; drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace."), 'error'); return ' '; } - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); $objectHelper->makeObject($pid, $dsID); } @@ -899,10 +899,10 @@ function makeObject($pid, $dsID) { * @param type $limit * @return type */ -function islandora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $page_number = NULL, $limit = NULL) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); +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', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $user; if (!fedora_available()) { @@ -916,7 +916,7 @@ function islandora_repository_get_items($pid = NULL, $dsId = NULL, $collection = } if ($pid == NULL) { - $pid = variable_get('islandora_repository_pid', 'islandora:root'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $item = new fedora_item($pid); @@ -934,9 +934,9 @@ function islandora_repository_get_items($pid = NULL, $dsId = NULL, $collection = drupal_set_message(t("Invalid dsID!"), 'error'); return ' '; } - if (!islandora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/islandora_repository'))), 'warning'); + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); } drupal_access_denied(); exit; @@ -945,7 +945,7 @@ function islandora_repository_get_items($pid = NULL, $dsId = NULL, $collection = $objectHelper = new ObjectHelper(); if ($pid == NULL) { - $pid = variable_get('islandora_repository_pid', 'islandora:root'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); if (in_array(-1, $headers)) { @@ -960,10 +960,10 @@ function islandora_repository_get_items($pid = NULL, $dsId = NULL, $collection = $content = '<div id="content-fedora">'; - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionClass = new CollectionClass(); - module_load_include('inc', 'islandora_repository', 'ContentModel'); - module_load_include('inc', 'islandora_repository', 'plugins/FedoraObjectDetailedContent'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'plugins/FedoraObjectDetailedContent'); $breadcrumbs = array(); $objectHelper->getBreadcrumbs($pid, $breadcrumbs); drupal_set_breadcrumb(array_reverse($breadcrumbs)); @@ -1009,7 +1009,7 @@ function islandora_repository_get_items($pid = NULL, $dsId = NULL, $collection = * @param type $str * @return type */ -function islandora_repository_urlencode_string($str) { +function fedora_repository_urlencode_string($str) { return htmlentities($str); } @@ -1026,7 +1026,7 @@ function islandora_repository_urlencode_string($str) { */ function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { global $user; - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); if ($pid == NULL || $dsId == NULL) { drupal_set_message(t("no pid or dsid given to create an object with!")); @@ -1046,9 +1046,9 @@ function fedora_object_as_attachment($pid, $dsId, $label=NULL, $version=NULL) { * @return type */ function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNumber = NULL) { -//do security check at islandora_repository_get_items function as it has to be called there in case +//do security check at fedora_repository_get_items function as it has to be called there in case //someone trys to come in a back door. - return islandora_repository_get_items($pid, $dsId, $collection, $pageNumber); + return fedora_repository_get_items($pid, $dsId, $collection, $pageNumber); } /** @@ -1060,20 +1060,20 @@ function repository_page($pid = NULL, $dsId = NULL, $collection = NULL, $pageNum * @return type */ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NULL) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); global $user; - if (!islandora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { //drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); drupal_access_denied(); if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/islandora_repository'))), 'error'); + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'error'); } return ' '; } if ($pid == NULL) { - $pid = variable_get('islandora_repository_pid', 'islandora:root'); + $pid = variable_get('fedora_repository_pid', 'islandora:root'); } $headers = module_invoke_all('file_download', "/fedora/repository/$pid"); if (in_array(-1, $headers)) { @@ -1105,9 +1105,9 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU * @param type $keys * @return array */ -function islandora_repository_search($op = 'search', $keys = NULL) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); +function fedora_repository_search($op = 'search', $keys = NULL) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); switch ($op) { case 'name': @@ -1140,7 +1140,7 @@ function islandora_repository_search($op = 'search', $keys = NULL) { $xmlDoc = NULL; - $path = drupal_get_path('module', 'islandora_repository'); + $path = drupal_get_path('module', 'fedora_repository'); $xmlDoc = new DomDocument(); $xmlDoc->load($path . '/searchTerms.xml'); $nodeList = $xmlDoc->getElementsByTagName('default'); @@ -1188,8 +1188,8 @@ function islandora_repository_search($op = 'search', $keys = NULL) { * @param type $resultData * @return array */ -function islandora_repository_search_page($resultData) { - $path = drupal_get_path('module', 'islandora_repository'); +function fedora_repository_search_page($resultData) { + $path = drupal_get_path('module', 'fedora_repository'); $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); $proc = NULL; if (!$resultData[0][0]['data']) { @@ -1211,7 +1211,7 @@ function islandora_repository_search_page($resultData) { //inject into xsl stylesheet $proc->setParameter('', 'searchToken', drupal_get_token('search_form')); //token generated by Drupal, keeps tack of what tab etc we are on - $proc->setParameter('', 'searchUrl', url('search') . '/islandora_repository'); //needed in our xsl + $proc->setParameter('', 'searchUrl', url('search') . '/fedora_repository'); //needed in our xsl $proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'allowedPidNameSpaces', variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); $proc->registerPHPFunctions(); @@ -1266,11 +1266,11 @@ function islandora_repository_search_page($resultData) { * @param type $form_state * @param type $form_id */ -function islandora_repository_form_alter(&$form, &$form_state, $form_id) { +function fedora_repository_form_alter(&$form, &$form_state, $form_id) { // Advanced node search form - module_load_include('inc', 'islandora_repository', 'SearchClass'); - $path = drupal_get_path('module', 'islandora_repository'); - if ($form_id == 'search_form' && arg(1) == 'islandora_repository' && user_access('use advanced search')) { + module_load_include('inc', 'fedora_repository', 'SearchClass'); + $path = drupal_get_path('module', 'fedora_repository'); + if ($form_id == 'search_form' && arg(1) == 'fedora_repository' && user_access('use advanced search')) { $default_value = $form['basic']['inline']['keys']['#default_value']; $index = strpos($default_value, '.'); $test = substr($default_value, 0, $index + 1); @@ -1312,7 +1312,7 @@ function islandora_repository_form_alter(&$form, &$form_state, $form_id) { '#value' => t('Advanced search'), '#prefix' => '<div class="action clear-block">', '#suffix' => '</div>', ); - $form['#validate'][] = 'islandora_repository_search_validate'; + $form['#validate'][] = 'fedora_repository_search_validate'; } } @@ -1322,7 +1322,7 @@ function islandora_repository_form_alter(&$form, &$form_state, $form_id) { * @param type $form * @param type $form_state */ -function islandora_repository_search_validate($form, &$form_state) { +function fedora_repository_search_validate($form, &$form_state) { // Initialise using any existing basic search keywords. $keys = $form_state['values']['processed_keys']; @@ -1342,18 +1342,18 @@ function islandora_repository_search_validate($form, &$form_state) { * fedora repository theme * @return type */ -function islandora_repository_theme() { +function fedora_repository_theme() { return array( - 'islandora_repository_mnpl_advanced_search_form' => array( + 'fedora_repository_mnpl_advanced_search_form' => array( 'arguments' => array( 'form' => NULL, ), ), - 'islandora_repository_time' => array( + 'fedora_repository_time' => array( 'arguments' => array( 'element' => NULL ), - 'islandora_repository_solution_packs_list' => array( + 'fedora_repository_solution_packs_list' => array( 'arguments' => array( 'solution_packs' => NULL, ), @@ -1370,8 +1370,8 @@ function islandora_repository_theme() { * @param type $displayName * @return type */ -function islandora_repository_list_terms($field, $startTerm = NULL, $displayName = NULL) { - module_load_include('inc', 'islandora_repository', 'SearchClass'); +function fedora_repository_list_terms($field, $startTerm = NULL, $displayName = NULL) { + module_load_include('inc', 'fedora_repository', 'SearchClass'); $searchClass = new SearchClass(); return $searchClass->getTerms($field, $startTerm, $displayName); } @@ -1380,8 +1380,8 @@ function islandora_repository_list_terms($field, $startTerm = NULL, $displayName * fedora repository mnpl advanced search form * @return type */ -function islandora_repository_mnpl_advanced_search_form() { - module_load_include('inc', 'islandora_repository', 'SearchClass'); +function fedora_repository_mnpl_advanced_search_form() { + module_load_include('inc', 'fedora_repository', 'SearchClass'); $searchClass = new SearchClass(); return $searchClass->build_advanced_search_form(); } @@ -1391,8 +1391,8 @@ function islandora_repository_mnpl_advanced_search_form() { * @param type $form * @return type */ -function theme_islandora_repository_mnpl_advanced_search_form($form) { - module_load_include('inc', 'islandora_repository', 'SearchClass'); +function theme_fedora_repository_mnpl_advanced_search_form($form) { + module_load_include('inc', 'fedora_repository', 'SearchClass'); $advanced_search_form = new SearchClass(); return $advanced_search_form->theme_advanced_search_form($form); } @@ -1403,8 +1403,8 @@ function theme_islandora_repository_mnpl_advanced_search_form($form) { * @param type $startPage * @return type */ -function islandora_repository_mnpl_advanced_search($query, $startPage = 1) { - module_load_include('inc', 'islandora_repository', 'SearchClass'); +function fedora_repository_mnpl_advanced_search($query, $startPage = 1) { + module_load_include('inc', 'fedora_repository', 'SearchClass'); $searchClass = new SearchClass(); $retVal = $searchClass->custom_search($query, $startPage); return $searchClass->custom_search($query, $startPage); @@ -1415,9 +1415,9 @@ function islandora_repository_mnpl_advanced_search($query, $startPage = 1) { * @param type $form * @param type $form_state */ -function islandora_repository_mnpl_advanced_search_form_submit($form, &$form_state) { +function fedora_repository_mnpl_advanced_search_form_submit($form, &$form_state) { $type_id = $form_state['values']['type']; - $repeat = variable_get('islandora_repository_advanced_block_repeat', t('3')); + $repeat = variable_get('fedora_repository_advanced_block_repeat', t('3')); $searchString = $form_state['values']['type1'] . ':' . $form_state['values']['fedora_terms1']; if ($form_state['values']['fedora_terms2'] != '') { $searchString .=' +' . $form_state['values']['andor1'] . '+' . $form_state['values']['type2'] . ':' . $form_state['values']['fedora_terms2']; @@ -1437,8 +1437,8 @@ function islandora_repository_mnpl_advanced_search_form_submit($form, &$form_sta * fedora repository install demo page * @return type */ -function islandora_repository_install_demos_page() { - $output = drupal_get_form('islandora_repository_demo_objects_form'); +function fedora_repository_install_demos_page() { + $output = drupal_get_form('fedora_repository_demo_objects_form'); return $output; } @@ -1446,9 +1446,9 @@ function islandora_repository_install_demos_page() { * fedora repository demo objects form * @return string */ -function islandora_repository_demo_objects_form() { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); +function fedora_repository_demo_objects_form() { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $form = array(); $existing_demos = array(); @@ -1539,24 +1539,24 @@ function islandora_repository_demo_objects_form() { * @param type $form * @param type $form_state */ -function islandora_repository_demo_objects_form_submit($form, &$form_state) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/dublin_core'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); +function fedora_repository_demo_objects_form_submit($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/dublin_core'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); global $base_url; if ($form_state['clicked_button']['#name'] == 'install_demos') { if (!empty($form_state['values']['demo_collections']['islandora:collectionCModel'])) { try { $collectioncm = Fedora_Item::ingest_new_item('islandora:collectionCModel', 'A', 'Islandora Collection Content Model'); $collectioncm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); - $collectioncm->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); + $collectioncm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); } catch (exception $e) { } try { $strictpdfcm = Fedora_Item::ingest_new_item('islandora:strict_pdf', 'A', 'Strict PDF Content Model'); $strictpdfcm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); - $strictpdfcm->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/content_models/STRICT_PDFCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); + $strictpdfcm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STRICT_PDFCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); } catch (exception $e) { } @@ -1578,8 +1578,8 @@ function islandora_repository_demo_objects_form_submit($form, &$form_state) { order by $title', 'QUERY', 'Content Model Collection Query', 'text/plain'); $cmodel_collection->add_relationship('isMemberOfCollection', 'islandora:root'); $cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); - $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); + $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); + $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:ContentModelCollection\">islandora:ContentModelCollection</a>."), 'message'); } catch (exception $e) { @@ -1589,9 +1589,9 @@ function islandora_repository_demo_objects_form_submit($form, &$form_state) { if (!empty($form_state['values']['demo_collections']['islandora:root'])) { $new_item = Fedora_Item::ingest_new_item('islandora:root', 'A', 'Islandora Top-level Collection'); $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); try { - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:root\">islandora:root</a>."), 'message'); } catch (exception $e) { @@ -1602,16 +1602,16 @@ function islandora_repository_demo_objects_form_submit($form, &$form_state) { $new_item = fedora_item::ingest_new_item('islandora:demos', 'A', 'Islandora Demo Collection'); $new_item->add_relationship('isMemberOfCollection', 'islandora:root'); $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); -// $cv = $new_item->add_datastream_from_file( drupal_get_path('module', 'islandora_repository') . '/collection_views/COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View.xml', 'text/xml', 'X'); - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); +// $cv = $new_item->add_datastream_from_file( drupal_get_path('module', 'fedora_repository') . '/collection_views/COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View.xml', 'text/xml', 'X'); + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); try { $new_item = Fedora_Item::ingest_new_item('islandora:pdf_collection', 'A', 'PDF Collection'); $new_item->add_relationship('isMemberOfCollection', 'islandora:demos'); $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); - $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); + $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:demos\">islandora:demos</a>."), 'message'); } catch (exception $e) { @@ -1620,20 +1620,20 @@ function islandora_repository_demo_objects_form_submit($form, &$form_state) { if (!empty($form_state['values']['demo_collections']['demo:SmileyStuff'])) { $smiley_stuff = new Fedora_Item('demo:SmileyStuff'); - $new_item = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_views/SmileyStuff-COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); + $new_item = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/SmileyStuff-COLLECTION_VIEW.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); $smiley_stuff->add_relationship('isMemberOfCollection', 'info:fedora/islandora:demos'); - $tn = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/smileytn.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - $cp = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/collection_policies/JPG-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy.xml', 'application/xml', 'X'); + $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', 'islandora_repository') . '/content_models/STANDARD JPG.xml', 'ISLANDORACM', 'Content Model.xml', 'application/xml', 'X'); + $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', 'islandora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); + $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(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/demo:SmileyStuff\">demo:SmileyStuff</a> collection view."), 'message'); } catch (exception $e) { @@ -1645,14 +1645,14 @@ function islandora_repository_demo_objects_form_submit($form, &$form_state) { foreach (array('islandora_jp2Sdep-slideCModel.xml', 'islandora_mods2htmlSdef.xml', 'islandora_mods2htmlSdep.xml', 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { try { - $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'islandora_repository') . '/content_models/' . $foxml_file); + $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/' . $foxml_file); } catch (exception $e) { $error .= " - Problem ingesting $foxml_file"; } } try { - $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'islandora_repository') . '/content_models/islandora_largeimages.xml'); - $tn = $item->add_datastream_from_file(drupal_get_path('module', 'islandora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); + $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/islandora_largeimages.xml'); + $tn = $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:largeimages\">islandora:largeimages</a>."), 'message'); } catch (exception $e) { $error .= " - Problem ingesting islandora:largeimages collection"; @@ -1669,12 +1669,12 @@ function islandora_repository_demo_objects_form_submit($form, &$form_state) { * fedora repository required fedora objects * @return type */ -function islandora_repository_required_fedora_objects() { +function fedora_repository_required_fedora_objects() { // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) - $module_path = drupal_get_path('module', 'islandora_repository'); + $module_path = drupal_get_path('module', 'fedora_repository'); return array( - 'islandora_repository' => array( - 'module' => 'islandora_repository', + 'fedora_repository' => array( + 'module' => 'fedora_repository', 'title' => 'Islandora Core', 'objects' => array( array( @@ -1710,10 +1710,10 @@ function islandora_repository_required_fedora_objects() { /** * Functions to create a time selector form element type. */ -function islandora_repository_elements() { - $type['islandora_repository_time'] = array( +function fedora_repository_elements() { + $type['fedora_repository_time'] = array( "#input" => TRUE, - "#process" => array("islandora_repository_expand_time"), + "#process" => array("fedora_repository_expand_time"), ); return $type; @@ -1724,7 +1724,7 @@ function islandora_repository_elements() { * @param type $element * @return string */ -function islandora_repository_expand_time($element) { +function fedora_repository_expand_time($element) { // Default to current time, check default_value but set value so that if // default value is present it will override value if (empty($element['#default_value'])) { @@ -1767,7 +1767,7 @@ function islandora_repository_expand_time($element) { * @param type $element * @return type */ -function islandora_repository_time($element) { +function fedora_repository_time($element) { $output = '<div class="container-inline">' . $element['#children'] . '</div>'; return theme('form_element', $element, $output); } @@ -1777,7 +1777,7 @@ function islandora_repository_time($element) { * @param type $element * @return type */ -function theme_islandora_repository_time($element) { +function theme_fedora_repository_time($element) { $output = '<div class="container-inline">' . $element['#children'] . '</div>'; return theme('form_element', $element, $output); } @@ -1788,9 +1788,9 @@ function theme_islandora_repository_time($element) { * fedora repository remove item from basket * @param type $pid */ -function islandora_repository_remove_item_from_basket($pid) { +function fedora_repository_remove_item_from_basket($pid) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; $objectHelper = new ObjectHelper(); @@ -1804,7 +1804,7 @@ function islandora_repository_remove_item_from_basket($pid) { if (!empty($cpids)) { // there are children foreach ($cpids as $child_pid => $value) { // remove child item from basket recursively - islandora_repository_remove_item_from_basket($child_pid); + fedora_repository_remove_item_from_basket($child_pid); } } } @@ -1813,14 +1813,14 @@ function islandora_repository_remove_item_from_basket($pid) { * fedora repository basket * @return type */ -function islandora_repository_basket() { - $pids = _islandora_repository_get_basket_pids(); - $output = drupal_get_form('islandora_repository_basket_form', $pids); +function fedora_repository_basket() { + $pids = _fedora_repository_get_basket_pids(); + $output = drupal_get_form('fedora_repository_basket_form', $pids); return $output; } -function islandora_repository_basket_form($form_state, $pids) { +function fedora_repository_basket_form($form_state, $pids) { $form = array(); if (!empty($pids)) { @@ -1874,7 +1874,7 @@ function islandora_repository_basket_form($form_state, $pids) { * @param type $form * @return string */ -function theme_islandora_repository_basket_form($form) { +function theme_fedora_repository_basket_form($form) { $header = array( theme('table_select_header_cell'), t('PID'), @@ -1909,7 +1909,7 @@ function theme_islandora_repository_basket_form($form) { * @param type $form * @param type $form_state */ -function islandora_repository_basket_form_validate($form, &$form_state) { +function fedora_repository_basket_form_validate($form, &$form_state) { } @@ -1920,13 +1920,13 @@ function islandora_repository_basket_form_validate($form, &$form_state) { * @param type $form_state * @return type */ -function islandora_repository_basket_form_submit($form, &$form_state) { +function fedora_repository_basket_form_submit($form, &$form_state) { if ($form_state['values']['op'] == $form_state['values']['remove_submit']) { $pids = $form_state['clicked_button']['#post']['remove']; if (isset($pids)) { foreach ($pids as $pid) { - islandora_repository_remove_from_basket($pid); + fedora_repository_remove_from_basket($pid); } drupal_set_message(t("Selected objects removed")); return; @@ -1934,14 +1934,14 @@ function islandora_repository_basket_form_submit($form, &$form_state) { } if ($form_state['values']['op'] == $form_state['values']['remove_all']) { - _islandora_repository_empty_basket(); + _fedora_repository_empty_basket(); drupal_set_message(t("Basket emptied")); return; } if ($form_state['values']['op'] == $form_state['values']['submit_all']) { $msg = t("All objects exported to staging area"); - $pids = _islandora_repository_get_basket_pids(); + $pids = _fedora_repository_get_basket_pids(); } elseif ($form_state['values']['op'] == $form_state['values']['submit']) { $msg = t("Selected objects exported to staging area"); @@ -1960,7 +1960,7 @@ function islandora_repository_basket_form_submit($form, &$form_state) { return FALSE; } - module_load_include('inc', 'islandora_repository', 'api/fedora_export'); + module_load_include('inc', 'fedora_repository', 'api/fedora_export'); foreach ($pids as $pid => $arr) { $objects_dir = $export_dir . '/objects/' . $pid; @@ -1977,7 +1977,7 @@ function islandora_repository_basket_form_submit($form, &$form_state) { $msg .= ":<br/>" . implode("<br/>", $log); drupal_set_message($msg, $success ? 'info' : 'error'); -//_islandora_repository_empty_basket(); +//_fedora_repository_empty_basket(); } else { drupal_set_message(t("No objects selected or basket empty"), 'error'); @@ -1991,7 +1991,7 @@ function islandora_repository_basket_form_submit($form, &$form_state) { * * @return type */ -function _islandora_repository_get_basket_pids() { +function _fedora_repository_get_basket_pids() { // Set empty defaults if basket elements are missing $_SESSION['basket'] = isset($_SESSION['basket']) ? $_SESSION['basket'] : array('processed' => array(), 'unprocessed' => array()); @@ -2000,7 +2000,7 @@ function _islandora_repository_get_basket_pids() { $pids = empty($_SESSION['basket']['processed']) ? array() : $_SESSION['basket']['processed']; - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $ob = new ObjectHelper(); foreach ($_SESSION['basket']['unprocessed'] as $pid) { // Check if the pid already exists in the tree @@ -2021,7 +2021,7 @@ function _islandora_repository_get_basket_pids() { /** * fedora repository empty basket */ -function _islandora_repository_empty_basket() { +function _fedora_repository_empty_basket() { unset($_SESSION['basket']); } @@ -2031,7 +2031,7 @@ function _islandora_repository_empty_basket() { * @param type $warn * @param type $searchResultsFlag */ -function islandora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) { +function fedora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) { if ($warn && _is_added_to_basket($pid)) { drupal_set_message(t("Object already in basket")); } @@ -2054,7 +2054,7 @@ function islandora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFl * @param type $pid * @return type */ -function islandora_repository_remove_from_basket($pid) { +function fedora_repository_remove_from_basket($pid) { if (isset($_SESSION['basket']['unprocessed'][$pid])) { unset($_SESSION['basket']['unprocessed'][$pid]); } @@ -2110,8 +2110,8 @@ function _is_added_to_basket($pid, $account = NULL) { * @param type $file * @return type */ -function islandora_repository_display_schema($file) { - $path = drupal_get_path('module', 'islandora_repository'); +function fedora_repository_display_schema($file) { + $path = drupal_get_path('module', 'fedora_repository'); if (strtolower(substr($file, -3)) == 'xsd' && file_exists($path . '/' . $file)) { drupal_goto($path . '/' . $file); } @@ -2127,9 +2127,9 @@ function islandora_repository_display_schema($file) { * @param type $context * @return type */ -function islandora_repository_batch_reingest_object($object, &$context) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); +function fedora_repository_batch_reingest_object($object, &$context) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!empty($object) && is_array($object)) { $pid = $object['pid']; if (!valid_pid($pid)) { @@ -2195,7 +2195,7 @@ function islandora_repository_batch_reingest_object($object, &$context) { * @param string $datastream_file * @return int, or NULL if no version attribute was found. */ -function islandora_repository_get_islandora_datastream_version($item = NULL, $dsid = NULL, $datastream_file = NULL) { +function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid = NULL, $datastream_file = NULL) { $return = NULL; if (isset($item)) { $doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); @@ -2221,9 +2221,9 @@ function islandora_repository_get_islandora_datastream_version($item = NULL, $ds * @param type $solution_packs * @return string */ -function theme_islandora_repository_solution_packs_list($solution_packs) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); +function theme_fedora_repository_solution_packs_list($solution_packs) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $output = ''; $header = array(); $rows = array(); @@ -2240,11 +2240,11 @@ function theme_islandora_repository_solution_packs_list($solution_packs) { * @param string $form_id * @return array */ -function islandora_repository_forms($form_id) { +function fedora_repository_forms($form_id) { $forms = array(); - if (strpos($form_id, 'islandora_repository_solution_pack_form_') === 0) { + if (strpos($form_id, 'fedora_repository_solution_pack_form_') === 0) { $forms[$form_id] = array( - 'callback' => 'islandora_repository_solution_pack_form', + 'callback' => 'fedora_repository_solution_pack_form', ); } return $forms; diff --git a/islandora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc similarity index 84% rename from islandora_repository.solutionpacks.inc rename to fedora_repository.solutionpacks.inc index 633d28fe..de4ce137 100644 --- a/islandora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -20,7 +20,7 @@ * * Datastreams which don't have this element are assumed to be at version 0. */ -function islandora_repository_solution_packs_page() { +function fedora_repository_solution_packs_page() { $enabled_solution_packs = module_invoke_all('required_fedora_objects'); $output = ''; foreach ($enabled_solution_packs as $solution_pack_module => $solution_pack_info) { @@ -35,7 +35,7 @@ function islandora_repository_solution_packs_page() { break; } } - $output .= drupal_get_form('islandora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects); + $output .= drupal_get_form('fedora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects); } return $output; @@ -45,9 +45,9 @@ function islandora_repository_solution_packs_page() { * Check for installed objects and add a 'Update' or 'Install' button if some objects are missing. * @param array $solution_pack */ -function islandora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { +function fedora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { // Check each object to see if it is in the repository. - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $base_path; $needs_update = FALSE; $needs_install = FALSE; @@ -111,8 +111,8 @@ function islandora_repository_solution_pack_form(&$form_state, $solution_pack_mo } if (isset($ds['dsversion'])) { // Check if the datastream is versioned and needs updating. - $installed_version = islandora_repository_get_islandora_datastream_version($item, $ds['dsid']); - $available_version = islandora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); + $installed_version = fedora_repository_get_islandora_datastream_version($item, $ds['dsid']); + $available_version = fedora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); if ($available_version > $installed_version) { $needs_update = TRUE; $object_status = 'Out of date'; @@ -151,25 +151,25 @@ function islandora_repository_solution_pack_form(&$form_state, $solution_pack_mo ); $form['#submit'] = array( - 'islandora_repository_solution_pack_form_submit', + 'fedora_repository_solution_pack_form_submit', ); return $form; } -function islandora_repository_solution_pack_form_submit($form, &$form_state) { +function fedora_repository_solution_pack_form_submit($form, &$form_state) { $what = $form_state; $module_name = $form_state['values']['solution_pack_module']; $solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); $batch = array( 'title' => t('Installing / updating solution pack objects'), - 'file' => drupal_get_path('module', 'islandora_repository') . '/islandora_repository.module', + 'file' => drupal_get_path('module', 'fedora_repository') . '/fedora_repository.module', 'operations' => array(), ); foreach ($solution_pack_info[$module_name]['objects'] as $object) { // Add this object to the batch job queue. - $batch['operations'][] = array('islandora_repository_batch_reingest_object', array($object)); + $batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object)); } batch_set($batch); } diff --git a/formClass.inc b/formClass.inc index a7abe947..af0dc218 100644 --- a/formClass.inc +++ b/formClass.inc @@ -24,15 +24,15 @@ class formClass { function createMenu() { $items = array(); - $items['admin/settings/islandora_repository'] = array( + $items['admin/settings/fedora_repository'] = array( 'title' => t('Islandora Configure'), 'description' => t('Enter the Islandora Collection information here'), 'page callback' => 'drupal_get_form', - 'page arguments' => array('islandora_repository_admin'), + 'page arguments' => array('fedora_repository_admin'), 'access arguments' => array('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); - $items['admin/settings/islandora_repository/collection'] = array( + $items['admin/settings/fedora_repository/collection'] = array( 'title' => t('Collection list'), 'description' => t('Enter the Islandora collection information here.'), 'access arguments' => array('administer site configuration'), @@ -40,18 +40,18 @@ class formClass { 'weight' => 0, ); - $items['admin/settings/islandora_repository/demoobjects'] = array( + $items['admin/settings/fedora_repository/demoobjects'] = array( 'title' => t('Solution Packs'), 'description' => t('Install content models and collections required by installed solution packs.'), - 'page callback' => 'islandora_repository_solution_packs_page', + 'page callback' => 'fedora_repository_solution_packs_page', 'access arguments' => array('add fedora datastreams'), - 'file' => 'islandora_repository.solutionpacks.inc', + 'file' => 'fedora_repository.solutionpacks.inc', 'type' => MENU_LOCAL_TASK, ); $items['islandoracm.xsd'] = array( 'title' => t('Islandora Content Model XML Schema Definition'), - 'page callback' => 'islandora_repository_display_schema', + 'page callback' => 'fedora_repository_display_schema', 'page arguments' => array('islandoracm.xsd'), 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), @@ -59,7 +59,7 @@ class formClass { $items['collection_policy.xsd'] = array( 'title' => t('Islandora Content Model XML Schema Definition'), - 'page callback' => 'islandora_repository_display_schema', + 'page callback' => 'fedora_repository_display_schema', 'page arguments' => array('collection_policy.xsd'), 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), @@ -70,7 +70,7 @@ class formClass { 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); - $repository_title = variable_get('islandora_repository_title', 'Digital repository'); + $repository_title = variable_get('fedora_repository_title', 'Digital repository'); if (trim($repository_title) != '') { $respository_title = t($repository_title); } @@ -100,7 +100,7 @@ class formClass { $items['fedora/repository/editmetadata'] = array( 'title' => t('Edit metadata'), - 'page callback' => 'islandora_repository_edit_qdc_page', + 'page callback' => 'fedora_repository_edit_qdc_page', // 'page arguments' => array(1), //'type' => MENU_LOCAL_TASK, 'type' => MENU_CALLBACK, @@ -109,21 +109,21 @@ class formClass { $items['fedora/repository/purgeStream'] = array( 'title' => t('Purge data stream'), - 'page callback' => 'islandora_repository_purge_stream', + 'page callback' => 'fedora_repository_purge_stream', 'type' => MENU_CALLBACK, 'access arguments' => array('purge objects and datastreams') ); $items['fedora/repository/replaceStream'] = array( 'title' => t('Replace Stream'), - 'page callback' => 'islandora_repository_replace_stream', + 'page callback' => 'fedora_repository_replace_stream', 'type' => MENU_CALLBACK, 'access arguments' => array('add fedora datastreams'), ); $items['fedora/repository/purgeObject'] = array( 'title' => t('Purge object'), - 'page callback' => 'islandora_repository_purge_object', + 'page callback' => 'fedora_repository_purge_object', // 'type' => MENU_LOCAL_TASK, 'type' => MENU_CALLBACK, 'access arguments' => array('purge objects and datastreams') @@ -147,21 +147,21 @@ class formClass { //new for mnpl****************************************** $items['fedora/repository/mnpl_advanced_search'] = array( 'title' => t('Repository advanced search'), - 'page callback' => 'islandora_repository_mnpl_advanced_search', + 'page callback' => 'fedora_repository_mnpl_advanced_search', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection') ); $items['fedora/ingestObject'] = array( 'title' => t('Ingest object'), - 'page callback' => 'islandora_repository_ingest_object', + 'page callback' => 'fedora_repository_ingest_object', 'type' => MENU_CALLBACK, 'access arguments' => array('add fedora datastreams') ); $items['fedora/repository/list_terms'] = array( 'title' => t('List terms'), - 'page callback' => 'islandora_repository_list_terms', + 'page callback' => 'fedora_repository_list_terms', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection') ); @@ -170,25 +170,25 @@ class formClass { $items['fedora/basket'] = array( 'title' => t('Fedora Basket'), 'description' => t('View and download objects added to your basket'), - 'page callback' => 'islandora_repository_basket', + 'page callback' => 'fedora_repository_basket', 'access arguments' => array('view fedora collection'), 'type' => MENU_CALLBACK, ); $items['fedora/repository/addToBasket'] = array( - 'page callback' => 'islandora_repository_add_to_basket', + 'page callback' => 'fedora_repository_add_to_basket', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); $items['fedora/repository/removeFromBasket'] = array( - 'page callback' => 'islandora_repository_remove_from_basket', + 'page callback' => 'fedora_repository_remove_from_basket', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); $items['fedora/repository/add_search_results_to_basket'] = array( - 'page callback' => 'islandora_repository_add_search_results_to_basket', + 'page callback' => 'fedora_repository_add_search_results_to_basket', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); @@ -205,21 +205,21 @@ class formClass { drupal_set_message(t('You must be a site administrator to edit the Fedora collecitons list.'), 'error'); return; } - module_load_include('inc', 'islandora_repository', 'api/fedora_utils'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $form = array(); - $form['islandora_repository_name'] = array( + $form['fedora_repository_name'] = array( '#type' => 'textfield', '#title' => t('Root Collection Name'), - '#default_value' => variable_get('islandora_repository_name', 'Islandora demos collection'), + '#default_value' => variable_get('fedora_repository_name', 'Islandora demos collection'), '#description' => t('The Name of the Root Collection Object'), '#required' => TRUE, '#weight' => -20 ); - $form['islandora_repository_pid'] = array( + $form['fedora_repository_pid'] = array( '#type' => 'textfield', '#title' => t('Root Collection PID'), - '#default_value' => variable_get('islandora_repository_pid', 'islandora:root'), + '#default_value' => variable_get('fedora_repository_pid', 'islandora:root'), '#description' => t('The PID of the Root Collection Object'), '#required' => TRUE, '#weight' => -18 @@ -235,10 +235,10 @@ class formClass { ); - $form['islandora_repository_url'] = array( + $form['fedora_repository_url'] = array( '#type' => 'textfield', '#title' => t('Fedora RISearch URL'), - '#default_value' => variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'), + '#default_value' => variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), '#description' => t('The url of the Fedora server'), '#required' => TRUE, '#weight' => -14 ); @@ -296,10 +296,10 @@ class formClass { '#weight' => 0 ); } - $form['islandora_repository_title'] = array( + $form['fedora_repository_title'] = array( '#type' => 'textfield', '#title' => t('Digital Repository Title'), - '#default_value' => variable_get('islandora_repository_title', 'Digital Repository'), + '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); $form['advanced'] = array( @@ -432,7 +432,7 @@ class formClass { * @return type */ function can_ingest_here($collection_pid) { - module_load_include('inc', 'islandora_repository', 'SecurityClass'); + module_load_include('inc', 'fedora_repository', 'SecurityClass'); $securityClass = new SecurityClass(); return $securityClass->canIngestHere($collection_pid); } @@ -447,7 +447,7 @@ class formClass { drupal_set_message(t('You do not have permission to ingest.'), 'error'); return FALSE; } - module_load_include('inc', 'islandora_repository', 'SecurityClass'); + module_load_include('inc', 'fedora_repository', 'SecurityClass'); $security_class = new SecurityClass(); if (!$security_class->canIngestHere($collection_pid)) { // Queries the collection object for a child security datastream and if found parses it @@ -507,7 +507,7 @@ class formClass { ), 'submit' => array( '#type' => 'submit', - '#submit' => array('islandora_repository_ingest_form_submit'), + '#submit' => array('fedora_repository_ingest_form_submit'), '#value' => t('Next') ), ); @@ -523,7 +523,7 @@ class formClass { * @return array */ function createQDCIngestFormPageTwo($collection_pid, $collection_label, array &$form_state) { - module_load_include('inc', 'islandora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); $form = array(); $content_model_pid = ContentModel::getPidFromIdentifier($form_state['values']['models']); $content_model_dsid = ContentModel::getDSIDFromIdentifier($form_state['values']['models']); @@ -541,7 +541,7 @@ class formClass { ); $form['submit'] = array( '#type' => 'submit', - '#submit' => array('islandora_repository_ingest_form_submit'), + '#submit' => array('fedora_repository_ingest_form_submit'), '#value' => t('Ingest') ); } @@ -558,7 +558,7 @@ class formClass { * @return array */ function createQDCIngestForm($collection_pid, $collection_label, array &$form_state) { - module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); $form_state['storage']['step'] = empty($form_state['storage']['step']) ? 1 : $form_state['storage']['step']; if ($form_state['storage']['step'] == 1) { return $this->createQDCIngestFormPageOne($collection_pid, $collection_label, $form_state); @@ -603,9 +603,9 @@ class formClass { //dump_vars($form_state); // Populate the list of datastream IDs. - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'ContentModel'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $obj_helper = new ObjectHelper(); $content_models = $obj_helper->get_content_models_list($pid); diff --git a/islandoracm.xsd b/islandoracm.xsd index 21ab6661..bce83136 100644 --- a/islandoracm.xsd +++ b/islandoracm.xsd @@ -48,14 +48,14 @@ </xsd:complexType> <xsd:complexType name="form_builder_methodType"> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="handler" type="xsd:normalizedString" use="required"/> </xsd:complexType> <xsd:complexType name="edit_metadata_methodType"> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="handler" type="xsd:normalizedString" use="required"/> @@ -118,7 +118,7 @@ </xsd:all> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/> @@ -149,7 +149,7 @@ <xsd:element name="parameters" type="parametersType" minOccurs="0"/> </xsd:all> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/> @@ -171,7 +171,7 @@ <xsd:complexContent> <xsd:restriction base="xsd:anyType"> <xsd:attribute name="file" type="xsd:normalizedString" use="required"/> - <xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/> + <xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/> <xsd:attribute name="class" type="xsd:normalizedString" use="required"/> <xsd:attribute name="method" type="xsd:normalizedString" use="required"/> <xsd:attribute name="default" type="xsd:boolean" default="false"/> diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index 6d901b21..a385aa26 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -7,7 +7,7 @@ * Collection Form Builder */ -module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml @@ -32,7 +32,7 @@ class CollectionFormBuilder extends FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index 814e9dfb..5ab525b6 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -21,7 +21,7 @@ class DarwinCore { * @param type $item */ function __construct($item = NULL) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); if (!empty($item)) { $this->owner = $item; if (array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) { @@ -200,7 +200,7 @@ class DarwinCore { * @param type $form_values */ public function handleForm($form_values) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $user; //$new_item = Fedora_Item::ingest_new_item($form_values['pid'], 'A', $form_values['dwc:institutionCode'].':'.$form_values['dwc:collectionCode'].':'.$form_values['dwc:catalogNumber'], $user->name); //$new_item->add_datastream_from_string($this->darwinCoreXML, 'DARWIN_CORE', 'Darwin Core Metadata', 'text/xml', 'X'); @@ -248,8 +248,8 @@ class DarwinCore { */ public function asHTML() { $path = drupal_get_path('module', 'Fedora_Repository'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); $xmlstr = $this->darwinCoreXML; html_entity_decode($xmlstr); diff --git a/plugins/DemoFormBuilder.inc b/plugins/DemoFormBuilder.inc index d2d7f738..ccc74ba2 100644 --- a/plugins/DemoFormBuilder.inc +++ b/plugins/DemoFormBuilder.inc @@ -6,7 +6,7 @@ * @file * */ -module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml @@ -19,7 +19,7 @@ class DemoFormBuilder extends FormBuilder { * Constructor */ function DemoFormBuilder() { - module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); + module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } @@ -31,7 +31,7 @@ class DemoFormBuilder extends FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); $server = NULL; diff --git a/plugins/DocumentConverter.inc b/plugins/DocumentConverter.inc index e64517c6..f258441a 100644 --- a/plugins/DocumentConverter.inc +++ b/plugins/DocumentConverter.inc @@ -32,7 +32,7 @@ class DocumentConverter { * @return string */ function convert($parameterArray = NULL, $dsid, $file, $output_ext) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); #debug: #drupal_set_message("Sending $file to ". $this->converter_service_url ." for convertsion to $output_ext", 'status'); diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index 5db3d600..c0b98981 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -22,7 +22,7 @@ class Exiftool { function __construct($pid) { //drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); $this->pid = $pid; - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $this->item = new Fedora_Item($this->pid); } diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index de8d10a7..855d508c 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -19,7 +19,7 @@ class FedoraObjectDetailedContent { * @param type $pid */ function __construct($pid = '') { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); if (!empty($pid)) { $this->pid = $pid; @@ -36,9 +36,9 @@ class FedoraObjectDetailedContent { global $user; $objectHelper = new ObjectHelper(); $tabset = array(); - $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_purge_object_form'); - $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_edit_qdc_form'); - $purge_form = drupal_get_form('islandora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path())))); + $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form'); + $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_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', @@ -59,8 +59,8 @@ class FedoraObjectDetailedContent { '#content' => $dc_html . $ds_list . $purge_form, ); - if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { - $editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DC'); + 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'), diff --git a/plugins/Flv.inc b/plugins/Flv.inc index d1dc03d3..d8f2b06b 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -138,7 +138,7 @@ class FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); $mimetype = new MimeClass(); $server = NULL; $file = $form_values['ingest-file-location']; diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index f9d13e56..c259328c 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -6,7 +6,7 @@ * @file * FLVFormBuilder */ -module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml @@ -19,7 +19,7 @@ class FlvFormBuilder extends FormBuilder { * Constructor */ function FlvFormBuilder() { - module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); + module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } @@ -32,7 +32,7 @@ class FlvFormBuilder extends FormBuilder { */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); $server = NULL; diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 695fa2c6..382733b4 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -84,7 +84,7 @@ class FormBuilder { * @return type */ function createPolicy($collectionPid, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); $dsid = 'CHILD_SECURITY'; @@ -135,8 +135,8 @@ class FormBuilder { * @return type */ function handleQDCForm($form_values) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); $dom = new DomDocument("1.0", "UTF-8"); $dom->formatOutput = TRUE; @@ -196,7 +196,7 @@ class FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); $server = NULL; diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index c67e4911..8f97ab94 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -16,7 +16,7 @@ class ImageManipulation { * Constructor */ function ImageManipulation() { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); } /** diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index 26662cf2..d49869e2 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -6,7 +6,7 @@ * @file * ModsFormBuilder class */ -module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * ModsFormBuilder class ??? @@ -25,8 +25,8 @@ class ModsFormBuilder extends FormBuilder { function __construct($pid=NULL) { parent::__construct(); if ($pid !== NULL) { - module_load_include('inc', 'islandora_repository', 'ContentModel'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $this->pid = $pid; $this->cm = ContentModel::loadFromObject($pid); @@ -241,7 +241,7 @@ class ModsFormBuilder extends FormBuilder { $form['submit'] = array( '#type' => 'submit', - '#submit' => array('islandora_repository_edit_qdc_form_submit'), + '#submit' => array('fedora_repository_edit_qdc_form_submit'), '#value' => 'Save Metadata' ); @@ -256,8 +256,8 @@ class ModsFormBuilder extends FormBuilder { * @param &$form_state */ function handleModsForm(&$form_values, &$form_state) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'CollectionPolicy'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); $form_state['storage']['people'] = NULL; //clears out old entities for the next run of the formbuilder. @@ -329,7 +329,7 @@ class ModsFormBuilder extends FormBuilder { * @param &$rootElement */ function createCollectionPolicy($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $model = new fedora_item($form_values['content_model_pid']); $ds_list = $model->get_datastreams_list_as_array(); if (isset($ds_list['COLLECTION_POLICY_TMPL'])) { @@ -364,7 +364,7 @@ class ModsFormBuilder extends FormBuilder { * @param &$rootElement */ function createWorkflowStream($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $model = new fedora_item($form_values['content_model_pid']); $ds_list = $model->get_datastreams_list_as_array(); if (isset($ds_list['WORKFLOW_TMPL'])) { diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index b4742711..68ae5528 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -120,7 +120,7 @@ class PersonalCollectionClass { * @return type */ function createPolicyStream($user, $dom, $rootElement) { - module_load_include('inc', 'islandora_repository', 'SecurityClass'); + module_load_include('inc', 'fedora_repository', 'SecurityClass'); $securityClass = new SecurityClass(); $policyStreamDoc = $securityClass->createPersonalPolicy($user); diff --git a/plugins/QtFormBuilder.php b/plugins/QtFormBuilder.php index 954f28e4..28645d6b 100644 --- a/plugins/QtFormBuilder.php +++ b/plugins/QtFormBuilder.php @@ -6,7 +6,7 @@ * @file * QTFormBuilder class */ -module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder'); +module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * Implements methods from content model ingest form xml @@ -30,7 +30,7 @@ class QtFormBuilder extends FormBuilder { * @param type $rootElement */ function createFedoraDataStreams($form_values, &$dom, &$rootElement) { - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); global $base_url; $mimetype = new MimeClass(); $server = null; diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 4f0d6fc3..592a7e99 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -7,7 +7,7 @@ * Refworks class */ -module_load_include('inc', 'islandora_repository', 'SecurityClass'); +module_load_include('inc', 'fedora_repository', 'SecurityClass'); /** * Refworks class ??? @@ -222,9 +222,9 @@ class Refworks { */ function handleForm(&$form_values) { $errorMessage = NULL; - module_load_include('inc', 'islandora_repository', 'CollectionClass'); - module_load_include('inc', 'islandora_repository', 'ContentModel'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $contentModelPid = ContentModel::getPidFromIdentifier($form_values['models']); $contentModelDsid = ContentModel::getDSIDFromIdentifier($form_values['models']); $collectionHelper = new CollectionClass(); @@ -238,7 +238,7 @@ class Refworks { $collection_item = new Fedora_Item($collection_pid); $this->collectionPolicyStream = $collection_item->get_datastream_dissemination('CHILD_SECURITY'); if (empty($this->collectionPolicyStream)) { - $this->collectionPolicyStream = file_get_contents(drupal_get_path('module', 'islandora_repository') . '/policies/noObjectEditPolicy.xml'); + $this->collectionPolicyStream = file_get_contents(drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml'); } $success = 0; $errors = 0; @@ -388,7 +388,7 @@ class Refworks { */ function createFedoraDataStreams($form_values, &$dom, &$rootElement, $reference) { global $base_url; - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); $mimetype = new MimeClass(); $server = NULL; $this->createRomeoDataStream($dom, $rootElement); diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index efa1ab7e..77eada60 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -87,7 +87,7 @@ class ShowStreamsInFieldSets { global $base_url; global $base_path; global $user; - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $tabset = array(); @@ -105,7 +105,7 @@ class ShowStreamsInFieldSets { $tn_url = $base_url . '/fedora/repository/' . $item->pid . '/TN'; } else { - $tn_url = $base_path . drupal_get_path('module', 'islandora_repository') . '/images/Crystal_Clear_app_download_manager.png'; + $tn_url = $base_path . drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_app_download_manager.png'; } $dc_html = $objectHelper->getFormattedDC($item); @@ -117,8 +117,8 @@ class ShowStreamsInFieldSets { '#content' => $dl_link . $dc_html, ); - if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { - $editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DC'); + if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { + $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC'); $tabset['first_tab']['tabs']['edit'] = array( '#type' => 'tabpage', '#title' => t('Edit'), @@ -142,7 +142,7 @@ class ShowStreamsInFieldSets { * @return type */ function showQdc() { - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); $content = $objectHelper->getQDC($this->pid); $collection_fieldset = array( @@ -161,7 +161,7 @@ class ShowStreamsInFieldSets { */ function showOBJLink() { global $base_url; - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $streams = $item->get_datastreams_list_as_array(); return "<a href='" . $base_url . "/fedora/repository/" . $this->pid . "/OBJ/" . $streams['OBJ']['label'] . "'>" . $streams['OBJ']['label'] . "</a>"; @@ -172,8 +172,8 @@ class ShowStreamsInFieldSets { * @return type */ function showRefworks() { - $path = drupal_get_path('module', 'islandora_repository'); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + $path = drupal_get_path('module', 'fedora_repository'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $collectionHelper = new CollectionClass(); $xmlstr = $collectionHelper->getStream($this->pid, "refworks"); html_entity_decode($xmlstr); @@ -226,7 +226,7 @@ class ShowStreamsInFieldSets { */ function showRomeo($collapsed = FALSE) { $path = drupal_get_path('module', 'Fedora_Repository'); - module_load_include('inc', 'islandora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collectionHelper = new CollectionClass(); $xmlstr = $collectionHelper->getStream($this->pid, "ROMEO", 0); diff --git a/plugins/islandora_imageapi.info b/plugins/fedora_imageapi.info similarity index 82% rename from plugins/islandora_imageapi.info rename to plugins/fedora_imageapi.info index 5519ad85..6a465a04 100644 --- a/plugins/islandora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -1,7 +1,7 @@ name = Fedora ImageAPI description = Adds image manipulation support through a REST interface package = Islandora Dependencies -dependencies[] = islandora_repository +dependencies[] = fedora_repository dependencies[] = imageapi version = 11.2.beta2 core = 6.x diff --git a/plugins/islandora_imageapi.module b/plugins/fedora_imageapi.module similarity index 89% rename from plugins/islandora_imageapi.module rename to plugins/fedora_imageapi.module index cbe6225d..f3bd4481 100644 --- a/plugins/islandora_imageapi.module +++ b/plugins/fedora_imageapi.module @@ -6,7 +6,7 @@ function fedora_imageapi_menu() { $items = array(); $items['fedora/imageapi'] = array( 'title' => t('Image manipulation functions'), - 'page callback' => 'islandora_repository_image_manip', + 'page callback' => 'fedora_repository_image_manip', 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); @@ -21,7 +21,7 @@ function fedora_imageapi_menu() { * @param string $op * @param string $params */ -function islandora_repository_image_manip($pid = '', $dsid = '', $op = '', $params = '') { +function fedora_repository_image_manip($pid = '', $dsid = '', $op = '', $params = '') { module_load_include('inc', 'Fedora_Repository', 'ObjectHelper'); module_load_include('module', 'imageapi'); $obj = new ObjectHelper(); @@ -30,7 +30,7 @@ function islandora_repository_image_manip($pid = '', $dsid = '', $op = '', $para $op = (!empty($_GET['op']) ? $_GET['op'] : ''); $safe_pid = str_replace(':', '_', $pid); - $cache_key = 'islandora_repository_image_manip_' . md5($safe_pid . '_' . $dsid . '_' . $ext . '_' . $op . (isset($_GET['width']) ? '_' . $_GET['width'] : '') . (isset($_GET['height']) ? '_' . $_GET['height'] : '')); + $cache_key = 'fedora_repository_image_manip_' . md5($safe_pid . '_' . $dsid . '_' . $ext . '_' . $op . (isset($_GET['width']) ? '_' . $_GET['width'] : '') . (isset($_GET['height']) ? '_' . $_GET['height'] : '')); if (($file = cache_get($cache_key)) === 0) { //added the slash as sys_get_temp_dir in linux does not seem to include the slash $tmp_file_name = sys_get_temp_dir() . '/' . $safe_pid . '_' . $dsid . '.' . $ext; @@ -83,7 +83,7 @@ function islandora_repository_image_manip($pid = '', $dsid = '', $op = '', $para function fedora_imageapi_form_alter( &$form, $form_state, $form_id) { switch ( $form_id ) { - case 'islandora_repository_admin': + case 'fedora_repository_admin': $fedora_base_url = $form['fedora_base_url']['#default_value']; diff --git a/plugins/herbarium.inc b/plugins/herbarium.inc index f831bc59..f7a6d685 100644 --- a/plugins/herbarium.inc +++ b/plugins/herbarium.inc @@ -16,7 +16,7 @@ class Herbarium { function __construct($pid = '') { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); if (!empty($pid)) { $this->pid = $pid; $this->item = new Fedora_Item($pid); @@ -32,7 +32,7 @@ class Herbarium { public function buildDrupalForm($form = array(), $form_state = array()) { // We don't need to add anything beyond the standard Darwin Core form so just pass this through // If we wanted to we could add other fields. - module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); + module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); $dwc = new DarwinCore($this->item); return $dwc->buildDrupalForm($form); @@ -73,9 +73,9 @@ class Herbarium { * Process the metadata form * Update the datastreams */ - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); - module_load_include('inc', 'islandora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); global $user; $mimetype = new MimeClass(); $dwc = new DarwinCore($this->item); @@ -97,9 +97,9 @@ class Herbarium { * Create fedora object * Add the datastreams */ - module_load_include('inc', 'islandora_repository', 'MimeClass'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); + module_load_include('inc', 'fedora_repository', 'MimeClass'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); global $user; $mimetype = new MimeClass(); $dwc = new DarwinCore(); @@ -141,8 +141,8 @@ class Herbarium { * @return string */ public function showFieldSets() { - module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore'); + module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); + module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); global $base_url; $tabset = array(); @@ -167,7 +167,7 @@ class Herbarium { '#title' => t('View'), // This will be the content of the tab. '#content' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/FULL_JPG/"><img src="' . $base_url . '/fedora/imageapi/' . - $this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('islandora_repository_image_tagging_form', $this->pid) . '</p>', + $this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>', ); $dwc = new DarwinCore($this->item); @@ -184,10 +184,10 @@ class Herbarium { '#title' => t('Darwin Core'), '#content' => $dwc->asHTML(), ); - module_load_include('inc', 'islandora_repository', 'ObjectHelper'); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $obj = new ObjectHelper(); - if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { - $editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE'); + 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['third_tab']['tabset']['edit'] = array( '#type' => 'tabpage', '#title' => t('Edit'), diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index 2ad56c0a..3e9bcfb6 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -29,9 +29,9 @@ class ShowMapStreamsInFieldSets { * @return type */ function showJPG() { - module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); + module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $base_url; @@ -51,8 +51,8 @@ class ShowMapStreamsInFieldSets { $html = '<iframe src="' . $viewer_url . '" scrolling="no" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>'; drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme'); - drupal_add_css(drupal_get_path('module', 'islandora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css'); - drupal_add_css(drupal_get_path('module', 'islandora_repository') . '/js/iiv/css/iiv.css'); + drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css'); + drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/iiv.css'); $tabset['my_tabset']['second_tab'] = array( diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index 09d24cca..ec321ca1 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -112,9 +112,9 @@ class ShowQtStreamsInFieldSets { * @return type */ function showQt() { - module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); + module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $info = $this->technicalMetadata(array('width' => 640, 'height' => 480)); $width = $info['width']; diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index ef569487..1d23b227 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -30,8 +30,8 @@ class ShowSlideStreamsInFieldSets { * @return type */ function showJPG() { - module_load_include('inc', 'islandora_repository', 'plugins/tagging_form'); - module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets'); + module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); + module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); global $base_url; global $user; @@ -58,7 +58,7 @@ class ShowSlideStreamsInFieldSets { '#title' => t('View'), // This will be the content of the tab. '#content' => '<img src="' . $base_url . - '/fedora/imageapi/' . $this->pid . '/JPG/JPG.jpg' . '" />' . '<p>' . drupal_get_form('islandora_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>', ); return $tabset; diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index ca32ecd5..0a421105 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -13,9 +13,9 @@ * @return string */ function _show_subject_tags($pid) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/dublin_core'); - module_load_include('inc', 'islandora_repository', 'api/tagging'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/dublin_core'); + module_load_include('inc', 'fedora_repository', 'api/tagging'); $obj = new Fedora_Item($pid); $tags = new TagSet($obj); if (!empty($tags->tags)) { @@ -35,10 +35,10 @@ function _show_subject_tags($pid) { * @param type $pid * @return type */ -function islandora_repository_image_tagging_form($form_state, $pid) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/dublin_core'); - module_load_include('inc', 'islandora_repository', 'api/tagging'); +function fedora_repository_image_tagging_form($form_state, $pid) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/dublin_core'); + module_load_include('inc', 'fedora_repository', 'api/tagging'); global $base_url; if (!empty($form_state['post']['pid'])) { @@ -71,7 +71,7 @@ function islandora_repository_image_tagging_form($form_state, $pid) { // Delete button for each existing tag. $form['tags-wrapper']['tags'][$tag['name']]['delete'] = array( '#type' => 'imagebutton', - '#image' => $base_url . '/' . drupal_get_path('module', 'islandora_repository') . '/images/remove_icon.png', + '#image' => $base_url . '/' . drupal_get_path('module', 'fedora_repository') . '/images/remove_icon.png', '#default_value' => $tag['name'], '#title' => t('Delete this tag'), ); @@ -122,9 +122,9 @@ function hook_imagebutton_process($form) { * @param type $form * @param type $form_state */ -function islandora_repository_image_tagging_form_submit($form, &$form_state) { - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); - module_load_include('inc', 'islandora_repository', 'api/tagging'); +function fedora_repository_image_tagging_form_submit($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/tagging'); global $user; $item = new Fedora_Item($form_state['values']['pid']); diff --git a/tests/README_TESTING.txt b/tests/README_TESTING.txt index f38af855..c9dde164 100644 --- a/tests/README_TESTING.txt +++ b/tests/README_TESTING.txt @@ -21,7 +21,7 @@ $FEDORA_HOME/server/config/fedora-users.xml: </attribute> </user> -If you look in the islandora_repository.test file we see that we are creating +If you look in the fedora_repository.test file we see that we are creating a user with a password set to 'simpletestpass'. Fedora requires the hashed version of this password to do a servlet filter-based authentication. diff --git a/tests/fedora_repository.test b/tests/fedora_repository.test index d5e59bc8..bbad2569 100644 --- a/tests/fedora_repository.test +++ b/tests/fedora_repository.test @@ -16,9 +16,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { } function setUp() { - parent::setUp('tabs', 'islandora_repository'); + parent::setUp('tabs', 'fedora_repository'); - module_load_include('inc', 'islandora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); // Create and login user. $repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams', @@ -57,11 +57,11 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $ingest_form_step_2['dc:title'] = $this->randomName(32); $ingest_form_step_2['dc:description'] = $this->randomName(256); - $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/tests/test_files/lorem_ipsum.pdf'); + $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); $this->assertText('mimetype (application/pdf) is not associated with this Content Model', 'PDF mime type not accepted in collection content model.', 'message'); - $this->outputScreenContents('Initial ingest form submit step 2', 'islandora_repository'); + $this->outputScreenContents('Initial ingest form submit step 2', 'fedora_repository'); // Now try ingesting a proper collection policy. $ingest_form = array(); @@ -72,9 +72,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $ingest_form_step_2 = array(); $ingest_form_step_2['dc:title'] = $this->randomName(32); $ingest_form_step_2['dc:description'] = $this->randomName(256); - $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml'); + $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); - //$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'islandora_repository'); + //$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'fedora_repository'); $this->assertPattern('/Item .* created successfully./', "Verified item created."); $pid = $this->getIngestedPid(); @@ -88,7 +88,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $ingest_form_step_2 = array(); $ingest_form_step_2['dc:title'] = "Lorem Ipsum"; $ingest_form_step_2['dc:description'] = $this->randomName(256); - $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/tests/test_files/lorem_ipsum.pdf'); + $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); $pid = $this->getIngestedPid(); $pid_list[] = $pid; @@ -104,7 +104,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $admin_tester = $this->drupalCreateUser(array('administer site configuration', 'view fedora collection')); $this->drupalLogin($admin_tester); - $pageContent = $this->drupalGet('admin/settings/islandora_repository'); + $pageContent = $this->drupalGet('admin/settings/fedora_repository'); $hasOption = preg_match('/Enforce namespace restrictions/', $pageContent); @@ -115,13 +115,13 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $this->pass('Removal of namespace restrictions is enabled'); $inVal['fedora_namespace_restriction_enforced'] = TRUE; $inVal['fedora_pids_allowed'] = 'simpletest:'; - $this->drupalPost('admin/settings/islandora_repository', $inVal, 'Save configuration'); + $this->drupalPost('admin/settings/fedora_repository', $inVal, 'Save configuration'); $this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.'); $this->drupalGet('fedora/repository/islandora:largeimages/'); $this->assertPattern('/Access denied/', 'No access to Large image Collection Collection'); $inVal['fedora_namespace_restriction_enforced'] = 0; - $this->drupalPost('admin/settings/islandora_repository', $inVal, 'Save configuration'); + $this->drupalPost('admin/settings/fedora_repository', $inVal, 'Save configuration'); $this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.'); $this->drupalLogin($this->repository_user); $this->drupalGet('fedora/repository/islandora:largeimages/'); From 632de8f9f0d627ee760fa8b57ad56e98f7aa2c54 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Wed, 12 Oct 2011 14:31:06 -0300 Subject: [PATCH 100/247] Change the way we checked for ISLANDORACM datastream to take some strain off the logs --- api/fedora_utils.inc | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index c8ce7d0e..98d83f3a 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -6,7 +6,6 @@ * @file * Base utilities used by the Islandora fedora module. */ - if (!function_exists('str_getcsv')) { /** @@ -96,9 +95,8 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post */ function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $post = NULL) { global $user; - + // Check if we are inside Drupal and there is a valid user. - // If the user is not valid for a Fedora call curl will throw an exception. if ((!isset($user)) || $user->uid == 0) { $fedora_user = 'anonymous'; @@ -126,14 +124,13 @@ function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $p curl_setopt($ch, CURLOPT_POST, $number_of_post_vars); curl_setopt($ch, CURLOPT_POSTFIELDS, "$post"); } - + $ret_val = curl_exec($ch); - + $error_code = curl_errno($ch); $error_string = curl_error($ch); - return array ($ret_val, $error_code, $error_string); + return array($ret_val, $error_code, $error_string); } - else { if (function_exists(drupal_set_message)) { drupal_set_message(t('No curl support.'), 'error'); @@ -159,10 +156,9 @@ function fedora_available() { function risearch_available() { $response = do_curl_ext(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch')); - return ($response != NULL) ? ($response[1] == 0): FALSE; + return ($response != NULL) ? ($response[1] == 0) : FALSE; } - /** * Returns a UTF-8-encoded transcripiton of the string given in $in_str. * @param string $in_str @@ -264,7 +260,7 @@ function get_collections_as_option_array() { /** * Function: get_content_models_as_option_array * - * Description: Returns an associative array of all collection objects in Fedora instance + * Description: Returns an associative array of all available content models in Fedora instance * * @return array */ @@ -298,9 +294,10 @@ function get_content_models_as_option_array() { $item = new fedora_item($parts[0]); $nameparts = explode(':', $parts[0]); if (!$restricted || in_array($nameparts[0], $allowed)) - if ($item->get_datastream_dissemination('ISLANDORACM')) { - $options[$parts[0]] = $parts[1]. ' ~ ' . $parts[0] ; - } + $datastreams = array_keys($item->get_datastreams_list_as_array()); + if (in_array('ISLANDORACM', $datastreams)) { + $options[$parts[0]] = $parts[1] . ' ~ ' . $parts[0]; + } } } From 58ceada8758334816873cd07c13e2d2a5094eb94 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 12 Oct 2011 15:45:59 -0300 Subject: [PATCH 101/247] Coding standard cleanup --- BatchIngest.inc | 6 ++-- CollectionClass.inc | 8 +++--- CollectionManagement.inc | 6 ++-- CollectionPolicy.inc | 16 +++++------ ContentModel.inc | 54 +++++++++++++++++------------------ ObjectHelper.inc | 4 +-- XMLDatastream.inc | 4 +-- api/fedora_export.inc | 2 +- api/fedora_item.inc | 6 ++-- api/fedora_utils.inc | 6 ++-- fedora_repository.module | 2 +- formClass.inc | 8 +++--- plugins/ImageManipulation.inc | 2 +- plugins/qt_viewer.inc | 4 +-- 14 files changed, 64 insertions(+), 64 deletions(-) diff --git a/BatchIngest.inc b/BatchIngest.inc index ed768294..621a674a 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -38,7 +38,7 @@ function batch_creation_form(&$form_state, $collection_pid, $content_models) { '#title' => "Choose content model to be associated with objects ingested", '#type' => 'select', '#options' => $cm_options, - '#required' => true, + '#required' => TRUE, '#description' => t("Content models describe the behaviours of objects with which they are associated."), ); $form['indicator']['file-location'] = array( @@ -251,14 +251,14 @@ function batch_create_dc_from_mods($mods_xml) { */ function recursive_directory_delete($dir) { if (!file_exists($dir)) - return true; + return TRUE; if (!is_dir($dir)) return unlink($dir); foreach (scandir($dir) as $item) { if ($item == '.' || $item == '..') continue; if (!recursive_directory_delete($dir . DIRECTORY_SEPARATOR . $item)) - return false; + return FALSE; } return rmdir($dir); } \ No newline at end of file diff --git a/CollectionClass.inc b/CollectionClass.inc index 4216733d..ae68e2de 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -524,11 +524,11 @@ class CollectionClass { $show_batch_tab = FALSE; } if (!$show_ingest_tab) { - $view_selected = true; + $view_selected = TRUE; } if(!$collection_items){ - $view_selected = false; - $add_selected = true; + $view_selected = FALSE; + $add_selected = TRUE; } $view_selected = !$show_ingest_tab; @@ -554,7 +554,7 @@ class CollectionClass { '#title' => t('Manage This Collection'), // This will be the content of the tab. '#content' => drupal_get_form('collection_management_form', $this->pid, $content_models), - '#selected' => false, + '#selected' => FALSE, ); } if ($show_batch_tab && user_access('create batch process')) { diff --git a/CollectionManagement.inc b/CollectionManagement.inc index 83bb9952..39d33456 100644 --- a/CollectionManagement.inc +++ b/CollectionManagement.inc @@ -10,8 +10,8 @@ function collection_management_form(&$form_state, $this_collection_pid, $content_models) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $restricted = FALSE; - if (variable_get('fedora_namespace_restriction_enforced', true)) { - $restricted = true; + if (variable_get('fedora_namespace_restriction_enforced', TRUE)) { + $restricted = TRUE; $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); $namespaces = explode(':', $allowed_string); foreach ($namespaces as $namespace) { @@ -35,7 +35,7 @@ function collection_management_form(&$form_state, $this_collection_pid, $content } } if (!empty($cm_options)) { - $show_delete = true; + $show_delete = TRUE; } diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index b801eaff..be9e7a92 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -64,7 +64,7 @@ class CollectionPolicy extends XMLDatastream { /** * Ingests a new Collection Policy datastream to the specified * PID with the DSID specified. The file should be a valid collection - * policy XML. Returns false on failure. + * policy XML. Returns FALSE on failure. * * @param string $pid * @param string $name @@ -92,7 +92,7 @@ class CollectionPolicy extends XMLDatastream { /** * Ingests a new Collection Policy datastream to the specified * PID with the DSID specified. Clones the collection policy from the - * source collection pid. Returns false on failure. + * source collection pid. Returns FALSE on failure. * * @param string $pid * @param string $name @@ -122,7 +122,7 @@ class CollectionPolicy extends XMLDatastream { /** * Ingests a new minimum Collection Policy datastream to the specified * PID with the DSID specified. Initializes the policy with the specified values. - * Returns false on failure + * Returns FALSE on failure * * @param string $pid * @param string $name @@ -234,7 +234,7 @@ class CollectionPolicy extends XMLDatastream { $termEl = $newDom->createElement('term', $term->value); $termEl->setAttribute('field', $term->field); if (strval($sXml->search_terms->default) == $term->field) { - $termEl->setAttribute('default', 'true'); + $termEl->setAttribute('default', 'TRUE'); } $search_termsEl->appendChild($termEl); } @@ -321,7 +321,7 @@ class CollectionPolicy extends XMLDatastream { /** * Sets the path to the staging area to use for this - * collection. If specified path is blank (or false) it will + * collection. If specified path is blank (or FALSE) it will * remove the staging are path element from the collection policy. * * @param string $path @@ -435,7 +435,7 @@ class CollectionPolicy extends XMLDatastream { $terms = $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term'); for ($i = 0; $i < $terms->length; $i++) { $default = $terms->item($i)->attributes->getNamedItem('default'); - $default = ($default !== NULL) ? (strtolower($default->nodeValue) == 'true') : FALSE; + $default = ($default !== NULL) ? (strtolower($default->nodeValue) == 'TRUE') : FALSE; $ret[] = ($asArray) ? array('value' => $terms->item($i)->nodeValue, 'field' => $terms->item($i)->getAttribute('field'), 'default' => $default) : $terms->item($i)->nodeValue; @@ -540,7 +540,7 @@ class CollectionPolicy extends XMLDatastream { if ($terms->item($i)->attributes->getNamedItem('default') !== NULL) { $terms->item($i)->removeAttribute('default'); } - $found->setAttribute('default', 'true'); + $found->setAttribute('default', 'TRUE'); $ret = TRUE; } } @@ -550,7 +550,7 @@ class CollectionPolicy extends XMLDatastream { /** * Removes the specified content model from the collection policy. This will only * prevent future ingests of the removed model to the collection. $cm should be - * a valid ContentModel object. Returns false on failure or when the CM was not found in + * a valid ContentModel object. Returns FALSE on failure or when the CM was not found in * the collection policy. * * @param ContentModel $cm diff --git a/ContentModel.inc b/ContentModel.inc index b1f28074..cbacd422 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -34,7 +34,7 @@ class ContentModel extends XMLDatastream { /** * Constructs a ContentModel object from a Fedora item * by getting the first content model from the hasModel relationship. - * Returns false on failure. + * Returns FALSE on failure. * @param string $pid * @return ContentModel $cm */ @@ -57,7 +57,7 @@ class ContentModel extends XMLDatastream { /** * Ingests a Content Model from a file to the specified pid/dsid . - * Returns false on failure. + * Returns FALSE on failure. * * @param string $pid * @param string $name @@ -84,7 +84,7 @@ class ContentModel extends XMLDatastream { /** * Ingests a Content Model from an existing model to the specified pid/dsid . - * Returns false on failure. + * Returns FALSE on failure. * * @param string $pid * @param string $name @@ -113,7 +113,7 @@ class ContentModel extends XMLDatastream { /** * Ingests a minimum Content Model to the specified pid/dsid. - * Returns false on failure. + * Returns FALSE on failure. * * @param string $pid * @param string $name @@ -153,8 +153,8 @@ class ContentModel extends XMLDatastream { $ingestFormEl = $newDom->createElement('ingest_form'); $ingestFormEl->setAttribute('dsid', $ingestFormDsid); $ingestFormEl->setAttribute('page', $ingestFormPage); - if ($ingestFormHideChooser == 'true') { - $ingestFormEl->setAttribute('hide_file_chooser', 'true'); + if ($ingestFormHideChooser == 'TRUE') { + $ingestFormEl->setAttribute('hide_file_chooser', 'TRUE'); } $builderEl = $newDom->createElement('form_builder_method'); @@ -186,7 +186,7 @@ class ContentModel extends XMLDatastream { * If DSID is specified it will use that datastream as the model, otherwise it will * use the default (usually ISLANDORACM). PID_NAMESPACE and name can also be initialized * from the collection policy. - * Returns false on failure. + * Returns FALSE on failure. * * NOTE: $name will be overwritten with the content model name found in the datastream * when the model is first validated.\ @@ -344,7 +344,7 @@ class ContentModel extends XMLDatastream { $ingest_formEl->setAttribute('dsid', $sXml->ingest_form['dsid']); $ingest_formEl->setAttribute('page', $sXml->ingest_form['page']); if (isset($sXml->ingest_form['hide_file_chooser'])) { - $ingest_formEl->setAttribute('hide_file_chooser', (strtolower($sXml->ingest_form['hide_file_chooser']) == 'true') ? 'true' : 'false'); + $ingest_formEl->setAttribute('hide_file_chooser', (strtolower($sXml->ingest_form['hide_file_chooser']) == 'TRUE') ? 'TRUE' : 'FALSE'); } $form_builderEl = $newDom->createElement('form_builder_method'); @@ -373,8 +373,8 @@ class ContentModel extends XMLDatastream { $elEl->setAttribute('label', $element->label); $elEl->setAttribute('name', $element->name); $elEl->setAttribute('type', $element->type); - if (strtolower($element->required) == 'true') { - $elEl->setAttribute('required', 'true'); + if (strtolower($element->required) == 'TRUE') { + $elEl->setAttribute('required', 'TRUE'); } if (isset($element->description) && trim($element->description) != '') { $descEl = $newDom->createElement('description', trim($element->description)); @@ -453,7 +453,7 @@ class ContentModel extends XMLDatastream { /** * Gets the name of the ContentModel - * Returns false on failure. + * Returns FALSE on failure. * * @return String $name */ @@ -539,7 +539,7 @@ class ContentModel extends XMLDatastream { $element = array('name' => $elements->item($i)->getAttribute('name'), 'label' => $label, 'type' => $elements->item($i)->getAttribute('type'), - 'required' => ($elements->item($i)->getAttribute('required') == 'true') ? TRUE : FALSE, + 'required' => ($elements->item($i)->getAttribute('required') == 'TRUE') ? TRUE : FALSE, 'description' => $desc ); @@ -561,7 +561,7 @@ class ContentModel extends XMLDatastream { $items = $params->item(0)->getElementsByTagName('parameter'); for ($j = 0; $j < $items->length; $j++) { $value = $items->item($j)->nodeValue; - $list[$items->item($j)->getAttribute('name')] = (strtolower($value) == 'true' ? TRUE : (strtolower($value) == 'false' ? FALSE : $value)); + $list[$items->item($j)->getAttribute('name')] = (strtolower($value) == 'TRUE' ? TRUE : (strtolower($value) == 'FALSE' ? FALSE : $value)); } } $element['parameters'] = $list; @@ -657,7 +657,7 @@ class ContentModel extends XMLDatastream { /** * Sets a parameter of an ingest form element. If the value of the element is FALSE the parameter - * will be removed entirely (if you want to store false as a value, then send the String "false"). + * will be removed entirely (if you want to store FALSE as a value, then send the String "FALSE"). * * @param String $elementName * @param String $paramName @@ -786,7 +786,7 @@ class ContentModel extends XMLDatastream { $found->setAttribute('name', $name); $found->setAttribute('type', $type); - $found->setAttribute('required', $required ? 'true' : 'false'); + $found->setAttribute('required', $required ? 'TRUE' : 'FALSE'); if (trim($label) != '' && trim($label) != trim($name)) { $found->setAttribute('label', $label); } @@ -838,7 +838,7 @@ class ContentModel extends XMLDatastream { $elementEl = $this->xml->createElement('element'); $elementEl->setAttribute('name', $name); $elementEl->setAttribute('type', $type); - $elementEl->setAttribute('required', $requiredi ? 'true' : 'false'); + $elementEl->setAttribute('required', $requiredi ? 'TRUE' : 'FALSE'); if (trim($label) != '' && trim($label) != trim($name)) { $elementEl->setAttribute('label', $label); } @@ -1062,7 +1062,7 @@ class ContentModel extends XMLDatastream { $ingest_form = $this->xml->getElementsByTagName('ingest_form')->item(0); if (!empty($ingest_form)) { - if (strtolower($ingest_form->getAttribute('hide_file_chooser')) == 'true') { + if (strtolower($ingest_form->getAttribute('hide_file_chooser')) == 'TRUE') { $form['indicator']['ingest-file-location']['#type'] = 'hidden'; } } @@ -1464,7 +1464,7 @@ class ContentModel extends XMLDatastream { $datastreams = $datastreams->item(0)->getElementsByTagName('datastream'); for ($i = 0; $i < $datastreams->length; $i++) { $ds = $datastreams->item($i); - if ($ds->attributes->getNamedItem('display_in_fieldset') == NULL || strtolower($ds->getAttribute('display_in_fieldset')) != 'false') { + if ($ds->attributes->getNamedItem('display_in_fieldset') == NULL || strtolower($ds->getAttribute('display_in_fieldset')) != 'FALSE') { $dispMethods = $ds->getElementsByTagName('display_method'); for ($j = 0; $j < $dispMethods->length; $j++) { $method = $dispMethods->item($j); @@ -1592,7 +1592,7 @@ class ContentModel extends XMLDatastream { 'file' => $dispMethods->item($i)->getAttribute('file'), 'class' => $dispMethods->item($i)->getAttribute('class'), 'method' => $dispMethods->item($i)->getAttribute('method'), - 'default' => ($dispMethods->item($i)->attributes->getNamedItem('default') !== NULL ? strtolower($dispMethods->item($i)->getAttribute('default')) == 'true' : FALSE)); + 'default' => ($dispMethods->item($i)->attributes->getNamedItem('default') !== NULL ? strtolower($dispMethods->item($i)->getAttribute('default')) == 'TRUE' : FALSE)); } } return $ret; @@ -1620,7 +1620,7 @@ class ContentModel extends XMLDatastream { $dsEl = $this->xml->createElement('datastream'); $dsEl->setAttribute('dsid', $dsid); if ($display_in_fieldset == TRUE) { - $dsEl->setAttribute('display_in_fieldset', 'true'); + $dsEl->setAttribute('display_in_fieldset', 'TRUE'); } $datastreamsEl->appendChild($dsEl); $ret = TRUE; @@ -1652,7 +1652,7 @@ class ContentModel extends XMLDatastream { public function displayInFieldset($dsid) { $ret = FALSE; if (self::valid_dsid($dsid) && ($ds = $this->getDSModel($dsid)) !== FALSE) { - $ret = strtolower($ds->getAttribute('display_in_fieldset')) == 'true'; + $ret = strtolower($ds->getAttribute('display_in_fieldset')) == 'TRUE'; } return $ret; } @@ -1671,7 +1671,7 @@ class ContentModel extends XMLDatastream { $ret = TRUE; } elseif ($value == TRUE) { - $ds->setAttribute('display_in_fieldset', 'true'); + $ds->setAttribute('display_in_fieldset', 'TRUE'); $ret = TRUE; } } @@ -1710,7 +1710,7 @@ class ContentModel extends XMLDatastream { } } - $found->setAttribute('default', 'true'); + $found->setAttribute('default', 'TRUE'); $ret = TRUE; } } @@ -2112,8 +2112,8 @@ class ContentModel extends XMLDatastream { $ingest_formEl = $this->xml->getElementsByTagName('ingest_form')->item(0); $ret = array('dsid' => $ingest_formEl->getAttribute('dsid'), 'page' => $ingest_formEl->getAttribute('page'), - 'hide_file_chooser' => strtolower($ingest_formEl->getAttribute('hide_file_chooser')) == 'true', - 'redirect' => strtolower($ingest_formEl->getAttribute('redirect')) == 'false' ? FALSE : TRUE); + 'hide_file_chooser' => strtolower($ingest_formEl->getAttribute('hide_file_chooser')) == 'TRUE', + 'redirect' => strtolower($ingest_formEl->getAttribute('redirect')) == 'FALSE' ? FALSE : TRUE); } return $ret; } @@ -2133,13 +2133,13 @@ class ContentModel extends XMLDatastream { $ingest_formEl->setAttribute('dsid', $dsid); $ingest_formEl->setAttribute('page', $page); if (!$redirect) { - $ingest_formEl->setAttribute('redirect', 'false'); + $ingest_formEl->setAttribute('redirect', 'FALSE'); } else { $ingest_formEl->removeAttribute('redirect'); } if ($hide_file_chooser) { - $ingest_formEl->setAttribute('hide_file_chooser', 'true'); + $ingest_formEl->setAttribute('hide_file_chooser', 'TRUE'); } else { $ingest_formEl->removeAttribute('hide_file_chooser'); diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 9e9995b7..4097a2d1 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -835,7 +835,7 @@ class ObjectHelper { and $o <mulgara:is> <info:fedora/' . $pid . '>'; $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; + $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query_string))); $rows = explode("\n", $content); @@ -869,7 +869,7 @@ class ObjectHelper { $query_string = substr($query_string, 0, -3) . ' )'; $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; + $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query="; $url .= htmlentities(urlencode($query_string)); $content = $this->doCurl($url); diff --git a/XMLDatastream.inc b/XMLDatastream.inc index d3afed09..ab8044f4 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -102,7 +102,7 @@ abstract class XMLDatastream { * @return XMLDatastream $cm */ public function __construct($xmlStr, $pid = NULL, $dsid = NULL) { - libxml_use_internal_errors(true); + libxml_use_internal_errors(TRUE); $this->pid = $pid; $this->dsid = $dsid; @@ -253,7 +253,7 @@ abstract class XMLDatastream { /** * Gets the history of the datastream from fedora. - * Returns false on failure. + * Returns FALSE on failure. * * @return string[] $ret */ diff --git a/api/fedora_export.inc b/api/fedora_export.inc index e1ed3cbd..30675783 100644 --- a/api/fedora_export.inc +++ b/api/fedora_export.inc @@ -170,7 +170,7 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re } foreach ($xpath->('METS:FLocat[@xlink:href]', $content_node) as $floc) { - $floc->setAttribute('xlink:href', url($paths[$ds_id], array('absolute' => true))); + $floc->setAttribute('xlink:href', url($paths[$ds_id], array('absolute' => TRUE))); } `} */ diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 4dacca8c..a4ee923b 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -297,14 +297,14 @@ class Fedora_Item { $i++; $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora'); if ($cursor == 0) { - $url .= "/objects?query=$field~$pattern&pid=true&title=true&resultFormat=xml&maxResults=$max_results"; + $url .= "/objects?query=$field~$pattern&pid=TRUE&title=TRUE&resultFormat=xml&maxResults=$max_results"; } else { - $url .= "/objects?pid=true&title=truesessionToken=$session_token&resultFormat=xml&maxResults=$max_results"; + $url .= "/objects?pid=TRUE&title=TRUEsessionToken=$session_token&resultFormat=xml&maxResults=$max_results"; } if (count($resultFields) > 0) { - $url .= '&' . join('=true&', $resultFields) . '=true'; + $url .= '&' . join('=TRUE&', $resultFields) . '=TRUE'; } $resultxml = do_curl($url); diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index c8ce7d0e..36ae5918 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -245,7 +245,7 @@ function get_collections_as_option_array() { and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; + $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query))); $list = explode("\n", $content); array_shift($list); @@ -271,7 +271,7 @@ function get_collections_as_option_array() { function get_content_models_as_option_array() { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $restricted = variable_get('fedora_namespace_restriction_enforced', true); + $restricted = variable_get('fedora_namespace_restriction_enforced', TRUE); $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); $namespaces = explode(':', $allowed_string); foreach ($namespaces as $namespace) { @@ -287,7 +287,7 @@ function get_content_models_as_option_array() { order by $title'; $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query="; + $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query="; $content = do_curl($url . htmlentities(urlencode($query))); $list = explode("\n", $content); array_shift($list); diff --git a/fedora_repository.module b/fedora_repository.module index ea1c15c5..e2153355 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -990,7 +990,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU // Add a 'manage object' tab for all objects, where detailed list of content is shown. $obj = new FedoraObjectDetailedContent($pid); $object_details = $obj->showFieldSets(); - if ($object_details['fedora_object_details']['#selected'] == true){ + if ($object_details['fedora_object_details']['#selected'] == TRUE){ foreach($cmodels_tabs as $cmodel_tab){ if (is_array($cmodel_tab)){ $cmodel_tab['#selected'] = FALSE; diff --git a/formClass.inc b/formClass.inc index af0dc218..cfc240b6 100644 --- a/formClass.inc +++ b/formClass.inc @@ -306,8 +306,8 @@ class formClass { '#type' => 'fieldset', '#title' => t('Advanced configuration options'), '#description' => t('Advanced configuration. Under normal circumstances these will not be touched'), - '#collapsible' => true, - '#collapsed' => true, + '#collapsible' => TRUE, + '#collapsed' => TRUE, ); $form['advanced']['fedora_object_display_title'] = array( '#type' => 'select', @@ -587,7 +587,7 @@ class formClass { $form = new IngestObjectMetadataForm(); return $form->create($collection_pid, $collection_label, $form_state); } catch (Exception $e) { - $form_state['storage']['xml'] = false; // An error occured revert back to the QDC Form. + $form_state['storage']['xml'] = FALSE; // An error occured revert back to the QDC Form. } } return $this->createQDCIngestForm($collection_pid, $collection_label, $form_state); @@ -810,7 +810,7 @@ class formClass { $form = new EditObjectMetadataForm($form_state); return $form->create($pid, $client, $form_state); } catch (Exception $e) { - $form_state['storage']['xml'] = false; // An error occured revert back to the QDC Form. + $form_state['storage']['xml'] = FALSE; // An error occured revert back to the QDC Form. } } return $this->createQDCEditForm($pid, $dsid, $client, $form_state); diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 8f97ab94..0351adbe 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -211,7 +211,7 @@ class ImageManipulation { } elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'unix')) { // Use this for Mac OS X (MAMP) - $cmdline = "sips -s format jpeg \"$file\" -z $height $height --out \"$file$file_suffix\" >/dev/null"; + $cmdline = "sips -s format jpeg \"$file\" -z $height $height --out \"$file$file_suffix\" >/dev/NULL"; } else { $cmdline = "convert \"$file\"\[0\] -colorspace RGB -thumbnail " . $width . "x" . $height . " \"$file$file_suffix\""; diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index ec321ca1..e4717f14 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -99,7 +99,7 @@ class ShowQtStreamsInFieldSets { } /** - * Is download enabled. It always returns false. ??? + * Is download enabled. It always returns FALSE. ??? * @return FALSE */ function enableDownload() { @@ -147,7 +147,7 @@ class ShowQtStreamsInFieldSets { } $src = base_path() . 'fedora/repository/' . $this->pid . '/' . $media->ID . '/MOV.mov'; $qtparams = ''; - $qtparams .= "'autostart', '" . ($pframe !== FALSE ? 'true' : 'false') . "', "; + $qtparams .= "'autostart', '" . ($pframe !== FALSE ? 'TRUE' : 'FALSE') . "', "; $init = <<<EOD $(function() { src = "$src"; From c498a3f2b4a34baa2201314ed2084078e59d70a7 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 12 Oct 2011 15:51:46 -0300 Subject: [PATCH 102/247] fixed /dev/null --- api/fedora_collection.inc | 2 +- plugins/ImageManipulation.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index b8afc5c4..a82bf39b 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -41,7 +41,7 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio fwrite($file, $item_foxml); fclose($file); } - if (system("cd $container;zip -r $collection_pid.zip $collection_pid/* >/dev/NULL") == 0) { + if (system("cd $container;zip -r $collection_pid.zip $collection_pid/* >/dev/null") == 0) { header("Content-type: application/zip"); header('Content-Disposition: attachment; filename="' . $collection_pid . '.zip' . '"'); $fh = fopen($container . '/' . $collection_pid . '.zip', 'r'); diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 0351adbe..8f97ab94 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -211,7 +211,7 @@ class ImageManipulation { } elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'unix')) { // Use this for Mac OS X (MAMP) - $cmdline = "sips -s format jpeg \"$file\" -z $height $height --out \"$file$file_suffix\" >/dev/NULL"; + $cmdline = "sips -s format jpeg \"$file\" -z $height $height --out \"$file$file_suffix\" >/dev/null"; } else { $cmdline = "convert \"$file\"\[0\] -colorspace RGB -thumbnail " . $width . "x" . $height . " \"$file$file_suffix\""; From d8728516b978875d6d8e87f6a062679d7d515833 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:11:35 -0300 Subject: [PATCH 103/247] checking to see if I need an array to sanitize text --- fedora_repository.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index e2153355..90354d44 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -115,7 +115,7 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label $collection_pid = urldecode($collection_pid); } else { - drupal_set_message(t("This collection PID $collection_pid is not valid"), 'error'); + drupal_set_message(t("This collection PID @collection_pid is not valid", check_plain($collection_pid )), 'error'); return ' '; } } From bba29d761a032823098c61f8fc9e3a715e9d0483 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:16:41 -0300 Subject: [PATCH 104/247] Does this actually work --- fedora_repository.module | 56 ++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 90354d44..67dc0494 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -54,10 +54,9 @@ function fedora_repository_purge_object($pid = NULL, $name = NULL) { drupal_set_message(t('You must specify an object pid to purge an object.'), 'error'); return ''; } - $output = t('Are you sure you wish to purge object %name %pid!<br /><b>This cannot be undone</b><br />', - array( - '%name' => $name, - '%pid' => $pid) + $output = t('Are you sure you wish to purge object %name %pid!<br /><b>This cannot be undone</b><br />', array( + '%name' => $name, + '%pid' => $pid) ); $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); @@ -115,7 +114,7 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label $collection_pid = urldecode($collection_pid); } else { - drupal_set_message(t("This collection PID @collection_pid is not valid", check_plain($collection_pid )), 'error'); + drupal_set_message(t("This collection PID @collection_pid is not valid", check_plain($collection_pid)), 'error'); return ' '; } } @@ -150,7 +149,7 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { $xml_form->submit($form, $form_state); } } - else if ($form_state['clicked_button']['#id'] == 'edit-submit') { + elseif ($form_state['clicked_button']['#id'] == 'edit-submit') { global $base_url; module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); @@ -240,14 +239,14 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { if (!empty($file)) { if (!in_array($dformat, $allowedMimeTypes)) { form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . - implode(' ', $allowedMimeTypes))); + implode(' ', $allowedMimeTypes))); file_delete($file); return; } elseif (!$cm->execIngestRules($file, $dformat)) { drupal_set_message(t('Error following Content Model Rules'), 'error'); foreach (ContentModel::$errors as $err) { - drupal_set_message($err, 'error'); + drupal_set_message(check_plain($err), 'error'); } } } @@ -400,7 +399,7 @@ function add_stream_form_submit($form, &$form_state) { file_delete($file); } catch (exception $e) { - drupal_set_message(t($e->getMessage()), 'error'); + drupal_set_message(t(check_plain($e->getMessage())), 'error'); return; } $form_state['rebuild'] = TRUE; @@ -448,9 +447,9 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } $validators = array( - // 'file_validate_is_image' => array(), - // 'file_validate_image_resolution' => array('85x85'), - // 'file_validate_size' => array(30 * 1024), + // 'file_validate_is_image' => array(), + // 'file_validate_image_resolution' => array('85x85'), + // 'file_validate_size' => array(30 * 1024), ); $fileObject = file_save_upload('add-stream-file-location', $validators); @@ -482,9 +481,8 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) return ' '; } - $output = t('Are you sure you wish to purge this datastream %name<br />', - array( - '%name' => $name) + $output = t('Are you sure you wish to purge this datastream %name<br />', array( + '%name' => $name) ); $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); return $output; @@ -909,12 +907,12 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); return ''; } - + if (!risearch_available()) { drupal_set_message(t('The Fedora resource index search is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); return ''; } - + if ($pid == NULL) { $pid = variable_get('fedora_repository_pid', 'islandora:root'); } @@ -990,12 +988,11 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU // Add a 'manage object' tab for all objects, where detailed list of content is shown. $obj = new FedoraObjectDetailedContent($pid); $object_details = $obj->showFieldSets(); - if ($object_details['fedora_object_details']['#selected'] == TRUE){ - foreach($cmodels_tabs as $cmodel_tab){ - if (is_array($cmodel_tab)){ + if ($object_details['fedora_object_details']['#selected'] == TRUE) { + foreach ($cmodels_tabs as $cmodel_tab) { + if (is_array($cmodel_tab)) { $cmodel_tab['#selected'] = FALSE; } - } } $cmodels_tabs = array_merge($cmodels_tabs, $object_details); @@ -1468,10 +1465,10 @@ function fedora_repository_demo_objects_form() { ); foreach (array( - 'islandora:collectionCModel' => 'Islandora default content models', - 'islandora:root' => 'Islandora top-level collection', - 'islandora:demos' => 'Islandora demos collection', - 'islandora:largeimages' => 'Sample large image content model (requires <a href="http://sourceforge.net/projects/djatoka/">Djatoka</a> and <a href="http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22">Kakadu</a>.)', +'islandora:collectionCModel' => 'Islandora default content models', + 'islandora:root' => 'Islandora top-level collection', + 'islandora:demos' => 'Islandora demos collection', + 'islandora:largeimages' => 'Sample large image content model (requires <a href="http://sourceforge.net/projects/djatoka/">Djatoka</a> and <a href="http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22">Kakadu</a>.)', ) as $available_demo => $available_demo_desc) { try { @@ -1643,7 +1640,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { if (!empty($form_state['values']['demo_collections']['islandora:largeimages'])) { $error = ''; foreach (array('islandora_jp2Sdep-slideCModel.xml', 'islandora_mods2htmlSdef.xml', 'islandora_mods2htmlSdep.xml', - 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { + 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { try { $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/' . $foxml_file); } catch (exception $e) { @@ -1685,7 +1682,6 @@ function fedora_repository_required_fedora_objects() { 'dsversion' => 2, 'cmodel' => 'fedora-system:ContentModel-3.0', ), - array( 'pid' => 'islandora:root', 'label' => 'Islandora Top-level Collection', @@ -1701,7 +1697,7 @@ function fedora_repository_required_fedora_objects() { 'mimetype' => 'image/png', ), ), - ), + ), ), ), ); @@ -2085,9 +2081,7 @@ function theme_add_to_basket_link($pid, $type = 'object') { */ if (!_is_added_to_basket($pid)) { return l( - theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), - "fedora/repository/addToBasket/" . $path, - array('html' => TRUE) + theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), "fedora/repository/addToBasket/" . $path, array('html' => TRUE) ); } From e542a6d4b52b9ca9d67e708334255064ce0ed768 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:19:28 -0300 Subject: [PATCH 105/247] Sanitizing text --- fedora_repository.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 67dc0494..1d761d8f 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -399,7 +399,7 @@ function add_stream_form_submit($form, &$form_state) { file_delete($file); } catch (exception $e) { - drupal_set_message(t(check_plain($e->getMessage())), 'error'); + drupal_set_message(t('@message', check_plain($e->getMessage())), 'error'); return; } $form_state['rebuild'] = TRUE; @@ -518,7 +518,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error'); } else { - drupal_set_message(t($e->getMessage()), 'error'); + drupal_set_message(t('@message', check_plain($e->getMessage())), 'error'); } return; } @@ -576,7 +576,7 @@ function fedora_repository_purge_stream_form_submit($form, &$form_state) { try { $item->purge_datastream($dsid); } catch (exception $e) { - drupal_set_message(t($e->getMessage()), 'error'); + drupal_set_message(t('@message', check_plain($e->getMessage())), 'error'); } $form_state['redirect'] = $base_url . "/fedora/repository/$pid"; } @@ -934,7 +934,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU } if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed @here", array('@here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); } drupal_access_denied(); exit; From bc69572d6413d58c02d9b5d354a96b9bcb5062cf Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:29:21 -0300 Subject: [PATCH 106/247] Sanitized more text --- fedora_repository.module | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 1d761d8f..2a7e5498 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -399,7 +399,7 @@ function add_stream_form_submit($form, &$form_state) { file_delete($file); } catch (exception $e) { - drupal_set_message(t('@message', check_plain($e->getMessage())), 'error'); + drupal_set_message(t('@message', array('@message' => check_plain($e->getMessage()))), 'error'); return; } $form_state['rebuild'] = TRUE; @@ -435,7 +435,7 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } if (!(preg_match("/^[a-zA-Z]/", $dsid))) { - form_set_error('', t("Data stream ID ($dsid) has to start with a letter.")); + form_set_error('', t("Data stream ID (@dsid) has to start with a letter.", array( '@dsid' => check_plain($dsid)))); return FALSE; } if (strlen($dsLabel) > 64) { @@ -518,7 +518,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error'); } else { - drupal_set_message(t('@message', check_plain($e->getMessage())), 'error'); + drupal_set_message(t('@message', array('@message' => check_plain($e->getMessage()))), 'error'); } return; } @@ -576,7 +576,7 @@ function fedora_repository_purge_stream_form_submit($form, &$form_state) { try { $item->purge_datastream($dsid); } catch (exception $e) { - drupal_set_message(t('@message', check_plain($e->getMessage())), 'error'); + drupal_set_message(t('@message', array('@message' => check_plain($e->getMessage()))), 'error'); } $form_state['redirect'] = $base_url . "/fedora/repository/$pid"; } @@ -1065,7 +1065,7 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU //drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); drupal_access_denied(); if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'error'); + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed @here", array('@here' => l('here', 'admin/settings/fedora_repository'))), 'error'); } return ' '; } @@ -1577,7 +1577,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X'); $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); - drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:ContentModelCollection\">islandora:ContentModelCollection</a>."), 'message'); + drupal_set_message(t("Successfully installed <a href=\"@base_url/fedora/repository/islandora:ContentModelCollection\">islandora:ContentModelCollection</a>.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { } @@ -1589,7 +1589,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); try { $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:root\">islandora:root</a>."), 'message'); + drupal_set_message(t("Successfully installed <a href=\"@base_url/fedora/repository/islandora:root\">islandora:root</a>.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { } @@ -1609,7 +1609,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); $cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X'); $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:demos\">islandora:demos</a>."), 'message'); + drupal_set_message(t("Successfully installed <a href=\"@base_url/fedora/repository/islandora:demos\">islandora:demos</a>.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { } @@ -1631,7 +1631,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $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(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/demo:SmileyStuff\">demo:SmileyStuff</a> collection view."), 'message'); + drupal_set_message(t("Successfully installed <a href=\"@base_url/fedora/repository/demo:SmileyStuff\">demo:SmileyStuff</a> collection view.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { } @@ -1650,7 +1650,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { try { $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/islandora_largeimages.xml'); $tn = $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); - drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:largeimages\">islandora:largeimages</a>."), 'message'); + drupal_set_message(t("Successfully installed <a href=\"@base_url/fedora/repository/islandora:largeimages\">islandora:largeimages</a>.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { $error .= " - Problem ingesting islandora:largeimages collection"; } @@ -1952,7 +1952,7 @@ function fedora_repository_basket_form_submit($form, &$form_state) { $foxml_dir = $export_dir . '/foxml'; if (!file_exists($foxml_dir) && !@mkdir($foxml_dir, 0775, TRUE)) { - drupal_set_message(t("Failed to create foxml dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $foxml_dir)), 'error'); + drupal_set_message(t("Failed to create foxml dir @dir. Check that export dir exsits and has correct permissions", array('@dir' => $foxml_dir)), 'error'); return FALSE; } @@ -1961,7 +1961,7 @@ function fedora_repository_basket_form_submit($form, &$form_state) { $objects_dir = $export_dir . '/objects/' . $pid; if (!file_exists($objects_dir) && !@mkdir($objects_dir, 0775, TRUE)) { - drupal_set_message(t("Failed to create objects dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $objects_dir)), 'error'); + drupal_set_message(t("Failed to create objects dir @dir. Check that export dir exsits and has correct permissions", array('@dir' => $objects_dir)), 'error'); return FALSE; } From cc4f8903635ea880b98f121b53fb3c92046497cd Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:30:27 -0300 Subject: [PATCH 107/247] Fixed last string error in fedora_repository.module --- fedora_repository.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index 2a7e5498..56859edb 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1657,7 +1657,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { } if (!empty($error)) { - drupal_set_message(t('Some problems occurred: ' . $error)); + drupal_set_message(t('Some problems occurred: @error', array('@error' => $error))); } } } From d705d897cb2012a0aec39070ec179d91eccd1abc Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:32:04 -0300 Subject: [PATCH 108/247] Removed CVS id tags --- ConnectionHelper.inc | 2 +- MimeClass.inc | 2 +- ObjectHelper.inc | 2 +- SearchClass.inc | 2 +- SecurityClass.inc | 2 +- api/dublin_core.inc | 2 +- api/fedora_export.inc | 2 +- api/fedora_utils.inc | 2 +- api/rels-ext.inc | 2 +- api/tagging.inc | 2 +- formClass.inc | 2 +- plugins/CollectionFormBuilder.inc | 2 +- plugins/CreateCollection.inc | 2 +- plugins/DemoFormBuilder.inc | 2 +- plugins/Exiftool.inc | 2 +- plugins/FedoraObjectDetailedContent.inc | 2 +- plugins/Ffmpeg.inc | 2 +- plugins/Flv.inc | 2 +- plugins/FlvFormBuilder.inc | 2 +- plugins/FormBuilder.inc | 2 +- plugins/ImageManipulation.inc | 2 +- plugins/ModsFormBuilder.inc | 2 +- plugins/PersonalCollectionClass.inc | 2 +- plugins/Refworks.inc | 2 +- plugins/ShowDemoStreamsInFieldSets.inc | 2 +- plugins/ShowStreamsInFieldSets.inc | 2 +- plugins/map_viewer.inc | 2 +- plugins/qt_viewer.inc | 2 +- plugins/slide_viewer.inc | 2 +- plugins/tagging_form.inc | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 8225f0fc..255ebfac 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/MimeClass.inc b/MimeClass.inc index 119a8f97..42c11e37 100644 --- a/MimeClass.inc +++ b/MimeClass.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 4097a2d1..98160292 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file * Object Helper Class diff --git a/SearchClass.inc b/SearchClass.inc index 3f1c78d5..751dbbfa 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/SecurityClass.inc b/SecurityClass.inc index 0cdb2cbe..1e2b1835 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/api/dublin_core.inc b/api/dublin_core.inc index cb920c2a..ae8a3687 100644 --- a/api/dublin_core.inc +++ b/api/dublin_core.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/api/fedora_export.inc b/api/fedora_export.inc index 30675783..f3c82160 100644 --- a/api/fedora_export.inc +++ b/api/fedora_export.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 917030ee..c154dbc4 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/api/rels-ext.inc b/api/rels-ext.inc index 4714b4ed..d89f9abd 100644 --- a/api/rels-ext.inc +++ b/api/rels-ext.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/api/tagging.inc b/api/tagging.inc index 5d58358b..bfe4b844 100644 --- a/api/tagging.inc +++ b/api/tagging.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/formClass.inc b/formClass.inc index cfc240b6..be5ef9d2 100644 --- a/formClass.inc +++ b/formClass.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index a385aa26..93e11479 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/CreateCollection.inc b/plugins/CreateCollection.inc index 1ce9fad3..c02ac2b7 100644 --- a/plugins/CreateCollection.inc +++ b/plugins/CreateCollection.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/DemoFormBuilder.inc b/plugins/DemoFormBuilder.inc index ccc74ba2..05a9304f 100644 --- a/plugins/DemoFormBuilder.inc +++ b/plugins/DemoFormBuilder.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index c0b98981..d8fd5e90 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 855d508c..4f3d9a74 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/Ffmpeg.inc b/plugins/Ffmpeg.inc index 81072ee3..46b4ae80 100644 --- a/plugins/Ffmpeg.inc +++ b/plugins/Ffmpeg.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/Flv.inc b/plugins/Flv.inc index d8f2b06b..f51e2194 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index c259328c..8c2b5777 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 382733b4..6da718fa 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 8f97ab94..4faabdd8 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index d49869e2..b9ace70b 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 68ae5528..39dc68d0 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 592a7e99..0f3e908c 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/ShowDemoStreamsInFieldSets.inc b/plugins/ShowDemoStreamsInFieldSets.inc index b648df53..80f8017c 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index 77eada60..e13dce33 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index 3e9bcfb6..f3bfca80 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index e4717f14..e52e4363 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index 1d23b227..45ff3f9d 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index 0a421105..390bf36c 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -1,6 +1,6 @@ <?php -// $Id$ + /** * @file From 6494fa13a3accdb8ce373a810483d458e81ea731 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:37:52 -0300 Subject: [PATCH 109/247] Added check_plain to the error handling --- BatchIngest.inc | 2 +- CollectionClass.inc | 18 +++++++++--------- ConnectionHelper.inc | 4 ++-- ObjectHelper.inc | 2 +- plugins/DarwinCore.inc | 2 +- plugins/Flv.inc | 4 ++-- plugins/FormBuilder.inc | 8 ++++---- plugins/ModsFormBuilder.inc | 4 ++-- plugins/PersonalCollectionClass.inc | 4 ++-- plugins/ShowStreamsInFieldSets.inc | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/BatchIngest.inc b/BatchIngest.inc index 621a674a..f4d987e0 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -229,7 +229,7 @@ function batch_create_dc_from_mods($mods_xml) { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); return " "; } diff --git a/CollectionClass.inc b/CollectionClass.inc index ae68e2de..3d2c9f5b 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -131,7 +131,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting relationship element from policy stream !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting relationship element from policy stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); return; } $relationship = $xml->relationship[0]; @@ -172,7 +172,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting PID namespace !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting PID namespace !e', array('!e' => check_plain($e->getMessage()))), 'error'); return; } foreach ($xml->contentmodels->contentmodel as $contentModel) { @@ -199,7 +199,7 @@ class CollectionClass { $xml = new SimpleXMLElement($collection_stream); } catch (Exception $e) { if ($showError) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); } return NULL; } @@ -239,7 +239,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error Getting FormHandler: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error Getting FormHandler: !e', array('!e' => check_plain($e->getMessage()))), 'error'); return NULL; } $formHandler = $xml->ingest_form; @@ -272,7 +272,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting content model stream for mime types !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting content model stream for mime types !e', array('!e' => check_plain($e->getMessage()))), 'error'); return; } foreach ($xml->mimetypes->type as $type) { @@ -302,7 +302,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting content model stream !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting content model stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); return FALSE; } foreach ($xml->ingest_rules->rule as $rule) { @@ -365,7 +365,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting ingest form stream !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting ingest form stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $docRoot = $_SERVER['DOCUMENT_ROOT']; @@ -451,7 +451,7 @@ class CollectionClass { $params )); } catch (exception $e) { - drupal_set_message(t('Error getting Next PID: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting Next PID: !e', array('!e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $pid = implode(get_object_vars($object)); @@ -663,7 +663,7 @@ class CollectionClass { throw new Exception("Invalid XML."); } } catch (Exception $e) { - drupal_set_message(t('!e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('!e', array('!e' => check_plain($e->getMessage()))), 'error'); return ''; } } diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 255ebfac..71cca98d 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -71,7 +71,7 @@ class ConnectionHelper { 'exceptions' => $exceptions, )); } catch (SoapFault $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage()))); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage())))); return NULL; } } @@ -83,7 +83,7 @@ class ConnectionHelper { 'exceptions' => TRUE, )); } catch (SoapFault $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage()))); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage())))); return NULL; } } diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 98160292..ed3aec38 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -750,7 +750,7 @@ class ObjectHelper { try { $parent_collections = new SimpleXMLElement($parent_collections); } catch (exception $e) { - drupal_set_message(t('Error getting parent objects !e', array('!e' => $e->getMessage()))); + drupal_set_message(t('Error getting parent objects !e', array('!e' => check_plain($e->getMessage())))); return; } diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index 5ab525b6..1071c5e0 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -261,7 +261,7 @@ class DarwinCore { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); return " "; } diff --git a/plugins/Flv.inc b/plugins/Flv.inc index f51e2194..0e248b71 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -69,7 +69,7 @@ class FormBuilder { $oai->appendChild($previousElement); } } catch (exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); continue; } } @@ -126,7 +126,7 @@ class FormBuilder { unlink($form_values['fullpath']); } } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); return; } } diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 6da718fa..d44e1f9b 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -68,7 +68,7 @@ class FormBuilder { $oai->appendChild($previousElement); } } catch (exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); continue; } } @@ -96,7 +96,7 @@ class FormBuilder { $xml = new SimpleXMLElement($policyStreamDoc); } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); - drupal_set_message(t('Problem getting security policy: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Problem getting security policy: !e', array('!e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $policyElement = $dom->createDocumentFragment(); @@ -182,8 +182,8 @@ class FormBuilder { } file_delete($form_values['ingest-file-location']); } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); - watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => $e->getMessage()), NULL, WATCHDOG_ERROR); + drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index b9ace70b..05ae0a99 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -316,8 +316,8 @@ class ModsFormBuilder extends FormBuilder { } file_delete($form_values['ingest-file-location']); } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); - watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => $e->getMessage()), NULL, WATCHDOG_ERROR); + drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 39dc68d0..6d5b0946 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -57,7 +57,7 @@ class PersonalCollectionClass { $params )); } catch (exception $e) { - drupal_set_message(t('Error ingesting personal collection object: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error ingesting personal collection object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); return FALSE; } return TRUE; @@ -76,7 +76,7 @@ class PersonalCollectionClass { $xml = new SimpleXMLElement($collectionTemplate); } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem creating personal collection policy, could not parse collection policy stream."), NULL, WATCHDOG_ERROR); - drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: !e', array('!e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $policyElement = $dom->createDocumentFragment(); diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index e13dce33..23d5a4dc 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -183,7 +183,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); return " "; } $xsl = new DomDocument(); @@ -237,7 +237,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); return; } $xsl = new DomDocument(); From 9c43f2dce7cdab33c9a590566c55b5f5c6529e64 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:52:10 -0300 Subject: [PATCH 110/247] Added a check_plain to getMessage and changed !e to @e --- BatchIngest.inc | 2 +- CollectionClass.inc | 18 +++++++++--------- ConnectionHelper.inc | 4 ++-- ObjectHelper.inc | 4 ++-- api/fedora_item.inc | 4 ++-- api/tagging.inc | 2 +- plugins/DarwinCore.inc | 2 +- plugins/Flv.inc | 4 ++-- plugins/FormBuilder.inc | 8 ++++---- plugins/ModsFormBuilder.inc | 4 ++-- plugins/PersonalCollectionClass.inc | 4 ++-- plugins/Refworks.inc | 4 ++-- plugins/ShowStreamsInFieldSets.inc | 4 ++-- 13 files changed, 32 insertions(+), 32 deletions(-) diff --git a/BatchIngest.inc b/BatchIngest.inc index f4d987e0..efc235a6 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -229,7 +229,7 @@ function batch_create_dc_from_mods($mods_xml) { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } diff --git a/CollectionClass.inc b/CollectionClass.inc index 3d2c9f5b..82e4739e 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -131,7 +131,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting relationship element from policy stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting relationship element from policy stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } $relationship = $xml->relationship[0]; @@ -172,7 +172,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting PID namespace !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting PID namespace @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } foreach ($xml->contentmodels->contentmodel as $contentModel) { @@ -199,7 +199,7 @@ class CollectionClass { $xml = new SimpleXMLElement($collection_stream); } catch (Exception $e) { if ($showError) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); } return NULL; } @@ -239,7 +239,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error Getting FormHandler: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error Getting FormHandler: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return NULL; } $formHandler = $xml->ingest_form; @@ -272,7 +272,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting content model stream for mime types !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting content model stream for mime types @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } foreach ($xml->mimetypes->type as $type) { @@ -302,7 +302,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting content model stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting content model stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } foreach ($xml->ingest_rules->rule as $rule) { @@ -365,7 +365,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting ingest form stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting ingest form stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $docRoot = $_SERVER['DOCUMENT_ROOT']; @@ -451,7 +451,7 @@ class CollectionClass { $params )); } catch (exception $e) { - drupal_set_message(t('Error getting Next PID: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting Next PID: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $pid = implode(get_object_vars($object)); @@ -663,7 +663,7 @@ class CollectionClass { throw new Exception("Invalid XML."); } } catch (Exception $e) { - drupal_set_message(t('!e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return ''; } } diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 71cca98d..59f811e2 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -71,7 +71,7 @@ class ConnectionHelper { 'exceptions' => $exceptions, )); } catch (SoapFault $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage())))); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); return NULL; } } @@ -83,7 +83,7 @@ class ConnectionHelper { 'exceptions' => TRUE, )); } catch (SoapFault $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage())))); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); return NULL; } } diff --git a/ObjectHelper.inc b/ObjectHelper.inc index ed3aec38..70f73d4b 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -386,7 +386,7 @@ class ObjectHelper { $input = new DomDocument(); $input->loadXML(trim($xmlstr)); } catch (exception $e) { - watchdog(t("Fedora_Repository"), "Problem loading XSL file: !e", array('!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem loading XSL file: @e", array('@e' => $e), NULL, WATCHDOG_ERROR); } $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); @@ -750,7 +750,7 @@ class ObjectHelper { try { $parent_collections = new SimpleXMLElement($parent_collections); } catch (exception $e) { - drupal_set_message(t('Error getting parent objects !e', array('!e' => check_plain($e->getMessage())))); + drupal_set_message(t('Error getting parent objects @e', array('@e' => check_plain($e->getMessage())))); return; } diff --git a/api/fedora_item.inc b/api/fedora_item.inc index a4ee923b..54a9158b 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -885,7 +885,7 @@ class Fedora_Item { drupal_set_message(t("Error trying to call SOAP function $function_name. Check watchdog logs for more information."), 'error'); } - watchdog(t("FEDORA_REPOSITORY"), "Error Trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error Trying to call SOAP function @fn: @e", array('@fn' => $function_name, '@e' => $e), NULL, WATCHDOG_ERROR); } return NULL; } @@ -904,7 +904,7 @@ class Fedora_Item { } catch (exception $e) { if (!$quiet) { - watchdog(t("FEDORA_REPOSITORY"), "Error trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error trying to call SOAP function @fn: @e", array('@fn' => $function_name, '@e' => $e), NULL, WATCHDOG_ERROR); } return NULL; } diff --git a/api/tagging.inc b/api/tagging.inc index bfe4b844..418193fa 100644 --- a/api/tagging.inc +++ b/api/tagging.inc @@ -69,7 +69,7 @@ class TagSet { $this->item->modify_datastream_by_value($tagdoc->saveXML(), $this->tagsDSID, 'Tags', 'text/xml', 'X'); } } catch (exception $e) { - drupal_set_message(t('There was an error saving the tags datastream: !e'), array('!e' => $e), 'error'); + drupal_set_message(t('There was an error saving the tags datastream: @e'), array('@e' => $e), 'error'); return FALSE; } return TRUE; diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index 1071c5e0..2d66d60a 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -261,7 +261,7 @@ class DarwinCore { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } diff --git a/plugins/Flv.inc b/plugins/Flv.inc index 0e248b71..b5f159b2 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -69,7 +69,7 @@ class FormBuilder { $oai->appendChild($previousElement); } } catch (exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); continue; } } @@ -126,7 +126,7 @@ class FormBuilder { unlink($form_values['fullpath']); } } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } } diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index d44e1f9b..cd9dc4a9 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -68,7 +68,7 @@ class FormBuilder { $oai->appendChild($previousElement); } } catch (exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); continue; } } @@ -96,7 +96,7 @@ class FormBuilder { $xml = new SimpleXMLElement($policyStreamDoc); } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); - drupal_set_message(t('Problem getting security policy: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Problem getting security policy: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $policyElement = $dom->createDocumentFragment(); @@ -182,8 +182,8 @@ class FormBuilder { } file_delete($form_values['ingest-file-location']); } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); - watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); + watchdog(t("Fedora_Repository"), "Error ingesting object: @e", array('@e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index 05ae0a99..aa0f6f92 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -316,8 +316,8 @@ class ModsFormBuilder extends FormBuilder { } file_delete($form_values['ingest-file-location']); } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); - watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); + watchdog(t("Fedora_Repository"), "Error ingesting object: @e", array('@e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 6d5b0946..29c76cfa 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -57,7 +57,7 @@ class PersonalCollectionClass { $params )); } catch (exception $e) { - drupal_set_message(t('Error ingesting personal collection object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error ingesting personal collection object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } return TRUE; @@ -76,7 +76,7 @@ class PersonalCollectionClass { $xml = new SimpleXMLElement($collectionTemplate); } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem creating personal collection policy, could not parse collection policy stream."), NULL, WATCHDOG_ERROR); - drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $policyElement = $dom->createDocumentFragment(); diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 0f3e908c..5e39b3c2 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -290,7 +290,7 @@ class Refworks { if ($client == NULL) { drupal_set_message(t('Error getting SOAP client.'), 'error'); - watchdog(t("FEDORA_REPOSITORY"), "Error getting SOAP client: !e", array('!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error getting SOAP client: @e", array('@e' => $e), NULL, WATCHDOG_ERROR); return; } $object = $client->__soapCall('ingest', array( @@ -305,7 +305,7 @@ class Refworks { } catch (exception $e) { $errors++; $errorMessage = 'yes'; - watchdog(t("FEDORA_REPOSITORY"), t("Error during ingest !it !e", array('!it' => $item_title, '!e' => $e)), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), t("Error during ingest !it @e", array('!it' => $item_title, '@e' => $e)), NULL, WATCHDOG_ERROR); } $success++; } diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index 23d5a4dc..a6e7eaad 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -183,7 +183,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } $xsl = new DomDocument(); @@ -237,7 +237,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } $xsl = new DomDocument(); From 759c5204497fb27e60a108f28fb85b070e1a9589 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 13 Oct 2011 14:56:38 -0300 Subject: [PATCH 111/247] Removed camel case --- BatchIngest.inc | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/BatchIngest.inc b/BatchIngest.inc index efc235a6..c78be313 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -65,22 +65,22 @@ function batch_creation_form(&$form_state, $collection_pid, $content_models) { */ function batch_creation_form_validate($form, &$form_state) { - $fieldName = 'file-location'; - if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name'][$fieldName])) { - $file = file_save_upload($fieldName); + $field_name = 'file-location'; + if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name'][$field_name])) { + $file = file_save_upload($field_name); if ($file->filemime != 'application/zip') { - form_set_error($fieldName, 'Input file must be a .zip file'); + form_set_error($field_name, 'Input file must be a .zip file'); return; } if (!$file) { - form_set_error($fieldName, 'Error uploading file.'); + form_set_error($field_name, 'Error uploading file.'); return; } $form_state['values']['file'] = $file; } else { // set error - form_set_error($fieldName, 'Error uploading file.'); + form_set_error($field_name, 'Error uploading file.'); return; } } @@ -100,27 +100,27 @@ function batch_creation_form_submit($form, &$form_state) { } $namespace = $namespace_mappings[$content_model]; $namespace = preg_replace('/:.*/', '', $namespace); - $dirName = "temp" . $user->uid; - $tmpDir = file_directory_path() . '/' . $dirName . '/'; - mkdir($tmpDir); + $dir_name = "temp" . $user->uid; + $tmp_dir = file_directory_path() . '/' . $dir_name . '/'; + mkdir($tmp_dir); $file = $form_state['values']['file']; $fileName = $file->filepath; $file_list = array(); - $cmdString = "unzip -q -o -d $tmpDir \"$fileName\""; + $cmdString = "unzip -q -o -d $tmp_dir \"$fileName\""; system($cmdString, $retVal); $dirs = array(); - $doNotAdd = array('.', '..', '__MACOSX'); - array_push($dirs, $tmpDir); - $files = scandir($tmpDir); + $do_not_add = array('.', '..', '__MACOSX'); + array_push($dirs, $tmp_dir); + $files = scandir($tmp_dir); foreach ($files as $file) { - if (is_dir("$tmpDir/$file") & !in_array($file, $doNotAdd)) { - array_push($dirs, $tmpDir . $file); + if (is_dir("$tmp_dir/$file") & !in_array($file, $do_not_add)) { + array_push($dirs, $tmp_dir . $file); } } foreach ($dirs as $directory) { if ($inputs = opendir($directory)) { while (FALSE !== ($file_name = readdir($inputs))) { - if (!in_array($file_name, $doNotAdd) && is_dir($file_name) == FALSE) { + if (!in_array($file_name, $do_not_add) && is_dir($file_name) == FALSE) { $ext = strrchr($file_name, '.'); $base = preg_replace("/$ext$/", '', $file_name); $ext = substr($ext, 1); @@ -148,7 +148,7 @@ function batch_creation_form_submit($form, &$form_state) { foreach ($file_list as $label => $object_files) { $batch['operations'][] = array('create_batch_objects', array($label, $content_model, $object_files, $collection_pid, $namespace, $metadata)); } - $batch['operations'][] = array('recursive_directory_delete', array($tmpDir)); + $batch['operations'][] = array('recursive_directory_delete', array($tmp_dir)); batch_set($batch); batch_process(); } @@ -168,7 +168,7 @@ function create_batch_objects($label, $content_model, $object_files, $collection module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); - $allowedMimeTypes = $cm->getMimetypes(); + $allowed_mime_types = $cm->getMimetypes(); $mime_helper = new MimeClass(); $pid = fedora_item::get_next_PID_in_namespace($namespace); @@ -193,7 +193,7 @@ function create_batch_objects($label, $content_model, $object_files, $collection $use_primary = TRUE; foreach ($object_files as $ext => $filename) { $file_mimetype = $mime_helper->get_mimetype($filename); - if (in_array($file_mimetype, $allowedMimeTypes)) { + if (in_array($file_mimetype, $allowed_mime_types)) { $added = $cm->execIngestRules($filename, $file_mimetype); } else { From 9eb6038eeafba16fb248bf88bc08ab20f014094b Mon Sep 17 00:00:00 2001 From: rwincewicz <richard.wincewicz@googlemail.com> Date: Fri, 14 Oct 2011 16:43:42 -0300 Subject: [PATCH 112/247] Fixed paging issue in sparql_to_html.xsl --- xsl/sparql_to_html.xsl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index 71f94a30..c64af7d0 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -34,7 +34,7 @@ of <xsl:value-of select="$count"/> <br /> <li class="pager-previous"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/<xsl:value-of select="$thisTitle"/>/<xsl:value-of select="$page - 1"/> + <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page - 1"/> </xsl:attribute> <Prev </a></li> @@ -44,7 +44,7 @@ of <xsl:value-of select="$count"/> <br /> <li class="pager-next"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/<xsl:value-of select="$thisTitle"/>/<xsl:value-of select="$page + 1"/> + <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page + 1"/> </xsl:attribute> Next> </a></li> @@ -54,13 +54,13 @@ of <xsl:value-of select="$count"/> <br /> <li class="pager-previous"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/<xsl:value-of select="$thisTitle"/>/<xsl:value-of select="$page - 1"/> + <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page - 1"/> </xsl:attribute> <Prev </a> </li> <li class="pager-next"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/<xsl:value-of select="$thisTitle"/>/<xsl:value-of select="$page + 1"/> + <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page + 1"/> </xsl:attribute> Next> </a></li> @@ -106,7 +106,7 @@ of <xsl:value-of select="$count"/> <br /> <li class="pager-previous"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/<xsl:value-of select="$thisTitle"/>/<xsl:value-of select="$page - 1"/> + <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page - 1"/> </xsl:attribute> <Prev </a></li> @@ -116,7 +116,7 @@ of <xsl:value-of select="$count"/> <br /> <li class="pager-next"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/<xsl:value-of select="$thisTitle"/>/<xsl:value-of select="$page + 1"/> + <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page + 1"/> </xsl:attribute> Next> </a></li> @@ -126,13 +126,13 @@ of <xsl:value-of select="$count"/> <br /> <li class="pager-previous"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/<xsl:value-of select="$thisTitle"/>/<xsl:value-of select="$page - 1"/> + <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page - 1"/> </xsl:attribute> <Prev </a> </li> <li class="pager-next"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/<xsl:value-of select="$thisTitle"/>/<xsl:value-of select="$page + 1"/> + <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page + 1"/> </xsl:attribute> Next> </a></li> @@ -245,4 +245,4 @@ </xsl:otherwise> </xsl:choose> </xsl:template> -</xsl:stylesheet> \ No newline at end of file +</xsl:stylesheet> From db7874c35eb96d20b964671ece1ccd701c36bf4f Mon Sep 17 00:00:00 2001 From: rwincewicz <richard.wincewicz@googlemail.com> Date: Fri, 14 Oct 2011 16:47:15 -0300 Subject: [PATCH 113/247] Fixed paging issue in sparql_to_html.xsl --- xsl/sparql_to_html.xsl | 1 - 1 file changed, 1 deletion(-) diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index c64af7d0..1b042273 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -8,7 +8,6 @@ <xsl:value-of select="$path"/> </xsl:variable> <xsl:variable name="thisPid" select="$collectionPid"/> - <xsl:variable name="thisTitle" select="Collection"/> <xsl:variable name="size" select="20"/> <xsl:variable name="page" select="$hitPage"/> <xsl:variable name="start" select="((number($page) - 1) * number($size)) + 1"/> From 9201ae2ef6d4e0df6420b8f41f561e85f542bff9 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 18 Oct 2011 15:43:21 -0300 Subject: [PATCH 114/247] Fixed version --- fedora_repository.info | 2 +- plugins/fedora_imageapi.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index 6fcf223f..99cb3d6f 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -5,5 +5,5 @@ dependencies[] = tabs dependencies[] = islandora_content_model_forms description = Shows a list of items in a fedora collection. package = Islandora -version = 11.2.beta2 +version = 11.2.0 core = 6.x diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index 6a465a04..af50a614 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -3,5 +3,5 @@ description = Adds image manipulation support through a REST interface package = Islandora Dependencies dependencies[] = fedora_repository dependencies[] = imageapi -version = 11.2.beta2 +version = 11.2.0 core = 6.x From ce0078d0eab8a0a4346e2086069093351d37a604 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 19 Oct 2011 09:33:17 -0300 Subject: [PATCH 115/247] Moved fixed a more appropriate place API should be low level fedora communications Core should be islandora specific code --- BatchIngest.inc => core/BatchIngest.inc | 0 CollectionClass.inc => core/CollectionClass.inc | 0 CollectionManagement.inc => core/CollectionManagement.inc | 0 CollectionPolicy.inc => core/CollectionPolicy.inc | 0 ConnectionHelper.inc => core/ConnectionHelper.inc | 0 ContentModel.inc => core/ContentModel.inc | 0 MimeClass.inc => core/MimeClass.inc | 0 ObjectHelper.inc => core/ObjectHelper.inc | 0 SearchClass.inc => core/SearchClass.inc | 0 SecurityClass.inc => core/SecurityClass.inc | 0 XMLDatastream.inc => core/XMLDatastream.inc | 0 .../fedora_repository.solutionpacks.inc | 0 formClass.inc => core/formClass.inc | 0 islandoracm.xsd => xsd/islandoracm.xsd | 0 searchTerms.xml => xsl/searchTerms.xml | 0 solrSearchTerms.xml => xsl/solrSearchTerms.xml | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename BatchIngest.inc => core/BatchIngest.inc (100%) rename CollectionClass.inc => core/CollectionClass.inc (100%) rename CollectionManagement.inc => core/CollectionManagement.inc (100%) rename CollectionPolicy.inc => core/CollectionPolicy.inc (100%) rename ConnectionHelper.inc => core/ConnectionHelper.inc (100%) rename ContentModel.inc => core/ContentModel.inc (100%) rename MimeClass.inc => core/MimeClass.inc (100%) rename ObjectHelper.inc => core/ObjectHelper.inc (100%) rename SearchClass.inc => core/SearchClass.inc (100%) rename SecurityClass.inc => core/SecurityClass.inc (100%) rename XMLDatastream.inc => core/XMLDatastream.inc (100%) rename fedora_repository.solutionpacks.inc => core/fedora_repository.solutionpacks.inc (100%) rename formClass.inc => core/formClass.inc (100%) rename islandoracm.xsd => xsd/islandoracm.xsd (100%) rename searchTerms.xml => xsl/searchTerms.xml (100%) rename solrSearchTerms.xml => xsl/solrSearchTerms.xml (100%) diff --git a/BatchIngest.inc b/core/BatchIngest.inc similarity index 100% rename from BatchIngest.inc rename to core/BatchIngest.inc diff --git a/CollectionClass.inc b/core/CollectionClass.inc similarity index 100% rename from CollectionClass.inc rename to core/CollectionClass.inc diff --git a/CollectionManagement.inc b/core/CollectionManagement.inc similarity index 100% rename from CollectionManagement.inc rename to core/CollectionManagement.inc diff --git a/CollectionPolicy.inc b/core/CollectionPolicy.inc similarity index 100% rename from CollectionPolicy.inc rename to core/CollectionPolicy.inc diff --git a/ConnectionHelper.inc b/core/ConnectionHelper.inc similarity index 100% rename from ConnectionHelper.inc rename to core/ConnectionHelper.inc diff --git a/ContentModel.inc b/core/ContentModel.inc similarity index 100% rename from ContentModel.inc rename to core/ContentModel.inc diff --git a/MimeClass.inc b/core/MimeClass.inc similarity index 100% rename from MimeClass.inc rename to core/MimeClass.inc diff --git a/ObjectHelper.inc b/core/ObjectHelper.inc similarity index 100% rename from ObjectHelper.inc rename to core/ObjectHelper.inc diff --git a/SearchClass.inc b/core/SearchClass.inc similarity index 100% rename from SearchClass.inc rename to core/SearchClass.inc diff --git a/SecurityClass.inc b/core/SecurityClass.inc similarity index 100% rename from SecurityClass.inc rename to core/SecurityClass.inc diff --git a/XMLDatastream.inc b/core/XMLDatastream.inc similarity index 100% rename from XMLDatastream.inc rename to core/XMLDatastream.inc diff --git a/fedora_repository.solutionpacks.inc b/core/fedora_repository.solutionpacks.inc similarity index 100% rename from fedora_repository.solutionpacks.inc rename to core/fedora_repository.solutionpacks.inc diff --git a/formClass.inc b/core/formClass.inc similarity index 100% rename from formClass.inc rename to core/formClass.inc diff --git a/islandoracm.xsd b/xsd/islandoracm.xsd similarity index 100% rename from islandoracm.xsd rename to xsd/islandoracm.xsd diff --git a/searchTerms.xml b/xsl/searchTerms.xml similarity index 100% rename from searchTerms.xml rename to xsl/searchTerms.xml diff --git a/solrSearchTerms.xml b/xsl/solrSearchTerms.xml similarity index 100% rename from solrSearchTerms.xml rename to xsl/solrSearchTerms.xml From bddfd81fc8c1082e0bf76b789727790a7dde92d8 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 19 Oct 2011 09:57:41 -0300 Subject: [PATCH 116/247] Marked everything in plugins as deprecated --- {plugins => api}/fedora_imageapi.info | 0 {plugins => api}/fedora_imageapi.module | 6 ++++-- plugins/CollectionFormBuilder.inc | 4 +--- plugins/CreateCollection.inc | 1 + plugins/DarwinCore.inc | 9 ++------- plugins/DemoFormBuilder.inc | 4 +--- plugins/DocumentConverter.inc | 2 +- plugins/Exiftool.inc | 3 +-- plugins/FedoraObjectDetailedContent.inc | 3 +-- plugins/Ffmpeg.inc | 3 +-- plugins/Flv.inc | 3 +-- plugins/FlvFormBuilder.inc | 4 +--- plugins/FormBuilder.inc | 3 +-- plugins/ImageManipulation.inc | 3 +-- plugins/ModsFormBuilder.inc | 5 ++--- plugins/PersonalCollectionClass.inc | 3 +-- plugins/QtFormBuilder.php | 3 +-- plugins/Refworks.inc | 3 ++- plugins/ShowDemoStreamsInFieldSets.inc | 3 ++- plugins/ShowStreamsInFieldSets.inc | 3 ++- plugins/herbarium.inc | 12 ++++++------ plugins/map_viewer.inc | 5 ++--- plugins/qt_viewer.inc | 3 +-- plugins/slide_viewer.inc | 5 ++--- plugins/tagging_form.inc | 6 ++++-- 25 files changed, 42 insertions(+), 57 deletions(-) rename {plugins => api}/fedora_imageapi.info (100%) rename {plugins => api}/fedora_imageapi.module (98%) diff --git a/plugins/fedora_imageapi.info b/api/fedora_imageapi.info similarity index 100% rename from plugins/fedora_imageapi.info rename to api/fedora_imageapi.info diff --git a/plugins/fedora_imageapi.module b/api/fedora_imageapi.module similarity index 98% rename from plugins/fedora_imageapi.module rename to api/fedora_imageapi.module index f3bd4481..99c2cfd2 100644 --- a/plugins/fedora_imageapi.module +++ b/api/fedora_imageapi.module @@ -1,7 +1,9 @@ <?php - - +/** + * fedora imageapi menu + * @return string + */ function fedora_imageapi_menu() { $items = array(); $items['fedora/imageapi'] = array( diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index 93e11479..83624d38 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * Collection Form Builder @@ -12,8 +10,8 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml * builds a dc metadata form + * @deprecated */ - class CollectionFormBuilder extends FormBuilder { /** diff --git a/plugins/CreateCollection.inc b/plugins/CreateCollection.inc index c02ac2b7..c29eb657 100644 --- a/plugins/CreateCollection.inc +++ b/plugins/CreateCollection.inc @@ -9,6 +9,7 @@ /** * This Class implements the methods defined in the STANDARD_IMAGE content model + * @deprecated */ class CreateCollection { diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index 2d66d60a..dc698521 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -1,18 +1,13 @@ <?php -/* @file - - - -*/ - /** * @file * Darwin Core class */ /** - * Darwin Core ??? + * Darwin Core + * @deprecated */ class DarwinCore { diff --git a/plugins/DemoFormBuilder.inc b/plugins/DemoFormBuilder.inc index 05a9304f..305c2029 100644 --- a/plugins/DemoFormBuilder.inc +++ b/plugins/DemoFormBuilder.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * @@ -11,8 +9,8 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml * builds a dc metadata form + * @deprecated */ - class DemoFormBuilder extends FormBuilder { /** diff --git a/plugins/DocumentConverter.inc b/plugins/DocumentConverter.inc index f258441a..ce782f08 100644 --- a/plugins/DocumentConverter.inc +++ b/plugins/DocumentConverter.inc @@ -1,6 +1,5 @@ <?php - /** * @file * Document Converter Class @@ -9,6 +8,7 @@ /** * This class implements document (doc, odt, pdf, etc.) conversion for a generic * multi-format document collection. + * @deprecated */ class DocumentConverter { diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index d8fd5e90..002c6b0c 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * Exiftool @@ -9,6 +7,7 @@ /** * This Class implements the methods defined in the STANDARD_IMAGE content model + * @deprecated */ class Exiftool { diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 4f3d9a74..ea70642b 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * FedoraObjectDetailedContent class @@ -11,6 +9,7 @@ * Fedora Object. This class is a plugin called from content models to display a detailed list of * content of the Fedora Item. This is hard coded into Islandora core, and it can also be called * from the IslandoraCM stream. + * @deprecated */ class FedoraObjectDetailedContent { diff --git a/plugins/Ffmpeg.inc b/plugins/Ffmpeg.inc index 46b4ae80..7c2159ed 100644 --- a/plugins/Ffmpeg.inc +++ b/plugins/Ffmpeg.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * Ffmpeg wrapper class @@ -11,6 +9,7 @@ * FFMpeg wrapper class for generating movie thumbnails * * This Class implements the methods defined in the STANDARD_QT content model + * @deprecated */ class Ffmpeg { diff --git a/plugins/Flv.inc b/plugins/Flv.inc index b5f159b2..76506ce3 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * Form Builder class @@ -9,6 +7,7 @@ /** * implements method from content model ingest form xml + * @deprecated */ class FormBuilder { diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index 8c2b5777..5e022b88 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * FLVFormBuilder @@ -11,8 +9,8 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml * builds a dc metadata form + * @deprecated */ - class FlvFormBuilder extends FormBuilder { /** diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index cd9dc4a9..02ca6ace 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * FormBuilder class @@ -10,6 +8,7 @@ /** * implements methods from content model ingest form xml * builds a dc metadata form + * @deprecated */ class FormBuilder { diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 4faabdd8..bbbe84fd 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * Image Manipulation class @@ -9,6 +7,7 @@ /** * This Class implements the methods defined in the STANDARD_IMAGE content model + * @deprecated */ class ImageManipulation { diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index aa0f6f92..c7eefdb6 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * ModsFormBuilder class @@ -9,7 +7,8 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** - * ModsFormBuilder class ??? + * ModsFormBuilder class + * @deprecated */ class ModsFormBuilder extends FormBuilder { diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 29c76cfa..b81d75df 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * PersonalCollectionClass class @@ -9,6 +7,7 @@ /** * Personal Collection Class + * @deprecated */ class PersonalCollectionClass { diff --git a/plugins/QtFormBuilder.php b/plugins/QtFormBuilder.php index 28645d6b..95b7699c 100644 --- a/plugins/QtFormBuilder.php +++ b/plugins/QtFormBuilder.php @@ -1,7 +1,5 @@ <?php -// $Id$ - /** * @file * QTFormBuilder class @@ -11,6 +9,7 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * Implements methods from content model ingest form xml * builds a dc metadata form + * @deprecated */ class QtFormBuilder extends FormBuilder { diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 5e39b3c2..e539520c 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -10,7 +10,8 @@ module_load_include('inc', 'fedora_repository', 'SecurityClass'); /** - * Refworks class ??? + * Refworks class + * @deprecated */ class Refworks { diff --git a/plugins/ShowDemoStreamsInFieldSets.inc b/plugins/ShowDemoStreamsInFieldSets.inc index 80f8017c..05c2dbd8 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -8,7 +8,8 @@ */ /** - * Show Demo Streams in Field Sets ??? + * Show Demo Streams in Field Sets + * @deprecated */ class ShowDemoStreamsInFieldSets { diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index a6e7eaad..3fc116d2 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -8,7 +8,8 @@ */ /** - * Show Streams In Field Sets ?? + * Show Streams In Field Sets + * @deprecated */ class ShowStreamsInFieldSets { diff --git a/plugins/herbarium.inc b/plugins/herbarium.inc index f7a6d685..fa2ac4a7 100644 --- a/plugins/herbarium.inc +++ b/plugins/herbarium.inc @@ -1,20 +1,20 @@ <?php -/** - * @file - * - */ - /** * @file * Herbarium class */ /** - * Herbarium ??? + * Herbarium Class + * @deprecated */ class Herbarium { + /** + * Constructor + * @param type $pid + */ function __construct($pid = '') { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); if (!empty($pid)) { diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index f3bfca80..7b9cdf1d 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -1,14 +1,13 @@ <?php - - /** * @file * ShowMapStreamsInFieldSets class */ /** - * Show Map Streams in Field Sets Class ?? + * Show Map Streams in Field Sets Class + * @deprecated */ class ShowMapStreamsInFieldSets { diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index e52e4363..46984cf2 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * ShowQTStreamsInFieldSets class @@ -9,6 +7,7 @@ /** * Show QT Stream in Field Sets + * @deprecated */ class ShowQtStreamsInFieldSets { diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index 45ff3f9d..b7c3cf41 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -1,14 +1,13 @@ <?php - - /** * @file * ShowSlideStreamsInFieldSets class */ /** - * ShowSlideStreamInFieldSets ?????? + * ShowSlideStreamInFieldSets + * @deprecated */ class ShowSlideStreamsInFieldSets { diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index 390bf36c..d3931957 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * Tagging Form??? @@ -11,6 +9,7 @@ * Show subject tags ??? * @param type $pid * @return string + * @deprecated */ function _show_subject_tags($pid) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); @@ -34,6 +33,7 @@ function _show_subject_tags($pid) { * @param type $form_state * @param type $pid * @return type + * @deprecated */ function fedora_repository_image_tagging_form($form_state, $pid) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); @@ -105,6 +105,7 @@ function fedora_repository_image_tagging_form($form_state, $pid) { * Hook image button process ??? * @param type $form * @return string + * @deprecated */ function hook_imagebutton_process($form) { $form['op_x'] = array( @@ -121,6 +122,7 @@ function hook_imagebutton_process($form) { * @global type $user * @param type $form * @param type $form_state + * @deprecated */ function fedora_repository_image_tagging_form_submit($form, &$form_state) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); From 4bca2e80afa15eaec7805611218d968c72e6b307 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 19 Oct 2011 09:58:39 -0300 Subject: [PATCH 117/247] Moved the collection policy file --- collection_policy.xsd => xsd/collection_policy.xsd | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename collection_policy.xsd => xsd/collection_policy.xsd (100%) diff --git a/collection_policy.xsd b/xsd/collection_policy.xsd similarity index 100% rename from collection_policy.xsd rename to xsd/collection_policy.xsd From d037ce4edf5597951bfa7d5c6c14765b69de2c91 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 19 Oct 2011 10:07:47 -0300 Subject: [PATCH 118/247] Revert "Moved the collection policy file" This reverts commit 4bca2e80afa15eaec7805611218d968c72e6b307. --- xsd/collection_policy.xsd => collection_policy.xsd | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename xsd/collection_policy.xsd => collection_policy.xsd (100%) diff --git a/xsd/collection_policy.xsd b/collection_policy.xsd similarity index 100% rename from xsd/collection_policy.xsd rename to collection_policy.xsd From e1ebfb8f32a7389c2fab76d03b27fcb77cb3865e Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 19 Oct 2011 10:07:56 -0300 Subject: [PATCH 119/247] Revert "Marked everything in plugins as deprecated" This reverts commit bddfd81fc8c1082e0bf76b789727790a7dde92d8. --- plugins/CollectionFormBuilder.inc | 4 +++- plugins/CreateCollection.inc | 1 - plugins/DarwinCore.inc | 9 +++++++-- plugins/DemoFormBuilder.inc | 4 +++- plugins/DocumentConverter.inc | 2 +- plugins/Exiftool.inc | 3 ++- plugins/FedoraObjectDetailedContent.inc | 3 ++- plugins/Ffmpeg.inc | 3 ++- plugins/Flv.inc | 3 ++- plugins/FlvFormBuilder.inc | 4 +++- plugins/FormBuilder.inc | 3 ++- plugins/ImageManipulation.inc | 3 ++- plugins/ModsFormBuilder.inc | 5 +++-- plugins/PersonalCollectionClass.inc | 3 ++- plugins/QtFormBuilder.php | 3 ++- plugins/Refworks.inc | 3 +-- plugins/ShowDemoStreamsInFieldSets.inc | 3 +-- plugins/ShowStreamsInFieldSets.inc | 3 +-- {api => plugins}/fedora_imageapi.info | 0 {api => plugins}/fedora_imageapi.module | 6 ++---- plugins/herbarium.inc | 12 ++++++------ plugins/map_viewer.inc | 5 +++-- plugins/qt_viewer.inc | 3 ++- plugins/slide_viewer.inc | 5 +++-- plugins/tagging_form.inc | 6 ++---- 25 files changed, 57 insertions(+), 42 deletions(-) rename {api => plugins}/fedora_imageapi.info (100%) rename {api => plugins}/fedora_imageapi.module (98%) diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index 83624d38..93e11479 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * Collection Form Builder @@ -10,8 +12,8 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml * builds a dc metadata form - * @deprecated */ + class CollectionFormBuilder extends FormBuilder { /** diff --git a/plugins/CreateCollection.inc b/plugins/CreateCollection.inc index c29eb657..c02ac2b7 100644 --- a/plugins/CreateCollection.inc +++ b/plugins/CreateCollection.inc @@ -9,7 +9,6 @@ /** * This Class implements the methods defined in the STANDARD_IMAGE content model - * @deprecated */ class CreateCollection { diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index dc698521..2d66d60a 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -1,13 +1,18 @@ <?php +/* @file + + + +*/ + /** * @file * Darwin Core class */ /** - * Darwin Core - * @deprecated + * Darwin Core ??? */ class DarwinCore { diff --git a/plugins/DemoFormBuilder.inc b/plugins/DemoFormBuilder.inc index 305c2029..05a9304f 100644 --- a/plugins/DemoFormBuilder.inc +++ b/plugins/DemoFormBuilder.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * @@ -9,8 +11,8 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml * builds a dc metadata form - * @deprecated */ + class DemoFormBuilder extends FormBuilder { /** diff --git a/plugins/DocumentConverter.inc b/plugins/DocumentConverter.inc index ce782f08..f258441a 100644 --- a/plugins/DocumentConverter.inc +++ b/plugins/DocumentConverter.inc @@ -1,5 +1,6 @@ <?php + /** * @file * Document Converter Class @@ -8,7 +9,6 @@ /** * This class implements document (doc, odt, pdf, etc.) conversion for a generic * multi-format document collection. - * @deprecated */ class DocumentConverter { diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index 002c6b0c..d8fd5e90 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * Exiftool @@ -7,7 +9,6 @@ /** * This Class implements the methods defined in the STANDARD_IMAGE content model - * @deprecated */ class Exiftool { diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index ea70642b..4f3d9a74 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * FedoraObjectDetailedContent class @@ -9,7 +11,6 @@ * Fedora Object. This class is a plugin called from content models to display a detailed list of * content of the Fedora Item. This is hard coded into Islandora core, and it can also be called * from the IslandoraCM stream. - * @deprecated */ class FedoraObjectDetailedContent { diff --git a/plugins/Ffmpeg.inc b/plugins/Ffmpeg.inc index 7c2159ed..46b4ae80 100644 --- a/plugins/Ffmpeg.inc +++ b/plugins/Ffmpeg.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * Ffmpeg wrapper class @@ -9,7 +11,6 @@ * FFMpeg wrapper class for generating movie thumbnails * * This Class implements the methods defined in the STANDARD_QT content model - * @deprecated */ class Ffmpeg { diff --git a/plugins/Flv.inc b/plugins/Flv.inc index 76506ce3..b5f159b2 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * Form Builder class @@ -7,7 +9,6 @@ /** * implements method from content model ingest form xml - * @deprecated */ class FormBuilder { diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index 5e022b88..8c2b5777 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * FLVFormBuilder @@ -9,8 +11,8 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * implements methods from content model ingest form xml * builds a dc metadata form - * @deprecated */ + class FlvFormBuilder extends FormBuilder { /** diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 02ca6ace..cd9dc4a9 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * FormBuilder class @@ -8,7 +10,6 @@ /** * implements methods from content model ingest form xml * builds a dc metadata form - * @deprecated */ class FormBuilder { diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index bbbe84fd..4faabdd8 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * Image Manipulation class @@ -7,7 +9,6 @@ /** * This Class implements the methods defined in the STANDARD_IMAGE content model - * @deprecated */ class ImageManipulation { diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index c7eefdb6..aa0f6f92 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * ModsFormBuilder class @@ -7,8 +9,7 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** - * ModsFormBuilder class - * @deprecated + * ModsFormBuilder class ??? */ class ModsFormBuilder extends FormBuilder { diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index b81d75df..29c76cfa 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * PersonalCollectionClass class @@ -7,7 +9,6 @@ /** * Personal Collection Class - * @deprecated */ class PersonalCollectionClass { diff --git a/plugins/QtFormBuilder.php b/plugins/QtFormBuilder.php index 95b7699c..28645d6b 100644 --- a/plugins/QtFormBuilder.php +++ b/plugins/QtFormBuilder.php @@ -1,5 +1,7 @@ <?php +// $Id$ + /** * @file * QTFormBuilder class @@ -9,7 +11,6 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /** * Implements methods from content model ingest form xml * builds a dc metadata form - * @deprecated */ class QtFormBuilder extends FormBuilder { diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index e539520c..5e39b3c2 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -10,8 +10,7 @@ module_load_include('inc', 'fedora_repository', 'SecurityClass'); /** - * Refworks class - * @deprecated + * Refworks class ??? */ class Refworks { diff --git a/plugins/ShowDemoStreamsInFieldSets.inc b/plugins/ShowDemoStreamsInFieldSets.inc index 05c2dbd8..80f8017c 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -8,8 +8,7 @@ */ /** - * Show Demo Streams in Field Sets - * @deprecated + * Show Demo Streams in Field Sets ??? */ class ShowDemoStreamsInFieldSets { diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index 3fc116d2..a6e7eaad 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -8,8 +8,7 @@ */ /** - * Show Streams In Field Sets - * @deprecated + * Show Streams In Field Sets ?? */ class ShowStreamsInFieldSets { diff --git a/api/fedora_imageapi.info b/plugins/fedora_imageapi.info similarity index 100% rename from api/fedora_imageapi.info rename to plugins/fedora_imageapi.info diff --git a/api/fedora_imageapi.module b/plugins/fedora_imageapi.module similarity index 98% rename from api/fedora_imageapi.module rename to plugins/fedora_imageapi.module index 99c2cfd2..f3bd4481 100644 --- a/api/fedora_imageapi.module +++ b/plugins/fedora_imageapi.module @@ -1,9 +1,7 @@ <?php -/** - * fedora imageapi menu - * @return string - */ + + function fedora_imageapi_menu() { $items = array(); $items['fedora/imageapi'] = array( diff --git a/plugins/herbarium.inc b/plugins/herbarium.inc index fa2ac4a7..f7a6d685 100644 --- a/plugins/herbarium.inc +++ b/plugins/herbarium.inc @@ -1,20 +1,20 @@ <?php +/** + * @file + * + */ + /** * @file * Herbarium class */ /** - * Herbarium Class - * @deprecated + * Herbarium ??? */ class Herbarium { - /** - * Constructor - * @param type $pid - */ function __construct($pid = '') { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); if (!empty($pid)) { diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index 7b9cdf1d..f3bfca80 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -1,13 +1,14 @@ <?php + + /** * @file * ShowMapStreamsInFieldSets class */ /** - * Show Map Streams in Field Sets Class - * @deprecated + * Show Map Streams in Field Sets Class ?? */ class ShowMapStreamsInFieldSets { diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index 46984cf2..e52e4363 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * ShowQTStreamsInFieldSets class @@ -7,7 +9,6 @@ /** * Show QT Stream in Field Sets - * @deprecated */ class ShowQtStreamsInFieldSets { diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index b7c3cf41..45ff3f9d 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -1,13 +1,14 @@ <?php + + /** * @file * ShowSlideStreamsInFieldSets class */ /** - * ShowSlideStreamInFieldSets - * @deprecated + * ShowSlideStreamInFieldSets ?????? */ class ShowSlideStreamsInFieldSets { diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index d3931957..390bf36c 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -1,5 +1,7 @@ <?php + + /** * @file * Tagging Form??? @@ -9,7 +11,6 @@ * Show subject tags ??? * @param type $pid * @return string - * @deprecated */ function _show_subject_tags($pid) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); @@ -33,7 +34,6 @@ function _show_subject_tags($pid) { * @param type $form_state * @param type $pid * @return type - * @deprecated */ function fedora_repository_image_tagging_form($form_state, $pid) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); @@ -105,7 +105,6 @@ function fedora_repository_image_tagging_form($form_state, $pid) { * Hook image button process ??? * @param type $form * @return string - * @deprecated */ function hook_imagebutton_process($form) { $form['op_x'] = array( @@ -122,7 +121,6 @@ function hook_imagebutton_process($form) { * @global type $user * @param type $form * @param type $form_state - * @deprecated */ function fedora_repository_image_tagging_form_submit($form, &$form_state) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); From b79b82ab89097187dbc9b24bec4137e69dce9c9f Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 19 Oct 2011 10:08:02 -0300 Subject: [PATCH 120/247] Revert "Moved fixed a more appropriate place" This reverts commit ce0078d0eab8a0a4346e2086069093351d37a604. --- core/BatchIngest.inc => BatchIngest.inc | 0 core/CollectionClass.inc => CollectionClass.inc | 0 core/CollectionManagement.inc => CollectionManagement.inc | 0 core/CollectionPolicy.inc => CollectionPolicy.inc | 0 core/ConnectionHelper.inc => ConnectionHelper.inc | 0 core/ContentModel.inc => ContentModel.inc | 0 core/MimeClass.inc => MimeClass.inc | 0 core/ObjectHelper.inc => ObjectHelper.inc | 0 core/SearchClass.inc => SearchClass.inc | 0 core/SecurityClass.inc => SecurityClass.inc | 0 core/XMLDatastream.inc => XMLDatastream.inc | 0 ...itory.solutionpacks.inc => fedora_repository.solutionpacks.inc | 0 core/formClass.inc => formClass.inc | 0 xsd/islandoracm.xsd => islandoracm.xsd | 0 xsl/searchTerms.xml => searchTerms.xml | 0 xsl/solrSearchTerms.xml => solrSearchTerms.xml | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename core/BatchIngest.inc => BatchIngest.inc (100%) rename core/CollectionClass.inc => CollectionClass.inc (100%) rename core/CollectionManagement.inc => CollectionManagement.inc (100%) rename core/CollectionPolicy.inc => CollectionPolicy.inc (100%) rename core/ConnectionHelper.inc => ConnectionHelper.inc (100%) rename core/ContentModel.inc => ContentModel.inc (100%) rename core/MimeClass.inc => MimeClass.inc (100%) rename core/ObjectHelper.inc => ObjectHelper.inc (100%) rename core/SearchClass.inc => SearchClass.inc (100%) rename core/SecurityClass.inc => SecurityClass.inc (100%) rename core/XMLDatastream.inc => XMLDatastream.inc (100%) rename core/fedora_repository.solutionpacks.inc => fedora_repository.solutionpacks.inc (100%) rename core/formClass.inc => formClass.inc (100%) rename xsd/islandoracm.xsd => islandoracm.xsd (100%) rename xsl/searchTerms.xml => searchTerms.xml (100%) rename xsl/solrSearchTerms.xml => solrSearchTerms.xml (100%) diff --git a/core/BatchIngest.inc b/BatchIngest.inc similarity index 100% rename from core/BatchIngest.inc rename to BatchIngest.inc diff --git a/core/CollectionClass.inc b/CollectionClass.inc similarity index 100% rename from core/CollectionClass.inc rename to CollectionClass.inc diff --git a/core/CollectionManagement.inc b/CollectionManagement.inc similarity index 100% rename from core/CollectionManagement.inc rename to CollectionManagement.inc diff --git a/core/CollectionPolicy.inc b/CollectionPolicy.inc similarity index 100% rename from core/CollectionPolicy.inc rename to CollectionPolicy.inc diff --git a/core/ConnectionHelper.inc b/ConnectionHelper.inc similarity index 100% rename from core/ConnectionHelper.inc rename to ConnectionHelper.inc diff --git a/core/ContentModel.inc b/ContentModel.inc similarity index 100% rename from core/ContentModel.inc rename to ContentModel.inc diff --git a/core/MimeClass.inc b/MimeClass.inc similarity index 100% rename from core/MimeClass.inc rename to MimeClass.inc diff --git a/core/ObjectHelper.inc b/ObjectHelper.inc similarity index 100% rename from core/ObjectHelper.inc rename to ObjectHelper.inc diff --git a/core/SearchClass.inc b/SearchClass.inc similarity index 100% rename from core/SearchClass.inc rename to SearchClass.inc diff --git a/core/SecurityClass.inc b/SecurityClass.inc similarity index 100% rename from core/SecurityClass.inc rename to SecurityClass.inc diff --git a/core/XMLDatastream.inc b/XMLDatastream.inc similarity index 100% rename from core/XMLDatastream.inc rename to XMLDatastream.inc diff --git a/core/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc similarity index 100% rename from core/fedora_repository.solutionpacks.inc rename to fedora_repository.solutionpacks.inc diff --git a/core/formClass.inc b/formClass.inc similarity index 100% rename from core/formClass.inc rename to formClass.inc diff --git a/xsd/islandoracm.xsd b/islandoracm.xsd similarity index 100% rename from xsd/islandoracm.xsd rename to islandoracm.xsd diff --git a/xsl/searchTerms.xml b/searchTerms.xml similarity index 100% rename from xsl/searchTerms.xml rename to searchTerms.xml diff --git a/xsl/solrSearchTerms.xml b/solrSearchTerms.xml similarity index 100% rename from xsl/solrSearchTerms.xml rename to solrSearchTerms.xml From 5dbe901b7484dbbc09b1d0e7ebe8ffdc2b300aca Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Fri, 21 Oct 2011 12:25:12 -0300 Subject: [PATCH 121/247] Changed default file nameing --- BatchIngest.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BatchIngest.inc b/BatchIngest.inc index c78be313..77ab6bf7 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -125,7 +125,10 @@ function batch_creation_form_submit($form, &$form_state) { $base = preg_replace("/$ext$/", '', $file_name); $ext = substr($ext, 1); if ($ext) { - $file_list[$base][$ext] = "$directory/" . $file_name; + if ($directory[strlen($directory)-1] != '/'){ + $directory .= '/'; + } + $file_list[$base][$ext] = "$directory" . $file_name; } } } @@ -190,7 +193,6 @@ function create_batch_objects($label, $content_model, $object_files, $collection } unset($object_files['xml']); - $use_primary = TRUE; foreach ($object_files as $ext => $filename) { $file_mimetype = $mime_helper->get_mimetype($filename); if (in_array($file_mimetype, $allowed_mime_types)) { @@ -200,9 +202,7 @@ function create_batch_objects($label, $content_model, $object_files, $collection $item->purge("$pid $label not ingested. $file_mimetype not permitted in objects associated with $content_model"); continue; } - $ds_label = $use_primary ? $cm->getDatastreamNameDSID() : $ext; - $item->add_datastream_from_file($filename, $ds_label); - $use_primary = FALSE; + $item->add_datastream_from_file($filename, "Source_File"); if (!empty($_SESSION['fedora_ingest_files'])) { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $datastream_file) { From 077223c985c1034f17c3179e1a74087d45d94df4 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Tue, 25 Oct 2011 09:44:02 -0300 Subject: [PATCH 122/247] Moved Collection Manager to external module --- BatchIngest.inc | 264 -------------------------- CollectionClass.inc | 13 +- CollectionManagement.inc | 401 --------------------------------------- ObjectHelper.inc | 3 - fedora_repository.module | 11 +- xsl/convertQDC.xsl | 2 +- 6 files changed, 9 insertions(+), 685 deletions(-) delete mode 100644 BatchIngest.inc delete mode 100644 CollectionManagement.inc diff --git a/BatchIngest.inc b/BatchIngest.inc deleted file mode 100644 index 77ab6bf7..00000000 --- a/BatchIngest.inc +++ /dev/null @@ -1,264 +0,0 @@ -<?php - -/** - * batch creation form submit - * @global type $user - * @param array $form - * @param array $form_state - * @param array $content_models - */ -function batch_creation_form(&$form_state, $collection_pid, $content_models) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - $cm_options = array(); - $name_mappings = array(); - foreach ($content_models as $content_model) { - if ($content_model->pid != "islandora:collectionCModel") { - $cm_options[$content_model->pid] = $content_model->name; - $name_mappings[] = $content_model->pid . '^' . $content_model->pid_namespace; - } - } - $mappings = implode('~~~', $name_mappings); - $form['#attributes']['enctype'] = 'multipart/form-data'; - - $form['titlebox'] = array( - '#type' => 'item', - '#value' => t("Batch ingest into $collection_pid"), - ); - - $form['collection_pid'] = array( - '#type' => 'hidden', - '#value' => $collection_pid, - ); - $form['namespace_mappings'] = array( - '#type' => 'hidden', - '#value' => $mappings, - ); - $form['content_model'] = array( - '#title' => "Choose content model to be associated with objects ingested", - '#type' => 'select', - '#options' => $cm_options, - '#required' => TRUE, - '#description' => t("Content models describe the behaviours of objects with which they are associated."), - ); - $form['indicator']['file-location'] = array( - '#type' => 'file', - '#title' => t('Upload zipped folder'), - '#size' => 48, - '#description' => t('The zipped folder should contain all files necessary to build objects.<br .> - Related files must have the same filename, but with differing extensions to indicate mimetypes.<br /> - ie. <em>myFile.xml</em> and <em>myFile.jpg</em>'), - ); - - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Create Objects ') - ); - - - return($form); -} - -/** - * @param array $form - * @param array $form_state - */ -function batch_creation_form_validate($form, &$form_state) { - - $field_name = 'file-location'; - if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name'][$field_name])) { - $file = file_save_upload($field_name); - if ($file->filemime != 'application/zip') { - form_set_error($field_name, 'Input file must be a .zip file'); - return; - } - if (!$file) { - form_set_error($field_name, 'Error uploading file.'); - return; - } - $form_state['values']['file'] = $file; - } - else { - // set error - form_set_error($field_name, 'Error uploading file.'); - return; - } -} - -function batch_creation_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - global $user; - $namespace_mappings = array(); - $content_model = $form_state['values']['content_model']; - $metadata = $form_state['values']['metadata_type']; - $collection_pid = $form_state['values']['collection_pid']; - $namespace_process = explode('~~~', $form_state['values']['namespace_mappings']); - foreach ($namespace_process as $line) { - $line_parts = explode('^', $line); - $namespace_mappings[$line_parts[0]] = $line_parts[1]; - } - $namespace = $namespace_mappings[$content_model]; - $namespace = preg_replace('/:.*/', '', $namespace); - $dir_name = "temp" . $user->uid; - $tmp_dir = file_directory_path() . '/' . $dir_name . '/'; - mkdir($tmp_dir); - $file = $form_state['values']['file']; - $fileName = $file->filepath; - $file_list = array(); - $cmdString = "unzip -q -o -d $tmp_dir \"$fileName\""; - system($cmdString, $retVal); - $dirs = array(); - $do_not_add = array('.', '..', '__MACOSX'); - array_push($dirs, $tmp_dir); - $files = scandir($tmp_dir); - foreach ($files as $file) { - if (is_dir("$tmp_dir/$file") & !in_array($file, $do_not_add)) { - array_push($dirs, $tmp_dir . $file); - } - } - foreach ($dirs as $directory) { - if ($inputs = opendir($directory)) { - while (FALSE !== ($file_name = readdir($inputs))) { - if (!in_array($file_name, $do_not_add) && is_dir($file_name) == FALSE) { - $ext = strrchr($file_name, '.'); - $base = preg_replace("/$ext$/", '', $file_name); - $ext = substr($ext, 1); - if ($ext) { - if ($directory[strlen($directory)-1] != '/'){ - $directory .= '/'; - } - $file_list[$base][$ext] = "$directory" . $file_name; - } - } - } - closedir($inputs); - } - } - - if (($cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM')) === FALSE) { - drupal_set_message("$content_model not found", "error"); - return; - } - - $batch = array( - 'title' => 'Ingesting Objects', - 'operations' => array(), - 'file' => drupal_get_path('module', 'fedora_repository') . '/BatchIngest.inc', - ); - - - foreach ($file_list as $label => $object_files) { - $batch['operations'][] = array('create_batch_objects', array($label, $content_model, $object_files, $collection_pid, $namespace, $metadata)); - } - $batch['operations'][] = array('recursive_directory_delete', array($tmp_dir)); - batch_set($batch); - batch_process(); -} - -/** - * - * @param <string> $label - * @param <string> $content_model - * @param <array> $object_files - * @param <string> $collection_pid - * @param <string> $namespace - * @param <string> $metadata - */ -function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) { - module_load_include('inc', 'fedora_repository', 'ContentModel'); - module_load_include('inc', 'fedora_repository', 'MimeClass'); - module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); - - $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); - $allowed_mime_types = $cm->getMimetypes(); - $mime_helper = new MimeClass(); - $pid = fedora_item::get_next_PID_in_namespace($namespace); - - $item = Fedora_item::ingest_new_item($pid, 'A', $label, $owner); - $item->add_relationship('hasModel', $content_model, FEDORA_MODEL_URI); - $item->add_relationship('isMemberOfCollection', $collection_pid); - if ($object_files['xml']) { - $data = file_get_contents($object_files['xml']); - $xml = simplexml_load_string($data); - $identifier = $xml->getName(); - if ($identifier == 'dc') { - $item->modify_datastream_by_value($data, 'DC', "Dublin Core", 'text/xml'); - } - if ($identifier == 'mods') { - $item->add_datastream_from_string($mods_xml, 'MODS'); - $dc_xml = batch_create_dc_from_mods($mods_xml); - $item->modify_datastream_by_value($dc_xml, 'DC', "Dublin Core", 'text/xml'); - } - } - - unset($object_files['xml']); - foreach ($object_files as $ext => $filename) { - $file_mimetype = $mime_helper->get_mimetype($filename); - if (in_array($file_mimetype, $allowed_mime_types)) { - $added = $cm->execIngestRules($filename, $file_mimetype); - } - else { - $item->purge("$pid $label not ingested. $file_mimetype not permitted in objects associated with $content_model"); - continue; - } - $item->add_datastream_from_file($filename, "Source_File"); - - if (!empty($_SESSION['fedora_ingest_files'])) { - foreach ($_SESSION['fedora_ingest_files'] as $dsid => $datastream_file) { - $item->add_datastream_from_file($datastream_file, $dsid); - } - } - } -} - -/** - * transforms mods to dc - * @param <string> $mods_xml - * @return <string> - */ -function batch_create_dc_from_mods($mods_xml) { - $path = drupal_get_path('module', 'fedora_repository'); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'fedora_repository', 'CollectionClass'); - - if ($xmlstr == NULL || strlen($xmlstr) < 5) { - return " "; - } - - try { - $proc = new XsltProcessor(); - } catch (Exception $e) { - drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); - return " "; - } - - $xsl = new DomDocument(); - $xsl->load($path . '/xsl/mods_to_dc.xsl'); - $input = new DomDocument(); - $input->loadXML(trim($xmlstr)); - $xsl = $proc->importStylesheet($xsl); - $newdom = $proc->transformToDoc($input); - $dc_xml = $newdom->saveXML(); - - return $dc_xml; -} - -/** - * - * @param <string> $dir - * @return <boolean> - */ -function recursive_directory_delete($dir) { - if (!file_exists($dir)) - return TRUE; - if (!is_dir($dir)) - return unlink($dir); - foreach (scandir($dir) as $item) { - if ($item == '.' || $item == '..') - continue; - if (!recursive_directory_delete($dir . DIRECTORY_SEPARATOR . $item)) - return FALSE; - } - return rmdir($dir); -} \ No newline at end of file diff --git a/CollectionClass.inc b/CollectionClass.inc index 82e4739e..2af37522 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -517,7 +517,7 @@ class CollectionClass { $show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_ingest_form'); $add_to_collection = $this->getIngestInterface(); - $show_batch_tab = TRUE; + $show_batch_tab = FALSE; $policy = CollectionPolicy::loadFromCollection($this->pid, TRUE); $content_models = $policy->getContentModels(); if (count($content_models) == 1 && $content_models[0]->pid == "islandora:collectionCModel") { @@ -547,16 +547,7 @@ class CollectionClass { // This will be the content of the tab. '#content' => $add_to_collection, ); - if (user_access('manage collections')) { - $tabset['add_collection_tab'] = array( - // #type and #title are the minimum requirements. - '#type' => 'tabpage', - '#title' => t('Manage This Collection'), - // This will be the content of the tab. - '#content' => drupal_get_form('collection_management_form', $this->pid, $content_models), - '#selected' => FALSE, - ); - } + if ($show_batch_tab && user_access('create batch process')) { $tabset['batch_ingest_tab'] = array( // #type and #title are the minimum requirements. diff --git a/CollectionManagement.inc b/CollectionManagement.inc deleted file mode 100644 index 39d33456..00000000 --- a/CollectionManagement.inc +++ /dev/null @@ -1,401 +0,0 @@ -<?php - -/** - * collection creation form - * @param array $form_state - * @param string $parent_collection_pid - * @param string $content_models - * @return array - */ -function collection_management_form(&$form_state, $this_collection_pid, $content_models) { - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $restricted = FALSE; - if (variable_get('fedora_namespace_restriction_enforced', TRUE)) { - $restricted = TRUE; - $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); - $namespaces = explode(':', $allowed_string); - foreach ($namespaces as $namespace) { - if ($namespace) { - $allowed[trim($namespace)] = trim($namespace); - } - } - } - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - $item = new Fedora_Item($this_collection_pid); - $collection_name = $item->objectProfile->objLabel; - $new_content_models = get_content_models_as_option_array(); - $cm_options = array(); - $name_mappings = array(); - foreach ($content_models as $content_model) { - if ($content_model->pid != "islandora:collectionCModel") { - $item = new fedora_item($content_model->pid); - $cm_name = $item->objectProfile->objLabel; - $cm_options[$content_model->pid] = $cm_name; - } - } - if (!empty($cm_options)) { - $show_delete = TRUE; - } - - - $content_models = get_content_models_as_option_array(); - $form['child_creation'] = array( - '#title' => "Create Child Collection", - '#type' => 'fieldset', - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - - $form['child_creation']['titlebox'] = array( - '#type' => 'item', - '#value' => t("Create New Child Collection within $this_collection_pid"), - ); - - $form['child_creation']['collection_name'] = array( - '#title' => "Collection Name", - '#type' => 'textfield', - '#description' => t("Human readable name for this collection"), - ); - - $form['child_creation']['new_collection_pid'] = array( - '#title' => "Collection PID", - '#type' => 'textfield', - '#size' => 15, - '#description' => t("Unique PID for this collection. <br />Pids take the general form of namespace:collection eg islandora:pamphlets"), - ); - if (!$restricted) { - $form['child_creation']['collection_namespace'] = array( - '#title' => "Collection Namespace", - '#type' => 'textfield', - '#size' => 15, - '#default_value' => 'default', - '#description' => t("Namespace for objects in this collection."), - ); - } - else { - $form['child_creation']['collection_namespace'] = array( - '#title' => "Collection Namespace", - '#type' => 'select', - '#options' => $allowed, - '#default_value' => 'default', - '#description' => t("Namespace for objects in this collection."), - ); - } - $form['parent_collection'] = array( - '#type' => 'hidden', - '#value' => $this_collection_pid, - ); - - $form['collection_pid'] = array( - '#type' => 'hidden', - '#value' => $this_collection_pid, - ); - $form['child_creation']['content_models'] = array( - '#title' => "Choose allowable content models for this collection", - '#type' => 'checkboxes', - '#options' => $content_models, - '#description' => t("Content models describe the behaviours of objects with which they are associated."), - ); - - - $form['child_creation']['submit'] = array( - '#type' => 'submit', - '#value' => t('Create Collection'), - '#id' => 'create_class' - ); - $form['manage_collection_policy'] = array( - '#title' => "Manage Collection Policies", - '#type' => 'fieldset', - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - - $form['manage_collection_policy']['add'] = array( - '#title' => "Add Content Model", - '#type' => 'fieldset', - '#collapsible' => TRUE, - '#collapsed' => $show_delete, - ); - - - $form ['manage_collection_policy']['add']['content_model_to_add'] = array( - '#title' => "Choose Content Model", - '#type' => 'select', - '#options' => array_diff_key($content_models, $cm_options), - '#description' => t("Choose content model to add to this collection policy."), - ); - - $form ['manage_collection_policy']['add']['new_cp_namespace'] = array( - '#title' => "Choose Namespace", - '#type' => 'textfield', - '#size' => 15, - '#description' => t("Choose namespace for objects in this collection associated with this content model"), - ); - $form['manage_collection_policy']['add']['submit'] = array( - '#type' => 'submit', - '#value' => t('Add Content Model to Collection Policy'), - '#id' => 'add_cm' - ); - - if ($show_delete) { - $form['manage_collection_policy']['remove'] = array( - '#title' => "Delete Content Model", - '#type' => 'fieldset', - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - - $form ['manage_collection_policy']['remove']['content_models_to_remove'] = array( - '#title' => "Choose Content Model to Remove", - '#type' => 'checkboxes', - '#options' => $cm_options, - '#description' => t("Choose content models to remove from this collection policy."), - ); - - - $form['manage_collection_policy']['remove']['submit'] = array( - '#type' => 'submit', - '#value' => t('Remove Content Collection Policy'), - '#id' => 'remove_cm' - ); - } - $form['change_cmodel'] = array( - '#title' => "Change Content Models", - '#type' => 'fieldset', - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - $form['change_cmodel']['titlebox'] = array( - '#type' => 'item', - '#value' => t("Change Content Models within $this_collection_pid"), - ); - - $form['change_cmodel']['current_content_model'] = array( - '#title' => "Choose content model to be changed", - '#type' => 'select', - '#options' => $cm_options, - '#description' => t("All objects in this collection with the selected content model will be changed."), - ); - $form['change_cmodel']['new_content_model'] = array( - '#title' => "Choose new content model", - '#type' => 'select', - '#options' => $new_content_models, - '#description' => t("The new content model to be assigned to selected objects."), - ); - $form['change_cmodel']['collection_pid'] = array( - '#type' => 'hidden', - '#value' => $this_collection_pid, - ); - $form['change_cmodel']['submit'] = array( - '#type' => 'submit', - '#value' => t('Change Content Model Associations'), - '#id' => 'change_model', - ); - if (user_access('delete entire collections')) { - $form['delete_collection'] = array( - '#title' => "Permanently Delete $collection_name", - '#type' => 'fieldset', - '#description' => t("Clicking this button will delete all objects within $collection_name. <br /> <strong>This action cannot be undone.</strong>"), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - $form['delete_collection']['confirm'] = array( - '#title' => "Are you sure?", - '#type' => 'fieldset', - '#description' => t('<strong>Clicking the delete button will permanantly remove all objects from this collection. <br /> <strong>This action cannot be undone.</strong> '), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - - $form['delete_collection']['confirm']['submit'] = array( - '#type' => 'submit', - '#value' => t('Delete this collection'), - '#id' => 'delete_collection', - ); - } - return($form); -} - -/** - * collection creation form validate - * @param array $form - * @param array $form_state - */ -function collection_management_form_validate($form, &$form_state) { - if ($form_state['clicked_button']['#id'] == 'create_class') { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $pid = $form_state['values']['new_collection_pid']; - $item = new fedora_item($pid); - if ($item->exists()) { - form_set_error('new_collection_pid', t("$pid already exists within your repository. the PID must be unique")); - return; - } - if (!valid_pid($pid)) { - form_set_error('new_collection_pid', t("$pid is not a valid identifier")); - return; - } - } - if ($form_state['clicked_button']['#id'] == 'add_cm') { - if (!valid_pid($form_state['values']['new_cp_namespace'])) { - form_set_error('new_cp_namespace', t("Namespace must be a valid PID")); - return; - } - } -} - -/** - * collection creation form submit - * @global type $user - * @param type $form - * @param type $form_state - */ -function collection_management_form_submit($form, &$form_state) { - module_load_include('inc', 'fedora_repository', 'api/fedora_collection'); - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/dublin_core'); - global $user; - $collection_pid = $form_state['values']['parent_collection']; - $policy = CollectionPolicy::loadFromCollection($collection_pid, TRUE); - if ($form_state['clicked_button']['#id'] == 'create_class') { - $module_path = drupal_get_path('module', 'fedora_repository'); - $thumbnail = drupal_get_path('module', 'Fedora_Repository') . '/images/Crystal_Clear_filesystem_folder_grey.png'; - $new_collection_pid = $form_state['values']['new_collection_pid']; - $new_collection_label = $form_state['values']['collection_name']; - $pid_namespace = $form_state['values']['collection_namespace']; - $all_cModels = get_content_models_as_option_array(); - $collection_policy = '<?xml version="1.0" encoding="UTF-8"?> -<collection_policy xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="" xsi:schemaLocation="http://www.islandora.ca http://syn.lib.umanitoba.ca/collection_policy.xsd"> - <content_models> - </content_models> - <search_terms> - </search_terms> - <staging_area></staging_area> - <relationship>isMemberOfCollection</relationship> -</collection_policy>'; - $content_models = $form_state['values']['content_models']; - $collection_policy_xml = simplexml_load_string($collection_policy); - foreach ($content_models as $content_model) { - if ($content_model) { - $node = $collection_policy_xml->content_models->addChild('content_model'); - $node->addAttribute('dsid', 'ISLANDORACM'); - $node->addAttribute('name', $all_cModels[$content_model]); - $node->addAttribute('namespace', $pid_namespace . ':1'); - $node->addAttribute('pid', $content_model); - } - } - $item = fedora_item::ingest_new_item($new_collection_pid, 'A', $new_collection_label, $user->name); - $item->add_relationship('isMemberOfCollection', $collection_pid, RELS_EXT_URI); - $item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI); - $item->add_datastream_from_string($collection_policy_xml->saveXML(), 'COLLECTION_POLICY'); - $item->add_datastream_from_file($thumbnail, 'TN'); - drupal_goto("/fedora/repository/$new_collection_pid"); - } - - if ($form_state['clicked_button']['#id'] == 'add_cm') { - - $cp_namespace = $form_state['values']['new_cp_namespace']; - $cp_content_model = $form_state['values']['content_model_to_add']; - $policy->addModel(ContentModel::loadFromModel($cp_content_model), $cp_namespace); - $policy->saveToFedora(); - drupal_set_message("Collection model successfully added"); - } - - if ($form_state['clicked_button']['#id'] == 'remove_cm') { - $candidates = $form_state['values']['content_models_to_remove']; - $count = 0; - foreach ($candidates as $candidate) { - if (is_string($candidate)) { - $policy->removeModel(ContentModel::loadFromModel($candidate)); - $count++; - } - } - if ($count > 0) { - $policy->saveToFedora(); - if ($count > 1) { - $s = 's'; - } - drupal_set_message("$count collection model$s removed"); - } - } - - if ($form_state['clicked_button']['#id'] == 'change_model') { - $current_content_model = $form_state['values']['current_content_model']; - $new_content_model = $form_state['values']['new_content_model']; - - $add_to_policy = TRUE; - $policy_cms = $policy->getContentModels(); - foreach ($policy_cms as $policy_cm) { - if ($policy_cm->pid == $current_content_model) { - $namespace = $policy_cm->pid_namespace; - } - if ($policy_cm->pid == $new_content_model) { - $add_to_policy = FALSE; - } - } - if ($add_to_policy) { - $policy->addModel(ContentModel::loadFromModel($new_content_model), $namespace); - $policy->saveToFedora(); - } - $query = "select \$object from <#ri> - where (\$object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/$current_content_model> - and \$object <info:fedora/fedora-system:def/relations-external#isMemberOfCollection> <info:fedora/$collection_pid> - and \$object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)"; - $query = htmlentities(urlencode($query)); - $content = ''; - - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=csv&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query; - $content .= do_curl($url); - $results = explode("\n", $content); - $object_pids = preg_replace('/^info:fedora\/|"object"/', '', $results); - $count = 0; - foreach ($object_pids as $object_pid) { - if (!$object_pid) { - continue; - } - $item = new fedora_item($object_pid); - $item->purge_relationship('hasModel', $current_content_model); - $item->add_relationship('hasModel', $new_content_model, FEDORA_MODEL_URI); - $count++; - } - drupal_set_message("$current_content_model changed to $new_content_model on $count objects"); - } - - if ($form_state['clicked_button']['#id'] == 'delete_collection') { - $collection_name = $form_state['values']['collection_name']; - $pids = get_related_items_as_array($collection_pid, 'isMemberOfCollection'); - - $batch = array( - 'title' => "Deleting Objects from $name", - 'operations' => array(), - 'file' => drupal_get_path('module', 'fedora_repository') . '/CollectionManagement.inc', - ); - - - foreach ($pids as $pid) { - - $batch['operations'][] = array('delete_objects_as_batch', array($pid)); - } - - batch_set($batch); - batch_process('/fedora/repository'); - } -} - -/** - * deletes PID if pid is not collection - * @param <type> $pid - */ -function delete_objects_as_batch($pid) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $name = $user->name; - $item_to_delete = new Fedora_Item($pid); - $models = $item_to_delete->get_models(); - foreach ($models as $model) { - if ($model['object'] != 'islandora:collectionCModel') { - $item_to_delete->purge("$object purged by $name"); - } - } -} \ No newline at end of file diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 70f73d4b..8321c0ea 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -19,9 +19,6 @@ class ObjectHelper { public static $INGEST_FEDORA_OBJECTS = 'ingest new fedora objects'; public static $EDIT_TAGS_DATASTREAM = 'edit tags datastream'; public static $VIEW_DETAILED_CONTENT_LIST = 'view detailed list of content'; - public static $MANAGE_COLLECTIONS = 'manage collections'; - public static $DELETE_ENTIRE_COLLECTIONS = 'delete entire collections'; - public static $CREATE_BATCH_PROCESS = 'create batch process'; public static $DISPLAY_ALWAYS = 0; public static $DISPLAY_NEVER = 1; public static $DISPLAY_NO_MODEL_OUTPUT = 2; diff --git a/fedora_repository.module b/fedora_repository.module index 56859edb..f0ca2eaf 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -55,8 +55,8 @@ function fedora_repository_purge_object($pid = NULL, $name = NULL) { return ''; } $output = t('Are you sure you wish to purge object %name %pid!<br /><b>This cannot be undone</b><br />', array( - '%name' => $name, - '%pid' => $pid) + '%name' => $name, + '%pid' => $pid) ); $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); @@ -435,7 +435,7 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } if (!(preg_match("/^[a-zA-Z]/", $dsid))) { - form_set_error('', t("Data stream ID (@dsid) has to start with a letter.", array( '@dsid' => check_plain($dsid)))); + form_set_error('', t("Data stream ID (@dsid) has to start with a letter.", array('@dsid' => check_plain($dsid)))); return FALSE; } if (strlen($dsLabel) > 64) { @@ -482,7 +482,7 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) } $output = t('Are you sure you wish to purge this datastream %name<br />', array( - '%name' => $name) + '%name' => $name) ); $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); return $output; @@ -995,8 +995,9 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU } } } - $cmodels_tabs = array_merge($cmodels_tabs, $object_details); + $hook_tabs = module_invoke_all('islandora_tabs', $content_models, $pid); + $cmodels_tabs = array_merge($cmodels_tabs, $object_details, $hook_tabs); return tabs_render($cmodels_tabs); } diff --git a/xsl/convertQDC.xsl b/xsl/convertQDC.xsl index e7e0d627..c2bb50f0 100644 --- a/xsl/convertQDC.xsl +++ b/xsl/convertQDC.xsl @@ -21,7 +21,7 @@ <xsl:value-of select="substring-after(name(),':')"/> = <xsl:value-of select="text()"/> </div> </xsl:for-each> - </td><td><a href="{$baseUrl}/search/fedora_repository/dc.{$FIELD}:{$DATA}"><img title="Find Similar by {$FIELD}" src="{$PATH}/images/view.gif" alt="Find Similar by {$FIELD}" /></a></td></tr> + </td></tr> </xsl:if> </xsl:for-each> From b4737ed80260ba98098c1a03eb0c1e144ca9c17e Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Fri, 28 Oct 2011 16:26:15 -0300 Subject: [PATCH 123/247] Fixed problem with page redirects on Edit --- ObjectHelper.inc | 1 + api/fedora_utils.inc | 1 + fedora_repository.module | 4 ++-- plugins/FedoraObjectDetailedContent.inc | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 8321c0ea..9567fd70 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -546,6 +546,7 @@ class ObjectHelper { */ function get_content_models_list($pid, $include_fedora_system_content_models = FALSE) { module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); $collectionHelper = new CollectionClass(); $pids = array(); $query = 'select $object from <#ri> diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index c154dbc4..9399356d 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -235,6 +235,7 @@ function fix_dsid($dsid) { */ function get_collections_as_option_array() { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + $restricted = variable_get('fedora_namespace_restriction_enforced', TRUE); $query = 'select $object $title from <#ri> where ($object <dc:title> $title and $object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/islandora:collectionCModel> diff --git a/fedora_repository.module b/fedora_repository.module index f0ca2eaf..27060dda 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -317,7 +317,7 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NUL if (!empty($collectionPid)) { $collectionPid = $_SESSION['fedora_collection']; } -//$form['#redirect'] = $referrer; +//$form['#rebuild'] = $false; return $form; } @@ -989,7 +989,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $obj = new FedoraObjectDetailedContent($pid); $object_details = $obj->showFieldSets(); if ($object_details['fedora_object_details']['#selected'] == TRUE) { - foreach ($cmodels_tabs as $cmodel_tab) { + foreach ($cmodels_tabs as &$cmodel_tab) { if (is_array($cmodel_tab)) { $cmodel_tab['#selected'] = FALSE; } diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 4f3d9a74..0eef0f75 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -39,11 +39,11 @@ class FedoraObjectDetailedContent { $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form'); $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_form'); $purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path())))); - + $details_selected = ($show_purge_tab ||$show_edit_tab); $tabset['fedora_object_details'] = array( '#type' => 'tabpage', '#title' => t('Object Details'), - '#selected' => $show_purge_tab, + '#selected' => $details_selected, ); $tabset['fedora_object_details']['tabset'] = array( '#type' => 'tabset', From d7de3a51bfe150cdbb13e7606b5330f8de98f078 Mon Sep 17 00:00:00 2001 From: ppound <paul.pound@gmail.com> Date: Mon, 31 Oct 2011 15:43:13 -0300 Subject: [PATCH 124/247] partial fix for ISLANDORA-403 --- CollectionClass.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 82e4739e..87ab1d63 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -519,7 +519,9 @@ class CollectionClass { $show_batch_tab = TRUE; $policy = CollectionPolicy::loadFromCollection($this->pid, TRUE); - $content_models = $policy->getContentModels(); + if(!empty($policy)){ + $content_models = $policy->getContentModels(); + } if (count($content_models) == 1 && $content_models[0]->pid == "islandora:collectionCModel") { $show_batch_tab = FALSE; } From b195d45b1e8517d747c04a19284c1c8f8f0b34f0 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Tue, 8 Nov 2011 21:28:00 -0400 Subject: [PATCH 125/247] Cleanup some TRUE that should be true When you do a repository search in Fedora_Item the URL it creates requires that the boolean be true. This got changed to TRUE in the code cleanup. Changed this back. --- api/fedora_item.inc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 54a9158b..a79749a7 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -43,7 +43,7 @@ class Fedora_Item { } $raw_objprofile = $this->soap_call('getObjectProfile', array('pid' => $this->pid, 'asOfDateTime' => "")); - + if (!empty($raw_objprofile)) { $this->objectProfile = $raw_objprofile->objectProfile; $this->datastreams = $this->get_datastreams_list_as_array(); @@ -297,18 +297,17 @@ class Fedora_Item { $i++; $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora'); if ($cursor == 0) { - $url .= "/objects?query=$field~$pattern&pid=TRUE&title=TRUE&resultFormat=xml&maxResults=$max_results"; + $url .= "/objects?query=$field~$pattern&pid=true&title=TRUE&resultFormat=xml&maxResults=$max_results"; } else { - $url .= "/objects?pid=TRUE&title=TRUEsessionToken=$session_token&resultFormat=xml&maxResults=$max_results"; + $url .= "/objects?pid=true&title=true&sessionToken=$session_token&resultFormat=xml&maxResults=$max_results"; } if (count($resultFields) > 0) { - $url .= '&' . join('=TRUE&', $resultFields) . '=TRUE'; + $url .= '&' . join('=true&', $resultFields) . '=true'; } $resultxml = do_curl($url); - libxml_use_internal_errors(TRUE); $resultelements = simplexml_load_string($resultxml); if ($resultelements === FALSE) { From 32efbf8ae4b09a3c43f85c7c03be85db02a7a822 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Thu, 10 Nov 2011 15:47:20 -0400 Subject: [PATCH 126/247] Externalized tabbing --- fedora_repository.module | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 27060dda..600e3bcb 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -142,6 +142,10 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label */ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH + if ($form_state['ahah_submission']) { + $form_state['submitted'] = false; + return; + } if ($form_state['storage']['xml']) { if (module_exists('islandora_content_model_forms')) { module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); @@ -197,7 +201,11 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { */ function fedora_repository_ingest_form_validate($form, &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH - if ($form_state['clicked_button']['#id'] == 'edit-submit') { + if ($form_state['ahah_submission']) { + $form_state['submitted'] = false; + return; + } + if ($form_state['clicked_button']['#id'] == 'edit-submit' && $form_state['ahah_submission'] != 1) { switch ($form_state['storage']['step']) { case 1: $form_state['storage']['step']++; @@ -828,9 +836,6 @@ function fedora_repository_perm() { OBJECTHELPER::$INGEST_FEDORA_OBJECTS, OBJECTHELPER::$EDIT_TAGS_DATASTREAM, OBJECTHELPER::$VIEW_DETAILED_CONTENT_LIST, - OBJECTHELPER::$MANAGE_COLLECTIONS, - OBJECTHELPER::$DELETE_ENTIRE_COLLECTIONS, - OBJECTHELPER::$CREATE_BATCH_PROCESS, ); } From e44be2a48c4ae483ed2a951baaada01f1a0a07ae Mon Sep 17 00:00:00 2001 From: ajstanley <alanjarlathstanley@gmail.com> Date: Mon, 14 Nov 2011 14:37:27 -0400 Subject: [PATCH 127/247] Replaced fedora calls with regex to improve performance. --- api/fedora_utils.inc | 58 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 9399356d..89545191 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -266,41 +266,41 @@ function get_collections_as_option_array() { * @return array */ function get_content_models_as_option_array() { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $restricted = variable_get('fedora_namespace_restriction_enforced', TRUE); - $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); - $namespaces = explode(':', $allowed_string); - foreach ($namespaces as $namespace) { - if ($namespace) { - $allowed[] = trim($namespace); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + $restricted = variable_get('fedora_namespace_restriction_enforced', TRUE); + $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); + $namespaces = explode(':', $allowed_string); + foreach ($namespaces as $namespace) { + if ($namespace) { + $allowed[] = trim($namespace); + } } - } - $query = 'select $object $title from <#ri> + $query = 'select $object $title from <#ri> where ($object <dc:title> $title and ($object <fedora-model:hasModel> <info:fedora/fedora-system:ContentModel-3.0> or $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:ContentModelsCollection>) and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query="; - $content = do_curl($url . htmlentities(urlencode($query))); - $list = explode("\n", $content); - array_shift($list); - $list = preg_replace('/info:fedora\//', '', $list); - foreach ($list as $item) { //removes blanks - if ($item) { - $parts = explode(',', $item); - $item = new fedora_item($parts[0]); - $nameparts = explode(':', $parts[0]); - if (!$restricted || in_array($nameparts[0], $allowed)) - $datastreams = array_keys($item->get_datastreams_list_as_array()); - if (in_array('ISLANDORACM', $datastreams)) { - $options[$parts[0]] = $parts[1] . ' ~ ' . $parts[0]; - } + $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); + $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query="; + $content = do_curl($url . htmlentities(urlencode($query))); + $list = explode("\n", $content); + array_shift($list); + $list = preg_replace('/info:fedora\//', '', $list); + foreach ($list as $item) { //removes blanks + if ($item) { + $parts = explode(',', $item); + $nameparts = explode(':', $parts[0]); + if (!$restricted || in_array($nameparts[0], $allowed)) { + + if (!preg_match('/fedora-system/', $nameparts[0])) { + $options[$parts[0]] = $parts[1] . ' ~ ' . $parts[0]; + } + } + } } - } - return $options; -} + return $options; +} \ No newline at end of file From 4ef6faa2fb5a774bb29ef8cb1dc2e648a73ca626 Mon Sep 17 00:00:00 2001 From: discoverygnoye <gordie@discoverygarden.ca> Date: Tue, 15 Nov 2011 11:41:49 -0400 Subject: [PATCH 128/247] COLORADO-1628 Fix the breadcrumb path calculation to remove blanks The current breadcrumb calculation takes the first <dc:title> tag in the DC datastream. The sorting order of the <dc:title> tags (in the case of more than one tag) has empty tags appearing as the first items to be selected by the query. This fix alters the query to change the sort order to make empty tags the last items to be selected and thus, if a non-empty tag exists it will be selected as the name of the breadcrumb. There is also a problem with the breadcrumb query processing that will attempt to process failed queries. The test for failure was incorrect and allowed some failed queries to be treated as successes. This resulted in recursively calling the breadcrumb processing an additional 10 times and failing each time. This resulted in 10 '>' symbols instead of an error message. This fix tests for falure and puts up an error message in the breadcrumb trail. The breadcrumb calculation should be rewritten to be more robust. --- ObjectHelper.inc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 70f73d4b..d1e73b8c 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -937,18 +937,22 @@ class ObjectHelper { or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject) and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> - order by $title'; + order by $title desc'; $query_string = htmlentities(urlencode($query_string)); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; - + $result = preg_split('/[\r\n]+/', do_curl($url)); array_shift($result); // throw away first line $matches = str_getcsv(join("\n", $result)); - if ($matches !== FALSE) { + if (count($matches) >= 2) { $parent = preg_replace('/^info:fedora\//', '', $matches[0]); + if (0 == strlen($matches[1])) { + $matches[1] = "Unlabeled Object"; + } + $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); @@ -958,6 +962,10 @@ class ObjectHelper { $this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); } } + + else { + $breadcrumbs[] = l("Path Calculation Error", 'fedora/repository/' . $pid); + } } } From 35a7d19f37006eef829c76ce6cea27e40464bd6e Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Wed, 16 Nov 2011 11:14:21 -0400 Subject: [PATCH 129/247] Updated SecurityClass to properly search XACML The SecurityClass module does a naive search of an XACML policy to pull out the users and roles listed. Assuming that they are who can edit the object. With certain policies this was failing, and only returning the users, not the roles. This became a problem with the XACML editor in use because this class was used more often. I updated the XPATH expressions that it uses to find the users and roles, so it should find them in all cases now. We should update the security class to call the more precise XACML class first and only fall back on the security class if XACML fails to parse the file, however this would mean moving the XACML stuff into core. --- SecurityClass.inc | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/SecurityClass.inc b/SecurityClass.inc index 1e2b1835..1f3df0eb 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -34,7 +34,6 @@ class SecurityClass { $objectHelper = new ObjectHelper(); // get the childsecurity policy from the collection. $policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS :: $SECURITY_CLASS_SECURITY_STREAM, FALSE); - if ($policyStream == NULL) { // no child policy stream so collection is wide open to anyone to ingest, that has the permission ingest in Drupal. // maybe we should return FALSE here?? would be more secure. @@ -79,34 +78,20 @@ class SecurityClass { } $xml->registerXPathNamespace('default', 'urn:oasis:names:tc:xacml:1.0:policy'); - $conditions = $xml->xpath("//default:Condition"); - - foreach ($conditions as $condition) { - $designator = $condition->Apply->SubjectAttributeDesignator; - if (empty($designator)) {//$disignator may be wrapped by an or - $designator = $condition->Apply->Apply->SubjectAttributeDesignator; - } - $attributeId = strip_tags($designator['AttributeId']); + $roles = $xml->xpath('//default:SubjectAttributeDesignator[@AttributeId="fedoraRole"]/../default:Apply/default:AttributeValue'); + $users = $xml->xpath('//default:SubjectAttributeDesignator[@AttributeId="urn:fedora:names:fedora:2.1:subject:loginId"]/../default:Apply/default:AttributeValue'); - if ($attributeId == "fedoraRole") { - foreach ($condition->Apply->Apply->AttributeValue as $attributeValue) { - $allowedRoles[] = strip_tags($attributeValue->asXML()); - } - foreach ($condition->Apply->Apply->Apply->AttributeValue as $attributeValue) { - $allowedRoles[] = strip_tags($attributeValue->asXML()); - } - } - if ($attributeId == "urn:fedora:names:fedora:2.1:subject:loginId") { - foreach ($condition->Apply->Apply->AttributeValue as $attributeValue) { - $allowedUsers[] = strip_tags($attributeValue->asXML()); - } - foreach ($condition->Apply->Apply->Apply->AttributeValue as $attributeValue) { - $allowedUsers[] = strip_tags($attributeValue->asXML()); - } - } + foreach($roles as $role) { + $allowedRoles[] = (string)$role; } + foreach($users as $user) { + $allowedUsers[] = (string)$user; + } + $usersAndRoles['users'] = $allowedUsers; $usersAndRoles['roles'] = $allowedRoles; + + dd($usersAndRoles); return $usersAndRoles; } From 4d9c4cd00615b511ba70eb71d882f352d291e454 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Wed, 16 Nov 2011 15:08:50 -0400 Subject: [PATCH 130/247] Forgot to remove a debug statement before I committed. Woops. This fixes it all up. --- SecurityClass.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/SecurityClass.inc b/SecurityClass.inc index 1f3df0eb..67bc9c43 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -91,7 +91,6 @@ class SecurityClass { $usersAndRoles['users'] = $allowedUsers; $usersAndRoles['roles'] = $allowedRoles; - dd($usersAndRoles); return $usersAndRoles; } From 288125ea855d428b98541592f8e1e6717a566ef3 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 17 Nov 2011 14:45:46 -0400 Subject: [PATCH 131/247] Set the version to 11.3.beta1 --- fedora_repository.info | 2 +- plugins/fedora_imageapi.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index 99cb3d6f..45564e20 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -5,5 +5,5 @@ dependencies[] = tabs dependencies[] = islandora_content_model_forms description = Shows a list of items in a fedora collection. package = Islandora -version = 11.2.0 +version = 11.3beta1 core = 6.x diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index af50a614..ea14fb07 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -3,5 +3,5 @@ description = Adds image manipulation support through a REST interface package = Islandora Dependencies dependencies[] = fedora_repository dependencies[] = imageapi -version = 11.2.0 +version = 11.3beta1 core = 6.x From 9ca282d521e9c81af31e0dcced75c96b8f5ea4f0 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Tue, 22 Nov 2011 12:01:49 -0400 Subject: [PATCH 132/247] Added validity check for Collection Policy class --- CollectionClass.inc | 9 +++++---- fedora_repository.module | 13 +++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 2af37522..bee0c495 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -519,14 +519,16 @@ class CollectionClass { $show_batch_tab = FALSE; $policy = CollectionPolicy::loadFromCollection($this->pid, TRUE); - $content_models = $policy->getContentModels(); + if ($policy) { + $content_models = $policy->getContentModels(); + } if (count($content_models) == 1 && $content_models[0]->pid == "islandora:collectionCModel") { $show_batch_tab = FALSE; } if (!$show_ingest_tab) { $view_selected = TRUE; } - if(!$collection_items){ + if (!$collection_items) { $view_selected = FALSE; $add_selected = TRUE; } @@ -538,7 +540,6 @@ class CollectionClass { '#title' => 'View', '#selected' => $view_selected, '#content' => $collection_items, - ); $tabset['add_tab'] = array( '#type' => 'tabpage', @@ -614,7 +615,7 @@ class CollectionClass { $collectionName = $collection; - + if (!$pageNumber) { $pageNumber = 1; } diff --git a/fedora_repository.module b/fedora_repository.module index 27060dda..600e3bcb 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -142,6 +142,10 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label */ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH + if ($form_state['ahah_submission']) { + $form_state['submitted'] = false; + return; + } if ($form_state['storage']['xml']) { if (module_exists('islandora_content_model_forms')) { module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); @@ -197,7 +201,11 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { */ function fedora_repository_ingest_form_validate($form, &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH - if ($form_state['clicked_button']['#id'] == 'edit-submit') { + if ($form_state['ahah_submission']) { + $form_state['submitted'] = false; + return; + } + if ($form_state['clicked_button']['#id'] == 'edit-submit' && $form_state['ahah_submission'] != 1) { switch ($form_state['storage']['step']) { case 1: $form_state['storage']['step']++; @@ -828,9 +836,6 @@ function fedora_repository_perm() { OBJECTHELPER::$INGEST_FEDORA_OBJECTS, OBJECTHELPER::$EDIT_TAGS_DATASTREAM, OBJECTHELPER::$VIEW_DETAILED_CONTENT_LIST, - OBJECTHELPER::$MANAGE_COLLECTIONS, - OBJECTHELPER::$DELETE_ENTIRE_COLLECTIONS, - OBJECTHELPER::$CREATE_BATCH_PROCESS, ); } From 33bc8c922e1527633692b0b223c7a7e4afbd19ab Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Thu, 24 Nov 2011 13:54:44 -0400 Subject: [PATCH 133/247] Added additional functionality to CollectionPolicy::getNextPid --- CollectionPolicy.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index be9e7a92..5a3daf21 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -360,13 +360,14 @@ class CollectionPolicy extends XMLDatastream { * @param string $dsid * @return string $nextPid */ - public function getNextPid($dsid) { + public function getNextPid($dsid, $content_model = null) { $ret = FALSE; + if (self::valid_dsid($dsid) && $this->validate()) { $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); $namespace = FALSE; for ($i = 0; $namespace === FALSE && $i < $content_models->length; $i++) { - if (strtolower($content_models->item($i)->getAttribute('dsid')) == strtolower($dsid)) { + if (strtolower($content_models->item($i)->getAttribute('dsid')) == strtolower($dsid) && (strtolower($content_models->item($i)->getAttribute('pid') == $content_model) || $content_model == null)) { $namespace = $content_models->item($i)->getAttribute('namespace'); } } From 59db4b5097e5994c3f4b7b633bf1983843a6a643 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 29 Nov 2011 09:51:46 -0400 Subject: [PATCH 134/247] New version and removed id tags --- fedora_repository.info | 3 +-- plugins/fedora_imageapi.info | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index 45564e20..944568fe 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -1,9 +1,8 @@ -; $Id$ name = Islandora Repository dependencies[] = imageapi dependencies[] = tabs dependencies[] = islandora_content_model_forms description = Shows a list of items in a fedora collection. package = Islandora -version = 11.3beta1 +version = 11.3beta2 core = 6.x diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index ea14fb07..d17d73a8 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -3,5 +3,5 @@ description = Adds image manipulation support through a REST interface package = Islandora Dependencies dependencies[] = fedora_repository dependencies[] = imageapi -version = 11.3beta1 +version = 11.3beta2 core = 6.x From 0cf63ac59d8bffaf9a50b623a7c5f7800c64d11e Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Tue, 29 Nov 2011 15:17:51 -0400 Subject: [PATCH 135/247] Added delete validation to prevent removal of populated collections --- fedora_repository.module | 35 ++++++++++++++++------ xsl/sparql_to_html.xsl | 65 ++++++++++++++++++++-------------------- 2 files changed, 59 insertions(+), 41 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 600e3bcb..05631b91 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -455,9 +455,9 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } $validators = array( - // 'file_validate_is_image' => array(), - // 'file_validate_image_resolution' => array('85x85'), - // 'file_validate_size' => array(30 * 1024), +// 'file_validate_is_image' => array(), +// 'file_validate_image_resolution' => array('85x85'), +// 'file_validate_size' => array(30 * 1024), ); $fileObject = file_save_upload('add-stream-file-location', $validators); @@ -496,6 +496,23 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) return $output; } +function fedora_repository_purge_object_form_validate($form, &$form_state) { + module_load_include('inc', 'fedora_repository', 'api/fedora_collection'); + $pid = $form_state['values']['pid']; + + $objectHelper = new ObjectHelper(); + $contentModels = $objectHelper->get_content_models_list($pid); + foreach ($contentModels as $contentModel) { + if ($contentModel->pid == 'islandora:collectionCModel') { + $member_pids = get_related_items_as_array($pid, 'isMemberOfCollection'); + if (is_array($member_pids)){ + form_set_error('new_collection_pid', t("Please purge all members of this collection before deleting the collection itself.")); + return; + } + } + } +} + /** * fedora repository purge object form submit * @param type $form @@ -667,7 +684,7 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $pid = $form_state['values']['pid']; $dsid = $form_state['values']['dsId']; $dsLabel = $form_state['values']['dsLabel']; - // Remove the original file extension from the label and add the new one +// Remove the original file extension from the label and add the new one $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot if ($indexOfDot !== FALSE) { $dsLabel = substr($dsLabel, 0, $indexOfDot); @@ -1554,14 +1571,14 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $collectioncm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); $collectioncm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); } catch (exception $e) { - + } try { $strictpdfcm = Fedora_Item::ingest_new_item('islandora:strict_pdf', 'A', 'Strict PDF Content Model'); $strictpdfcm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); $strictpdfcm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STRICT_PDFCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); } catch (exception $e) { - + } // Install a collection object that points to all content model objects @@ -1585,7 +1602,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M'); drupal_set_message(t("Successfully installed <a href=\"@base_url/fedora/repository/islandora:ContentModelCollection\">islandora:ContentModelCollection</a>.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { - + } } @@ -1597,7 +1614,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); drupal_set_message(t("Successfully installed <a href=\"@base_url/fedora/repository/islandora:root\">islandora:root</a>.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { - + } } @@ -1912,7 +1929,7 @@ function theme_fedora_repository_basket_form($form) { * @param type $form_state */ function fedora_repository_basket_form_validate($form, &$form_state) { - + } /** diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index 1b042273..a4a4f934 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -8,7 +8,7 @@ <xsl:value-of select="$path"/> </xsl:variable> <xsl:variable name="thisPid" select="$collectionPid"/> - <xsl:variable name="size" select="20"/> + <xsl:variable name="size" select="20"/> <xsl:variable name="page" select="$hitPage"/> <xsl:variable name="start" select="((number($page) - 1) * number($size)) + 1"/> <xsl:variable name="end" select="($start - 1) + number($size)"/> @@ -72,23 +72,23 @@ </td></tr> <!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() <=$end]"> - <xsl:variable name='OBJECTURI' select="object/@uri"/> - <xsl:variable name='PID' select="substring-after($OBJECTURI,'/')"/> - <tr> - <td> - <img> - <xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN - </xsl:attribute> - </img> - <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> - </xsl:attribute> - <xsl:value-of select="title"/> - </a> - </td> - </tr> - </xsl:for-each>- - --> +<xsl:variable name='OBJECTURI' select="object/@uri"/> +<xsl:variable name='PID' select="substring-after($OBJECTURI,'/')"/> +<tr> +<td> +<img> +<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN +</xsl:attribute> +</img> +<a> +<xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> +</xsl:attribute> +<xsl:value-of select="title"/> +</a> +</td> +</tr> +</xsl:for-each>- +--> <xsl:apply-templates select="s:sparql/s:results"/> </table><br clear="all" /> <!-- start previous next --> @@ -160,7 +160,7 @@ <xsl:with-param name="from" select="'_'"/> <xsl:with-param name="to" select="' '"/> </xsl:call-template> - + </xsl:variable> <xsl:variable name="cleanTitle"> <xsl:value-of select="php:functionString('fedora_repository_urlencode_string', $newTitle)"/> @@ -171,8 +171,8 @@ <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="'collection'"/> </xsl:when> <xsl:otherwise> - <!--the below is an example of going straight to a datastream instead of the details page. - <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="s:title"/>--> + <!--the below is an example of going straight to a datastream instead of the details page. +<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="s:title"/>--> <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="$cleanTitle"/> </xsl:otherwise> </xsl:choose> @@ -185,24 +185,24 @@ <img> <xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN </xsl:attribute> - <xsl:attribute name="alt"><xsl:value-of select="$newTitle" disable-output-escaping="yes"/> +<xsl:attribute name="alt"><xsl:value-of select="$newTitle" disable-output-escaping="yes"/> </xsl:attribute> - </img> </a> <br clear="all" /> + </img> </a> <br clear="all" /> <a> <xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> </xsl:attribute> <xsl:value-of select="$newTitle" disable-output-escaping="yes" /> </a> <!-- example of a url that would drill down to the details page if the url above went directly to a datastream - <xsl:if test="($CONTENTMODEL!='islandora:collectionCModel')"> - <br />[[ <a> - <xsl:attribute name="href"> - <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="$cleanTitle"/> - </xsl:attribute> - DETAILS - </a> ]] - </xsl:if>--> - +<xsl:if test="($CONTENTMODEL!='islandora:collectionCModel')"> +<br />[[ <a> +<xsl:attribute name="href"> +<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="$cleanTitle"/> +</xsl:attribute> +DETAILS +</a> ]] +</xsl:if>--> + </td> <xsl:if test="(position() = last()) and (position() < $cellsPerRow)"> <xsl:call-template name="FillerCells"> @@ -245,3 +245,4 @@ </xsl:choose> </xsl:template> </xsl:stylesheet> + From 7d0fa6cb922b2f52ca796443cfbd7ce63e0297eb Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Tue, 29 Nov 2011 15:41:23 -0400 Subject: [PATCH 136/247] added object's title to generted page --- plugins/FedoraObjectDetailedContent.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 0eef0f75..55a3d31c 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * FedoraObjectDetailedContent class @@ -34,12 +32,13 @@ class FedoraObjectDetailedContent { */ public function showFieldSets() { global $user; + drupal_set_title($this->item->objectProfile->objLabel); $objectHelper = new ObjectHelper(); $tabset = array(); $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form'); $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_form'); $purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path())))); - $details_selected = ($show_purge_tab ||$show_edit_tab); + $details_selected = ($show_purge_tab || $show_edit_tab); $tabset['fedora_object_details'] = array( '#type' => 'tabpage', '#title' => t('Object Details'), From dd23ba456e76752b9bcd8064e65351fc4378b2a0 Mon Sep 17 00:00:00 2001 From: Nigel Banks <nigel.g.banks@gmail.com> Date: Thu, 8 Dec 2011 15:31:31 -0400 Subject: [PATCH 137/247] Fixed issue ISLANDORA-164. --- ObjectHelper.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 9e9995b7..843a3f2d 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -339,11 +339,12 @@ class ObjectHelper { $versions = $item->get_datastream_history($id); if (is_array($versions)) { $downloadVersion = '<form method="GET" action="' . $action . '" onsubmit="this.action=\'' . $action . '\' + \'/\'+this.version.value;">'; + $downloadVersion .= '<input type="submit" value="' . t('Download') . '">'; $downloadVersion .= '<select name="version">'; foreach ($versions as $version) { $downloadVersion .= '<option>' . $version->createDate . '</option>'; } - $downloadVersion .= '</select><input type="submit" value="' . t('Download') . '"></form>'; + $downloadVersion .= '</select></form>'; } } From cedc2f6dd49e8b4cc8cbb6e7b9ee80aba2a0729d Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Fri, 9 Dec 2011 15:07:17 -0400 Subject: [PATCH 138/247] Fixed a warning in SecurityClass.inc In SecurityClass.inc it is possible to get the warnings: warning: Invalid argument supplied for foreach() in /var/www/sites/all/modules/fedora_repository/SecurityClass.inc on line 84. warning: Invalid argument supplied for foreach() in /var/www/sites/all/modules/fedora_repository/SecurityClass.inc on line 89. These happen when the XACML policy doesn't contain any roles or users. --- SecurityClass.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/SecurityClass.inc b/SecurityClass.inc index 1f3df0eb..06b5844a 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -81,11 +81,15 @@ class SecurityClass { $roles = $xml->xpath('//default:SubjectAttributeDesignator[@AttributeId="fedoraRole"]/../default:Apply/default:AttributeValue'); $users = $xml->xpath('//default:SubjectAttributeDesignator[@AttributeId="urn:fedora:names:fedora:2.1:subject:loginId"]/../default:Apply/default:AttributeValue'); - foreach($roles as $role) { - $allowedRoles[] = (string)$role; + if($roles) { + foreach($roles as $role) { + $allowedRoles[] = (string)$role; + } } - foreach($users as $user) { - $allowedUsers[] = (string)$user; + if($users) { + foreach($users as $user) { + $allowedUsers[] = (string)$user; + } } $usersAndRoles['users'] = $allowedUsers; From 061f47114398576fc837816b341a7fed85df3337 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 12 Dec 2011 13:20:45 -0400 Subject: [PATCH 139/247] Fixed version --- fedora_repository.info | 2 +- plugins/fedora_imageapi.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index 944568fe..aacd2731 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -4,5 +4,5 @@ dependencies[] = tabs dependencies[] = islandora_content_model_forms description = Shows a list of items in a fedora collection. package = Islandora -version = 11.3beta2 +version = 11.3beta3 core = 6.x diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index d17d73a8..171343b6 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -3,5 +3,5 @@ description = Adds image manipulation support through a REST interface package = Islandora Dependencies dependencies[] = fedora_repository dependencies[] = imageapi -version = 11.3beta2 +version = 11.3beta3 core = 6.x From fe451fc7d09fde232aa066e802a80f56755252ea Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Wed, 14 Dec 2011 10:39:21 -0400 Subject: [PATCH 140/247] added array check --- fedora_repository.module | 3 ++- plugins/slide_viewer.inc | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 05631b91..00201ec9 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -505,7 +505,7 @@ function fedora_repository_purge_object_form_validate($form, &$form_state) { foreach ($contentModels as $contentModel) { if ($contentModel->pid == 'islandora:collectionCModel') { $member_pids = get_related_items_as_array($pid, 'isMemberOfCollection'); - if (is_array($member_pids)){ + if (is_array($member_pids) && ! empty($member_pids)){ form_set_error('new_collection_pid', t("Please purge all members of this collection before deleting the collection itself.")); return; } @@ -757,6 +757,7 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $soapHelper = new ConnectionHelper(); $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); + // Check if there is a custom edit metadata function defined in the content model. $breadcrumbs = array(); diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index 45ff3f9d..f3bdd6b9 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * ShowSlideStreamsInFieldSets class From 60943c95c751b1ff0b142c693a7f9c8c964f2614 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Wed, 14 Dec 2011 15:05:26 -0400 Subject: [PATCH 141/247] Added filter for blank subtitle field --- xsl/mods_to_dc.xsl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xsl/mods_to_dc.xsl b/xsl/mods_to_dc.xsl index 4c007469..ffad541d 100644 --- a/xsl/mods_to_dc.xsl +++ b/xsl/mods_to_dc.xsl @@ -39,7 +39,8 @@ Version 1.0 2007-05-04 Tracy Meehleib <tmee@loc.gov> <srw_dc:dcCollection xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/standards/sru/dc-schema.xsd"> <xsl:apply-templates/> <xsl:for-each select="mods:modsCollection/mods:mods"> - <srw_dc:dc xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/standards/sru/dc-schema.xsd"> + :67 + <srw_dc:dc xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/standards/sru/dc-schema.xsd"> <xsl:apply-templates/> </srw_dc:dc> @@ -66,8 +67,10 @@ Version 1.0 2007-05-04 Tracy Meehleib <tmee@loc.gov> </xsl:if> <xsl:value-of select="mods:title"/> <xsl:if test="mods:subTitle"> + <xsl:if test="text() [normalize-space(.) ]"> <xsl:text>: </xsl:text> <xsl:value-of select="mods:subTitle"/> + </xsl:if> </xsl:if> <xsl:if test="mods:partNumber"> From 9db1e4f83b70d3be538b438acd00bd7e69db7bda Mon Sep 17 00:00:00 2001 From: Nigel Banks <nigel.g.banks@gmail.com> Date: Thu, 22 Dec 2011 13:23:12 -0400 Subject: [PATCH 142/247] Fix for ISLANDORA-219: Warning issued when converting old schema --- CollectionPolicy.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index 5a3daf21..9b0af861 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -244,8 +244,8 @@ class CollectionPolicy extends XMLDatastream { $rootEl->appendChild($relationshipEl); $newDom->appendChild($rootEl); - - $this->xml = DOMDocument::loadXML($newDom->saveXml()); + $this->xml = new DOMDocument(); + $this->xml->loadXML($newDom->saveXml()); } /** @@ -427,7 +427,8 @@ class CollectionPolicy extends XMLDatastream { if ($this->xml == NULL) { $fedoraItem = new Fedora_Item($this->pid); $ds = $fedoraItem->get_datastream_dissemination($this->dsid); - $this->xml = DOMDocument::loadXML($ds); + $this->xml = new DOMDocument(); + $this->xml->loadXML($ds); } From 4ed630370d0101f127a4f553f6a277d9b3349d4f Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 10 Jan 2012 14:35:46 -0400 Subject: [PATCH 143/247] Changed version --- fedora_repository.info | 2 +- plugins/fedora_imageapi.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.info b/fedora_repository.info index aacd2731..5d3762e4 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -4,5 +4,5 @@ dependencies[] = tabs dependencies[] = islandora_content_model_forms description = Shows a list of items in a fedora collection. package = Islandora -version = 11.3beta3 +version = 11.3.1 core = 6.x diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index 171343b6..3a9deea7 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -3,5 +3,5 @@ description = Adds image manipulation support through a REST interface package = Islandora Dependencies dependencies[] = fedora_repository dependencies[] = imageapi -version = 11.3beta3 +version = 11.3.1 core = 6.x From 15a09635819b9489075b6db7c2e961f0ab9fc7a2 Mon Sep 17 00:00:00 2001 From: ppound <paul.pound@gmail.com> Date: Thu, 2 Feb 2012 13:07:07 -0400 Subject: [PATCH 144/247] updated soap connection to be session aware --- ConnectionHelper.inc | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 59f811e2..71a83bc9 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -1,7 +1,5 @@ <?php - - /** * @file * Connection Helper Class @@ -66,10 +64,10 @@ class ConnectionHelper { //with the appropriate entry for a username of anonymous password of anonymous try { $client = new SoapClient($this->_fixURL($url, 'anonymous', 'anonymous'), array( - 'login' => 'anonymous', - 'password' => 'anonymous', - 'exceptions' => $exceptions, - )); + 'login' => 'anonymous', + 'password' => 'anonymous', + 'exceptions' => $exceptions, + )); } catch (SoapFault $e) { drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); return NULL; @@ -78,15 +76,32 @@ class ConnectionHelper { else { try { $client = new SoapClient($this->_fixURL($url, $user->name, $user->pass), array( - 'login' => $user->name, - 'password' => $user->pass, - 'exceptions' => TRUE, - )); + 'login' => $user->name, + 'password' => $user->pass, + 'exceptions' => TRUE, + )); } catch (SoapFault $e) { drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); return NULL; } } + if (isset($_SESSION['islandora_soapcookies'])) { + + // just set the cookies + + $client->_cookies = ($_SESSION['islandora_soapcookies']); + } + else { + try { + //we need to make a call to set the cookie this extra call would only happen once per session + $client->__soapCall('describeRepository', array()); + } catch (exception $e) { + //connection is tested elsewhere so eat this for now here we just want the cookie + } + $_SESSION['islandora_soapcookies'] = $client->_cookies; + } + + return $client; } From eb2e765e782e2e90eed016084434eb1440944d8f Mon Sep 17 00:00:00 2001 From: Nigel Banks <nigel.g.banks@gmail.com> Date: Thu, 2 Feb 2012 17:56:18 +0000 Subject: [PATCH 145/247] Added a function for forgetting a object when memory constraints apply. --- api/fedora_item.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index a79749a7..4d309ba8 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -55,6 +55,15 @@ class Fedora_Item { Fedora_Item::$instantiated_pids[$pid] = &$this; } } + + /** + * Forget this Object, do manually when memory constraints apply. + * + * Removes this object from the static list of $instantiated_pids + */ + function forget() { + unset(Fedora_Item::$instantiated_pids[$pid]); + } /** * Exists From e57a0f9a817e3ff6e900aa90a1765c87efc06a39 Mon Sep 17 00:00:00 2001 From: Nigel Banks <nigel.g.banks@gmail.com> Date: Thu, 2 Feb 2012 18:21:40 +0000 Subject: [PATCH 146/247] Opps! --- api/fedora_item.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 4d309ba8..2a70010a 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -62,7 +62,7 @@ class Fedora_Item { * Removes this object from the static list of $instantiated_pids */ function forget() { - unset(Fedora_Item::$instantiated_pids[$pid]); + unset(Fedora_Item::$instantiated_pids[$this->pid]); } /** From 56b1d21f499885fb09f2ee36d1610cf702252dac Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 15:02:19 -0400 Subject: [PATCH 147/247] Fixed coding issues --- fedora_repository.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 00201ec9..83532ead 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -143,7 +143,7 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label function fedora_repository_ingest_form_submit(array $form, array &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH if ($form_state['ahah_submission']) { - $form_state['submitted'] = false; + $form_state['submitted'] = FALSE; return; } if ($form_state['storage']['xml']) { @@ -202,7 +202,7 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { function fedora_repository_ingest_form_validate($form, &$form_state) { //only validate the form if the submit button was pressed (other buttons may be used for AHAH if ($form_state['ahah_submission']) { - $form_state['submitted'] = false; + $form_state['submitted'] = FALSE; return; } if ($form_state['clicked_button']['#id'] == 'edit-submit' && $form_state['ahah_submission'] != 1) { @@ -246,7 +246,7 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { if (!empty($file)) { if (!in_array($dformat, $allowedMimeTypes)) { - form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . + form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are' . ' ' . implode(' ', $allowedMimeTypes))); file_delete($file); return; @@ -505,7 +505,7 @@ function fedora_repository_purge_object_form_validate($form, &$form_state) { foreach ($contentModels as $contentModel) { if ($contentModel->pid == 'islandora:collectionCModel') { $member_pids = get_related_items_as_array($pid, 'isMemberOfCollection'); - if (is_array($member_pids) && ! empty($member_pids)){ + if (is_array($member_pids) && ! empty($member_pids)) { form_set_error('new_collection_pid', t("Please purge all members of this collection before deleting the collection itself.")); return; } From a4a846e90a7ac2e74006690beee663785167f867 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 15:10:32 -0400 Subject: [PATCH 148/247] Fixed t tags --- fedora_repository.module | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 83532ead..0e8e25fc 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -246,8 +246,11 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { if (!empty($file)) { if (!in_array($dformat, $allowedMimeTypes)) { - form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are' . ' ' . - implode(' ', $allowedMimeTypes))); + form_set_error('ingest-file-location', + t('The uploaded file\'s mimetype ') . + '(' . $dformat . ') ' . + t('is not associated with this Content Model. The allowed types are') . + ' ' . implode(' ', $allowedMimeTypes)); file_delete($file); return; } From 9babc676d8d3e814607e508c26e13c91468fe674 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 15:11:54 -0400 Subject: [PATCH 149/247] Fixed t tags --- fedora_repository.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 0e8e25fc..aaad2c4c 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -247,8 +247,8 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { if (!empty($file)) { if (!in_array($dformat, $allowedMimeTypes)) { form_set_error('ingest-file-location', - t('The uploaded file\'s mimetype ') . - '(' . $dformat . ') ' . + t('The uploaded file\'s mimetype') . + ' (' . $dformat . ') ' . t('is not associated with this Content Model. The allowed types are') . ' ' . implode(' ', $allowedMimeTypes)); file_delete($file); From fb41e231b7ff86b513a6a1cf2ec149d534bd272e Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 15:17:08 -0400 Subject: [PATCH 150/247] Fixed formBuilder --- plugins/FormBuilder.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index cd9dc4a9..715ca6af 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -95,7 +95,7 @@ class FormBuilder { try { $xml = new SimpleXMLElement($policyStreamDoc); } catch (Exception $e) { - watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem getting security policy.", NULL, WATCHDOG_ERROR); drupal_set_message(t('Problem getting security policy: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } @@ -173,7 +173,7 @@ class FormBuilder { $object = Fedora_Item::ingest_from_FOXML($dom); if (!empty($object->pid)) { // drupal_set_message("Item ". l($object->pid, 'fedora/repository/'. $object->pid) . " created successfully.", "status"); - drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/' . $object->pid))), "status"); + drupal_set_message(t("Item !pid created successfully.", array('!pid' => l(check_plain($object->pid), 'fedora/repository/' . check_plain($object->pid)))), "status"); } if (!empty($_SESSION['fedora_ingest_files'])) { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { From 039e77b41289eabf86b38336ab05dcb8b6b37d50 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 15:31:26 -0400 Subject: [PATCH 151/247] Fixed Refworks --- plugins/Refworks.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 5e39b3c2..2c86caa7 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -83,7 +83,7 @@ class Refworks { //$dom = dom_import_simplexml($xml);//test to see if it behaves better //$xml = new SimpleXMLElement(trim(file_get_contents($file))); } catch (Exception $e) { - drupal_set_message(t('Error processing Refworks file:') . " " . $e->getMessage()); + drupal_set_message(t('Error processing Refworks file: @message', array('@message' => $e->getMessage()))); return FALSE; } $this->referenceList = array(); @@ -296,7 +296,7 @@ class Refworks { $object = $client->__soapCall('ingest', array( $params )); - watchdog(t("FEDORA_REPOSITORY"), t("Successfully added repository item !pid - !it", array('!pid' => $pid, '!it' => $item_title)), NULL, WATCHDOG_INFO); + watchdog(t("FEDORA_REPOSITORY"), "Successfully added repository item " . $pid . " - ". $item_title, NULL, WATCHDOG_INFO); $deleteFiles = $form_values['delete_file']; //remove files from drupal file system if ($deleteFiles > 0) { From 5d771e78b65b46f396e612f9463a473ff0c8e4cd Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 15:35:17 -0400 Subject: [PATCH 152/247] Fixed ShowStreamsInFieldSets --- plugins/ShowStreamsInFieldSets.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index a6e7eaad..9e20ca5a 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -109,7 +109,7 @@ class ShowStreamsInFieldSets { } $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)); + $dl_link = l('<div style="float:left; padding: 10px"><img src="' . $tn_url . '"><br />' . t('View Document') .'</div>', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); $tabset['first_tab']['tabs']['view'] = array( '#type' => 'tabpage', From 129cb21079e62473791f94c54fb18b3f4ed18206 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 15:42:15 -0400 Subject: [PATCH 153/247] Fixed more i18n errors --- ObjectHelper.inc | 2 +- SecurityClass.inc | 6 +++--- formClass.inc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 313d2159..8f58a3ab 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -963,7 +963,7 @@ class ObjectHelper { } else { - $breadcrumbs[] = l("Path Calculation Error", 'fedora/repository/' . $pid); + $breadcrumbs[] = l(t("Path Calculation Error"), 'fedora/repository/' . $pid); } } } diff --git a/SecurityClass.inc b/SecurityClass.inc index 55a6ebb4..970b108b 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -71,9 +71,9 @@ class SecurityClass { try { $xml = new SimpleXMLElement($policyStream); } catch (Exception $e) { - watchdog(t("Fedora_Repository"), t("No roles found in security policy, could not parse policy stream."), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "No roles found in security policy, could not parse policy stream.", NULL, WATCHDOG_ERROR); //we may not want to send this to the screen. - drupal_set_message(t('No roles found in security policy, could not parse policy stream: !message', array('!message' => $e->getMessage())), 'error'); + drupal_set_message(t('No roles found in security policy, could not parse policy stream: !message', array('!message' => check_plain($e->getMessage()))), 'error'); return NULL; } $xml->registerXPathNamespace('default', 'urn:oasis:names:tc:xacml:1.0:policy'); @@ -110,7 +110,7 @@ class SecurityClass { try { $doc->load(drupal_get_path('module', 'Fedora_Repository') . '/policies/noObjectEditPolicy.xml'); } catch (exception $e) { - watchdog(t("Fedora_Repository"), t("Problem loading policy file."), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem loading policy file.", NULL, WATCHDOG_ERROR); } $conditions = $doc->getElementsByTagName('Condition'); foreach ($conditions as $condition) { diff --git a/formClass.inc b/formClass.inc index be5ef9d2..1c8d2f84 100644 --- a/formClass.inc +++ b/formClass.inc @@ -498,7 +498,7 @@ class formClass { '#title' => t('Content models available'), '#options' => $potential_models, '#default_value' => $selected_model, - '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.<br /> Additional information may be found <a href="https://wiki.duraspace.org/display/FEDORACREATE/Content+Models+Overview">here.</a> '), + '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.<br /> Additional information may be found <a href="https://wiki.duraspace.org/display/FEDORACREATE/Content+Models+Overview">here.</a>'), ), ), 'collection_pid' => array( From cd234314305b934cab92f5b8a1ca0e57a550d762 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 15:46:09 -0400 Subject: [PATCH 154/247] Fixed more i18n errors --- CollectionClass.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 6c5fd8f5..96eca6f0 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -343,7 +343,7 @@ class CollectionClass { $thisClass = new $phpClass (); $returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext); if (!$returnValue) { - drupal_set_message('Error! Failed running content model method !m !rv', array('!m' => $phpMethod, '!rv' => $returnValue)); + drupal_set_message(t('Error! Failed running content model method !m !rv', array('!m' => $phpMethod, '!rv' => $returnValue))); return FALSE; } } @@ -463,7 +463,7 @@ class CollectionClass { module_load_include('inc', 'fedora_repository', 'plugins/PersonalCollectionClass'); $personalCollectionClass = new PersonalCollectionClass(); if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) { - drupal_set_message("Did not create a personal collection object for !u", array('!u' => $user->name)); + drupal_set_message(t("Did not create a personal collection object for !u", array('!u' => $user->name))); return FALSE; //creation failed don't save the collection pid in drupal db } user_save($user, $personal_collection_pid); From 33b3b4453f4134d3c701225bdeff85b880656226 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Mon, 13 Feb 2012 16:15:49 -0400 Subject: [PATCH 155/247] added permission filtering to get_collections_as_option_array() --- api/fedora_utils.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 89545191..c2665fc7 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -236,6 +236,8 @@ function fix_dsid($dsid) { function get_collections_as_option_array() { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); $restricted = variable_get('fedora_namespace_restriction_enforced', TRUE); + $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); + $namespaces = explode(':', $allowed_string); $query = 'select $object $title from <#ri> where ($object <dc:title> $title and $object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/islandora:collectionCModel> @@ -247,13 +249,22 @@ function get_collections_as_option_array() { $list = explode("\n", $content); array_shift($list); $list = preg_replace('/info:fedora\//', '', $list); + foreach ($namespaces as $namespace) { + $trimmed_names[] = trim($namespace); + } $options = array(); foreach ($list as $item) { //removes blanks if ($item) { $parts = explode(',', $item); - $options[$parts[0]] = $parts[1]; + $namespace = explode(':', $parts[0]); + $namespace = trim($namespace[0]); + $bool = in_array($namespace, $trimmed_names); + if (!$restricted || in_array($namespace, $trimmed_names)) { + $options[$parts[0]] = $parts[1]; + } } } + unset($options['islandora:ContentModelCollection']); return $options; } From 711b0082f3837cc3b1ce765a33bfef1a2fd58164 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Mon, 13 Feb 2012 16:20:26 -0400 Subject: [PATCH 156/247] getRelatedItems raised default limit to 10000 --- CollectionClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 6c5fd8f5..ce3aafff 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -68,7 +68,7 @@ class CollectionClass { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!isset($limit)) { - $limit = 1000; + $limit = 10000; } if (!isset($offset)) { $offset = 0; From dbacca19be6e06da6ba80b4b9d75434acbaa1b84 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 13 Feb 2012 16:34:33 -0400 Subject: [PATCH 157/247] Fixed more i18n errors --- fedora_repository.solutionpacks.inc | 4 ++-- plugins/PersonalCollectionClass.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index fb09528d..756f8bf0 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -181,7 +181,7 @@ function solution_pack_add_form($form_name, $form_xml) { $object->name = $form_name; $object->form = $form_xml; $result = drupal_write_record('xml_forms', $object); - drupal_set_message("Added $name"); + drupal_set_message(t("Added @name", array("@name" => $name))); } } @@ -196,7 +196,7 @@ function solution_pack_add_form_association($content_model, $form_name) { $object->title_field = "['titleInfo']['title']"; $object->transform = 'mods_to_dc.xsl'; $result = drupal_write_record('islandora_content_model_forms', $object); - drupal_set_message("Added association between $content_model$name"); + drupal_set_message(t("Added association between @cm@name", array("@cm" => $content_model, "@name"=>$name))); } } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 29c76cfa..9ed6af07 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -75,7 +75,7 @@ class PersonalCollectionClass { try { $xml = new SimpleXMLElement($collectionTemplate); } catch (Exception $e) { - watchdog(t("Fedora_Repository"), t("Problem creating personal collection policy, could not parse collection policy stream."), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem creating personal collection policy, could not parse collection policy stream.", NULL, WATCHDOG_ERROR); drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } From 43a85cf89ccfff167c1d7d9bc7eba3e6537ec313 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Mon, 13 Feb 2012 17:07:19 -0400 Subject: [PATCH 158/247] Removed ALL limits on collections --- CollectionClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index ce3aafff..cb49c909 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -68,7 +68,7 @@ class CollectionClass { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!isset($limit)) { - $limit = 10000; + $limit = null; } if (!isset($offset)) { $offset = 0; From 2d353855c3fbe79228ad7b8bc163f5c68672f0c9 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Mon, 13 Feb 2012 20:05:18 -0400 Subject: [PATCH 159/247] remove testing line --- CollectionClass.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index cb49c909..35d9a0ca 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -67,9 +67,6 @@ class CollectionClass { function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!isset($limit)) { - $limit = null; - } if (!isset($offset)) { $offset = 0; } From 67007c80dedd0b62e20158f0f43956cb00cc788f Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 14 Feb 2012 10:34:13 -0400 Subject: [PATCH 160/247] Created a move to trash option asdf removed breadcrumbs for a test setback to default playing with the menu playing with the menu playing with the menu playing with the menu playing with the menu cleanup Removed ALL limits on collections remove testing line --- CollectionClass.inc | 3 --- api/fedora_item.inc | 28 ++++++++++++++++++++++++++++ fedora_repository.module | 1 + formClass.inc | 2 ++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index c5029333..71710d78 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -67,9 +67,6 @@ class CollectionClass { function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!isset($limit)) { - $limit = 10000; - } if (!isset($offset)) { $offset = 0; } diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 2a70010a..3018d614 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -635,6 +635,28 @@ class Fedora_Item { return FALSE; } + + /** + * Set the object to a deleted state + */ + function move_to_trash($log_message = 'Flagged deleted using Islandora API.') + { + // Loop through the datastreams and mark them deleted + foreach($this->get_datastreams_list_as_array() as $dsid) + { + $this->set_datastream_state($dsid, 'D'); + } + + // Create a message to mark the object deleted + $params = array( + 'pid' => $this->pid, + 'state' => 'D', + 'logMessage' => $logMessage + ); + + // Send message to mark the object deleted + return self::soap_call('modifyObject', $params, $quiet); + } /** * Removes this object form the repository. @@ -643,12 +665,18 @@ class Fedora_Item { * @return type */ function purge($log_message = 'Purged using Islandora API.', $force = FALSE) { + + // Flag the object to be deleted first + $this->move_to_trash($log_message); + + // Create the delete message $params = array( 'pid' => $this->pid, 'logMessage' => $log_message, 'force' => $force ); + // Delete the object return $this->soap_call('purgeObject', $params); } diff --git a/fedora_repository.module b/fedora_repository.module index aaad2c4c..f3412b54 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1011,6 +1011,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU ); } } + // Add a 'manage object' tab for all objects, where detailed list of content is shown. $obj = new FedoraObjectDetailedContent($pid); $object_details = $obj->showFieldSets(); diff --git a/formClass.inc b/formClass.inc index 1c8d2f84..b3972087 100644 --- a/formClass.inc +++ b/formClass.inc @@ -581,6 +581,8 @@ class formClass { if (!$this->canShowIngestForm($collection_pid)) { return FALSE; } + + drupal_set_title($collection_label); if (module_exists('islandora_content_model_forms')) { module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); try { From 79b37234592d5ffa8ddb3881ae48797a10963e20 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Wed, 15 Feb 2012 14:54:07 -0400 Subject: [PATCH 161/247] added conveninece method to wrap datastream writing --- api/fedora_item.inc | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 2a70010a..d315f904 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -43,7 +43,7 @@ class Fedora_Item { } $raw_objprofile = $this->soap_call('getObjectProfile', array('pid' => $this->pid, 'asOfDateTime' => "")); - + if (!empty($raw_objprofile)) { $this->objectProfile = $raw_objprofile->objectProfile; $this->datastreams = $this->get_datastreams_list_as_array(); @@ -55,7 +55,7 @@ class Fedora_Item { Fedora_Item::$instantiated_pids[$pid] = &$this; } } - + /** * Forget this Object, do manually when memory constraints apply. * @@ -164,6 +164,30 @@ class Fedora_Item { return $returnvalue; } + + /** + * Wrapper to add new or modify existing datastream + * @global url $base_url + * @param url $external_url + * @param string $dsid + * @param string $label + * @param string $mime_type + * @param string $controlGroup + * @param boolean $force + * @param string $logMessage + * @param boolean $quiet + */ + function add_or_modify_by_reference($external_url, $dsid, $label, $mime_type, $controlGroup = 'M', $force = FALSE, $logMessage = 'Modified by Islandora API', $quiet=FALSE) { + global $base_url; + if (array_key_exists($dsid, $this->datastreams)) { + $this->modify_datastream_by_reference($external_url, $dsid, $label, $mime_type, $force, $logMessage, $quiet); + } + else { + $file_location = str_replace("$base_url/", '', $external_url); + $this->add_datastream_from_file($file_location, $dsid, $label, $mime_type, $controlGroup = 'M', $logMessage = NULL); + } + } + /** * Add a relationship string to this object's RELS-EXT. * does not support rels-int yet. @@ -583,8 +607,7 @@ class Fedora_Item { return $relationships; } - - function get_models() { + function get_models() { $relationships = array(); try { $relsext = $this->get_datastream_dissemination('RELS-EXT'); From abb065f7e3512131ddc08330bb3b421d4c8eb7b4 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 15 Feb 2012 16:37:16 -0400 Subject: [PATCH 162/247] Fixed collection renaming --- formClass.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/formClass.inc b/formClass.inc index b3972087..86a5128f 100644 --- a/formClass.inc +++ b/formClass.inc @@ -379,7 +379,13 @@ class formClass { // DC elements $previousElement = NULL; // Used in case we have to nest elements for qualified dublin core. + + $label = null; foreach ($form_values as $key => $value) { + //echo ($key); + if ($key == 'dc:title-0') { + $label = $value; + } $index = strrpos($key, '-'); $key = substr($key, 0, $index); $test = substr($key, 0, 2); @@ -400,6 +406,13 @@ class formClass { } } + // Save the title + if ( $label != null ) + { + $object = new Fedora_Item($form_values['pid']); + $object->modify_object($label); + } + $dom->appendChild($oai); if (!$client) { From e9291a96c37ca248188bd698087c779eb333673c Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Thu, 16 Feb 2012 12:07:45 -0400 Subject: [PATCH 163/247] Added a new api --- newapi/Cache.php | 76 ++++++++++ newapi/Configuration.php | 58 ++++++++ newapi/IslandoraModule.php | 37 +++++ newapi/Repository.php | 264 ++++++++++++++++++++++++++++++++++ newapi/Search.php | 37 +++++ newapi/models/DataObject.php | 42 ++++++ newapi/models/ObjectModel.php | 119 +++++++++++++++ newapi/models/SPO.php | 75 ++++++++++ 8 files changed, 708 insertions(+) create mode 100644 newapi/Cache.php create mode 100644 newapi/Configuration.php create mode 100644 newapi/IslandoraModule.php create mode 100644 newapi/Repository.php create mode 100644 newapi/Search.php create mode 100644 newapi/models/DataObject.php create mode 100644 newapi/models/ObjectModel.php create mode 100644 newapi/models/SPO.php diff --git a/newapi/Cache.php b/newapi/Cache.php new file mode 100644 index 00000000..906fe804 --- /dev/null +++ b/newapi/Cache.php @@ -0,0 +1,76 @@ +<?php + +/** + * Hashtable cache ( nothing special ) + * Should be replaced with something like + */ +class Cache +{ + private $objectList = array(); + + /** + * Add an object to the cache + * @param ObjectModel $object + */ + public function addObject(ObjectModel &$object) + { + if ( !isset($this->objectList[$object->getId()])) + { + $this->objectList[$object->getId()] = array(); + } + + $this->objectList[$object->getId()]['checksum'] = sha1(serialize($object)); + $this->objectList[$object->getId()]['object'] = $object; + } + + /** + * Check to see if the object has been updated + * @param ObjectModel $object + */ + public function hasChanged(ObjectModel &$object) + { + // Is the object even cached + if ( !isset($this->objectList[$object->getId()])) + { + return false; + } + + // Does it have the same checksum + if ($this->objectList[$object->getId()]['checksum'] == sha1(serialize($object)) ) + { + return true; + } + + // If they were the same then it would have already exited + return false; + } + + /** + * Get object from the cache. Returns null if not found. + * @param type $id + */ + public function getObject($id) + { + // Is the object cached + if ( isset($this->objectList[$id]['object'] ) ) { + + // Return the object from the cache + return $this->objectList[$id]['object']; + } + + // Object wasn't found so return null + return null; + } + + /** + * Remove the object from the cache + * @param type $id + */ + public function deleteObject($id) + { + // Unset it from the array + unset( $this->objectList[$id]); + } +} + +?> diff --git a/newapi/Configuration.php b/newapi/Configuration.php new file mode 100644 index 00000000..5f939715 --- /dev/null +++ b/newapi/Configuration.php @@ -0,0 +1,58 @@ +<?php + +/** + * Basic config should be replaced with a specific implementation + */ +class Configuration +{ + private $baseUrl; + private $port; + + /** + * Default constructor + * @param type $base_url + * @param type $port + */ + public function __construct($base_url, $port) { + $this->$baseUrl = $base_url; + $this->$port = $port; + } + + /** + * Get the base url + * @return type + */ + public function getBaseURL() + { + return $this->$baseUrl; + } + + /** + * Set the base url + * @param type $url + */ + public function setBaseURL($url) + { + $this->$baseUrl = $url; + } + + /** + * Get the port + * @return type + */ + public function getPort() + { + return $this->$port; + } + + /** + * Set the port + * @param type $port + */ + public function setPort($port) + { + $this->$port = $port; + } +} + +?> diff --git a/newapi/IslandoraModule.php b/newapi/IslandoraModule.php new file mode 100644 index 00000000..8183415a --- /dev/null +++ b/newapi/IslandoraModule.php @@ -0,0 +1,37 @@ +<?php + +/** + * Islandora wrapper class to make everything easy to access + */ +class IslandoraModule +{ + private static $instance; + private $repository; + + /** + * Block people from creating the class + */ + private function __construct() + { + $this->repository = new Repository(new Configuration("127.0.0.1", 8080), new Search, new Cache()); + } + + /** + * Get the repository singleton + * @return type + */ + public static function instance() + { + if ( self::instance == null ) + { + $className = __CLASS__; + self::$instance = new $className; + // get_called_class only works in 5.3 + } + + // Return the link to the repository + return self::$instance->repository; + } +} + +?> diff --git a/newapi/Repository.php b/newapi/Repository.php new file mode 100644 index 00000000..cfc34e6c --- /dev/null +++ b/newapi/Repository.php @@ -0,0 +1,264 @@ +<?php + +/** + * Fedora repository + */ +class Repository +{ + private $config; + private $search; + private $cache; + + public function __construct(Configuration &$config, Search &$search, Cache &$cache) + { + // Store all the dependencies + $this->setConfig($config); + $this->setSearch($search); + $this->setCache($cache); + } + + /** + * Get the configuration implementation + * @return type + */ + public function getConfig() + { + return $this->config; + } + + /** + * Get the search implementation + * @return type + */ + public function getSearch() + { + return $this->search; + } + + /** + * Get the cache implementation + * @return type + */ + public function getCache() + { + return $this->cache; + } + + /** + * Set the configuration implementation + * @param Configuration $config + */ + public function setConfig(Configuration &$config) + { + if ( $config == null ) + { + throw new Exception("Config implementation can't be null"); + } + $this->config = $config; + } + + /** + * Set the search implementation + * @param Search $search + */ + public function setSearch(Search &$search) + { + if ( $search == null ) + { + throw new Exception("Search implementation can't be null"); + } + $this->search = $search; + } + + /** + * Set the cache implementation + * @param Cache $cache + */ + public function setCache(Cache &$cache) + { + if ( $cache == null ) + { + throw new Exception("Cache implementation can't be null"); + } + $this->cache = $cache; + } + + /** + * Get the object from the repo + * @param type $id + */ + public function loadObject($id, $cache=true) + { + // Check to see if its already cached + if ( $this->getCache()->getObject( $id ) && $cache = true) + { + // Return the cached object + return $this->getCache()->getObject( $id ); + } + + // Create the request + $results = $this->makeRequest( '/objects/' .$id ); + + // Return the object model + return unserialize($results); + } + + /** + * Save an object to the repository + * @param ObjectModel $model + * @param type $force + */ + public function saveObject(ObjectModel $model, $force=false) + { + // Has the object been created at all + if ( $model->getId() == null ) { + + // Get the next free persistent id + $id = $this->makeRequest( '/objects/nextPID' ); + + // Set the id on the model + $model->setId($id); + + } + + // If it hasn't changed then done't save unless it's forced + if ( ! $force && ! $this->getCache()->hasChanged($model) ) + { + return; + } + + // Add the object to the cache so everybody has the new copy + $this->getCache()->addObject($model); + + // Post the serialized model to the object endpoint + $this->makeRequest('/objects', $this->serialize($model)); + } + + /** + * Find an object using a search term + * @param type $term + * @return type + */ + public function findObjectByTerm($term) + { + // Create results + $results = $this->makeRequest('/objects?terms=' . $term); + + // Do something with results + return $results; + } + + /** + * Find an object with a query + * @param type $query + * @return type + */ + public function findObjectWithQuery($query) + { + // Create results + $results = $this->makeRequest('/objects?query=' . $term); + + // Do something with results + return $results; + } + + /** + * Search the repository using either a SPO or an array of SPOs + * @param type $query + */ + public function SearchSPO($SPO) + { + // Search + $results = $this->getSearch()->SearchSPO($SPO); + + // Do something with the results + return $results; + } + + /** + * Unserialize the object from foxml + * @param type $xml + * @return \ObjectModel + */ + protected function unserialize($xml) + { + // Create the object model + $model = new ObjectModel(); + + // Do something with the xml + $xml = $xml; + + // Return the model; + return $model; + } + + /** + * Serialize the object to foxml + * @param ObjectModel $model + * @return string + */ + protected function serialize(ObjectModel $model) + { + // Do something with the model + serialize($model); + + // return a string + return ""; + } + + /** + * Make a request + * @param type $request + * @return type + */ + private function makeRequest($request, array $postData = null, $responseCode=200, $format="xml") + { + // Check to see if we already have parameters + $pos = strpos($request, "?"); + if ($pos === false) { + $request.="?format=".$format; + } else { + $request.="&format=".$format; + } + + // Initialize Curl + $curl = curl_init(); + + // Set all the options + curl_setopt($curl, CURLOPT_URL, $this->getConfig()->getBaseURL() . $request); + curl_setopt($curl, CURLOPT_PORT , $this->getConfig()->getPort() ); + curl_setopt($curl, CURLOPT_VERBOSE, 1); + // If we have post data then append that + if ( $postData ) { + curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); + } + + // Execute the curl call + $results = curl_exec($curl); + + // Check for an error + if( ! curl_errno($curl) ) { + + // Get information regarding the curl connection + $info = curl_getinfo($curl); + + // Check the response code + if ( $info['http_code'] != $responseCode ) + { + var_dump($results); + var_dump($info); + throw new Exception("Curl request failed"); + } else { + return $results; + } + } + + // Close connection + curl_close($curl); + + } // Close makeRequest + +} + + +?> diff --git a/newapi/Search.php b/newapi/Search.php new file mode 100644 index 00000000..406a68e5 --- /dev/null +++ b/newapi/Search.php @@ -0,0 +1,37 @@ +<?php + + +/** + * Basic search that uses RI but could be replaced with solr + */ +class Search +{ + /** + * Search the repository using either a SPO or an array of SPOs + * @param type $query + */ + public function SearchSPO($SPO) + { + $queryString = ""; + if (is_array($SPO)) + { + foreach($SPO as $spo) + { + $queryString .= $spo->getSubject() . " " . $spo->getPredicate() . " " . $spo->getObject() . ", "; + } + // Strip off the extra comma + $queryString = substr($queryString, '', -2); + } + else { + $queryString .= $SPO->getSubject() . " " . $SPO->getPredicate() . " " . $SPO->getObject(); + } + + // Do a search + $results = ""; + + // Return results; + return $results; + } +} + +?> diff --git a/newapi/models/DataObject.php b/newapi/models/DataObject.php new file mode 100644 index 00000000..55af4062 --- /dev/null +++ b/newapi/models/DataObject.php @@ -0,0 +1,42 @@ +<?php + +/** + * Repository Object Data + */ +class DataObject +{ + private $id; + + /** + * Get the object id + * @return type + */ + public function getId() + { + return $this->id; + } + + /** + * Set the idea if not already set + * @param type $id + * @throws Exception + */ + public function setId($id) + { + if ( $pid != null ) + { + throw new Exception("PID can't be changed"); + } + $this->id = $pid; + } + + /** + * Add the data from a file ( example ) + */ + public function addDataFromFile() + { + + } +} + +?> diff --git a/newapi/models/ObjectModel.php b/newapi/models/ObjectModel.php new file mode 100644 index 00000000..3ceb6da1 --- /dev/null +++ b/newapi/models/ObjectModel.php @@ -0,0 +1,119 @@ +<?php + +/** + * Repository Object + * + * @todo Create an iterator for the datas + */ +class ObjectModel +{ + private $id; + private $label; + private $status; + private $dataObjects = array(); + + /** + * Get the object id + * @return type + */ + public function getId() + { + return $this->id; + } + + /** + * Set the idea if not already set + * @param type $id + * @throws Exception + */ + public function setId($id) + { + if ( $id != null ) + { + throw new Exception("ID can't be changed"); + } + $this->id = $id; + } + + /** + * Get the object label + * @return type + */ + public function getLabel() + { + return $this->label; + } + + /** + * Set the label + * @param type $label + */ + public function setLabel($label) + { + $this->label = $label; + } + + /** + * Get the object status + * @return type + */ + public function getStatus() + { + return $this->status; + } + + /** + * Set the status + * @param type $status + */ + public function setStatus($status) + { + $this->label = $status; + } + + /** + * Get a data using the id + * @param type $id + * @return null + */ + public function getData($id) + { + foreach($this->getAllDataObjects() as $data) + { + if ($data->getId() == $id) + { + return $data; + } + } + return null; + } + + /** + * Get all the data object + * @return type + */ + public function getAllDataObjects() + { + return $this->dataObjects; + } + + /** + * Add a data object + * @param type $data + */ + public function addData(DataObject &$data) + { + $this->dataObjects[$data->getId()] = $data; + } + + /** + * Delete a data object + * @param type $data + */ + public function deleteData(DataObject &$data) + { + unset( $this->datas[$data->getId()] ); + } +} + +?> diff --git a/newapi/models/SPO.php b/newapi/models/SPO.php new file mode 100644 index 00000000..6ccce543 --- /dev/null +++ b/newapi/models/SPO.php @@ -0,0 +1,75 @@ +<?php + +/** + * Subject Predicate Object + * I.E. This, has, that + */ +class SPO +{ + private $subject; + private $predicate; + private $object; + + public function __construct($subject, $predicate, $object) + { + $this->subject = $subject; + $this->predicate = $predicate; + $this->object = $object; + } + + /** + * Get the subject + * @return type + */ + public function getSubject() + { + return $this->subject; + } + + /** + * Get the predicate + * @return type + */ + public function getPredicate() + { + return $this->predicate; + } + + /** + * Get the object + * @return type + */ + public function getObject() + { + return $this->object; + } + + /** + * Set the subject + * @param type $value + */ + public function setSubject($value) + { + $this->subject = $value; + } + + /** + * Set the predicate + * @param type $value + */ + public function setPredicate($value) + { + $this->predicate = $value; + } + + /** + * Set the object + * @param type $value + */ + public function setObject($value) + { + $this->object = $value; + } +} + +?> From b60921adf42d6834b1a7b07249c683f8b975cb9b Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 27 Feb 2012 15:06:17 -0400 Subject: [PATCH 164/247] Switched queries from dc:title to fedora label --- CollectionClass.inc | 2 +- ContentModel.inc | 12 ++++++------ ObjectHelper.inc | 8 ++++---- api/fedora_collection.inc | 2 +- api/fedora_utils.inc | 4 ++-- fedora_repository.module | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 71710d78..f561295c 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -81,7 +81,7 @@ class CollectionClass { $query_string = $objectHelper->getStream($pid, 'QUERY', 0); if ($query_string == NULL) { $query_string = 'select $object $title $content from <#ri> - where ($object <dc:title> $title + where ($object <fedora-model:label> $title and $object <fedora-model:hasModel> $content and ($object <fedora-rels-ext:isMemberOfCollection> <info:fedora/' . $pid . '> or $object <fedora-rels-ext:isMemberOf> <info:fedora/' . $pid . '>) diff --git a/ContentModel.inc b/ContentModel.inc index cbacd422..444f485c 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -429,12 +429,12 @@ class ContentModel extends XMLDatastream { */ public function getServices() { $query = 'select $object $title from <#ri> - where ($object <dc:title> $title - and $object <fedora-model:isDeploymentOf> $deploymentOf - and $object <fedora-model:hasModel> <info:fedora/fedora-system:ServiceDeployment-3.0> - and $object <fedora-model:isContractorOf> <info:fedora/' . $this->pid . '> - and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) - order by $title'; + where ($object <fedora-model:label> $title + and $object <fedora-model:isDeploymentOf> $deploymentOf + and $object <fedora-model:hasModel> <info:fedora/fedora-system:ServiceDeployment-3.0> + and $object <fedora-model:isContractorOf> <info:fedora/' . $this->pid . '> + and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) + order by $title'; module_load_include('inc', 'fedora_repository', 'CollectionClass'); diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 8f58a3ab..1a8db575 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -729,7 +729,7 @@ class ObjectHelper { */ function get_parent_objects($pid) { $query_string = 'select $object $title from <#ri> - where ($object <dc:title> $title + where ($object <fedora-model:label> $title and <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $object and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; @@ -829,7 +829,7 @@ class ObjectHelper { // Get title and descriptions for $pid $query_string = 'select $title $desc from <#ri> - where $o <dc:title> $title + where $o <fedora-model:label> $title and $o <dc:description> $desc and $o <mulgara:is> <info:fedora/' . $pid . '>'; @@ -858,7 +858,7 @@ class ObjectHelper { $query_string = 'select $o $title from <#ri> ' . // $query_string = 'select $o $title $desc from <#ri> '. 'where $s <info:fedora/fedora-system:def/relations-external#hasMember> $o ' . - 'and $o <dc:title> $title ' . + 'and $o <fedora-model:label> $title ' . // 'and $o <dc:description> $desc '. 'and ( '; @@ -929,7 +929,7 @@ class ObjectHelper { } else { $query_string = 'select $parentObject $title $content from <#ri> - where (<info:fedora/' . $pid . '> <dc:title> $title + where (<info:fedora/' . $pid . '> <fedora-model:label> $title and $parentObject <fedora-model:hasModel> $content and (<info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject diff --git a/api/fedora_collection.inc b/api/fedora_collection.inc index a82bf39b..200fb324 100644 --- a/api/fedora_collection.inc +++ b/api/fedora_collection.inc @@ -77,7 +77,7 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb } $query_string = 'select $object $title $content from <#ri> - where ($object <dc:title> $title + where ($object <fedora-model:label> $title and $object <fedora-model:hasModel> $content and ('; diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index c2665fc7..eb56bdcc 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -239,7 +239,7 @@ function get_collections_as_option_array() { $allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:'); $namespaces = explode(':', $allowed_string); $query = 'select $object $title from <#ri> - where ($object <dc:title> $title + where ($object <fedora-model:label> $title and $object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/islandora:collectionCModel> and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) order by $title'; @@ -288,7 +288,7 @@ function get_content_models_as_option_array() { } } $query = 'select $object $title from <#ri> - where ($object <dc:title> $title + where ($object <fedora-model:label> $title and ($object <fedora-model:hasModel> <info:fedora/fedora-system:ContentModel-3.0> or $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:ContentModelsCollection>) and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) diff --git a/fedora_repository.module b/fedora_repository.module index f3412b54..1646ce4f 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1596,7 +1596,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $dc->set_element('dc:title', array('Installed Content Model')); $dc->save(); $cmodel_collection->add_datastream_from_string('select $object $title from <#ri> - where ($object <dc:title> $title + where ($object <fedora-model:label> $title and ($object <fedora-model:hasModel> <info:fedora/fedora-system:ContentModel-3.0> or $object <fedora-rels-ext:isMemberOfCollection> <info:fedora/islandora:ContentModelsCollection>) and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) From 34fa8851274f939970994807df35e251ad66cecf Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 27 Feb 2012 15:14:38 -0400 Subject: [PATCH 165/247] removed the api stuff that shouldn't have been pushed --- newapi/Cache.php | 76 ---------- newapi/Configuration.php | 58 -------- newapi/IslandoraModule.php | 37 ----- newapi/Repository.php | 264 ---------------------------------- newapi/Search.php | 37 ----- newapi/models/DataObject.php | 42 ------ newapi/models/ObjectModel.php | 119 --------------- newapi/models/SPO.php | 75 ---------- 8 files changed, 708 deletions(-) delete mode 100644 newapi/Cache.php delete mode 100644 newapi/Configuration.php delete mode 100644 newapi/IslandoraModule.php delete mode 100644 newapi/Repository.php delete mode 100644 newapi/Search.php delete mode 100644 newapi/models/DataObject.php delete mode 100644 newapi/models/ObjectModel.php delete mode 100644 newapi/models/SPO.php diff --git a/newapi/Cache.php b/newapi/Cache.php deleted file mode 100644 index 906fe804..00000000 --- a/newapi/Cache.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -/** - * Hashtable cache ( nothing special ) - * Should be replaced with something like - */ -class Cache -{ - private $objectList = array(); - - /** - * Add an object to the cache - * @param ObjectModel $object - */ - public function addObject(ObjectModel &$object) - { - if ( !isset($this->objectList[$object->getId()])) - { - $this->objectList[$object->getId()] = array(); - } - - $this->objectList[$object->getId()]['checksum'] = sha1(serialize($object)); - $this->objectList[$object->getId()]['object'] = $object; - } - - /** - * Check to see if the object has been updated - * @param ObjectModel $object - */ - public function hasChanged(ObjectModel &$object) - { - // Is the object even cached - if ( !isset($this->objectList[$object->getId()])) - { - return false; - } - - // Does it have the same checksum - if ($this->objectList[$object->getId()]['checksum'] == sha1(serialize($object)) ) - { - return true; - } - - // If they were the same then it would have already exited - return false; - } - - /** - * Get object from the cache. Returns null if not found. - * @param type $id - */ - public function getObject($id) - { - // Is the object cached - if ( isset($this->objectList[$id]['object'] ) ) { - - // Return the object from the cache - return $this->objectList[$id]['object']; - } - - // Object wasn't found so return null - return null; - } - - /** - * Remove the object from the cache - * @param type $id - */ - public function deleteObject($id) - { - // Unset it from the array - unset( $this->objectList[$id]); - } -} - -?> diff --git a/newapi/Configuration.php b/newapi/Configuration.php deleted file mode 100644 index 5f939715..00000000 --- a/newapi/Configuration.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * Basic config should be replaced with a specific implementation - */ -class Configuration -{ - private $baseUrl; - private $port; - - /** - * Default constructor - * @param type $base_url - * @param type $port - */ - public function __construct($base_url, $port) { - $this->$baseUrl = $base_url; - $this->$port = $port; - } - - /** - * Get the base url - * @return type - */ - public function getBaseURL() - { - return $this->$baseUrl; - } - - /** - * Set the base url - * @param type $url - */ - public function setBaseURL($url) - { - $this->$baseUrl = $url; - } - - /** - * Get the port - * @return type - */ - public function getPort() - { - return $this->$port; - } - - /** - * Set the port - * @param type $port - */ - public function setPort($port) - { - $this->$port = $port; - } -} - -?> diff --git a/newapi/IslandoraModule.php b/newapi/IslandoraModule.php deleted file mode 100644 index 8183415a..00000000 --- a/newapi/IslandoraModule.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * Islandora wrapper class to make everything easy to access - */ -class IslandoraModule -{ - private static $instance; - private $repository; - - /** - * Block people from creating the class - */ - private function __construct() - { - $this->repository = new Repository(new Configuration("127.0.0.1", 8080), new Search, new Cache()); - } - - /** - * Get the repository singleton - * @return type - */ - public static function instance() - { - if ( self::instance == null ) - { - $className = __CLASS__; - self::$instance = new $className; - // get_called_class only works in 5.3 - } - - // Return the link to the repository - return self::$instance->repository; - } -} - -?> diff --git a/newapi/Repository.php b/newapi/Repository.php deleted file mode 100644 index cfc34e6c..00000000 --- a/newapi/Repository.php +++ /dev/null @@ -1,264 +0,0 @@ -<?php - -/** - * Fedora repository - */ -class Repository -{ - private $config; - private $search; - private $cache; - - public function __construct(Configuration &$config, Search &$search, Cache &$cache) - { - // Store all the dependencies - $this->setConfig($config); - $this->setSearch($search); - $this->setCache($cache); - } - - /** - * Get the configuration implementation - * @return type - */ - public function getConfig() - { - return $this->config; - } - - /** - * Get the search implementation - * @return type - */ - public function getSearch() - { - return $this->search; - } - - /** - * Get the cache implementation - * @return type - */ - public function getCache() - { - return $this->cache; - } - - /** - * Set the configuration implementation - * @param Configuration $config - */ - public function setConfig(Configuration &$config) - { - if ( $config == null ) - { - throw new Exception("Config implementation can't be null"); - } - $this->config = $config; - } - - /** - * Set the search implementation - * @param Search $search - */ - public function setSearch(Search &$search) - { - if ( $search == null ) - { - throw new Exception("Search implementation can't be null"); - } - $this->search = $search; - } - - /** - * Set the cache implementation - * @param Cache $cache - */ - public function setCache(Cache &$cache) - { - if ( $cache == null ) - { - throw new Exception("Cache implementation can't be null"); - } - $this->cache = $cache; - } - - /** - * Get the object from the repo - * @param type $id - */ - public function loadObject($id, $cache=true) - { - // Check to see if its already cached - if ( $this->getCache()->getObject( $id ) && $cache = true) - { - // Return the cached object - return $this->getCache()->getObject( $id ); - } - - // Create the request - $results = $this->makeRequest( '/objects/' .$id ); - - // Return the object model - return unserialize($results); - } - - /** - * Save an object to the repository - * @param ObjectModel $model - * @param type $force - */ - public function saveObject(ObjectModel $model, $force=false) - { - // Has the object been created at all - if ( $model->getId() == null ) { - - // Get the next free persistent id - $id = $this->makeRequest( '/objects/nextPID' ); - - // Set the id on the model - $model->setId($id); - - } - - // If it hasn't changed then done't save unless it's forced - if ( ! $force && ! $this->getCache()->hasChanged($model) ) - { - return; - } - - // Add the object to the cache so everybody has the new copy - $this->getCache()->addObject($model); - - // Post the serialized model to the object endpoint - $this->makeRequest('/objects', $this->serialize($model)); - } - - /** - * Find an object using a search term - * @param type $term - * @return type - */ - public function findObjectByTerm($term) - { - // Create results - $results = $this->makeRequest('/objects?terms=' . $term); - - // Do something with results - return $results; - } - - /** - * Find an object with a query - * @param type $query - * @return type - */ - public function findObjectWithQuery($query) - { - // Create results - $results = $this->makeRequest('/objects?query=' . $term); - - // Do something with results - return $results; - } - - /** - * Search the repository using either a SPO or an array of SPOs - * @param type $query - */ - public function SearchSPO($SPO) - { - // Search - $results = $this->getSearch()->SearchSPO($SPO); - - // Do something with the results - return $results; - } - - /** - * Unserialize the object from foxml - * @param type $xml - * @return \ObjectModel - */ - protected function unserialize($xml) - { - // Create the object model - $model = new ObjectModel(); - - // Do something with the xml - $xml = $xml; - - // Return the model; - return $model; - } - - /** - * Serialize the object to foxml - * @param ObjectModel $model - * @return string - */ - protected function serialize(ObjectModel $model) - { - // Do something with the model - serialize($model); - - // return a string - return ""; - } - - /** - * Make a request - * @param type $request - * @return type - */ - private function makeRequest($request, array $postData = null, $responseCode=200, $format="xml") - { - // Check to see if we already have parameters - $pos = strpos($request, "?"); - if ($pos === false) { - $request.="?format=".$format; - } else { - $request.="&format=".$format; - } - - // Initialize Curl - $curl = curl_init(); - - // Set all the options - curl_setopt($curl, CURLOPT_URL, $this->getConfig()->getBaseURL() . $request); - curl_setopt($curl, CURLOPT_PORT , $this->getConfig()->getPort() ); - curl_setopt($curl, CURLOPT_VERBOSE, 1); - // If we have post data then append that - if ( $postData ) { - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } - - // Execute the curl call - $results = curl_exec($curl); - - // Check for an error - if( ! curl_errno($curl) ) { - - // Get information regarding the curl connection - $info = curl_getinfo($curl); - - // Check the response code - if ( $info['http_code'] != $responseCode ) - { - var_dump($results); - var_dump($info); - throw new Exception("Curl request failed"); - } else { - return $results; - } - } - - // Close connection - curl_close($curl); - - } // Close makeRequest - -} - - -?> diff --git a/newapi/Search.php b/newapi/Search.php deleted file mode 100644 index 406a68e5..00000000 --- a/newapi/Search.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - - -/** - * Basic search that uses RI but could be replaced with solr - */ -class Search -{ - /** - * Search the repository using either a SPO or an array of SPOs - * @param type $query - */ - public function SearchSPO($SPO) - { - $queryString = ""; - if (is_array($SPO)) - { - foreach($SPO as $spo) - { - $queryString .= $spo->getSubject() . " " . $spo->getPredicate() . " " . $spo->getObject() . ", "; - } - // Strip off the extra comma - $queryString = substr($queryString, '', -2); - } - else { - $queryString .= $SPO->getSubject() . " " . $SPO->getPredicate() . " " . $SPO->getObject(); - } - - // Do a search - $results = ""; - - // Return results; - return $results; - } -} - -?> diff --git a/newapi/models/DataObject.php b/newapi/models/DataObject.php deleted file mode 100644 index 55af4062..00000000 --- a/newapi/models/DataObject.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/** - * Repository Object Data - */ -class DataObject -{ - private $id; - - /** - * Get the object id - * @return type - */ - public function getId() - { - return $this->id; - } - - /** - * Set the idea if not already set - * @param type $id - * @throws Exception - */ - public function setId($id) - { - if ( $pid != null ) - { - throw new Exception("PID can't be changed"); - } - $this->id = $pid; - } - - /** - * Add the data from a file ( example ) - */ - public function addDataFromFile() - { - - } -} - -?> diff --git a/newapi/models/ObjectModel.php b/newapi/models/ObjectModel.php deleted file mode 100644 index 3ceb6da1..00000000 --- a/newapi/models/ObjectModel.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php - -/** - * Repository Object - * - * @todo Create an iterator for the datas - */ -class ObjectModel -{ - private $id; - private $label; - private $status; - private $dataObjects = array(); - - /** - * Get the object id - * @return type - */ - public function getId() - { - return $this->id; - } - - /** - * Set the idea if not already set - * @param type $id - * @throws Exception - */ - public function setId($id) - { - if ( $id != null ) - { - throw new Exception("ID can't be changed"); - } - $this->id = $id; - } - - /** - * Get the object label - * @return type - */ - public function getLabel() - { - return $this->label; - } - - /** - * Set the label - * @param type $label - */ - public function setLabel($label) - { - $this->label = $label; - } - - /** - * Get the object status - * @return type - */ - public function getStatus() - { - return $this->status; - } - - /** - * Set the status - * @param type $status - */ - public function setStatus($status) - { - $this->label = $status; - } - - /** - * Get a data using the id - * @param type $id - * @return null - */ - public function getData($id) - { - foreach($this->getAllDataObjects() as $data) - { - if ($data->getId() == $id) - { - return $data; - } - } - return null; - } - - /** - * Get all the data object - * @return type - */ - public function getAllDataObjects() - { - return $this->dataObjects; - } - - /** - * Add a data object - * @param type $data - */ - public function addData(DataObject &$data) - { - $this->dataObjects[$data->getId()] = $data; - } - - /** - * Delete a data object - * @param type $data - */ - public function deleteData(DataObject &$data) - { - unset( $this->datas[$data->getId()] ); - } -} - -?> diff --git a/newapi/models/SPO.php b/newapi/models/SPO.php deleted file mode 100644 index 6ccce543..00000000 --- a/newapi/models/SPO.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -/** - * Subject Predicate Object - * I.E. This, has, that - */ -class SPO -{ - private $subject; - private $predicate; - private $object; - - public function __construct($subject, $predicate, $object) - { - $this->subject = $subject; - $this->predicate = $predicate; - $this->object = $object; - } - - /** - * Get the subject - * @return type - */ - public function getSubject() - { - return $this->subject; - } - - /** - * Get the predicate - * @return type - */ - public function getPredicate() - { - return $this->predicate; - } - - /** - * Get the object - * @return type - */ - public function getObject() - { - return $this->object; - } - - /** - * Set the subject - * @param type $value - */ - public function setSubject($value) - { - $this->subject = $value; - } - - /** - * Set the predicate - * @param type $value - */ - public function setPredicate($value) - { - $this->predicate = $value; - } - - /** - * Set the object - * @param type $value - */ - public function setObject($value) - { - $this->object = $value; - } -} - -?> From e5027f60e3080e86915bc3d12521f44043a07860 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Mon, 27 Feb 2012 16:07:53 -0400 Subject: [PATCH 166/247] Added namespaces to relationship maninupulators for pagination --- api/fedora_item.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index d315f904..0a345723 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -6,6 +6,7 @@ */ define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#'); define("FEDORA_MODEL_URI", 'info:fedora/fedora-system:def/model#'); +define("ISLANDORA_PAGE_URI", 'info:islandora/islandora-system:def/pageinfo#'); /** * Fedora Item Class @@ -164,7 +165,6 @@ class Fedora_Item { return $returnvalue; } - /** * Wrapper to add new or modify existing datastream * @global url $base_url @@ -270,6 +270,10 @@ class Fedora_Item { $relationship = "hasModel"; $namespaceURI = FEDORA_MODEL_URI; break; + case "isPageNumber": + $relationship = "isPageNumber"; + $namespaceURI = ISLANDORA_PAGE_URI; + break; } if (substr($object, 0, 12) != 'info:fedora/') { From 0ba035d4da00f681247d91f0b018d9c307471a5d Mon Sep 17 00:00:00 2001 From: Nigel Banks <nigel.g.banks@gmail.com> Date: Tue, 28 Feb 2012 12:15:17 +0000 Subject: [PATCH 167/247] Cleaned up the function soap_call(). It was using watchdog incorrectly, causing the function to attempt to serialize non-serializable data. --- api/fedora_item.inc | 183 ++++++++++++++++++++------------------------ 1 file changed, 83 insertions(+), 100 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 7524ebbb..3367df43 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -1,7 +1,7 @@ <?php /** - * @file + * @file * Fedora Item */ define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#'); @@ -18,6 +18,22 @@ class Fedora_Item { public $datastreams = NULL; private static $connection_helper = NULL; private static $instantiated_pids = array(); + private static $SoapManagedFunctions = array( + 'ingest', + 'addDataStream', + 'addRelationship', + 'export', + 'getDatastream', + 'getDatastreamHistory', + 'getNextPID', + 'getRelationships', + 'modifyDatastreamByValue', + 'modifyDatastreamByReference', + 'purgeDatastream', + 'purgeObject', + 'modifyObject', + 'setDatastreamState' + ); /** * Create an object to represent an item in the Fedora repository. @@ -58,7 +74,7 @@ class Fedora_Item { /** * Forget this Object, do manually when memory constraints apply. - * + * * Removes this object from the static list of $instantiated_pids */ function forget() { @@ -66,8 +82,8 @@ class Fedora_Item { } /** - * Exists - * @return type + * Exists + * @return type */ function exists() { return (!empty($this->objectProfile)); @@ -81,7 +97,7 @@ class Fedora_Item { * @param type $datastream_mimetype * @param type $controlGroup * @param type $logMessage - * @return type + * @return type */ function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { module_load_include('inc', 'fedora_repository', 'MimeClass'); @@ -116,7 +132,7 @@ class Fedora_Item { * @param type $datastream_mimetype * @param type $controlGroup * @param type $logMessage - * @return type + * @return type */ function add_datastream_from_url($datastream_url, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { if (empty($datastream_label)) { @@ -151,7 +167,7 @@ class Fedora_Item { * @param type $datastream_mimetype * @param type $controlGroup * @param type $logMessage - * @return type + * @return type */ function add_datastream_from_string($str, $datastream_id, $datastream_label = NULL, $datastream_mimetype = 'text/xml', $controlGroup = 'M', $logMessage = NULL) { $dir = file_directory_temp(); @@ -164,9 +180,8 @@ class Fedora_Item { return $returnvalue; } - /** - * Wrapper to add new or modify existing datastream + * Wrapper to add new or modify existing datastream * @global url $base_url * @param url $external_url * @param string $dsid @@ -175,7 +190,7 @@ class Fedora_Item { * @param string $controlGroup * @param boolean $force * @param string $logMessage - * @param boolean $quiet + * @param boolean $quiet */ function add_or_modify_by_reference($external_url, $dsid, $label, $mime_type, $controlGroup = 'M', $force = FALSE, $logMessage = 'Modified by Islandora API', $quiet=FALSE) { global $base_url; @@ -193,7 +208,7 @@ class Fedora_Item { * does not support rels-int yet. * @param type $relationship * @param type $object - * @param type $namespaceURI + * @param type $namespaceURI */ function add_relationship($relationship, $object, $namespaceURI = RELS_EXT_URI) { $ds_list = $this->get_datastreams_list_as_array(); @@ -297,7 +312,7 @@ class Fedora_Item { /** * Export as foxml - * @return type + * @return type */ function export_as_foxml() { $params = array( @@ -378,7 +393,7 @@ class Fedora_Item { * Get datastream dissemination * @param type $dsid * @param type $as_of_date_time - * @return string + * @return string */ function get_datastream_dissemination($dsid, $as_of_date_time = "") { $params = array( @@ -401,7 +416,7 @@ class Fedora_Item { * Get datastream * @param type $dsid * @param type $as_of_date_time - * @return type + * @return type */ function get_datastream($dsid, $as_of_date_time = "") { $params = array( @@ -417,7 +432,7 @@ class Fedora_Item { /** * Get datastream history * @param type $dsid - * @return type + * @return type */ function get_datastream_history($dsid) { $params = array( @@ -439,7 +454,7 @@ class Fedora_Item { * @param type $method_name * @param type $parameters * @param type $as_of_date_time - * @return string + * @return string */ function get_dissemination($service_definition_pid, $method_name, $parameters = array(), $as_of_date_time = NULL) { $params = array( @@ -658,18 +673,16 @@ class Fedora_Item { return FALSE; } - + /** * Set the object to a deleted state */ - function move_to_trash($log_message = 'Flagged deleted using Islandora API.') - { + function move_to_trash($log_message = 'Flagged deleted using Islandora API.') { // Loop through the datastreams and mark them deleted - foreach($this->get_datastreams_list_as_array() as $dsid) - { + foreach ($this->get_datastreams_list_as_array() as $dsid) { $this->set_datastream_state($dsid, 'D'); } - + // Create a message to mark the object deleted $params = array( 'pid' => $this->pid, @@ -685,13 +698,13 @@ class Fedora_Item { * Removes this object form the repository. * @param type $log_message * @param type $force - * @return type + * @return type */ function purge($log_message = 'Purged using Islandora API.', $force = FALSE) { - + // Flag the object to be deleted first $this->move_to_trash($log_message); - + // Create the delete message $params = array( 'pid' => $this->pid, @@ -710,7 +723,7 @@ class Fedora_Item { * @param type $end_date * @param type $log_message * @param type $force - * @return type + * @return type */ function purge_datastream($dsID, $start_date = NULL, $end_date = NULL, $log_message = 'Purged datastream using Islandora API', $force = FALSE) { $params = array( @@ -727,7 +740,7 @@ class Fedora_Item { /** * URL * @global type $base_url - * @return type + * @return type */ function url() { global $base_url; @@ -737,7 +750,7 @@ class Fedora_Item { /** * Get Next PID in Namespace * @param type $pid_namespace - * @return type + * @return type */ static function get_next_PID_in_namespace($pid_namespace = '') { @@ -765,7 +778,7 @@ class Fedora_Item { /** * ingest from FOXML * @param type $foxml - * @return Fedora_Item + * @return Fedora_Item */ static function ingest_from_FOXML($foxml) { $params = array('objectXML' => $foxml->saveXML(), 'format' => "info:fedora/fedora-system:FOXML-1.1", 'logMessage' => "Fedora Object Ingested"); @@ -776,7 +789,7 @@ class Fedora_Item { /** * ingest from FOXML file * @param type $foxml_file - * @return type + * @return type */ static function ingest_from_FOXML_file($foxml_file) { $foxml = new DOMDocument(); @@ -786,7 +799,7 @@ class Fedora_Item { /** * ingest from FOXML files in directory - * @param type $path + * @param type $path */ static function ingest_from_FOXML_files_in_directory($path) { // Open the directory @@ -814,7 +827,7 @@ class Fedora_Item { * @param type $ownerId * @param type $logMessage * @param type $quiet - * @return type + * @return type */ function modify_object($label = '', $state = NULL, $ownerId = NULL, $logMessage = 'Modified by Islandora API', $quiet=TRUE) { @@ -838,7 +851,7 @@ class Fedora_Item { * @param type $force * @param type $logMessage * @param type $quiet - * @return type + * @return type */ function modify_datastream_by_reference($external_url, $dsid, $label, $mime_type, $force = FALSE, $logMessage = 'Modified by Islandora API', $quiet=FALSE) { $params = array( @@ -866,7 +879,7 @@ class Fedora_Item { * @param type $force * @param type $logMessage * @param type $quiet - * @return type + * @return type */ function modify_datastream_by_value($content, $dsid, $label, $mime_type, $force = FALSE, $logMessage = 'Modified by Islandora API', $quiet=FALSE) { $params = array( @@ -899,74 +912,44 @@ class Fedora_Item { } /** - * Soap call - * @param type $function_name - * @param type $params_array - * @param type $quiet - * @return type + * Make a soap call to the fedora API. + * + * @param string $function + * The name of the soap function to call. + * @param array $parameters + * Paramters to pass onto the soap call + * @param boolean $quiet + * If TRUE suppress drupal messages. + * + * @return mixed + * The return value from the soap function if successful, NULL otherwise. */ - static function soap_call($function_name, $params_array, $quiet = FALSE) { + static function soap_call($function, $parameters, $quiet = FALSE) { if (!self::$connection_helper) { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); self::$connection_helper = new ConnectionHelper(); } - switch ($function_name) { - case 'ingest': - case 'addDataStream': - case 'addRelationship': - case 'export': - case 'getDatastream': - case 'getDatastreamHistory': - case 'getNextPID': - case 'getRelationships': - case 'modifyDatastreamByValue': - case 'modifyDatastreamByReference': - case 'purgeDatastream': - case 'purgeObject': - case 'modifyObject': - case 'setDatastreamState': - $soap_client = self::$connection_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); - try { - if (!empty($soap_client)) { - $result = $soap_client->__soapCall($function_name, array('parameters' => $params_array)); - } - else { - watchdog(t("FEDORA_REPOSITORY"), "Error trying to get SOAP client connection."); - return NULL; - } - } catch (exception $e) { - if (!$quiet) { - - if (preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage())) { - drupal_set_message(t('Error: Insufficient permissions to call SOAP function !fn.', array('!fn' => $function_name)), 'error'); - } - else { - drupal_set_message(t("Error trying to call SOAP function $function_name. Check watchdog logs for more information."), 'error'); - } - - watchdog(t("FEDORA_REPOSITORY"), "Error Trying to call SOAP function @fn: @e", array('@fn' => $function_name, '@e' => $e), NULL, WATCHDOG_ERROR); - } - return NULL; - } - break; - - default: - try { - $soap_client = self::$connection_helper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); - if (!empty($soap_client)) { - $result = $soap_client->__soapCall($function_name, array('parameters' => $params_array)); - } - else { - watchdog(t("FEDORA_REPOSITORY"), "Error trying to get SOAP client connection."); - return NULL; - } - } catch (exception $e) { - - if (!$quiet) { - watchdog(t("FEDORA_REPOSITORY"), "Error trying to call SOAP function @fn: @e", array('@fn' => $function_name, '@e' => $e), NULL, WATCHDOG_ERROR); - } - return NULL; + $url = (array_search($function, self::$SoapManagedFunctions) !== FALSE) ? + variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl') : + variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'); + try { + $soap_client = self::$connection_helper->getSoapClient($url); + if (empty($soap_client)) { + if (!$quiet) { + drupal_set_message(t('Error trying to get SOAP client connection.')); } + watchdog('fedora_repository', 'Error trying to get SOAP client connection.'); + return NULL; + } + $result = $soap_client->__soapCall($function, array('parameters' => $parameters)); + } catch (Exception $e) { + if (!$quiet) { + preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage()) ? + drupal_set_message(t('Insufficient permissions to call SOAP function "%func".', array('%func' => $function)), 'error') : + drupal_set_message(t('Error trying to call SOAP function "%func". Check watchdog logs for more information.', array('%func' => $function)), 'error'); + } + watchdog('fedora_repository', 'Error Trying to call SOAP function "%func". Exception Occured: @e', array('%func' => $function, '@e' => $e->getMessage()), NULL, WATCHDOG_ERROR); + return NULL; } return $result; } @@ -979,7 +962,7 @@ class Fedora_Item { * @param string $state The initial state, A - Active, I - Inactive, D - Deleted * @param type $label * @param type $owner - * @return DOMDocument + * @return DOMDocument */ static function create_object_FOXML($pid = '', $state = 'A', $label = 'Untitled', $owner = '') { $foxml = new DOMDocument("1.0", "UTF-8"); @@ -1034,16 +1017,16 @@ class Fedora_Item { * @param type $state * @param type $label * @param type $owner - * @return type + * @return type */ static function ingest_new_item($pid = '', $state = 'A', $label = '', $owner = '') { return self::ingest_from_FOXML(self::create_object_FOXML($pid, $state, $label, $owner)); } /** - * fedora item exists + * fedora item exists * @param type $pid - * @return type + * @return type */ static function fedora_item_exists($pid) { $item = new Fedora_Item($pid); From 7715ec1f1d03c8c4231e73f6beecbee7d83dcd46 Mon Sep 17 00:00:00 2001 From: rwincewicz <richard.wincewicz@googlemail.com> Date: Thu, 1 Mar 2012 17:13:38 -0400 Subject: [PATCH 168/247] Removed object labels from the URLs created in sparql_to_html.xsl to prevent unnecessarily long paths and stop diacritics from breaking the default collection view --- xsl/sparql_to_html.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index a4a4f934..99045659 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -173,7 +173,7 @@ <xsl:otherwise> <!--the below is an example of going straight to a datastream instead of the details page. <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="s:title"/>--> - <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="$cleanTitle"/> + <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/> </xsl:otherwise> </xsl:choose> <xsl:value-of select="s:content"/> From 6bd33358edcd1dd5b50df44e52e61762e896498f Mon Sep 17 00:00:00 2001 From: Nigel Banks <nigel.g.banks@gmail.com> Date: Fri, 2 Mar 2012 17:38:49 +0000 Subject: [PATCH 169/247] Using fedora item instead of object helper in some cause to prevent exceptions such as object not found in lower level storage. --- CollectionClass.inc | 24 ++++++++++++++---------- api/fedora_item.inc | 10 ++++++---- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index f561295c..08f669e0 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -45,11 +45,12 @@ class CollectionClass { * @return type */ function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - $objectHelper = new ObjectHelper(); if (!isset($itqlquery)) { - // $query_string = $objectHelper->getStream($pid, 'QUERY', 0); - $itqlquery = $objectHelper->getStream($pid, 'QUERY', 0); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $item = new Fedora_Item($pid); + if ($item->exists() && array_key_exists('QUERY', $item->datastreams)) { + $itqlquery = $item->get_datastream_dissemination('QUERY'); + } } return $this->getRelatedItems($pid, $itqlquery, $limit, $offset); } @@ -78,7 +79,11 @@ class CollectionClass { $objectHelper = new ObjectHelper(); $query_string = $itqlquery; if (!isset($query_string)) { - $query_string = $objectHelper->getStream($pid, 'QUERY', 0); + $query_string = NULL; + $item = new Fedora_Item($pid); + if ($item->exists() && array_key_exists('QUERY', $item->datastreams)) { + $query_string = $item->get_datastream_dissemination('QUERY'); + } if ($query_string == NULL) { $query_string = 'select $object $title $content from <#ri> where ($object <fedora-model:label> $title @@ -445,7 +450,7 @@ class CollectionClass { 'pidNamespace' => $pidNameSpace ); $object = $soapClient->__soapCall('getNextPID', array( - $params + $params )); } catch (exception $e) { drupal_set_message(t('Error getting Next PID: @e', array('@e' => check_plain($e->getMessage()))), 'error'); @@ -498,11 +503,10 @@ class CollectionClass { module_load_include('inc', 'fedora_repository', 'CollectionManagement'); module_load_include('inc', 'fedora_repository', 'BatchIngest'); global $base_url; - $tabset = array(); global $user; - $objectHelper = new ObjectHelper(); - $item = new Fedora_Item($this->pid); + $tabset = array(); $query = NULL; + $item = new Fedora_Item($this->pid); if ($item->exists() && array_key_exists('QUERY', $item->datastreams)) { $query = $item->get_datastream_dissemination('QUERY'); } @@ -517,7 +521,7 @@ class CollectionClass { $show_batch_tab = FALSE; $policy = CollectionPolicy::loadFromCollection($this->pid, TRUE); - if(!empty($policy)){ + if (!empty($policy)) { $content_models = $policy->getContentModels(); } if (count($content_models) == 1 && $content_models[0]->pid == "islandora:collectionCModel") { diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 3367df43..afc110bd 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -934,21 +934,23 @@ class Fedora_Item { variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'); try { $soap_client = self::$connection_helper->getSoapClient($url); - if (empty($soap_client)) { + if (isset($soap_client)) { + $result = $soap_client->__soapCall($function, array('parameters' => $parameters)); + } + else { if (!$quiet) { - drupal_set_message(t('Error trying to get SOAP client connection.')); + drupal_set_message(t('Error trying to get SOAP client connection')); } watchdog('fedora_repository', 'Error trying to get SOAP client connection.'); return NULL; } - $result = $soap_client->__soapCall($function, array('parameters' => $parameters)); } catch (Exception $e) { if (!$quiet) { preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage()) ? drupal_set_message(t('Insufficient permissions to call SOAP function "%func".', array('%func' => $function)), 'error') : drupal_set_message(t('Error trying to call SOAP function "%func". Check watchdog logs for more information.', array('%func' => $function)), 'error'); } - watchdog('fedora_repository', 'Error Trying to call SOAP function "%func". Exception Occured: @e', array('%func' => $function, '@e' => $e->getMessage()), NULL, WATCHDOG_ERROR); + watchdog('fedora_repository', 'Error Trying to call SOAP function "%func". Exception: @e in @f(@l)\n@t', array('%func' => $function, '@e' => $e->getMessage(), '@f' => $e->getFile(), '@l' => $e->getLine(), '@t' => $e->getTraceAsString()), NULL, WATCHDOG_ERROR); return NULL; } return $result; From 2f979ab447565b881ef058866ac053940ecf50c2 Mon Sep 17 00:00:00 2001 From: Nigel Banks <nigel.g.banks@gmail.com> Date: Fri, 2 Mar 2012 17:45:20 +0000 Subject: [PATCH 170/247] Found incorrect use of watchdog. --- ObjectHelper.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 1a8db575..e8555635 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -383,8 +383,8 @@ class ObjectHelper { $xsl->load($path . '/xsl/convertQDC.xsl'); $input = new DomDocument(); $input->loadXML(trim($xmlstr)); - } catch (exception $e) { - watchdog(t("Fedora_Repository"), "Problem loading XSL file: @e", array('@e' => $e), NULL, WATCHDOG_ERROR); + } catch (Exception $e) { + watchdog('fedora_repository', "Problem loading XSL file: @e", array('@e' => $e->getMessage()), NULL, WATCHDOG_ERROR); } $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); From 741a1727242c9d9941ce64e80bc75711b187fafb Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 5 Mar 2012 11:13:44 -0400 Subject: [PATCH 171/247] Added solution pack install boilerplate --- fedora_repository.solutionpacks.inc | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 756f8bf0..c45f475a 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -200,3 +200,54 @@ function solution_pack_add_form_association($content_model, $form_name) { } } +/** + * Solution pack install helper + * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" + * @param type $mods_form_file The MODS form file name relative to the module (solutionpack/xml/mods_article.xml) + * @param type $content_model The Content Model (islandora:docs_sp_cm) + */ +function solution_pack_installer($mods_form_name, $mods_form_file, $content_model) +{ + module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); + + if (!XMLFormDatabase::Exists($mods_form_name)) { + //$module_path = drupal_get_path('module', ISLANDORA_SP_MODULE_NAME); + $definition = new DOMDocument(); + $definition->load($mods_form_file); + XMLFormDatabase::Create($mods_form_name, $definition); + } + + // Associates the form with the content model + $result = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name)); + + if (!$result) { + $object = new stdClass(); + $object->content_model = $content_model; + $object->form_name = $mods_form_name; + $object->dsid = 'MODS'; + $object->title_field = "['titleInfo']['title']"; + $object->transform = 'mods_to_dc.xsl'; + $result = drupal_write_record('islandora_content_model_forms', $object); + } +} + +/** + * Solution Pack Uninstall Helper + * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" + * @param type $mods_form_file The MODS form file name relative to the module (solutionpack/xml/mods_article.xml) + * @param type $content_model The Content Model (islandora:docs_sp_cm) + */ +function solution_pack_uninstaller($mods_form_name, $mods_form_name, $content_model) +{ + module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); + + if (XMLFormDatabase::Exists($mods_form_name)) { + XMLFormDatabase::Delete($mods_form_name); + } + + $result = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name)); + + if (!$result) { + db_query('DELETE FROM {islandora_content_model_forms} WHERE content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name); + } +} From 800407ec54029acb876031f6549b8e45d1e1c08c Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 5 Mar 2012 11:47:59 -0400 Subject: [PATCH 172/247] Renamed the files to something more appropriate --- fedora_repository.solutionpacks.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index c45f475a..64dc78bb 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -201,12 +201,12 @@ function solution_pack_add_form_association($content_model, $form_name) { } /** - * Solution pack install helper + * Solution pack register form * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" * @param type $mods_form_file The MODS form file name relative to the module (solutionpack/xml/mods_article.xml) * @param type $content_model The Content Model (islandora:docs_sp_cm) */ -function solution_pack_installer($mods_form_name, $mods_form_file, $content_model) +function solution_pack_register_form($mods_form_name, $mods_form_file, $content_model) { module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); @@ -232,12 +232,12 @@ function solution_pack_installer($mods_form_name, $mods_form_file, $content_mode } /** - * Solution Pack Uninstall Helper + * Solution pack unregister form * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" * @param type $mods_form_file The MODS form file name relative to the module (solutionpack/xml/mods_article.xml) * @param type $content_model The Content Model (islandora:docs_sp_cm) */ -function solution_pack_uninstaller($mods_form_name, $mods_form_name, $content_model) +function solution_pack_unregister_form($mods_form_name, $mods_form_name, $content_model) { module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); From 9948737d7c585ff4297477a688023b92b32e342e Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 5 Mar 2012 12:20:28 -0400 Subject: [PATCH 173/247] Added a force reinstall option --- fedora_repository.solutionpacks.inc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 64dc78bb..b7edc8ab 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -205,16 +205,28 @@ function solution_pack_add_form_association($content_model, $form_name) { * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" * @param type $mods_form_file The MODS form file name relative to the module (solutionpack/xml/mods_article.xml) * @param type $content_model The Content Model (islandora:docs_sp_cm) + * @param boolean $force Force a reinstall */ -function solution_pack_register_form($mods_form_name, $mods_form_file, $content_model) +function solution_pack_register_form($mods_form_name, $mods_form_file, $content_model, $force=false) { + // Load the form builder database module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); + + // Load the form + $definition = new DOMDocument(); + $definition->load($mods_form_file); - if (!XMLFormDatabase::Exists($mods_form_name)) { - //$module_path = drupal_get_path('module', ISLANDORA_SP_MODULE_NAME); - $definition = new DOMDocument(); - $definition->load($mods_form_file); + // If it doesn't exist + if (!XMLFormDatabase::Exists($mods_form_name) ) { + + // Create the form XMLFormDatabase::Create($mods_form_name, $definition); + + // Force Update of an existing form + } elseif ( $force == true ) { + + // Update the form + XMLFormDatabase::Update($mods_form_name, $definition); } // Associates the form with the content model @@ -234,10 +246,9 @@ function solution_pack_register_form($mods_form_name, $mods_form_file, $content_ /** * Solution pack unregister form * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" - * @param type $mods_form_file The MODS form file name relative to the module (solutionpack/xml/mods_article.xml) * @param type $content_model The Content Model (islandora:docs_sp_cm) */ -function solution_pack_unregister_form($mods_form_name, $mods_form_name, $content_model) +function solution_pack_unregister_form($mods_form_name, $content_model) { module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); From 783e2da0c86117ab8456b4daff31efabd2047c01 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 5 Mar 2012 12:30:33 -0400 Subject: [PATCH 174/247] Cleaned up, added a force and fixed a bug in the delete --- fedora_repository.solutionpacks.inc | 37 +++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index b7edc8ab..bdd36132 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -211,34 +211,43 @@ function solution_pack_register_form($mods_form_name, $mods_form_file, $content_ { // Load the form builder database module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); - - // Load the form - $definition = new DOMDocument(); - $definition->load($mods_form_file); - + // If it doesn't exist if (!XMLFormDatabase::Exists($mods_form_name) ) { + + // Load the form + $definition = new DOMDocument(); + $definition->load($mods_form_file); // Create the form XMLFormDatabase::Create($mods_form_name, $definition); // Force Update of an existing form } elseif ( $force == true ) { + + // Load the form + $definition = new DOMDocument(); + $definition->load($mods_form_file); // Update the form XMLFormDatabase::Update($mods_form_name, $definition); } - // Associates the form with the content model - $result = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name)); + // Check to see if the form has already been registered + $result = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name)); + // Check for results if (!$result) { + + // Create a model for the database $object = new stdClass(); $object->content_model = $content_model; $object->form_name = $mods_form_name; $object->dsid = 'MODS'; $object->title_field = "['titleInfo']['title']"; $object->transform = 'mods_to_dc.xsl'; + + // Write the association $result = drupal_write_record('islandora_content_model_forms', $object); } } @@ -250,15 +259,23 @@ function solution_pack_register_form($mods_form_name, $mods_form_file, $content_ */ function solution_pack_unregister_form($mods_form_name, $content_model) { + // Load the form builders xmlformdatabase module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); + // Check to see if the form exists if (XMLFormDatabase::Exists($mods_form_name)) { + + // Delete the form XMLFormDatabase::Delete($mods_form_name); } - + + // Check to see if the form has already been registered $result = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name)); - - if (!$result) { + + // Is there anything to delete + if ($result) { + + // Delete the association db_query('DELETE FROM {islandora_content_model_forms} WHERE content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name); } } From 0a13bf248fb509b7a0c2fa23719f0ed9fd819834 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 5 Mar 2012 13:13:50 -0400 Subject: [PATCH 175/247] We now use the database to store instead of xmlformdatabase and a force has been added --- fedora_repository.solutionpacks.inc | 132 ++++++++++++++++------------ 1 file changed, 76 insertions(+), 56 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index bdd36132..34a4b33d 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -181,7 +181,7 @@ function solution_pack_add_form($form_name, $form_xml) { $object->name = $form_name; $object->form = $form_xml; $result = drupal_write_record('xml_forms', $object); - drupal_set_message(t("Added @name", array("@name" => $name))); + drupal_set_message(t("Added @name", array("@name" => $form_name))); } } @@ -196,7 +196,7 @@ function solution_pack_add_form_association($content_model, $form_name) { $object->title_field = "['titleInfo']['title']"; $object->transform = 'mods_to_dc.xsl'; $result = drupal_write_record('islandora_content_model_forms', $object); - drupal_set_message(t("Added association between @cm@name", array("@cm" => $content_model, "@name"=>$name))); + drupal_set_message(t("Added association between @cm@name", array("@cm" => $content_model, "@name"=>$form_name))); } } @@ -204,78 +204,98 @@ function solution_pack_add_form_association($content_model, $form_name) { * Solution pack register form * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" * @param type $mods_form_file The MODS form file name relative to the module (solutionpack/xml/mods_article.xml) - * @param type $content_model The Content Model (islandora:docs_sp_cm) - * @param boolean $force Force a reinstall + * @return int 0 = Ok and 1 = Unable to load file */ -function solution_pack_register_form($mods_form_name, $mods_form_file, $content_model, $force=false) +function solution_pack_register_form($mods_form_name, $mods_form_file, $force=false) { - // Load the form builder database - module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); - - // If it doesn't exist - if (!XMLFormDatabase::Exists($mods_form_name) ) { + // Lookup the form + $results = db_result(db_query('Select name from {xml_forms} where name = "%s"', $mods_form_name)); + + // Check to see if there is anything to do + if ( $results && $force==false) { - // Load the form - $definition = new DOMDocument(); - $definition->load($mods_form_file); - - // Create the form - XMLFormDatabase::Create($mods_form_name, $definition); - - // Force Update of an existing form - } elseif ( $force == true ) { - - // Load the form - $definition = new DOMDocument(); - $definition->load($mods_form_file); + // Nothing to do so early out + return 0; + } + + // Get the contents of the file + $mods_form_data = file_get_contents($mods_form_file); + + // Didn't load the file + if ( ! $mods_form_data ) { - // Update the form - XMLFormDatabase::Update($mods_form_name, $definition); + // Return an error + return 1; } - - // Check to see if the form has already been registered - $result = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name)); - // Check for results - if (!$result) { + // Create the data model + $object = new stdClass(); + $object->name = $mods_form_name; + $object->form = $mods_form_data; + + // Are we adding the form + if ( ! $results ) { - // Create a model for the database - $object = new stdClass(); - $object->content_model = $content_model; - $object->form_name = $mods_form_name; - $object->dsid = 'MODS'; - $object->title_field = "['titleInfo']['title']"; - $object->transform = 'mods_to_dc.xsl'; + // Add the model to the database + $result = drupal_write_record('xml_forms', $object); - // Write the association - $result = drupal_write_record('islandora_content_model_forms', $object); + } else { + + // Update the model in the database + $result = drupal_write_record('xml_forms', $object, array("name" => $mods_form_name)); } + + // Log the action + drupal_set_message(t("Added @name", array("@name" => $mods_form_name))); } /** - * Solution pack unregister form + * Solution pack register form * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" * @param type $content_model The Content Model (islandora:docs_sp_cm) */ -function solution_pack_unregister_form($mods_form_name, $content_model) -{ - // Load the form builders xmlformdatabase - module_load_include('inc', 'xml_form_builder', 'XMLFormDatabase'); - - // Check to see if the form exists - if (XMLFormDatabase::Exists($mods_form_name)) { +function solution_pack_register_form_association($mods_form_name, $content_model, $force=false) { + + // Query the database for previous associations + $results = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', + $content_model, $mods_form_name)); + + // Check to see if there is anything to do + if ( $results && $force==false) { - // Delete the form - XMLFormDatabase::Delete($mods_form_name); + // Nothing to do so early out + return; } - // Check to see if the form has already been registered - $result = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name)); + // Create a model for the database + $object = new stdClass(); + $object->content_model = $content_model; + $object->form_name = $mods_form_name; + $object->dsid = 'MODS'; + $object->title_field = "['titleInfo']['title']"; + $object->transform = 'mods_to_dc.xsl'; - // Is there anything to delete - if ($result) { + // Are we adding the form association + if ( ! $results ) { - // Delete the association - db_query('DELETE FROM {islandora_content_model_forms} WHERE content_model = "%s" and form_name = "%s"', $content_model, $mods_form_name); - } + // Add the association + $result = drupal_write_record('islandora_content_model_forms', $object); + } else { + + // Update the association + $result = drupal_write_record('islandora_content_model_forms', $object, array("content_model" => $content_model)); + } + + // Log the action + drupal_set_message(t("Added association between @cm@name", array("@cm" => $content_model, "@name"=>$mods_form_name))); +} + +/** + * Solution pack unregister form + * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" + * @param type $content_model The Content Model (islandora:docs_sp_cm) + */ +function solution_pack_unregister_form($mods_form_name, $content_model) +{ + } From f153548f0740eb7c3176d7feef345e03bca97997 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 5 Mar 2012 13:27:41 -0400 Subject: [PATCH 176/247] Added delete calls --- fedora_repository.solutionpacks.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 34a4b33d..59e2f6da 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -290,12 +290,21 @@ function solution_pack_register_form_association($mods_form_name, $content_model drupal_set_message(t("Added association between @cm@name", array("@cm" => $content_model, "@name"=>$mods_form_name))); } +/** + * Solution pack unregister form + * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" + */ +function solution_pack_unregister_form($mods_form_name) +{ + +} + /** * Solution pack unregister form * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" * @param type $content_model The Content Model (islandora:docs_sp_cm) */ -function solution_pack_unregister_form($mods_form_name, $content_model) +function solution_pack_unregister_form_association($mods_form_name, $content_model) { } From 63ac3d44d30327e6af1660766a5385d5d2c6eb8d Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 5 Mar 2012 16:36:19 -0400 Subject: [PATCH 177/247] Added a new sp architecture based around alans ideas --- fedora_repository.newsp.inc | 11 +++++++++++ fedora_repository.solutionpacks.inc | 2 ++ formClass.inc | 11 ++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 fedora_repository.newsp.inc diff --git a/fedora_repository.newsp.inc b/fedora_repository.newsp.inc new file mode 100644 index 00000000..98e6d3e0 --- /dev/null +++ b/fedora_repository.newsp.inc @@ -0,0 +1,11 @@ +<?php + +function fedora_repository_newsp_page() +{ + $solution_packs = array(); + $enabled_solution_packs = module_invoke_all('setup_defaults', $solution_packs); + var_dump($solution_packs); + var_dump($enabled_solution_packs); +} + +?> diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 59e2f6da..f8f4bdd5 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -308,3 +308,5 @@ function solution_pack_unregister_form_association($mods_form_name, $content_mod { } + + diff --git a/formClass.inc b/formClass.inc index 86a5128f..4ac1c246 100644 --- a/formClass.inc +++ b/formClass.inc @@ -48,7 +48,16 @@ class formClass { 'file' => 'fedora_repository.solutionpacks.inc', 'type' => MENU_LOCAL_TASK, ); - + + $items['admin/settings/fedora_repository/newsp'] = array( + 'title' => t('New Solution Packs'), + 'description' => t('Install content models and collections required by installed solution packs.'), + 'page callback' => 'fedora_repository_newsp_page', + 'access arguments' => array('add fedora datastreams'), + 'file' => 'fedora_repository.newsp.inc', + 'type' => MENU_LOCAL_TASK, + ); + $items['islandoracm.xsd'] = array( 'title' => t('Islandora Content Model XML Schema Definition'), 'page callback' => 'fedora_repository_display_schema', From bac9026c93fdaa5de361c7bb2b50b01eb0037a40 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 6 Mar 2012 10:30:11 -0400 Subject: [PATCH 178/247] cleanup my solution pack code --- fedora_repository.newsp.inc | 11 ----------- formClass.inc | 10 ---------- 2 files changed, 21 deletions(-) delete mode 100644 fedora_repository.newsp.inc diff --git a/fedora_repository.newsp.inc b/fedora_repository.newsp.inc deleted file mode 100644 index 98e6d3e0..00000000 --- a/fedora_repository.newsp.inc +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -function fedora_repository_newsp_page() -{ - $solution_packs = array(); - $enabled_solution_packs = module_invoke_all('setup_defaults', $solution_packs); - var_dump($solution_packs); - var_dump($enabled_solution_packs); -} - -?> diff --git a/formClass.inc b/formClass.inc index 4ac1c246..09bfce8b 100644 --- a/formClass.inc +++ b/formClass.inc @@ -48,16 +48,6 @@ class formClass { 'file' => 'fedora_repository.solutionpacks.inc', 'type' => MENU_LOCAL_TASK, ); - - $items['admin/settings/fedora_repository/newsp'] = array( - 'title' => t('New Solution Packs'), - 'description' => t('Install content models and collections required by installed solution packs.'), - 'page callback' => 'fedora_repository_newsp_page', - 'access arguments' => array('add fedora datastreams'), - 'file' => 'fedora_repository.newsp.inc', - 'type' => MENU_LOCAL_TASK, - ); - $items['islandoracm.xsd'] = array( 'title' => t('Islandora Content Model XML Schema Definition'), 'page callback' => 'fedora_repository_display_schema', From 5cb3023204d9c582fe5008aa9730726d3e6629d6 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Tue, 6 Mar 2012 12:48:44 -0400 Subject: [PATCH 179/247] Get rid of useless instantiations --- fedora_repository.module | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 1646ce4f..2a0dbde9 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -149,8 +149,7 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { if ($form_state['storage']['xml']) { if (module_exists('islandora_content_model_forms')) { module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); - $xml_form = new IngestObjectMetadataForm(); - $xml_form->submit($form, $form_state); + IngestObjectMetadataForm::submit($form, $form_state); } } elseif ($form_state['clicked_button']['#id'] == 'edit-submit') { @@ -812,8 +811,7 @@ function fedora_repository_edit_qdc_form_validate($form, &$form_state) { function fedora_repository_edit_qdc_form_submit($form, &$form_state) { if ($form_state['storage']['xml']) { module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); - $xml_form = new EditObjectMetadataForm($form_state); - $xml_form->submit($form, $form_state); + EditObjectMetadataForm::submit($form, $form_state); } else { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); From 286354196927f0b88d6f4734dec24bacf5470226 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 6 Mar 2012 16:11:44 -0400 Subject: [PATCH 180/247] removed register functions --- fedora_repository.solutionpacks.inc | 110 ---------------------------- 1 file changed, 110 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index f8f4bdd5..1ee956f1 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -200,113 +200,3 @@ function solution_pack_add_form_association($content_model, $form_name) { } } -/** - * Solution pack register form - * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" - * @param type $mods_form_file The MODS form file name relative to the module (solutionpack/xml/mods_article.xml) - * @return int 0 = Ok and 1 = Unable to load file - */ -function solution_pack_register_form($mods_form_name, $mods_form_file, $force=false) -{ - // Lookup the form - $results = db_result(db_query('Select name from {xml_forms} where name = "%s"', $mods_form_name)); - - // Check to see if there is anything to do - if ( $results && $force==false) { - - // Nothing to do so early out - return 0; - } - - // Get the contents of the file - $mods_form_data = file_get_contents($mods_form_file); - - // Didn't load the file - if ( ! $mods_form_data ) { - - // Return an error - return 1; - } - - // Create the data model - $object = new stdClass(); - $object->name = $mods_form_name; - $object->form = $mods_form_data; - - // Are we adding the form - if ( ! $results ) { - - // Add the model to the database - $result = drupal_write_record('xml_forms', $object); - - } else { - - // Update the model in the database - $result = drupal_write_record('xml_forms', $object, array("name" => $mods_form_name)); - } - - // Log the action - drupal_set_message(t("Added @name", array("@name" => $mods_form_name))); -} - -/** - * Solution pack register form - * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" - * @param type $content_model The Content Model (islandora:docs_sp_cm) - */ -function solution_pack_register_form_association($mods_form_name, $content_model, $force=false) { - - // Query the database for previous associations - $results = db_result(db_query('Select content_model from {islandora_content_model_forms} where content_model = "%s" and form_name = "%s"', - $content_model, $mods_form_name)); - - // Check to see if there is anything to do - if ( $results && $force==false) { - - // Nothing to do so early out - return; - } - - // Create a model for the database - $object = new stdClass(); - $object->content_model = $content_model; - $object->form_name = $mods_form_name; - $object->dsid = 'MODS'; - $object->title_field = "['titleInfo']['title']"; - $object->transform = 'mods_to_dc.xsl'; - - // Are we adding the form association - if ( ! $results ) { - - // Add the association - $result = drupal_write_record('islandora_content_model_forms', $object); - } else { - - // Update the association - $result = drupal_write_record('islandora_content_model_forms', $object, array("content_model" => $content_model)); - } - - // Log the action - drupal_set_message(t("Added association between @cm@name", array("@cm" => $content_model, "@name"=>$mods_form_name))); -} - -/** - * Solution pack unregister form - * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" - */ -function solution_pack_unregister_form($mods_form_name) -{ - -} - -/** - * Solution pack unregister form - * @param type $mods_form_name The MODS form name "Islandora Docs MODS Form" - * @param type $content_model The Content Model (islandora:docs_sp_cm) - */ -function solution_pack_unregister_form_association($mods_form_name, $content_model) -{ - -} - - From fec776de32f7c0aea82500fc30f5a41adf6c89ee Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 7 Mar 2012 14:02:34 -0400 Subject: [PATCH 181/247] Added a force reinstall and fixed a move to trash bug --- api/fedora_item.inc | 6 ++++-- fedora_repository.module | 7 +++++++ fedora_repository.solutionpacks.inc | 18 ++++++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 7524ebbb..e7043b14 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -669,12 +669,14 @@ class Fedora_Item { { $this->set_datastream_state($dsid, 'D'); } - + // Create a message to mark the object deleted $params = array( 'pid' => $this->pid, 'state' => 'D', - 'logMessage' => $logMessage + 'logMessage' => $logMessage, + 'label' => $this->objectProfile->objLabel, + 'ownerId' => null, ); // Send message to mark the object deleted diff --git a/fedora_repository.module b/fedora_repository.module index 1646ce4f..eeee9851 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -2150,13 +2150,16 @@ function fedora_repository_display_schema($file) { * @return type */ function fedora_repository_batch_reingest_object($object, &$context) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + if (!empty($object) && is_array($object)) { $pid = $object['pid']; if (!valid_pid($pid)) { return NULL; } + // Does the object exist? If so, purge it. $item = new Fedora_Item($pid); if ($item->exists()) { @@ -2172,6 +2175,7 @@ function fedora_repository_batch_reingest_object($object, &$context) { $context['message'][] = "$new_item->pid installed."; } } + if (!empty($object['dsid']) && !empty($object['datastream_file'])) { $datastreams = array( array( @@ -2185,10 +2189,13 @@ function fedora_repository_batch_reingest_object($object, &$context) { } if (!empty($datastreams) && is_array($datastreams)) { + $label = !empty($object['label']) ? $object['label'] : ''; + if (empty($object['foxml_file']) && !isset($new_item)) { $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); } + if (!empty($object['cmodel'])) { $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); } diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 1ee956f1..12a4e08c 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -46,19 +46,21 @@ function fedora_repository_solution_packs_page() { * @param array $solution_pack */ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { + // Check each object to see if it is in the repository. module_load_include('inc', 'fedora_repository', 'api/fedora_item'); global $base_path; $needs_update = FALSE; $needs_install = FALSE; $form = array(); + $form['solution_pack_module'] = array( '#type' => 'hidden', '#value' => $solution_pack_module, ); if (!$form_state['submitted']) { - $form['soluction_pack_name'] = array( + $form['solution_pack_name'] = array( '#type' => 'markup', '#value' => t($solution_pack_name), '#prefix' => '<h3>', @@ -75,7 +77,6 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul $table_header = array('PID', 'Status'); $table_rows = array(); - foreach ($objects as $object) { $datastreams = NULL; if (isset($object['pid'])) { @@ -149,6 +150,12 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul '#type' => 'submit', '#name' => $solution_pack_module, ); + $form['forcesubmit'] = array( + '#value' => t('Force Reinstall'), + //'#disabled' => !$needs_install && !$needs_update, + '#type' => 'submit', + '#name' => $solution_pack_module, + ); $form['#submit'] = array( 'fedora_repository_solution_pack_form_submit', @@ -159,7 +166,11 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul function fedora_repository_solution_pack_form_submit($form, &$form_state) { $what = $form_state; $module_name = $form_state['values']['solution_pack_module']; + + // This should be replaced with module_invoke $solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); + //$solution_pack_info = module_invoke($module_name, 'required_fedora_objects'); + $batch = array( 'title' => t('Installing / updating solution pack objects'), 'file' => drupal_get_path('module', 'fedora_repository') . '/fedora_repository.module', @@ -171,6 +182,9 @@ function fedora_repository_solution_pack_form_submit($form, &$form_state) { // Add this object to the batch job queue. $batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object)); } + foreach($batch['operations'] as $key => $value) { + //var_dump($value); + } batch_set($batch); } From c5bcc3d082476386bbfa108ee8b3f55876a3bb8a Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Wed, 7 Mar 2012 14:06:44 -0400 Subject: [PATCH 182/247] Removed some debug info --- fedora_repository.solutionpacks.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 12a4e08c..1fa64a9c 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -182,9 +182,6 @@ function fedora_repository_solution_pack_form_submit($form, &$form_state) { // Add this object to the batch job queue. $batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object)); } - foreach($batch['operations'] as $key => $value) { - //var_dump($value); - } batch_set($batch); } From 6f2442e96b8559aceebde2b06dc0db6dd33691f4 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Wed, 14 Mar 2012 14:01:19 -0300 Subject: [PATCH 183/247] Added abiltiy to force reinstallation of fedora objects --- api/fedora_item.inc | 29 +++++++++++++++++++++++++++++ fedora_repository.solutionpacks.inc | 22 +++++++++++++++------- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 0a345723..a306bdab 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -611,6 +611,35 @@ class Fedora_Item { return $relationships; } + function get_rdf_relationships() { + + $relationships = array(); + try { + $relsext = $this->get_datastream_dissemination('RELS-EXT'); + } catch (exception $e) { + drupal_set_message(t("Error retrieving RELS-EXT of object $pid"), 'error'); + return $relationships; + } + + // Parse the RELS-EXT into an associative array. + $relsextxml = new DOMDocument(); + $relsextxml->loadXML($relsext); + $relsextxml->normalizeDocument(); + $allTags = array(); + $allTags[] = $relsextxml->getElementsByTagNameNS(RELS_EXT_URI, '*'); + $allTags[] = $relsextxml->getElementsByTagNameNS(FEDORA_MODEL_URI, '*'); + $allTags[] = $relsextxml->getElementsByTagNameNS(ISLANDORA_PAGE_URI, '*'); + foreach ($allTags as $tags) { + foreach ($tags as $child) { + $value = preg_replace('/info:fedora\//','',$child->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource')); + + $relationships[$child->tagName][] = $value; + } + } + + return $relationships; + } + function get_models() { $relationships = array(); try { diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index fb09528d..fc8cd879 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -143,13 +143,21 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul else { $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); } - $form['submit'] = array( - '#value' => t('Install'), - '#disabled' => !$needs_install && !$needs_update, - '#type' => 'submit', - '#name' => $solution_pack_module, - ); - + if ($need_install || $needs_update) { + $form['submit'] = array( + '#value' => t('Install'), + '#type' => 'submit', + '#name' => $solution_pack_module, + ); + } + else { + $form['force_submit'] = array( + '#value' => t('Forced Reinstall'), + '#attributes' => array('title' => ('Installs all fedora objects, reverting any changes made since installation. Use with caution.')), + '#type' => 'submit', + '#name' => $solution_pack_module, + ); + } $form['#submit'] = array( 'fedora_repository_solution_pack_form_submit', ); From eb71393289aa6094c2d8059fe7b1364f09dbc4c1 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Wed, 14 Mar 2012 15:29:10 -0300 Subject: [PATCH 184/247] Fixed typo --- fedora_repository.solutionpacks.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index fc8cd879..df651c93 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -143,7 +143,7 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul else { $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); } - if ($need_install || $needs_update) { + if ($needs_install || $needs_update) { $form['submit'] = array( '#value' => t('Install'), '#type' => 'submit', From 6429d11a8b3e9ce175702f7cea86ae080ce19788 Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Thu, 15 Mar 2012 09:49:39 -0300 Subject: [PATCH 185/247] Minor code cleanup --- fedora_repository.solutionpacks.inc | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index df651c93..1b395548 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -139,25 +139,21 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul ); if (!$needs_install && !$needs_update) { $form['install_status']['#value'] = theme_image('misc/watchdog-ok.png') . t('All required objects are installed and up-to-date.'); + $submit_button_text = t("Force Reinstallation of Fedora Objects"); + } else { $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); + $submit_button_text = t("Install Fedora Objects"); + } - if ($needs_install || $needs_update) { - $form['submit'] = array( - '#value' => t('Install'), - '#type' => 'submit', - '#name' => $solution_pack_module, - ); - } - else { - $form['force_submit'] = array( - '#value' => t('Forced Reinstall'), - '#attributes' => array('title' => ('Installs all fedora objects, reverting any changes made since installation. Use with caution.')), - '#type' => 'submit', - '#name' => $solution_pack_module, - ); - } + $form['submit'] = array( + '#value' => $submit_button_text, + '#type' => 'submit', + '#name' => $solution_pack_module, + ); + + $form['#submit'] = array( 'fedora_repository_solution_pack_form_submit', ); From ae06196a2ec2c07d85742a92cc1842c6edf03e5c Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Thu, 15 Mar 2012 10:11:11 -0300 Subject: [PATCH 186/247] Fixed fore submit logic --- fedora_repository.solutionpacks.inc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 7743a0b7..5bb5a117 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -153,13 +153,6 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul '#type' => 'submit', '#name' => $solution_pack_module, ); - $form['forcesubmit'] = array( - '#value' => t('Force Reinstall'), - //'#disabled' => !$needs_install && !$needs_update, - '#type' => 'submit', - '#name' => $solution_pack_module, - ); - $form['#submit'] = array( 'fedora_repository_solution_pack_form_submit', From a8be27871a93440c1c44400c8063b2f4a847d15c Mon Sep 17 00:00:00 2001 From: Jason MacWilliams <jason@discoverygarden.ca> Date: Fri, 16 Mar 2012 09:50:04 -0300 Subject: [PATCH 187/247] replaced digital repository breadcrumb with the name of the repository --- ObjectHelper.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index e8555635..fa6e2a06 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -924,7 +924,8 @@ class ObjectHelper { // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; if ($pid == variable_get('fedora_repository_pid', 'islandora:root')) { - $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); + //$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); + $breadcrumbs[] = l(variable_get('fedora_repository_title', 'Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } else { @@ -954,7 +955,8 @@ class ObjectHelper { $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { - $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); + //$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); + $breadcrumbs[] = l(variable_get('fedora_repository_title', 'Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } elseif ($level > 0) { From 6508f3c50612ccd2fd9aca71ac341b76783cdc1f Mon Sep 17 00:00:00 2001 From: Alan Stanley <astanley@upei.ca> Date: Fri, 16 Mar 2012 10:30:25 -0300 Subject: [PATCH 188/247] Added clarity to messages --- fedora_repository.solutionpacks.inc | 2 +- formClass.inc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 5bb5a117..efc7cd9d 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -204,6 +204,6 @@ function solution_pack_add_form_association($content_model, $form_name) { $object->title_field = "['titleInfo']['title']"; $object->transform = 'mods_to_dc.xsl'; $result = drupal_write_record('islandora_content_model_forms', $object); - drupal_set_message(t("Added association between @cm@name", array("@cm" => $content_model, "@name"=>$form_name))); + drupal_set_message(t("Added association between @cm and @name", array("@cm" => $content_model, "@name"=>$form_name))); } } diff --git a/formClass.inc b/formClass.inc index 09bfce8b..293a83ec 100644 --- a/formClass.inc +++ b/formClass.inc @@ -25,8 +25,8 @@ class formClass { $items = array(); $items['admin/settings/fedora_repository'] = array( - 'title' => t('Islandora Configure'), - 'description' => t('Enter the Islandora Collection information here'), + 'title' => t('Islandora Configuration'), + 'description' => t("Configure Islandora's interaction with Fedora"), 'page callback' => 'drupal_get_form', 'page arguments' => array('fedora_repository_admin'), 'access arguments' => array('administer site configuration'), From 417b1ab050d53b194b103c2e1562e0dbfa5a4ccd Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 19 Mar 2012 09:35:53 -0400 Subject: [PATCH 189/247] Handle redirect streams better, and various minor changes. --- CollectionPolicy.inc | 8 ++- ConnectionHelper.inc | 7 ++- ObjectHelper.inc | 37 +++++++++++--- api/fedora_item.inc | 67 +++++++++++++++---------- fedora_repository.module | 60 ++++++++++++++-------- fedora_repository.solutionpacks.inc | 2 +- formClass.inc | 1 + plugins/FedoraObjectDetailedContent.inc | 37 +++++++++++--- 8 files changed, 154 insertions(+), 65 deletions(-) diff --git a/CollectionPolicy.inc b/CollectionPolicy.inc index 9b0af861..71d95a6c 100644 --- a/CollectionPolicy.inc +++ b/CollectionPolicy.inc @@ -44,7 +44,12 @@ class CollectionPolicy extends XMLDatastream { if ($preFetch) { $fedoraItem = new Fedora_Item($pid); - $ds = $fedoraItem->get_datastream_dissemination($dsid); + if (array_key_exists($dsid, $fedoraItem->get_datastreams_list_as_array())) { + $ds = $fedoraItem->get_datastream_dissemination($dsid); + } + else { //No collection policy stream (of the default name, anyway) + return FALSE; + } } else { $ds = NULL; @@ -55,7 +60,6 @@ class CollectionPolicy extends XMLDatastream { $ret = new CollectionPolicy($ds, $pid, $dsid); } } catch (SOAPException $e) { - $ret = FALSE; } return $ret; diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 59f811e2..f34581e3 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -65,10 +65,11 @@ class ConnectionHelper { //anonymous user. We will need an entry in the fedora users.xml file //with the appropriate entry for a username of anonymous password of anonymous try { - $client = new SoapClient($this->_fixURL($url, 'anonymous', 'anonymous'), array( + $client = new SoapClient($url, array( 'login' => 'anonymous', 'password' => 'anonymous', 'exceptions' => $exceptions, + 'authentication' => SOAP_AUTHENTICATION_BASIC )); } catch (SoapFault $e) { drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); @@ -77,10 +78,12 @@ class ConnectionHelper { } else { try { - $client = new SoapClient($this->_fixURL($url, $user->name, $user->pass), array( + $client = new SoapClient($url, array( 'login' => $user->name, 'password' => $user->pass, 'exceptions' => TRUE, + 'authentication' => SOAP_AUTHENTICATION_BASIC, + 'cache_wsdl' => WSDL_CACHE_MEMORY )); } catch (SoapFault $e) { drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); diff --git a/ObjectHelper.inc b/ObjectHelper.inc index e8555635..8ec7bf1c 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -139,7 +139,7 @@ class ObjectHelper { curl_setopt($ch, CURLOPT_USERPWD, "$fedoraUser:$fedoraPass"); // There seems to be a bug in Fedora 3.1's REST authentication, removing this line fixes the authorization denied error. // curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); // return into a variable + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // return into a variable curl_setopt($ch, CURLOPT_URL, $url); @@ -151,7 +151,6 @@ class ObjectHelper { fclose($fp); } else { - header("Content-type: $mimeType"); if ($contentSize > 0) { header("Content-length: $contentSize"); @@ -182,12 +181,38 @@ class ObjectHelper { header('Content-Disposition: attachment; filename="' . $suggestedFileName . '"'); } - if ((isset($user) && $user->uid != 0) || $forceSoap || isset($_SERVER['HTTPS'])) { - curl_exec($ch); + curl_setopt($ch, CURLOPT_NOBODY, TRUE); + $curl_out = curl_exec($ch); + if ($curl_out !== FALSE) { + $info = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); + //dd($info, 'effective URL'); + if ($url !== $info) { //Handle redirect streams (the final URL is not the same as the Fedora URL) + + //Add the parameters passed to Drupal, leaving out the 'q' + $query = array(); + parse_str($_SERVER['QUERY_STRING'], $query); + if (isset($query['q'])) { + unset($query['q']); + } + + header('HTTP/1.1 307 Moved Temporarily'); + header('Location: ' . $info . '?' . http_build_query($query)); //Fedora seems to discard the query portion. + } + elseif ((isset($user) && $user->uid != 0) || $forceSoap || isset($_SERVER['HTTPS'])) { //If not anonymous, soap is force or we're using HTTPS + //Have the webserver mediate the transfer (download and restream) + + curl_setopt($ch, CURLOPT_NOBODY, FALSE); + curl_setopt($ch, CURLOPT_HTTPGET, TRUE); //CURLOPT_NOBODY sets it to 'HEAD' + $toReturn = curl_exec($ch); + echo $toReturn; + } + else { + header('Location: ' . $url); + } } else { - header('Location: ' . $url); - } + //Curl error... + } } curl_close($ch); } diff --git a/api/fedora_item.inc b/api/fedora_item.inc index afc110bd..79440f5e 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -211,27 +211,39 @@ class Fedora_Item { * @param type $namespaceURI */ function add_relationship($relationship, $object, $namespaceURI = RELS_EXT_URI) { + dd($this, 'The Fedora_Item'); $ds_list = $this->get_datastreams_list_as_array(); - - if (empty($ds_list['RELS-EXT'])) { - $this->add_datastream_from_string(' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <rdf:Description rdf:about="info:fedora/' . $this->pid . '"> + $f_prefix = 'info:fedora/'; + if (!array_key_exists('RELS-EXT', $ds_list)) { + $rdf_string = <<<RDF + <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <rdf:Description rdf:about="$f_prefix{$this->pid}"> </rdf:Description> - </rdf:RDF>', 'RELS-EXT', 'Fedora object-to-object relationship metadata', 'text/xml', 'X'); + </rdf:RDF> +RDF; + dd($rdf_string, 'RELS-EXT RDF being added'); + $this->add_datastream_from_string($rdf_string, 'RELS-EXT', 'Fedora object-to-object relationship metadata', 'application/rdf+xml', 'X'); + dd('Added'); } + dd('Getting RELS-EXT'); $relsext = $this->get_datastream_dissemination('RELS-EXT'); - - if (substr($object, 0, 12) != 'info:fedora/') { - $object = "info:fedora/$object"; + dd('Got RELS-EXT'); + + if (substr($object, 0, strlen($f_prefix)) !== $f_prefix) { + $object = $f_prefix . $object; } - $relsextxml = new DomDocument(); + $relsextxml = new DOMDocument(); $relsextxml->loadXML($relsext); $description = $relsextxml->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'Description'); if ($description->length == 0) { + //XXX: This really shouldn't be done; lower case d doesn't fit the schema. Warn users to fix the data and generators, pending deprecation. $description = $relsextxml->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'description'); + if ($description->length > 0) { + drupal_set_message(t('RDF with lower case "d" in "description" encountered. Should be uppercase! PID: %pid', array('%pid' => $this->pid)), 'warning'); + } } $description = $description->item(0); @@ -241,7 +253,7 @@ class Fedora_Item { $newrel->setAttribute('rdf:resource', $object); $description->appendChild($newrel); - $this->modify_datastream_by_value($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'text/xml'); + $this->modify_datastream_by_value($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); //print ($description->dump_node()); /* $params = array( 'pid' => $this->pid, @@ -287,7 +299,7 @@ class Fedora_Item { break; } - if (substr($object, 0, 12) != 'info:fedora/') { + if (!empty($object) && substr($object, 0, 12) != 'info:fedora/') { $object = "info:fedora/$object"; } @@ -297,7 +309,7 @@ class Fedora_Item { $rels = $relsextxml->getElementsByTagNameNS($namespaceURI, $relationship); if (!empty($rels)) { foreach ($rels as $rel) { - if ($rel->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource') == $object) { + if (empty($object) || $rel->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource') == $object) { $rel->parentNode->removeChild($rel); $modified = TRUE; } @@ -307,7 +319,6 @@ class Fedora_Item { $this->modify_datastream_by_value($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'text/xml'); } return $modified; - //print ($description->dump_node()); } /** @@ -743,8 +754,9 @@ class Fedora_Item { * @return type */ function url() { - global $base_url; - return $base_url . '/fedora/repository/' . $this->pid . (!empty($this->objectProfile) ? '/-/' . drupal_urlencode($this->objectProfile->objLabel) : ''); + return url('fedora/repository/' . $this->pid . (!empty($this->objectProfile) ? '/-/' . drupal_urlencode($this->objectProfile->objLabel) : ''), array( + 'absolute' => TRUE + )); } /** @@ -780,9 +792,14 @@ class Fedora_Item { * @param type $foxml * @return Fedora_Item */ - static function ingest_from_FOXML($foxml) { - $params = array('objectXML' => $foxml->saveXML(), 'format' => "info:fedora/fedora-system:FOXML-1.1", 'logMessage' => "Fedora Object Ingested"); + static function ingest_from_FOXML(DOMDocument $foxml) { + $params = array( + 'objectXML' => $foxml->saveXML(), + 'format' => 'info:fedora/fedora-system:FOXML-1.1', + 'logMessage' => 'Fedora Object Ingested' + ); $object = self::soap_call('ingest', $params); + dd($object, 'Soap return'); return new Fedora_Item($object->objectPID); } @@ -982,25 +999,23 @@ class Fedora_Item { } } - $root_element = $foxml->createElement("foxml:digitalObject"); + $root_element = $foxml->createElementNS("info:fedora/fedora-system:def/foxml#", "foxml:digitalObject"); $root_element->setAttribute("VERSION", "1.1"); $root_element->setAttribute("PID", $pid); - $root_element->setAttribute("xmlns:foxml", "info:fedora/fedora-system:def/foxml#"); - $root_element->setAttribute("xmlns:xsl", "http://www.w3.org/2001/XMLSchema-instance"); - $root_element->setAttribute("xsl:schemaLocation", "info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"); + $root_element->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation", "info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd"); $foxml->appendChild($root_element); // FOXML object properties section - $object_properties = $foxml->createElement("foxml:objectProperties"); - $state_property = $foxml->createElement("foxml:property"); + $object_properties = $foxml->createElementNS("info:fedora/fedora-system:def/foxml#", "foxml:objectProperties"); + $state_property = $foxml->createElementNS("info:fedora/fedora-system:def/foxml#", "foxml:property"); $state_property->setAttribute("NAME", "info:fedora/fedora-system:def/model#state"); $state_property->setAttribute("VALUE", $state); - $label_property = $foxml->createElement("foxml:property"); + $label_property = $foxml->createElementNS("info:fedora/fedora-system:def/foxml#", "foxml:property"); $label_property->setAttribute("NAME", "info:fedora/fedora-system:def/model#label"); $label_property->setAttribute("VALUE", $label); - $owner_property = $foxml->createElement("foxml:property"); + $owner_property = $foxml->createElementNS("info:fedora/fedora-system:def/foxml#", "foxml:property"); $owner_property->setAttribute("NAME", "info:fedora/fedora-system:def/model#ownerId"); $owner_property->setAttribute("VALUE", $owner); @@ -1009,7 +1024,7 @@ class Fedora_Item { $object_properties->appendChild($owner_property); $root_element->appendChild($object_properties); $foxml->appendChild($root_element); - + //dd($foxml->saveXML(), 'XML to ingest'); Worked on 2012/01/16 return $foxml; } diff --git a/fedora_repository.module b/fedora_repository.module index 1646ce4f..f8b3f733 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -146,14 +146,13 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { $form_state['submitted'] = FALSE; return; } - if ($form_state['storage']['xml']) { - if (module_exists('islandora_content_model_forms')) { - module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); - $xml_form = new IngestObjectMetadataForm(); - $xml_form->submit($form, $form_state); - } + //ddebug_backtrace(); + if ($form_state['storage']['xml'] && module_exists('islandora_content_model_forms')) { + module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); + $xml_form = new IngestObjectMetadataForm(); + $xml_form->submit($form, $form_state); } - elseif ($form_state['clicked_button']['#id'] == 'edit-submit') { + elseif (strpos($form_state['clicked_button']['#id'], 'edit-submit') === 0) { global $base_url; module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); @@ -188,7 +187,7 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) { } if ($redirect) { - $form_state['redirect'] = ($err) ? ' ' : $base_url . "/fedora/repository/{$form_state['values']['collection_pid']}"; + $form_state['redirect'] = ($err) ? ' ' : url("fedora/repository/{$form_state['values']['collection_pid']}"); } } } @@ -205,7 +204,7 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { $form_state['submitted'] = FALSE; return; } - if ($form_state['clicked_button']['#id'] == 'edit-submit' && $form_state['ahah_submission'] != 1) { + if (strpos($form_state['clicked_button']['#id'], 'edit-submit') === 0 && $form_state['ahah_submission'] != 1) { switch ($form_state['storage']['step']) { case 1: $form_state['storage']['step']++; @@ -286,7 +285,8 @@ function fedora_repository_ingest_form(&$form_state, $collection_pid, $collectio $ingestForm = new formClass(); $form_state['storage']['content_model'] = $content_model; $form_state['storage']['collection_pid'] = $collection_pid; - return $ingestForm->createIngestForm($collection_pid, $collection_label, $form_state); + $form = $ingestForm->createIngestForm($collection_pid, $collection_label, $form_state); + return $form; } /** @@ -1706,22 +1706,22 @@ function fedora_repository_required_fedora_objects() { 'pid' => 'islandora:collectionCModel', 'label' => 'Islandora Collection Content Model', 'dsid' => 'ISLANDORACM', - 'datastream_file' => "$module_path/content_models/COLLECTIONCM.xml", + 'datastream_file' => "./$module_path/content_models/COLLECTIONCM.xml", 'dsversion' => 2, - 'cmodel' => 'fedora-system:ContentModel-3.0', + 'cmodel' => 'info:fedora/fedora-system:ContentModel-3.0', ), array( 'pid' => 'islandora:root', 'label' => 'Islandora Top-level Collection', - 'cmodel' => 'islandora:collectionCModel', + 'cmodel' => 'info:fedora/islandora:collectionCModel', 'datastreams' => array( array( 'dsid' => 'COLLECTION_POLICY', - 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", + 'datastream_file' => "./$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", ), array( 'dsid' => 'TN', - 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", + 'datastream_file' => "./$module_path/images/Gnome-emblem-photos.png", 'mimetype' => 'image/png', ), ), @@ -2152,23 +2152,30 @@ function fedora_repository_display_schema($file) { function fedora_repository_batch_reingest_object($object, &$context) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + dd($object, 'Object array'); if (!empty($object) && is_array($object)) { $pid = $object['pid']; if (!valid_pid($pid)) { return NULL; } // Does the object exist? If so, purge it. + dd("About to test existence of PID: $pid"); $item = new Fedora_Item($pid); if ($item->exists()) { + dd(' Found'); $item->purge(t('Remove during re-install batch job')); + dd(' Purged'); } + $new_item = NULL; //Need to have this a couple places... (After trying from FOXML and later for individual DSs) + $datastreams = array(); //Seems like this might be getting messed up due to scope? + // Ingest the object from the source file. if (!empty($object['foxml_file'])) { $foxml_file = $object['foxml_file']; $new_item = Fedora_Item::ingest_from_FOXML_file($foxml_file); if ($new_item->exists()) { -// Batch operation was successful. +// Batch operation was successful; can still add additional DSs, though $context['message'][] = "$new_item->pid installed."; } } @@ -2184,18 +2191,29 @@ function fedora_repository_batch_reingest_object($object, &$context) { $datastreams = $object['datastreams']; } - if (!empty($datastreams) && is_array($datastreams)) { - $label = !empty($object['label']) ? $object['label'] : ''; - if (empty($object['foxml_file']) && !isset($new_item)) { - $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); - } + $label = !empty($object['label']) ? $object['label'] : ''; + if (!isset($new_item)) { + dd(' Not found, creating'); + $new_item = Fedora_Item::ingest_new_item($pid, 'A', $label); + dd(' Created'); + } + elseif (!empty($label)) { + $new_item->modify_object($label); + } + + if (isset($new_item)) { if (!empty($object['cmodel'])) { + dd(' relating to cmodel'); $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); + dd(' related to cmodel'); } if (!empty($object['parent'])) { + dd(' adding parent'); $new_item->add_relationship('isMemberOfCollection', $object['parent']); + dd(' parent added'); } foreach ($datastreams as $ds) { + dd("trying to add ds: {$ds['dsid']}"); if ($ds['dsid'] == 'DC') { $new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml'); } diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index 756f8bf0..1c813b57 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -109,7 +109,7 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul $object_status = 'Missing datastream'; break; } - if (isset($ds['dsversion'])) { + elseif (isset($ds['dsversion'])) { // Check if the datastream is versioned and needs updating. $installed_version = fedora_repository_get_islandora_datastream_version($item, $ds['dsid']); $available_version = fedora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); diff --git a/formClass.inc b/formClass.inc index 86a5128f..27b24948 100644 --- a/formClass.inc +++ b/formClass.inc @@ -602,6 +602,7 @@ class formClass { $form = new IngestObjectMetadataForm(); return $form->create($collection_pid, $collection_label, $form_state); } catch (Exception $e) { + dd('An error occured; reverting to QDC form...'); $form_state['storage']['xml'] = FALSE; // An error occured revert back to the QDC Form. } } diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 55a3d31c..9283acb2 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -43,6 +43,7 @@ class FedoraObjectDetailedContent { '#type' => 'tabpage', '#title' => t('Object Details'), '#selected' => $details_selected, + '#weight' => 100, //XXX: Make the weight configurable? ); $tabset['fedora_object_details']['tabset'] = array( '#type' => 'tabset', @@ -51,12 +52,28 @@ class FedoraObjectDetailedContent { $ds_list = $objectHelper->get_formatted_datastream_list($this->pid, NULL, $this->item); - - $tabset['fedora_object_details']['tabset']['view'] = array( - '#type' => 'tabpage', - '#title' => t('View'), - '#content' => $dc_html . $ds_list . $purge_form, - ); + $i = 0; + if (fedora_repository_access(OBJECTHELPER :: $VIEW_DETAILED_CONTENT_LIST, $this->pid, $user)) { + $tabset['fedora_object_details']['tabset']['view'] = array( + '#type' => 'tabpage', + '#title' => t('View'), + 'dc' => array( + '#type' => 'markup', + '#value' => $dc_html, //XXX: This could easily be done in Drupal, instead of using an XSL + '#weight' => $i++ + ), + 'list' => array( + '#type' => 'markup', + '#value' => $ds_list, //XXX: The function called here could be cleaned up a fair bit as well... + '#weight' => $i++ + ), + 'purge' => array( + '#type' => 'markup', + '#value' => $purge_form, + '#weight' => $i++ + ) + ); + } if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) { $editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC'); @@ -68,7 +85,13 @@ class FedoraObjectDetailedContent { ); } - return $tabset; + $ts = $tabset['fedora_object_details']['tabset']; + if (array_key_exists('view', $ts) || array_key_exists('edit', $ts)) { + return $tabset; + } + else { + return array(); + } } } From 972e97d498fc0d48a635189eeed388e3260c3b15 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 19 Mar 2012 12:39:17 -0300 Subject: [PATCH 190/247] Comment out debug lines. --- api/fedora_item.inc | 12 ++++++------ fedora_repository.module | 23 ++++++++++++----------- formClass.inc | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 741c883c..9863816d 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -212,7 +212,7 @@ class Fedora_Item { * @param type $namespaceURI */ function add_relationship($relationship, $object, $namespaceURI = RELS_EXT_URI) { - dd($this, 'The Fedora_Item'); + //dd($this, 'The Fedora_Item'); $ds_list = $this->get_datastreams_list_as_array(); $f_prefix = 'info:fedora/'; if (!array_key_exists('RELS-EXT', $ds_list)) { @@ -222,14 +222,14 @@ class Fedora_Item { </rdf:Description> </rdf:RDF> RDF; - dd($rdf_string, 'RELS-EXT RDF being added'); + //dd($rdf_string, 'RELS-EXT RDF being added'); $this->add_datastream_from_string($rdf_string, 'RELS-EXT', 'Fedora object-to-object relationship metadata', 'application/rdf+xml', 'X'); - dd('Added'); + //dd('Added'); } - dd('Getting RELS-EXT'); + //dd('Getting RELS-EXT'); $relsext = $this->get_datastream_dissemination('RELS-EXT'); - dd('Got RELS-EXT'); + //dd('Got RELS-EXT'); if (substr($object, 0, strlen($f_prefix)) !== $f_prefix) { $object = $f_prefix . $object; @@ -835,7 +835,7 @@ RDF; 'logMessage' => 'Fedora Object Ingested' ); $object = self::soap_call('ingest', $params); - dd($object, 'Soap return'); + //dd($object, 'Soap return'); return new Fedora_Item($object->objectPID); } diff --git a/fedora_repository.module b/fedora_repository.module index 822bfda0..fa4d6e25 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -812,7 +812,8 @@ function fedora_repository_edit_qdc_form_validate($form, &$form_state) { function fedora_repository_edit_qdc_form_submit($form, &$form_state) { if ($form_state['storage']['xml']) { module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); - EditObjectMetadataForm::submit($form, $form_state); + $xml_form = new EditObjectMetadataForm(); + $xml_form->submit($form, $form_state); } else { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); @@ -2160,12 +2161,12 @@ function fedora_repository_batch_reingest_object($object, &$context) { } // Does the object exist? If so, purge it. - dd("About to test existence of PID: $pid"); + //dd("About to test existence of PID: $pid"); $item = new Fedora_Item($pid); if ($item->exists()) { - dd(' Found'); + //dd(' Found'); $item->purge(t('Remove during re-install batch job')); - dd(' Purged'); + //dd(' Purged'); } $new_item = NULL; //Need to have this a couple places... (After trying from FOXML and later for individual DSs) @@ -2193,9 +2194,9 @@ function fedora_repository_batch_reingest_object($object, &$context) { $label = !empty($object['label']) ? $object['label'] : ''; if (!isset($new_item)) { - dd(' Not found, creating'); + //dd(' Not found, creating'); $new_item = Fedora_Item::ingest_new_item($pid, 'A', $label); - dd(' Created'); + //dd(' Created'); } elseif (!empty($label)) { $new_item->modify_object($label); @@ -2203,17 +2204,17 @@ function fedora_repository_batch_reingest_object($object, &$context) { if (isset($new_item)) { if (!empty($object['cmodel'])) { - dd(' relating to cmodel'); + //dd(' relating to cmodel'); $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); - dd(' related to cmodel'); + //dd(' related to cmodel'); } if (!empty($object['parent'])) { - dd(' adding parent'); + //dd(' adding parent'); $new_item->add_relationship('isMemberOfCollection', $object['parent']); - dd(' parent added'); + //dd(' parent added'); } foreach ((array)$datastreams as $ds) { - dd("trying to add ds: {$ds['dsid']}"); + //dd("trying to add ds: {$ds['dsid']}"); if ($ds['dsid'] == 'DC') { $new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml'); } diff --git a/formClass.inc b/formClass.inc index 12f56b3f..e57f4dba 100644 --- a/formClass.inc +++ b/formClass.inc @@ -601,7 +601,7 @@ class formClass { $form = new IngestObjectMetadataForm(); return $form->create($collection_pid, $collection_label, $form_state); } catch (Exception $e) { - dd('An error occured; reverting to QDC form...'); + //dd('An error occured; reverting to QDC form...'); $form_state['storage']['xml'] = FALSE; // An error occured revert back to the QDC Form. } } From 7101d28d7d4532615f8c0af47dbc70c3a3f66cdd Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Tue, 20 Mar 2012 09:46:34 -0300 Subject: [PATCH 191/247] Fixed OBJECTHELPER couldn't be found outside of islandora bug --- fedora_repository.module | 1 + 1 file changed, 1 insertion(+) diff --git a/fedora_repository.module b/fedora_repository.module index eeee9851..ff1825c9 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -882,6 +882,7 @@ function fedora_repository_access($op, $node, $account) { * @param $dsID String */ function makeObject($pid, $dsID) { + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!valid_pid($pid)) { drupal_set_message(t("Invalid PID!"), 'error'); From 4ba420dce8affb7fbd9cf9c7bf84b363794b5878 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Tue, 20 Mar 2012 11:21:08 -0300 Subject: [PATCH 192/247] Updated Fedora Item Datastream add for HTTPS When a datastream is added using HTTPS if its using the drupal url it will try to use HTTP instead of HTTPS since Fedora has some problems with HTTP. Ammended commit. Removed debug statements. --- api/fedora_item.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 1714c571..7e4810e5 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -136,10 +136,18 @@ class Fedora_Item { * @return type */ function add_datastream_from_url($datastream_url, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { + global $base_url; + if (empty($datastream_label)) { $datastream_label = $datastream_id; } + // Fedora has some problems getting files from HTTPS connections sometimes, so if we are getting a file + // from the local drupal, we try to pass a HTTP url instead of a HTTPS one. + if(stripos($datastream_url, 'https://') !== FALSE && stripos($datastream_url, $base_url) !== FALSE) { + $datastream_url = str_ireplace('https://', 'http://', $datastream_url); + } + $params = array( 'pid' => $this->pid, 'dsID' => $datastream_id, From c59290c9c76501846fe2454d27e0ab1090b22256 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Wed, 28 Mar 2012 13:22:16 -0300 Subject: [PATCH 193/247] ISLANDORA-548 Updated curl call in ObjectHelper The ObjectHelper.inc file uses the deprecated API-A Lite API, i.e. localhost:8080/fedora/get/{pid}/{dsID} This causes problems when XACML policies are in place that require access to certain datastreams based on fedoraRole. Basically, despite sending accurate credentials in the GET request, the fedoraRole is not recognized by fedora's AttributeFinderModule, and a user cannot access a particular datastream. The protected datastreams, however, are viewable in Fedora's admin console (while using the same credentials) since that uses the REST API. Updated the curl call to use the new REST API. --- ObjectHelper.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index fa6e2a06..31a0ccd2 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -122,8 +122,7 @@ class ObjectHelper { $dsID = variable_get('fedora_default_display_dsid', 'TN'); $mimeType = 'image/jpeg'; } - - $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/get/' . $pid . '/' . $dsID; + $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/objects/' . $pid . '/datastreams/' . $dsID . '/content'; if ($version) { $url .= '/' . $version; //drupal_urlencode($version); } From 0b40b559811f0b2d60a10c1e643eb45fc1693bb3 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Wed, 28 Mar 2012 13:45:27 -0300 Subject: [PATCH 194/247] Added the quiet=true flag to fedora_item.inc In Fedora item when you call the constructor it automatically does a getObjectProfile soap call. This was reporting soap errors when called on an item that dosen't exist, we don't want to show the user this. --- api/fedora_item.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 7e4810e5..2809f384 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -59,7 +59,7 @@ class Fedora_Item { self::$connection_helper = new ConnectionHelper(); } - $raw_objprofile = $this->soap_call('getObjectProfile', array('pid' => $this->pid, 'asOfDateTime' => "")); + $raw_objprofile = $this->soap_call('getObjectProfile', array('pid' => $this->pid, 'asOfDateTime' => ""), TRUE); if (!empty($raw_objprofile)) { $this->objectProfile = $raw_objprofile->objectProfile; From 17a91d971cb44a5d794b40e87029228e448ab8a7 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Wed, 28 Mar 2012 22:45:35 -0300 Subject: [PATCH 195/247] ISLANDORA-479 Error replacing X Datastream When you tried to replace a datastream that was anything but managed, you would get a SOAP error. Changed this behavior so that you can replace a managed datastream, an inline xml datastream, and it gives a reasonable warning if you try to replace a reference or redirect datastream. --- fedora_repository.module | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index ff1825c9..42eb4c49 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -617,7 +617,7 @@ function fedora_repository_purge_stream_form_submit($form, &$form_state) { * @param type $collectionName * @return type */ -function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { +function fedora_repository_replace_stream($pid, $dsId, $dsLabel = '', $collectionName = NULL) { if ($pid == NULL || $dsId == NULL) { drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error'); return ''; @@ -707,8 +707,20 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $dformat = $mimetype->getType($file->filepath); $item = new Fedora_Item($pid); + $info = $item->get_datastream_info($dsid); - $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); + if($info->datastream->controlGroup == 'M') { + $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); + } elseif ($info->datastream->controlGroup == 'X') { + if($dformat == 'text/xml') { + $item->modify_datastream_by_value(file_get_contents($file->filepath), $dsid, $dsLabel, $dformat); + } + else { + drupal_set_message('File must be of mimetype text/xml in order to replace inline XML datastream.', 'error'); + } + } else { + drupal_set_message('Cannot replace Redirect or Managed Datastream.', 'error'); + } $form_state['redirect'] = 'fedora/repository/' . $pid; } From 1c48ace3900b398b633ce27cb80de7904530f4f2 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 29 Mar 2012 11:24:30 -0300 Subject: [PATCH 196/247] Use hook mechanism and improve version acquisition --- fedora_repository.module | 19 +++++++------------ fedora_repository.solutionpacks.inc | 5 +++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index fa4d6e25..18e3bfb5 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -2178,7 +2178,7 @@ function fedora_repository_batch_reingest_object($object, &$context) { $new_item = Fedora_Item::ingest_from_FOXML_file($foxml_file); if ($new_item->exists()) { // Batch operation was successful; can still add additional DSs, though - $context['message'][] = "{$new_item->pid} installed."; + $context['message'][] = t('%pid installed.', array('%pid' => $new_item->pid)); } } @@ -2238,22 +2238,17 @@ function fedora_repository_batch_reingest_object($object, &$context) { */ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid = NULL, $datastream_file = NULL) { $return = NULL; - if (isset($item)) { + if (!empty($item) && !empty($dsid)) { $doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); } - elseif (isset($datastream_file)) { + elseif (!empty($datastream_file)) { $doc = simplexml_load_file($datastream_file); } - - if (!empty($doc)) { - $attrs = $doc->attributes(); - foreach ($attrs as $name => $value) { - if ($name == 'version') { - $return = (int) $value; - break; - } - } + + if (!empty($doc) && $version = (int)$doc->attributes()->version) { + $return = $version; } + return $return; } diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index e9cc573e..b6c40412 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -114,6 +114,7 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul // Check if the datastream is versioned and needs updating. $installed_version = fedora_repository_get_islandora_datastream_version($item, $ds['dsid']); $available_version = fedora_repository_get_islandora_datastream_version(NULL, NULL, $ds['datastream_file']); + if ($available_version > $installed_version) { $needs_update = TRUE; $object_status = 'Out of date'; @@ -165,8 +166,8 @@ function fedora_repository_solution_pack_form_submit($form, &$form_state) { $module_name = $form_state['values']['solution_pack_module']; // This should be replaced with module_invoke - $solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); - //$solution_pack_info = module_invoke($module_name, 'required_fedora_objects'); + //$solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); + $solution_pack_info = module_invoke($module_name, 'required_fedora_objects'); $batch = array( 'title' => t('Installing / updating solution pack objects'), From b8e88b628695808307c44728cce59c064cddb555 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 29 Mar 2012 11:27:21 -0300 Subject: [PATCH 197/247] Fix tab selection and slight refactoring. --- CollectionClass.inc | 84 +++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 08f669e0..6fa83b63 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -5,6 +5,11 @@ * * Collection Class Class */ + +if (!defined('PHP_VERSION_ID')) { //XXX: This should go elsewhere + $version = explode('.', PHP_VERSION); + define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); +} /** * This CLASS caches the streams so once you call a getstream once it will always return @@ -500,10 +505,11 @@ class CollectionClass { */ function showFieldSets($page_number) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - module_load_include('inc', 'fedora_repository', 'CollectionManagement'); - module_load_include('inc', 'fedora_repository', 'BatchIngest'); + module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); + //module_load_include('inc', 'fedora_repository', 'BatchIngest'); //Legacy code? global $base_url; global $user; + $tabset = array(); $query = NULL; $item = new Fedora_Item($this->pid); @@ -513,10 +519,7 @@ class CollectionClass { $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(); + //$collection_item = new Fedora_Item($this->pid); //XXX: This didn't seem to be used... $show_batch_tab = FALSE; $policy = CollectionPolicy::loadFromCollection($this->pid, TRUE); @@ -527,39 +530,42 @@ class CollectionClass { if (count($content_models) == 1 && $content_models[0]->pid == "islandora:collectionCModel") { $show_batch_tab = FALSE; } - if (!$show_ingest_tab) { - $view_selected = TRUE; - } - if (!$collection_items) { - $view_selected = FALSE; - $add_selected = TRUE; - } - $view_selected = !$show_ingest_tab; - + + // Check the form post to see if we are in the middle of an ingest operation. + $add_selected = ((!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_ingest_form') || !$collection_items); + $view_selected = !$add_selected; $tabset['view_tab'] = array( '#type' => 'tabpage', - '#title' => 'View', + '#title' => t('View'), '#selected' => $view_selected, '#content' => $collection_items, + '#tab_name' => 'view-tab', ); - $tabset['add_tab'] = array( - '#type' => 'tabpage', - '#title' => t('Add'), - '#selected' => $add_selected, - // This will be the content of the tab. - '#content' => $add_to_collection, - ); - - if ($show_batch_tab && user_access('create batch process')) { + + $add_to_collection = $this->getIngestInterface(); + if (!empty($add_to_collection)) { + $tabset['add_tab'] = array( + '#type' => 'tabpage', + '#title' => t('Add'), + '#selected' => $add_selected, + // This will be the content of the tab. + '#content' => $add_to_collection, + '#tab_name' => 'add-tab', + ); + } + + if ($show_batch_tab && user_access('create batch process')) { //XXX: Is this not put in by the batch module? $tabset['batch_ingest_tab'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', '#title' => t('Batch Ingest'), // This will be the content of the tab. '#content' => drupal_get_form('batch_creation_form', $this->pid, $content_models), + '#tab_name' => 'batch-ingest-tab', ); } + return $tabset; } @@ -622,7 +628,7 @@ class CollectionClass { $pageNumber = 1; } - if (!isset($collectionName)) { + if (empty($collectionName)) { $collectionName = variable_get('fedora_repository_name', 'Collection'); } $xslContent = $this->getXslContent($pid, $path); @@ -636,11 +642,23 @@ class CollectionClass { 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); + $options = array( //Could make this the return of a hook? + 'collectionPid' => $collection_pid, + 'collectionTitle' => $collectionName, + 'baseUrl' => $base_url, + 'path' => "$base_url/$path", + 'hitPage' => $pageNumber, + ); + + if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50100) { + $proc->setParameter('', $options); + } + else { + foreach ($options as $name => $value) { + $proc->setParameter('', $name, $value); + } + } + $proc->registerPHPFunctions(); $xsl = new DomDocument(); $xsl->loadXML($xslContent); @@ -657,13 +675,13 @@ class CollectionClass { throw new Exception("Invalid XML."); } } catch (Exception $e) { - drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(check_plain($e->getMessage()), 'error'); return ''; } } } else { - drupal_set_message(t("No Objects in this collection or bad query.")); + drupal_set_message(t("No objects in this collection (or bad query).")); } return $objectList; } From 0d8207325863004e3bc219f300db7d2ea0bfa352 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 2 Apr 2012 10:49:44 -0300 Subject: [PATCH 198/247] Added error reporting for when an ingest fails --- ContentModel.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/ContentModel.inc b/ContentModel.inc index 444f485c..be362c70 100644 --- a/ContentModel.inc +++ b/ContentModel.inc @@ -1374,6 +1374,7 @@ class ContentModel extends XMLDatastream { else { $status = $class->$methodName($param_array, $method->getAttribute('dsid'), $file, $method->getAttribute('modified_files_ext')); if ($status !== TRUE) { + self::$errors[] = 'Execute Ingest Rules: method \'' . $className . '->' . $methodName . '\' failed.'; $ret = FALSE; } } From 860069f40042dcb14f150e259b87e9b9f91f4bb2 Mon Sep 17 00:00:00 2001 From: Ben Woodhead <bwoodhead@upei.ca> Date: Mon, 2 Apr 2012 11:56:08 -0300 Subject: [PATCH 199/247] Cleaned up error handling --- api/fedora_item.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 2809f384..e6477915 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -406,15 +406,18 @@ class Fedora_Item { * Get datastream dissemination * @param type $dsid * @param type $as_of_date_time - * @return string + * @param type $quiet + * @return null */ - function get_datastream_dissemination($dsid, $as_of_date_time = "") { + function get_datastream_dissemination($dsid, $as_of_date_time = "", $quiet=TRUE) { $params = array( 'pid' => $this->pid, 'dsID' => $dsid, 'asOfDateTime' => $as_of_date_time, ); - $object = self::soap_call('getDataStreamDissemination', $params); + + // Make soap call with quite + $object = self::soap_call('getDataStreamDissemination', $params, $quiet); if (!empty($object)) { $content = $object->dissemination->stream; $content = trim($content); From a2c4b5d374c344093807c35959bab07c1b88cc60 Mon Sep 17 00:00:00 2001 From: ppound <paul.pound@gmail.com> Date: Tue, 10 Apr 2012 09:15:35 -0300 Subject: [PATCH 200/247] Connectionhelper is session aware SecurityClass now uses xacml api --- ConnectionHelper.inc | 2 +- SecurityClass.inc | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 71a83bc9..4dce9a0d 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -95,10 +95,10 @@ class ConnectionHelper { try { //we need to make a call to set the cookie this extra call would only happen once per session $client->__soapCall('describeRepository', array()); + $_SESSION['islandora_soapcookies'] = $client->_cookies; } catch (exception $e) { //connection is tested elsewhere so eat this for now here we just want the cookie } - $_SESSION['islandora_soapcookies'] = $client->_cookies; } diff --git a/SecurityClass.inc b/SecurityClass.inc index 970b108b..ced11ba7 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -22,15 +22,17 @@ class SecurityClass { drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } - /** - * canIngestHere ?? - * @global type $user - * @param type $collection_pid - * @return type + /** + * reads the specified stream of the parent object to see if the user can ingest in this collection. + * + * @global object $user + * @param string $collection_pid + * @return boolean */ function canIngestHere($collection_pid) { global $user; module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + module_load_include('inc', 'islandora_xacml_api', 'Xacml'); $objectHelper = new ObjectHelper(); // get the childsecurity policy from the collection. $policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS :: $SECURITY_CLASS_SECURITY_STREAM, FALSE); @@ -39,13 +41,9 @@ class SecurityClass { // maybe we should return FALSE here?? would be more secure. return TRUE; } - $allowedUsersAndRoles = $this->getAllowedUsersAndRoles($policyStream); - if (!$allowedUsersAndRoles) { - // error processing stream so don't let them ingest here. - return FALSE; - } - $allowedUsers = $allowedUsersAndRoles["users"]; - $allowedRoles = $allowedUsersAndRoles["roles"]; + $xacml = new Xacml($policyStream); + $allowedUsers = $xacml->managementRule->getUsers(); + $allowedRoles = $xacml->managementRule->getRoles(); foreach ($user->roles as $role) { if (in_array($role, $allowedRoles)) { @@ -60,7 +58,10 @@ class SecurityClass { } /** + * Depracated should use the xacml api for this + * * parses our simple xacml policies checking for users or roles that are allowed to ingest + * * @param type $policyStream * @return type */ @@ -153,6 +154,8 @@ class SecurityClass { } /** + * Depracated should use the xacml api for this + * * Add a list of allowed users and roles to the given policy stream and return it. * * @param string $policy_stream From 378e060d2fa71ddcd6edb829d3dc0a71d9d62248 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Wed, 11 Apr 2012 15:50:49 -0300 Subject: [PATCH 201/247] Allow breadcrumbs to be overridden by CModels --- fedora_repository.module | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 18e3bfb5..30293e0f 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -762,13 +762,6 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) { $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl')); // Check if there is a custom edit metadata function defined in the content model. - - $breadcrumbs = array(); - $objectHelper = new ObjectHelper(); - $objectHelper->getBreadcrumbs($pid, $breadcrumbs); - drupal_set_breadcrumb(array_reverse($breadcrumbs)); - - $output = ''; if (($cm = ContentModel::loadFromObject($pid)) !== FALSE) { $output = $cm->buildEditMetadataForm($pid, $dsId); @@ -1031,6 +1024,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU /** * fedora repository urlencode string + * FIXME: URL-encoding is not the same as HTML/XML encoding... * @param type $str * @return type */ From 16bd36599307790f20950c20a7337d61a799165c Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Wed, 11 Apr 2012 15:55:03 -0300 Subject: [PATCH 202/247] Simplify title acquisition logic and remove commented code --- formClass.inc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/formClass.inc b/formClass.inc index e57f4dba..8648fe20 100644 --- a/formClass.inc +++ b/formClass.inc @@ -69,19 +69,12 @@ class formClass { 'type' => MENU_CALLBACK, 'access arguments' => array('view fedora collection'), ); - $repository_title = variable_get('fedora_repository_title', 'Digital repository'); - if (trim($repository_title) != '') { - $respository_title = t($repository_title); - } - else { - $repository_title = NULL; - } $items['fedora/repository'] = array( - 'title' => $repository_title, + 'title callback' => 'variable_get', + 'title arguments' => array('fedora_repository_title', 'Digital Repository'), 'page callback' => 'repository_page', 'type' => MENU_NORMAL_ITEM, 'access arguments' => array('view fedora collection'), - // 'access' => TRUE ); $items['fedora/repository/service'] = array( @@ -100,8 +93,6 @@ class formClass { $items['fedora/repository/editmetadata'] = array( 'title' => t('Edit metadata'), 'page callback' => 'fedora_repository_edit_qdc_page', - // 'page arguments' => array(1), - //'type' => MENU_LOCAL_TASK, 'type' => MENU_CALLBACK, 'access arguments' => array('edit fedora meta data') ); @@ -123,7 +114,6 @@ class formClass { $items['fedora/repository/purgeObject'] = array( 'title' => t('Purge object'), 'page callback' => 'fedora_repository_purge_object', - // 'type' => MENU_LOCAL_TASK, 'type' => MENU_CALLBACK, 'access arguments' => array('purge objects and datastreams') ); @@ -131,7 +121,6 @@ class formClass { $items['fedora/repository/addStream'] = array( 'title' => t('Add stream'), 'page callback' => 'add_stream', - // 'type' => MENU_LOCAL_TASK, 'type' => MENU_CALLBACK, 'access arguments' => array('add fedora datastreams') ); From 33b0c3b3ce68d9be4f6e72e2535f37c9bb475697 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Wed, 11 Apr 2012 15:58:27 -0300 Subject: [PATCH 203/247] Additional error handling, and add wrapp for modifyDatastream Wrapping allows either content or a file to be pushed, independant of the controlGroup... You don't have to know if you need to push by value or reference! --- api/fedora_item.inc | 96 ++++++++++++++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 32 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 9863816d..65ec4751 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -103,9 +103,14 @@ class Fedora_Item { function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) { module_load_include('inc', 'fedora_repository', 'MimeClass'); if (!is_file($datastream_file)) { - drupal_set_message("$datastream_file not found<br />", 'warning'); + drupal_set_message(t('The datastream file %datastream_file could not found! (or is not a regular file...)', array('%datastream_file' => $datastream_file)), 'warning'); return; } + elseif (!is_readable($datastream_file)) { + drupal_set_message(t('The datastream file %datastream_file could not be read! (likely due to permissions...)', array('%datastream_file' => $datastream_file)), 'warning'); + return; + } + if (empty($datastream_mimetype)) { // Get mime type from the file extension. $mimetype_helper = new MimeClass(); @@ -434,7 +439,7 @@ RDF; * @param type $as_of_date_time * @return type */ - function get_datastream($dsid, $as_of_date_time = "") { + function get_datastream($dsid, $as_of_date_time = '') { $params = array( 'pid' => $this->pid, 'dsID' => $dsid, @@ -530,7 +535,7 @@ RDF; * @return datastream object * get the mimetype size etc. in one shot. instead of iterating throught the datastream list for what we need */ - function get_datastream_info($dsid, $as_of_date_time = "") { + function get_datastream_info($dsid, $as_of_date_time = '') { $params = array( 'pid' => $this->pid, 'dsID' => $dsid, @@ -563,7 +568,7 @@ RDF; // datastream, instead of returning it as an array, only // the single item will be returned directly. We have to // check for this. - if (count($this->datastreams_list->datastreamDef) >= 2) { + if (count($this->datastreams_list->datastreamDef) > 1) { foreach ($this->datastreams_list->datastreamDef as $ds) { if (!is_object($ds)) { print_r($ds); @@ -644,7 +649,7 @@ RDF; try { $relsext = $this->get_datastream_dissemination('RELS-EXT'); } catch (exception $e) { - drupal_set_message(t("Error retrieving RELS-EXT of object $pid"), 'error'); + drupal_set_message(t('Error retrieving RELS-EXT of object %pid.', array('%pid' => $pid)), 'error'); return $relationships; } @@ -668,30 +673,8 @@ RDF; } function get_models() { - $relationships = array(); - try { - $relsext = $this->get_datastream_dissemination('RELS-EXT'); - } catch (exception $e) { - drupal_set_message(t("Error retrieving RELS-EXT of object $pid"), 'error'); - return $relationships; - } - - // Parse the RELS-EXT into an associative array. - $relsextxml = new DOMDocument(); - $relsextxml->loadXML($relsext); - $relsextxml->normalizeDocument(); - $mods = $relsextxml->getElementsByTagNameNS(FEDORA_MODEL_URI, '*'); - foreach ($mods as $child) { - if (empty($relationship) || preg_match("/$relationship/", $child->tagName)) { - $relationships[] = array( - 'subject' => $this->pid, - 'predicate' => $child->tagName, - 'object' => substr($child->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource'), 12), - ); - } - } - - return $relationships; + //This is/was formerly just a copy/paste jobbie, without the parameter being passable... + return $this->get_relationships(); } /** @@ -895,6 +878,53 @@ RDF; return self::soap_call('modifyObject', $params, $quiet); } + /** + * Wrap modify by value and reference, so that the proper one gets called in the correct instance. (value if inline XML, reference otherwise) + * + * First tries to treat the passed in value as a filename, tries using as contents second. + * Coerces the data into what is required, and passes it on to the relevant function. + */ + function modify_datastream($filename_or_content, $dsid, $label, $mime_type, $force = FALSE, $logMessage='Modified by Islandora API') { + //Determine if it's inline xml; if it is, modify by value + if ($this->get_datastream($dsid)->controlGroup === 'X') { + $content = '<null/>'; + if (is_file($filename_or_content) && is_readable($filename_or_content)) { + $content = file_get_contents($filename_or_content); + } + else { + $content = $filename_or_content; + } + + $this->modify_datastream_by_value($content, $dsid, $label, $mime_type, $force, $logMessage); + } + //Otherwise, write to web-accessible temp file and modify by reference. + else { + $file = ''; + $created_temp = FALSE; + if (is_file($filename_or_content) && is_readable($filename_or_content)) { + $file = $filename_or_content; + } + else { + //Get Drupal temp file + $file = file_directory_path(); + $file = tempnam($file, 'fedora_modification'); //Be careful... Does this return the full path to the file? + //Push contents to file + file_put_contents($file, $filename_or_content); + $created_temp = TRUE; + } + + $file_url = url($file, array( + 'absolute' => TRUE, + )); + + $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); + + if ($created_temp && is_file($file) && is_writable($file)) { + unlink($file); + } + } + } + /** * Modify datastream by reference * @param type $external_url @@ -982,9 +1012,11 @@ RDF; module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); self::$connection_helper = new ConnectionHelper(); } - $url = (array_search($function, self::$SoapManagedFunctions) !== FALSE) ? - variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl') : - variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'); + $url = ( + in_array($function, self::$SoapManagedFunctions)? + variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'): + variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl') + ); try { $soap_client = self::$connection_helper->getSoapClient($url); if (isset($soap_client)) { From 899f1fb5ad2bc46142febe4b14c12d5e57a38e21 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Wed, 11 Apr 2012 17:01:52 -0300 Subject: [PATCH 204/247] Documentation and improvement of wrapper. --- api/fedora_item.inc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 65ec4751..b647e514 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -883,6 +883,13 @@ RDF; * * First tries to treat the passed in value as a filename, tries using as contents second. * Coerces the data into what is required, and passes it on to the relevant function. + * + * @param $filename_or_content Either a filename to add, or an string of content. + * @param $dsid The DSID to update + * @param $label A label to withwhich to update the datastream + * @param $mime_type Mimetype for the data being pushed into the datastream + * @param $force Dunno, refer to underlying functions/SOAP interface. We just pass it like a chump. + * @param $logMessage A message for the audit log. */ function modify_datastream($filename_or_content, $dsid, $label, $mime_type, $force = FALSE, $logMessage='Modified by Islandora API') { //Determine if it's inline xml; if it is, modify by value @@ -902,25 +909,24 @@ RDF; $file = ''; $created_temp = FALSE; if (is_file($filename_or_content) && is_readable($filename_or_content)) { - $file = $filename_or_content; + $file = $filename_or_content; + $original_path = $file; + // Temporarily move file to a web-accessible location. + file_copy($file, file_directory_path()); + $created_temp = ($original_path != $file); } else { - //Get Drupal temp file - $file = file_directory_path(); - $file = tempnam($file, 'fedora_modification'); //Be careful... Does this return the full path to the file? - //Push contents to file - file_put_contents($file, $filename_or_content); + //Push contents to a web-accessible file + $file = file_save_data($filename_or_content, file_directory_path()); $created_temp = TRUE; } - $file_url = url($file, array( - 'absolute' => TRUE, - )); + $file_url = file_create_url($file); $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); if ($created_temp && is_file($file) && is_writable($file)) { - unlink($file); + file_delete($file); } } } From 280243ea65a05eb70dfafd780f1397d2320fa4b3 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Wed, 11 Apr 2012 17:10:19 -0300 Subject: [PATCH 205/247] Drupal-parsable docs --- api/fedora_item.inc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index b647e514..1063262d 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -879,17 +879,25 @@ RDF; } /** + * Wrap modify by value and reference + * * Wrap modify by value and reference, so that the proper one gets called in the correct instance. (value if inline XML, reference otherwise) * * First tries to treat the passed in value as a filename, tries using as contents second. * Coerces the data into what is required, and passes it on to the relevant function. * - * @param $filename_or_content Either a filename to add, or an string of content. - * @param $dsid The DSID to update - * @param $label A label to withwhich to update the datastream - * @param $mime_type Mimetype for the data being pushed into the datastream - * @param $force Dunno, refer to underlying functions/SOAP interface. We just pass it like a chump. - * @param $logMessage A message for the audit log. + * @param string $filename_or_content + * Either a filename to add, or an string of content. + * @param string $dsid + * The DSID to update + * @param string $label + * A label to withwhich to update the datastream + * @param string $mime_type + * Mimetype for the data being pushed into the datastream + * @param boolean $force + * Dunno, refer to underlying functions/SOAP interface. We just pass it like a chump. + * @param string $logMessage + * A message for the audit log. */ function modify_datastream($filename_or_content, $dsid, $label, $mime_type, $force = FALSE, $logMessage='Modified by Islandora API') { //Determine if it's inline xml; if it is, modify by value From 8e3e02634c0a1fc34e128057881ea3768ac69532 Mon Sep 17 00:00:00 2001 From: William Panting <willtp87@hotmail.com> Date: Wed, 11 Apr 2012 17:15:40 -0300 Subject: [PATCH 206/247] object details tab is now diableable --- fedora_repository.module | 20 +++++++++++++------- formClass.inc | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 42eb4c49..96918dc8 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1027,13 +1027,19 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU // Add a 'manage object' tab for all objects, where detailed list of content is shown. $obj = new FedoraObjectDetailedContent($pid); - $object_details = $obj->showFieldSets(); - if ($object_details['fedora_object_details']['#selected'] == TRUE) { - foreach ($cmodels_tabs as &$cmodel_tab) { - if (is_array($cmodel_tab)) { - $cmodel_tab['#selected'] = FALSE; - } - } + + if(variable_get('fedora_repository_show_object_details_tab', FALSE)) {//can disable showing the object details tab in admin UI + $object_details = $obj->showFieldSets(); + if ($object_details['fedora_object_details']['#selected'] == TRUE) { + foreach ($cmodels_tabs as &$cmodel_tab) { + if (is_array($cmodel_tab)) { + $cmodel_tab['#selected'] = FALSE; + } + } + } + } + else { + $object_details = array(); } $hook_tabs = module_invoke_all('islandora_tabs', $content_models, $pid); diff --git a/formClass.inc b/formClass.inc index 293a83ec..d107c047 100644 --- a/formClass.inc +++ b/formClass.inc @@ -301,6 +301,22 @@ class formClass { '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); + + $form['tabs'] = array(//have tabs options (like disable) + '#type' => 'fieldset', + '#title' => t('Tabs Configuration'), + '#description' => t('Configure the tabs avaialble when viewing Fedora objects.'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['tabs']['fedora_repository_show_object_details_tab'] = array(//when checked show object details tab + '#type' => 'checkbox', + '#title' => t('Show Object Details Tab'), + '#default_value' => variable_get('fedora_repository_show_object_details_tab', TRUE), + '#description' => t("When enabled, the 'Object Details' tab will be visible when visiting objects if the user has the correct permissions."), + ); + $form['advanced'] = array( '#type' => 'fieldset', '#title' => t('Advanced configuration options'), From 63b089cedd96d3ad5571ba2a6bb58ca0a1a056b8 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 12 Apr 2012 09:30:32 -0300 Subject: [PATCH 207/247] Allow for literals in add_relationship, and use wrapped modify_datastream Slight improvements, and RELS-EXT does not have to be inline XML (can be managed) --- api/fedora_item.inc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 1063262d..318ce114 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -212,11 +212,16 @@ class Fedora_Item { /** * Add a relationship string to this object's RELS-EXT. * does not support rels-int yet. - * @param type $relationship - * @param type $object - * @param type $namespaceURI + * @param string $relationship + * The predicate/relationship tag to add + * @param string $object + * The object to be related to. + * @param string $namespaceURI + * The predicate namespace. + * @param boolean $literal_value + * Whether or not the object should be added as a URI (FALSE) or a literal (TRUE). */ - function add_relationship($relationship, $object, $namespaceURI = RELS_EXT_URI) { + function add_relationship($relationship, $object, $namespaceURI = RELS_EXT_URI, $literal_value = FALSE) { //dd($this, 'The Fedora_Item'); $ds_list = $this->get_datastreams_list_as_array(); $f_prefix = 'info:fedora/'; @@ -236,7 +241,7 @@ RDF; $relsext = $this->get_datastream_dissemination('RELS-EXT'); //dd('Got RELS-EXT'); - if (substr($object, 0, strlen($f_prefix)) !== $f_prefix) { + if (!$literal_value && strpos($object, $f_prefix) !== 0) { $object = $f_prefix . $object; } @@ -256,10 +261,16 @@ RDF; // Create the new relationship node. $newrel = $relsextxml->createElementNS($namespaceURI, $relationship); - $newrel->setAttribute('rdf:resource', $object); + if ($literal_value) { + $newrel->appendChild($relsextxml->createTextNode($object)); + } + else { + $newrel->setAttribute('rdf:resource', $object); + } $description->appendChild($newrel); - $this->modify_datastream_by_value($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); + + $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); //print ($description->dump_node()); /* $params = array( 'pid' => $this->pid, From a691d23b8366ec33f02a2f3a7ecbf2f40645aaf5 Mon Sep 17 00:00:00 2001 From: William Panting <willtp87@hotmail.com> Date: Thu, 12 Apr 2012 09:38:34 -0300 Subject: [PATCH 208/247] acted on comments from jonathangreen --- fedora_repository.module | 3 ++- formClass.inc | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 96918dc8..f477e9f5 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1028,7 +1028,8 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU // Add a 'manage object' tab for all objects, where detailed list of content is shown. $obj = new FedoraObjectDetailedContent($pid); - if(variable_get('fedora_repository_show_object_details_tab', FALSE)) {//can disable showing the object details tab in admin UI + //can disable showing the object details tab in admin UI + if (variable_get('fedora_repository_show_object_details_tab', TRUE)) { $object_details = $obj->showFieldSets(); if ($object_details['fedora_object_details']['#selected'] == TRUE) { foreach ($cmodels_tabs as &$cmodel_tab) { diff --git a/formClass.inc b/formClass.inc index d107c047..8f936f24 100644 --- a/formClass.inc +++ b/formClass.inc @@ -301,16 +301,16 @@ class formClass { '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); - - $form['tabs'] = array(//have tabs options (like disable) + //have tabs options (like disable) + $form['tabs'] = array( '#type' => 'fieldset', '#title' => t('Tabs Configuration'), '#description' => t('Configure the tabs avaialble when viewing Fedora objects.'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); - - $form['tabs']['fedora_repository_show_object_details_tab'] = array(//when checked show object details tab + //when checked show object details tab + $form['tabs']['fedora_repository_show_object_details_tab'] = array( '#type' => 'checkbox', '#title' => t('Show Object Details Tab'), '#default_value' => variable_get('fedora_repository_show_object_details_tab', TRUE), From 27be8ded87ad814f133fdb9edb3b7df65d6e088a Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 12 Apr 2012 09:38:38 -0300 Subject: [PATCH 209/247] Add 'quiet' parameter to modify_datastream wrapper. --- api/fedora_item.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 318ce114..2079d060 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -909,8 +909,10 @@ RDF; * Dunno, refer to underlying functions/SOAP interface. We just pass it like a chump. * @param string $logMessage * A message for the audit log. + * @param boolean $quiet + * Error suppression? Refer to soap_call for usage (just passed along here). */ - function modify_datastream($filename_or_content, $dsid, $label, $mime_type, $force = FALSE, $logMessage='Modified by Islandora API') { + function modify_datastream($filename_or_content, $dsid, $label, $mime_type, $force = FALSE, $logMessage='Modified by Islandora API', $quiet=FALSE) { //Determine if it's inline xml; if it is, modify by value if ($this->get_datastream($dsid)->controlGroup === 'X') { $content = '<null/>'; From 0983d5c05911b8caf75bde1069d82150be1e7518 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 12 Apr 2012 09:40:40 -0300 Subject: [PATCH 210/247] Undo some minor changes... --- fedora_repository.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 30293e0f..45f99d01 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1702,12 +1702,12 @@ function fedora_repository_required_fedora_objects() { 'dsid' => 'ISLANDORACM', 'datastream_file' => "./$module_path/content_models/COLLECTIONCM.xml", 'dsversion' => 2, - 'cmodel' => 'info:fedora/fedora-system:ContentModel-3.0', + 'cmodel' => 'fedora-system:ContentModel-3.0', ), array( 'pid' => 'islandora:root', 'label' => 'Islandora Top-level Collection', - 'cmodel' => 'info:fedora/islandora:collectionCModel', + 'cmodel' => 'islandora:collectionCModel', 'datastreams' => array( array( 'dsid' => 'COLLECTION_POLICY', From 45209b87fc813bac6113a098b4e4b4334a87453c Mon Sep 17 00:00:00 2001 From: William Panting <willtp87@hotmail.com> Date: Thu, 12 Apr 2012 09:43:47 -0300 Subject: [PATCH 211/247] changed text for object details toggle as David Wilcox asked --- formClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 8f936f24..0fa07e98 100644 --- a/formClass.inc +++ b/formClass.inc @@ -314,7 +314,7 @@ class formClass { '#type' => 'checkbox', '#title' => t('Show Object Details Tab'), '#default_value' => variable_get('fedora_repository_show_object_details_tab', TRUE), - '#description' => t("When enabled, the 'Object Details' tab will be visible when visiting objects if the user has the correct permissions."), + '#description' => t("When enabled, the 'Object Details' tab will be visible to users with the correct permissions when viewing an object in the repository"), ); $form['advanced'] = array( From 04a0a763786020b950e6c22943bcc142bad0f289 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 12 Apr 2012 10:11:34 -0300 Subject: [PATCH 212/247] Produce a purge_relationships function which is more similar to add_relationship --- api/fedora_item.inc | 48 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 2079d060..02d45907 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -211,7 +211,9 @@ class Fedora_Item { /** * Add a relationship string to this object's RELS-EXT. + * * does not support rels-int yet. + * * @param string $relationship * The predicate/relationship tag to add * @param string $object @@ -284,8 +286,52 @@ RDF; */ } + /** + * Purge/delete relationships string from this object's RELS-EXT. + * + * does not support rels-int yet. + * + * @param string $relationship + * The predicate/relationship tag to add + * @param string $object + * The object to be related to. (NULL/value for which empty() evaluates to true will remove all relations of the given type, ignoring $literal_value) + * @param string $namespaceURI + * The predicate namespace. + * @param boolean $literal_value + * Whether or not the object should be added as a URI (FALSE) or a literal (TRUE). + */ + function purge_relationships($relationship, $object, $namespaceURI = RELS_EXT_URI, $literal_value = FALSE) { + $relsext = $this->get_datastream_dissemination('RELS-EXT'); + + $relsextxml = new DomDocument(); + $relsextxml->loadXML($relsext); + $modified = FALSE; + $rels = $relsextxml->getElementsByTagNameNS($namespaceURI, $relationship); + if (!empty($rels)) { + foreach ($rels as $rel) { + if ( //If either no object is specified, or the object matches (in either the literal or URI case), remove this node from it's parent, and mark as changed. + empty($object) || + (!$literal_value && $rel->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource') == $object) || + ($literal_value && $rel->textContent == $object)) { + $rel->parentNode->removeChild($rel); + $modified = TRUE; + } + } + } + + //Save changes. + if ($modified) { + $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'text/xml'); + } + + //Return whether or not we've introduced any changes. + return $modified; + } + /** * Removes the given relationship from the item's RELS-EXT and re-saves it. + * @deprecated + * Dropped in favour of purge_relationships, which follows the same paradigm as add_relationship. This function tries to figure out the predicate URI based on the prefix/predicate given, which requires specific naming... * @param string $relationship * @param string $object */ @@ -337,7 +383,7 @@ RDF; } } if ($modified) { - $this->modify_datastream_by_value($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'text/xml'); + $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'text/xml'); } return $modified; } From 1c568f760d08a70343a82867dfdc50a0ae9b172e Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 12 Apr 2012 10:20:16 -0300 Subject: [PATCH 213/247] Remove unnecessary comments --- api/fedora_item.inc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 02d45907..d107a844 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -234,14 +234,10 @@ class Fedora_Item { </rdf:Description> </rdf:RDF> RDF; - //dd($rdf_string, 'RELS-EXT RDF being added'); $this->add_datastream_from_string($rdf_string, 'RELS-EXT', 'Fedora object-to-object relationship metadata', 'application/rdf+xml', 'X'); - //dd('Added'); } - //dd('Getting RELS-EXT'); $relsext = $this->get_datastream_dissemination('RELS-EXT'); - //dd('Got RELS-EXT'); if (!$literal_value && strpos($object, $f_prefix) !== 0) { $object = $f_prefix . $object; @@ -292,13 +288,15 @@ RDF; * does not support rels-int yet. * * @param string $relationship - * The predicate/relationship tag to add + * The predicate/relationship tag to delete * @param string $object * The object to be related to. (NULL/value for which empty() evaluates to true will remove all relations of the given type, ignoring $literal_value) * @param string $namespaceURI * The predicate namespace. * @param boolean $literal_value - * Whether or not the object should be added as a URI (FALSE) or a literal (TRUE). + * Whether or not the object should be looked for as a URI (FALSE) or a literal (TRUE). + * @return boolean + * Whether or not this operation has produced any changes in the RELS-EXT */ function purge_relationships($relationship, $object, $namespaceURI = RELS_EXT_URI, $literal_value = FALSE) { $relsext = $this->get_datastream_dissemination('RELS-EXT'); @@ -330,6 +328,7 @@ RDF; /** * Removes the given relationship from the item's RELS-EXT and re-saves it. + * * @deprecated * Dropped in favour of purge_relationships, which follows the same paradigm as add_relationship. This function tries to figure out the predicate URI based on the prefix/predicate given, which requires specific naming... * @param string $relationship @@ -1165,7 +1164,6 @@ RDF; $object_properties->appendChild($owner_property); $root_element->appendChild($object_properties); $foxml->appendChild($root_element); - //dd($foxml->saveXML(), 'XML to ingest'); Worked on 2012/01/16 return $foxml; } From aa7029a2f22312252e88b48b0a81f9f95017dbd4 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 12 Apr 2012 17:02:29 -0300 Subject: [PATCH 214/247] Fix parameters to variable_get. Fool was I to think it was originally trying to get the correct variable (fedora_repository_title; actually should be fedora_repository_name) --- formClass.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 8648fe20..e6a3523b 100644 --- a/formClass.inc +++ b/formClass.inc @@ -70,8 +70,9 @@ class formClass { 'access arguments' => array('view fedora collection'), ); $items['fedora/repository'] = array( + 'title' => '', 'title callback' => 'variable_get', - 'title arguments' => array('fedora_repository_title', 'Digital Repository'), + 'title arguments' => array('fedora_repository_name', 'Digital Repository'), 'page callback' => 'repository_page', 'type' => MENU_NORMAL_ITEM, 'access arguments' => array('view fedora collection'), From a8b45fb6d73251008a62696363d0e7bcb1b7856d Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 13 Apr 2012 08:59:05 -0300 Subject: [PATCH 215/247] Reindent query. --- ObjectHelper.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 81d56d4e..a9358df0 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -955,14 +955,14 @@ class ObjectHelper { } else { $query_string = 'select $parentObject $title $content from <#ri> - where (<info:fedora/' . $pid . '> <fedora-model:label> $title - and $parentObject <fedora-model:hasModel> $content - and (<info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject - or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject - or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject) - and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) - minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> - order by $title desc'; + where (<info:fedora/' . $pid . '> <fedora-model:label> $title + and $parentObject <fedora-model:hasModel> $content + and (<info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject + or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject + or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject) + and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) + minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> + order by $title desc'; $query_string = htmlentities(urlencode($query_string)); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); From a41a256be20dcd6e72efd52947e8ec4a40c0543b Mon Sep 17 00:00:00 2001 From: Paul Pound <ppound@upei.ca> Date: Fri, 13 Apr 2012 09:41:09 -0300 Subject: [PATCH 216/247] Fix for Islandora 504 reverted SecurityClass changes --- SecurityClass.inc | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/SecurityClass.inc b/SecurityClass.inc index ced11ba7..970b108b 100644 --- a/SecurityClass.inc +++ b/SecurityClass.inc @@ -22,17 +22,15 @@ class SecurityClass { drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); } - /** - * reads the specified stream of the parent object to see if the user can ingest in this collection. - * - * @global object $user - * @param string $collection_pid - * @return boolean + /** + * canIngestHere ?? + * @global type $user + * @param type $collection_pid + * @return type */ function canIngestHere($collection_pid) { global $user; module_load_include('inc', 'fedora_repository', 'ObjectHelper'); - module_load_include('inc', 'islandora_xacml_api', 'Xacml'); $objectHelper = new ObjectHelper(); // get the childsecurity policy from the collection. $policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS :: $SECURITY_CLASS_SECURITY_STREAM, FALSE); @@ -41,9 +39,13 @@ class SecurityClass { // maybe we should return FALSE here?? would be more secure. return TRUE; } - $xacml = new Xacml($policyStream); - $allowedUsers = $xacml->managementRule->getUsers(); - $allowedRoles = $xacml->managementRule->getRoles(); + $allowedUsersAndRoles = $this->getAllowedUsersAndRoles($policyStream); + if (!$allowedUsersAndRoles) { + // error processing stream so don't let them ingest here. + return FALSE; + } + $allowedUsers = $allowedUsersAndRoles["users"]; + $allowedRoles = $allowedUsersAndRoles["roles"]; foreach ($user->roles as $role) { if (in_array($role, $allowedRoles)) { @@ -58,10 +60,7 @@ class SecurityClass { } /** - * Depracated should use the xacml api for this - * * parses our simple xacml policies checking for users or roles that are allowed to ingest - * * @param type $policyStream * @return type */ @@ -154,8 +153,6 @@ class SecurityClass { } /** - * Depracated should use the xacml api for this - * * Add a list of allowed users and roles to the given policy stream and return it. * * @param string $policy_stream From 9bbf9e8423ffa17b533c41665999010831298071 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Mon, 16 Apr 2012 10:11:27 -0300 Subject: [PATCH 217/247] ISLANDORA-527: Fixed the SOAP URL. --- CollectionClass.inc | 4 ++-- api/fedora_item.inc | 2 +- fedora_repository.info | 2 +- fedora_repository.module | 10 +++------- formClass.inc | 2 +- plugins/Flv.inc | 2 +- plugins/Refworks.inc | 2 +- 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 08f669e0..30035594 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -1,4 +1,4 @@ -<?php +/<?php /** * @file @@ -442,7 +442,7 @@ class CollectionClass { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); $connectionHelper = new ConnectionHelper(); try { - $soapClient = $connectionHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $soapClient = $connectionHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M')); $pidNameSpace = variable_get('fedora_repository_pid', 'vre:'); $pidNameSpace = substr($pidNameSpace, 0, strpos($pidNameSpace, ":")); $params = array( diff --git a/api/fedora_item.inc b/api/fedora_item.inc index e6477915..50330d6a 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -977,7 +977,7 @@ class Fedora_Item { self::$connection_helper = new ConnectionHelper(); } $url = (array_search($function, self::$SoapManagedFunctions) !== FALSE) ? - variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl') : + variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M') : variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'); try { $soap_client = self::$connection_helper->getSoapClient($url); diff --git a/fedora_repository.info b/fedora_repository.info index 5d3762e4..6d3135d1 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -4,5 +4,5 @@ dependencies[] = tabs dependencies[] = islandora_content_model_forms description = Shows a list of items in a fedora collection. package = Islandora -version = 11.3.1 +version = 6.x-12.1-RC1 core = 6.x diff --git a/fedora_repository.module b/fedora_repository.module index f477e9f5..06d220c7 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -538,7 +538,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { ); try { $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M')); $object = $client->__soapCall('purgeObject', array($params)); unset($form_state['storage']['confirm']); } catch (exception $e) { @@ -597,7 +597,6 @@ function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) { function fedora_repository_purge_stream_form_submit($form, &$form_state) { global $base_url; module_load_include('inc', 'fedora_repository', 'api/fedora_item'); -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $pid = $form_state['values']['pid']; $item = new Fedora_Item($pid); $dsid = $form_state['values']['dsid']; @@ -636,9 +635,7 @@ function fedora_repository_replace_stream($pid, $dsId, $dsLabel = '', $collectio * @return type */ function fedora_repository_replace_stream_form(&$form_state, $pid, $dsId, $dsLabel) { -//module_load_module_load_include('hp', ''Fedora_Repository'', 'config', 'fedora_repository', ''); module_load_include('inc', 'Fedora_Repository', 'formClass'); -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $replaceDataStreamForm = new formClass(); return $replaceDataStreamForm->createReplaceDataStreamForm($pid, $dsId, $dsLabel, $form_state); } @@ -832,11 +829,10 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) { global $base_url; if (strstr($form_state['clicked_button']['#id'], 'edit-submit')) { -//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); $soap_helper = new ConnectionHelper(); - $client = $soap_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $client = $soap_helper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M')); -// Check the content model for a custom edit metadata form submit function. + // Check the content model for a custom edit metadata form submit function. if (isset($form_state['values']['pid'])) { module_load_include('inc', 'fedora_repository', 'ContentModel'); if (($cm = ContentModel::loadFromObject($form_state['values']['pid'])) !== FALSE) { diff --git a/formClass.inc b/formClass.inc index 0fa07e98..8512fd61 100644 --- a/formClass.inc +++ b/formClass.inc @@ -255,7 +255,7 @@ class formClass { $form['fedora_soap_manage_url'] = array( '#type' => 'textfield', '#title' => t('Fedora SOAP management URL'), - '#default_value' => variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'), '#description' => t('The URL to use for SOAP API-M connections'), + '#default_value' => variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M'), '#description' => t('The URL to use for SOAP API-M connections'), '#required' => TRUE, '#weight' => -10 ); diff --git a/plugins/Flv.inc b/plugins/Flv.inc index b5f159b2..8d2079b6 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -110,7 +110,7 @@ class FormBuilder { try { $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M')); if ($client == NULL) { drupal_set_message(t('Error getting SOAP client.'), 'error'); diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 2c86caa7..70b0abeb 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -286,7 +286,7 @@ class Refworks { try { $soapHelper = new ConnectionHelper(); - $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl')); + $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M')); if ($client == NULL) { drupal_set_message(t('Error getting SOAP client.'), 'error'); From 742a35043c516d03a051480677327ef77e35df82 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Mon, 16 Apr 2012 10:17:45 -0300 Subject: [PATCH 218/247] Updated version number --- fedora_repository.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_repository.info b/fedora_repository.info index 6d3135d1..018910bf 100644 --- a/fedora_repository.info +++ b/fedora_repository.info @@ -4,5 +4,5 @@ dependencies[] = tabs dependencies[] = islandora_content_model_forms description = Shows a list of items in a fedora collection. package = Islandora -version = 6.x-12.1-RC1 +version = 6.x-dev core = 6.x From a2d528b91f29b14ee469a57d8a6726f5b6bdad7d Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 16 Apr 2012 16:33:02 -0300 Subject: [PATCH 219/247] Fix a couple more places where the incorrect variable name was used. --- ObjectHelper.inc | 2 +- formClass.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index a9358df0..b671e1d5 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -981,7 +981,7 @@ class ObjectHelper { $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { //$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(variable_get('fedora_repository_title', 'Digital repository'), 'fedora/repository'); + $breadcrumbs[] = l(variable_get('fedora_repository_name', 'Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } elseif ($level > 0) { diff --git a/formClass.inc b/formClass.inc index e6a3523b..c17bb35b 100644 --- a/formClass.inc +++ b/formClass.inc @@ -288,7 +288,7 @@ class formClass { $form['fedora_repository_title'] = array( '#type' => 'textfield', '#title' => t('Digital Repository Title'), - '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), + '#default_value' => variable_get('fedora_repository_name', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); $form['advanced'] = array( From 971b90d777e9436afa5db4581f2f8fdf94ec3d24 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Tue, 17 Apr 2012 09:49:56 -0300 Subject: [PATCH 220/247] Updated version number i forgot. --- plugins/fedora_imageapi.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index 3a9deea7..cbd6b2ae 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -3,5 +3,5 @@ description = Adds image manipulation support through a REST interface package = Islandora Dependencies dependencies[] = fedora_repository dependencies[] = imageapi -version = 11.3.1 +version = 6.x-dev core = 6.x From aa7f8fe24597f366397212f77ad590bdd4ff4caa Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Tue, 17 Apr 2012 14:42:02 -0300 Subject: [PATCH 221/247] Fix a tiny error introduced... --- formClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index c17bb35b..e6a3523b 100644 --- a/formClass.inc +++ b/formClass.inc @@ -288,7 +288,7 @@ class formClass { $form['fedora_repository_title'] = array( '#type' => 'textfield', '#title' => t('Digital Repository Title'), - '#default_value' => variable_get('fedora_repository_name', 'Digital Repository'), + '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); $form['advanced'] = array( From 2c47f9bfb2db53a716e67654409bc03a814e4c87 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Tue, 17 Apr 2012 13:45:04 -0400 Subject: [PATCH 222/247] Allow returns from modifications... --- api/fedora_item.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/fedora_item.inc b/api/fedora_item.inc index d107a844..66259275 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -268,7 +268,7 @@ RDF; $description->appendChild($newrel); - $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); + return $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); //print ($description->dump_node()); /* $params = array( 'pid' => $this->pid, @@ -958,6 +958,8 @@ RDF; * Error suppression? Refer to soap_call for usage (just passed along here). */ function modify_datastream($filename_or_content, $dsid, $label, $mime_type, $force = FALSE, $logMessage='Modified by Islandora API', $quiet=FALSE) { + $toReturn = NULL; + //Determine if it's inline xml; if it is, modify by value if ($this->get_datastream($dsid)->controlGroup === 'X') { $content = '<null/>'; @@ -968,7 +970,7 @@ RDF; $content = $filename_or_content; } - $this->modify_datastream_by_value($content, $dsid, $label, $mime_type, $force, $logMessage); + $toReturn = $this->modify_datastream_by_value($content, $dsid, $label, $mime_type, $force, $logMessage); } //Otherwise, write to web-accessible temp file and modify by reference. else { @@ -989,12 +991,14 @@ RDF; $file_url = file_create_url($file); - $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); + $toReturn = $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); if ($created_temp && is_file($file) && is_writable($file)) { file_delete($file); } } + + return $toReturn; } /** From 0cacb11a543e40f7ee1d8955269197579e526c41 Mon Sep 17 00:00:00 2001 From: jonathangreen <jonathan@discoverygarden.ca> Date: Tue, 17 Apr 2012 15:01:52 -0300 Subject: [PATCH 223/247] Added a slash by accident to CollectionClass.inc Removed a slash that I added by accident to CollectionClass.inc. It came before the PHP tags so it was just adding it to the page. --- CollectionClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 27a497d7..a46b1b5f 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -1,4 +1,4 @@ -/<?php +<?php /** * @file From 0e5bab57062f07cb3f3b320916196f5f2bae1aca Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 19 Apr 2012 16:31:30 -0300 Subject: [PATCH 224/247] Overhaul breadcrumbs and nuke fedora_repository_{name,title} Addresses the title/name issues of ISLANDORA-562 (by getting rid of them). Menu/root title is provided through the menu system. --- CollectionClass.inc | 9 +- ObjectHelper.inc | 194 +++++++++++++++++++++++++++++++-------- README | 4 +- api/fedora_utils.inc | 6 +- fedora_repository.module | 3 +- formClass.inc | 23 +---- 6 files changed, 170 insertions(+), 69 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index a46b1b5f..43d06be0 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -607,7 +607,7 @@ class CollectionClass { * @param int $pageNumber * @return type */ - function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { + function renderCollection($content, $pid, $dsId, $collectionName, $pageNumber = NULL) { $path = drupal_get_path('module', 'fedora_repository'); global $base_url; $collection_pid = $pid; //we will be changing the pid later maybe @@ -620,17 +620,14 @@ class CollectionClass { $fedoraItem = NULL; - - - $collectionName = $collection; - if (!$pageNumber) { $pageNumber = 1; } if (empty($collectionName)) { - $collectionName = variable_get('fedora_repository_name', 'Collection'); + $collectionName = menu_get_active_title(); } + $xslContent = $this->getXslContent($pid, $path); //get collection list and display using xslt------------------------------------------- diff --git a/ObjectHelper.inc b/ObjectHelper.inc index aeaf09d0..85c0ab4b 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -938,58 +938,62 @@ class ObjectHelper { /** * Builds an array of drupal links for use in breadcrumbs. * + * @todo Make fully recursive... + * * @global type $base_url * @param type $pid * @param type $breadcrumbs * @param type $level */ - function getBreadcrumbs($pid, &$breadcrumbs, $level=10) { + function getBreadcrumbs($pid, &$breadcrumbs) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; - if ($pid == variable_get('fedora_repository_pid', 'islandora:root')) { - //$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(variable_get('fedora_repository_title', 'Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(t('Home'), $base_url); + static $max_level = 10; + static $level = -1; + + if (count($breadcrumbs) === 0) { + $level = $max_level; + } + + $root = variable_get('fedora_repository_pid', 'islandora:root'); + + if ($pid == $root) { + $breadcrumbs[] = l(menu_get_active_title(), 'fedora/repository'); + $breadcrumbs[] = l(t('Home'), '<front>'); } else { $query_string = 'select $parentObject $title $content from <#ri> - where (<info:fedora/' . $pid . '> <fedora-model:label> $title - and $parentObject <fedora-model:hasModel> $content - and (<info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject - or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject - or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject) - and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) - minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> - order by $title desc'; - $query_string = htmlentities(urlencode($query_string)); - - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; - - $result = preg_split('/[\r\n]+/', do_curl($url)); - array_shift($result); // throw away first line - $matches = str_getcsv(join("\n", $result)); - if (count($matches) >= 2) { - $parent = preg_replace('/^info:fedora\//', '', $matches[0]); - - if (0 == strlen($matches[1])) { - $matches[1] = "Unlabeled Object"; + where ( + <info:fedora/' . $pid . '> <fedora-model:label> $title + and $parentObject <fedora-model:hasModel> $content + and ( + <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject + or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject + or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject + ) + and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active> + ) + minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> + order by $title desc'; + + if (count($results = self::perform_itql_query($query_string)) > 0 && $level > 0) { + $parent = $results[0]['parentObject']; + $this_title = $results[0]['title']; + + if (empty($this_title)) { + $this_title = t('Unlabeled Object'); } - $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); - if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { - //$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(variable_get('fedora_repository_name', 'Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(t('Home'), $base_url); - } - elseif ($level > 0) { - $this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); - } + $breadcrumbs[] = l($this_title, "fedora/repository/$pid"); + + $level--; + $this->getBreadcrumbs($parent, $breadcrumbs); } - else { - $breadcrumbs[] = l(t("Path Calculation Error"), 'fedora/repository/' . $pid); + watchdog('fedora_repository', 'Error generating breadcrumbs for %pid. Verify there exists relationships back up to %root. (May also be due to a hierarchy deeper than %max_depth).', array('%pid' => $pid, '%root' => $root, '%max_depth' => $max_depth), WATCHDOG_WARNING); + $breadcrumbs[] = '...'; //Add an non-link, as we don't know how to get back to the root. + $this->getBreadcrumbs($root, $breadcrumbs); //And render the last two links and break (on the next pass). } } } @@ -1012,5 +1016,121 @@ class ObjectHelper { drupal_set_message(t($configMess . "<br />" . $messMap[$app] . "<hr width='40%' align = 'left'/>", array('%app' => $app)), 'warning', FALSE); } + /** + * Performs the given Resource Index query and return the results. + * + * @param $query string + * A string containing the RI query to perform. + * @param $type string + * The type of query to perform, as used by the risearch interface. + * @param $limit int + * An integer, used to limit the number of results to return. + * @param $offset int + * An integer, used to offset the results (results should be ordered, to + * maintain consistency. + * + * @return array + * Indexed (numerical) array, containing a number of associative arrays, + * with keys being the same as the variable names in the query. + * URIs beginning with 'info:fedora/' will have this beginning stripped + * off, to facilitate their use as PIDs. + */ + protected static function perform_ri_query($query, $type = 'itql', $limit = -1, $offset = 0) { + //Setup the query options... + $options = array( + 'type' => 'tuples', + 'flush' => TRUE, + 'format' => 'Sparql', //Sparql XML is processed into the array below. + 'lang' => $type, + 'query' => $query + ); + //Add limit if provided. + if ($limit > 0) { + $options['limit'] = $limit; + } + //Add offset if provided. + if ($offset > 0) { + $options['offset'] = $offset; + } + + //Construct the query URL. + $queryUrl = url(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), array('query' => $options)); + + //Perform the query. + $curl_result = do_curl_ext($queryUrl); + + //If the query failed, write message to the logs and return. + if (!$curl_result[0]) { + watchdog('fedora_repository', 'Failed to perform %type resource index query: %query', array('%type' => $type, '%query' => $query), WATCHDOG_ERROR); + return FALSE; + } + + //Load the results into a SimpleXMLElement + $doc = new SimpleXMLElement($curl_result[0], 0, FALSE, 'http://www.w3.org/2001/sw/DataAccess/rf1/result'); + + $results = array(); //Storage. + + //Build the results. + foreach ($doc->results->children() as $result) { + //Built a single result. + $r = array(); + foreach ($result->children() as $element) { + $val = NULL; + + $attrs = $element->attributes(); + if (!empty($attrs['uri'])) { + $val = self::pid_uri_to_bare_pid((string)$attrs['uri']); + } + else { + $val = (string)$element; + } + + //Map the name to the value in the array. + $r[$element->getName()] = $val; + } + + //Add the single result to the set to return. + $results[] = $r; + } + return $results; + } + /** + * Thin wrapper for self::_perform_ri_query(). + * + * @see self::_perform_ri_query() + */ + public static function perform_itql_query($query, $limit = -1, $offset = 0) { + return self::perform_ri_query($query, 'itql', $limit, $offset); + } + /** + * Thin wrapper for self::_perform_ri_query(). + * + * @see self::_perform_ri_query() + */ + public static function perform_sparql_query($query, $limit = -1, $offset = 0) { + return self::perform_ri_query($query, 'sparql', $limit, $offset); + } + /** + * Utility function used in self::_perform_ri_query(). + * + * Strips off the 'info:fedora/' prefix from the passed in string. + * + * @param $uri string + * A string containing a URI. + * + * @return string + * The input string less the 'info:fedora/' prefix (if it has it). + * The original string otherwise. + */ + protected static function pid_uri_to_bare_pid($uri) { + $chunk = 'info:fedora/'; + $pos = strpos($uri, $chunk); + if ($pos === 0) { //Remove info:fedora/ chunk + return substr($uri, strlen($chunk)); + } + else { //Doesn't start with info:fedora/ chunk... + return $uri; + } + } } diff --git a/README b/README index f4980bb4..7a642cc4 100644 --- a/README +++ b/README @@ -4,6 +4,6 @@ For installation and customization instructions please see the documentation and https://wiki.duraspace.org/display/ISLANDORA/Islandora -All bugs, feature requests and improvement suggestions are tracked at the DuraSpace JIRA: +All bugs, feature requests and improvement suggestions are tracked at the DuraSpace JIRA: -https://jira.duraspace.org/browse/ISLANDORA \ No newline at end of file +https://jira.duraspace.org/browse/ISLANDORA diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index eb56bdcc..459c86ba 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -85,7 +85,7 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post * an array that consists of three value or NULL if curl is not suported: * - element 0: * The value returned from the curl_exec function call. - * This is either a TRUE or FALSE value or the actual data returned from + * This is either a boolean value or the actual data returned from * accessing the URL. * - element 1: * The error code reslting from attempting to access the URL with curl_exec @@ -93,7 +93,7 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post * A string representing a textual representation of the error code that * resulted from attempting to access the URL with curl_exec */ -function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $post = NULL) { +function do_curl_ext($url, $return_to_variable = TRUE, $number_of_post_vars = 0, $post = NULL) { global $user; // Check if we are inside Drupal and there is a valid user. @@ -113,7 +113,7 @@ function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $p curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_FAILONERROR, TRUE); // Fail on errors - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); // allow redirects curl_setopt($ch, CURLOPT_TIMEOUT, 90); // times out after 90s curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, $return_to_variable); // return into a variable diff --git a/fedora_repository.module b/fedora_repository.module index abec4b9e..8a80c8e3 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -2,8 +2,7 @@ /** * Drupal hook for admin form - * fedora_repository_name is the name of the top level collection this module will query - * fedora_repository_pid is the name of the top level pid. + * * Stores this info in the drupal variables table. * the name and pid can also be passed as url parameters */ diff --git a/formClass.inc b/formClass.inc index c1122182..1d752f3d 100644 --- a/formClass.inc +++ b/formClass.inc @@ -70,9 +70,7 @@ class formClass { 'access arguments' => array('view fedora collection'), ); $items['fedora/repository'] = array( - 'title' => '', - 'title callback' => 'variable_get', - 'title arguments' => array('fedora_repository_name', 'Digital Repository'), + 'title' => 'Digital Repository', 'page callback' => 'repository_page', 'type' => MENU_NORMAL_ITEM, 'access arguments' => array('view fedora collection'), @@ -187,24 +185,16 @@ class formClass { /** * Create admin form - * @return type + * @return array */ function createAdminForm() { if (!user_access('administer site configuration')) { - drupal_set_message(t('You must be a site administrator to edit the Fedora collecitons list.'), 'error'); + drupal_set_message(t('You must be a site administrator to edit the Fedora collections list.'), 'error'); return; } module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $form = array(); - $form['fedora_repository_name'] = array( - '#type' => 'textfield', - '#title' => t('Root Collection Name'), - '#default_value' => variable_get('fedora_repository_name', 'Islandora demos collection'), - '#description' => t('The Name of the Root Collection Object'), - '#required' => TRUE, - '#weight' => -20 - ); $form['fedora_repository_pid'] = array( '#type' => 'textfield', '#title' => t('Root Collection PID'), @@ -285,12 +275,7 @@ class formClass { '#weight' => 0 ); } - $form['fedora_repository_title'] = array( - '#type' => 'textfield', - '#title' => t('Digital Repository Title'), - '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), - '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), - ); + //have tabs options (like disable) $form['tabs'] = array( '#type' => 'fieldset', From 0f15711e4bcb80c5a1394ad56969d2d5fa631093 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 09:48:52 -0300 Subject: [PATCH 225/247] Use function returned by get_t() Because of Drupal's workflow, we may not have access to the regular t() function. Drupal provides get_t() function to address this issue, it just has to be used (and it's return used). Also, use the bloody url function instead of appending $base_url. --- fedora_repository.install | 43 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/fedora_repository.install b/fedora_repository.install index 164ce02e..169d1178 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -34,71 +34,70 @@ function fedora_collections_enable() { * @see _update_cron_notify() */ function fedora_repository_requirements($phase) { - global $base_url; - $requirements = array(); + $t = get_t(); //May not have access to the regular t() function; and so Drupal provides... if ($phase == 'install') { // Test for SOAP - $requirements['fedora-soap']['title'] = t("PHP SOAP extension library"); + $requirements['fedora-soap']['title'] = $t("PHP SOAP extension library"); if (!class_exists('SoapClient')) { - $requirements['fedora-soap']['value'] = t("Not installed"); + $requirements['fedora-soap']['value'] = $t("Not installed"); $requirements['fedora-soap']['severity'] = REQUIREMENT_ERROR; - $requirements['fedora-soap']['description'] = t('Ensure that the PHP SOAP extension is installed.'); + $requirements['fedora-soap']['description'] = $t('Ensure that the PHP SOAP extension is installed.'); } else { - $requirements['fedora-soap']['value'] = t("Installed"); + $requirements['fedora-soap']['value'] = $t("Installed"); $requirements['fedora-soap']['severity'] = REQUIREMENT_OK; } // Test for Curl - $requirements['curl']['title'] = "PHP Curl extension library"; + $requirements['curl']['title'] = $t('PHP Curl extension library'); if (!function_exists('curl_init')) { - $requirements['curl']['value'] = t("Not installed"); + $requirements['curl']['value'] = $t("Not installed"); $requirements['curl']['severity'] = REQUIREMENT_ERROR; - $requirements['curl']['description'] = t("Ensure that the PHP Curl extension is installed."); + $requirements['curl']['description'] = $t("Ensure that the PHP Curl extension is installed."); } else { - $requirements['curl']['value'] = t("Installed"); + $requirements['curl']['value'] = $t("Installed"); $requirements['curl']['severity'] = REQUIREMENT_OK; } // Test for DOM - $requirements['dom']['title'] = "PHP DOM XML extension library"; + $requirements['dom']['title'] = $t("PHP DOM XML extension library"; if (!method_exists('DOMDocument', 'loadHTML')) { - $requirements['dom']['value'] = t("Not installed"); + $requirements['dom']['value'] = $t("Not installed"); $requirements['dom']['severity'] = REQUIREMENT_ERROR; - $requirements['dom']['description'] = t("Ensure that the PHP DOM XML extension is installed."); + $requirements['dom']['description'] = $t("Ensure that the PHP DOM XML extension is installed."); } else { - $requirements['dom']['value'] = t("Installed"); + $requirements['dom']['value'] = $t("Installed"); $requirements['dom']['severity'] = REQUIREMENT_OK; } // Test for XSLT - $requirements['xsl']['title'] = "PHP XSL extension library"; + $requirements['xsl']['title'] = $t("PHP XSL extension library"); if (!class_exists('XSLTProcessor')) { - $requirements['xslt']['value'] = t("Not installed"); + $requirements['xslt']['value'] = $t("Not installed"); $requirements['xslt']['severity'] = REQUIREMENT_ERROR; - $requirements['xslt']['description'] = t("Ensure that the PHP XSL extension is installed."); + $requirements['xslt']['description'] = $t("Ensure that the PHP XSL extension is installed."); } else { - $requirements['xslt']['value'] = t("Installed"); + $requirements['xslt']['value'] = $t("Installed"); $requirements['xslt']['severity'] = REQUIREMENT_OK; } } elseif ($phase == 'runtime') { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $requirements['fedora-repository']['title'] = t("Fedora server"); + $requirements['fedora-repository']['title'] = $t("Fedora server"); if (!fedora_available()) { - $requirements['fedora-repository']['value'] = t("Not available"); + $requirements['fedora-repository']['value'] = $t("Not available"); $requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; - $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); + $requirements['fedora-repository']['description'] = $t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => url('admin/settings/fedora_repository'))); } else { - $requirements['fedora-repository']['value'] = t("Available"); + $requirements['fedora-repository']['value'] = $t("Available"); $requirements['fedora-repository']['severity'] = REQUIREMENT_OK; } } From 7ad0b140ab2151b0958f85b10fdbf91676d50444 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Tue, 17 Apr 2012 14:42:02 -0300 Subject: [PATCH 226/247] Fix a tiny error introduced... --- formClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 99decc08..c1122182 100644 --- a/formClass.inc +++ b/formClass.inc @@ -288,7 +288,7 @@ class formClass { $form['fedora_repository_title'] = array( '#type' => 'textfield', '#title' => t('Digital Repository Title'), - '#default_value' => variable_get('fedora_repository_name', 'Digital Repository'), + '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); //have tabs options (like disable) From 856489f74fd2ff20e61ab0453494cdc288582403 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Tue, 17 Apr 2012 13:45:04 -0400 Subject: [PATCH 227/247] Allow returns from modifications... --- README | 4 ++-- api/fedora_item.inc | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README b/README index f4980bb4..7a642cc4 100644 --- a/README +++ b/README @@ -4,6 +4,6 @@ For installation and customization instructions please see the documentation and https://wiki.duraspace.org/display/ISLANDORA/Islandora -All bugs, feature requests and improvement suggestions are tracked at the DuraSpace JIRA: +All bugs, feature requests and improvement suggestions are tracked at the DuraSpace JIRA: -https://jira.duraspace.org/browse/ISLANDORA \ No newline at end of file +https://jira.duraspace.org/browse/ISLANDORA diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 279a3e51..fdb4a00d 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -276,7 +276,7 @@ RDF; $description->appendChild($newrel); - $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); + return $this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'application/rdf+xml'); //print ($description->dump_node()); /* $params = array( 'pid' => $this->pid, @@ -969,6 +969,8 @@ RDF; * Error suppression? Refer to soap_call for usage (just passed along here). */ function modify_datastream($filename_or_content, $dsid, $label, $mime_type, $force = FALSE, $logMessage='Modified by Islandora API', $quiet=FALSE) { + $toReturn = NULL; + //Determine if it's inline xml; if it is, modify by value if ($this->get_datastream($dsid)->controlGroup === 'X') { $content = '<null/>'; @@ -979,7 +981,7 @@ RDF; $content = $filename_or_content; } - $this->modify_datastream_by_value($content, $dsid, $label, $mime_type, $force, $logMessage); + $toReturn = $this->modify_datastream_by_value($content, $dsid, $label, $mime_type, $force, $logMessage); } //Otherwise, write to web-accessible temp file and modify by reference. else { @@ -1000,12 +1002,14 @@ RDF; $file_url = file_create_url($file); - $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); + $toReturn = $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage); if ($created_temp && is_file($file) && is_writable($file)) { file_delete($file); } } + + return $toReturn; } /** From e4cad8c4488d101b1581ce988ae6aa6959bc6a3f Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 19 Apr 2012 16:31:30 -0300 Subject: [PATCH 228/247] Overhaul breadcrumbs and nuke fedora_repository_{name,title} Addresses the title/name issues of ISLANDORA-562 (by getting rid of them). Menu/root title is provided through the menu system. --- CollectionClass.inc | 9 +- ObjectHelper.inc | 176 +++++++++++++++++++++++++++++++-------- api/fedora_utils.inc | 6 +- fedora_repository.module | 3 +- formClass.inc | 23 +---- 5 files changed, 150 insertions(+), 67 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index a46b1b5f..43d06be0 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -607,7 +607,7 @@ class CollectionClass { * @param int $pageNumber * @return type */ - function renderCollection($content, $pid, $dsId, $collection, $pageNumber = NULL) { + function renderCollection($content, $pid, $dsId, $collectionName, $pageNumber = NULL) { $path = drupal_get_path('module', 'fedora_repository'); global $base_url; $collection_pid = $pid; //we will be changing the pid later maybe @@ -620,17 +620,14 @@ class CollectionClass { $fedoraItem = NULL; - - - $collectionName = $collection; - if (!$pageNumber) { $pageNumber = 1; } if (empty($collectionName)) { - $collectionName = variable_get('fedora_repository_name', 'Collection'); + $collectionName = menu_get_active_title(); } + $xslContent = $this->getXslContent($pid, $path); //get collection list and display using xslt------------------------------------------- diff --git a/ObjectHelper.inc b/ObjectHelper.inc index aeaf09d0..7e4c0161 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -938,58 +938,62 @@ class ObjectHelper { /** * Builds an array of drupal links for use in breadcrumbs. * + * @todo Make fully recursive... + * * @global type $base_url * @param type $pid * @param type $breadcrumbs * @param type $level */ - function getBreadcrumbs($pid, &$breadcrumbs, $level=10) { + function getBreadcrumbs($pid, &$breadcrumbs) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; - if ($pid == variable_get('fedora_repository_pid', 'islandora:root')) { - //$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(variable_get('fedora_repository_title', 'Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(t('Home'), $base_url); + static $max_level = 10; + static $level = -1; + + if (count($breadcrumbs) === 0) { + $level = $max_level; + } + + $root = variable_get('fedora_repository_pid', 'islandora:root'); + + if ($pid == $root) { + $breadcrumbs[] = l(menu_get_active_title(), 'fedora/repository'); + $breadcrumbs[] = l(t('Home'), '<front>'); } else { $query_string = 'select $parentObject $title $content from <#ri> - where (<info:fedora/' . $pid . '> <fedora-model:label> $title - and $parentObject <fedora-model:hasModel> $content - and (<info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject - or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject - or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject) - and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) - minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> - order by $title desc'; - $query_string = htmlentities(urlencode($query_string)); - - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; - - $result = preg_split('/[\r\n]+/', do_curl($url)); - array_shift($result); // throw away first line - $matches = str_getcsv(join("\n", $result)); - if (count($matches) >= 2) { - $parent = preg_replace('/^info:fedora\//', '', $matches[0]); - - if (0 == strlen($matches[1])) { - $matches[1] = "Unlabeled Object"; + where ( + <info:fedora/' . $pid . '> <fedora-model:label> $title + and $parentObject <fedora-model:hasModel> $content + and ( + <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject + or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject + or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject + ) + and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active> + ) + minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> + order by $title desc'; + + if (count($results = self::_perform_itql_query($query_string)) > 0 && $level > 0) { + $parent = $results[0]['parentObject']; + $this_title = $results[0]['title']; + + if (empty($this_title)) { + $this_title = t('Unlabeled Object'); } - $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); - if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { - //$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(variable_get('fedora_repository_name', 'Digital repository'), 'fedora/repository'); - $breadcrumbs[] = l(t('Home'), $base_url); - } - elseif ($level > 0) { - $this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); - } + $breadcrumbs[] = l($this_title, "fedora/repository/$pid"); + + $level--; + $this->getBreadcrumbs($parent, $breadcrumbs); } - else { - $breadcrumbs[] = l(t("Path Calculation Error"), 'fedora/repository/' . $pid); + watchdog('fedora_repository', 'Error generating breadcrumbs for %pid. Verify there exists relationships back up to %root. (May also be due to a hierarchy deeper than %max_depth).', array('%pid' => $pid, '%root' => $root, '%max_depth' => $max_depth), WATCHDOG_WARNING); + $breadcrumbs[] = '...'; + $this->getBreadcrumbs($root, $breadcrumbs); } } } @@ -1012,5 +1016,103 @@ class ObjectHelper { drupal_set_message(t($configMess . "<br />" . $messMap[$app] . "<hr width='40%' align = 'left'/>", array('%app' => $app)), 'warning', FALSE); } + /** + * Performs the given RI query. + * + * FIXME: Could probably made more fail-safe (avoid loading directly with SimpleXML.) + * + * @param string $query + * @param int $limit + * @param int $offset + * @return array + * Indexed (numerical) array, containing a number of associative arrays, + * with keys being the same as the variable names in the query. + * URIs beginning with 'info:fedora/' will have this beginning stripped + * off, to facilitate their use as PIDs. + */ + protected static function _perform_ri_query($query, $type = 'itql', $limit = -1, $offset = 0) { + //Setup the query options... + $options = array( + 'type' => 'tuples', + 'flush' => TRUE, + 'format' => 'Sparql', + 'lang' => $type, + 'query' => $query + ); + if ($limit > 0) { + $options['limit'] = $limit; + } + if ($offset > 0) { + $options['offset'] = $offset; + } + + //Actually construct the query URL. + $queryUrl = url(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), array('query' => $options)); + + $curl_result = do_curl_ext($queryUrl); + + if (!$curl_result[0]) { + watchdog('fedora_repository', 'Failed to perform %type resource index query: %query', array('%type' => $type, '%query' => $query), WATCHDOG_ERROR); + return FALSE; + } + + $doc = new SimpleXMLElement($curl_result[0], 0, FALSE, 'http://www.w3.org/2001/sw/DataAccess/rf1/result'); + + $results = array(); //Storage. + + //Build the results. + foreach ($doc->results->children() as $result) { + $r = array(); + foreach ($result->children() as $element) { + $val = NULL; + + $attrs = $element->attributes(); + + if (!empty($attrs['uri'])) { + $val = $attrs['uri']; + } + else { + $val = $element; + } + + $r[$element->getName()] = self::_pid_uri_to_bare_pid((string)$val); + } + $results[] = $r; + } + return $results; + } + /** + * Thin wrapper for self::_perform_ri_query(). + */ + public static function _perform_itql_query($query, $limit = -1, $offset = 0) { + return self::_perform_ri_query($query, 'itql', $limit, $offset); + } + /** + * Thin wrapper for self::_perform_ri_query(). + */ + public static function _perform_sparql_query($query, $limit = -1, $offset = 0) { + return self::_perform_ri_query($query, 'sparql', $limit, $offset); + } + /** + * Utility function used in self::_perform_ri_query(). + * + * Strips off the 'info:fedora/' prefix from the passed in string. + * + * @param $uri string + * A string containing a URI. + * @return string + * The input string less the 'info:fedora/' prefix (if it has it). + * The original string otherwise. + */ + protected static function _pid_uri_to_bare_pid($uri) { + $chunk = 'info:fedora/'; + $pos = strrpos($uri, $chunk); + if ($pos !== FALSE) { //Remove info:fedora/ chunk + return substr($uri, strlen($chunk)); + } + else { //Doesn't start with info:fedora/ chunk... + return $uri; + } + } } diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index eb56bdcc..459c86ba 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -85,7 +85,7 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post * an array that consists of three value or NULL if curl is not suported: * - element 0: * The value returned from the curl_exec function call. - * This is either a TRUE or FALSE value or the actual data returned from + * This is either a boolean value or the actual data returned from * accessing the URL. * - element 1: * The error code reslting from attempting to access the URL with curl_exec @@ -93,7 +93,7 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post * A string representing a textual representation of the error code that * resulted from attempting to access the URL with curl_exec */ -function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $post = NULL) { +function do_curl_ext($url, $return_to_variable = TRUE, $number_of_post_vars = 0, $post = NULL) { global $user; // Check if we are inside Drupal and there is a valid user. @@ -113,7 +113,7 @@ function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $p curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_FAILONERROR, TRUE); // Fail on errors - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); // allow redirects curl_setopt($ch, CURLOPT_TIMEOUT, 90); // times out after 90s curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, $return_to_variable); // return into a variable diff --git a/fedora_repository.module b/fedora_repository.module index abec4b9e..8a80c8e3 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -2,8 +2,7 @@ /** * Drupal hook for admin form - * fedora_repository_name is the name of the top level collection this module will query - * fedora_repository_pid is the name of the top level pid. + * * Stores this info in the drupal variables table. * the name and pid can also be passed as url parameters */ diff --git a/formClass.inc b/formClass.inc index c1122182..1d752f3d 100644 --- a/formClass.inc +++ b/formClass.inc @@ -70,9 +70,7 @@ class formClass { 'access arguments' => array('view fedora collection'), ); $items['fedora/repository'] = array( - 'title' => '', - 'title callback' => 'variable_get', - 'title arguments' => array('fedora_repository_name', 'Digital Repository'), + 'title' => 'Digital Repository', 'page callback' => 'repository_page', 'type' => MENU_NORMAL_ITEM, 'access arguments' => array('view fedora collection'), @@ -187,24 +185,16 @@ class formClass { /** * Create admin form - * @return type + * @return array */ function createAdminForm() { if (!user_access('administer site configuration')) { - drupal_set_message(t('You must be a site administrator to edit the Fedora collecitons list.'), 'error'); + drupal_set_message(t('You must be a site administrator to edit the Fedora collections list.'), 'error'); return; } module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $form = array(); - $form['fedora_repository_name'] = array( - '#type' => 'textfield', - '#title' => t('Root Collection Name'), - '#default_value' => variable_get('fedora_repository_name', 'Islandora demos collection'), - '#description' => t('The Name of the Root Collection Object'), - '#required' => TRUE, - '#weight' => -20 - ); $form['fedora_repository_pid'] = array( '#type' => 'textfield', '#title' => t('Root Collection PID'), @@ -285,12 +275,7 @@ class formClass { '#weight' => 0 ); } - $form['fedora_repository_title'] = array( - '#type' => 'textfield', - '#title' => t('Digital Repository Title'), - '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), - '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), - ); + //have tabs options (like disable) $form['tabs'] = array( '#type' => 'fieldset', From 5560e73202657cb1246a6d0c25b36213ad8ed021 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 09:48:36 -0300 Subject: [PATCH 229/247] Add a couple comments. --- ObjectHelper.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 7e4c0161..7a583c33 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -992,8 +992,8 @@ class ObjectHelper { } else { watchdog('fedora_repository', 'Error generating breadcrumbs for %pid. Verify there exists relationships back up to %root. (May also be due to a hierarchy deeper than %max_depth).', array('%pid' => $pid, '%root' => $root, '%max_depth' => $max_depth), WATCHDOG_WARNING); - $breadcrumbs[] = '...'; - $this->getBreadcrumbs($root, $breadcrumbs); + $breadcrumbs[] = '...'; //Add an non-link, as we don't know how to get back to the root. + $this->getBreadcrumbs($root, $breadcrumbs); //And render the last two links and break (on the next pass). } } } From e7df7b358bab85d42d75456f5174395ac6ea3062 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 09:48:52 -0300 Subject: [PATCH 230/247] Use function returned by get_t() Because of Drupal's workflow, we may not have access to the regular t() function. Drupal provides get_t() function to address this issue, it just has to be used (and it's return used). Also, use the bloody url function instead of appending $base_url. --- fedora_repository.install | 43 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/fedora_repository.install b/fedora_repository.install index 164ce02e..169d1178 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -34,71 +34,70 @@ function fedora_collections_enable() { * @see _update_cron_notify() */ function fedora_repository_requirements($phase) { - global $base_url; - $requirements = array(); + $t = get_t(); //May not have access to the regular t() function; and so Drupal provides... if ($phase == 'install') { // Test for SOAP - $requirements['fedora-soap']['title'] = t("PHP SOAP extension library"); + $requirements['fedora-soap']['title'] = $t("PHP SOAP extension library"); if (!class_exists('SoapClient')) { - $requirements['fedora-soap']['value'] = t("Not installed"); + $requirements['fedora-soap']['value'] = $t("Not installed"); $requirements['fedora-soap']['severity'] = REQUIREMENT_ERROR; - $requirements['fedora-soap']['description'] = t('Ensure that the PHP SOAP extension is installed.'); + $requirements['fedora-soap']['description'] = $t('Ensure that the PHP SOAP extension is installed.'); } else { - $requirements['fedora-soap']['value'] = t("Installed"); + $requirements['fedora-soap']['value'] = $t("Installed"); $requirements['fedora-soap']['severity'] = REQUIREMENT_OK; } // Test for Curl - $requirements['curl']['title'] = "PHP Curl extension library"; + $requirements['curl']['title'] = $t('PHP Curl extension library'); if (!function_exists('curl_init')) { - $requirements['curl']['value'] = t("Not installed"); + $requirements['curl']['value'] = $t("Not installed"); $requirements['curl']['severity'] = REQUIREMENT_ERROR; - $requirements['curl']['description'] = t("Ensure that the PHP Curl extension is installed."); + $requirements['curl']['description'] = $t("Ensure that the PHP Curl extension is installed."); } else { - $requirements['curl']['value'] = t("Installed"); + $requirements['curl']['value'] = $t("Installed"); $requirements['curl']['severity'] = REQUIREMENT_OK; } // Test for DOM - $requirements['dom']['title'] = "PHP DOM XML extension library"; + $requirements['dom']['title'] = $t("PHP DOM XML extension library"; if (!method_exists('DOMDocument', 'loadHTML')) { - $requirements['dom']['value'] = t("Not installed"); + $requirements['dom']['value'] = $t("Not installed"); $requirements['dom']['severity'] = REQUIREMENT_ERROR; - $requirements['dom']['description'] = t("Ensure that the PHP DOM XML extension is installed."); + $requirements['dom']['description'] = $t("Ensure that the PHP DOM XML extension is installed."); } else { - $requirements['dom']['value'] = t("Installed"); + $requirements['dom']['value'] = $t("Installed"); $requirements['dom']['severity'] = REQUIREMENT_OK; } // Test for XSLT - $requirements['xsl']['title'] = "PHP XSL extension library"; + $requirements['xsl']['title'] = $t("PHP XSL extension library"); if (!class_exists('XSLTProcessor')) { - $requirements['xslt']['value'] = t("Not installed"); + $requirements['xslt']['value'] = $t("Not installed"); $requirements['xslt']['severity'] = REQUIREMENT_ERROR; - $requirements['xslt']['description'] = t("Ensure that the PHP XSL extension is installed."); + $requirements['xslt']['description'] = $t("Ensure that the PHP XSL extension is installed."); } else { - $requirements['xslt']['value'] = t("Installed"); + $requirements['xslt']['value'] = $t("Installed"); $requirements['xslt']['severity'] = REQUIREMENT_OK; } } elseif ($phase == 'runtime') { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - $requirements['fedora-repository']['title'] = t("Fedora server"); + $requirements['fedora-repository']['title'] = $t("Fedora server"); if (!fedora_available()) { - $requirements['fedora-repository']['value'] = t("Not available"); + $requirements['fedora-repository']['value'] = $t("Not available"); $requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; - $requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository')); + $requirements['fedora-repository']['description'] = $t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => url('admin/settings/fedora_repository'))); } else { - $requirements['fedora-repository']['value'] = t("Available"); + $requirements['fedora-repository']['value'] = $t("Available"); $requirements['fedora-repository']['severity'] = REQUIREMENT_OK; } } From 8dde6736b70bbeeb3a0c7aafb84642ee37044b08 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 10:13:08 -0300 Subject: [PATCH 231/247] Add comments/inline docs, and change the function names to be more the norm. --- ObjectHelper.inc | 50 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 7a583c33..06481a91 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -977,7 +977,7 @@ class ObjectHelper { minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> order by $title desc'; - if (count($results = self::_perform_itql_query($query_string)) > 0 && $level > 0) { + if (count($results = self::perform_itql_query($query_string)) > 0 && $level > 0) { $parent = $results[0]['parentObject']; $this_title = $results[0]['title']; @@ -1017,13 +1017,17 @@ class ObjectHelper { } /** - * Performs the given RI query. + * Performs the given Resource Index query and return the results. * - * FIXME: Could probably made more fail-safe (avoid loading directly with SimpleXML.) - * - * @param string $query - * @param int $limit - * @param int $offset + * @param $query string + * A string containing the RI query to perform. + * @param $type string + * The type of query to perform, as used by the risearch interface. + * @param $limit int + * An integer, used to limit the number of results to return. + * @param $offset int + * An integer, used to offset the results (results should be ordered, to + * maintain consistency. * @return array * Indexed (numerical) array, containing a number of associative arrays, * with keys being the same as the variable names in the query. @@ -1035,62 +1039,74 @@ class ObjectHelper { $options = array( 'type' => 'tuples', 'flush' => TRUE, - 'format' => 'Sparql', + 'format' => 'Sparql', //Sparql XML is processed into the array below. 'lang' => $type, 'query' => $query ); + //Add limit if provided. if ($limit > 0) { $options['limit'] = $limit; } + //Add offset if provided. if ($offset > 0) { $options['offset'] = $offset; } - //Actually construct the query URL. + //Construct the query URL. $queryUrl = url(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'), array('query' => $options)); + //Perform the query. $curl_result = do_curl_ext($queryUrl); + //If the query failed, write message to the logs and return. if (!$curl_result[0]) { watchdog('fedora_repository', 'Failed to perform %type resource index query: %query', array('%type' => $type, '%query' => $query), WATCHDOG_ERROR); return FALSE; } + //Load the results into a SimpleXMLElement $doc = new SimpleXMLElement($curl_result[0], 0, FALSE, 'http://www.w3.org/2001/sw/DataAccess/rf1/result'); $results = array(); //Storage. //Build the results. foreach ($doc->results->children() as $result) { + //Built a single result. $r = array(); foreach ($result->children() as $element) { $val = NULL; $attrs = $element->attributes(); - if (!empty($attrs['uri'])) { - $val = $attrs['uri']; + $val = self::_pid_uri_to_bare_pid((string)$attrs['uri']); } else { - $val = $element; + $val = (string)$element; } - $r[$element->getName()] = self::_pid_uri_to_bare_pid((string)$val); + //Map the name to the value in the array. + $r[$element->getName()] = $val; } + + //Add the single result to the set to return. $results[] = $r; } return $results; } /** * Thin wrapper for self::_perform_ri_query(). + * + * @see self::_perform_ri_query() */ - public static function _perform_itql_query($query, $limit = -1, $offset = 0) { + public static function perform_itql_query($query, $limit = -1, $offset = 0) { return self::_perform_ri_query($query, 'itql', $limit, $offset); } /** * Thin wrapper for self::_perform_ri_query(). + * + * @see self::_perform_ri_query() */ - public static function _perform_sparql_query($query, $limit = -1, $offset = 0) { + public static function perform_sparql_query($query, $limit = -1, $offset = 0) { return self::_perform_ri_query($query, 'sparql', $limit, $offset); } /** @@ -1106,8 +1122,8 @@ class ObjectHelper { */ protected static function _pid_uri_to_bare_pid($uri) { $chunk = 'info:fedora/'; - $pos = strrpos($uri, $chunk); - if ($pos !== FALSE) { //Remove info:fedora/ chunk + $pos = strpos($uri, $chunk); + if ($pos === 0) { //Remove info:fedora/ chunk return substr($uri, strlen($chunk)); } else { //Doesn't start with info:fedora/ chunk... From 5ae0e4605332f9be60b9504d935cf56d41665302 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Thu, 19 Apr 2012 16:31:30 -0300 Subject: [PATCH 232/247] Overhaul breadcrumbs and nuke fedora_repository_{name,title} Addresses the title/name issues of ISLANDORA-562 (by getting rid of them). Menu/root title is provided through the menu system. --- ObjectHelper.inc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 06481a91..71d1aa2d 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -1028,13 +1028,14 @@ class ObjectHelper { * @param $offset int * An integer, used to offset the results (results should be ordered, to * maintain consistency. + * * @return array * Indexed (numerical) array, containing a number of associative arrays, * with keys being the same as the variable names in the query. * URIs beginning with 'info:fedora/' will have this beginning stripped * off, to facilitate their use as PIDs. */ - protected static function _perform_ri_query($query, $type = 'itql', $limit = -1, $offset = 0) { +static function perform_ri_query($query, $type = 'itql', $limit = -1, $offset = 0) { //Setup the query options... $options = array( 'type' => 'tuples', @@ -1078,7 +1079,7 @@ class ObjectHelper { $attrs = $element->attributes(); if (!empty($attrs['uri'])) { - $val = self::_pid_uri_to_bare_pid((string)$attrs['uri']); + $val = self::pid_uri_to_bare_pid((string)$attrs['uri']); } else { $val = (string)$element; @@ -1099,7 +1100,7 @@ class ObjectHelper { * @see self::_perform_ri_query() */ public static function perform_itql_query($query, $limit = -1, $offset = 0) { - return self::_perform_ri_query($query, 'itql', $limit, $offset); + return self::perform_ri_query($query, 'itql', $limit, $offset); } /** * Thin wrapper for self::_perform_ri_query(). @@ -1107,7 +1108,7 @@ class ObjectHelper { * @see self::_perform_ri_query() */ public static function perform_sparql_query($query, $limit = -1, $offset = 0) { - return self::_perform_ri_query($query, 'sparql', $limit, $offset); + return self::perform_ri_query($query, 'sparql', $limit, $offset); } /** * Utility function used in self::_perform_ri_query(). @@ -1116,11 +1117,12 @@ class ObjectHelper { * * @param $uri string * A string containing a URI. + * * @return string * The input string less the 'info:fedora/' prefix (if it has it). * The original string otherwise. */ - protected static function _pid_uri_to_bare_pid($uri) { + protected static function pid_uri_to_bare_pid($uri) { $chunk = 'info:fedora/'; $pos = strpos($uri, $chunk); if ($pos === 0) { //Remove info:fedora/ chunk From f18ce11ba5076c3338af3b235de217c7a6dbe18f Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 15:24:24 -0300 Subject: [PATCH 233/247] Overhaul FedoraObjectDetailedContent and Object helper. FODC tab now uses theme functions to generate the DC content, datastream info, and list of parents. Only thing not really being generated is the tiny (but repeated) form for downloading. Also, make the convertQDC XSLT a little simpler, even though it really won't need to be used anymore... Refactored to use the new RI search methods as well. --- CollectionClass.inc | 65 +++-- ObjectHelper.inc | 340 ++++++++++++------------ fedora_repository.module | 2 +- formClass.inc | 5 +- plugins/FedoraObjectDetailedContent.inc | 24 +- xsl/convertQDC.xsl | 6 +- 6 files changed, 234 insertions(+), 208 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 43d06be0..2d0c2b31 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -39,6 +39,36 @@ class CollectionClass { $this->pid = $pid; } } + + static function get_collection_query($pid) { + if ($query = self::_get_collection_query_from_stream($pid)) { + return $query; + } + else { + return self::_get_default_collection_query($pid); + } + } + + static function _get_collection_query_from_stream($pid) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $item = new Fedora_Item($pid); + if ($item->exists() && array_key_exists('QUERY', $item->datastreams)) { + return $item->get_datastream_dissemination('QUERY'); + } + else { + return FALSE; + } + } + static function _get_default_collection_query($pid) { + return 'select $object $title $content from <#ri> + where ($object <fedora-model:label> $title + and $object <fedora-model:hasModel> $content + and ($object <fedora-rels-ext:isMemberOfCollection> <info:fedora/' . $pid . '> + or $object <fedora-rels-ext:isMemberOf> <info:fedora/' . $pid . '>) + and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) + minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> + order by $title'; + } /** * gets objects related to this object. must include offset and limit @@ -49,15 +79,11 @@ class CollectionClass { * @param type $itqlquery * @return type */ - function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { + static function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { if (!isset($itqlquery)) { - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $item = new Fedora_Item($pid); - if ($item->exists() && array_key_exists('QUERY', $item->datastreams)) { - $itqlquery = $item->get_datastream_dissemination('QUERY'); - } + $itqlquery = self::get_collection_query($pid); } - return $this->getRelatedItems($pid, $itqlquery, $limit, $offset); + return self::getRelatedItems($pid, $itqlquery, $limit, $offset); } /** @@ -70,7 +96,7 @@ class CollectionClass { * @param int $offset * @return type */ - function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { + static function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!isset($offset)) { @@ -84,26 +110,11 @@ class CollectionClass { $objectHelper = new ObjectHelper(); $query_string = $itqlquery; if (!isset($query_string)) { - $query_string = NULL; - $item = new Fedora_Item($pid); - if ($item->exists() && array_key_exists('QUERY', $item->datastreams)) { - $query_string = $item->get_datastream_dissemination('QUERY'); - } - if ($query_string == NULL) { - $query_string = 'select $object $title $content from <#ri> - where ($object <fedora-model:label> $title - and $object <fedora-model:hasModel> $content - and ($object <fedora-rels-ext:isMemberOfCollection> <info:fedora/' . $pid . '> - or $object <fedora-rels-ext:isMemberOf> <info:fedora/' . $pid . '>) - and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) - minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> - order by $title'; - } - } - else { - // Replace %parent_collection% with the actual collection PID - $query_string = preg_replace("/\%parent_collection\%/", "<info:fedora/$pid>", $query_string); + $query_string = self::get_collection_query($pid); } + + // Replace %parent_collection% with the actual collection PID + $query_string = preg_replace("/\%parent_collection\%/", "<info:fedora/$pid>", $query_string); $query_string = htmlentities(urlencode($query_string)); diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 71d1aa2d..35200f87 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -313,36 +313,42 @@ class ObjectHelper { function create_link_for_ds($pid, $dataStreamValue) { global $base_url; $path = drupal_get_path('module', 'fedora_repository'); + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - require_once($path . '/api/fedora_item.inc'); $item = new Fedora_Item($pid); + $purge_image = ' '; if (user_access(ObjectHelper :: $PURGE_FEDORA_OBJECTSANDSTREAMS)) { $allow = TRUE; if (module_exists('fedora_fesl')) { $allow = fedora_fesl_check_roles($pid, 'write'); } if ($allow) { - $purgeImage = '<a title="purge datastream ' . $dataStreamValue->label . '" href="' . $base_url . '/fedora/repository/purgeStream/' . - $pid . '/' . $dataStreamValue->ID . '/' . $dataStreamValue->label . '"><img src="' . $base_url . '/' . $path . - '/images/purge.gif" alt="purge datastream" /></a>'; + $purge_text = t("purge datastream @label", array('@label' => $dataStreamValue->label)); + $purge_path = "fedora/repository/purgeStream/$pid/{$dataStreamValue->ID}/{$dataStreamValue->label}"; + $purge_image = l(theme('image', "$path/images/purge.gif", $purge_text, $purge_text, NULL, FALSE), $purge_path, array( + 'html' => TRUE, + )); } } else { - $purgeImage = ' '; + $purge_image = ' '; } - $fullPath = base_path() . $path; // Add an icon to replace a datastream // @TODO Note: using l(theme_image(..), ...); for these image links (and other links) may remove the need to have clean urls enabled. - $replaceImage = ' '; + $replace_image = ' '; if (user_access(ObjectHelper :: $ADD_FEDORA_STREAMS)) { $allow = TRUE; if (module_exists('fedora_fesl')) { $allow = fedora_fesl_check_roles($pid, 'write'); } if ($allow) { - $replaceImage = '<a title="' . t("Replace datastream") . " " . $dataStreamValue->label . '" href="' . $base_url . '/fedora/repository/replaceStream/' . $pid . '/' . $dataStreamValue->ID . '/' . $dataStreamValue->label . '"><img src="' . $base_url . '/' . $path . '/images/replace.png" alt="replace datastream" /></a>'; + $replace_text = t('Replace datastream "@label"', array('@label' => $dataStreamValue->label)); + $replace_path = "fedora/repository/replaceStream/$pid/{$dataStreamValue->ID}/{$dataStreamValue->label}"; + $replace_image = l(theme('image', "$path/images/replace.png", $replace_text, $replace_text, NULL, FALSE), $replace_path, array( + 'html' => TRUE, + )); } } @@ -350,13 +356,17 @@ class ObjectHelper { $id = $dataStreamValue->ID; $label = $dataStreamValue->label; $label = str_replace("_", " ", $label); + $label_deslashed = preg_replace('/\//i', '${1}_', $label); // Necessary to handle the case of Datastream labels that contain slashes. Ugh. $mimeType = $dataStreamValue->MIMEType; - $view = '<a href="' . $base_url . '/fedora/repository/' . drupal_urlencode($pid) . '/' . $id . '/' . drupal_urlencode($label) . - '" target="_blank" >' . t('View') . '</a>'; - $action = "$base_url/fedora/repository/object_download/" . drupal_urlencode($pid) . '/' . $id . '/' . drupal_urlencode(preg_replace('/\//i', '${1}_', $label)); // Necessary to handle the case of Datastream labels that contain slashes. Ugh. + $view = l(t('View'), "'fedora/repository/$pid/$id/$label_deslashed", array( + 'attributes' => array( + 'target' => '_blank', + ), + )); + $action = url("fedora/repository/object_download/$pid/$id/$label_deslashed"); $downloadVersion = '<form method="GET" action="' . $action . '"><input type="submit" value="' . t('Download') . '"></form>'; - if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { + if (user_access(ObjectHelper::$EDIT_FEDORA_METADATA)) { $versions = $item->get_datastream_history($id); if (is_array($versions)) { $downloadVersion = '<form method="GET" action="' . $action . '" onsubmit="this.action=\'' . $action . '\' + \'/\'+this.version.value;">'; @@ -369,8 +379,23 @@ class ObjectHelper { } } - $content .= "<tr><td>$label</td><td> $view</td><td> $downloadVersion</td><td> $mimeType</td><td> $replaceImage $purgeImage</td></tr>\n"; - return $content; + return array( + array( + 'data' => $label, + ), + array( + 'data' => $view, + ), + array( + 'data' => $downloadVersion, + ), + array( + 'data' => $mimeType + ), + array( + 'data' => $replace_image . $purge_image, + ), + ); } /** @@ -386,34 +411,37 @@ class ObjectHelper { $dsid = array_key_exists('QDC', $item->get_datastreams_list_as_array()) ? 'QDC' : 'DC'; $xmlstr = $item->get_datastream_dissemination($dsid); - - + if (empty($xmlstr)) { return ''; } + + $simplexml = new SimpleXMLElement($xmlstr); - try { - $proc = new XsltProcessor(); - } catch (Exception $e) { - drupal_set_message($e->getMessage(), 'error'); - return; + $headers = array( + array( + 'data' => t('Metadata'), + 'colspan' => 2, + ), + ); + $rows = array(); + dsm($xmlstr); + foreach ($simplexml->getNamespaces(TRUE) as $ns) { + foreach ($simplexml->children($ns) as $child) { + $rows[] = array( + array( + 'data' => $child->getName(), + 'class' => 'dc-tag-name', + ), + array( + 'data' => (string)$child, + 'class' => 'dc-content', + ), + ); + } } - $proc->setParameter('', 'baseUrl', $base_url); - $proc->setParameter('', 'path', $base_url . '/' . $path); - $input = NULL; - $xsl = new DomDocument(); - try { - $xsl->load($path . '/xsl/convertQDC.xsl'); - $input = new DomDocument(); - $input->loadXML(trim($xmlstr)); - } catch (Exception $e) { - watchdog('fedora_repository', "Problem loading XSL file: @e", array('@e' => $e->getMessage()), NULL, WATCHDOG_ERROR); - } - $xsl = $proc->importStylesheet($xsl); - $newdom = $proc->transformToDoc($input); - $output = $newdom->saveHTML(); - return $output; + return theme('table', $headers, $rows, array('class' => 'dc-table')); } /** @@ -432,16 +460,17 @@ class ObjectHelper { $dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC'; $path = drupal_get_path('module', 'fedora_repository'); - //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1)); if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { $allow = TRUE; if (module_exists('fedora_fesl')) { $allow = fedora_fesl_check_roles($pid, 'write'); } if ($allow) { - - $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>'; + $link_image = theme('image', "$path/images/edit.gif", t('Edit Metadata')); + $link = l($link_image, "fedora/repository/editmetadata/$pid", array( + 'html' => TRUE, + )); + $output .= '<br />' . $link; } } return $output; @@ -461,7 +490,7 @@ class ObjectHelper { * */ function get_formatted_datastream_list($object_pid, $contentModels, &$fedoraItem) { - global $fedoraUser, $fedoraPass, $base_url, $user; + global $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'); @@ -473,58 +502,42 @@ class ObjectHelper { if (user_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST)) { $availableDataStreamsText = 'Detailed List of Content'; - //$metaDataText='Description'; + $mainStreamLabel = NULL; $object = $fedoraItem->get_datastreams_list_as_SimpleXML(); if (!isset($object)) { drupal_set_message(t("No datastreams available")); return ' '; } - $hasOBJStream = NULL; - $hasTNStream = FALSE; - $dataStreamBody = "<br /><table>\n"; $cmDatastreams = array(); if (variable_get('fedora_object_restrict_datastreams', FALSE) == TRUE && ($cm = ContentModel::loadFromObject($object_pid)) !== FALSE) { $cmDatastreams = $cm->listDatastreams(); } - $dataStreamBody .= $this->get_parent_objects_asHTML($object_pid); - $dataStreamBody .= '<tr><th colspan="4"><h3>' . t("!text", array('!text' => $availableDataStreamsText)) . '</h3></th></tr>'; + $headers = array( + array( + 'data' => $availableDataStreamsText, + 'colspan' => 4, + ), + ); + $DSs = array(); foreach ($object as $datastream) { foreach ($datastream as $datastreamValue) { - if (variable_get('fedora_object_restrict_datastreams', FALSE) == FALSE || ((isset($user) && in_array('administrator', $user->roles)) || in_array($datastreamValue->ID, $cmDatastreams))) { - if ($datastreamValue->ID == 'OBJ') { - $hasOBJStream = '1'; - $mainStreamLabel = $datastreamValue->label; - $mainStreamLabel = str_replace("_", " ", $mainStreamLabel); - } - if ($datastreamValue->ID == 'TN') { - $hasTNStream = TRUE; - } + if (variable_get('fedora_object_restrict_datastreams', FALSE) == FALSE || ((isset($user) && in_array('administrator', $user->roles)) || in_array($datastreamValue->ID, $cmDatastreams))) { //create the links to each datastream - $dataStreamBody .= $this->create_link_for_ds($object_pid, $datastreamValue); //"<tr><td><b>$key :</b></td><td>$value</td></tr>\n"; + $DSs []= $this->create_link_for_ds($object_pid, $datastreamValue); } } } - $dataStreamBody .= "</table>\n"; + + $dataStreamBody = theme('table', $headers, $DSs); //if they have access let them add a datastream - if (user_access(ObjectHelper :: $ADD_FEDORA_STREAMS)) { - $allow = TRUE; - if (module_exists('fedora_fesl')) { - $allow = fedora_fesl_check_roles($object_pid, 'write'); - } - if ($allow) { - $dataStreamBody .= drupal_get_form('add_stream_form', $object_pid); - } + if (user_access(ObjectHelper::$ADD_FEDORA_STREAMS) && //If allowed throw Drupal + ((module_exists('fedora_fesl') && fedora_fesl_check_roles($object_pid, 'write')) || //And allowed throw FESL + !module_exists('fedora_fesl'))) { //Or not using FESL, draw the add datastream form. + $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>'; return $dataStreamBody; } @@ -616,55 +629,44 @@ class ObjectHelper { * @param type $pid * @return type */ - function fedora_repository_access($op, $pid) { - global $user; - + function fedora_repository_access($op, $pid = NULL, $as_user = NULL) { $returnValue = FALSE; - $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); - if (!$isRestricted) { - $namespaceAccess = TRUE; - } + if ($pid == NULL) { $pid = variable_get('fedora_repository_pid', 'islandora:root'); } - $nameSpaceAllowed = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); - $pos = NULL; - foreach ($nameSpaceAllowed as $nameSpace) { - $pos = stripos($pid, $nameSpace); - if ($pos === 0) { - $namespaceAccess = TRUE; - } - } - if ($namespaceAccess) { - $user_access = user_access($op); - if ($user_access == NULL) { - return FALSE; - } - return $user_access; + + $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE); + $namespace_access = NULL; + if (!$isRestricted) { + $namespace_access = TRUE; } - else { - return FALSE; + else { + $pid_namespace = substr($pid, 0, strpos($pid, ':') + 1); //Get the namespace (with colon) + $allowed_namespaces = explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: islandora-book: books: newspapers: ')); + + $namespace_access = in_array($pid_namespace, $allowed_namespaces); } + + return ($namespace_access && user_access($op, $as_user)); } /** * internal function * uses an xsl to parse the sparql xml returned from the ITQL query - * - * + * @deprecated + * This is only used in the fedora/repository/collection path, + * which should probably be nuked. * @param $content String */ function parseContent($content, $pid, $dsId, $collection, $pageNumber = NULL) { $path = drupal_get_path('module', 'fedora_repository'); global $base_url; $collection_pid = $pid; //we will be changing the pid later maybe - //module_load_include('php', ''Fedora_Repository'', 'ObjectHelper'); $objectHelper = $this; $parsedContent = NULL; - $contentModels = $objectHelper->get_content_models_list($pid); + $contentModels = $this->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; $datastreams = $this->get_formatted_datastream_list($pid, $contentModels, $fedoraItem); @@ -672,6 +674,9 @@ class ObjectHelper { if (!empty($contentModels)) { foreach ($contentModels as $contentModel) { if ($contentModel == variable_get('fedora_collection_model_pid', 'islandora:collectionCModel')) { + //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. + $_SESSION['fedora_collection'] = $pid; $isCollection = TRUE; } @@ -689,8 +694,8 @@ class ObjectHelper { if ($results->length > 0 || $isCollection == TRUE) { // if(strlen($objectList)>22||$contentModel=='Collection'||$contentModel=='Community')//length of empty dom still equals 22 because of <table/> etc module_load_include('inc', 'Fedora_Repository', 'CollectionPolicy'); - $collectionPolicyExists = $objectHelper->getMimeType($pid, CollectionPolicy::getDefaultDSID()); - if (user_access(ObjectHelper :: $INGEST_FEDORA_OBJECTS) && $collectionPolicyExists) { + $collectionPolicyExists = $this->getMimeType($pid, CollectionPolicy::getDefaultDSID()); + if (user_access(ObjectHelper::$INGEST_FEDORA_OBJECTS) && $collectionPolicyExists) { if (!empty($collectionPolicyExists)) { $allow = TRUE; if (module_exists('fedora_fesl')) { @@ -745,19 +750,34 @@ class ObjectHelper { return $output; } + /** + * Get the query to find parent objects. + * + * @param $pid string + * A string containing a Fedora PID to find the parents for. + * @return string + * A string containing an iTQL query, selecting something into $object and $title + */ + static function _parent_query($pid) { + return 'select $object $title from <#ri> + where ($object <fedora-model:label> $title + and <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $object + and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) + order by $title'; + } + /** * Gets the parent objects that this object is related to * - * @param unknown_type $pid - * @return unknown + * @param $pid string + * A string containing a Fedora PID to find the parents for. + * @return string + * A string containing Sparql XML (the results of the self::_parent_query()) */ function get_parent_objects($pid) { - $query_string = 'select $object $title from <#ri> - where ($object <fedora-model:label> $title - and <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $object - and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>) - order by $title'; - $objects = $this->getCollectionInfo($pid, $query_string); + $query_string = self::_parent_query(); + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + $objects = CollectionClass::getRelatedItems($pid, $query_string); return $objects; } @@ -768,31 +788,24 @@ class ObjectHelper { * @return string */ function get_parent_objects_asHTML($pid) { - global $base_url; - $parent_collections = $this->get_parent_objects($pid); - try { - $parent_collections = new SimpleXMLElement($parent_collections); - } catch (exception $e) { - drupal_set_message(t('Error getting parent objects @e', array('@e' => check_plain($e->getMessage())))); - return; - } - - $parent_collections_HTML = ''; - foreach ($parent_collections->results->result as $result) { - $collection_label = $result->title; - foreach ($result->object->attributes() as $a => $b) { - if ($a == 'uri') { - $uri = (string) $b; - $uri = $base_url . '/fedora/repository' . substr($uri, strpos($uri, '/')) . '/-/' . $collection_label; - } - } - $parent_collections_HTML .= '<a href="' . $uri . '">' . $collection_label . '</a><br />'; + module_load_include('inc', 'fedora_repository', 'CollectionClass'); + $results = self::perform_itql_query(self::_parent_query($pid)); + + $parent_collections = array(); + foreach ($results as $result) { + $collection_title = $result['title']; + $collection_pid = $result['object']; + $path = "fedora/repository/$collection_pid/-/$collection_title"; + $parent = array( + 'data' => l($collection_title, $path), + ); + + $parent_collections[] = $parent; } - if (!empty($parent_collections_HTML)) { - $parent_collections_HTML = '<tr><td><h3>' . t("Belongs to these collections:") . ' </h3></td><td colspan="4">' . $parent_collections_HTML . '</td></tr>'; + + if (!empty($parent_collections)) { + return theme('item_list', $parent_collections, t('Belongs to these collections'), 'ul'); } - - return $parent_collections_HTML; } /** @@ -842,6 +855,8 @@ class ObjectHelper { /** * Get a tree of related pids - for the basket functionality * + * FIXME: This doesn't actually get a tree... + * * @param type $pid * @return type */ @@ -852,19 +867,18 @@ class ObjectHelper { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Get title and descriptions for $pid - $query_string = 'select $title $desc from <#ri> + $query_string = 'select $title $description from <#ri> where $o <fedora-model:label> $title and $o <dc:description> $desc and $o <mulgara:is> <info:fedora/' . $pid . '>'; - - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query="; - $content = do_curl($url . htmlentities(urlencode($query_string))); - - $rows = explode("\n", $content); - $fields = explode(',', $rows[1]); - - $pids[$pid] = array('title' => $fields[0], 'description' => $fields[1]); + + $results = self::perform_itql_query($query_string); + + $pids = array(); + //There should only be one... Anyway. + foreach($results as $result) { + $pids[$pid] = $result; + } // $pids += $this->get_child_pids(array($pid)); @@ -878,38 +892,24 @@ class ObjectHelper { * @return type */ function get_child_pids($pids) { + //Build the parts which are used to filter to the list of input. + $query_chunks = array(); + foreach ($pids as $pid) { + $query_chunks[] = '$s <mulgara:is> <info:fedora/' . $pid . '>'; + } // Get pid, title and description for children of object $pid $query_string = 'select $o $title from <#ri> ' . -// $query_string = 'select $o $title $desc from <#ri> '. 'where $s <info:fedora/fedora-system:def/relations-external#hasMember> $o ' . 'and $o <fedora-model:label> $title ' . -// 'and $o <dc:description> $desc '. - 'and ( '; - - foreach ($pids as $pid) { - $query_string .= '$s <mulgara:is> <info:fedora/' . $pid . '> or '; - } - $query_string = substr($query_string, 0, -3) . ' )'; - - $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=csv&limit=1000&lang=itql&stream=on&query="; - $url .= htmlentities(urlencode($query_string)); - $content = $this->doCurl($url); - - $rows = explode("\n", $content); - // Knock of the first heading row - array_shift($rows); + 'and ( ' . implode(' or ', $query_chunks) . ' )'; + + $results = self::perform_itql_query($query_string); $child_pids = array(); - if (count($rows)) { + if ($results) { // iterate through each row - foreach ($rows as $row) { - if ($row == "") { - continue; - } - $fields = explode(',', $row); - $child_pid = substr($fields[0], 12); - $child_pids[$child_pid] = array('title' => $fields[1], 'description' => $fields[2]); + foreach ($results as $result) { + $child_pids[$result['o']] = array('title' => $result['title']); } if (!empty($child_pids)) { $child_pids += $this->get_child_pids(array_keys($child_pids)); diff --git a/fedora_repository.module b/fedora_repository.module index 8a80c8e3..e83d91f5 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -869,7 +869,7 @@ function fedora_repository_perm() { * @param type $account * @return type */ -function fedora_repository_access($op, $node, $account) { +function fedora_repository_access($op, $node = NULL, $account = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); return $objectHelper->fedora_repository_access($op, $node, $account); diff --git a/formClass.inc b/formClass.inc index 1d752f3d..4bd1e132 100644 --- a/formClass.inc +++ b/formClass.inc @@ -13,8 +13,8 @@ class formClass { function formClass() { - module_load_include('inc', 'formClass', ''); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); } /** @@ -128,7 +128,8 @@ class formClass { 'title' => t('Collection view'), 'page callback' => 'fedora_collection_view', 'type' => MENU_CALLBACK, - 'access argruments' => array('view fedora collection') + 'access callback' => 'fedora_repository_access', + 'access argruments' => array(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA), ); //new for mnpl****************************************** diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 9283acb2..30e222a6 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -48,10 +48,9 @@ class FedoraObjectDetailedContent { $tabset['fedora_object_details']['tabset'] = array( '#type' => 'tabset', ); + $dc_html = $objectHelper->getFormattedDC($this->item); - $ds_list = $objectHelper->get_formatted_datastream_list($this->pid, NULL, $this->item); - $i = 0; if (fedora_repository_access(OBJECTHELPER :: $VIEW_DETAILED_CONTENT_LIST, $this->pid, $user)) { $tabset['fedora_object_details']['tabset']['view'] = array( @@ -63,9 +62,24 @@ class FedoraObjectDetailedContent { '#weight' => $i++ ), 'list' => array( - '#type' => 'markup', - '#value' => $ds_list, //XXX: The function called here could be cleaned up a fair bit as well... - '#weight' => $i++ + '#type' => 'fieldset', + '#title' => t('Detailed List of Content'), + '#attributes' => array( + 'class' => 'fedora_detailed_list', + ), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#weight' => $i++, + 'parents' => array( + '#type' => 'markup', + '#value' => $objectHelper->get_parent_objects_asHTML($this->pid), + '#weight' => $i++, + ), + 'datastreams' => array( + '#type' => 'markup', + '#value' => $objectHelper->get_formatted_datastream_list($this->pid, NULL, $this->item), //XXX: The function called here could be cleaned up a fair bit as well... + '#weight' => $i++, + ), ), 'purge' => array( '#type' => 'markup', diff --git a/xsl/convertQDC.xsl b/xsl/convertQDC.xsl index c2bb50f0..5d881e35 100644 --- a/xsl/convertQDC.xsl +++ b/xsl/convertQDC.xsl @@ -12,13 +12,13 @@ <tr><th colspan="3"><h3>MetaData</h3></th></tr> <xsl:for-each select="/*/*"> <xsl:variable name="FULLFIELD" select="name()"/> - <xsl:variable name="FIELD" select="substring-after(name(),':')"/> + <xsl:variable name="FIELD" select="local-name()"/> <xsl:variable name="DATA" select="text()"/> <xsl:if test="$DATA != ' '"> - <tr><td><strong><xsl:value-of select="substring-after(name(),':')"/></strong></td><td><xsl:value-of select="text()"/> + <tr><td><strong><xsl:value-of select="local-name()"/></strong></td><td><xsl:value-of select="text()"/> <xsl:for-each select="*"> <div> - <xsl:value-of select="substring-after(name(),':')"/> = <xsl:value-of select="text()"/> + <xsl:value-of select="local-name()"/> = <xsl:value-of select="text()"/> </div> </xsl:for-each> </td></tr> From 7934e43880aa87d8827caf765b6f6d45a6be5ea5 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 15:32:07 -0300 Subject: [PATCH 234/247] Fix string which was bugging me. --- ObjectHelper.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 35200f87..5da8fdfd 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -324,7 +324,7 @@ class ObjectHelper { $allow = fedora_fesl_check_roles($pid, 'write'); } if ($allow) { - $purge_text = t("purge datastream @label", array('@label' => $dataStreamValue->label)); + $purge_text = t('Purge datastream "@label"', array('@label' => $dataStreamValue->label)); $purge_path = "fedora/repository/purgeStream/$pid/{$dataStreamValue->ID}/{$dataStreamValue->label}"; $purge_image = l(theme('image', "$path/images/purge.gif", $purge_text, $purge_text, NULL, FALSE), $purge_path, array( 'html' => TRUE, From 548861b7bc444351a99207d621de2fbdcbd1fa55 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 16:17:53 -0300 Subject: [PATCH 235/247] Avoid DSMing the DC... Derp. --- ObjectHelper.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 5da8fdfd..16076a18 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -425,7 +425,6 @@ class ObjectHelper { ), ); $rows = array(); - dsm($xmlstr); foreach ($simplexml->getNamespaces(TRUE) as $ns) { foreach ($simplexml->children($ns) as $child) { $rows[] = array( From a5e6054fbdc9d9a78c5f729f687b4db2a6d11bf5 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 18:09:20 -0300 Subject: [PATCH 236/247] Extract the Sparql parser out, so it might be used elsewhere during transition. --- ObjectHelper.inc | 72 +++++++++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 16076a18..7fed4f86 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -1015,6 +1015,48 @@ class ObjectHelper { drupal_set_message(t($configMess . "<br />" . $messMap[$app] . "<hr width='40%' align = 'left'/>", array('%app' => $app)), 'warning', FALSE); } + /** + * Parse the passed in Sparql XML string into a more easily usable format. + * + * @param $sparql string + * A string containing Sparql result XML. + * @return array + * Indexed (numerical) array, containing a number of associative arrays, + * with keys being the same as the variable names in the query. + * URIs beginning with 'info:fedora/' will have this beginning stripped + * off, to facilitate their use as PIDs. + */ + public static function parse_sparql_results($sparql) { + //Load the results into a SimpleXMLElement + $doc = new SimpleXMLElement($sparql, 0, FALSE, 'http://www.w3.org/2001/sw/DataAccess/rf1/result'); + + $results = array(); //Storage. + + //Build the results. + foreach ($doc->results->children() as $result) { + //Built a single result. + $r = array(); + foreach ($result->children() as $element) { + $val = NULL; + + $attrs = $element->attributes(); + if (!empty($attrs['uri'])) { + $val = self::_pid_uri_to_bare_pid((string)$attrs['uri']); + } + else { + $val = (string)$element; + } + + //Map the name to the value in the array. + $r[$element->getName()] = $val; + } + + //Add the single result to the set to return. + $results[] = $r; + } + return $results; + } + /** * Performs the given Resource Index query and return the results. * @@ -1064,34 +1106,8 @@ static function perform_ri_query($query, $type = 'itql', $limit = -1, $offset = return FALSE; } - //Load the results into a SimpleXMLElement - $doc = new SimpleXMLElement($curl_result[0], 0, FALSE, 'http://www.w3.org/2001/sw/DataAccess/rf1/result'); - - $results = array(); //Storage. - - //Build the results. - foreach ($doc->results->children() as $result) { - //Built a single result. - $r = array(); - foreach ($result->children() as $element) { - $val = NULL; - - $attrs = $element->attributes(); - if (!empty($attrs['uri'])) { - $val = self::pid_uri_to_bare_pid((string)$attrs['uri']); - } - else { - $val = (string)$element; - } - - //Map the name to the value in the array. - $r[$element->getName()] = $val; - } - - //Add the single result to the set to return. - $results[] = $r; - } - return $results; + //Pass the query's results off to a decent parser. + return self::parse_sparql_results($curl_result[0]); } /** * Thin wrapper for self::_perform_ri_query(). From 4182bfac277a280473c06371efc409f347d5d29b Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Fri, 20 Apr 2012 18:10:35 -0300 Subject: [PATCH 237/247] Add the ability to render a collection view without an XSLT. --- CollectionClass.inc | 245 +++++++++++++++++++++++++++++--------------- 1 file changed, 165 insertions(+), 80 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 2d0c2b31..2bed9a6c 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -71,58 +71,79 @@ class CollectionClass { } /** - * gets objects related to this object. must include offset and limit - * calls getRelatedItems but enforces limit and offset - * @param type $pid - * @param type $limit + * Gets objects related to this object. Must include offset and limit! + * + * Calls self::getRelatedItems() but requires limit and offset. + * + * @param $pid string + * A string containing a Fedora PID. + * @param $limit + * An integer * @param type $offset * @param type $itqlquery * @return type */ static function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { - if (!isset($itqlquery)) { - $itqlquery = self::get_collection_query($pid); - } return self::getRelatedItems($pid, $itqlquery, $limit, $offset); } /** - * Gets objects related to this item. It will query the object for a Query stream and use that as a itql query - * or if there is no query stream it will use the default. If you pass a query to this method it will use the passed in query no matter what - * @global type $user - * @param type $pid - * @param type $itqlquery - * @param int $limit + * Gets objects related to this item. + * + * Query the resource index using the provided iTQL query. If no query is + * provided, one should be obtained via self::get_collection_query() which + * grabs the child objects. + * + * @param $pid string + * A string containing a PID which may be substituted into the query, + * in place of the %parent_collection% placeholder. + * @param $itqlquery string + * An optional iTQL query. + * @param $limit int + * An optional integer to limit the number of results returned. * @param int $offset - * @return type + * An optional integer used to offset the results returned. (Query should + * involve a sort to maintain consistency. + * @return string + * Sparql XML results from the resource index. */ - static function getRelatedItems($pid, $itqlquery = NULL, $limit = NULL, $offset = NULL) { + static function getRelatedItems($pid, $query_string = NULL, $limit = NULL, $offset = NULL) { module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - if (!isset($offset)) { - $offset = 0; - } - global $user; - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { + + if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return ' '; } $objectHelper = new ObjectHelper(); - $query_string = $itqlquery; - if (!isset($query_string)) { + + if ($query_string === NULL) { $query_string = self::get_collection_query($pid); } - + // Replace %parent_collection% with the actual collection PID $query_string = preg_replace("/\%parent_collection\%/", "<info:fedora/$pid>", $query_string); - $query_string = htmlentities(urlencode($query_string)); - - $content = ''; $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); - $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string; - $content .= do_curl($url); + + $settings = array( + 'type' => 'tuples', + 'flush' => TRUE, + 'format' => 'Sparql', + 'lang' => 'itql', + 'stream' => 'on', + 'query' => $query_string + ); + if ($limit > 0) { + $settings['limit'] = $limit; + } + if ($offset > 0) { + $settings['offset'] = $offset; + } + + $url .= '?' . http_build_query($settings, NULL, '&'); + $content = do_curl($url); return $content; } @@ -501,9 +522,12 @@ class CollectionClass { 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 + + //If there's no XSLT from the object, then check if the one which used to exist, does... + if (!$xslContent && $canUseDefault && file_exists($path . '/xsl/sparql_to_html.xsl')) { $xslContent = file_get_contents($path . '/xsl/sparql_to_html.xsl'); } + return $xslContent; } @@ -530,7 +554,6 @@ class CollectionClass { $results = $this->getRelatedItems($this->pid, $query); $collection_items = $this->renderCollection($results, $this->pid, NULL, NULL, $page_number); - //$collection_item = new Fedora_Item($this->pid); //XXX: This didn't seem to be used... $show_batch_tab = FALSE; $policy = CollectionPolicy::loadFromCollection($this->pid, TRUE); @@ -565,17 +588,6 @@ class CollectionClass { '#tab_name' => 'add-tab', ); } - - if ($show_batch_tab && user_access('create batch process')) { //XXX: Is this not put in by the batch module? - $tabset['batch_ingest_tab'] = array( - // #type and #title are the minimum requirements. - '#type' => 'tabpage', - '#title' => t('Batch Ingest'), - // This will be the content of the tab. - '#content' => drupal_get_form('batch_creation_form', $this->pid, $content_models), - '#tab_name' => 'batch-ingest-tab', - ); - } return $tabset; } @@ -608,6 +620,33 @@ class CollectionClass { return $ingestObject; } + /** + * Unfortunate function, I know... + * + * Does just what it says: Hacks the default Drupal pager such that it might + * be rendered. + */ + protected static function _hack_pager($pager_name, $per_page, $total_items) { + global $pager_total, $pager_page_array; + $pager_total[$pager_name] = ceil($total_items / $per_page); + + $page_info = explode(',', isset($_GET['page']) ? $_GET['page'] : ''); + $page = $page_info[$pager_name]; + if ($page < 0) { + $page = 0; + } + + if (!isset($pager_page_array)) { + $pager_page_array = pager_load_array($page, $pager_name, $page_info); + } + else { + $pager_page_array = pager_load_array($page, $pager_name, $pager_page_array); + } + + $page = $pager_page_array[$pager_name]; + return $page; + } + /** * render collection * @global type $base_url @@ -631,60 +670,106 @@ class CollectionClass { $fedoraItem = NULL; - if (!$pageNumber) { - $pageNumber = 1; - } - if (empty($collectionName)) { $collectionName = menu_get_active_title(); } $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(); - $options = array( //Could make this the return of a hook? - 'collectionPid' => $collection_pid, - 'collectionTitle' => $collectionName, - 'baseUrl' => $base_url, - 'path' => "$base_url/$path", - 'hitPage' => $pageNumber, + if (!$xslContent) { //Didn't find an XSLT. + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + $intermediate_results = ObjectHelper::parse_sparql_results($content); + unset($content); + + $per_page = 20; //XXX: Make this configurable. + $pager_name = 0; + $total = count($intermediate_results); + $pager_page = self::_hack_pager($pager_name, $per_page, $total); + + $results = array(); + foreach (array_slice($intermediate_results, $per_page * $pager_page, $per_page) as $result) { + $title = $result['title']; + $obj_path = "fedora/repository/{$result['object']}"; + $thumbnail = theme('image', "$obj_path/TN", $title, $title, array(), FALSE); + $results[] = array( + array( + 'data' => l($thumbnail, $obj_path, array( + 'html' => TRUE, + )), + ), + array( + 'data' => l($title, $obj_path), + ), ); - - if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50100) { - $proc->setParameter('', $options); - } - else { - foreach ($options as $name => $value) { - $proc->setParameter('', $name, $value); + } + if (!$results) { + drupal_set_message(t("No objects in this collection (or bad query).")); + } + else { + $first = $per_page * $pager_page; + $last = (($total - $first) > $per_page)? + ($first + $per_page): + $total; + $objectList = '<h3>' . t('Results @first to @last of @total', array( + '@first' => $first + 1, + '@last' => $last, + '@total' => $total, + )) . '</h3>'; + $objectList .= theme('pager', array(), $per_page, $pager_name); + $objectList .= theme('table', NULL, $results); + $objectList .= theme('pager', array(), $per_page, $pager_name); + } + } + else { + if (!$pageNumber) { + $pageNumber = 1; + } + + //get collection list and display using xslt------------------------------------------- + $input = new DomDocument(); + $input->loadXML(trim($content)); + $results = $input->getElementsByTagName('result'); + if ($results->length > 0) { + try { + $proc = new XsltProcessor(); + $options = array( //Could make this the return of a hook? + 'collectionPid' => $collection_pid, + 'collectionTitle' => $collectionName, + 'baseUrl' => $base_url, + 'path' => "$base_url/$path", + 'hitPage' => $pageNumber, + ); + + if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50100) { + $proc->setParameter('', $options); + } + else { + foreach ($options as $name => $value) { + $proc->setParameter('', $name, $value); + } } - } - $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); + $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); + $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 + $objectList = $newdom->saveHTML(); //is the xml transformed to html as defined in the xslt associated with the collection object - if (!$objectList) { - throw new Exception("Invalid XML."); + if (!$objectList) { + throw new Exception("Invalid XML."); + } + } catch (Exception $e) { + drupal_set_message(check_plain($e->getMessage()), 'error'); + return ''; } - } catch (Exception $e) { - drupal_set_message(check_plain($e->getMessage()), 'error'); - return ''; } } } From eaff54436b3a13663b5987086eda6c11d2594704 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 10:25:45 -0300 Subject: [PATCH 238/247] Get rid of more explicit markup output, in favour of Drupal methods. --- ObjectHelper.inc | 8 ++- formClass.inc | 5 +- plugins/ShowDemoStreamsInFieldSets.inc | 5 +- plugins/ShowStreamsInFieldSets.inc | 42 ++++++----- plugins/herbarium.inc | 4 +- plugins/qt_viewer.inc | 99 +++++++++++++++----------- plugins/slide_viewer.inc | 6 +- plugins/tagging_form.inc | 30 +++++--- 8 files changed, 116 insertions(+), 83 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 7fed4f86..18000b80 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -702,9 +702,11 @@ class ObjectHelper { } if ($allow) { // $ingestObject = '<a title="'. t('Ingest a New object into ') . $collectionName . ' '. $collection_pid . '" href="'. base_path() . - $ingestObject = '<a title="' . t('Ingest a New object into !collection_name PID !collection_pid', array('!collection_name' => $collectionName, '!collection_pid' => $collection_pid)) . '" href="' . base_path() . - 'fedora/ingestObject/' . $collection_pid . '/' . $collectionName . '"><img src="' . $base_url . '/' . $path . - '/images/ingest.png" alt="' . t('Add a New Object') . '" class="icon"></a> ' . t('Add to this Collection'); + $ingest_text = t('Ingest a new object into @collection_name PID @collection_pid', array('@collection_name' => $collectionName, '@collection_pid' => $collection_pid)); + $ingestObject = l(theme('image', "$path/images/ingest.png", $ingest_text), "fedora/ingestObject/$collection_pid/$collectionName", array('attributes' => array( + 'class' => 'icon', + 'title' => $ingest_text, + ))) . t('Add to this Collection'); } } } diff --git a/formClass.inc b/formClass.inc index 4bd1e132..d6cb23df 100644 --- a/formClass.inc +++ b/formClass.inc @@ -230,7 +230,10 @@ class formClass { '#description' => t('The URL to use for SOAP connections'), '#required' => TRUE, '#weight' => -12, - '#suffix' => '<p>' . (fedora_available() ? '<img src="' . url('misc/watchdog-ok.png') . '"/>' . t('Successfully connected to Fedora server at !fedora_soap_url', array('!fedora_soap_url' => variable_get('fedora_soap_url', ''))) : '<img src="' . url('misc/watchdog-error.png') . '"/> ' . t('Unable to connect to Fedora server at !fedora_soap_url</p>', array('!fedora_soap_url' => variable_get('fedora_soap_url', '')))), + '#suffix' => '<p>' . ( + fedora_available() ? + theme('image', 'misc/watchdog-ok.png') . t('Successfully connected to Fedora server at @fedora_soap_url', array('@fedora_soap_url' => variable_get('fedora_soap_url', ''))) : + theme('image', 'misc/watchdog-error.png') . t('Unable to connect to Fedora server at @fedora_soap_url', array('@fedora_soap_url' => variable_get('fedora_soap_url', '')))) . '</p>', ); $form['fedora_soap_manage_url'] = array( diff --git a/plugins/ShowDemoStreamsInFieldSets.inc b/plugins/ShowDemoStreamsInFieldSets.inc index 80f8017c..9d210d2a 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -29,11 +29,10 @@ class ShowDemoStreamsInFieldSets { * @return type */ function showMediumSize() { - global $base_url; + $path = "fedora/repository/{$this->pid}/MEDIUM_SIZE"; $collection_fieldset = array( '#collapsible' => FALSE, - '#value' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/MEDIUM_SIZE/"><img src="' . - $base_url . '/fedora/repository/' . $this->pid . '/MEDIUM_SIZE/MEDIUM_SIZE' . '" /></a>', + '#value' => l(theme('image', $path), $path, array('html' => TRUE)), ); return theme('fieldset', $collection_fieldset); } diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index 9e20ca5a..0bbf9403 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -29,15 +29,21 @@ class ShowStreamsInFieldSets { function showFlv() { //FLV is the datastream id $path = drupal_get_path('module', 'Fedora_Repository'); - $fullPath = base_path() . $path; + $fullPath = url($path); $content = ""; $pathTojs = drupal_get_path('module', 'Fedora_Repository') . '/js/swfobject.js'; drupal_add_js("$pathTojs"); - $content .= '<div id="player' . $this->pid . 'FLV"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>'; - drupal_add_js('var s1 = new SWFObject("' . $fullPath . '/flash/flvplayer.swf","single","320","240","7"); - s1.addParam("allowfullscreen","TRUE"); - s1.addVariable("file","' . base_path() . 'fedora/repository/' . $this->pid . '/FLV/FLV.flv"); - s1.write("player' . $this->pid . 'FLV");', 'inline', 'footer'); + $div_id = "player' . $this->pid . 'FLV"; + $content .= <<<EOH +<div id="$div_id"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div> +EOH; + drupal_add_js(<<<EOJS +var s1 = new SWFObject("$fullPath/flash/flvplayer.swf","single","320","240","7"); +s1.addParam("allowfullscreen","TRUE"); +s1.addVariable("file", "$fullPath/fedora/repository/{$this->pid}/FLV/FLV.flv"); +s1.write("$div_id"); +EOJS +, 'inline', 'footer'); $collection_fieldset = array( '#title' => t('Flash Video'), '#collapsible' => TRUE, @@ -48,30 +54,26 @@ class ShowStreamsInFieldSets { /** * Show the TN ?? - * @global type $base_url * @return type */ function showTN() { - global $base_url; $collection_fieldset = array( '#title' => '', '#attributes' => array(), '#collapsible' => FALSE, - '#value' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/OBJ/"><img src="' . $base_url . '/fedora/repository/' . $this->pid . '/TN/TN' . '" /></a>', + '#value' => l(theme('image', "fedora/repository/{$this->pid}/TN/TN", '', '', NULL, FALSE), "fedora/repository/{$this->pid}/OBJ", array('html' => TRUE)), ); return theme('fieldset', $collection_fieldset); } /** * Same as showTN but artinventory stores the image in a dsid of IMAGE instead of OBJ - * @global type $base_url * @return type */ function showArtInventoryTN() { - global $base_url; $collection_fieldset = array( '#collapsible' => FALSE, - '#value' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/IMAGE/image.jpg"><img src="' . $base_url . '/fedora/repository/' . $this->pid . '/TN/TN' . '" /></a>', + '#value' => l(theme('image', "fedora/repository/{$this->pid}/TN/TN", '', '', NULL, FALSE), "fedora/repository/{$this->pid}/IMAGE/image.jpg", array('html' => TRUE)), ); return theme('fieldset', $collection_fieldset); } @@ -102,14 +104,16 @@ class ShowStreamsInFieldSets { $objectHelper = new ObjectHelper(); $item = new Fedora_Item($this->pid); if (key_exists('TN', $item->datastreams)) { - $tn_url = $base_url . '/fedora/repository/' . $item->pid . '/TN'; + $tn_url = "fedora/repository/{$item->pid}/TN"; } else { - $tn_url = $base_path . drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_app_download_manager.png'; + $tn_url = drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_app_download_manager.png'; } + $tn_url = url($tn_url); + $dc_html = $objectHelper->getFormattedDC($item); - $dl_link = l('<div style="float:left; padding: 10px"><img src="' . $tn_url . '"><br />' . t('View Document') .'</div>', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); + $dl_link = l('<div style="float:left; padding: 10px">' . theme('image', $tn_url, '', '', NULL, FALSE) . '<br />' . t('View Document') .'</div>', "fedora/repository/{$this->pid}/OBJ", array('html' => TRUE)); $tabset['first_tab']['tabs']['view'] = array( '#type' => 'tabpage', @@ -126,11 +130,13 @@ class ShowStreamsInFieldSets { ); } + $viewer_url = 'http://docs.google.com/viewer?url=' . url("fedora/repository/{$this->pid}/OBJ/preview.pdf", array('absolute' => TRUE)) . '&embedded=TRUE'; $tabset['second_tab'] = array( '#type' => 'tabpage', '#title' => t('Read Online'), - '#content' => "<iframe src=\"http://docs.google.com/viewer?url=" . $base_url . '/fedora/repository/' . - $this->pid . '/OBJ/preview.pdf' . "&embedded=TRUE\" style=\"width:600px; height:500px;\" frameborder=\"0\"></iframe>" + '#content' => <<<EOM +<iframe src="$viewer_url" style="width:600px; height:500px;" frameborder="0"></iframe>" +EOM ); // Render the tabset. @@ -164,7 +170,7 @@ class ShowStreamsInFieldSets { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($this->pid); $streams = $item->get_datastreams_list_as_array(); - return "<a href='" . $base_url . "/fedora/repository/" . $this->pid . "/OBJ/" . $streams['OBJ']['label'] . "'>" . $streams['OBJ']['label'] . "</a>"; + return l($streams['OBJ']['label'], "fedora/repository/{$this->pid}/OBJ"); } /** diff --git a/plugins/herbarium.inc b/plugins/herbarium.inc index f7a6d685..0ad13fd6 100644 --- a/plugins/herbarium.inc +++ b/plugins/herbarium.inc @@ -161,13 +161,13 @@ class Herbarium { '#title' => t('Full-size'), '#content' => $html ); + $image = theme('image', "fedora/imageapi/{$this->pid}/JPG/JPG.jpg", '', '', NULL, FALSE); $tabset['first_tab'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', '#title' => t('View'), // This will be the content of the tab. - '#content' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/FULL_JPG/"><img src="' . $base_url . '/fedora/imageapi/' . - $this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>', + '#content' => l($image, "fedora/repository/{$this->pid}/FULL_JPG", array('html' => TRUE)), '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>', ); $dwc = new DarwinCore($this->item); diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index e52e4363..e321f00f 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -125,59 +125,76 @@ class ShowQtStreamsInFieldSets { if ($media === FALSE) { return ''; } - global $base_url; + $path = drupal_get_path('module', 'Fedora_Repository'); - $fullPath = base_path() . $path; - $content = ''; - $pathTojs = drupal_get_path('module', 'Fedora_Repository') . '/js/AC_Quicktime.js'; - drupal_add_js($pathTojs); + + drupal_add_js("$path/js/AC_Quicktime.js"); $divid = 'player' . md5($this->pid) . 'MOV'; - $content .= '<div class="player" id="' . $divid . '">'; + + $collection_fieldset = array( + '#title' => t('Quicktime'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + 'player' => array( + '#type' => 'markup', + '#prefix' => '<div class="player" id="' . $divid . '">', + '#suffix' => '</div>', + ), + ); + if ($pframe !== FALSE) { - $content .= '<div class="poster" style="cursor: pointer; position: relative; width: ' . $width . 'px; min-height: ' . ($height) . 'px;">'; - $content .= '<img src="' . base_path() . 'fedora/repository/' . $this->pid . '/' . $pframe->ID . '/poster.jpg' . '" />'; - $content .= '<div class="play" style="font-size: 128px; color: white; position: absolute; top: 50%; left: 50%; margin-top: -0.085em; margin-left: -0.33em; opacity: 0.9; ">▶</div>'; - $content .= '</div>'; + $collection_fieldset['player']['poster_container'] = array( + '#type' => 'markup', + '#prefix' => '<div class="poster" style="cursor: pointer; position: relative; width: ' . $width . 'px; min-height: ' . ($height) . 'px;">', + '#suffix' => '</div>', + 'poster' => array( + '#type' => 'markup', + '#value' => theme('image', "fedora/repository/{$this->pid}/{$pframe->ID}/poster.jpg", '', '', NULL, FALSE) + ) + 'play' => array( + '#type' => 'markup', + '#prefix' => '<div class="play" style="font-size: 128px; color: white; position: absolute; top: 50%; left: 50%; margin-top: -0.085em; margin-left: -0.33em; opacity: 0.9;">', + '#suffix' => '</div>', + '#value' => ' ', + ), + ); } - $content .= '</div>'; if ($this->enableDownload()) { - $url = base_path() . 'fedora/repository/' . $this->pid . '/OBJ/MOV.mov'; - $content .= '<a class="download" href="' . $url . '">Download Media File</a>'; + //$url = url(); + $collection_fieldset['download_link'] = array( + '#type' => 'markup', + '#value' => l(t('Download Media File'), "fedora/repository/{$this->pid}/OBJ/MOV.mov", array('attributes' => array('class' => 'download'))), + ); } - $src = base_path() . 'fedora/repository/' . $this->pid . '/' . $media->ID . '/MOV.mov'; - $qtparams = ''; - $qtparams .= "'autostart', '" . ($pframe !== FALSE ? 'TRUE' : 'FALSE') . "', "; + $src = url("fedora/repository/{$this->pid}/{$media->ID}/MOV.mov"; + + $qtparams = "'autostart', '" . ($pframe !== FALSE ? 'TRUE' : 'FALSE') . "', "; $init = <<<EOD - $(function() { - src = "$src"; - if(src.substring(0,4) != 'http') { - src = 'http://' + location.host + src; - } - str = QT_GenerateOBJECTText_XHTML(src, "$width", ($height+15), '', - $qtparams - 'postdomevents', 'TRUE', - 'EnableJavaScript', 'TRUE', - 'bgcolor', 'black', - 'controller', 'TRUE', - 'SCALE', 'aspect', - 'LOOP', 'FALSE' - ); - if($('.poster', '#$divid').length ==0) { - $('#$divid').append(str); - } else { - $('#$divid .poster').one('click', function() { $(this).hide(); $('#$divid').append(str); }); - } - }); +$(function() { + src = "$src"; + if(src.substring(0,4) != 'http') { + src = 'http://' + location.host + src; + } + str = QT_GenerateOBJECTText_XHTML(src, "$width", ($height+15), '', + $qtparams + 'postdomevents', 'TRUE', + 'EnableJavaScript', 'TRUE', + 'bgcolor', 'black', + 'controller', 'TRUE', + 'SCALE', 'aspect', + 'LOOP', 'FALSE' + ); + if($('.poster', '#$divid').length == 0) { + $('#$divid').append(str); + } else { + $('#$divid .poster').one('click', function() { $(this).hide(); $('#$divid').append(str); }); + } +}); EOD; drupal_add_js($init, 'inline', 'footer'); - $collection_fieldset = array( - '#title' => t('Quicktime'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#value' => $content); return theme('fieldset', $collection_fieldset); } diff --git a/plugins/slide_viewer.inc b/plugins/slide_viewer.inc index f3bdd6b9..729e824e 100644 --- a/plugins/slide_viewer.inc +++ b/plugins/slide_viewer.inc @@ -30,14 +30,13 @@ class ShowSlideStreamsInFieldSets { function showJPG() { module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets'); - global $base_url; global $user; $tabset = array(); $qs = ''; if ($user->uid != 0) { - $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); + $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); //XXX: Base64 encoding is not encryption; SSL would be nice... } $viewer_url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs; @@ -55,8 +54,7 @@ class ShowSlideStreamsInFieldSets { '#type' => 'tabpage', '#title' => t('View'), // This will be the content of the tab. - '#content' => '<img src="' . $base_url . - '/fedora/imageapi/' . $this->pid . '/JPG/JPG.jpg' . '" />' . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>', + '#content' => theme('image', "fedora/imageapi/{$this->pid}/JPG/JPG.jpg", '', '', NULL, FALSE) . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>', ); return $tabset; diff --git a/plugins/tagging_form.inc b/plugins/tagging_form.inc index 390bf36c..f00274d4 100644 --- a/plugins/tagging_form.inc +++ b/plugins/tagging_form.inc @@ -19,13 +19,15 @@ function _show_subject_tags($pid) { $obj = new Fedora_Item($pid); $tags = new TagSet($obj); if (!empty($tags->tags)) { - $output = "<ul>"; + $items = array(); foreach ($tags->tags as $tag) { - $output .= "<li title=" . $tag['creator'] . '>' . $tag['name'] . '</li> '; + $items[] = array( + 'data' => $tag['name'], + 'title' => $tag['creator'], + ); } - $output .= "</ul>"; + return theme('item_list', $items); } - return $output; } /** @@ -57,21 +59,27 @@ function fedora_repository_image_tagging_form($form_state, $pid) { // Add the current tags to the form. $tagset = new TagSet($obj); + $tags = array(); foreach ($tagset->tags as $tag) { - $form['tags-wrapper']['tags'][$tag['name']] = array( + $form_tag =& $form['tags-wrapper']['tags'][$tag['name']] = array( '#prefix' => '<li>', '#suffix' => '</li>', ); - $form['tags-wrapper']['tags'][$tag['name']]['tag'] = array( - '#prefix' => '<a title="Added by ' . $tag['creator'] . '" href="' . $base_url . '/fedora/repository/mnpl_advanced_search/tag:' . $tag['name'] . '">', - '#value' => $tag['name'], - '#suffix' => '</a>', + + $tag_title_text = t('Added by @creator.', array( + '@creator' => $tag['creator'], + )); + $tag_mnpl_search_path = "fedora/repository/mnpl_advanced_search/tag:{$tag['name']}" + $form_tag['tag'] = array( + '#value' => l($tag['name'], $tag_mnpl_search_path, array('attributes' => array( + 'title' => $tag_title_text + ))), ); if (user_access('modify fedora datastreams') || user_access('add fedora tags')) { // Delete button for each existing tag. - $form['tags-wrapper']['tags'][$tag['name']]['delete'] = array( + $form_tag['delete'] = array( '#type' => 'imagebutton', - '#image' => $base_url . '/' . drupal_get_path('module', 'fedora_repository') . '/images/remove_icon.png', + '#image' => drupal_get_path('module', 'fedora_repository') . '/images/remove_icon.png', '#default_value' => $tag['name'], '#title' => t('Delete this tag'), ); From af364d04bee8c776c1a39deafa288645e613fb45 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 14:46:56 -0300 Subject: [PATCH 239/247] Fix syntax error. --- fedora_repository.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_repository.install b/fedora_repository.install index 169d1178..563fde52 100644 --- a/fedora_repository.install +++ b/fedora_repository.install @@ -64,7 +64,7 @@ function fedora_repository_requirements($phase) { } // Test for DOM - $requirements['dom']['title'] = $t("PHP DOM XML extension library"; + $requirements['dom']['title'] = $t("PHP DOM XML extension library"); if (!method_exists('DOMDocument', 'loadHTML')) { $requirements['dom']['value'] = $t("Not installed"); $requirements['dom']['severity'] = REQUIREMENT_ERROR; From ccfc8454641b482f1e76c6d6b29fe232a4190b1a Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 14:48:52 -0300 Subject: [PATCH 240/247] Clean up and formatting --- xsl/sparql_to_html.xsl | 398 +++++++++++++++++------------------------ 1 file changed, 166 insertions(+), 232 deletions(-) diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index 99045659..c5974403 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -1,248 +1,182 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" version="1.0" xmlns:php="http://php.net/xsl" exclude-result-prefixes="php"> - <!-- Red and White XSLT --> - <xsl:variable name="BASEURL"> - <xsl:value-of select="$baseUrl"/> - </xsl:variable> - <xsl:variable name="PATH"> - <xsl:value-of select="$path"/> - </xsl:variable> - <xsl:variable name="thisPid" select="$collectionPid"/> - <xsl:variable name="size" select="20"/> - <xsl:variable name="page" select="$hitPage"/> - <xsl:variable name="start" select="((number($page) - 1) * number($size)) + 1"/> - <xsl:variable name="end" select="($start - 1) + number($size)"/> + <!-- Red and White XSLT --> + <xsl:variable name="BASEURL" select="$baseUrl"/> + <xsl:variable name="PATH" select="$path"/> + <xsl:variable name="thisPid" select="$collectionPid"/> + <xsl:variable name="size" select="20"/> + <xsl:variable name="page" select="$hitPage"/> + <xsl:variable name="start" select="((number($page) - 1) * number($size)) + 1"/> + <xsl:variable name="end" select="($start - 1) + number($size)"/> <xsl:variable name="cellsPerRow" select="4"/> - <xsl:variable name="count" select="count(s:sparql/s:results/s:result)"/> -<xsl:template match="/"> - <xsl:if test="$count>0"> -<table cellpadding="3" cellspacing="3" width="90%"> - <tr><td colspan="{$cellsPerRow}"> - <!-- <div STYLE="text-align: center;">--> - <!-- start previous next --> - <div class="item-list"> - <ul class="pager"> - <xsl:choose> - <xsl:when test="$end >= $count and $start = 1"> - <xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> - of <xsl:value-of select="$count"/> <br /> - </xsl:when> - <xsl:when test="$end >= $count"> + <xsl:variable name="count" select="count(s:sparql/s:results/s:result)"/> - <xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> - of <xsl:value-of select="$count"/> <br /> - <li class="pager-previous"> - <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page - 1"/> - </xsl:attribute> - <Prev - </a></li> - </xsl:when> - <xsl:when test="$start = 1"> - <xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> - of <xsl:value-of select="$count"/> <br /> - <li class="pager-next"> - <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page + 1"/> - </xsl:attribute> - Next> - </a></li> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> - of <xsl:value-of select="$count"/> <br /> - <li class="pager-previous"> - <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page - 1"/> - </xsl:attribute> - <Prev - </a> </li> - <li class="pager-next"> - <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page + 1"/> - </xsl:attribute> - Next> - </a></li> - </xsl:otherwise> - </xsl:choose> - </ul> - </div> - <!-- end previous next--> - <br clear="all" /> - </td></tr> + <xsl:template match="/"> + <xsl:if test="$count>0"> + <xsl:call-template name="render_pager"/> + <table cellpadding="3" cellspacing="3" width="90%"> + <xsl:apply-templates select="s:sparql/s:results"/> + </table><br clear="all" /> + <xsl:call-template name="render_pager"/> + </xsl:if> + </xsl:template> - <!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() <=$end]"> -<xsl:variable name='OBJECTURI' select="object/@uri"/> -<xsl:variable name='PID' select="substring-after($OBJECTURI,'/')"/> -<tr> -<td> -<img> -<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN -</xsl:attribute> -</img> -<a> -<xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> -</xsl:attribute> -<xsl:value-of select="title"/> -</a> -</td> -</tr> -</xsl:for-each>- ---> - <xsl:apply-templates select="s:sparql/s:results"/> -</table><br clear="all" /> -<!-- start previous next --> - <div class="item-list"> - <ul class="pager"> - <xsl:choose> - <xsl:when test="$end >= $count and $start = 1"> - <xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> - of <xsl:value-of select="$count"/> <br /> - </xsl:when> - <xsl:when test="$end >= $count"> + <xsl:template match="s:sparql/s:results"> + <xsl:for-each select="s:result[position() mod $cellsPerRow = 1 and position()>=$start and position() <=$end]"> + <tr> + <xsl:apply-templates select=". | following-sibling::s:result[position() < $cellsPerRow]"/> + </tr> + </xsl:for-each> + </xsl:template> + + <xsl:template name="render_pager"> + <!-- start previous next --> + <div class="item-list"> + <ul class="pager"> + <xsl:choose> + <xsl:when test="$end >= $count and $start = 1"> + <xsl:value-of select="concat($start, '-', $count, ' of ', $count, ' ')"/><br /> + </xsl:when> + <xsl:when test="$end >= $count"> + <xsl:value-of select="concat($start, '-', $count, ' of ', $count, ' ')"/><br /> + <li class="pager-previous"> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat($BASEURL, '/fedora/repository/', $thisPid, '/-/Collection/', $page - 1)"/> + </xsl:attribute> + <Prev + </a> + </li> + </xsl:when> + <xsl:when test="$start = 1"> + <xsl:value-of select="concat($start, '-', $end, ' of ', $count, ' ')"/><br /> + <li class="pager-next"> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat($BASEURL, '/fedora/repository/', $thisPid, '/-/Collection/', $page + 1)"/> + </xsl:attribute> + Next> + </a> + </li> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat($start, '-', $end, ' of ', $count, ' ')"/><br /> + <li class="pager-previous"> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat($BASEURL, '/fedora/repository/', $thisPid, '/-/Collection/', $page - 1)"/> + </xsl:attribute> + <Prev + </a>  + </li> + <li class="pager-next"> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat($BASEURL, '/fedora/repository/', $thisPid, '/-/Collection/', $page + 1)"/> + </xsl:attribute> + Next> + </a> + </li> + </xsl:otherwise> + </xsl:choose> + </ul> + </div> + <!-- end previous next--> + </xsl:template> - <xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> - of <xsl:value-of select="$count"/> <br /> - <li class="pager-previous"> + <xsl:template match="s:result"> + <xsl:variable name='OBJECTURI' select="s:object/@uri"/> + <xsl:variable name='CONTENTURI' select="s:content/@uri"/> + <xsl:variable name='CONTENTMODEL' select="substring-after($CONTENTURI,'/')"/> + <xsl:variable name='PID' select="substring-after($OBJECTURI,'/')"/> + <xsl:variable name="newTitle" > + <xsl:call-template name="replace-string"> + <xsl:with-param name="text" select="s:title"/> + <xsl:with-param name="from" select="'_'"/> + <xsl:with-param name="to" select="' '"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="cleanTitle" select="php:functionString('fedora_repository_urlencode_string', $newTitle)"/> + + <xsl:variable name="linkUrl"> + <xsl:choose> + <xsl:when test="($CONTENTMODEL='islandora:collectionCModel')"> + <xsl:value-of select="concat($BASEURL, '/fedora/repository/', $PID, '/-/collection')"/> + </xsl:when> + <xsl:otherwise> + <!--the below is an example of going straight to a datastream instead of the details page. + <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="s:title"/>--> + <xsl:value-of select="concat($BASEURL, '/fedora/repository/', $PID)"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="s:content"/> + </xsl:variable> + <td valign="top" width="25%"> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page - 1"/> + <xsl:attribute name="href"> + <xsl:value-of select="$linkUrl"/> </xsl:attribute> - <Prev - </a></li> - </xsl:when> - <xsl:when test="$start = 1"> - <xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> - of <xsl:value-of select="$count"/> <br /> - <li class="pager-next"> + <img> + <xsl:attribute name="src"><xsl:value-of select="concat($BASEURL, '/fedora/repository/', $PID, '/TN')"/></xsl:attribute> + <xsl:attribute name="alt"><xsl:value-of select="$newTitle" disable-output-escaping="yes"/></xsl:attribute> + </img> + </a><br clear="all" /> <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page + 1"/> + <xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> </xsl:attribute> - Next> - </a></li> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> - of <xsl:value-of select="$count"/> <br /> - <li class="pager-previous"> - <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page - 1"/> - </xsl:attribute> - <Prev - </a> </li> - <li class="pager-next"> - <a> - <xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$thisPid"/>/-/Collection/<xsl:value-of select="$page + 1"/> - </xsl:attribute> - Next> - </a></li> - </xsl:otherwise> - </xsl:choose> - </ul> - </div> - <!-- end previous next--> - </xsl:if> -</xsl:template> - <xsl:template match="s:sparql/s:results"> - <xsl:for-each select="s:result[position() mod $cellsPerRow = 1 and position()>=$start and position() <=$end]"> - <tr> - <xsl:apply-templates select=". | following-sibling::s:result[position() < $cellsPerRow]"/> - </tr> - </xsl:for-each> - </xsl:template> - <xsl:template match="s:result"> - <xsl:variable name='OBJECTURI' select="s:object/@uri"/> - <xsl:variable name='CONTENTURI' select="s:content/@uri"/> - <xsl:variable name='CONTENTMODEL' select="substring-after($CONTENTURI,'/')"/> - <xsl:variable name='PID' select="substring-after($OBJECTURI,'/')"/> - <xsl:variable name="newTitle" > - <xsl:call-template name="replace-string"> - <xsl:with-param name="text" select="s:title"/> - <xsl:with-param name="from" select="'_'"/> - <xsl:with-param name="to" select="' '"/> - </xsl:call-template> + <xsl:value-of select="$newTitle" disable-output-escaping="yes" /> + </a> + <!-- example of a url that would drill down to the details page if the url above went directly to a datastream + <xsl:if test="($CONTENTMODEL!='islandora:collectionCModel')"> + <br />[[ <a> + <xsl:attribute name="href"> + <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="$cleanTitle"/> + </xsl:attribute> + DETAILS + </a> ]] + </xsl:if>--> - </xsl:variable> - <xsl:variable name="cleanTitle"> - <xsl:value-of select="php:functionString('fedora_repository_urlencode_string', $newTitle)"/> - </xsl:variable> - <xsl:variable name="linkUrl"> - <xsl:choose> - <xsl:when test="($CONTENTMODEL='islandora:collectionCModel')"> - <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="'collection'"/> - </xsl:when> - <xsl:otherwise> - <!--the below is an example of going straight to a datastream instead of the details page. -<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="s:title"/>--> - <xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/> - </xsl:otherwise> - </xsl:choose> - <xsl:value-of select="s:content"/> - </xsl:variable> - <td valign="top" width="25%"> - <a> - <xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> - </xsl:attribute> - <img> - <xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN - </xsl:attribute> -<xsl:attribute name="alt"><xsl:value-of select="$newTitle" disable-output-escaping="yes"/> - </xsl:attribute> - </img> </a> <br clear="all" /> - <a> - <xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> - </xsl:attribute> - <xsl:value-of select="$newTitle" disable-output-escaping="yes" /> - </a> - <!-- example of a url that would drill down to the details page if the url above went directly to a datastream -<xsl:if test="($CONTENTMODEL!='islandora:collectionCModel')"> -<br />[[ <a> -<xsl:attribute name="href"> -<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="$cleanTitle"/> -</xsl:attribute> -DETAILS -</a> ]] -</xsl:if>--> + </td> + <xsl:if test="(position() = last()) and (position() < $cellsPerRow)"> + <xsl:call-template name="FillerCells"> + <xsl:with-param name="cellCount" select="$cellsPerRow - position()"/> + </xsl:call-template> + </xsl:if> + </xsl:template> - </td> - <xsl:if test="(position() = last()) and (position() < $cellsPerRow)"> - <xsl:call-template name="FillerCells"> - <xsl:with-param name="cellCount" select="$cellsPerRow - position()"/> - </xsl:call-template> - </xsl:if> - </xsl:template> - <xsl:template name="FillerCells"> - <xsl:param name="cellCount"/> - <td> </td> - <xsl:if test="$cellCount > 1"> - <xsl:call-template name="FillerCells"> - <xsl:with-param name="cellCount" select="$cellCount - 1"/> - </xsl:call-template> - </xsl:if> - </xsl:template> - <xsl:template name="replace-string"> - <xsl:param name="text"/> - <xsl:param name="from"/> - <xsl:param name="to"/> + <xsl:template name="FillerCells"> + <xsl:param name="cellCount"/> + <td> </td> + <xsl:if test="$cellCount > 1"> + <xsl:call-template name="FillerCells"> + <xsl:with-param name="cellCount" select="$cellCount - 1"/> + </xsl:call-template> + </xsl:if> + </xsl:template> - <xsl:choose> - <xsl:when test="contains($text, $from)"> + <xsl:template name="replace-string"> + <xsl:param name="text"/> + <xsl:param name="from"/> + <xsl:param name="to"/> - <xsl:variable name="before" select="substring-before($text, $from)"/> - <xsl:variable name="after" select="substring-after($text, $from)"/> - <xsl:variable name="prefix" select="concat($before, $to)"/> + <xsl:choose> + <xsl:when test="contains($text, $from)"> - <xsl:value-of select="$before"/> - <xsl:value-of select="$to"/> - <xsl:call-template name="replace-string"> - <xsl:with-param name="text" select="$after"/> - <xsl:with-param name="from" select="$from"/> - <xsl:with-param name="to" select="$to"/> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$text"/> - </xsl:otherwise> - </xsl:choose> - </xsl:template> -</xsl:stylesheet> + <xsl:variable name="before" select="substring-before($text, $from)"/> + <xsl:variable name="after" select="substring-after($text, $from)"/> + <xsl:variable name="prefix" select="concat($before, $to)"/> + <xsl:value-of select="$before"/> + <xsl:value-of select="$to"/> + <xsl:call-template name="replace-string"> + <xsl:with-param name="text" select="$after"/> + <xsl:with-param name="from" select="$from"/> + <xsl:with-param name="to" select="$to"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$text"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> +</xsl:stylesheet> From ccb4ff56712b951f0060f97a6180fdfddebccc18 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 14:54:28 -0300 Subject: [PATCH 241/247] Remove PHP_VERSION shenanigans, as we don't look back before 5.2... Needed at least 5.1 to be able to add XSLT parameters by array. --- CollectionClass.inc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 2bed9a6c..f03bf4d6 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -6,11 +6,6 @@ * Collection Class Class */ -if (!defined('PHP_VERSION_ID')) { //XXX: This should go elsewhere - $version = explode('.', PHP_VERSION); - define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); -} - /** * This CLASS caches the streams so once you call a getstream once it will always return * the same stream as long as you are using the instance of this class. Cached to @@ -742,14 +737,7 @@ class CollectionClass { 'hitPage' => $pageNumber, ); - if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50100) { - $proc->setParameter('', $options); - } - else { - foreach ($options as $name => $value) { - $proc->setParameter('', $name, $value); - } - } + $proc->setParameter('', $options); $proc->registerPHPFunctions(); $xsl = new DomDocument(); From 3a559b7701637c3508e812fa5f14693ffec0cea3 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 14:55:37 -0300 Subject: [PATCH 242/247] Undo bit of code which ended up producing warnings/errors... ... In calling deprecated code, but anyway. --- formClass.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/formClass.inc b/formClass.inc index d6cb23df..7a54133a 100644 --- a/formClass.inc +++ b/formClass.inc @@ -128,8 +128,7 @@ class formClass { 'title' => t('Collection view'), 'page callback' => 'fedora_collection_view', 'type' => MENU_CALLBACK, - 'access callback' => 'fedora_repository_access', - 'access argruments' => array(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA), + 'access argruments' => array('view fedora collection'), ); //new for mnpl****************************************** From b2c1d613f11bc75cc7a4c4544462aad6c644091c Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 15:00:18 -0300 Subject: [PATCH 243/247] Remove include added in previous (reverted) commit. --- formClass.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 7a54133a..713f1fcb 100644 --- a/formClass.inc +++ b/formClass.inc @@ -14,7 +14,6 @@ class formClass { function formClass() { drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); } /** From f7bd67d01566f75d243139fc9126de9c02b73679 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 15:16:35 -0300 Subject: [PATCH 244/247] Use an item_list instead of a table, for the XSLT-less display. Should add some default CSS. --- CollectionClass.inc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index f03bf4d6..77318b03 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -689,14 +689,12 @@ class CollectionClass { $obj_path = "fedora/repository/{$result['object']}"; $thumbnail = theme('image', "$obj_path/TN", $title, $title, array(), FALSE); $results[] = array( - array( - 'data' => l($thumbnail, $obj_path, array( - 'html' => TRUE, - )), - ), - array( - 'data' => l($title, $obj_path), - ), + 'data' => l($thumbnail, $obj_path, array( + 'html' => TRUE, + 'attributes' => array( + 'class' => 'results-image', + ), + )) . l($title, $obj_path, array('attributes' => array('class' => 'results-text'))), ); } if (!$results) { @@ -707,13 +705,16 @@ class CollectionClass { $last = (($total - $first) > $per_page)? ($first + $per_page): $total; - $objectList = '<h3>' . t('Results @first to @last of @total', array( + $results_range_text = t('Results @first to @last of @total', array( '@first' => $first + 1, '@last' => $last, '@total' => $total, - )) . '</h3>'; + )); + //$objectList = '<h3>' . $results_range_text . '</h3>'; $objectList .= theme('pager', array(), $per_page, $pager_name); - $objectList .= theme('table', NULL, $results); + $objectList .= theme('item_list', $results, $result_range_text, 'ul', array( + 'class' => 'islandora-collection-results-list', + )); $objectList .= theme('pager', array(), $per_page, $pager_name); } } From 8cebf38560689036836c70618080110827ba08d0 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 15:41:50 -0300 Subject: [PATCH 245/247] Undo making a couple functions static and fix merge error. --- CollectionClass.inc | 19 +++++++------------ ObjectHelper.inc | 3 ++- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 77318b03..68dbc08a 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -54,6 +54,7 @@ class CollectionClass { return FALSE; } } + static function _get_default_collection_query($pid) { return 'select $object $title $content from <#ri> where ($object <fedora-model:label> $title @@ -78,8 +79,8 @@ class CollectionClass { * @param type $itqlquery * @return type */ - static function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { - return self::getRelatedItems($pid, $itqlquery, $limit, $offset); + function getRelatedObjects($pid, $limit, $offset, $itqlquery=NULL) { + return $this->getRelatedItems($pid, $itqlquery, $limit, $offset); } /** @@ -92,7 +93,7 @@ class CollectionClass { * @param $pid string * A string containing a PID which may be substituted into the query, * in place of the %parent_collection% placeholder. - * @param $itqlquery string + * @param $query_string string * An optional iTQL query. * @param $limit int * An optional integer to limit the number of results returned. @@ -102,15 +103,13 @@ class CollectionClass { * @return string * Sparql XML results from the resource index. */ - static function getRelatedItems($pid, $query_string = NULL, $limit = NULL, $offset = NULL) { - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); + function getRelatedItems($pid, $query_string = NULL, $limit = NULL, $offset = NULL) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid)) { drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error'); return ' '; } - $objectHelper = new ObjectHelper(); if ($query_string === NULL) { $query_string = self::get_collection_query($pid); @@ -593,10 +592,8 @@ class CollectionClass { * @return string */ function getIngestInterface() { - global $base_url; - $objectHelper = new ObjectHelper(); module_load_include('inc', 'Fedora_Repository', 'CollectionPolicy'); - $collectionPolicyExists = $objectHelper->getMimeType($this->pid, CollectionPolicy::getDefaultDSID()); + $collectionPolicyExists = $this->collectionObject->getMimeType($this->pid, CollectionPolicy::getDefaultDSID()); if (user_access(ObjectHelper :: $INGEST_FEDORA_OBJECTS) && $collectionPolicyExists) { if (!empty($collectionPolicyExists)) { $allow = TRUE; @@ -656,9 +653,8 @@ class CollectionClass { $path = drupal_get_path('module', 'fedora_repository'); global $base_url; $collection_pid = $pid; //we will be changing the pid later maybe - $objectHelper = new ObjectHelper(); $parsedContent = NULL; - $contentModels = $objectHelper->get_content_models_list($pid); + $contentModels = $this->collectionObject->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. @@ -674,7 +670,6 @@ class CollectionClass { $objectList = ''; if (isset($content) && $content != FALSE) { if (!$xslContent) { //Didn't find an XSLT. - module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $intermediate_results = ObjectHelper::parse_sparql_results($content); unset($content); diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 18000b80..358aaac5 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -778,6 +778,7 @@ class ObjectHelper { function get_parent_objects($pid) { $query_string = self::_parent_query(); module_load_include('inc', 'fedora_repository', 'CollectionClass'); + $collection_class = new CollectionClass($pid); $objects = CollectionClass::getRelatedItems($pid, $query_string); return $objects; } @@ -1043,7 +1044,7 @@ class ObjectHelper { $attrs = $element->attributes(); if (!empty($attrs['uri'])) { - $val = self::_pid_uri_to_bare_pid((string)$attrs['uri']); + $val = self::pid_uri_to_bare_pid((string)$attrs['uri']); } else { $val = (string)$element; From 3b64841ca7c00df18541ef21dbac73f72c95da1e Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Mon, 23 Apr 2012 19:44:48 -0300 Subject: [PATCH 246/247] Conform a little better with the Drupal code standards. --- CollectionClass.inc | 55 ++++++++++++++++++++++++++++++++++++--------- ObjectHelper.inc | 42 +++++++++++++++++----------------- 2 files changed, 65 insertions(+), 32 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 68dbc08a..5882a460 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -35,16 +35,16 @@ class CollectionClass { } } - static function get_collection_query($pid) { - if ($query = self::_get_collection_query_from_stream($pid)) { + public static function getCollectionQuery($pid) { + if ($query = self::getCollectionQueryFromStream($pid)) { return $query; } else { - return self::_get_default_collection_query($pid); + return self::getDefaultCollectionQuery($pid); } } - static function _get_collection_query_from_stream($pid) { + protected static function getCollectionQueryFromStream($pid) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($pid); if ($item->exists() && array_key_exists('QUERY', $item->datastreams)) { @@ -55,7 +55,7 @@ class CollectionClass { } } - static function _get_default_collection_query($pid) { + protected static function getDefaultCollectionQuery($pid) { return 'select $object $title $content from <#ri> where ($object <fedora-model:label> $title and $object <fedora-model:hasModel> $content @@ -87,7 +87,7 @@ class CollectionClass { * Gets objects related to this item. * * Query the resource index using the provided iTQL query. If no query is - * provided, one should be obtained via self::get_collection_query() which + * provided, one should be obtained via self::getCollectionQuery() which * grabs the child objects. * * @param $pid string @@ -112,7 +112,7 @@ class CollectionClass { } if ($query_string === NULL) { - $query_string = self::get_collection_query($pid); + $query_string = self::getCollectionQuery($pid); } // Replace %parent_collection% with the actual collection PID @@ -616,12 +616,45 @@ class CollectionClass { * Unfortunate function, I know... * * Does just what it says: Hacks the default Drupal pager such that it might - * be rendered. + * be rendered, likely with: theme('pager', array(), $per_page, $pager_name) + * (I reccomend seeing the real documentation for more detail, but the first + * array can be a list of the tags to use for first, previous, next and last + * (text in the pager), I don't believe per_page is actually used in the theme + * function, and $pager_name is an integer used to identify the pager (such + * that there can be more than one--that is, tracking different lists of + * content on a single page. You can render the exact same pager multiple + * times, say if you want one at the top and bottom of a list, using the same + * ID/pager_name. + * + * @global $pager_total array + * Numerically indexed array, where keys are the $pager_names and values + * are the number of pages in the given set, based on: ceil($total_items/$per_page); + * @global $pager_page_array array + * Numerically indexed array, where keys are the $pager_names and values + * are the page selected in the relevant set. + * @param $pager_name int + * An integer to identify the pager to affect. Do note that paging in using + * this function will add the 'page' HTTP GET parameter to the URL, with + * the value containing a comma-separated list with max($pager_name + 1) + * values--that is, if you create a single pager named '10', the 'next' + * link will look something like: 0,0,0,0,0,0,0,0,0,0,1 + * @param $per_page int + * An integer representing the number of items per page. + * @param $total_items int + * An integer representing the total number of items in the set. + * @return int + * An integer representing what the current page should be. */ - protected static function _hack_pager($pager_name, $per_page, $total_items) { + protected static function hackPager($pager_name, $per_page = NULL, $total_items = NULL) { global $pager_total, $pager_page_array; - $pager_total[$pager_name] = ceil($total_items / $per_page); + if ($per_page !== NULL && $total_items !== NULL) { + $pager_total[$pager_name] = ceil($total_items / $per_page); + } + + //XXX: Don't know that this is neccessary, to try to load all the time, or + // whether Drupal will load it automatically somewhere... Docs seems a + // a little sparse. $page_info = explode(',', isset($_GET['page']) ? $_GET['page'] : ''); $page = $page_info[$pager_name]; if ($page < 0) { @@ -676,7 +709,7 @@ class CollectionClass { $per_page = 20; //XXX: Make this configurable. $pager_name = 0; $total = count($intermediate_results); - $pager_page = self::_hack_pager($pager_name, $per_page, $total); + $pager_page = self::hackPager($pager_name, $per_page, $total); $results = array(); foreach (array_slice($intermediate_results, $per_page * $pager_page, $per_page) as $result) { diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 659847d7..f41217cc 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -759,7 +759,7 @@ class ObjectHelper { * @return string * A string containing an iTQL query, selecting something into $object and $title */ - static function _parent_query($pid) { + static function parentQuery($pid) { return 'select $object $title from <#ri> where ($object <fedora-model:label> $title and <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $object @@ -773,10 +773,10 @@ class ObjectHelper { * @param $pid string * A string containing a Fedora PID to find the parents for. * @return string - * A string containing Sparql XML (the results of the self::_parent_query()) + * A string containing Sparql XML (the results of the self::parentQuery()) */ function get_parent_objects($pid) { - $query_string = self::_parent_query(); + $query_string = self::parentQuery(); module_load_include('inc', 'fedora_repository', 'CollectionClass'); $collection_class = new CollectionClass($pid); $objects = CollectionClass::getRelatedItems($pid, $query_string); @@ -791,7 +791,7 @@ class ObjectHelper { */ function get_parent_objects_asHTML($pid) { module_load_include('inc', 'fedora_repository', 'CollectionClass'); - $results = self::perform_itql_query(self::_parent_query($pid)); + $results = self::performItqlQuery(self::parentQuery($pid)); $parent_collections = array(); foreach ($results as $result) { @@ -874,7 +874,7 @@ class ObjectHelper { and $o <dc:description> $desc and $o <mulgara:is> <info:fedora/' . $pid . '>'; - $results = self::perform_itql_query($query_string); + $results = self::performItqlQuery($query_string); $pids = array(); //There should only be one... Anyway. @@ -905,7 +905,7 @@ class ObjectHelper { 'and $o <fedora-model:label> $title ' . 'and ( ' . implode(' or ', $query_chunks) . ' )'; - $results = self::perform_itql_query($query_string); + $results = self::performItqlQuery($query_string); $child_pids = array(); if ($results) { @@ -979,7 +979,7 @@ class ObjectHelper { minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> order by $title desc'; - if (count($results = self::perform_itql_query($query_string)) > 0 && $level > 0) { + if (count($results = self::performItqlQuery($query_string)) > 0 && $level > 0) { $parent = $results[0]['parentObject']; $this_title = $results[0]['title']; @@ -1029,7 +1029,7 @@ class ObjectHelper { * URIs beginning with 'info:fedora/' will have this beginning stripped * off, to facilitate their use as PIDs. */ - public static function parse_sparql_results($sparql) { + public static function parseSparqlResults($sparql) { //Load the results into a SimpleXMLElement $doc = new SimpleXMLElement($sparql, 0, FALSE, 'http://www.w3.org/2001/sw/DataAccess/rf1/result'); @@ -1044,7 +1044,7 @@ class ObjectHelper { $attrs = $element->attributes(); if (!empty($attrs['uri'])) { - $val = self::pid_uri_to_bare_pid((string)$attrs['uri']); + $val = self::pidUriToBarePid((string)$attrs['uri']); } else { $val = (string)$element; @@ -1079,7 +1079,7 @@ class ObjectHelper { * URIs beginning with 'info:fedora/' will have this beginning stripped * off, to facilitate their use as PIDs. */ - static function perform_ri_query($query, $type = 'itql', $limit = -1, $offset = 0) { + static function performRiQuery($query, $type = 'itql', $limit = -1, $offset = 0) { //Setup the query options... $options = array( 'type' => 'tuples', @@ -1110,26 +1110,26 @@ class ObjectHelper { } //Pass the query's results off to a decent parser. - return self::parse_sparql_results($curl_result[0]); + return self::parseSparqlResults($curl_result[0]); } /** - * Thin wrapper for self::_perform_ri_query(). + * Thin wrapper for self::_performRiQuery(). * - * @see self::_perform_ri_query() + * @see self::performRiQuery() */ - public static function perform_itql_query($query, $limit = -1, $offset = 0) { - return self::perform_ri_query($query, 'itql', $limit, $offset); + public static function performItqlQuery($query, $limit = -1, $offset = 0) { + return self::performRiQuery($query, 'itql', $limit, $offset); } /** - * Thin wrapper for self::_perform_ri_query(). + * Thin wrapper for self::performRiQuery(). * - * @see self::_perform_ri_query() + * @see self::_performRiQuery() */ - public static function perform_sparql_query($query, $limit = -1, $offset = 0) { - return self::perform_ri_query($query, 'sparql', $limit, $offset); + public static function performSparqlQuery($query, $limit = -1, $offset = 0) { + return self::performRiQuery($query, 'sparql', $limit, $offset); } /** - * Utility function used in self::_perform_ri_query(). + * Utility function used in self::performRiQuery(). * * Strips off the 'info:fedora/' prefix from the passed in string. * @@ -1140,7 +1140,7 @@ class ObjectHelper { * The input string less the 'info:fedora/' prefix (if it has it). * The original string otherwise. */ - protected static function pid_uri_to_bare_pid($uri) { + protected static function pidUriToBarePid($uri) { $chunk = 'info:fedora/'; $pos = strpos($uri, $chunk); if ($pos === 0) { //Remove info:fedora/ chunk From 364e908ff525977e920cdefc028c9ab0b9ab9057 Mon Sep 17 00:00:00 2001 From: Adam Vessey <adam@discoverygarden.ca> Date: Tue, 24 Apr 2012 09:58:13 -0300 Subject: [PATCH 247/247] Fix error intro'd during refactor. --- ObjectHelper.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index f41217cc..e866f62f 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -359,7 +359,7 @@ class ObjectHelper { $label_deslashed = preg_replace('/\//i', '${1}_', $label); // Necessary to handle the case of Datastream labels that contain slashes. Ugh. $mimeType = $dataStreamValue->MIMEType; - $view = l(t('View'), "'fedora/repository/$pid/$id/$label_deslashed", array( + $view = l(t('View'), "fedora/repository/$pid/$id/$label_deslashed", array( 'attributes' => array( 'target' => '_blank', ),