Browse Source

ISLANDORA-278 Initial pass at making the islandora code conform to the drupal coding standards.

pull/7/head^2
jonathangreen 13 years ago
parent
commit
abfc84457d
  1. 2
      CollectionClass.inc
  2. 143
      CollectionPolicy.inc
  3. 22
      ConnectionHelper.inc
  4. 360
      ContentModel.inc
  5. 52
      MimeClass.inc
  6. 46
      ObjectHelper.inc
  7. 98
      SearchClass.inc
  8. 26
      SecurityClass.inc
  9. 13
      XMLDatastream.inc
  10. 10
      api/dublin_core.inc
  11. 29
      api/fedora_collection.inc
  12. 12
      api/fedora_export.inc
  13. 17
      api/fedora_item.inc
  14. 36
      api/fedora_utils.inc
  15. 11
      api/rels-ext.inc
  16. 10
      api/tagging.inc
  17. 1
      collection_policies/COLLECTION-COLLECTION POLICY.xml
  18. 25
      collection_policies/PDF-COLLECTION POLICY.xml
  19. 1
      collection_policies/PERSONAL-COLLECTION-POLICY.xml
  20. 1
      collection_policies/book_collection_policy.xml
  21. 43
      collection_policies/qt_collection_policy.xml
  22. 1
      collection_policy.xsd
  23. 7
      collection_views/Coverflow_Collection_View.xsl
  24. 7
      collection_views/Coverflow_PRE_Collection_View.xsl
  25. 151
      collection_views/FLV-COLLECTION VIEW(2).xml
  26. 131
      collection_views/REFWORKS-COLLECTION_VIEW.xml
  27. 145
      collection_views/SIMPLE-COLLECTION_VIEW.xml
  28. 4
      collection_views/SmileyStuff-COLLECTION_VIEW.xml
  29. 4
      collection_views/Video-COLLECTION_VIEW.xml
  30. 135
      collection_views/default-sparqltoHtml.xsl
  31. 4
      collection_views/simple_list_view.xml
  32. 4
      collection_views/standard_jpeg_collection_view.xml
  33. 244
      collection_views/yui_coverflow/js/CoverFlow.js
  34. 87
      collection_views/yui_coverflow/js/test.js
  35. 2
      content_models/BASIC_AUDIO.xml
  36. 2
      content_models/BASIC_VIDEO.xml
  37. 1
      content_models/COLLECTIONCM.xml
  38. 1
      content_models/FAS_slideCModel.xml
  39. 2
      content_models/STANDARD PDF.xml
  40. 2
      content_models/STANDARD_FLVCM.xml
  41. 2
      content_models/STANDARD_IMAGECM.xml
  42. 33
      content_models/STANDARD_QT.xml
  43. 1
      content_models/STRICT_PDFCM.xml
  44. 15
      content_models/ilives_tei2htmlSdep-pageCModel.xml
  45. 294
      content_models/islandora_jp2Sdep-slideCModel.xml
  46. 20
      content_models/islandora_mods2htmlSdep.xml
  47. 71
      content_models/islandora_qtCModel.xml
  48. 154
      example_collection_views/MHL-sparqltoHtml.xsl
  49. 95
      example_collection_views/critter.xsl
  50. 151
      example_collection_views/flv-sparqltoHtml.xsl
  51. 147
      example_collection_views/mlp-sparqltoHtml.xsl
  52. 174
      example_collection_views/refworks.xsl
  53. 156
      example_collection_views/riri-sparqltoHtml.xsl
  54. 135
      example_collection_views/sparqltoHtml.xsl
  55. 5
      fedora_repository.install
  56. 97
      fedora_repository.module
  57. 10
      fedora_repository.solutionpacks.inc
  58. 7
      formClass.inc
  59. 6
      form_elements/css/sticky.css
  60. 26
      form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css
  61. 144
      form_elements/includes/autocomplete.inc
  62. 115
      form_elements/includes/creative_commons.inc
  63. 76
      form_elements/includes/filechooser.inc
  64. 43
      form_elements/includes/people.inc
  65. 534
      form_elements/islandora_form_elements.module
  66. 56
      form_elements/js/copyright.js
  67. 4
      form_elements/js/filechooser.js
  68. 47
      form_elements/js/jcarousellite_1.0.1.js
  69. 39
      form_elements/js/jquery.easing.1.1.js
  70. 17
      form_elements/js/jquery.loadImages.1.0.1.min.js
  71. 46
      form_elements/js/jquery.mousewheel.min.js
  72. 146
      form_elements/js/jquery.tag.editor-min.js
  73. 38
      form_elements/js/jquery.ui.core.js
  74. 223
      form_elements/js/jquery.ui.datepicker.js
  75. 32
      form_elements/js/jquery.ui.widget.js
  76. 4
      form_elements/js/otherselect.js
  77. 18
      form_elements/js/people_ahah.js
  78. 36
      form_elements/xml/gacs.xml
  79. 6
      form_elements/xml/languages.xml
  80. 2
      ilives/book.inc
  81. 3
      ilives/fedora_ilives.install
  82. 2
      ilives/fedora_ilives.module
  83. 27
      ilives/image_rotator_tagger_block.inc
  84. 4
      ilives/searchTerms.xml
  85. 16
      ilives/tests/fedora_ilives.test
  86. 193
      ilives/xml/ilives_CollectionModel.xml
  87. 90
      ilives/xml/ilives_collection.xml
  88. 15
      ilives/xml/ilives_tei2htmlSdep-pageCModel.xml
  89. 9
      ilives/xsl/MODS3-22simpleDC.xsl
  90. 183
      ilives/xsl/book_view.xsl
  91. 13
      ilives/xsl/pageResults.xsl
  92. 143
      ilives/xsl/results.xsl
  93. 1
      islandoracm.xsd
  94. 6
      js/AC_Quicktime.js
  95. 23
      js/printer_tool.js
  96. 51
      js/swfobject.js
  97. 12
      plugins/CollectionFormBuilder.inc
  98. 7
      plugins/CreateCollection.inc
  99. 15
      plugins/DarwinCore.inc
  100. 14
      plugins/DemoFormBuilder.inc
  101. Some files were not shown because too many files have changed in this diff Show More

2
CollectionClass.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
/* /*
* Created on 18-Feb-08 * Created on 18-Feb-08

143
CollectionPolicy.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
module_load_include('inc', 'fedora_repository', 'XMLDatastream'); module_load_include('inc', 'fedora_repository', 'XMLDatastream');
@ -8,8 +8,7 @@ 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'; static $DEFAULT_DSID = 'COLLECTION_POLICY';
private $staging_area = NULL;
private $staging_area=NULL;
/** /**
* Gets the default DSID to use for ContentModel datastreams. * Gets the default DSID to use for ContentModel datastreams.
@ -36,22 +35,21 @@ class CollectionPolicy extends XMLDatastream {
try { try {
if (self::validPid($pid)) { if (self::validPid($pid)) {
$dsid=CollectionPolicy::getDefaultDSID(); $dsid = CollectionPolicy::getDefaultDSID();
if ($preFetch) { if ($preFetch) {
$fedoraItem = new Fedora_Item($pid); $fedoraItem = new Fedora_Item($pid);
$ds = $fedoraItem->get_datastream_dissemination($dsid); $ds = $fedoraItem->get_datastream_dissemination($dsid);
} else {
$ds=null;
} }
else {
$ds = NULL;
}
} }
if (!empty($ds) || !$preFetch) { if (!empty($ds) || !$preFetch) {
$ret=new CollectionPolicy($ds, $pid, $dsid); $ret = new CollectionPolicy($ds, $pid, $dsid);
} }
} } catch (SOAPException $e) {
catch (SOAPException $e) {
$ret = FALSE; $ret = FALSE;
} }
@ -133,7 +131,7 @@ class CollectionPolicy extends XMLDatastream {
*/ */
public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) { public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) {
$ret = FALSE; $ret = FALSE;
if (($cp = self::loadFromCollection($pid )) === FALSE) { //removed second, non-existant variable if (($cp = self::loadFromCollection($pid)) === FALSE) { //removed second, non-existant variable
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) { if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) {
$newDom = new DOMDocument('1.0', 'utf-8'); $newDom = new DOMDocument('1.0', 'utf-8');
@ -142,7 +140,7 @@ class CollectionPolicy extends XMLDatastream {
$rootEl->setAttribute('name', $name); $rootEl->setAttribute('name', $name);
$rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns', self::$XMLNS);
$rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); $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'); $modelsEl = $newDom->createElement('content_models');
@ -175,13 +173,11 @@ class CollectionPolicy extends XMLDatastream {
$fedoraItem->add_datastream_from_string($cp->dumpXml(), $policyDsid, $name, 'text/xml', 'X'); $fedoraItem->add_datastream_from_string($cp->dumpXml(), $policyDsid, $name, 'text/xml', 'X');
$ret = $cp; $ret = $cp;
} }
} }
return $ret; return $ret;
} }
/** /**
* Constructor * Constructor
* NOTE: Use the static constructor methods whenever possible. * NOTE: Use the static constructor methods whenever possible.
@ -192,8 +188,8 @@ class CollectionPolicy extends XMLDatastream {
* @return XMLDatastream $cm * @return XMLDatastream $cm
*/ */
public function __construct($xmlStr, $pid = NULL, $dsid = NULL) { public function __construct($xmlStr, $pid = NULL, $dsid = NULL) {
parent::__construct($xmlStr,$pid,$dsid); parent::__construct($xmlStr, $pid, $dsid);
$this->name= 'Collection Policy'; $this->name = 'Collection Policy';
} }
/** /**
@ -215,7 +211,7 @@ class CollectionPolicy extends XMLDatastream {
$rootEl->setAttribute('name', $sXml['name']); $rootEl->setAttribute('name', $sXml['name']);
$rootEl->setAttribute('xmlns', self::$XMLNS); $rootEl->setAttribute('xmlns', self::$XMLNS);
$rootEl->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); $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'); $content_modelsEl = $newDom->createElement('content_models');
foreach ($sXml->contentmodels->contentmodel as $contentmodel) { foreach ($sXml->contentmodels->contentmodel as $contentmodel) {
@ -247,7 +243,6 @@ class CollectionPolicy extends XMLDatastream {
$this->xml = DOMDocument::loadXML($newDom->saveXml()); $this->xml = DOMDocument::loadXML($newDom->saveXml());
} }
/** /**
* Gets the name of the relationship to use * Gets the name of the relationship to use
* for members of this collection. * for members of this collection.
@ -256,9 +251,9 @@ class CollectionPolicy extends XMLDatastream {
* @return string $relationship * @return string $relationship
*/ */
public function getRelationship() { public function getRelationship() {
$ret=FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
$ret=trim($this->xml->getElementsByTagName('relationship')->item(0)->nodeValue); $ret = trim($this->xml->getElementsByTagName('relationship')->item(0)->nodeValue);
} }
return $ret; return $ret;
} }
@ -272,10 +267,10 @@ class CollectionPolicy extends XMLDatastream {
* @return boolean $ret * @return boolean $ret
*/ */
public function setRelationship($relationship) { public function setRelationship($relationship) {
$ret=FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
$relationshipEl=$this->xml->getElementsByTagName('relationship')->item(0); $relationshipEl = $this->xml->getElementsByTagName('relationship')->item(0);
$relationshipEl->nodeValue=trim($relationship); $relationshipEl->nodeValue = trim($relationship);
$ret = TRUE; $ret = TRUE;
} }
return $ret; return $ret;
@ -290,17 +285,18 @@ class CollectionPolicy extends XMLDatastream {
* @return string $path * @return string $path
*/ */
public function getStagingArea($recurse=TRUE) { public function getStagingArea($recurse=TRUE) {
$ret=FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
if ($this->staging_area === NULL) { if ($this->staging_area === NULL) {
$stagingEl=$this->xml->getElementsByTagName('staging_area'); $stagingEl = $this->xml->getElementsByTagName('staging_area');
if ($stagingEl->length > 0) { if ($stagingEl->length > 0) {
$this->staging_area = trim($stagingEl->item(0)->nodeValue); $this->staging_area = trim($stagingEl->item(0)->nodeValue);
} elseif ($recurse) { }
elseif ($recurse) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item=new Fedora_Item($this->pid); $item = new Fedora_Item($this->pid);
$rels=$item->get_relationships(); $rels = $item->get_relationships();
if (count($rels) > 0) { if (count($rels) > 0) {
foreach ($rels as $rel) { foreach ($rels as $rel) {
$cp = CollectionPolicy::loadFromCollection($rel['object']); $cp = CollectionPolicy::loadFromCollection($rel['object']);
@ -314,7 +310,6 @@ class CollectionPolicy extends XMLDatastream {
} }
$ret = $this->staging_area; $ret = $this->staging_area;
} }
return $ret; return $ret;
} }
@ -329,21 +324,21 @@ class CollectionPolicy extends XMLDatastream {
* @return string $relationship * @return string $relationship
*/ */
public function setStagingArea($path) { public function setStagingArea($path) {
$ret=FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
$rootEl=$this->xml->getElementsByTagName('collection_policy')->item(0); $rootEl = $this->xml->getElementsByTagName('collection_policy')->item(0);
$stagingEl=$this->xml->getElementsByTagName('staging_area'); $stagingEl = $this->xml->getElementsByTagName('staging_area');
if ($stagingEl->length > 0) { if ($stagingEl->length > 0) {
$stagingEl=$stagingEl->item(0); $stagingEl = $stagingEl->item(0);
if (trim($path) == '') { if (trim($path) == '') {
$rootEl->removeChild($stagingEl); $rootEl->removeChild($stagingEl);
} }
else { else {
$stagingEl->nodeValue=trim($path); $stagingEl->nodeValue = trim($path);
} }
} }
elseif (trim($path) != '') { elseif (trim($path) != '') {
$stagingEl=$this->xml->createElement('staging_area', trim($path)); $stagingEl = $this->xml->createElement('staging_area', trim($path));
$rootEl->appendChild($stagingEl); $rootEl->appendChild($stagingEl);
} }
@ -352,7 +347,6 @@ class CollectionPolicy extends XMLDatastream {
return $ret; return $ret;
} }
/** /**
* Gets the next available PID for the * Gets the next available PID for the
* content model specified by the DSID * content model specified by the DSID
@ -366,7 +360,7 @@ class CollectionPolicy extends XMLDatastream {
if (self::validDsid($dsid) && $this->validate()) { if (self::validDsid($dsid) && $this->validate()) {
$content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model');
$namespace = FALSE; $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)) { if (strtolower($content_models->item($i)->getAttribute('dsid')) == strtolower($dsid)) {
$namespace = $content_models->item($i)->getAttribute('namespace'); $namespace = $content_models->item($i)->getAttribute('namespace');
} }
@ -386,27 +380,24 @@ class CollectionPolicy extends XMLDatastream {
* @return ContentModel[] $models * @return ContentModel[] $models
*/ */
function getContentModels() { function getContentModels() {
$ret=FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
module_load_include('inc', 'Fedora_Repository', 'ContentModel'); module_load_include('inc', 'Fedora_Repository', 'ContentModel');
$ret=array(); $ret = array();
$content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model'); $content_models = $this->xml->getElementsByTagName('content_models')->item(0)->getElementsByTagName('content_model');
for ($i=0;$i<$content_models->length;$i++) { for ($i = 0; $i < $content_models->length; $i++) {
$cm=ContentModel::loadFromModel($content_models->item($i)->getAttribute('pid'), $cm = ContentModel::loadFromModel($content_models->item($i)->getAttribute('pid'),
$content_models->item($i)->getAttribute('dsid'), $content_models->item($i)->getAttribute('dsid'),
$content_models->item($i)->getAttribute('namespace'), $content_models->item($i)->getAttribute('namespace'),
$content_models->item($i)->getAttribute('name')); $content_models->item($i)->getAttribute('name'));
if ($cm !== FALSE) { if ($cm !== FALSE) {
$ret[]=$cm; $ret[] = $cm;
} }
} }
} }
return $ret; return $ret;
} }
/** /**
* Gets a list of search terms from the Collection Policy. If asArray is set * 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. * it will return an associative array with the value, field name, and the default value.
@ -422,9 +413,10 @@ class CollectionPolicy extends XMLDatastream {
function getSearchTerms($asArray = FALSE, $recurse = FALSE, $cache = FALSE) { function getSearchTerms($asArray = FALSE, $recurse = FALSE, $cache = FALSE) {
$ret = FALSE; $ret = FALSE;
if ($cache == TRUE && ($cache = cache_get('collection_policy_search_terms-'.$this->pid)) !== 0 ) { if ($cache == TRUE && ($cache = cache_get('collection_policy_search_terms-' . $this->pid)) !== 0) {
$ret=$cache->data; $ret = $cache->data;
} else { }
else {
if ($this->xml == NULL) { if ($this->xml == NULL) {
$fedoraItem = new Fedora_Item($this->pid); $fedoraItem = new Fedora_Item($this->pid);
@ -434,21 +426,21 @@ class CollectionPolicy extends XMLDatastream {
if ($this->validate()) { if ($this->validate()) {
$ret=array(); $ret = array();
$terms= $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term'); $terms = $this->xml->getElementsByTagName('search_terms')->item(0)->getElementsByTagName('term');
for ($i=0;$i<$terms->length;$i++) { for ($i = 0; $i < $terms->length; $i++) {
$default = $terms->item($i)->attributes->getNamedItem('default'); $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, $ret[] = ($asArray) ? array('value' => $terms->item($i)->nodeValue,
'field' => $terms->item($i)->getAttribute('field'), 'field' => $terms->item($i)->getAttribute('field'),
'default' => $default): $terms->item($i)->nodeValue; 'default' => $default) : $terms->item($i)->nodeValue;
} }
if ($recurse && count($ret) == 0) { if ($recurse && count($ret) == 0) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item=new Fedora_Item($this->pid); $item = new Fedora_Item($this->pid);
$rels=$item->get_relationships(); $rels = $item->get_relationships();
if (count($rels) > 0) { if (count($rels) > 0) {
foreach ($rels as $rel) { foreach ($rels as $rel) {
$cp = CollectionPolicy::loadFromCollection($rel['object']); $cp = CollectionPolicy::loadFromCollection($rel['object']);
@ -459,14 +451,12 @@ class CollectionPolicy extends XMLDatastream {
} }
} }
} }
cache_set('collection_policy_search_terms-'.$this->pid, $ret, 'cache', time()+3600); cache_set('collection_policy_search_terms-' . $this->pid, $ret, 'cache', time() + 3600);
} }
} }
return $ret; return $ret;
} }
/** /**
* Adds a search term to the collection policy. * Adds a search term to the collection policy.
* Returns fase on failure. * Returns fase on failure.
@ -476,12 +466,12 @@ class CollectionPolicy extends XMLDatastream {
* @return boolean $success * @return boolean $success
*/ */
function addTerm($field, $value) { function addTerm($field, $value) {
$ret=FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
$search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0);
$terms= $search_termsEl->getElementsByTagName('term'); $terms = $search_termsEl->getElementsByTagName('term');
$found=FALSE; $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) { if ($terms->item($i)->getAttribute('field') == $field) {
$found = TRUE; $found = TRUE;
} }
@ -504,12 +494,12 @@ class CollectionPolicy extends XMLDatastream {
* @return boolean $success * @return boolean $success
*/ */
function removeTerm($field) { function removeTerm($field) {
$ret=FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
$search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0);
$terms = $search_termsEl->getElementsByTagName('term'); $terms = $search_termsEl->getElementsByTagName('term');
$found = FALSE; $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) { if ($terms->item($i)->getAttribute('field') == $field) {
$found = $terms->item($i); $found = $terms->item($i);
} }
@ -523,21 +513,20 @@ class CollectionPolicy extends XMLDatastream {
return $ret; return $ret;
} }
function setDefaultTerm($field) { function setDefaultTerm($field) {
$ret = FALSE; $ret = FALSE;
if ($this->validate()) { if ($this->validate()) {
$search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0); $search_termsEl = $this->xml->getElementsByTagName('search_terms')->item(0);
$terms= $search_termsEl->getElementsByTagName('term'); $terms = $search_termsEl->getElementsByTagName('term');
$found=FALSE; $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) { if ($terms->item($i)->getAttribute('field') == $field) {
$found = $terms->item($i); $found = $terms->item($i);
} }
} }
if ($found !== FALSE) { 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) { if ($terms->item($i)->attributes->getNamedItem('default') !== NULL) {
$terms->item($i)->removeAttribute('default'); $terms->item($i)->removeAttribute('default');
} }
@ -548,7 +537,6 @@ class CollectionPolicy extends XMLDatastream {
return $ret; return $ret;
} }
/** /**
* Removes the specified content model from the collection policy. This will only * 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 * prevent future ingests of the removed model to the collection. $cm should be
@ -559,14 +547,14 @@ class CollectionPolicy extends XMLDatastream {
* @return boolean $valid * @return boolean $valid
*/ */
function removeModel($cm) { function removeModel($cm) {
$ret=FALSE; $ret = FALSE;
if ($this->validate() && $cm->validate()) { if ($this->validate() && $cm->validate()) {
$contentmodelsEl = $this->xml->getElementsByTagName('content_models'); $contentmodelsEl = $this->xml->getElementsByTagName('content_models');
$models = $contentmodelsEl->item(0)->getElementsByTagName('content_model'); $models = $contentmodelsEl->item(0)->getElementsByTagName('content_model');
$found = FALSE; $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) { if ($models->item($i)->getAttribute('pid') == $cm->pid) {
$found=$models->item($i); $found = $models->item($i);
} }
} }
@ -578,16 +566,13 @@ class CollectionPolicy extends XMLDatastream {
return $ret; return $ret;
} }
function addModel($cm, $namespace) { function addModel($cm, $namespace) {
$ret = FALSE; $ret = FALSE;
if (self::validPid($namespace) && $this->validate() && $cm->validate()) { if (self::validPid($namespace) && $this->validate() && $cm->validate()) {
$contentmodelsEl = $this->xml->getElementsByTagName('content_models'); $contentmodelsEl = $this->xml->getElementsByTagName('content_models');
$models = $contentmodelsEl->item(0)->getElementsByTagName('content_model'); $models = $contentmodelsEl->item(0)->getElementsByTagName('content_model');
$found = FALSE; $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) if ($models->item($i)->getAttribute('pid') == $cm->pid)
$found = TRUE; $found = TRUE;
} }
@ -607,9 +592,9 @@ class CollectionPolicy extends XMLDatastream {
} }
function getName() { function getName() {
$ret=FALSE; $ret = FALSE;
if ($this->validate()) { 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; return $ret;
} }

22
ConnectionHelper.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* Created on Jan 24, 2008 * Created on Jan 24, 2008
@ -9,23 +10,25 @@
*/ */
module_load_include('inc', 'ConnectionHelper', ''); module_load_include('inc', 'ConnectionHelper', '');
class ConnectionHelper { class ConnectionHelper {
function ConnectionHelper() { function ConnectionHelper() {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
} }
function _fixURL($url, $_name, $_pass) { function _fixURL($url, $_name, $_pass) {
if (empty($url)) { 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');
} }
$creds = urlencode($_name) . ':'. urlencode($_pass); $creds = urlencode($_name) . ':' . urlencode($_pass);
if (strpos($url, 'http://') === 0) { if (strpos($url, 'http://') === 0) {
$new_url = 'http://'. $creds . '@'. substr($url, 7); $new_url = 'http://' . $creds . '@' . substr($url, 7);
} }
elseif (strpos($url, 'https://') === 0) { elseif (strpos($url, 'https://') === 0) {
$new_url = 'https://'. $creds . '@'. substr($url, 8); $new_url = 'https://' . $creds . '@' . substr($url, 8);
} }
else { else {
drupal_set_message(t('Invalid URL: !url', array('!url' => $url))); drupal_set_message(t('Invalid URL: !url', array('!url' => $url)));
@ -37,7 +40,7 @@ class ConnectionHelper {
function getSoapClient($url = NULL, $exceptions = TRUE) { function getSoapClient($url = NULL, $exceptions = TRUE) {
if (empty($url)) { 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; global $user;
@ -50,8 +53,7 @@ class ConnectionHelper {
'password' => 'anonymous', 'password' => 'anonymous',
'exceptions' => $exceptions, 'exceptions' => $exceptions,
)); ));
} } catch (SoapFault $e) {
catch (SoapFault $e) {
drupal_set_message(t("!e", array('!e' => $e->getMessage()))); drupal_set_message(t("!e", array('!e' => $e->getMessage())));
return NULL; return NULL;
} }
@ -63,13 +65,13 @@ class ConnectionHelper {
'password' => $user->pass, 'password' => $user->pass,
'exceptions' => TRUE, 'exceptions' => TRUE,
)); ));
} } catch (SoapFault $e) {
catch (SoapFault $e) {
drupal_set_message(t("!e", array('!e' => $e->getMessage()))); drupal_set_message(t("!e", array('!e' => $e->getMessage())));
return NULL; return NULL;
} }
} }
return $client; return $client;
} }
} }

360
ContentModel.inc

File diff suppressed because it is too large Load Diff

52
MimeClass.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/** /**
* *
@ -20,8 +21,8 @@
* http://api.drupal.org/api/function/file_default_mimetype_mapping/7 * http://api.drupal.org/api/function/file_default_mimetype_mapping/7
* *
*/ */
class MimeClass { class MimeClass {
private $private_mime_types = array( private $private_mime_types = array(
/** /**
* This is a shortlist of mimetypes which should catch most * This is a shortlist of mimetypes which should catch most
@ -190,7 +191,6 @@ class MimeClass {
// others: // others:
'bin' => 'application/octet-stream', 'bin' => 'application/octet-stream',
); );
private $private_file_extensions; private $private_file_extensions;
private $system_types; private $system_types;
private $system_exts; private $system_exts;
@ -199,13 +199,12 @@ class MimeClass {
public function __construct() { public function __construct() {
// populate the reverse shortlist: // 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 // 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'; $this->etc_mime_types = 'mime.types';
} }
} }
/** /**
@ -213,27 +212,27 @@ class MimeClass {
* description: An alias to get_mimetype, * description: An alias to get_mimetype,
* for backwards-compatibility with our old mimetype class. * for backwards-compatibility with our old mimetype class.
*/ */
public function getType( $filename ) { public function getType($filename) {
return $this->get_mimetype( $filename ); return $this->get_mimetype($filename);
} }
/** /**
* function: get_mimetype * function: get_mimetype
* description: returns a mimetype associated with the file extension of $filename * 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 ); $file_name_and_extension = explode('.', $filename);
$ext = strtolower( array_pop( $file_name_and_extension ) ); $ext = strtolower(array_pop($file_name_and_extension));
if ( ! empty( $this->private_mime_types[$ext] ) ) { if (!empty($this->private_mime_types[$ext])) {
if ( TRUE === $debug ) if (TRUE === $debug)
return array( 'mime_type' => $this->private_mime_types[$ext], 'method' => 'from_array' ); return array('mime_type' => $this->private_mime_types[$ext], 'method' => 'from_array');
return $this->private_mime_types[$ext]; return $this->private_mime_types[$ext];
} }
if (function_exists('file_get_mimetype')) { 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 ('application/octet-stream' != $drupal_mimetype) {
if (TRUE == $debug) if (TRUE == $debug)
return array('mime_type' => $drupal_mimetype, 'method' => 'file_get_mimetype'); return array('mime_type' => $drupal_mimetype, 'method' => 'file_get_mimetype');
@ -241,42 +240,41 @@ class MimeClass {
} }
} }
if (!isset( $this->system_types)) if (!isset($this->system_types))
$this->system_types = $this->system_extension_mime_types(); $this->system_types = $this->system_extension_mime_types();
if (isset( $this->system_types[$ext])) { if (isset($this->system_types[$ext])) {
if (TRUE == $debug) if (TRUE == $debug)
return array('mime_type' => $this->system_types[$ext], 'method' => 'mime.types'); return array('mime_type' => $this->system_types[$ext], 'method' => 'mime.types');
return $this->system_types[$ext]; return $this->system_types[$ext];
} }
if ( TRUE === $debug ) if (TRUE === $debug)
return array( 'mime_type' => 'application/octet-stream', 'method' => 'last_resort' ); return array('mime_type' => 'application/octet-stream', 'method' => 'last_resort');
return 'application/octet-stream'; return 'application/octet-stream';
} }
/** /**
* function: get_extension * function: get_extension
* description: returns *one* valid file extension for a given $mime_type * 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) 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]; 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(); $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) 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]; return $this->system_exts[$mime_type];
} }
if (TRUE == $debug) if (TRUE == $debug)
return array( 'extension' => 'bin', 'method' => 'last_resort' ); return array('extension' => 'bin', 'method' => 'last_resort');
return 'bin'; return 'bin';
} }

46
ObjectHelper.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
/* /*
* Created on Feb 1, 2008 * Created on Feb 1, 2008
@ -85,7 +85,8 @@ class ObjectHelper {
if ($label == NULL) { if ($label == NULL) {
$label = $item->datastreams[$dsID]['label']; $label = $item->datastreams[$dsID]['label'];
} }
} else { }
else {
drupal_not_found(); drupal_not_found();
exit(); exit();
} }
@ -95,7 +96,8 @@ class ObjectHelper {
$fedoraUser = 'anonymous'; $fedoraUser = 'anonymous';
$fedoraPass = 'anonymous'; $fedoraPass = 'anonymous';
$contentSize = 0; $contentSize = 0;
} else { }
else {
$fedoraUser = $user->name; $fedoraUser = $user->name;
$fedoraPass = $user->pass; $fedoraPass = $user->pass;
$dataStreamInfo = $item->get_datastream_info($dsID); $dataStreamInfo = $item->get_datastream_info($dsID);
@ -135,7 +137,8 @@ class ObjectHelper {
curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch); curl_exec($ch);
fclose($fp); fclose($fp);
} else { }
else {
header("Content-type: $mimeType"); header("Content-type: $mimeType");
if ($contentSize > 0) { if ($contentSize > 0) {
@ -168,12 +171,14 @@ class ObjectHelper {
if ((isset($user) && $user->uid != 0) || $forceSoap || isset($_SERVER['HTTPS'])) { if ((isset($user) && $user->uid != 0) || $forceSoap || isset($_SERVER['HTTPS'])) {
curl_exec($ch); curl_exec($ch);
} else { }
else {
header('Location: ' . $url); header('Location: ' . $url);
} }
} }
curl_close($ch); curl_close($ch);
} else { }
else {
drupal_set_message(t('No curl support.'), 'error'); drupal_set_message(t('No curl support.'), 'error');
} }
} }
@ -267,7 +272,8 @@ class ObjectHelper {
$pid . '/' . $dataStreamValue->ID . '/' . $dataStreamValue->label . '"><img src="' . $base_url . '/' . $path . $pid . '/' . $dataStreamValue->ID . '/' . $dataStreamValue->label . '"><img src="' . $base_url . '/' . $path .
'/images/purge.gif" alt="purge datastream" /></a>'; '/images/purge.gif" alt="purge datastream" /></a>';
} }
} else { }
else {
$purgeImage = '&nbsp;'; $purgeImage = '&nbsp;';
} }
$fullPath = base_path() . $path; $fullPath = base_path() . $path;
@ -322,7 +328,6 @@ class ObjectHelper {
if (empty($xmlstr)) { if (empty($xmlstr)) {
return ''; return '';
} }
try { try {
@ -375,13 +380,11 @@ class ObjectHelper {
$output .= '<br /><a title = "' . t('Edit Meta Data') . '" href="' . $base_url . '/fedora/repository/' . 'editmetadata/' . $pid . '/' . $output .= '<br /><a title = "' . t('Edit Meta Data') . '" href="' . $base_url . '/fedora/repository/' . 'editmetadata/' . $pid . '/' .
$dsid . '"><img src="' . $base_url . '/' . $path . '/images/edit.gif" alt="' . t('Edit Meta Data') . '" /></a>'; $dsid . '"><img src="' . $base_url . '/' . $path . '/images/edit.gif" alt="' . t('Edit Meta Data') . '" /></a>';
} }
} }
return $output; return $output;
} }
/** /**
* Gets a list of datastreams from an object using its pid * Gets a list of datastreams from an object using its pid
* *
@ -466,8 +469,6 @@ class ObjectHelper {
return ''; return '';
} }
/** /**
* returns a stream from a fedora object given a pid and dsid * returns a stream from a fedora object given a pid and dsid
* *
@ -572,7 +573,8 @@ class ObjectHelper {
return FALSE; return FALSE;
} }
return $user_access; return $user_access;
} else { }
else {
return FALSE; return FALSE;
} }
} }
@ -633,10 +635,10 @@ class ObjectHelper {
'/images/ingest.png" alt="' . t('Add a New Object') . '" class="icon"></a>' . t(' Add to this Collection'); '/images/ingest.png" alt="' . t('Add a New Object') . '" class="icon"></a>' . t(' Add to this Collection');
} }
} }
} else { }
else {
$ingestObject = '&nbsp;'; $ingestObject = '&nbsp;';
} }
} }
$datastreams .= $ingestObject; $datastreams .= $ingestObject;
@ -850,10 +852,11 @@ class ObjectHelper {
module_load_include('inc', 'fedora_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 // Before executing the query, we hve a base case of accessing the top-level collection
global $base_url; global $base_url;
if ($pid == variable_get('fedora_repository_pid', 'islandora:top')){ if ($pid == variable_get('fedora_repository_pid', 'islandora:top')) {
$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository');
$breadcrumbs[] = l(t('Home'), $base_url); $breadcrumbs[] = l(t('Home'), $base_url);
} else { }
else {
$query_string = 'select $parentObject $title $content from <#ri> $query_string = 'select $parentObject $title $content from <#ri>
where (<info:fedora/' . $pid . '> <dc:title> $title where (<info:fedora/' . $pid . '> <dc:title> $title
and $parentObject <fedora-model:hasModel> $content and $parentObject <fedora-model:hasModel> $content
@ -868,17 +871,18 @@ class ObjectHelper {
$url = variable_get('fedora_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; $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 array_shift($result); // throw away first line
$matches =str_getcsv(join("\n",$result)); $matches = str_getcsv(join("\n", $result));
if ($matches !== FALSE) { if ($matches !== FALSE) {
$parent = preg_replace('/^info:fedora\//','',$matches[0]); $parent = preg_replace('/^info:fedora\//', '', $matches[0]);
$breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid);
if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) { if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) {
$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository');
$breadcrumbs[] = l(t('Home'), $base_url); $breadcrumbs[] = l(t('Home'), $base_url);
} elseif ($level > 0) { }
elseif ($level > 0) {
$this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); $this->getBreadcrumbs($parent, $breadcrumbs, $level - 1);
} }
} }

98
SearchClass.inc

@ -1,8 +1,11 @@
<?php <?php
// $Id$
class SearchClass { class SearchClass {
public static $SEARCH_CLASS_ADVANCED_SEARCH_NUMBER_FIELDS = 5; public static $SEARCH_CLASS_ADVANCED_SEARCH_NUMBER_FIELDS = 5;
function solr_search($query, $startPage=1, $fq = NULL, $dismax = NULL) { function solr_search($query, $startPage=1, $fq = NULL, $dismax = NULL) {
$solrFile = trim(variable_get('islandora_solr_search_block_handler_file', 'plugins/SolrResults.inc')); $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 if (strpos($solrField, '../')) { // Don't let us bust out of fedora_repository modules directory when looking for a handler
@ -10,7 +13,7 @@ class SearchClass {
} }
$solrClass = trim(variable_get('islandora_solr_search_block_handler_class', 'SolrResults')); $solrClass = trim(variable_get('islandora_solr_search_block_handler_class', 'SolrResults'));
$solrFunction = trim(variable_get('islandora_solr_search_block_handler_function', 'SearchAndDisplay')); $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', 'fedora_repository') . '/' . $solrFile);
try { try {
$implementation = new $solrClass(); $implementation = new $solrClass();
} catch (Exception $e) { } catch (Exception $e) {
@ -19,9 +22,10 @@ class SearchClass {
} }
return $implementation->$solrFunction($query, $startPage, $fq, $dismax); return $implementation->$solrFunction($query, $startPage, $fq, $dismax);
} }
function build_solr_search_form($repeat = NULL, $pathToSearchTerms = NULL, $query = NULL) { function build_solr_search_form($repeat = NULL, $pathToSearchTerms = NULL, $query = NULL) {
$types = $this->get_search_terms_array(NULL, 'solrSearchTerms.xml'); $types = $this->get_search_terms_array(NULL, 'solrSearchTerms.xml');
$queryArray=NULL; $queryArray = NULL;
if (isset($query)) { if (isset($query)) {
$queryArray = explode('AND', $query); $queryArray = explode('AND', $query);
} }
@ -68,7 +72,7 @@ class SearchClass {
'#title' => t(''), '#title' => t(''),
'#default_value' => (count($var1) >= 2 ? $var1[1] : ''), '#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++) { for ($i = 3; $i < $repeat + 1; $i++) {
$t = $i - 1; $t = $i - 1;
$field_and_term = explode(':', $queryArray[$t]); $field_and_term = explode(':', $queryArray[$t]);
@ -114,28 +118,28 @@ class SearchClass {
); );
return $form; return $form;
} }
function theme_solr_search_form($form) { function theme_solr_search_form($form) {
if (!isset($repeat)) { 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['search_type']['type1']);
$output .= drupal_render($form['fedora_terms1']) ; $output .= drupal_render($form['fedora_terms1']);
$output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']) ; $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']);
$output .= drupal_render($form['fedora_terms2']); $output .= drupal_render($form['fedora_terms2']);
if ($repeat>2 && $repeat < 9) { if ($repeat > 2 && $repeat < 9) {
for ($i=3;$i<$repeat+1;$i++) { for ($i = 3; $i < $repeat + 1; $i++) {
$t = $i - 1; $t = $i - 1;
$output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$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["fedora_terms$i"]);
} }
} }
$output .= drupal_render($form['submit']) ; $output .= drupal_render($form['submit']);
$output .= drupal_render($form); $output .= drupal_render($form);
return $output; return $output;
} }
function quickSearch($type, $query, $showForm = 1, $orderBy = 0, & $userArray) { function quickSearch($type, $query, $showForm = 1, $orderBy = 0, & $userArray) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
@ -146,15 +150,15 @@ class SearchClass {
$keywords = explode(' ', $query); $keywords = explode(' ', $query);
foreach ($keywords as $keyword) { foreach ($keywords as $keyword) {
$luceneQuery .= $type . ':'. $keyword . '+AND+'; $luceneQuery .= $type . ':' . $keyword . '+AND+';
} }
$luceneQuery = substr($luceneQuery, 0, strlen($luceneQuery) - 5); $luceneQuery = substr($luceneQuery, 0, strlen($luceneQuery) - 5);
$indexName = variable_get('fedora_index_name', 'DemoOnLucene'); $indexName = variable_get('fedora_index_name', 'DemoOnLucene');
$keys = htmlentities(urlencode($query)); $keys = htmlentities(urlencode($query));
$searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest');
$searchString = '?operation=gfindObjects&indexName='. $indexName . '&restXslt=copyXml&query='. $luceneQuery; $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=copyXml&query=' . $luceneQuery;
$searchString .= '&hitPageSize='. $numberOfHistPerPage . '&hitPageStart=1'; $searchString .= '&hitPageSize=' . $numberOfHistPerPage . '&hitPageStart=1';
//$searchString = htmlentities($searchString); //$searchString = htmlentities($searchString);
$searchUrl .= $searchString; $searchUrl .= $searchString;
@ -169,19 +173,18 @@ class SearchClass {
$nodeList = $xPath->query('//field[@name="refworks.u1"]'); $nodeList = $xPath->query('//field[@name="refworks.u1"]');
foreach ($nodeList as $node) { foreach ($nodeList as $node) {
if (!in_array($node->nodeValue, $userArray)) { if (!in_array($node->nodeValue, $userArray)) {
$userArray[]=$node->nodeValue; $userArray[] = $node->nodeValue;
} }
} }
} }
if ($showForm) { if ($showForm) {
$output = '<Strong>Quick Search</strong><br /><table class="table-form"><tr>'. drupal_get_form('fedora_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); $output .= $this->applyXSLT($resultData, $orderBy);
return $output; 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
function getTerms($fieldName, $startTerm, $displayName = NULL) { function getTerms($fieldName, $startTerm, $displayName = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
@ -192,10 +195,10 @@ class SearchClass {
$startTerm = ""; $startTerm = "";
} }
$startTerm = drupal_urlencode($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=drupal_urlencode($query);
$query = '?'. $query; $query = '?' . $query;
$searchString=$searchUrl . $query; $searchString = $searchUrl . $query;
$objectHelper = new ObjectHelper(); $objectHelper = new ObjectHelper();
@ -205,11 +208,8 @@ class SearchClass {
$output .= $this->applySpecifiedXSLT($resultData, $path . '/xsl/browseIndexToResultPage.xslt', $displayName); $output .= $this->applySpecifiedXSLT($resultData, $path . '/xsl/browseIndexToResultPage.xslt', $displayName);
//$output .= '<br />'.$alpha_out; //$output .= '<br />'.$alpha_out;
return $output; return $output;
} }
function custom_search($query, $startPage=1, $xslt= '/xsl/advanced_search_results.xsl', $numberOfHistPerPage = 50) { 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', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
@ -225,8 +225,8 @@ class SearchClass {
$query = trim($query); $query = trim($query);
$query = htmlentities(urlencode($query)); $query = htmlentities(urlencode($query));
$searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest'); $searchUrl = variable_get('fedora_fgsearch_url', 'http://localhost:8080/fedoragsearch/rest');
$searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt='. $copyXMLFile . '&query=' . $query; $searchString = '?operation=gfindObjects&indexName=' . $indexName . '&restXslt=' . $copyXMLFile . '&query=' . $query;
$searchString .= '&hitPageSize='. $numberOfHistPerPage . '&hitPageStart='. $startPage; $searchString .= '&hitPageSize=' . $numberOfHistPerPage . '&hitPageStart=' . $startPage;
//$searchString = htmlentities($searchString); //$searchString = htmlentities($searchString);
$searchUrl .= $searchString; $searchUrl .= $searchString;
@ -242,7 +242,6 @@ class SearchClass {
} }
} }
function applySpecifiedXSLT($resultData, $pathToXSLT, $displayName = NULL) { function applySpecifiedXSLT($resultData, $pathToXSLT, $displayName = NULL) {
$proc = NULL; $proc = NULL;
global $user; global $user;
@ -252,9 +251,8 @@ class SearchClass {
} }
try { try {
$proc = new XsltProcessor(); $proc = new XsltProcessor();
} } catch (Exception $e) {
catch (Exception $e) { drupal_set_message(t('Error loading ' . $pathToXSLT . ' xslt!') . $e->getMessage());
drupal_set_message(t('Error loading '. $pathToXSLT . ' xslt!') . $e->getMessage());
return ' '; return ' ';
} }
@ -270,10 +268,10 @@ class SearchClass {
$xsl = new DomDocument(); $xsl = new DomDocument();
$test= $xsl->load($pathToXSLT); $test = $xsl->load($pathToXSLT);
if (!isset($test)) { 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)); return t('Error loading !pathToXSLT xslt.', array('!pathToXSLT' => $pathToXSLT));
} }
@ -291,8 +289,8 @@ class SearchClass {
return $newdom->saveXML(); return $newdom->saveXML();
} }
} }
//default function for lucene results
//default function for lucene results
/** /**
* apply an xslt to lucene gsearch search 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) { function applyLuceneXSLT($resultData, $startPage = 1, $xslt_file = '/xsl/results.xsl', $query=NULL) {
$path = drupal_get_path('module', 'Fedora_Repository'); $path = drupal_get_path('module', 'Fedora_Repository');
$test = $xslt_file; $test = $xslt_file;
$isRestricted = variable_get('fedora_namespace_restriction_enforced',TRUE); $isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE);
if(!isRestricted && $xslt_file == null){ if (!isRestricted && $xslt_file == NULL) {
$xslt_file = '/xsl/unfilteredresults.xsl'; $xslt_file = '/xsl/unfilteredresults.xsl';
} }
$proc = NULL; $proc = NULL;
@ -378,7 +376,7 @@ class SearchClass {
$proc->setParameter('', 'orderBy', $orderBy); $proc->setParameter('', 'orderBy', $orderBy);
$xsl = new DomDocument(); $xsl = new DomDocument();
$test=$xsl->load($path . '/ir/xsl/results.xsl'); $test = $xsl->load($path . '/ir/xsl/results.xsl');
if (!isset($test)) { if (!isset($test)) {
drupal_set_message(t('Error loading search results xslt!')); drupal_set_message(t('Error loading search results xslt!'));
return t('Error loading search results XSLT.'); return t('Error loading search results XSLT.');
@ -403,18 +401,18 @@ class SearchClass {
$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['search_type']['type1']);
$output .= drupal_render($form['fedora_terms1']) ; $output .= drupal_render($form['fedora_terms1']);
$output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']) ; $output .= drupal_render($form['andor1']) . drupal_render($form['search_type']['type2']);
$output .= drupal_render($form['fedora_terms2']); $output .= drupal_render($form['fedora_terms2']);
if ($repeat>2 && $repeat < 9) { if ($repeat > 2 && $repeat < 9) {
for ($i=3;$i<$repeat+1;$i++) { for ($i = 3; $i < $repeat + 1; $i++) {
$t = $i - 1; $t = $i - 1;
$output .= drupal_render($form["andor$t"]) . drupal_render($form['search_type']["type$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["fedora_terms$i"]);
} }
} }
$output .= drupal_render($form['submit']) ; $output .= drupal_render($form['submit']);
$output .= drupal_render($form); $output .= drupal_render($form);
return $output; return $output;
} }
@ -422,7 +420,7 @@ class SearchClass {
//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
function build_advanced_search_form($repeat = NULL, $pathToSearchTerms = NULL, $query = NULL) { function build_advanced_search_form($repeat = NULL, $pathToSearchTerms = NULL, $query = NULL) {
$types = $this->get_search_terms_array($pathToSearchTerms); $types = $this->get_search_terms_array($pathToSearchTerms);
$queryArray=NULL; $queryArray = NULL;
if (isset($query)) { if (isset($query)) {
$queryArray = explode('AND', $query); $queryArray = explode('AND', $query);
} }
@ -469,7 +467,7 @@ class SearchClass {
'#title' => t(''), '#title' => t(''),
'#default_value' => (count($var1) >= 2 ? $var1[1] : ''), '#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++) { for ($i = 3; $i < $repeat + 1; $i++) {
$t = $i - 1; $t = $i - 1;
$field_and_term = explode(':', $queryArray[$t]); $field_and_term = explode(':', $queryArray[$t]);
@ -501,7 +499,6 @@ class SearchClass {
return $form; return $form;
} }
function get_search_terms_array($path = NULL, $file = NULL) { function get_search_terms_array($path = NULL, $file = NULL) {
if (!isset($path)) { if (!isset($path)) {
$path = drupal_get_path('module', 'Fedora_Repository'); $path = drupal_get_path('module', 'Fedora_Repository');
@ -510,7 +507,7 @@ class SearchClass {
if (!isset($file)) { if (!isset($file)) {
$file = 'searchTerms.xml'; $file = 'searchTerms.xml';
} }
$xmlDoc->load($path . '/'. $file); $xmlDoc->load($path . '/' . $file);
$nodeList = $xmlDoc->getElementsByTagName('term'); $nodeList = $xmlDoc->getElementsByTagName('term');
$types = array(); $types = array();
for ($i = 0; $i < $nodeList->length; $i++) { for ($i = 0; $i < $nodeList->length; $i++) {
@ -522,4 +519,5 @@ class SearchClass {
} }
return $types; return $types;
} }
} }

26
SecurityClass.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* Created on 22-Oct-08 * Created on 22-Oct-08
@ -9,7 +10,9 @@
*/ */
class SecurityClass { class SecurityClass {
public static $SECURITY_CLASS_SECURITY_STREAM = 'POLICY'; public static $SECURITY_CLASS_SECURITY_STREAM = 'POLICY';
function SecurityClass() { function SecurityClass() {
module_load_include('inc', 'SecurityClass', ''); module_load_include('inc', 'SecurityClass', '');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
@ -54,8 +57,7 @@ class SecurityClass {
$usersAndRoles = array(); $usersAndRoles = array();
try { try {
$xml = new SimpleXMLElement($policyStream); $xml = new SimpleXMLElement($policyStream);
} } catch (Exception $e) {
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"), t("No roles found in security policy, could not parse policy stream."), NULL, WATCHDOG_ERROR);
//we may not want to send this to the screen. //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' => $e->getMessage())), 'error');
@ -68,7 +70,7 @@ class SecurityClass {
foreach ($conditions as $condition) { foreach ($conditions as $condition) {
$designator = $condition->Apply->SubjectAttributeDesignator; $designator = $condition->Apply->SubjectAttributeDesignator;
if (empty($designator)) {//$disignator may be wrapped by an or 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']); $attributeId = strip_tags($designator['AttributeId']);
@ -92,8 +94,8 @@ class SecurityClass {
$usersAndRoles['users'] = $allowedUsers; $usersAndRoles['users'] = $allowedUsers;
$usersAndRoles['roles'] = $allowedRoles; $usersAndRoles['roles'] = $allowedRoles;
return $usersAndRoles; return $usersAndRoles;
} }
// When a user's profile is saved in drupal we will attempt to create a collection for them in Fedora // 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 // 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. // it probably would not be.
@ -101,8 +103,7 @@ class SecurityClass {
$doc = new DOMDocument(); $doc = new DOMDocument();
try { try {
$doc->load(drupal_get_path('module', 'Fedora_Repository') . '/policies/noObjectEditPolicy.xml'); $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); watchdog(t("Fedora_Repository"), t("Problem loading policy file."), NULL, WATCHDOG_ERROR);
} }
$conditions = $doc->getElementsByTagName('Condition'); $conditions = $doc->getElementsByTagName('Condition');
@ -117,7 +118,7 @@ class SecurityClass {
if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') {
foreach ($user->roles as $role) { foreach ($user->roles as $role) {
if (!($role == 'authenticated user' || $role == 'administrator')) { //don't want authenticated user included administrator already is included' if (!($role == 'authenticated user' || $role == 'administrator')) { //don't want authenticated user included administrator already is included'
$newAttributeValue=$doc->createElement('AttributeValue', '<![CDATA['. $role . ']]>'); $newAttributeValue = $doc->createElement('AttributeValue', '<![CDATA[' . $role . ']]>');
$newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string');
// $newAttributeValue->setAttribute('MustBePresent', 'FALSE'); // $newAttributeValue->setAttribute('MustBePresent', 'FALSE');
$apply->appendChild($newAttributeValue); $apply->appendChild($newAttributeValue);
@ -132,7 +133,7 @@ class SecurityClass {
foreach ($applies as $apply) { foreach ($applies as $apply) {
$functionId = $apply->getAttribute('FunctionId'); $functionId = $apply->getAttribute('FunctionId');
if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { 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('DataType', 'http://www.w3.org/2001/XMLSchema#string');
//$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE');
$apply->appendChild($newAttributeValue); $apply->appendChild($newAttributeValue);
@ -170,7 +171,7 @@ class SecurityClass {
if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') {
foreach ($allowed_roles as $role) { foreach ($allowed_roles as $role) {
if (!($role == 'authenticated user' || $role == 'administrator')) { //don't want authenticated user included administrator already is included' 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('DataType', 'http://www.w3.org/2001/XMLSchema#string');
//$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE');
$apply->appendChild($newAttributeValue); $apply->appendChild($newAttributeValue);
@ -186,8 +187,8 @@ class SecurityClass {
foreach ($applies as $apply) { foreach ($applies as $apply) {
$functionId = $apply->getAttribute('FunctionId'); $functionId = $apply->getAttribute('FunctionId');
if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') { if ($functionId == 'urn:oasis:names:tc:xacml:1.0:function:string-bag') {
foreach ( $allowed_users as $username ) { foreach ($allowed_users as $username) {
$newAttributeValue=$dom->createElement('AttributeValue', $username ); $newAttributeValue = $dom->createElement('AttributeValue', $username);
$newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string'); $newAttributeValue->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string');
//$newAttributeValue->setAttribute('MustBePresent', 'FALSE'); //$newAttributeValue->setAttribute('MustBePresent', 'FALSE');
$apply->appendChild($newAttributeValue); $apply->appendChild($newAttributeValue);
@ -200,4 +201,5 @@ class SecurityClass {
// $this->collection_policy_stream = $dom->saveXML(); // $this->collection_policy_stream = $dom->saveXML();
return $dom->saveXML(); return $dom->saveXML();
} }
} }

13
XMLDatastream.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
abstract class XMLDatastream { abstract class XMLDatastream {
@ -96,7 +96,7 @@ abstract class XMLDatastream {
$this->pid = $pid; $this->pid = $pid;
$this->dsid = $dsid; $this->dsid = $dsid;
if ($xmlStr !== NULL) { if ($xmlStr !== NULL) {
if(is_object($xmlStr) && get_class($xmlStr) == DOMDocument) { if (is_object($xmlStr) && get_class($xmlStr) == DOMDocument) {
$this->xml = $xmlStr; $this->xml = $xmlStr;
} }
else { else {
@ -180,7 +180,8 @@ abstract class XMLDatastream {
// a subclass. // a subclass.
$vars = get_class_vars(get_class($this)); $vars = get_class_vars(get_class($this));
$schemaLocation = $vars['SCHEMA_URI']; $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. //figure out where the schema is located and validate.
list(, $schemaLocation) = preg_split('/\s+/', $rootEl->attributes->getNamedItem('schemaLocation')->nodeValue); list(, $schemaLocation) = preg_split('/\s+/', $rootEl->attributes->getNamedItem('schemaLocation')->nodeValue);
} }
@ -193,10 +194,12 @@ abstract class XMLDatastream {
foreach ($errors as $err) { foreach ($errors as $err) {
self::$errors[] = 'XML Error: Line ' . $err->line . ': ' . $err->message; self::$errors[] = 'XML Error: Line ' . $err->line . ': ' . $err->message;
} }
} else { }
else {
$this->name = $rootEl->attributes->getNamedItem('name')->nodeValue; $this->name = $rootEl->attributes->getNamedItem('name')->nodeValue;
} }
} else { }
else {
$ret = FALSE; $ret = FALSE;
self::$errors[] = 'Unable to load schema.'; self::$errors[] = 'Unable to load schema.';
} }

10
api/dublin_core.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* Implements a simple class for working with Dublin Core data and exporting it * Implements a simple class for working with Dublin Core data and exporting it
@ -8,6 +9,7 @@
*/ */
class Dublin_Core { class Dublin_Core {
public $dc = array( public $dc = array(
'dc:title' => array(), 'dc:title' => array(),
'dc:creator' => array(), 'dc:creator' => array(),
@ -45,13 +47,13 @@ class Dublin_Core {
* @param <type> $element_name * @param <type> $element_name
* @param <type> $value * @param <type> $value
*/ */
function add_element( $element_name, $value ) { function add_element($element_name, $value) {
if (is_string($value) && is_array($this->dc[$element_name])) { if (is_string($value) && is_array($this->dc[$element_name])) {
$this->dc[$element_name][] = $value; $this->dc[$element_name][] = $value;
} }
} }
/** /**
* Replace the given DC element with the values in $values * Replace the given DC element with the values in $values
* @param string $elemnt_name * @param string $elemnt_name
* @param array $values * @param array $values
@ -68,7 +70,7 @@ class Dublin_Core {
/** /**
* Serialize this object to XML and return it. * Serialize this object to XML and return it.
*/ */
function as_xml( $with_preamble = FALSE ) { function as_xml($with_preamble = FALSE) {
$dc_xml = new DomDocument(); $dc_xml = new DomDocument();
$oai_dc = $dc_xml->createElementNS('http://www.openarchives.org/OAI/2.0/oai_dc/', 'oai_dc:dc'); $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/'); $oai_dc->setAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');

29
api/fedora_collection.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* Operations that affect a Fedora repository at a collection level. * Operations that affect a Fedora repository at a collection level.
@ -15,7 +16,7 @@ module_load_include('module', 'fedora_repository');
* that will let you import them into another repository. * that will let you import them into another repository.
* @param <type> $format * @param <type> $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); $collection_item = new Fedora_Item($collection_pid);
$foxml = $collection_item->export_as_foxml(); $foxml = $collection_item->export_as_foxml();
@ -25,15 +26,15 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio
$container = tempnam($file_dir, 'export_'); $container = tempnam($file_dir, 'export_');
file_delete($container); file_delete($container);
print $container; print $container;
if (mkdir($container) && mkdir($container . '/'. $collection_pid)) { if (mkdir($container) && mkdir($container . '/' . $collection_pid)) {
$foxml_dir = $container . '/'. $collection_pid; $foxml_dir = $container . '/' . $collection_pid;
$file = fopen($foxml_dir . '/'. $collection_pid . '.xml', 'w'); $file = fopen($foxml_dir . '/' . $collection_pid . '.xml', 'w');
fwrite($file, $foxml); fwrite($file, $foxml);
fclose($file); fclose($file);
$member_pids = get_related_items_as_array($collection_pid, $relationship); $member_pids = get_related_items_as_array($collection_pid, $relationship);
foreach ($member_pids as $member) { 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 = new Fedora_Item($member);
$item_foxml = $item->export_as_foxml(); $item_foxml = $item->export_as_foxml();
fwrite($file, $item_foxml); fwrite($file, $item_foxml);
@ -41,13 +42,13 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio
} }
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-type: application/zip");
header('Content-Disposition: attachment; filename="' . $collection_pid . '.zip'. '"'); header('Content-Disposition: attachment; filename="' . $collection_pid . '.zip' . '"');
$fh = fopen($container . '/'. $collection_pid . '.zip', 'r'); $fh = fopen($container . '/' . $collection_pid . '.zip', 'r');
$the_data = fread($fh, filesize($container . '/'. $collection_pid . '.zip')); $the_data = fread($fh, filesize($container . '/' . $collection_pid . '.zip'));
fclose($fh); fclose($fh);
echo $the_data; echo $the_data;
} }
if (file_exists($container . '/'. $collection_pid)) { if (file_exists($container . '/' . $collection_pid)) {
system("rm -rf $container"); // I'm sorry. system("rm -rf $container"); // I'm sorry.
} }
} }
@ -82,14 +83,14 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb
if (is_array($relationship)) { if (is_array($relationship)) {
foreach ($relationship as $rel) { foreach ($relationship as $rel) {
$query_string .= '$object <fedora-rels-ext:'. $rel . '> <info:fedora/'. $collection_pid . '>'; $query_string .= '$object <fedora-rels-ext:' . $rel . '> <info:fedora/' . $collection_pid . '>';
if (next($relationship)) { if (next($relationship)) {
$query_string .= ' OR '; $query_string .= ' OR ';
} }
} }
} }
elseif (is_string($relationship)) { elseif (is_string($relationship)) {
$query_string .= '$object <fedora-rels-ext:'. $relationship . '> <info:fedora/'. $collection_pid . '>'; $query_string .= '$object <fedora-rels-ext:' . $relationship . '> <info:fedora/' . $collection_pid . '>';
} }
else { else {
return ''; return '';
@ -104,14 +105,14 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb
$query_string .= ') $query_string .= ')
minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0>
order by '.$orderby; order by ' . $orderby;
$query_string = htmlentities(urlencode($query_string)); $query_string = htmlentities(urlencode($query_string));
$content = ''; $content = '';
$url = variable_get('fedora_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; $url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string;
$content .= do_curl($url); $content .= do_curl($url);
return $content; return $content;

12
api/fedora_export.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
define('FOXML_10', 'info:fedora/fedora-system:FOXML-1.0'); define('FOXML_10', 'info:fedora/fedora-system:FOXML-1.0');
define('FOXML_11', 'info:fedora/fedora-system:FOXML-1.1'); define('FOXML_11', 'info:fedora/fedora-system:FOXML-1.1');
@ -38,7 +38,7 @@ function export_objects_for_pid($pid, $dir, &$log) {
$paths = array(); $paths = array();
foreach ($object->datastreamDef as $ds) { foreach ($object->datastreamDef as $ds) {
if (!in_array($ds->ID, $ignore_dsids)) { 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; $paths[$ds->ID] = $file;
//$content = $ob_helper->getDatastreamDissemination($pid, $ds->ID); //$content = $ob_helper->getDatastreamDissemination($pid, $ds->ID);
@ -136,7 +136,7 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re
foreach ($xpath->query('METS:file[@OWNERID!="E"][@OWNERID!="R"]/METS:FLocat[@xlink:href]', $dsNode) as $Floc) { 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))); $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 // Don't update datastreams having external uris
if (in_array($dsNode->getAttribute('OWNERID'), $disallowed_groups)) { if (in_array($dsNode->getAttribute('OWNERID'), $disallowed_groups)) {
@ -147,18 +147,18 @@ function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $re
$Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => true))); $Floc->setAttribute('xlink:href', url($paths[$dsId], array('absolute' => true)));
} }
`} `}
*/ */
} }
break; break;
default: default:
$log[] = log_line(t("Unknown or invalid format: ". $format), 'error'); $log[] = log_line(t("Unknown or invalid format: " . $format), 'error');
return FALSE; return FALSE;
} }
} //if $remove_islandora } //if $remove_islandora
$file = $dir .'/'. $pid .'.xml'; $file = $dir . '/' . $pid . '.xml';
if (!$foxml->save($file)) { 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'); $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; return FALSE;

17
api/fedora_item.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#'); define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#');
define("FEDORA_MODEL_URI", 'info:fedora/fedora-system:def/model#'); define("FEDORA_MODEL_URI", 'info:fedora/fedora-system:def/model#');
@ -55,7 +55,7 @@ class Fedora_Item {
return (!empty($this->objectProfile)); return (!empty($this->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'); module_load_include('inc', 'fedora_repository', 'MimeClass');
if (empty($datastream_mimetype)) { if (empty($datastream_mimetype)) {
// Get mime type from the file extension. // Get mime type from the file extension.
@ -76,7 +76,7 @@ class Fedora_Item {
return $return_value; 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)) { if (empty($datastream_label)) {
$datastream_label = $datastream_id; $datastream_label = $datastream_id;
} }
@ -94,15 +94,14 @@ class Fedora_Item {
'dsState' => 'A', 'dsState' => 'A',
'checksumType' => 'DISABLED', 'checksumType' => 'DISABLED',
'checksum' => 'none', '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(); $dir = sys_get_temp_dir();
$tmpfilename = tempnam($dir, 'fedoratmp'); $tmpfilename = tempnam($dir, 'fedoratmp');
$tmpfile = fopen($tmpfilename, 'w'); $tmpfile = fopen($tmpfilename, 'w');
@ -332,7 +331,7 @@ class Fedora_Item {
return $ret; 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( $params = array(
'pid' => $this->pid, 'pid' => $this->pid,
'serviceDefinitionPid' => $service_definition_pid, 'serviceDefinitionPid' => $service_definition_pid,
@ -612,7 +611,7 @@ class Fedora_Item {
closedir($dir_handle); 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( $params = array(
'pid' => $this->pid, 'pid' => $this->pid,

36
api/fedora_utils.inc

@ -1,35 +1,36 @@
<?php <?php
// $Id$
// @file fedora_utils.inc // @file fedora_utils.inc
// Base utilities used by the Islansora fedora module. // Base utilities used by the Islansora fedora module.
/* /*
* Functions that emulate php5.3 functionality for backwards compatiablity * Functions that emulate php5.3 functionality for backwards compatiablity
*/ */
if (!function_exists('str_getcsv')) { if (!function_exists('str_getcsv')) {
function str_getcsv($input, $delimiter=',', $enclosure='"', $escape=null, $eol=null) {
$temp=fopen("php://memory", "rw"); function str_getcsv($input, $delimiter=',', $enclosure='"', $escape=NULL, $eol=NULL) {
$temp = fopen("php://memory", "rw");
fwrite($temp, $input); fwrite($temp, $input);
fseek($temp, 0); fseek($temp, 0);
$r=fgetcsv($temp, 4096, $delimiter, $enclosure); $r = fgetcsv($temp, 4096, $delimiter, $enclosure);
fclose($temp); fclose($temp);
return $r; return $r;
} }
} }
/* /*
* Functions that emulate php5.3 functionality for backwards compatiablity * Functions that emulate php5.3 functionality for backwards compatiablity
*/ */
/* /*
* Static functions used by the Fedora PHP API. * Static functions used by the Fedora PHP API.
*/ */
function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post = NULL) { function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post = NULL) {
global $user; global $user;
// Check if we are inside Drupal and there is a valid user. // Check if we are inside Drupal and there is a valid user.
if ((!isset ($user)) || $user->uid == 0) { if ((!isset($user)) || $user->uid == 0) {
$fedora_user = 'anonymous'; $fedora_user = 'anonymous';
$fedora_pass = '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_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "$fedora_user:$fedora_pass"); curl_setopt($ch, CURLOPT_USERPWD, "$fedora_user:$fedora_pass");
//curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); //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_POST, $number_of_post_vars);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$post"); curl_setopt($ch, CURLOPT_POSTFIELDS, "$post");
} }
@ -67,19 +68,17 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post
function fedora_available() { 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; return strstr($response, 'Repository Information HTML Presentation') !== FALSE;
} }
/** /**
* Returns a UTF-8-encoded transcripiton of the string given in $in_str. * Returns a UTF-8-encoded transcripiton of the string given in $in_str.
* @param string $in_str * @param string $in_str
* @return string A UTF-8 encoded string. * @return string A UTF-8 encoded string.
*/ */
function fix_encoding($in_str) { 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")) { if ($cur_encoding == "UTF-8" && mb_check_encoding($in_str, "UTF-8")) {
return $in_str; return $in_str;
} }
@ -113,16 +112,15 @@ function fixDsid($dsid) {
$replace = ''; $replace = '';
$new_dsid = preg_replace($find, $replace, $new_dsid); $new_dsid = preg_replace($find, $replace, $new_dsid);
if( strlen($new_dsid) > 63 ) if (strlen($new_dsid) > 63)
$new_dsid = substr($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; $new_dsid = 'x' . $new_dsid;
if( strlen($new_dsid) == 0 ) if (strlen($new_dsid) == 0)
$new_dsid = 'item' . rand(1, 100); $new_dsid = 'item' . rand(1, 100);
return $new_dsid; return $new_dsid;
} }

11
api/rels-ext.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* To change this template, choose Tools | Templates * To change this template, choose Tools | Templates
@ -12,9 +13,11 @@
* @author aoneill * @author aoneill
*/ */
class RelsExt { class RelsExt {
// Instance variables // Instance variables
public $relsExtArray = array(); public $relsExtArray = array();
private $originalRelsExtArray = array(); // Used to determine the result of modified() funciton. private $originalRelsExtArray = array(); // Used to determine the result of modified() funciton.
// Member functions // Member functions
/** /**
@ -22,13 +25,12 @@ class RelsExt {
* the repository for the given Fedora_Item. * the repository for the given Fedora_Item.
* @param Fedora_Item $item * @param Fedora_Item $item
*/ */
function RelsExt( $item ) { function RelsExt($item) {
$relsextxml = $item->get_datastream_dissemination('RELS-EXT'); $relsextxml = $item->get_datastream_dissemination('RELS-EXT');
} }
function modified() { function modified() {
return !(empty(array_diff($this->relsExtArray, $this->originalRelsExtArray)) && return!(empty(array_diff($this->relsExtArray, $this->originalRelsExtArray)) &&
empty(array_diff($this->originalRelsExtArray, $this->relsExtArray))); empty(array_diff($this->originalRelsExtArray, $this->relsExtArray)));
} }
@ -39,5 +41,6 @@ class RelsExt {
function save() { function save() {
} }
} }

10
api/tagging.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* @file tagging.inc * @file tagging.inc
@ -11,6 +12,7 @@
* @author aoneill * @author aoneill
*/ */
class TagSet { class TagSet {
public $tags = array(); public $tags = array();
public $item = NULL; public $item = NULL;
public $tagsDSID = 'TAGS'; public $tagsDSID = 'TAGS';
@ -23,7 +25,7 @@ class TagSet {
} }
function load() { 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)) { if (empty($tagsxml)) {
$this->tags = array(); $this->tags = array();
return FALSE; return FALSE;
@ -59,11 +61,11 @@ class TagSet {
else { else {
$this->item->modify_datastream_by_value($tagdoc->saveXML(), $this->tagsDSID, 'Tags', 'text/xml', 'X'); $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'); drupal_set_message('There was an error saving the tags datastream: !e', array('!e' => $e), 'error');
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
} }

1
collection_policies/COLLECTION-COLLECTION POLICY.xml

@ -1,3 +1,4 @@
<collection_policy name="" xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.islandora.ca http://syn.lib.umanitoba.ca/collection_policy.xsd"> <collection_policy name="" xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.islandora.ca http://syn.lib.umanitoba.ca/collection_policy.xsd">
<content_models> <content_models>
<content_model dsid="ISLANDORACM" name="Collection" namespace="islandora:collection" pid="islandora:collectionCModel"/> <content_model dsid="ISLANDORACM" name="Collection" namespace="islandora:collection" pid="islandora:collectionCModel"/>

25
collection_policies/PDF-COLLECTION POLICY.xml

@ -1 +1,24 @@
<?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_model name="STANDARD_PDF" dsid="ISLANDORACM" namespace="islandora:spdf" pid="islandora:standard_pdf"/> <content_model name="STRICT_PDF" dsid="ISLANDORACM" namespace="islandora:strictpdf" pid="islandora:strict_pdf"/> <content_model name="REFWORKS_BATCH" dsid="ISLANDORACM" namespace="islandora:ref" pid="islandora:refworks_cm"/> </content_models> <search_terms> <term field="dc.title">dc.title</term> <term field="dc.creator">dc.creator</term> <term field="dc.description" default="true">dc.description</term> <term field="dc.date">dc.date</term> <term field="dc.identifier">dc.identifier</term> <term field="dc.language">dc.language</term> <term field="dc.publisher">dc.publisher</term> <term field="dc.rights">dc.rights</term> <term field="dc.subject">dc.subject</term> <term field="dc.relation">dc.relation</term> <term field="dcterms.temporal">dcterms.temporal</term> <term field="dcterms.spatial">dcterms.spatial</term> <term field="fgs.DS.first.text">Full Text</term> </search_terms> <relationship>isMemberOfCollection</relationship> </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_model name="STANDARD_PDF" dsid="ISLANDORACM" namespace="islandora:spdf" pid="islandora:standard_pdf"/>
<content_model name="STRICT_PDF" dsid="ISLANDORACM" namespace="islandora:strictpdf" pid="islandora:strict_pdf"/>
<content_model name="REFWORKS_BATCH" dsid="ISLANDORACM" namespace="islandora:ref" pid="islandora:refworks_cm"/>
</content_models>
<search_terms>
<term field="dc.title">dc.title</term>
<term field="dc.creator">dc.creator</term>
<term field="dc.description" default="true">dc.description</term>
<term field="dc.date">dc.date</term>
<term field="dc.identifier">dc.identifier</term>
<term field="dc.language">dc.language</term>
<term field="dc.publisher">dc.publisher</term>
<term field="dc.rights">dc.rights</term>
<term field="dc.subject">dc.subject</term>
<term field="dc.relation">dc.relation</term>
<term field="dcterms.temporal">dcterms.temporal</term>
<term field="dcterms.spatial">dcterms.spatial</term>
<term field="fgs.DS.first.text">Full Text</term>
</search_terms>
<relationship>isMemberOfCollection</relationship>
</collection_policy>

1
collection_policies/PERSONAL-COLLECTION-POLICY.xml

@ -1,3 +1,4 @@
<collection_policy> <collection_policy>
<!---we will define allowed mimetypes and what to do with various types as part of the content model--> <!---we will define allowed mimetypes and what to do with various types as part of the content model-->
<contentmodels> <contentmodels>

1
collection_policies/book_collection_policy.xml

@ -1,3 +1,4 @@
<collection_policy> <collection_policy>
<!---we will define allowed mimetypes and what to do with various types as part of the content model--> <!---we will define allowed mimetypes and what to do with various types as part of the content model-->
<contentmodels> <contentmodels>

43
collection_policies/qt_collection_policy.xml

@ -1,35 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?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"> <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>
<content_model name="Video" dsid="ISLANDORACM" namespace="islandora" pid="islandora:qtCModel"/> <content_model name="Video" dsid="ISLANDORACM" namespace="islandora" pid="islandora:qtCModel"/>
</content_models> </content_models>
<search_terms> <search_terms>
<term field="dc.title"> <term field="dc.title">
dc.title</term> dc.title
</term>
<term field="dc.creator"> <term field="dc.creator">
dc.creator</term> dc.creator
</term>
<term field="dc.description" default="true"> <term field="dc.description" default="true">
dc.description</term> dc.description
</term>
<term field="dc.date"> <term field="dc.date">
dc.date</term> dc.date
</term>
<term field="dc.identifier"> <term field="dc.identifier">
dc.identifier</term> dc.identifier
</term>
<term field="dc.language"> <term field="dc.language">
dc.language</term> dc.language
</term>
<term field="dc.publisher"> <term field="dc.publisher">
dc.publisher</term> dc.publisher
</term>
<term field="dc.rights"> <term field="dc.rights">
dc.rights</term> dc.rights
</term>
<term field="dc.subject"> <term field="dc.subject">
dc.subject</term> dc.subject
</term>
<term field="dc.relation"> <term field="dc.relation">
dc.relation</term> dc.relation
</term>
<term field="dcterms.temporal"> <term field="dcterms.temporal">
dcterms.temporal</term> dcterms.temporal
</term>
<term field="dcterms.spatial"> <term field="dcterms.spatial">
dcterms.spatial</term> dcterms.spatial
</term>
</search_terms> </search_terms>
<relationship> <relationship>
isMemberOfCollection</relationship> isMemberOfCollection
</collection_policy> </relationship>
</collection_policy>

1
collection_policy.xsd

@ -1,3 +1,4 @@
<xsd:schema xmlns="http://www.islandora.ca" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.islandora.ca" elementFormDefault="qualified" > <xsd:schema xmlns="http://www.islandora.ca" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.islandora.ca" elementFormDefault="qualified" >
<xsd:annotation> <xsd:annotation>
<xsd:documentation xml:lang="en"> <xsd:documentation xml:lang="en">

7
collection_views/Coverflow_Collection_View.xsl

@ -1,3 +1,4 @@
<xsl:stylesheet exclude-result-prefixes="php" version="1.0" xmlns:php="http://php.net/xsl" <xsl:stylesheet exclude-result-prefixes="php" version="1.0" xmlns:php="http://php.net/xsl"
xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:template match="/">
@ -40,7 +41,8 @@
// YAHOO.util.Event.onDOMReady(function(){ // YAHOO.util.Event.onDOMReady(function(){
//$(document).ready(function(){ //$(document).ready(function(){
window.onload = function(){ window.onload = function(){
var images = [</xsl:text> var images = [
</xsl:text>
<xsl:for-each select="/s:sparql/s:results/s:result"> <xsl:for-each select="/s:sparql/s:results/s:result">
<xsl:variable name="OBJECTURI" select="s:object/@uri"/> <xsl:variable name="OBJECTURI" select="s:object/@uri"/>
<xsl:variable name="pid" select="substring-after($OBJECTURI,'/')"/> <xsl:variable name="pid" select="substring-after($OBJECTURI,'/')"/>
@ -67,7 +69,8 @@
var myMoveLeftBtn = new YAHOO.widget.Button('moveLeftButton', {onclick: {fn: moveLeft, obj: myCoverFlow}}); 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 myMoveRightBtn = new YAHOO.widget.Button('moveRightButton', {onclick: {fn: moveRight, obj: myCoverFlow}});
};</xsl:text> };
</xsl:text>
</script> </script>
<div class="title">Testing YUI's CoverFlow version 0.1 (beta)</div> <div class="title">Testing YUI's CoverFlow version 0.1 (beta)</div>
<div id="coverFlowTest"/> <div id="coverFlowTest"/>

7
collection_views/Coverflow_PRE_Collection_View.xsl

@ -1,3 +1,4 @@
<xsl:stylesheet exclude-result-prefixes="php" version="1.0" xmlns:php="http://php.net/xsl" <xsl:stylesheet exclude-result-prefixes="php" version="1.0" xmlns:php="http://php.net/xsl"
xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:template match="/">
@ -40,7 +41,8 @@
// YAHOO.util.Event.onDOMReady(function(){ // YAHOO.util.Event.onDOMReady(function(){
//$(document).ready(function(){ //$(document).ready(function(){
window.onload = function(){ window.onload = function(){
var images = [</xsl:text> var images = [
</xsl:text>
<xsl:for-each select="/s:sparql/s:results/s:result"> <xsl:for-each select="/s:sparql/s:results/s:result">
<xsl:variable name="OBJECTURI" select="s:object/@uri"/> <xsl:variable name="OBJECTURI" select="s:object/@uri"/>
<xsl:variable name="pid" select="substring-after($OBJECTURI,'/')"/> <xsl:variable name="pid" select="substring-after($OBJECTURI,'/')"/>
@ -71,7 +73,8 @@
var myMoveLeftBtn = new YAHOO.widget.Button('moveLeftButton', {onclick: {fn: moveLeft, obj: myCoverFlow}}); 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 myMoveRightBtn = new YAHOO.widget.Button('moveRightButton', {onclick: {fn: moveRight, obj: myCoverFlow}});
};</xsl:text> };
</xsl:text>
</script> </script>
<div class="title">Testing YUI's CoverFlow version 0.1 (beta)</div> <div class="title">Testing YUI's CoverFlow version 0.1 (beta)</div>
<div id="coverFlowTest"/> <div id="coverFlowTest"/>

151
collection_views/FLV-COLLECTION VIEW(2).xml

@ -15,51 +15,82 @@
<xsl:variable name="end" select="($start - 1) + number($size)"/> <xsl:variable name="end" select="($start - 1) + number($size)"/>
<xsl:variable name="cellsPerRow" select="4"/> <xsl:variable name="cellsPerRow" select="4"/>
<xsl:variable name="count" select="count(sparql/results/result)"/> <xsl:variable name="count" select="count(sparql/results/result)"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table cellpadding="3" cellspacing="3" width="90%"> <table cellpadding="3" cellspacing="3" width="90%">
<tr><td colspan="{$cellsPerRow}"> <tr>
<td colspan="{$cellsPerRow}">
<div STYLE="text-align: center;"> <div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> <br clear="all" /> </div>
</td></tr> <br clear="all" />
</td>
</tr>
<!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]"> <!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]">
<xsl:variable name='OBJECTURI' select="object/@uri"/> <xsl:variable name='OBJECTURI' select="object/@uri"/>
@ -80,41 +111,70 @@
</xsl:for-each>- </xsl:for-each>-
--> -->
<xsl:apply-templates select="sparql/results"/> <xsl:apply-templates select="sparql/results"/>
</table><br clear="all" /> </table>
<div STYLE="text-align: center;"> <br clear="all" />
<div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -122,7 +182,7 @@
</xsl:choose> </xsl:choose>
</div> </div>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="sparql/results"> <xsl:template match="sparql/results">
<xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]"> <xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]">
<tr> <tr>
@ -143,27 +203,40 @@
<xsl:variable name="linkUrl"> <xsl:variable name="linkUrl">
<xsl:choose> <xsl:choose>
<xsl:when test="(content='Collection' or content='Community')"> <xsl:when test="(content='Collection' or content='Community')">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/OBJ/
<xsl:value-of select="title"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<td valign="top" width="25%"> <td valign="top" width="25%">
<a> <a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
<img> <img>
<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:value-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="$newTitle"/> <xsl:attribute name="alt">
<xsl:value-of select="$newTitle"/>
</xsl:attribute> </xsl:attribute>
</img> </a> <br clear="all" /> </img>
</a>
<br clear="all" />
<a> <a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="$newTitle"/> <xsl:value-of select="$newTitle"/>
</a> </a>

131
collection_views/REFWORKS-COLLECTION_VIEW.xml

@ -18,48 +18,79 @@
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table cellpadding="3" cellspacing="3" width="90%"> <table cellpadding="3" cellspacing="3" width="90%">
<tr><td colspan="{$cellsPerRow}"> <tr>
<td colspan="{$cellsPerRow}">
<div STYLE="text-align: center;"> <div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> <br clear="all" /> </div>
</td></tr> <br clear="all" />
</td>
</tr>
<!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]"> <!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]">
<xsl:variable name='OBJECTURI' select="object/@uri"/> <xsl:variable name='OBJECTURI' select="object/@uri"/>
@ -80,41 +111,70 @@
</xsl:for-each>- </xsl:for-each>-
--> -->
<xsl:apply-templates select="s:sparql/s:results"/> <xsl:apply-templates select="s:sparql/s:results"/>
</table><br clear="all" /> </table>
<br clear="all" />
<div STYLE="text-align: center;"> <div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -145,10 +205,14 @@
<xsl:variable name="linkUrl"> <xsl:variable name="linkUrl">
<xsl:choose> <xsl:choose>
<xsl:when test="($CONTENTMODEL='islandora:collectionCModel')"> <xsl:when test="($CONTENTMODEL='islandora:collectionCModel')">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="s:title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="s:title"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<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"/>/OBJ/
<xsl:value-of select="s:title"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:value-of select="s:content"/> <xsl:value-of select="s:content"/>
@ -164,9 +228,12 @@
</xsl:attribute> </xsl:attribute>
</img> </a> <br clear="all" />--> </img> </a> <br clear="all" />-->
<br /><a> <br />
<a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="s:title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="s:title"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="$newTitle"/> <xsl:value-of select="$newTitle"/>
</a> </a>

145
collection_views/SIMPLE-COLLECTION_VIEW.xml

@ -18,48 +18,79 @@
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table cellpadding="3" cellspacing="3" width="90%"> <table cellpadding="3" cellspacing="3" width="90%">
<tr><td colspan="{$cellsPerRow}"> <tr>
<td colspan="{$cellsPerRow}">
<div STYLE="text-align: center;"> <div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> <br clear="all" /> </div>
</td></tr> <br clear="all" />
</td>
</tr>
<!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]"> <!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]">
<xsl:variable name='OBJECTURI' select="object/@uri"/> <xsl:variable name='OBJECTURI' select="object/@uri"/>
@ -80,41 +111,70 @@
</xsl:for-each>- </xsl:for-each>-
--> -->
<xsl:apply-templates select="s:sparql/s:results"/> <xsl:apply-templates select="s:sparql/s:results"/>
</table><br clear="all" /> </table>
<br clear="all" />
<div STYLE="text-align: center;"> <div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -145,28 +205,41 @@
<xsl:variable name="linkUrl"> <xsl:variable name="linkUrl">
<xsl:choose> <xsl:choose>
<xsl:when test="($CONTENTMODEL='islandora:collectionCModel')"> <xsl:when test="($CONTENTMODEL='islandora:collectionCModel')">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="s:title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="s:title"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<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"/>/OBJ/
<xsl:value-of select="s:title"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:value-of select="s:content"/> <xsl:value-of select="s:content"/>
</xsl:variable> </xsl:variable>
<td valign="top" width="25%"> <td valign="top" width="25%">
<a> <a>
<xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> <xsl:attribute name="href">
<xsl:value-of select="$linkUrl"/>
</xsl:attribute> </xsl:attribute>
<img> <img>
<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:value-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="$newTitle"/> <xsl:attribute name="alt">
<xsl:value-of select="$newTitle"/>
</xsl:attribute> </xsl:attribute>
</img> </a> <br clear="all" /> </img>
</a>
<br clear="all" />
<br /><a> <br />
<a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="s:title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="s:title"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="$newTitle"/> <xsl:value-of select="$newTitle"/>
</a> </a>

4
collection_views/SmileyStuff-COLLECTION_VIEW.xml

@ -1,3 +1,4 @@
<xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:template match="/">
<xsl:variable name="BASEURL"> <xsl:variable name="BASEURL">
@ -51,7 +52,8 @@
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/> <xsl:value-of select="$BASEURL"/>
<xsl:text>/fedora/repository/</xsl:text> <xsl:text>/fedora/repository/</xsl:text>
<xsl:value-of select="$pid"/>/-/<xsl:value-of select="s:memberTitle"/> <xsl:value-of select="$pid"/>/-/
<xsl:value-of select="s:memberTitle"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="s:memberTitle"/> <xsl:value-of select="s:memberTitle"/>
</a> </a>

4
collection_views/Video-COLLECTION_VIEW.xml

@ -1,3 +1,4 @@
<xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:template match="/">
<xsl:variable name="BASEURL"> <xsl:variable name="BASEURL">
@ -48,7 +49,8 @@
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/> <xsl:value-of select="$BASEURL"/>
<xsl:text>/fedora/repository/</xsl:text> <xsl:text>/fedora/repository/</xsl:text>
<xsl:value-of select="$pid"/>/-/<xsl:value-of select="s:memberTitle"/> <xsl:value-of select="$pid"/>/-/
<xsl:value-of select="s:memberTitle"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="s:memberTitle"/> <xsl:value-of select="s:memberTitle"/>
</a> </a>

135
collection_views/default-sparqltoHtml.xsl

@ -15,104 +15,169 @@
<xsl:variable name="end" select="($start - 1) + number($size)"/> <xsl:variable name="end" select="($start - 1) + number($size)"/>
<xsl:variable name='columns' select="4"/> <xsl:variable name='columns' select="4"/>
<xsl:variable name="count" select="count(sparql/results/result)"/> <xsl:variable name="count" select="count(sparql/results/result)"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table> <table>
<tr><td colspan="2"> <tr>
<td colspan="2">
<div align="center"> <div align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> </div>
</td></tr> </td>
</tr>
<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]"> <xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]">
<xsl:variable name='OBJECTURI' select="object/@uri"/> <xsl:variable name='OBJECTURI' select="object/@uri"/>
<xsl:variable name='PID' select="substring-after($OBJECTURI,'/')"/> <xsl:variable name='PID' select="substring-after($OBJECTURI,'/')"/>
<tr> <tr>
<td> <td>
<img> <img>
<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:value-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
</img> </img>
</td><td> </td>
<td>
<a> <a>
<xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="title"/> <xsl:value-of select="title"/>
</a> </a>
</td></tr> </td>
</tr>
</xsl:for-each> </xsl:for-each>
</table> </table>
<div align="center"> <div align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -120,5 +185,5 @@
</xsl:choose> </xsl:choose>
</div> </div>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

4
collection_views/simple_list_view.xml

@ -1,3 +1,4 @@
<xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- simple list view for a itql query that looks queries for $object and $title only --> <!-- simple list view for a itql query that looks queries for $object and $title only -->
<xsl:template match="/"> <xsl:template match="/">
@ -14,7 +15,8 @@
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/> <xsl:value-of select="$BASEURL"/>
<xsl:text>/fedora/repository/</xsl:text> <xsl:text>/fedora/repository/</xsl:text>
<xsl:value-of select="$pid"/>/-/<xsl:value-of select="s:title"/> <xsl:value-of select="$pid"/>/-/
<xsl:value-of select="s:title"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="s:title"/> <xsl:value-of select="s:title"/>
</a> </a>

4
collection_views/standard_jpeg_collection_view.xml

@ -1,3 +1,4 @@
<xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:stylesheet version="1.0" xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:template match="/">
<xsl:variable name="BASEURL"> <xsl:variable name="BASEURL">
@ -50,7 +51,8 @@
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/> <xsl:value-of select="$BASEURL"/>
<xsl:text>/fedora/repository/</xsl:text> <xsl:text>/fedora/repository/</xsl:text>
<xsl:value-of select="$pid"/>/-/<xsl:value-of select="s:memberTitle"/> <xsl:value-of select="$pid"/>/-/
<xsl:value-of select="s:memberTitle"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="s:memberTitle"/> <xsl:value-of select="s:memberTitle"/>
</a> </a>

244
collection_views/yui_coverflow/js/CoverFlow.js vendored

@ -19,7 +19,7 @@ YAHOO.namespace("ext");
//(function(){ //(function(){
/** /**
* @class CoverFlow * @class CoverFlow
* @namespace YAHOO.ext * @namespace YAHOO.ext
* @constructor * @constructor
@ -31,28 +31,28 @@ YAHOO.namespace("ext");
* config.bgColor {String} Background color. Could be in the form #00000 or black. Optional. Default: CoverFlow.DEFAULT_BG_COLOR. * 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){ YAHOO.ext.CoverFlow = function(el, userConfig){
if(el) if(el)
this.init(el, userConfig || {}); this.init(el, userConfig || {});
}; };
//shortcuts //shortcuts
var CoverFlow = YAHOO.ext.CoverFlow; var CoverFlow = YAHOO.ext.CoverFlow;
var Dom = YAHOO.util.Dom; var Dom = YAHOO.util.Dom;
/** /**
* Defaults * Defaults
*/ */
CoverFlow.DEFAULT_HEIGHT = 300; CoverFlow.DEFAULT_HEIGHT = 300;
CoverFlow.DEFAULT_WIDTH = 800; CoverFlow.DEFAULT_WIDTH = 800;
CoverFlow.DEFAULT_BG_COLOR = '#000000'; CoverFlow.DEFAULT_BG_COLOR = '#000000';
CoverFlow.IMAGE_SEPARATION = 50; CoverFlow.IMAGE_SEPARATION = 50;
CoverFlow.RIGHT = 'right'; CoverFlow.RIGHT = 'right';
CoverFlow.LEFT = 'left'; CoverFlow.LEFT = 'left';
CoverFlow.LABEL_CLASS = 'coverFlowLabel'; CoverFlow.LABEL_CLASS = 'coverFlowLabel';
CoverFlow.prototype = { CoverFlow.prototype = {
//Images array (it's a sort of transient var) //Images array (it's a sort of transient var)
images: [], images: [],
//Items array {CoverFlowItem[]} //Items array {CoverFlowItem[]}
@ -122,9 +122,9 @@ YAHOO.namespace("ext");
this.element.appendChild(image); this.element.appendChild(image);
//a shortcut to not create another context to call onload //a shortcut to not create another context to call onload
var me = this; var me = this;
// image.onload = function(){ // image.onload = function(){
// CoverFlow.preloadImage(me, this); // this = image // CoverFlow.preloadImage(me, this); // this = image
// }; // };
YAHOO.util.Event.on(image, 'load', this.preloadImage, image, this); YAHOO.util.Event.on(image, 'load', this.preloadImage, image, this);
image.src = img.src; image.src = img.src;
@ -203,15 +203,23 @@ YAHOO.namespace("ext");
}, },
attachEventListeners: function(){ attachEventListeners: function(){
new YAHOO.util.KeyListener(this.element, { keys:39 }, new YAHOO.util.KeyListener(this.element, {
{ fn:this.selectNext, keys:39
},
{
fn:this.selectNext,
scope:this, scope:this,
correctScope:true } ).enable(); correctScope:true
} ).enable();
new YAHOO.util.KeyListener(this.element, { keys:37 }, new YAHOO.util.KeyListener(this.element, {
{ fn:this.selectPrevious, keys:37
},
{
fn:this.selectPrevious,
scope:this, scope:this,
correctScope:true } ).enable(); correctScope:true
} ).enable();
}, },
@ -245,37 +253,61 @@ YAHOO.namespace("ext");
if(distance == 0){// selected if(distance == 0){// selected
coverFlowItem.setZIndex(this.imageZIndex); coverFlowItem.setZIndex(this.imageZIndex);
coverFlowItem.isSelected(false); coverFlowItem.isSelected(false);
animateItems.push({item: coverFlowItem, attribute:{angle: {start: 0, end: this.perspectiveAngle} } }); animateItems.push({
item: coverFlowItem,
attribute:{
angle: {
start: 0,
end: this.perspectiveAngle
}
}
});
coverFlowItem = this.coverFlowItems[++i]; coverFlowItem = this.coverFlowItems[++i];
coverFlowItem.isSelected(true); coverFlowItem.isSelected(true);
this.showLabel(coverFlowItem.getLabel()); this.showLabel(coverFlowItem.getLabel());
animateItems.push({item: coverFlowItem, attribute:{angle: {start: this.perspectiveAngle, end: 0} } }); animateItems.push({
item: coverFlowItem,
attribute:{
angle: {
start: this.perspectiveAngle,
end: 0
}
}
});
}else{ }else{
animateItems.push({item: coverFlowItem, attribute: {left: {start:coverFlowItem.getLeft(), end: coverFlowItem.getLeft() - CoverFlow.IMAGE_SEPARATION} }}); animateItems.push({
} item: coverFlowItem,
attribute: {
left: {
start:coverFlowItem.getLeft(),
end: coverFlowItem.getLeft() - CoverFlow.IMAGE_SEPARATION
} }
} }
});
}
}
}
var animation = new CoverFlowAnimation({ var animation = new CoverFlowAnimation({
direction: CoverFlow.LEFT, direction: CoverFlow.LEFT,
center: this.getCenter(), center: this.getCenter(),
startLeftPos: this.getLeftStart(), startLeftPos: this.getLeftStart(),
startRightPos: this.getRightStart() startRightPos: this.getRightStart()
}, },
animateItems, 0.5); animateItems, 0.5);
animation.onStart.subscribe(this.handleAnimationWorking, this); animation.onStart.subscribe(this.handleAnimationWorking, this);
animation.onComplete.subscribe(this.handleQueuedMove, this); animation.onComplete.subscribe(this.handleQueuedMove, this);
animation.animate(); animation.animate();
if(this.selectedItem + 1 < this.coverFlowItems.length) if(this.selectedItem + 1 < this.coverFlowItems.length)
this.selectedItem++; this.selectedItem++;
}, },
selectPrevious: function(){ selectPrevious: function(){
if(this.animationWorking){ if(this.animationWorking){
this.moveQueue.push('moveRight'); this.moveQueue.push('moveRight');
return; return;
@ -292,40 +324,64 @@ YAHOO.namespace("ext");
coverFlowItem.setZIndex(this.selectedImageZIndex); coverFlowItem.setZIndex(this.selectedImageZIndex);
coverFlowItem.isSelected(true); coverFlowItem.isSelected(true);
this.showLabel(coverFlowItem.getLabel()); this.showLabel(coverFlowItem.getLabel());
animateItems.push({item: coverFlowItem, attribute: {angle: {start: this.perspectiveAngle, end: 0}}}); animateItems.push({
item: coverFlowItem,
attribute: {
angle: {
start: this.perspectiveAngle,
end: 0
}
}
});
coverFlowItem = this.coverFlowItems[++i]; coverFlowItem = this.coverFlowItems[++i];
coverFlowItem.isSelected(false); coverFlowItem.isSelected(false);
coverFlowItem.setZIndex(this.imageZIndex); coverFlowItem.setZIndex(this.imageZIndex);
animateItems.push({item: coverFlowItem, attribute: {angle: {start: 0, end: this.perspectiveAngle}}}); animateItems.push({
}else{ item: coverFlowItem,
coverFlowItem.setZIndex(coverFlowItem.getZIndex() - 1); attribute: {
animateItems.push({item: coverFlowItem, attribute: {left: {start:coverFlowItem.getLeft(), end: coverFlowItem.getLeft() + CoverFlow.IMAGE_SEPARATION} }}); 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({ });
}
}
}
var animation = new CoverFlowAnimation({
direction: CoverFlow.RIGHT, direction: CoverFlow.RIGHT,
center: this.getCenter(), center: this.getCenter(),
startLeftPos: this.getLeftStart(), startLeftPos: this.getLeftStart(),
startRightPos: this.getRightStart() startRightPos: this.getRightStart()
}, },
animateItems, 0.5); animateItems, 0.5);
animation.onStart.subscribe(this.handleAnimationWorking, this); animation.onStart.subscribe(this.handleAnimationWorking, this);
animation.onComplete.subscribe(this.handleQueuedMove, this); animation.onComplete.subscribe(this.handleQueuedMove, this);
animation.animate(); animation.animate();
if(this.selectedItem > 0) if(this.selectedItem > 0)
this.selectedItem--; this.selectedItem--;
}, },
handleAnimationWorking: function(a, b, cf){ handleAnimationWorking: function(a, b, cf){
cf.animationWorking = true; cf.animationWorking = true;
}, },
handleQueuedMove: function(msg, data, cf){ handleQueuedMove: function(msg, data, cf){
cf.animationWorking = false; cf.animationWorking = false;
var next = cf.moveQueue.pop(); var next = cf.moveQueue.pop();
@ -333,29 +389,29 @@ YAHOO.namespace("ext");
cf.selectNext(); cf.selectNext();
if(next == 'moveRight') if(next == 'moveRight')
cf.selectPrevious(); cf.selectPrevious();
}, },
getCenter: function(){ getCenter: function(){
return this.containerWidth / 2; return this.containerWidth / 2;
}, },
getRightStart: function() { getRightStart: function() {
return this.containerWidth - this.sideRatio * this.containerWidth; return this.containerWidth - this.sideRatio * this.containerWidth;
}, },
getLeftStart: function() { getLeftStart: function() {
return this.sideRatio * this.containerWidth; return this.sideRatio * this.containerWidth;
}, },
sortCoverFlowItems: function(){ sortCoverFlowItems: function(){
function sortFunction(aCoverFlowItem, bCoverFlowItem){ function sortFunction(aCoverFlowItem, bCoverFlowItem){
return aCoverFlowItem.index - bCoverFlowItem.index; return aCoverFlowItem.index - bCoverFlowItem.index;
} }
this.coverFlowItems.sort(sortFunction); this.coverFlowItems.sort(sortFunction);
}, },
createCoverFlowItems: function(){ createCoverFlowItems: function(){
this.coverFlowItems = []; this.coverFlowItems = [];
for(var i=0; i<this.images.length; i++){ for(var i=0; i<this.images.length; i++){
var image = this.images[i]; var image = this.images[i];
@ -364,15 +420,18 @@ YAHOO.namespace("ext");
scaledHeight: this.scaleHeight(image), scaledHeight: this.scaleHeight(image),
reflectionRatio: this.reflectionRatio, reflectionRatio: this.reflectionRatio,
bgColor: this.backgroundColor, bgColor: this.backgroundColor,
onclick: {fn: this.select, scope: this} onclick: {
fn: this.select,
scope: this
}
}); });
this.alignCenterHeight(coverFlowItem); this.alignCenterHeight(coverFlowItem);
this.coverFlowItems.push(coverFlowItem); this.coverFlowItems.push(coverFlowItem);
}; };
delete this.images; delete this.images;
}, },
alignCenterHeight: function(coverFlowItem){//review!!!!! alignCenterHeight: function(coverFlowItem){//review!!!!!
coverFlowItem.element.style.position = 'absolute'; coverFlowItem.element.style.position = 'absolute';
var imageHeight = coverFlowItem.canvas.height / (1 + this.reflectionRatio); var imageHeight = coverFlowItem.canvas.height / (1 + this.reflectionRatio);
@ -381,9 +440,9 @@ YAHOO.namespace("ext");
coverFlowItem.setTop(top); coverFlowItem.setTop(top);
}, },
scaleHeight: function(image){ scaleHeight: function(image){
var height = 0; var height = 0;
if(image.height <= this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ if(image.height <= this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){
height = image.height; height = image.height;
@ -401,9 +460,9 @@ YAHOO.namespace("ext");
height = ((this.getMaxImageWidth() / image.width)) * image.height; height = ((this.getMaxImageWidth() / image.width)) * image.height;
} }
return height; return height;
}, },
scaleWidth: function(image){ scaleWidth: function(image){
var width = 0; var width = 0;
if(image.height <= this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){ if(image.height <= this.getMaxImageHeight() && image.width <= this.getMaxImageWidth()){
width = image.width; width = image.width;
@ -421,37 +480,37 @@ YAHOO.namespace("ext");
width = ((this.getMaxImageWidth() / image.width)) * image.width; width = ((this.getMaxImageWidth() / image.width)) * image.width;
} }
return width; return width;
}, },
getMaxImageHeight: function(){ getMaxImageHeight: function(){
return (this.containerHeight * this.imageHeightRatio); return (this.containerHeight * this.imageHeightRatio);
}, },
getMaxImageWidth: function(){ getMaxImageWidth: function(){
return (this.containerWidth * this.imageWidthRatio); return (this.containerWidth * this.imageWidthRatio);
}, },
getTopOffset: function(){ getTopOffset: function(){
return this.containerHeight * this.topRatio; return this.containerHeight * this.topRatio;
}, },
getFooterOffset: function(){ getFooterOffset: function(){
return this.containerHeight * (this.topRatio + this.imageHeightRatio); return this.containerHeight * (this.topRatio + this.imageHeightRatio);
} }
}; };
/** /**
* @class CoverFlowItem * @class CoverFlowItem
* *
*/ */
CoverFlowItem = function(image, config){ CoverFlowItem = function(image, config){
if(image) if(image)
this.init(image, config); this.init(image, config);
}; };
CoverFlowItem.prototype = { CoverFlowItem.prototype = {
canvas: null, canvas: null,
element: null, element: null,
index: null, index: null,
@ -573,7 +632,8 @@ YAHOO.namespace("ext");
ctx.fillRect(0, 0, scaledWidth, scaledHeight); ctx.fillRect(0, 0, scaledWidth, scaledHeight);
//apply the background color to the gradient //apply the background color to the gradient
ctx.globalCompositeOperation = 'destination-over'; ctx.globalCompositeOperation = 'destination-over';
ctx.fillStyle = bgColor; '#000'; ctx.fillStyle = bgColor;
'#000';
ctx.globalAlpha = 0.8; ctx.globalAlpha = 0.8;
ctx.fillRect(0, 0 , scaledWidth, scaledHeight); ctx.fillRect(0, 0 , scaledWidth, scaledHeight);
ctx.restore(); ctx.restore();
@ -696,17 +756,17 @@ YAHOO.namespace("ext");
} }
} }
}; };
/** /**
* @class CoverFlowAnimation * @class CoverFlowAnimation
* @requires YAHOO.util.AnimMgr * @requires YAHOO.util.AnimMgr
*/ */
CoverFlowAnimation = function(config, animationItems, duration){ CoverFlowAnimation = function(config, animationItems, duration){
this.init(config, animationItems, duration); this.init(config, animationItems, duration);
}; };
CoverFlowAnimation.prototype = { CoverFlowAnimation.prototype = {
direction: null, direction: null,
center: null, center: null,
@ -931,6 +991,6 @@ YAHOO.namespace("ext");
} }
} }
} }
}; };
//}); //});

87
collection_views/yui_coverflow/js/test.js vendored

@ -4,33 +4,82 @@
YAHOO.util.Event.onDOMReady(function(){ YAHOO.util.Event.onDOMReady(function(){
var images = [ 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: 'images/ardillitaMac.jpg',
{src: 'http://farm1.static.flickr.com/69/213130158_0d1aa23576_d.jpg'}, label: 'Ardileta!',
{src: 'http://farm1.static.flickr.com/69/213130158_0d1aa23576_d.jpg'}, onclick: function(){
{src: 'images/msn2.jpg', label: 'My Mac'}, alert('image1');
{src: 'images/msn2.jpg', label: 'My Mac again...'} }
},
{
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}); var myCoverFlow = new YAHOO.ext.CoverFlow('coverFlowTest', {
height: 200,
width: 600,
images: images
});
function moveLeft(e, coverFlow){ function moveLeft(e, coverFlow){
coverFlow.selectNext(); coverFlow.selectNext();
} }
function moveRight(e, coverFlow){ function moveRight(e, coverFlow){
coverFlow.selectPrevious(); 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 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 = [ var otherImages = [
{src: 'images/ardillitaMac.jpg', label: 'Ardileta!', onclick: function(){alert('image1');}}, {
{src: 'images/msn2.jpg', label: 'My Mac'}, src: 'images/ardillitaMac.jpg',
{src: 'images/msn2.jpg', label: 'My Mac again...'} 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'
});

2
content_models/BASIC_AUDIO.xml

@ -215,4 +215,4 @@
</element> </element>
</form_elements> </form_elements>
</ingest_form> </ingest_form>
</content_model> </content_model>

2
content_models/BASIC_VIDEO.xml

@ -215,4 +215,4 @@
</element> </element>
</form_elements> </form_elements>
</ingest_form> </ingest_form>
</content_model> </content_model>

1
content_models/COLLECTIONCM.xml

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

1
content_models/FAS_slideCModel.xml

@ -1,3 +1,4 @@
<content_model name="standard_slide"> <content_model name="standard_slide">
<mimetypes> <mimetypes>
<type>image/tiff</type> <type>image/tiff</type>

2
content_models/STANDARD PDF.xml

@ -233,4 +233,4 @@
</element> </element>
</form_elements> </form_elements>
</ingest_form> </ingest_form>
</content_model> </content_model>

2
content_models/STANDARD_FLVCM.xml

@ -215,4 +215,4 @@
</element> </element>
</form_elements> </form_elements>
</ingest_form> </ingest_form>
</content_model> </content_model>

2
content_models/STANDARD_IMAGECM.xml

@ -268,4 +268,4 @@
</element> </element>
</form_elements> </form_elements>
</ingest_form> </ingest_form>
</content_model> </content_model>

33
content_models/STANDARD_QT.xml

@ -53,12 +53,14 @@
<element label="Creator/" name="dc:creator" type="textfield"> <element label="Creator/" name="dc:creator" type="textfield">
<description>An entity primarily responsible for making the <description>An entity primarily responsible for making the
content of the resource such as a person, organization or content of the resource such as a person, organization or
service.</description> service.
</description>
</element> </element>
<element label="Subject" name="dc:subject" type="select"> <element label="Subject" name="dc:subject" type="select">
<description>An entity primarily responsible for making the <description>An entity primarily responsible for making the
content of the resource such as a person, organization or content of the resource such as a person, organization or
service.</description> service.
</description>
<authoritative_list> <authoritative_list>
<item>home recording</item> <item>home recording</item>
<item>meeting</item> <item>meeting</item>
@ -69,27 +71,32 @@
<element label="Description of Media" name="dc:description" required="true" type="textarea"> <element label="Description of Media" name="dc:description" required="true" type="textarea">
<description>Examples include an abstract, table of <description>Examples include an abstract, table of
contents, or free-text account of the content of the contents, or free-text account of the content of the
resource.</description> resource.
</description>
</element> </element>
<element label="Publisher" name="dc:publisher" type="textfield"> <element label="Publisher" name="dc:publisher" type="textfield">
<description>An entity, (including persons, organizations, <description>An entity, (including persons, organizations,
or services), responsible for making the resource or services), responsible for making the resource
available.</description> available.
</description>
</element> </element>
<element label="Contributor" name="dc:contributor" type="textfield"> <element label="Contributor" name="dc:contributor" type="textfield">
<description>An entity responsible for contributing to the <description>An entity responsible for contributing to the
content of the resource such as a person, organization or content of the resource such as a person, organization or
service.</description> service.
</description>
</element> </element>
<element label="Date" name="dc:date" type="textfield"> <element label="Date" name="dc:date" type="textfield">
<description>Temporal scope of the content if known. Date <description>Temporal scope of the content if known. Date
format is YYYY-MM-DD (e.g. 1890,1910-10,or format is YYYY-MM-DD (e.g. 1890,1910-10,or
2007-10-23)</description> 2007-10-23)
</description>
</element> </element>
<element label="Resource Type" name="dc:type" type="select"> <element label="Resource Type" name="dc:type" type="select">
<description>Genre of the content of the resource. Examples <description>Genre of the content of the resource. Examples
include: home page, novel, poem, working paper, technical include: home page, novel, poem, working paper, technical
report, essay, dictionary.</description> report, essay, dictionary.
</description>
<authoritative_list> <authoritative_list>
<item>none</item> <item>none</item>
<item>video</item> <item>video</item>
@ -108,16 +115,19 @@
</element> </element>
<element label="Source" name="dc:source" type="textfield"> <element label="Source" name="dc:source" type="textfield">
<description>A reference to a resource from which the <description>A reference to a resource from which the
present resource is derived.</description> present resource is derived.
</description>
</element> </element>
<element label="Identifier" name="dc:identifier" type="textfield"> <element label="Identifier" name="dc:identifier" type="textfield">
<description>A unique reference to the resource; In this <description>A unique reference to the resource; In this
instance, the accession number or collection instance, the accession number or collection
number.</description> number.
</description>
</element> </element>
<element label="Language" name="dc:language" type="select"> <element label="Language" name="dc:language" type="select">
<description>The language of the intellectual content of <description>The language of the intellectual content of
the resource.</description> the resource.
</description>
<authoritative_list> <authoritative_list>
<item field="eng">English</item> <item field="eng">English</item>
<item field="fre">French</item> <item field="fre">French</item>
@ -129,7 +139,8 @@
<element label="Rights Management" name="dc:rights" type="textarea"> <element label="Rights Management" name="dc:rights" type="textarea">
<description>Information about intellectual property <description>Information about intellectual property
rights, copyright, and various property rights, copyright, and various property
rights.</description> rights.
</description>
</element> </element>
</form_elements> </form_elements>
</ingest_form> </ingest_form>

1
content_models/STRICT_PDFCM.xml

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

15
content_models/ilives_tei2htmlSdep-pageCModel.xml

@ -197,8 +197,11 @@
<xsl:attribute name="class">search persName</xsl:attribute> <xsl:attribute name="class">search persName</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute>
<xsl:attribute <xsl:attribute
name="href">http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22<xsl:value-of name="href">http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22
select=".//tei:surname"/>+<xsl:value-of select=".//tei:forename"/>%22+AND+dc.type:collection</xsl:attribute> <xsl:value-of
select=".//tei:surname"/>+
<xsl:value-of select=".//tei:forename"/>%22+AND+dc.type:collection
</xsl:attribute>
<xsl:apply-templates select="*|node()"/> <xsl:apply-templates select="*|node()"/>
</a> </a>
</span> </span>
@ -213,7 +216,9 @@
<xsl:attribute name="class">search placeName</xsl:attribute> <xsl:attribute name="class">search placeName</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute>
<xsl:attribute <xsl:attribute
name="href">http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22<xsl:value-of select="normalize-space(.)"/>%22+AND+dc.type:collection</xsl:attribute> name="href">http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22
<xsl:value-of select="normalize-space(.)"/>%22+AND+dc.type:collection
</xsl:attribute>
<xsl:value-of select="normalize-space(.)"/> <xsl:value-of select="normalize-space(.)"/>
</a> </a>
</xsl:template> </xsl:template>
@ -222,7 +227,9 @@
<xsl:attribute name="class">search orgName</xsl:attribute> <xsl:attribute name="class">search orgName</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute>
<xsl:attribute <xsl:attribute
name="href">http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22<xsl:value-of select="normalize-space(.)"/>%22+AND+dc.type:collection</xsl:attribute> name="href">http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22
<xsl:value-of select="normalize-space(.)"/>%22+AND+dc.type:collection
</xsl:attribute>
<xsl:value-of select="normalize-space(.)"/> <xsl:value-of select="normalize-space(.)"/>
</a> </a>
</xsl:template> </xsl:template>

294
content_models/islandora_jp2Sdep-slideCModel.xml

@ -3,123 +3,123 @@
xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties> <foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/> <foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="islandora:jp2Sdep-slideCModel"/> <foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="islandora:jp2Sdep-slideCModel"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/> <foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2009-11-27T18:25:48.654Z"/> <foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2009-11-27T18:25:48.654Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-03-11T20:58:05.234Z"/> <foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-03-11T20:58:05.234Z"/>
</foxml:objectProperties> </foxml:objectProperties>
<foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false"> <foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2009-11-27T18:25:48.654Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit"> <foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2009-11-27T18:25:48.654Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit">
<foxml:xmlContent> <foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#"> <audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1"> <audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action> <audit:action>ingest</audit:action>
<audit:componentID></audit:componentID> <audit:componentID></audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-11-27T18:25:48.654Z</audit:date> <audit:date>2009-11-27T18:25:48.654Z</audit:date>
<audit:justification>Created with Admin GUI &quot;New Object&quot; command</audit:justification> <audit:justification>Created with Admin GUI &quot;New Object&quot; command</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC2"> <audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>METHODMAP</audit:componentID> <audit:componentID>METHODMAP</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-11-27T18:30:03.064Z</audit:date> <audit:date>2009-11-27T18:30:03.064Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC3"> <audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>DSINPUTSPEC</audit:componentID> <audit:componentID>DSINPUTSPEC</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-11-27T18:30:34.272Z</audit:date> <audit:date>2009-11-27T18:30:34.272Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC4"> <audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>WSDL</audit:componentID> <audit:componentID>WSDL</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-11-27T18:31:33.967Z</audit:date> <audit:date>2009-11-27T18:31:33.967Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC5"> <audit:record ID="AUDREC5">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>RELS-EXT</audit:componentID> <audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-11-27T18:36:14.648Z</audit:date> <audit:date>2009-11-27T18:36:14.648Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC6"> <audit:record ID="AUDREC6">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action> <audit:action>ingest</audit:action>
<audit:componentID></audit:componentID> <audit:componentID></audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-01-26T20:06:07.452Z</audit:date> <audit:date>2010-01-26T20:06:07.452Z</audit:date>
<audit:justification>Ingested from local file /Users/aoneill/Desktop/tmp/islandora_jp2Sdep-slideCModel.xml</audit:justification> <audit:justification>Ingested from local file /Users/aoneill/Desktop/tmp/islandora_jp2Sdep-slideCModel.xml</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC7"> <audit:record ID="AUDREC7">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>RELS-EXT</audit:componentID> <audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-03-05T16:47:23.192Z</audit:date> <audit:date>2010-03-05T16:47:23.192Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC8"> <audit:record ID="AUDREC8">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>RELS-EXT</audit:componentID> <audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-03-11T20:58:05.234Z</audit:date> <audit:date>2010-03-11T20:58:05.234Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
</audit:auditTrail> </audit:auditTrail>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="RELS-EXT1.0" LABEL="RDF Statements about this object" CREATED="2009-11-27T18:25:48.726Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="618"> <foxml:datastreamVersion ID="RELS-EXT1.0" LABEL="RDF Statements about this object" CREATED="2009-11-27T18:25:48.726Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="618">
<foxml:xmlContent> <foxml:xmlContent>
<rdf:RDF xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:jp2Sdep-slideCModel"> <rdf:Description rdf:about="info:fedora/islandora:jp2Sdep-slideCModel">
<fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"></fedora-model:hasModel> <fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"></fedora-model:hasModel>
<fedora-model:isDeploymentOf rdf:resource="info:fedora/changeme-to-sDefPid"></fedora-model:isDeploymentOf> <fedora-model:isDeploymentOf rdf:resource="info:fedora/changeme-to-sDefPid"></fedora-model:isDeploymentOf>
<fedora-model:isContractorOf rdf:resource="info:fedora/changeme-to-cModelPid"></fedora-model:isContractorOf> <fedora-model:isContractorOf rdf:resource="info:fedora/changeme-to-cModelPid"></fedora-model:isContractorOf>
</rdf:Description> </rdf:Description>
</rdf:RDF> </rdf:RDF>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="RELS-EXT.1" LABEL="RDF Statements about this object" CREATED="2009-11-27T18:36:14.648Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="612"> <foxml:datastreamVersion ID="RELS-EXT.1" LABEL="RDF Statements about this object" CREATED="2009-11-27T18:36:14.648Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="612">
<foxml:xmlContent> <foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:jp2Sdep-slideCModel"> <rdf:Description rdf:about="info:fedora/islandora:jp2Sdep-slideCModel">
<hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"></hasModel> <hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"></hasModel>
<isDeploymentOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/ilives:jp2Sdef"></isDeploymentOf> <isDeploymentOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/ilives:jp2Sdef"></isDeploymentOf>
<isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:slideCModel"></isContractorOf> <isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:slideCModel"></isContractorOf>
</rdf:Description> </rdf:Description>
</rdf:RDF> </rdf:RDF>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="RELS-EXT.2" LABEL="RDF Statements about this object" CREATED="2010-03-05T16:47:23.192Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="695"> <foxml:datastreamVersion ID="RELS-EXT.2" LABEL="RDF Statements about this object" CREATED="2010-03-05T16:47:23.192Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="695">
<foxml:xmlContent> <foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:jp2Sdep-slideCModel"> <rdf:Description rdf:about="info:fedora/islandora:jp2Sdep-slideCModel">
<hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"></hasModel> <hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"></hasModel>
<isDeploymentOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/ilives:jp2Sdef"></isDeploymentOf> <isDeploymentOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/ilives:jp2Sdef"></isDeploymentOf>
<isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:slideCModel"></isContractorOf> <isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:slideCModel"></isContractorOf>
<isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:herbCModel"></isContractorOf> <isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:herbCModel"></isContractorOf>
</rdf:Description> </rdf:Description>
</rdf:RDF> </rdf:RDF>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="RELS-EXT.3" LABEL="RDF Statements about this object" CREATED="2010-03-11T20:58:05.234Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="825"> <foxml:datastreamVersion ID="RELS-EXT.3" LABEL="RDF Statements about this object" CREATED="2010-03-11T20:58:05.234Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="825">
<foxml:xmlContent> <foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:jp2Sdep-slideCModel"> <rdf:Description rdf:about="info:fedora/islandora:jp2Sdep-slideCModel">
<hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"></hasModel> <hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"></hasModel>
<isDeploymentOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/ilives:jp2Sdef"></isDeploymentOf> <isDeploymentOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/ilives:jp2Sdef"></isDeploymentOf>
@ -127,23 +127,23 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
<isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:herbCModel"></isContractorOf> <isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:herbCModel"></isContractorOf>
<isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:mapCModel"></isContractorOf> <isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:mapCModel"></isContractorOf>
</rdf:Description> </rdf:Description>
</rdf:RDF> </rdf:RDF>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="METHODMAP" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="METHODMAP" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="METHODMAP1.0" LABEL="Deployment Method Map" CREATED="2009-11-27T18:25:48.726Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" SIZE="298"> <foxml:datastreamVersion ID="METHODMAP1.0" LABEL="Deployment Method Map" CREATED="2009-11-27T18:25:48.726Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" SIZE="298">
<foxml:xmlContent> <foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#"> <comment xmlns="info:fedora/fedora-system:def/comment#">
This METHODMAP datastream is included as a starting point to This METHODMAP datastream is included as a starting point to
assist in the creation of a service deployment. The METHODMAP assist in the creation of a service deployment. The METHODMAP
should define the the mapping of the WSDL to Fedora object methods. should define the the mapping of the WSDL to Fedora object methods.
</comment> </comment>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="METHODMAP.1" LABEL="Deployment Method Map" CREATED="2009-11-27T18:30:03.064Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" SIZE="2498"> <foxml:datastreamVersion ID="METHODMAP.1" LABEL="Deployment Method Map" CREATED="2009-11-27T18:30:03.064Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" SIZE="2498">
<foxml:xmlContent> <foxml:xmlContent>
<fmm:MethodMap xmlns:fmm="http://fedora.comm.nsdlib.org/service/methodmap" bDefPID="djatoka:bDef" name="MethodMap - djatoka Service Methods"> <fmm:MethodMap xmlns:fmm="http://fedora.comm.nsdlib.org/service/methodmap" bDefPID="djatoka:bDef" name="MethodMap - djatoka Service Methods">
<fmm:Method operationName="getMetadata" wsdlMsgName="getMetadataRequest" wsdlMsgOutput="response"> <fmm:Method operationName="getMetadata" wsdlMsgName="getMetadataRequest" wsdlMsgOutput="response">
<fmm:DefaultInputParm defaultValue="$PID" label="fedora object pid" parmName="PID" passBy="VALUE" required="true"></fmm:DefaultInputParm> <fmm:DefaultInputParm defaultValue="$PID" label="fedora object pid" parmName="PID" passBy="VALUE" required="true"></fmm:DefaultInputParm>
<fmm:DefaultInputParm defaultValue="JP2" label="content model" parmName="DSID" passBy="VALUE" required="true"></fmm:DefaultInputParm> <fmm:DefaultInputParm defaultValue="JP2" label="content model" parmName="DSID" passBy="VALUE" required="true"></fmm:DefaultInputParm>
@ -165,35 +165,35 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
<fmm:MethodReturnType wsdlMsgName="response" wsdlMsgTOMIME="image/jpeg"></fmm:MethodReturnType> <fmm:MethodReturnType wsdlMsgName="response" wsdlMsgTOMIME="image/jpeg"></fmm:MethodReturnType>
</fmm:Method> </fmm:Method>
</fmm:MethodMap> </fmm:MethodMap>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="DSINPUTSPEC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="DSINPUTSPEC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="DSINPUTSPEC1.0" LABEL="Datastream Input Specification" CREATED="2009-11-27T18:25:48.726Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1" SIZE="300"> <foxml:datastreamVersion ID="DSINPUTSPEC1.0" LABEL="Datastream Input Specification" CREATED="2009-11-27T18:25:48.726Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1" SIZE="300">
<foxml:xmlContent> <foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#"> <comment xmlns="info:fedora/fedora-system:def/comment#">
This DSINPUTSPEC datastream is included as a starting point to This DSINPUTSPEC datastream is included as a starting point to
assist in the creation of a service deployment. The DSINPUTSPEC assist in the creation of a service deployment. The DSINPUTSPEC
should define the datastreams to be used by WSDL-defined methods. should define the datastreams to be used by WSDL-defined methods.
</comment> </comment>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="DSINPUTSPEC.1" LABEL="Datastream Input Specification" CREATED="2009-11-27T18:30:34.272Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1" SIZE="401"> <foxml:datastreamVersion ID="DSINPUTSPEC.1" LABEL="Datastream Input Specification" CREATED="2009-11-27T18:30:34.272Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1" SIZE="401">
<foxml:xmlContent> <foxml:xmlContent>
<fbs:DSInputSpec xmlns:fbs="http://fedora.comm.nsdlib.org/service/bindspec" label="jp2SdepInputSpec"> <fbs:DSInputSpec xmlns:fbs="http://fedora.comm.nsdlib.org/service/bindspec" label="jp2SdepInputSpec">
<fbs:DSInput DSMax="1" DSMin="1" DSOrdinality="false" wsdlMsgPartName="DC"> <fbs:DSInput DSMax="1" DSMin="1" DSOrdinality="false" wsdlMsgPartName="DC">
<fbs:DSInputLabel>DC</fbs:DSInputLabel> <fbs:DSInputLabel>DC</fbs:DSInputLabel>
<fbs:DSMIME>text/xml</fbs:DSMIME> <fbs:DSMIME>text/xml</fbs:DSMIME>
<fbs:DSInputInstruction></fbs:DSInputInstruction> <fbs:DSInputInstruction></fbs:DSInputInstruction>
</fbs:DSInput> </fbs:DSInput>
</fbs:DSInputSpec> </fbs:DSInputSpec>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="WSDL" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="WSDL" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="WSDL1.0" LABEL="WSDL Bindings" CREATED="2009-11-27T18:25:48.732Z" MIMETYPE="text/xml" FORMAT_URI="http://schemas.xmlsoap.org/wsdl/" SIZE="752"> <foxml:datastreamVersion ID="WSDL1.0" LABEL="WSDL Bindings" CREATED="2009-11-27T18:25:48.732Z" MIMETYPE="text/xml" FORMAT_URI="http://schemas.xmlsoap.org/wsdl/" SIZE="752">
<foxml:xmlContent> <foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#"> <comment xmlns="info:fedora/fedora-system:def/comment#">
This WSDL datastream is included as a starting point to This WSDL datastream is included as a starting point to
assist in the creation of a service deployment. The WSDL assist in the creation of a service deployment. The WSDL
should define the services provided by this should define the services provided by this
@ -206,11 +206,11 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
For more information about the demonstration objects, see: For more information about the demonstration objects, see:
http://fedora-commons.org/confluence/x/AwFI. http://fedora-commons.org/confluence/x/AwFI.
</comment> </comment>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="WSDL.1" LABEL="WSDL Bindings" CREATED="2009-11-27T18:31:33.967Z" MIMETYPE="text/xml" FORMAT_URI="http://schemas.xmlsoap.org/wsdl/" SIZE="3258"> <foxml:datastreamVersion ID="WSDL.1" LABEL="WSDL Bindings" CREATED="2009-11-27T18:31:33.967Z" MIMETYPE="text/xml" FORMAT_URI="http://schemas.xmlsoap.org/wsdl/" SIZE="3258">
<foxml:xmlContent> <foxml:xmlContent>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap" xmlns:soapenc="http://schemas.xmlsoap.org/wsdl/soap/encoding" xmlns:this="djatoka" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Fedora Local Djatoka Service" targetNamespace="jp2SDep"> <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap" xmlns:soapenc="http://schemas.xmlsoap.org/wsdl/soap/encoding" xmlns:this="djatoka" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Fedora Local Djatoka Service" targetNamespace="jp2SDep">
<wsdl:message name="getMetadataRequest"> <wsdl:message name="getMetadataRequest">
<wsdl:part name="PID" type="xsd:string"></wsdl:part> <wsdl:part name="PID" type="xsd:string"></wsdl:part>
<wsdl:part name="DSID" type="xsd:string"></wsdl:part> <wsdl:part name="DSID" type="xsd:string"></wsdl:part>
@ -261,17 +261,17 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
</wsdl:operation> </wsdl:operation>
</wsdl:binding> </wsdl:binding>
</wsdl:definitions> </wsdl:definitions>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2009-11-27T18:25:48.654Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="411"> <foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2009-11-27T18:25:48.654Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="411">
<foxml:xmlContent> <foxml:xmlContent>
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" 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"> <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" 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:jp2Sdep-slideCModel</dc:title> <dc:title>islandora:jp2Sdep-slideCModel</dc:title>
<dc:identifier>islandora:jp2Sdep-slideCModel</dc:identifier> <dc:identifier>islandora:jp2Sdep-slideCModel</dc:identifier>
</oai_dc:dc> </oai_dc:dc>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
</foxml:digitalObject> </foxml:digitalObject>

20
content_models/islandora_mods2htmlSdep.xml

@ -435,27 +435,35 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template name="attr"> <xsl:template name="attr">
<xsl:for-each select="@type|@point">:<xsl:call-template name="longName"> <xsl:for-each select="@type|@point">:
<xsl:call-template name="longName">
<xsl:with-param name="name"> <xsl:with-param name="name">
<xsl:value-of select="."/> <xsl:value-of select="."/>
</xsl:with-param> </xsl:with-param>
</xsl:call-template> </xsl:call-template>
</xsl:for-each> </xsl:for-each>
<xsl:if test="@authority or @edition"> <xsl:if test="@authority or @edition">
<xsl:for-each select="@authority">(<xsl:call-template name="longName"> <xsl:for-each select="@authority">(
<xsl:call-template name="longName">
<xsl:with-param name="name"> <xsl:with-param name="name">
<xsl:value-of select="."/> <xsl:value-of select="."/>
</xsl:with-param> </xsl:with-param>
</xsl:call-template> </xsl:call-template>
</xsl:for-each> </xsl:for-each>
<xsl:if test="@edition">Edition <xsl:value-of select="@edition"/> <xsl:if test="@edition">Edition
</xsl:if>)</xsl:if> <xsl:value-of select="@edition"/>
</xsl:if>)
</xsl:if>
<xsl:variable name="attrStr"> <xsl:variable name="attrStr">
<xsl:for-each select="@*[local-name()!='edition' and local-name()!='type' and local-name()!='authority' and local-name()!='point']"> <xsl:for-each select="@*[local-name()!='edition' and local-name()!='type' and local-name()!='authority' and local-name()!='point']">
<xsl:value-of select="local-name()"/>="<xsl:value-of select="."/>",</xsl:for-each> <xsl:value-of select="local-name()"/>="
<xsl:value-of select="."/>",
</xsl:for-each>
</xsl:variable> </xsl:variable>
<xsl:variable name="nattrStr" select="normalize-space($attrStr)"/> <xsl:variable name="nattrStr" select="normalize-space($attrStr)"/>
<xsl:if test="string-length($nattrStr)">(<xsl:value-of select="substring($nattrStr,1,string-length($nattrStr)-1)"/>)</xsl:if> <xsl:if test="string-length($nattrStr)">(
<xsl:value-of select="substring($nattrStr,1,string-length($nattrStr)-1)"/>)
</xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
</foxml:xmlContent> </foxml:xmlContent>

71
content_models/islandora_qtCModel.xml

@ -3,27 +3,27 @@
xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties> <foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/> <foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Generic Content Model for Fedora Attach"/> <foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Generic Content Model for Fedora Attach"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/> <foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2010-01-26T21:29:20.416Z"/> <foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2010-01-26T21:29:20.416Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-03-11T21:01:44.921Z"/> <foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-03-11T21:01:44.921Z"/>
</foxml:objectProperties> </foxml:objectProperties>
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2010-01-26T21:29:20.416Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="396"> <foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2010-01-26T21:29:20.416Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="396">
<foxml:xmlContent> <foxml:xmlContent>
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" 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"> <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" 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>Quicktime Content Model</dc:title> <dc:title>Quicktime Content Model</dc:title>
<dc:identifier>islandora:qtCModel</dc:identifier> <dc:identifier>islandora:qtCModel</dc:identifier>
</oai_dc:dc> </oai_dc:dc>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="ISLANDORACM" CONTROL_GROUP="X" STATE="A" > <foxml:datastream ID="ISLANDORACM" CONTROL_GROUP="X" STATE="A" >
<foxml:datastreamVersion ID="ISLANDORACM.0" MIMETYPE="application/xml" LABEL="ISLANDORACM.0"> <foxml:datastreamVersion ID="ISLANDORACM.0" MIMETYPE="application/xml" LABEL="ISLANDORACM.0">
<foxml:xmlContent> <foxml:xmlContent>
<content_model xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="standard_qt" xsi:schemaLocation="http://www.islandora.ca http://localhost/islandoracm.xsd"> <content_model xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="standard_qt" xsi:schemaLocation="http://www.islandora.ca http://localhost/islandoracm.xsd">
<mimetypes> <mimetypes>
<type>video/quicktime</type> <type>video/quicktime</type>
<type>video/mp4</type> <type>video/mp4</type>
@ -76,12 +76,14 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
<element label="Creator/" name="dc:creator" type="textfield"> <element label="Creator/" name="dc:creator" type="textfield">
<description>An entity primarily responsible for making the <description>An entity primarily responsible for making the
content of the resource such as a person, organization or content of the resource such as a person, organization or
service.</description> service.
</description>
</element> </element>
<element label="Subject" name="dc:subject" type="select"> <element label="Subject" name="dc:subject" type="select">
<description>An entity primarily responsible for making the <description>An entity primarily responsible for making the
content of the resource such as a person, organization or content of the resource such as a person, organization or
service.</description> service.
</description>
<authoritative_list> <authoritative_list>
<item>home recording</item> <item>home recording</item>
<item>meeting</item> <item>meeting</item>
@ -92,27 +94,32 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
<element label="Description of Media" name="dc:description" required="true" type="textarea"> <element label="Description of Media" name="dc:description" required="true" type="textarea">
<description>Examples include an abstract, table of <description>Examples include an abstract, table of
contents, or free-text account of the content of the contents, or free-text account of the content of the
resource.</description> resource.
</description>
</element> </element>
<element label="Publisher" name="dc:publisher" type="textfield"> <element label="Publisher" name="dc:publisher" type="textfield">
<description>An entity, (including persons, organizations, <description>An entity, (including persons, organizations,
or services), responsible for making the resource or services), responsible for making the resource
available.</description> available.
</description>
</element> </element>
<element label="Contributor" name="dc:contributor" type="textfield"> <element label="Contributor" name="dc:contributor" type="textfield">
<description>An entity responsible for contributing to the <description>An entity responsible for contributing to the
content of the resource such as a person, organization or content of the resource such as a person, organization or
service.</description> service.
</description>
</element> </element>
<element label="Date" name="dc:date" type="textfield"> <element label="Date" name="dc:date" type="textfield">
<description>Temporal scope of the content if known. Date <description>Temporal scope of the content if known. Date
format is YYYY-MM-DD (e.g. 1890,1910-10,or format is YYYY-MM-DD (e.g. 1890,1910-10,or
2007-10-23)</description> 2007-10-23)
</description>
</element> </element>
<element label="Resource Type" name="dc:type" type="select"> <element label="Resource Type" name="dc:type" type="select">
<description>Genre of the content of the resource. Examples <description>Genre of the content of the resource. Examples
include: home page, novel, poem, working paper, technical include: home page, novel, poem, working paper, technical
report, essay, dictionary.</description> report, essay, dictionary.
</description>
<authoritative_list> <authoritative_list>
<item>none</item> <item>none</item>
<item>video</item> <item>video</item>
@ -131,16 +138,19 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
</element> </element>
<element label="Source" name="dc:source" type="textfield"> <element label="Source" name="dc:source" type="textfield">
<description>A reference to a resource from which the <description>A reference to a resource from which the
present resource is derived.</description> present resource is derived.
</description>
</element> </element>
<element label="Identifier" name="dc:identifier" type="textfield"> <element label="Identifier" name="dc:identifier" type="textfield">
<description>A unique reference to the resource; In this <description>A unique reference to the resource; In this
instance, the accession number or collection instance, the accession number or collection
number.</description> number.
</description>
</element> </element>
<element label="Language" name="dc:language" type="select"> <element label="Language" name="dc:language" type="select">
<description>The language of the intellectual content of <description>The language of the intellectual content of
the resource.</description> the resource.
</description>
<authoritative_list> <authoritative_list>
<item field="eng">English</item> <item field="eng">English</item>
<item field="fre">French</item> <item field="fre">French</item>
@ -152,12 +162,13 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
<element label="Rights Management" name="dc:rights" type="textarea"> <element label="Rights Management" name="dc:rights" type="textarea">
<description>Information about intellectual property <description>Information about intellectual property
rights, copyright, and various property rights, copyright, and various property
rights.</description> rights.
</description>
</element> </element>
</form_elements> </form_elements>
</ingest_form> </ingest_form>
</content_model> </content_model>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
</foxml:digitalObject> </foxml:digitalObject>

154
example_collection_views/MHL-sparqltoHtml.xsl

@ -15,87 +15,147 @@
<xsl:variable name="end" select="($start - 1) + number($size)"/> <xsl:variable name="end" select="($start - 1) + number($size)"/>
<xsl:variable name="cellsPerRow" select="4"/> <xsl:variable name="cellsPerRow" select="4"/>
<xsl:variable name="count" select="count(sparql/results/result)"/> <xsl:variable name="count" select="count(sparql/results/result)"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table cellpadding="3" cellspacing="3"> <table cellpadding="3" cellspacing="3">
<tr><td colspan="{$cellsPerRow}"> <tr>
<td colspan="{$cellsPerRow}">
<div align="center"> <div align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> <br clear="all" /> </div>
</td></tr> <br clear="all" />
</td>
</tr>
<xsl:apply-templates select="sparql/results"/> <xsl:apply-templates select="sparql/results"/>
</table><br clear="all" /> </table>
<div align="center"> <br clear="all" />
<div align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -103,7 +163,7 @@
</xsl:choose> </xsl:choose>
</div> </div>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="sparql/results"> <xsl:template match="sparql/results">
<xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]"> <xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]">
<tr> <tr>
@ -124,30 +184,44 @@
<xsl:variable name="linkUrl"> <xsl:variable name="linkUrl">
<xsl:choose> <xsl:choose>
<xsl:when test="(content='Collection' or content='Community')"> <xsl:when test="(content='Collection' or content='Community')">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/<xsl:value-of select="title"/>/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/
<xsl:value-of select="title"/>/
<xsl:value-of select="title"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<td valign="top" width="25%"> <td valign="top" width="25%">
<a> <a>
<xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> <xsl:attribute name="href">
<xsl:value-of select="$linkUrl"/>
</xsl:attribute> </xsl:attribute>
<img> <img>
<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:value-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
</img> </a> <br clear="all" /> </img>
</a>
<br clear="all" />
<a> <a>
<xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> <xsl:attribute name="href">
<xsl:value-of select="$linkUrl"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="$newTitle"/> <xsl:value-of select="$newTitle"/>
</a> </a>
<xsl:if test="(content!='Collection' and content!='Community')"> <xsl:if test="(content!='Collection' and content!='Community')">
<br />--<a> <br />--
<a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
DETAILS DETAILS
</a>-- </a>--

95
example_collection_views/critter.xsl

@ -5,29 +5,92 @@
<xsl:template match="/"> <xsl:template match="/">
<ul> <ul>
<li><b>Date Collected:</b><xsl:text> </xsl:text> <xsl:value-of select="/critters:sample/critters:date_collected"/></li> <li>
<li><b>Type:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:type"/></li> <b>Date Collected:</b>
<li><b>Phylum:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:taxonomy/critters:phylum"/></li> <xsl:text> </xsl:text>
<li><b>SubPhylum:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:taxonomy/critters:SubPhylum"/></li> <xsl:value-of select="/critters:sample/critters:date_collected"/>
<li><b>Class:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:taxonomy/critters:class"/></li> </li>
<li><b>Order:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:taxonomy/critters:order"/></li> <li>
<li><b>Family:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:taxonomy/critters:family"/></li> <b>Type:</b>
<li><b>Genus:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:taxonomy/critters:genus"/></li> <xsl:text> </xsl:text>
<li><b>Species:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:taxonomy/critters:species"/></li> <xsl:value-of select="/critters:sample/critters:type"/>
</li>
<li>
<b>Phylum:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:taxonomy/critters:phylum"/>
</li>
<li>
<b>SubPhylum:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:taxonomy/critters:SubPhylum"/>
</li>
<li>
<b>Class:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:taxonomy/critters:class"/>
</li>
<li>
<b>Order:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:taxonomy/critters:order"/>
</li>
<li>
<b>Family:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:taxonomy/critters:family"/>
</li>
<li>
<b>Genus:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:taxonomy/critters:genus"/>
</li>
<li>
<b>Species:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:taxonomy/critters:species"/>
</li>
</ul> </ul>
<h4>Collection Location</h4> <h4>Collection Location</h4>
<ul> <ul>
<li><b>Site Name:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:site/critters:sitename"/></li> <li>
<li><b>Country:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:site/critters:country"/></li> <b>Site Name:</b>
<li><b>Region:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:site/critters:region"/></li> <xsl:text> </xsl:text>
<li><b>Latitude:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:site/critters:latitude"/></li> <xsl:value-of select="/critters:sample/critters:site/critters:sitename"/>
<li><b>Longitude:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:site/critters:longitude"/></li> </li>
<li><b>Depth:</b> <xsl:text> </xsl:text><xsl:value-of select="/critters:sample/critters:site/critters:depth"/><xsl:text> </xsl:text>Feet</li> <li>
<b>Country:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:site/critters:country"/>
</li>
<li>
<b>Region:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:site/critters:region"/>
</li>
<li>
<b>Latitude:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:site/critters:latitude"/>
</li>
<li>
<b>Longitude:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:site/critters:longitude"/>
</li>
<li>
<b>Depth:</b>
<xsl:text> </xsl:text>
<xsl:value-of select="/critters:sample/critters:site/critters:depth"/>
<xsl:text> </xsl:text>Feet
</li>
</ul> </ul>
<h4>Description</h4> <h4>Description</h4>
<div><xsl:value-of select="/critters:sample/critters:description"/></div> <div>
<xsl:value-of select="/critters:sample/critters:description"/>
</div>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

151
example_collection_views/flv-sparqltoHtml.xsl

@ -15,51 +15,82 @@
<xsl:variable name="end" select="($start - 1) + number($size)"/> <xsl:variable name="end" select="($start - 1) + number($size)"/>
<xsl:variable name="cellsPerRow" select="4"/> <xsl:variable name="cellsPerRow" select="4"/>
<xsl:variable name="count" select="count(sparql/results/result)"/> <xsl:variable name="count" select="count(sparql/results/result)"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table cellpadding="3" cellspacing="3" width="90%"> <table cellpadding="3" cellspacing="3" width="90%">
<tr><td colspan="{$cellsPerRow}"> <tr>
<td colspan="{$cellsPerRow}">
<div STYLE="text-align: center;"> <div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> <br clear="all" /> </div>
</td></tr> <br clear="all" />
</td>
</tr>
<!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]"> <!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]">
<xsl:variable name='OBJECTURI' select="object/@uri"/> <xsl:variable name='OBJECTURI' select="object/@uri"/>
@ -80,41 +111,70 @@
</xsl:for-each>- </xsl:for-each>-
--> -->
<xsl:apply-templates select="sparql/results"/> <xsl:apply-templates select="sparql/results"/>
</table><br clear="all" /> </table>
<div STYLE="text-align: center;"> <br clear="all" />
<div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -122,7 +182,7 @@
</xsl:choose> </xsl:choose>
</div> </div>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="sparql/results"> <xsl:template match="sparql/results">
<xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]"> <xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]">
<tr> <tr>
@ -143,27 +203,40 @@
<xsl:variable name="linkUrl"> <xsl:variable name="linkUrl">
<xsl:choose> <xsl:choose>
<xsl:when test="(content='Collection' or content='Community')"> <xsl:when test="(content='Collection' or content='Community')">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/OBJ/
<xsl:value-of select="title"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<td valign="top" width="25%"> <td valign="top" width="25%">
<a> <a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
<img> <img>
<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:value-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="$newTitle"/> <xsl:attribute name="alt">
<xsl:value-of select="$newTitle"/>
</xsl:attribute> </xsl:attribute>
</img> </a> <br clear="all" /> </img>
</a>
<br clear="all" />
<a> <a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="$newTitle"/> <xsl:value-of select="$newTitle"/>
</a> </a>

147
example_collection_views/mlp-sparqltoHtml.xsl

@ -15,87 +15,147 @@
<xsl:variable name="end" select="($start - 1) + number($size)"/> <xsl:variable name="end" select="($start - 1) + number($size)"/>
<xsl:variable name="cellsPerRow" select="4"/> <xsl:variable name="cellsPerRow" select="4"/>
<xsl:variable name="count" select="count(sparql/results/result)"/> <xsl:variable name="count" select="count(sparql/results/result)"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table cellpadding="3" cellspacing="3"> <table cellpadding="3" cellspacing="3">
<tr><td colspan="{$cellsPerRow}"> <tr>
<td colspan="{$cellsPerRow}">
<div align="center"> <div align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> <br clear="all" /> </div>
</td></tr> <br clear="all" />
</td>
</tr>
<xsl:apply-templates select="sparql/results"/> <xsl:apply-templates select="sparql/results"/>
</table><br clear="all" /> </table>
<div align="center"> <br clear="all" />
<div align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -103,7 +163,7 @@
</xsl:choose> </xsl:choose>
</div> </div>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="sparql/results"> <xsl:template match="sparql/results">
<xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]"> <xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]">
<tr> <tr>
@ -124,27 +184,38 @@
<xsl:variable name="linkUrl"> <xsl:variable name="linkUrl">
<xsl:choose> <xsl:choose>
<xsl:when test="(content='Collection' or content='Community')"> <xsl:when test="(content='Collection' or content='Community')">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/<xsl:value-of select="title"/>/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/
<xsl:value-of select="title"/>/
<xsl:value-of select="title"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<td valign="top" width="25%"> <td valign="top" width="25%">
<img> <img>
<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:value-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
</img> <br clear="all" /> </img>
<br clear="all" />
<xsl:value-of select="$newTitle"/> <xsl:value-of select="$newTitle"/>
<xsl:if test="(content!='Collection' and content!='Community')"> <xsl:if test="(content!='Collection' and content!='Community')">
<br />--<a> <br />--
<a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
DETAILS DETAILS
</a>-- </a>--

174
example_collection_views/refworks.xsl

@ -6,27 +6,127 @@
<xsl:if test="/reference/jf"> <xsl:if test="/reference/jf">
<h2>General Information</h2> <h2>General Information</h2>
<table cellpadding="2" cellspacing="2"> <table cellpadding="2" cellspacing="2">
<tr><td ><strong>Periodical:</strong></td><td><xsl:value-of select="/reference/jf"/></td></tr> <tr>
<tr><td><strong>Abbreviation:</strong></td><td><xsl:value-of select="/reference/jo"/></td></tr> <td >
<tr><td><strong>Volume:</strong></td><td><xsl:value-of select="/reference/vo"/></td></tr> <strong>Periodical:</strong>
<tr><td><strong>Issue:</strong></td><td><xsl:value-of select="/reference/is"/></td></tr> </td>
<tr><td><strong>Publisher:</strong></td><td><xsl:value-of select="/reference/pb"/></td></tr> <td>
<tr><td><strong>Place of Publication:</strong></td><td><xsl:value-of select="/reference/pp"/></td></tr> <xsl:value-of select="/reference/jf"/>
<tr><td><strong>Edition:</strong></td><td><xsl:value-of select="/reference/ed"/></td></tr> </td>
<tr><td><strong>Year:</strong></td><td><xsl:value-of select="/reference/yr"/></td></tr> </tr>
<tr><td><strong>Date:</strong></td><td><xsl:value-of select="/reference/fd"/></td></tr> <tr>
<tr><td><strong>Start Page:</strong></td><td><xsl:value-of select="/reference/sp"/></td></tr> <td>
<tr><td><strong>Other Pages:</strong></td><td><xsl:value-of select="/reference/op"/></td></tr> <strong>Abbreviation:</strong>
<tr><td><strong>ISSN/ISBN:</strong></td><td><xsl:value-of select="/reference/sn"/></td></tr> </td>
<tr><td><strong>Language:</strong></td><td><xsl:value-of select="/reference/la"/></td></tr> <td>
<tr><td><strong>UL:</strong></td><td><xsl:value-of select="/reference/ul"/></td></tr> <xsl:value-of select="/reference/jo"/>
</td>
</tr>
<tr>
<td>
<strong>Volume:</strong>
</td>
<td>
<xsl:value-of select="/reference/vo"/>
</td>
</tr>
<tr>
<td>
<strong>Issue:</strong>
</td>
<td>
<xsl:value-of select="/reference/is"/>
</td>
</tr>
<tr>
<td>
<strong>Publisher:</strong>
</td>
<td>
<xsl:value-of select="/reference/pb"/>
</td>
</tr>
<tr>
<td>
<strong>Place of Publication:</strong>
</td>
<td>
<xsl:value-of select="/reference/pp"/>
</td>
</tr>
<tr>
<td>
<strong>Edition:</strong>
</td>
<td>
<xsl:value-of select="/reference/ed"/>
</td>
</tr>
<tr>
<td>
<strong>Year:</strong>
</td>
<td>
<xsl:value-of select="/reference/yr"/>
</td>
</tr>
<tr>
<td>
<strong>Date:</strong>
</td>
<td>
<xsl:value-of select="/reference/fd"/>
</td>
</tr>
<tr>
<td>
<strong>Start Page:</strong>
</td>
<td>
<xsl:value-of select="/reference/sp"/>
</td>
</tr>
<tr>
<td>
<strong>Other Pages:</strong>
</td>
<td>
<xsl:value-of select="/reference/op"/>
</td>
</tr>
<tr>
<td>
<strong>ISSN/ISBN:</strong>
</td>
<td>
<xsl:value-of select="/reference/sn"/>
</td>
</tr>
<tr>
<td>
<strong>Language:</strong>
</td>
<td>
<xsl:value-of select="/reference/la"/>
</td>
</tr>
<tr>
<td>
<strong>UL:</strong>
</td>
<td>
<xsl:value-of select="/reference/ul"/>
</td>
</tr>
</table> </table>
</xsl:if> </xsl:if>
<xsl:if test="/reference/t1"> <xsl:if test="/reference/t1">
<h2>Titles</h2> <h2>Titles</h2>
<ul> <ul>
<xsl:for-each select="/reference/t1"> <xsl:for-each select="/reference/t1">
<li><xsl:value-of select="."/></li> <li>
<xsl:value-of select="."/>
</li>
</xsl:for-each> </xsl:for-each>
</ul> </ul>
</xsl:if> </xsl:if>
@ -34,7 +134,9 @@
<ul> <ul>
<h3>Secondary Titles</h3> <h3>Secondary Titles</h3>
<xsl:for-each select="/reference/t2"> <xsl:for-each select="/reference/t2">
<li><xsl:value-of select="."/></li> <li>
<xsl:value-of select="."/>
</li>
</xsl:for-each> </xsl:for-each>
</ul> </ul>
</xsl:if> </xsl:if>
@ -42,7 +144,9 @@
<h2>Authors</h2> <h2>Authors</h2>
<ul> <ul>
<xsl:for-each select="/reference/a1"> <xsl:for-each select="/reference/a1">
<li><xsl:value-of select="."/></li> <li>
<xsl:value-of select="."/>
</li>
</xsl:for-each> </xsl:for-each>
</ul> </ul>
</xsl:if> </xsl:if>
@ -51,7 +155,9 @@
<ul> <ul>
<h3>Secondary Authors</h3> <h3>Secondary Authors</h3>
<xsl:for-each select="/reference/a2"> <xsl:for-each select="/reference/a2">
<li><xsl:value-of select="."/></li> <li>
<xsl:value-of select="."/>
</li>
</xsl:for-each> </xsl:for-each>
</ul> </ul>
</xsl:if> </xsl:if>
@ -59,34 +165,52 @@
<h2>Keywords</h2> <h2>Keywords</h2>
<ul> <ul>
<xsl:for-each select="/reference/k1"> <xsl:for-each select="/reference/k1">
<li><xsl:value-of select="."/></li> <li>
<xsl:value-of select="."/>
</li>
</xsl:for-each> </xsl:for-each>
</ul> </ul>
</xsl:if> </xsl:if>
<xsl:if test="/reference/ab"> <xsl:if test="/reference/ab">
<h2>Abstract</h2> <h2>Abstract</h2>
<xsl:for-each select="/reference/ab"> <xsl:for-each select="/reference/ab">
<div><xsl:value-of select="."/> </div> <div>
<xsl:value-of select="."/>
</div>
</xsl:for-each> </xsl:for-each>
</xsl:if> </xsl:if>
<xsl:if test="/reference/no"> <xsl:if test="/reference/no">
<h2>Notes</h2> <h2>Notes</h2>
<xsl:for-each select="/reference/no"> <xsl:for-each select="/reference/no">
<div><xsl:value-of select="."/> </div> <div>
<xsl:value-of select="."/>
</div>
</xsl:for-each> </xsl:for-each>
</xsl:if> </xsl:if>
<xsl:variable name="ISSN"> <xsl:variable name="ISSN">
<xsl:value-of select="/reference/sn"/> <xsl:value-of select="/reference/sn"/>
</xsl:variable> </xsl:variable>
<xsl:variable name="BASEURL"> <xsl:variable name="BASEURL">
http://articles.library.upei.ca:7888/godot/hold_tab.cgi?hold_tab_branch=PCU&amp;issn=<xsl:value-of select="/reference/sn/text()"/>&amp;date=<xsl:value-of select="/reference/yr/text()"/>&amp;volume=<xsl:value-of select="/reference/vo/text()"/>&amp;issue=<xsl:value-of select="/reference/is/text()"/>&amp;spage=<xsl:value-of select="/reference/sp/text()"/>&amp;atitle=<xsl:value-of select="/reference/t1"/>&amp;stitle=<xsl:value-of select="/reference/jf"/> http://articles.library.upei.ca:7888/godot/hold_tab.cgi?hold_tab_branch=PCU&amp;issn=
<xsl:value-of select="/reference/sn/text()"/>&amp;date=
<xsl:value-of select="/reference/yr/text()"/>&amp;volume=
<xsl:value-of select="/reference/vo/text()"/>&amp;issue=
<xsl:value-of select="/reference/is/text()"/>&amp;spage=
<xsl:value-of select="/reference/sp/text()"/>&amp;atitle=
<xsl:value-of select="/reference/t1"/>&amp;stitle=
<xsl:value-of select="/reference/jf"/>
</xsl:variable> </xsl:variable>
<br /> <br />
<xsl:if test="/reference/sn"> <xsl:if test="/reference/sn">
<div><a> <div>
<xsl:attribute name="href"><xsl:value-of select="$BASEURL"/></xsl:attribute> <a>
<xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute>
<img src="http://asin1.its.unb.ca:8000/muse/images/getit4.gif"/> </a></div> <img src="http://asin1.its.unb.ca:8000/muse/images/getit4.gif"/>
</a>
</div>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

156
example_collection_views/riri-sparqltoHtml.xsl

@ -15,51 +15,82 @@
<xsl:variable name="end" select="($start - 1) + number($size)"/> <xsl:variable name="end" select="($start - 1) + number($size)"/>
<xsl:variable name="cellsPerRow" select="4"/> <xsl:variable name="cellsPerRow" select="4"/>
<xsl:variable name="count" select="count(sparql/results/result)"/> <xsl:variable name="count" select="count(sparql/results/result)"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table cellpadding="3" cellspacing="3" width="90%"> <table cellpadding="3" cellspacing="3" width="90%">
<tr><td colspan="{$cellsPerRow}"> <tr>
<td colspan="{$cellsPerRow}">
<div STYLE="text-align: center;"> <div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> <br clear="all" /> </div>
</td></tr> <br clear="all" />
</td>
</tr>
<!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]"> <!--<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]">
<xsl:variable name='OBJECTURI' select="object/@uri"/> <xsl:variable name='OBJECTURI' select="object/@uri"/>
@ -80,41 +111,70 @@
</xsl:for-each>- </xsl:for-each>-
--> -->
<xsl:apply-templates select="sparql/results"/> <xsl:apply-templates select="sparql/results"/>
</table><br clear="all" /> </table>
<div STYLE="text-align: center;"> <br clear="all" />
<div STYLE="text-align: center;">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -122,7 +182,7 @@
</xsl:choose> </xsl:choose>
</div> </div>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="sparql/results"> <xsl:template match="sparql/results">
<xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]"> <xsl:for-each select="result[position() mod $cellsPerRow = 1 and position()>=$start and position() &lt;=$end]">
<tr> <tr>
@ -143,32 +203,46 @@
<xsl:variable name="linkUrl"> <xsl:variable name="linkUrl">
<xsl:choose> <xsl:choose>
<xsl:when test="(content='Collection' or content='Community')"> <xsl:when test="(content='Collection' or content='Community')">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="title"/>.pdf <!-- we know in riri that all OBJ streams are pdf so we can add the extension to tell browsers what it is--> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/OBJ/
<xsl:value-of select="title"/>.pdf <!-- we know in riri that all OBJ streams are pdf so we can add the extension to tell browsers what it is-->
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<td valign="top" width="25%"> <td valign="top" width="25%">
<a> <a>
<xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> <xsl:attribute name="href">
<xsl:value-of select="$linkUrl"/>
</xsl:attribute> </xsl:attribute>
<img> <img>
<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:value-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="$newTitle"/> <xsl:attribute name="alt">
<xsl:value-of select="$newTitle"/>
</xsl:attribute> </xsl:attribute>
</img> </a> <br clear="all" /> </img>
</a>
<br clear="all" />
<a> <a>
<xsl:attribute name="href"><xsl:value-of select="$linkUrl"/> <xsl:attribute name="href">
<xsl:value-of select="$linkUrl"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="$newTitle"/> <xsl:value-of select="$newTitle"/>
</a> </a>
<xsl:if test="(content!='Collection' and content!='Community')"> <xsl:if test="(content!='Collection' and content!='Community')">
<br />--<a> <br />--
<a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
DETAILS DETAILS
</a>-- </a>--

135
example_collection_views/sparqltoHtml.xsl

@ -15,52 +15,82 @@
<xsl:variable name="end" select="($start - 1) + number($size)"/> <xsl:variable name="end" select="($start - 1) + number($size)"/>
<xsl:variable name='columns' select="4"/> <xsl:variable name='columns' select="4"/>
<xsl:variable name="count" select="count(sparql/results/result)"/> <xsl:variable name="count" select="count(sparql/results/result)"/>
<xsl:template match="/"> <xsl:template match="/">
<xsl:if test="$count>0"> <xsl:if test="$count>0">
<table width='100%'> <table width='100%'>
<tr><td colspan="2"> <tr>
<td colspan="2">
<div align="center"> <div align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</div> </div>
</td></tr> </td>
</tr>
<!--select="//guestbook/entry[position()>=$start and $end>=position()]">--> <!--select="//guestbook/entry[position()>=$start and $end>=position()]">-->
<xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]"> <xsl:for-each select="/sparql/results/result[position()>=$start and position() &lt;=$end]">
<xsl:variable name='OBJECTURI' select="object/@uri"/> <xsl:variable name='OBJECTURI' select="object/@uri"/>
@ -68,52 +98,87 @@
<tr> <tr>
<td> <td>
<img> <img>
<xsl:attribute name="src"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:value-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:value-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
</img> </img>
</td><td> </td>
<td>
<a> <a>
<xsl:attribute name="href"><xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/-/<xsl:value-of select="title"/> <xsl:attribute name="href">
<xsl:value-of select="$BASEURL"/>/fedora/repository/
<xsl:copy-of select="$PID"/>/-/
<xsl:value-of select="title"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="title"/> <xsl:value-of select="title"/>
</a> </a>
</td></tr> </td>
</tr>
</xsl:for-each> </xsl:for-each>
</table> </table>
<div align="center"> <div align="center">
<xsl:choose> <xsl:choose>
<xsl:when test="$end >= $count and $start = 1"> <xsl:when test="$end >= $count and $start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
</xsl:when> </xsl:when>
<xsl:when test="$end >= $count"> <xsl:when test="$end >= $count">
<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$count"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a> </a>
</xsl:when> </xsl:when>
<xsl:when test="$start = 1"> <xsl:when test="$start = 1">
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$start"/>-<xsl:value-of select="$end"/> <xsl:value-of select="$start"/>-
of <xsl:value-of select="$count"/>&#160;<br /> <xsl:value-of select="$end"/>
of
<xsl:value-of select="$count"/>&#160;
<br />
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page - 1"/>
</xsl:attribute> </xsl:attribute>
&lt;&lt;Prev &lt;&lt;Prev
</a>&#160; </a>&#160;
<a> <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"/>/-/
<xsl:value-of select="$thisTitle"/>/
<xsl:value-of select="$page + 1"/>
</xsl:attribute> </xsl:attribute>
Next>> Next>>
</a> </a>
@ -121,5 +186,5 @@
</xsl:choose> </xsl:choose>
</div> </div>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

5
fedora_repository.install

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/** /**
* @file fedora_repository.install * @file fedora_repository.install
@ -59,7 +60,7 @@ function fedora_repository_requirements($phase) {
$requirements['fedora-repository']['value'] = t("Not available"); $requirements['fedora-repository']['value'] = t("Not available");
$requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR; $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.', $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')); array('@collection-settings' => $base_url . '/admin/settings/fedora_repository'));
} }
else { else {
$requirements['fedora-repository']['value'] = t("Available"); $requirements['fedora-repository']['value'] = t("Available");

97
fedora_repository.module

@ -1,6 +1,6 @@
<?php <?php
// $Id$
/* /*
* Created on Aug 10, 2007 * Created on Aug 10, 2007
@ -22,8 +22,6 @@ function fedora_repository_admin() {
return $adminForm->createAdminForm(); return $adminForm->createAdminForm();
} }
/** /**
* drupal hook * drupal hook
* calls the fedora_repositorys_admin form * calls the fedora_repositorys_admin form
@ -527,8 +525,8 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) {
$dsid = $form_state['values']['dsId']; $dsid = $form_state['values']['dsId'];
$dsLabel = $form_state['values']['dsLabel']; $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 $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot
if($indexOfDot !== FALSE){ if ($indexOfDot !== FALSE) {
$dsLabel = substr($dsLabel, 0, $indexOfDot); $dsLabel = substr($dsLabel, 0, $indexOfDot);
$dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.;
} }
@ -550,7 +548,6 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) {
$item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); $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) { function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) {
@ -727,7 +724,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
return ''; return '';
} }
if ($pid &!validPid($pid)) { if ($pid & !validPid($pid)) {
drupal_set_message(t("Invalid PID!"), 'error'); drupal_set_message(t("Invalid PID!"), 'error');
return ' '; return ' ';
@ -869,7 +866,7 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU
$item = new Fedora_Item($pid); $item = new Fedora_Item($pid);
if ($item !== false) { if ($item !== FALSE) {
echo $item->get_dissemination($servicePid, $serviceMethod); echo $item->get_dissemination($servicePid, $serviceMethod);
} }
@ -1180,7 +1177,6 @@ function fedora_repository_theme() {
'arguments' => array( 'arguments' => array(
'element' => NULL 'element' => NULL
), ),
'fedora_repository_solution_packs_list' => array( 'fedora_repository_solution_packs_list' => array(
'arguments' => array( 'arguments' => array(
'solution_packs' => NULL, 'solution_packs' => NULL,
@ -1454,16 +1450,15 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) {
} }
} }
function fedora_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) // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required)
$module_path = drupal_get_path('module', 'fedora_repository'); $module_path = drupal_get_path('module', 'fedora_repository');
return array ( return array(
'fedora_repository' => array( 'fedora_repository' => array(
'module' => 'fedora_repository', 'module' => 'fedora_repository',
'title' => 'Islandora Core', 'title' => 'Islandora Core',
'objects' => array ( 'objects' => array(
array ( array(
'pid' => 'islandora:collectionCModel', 'pid' => 'islandora:collectionCModel',
'label' => 'Islandora Collection Content Model', 'label' => 'Islandora Collection Content Model',
'dsid' => 'ISLANDORACM', 'dsid' => 'ISLANDORACM',
@ -1471,7 +1466,7 @@ function fedora_repository_required_fedora_objects() {
'dsversion' => 2, 'dsversion' => 2,
'cmodel' => 'fedora-system:ContentModel-3.0', 'cmodel' => 'fedora-system:ContentModel-3.0',
), ),
array ( array(
'pid' => 'islandora:strict_pdf', 'pid' => 'islandora:strict_pdf',
'label' => 'Islandora strict PDF content model', 'label' => 'Islandora strict PDF content model',
'dsid' => 'ISLANDORACM', 'dsid' => 'ISLANDORACM',
@ -1482,85 +1477,85 @@ function fedora_repository_required_fedora_objects() {
'pid' => 'islandora:top', 'pid' => 'islandora:top',
'label' => 'Islandora Top-level Collection', 'label' => 'Islandora Top-level Collection',
'cmodel' => 'islandora:collectionCModel', 'cmodel' => 'islandora:collectionCModel',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'COLLECTION_POLICY', 'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml",
), ),
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png",
'mimetype' => 'image/png', 'mimetype' => 'image/png',
), ),
), ),
), ),
array ( array(
'pid' => 'islandora:ContentModelCollection', 'pid' => 'islandora:ContentModelCollection',
'label' => 'Collection of installed content models', 'label' => 'Collection of installed content models',
'cmodel' => 'islandora:collectionCModel', 'cmodel' => 'islandora:collectionCModel',
'parent' => 'islandora:top', 'parent' => 'islandora:top',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'COLLECTION_VIEW', 'dsid' => 'COLLECTION_VIEW',
'datastream_file' => "$module_path/collection_views/simple_list_view.xml", 'datastream_file' => "$module_path/collection_views/simple_list_view.xml",
), ),
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/contentModel.jpg", 'datastream_file' => "$module_path/images/contentModel.jpg",
'mimetype' => 'image/jpeg', 'mimetype' => 'image/jpeg',
), ),
array ( array(
'dsid' => 'QUERY', 'dsid' => 'QUERY',
'datastream_file' => "$module_path/collection_views/cmodel_collection_query.txt", 'datastream_file' => "$module_path/collection_views/cmodel_collection_query.txt",
'mimetype' => 'text/plain', 'mimetype' => 'text/plain',
), ),
), ),
), ),
array ( array(
'pid' => 'islandora:demos', 'pid' => 'islandora:demos',
'label' => 'Islandora demos collection', 'label' => 'Islandora demos collection',
'cmodel' => 'islandora:collectionCModel', 'cmodel' => 'islandora:collectionCModel',
'parent' => 'islandora:top', 'parent' => 'islandora:top',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png",
'mimetype' => 'image/png', 'mimetype' => 'image/png',
), ),
array ( array(
'dsid' => 'COLLECTION_POLICY', 'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml",
), ),
), ),
), ),
array ( array(
'pid' => 'islandora:pdf_collection', 'pid' => 'islandora:pdf_collection',
'label' => 'Islandora Demo PDF Collection', 'label' => 'Islandora Demo PDF Collection',
'cmodel' => 'islandora:collectionCModel', 'cmodel' => 'islandora:collectionCModel',
'parent' => 'islandora:demos', 'parent' => 'islandora:demos',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/Crystal_Clear_mimetype_pdf.png", 'datastream_file' => "$module_path/images/Crystal_Clear_mimetype_pdf.png",
'mimetype' => 'image/png', 'mimetype' => 'image/png',
), ),
array ( array(
'dsid' => 'COLLECTION_POLICY', 'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/collection_policies/PDF-COLLECTION POLICY.xml", 'datastream_file' => "$module_path/collection_policies/PDF-COLLECTION POLICY.xml",
), ),
), ),
), ),
array ( array(
'pid' => 'demo:DualResImage', 'pid' => 'demo:DualResImage',
'foxml_file' => "$module_path/content_models/demo_DualResImage.xml", 'foxml_file' => "$module_path/content_models/demo_DualResImage.xml",
'datastreams' => array( 'datastreams' => array(
array ( array(
'dsid' => 'ISLANDORACM', 'dsid' => 'ISLANDORACM',
'datastream_file' => "$module_path/content_models/STANDARD JPG.xml", 'datastream_file' => "$module_path/content_models/STANDARD JPG.xml",
), ),
), ),
), ),
array ( array(
'pid' => 'demo:DualResImageCollection', 'pid' => 'demo:DualResImageCollection',
'foxml_file' => "$module_path/content_models/demo_DualResImageCollection.xml", 'foxml_file' => "$module_path/content_models/demo_DualResImageCollection.xml",
'datastreams' => array( 'datastreams' => array(
@ -1570,47 +1565,47 @@ function fedora_repository_required_fedora_objects() {
), ),
), ),
), ),
array ( array(
'pid' => 'demo:DualResolution', 'pid' => 'demo:DualResolution',
'foxml_file' => "$module_path/content_models/demo_DualResolution.xml", 'foxml_file' => "$module_path/content_models/demo_DualResolution.xml",
), ),
array ( array(
'pid' => 'demo:DualResImageImpl', 'pid' => 'demo:DualResImageImpl',
'foxml_file' => "$module_path/content_models/demo_DualResImageImpl.xml", 'foxml_file' => "$module_path/content_models/demo_DualResImageImpl.xml",
), ),
array ( array(
'pid' => 'demo:CollectionImpl', 'pid' => 'demo:CollectionImpl',
'foxml_file' => "$module_path/content_models/demo_CollectionImpl.xml", 'foxml_file' => "$module_path/content_models/demo_CollectionImpl.xml",
), ),
array ( array(
'pid' => 'demo:Collection', 'pid' => 'demo:Collection',
'foxml_file' => "$module_path/content_models/demo_Collection.xml", 'foxml_file' => "$module_path/content_models/demo_Collection.xml",
), ),
array ( array(
'pid' => 'islandora:demo_image_collection', 'pid' => 'islandora:demo_image_collection',
'label' => 'Demo Image Collection', 'label' => 'Demo Image Collection',
'cmodel' => 'demo:DualResImageCollection', 'cmodel' => 'demo:DualResImageCollection',
'parent' => 'islandora:demos', 'parent' => 'islandora:demos',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'COLLECTION_POLICY', 'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/collection_policies/JPG-COLLECTION POLICY.xml", 'datastream_file' => "$module_path/collection_policies/JPG-COLLECTION POLICY.xml",
), ),
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png",
'mimetype' => 'image/png', 'mimetype' => 'image/png',
), ),
array ( array(
'dsid' => 'COLLECTION_VIEW', 'dsid' => 'COLLECTION_VIEW',
'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml", 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml",
), ),
array ( array(
'dsid' => 'QUERY', 'dsid' => 'QUERY',
'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt", 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt",
'mimetype' => 'text/plain', 'mimetype' => 'text/plain',
), ),
array ( array(
'dsid' => 'DC', 'dsid' => 'DC',
'datastream_file' => "$module_path/collection_views/demo_image_collection_dc_record.xml", 'datastream_file' => "$module_path/collection_views/demo_image_collection_dc_record.xml",
), ),
@ -1964,7 +1959,6 @@ function fedora_repository_display_schema($file) {
return; return;
} }
function fedora_repository_batch_reingest_object($object, &$context) { 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_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); 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'])) { if (!empty($object['dsid']) && !empty($object['datastream_file'])) {
$datastreams = array ( $datastreams = array(
array ( array(
'dsid' => $object['dsid'], 'dsid' => $object['dsid'],
'datastream_file' => $object['datastream_file'], 'datastream_file' => $object['datastream_file'],
) )
@ -2011,7 +2005,7 @@ function fedora_repository_batch_reingest_object($object, &$context) {
if (!empty($object['parent'])) { if (!empty($object['parent'])) {
$new_item->add_relationship('isMemberOfCollection', $object['parent']); $new_item->add_relationship('isMemberOfCollection', $object['parent']);
} }
foreach($datastreams as $ds) { foreach ($datastreams as $ds) {
if ($ds['dsid'] == 'DC') { if ($ds['dsid'] == 'DC') {
$new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml'); $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; $return = NULL;
if (isset($item)) { if (isset($item)) {
$doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); $doc = simplexml_load_string($item->get_datastream_dissemination($dsid));
} elseif (isset($datastream_file)) { }
elseif (isset($datastream_file)) {
$doc = simplexml_load_file($datastream_file); $doc = simplexml_load_file($datastream_file);
} }
if (!empty($doc)) { if (!empty($doc)) {
$attrs = $doc->attributes(); $attrs = $doc->attributes();
foreach($attrs as $name => $value) { foreach ($attrs as $name => $value) {
if ($name == 'version') { if ($name == 'version') {
$return = (int) $value; $return = (int) $value;
break; break;
@ -2063,7 +2058,7 @@ function theme_fedora_repository_solution_packs_list($solution_packs) {
drupal_add_css(drupal_get_path('module', 'update') .'/update.css'); drupal_add_css(drupal_get_path('module', 'update') . '/update.css');
return $output; return $output;
} }

10
fedora_repository.solutionpacks.inc

@ -1,6 +1,5 @@
<?php <?php
/** /**
* Invokes a hook to any dependent modules asking them if their installations require * 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 * any fedora objects to be present. Modules implementing this hook should return an array
@ -87,7 +86,8 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
if (!$item->exists()) { if (!$item->exists()) {
$object_status = 'Missing'; $object_status = 'Missing';
$needs_install = TRUE; $needs_install = TRUE;
} else { }
else {
if (isset($object['dsid']) && isset($object['datastream_file']) && isset($object['dsversion'])) { if (isset($object['dsid']) && isset($object['datastream_file']) && isset($object['dsversion'])) {
$datastreams = array( $datastreams = array(
array( array(
@ -96,7 +96,8 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
'dsversion' => $object['dsversion'], 'dsversion' => $object['dsversion'],
), ),
); );
} elseif (!empty($object['datastreams'])) { }
elseif (!empty($object['datastreams'])) {
$datastreams = $object['datastreams']; $datastreams = $object['datastreams'];
} }
if (!empty($datastreams) && is_array($datastreams)) { if (!empty($datastreams) && is_array($datastreams)) {
@ -137,7 +138,8 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
); );
if (!$needs_install && !$needs_update) { 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.'); $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['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.');
} }
$form['submit'] = array( $form['submit'] = array(

7
formClass.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
/* /*
* Created on Jan 22, 2008 * Created on Jan 22, 2008
@ -577,7 +577,6 @@ class formClass {
if (!empty($newElements)) { if (!empty($newElements)) {
$available_dsids = array_merge($available_dsids, $newElements); $available_dsids = array_merge($available_dsids, $newElements);
} }
} }
} }
@ -641,8 +640,8 @@ class formClass {
if (!empty($unused_dsids)) { if (!empty($unused_dsids)) {
$dsidsForForm = array(); $dsidsForForm = array();
foreach ($unused_dsids as $dsid){ foreach ($unused_dsids as $dsid) {
$dsidsForForm[$dsid]=$dsid; $dsidsForForm[$dsid] = $dsid;
} }
$form['stream_id'] = array( $form['stream_id'] = array(
'#type' => 'select', '#type' => 'select',

6
form_elements/css/sticky.css

@ -1,8 +1,8 @@
input.sticky { input.sticky {
height: 18px; height: 18px;
padding-left: 15px; padding-left: 15px;
background: url(../images/pushpin.png) top left no-repeat; background: url(../images/pushpin.png) top left no-repeat;
filter:alpha(opacity=50); filter:alpha(opacity=50);
-moz-opacity:0.5; -moz-opacity:0.5;
-khtml-opacity:0.5; -khtml-opacity:0.5;

26
form_elements/css/ui-lightness/jquery-ui-1.8.4.custom.css vendored

@ -6,7 +6,7 @@
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Theming/API * http://docs.jquery.com/UI/Theming/API
*/ */
/* Layout helpers /* Layout helpers
----------------------------------*/ ----------------------------------*/
@ -51,7 +51,7 @@
* http://docs.jquery.com/UI/Theming/API * 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 * 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 /* Component containers
@ -300,7 +300,7 @@
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Resizable#theming * http://docs.jquery.com/UI/Resizable#theming
*/ */
.ui-resizable { position: relative;} .ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} .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-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
@ -319,7 +319,7 @@
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Selectable#theming * http://docs.jquery.com/UI/Selectable#theming
*/ */
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/* /*
* jQuery UI Accordion @VERSION * jQuery UI Accordion @VERSION
@ -329,7 +329,7 @@
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Accordion#theming * http://docs.jquery.com/UI/Accordion#theming
*/ */
/* IE/Win - Fix animation bug - #4615 */ /* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; } .ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
@ -347,7 +347,7 @@
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Autocomplete#theming * http://docs.jquery.com/UI/Autocomplete#theming
*/ */
.ui-autocomplete { position: absolute; cursor: default; } .ui-autocomplete { position: absolute; cursor: default; }
/* workarounds */ /* workarounds */
@ -361,7 +361,7 @@
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Menu#theming * http://docs.jquery.com/UI/Menu#theming
*/ */
.ui-menu { .ui-menu {
list-style:none; list-style:none;
padding: 2px; padding: 2px;
@ -400,7 +400,7 @@
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Button#theming * 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 { 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 */ .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 */ 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://jquery.org/license
* *
* http://docs.jquery.com/UI/Dialog#theming * http://docs.jquery.com/UI/Dialog#theming
*/ */
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } .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-titlebar { padding: .5em 1em .3em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } .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://jquery.org/license
* *
* http://docs.jquery.com/UI/Slider#theming * http://docs.jquery.com/UI/Slider#theming
*/ */
.ui-slider { position: relative; text-align: left; } .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-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 .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://jquery.org/license
* *
* http://docs.jquery.com/UI/Tabs#theming * 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 { 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 { 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 { 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://jquery.org/license
* *
* http://docs.jquery.com/UI/Datepicker#theming * http://docs.jquery.com/UI/Datepicker#theming
*/ */
.ui-datepicker { width: 17em; padding: .2em .2em 0; } .ui-datepicker { width: 17em; padding: .2em .2em 0; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.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, .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://jquery.org/license
* *
* http://docs.jquery.com/UI/Progressbar#theming * http://docs.jquery.com/UI/Progressbar#theming
*/ */
.ui-progressbar { height:2em; text-align: left; } .ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }

144
form_elements/includes/autocomplete.inc

@ -1,21 +1,21 @@
<?php <?php
// $Id$
function ife_autocomplete_person($string) { function ife_autocomplete_person($string) {
$string=trim(strtolower($string)); $string = trim(strtolower($string));
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('php', 'islandora_solr_search', 'Solr/Service'); module_load_include('php', 'islandora_solr_search', 'Solr/Service');
$host = variable_get('islandora_solr_search_block_host','localhost'); $host = variable_get('islandora_solr_search_block_host', 'localhost');
$port = variable_get('islandora_solr_search_block_port','8080'); $port = variable_get('islandora_solr_search_block_port', '8080');
$appName = variable_get('islandora_solr_search_block_app_name','solr'); $appName = variable_get('islandora_solr_search_block_app_name', 'solr');
$requestHandler = variable_get("islandora_solr_search_block_request_handler",t("standard")); $requestHandler = variable_get("islandora_solr_search_block_request_handler", t("standard"));
$solr = new Apache_Solr_Service($host, $port, '/'.$appName.'/'); $solr = new Apache_Solr_Service($host, $port, '/' . $appName . '/');
$string=$solr->escape($string); $string = $solr->escape($string);
$query = 'name_personal_t:'.$string.'* OR name_organization_t:'.$string.'* OR name_conference_t:'.$string.'*'; $query = 'name_personal_t:' . $string . '* OR name_organization_t:' . $string . '* OR name_conference_t:' . $string . '*';
$additionalParams = array( $additionalParams = array(
'facet' => 'false', 'facet' => 'false',
@ -23,19 +23,19 @@ function ife_autocomplete_person($string) {
); );
try { try {
$results = $solr->search($query, 0, 10,$additionalParams); $results = $solr->search($query, 0, 10, $additionalParams);
}catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(t('error searching ').$e->getMessage()); drupal_set_message(t('error searching ') . $e->getMessage());
} }
if(empty($results)){ if (empty($results)) {
drupal_set_message(t('Error searching solr index. Is the solr search block configured properly?'),'error'); drupal_set_message(t('Error searching solr index. Is the solr search block configured properly?'), 'error');
return ' '; return ' ';
} }
header('content-type: text/plain'); header('content-type: text/plain');
$matches = array(); $matches = array();
foreach($results->response->docs as $doc) { foreach ($results->response->docs as $doc) {
$item = new fedora_item($doc->id); $item = new fedora_item($doc->id);
@ -51,42 +51,47 @@ function ife_autocomplete_person($string) {
$nodeList = $xpath->evaluate('/mods:mods/mods:name'); $nodeList = $xpath->evaluate('/mods:mods/mods:name');
foreach ($nodeList as $node) { foreach ($nodeList as $node) {
$type=$node->getAttribute('type'); $type = $node->getAttribute('type');
$title=null; $title = NULL;
$name =null; $name = NULL;
$given=null; $given = NULL;
$family=null; $family = NULL;
$date = null; $date = NULL;
$nameParts = $node->getElementsByTagName('namePart'); $nameParts = $node->getElementsByTagName('namePart');
foreach ($nameParts as $part) { foreach ($nameParts as $part) {
switch ($part->getAttribute('type')) { switch ($part->getAttribute('type')) {
case 'given': $given = $part->nodeValue; break; case 'given': $given = $part->nodeValue;
case 'family': $family = $part->nodeValue; break; break;
case 'termsOfAddress': $title= $part->nodeValue; break; case 'family': $family = $part->nodeValue;
case 'date': $date = $part->nodeValue; break; break;
default: $name = $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)) { if ($name == NULL && isset($given) && isset($family)) {
$name = (isset($title)?$title.' ':'').$family.', '.$given; $name = (isset($title) ? $title . ' ' : '') . $family . ', ' . $given;
} }
$role =null; $role = NULL;
$roleTerm = $node->getElementsByTagName('roleTerm'); $roleTerm = $node->getElementsByTagName('roleTerm');
if ($roleTerm->length > 0) { if ($roleTerm->length > 0) {
$role=$roleTerm->item(0)->nodeValue; $role = $roleTerm->item(0)->nodeValue;
} }
if (strpos(strtolower($name),$string)!==FALSE) { if (strpos(strtolower($name), $string) !== FALSE) {
$display = $name; $display = $name;
$matches[json_encode(array('type'=>trim($type),'name'=>trim($name),'role'=>trim($role),'date'=>trim($date)))]= $display.' - '.$role.' '.$date; $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='') { function ife_autocomplete_marcrelator($collection, $string='') {
@ -97,30 +102,28 @@ function ife_autocomplete_marcrelator($collection, $string='') {
$collection = FALSE; $collection = FALSE;
} }
$string=ucfirst(trim($string)); $string = ucfirst(trim($string));
$dom = DOMDocument::load ( $moduleRoot .'/xml/relators.rdf' ); $dom = DOMDocument::load($moduleRoot . '/xml/relators.rdf');
$rootEl = $dom->getElementsByTagName('RDF'); $rootEl = $dom->getElementsByTagName('RDF');
if ($rootEl->length > 0) { if ($rootEl->length > 0) {
$rootEl=$rootEl->item(0); $rootEl = $rootEl->item(0);
$xpath = new DOMXPath($dom); $xpath = new DOMXPath($dom);
$xpath->registerNamespace ( 'skos' , $rootEl->getAttribute('xmlns:skos') ); $xpath->registerNamespace('skos', $rootEl->getAttribute('xmlns:skos'));
$xpath->registerNamespace ( 'rdf' , $rootEl->getAttribute('xmlns:rdf') ); $xpath->registerNamespace('rdf', $rootEl->getAttribute('xmlns:rdf'));
$result = $xpath->query('/rdf:RDF/rdf:Description[starts-with(skos:prefLabel, "'. $string .'")]'); $result = $xpath->query('/rdf:RDF/rdf:Description[starts-with(skos:prefLabel, "' . $string . '")]');
$terms = array(); $terms = array();
foreach ($result as $term) { foreach ($result as $term) {
$termVal =$term->getElementsByTagName('prefLabel')->item(0)->nodeValue; $termVal = $term->getElementsByTagName('prefLabel')->item(0)->nodeValue;
$termVal = preg_replace('/\s+/', ' ', $termVal); $termVal = preg_replace('/\s+/', ' ', $termVal);
$terms[$term->getElementsByTagName('notation')->item(0)->nodeValue]= $termVal; $terms[$term->getElementsByTagName('notation')->item(0)->nodeValue] = $termVal;
} }
echo drupal_json($terms); echo drupal_json($terms);
} }
} }
function ife_autocomplete_gacs($collection, $string='') { function ife_autocomplete_gacs($collection, $string='') {
@ -131,84 +134,80 @@ function ife_autocomplete_gacs($collection, $string='') {
$collection = FALSE; $collection = FALSE;
} }
$string=ucwords(trim($string)); $string = ucwords(trim($string));
$dom = DOMDocument::load ( $moduleRoot .'/xml/gacs.xml' ); $dom = DOMDocument::load($moduleRoot . '/xml/gacs.xml');
$rootEl = $dom->getElementsByTagName('codelist'); $rootEl = $dom->getElementsByTagName('codelist');
if ($rootEl->length > 0) { if ($rootEl->length > 0) {
$rootEl=$rootEl->item(0); $rootEl = $rootEl->item(0);
$xpath = new DOMXPath($dom); $xpath = new DOMXPath($dom);
$xpath->registerNamespace ( 'a' , $rootEl->getAttribute('xmlns') ); $xpath->registerNamespace('a', $rootEl->getAttribute('xmlns'));
$result = $xpath->query('/a:codelist/a:gacs/a:gac[starts-with(a:name, "'. $string .'")]'); $result = $xpath->query('/a:codelist/a:gacs/a:gac[starts-with(a:name, "' . $string . '")]');
$gacs = array(); $gacs = array();
foreach ($result as $gac) { foreach ($result as $gac) {
$gacs[$gac->getElementsByTagName('name')->item(0)->nodeValue]= $gac->getElementsByTagName('name')->item(0)->nodeValue; $gacs[$gac->getElementsByTagName('name')->item(0)->nodeValue] = $gac->getElementsByTagName('name')->item(0)->nodeValue;
} }
echo drupal_json($gacs); echo drupal_json($gacs);
} }
} }
function ife_autocomplete_language($collection, $string='') { function ife_autocomplete_language($collection, $string='') {
$moduleRoot=drupal_get_path('module', 'islandora_form_elements'); $moduleRoot = drupal_get_path('module', 'islandora_form_elements');
if ($string == '') { if ($string == '') {
$string = $collection; $string = $collection;
$collection = FALSE; $collection = FALSE;
} }
$string=ucwords(trim($string)); $string = ucwords(trim($string));
$dom = DOMDocument::load ( $moduleRoot .'/xml/languages.xml' ); $dom = DOMDocument::load($moduleRoot . '/xml/languages.xml');
$rootEl = $dom->getElementsByTagName('codelist'); $rootEl = $dom->getElementsByTagName('codelist');
if ($rootEl->length > 0) { if ($rootEl->length > 0) {
$rootEl=$rootEl->item(0); $rootEl = $rootEl->item(0);
$xpath = new DOMXPath($dom); $xpath = new DOMXPath($dom);
$xpath->registerNamespace ( 'a' , $rootEl->getAttribute('xmlns') ); $xpath->registerNamespace('a', $rootEl->getAttribute('xmlns'));
$result = $xpath->query('/a:codelist/a:languages/a:language[starts-with(a:name, "'. $string .'")]'); $result = $xpath->query('/a:codelist/a:languages/a:language[starts-with(a:name, "' . $string . '")]');
$languages = array(); $languages = array();
foreach ($result as $lang) { foreach ($result as $lang) {
$languages[$lang->getElementsByTagName('name')->item(0)->nodeValue]= $lang->getElementsByTagName('name')->item(0)->nodeValue; $languages[$lang->getElementsByTagName('name')->item(0)->nodeValue] = $lang->getElementsByTagName('name')->item(0)->nodeValue;
} }
echo drupal_json($languages); echo drupal_json($languages);
} }
} }
function ife_autocomplete($field, $collection, $string='') { function ife_autocomplete($field, $collection, $string='') {
if ($string == '') { if ($string == '') {
$string=$collection; $collection=FALSE; $string = $collection;
$collection = FALSE;
} }
module_load_include('php', 'islandora_solr_search', 'Solr/Service'); module_load_include('php', 'islandora_solr_search', 'Solr/Service');
$host = variable_get('islandora_solr_search_block_host', 'localhost'); $host = variable_get('islandora_solr_search_block_host', 'localhost');
$port = variable_get('islandora_solr_search_block_port', '8080'); $port = variable_get('islandora_solr_search_block_port', '8080');
$appName = variable_get('islandora_solr_search_block_app_name', 'solr'); $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( $additionalParams = array(
'fl' => $field 'fl' => $field
); );
$query = $field .':'. $solr->escape(strtolower(trim($string))) .'*'; $query = $field . ':' . $solr->escape(strtolower(trim($string))) . '*';
if ($collection != FALSE) { if ($collection != FALSE) {
$query .= ' AND related_item_identifier_t:'. $solr->escape($collection); $query .= ' AND related_item_identifier_t:' . $solr->escape($collection);
} }
try { try {
$results = $solr->search($query, 0, 10, $additionalParams); $results = $solr->search($query, 0, 10, $additionalParams);
} } catch (Exception $e) {
catch (Exception $e) {
drupal_set_message(t('error searching ') . $e->getMessage()); drupal_set_message(t('error searching ') . $e->getMessage());
} }
@ -216,16 +215,17 @@ function ife_autocomplete($field, $collection, $string='') {
$values = array(); $values = array();
if ($docs != NULL) { if ($docs != NULL) {
foreach ($docs as $doc) { foreach ($docs as $doc) {
$resfield=$doc->getField($field); $resfield = $doc->getField($field);
if (is_array($resfield['value'])) { if (is_array($resfield['value'])) {
foreach ($resfield['value'] as $val) { foreach ($resfield['value'] as $val) {
if (preg_match('/^'.strtolower($string).'/i',$val)) { if (preg_match('/^' . strtolower($string) . '/i', $val)) {
$values[$val]=$val; $values[$val] = $val;
}
} }
} }
} else { else {
$values[$resfield['value']]=$resfield['value']; $values[$resfield['value']] = $resfield['value'];
} }
} }
} }

115
form_elements/includes/creative_commons.inc

@ -1,6 +1,6 @@
<?php <?php
class CreativeCommons
{ class CreativeCommons {
public static $cc_jurisdiction_vals = array( public static $cc_jurisdiction_vals = array(
'' => 'International', '' => 'International',
@ -57,61 +57,60 @@
'scotland' => 'UK:Scotland', 'scotland' => 'UK:Scotland',
'us' => 'UnitedStates', 'us' => 'UnitedStates',
'vn' => 'Vietnam'); 'vn' => 'Vietnam');
public static $cc_versions = array( public static $cc_versions = array(
''=>'3.0', '' => '3.0',
'ar'=>'2.5', 'ar' => '2.5',
'au'=>'3.0', 'au' => '3.0',
'at'=>'3.0', 'at' => '3.0',
'be'=>'2.0', 'be' => '2.0',
'br'=>'3.0', 'br' => '3.0',
'bg'=>'2.5', 'bg' => '2.5',
'ca'=>'2.5', 'ca' => '2.5',
'cl'=>'2.0', 'cl' => '2.0',
'cn'=>'2.5', 'cn' => '2.5',
'co'=>'2.5', 'co' => '2.5',
'hr'=>'3.0', 'hr' => '3.0',
'cz'=>'3.0', 'cz' => '3.0',
'dk'=>'2.5', 'dk' => '2.5',
'ec'=>'3.0', 'ec' => '3.0',
'fi'=>'1.0', 'fi' => '1.0',
'fr'=>'2.0', 'fr' => '2.0',
'de'=>'3.0', 'de' => '3.0',
'gr'=>'3.0', 'gr' => '3.0',
'gt'=>'3.0', 'gt' => '3.0',
'hk'=>'3.0', 'hk' => '3.0',
'hu'=>'2.5', 'hu' => '2.5',
'in'=>'2.5', 'in' => '2.5',
'il'=>'2.5', 'il' => '2.5',
'it'=>'2.5', 'it' => '2.5',
'jp'=>'2.0', 'jp' => '2.0',
'kr'=>'2.0', 'kr' => '2.0',
'lu'=>'3.0', 'lu' => '3.0',
'mk'=>'2.5', 'mk' => '2.5',
'my'=>'2.5', 'my' => '2.5',
'mt'=>'2.5', 'mt' => '2.5',
'mx'=>'2.5', 'mx' => '2.5',
'nl'=>'3.0', 'nl' => '3.0',
'nz'=>'3.0', 'nz' => '3.0',
'no'=>'3.0', 'no' => '3.0',
'pe'=>'2.5', 'pe' => '2.5',
'ph'=>'3.0', 'ph' => '3.0',
'pl'=>'3.0', 'pl' => '3.0',
'pt'=>'2.5', 'pt' => '2.5',
'pr'=>'3.0', 'pr' => '3.0',
'ro'=>'3.0', 'ro' => '3.0',
'rs'=>'3.0', 'rs' => '3.0',
'sg'=>'3.0', 'sg' => '3.0',
'si'=>'2.5', 'si' => '2.5',
'za'=>'2.5', 'za' => '2.5',
'es'=>'3.0', 'es' => '3.0',
'se'=>'2.5', 'se' => '2.5',
'ch'=>'2.5', 'ch' => '2.5',
'tw'=>'3.0', 'tw' => '3.0',
'th'=>'3.0', 'th' => '3.0',
'uk'=>'2.0', 'uk' => '2.0',
'scotland'=>'2.5', 'scotland' => '2.5',
'us'=>'3.0', 'us' => '3.0',
'vn'=>'3.0'); 'vn' => '3.0');
} }

76
form_elements/includes/filechooser.inc

@ -1,38 +1,36 @@
<?php <?php
// $Id$
function theme_filechooser($element) { function theme_filechooser($element) {
global $base_url; global $base_url;
$path=drupal_get_path('module', 'islandora_form_elements'); $path = drupal_get_path('module', 'islandora_form_elements');
drupal_add_js($path .'/js/jcarousellite_1.0.1.js'); drupal_add_js($path . '/js/jcarousellite_1.0.1.js');
drupal_add_js($path .'/js/jquery.easing.1.1.js'); drupal_add_js($path . '/js/jquery.easing.1.1.js');
drupal_add_js($path .'/js/jquery.mousewheel.min.js'); drupal_add_js($path . '/js/jquery.mousewheel.min.js');
drupal_add_js($path .'/js/jquery.loadImages.1.0.1.js'); drupal_add_js($path . '/js/jquery.loadImages.1.0.1.js');
drupal_add_js($path .'/js/jquery.breakly-1.0.js'); drupal_add_js($path . '/js/jquery.breakly-1.0.js');
drupal_add_js($path .'/js/filechooser.js'); drupal_add_js($path . '/js/filechooser.js');
drupal_add_css($path .'/css/filechooser.css'); drupal_add_css($path . '/css/filechooser.css');
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
$contentModelPid = ContentModel::getPidFromIdentifier($element['#model_pid']); $contentModelPid = ContentModel::getPidFromIdentifier($element['#model_pid']);
$output='<div class="carousel"> $output = '<div class="carousel">
<div class="jCarouselLite"> <div class="jCarouselLite">
<ul id="fileList" class="clear-block"> <ul id="fileList" class="clear-block">
<li class="loading"><div>Generating File Previews...<br/>(this could take a minute or two.)<br/><img src="'.$base_url.'/'. $path .'/images/ajax-loader.gif" id="ajaxBusy" alt="Loading"/></div></li> <li class="loading"><div>Generating File Previews...<br/>(this could take a minute or two.)<br/><img src="' . $base_url . '/' . $path . '/images/ajax-loader.gif" id="ajaxBusy" alt="Loading"/></div></li>
</ul> </ul>
</div> </div>
<br clear="all"/> <br clear="all"/>
<a href="#" class="prev">Prev</a> <a href="#" class="next">Next</a> <a href="#" class="prev">Prev</a> <a href="#" class="next">Next</a>
<input type="hidden" id="model_pid" value="'. $contentModelPid .'"/> <input type="hidden" id="model_pid" value="' . $contentModelPid . '"/>
<input type="hidden" name="'. $element['#name'] .'" value="'. check_plain($element['#value']) .'" id="fileField"/></div>'; <input type="hidden" name="' . $element['#name'] . '" value="' . check_plain($element['#value']) . '" id="fileField"/></div>';
return theme('form_element', $element, $output); return theme('form_element', $element, $output);
} }
function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) { function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) {
module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
@ -42,12 +40,12 @@ function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) {
$cm = ContentModel::loadFromModel($cm_pid); $cm = ContentModel::loadFromModel($cm_pid);
$cp = CollectionPolicy::loadFromCollection($cp_pid); $cp = CollectionPolicy::loadFromCollection($cp_pid);
$path=$cp->getStagingArea() .'/'; $path = $cp->getStagingArea() . '/';
if ($cm !== FALSE && $cp !== FALSE) { if ($cm !== FALSE && $cp !== FALSE) {
if (is_file($path . $file)) { if (is_file($path . $file)) {
$mime=$mimeClass->getType($path . $file); $mime = $mimeClass->getType($path . $file);
$allowed_types = $cm->getMimetypes(); $allowed_types = $cm->getMimetypes();
@ -56,24 +54,22 @@ function ife_filechooser_get_thumbnail($cp_pid, $cm_pid, $file) {
$thumbnail = ''; $thumbnail = '';
//executes ingest rules with the "preview" parameter set. //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'])) { 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 = $_SESSION['fedora_ingest_files']['TN'];
} }
$thumbmime=$mimeClass->getType($thumbnail); $thumbmime = $mimeClass->getType($thumbnail);
header('Pragma: no-cache'); header('Pragma: no-cache');
header('Content-Type: '. $thumbmime); header('Content-Type: ' . $thumbmime);
echo file_get_contents($thumbnail); echo file_get_contents($thumbnail);
exit(); exit();
} }
} }
} }
} }
function ife_filechooser_cmp($a,$b)
{ function ife_filechooser_cmp($a, $b) {
return strcmp($a['name'],$b['name']); return strcmp($a['name'], $b['name']);
} }
function ife_filechooser_generate_thumbnails($cp_pid, $cm_pid) { function ife_filechooser_generate_thumbnails($cp_pid, $cm_pid) {
@ -85,45 +81,46 @@ function ife_filechooser_generate_thumbnails($cp_pid, $cm_pid) {
$cp = CollectionPolicy::loadFromCollection($cp_pid); $cp = CollectionPolicy::loadFromCollection($cp_pid);
if ($cm === FALSE || $cp === FALSE) { if ($cm === FALSE || $cp === FALSE) {
echo '[]'; exit(); echo '[]';
exit();
} }
$mimeClass = new MimeClass(); $mimeClass = new MimeClass();
$path=$cp->getStagingArea() .'/'; $path = $cp->getStagingArea() . '/';
$start=isset($_GET['start'])?intval($_GET['start']):0; $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
$end=isset($_GET['end'])?intval($_GET['end']):50; $end = isset($_GET['end']) ? intval($_GET['end']) : 50;
$thumbnails = array(); $thumbnails = array();
$files = array(); $files = array();
if ($cm !== FALSE && $cp !== FALSE) { if ($cm !== FALSE && $cp !== FALSE) {
$allowed_types = $cm->getMimetypes(); $allowed_types = $cm->getMimetypes();
if (file_exists($path) && is_dir($path)) { if (file_exists($path) && is_dir($path)) {
$dir = opendir($path); $dir = opendir($path);
for ($i=$start; $i < $end && ($file = readdir($dir)) !== FALSE;) { for ($i = $start; $i < $end && ($file = readdir($dir)) !== FALSE;) {
if (is_file($path . $file)) { if (is_file($path . $file)) {
$mime=$mimeClass->getType($path . $file); $mime = $mimeClass->getType($path . $file);
if (in_array($mime, $allowed_types)) { if (in_array($mime, $allowed_types)) {
$thumbnail = FALSE; $thumbnail = FALSE;
//executes ingest rules with the "preview" parameter set. //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'])) { 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 = $_SESSION['fedora_ingest_files']['TN'];
unset($_SESSION['fedora_ingest_files']['TN']); unset($_SESSION['fedora_ingest_files']['TN']);
} }
$res_array = getimagesize($path .'/'. $file); $res_array = getimagesize($path . '/' . $file);
$res = ''; $res = '';
if (is_array($res_array)) { if (is_array($res_array)) {
$res = $res_array[0] .'x'. $res_array[1]; $res = $res_array[0] . 'x' . $res_array[1];
} }
$size = filesize($path .'/'. $file); $size = filesize($path . '/' . $file);
$labels = array('kB', 'MB', 'GB', 'TB'); $labels = array('kB', 'MB', 'GB', 'TB');
$label = 'B'; $label = 'B';
while ($size > 1024) { while ($size > 1024) {
$size=$size/1024; $size = $size / 1024;
$label=array_shift($labels); $label = array_shift($labels);
} }
$size = round($size, 2) .' '. $label; $size = round($size, 2) . ' ' . $label;
$files[] = array('name' => $file, 'mime' => $mime, 'size' => $size, 'resolution' => $res, 'thumb' => ($thumbnail != FALSE)); $files[] = array('name' => $file, 'mime' => $mime, 'size' => $size, 'resolution' => $res, 'thumb' => ($thumbnail != FALSE));
$i++; $i++;
@ -132,7 +129,6 @@ function ife_filechooser_generate_thumbnails($cp_pid, $cm_pid) {
} }
} }
} }
usort($files,'ife_filechooser_cmp'); usort($files, 'ife_filechooser_cmp');
echo json_encode($files); echo json_encode($files);
} }

43
form_elements/includes/people.inc

@ -1,6 +1,5 @@
<?php <?php
// $Id$
// this is a bit of a hack. It iterates through the // this is a bit of a hack. It iterates through the
// form and assigns a dummy value to any field in the $post // form and assigns a dummy value to any field in the $post
@ -14,7 +13,7 @@ function _dummy_post_info($form, $post, $key = '') {
$post = _dummy_post_info($form[$key], $post, $key); $post = _dummy_post_info($form[$key], $post, $key);
} }
} }
if ($key!='' && isset($form['#required']) && $form['#required'] == TRUE && trim($post[$key]) == '') { if ($key != '' && isset($form['#required']) && $form['#required'] == TRUE && trim($post[$key]) == '') {
$post[$key] = 'not empty'; $post[$key] = 'not empty';
} }
@ -36,7 +35,6 @@ function _ife_find_people_element($form, &$keys = array()) {
} }
return FALSE; return FALSE;
} }
function ife_people_ahah() { function ife_people_ahah() {
@ -81,7 +79,7 @@ function ife_remove_person_submit($form, &$form_state) {
// Get the tab delta for the clicked button. // Get the tab delta for the clicked button.
$delta = $form_state['clicked_button']['#parents'][2]; $delta = $form_state['clicked_button']['#parents'][2];
$keys=array(); $keys = array();
$qt_form = _ife_find_people_element($form, $keys); $qt_form = _ife_find_people_element($form, $keys);
$peopleVals = &$form_state['values']; $peopleVals = &$form_state['values'];
@ -110,7 +108,6 @@ function ife_remove_person_submit($form, &$form_state) {
$form_state['rebuild'] = TRUE; $form_state['rebuild'] = TRUE;
} }
/** /**
* Submit handler for the "Add Person" button. * Submit handler for the "Add Person" button.
*/ */
@ -134,9 +131,9 @@ function ife_add_person_submit($form, &$form_state) {
} }
//only add new person if we are not adding from repository. //only add new person if we are not adding from repository.
$elName = isset($qt_form['entity0']['#parents'][0])?$qt_form['entity0']['#parents'][0]:null; $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']) == '') { 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' => ''); $people[] = array('name' => '', 'date' => '', 'role' => '', 'subject' => '');
} }
unset($form_state['submit_handlers']); unset($form_state['submit_handlers']);
form_execute_handlers('submit', $form, $form_state); form_execute_handlers('submit', $form, $form_state);
@ -144,8 +141,6 @@ function ife_add_person_submit($form, &$form_state) {
$form_state['rebuild'] = TRUE; $form_state['rebuild'] = TRUE;
} }
/** /**
* Submit handler for the "Add Person" button. * Submit handler for the "Add Person" button.
*/ */
@ -166,7 +161,7 @@ function ife_add_org_submit($form, &$form_state) {
$peopleVals['people'] = array(); $peopleVals['people'] = array();
foreach ($peopleVals['people'] as $val) { foreach ($peopleVals['people'] as $val) {
$people[]=$val; $people[] = $val;
} }
$people[] = array('role' => '', 'organization' => ''); $people[] = array('role' => '', 'organization' => '');
@ -176,20 +171,18 @@ function ife_add_org_submit($form, &$form_state) {
//$form_state['rebuild'] = TRUE; //$form_state['rebuild'] = TRUE;
} }
/** /**
* Submit handler for the "Add Person" button. * Submit handler for the "Add Person" button.
*/ */
function ife_add_conf_submit($form, &$form_state) { function ife_add_conf_submit($form, &$form_state) {
$people = array(); $people = array();
$keys=array(); $keys = array();
$qt_form = _ife_find_people_element($form, $keys); $qt_form = _ife_find_people_element($form, $keys);
$peopleVals = &$form_state['values']; $peopleVals = &$form_state['values'];
while (count($keys) > 0) { while (count($keys) > 0) {
$key = array_pop($keys); $key = array_pop($keys);
if (isset($peopleVals[$key])) { if (isset($peopleVals[$key])) {
$peopleVals=&$peopleVals[$key]; $peopleVals = &$peopleVals[$key];
} }
} }
if (!is_array($peopleVals['people'])) if (!is_array($peopleVals['people']))
@ -207,10 +200,8 @@ function ife_add_conf_submit($form, &$form_state) {
//$form_state['rebuild'] = TRUE; //$form_state['rebuild'] = TRUE;
} }
function theme_people($element) { function theme_people($element) {
drupal_add_js(drupal_get_path('module', 'islandora_form_elements') .'/js/people_ahah.js'); drupal_add_js(drupal_get_path('module', 'islandora_form_elements') . '/js/people_ahah.js');
if (!empty($element['#collapsible'])) { if (!empty($element['#collapsible'])) {
drupal_add_js('misc/collapse.js'); drupal_add_js('misc/collapse.js');
@ -223,10 +214,9 @@ function theme_people($element) {
$element['#attributes']['class'] .= ' collapsed'; $element['#attributes']['class'] .= ' collapsed';
} }
} }
return '<fieldset'. drupal_attributes($element['#attributes']) .'>'. ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . "</fieldset>\n"; return '<fieldset' . drupal_attributes($element['#attributes']) . '>' . ($element['#title'] ? '<legend>' . $element['#title'] . '</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">' . $element['#description'] . '</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . "</fieldset>\n";
} }
function theme_people_items($form) { function theme_people_items($form) {
$rows = array(); $rows = array();
$headers = array( $headers = array(
@ -242,7 +232,7 @@ function theme_people_items($form) {
$row = array( $row = array(
'data' => array( 'data' => array(
array('data' => drupal_render($form[$key]['organization']), 'class' => 'ife-person-name container-inline'), 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]['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]['remove']), 'class' => 'ife-person-remove'),
), ),
); );
@ -252,8 +242,8 @@ function theme_people_items($form) {
// Build the table row. // Build the table row.
$row = array( $row = array(
'data' => array( 'data' => array(
array('data' => drupal_render($form[$key]['conference']).'<br clear="all"/>'. drupal_render($form[$key]['date']), 'class' => 'ife-person-name container-inline' ), array('data' => drupal_render($form[$key]['conference']) . '<br clear="all"/>' . 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]['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]['remove']), 'class' => 'ife-person-remove'),
), ),
); );
@ -263,8 +253,8 @@ function theme_people_items($form) {
// Build the table row. // Build the table row.
$row = array( $row = array(
'data' => array( 'data' => array(
array('data' => drupal_render($form[$key]['name']) .'<br clear="all"/>'. drupal_render($form[$key]['date']), 'class' => 'ife-person-name container-inline'), array('data' => drupal_render($form[$key]['name']) . '<br clear="all"/>' . 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]['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]['remove']), 'class' => 'ife-person-remove'),
), ),
); );
@ -281,8 +271,7 @@ function theme_people_items($form) {
$output .= drupal_render($form); $output .= drupal_render($form);
// Add our JS file, which has some Drupal core JS overrides, and ensures ahah behaviours get re-attached // 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'); drupal_add_css(drupal_get_path('module', 'islandora_form_elements') . '/css/people.css');
return $output; return $output;
} }

534
form_elements/islandora_form_elements.module

File diff suppressed because it is too large Load Diff

56
form_elements/js/copyright.js

@ -1,6 +1,60 @@
$(document).ready(function () { $(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()
{ {

4
form_elements/js/filechooser.js

@ -27,7 +27,7 @@ $(document).ready(function () {
$('#fileList').append('<div>No files found in staging area.<div>'); $('#fileList').append('<div>No files found in staging area.<div>');
} else } else
{ {
$.each(data, function(i, item) $.each(data, function(i, item)
{ {
var html; var html;
@ -44,7 +44,7 @@ $(document).ready(function () {
{ {
html='<li id="file'+i+'"'+selected+'><img src="/filechooser/getThumbnail/'+cp_pid+'/'+cm_pid+'/'+item.name+'" class="thumbnail"><div style="width:150px">'+item.name+'<br>'+item.mime+'<br>'+item.size+'&nbsp;&nbsp;'+item.resolution+'</div></li>'; html='<li id="file'+i+'"'+selected+'><img src="/filechooser/getThumbnail/'+cp_pid+'/'+cm_pid+'/'+item.name+'" class="thumbnail"><div style="width:150px">'+item.name+'<br>'+item.mime+'<br>'+item.size+'&nbsp;&nbsp;'+item.resolution+'</div></li>';
} else } else
{ {
var type=item.mime.split('/',1).shift(); var type=item.mime.split('/',1).shift();
html='<li id="file'+i+'"'+selected+'><div class="'+type+'placeholder">&nbsp;</div><div class="breakly">'+item.name+'<br>'+item.mime+'<br>'+item.size+'</div></li>'; html='<li id="file'+i+'"'+selected+'><div class="'+type+'placeholder">&nbsp;</div><div class="breakly">'+item.name+'<br>'+item.mime+'<br>'+item.size+'</div></li>';
} }

47
form_elements/js/jcarousellite_1.0.1.js

@ -201,7 +201,7 @@
*/ */
(function($) { // Compliant with jquery.noConflict() (function($) { // Compliant with jquery.noConflict()
$.fn.jCarouselLite = function(o) { $.fn.jCarouselLite = function(o) {
o = $.extend({ o = $.extend({
btnPrev: null, btnPrev: null,
btnNext: null, btnNext: null,
@ -236,15 +236,32 @@ $.fn.jCarouselLite = function(o) {
var li = $("li", ul), itemLength = li.size(), curr = o.start; var li = $("li", ul), itemLength = li.size(), curr = o.start;
div.css("visibility", "visible"); div.css("visibility", "visible");
li.css({overflow: "hidden", float: o.vertical ? "none" : "left"}); li.css({
ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"}); overflow: "hidden",
div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"}); 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 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 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 divSize = liSize * v; // size of entire div(total length for just the visible items)
li.css({width: li.width(), height: li.height()}); li.css({
width: li.width(),
height: li.height()
});
ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize)); 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
@ -306,7 +323,11 @@ $.fn.jCarouselLite = function(o) {
running = true; running = true;
ul.animate( ul.animate(
animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing, animCss == "left" ? {
left: -(curr*liSize)
} : {
top: -(curr*liSize)
} , o.speed, o.easing,
function() { function() {
if(o.afterEnd) if(o.afterEnd)
o.afterEnd.call(this, vis()); o.afterEnd.call(this, vis());
@ -328,16 +349,16 @@ $.fn.jCarouselLite = function(o) {
return false; return false;
}; };
}); });
}; };
function css(el, prop) { function css(el, prop) {
return parseInt($.css(el[0], prop)) || 0; return parseInt($.css(el[0], prop)) || 0;
}; };
function width(el) { function width(el) {
return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
}; };
function height(el) { function height(el) {
return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
}; };
})(jQuery); })(jQuery);

39
form_elements/js/jquery.easing.1.1.js

@ -65,23 +65,44 @@ jQuery.easing = {
return jQuery.easing['bounceout'] (x, t*2-d,0, c, d) * .5 + c*.5 + b; return jQuery.easing['bounceout'] (x, t*2-d,0, c, d) * .5 + c*.5 + b;
}, },
elasin: function(x, t, b, c, d) { elasin: function(x, t, b, c, d) {
var s=1.70158;var p=0;var a=c; var s=1.70158;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; var p=0;
if (a < Math.abs(c)) { a=c; var s=p/4; } 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); 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; 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) { elasout: function(x, t, b, c, d) {
var s=1.70158;var p=0;var a=c; var s=1.70158;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; var p=0;
if (a < Math.abs(c)) { a=c; var s=p/4; } 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); 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; 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) { elasinout: function(x, t, b, c, d) {
var s=1.70158;var p=0;var a=c; var s=1.70158;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); var p=0;
if (a < Math.abs(c)) { a=c; var s=p/4; } 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); 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; 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; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;

17
form_elements/js/jquery.loadImages.1.0.1.min.js vendored

@ -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); (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);

46
form_elements/js/jquery.mousewheel.min.js vendored

@ -8,4 +8,48 @@
* *
* Requires: 1.2.2+ * 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); (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);

146
form_elements/js/jquery.tag.editor-min.js vendored

@ -5,4 +5,148 @@
@license: Creative Commons License - ShareAlike http://creativecommons.org/licenses/by-sa/3.0/ @license: Creative Commons License - ShareAlike http://creativecommons.org/licenses/by-sa/3.0/
@version: 1.4.1 @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('<img src="' + options.imageTagUrl + '">'); } 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); (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('<img src="' + options.imageTagUrl + '">');
}
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);

38
form_elements/js/jquery.ui.core.js vendored

@ -9,16 +9,16 @@
*/ */
(function( $, undefined ) { (function( $, undefined ) {
// prevent duplicate loading // prevent duplicate loading
// this is only a problem because we proxy existing functions // this is only a problem because we proxy existing functions
// and we don't want to double proxy them // and we don't want to double proxy them
$.ui = $.ui || {}; $.ui = $.ui || {};
if ( $.ui.version ) { if ( $.ui.version ) {
return; return;
} }
//Helper functions and ui object //Helper functions and ui object
$.extend( $.ui, { $.extend( $.ui, {
version: "1.8.4", version: "1.8.4",
// $.ui.plugin is deprecated. Use the proxy pattern instead. // $.ui.plugin is deprecated. Use the proxy pattern instead.
@ -117,10 +117,10 @@ $.extend( $.ui, {
UP: 38, UP: 38,
WINDOWS: 91 // COMMAND WINDOWS: 91 // COMMAND
} }
}); });
//jQuery plugins //jQuery plugins
$.fn.extend({ $.fn.extend({
_focus: $.fn.focus, _focus: $.fn.focus,
focus: function( delay, fn ) { focus: function( delay, fn ) {
return typeof delay === "number" ? return typeof delay === "number" ?
@ -191,9 +191,9 @@ $.fn.extend({
return 0; return 0;
} }
}); });
$.each( [ "Width", "Height" ], function( i, name ) { $.each( [ "Width", "Height" ], function( i, name ) {
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
type = name.toLowerCase(), type = name.toLowerCase(),
orig = { orig = {
@ -235,17 +235,17 @@ $.each( [ "Width", "Height" ], function( i, name ) {
$.style( this, type, reduce( this, size, true, margin ) + "px" ); $.style( this, type, reduce( this, size, true, margin ) + "px" );
}); });
}; };
}); });
//Additional selectors //Additional selectors
function visible( element ) { function visible( element ) {
return !$( element ).parents().andSelf().filter(function() { return !$( element ).parents().andSelf().filter(function() {
return $.curCSS( this, "visibility" ) === "hidden" || return $.curCSS( this, "visibility" ) === "hidden" ||
$.expr.filters.hidden( this ); $.expr.filters.hidden( this );
}).length; }).length;
} }
$.extend( $.expr[ ":" ], { $.extend( $.expr[ ":" ], {
data: function( elem, i, match ) { data: function( elem, i, match ) {
return !!$.data( elem, match[ 3 ] ); return !!$.data( elem, match[ 3 ] );
}, },
@ -276,6 +276,6 @@ $.extend( $.expr[ ":" ], {
var tabIndex = $.attr( element, "tabindex" ); var tabIndex = $.attr( element, "tabindex" );
return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" ); return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" );
} }
}); });
})( jQuery ); })( jQuery );

223
form_elements/js/jquery.ui.datepicker.js vendored

@ -12,17 +12,21 @@
*/ */
(function( $, undefined ) { (function( $, undefined ) {
$.extend($.ui, { datepicker: { version: "1.8.4" } }); $.extend($.ui, {
datepicker: {
version: "1.8.4"
}
});
var PROP_NAME = 'datepicker'; var PROP_NAME = 'datepicker';
var dpuuid = new Date().getTime(); 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. 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, Settings for (groups of) date pickers are maintained in an instance object,
allowing multiple different settings on the same page. */ allowing multiple different settings on the same page. */
function Datepicker() { function Datepicker() {
this.debug = false; // Change this to true to start debugging this.debug = false; // Change this to true to start debugging
this._curInst = null; // The current instance in use this._curInst = null; // The current instance in use
this._keyEvent = false; // If the last event was a key event this._keyEvent = false; // If the last event was a key event
@ -108,9 +112,9 @@ function Datepicker() {
}; };
$.extend(this._defaults, this.regional['']); $.extend(this._defaults, this.regional['']);
this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>'); this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');
} }
$.extend(Datepicker.prototype, { $.extend(Datepicker.prototype, {
/* Class name added to elements to indicate already configured with a date picker. */ /* Class name added to elements to indicate already configured with a date picker. */
markerClassName: 'hasDatepicker', markerClassName: 'hasDatepicker',
@ -168,12 +172,18 @@ $.extend(Datepicker.prototype, {
/* Create a new instance object. */ /* Create a new instance object. */
_newInst: function(target, inline) { _newInst: function(target, inline) {
var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\$1'); // escape jQuery meta chars var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\$1'); // escape jQuery meta chars
return {id: id, input: target, // associated target return {
selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection id: id,
drawMonth: 0, drawYear: 0, // month being drawn 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 inline: inline, // is datepicker inline or not
dpDiv: (!inline ? this.dpDiv : // presentation div dpDiv: (!inline ? this.dpDiv : // presentation div
$('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}; $('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))
};
}, },
/* Attach the date picker to an input field. */ /* Attach the date picker to an input field. */
@ -216,10 +226,18 @@ $.extend(Datepicker.prototype, {
var buttonImage = this._get(inst, 'buttonImage'); var buttonImage = this._get(inst, 'buttonImage');
inst.trigger = $(this._get(inst, 'buttonImageOnly') ? inst.trigger = $(this._get(inst, 'buttonImageOnly') ?
$('<img/>').addClass(this._triggerClass). $('<img/>').addClass(this._triggerClass).
attr({ src: buttonImage, alt: buttonText, title: buttonText }) : attr({
src: buttonImage,
alt: buttonText,
title: buttonText
}) :
$('<button type="button"></button>').addClass(this._triggerClass). $('<button type="button"></button>').addClass(this._triggerClass).
html(buttonImage == '' ? buttonText : $('<img/>').attr( html(buttonImage == '' ? buttonText : $('<img/>').attr(
{ src:buttonImage, alt:buttonText, title:buttonText }))); {
src:buttonImage,
alt:buttonText,
title:buttonText
})));
input[isRTL ? 'before' : 'after'](inst.trigger); input[isRTL ? 'before' : 'after'](inst.trigger);
inst.trigger.click(function() { inst.trigger.click(function() {
if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])
@ -356,15 +374,22 @@ $.extend(Datepicker.prototype, {
if (nodeName == 'input') { if (nodeName == 'input') {
target.disabled = false; target.disabled = false;
inst.trigger.filter('button'). inst.trigger.filter('button').
each(function() { this.disabled = false; }).end(). each(function() {
filter('img').css({opacity: '1.0', cursor: ''}); this.disabled = false;
}).end().
filter('img').css({
opacity: '1.0',
cursor: ''
});
} }
else if (nodeName == 'div' || nodeName == 'span') { else if (nodeName == 'div' || nodeName == 'span') {
var inline = $target.children('.' + this._inlineClass); var inline = $target.children('.' + this._inlineClass);
inline.children().removeClass('ui-state-disabled'); inline.children().removeClass('ui-state-disabled');
} }
this._disabledInputs = $.map(this._disabledInputs, this._disabledInputs = $.map(this._disabledInputs,
function(value) { return (value == target ? null : value); }); // delete entry function(value) {
return (value == target ? null : value);
}); // delete entry
}, },
/* Disable the date picker to a jQuery selection. /* Disable the date picker to a jQuery selection.
@ -379,15 +404,22 @@ $.extend(Datepicker.prototype, {
if (nodeName == 'input') { if (nodeName == 'input') {
target.disabled = true; target.disabled = true;
inst.trigger.filter('button'). inst.trigger.filter('button').
each(function() { this.disabled = true; }).end(). each(function() {
filter('img').css({opacity: '0.5', cursor: 'default'}); this.disabled = true;
}).end().
filter('img').css({
opacity: '0.5',
cursor: 'default'
});
} }
else if (nodeName == 'div' || nodeName == 'span') { else if (nodeName == 'div' || nodeName == 'span') {
var inline = $target.children('.' + this._inlineClass); var inline = $target.children('.' + this._inlineClass);
inline.children().addClass('ui-state-disabled'); inline.children().addClass('ui-state-disabled');
} }
this._disabledInputs = $.map(this._disabledInputs, this._disabledInputs = $.map(this._disabledInputs,
function(value) { return (value == target ? null : value); }); // delete entry function(value) {
return (value == target ? null : value);
}); // delete entry
this._disabledInputs[this._disabledInputs.length] = target; this._disabledInputs[this._disabledInputs.length] = target;
}, },
@ -496,10 +528,12 @@ $.extend(Datepicker.prototype, {
inst._keyEvent = true; inst._keyEvent = true;
if ($.datepicker._datepickerShowing) if ($.datepicker._datepickerShowing)
switch (event.keyCode) { switch (event.keyCode) {
case 9: $.datepicker._hideDatepicker(); case 9:
$.datepicker._hideDatepicker();
handled = false; handled = false;
break; // hide on tab out break; // hide on tab out
case 13: var sel = $('td.' + $.datepicker._dayOverClass, inst.dpDiv). case 13:
var sel = $('td.' + $.datepicker._dayOverClass, inst.dpDiv).
add($('td.' + $.datepicker._currentClass, inst.dpDiv)); add($('td.' + $.datepicker._currentClass, inst.dpDiv));
if (sel[0]) if (sel[0])
$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
@ -507,23 +541,29 @@ $.extend(Datepicker.prototype, {
$.datepicker._hideDatepicker(); $.datepicker._hideDatepicker();
return false; // don't submit the form return false; // don't submit the form
break; // select the value on enter break; // select the value on enter
case 27: $.datepicker._hideDatepicker(); case 27:
$.datepicker._hideDatepicker();
break; // hide on escape break; // hide on escape
case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? case 33:
$.datepicker._adjustDate(event.target, (event.ctrlKey ?
-$.datepicker._get(inst, 'stepBigMonths') : -$.datepicker._get(inst, 'stepBigMonths') :
-$.datepicker._get(inst, 'stepMonths')), 'M'); -$.datepicker._get(inst, 'stepMonths')), 'M');
break; // previous month/year on page up/+ ctrl break; // previous month/year on page up/+ ctrl
case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? case 34:
$.datepicker._adjustDate(event.target, (event.ctrlKey ?
+$.datepicker._get(inst, 'stepBigMonths') : +$.datepicker._get(inst, 'stepBigMonths') :
+$.datepicker._get(inst, 'stepMonths')), 'M'); +$.datepicker._get(inst, 'stepMonths')), 'M');
break; // next month/year on page down/+ ctrl break; // next month/year on page down/+ ctrl
case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); case 35:
if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);
handled = event.ctrlKey || event.metaKey; handled = event.ctrlKey || event.metaKey;
break; // clear on ctrl or command +end break; // clear on ctrl or command +end
case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); case 36:
if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);
handled = event.ctrlKey || event.metaKey; handled = event.ctrlKey || event.metaKey;
break; // current on ctrl or command +home break; // current on ctrl or command +home
case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); case 37:
if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
handled = event.ctrlKey || event.metaKey; handled = event.ctrlKey || event.metaKey;
// -1 day on ctrl or command +left // -1 day on ctrl or command +left
if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
@ -531,10 +571,12 @@ $.extend(Datepicker.prototype, {
-$.datepicker._get(inst, 'stepMonths')), 'M'); -$.datepicker._get(inst, 'stepMonths')), 'M');
// next month/year on alt +left on Mac // next month/year on alt +left on Mac
break; break;
case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); case 38:
if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');
handled = event.ctrlKey || event.metaKey; handled = event.ctrlKey || event.metaKey;
break; // -1 week on ctrl or command +up break; // -1 week on ctrl or command +up
case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); case 39:
if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
handled = event.ctrlKey || event.metaKey; handled = event.ctrlKey || event.metaKey;
// +1 day on ctrl or command +right // +1 day on ctrl or command +right
if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
@ -542,10 +584,12 @@ $.extend(Datepicker.prototype, {
+$.datepicker._get(inst, 'stepMonths')), 'M'); +$.datepicker._get(inst, 'stepMonths')), 'M');
// next month/year on alt +right // next month/year on alt +right
break; break;
case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); case 40:
if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');
handled = event.ctrlKey || event.metaKey; handled = event.ctrlKey || event.metaKey;
break; // +1 week on ctrl or command +down break; // +1 week on ctrl or command +down
default: handled = false; default:
handled = false;
} }
else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home
$.datepicker._showDatepicker(this); $.datepicker._showDatepicker(this);
@ -622,17 +666,28 @@ $.extend(Datepicker.prototype, {
$.datepicker._pos[0] -= document.documentElement.scrollLeft; $.datepicker._pos[0] -= document.documentElement.scrollLeft;
$.datepicker._pos[1] -= document.documentElement.scrollTop; $.datepicker._pos[1] -= document.documentElement.scrollTop;
} }
var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; var offset = {
left: $.datepicker._pos[0],
top: $.datepicker._pos[1]
};
$.datepicker._pos = null; $.datepicker._pos = null;
// determine sizing offscreen // determine sizing offscreen
inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); inst.dpDiv.css({
position: 'absolute',
display: 'block',
top: '-1000px'
});
$.datepicker._updateDatepicker(inst); $.datepicker._updateDatepicker(inst);
// fix width for dynamic number of date pickers // fix width for dynamic number of date pickers
// and adjust position before showing // and adjust position before showing
offset = $.datepicker._checkOffset(inst, offset, isFixed); offset = $.datepicker._checkOffset(inst, offset, isFixed);
inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? inst.dpDiv.css({
'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', position: ($.datepicker._inDialog && $.blockUI ?
left: offset.left + 'px', top: offset.top + 'px'}); 'static' : (isFixed ? 'fixed' : 'absolute')),
display: 'none',
left: offset.left + 'px',
top: offset.top + 'px'
});
if (!inst.inline) { if (!inst.inline) {
var showAnim = $.datepicker._get(inst, 'showAnim'); var showAnim = $.datepicker._get(inst, 'showAnim');
var duration = $.datepicker._get(inst, 'duration'); var duration = $.datepicker._get(inst, 'duration');
@ -640,8 +695,12 @@ $.extend(Datepicker.prototype, {
$.datepicker._datepickerShowing = true; $.datepicker._datepickerShowing = true;
var borders = $.datepicker._getBorders(inst.dpDiv); var borders = $.datepicker._getBorders(inst.dpDiv);
inst.dpDiv.find('iframe.ui-datepicker-cover'). // IE6- only inst.dpDiv.find('iframe.ui-datepicker-cover'). // IE6- only
css({left: -borders[0], top: -borders[1], css({
width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); left: -borders[0],
top: -borders[1],
width: inst.dpDiv.outerWidth(),
height: inst.dpDiv.outerHeight()
});
}; };
inst.dpDiv.zIndex($(input).zIndex()+1); inst.dpDiv.zIndex($(input).zIndex()+1);
if ($.effects && $.effects[showAnim]) if ($.effects && $.effects[showAnim])
@ -662,8 +721,12 @@ $.extend(Datepicker.prototype, {
var borders = $.datepicker._getBorders(inst.dpDiv); var borders = $.datepicker._getBorders(inst.dpDiv);
inst.dpDiv.empty().append(this._generateHTML(inst)) inst.dpDiv.empty().append(this._generateHTML(inst))
.find('iframe.ui-datepicker-cover') // IE6- only .find('iframe.ui-datepicker-cover') // IE6- only
.css({left: -borders[0], top: -borders[1], .css({
width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) left: -borders[0],
top: -borders[1],
width: inst.dpDiv.outerWidth(),
height: inst.dpDiv.outerHeight()
})
.end() .end()
.find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a')
.bind('mouseout', function(){ .bind('mouseout', function(){
@ -704,7 +767,12 @@ $.extend(Datepicker.prototype, {
@return (number[2]) the left and top borders */ @return (number[2]) the left and top borders */
_getBorders: function(elem) { _getBorders: function(elem) {
var convert = function(value) { var convert = function(value) {
return {thin: 1, medium: 2, thick: 3}[value] || value; return {
thin: 1,
medium: 2,
thick: 3
}
[value] || value;
}; };
return [parseFloat(convert(elem.css('border-left-width'))), return [parseFloat(convert(elem.css('border-left-width'))),
parseFloat(convert(elem.css('border-top-width')))]; parseFloat(convert(elem.css('border-top-width')))];
@ -770,7 +838,11 @@ $.extend(Datepicker.prototype, {
this._datepickerShowing = false; this._datepickerShowing = false;
this._lastInput = null; this._lastInput = null;
if (this._inDialog) { if (this._inDialog) {
this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); this._dialogInput.css({
position: 'absolute',
left: '0',
top: '-100px'
});
if ($.blockUI) { if ($.blockUI) {
$.unblockUI(); $.unblockUI();
$('body').append(this.dpDiv); $('body').append(this.dpDiv);
@ -906,7 +978,9 @@ $.extend(Datepicker.prototype, {
var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
var date = this._getDate(inst); var date = this._getDate(inst);
var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
$(altField).each(function() { $(this).val(dateStr); }); $(altField).each(function() {
$(this).val(dateStr);
});
} }
}, },
@ -1284,9 +1358,11 @@ $.extend(Datepicker.prototype, {
while (matches) { while (matches) {
switch (matches[2] || 'd') { switch (matches[2] || 'd') {
case 'd' : case 'D' : case 'd' : case 'D' :
day += parseInt(matches[1],10); break; day += parseInt(matches[1],10);
break;
case 'w' : case 'W' : case 'w' : case 'W' :
day += parseInt(matches[1],10) * 7; break; day += parseInt(matches[1],10) * 7;
break;
case 'm' : case 'M' : case 'm' : case 'M' :
month += parseInt(matches[1],10); month += parseInt(matches[1],10);
day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
@ -1438,11 +1514,18 @@ $.extend(Datepicker.prototype, {
calender += '<div class="ui-datepicker-group'; calender += '<div class="ui-datepicker-group';
if (numMonths[1] > 1) if (numMonths[1] > 1)
switch (col) { switch (col) {
case 0: calender += ' ui-datepicker-group-first'; case 0:
cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break; calender += ' ui-datepicker-group-first';
case numMonths[1]-1: calender += ' ui-datepicker-group-last'; cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left');
cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break; break;
default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break; case numMonths[1]-1:
calender += ' ui-datepicker-group-last';
cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right');
break;
default:
calender += ' ui-datepicker-group-middle';
cornerClass = '';
break;
} }
calender += '">'; calender += '">';
} }
@ -1658,9 +1741,13 @@ $.extend(Datepicker.prototype, {
var shortYearCutoff = this._get(inst, 'shortYearCutoff'); var shortYearCutoff = this._get(inst, 'shortYearCutoff');
shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
return {shortYearCutoff: shortYearCutoff, return {
dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), shortYearCutoff: shortYearCutoff,
monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; 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. */ /* Format the given date for display. */
@ -1675,28 +1762,28 @@ $.extend(Datepicker.prototype, {
this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
} }
}); });
/* jQuery extend now ignores nulls! */ /* jQuery extend now ignores nulls! */
function extendRemove(target, props) { function extendRemove(target, props) {
$.extend(target, props); $.extend(target, props);
for (var name in props) for (var name in props)
if (props[name] == null || props[name] == undefined) if (props[name] == null || props[name] == undefined)
target[name] = props[name]; target[name] = props[name];
return target; return target;
}; };
/* Determine whether an object is an array. */ /* Determine whether an object is an array. */
function isArray(a) { function isArray(a) {
return (a && (($.browser.safari && typeof a == 'object' && a.length) || return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
(a.constructor && a.constructor.toString().match(/\Array\(\)/)))); (a.constructor && a.constructor.toString().match(/\Array\(\)/))));
}; };
/* Invoke the datepicker functionality. /* Invoke the datepicker functionality.
@param options string - a command, optionally followed by additional parameters or @param options string - a command, optionally followed by additional parameters or
Object - settings for attaching new datepicker functionality Object - settings for attaching new datepicker functionality
@return jQuery object */ @return jQuery object */
$.fn.datepicker = function(options){ $.fn.datepicker = function(options){
/* Initialise the date picker. */ /* Initialise the date picker. */
if (!$.datepicker.initialized) { if (!$.datepicker.initialized) {
@ -1718,15 +1805,15 @@ $.fn.datepicker = function(options){
apply($.datepicker, [this].concat(otherArgs)) : apply($.datepicker, [this].concat(otherArgs)) :
$.datepicker._attachDatepicker(this, options); $.datepicker._attachDatepicker(this, options);
}); });
}; };
$.datepicker = new Datepicker(); // singleton instance $.datepicker = new Datepicker(); // singleton instance
$.datepicker.initialized = false; $.datepicker.initialized = false;
$.datepicker.uuid = new Date().getTime(); $.datepicker.uuid = new Date().getTime();
$.datepicker.version = "1.8.4"; $.datepicker.version = "1.8.4";
// Workaround for #4055 // Workaround for #4055
// Add another global to avoid noConflict issues with inline event handlers // Add another global to avoid noConflict issues with inline event handlers
window['DP_jQuery_' + dpuuid] = $; window['DP_jQuery_' + dpuuid] = $;
})(jQuery); })(jQuery);

32
form_elements/js/jquery.ui.widget.js vendored

@ -9,9 +9,9 @@
*/ */
(function( $, undefined ) { (function( $, undefined ) {
var _remove = $.fn.remove; var _remove = $.fn.remove;
$.fn.remove = function( selector, keepData ) { $.fn.remove = function( selector, keepData ) {
return this.each(function() { return this.each(function() {
if ( !keepData ) { if ( !keepData ) {
if ( !selector || $.filter( selector, [ this ] ).length ) { if ( !selector || $.filter( selector, [ this ] ).length ) {
@ -22,9 +22,9 @@ $.fn.remove = function( selector, keepData ) {
} }
return _remove.call( $(this), selector, keepData ); return _remove.call( $(this), selector, keepData );
}); });
}; };
$.widget = function( name, base, prototype ) { $.widget = function( name, base, prototype ) {
var namespace = name.split( "." )[ 0 ], var namespace = name.split( "." )[ 0 ],
fullName; fullName;
name = name.split( "." )[ 1 ]; name = name.split( "." )[ 1 ];
@ -52,11 +52,11 @@ $.widget = function( name, base, prototype ) {
// we need to make the options hash a property directly on the new instance // 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 // otherwise we'll modify the options hash on the prototype that we're
// inheriting from // inheriting from
// $.each( basePrototype, function( key, val ) { // $.each( basePrototype, function( key, val ) {
// if ( $.isPlainObject(val) ) { // if ( $.isPlainObject(val) ) {
// basePrototype[ key ] = $.extend( {}, val ); // basePrototype[ key ] = $.extend( {}, val );
// } // }
// }); // });
basePrototype.options = $.extend( true, {}, basePrototype.options ); basePrototype.options = $.extend( true, {}, basePrototype.options );
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, { $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
namespace: namespace, namespace: namespace,
@ -66,9 +66,9 @@ $.widget = function( name, base, prototype ) {
}, prototype ); }, prototype );
$.widget.bridge( name, $[ namespace ][ name ] ); $.widget.bridge( name, $[ namespace ][ name ] );
}; };
$.widget.bridge = function( name, object ) { $.widget.bridge = function( name, object ) {
$.fn[ name ] = function( options ) { $.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string", var isMethodCall = typeof options === "string",
args = Array.prototype.slice.call( arguments, 1 ), args = Array.prototype.slice.call( arguments, 1 ),
@ -111,16 +111,16 @@ $.widget.bridge = function( name, object ) {
return returnValue; return returnValue;
}; };
}; };
$.Widget = function( options, element ) { $.Widget = function( options, element ) {
// allow instantiation without initializing for simple inheritance // allow instantiation without initializing for simple inheritance
if ( arguments.length ) { if ( arguments.length ) {
this._createWidget( options, element ); this._createWidget( options, element );
} }
}; };
$.Widget.prototype = { $.Widget.prototype = {
widgetName: "widget", widgetName: "widget",
widgetEventPrefix: "", widgetEventPrefix: "",
options: { options: {
@ -232,6 +232,6 @@ $.Widget.prototype = {
callback.call( this.element[0], event, data ) === false || callback.call( this.element[0], event, data ) === false ||
event.isDefaultPrevented() ); event.isDefaultPrevented() );
} }
}; };
})( jQuery ); })( jQuery );

4
form_elements/js/otherselect.js

@ -18,13 +18,13 @@ $(document).ready(function () {
$('#'+$(this).attr('id')+'_field').val(''); $('#'+$(this).attr('id')+'_field').val('');
$('#'+$(this).attr('id')+'_other').show('fast'); $('#'+$(this).attr('id')+'_other').show('fast');
} else } else
{ {
$('#'+$(this).attr('id')+'_field').val($(this).val()); $('#'+$(this).attr('id')+'_field').val($(this).val());
$('#'+$(this).attr('id')+'_other').hide('fast'); $('#'+$(this).attr('id')+'_other').hide('fast');
} }
}); });
}); });
}); });

18
form_elements/js/people_ahah.js

@ -1,7 +1,7 @@
(function($) { (function($) {
if (Drupal.jsEnabled) { if (Drupal.jsEnabled) {
$(document).ready(function() { $(document).ready(function() {
$('#edit-mods-people-add-from-repository').blur(function () { $('#edit-mods-people-add-from-repository').blur(function () {
if ($('#edit-mods-people-add-from-repository').val() != '') { if ($('#edit-mods-people-add-from-repository').val() != '') {
@ -11,11 +11,11 @@ if (Drupal.jsEnabled) {
if (Drupal.ahah != undefined) { if (Drupal.ahah != undefined) {
/** /**
* Override of Drupal.ahah.prototype.success. The only difference is that we * Override of Drupal.ahah.prototype.success. The only difference is that we
* allow for new Drupal.settings. * allow for new Drupal.settings.
*/ */
Drupal.ahah.prototype.success = function (response, status) { Drupal.ahah.prototype.success = function (response, status) {
$('#edit-mods-people-add-from-repository').val(''); $('#edit-mods-people-add-from-repository').val('');
var wrapper = $(this.wrapper); var wrapper = $(this.wrapper);
@ -47,7 +47,13 @@ Drupal.ahah.prototype.success = function (response, status) {
wrapper[this.method](new_content); 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. // Immediately hide the new content if we're using any effects.
if (this.showEffect != 'show') { if (this.showEffect != 'show') {
@ -81,12 +87,12 @@ Drupal.ahah.prototype.success = function (response, status) {
} }
Drupal.unfreezeHeight(); Drupal.unfreezeHeight();
}; };
} }
}); });
} }
})(jQuery); })(jQuery);

36
form_elements/xml/gacs.xml

@ -443,7 +443,8 @@
<name authorized="yes">Transcaucasia</name> <name authorized="yes">Transcaucasia</name>
<note> <note>
<text>Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia <text>Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia
(Republic)) before June 1998]</text> (Republic)) before June 1998]
</text>
</note> </note>
</uf> </uf>
<uf> <uf>
@ -552,7 +553,8 @@
<name authorized="yes">Transcaucasia</name> <name authorized="yes">Transcaucasia</name>
<note> <note>
<text>Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia <text>Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia
(Republic)) before June 1998]</text> (Republic)) before June 1998]
</text>
</note> </note>
</uf> </uf>
<uf> <uf>
@ -1385,7 +1387,8 @@
<code>a-em</code> <code>a-em</code>
<note> <note>
<text>Coded [a-pt] (Portuguese Timor) before April 21, 1980; coded [a-io] (Indonesia) from <text>Coded [a-pt] (Portuguese Timor) before April 21, 1980; coded [a-io] (Indonesia) from
1980-Sept. 2002]</text> 1980-Sept. 2002]
</text>
</note> </note>
<uf> <uf>
<name authorized="yes">Lesser Sunda Islands (Indonesia and East Timor)</name> <name authorized="yes">Lesser Sunda Islands (Indonesia and East Timor)</name>
@ -1771,7 +1774,8 @@
<name authorized="yes">Transcaucasia</name> <name authorized="yes">Transcaucasia</name>
<note> <note>
<text>Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia <text>Coded [e-ur-ai] (Armenia (Republic)), [e-ur-aj] (Azerbaijan), [e-ur-gs] (Georgia
(Republic)) before June 1998]</text> (Republic)) before June 1998]
</text>
</note> </note>
</uf> </uf>
<uf> <uf>
@ -1787,13 +1791,15 @@
<code>e-gx</code> <code>e-gx</code>
<note> <note>
<text>For Germany as a whole regardless of time period; includes Germany (East) and Germany <text>For Germany as a whole regardless of time period; includes Germany (East) and Germany
(West) as a whole between 1949 and 1990]</text> (West) as a whole between 1949 and 1990]
</text>
</note> </note>
<uf> <uf>
<name authorized="yes">Berlin (Germany)</name> <name authorized="yes">Berlin (Germany)</name>
<note> <note>
<text>Coded [e-gx] (Germany) for Berlin as a whole; [e-ge] (Germany (East)) for East <text>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]</text> Berlin; or [e-gw] (Germany (West)) for West Berlin before Jan. 1991]
</text>
</note> </note>
<uf> <uf>
<name>East Berlin</name> <name>East Berlin</name>
@ -1824,7 +1830,8 @@
<code>e-ge</code> <code>e-ge</code>
<note> <note>
<text>For the eastern part of Germany before 1949 or after 1990 and for the German <text>For the eastern part of Germany before 1949 or after 1990 and for the German
Democratic Republic between 1949-1990]</text> Democratic Republic between 1949-1990]
</text>
</note> </note>
<uf> <uf>
<name>Democratic German Republic</name> <name>Democratic German Republic</name>
@ -1845,7 +1852,8 @@
<code>e-gw</code> <code>e-gw</code>
<note> <note>
<text>For the western part of Germany before 1949 or after 1990 and for the Federal Republic <text>For the western part of Germany before 1949 or after 1990 and for the Federal Republic
of Germany between 1949-1990</text> of Germany between 1949-1990
</text>
</note> </note>
<uf> <uf>
<name>Federal German Republic</name> <name>Federal German Republic</name>
@ -2551,7 +2559,8 @@
<code>pokb</code> <code>pokb</code>
<note> <note>
<text>Coded [pogn] (Gilbert and Ellice Islands) or [poln] (Line Islands) before Mar. <text>Coded [pogn] (Gilbert and Ellice Islands) or [poln] (Line Islands) before Mar.
1988</text> 1988
</text>
</note> </note>
<uf> <uf>
<name authorized="yes">Banaba (Kiribati)</name> <name authorized="yes">Banaba (Kiribati)</name>
@ -2620,7 +2629,8 @@
<code>e-kv</code> <code>e-kv</code>
<note> <note>
<text>Coded [e-rb] (Serbia) before May 2008 and [e-yu] (Serbia and Montenegro) before April <text>Coded [e-rb] (Serbia) before May 2008 and [e-yu] (Serbia and Montenegro) before April
2007</text> 2007
</text>
</note> </note>
</gac> </gac>
<gac> <gac>
@ -5052,7 +5062,8 @@
<code>poup</code> <code>poup</code>
<note> <note>
<text>Includes American Samoa, Guam, Pacific Islands (Trust Territory) treated <text>Includes American Samoa, Guam, Pacific Islands (Trust Territory) treated
collectively</text> collectively
</text>
</note> </note>
<uf> <uf>
<name authorized="yes">Pacific Islands (Trust Territory)</name> <name authorized="yes">Pacific Islands (Trust Territory)</name>
@ -5456,7 +5467,8 @@
<name authorized="yes">Socotra (Yemen)</name> <name authorized="yes">Socotra (Yemen)</name>
<note> <note>
<text>Coded [i-xo] (Socotra Island) before Mar. 1988; Coded [a-ys] (Yemen (People's <text>Coded [i-xo] (Socotra Island) before Mar. 1988; Coded [a-ys] (Yemen (People's
Democratic Republic) before Oct. 1992</text> Democratic Republic) before Oct. 1992
</text>
</note> </note>
<uf> <uf>
<name>Sokotra (Yemen)</name> <name>Sokotra (Yemen)</name>

6
form_elements/xml/languages.xml

@ -4874,7 +4874,8 @@
<code>cai</code> <code>cai</code>
<note> <note>
<text>Use for the other languages of Central America and Mexico, as well as for the <text>Use for the other languages of Central America and Mexico, as well as for the
languages of the Azteco-Tanoan language phylum.</text> languages of the Azteco-Tanoan language phylum.
</text>
</note> </note>
<uf> <uf>
<name authorized="yes">Amuzgo</name> <name authorized="yes">Amuzgo</name>
@ -12732,7 +12733,8 @@
<code>nai</code> <code>nai</code>
<note> <note>
<text>Use for the other languages of North America north of Mexico excluding the <text>Use for the other languages of North America north of Mexico excluding the
languages of the Azteco-Tanoan language phylum.</text> languages of the Azteco-Tanoan language phylum.
</text>
</note> </note>
<uf> <uf>
<name authorized="yes">Alabama</name> <name authorized="yes">Alabama</name>

2
ilives/book.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
class IslandoraBook { class IslandoraBook {

3
ilives/fedora_ilives.install

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* @file fedora_ilives.install * @file fedora_ilives.install

2
ilives/fedora_ilives.module

@ -1,6 +1,6 @@
<?php <?php
// $Id$
/* /*
* To change this template, choose Tools | Templates * To change this template, choose Tools | Templates

27
ilives/image_rotator_tagger_block.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* @file image_rotator_tagger_block.inc * @file image_rotator_tagger_block.inc
@ -25,27 +26,25 @@ and $object <dc:title> $title';
$resultsdoc->loadXML($results); $resultsdoc->loadXML($results);
$resultslist = $resultsdoc->getElementsByTagName('result'); $resultslist = $resultsdoc->getElementsByTagName('result');
if ( $resultslist->length == 0 ) { if ($resultslist->length == 0) {
return NULL; return NULL;
} }
//return htmlentities(substr($results, 0, 1000)); //return htmlentities(substr($results, 0, 1000));
$randresult = $resultslist->item( rand()%$resultslist->length ); $randresult = $resultslist->item(rand() % $resultslist->length);
if (empty($randresult)) { if (empty($randresult)) {
return NULL; return NULL;
} }
$objs = $randresult->getElementsByTagName('object'); $objs = $randresult->getElementsByTagName('object');
$obj = $objs->item(0); $obj = $objs->item(0);
$pid = substr( $obj->getAttribute('uri'), 12); $pid = substr($obj->getAttribute('uri'), 12);
$titles = $randresult->getElementsByTagName('title'); $titles = $randresult->getElementsByTagName('title');
$title = $titles->item(0); $title = $titles->item(0);
return array('pid' => $pid, return array('pid' => $pid,
//'title' => $randresult->textContent); //'title' => $randresult->textContent);
'title' => $title->nodeValue); 'title' => $title->nodeValue);
} }
function _fedora_image_rotator_tagger_block_content() { function _fedora_image_rotator_tagger_block_content() {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
@ -67,10 +66,10 @@ function _fedora_image_rotator_tagger_block_content() {
$image_item = new Fedora_Item($result['pid']); $image_item = new Fedora_Item($result['pid']);
} }
if (!empty ($result)) { if (!empty($result)) {
return '<p>' return '<p>'
. l( '<img src="'. $base_url . '/fedora/imageapi/'. $result['pid'] . '/JPG?op=scale&height=500&width=300" />', 'fedora/repository/'. $result['pid'], array('html' => TRUE, 'alias' => TRUE)) . l('<img src="' . $base_url . '/fedora/imageapi/' . $result['pid'] . '/JPG?op=scale&height=500&width=300" />', 'fedora/repository/' . $result['pid'], array('html' => TRUE, 'alias' => TRUE))
.'<p>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)) . '.' . '<p>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']) . '</p>'; . drupal_get_form('fedora_repository_image_tagging_form', $result['pid']) . '</p>';
} }
else { else {
@ -78,20 +77,19 @@ function _fedora_image_rotator_tagger_block_content() {
} }
} }
/* /*
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'); drupal_add_js(drupal_get_path('module', 'fedora_ilives').'/fedora_ilives_ajax.js', 'theme');
return TRUE; return TRUE;
}*/ } */
class ShowILivesStreamsInFieldSets { class ShowILivesStreamsInFieldSets {
private $pid =NULL; private $pid = NULL;
function ShowILivesStreamsInFieldSets($pid) { function ShowILivesStreamsInFieldSets($pid) {
//drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); //drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$this->pid=$pid; $this->pid = $pid;
} }
function showJPG() { function showJPG() {
@ -104,4 +102,5 @@ class ShowILivesStreamsInFieldSets {
return theme('fieldset', $collection_fieldset) 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);
} }
} }

4
ilives/searchTerms.xml

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<search_terms> <search_terms>
<!--define what fields we can query as part of the advanced search for this collection--> <!--define what fields we can query as part of the advanced search for this collection-->
<default>dc.title</default> <default>dc.title</default>
<number_of_results>1000</number_of_results> <number_of_results>1000</number_of_results>
@ -55,7 +55,7 @@
<field>tagUser</field> <field>tagUser</field>
<value>Tag Creator</value> <value>Tag Creator</value>
</term>--> </term>-->
</search_terms> </search_terms>

16
ilives/tests/fedora_ilives.test

@ -1,9 +1,10 @@
<?php <?php
// $Id$
/* /*
* Tests the functions of the Fedora Repository module. * Tests the functions of the Fedora Repository module.
*/ */
class FedoraBookTestCase extends DrupalWebTestCase { class FedoraBookTestCase extends DrupalWebTestCase {
@ -31,7 +32,6 @@ class FedoraBookTestCase extends DrupalWebTestCase {
$this->drupalLogin($repository_user); $this->drupalLogin($repository_user);
} }
public function testBookCModel() { public function testBookCModel() {
@ -73,11 +73,10 @@ class FedoraBookTestCase extends DrupalWebTestCase {
$this->pass("Successfully ingested book object $book_pid."); $this->pass("Successfully ingested book object $book_pid.");
} }
$this->cleanUpRepository($pid_list); $this->cleanUpRepository($pid_list);
} }
private function cleanUpRepository($pid_list = array()) { private function cleanUpRepository($pid_list = array()) {
$this->pass("This is the PID list to purge: ". implode(", ", $pid_list) ); $this->pass("This is the PID list to purge: " . implode(", ", $pid_list));
foreach ($pid_list as $pid) { foreach ($pid_list as $pid) {
$this->drupalPost("fedora/repository/purgeObject/$pid", array(), 'Purge'); $this->drupalPost("fedora/repository/purgeObject/$pid", array(), 'Purge');
$this->drupalPost(NULL, array(), 'Delete'); $this->drupalPost(NULL, array(), 'Delete');
@ -98,9 +97,9 @@ class FedoraBookTestCase extends DrupalWebTestCase {
if (!is_dir($file_dir)) { if (!is_dir($file_dir)) {
mkdir($file_dir, 0777, TRUE); mkdir($file_dir, 0777, TRUE);
} }
$output_path = "$file_dir/$basename.". $this->randomName(10) . '.html'; $output_path = "$file_dir/$basename." . $this->randomName(10) . '.html';
$rv = file_put_contents($output_path, $this->drupalGetContent()); $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('here', $output_path));
} }
protected function drupalCreateFedoraUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) { protected function drupalCreateFedoraUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) {
@ -130,3 +129,4 @@ class FedoraBookTestCase extends DrupalWebTestCase {
} }
} }

193
ilives/xml/ilives_CollectionModel.xml

@ -3,94 +3,94 @@
xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties> <foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/> <foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="IslandLives Collection Model"/> <foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="IslandLives Collection Model"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/> <foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2009-01-23T20:43:42.518Z"/> <foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2009-01-23T20:43:42.518Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2009-09-14T14:09:41.955Z"/> <foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2009-09-14T14:09:41.955Z"/>
</foxml:objectProperties> </foxml:objectProperties>
<foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false"> <foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2009-01-23T20:43:42.518Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit"> <foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2009-01-23T20:43:42.518Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit">
<foxml:xmlContent> <foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#"> <audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1"> <audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action> <audit:action>ingest</audit:action>
<audit:componentID></audit:componentID> <audit:componentID></audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-01-23T20:43:42.518Z</audit:date> <audit:date>2009-01-23T20:43:42.518Z</audit:date>
<audit:justification>Created with Admin GUI &quot;New Object&quot; command</audit:justification> <audit:justification>Created with Admin GUI &quot;New Object&quot; command</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC2"> <audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>RELS-EXT</audit:componentID> <audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-01-23T20:45:33.190Z</audit:date> <audit:date>2009-01-23T20:45:33.190Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC3"> <audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>DC</audit:componentID> <audit:componentID>DC</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-01-23T20:48:22.246Z</audit:date> <audit:date>2009-01-23T20:48:22.246Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC4"> <audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action> <audit:action>ingest</audit:action>
<audit:componentID></audit:componentID> <audit:componentID></audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-01-26T20:27:14.697Z</audit:date> <audit:date>2009-01-26T20:27:14.697Z</audit:date>
<audit:justification>Ingested from local file /opt/fedora/export/ilives_CollectionModel.xml</audit:justification> <audit:justification>Ingested from local file /opt/fedora/export/ilives_CollectionModel.xml</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC5"> <audit:record ID="AUDREC5">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action> <audit:action>ingest</audit:action>
<audit:componentID></audit:componentID> <audit:componentID></audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-03-21T22:35:49.622Z</audit:date> <audit:date>2009-03-21T22:35:49.622Z</audit:date>
<audit:justification>Ingested from local file /Volumes/iLives/iLivesTexts/215258_jpg/Content_Models/CollectionCModel.xml</audit:justification> <audit:justification>Ingested from local file /Volumes/iLives/iLivesTexts/215258_jpg/Content_Models/CollectionCModel.xml</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC6"> <audit:record ID="AUDREC6">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action> <audit:action>ingest</audit:action>
<audit:componentID></audit:componentID> <audit:componentID></audit:componentID>
<audit:responsibility>admin</audit:responsibility> <audit:responsibility>admin</audit:responsibility>
<audit:date>2009-09-14T14:09:41.955Z</audit:date> <audit:date>2009-09-14T14:09:41.955Z</audit:date>
<audit:justification>Fedora Object Ingested</audit:justification> <audit:justification>Fedora Object Ingested</audit:justification>
</audit:record> </audit:record>
</audit:auditTrail> </audit:auditTrail>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="RELS-EXT1.0" LABEL="RDF Statements about this object" CREATED="2009-01-23T20:43:44.131Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="366"> <foxml:datastreamVersion ID="RELS-EXT1.0" LABEL="RDF Statements about this object" CREATED="2009-01-23T20:43:44.131Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="366">
<foxml:xmlContent> <foxml:xmlContent>
<rdf:RDF xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/ilives:CollectionModel"> <rdf:Description rdf:about="info:fedora/ilives:CollectionModel">
<fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ContentModel-3.0"></fedora-model:hasModel> <fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ContentModel-3.0"></fedora-model:hasModel>
</rdf:Description> </rdf:Description>
</rdf:RDF> </rdf:RDF>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="RELS-EXT.1" LABEL="RDF Statements about this object" CREATED="2009-01-23T20:45:33.190Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="457"> <foxml:datastreamVersion ID="RELS-EXT.1" LABEL="RDF Statements about this object" CREATED="2009-01-23T20:45:33.190Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="457">
<foxml:xmlContent> <foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/ilives:CollectionModel"> <rdf:Description rdf:about="info:fedora/ilives:CollectionModel">
<hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ContentModel-3.0"></hasModel> <hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ContentModel-3.0"></hasModel>
<hasMember xmlns="info:fedora/fedora-system:def/relations-external#" rdf:resource="ilives:lowerfreetown"></hasMember> <hasMember xmlns="info:fedora/fedora-system:def/relations-external#" rdf:resource="ilives:lowerfreetown"></hasMember>
</rdf:Description> </rdf:Description>
</rdf:RDF> </rdf:RDF>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="DS-COMPOSITE-MODEL" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="DS-COMPOSITE-MODEL" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="DS-COMPOSITE-MODEL1.0" LABEL="Datastream Composite Model" CREATED="2009-01-23T20:43:44.131Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraDSCompositeModel-1.0" SIZE="1120"> <foxml:datastreamVersion ID="DS-COMPOSITE-MODEL1.0" LABEL="Datastream Composite Model" CREATED="2009-01-23T20:43:44.131Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:FedoraDSCompositeModel-1.0" SIZE="1120">
<foxml:xmlContent> <foxml:xmlContent>
<dsCompositeModel xmlns="info:fedora/fedora-system:def/dsCompositeModel#"> <dsCompositeModel xmlns="info:fedora/fedora-system:def/dsCompositeModel#">
<comment xmlns="info:fedora/fedora-system:def/comment#"> <comment xmlns="info:fedora/fedora-system:def/comment#">
This DS-COMPOSITE-MODEL datastream is included as a starting point to This DS-COMPOSITE-MODEL datastream is included as a starting point to
assist in the creation of a content model. The DS-COMPOSITE-MODEL assist in the creation of a content model. The DS-COMPOSITE-MODEL
@ -109,30 +109,31 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
<form MIME="text/xml"></form> <form MIME="text/xml"></form>
</dsTypeModel> </dsTypeModel>
</dsCompositeModel> </dsCompositeModel>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2009-01-23T20:43:42.518Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="427"> <foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2009-01-23T20:43:42.518Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="427">
<foxml:xmlContent> <foxml:xmlContent>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> <oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>IslandLives Collection Model</dc:title> <dc:title>IslandLives Collection Model</dc:title>
<dc:identifier>ilives:CollectionModel</dc:identifier> <dc:identifier>ilives:CollectionModel</dc:identifier>
</oai_dc:dc> </oai_dc:dc>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="DC.1" LABEL="Dublin Core Record for this object" CREATED="2009-01-23T20:48:22.246Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="1812"> <foxml:datastreamVersion ID="DC.1" LABEL="Dublin Core Record for this object" CREATED="2009-01-23T20:48:22.246Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="1812">
<foxml:xmlContent> <foxml:xmlContent>
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" 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"> <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" 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>IslandLives Collection</dc:title> <dc:title>IslandLives Collection</dc:title>
<dc:description>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&apos;s ongoing commitment to making PEI&apos;s cultural and published heritage available to all. <dc:description>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&apos;s ongoing commitment to making PEI&apos;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. 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. 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.</dc:description> 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.
</dc:description>
<dc:contributor>Robertson Library, University of Prince Edward Island</dc:contributor> <dc:contributor>Robertson Library, University of Prince Edward Island</dc:contributor>
<dc:identifier>ilives:CollectionModel</dc:identifier> <dc:identifier>ilives:CollectionModel</dc:identifier>
</oai_dc:dc> </oai_dc:dc>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
</foxml:digitalObject> </foxml:digitalObject>

90
ilives/xml/ilives_collection.xml

@ -3,54 +3,54 @@
xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties> <foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/> <foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="IslandLives Collection"/> <foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="IslandLives Collection"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/> <foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2009-05-14T19:32:21.132Z"/> <foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2009-05-14T19:32:21.132Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2009-05-14T19:35:11.912Z"/> <foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2009-05-14T19:35:11.912Z"/>
</foxml:objectProperties> </foxml:objectProperties>
<foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false"> <foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2009-05-14T19:32:21.132Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit"> <foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2009-05-14T19:32:21.132Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit">
<foxml:xmlContent> <foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#"> <audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1"> <audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action> <audit:action>ingest</audit:action>
<audit:componentID></audit:componentID> <audit:componentID></audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-05-14T19:32:21.132Z</audit:date> <audit:date>2009-05-14T19:32:21.132Z</audit:date>
<audit:justification>Created with Admin GUI &quot;New Object&quot; command</audit:justification> <audit:justification>Created with Admin GUI &quot;New Object&quot; command</audit:justification>
</audit:record> </audit:record>
<audit:record ID="AUDREC2"> <audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/> <audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action> <audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>DC</audit:componentID> <audit:componentID>DC</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility> <audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2009-05-14T19:35:11.912Z</audit:date> <audit:date>2009-05-14T19:35:11.912Z</audit:date>
<audit:justification></audit:justification> <audit:justification></audit:justification>
</audit:record> </audit:record>
</audit:auditTrail> </audit:auditTrail>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true"> <foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2009-05-14T19:32:21.132Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="392"> <foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2009-05-14T19:32:21.132Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="392">
<foxml:xmlContent> <foxml:xmlContent>
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" 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"> <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" 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>IslandLives Collection</dc:title> <dc:title>IslandLives Collection</dc:title>
<dc:identifier>ilives:collection</dc:identifier> <dc:identifier>ilives:collection</dc:identifier>
</oai_dc:dc> </oai_dc:dc>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="DC.1" LABEL="Dublin Core Record for this object" CREATED="2009-05-14T19:35:11.912Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="783"> <foxml:datastreamVersion ID="DC.1" LABEL="Dublin Core Record for this object" CREATED="2009-05-14T19:35:11.912Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="783">
<foxml:xmlContent> <foxml:xmlContent>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> <oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>IslandLives Collection</dc:title> <dc:title>IslandLives Collection</dc:title>
<dc:description>Made possible through a generous private donation, IslandLives contains community and church histories and it builds on the Robertson Library&apos;s mission to preserve and share unique material relating to Prince Edward Island and demonstrates UPEI&quot;s ongoing commitment to making PEI&quot;s cultural and published heritage available to all. Welcome.</dc:description> <dc:description>Made possible through a generous private donation, IslandLives contains community and church histories and it builds on the Robertson Library&apos;s mission to preserve and share unique material relating to Prince Edward Island and demonstrates UPEI&quot;s ongoing commitment to making PEI&quot;s cultural and published heritage available to all. Welcome.</dc:description>
<dc:identifier>ilives:collection</dc:identifier> <dc:identifier>ilives:collection</dc:identifier>
</oai_dc:dc> </oai_dc:dc>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>
</foxml:digitalObject> </foxml:digitalObject>

15
ilives/xml/ilives_tei2htmlSdep-pageCModel.xml

@ -189,8 +189,11 @@
<xsl:attribute name="class">search persName</xsl:attribute> <xsl:attribute name="class">search persName</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute>
<xsl:attribute <xsl:attribute
name="href">http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22<xsl:value-of name="href">http://islandlives.net/fedora/ilives_book_search/tei.persNameTERM:%22
select=".//tei:surname"/>+<xsl:value-of select=".//tei:forename"/>%22+AND+dc.type:collection</xsl:attribute> <xsl:value-of
select=".//tei:surname"/>+
<xsl:value-of select=".//tei:forename"/>%22+AND+dc.type:collection
</xsl:attribute>
<xsl:apply-templates select="*|node()"/> <xsl:apply-templates select="*|node()"/>
</a> </a>
</span> </span>
@ -205,7 +208,9 @@
<xsl:attribute name="class">search placeName</xsl:attribute> <xsl:attribute name="class">search placeName</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute>
<xsl:attribute <xsl:attribute
name="href">http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22<xsl:value-of select="normalize-space(.)"/>%22+AND+dc.type:collection</xsl:attribute> name="href">http://islandlives.net/fedora/ilives_book_search/tei.placeNameTERM:%22
<xsl:value-of select="normalize-space(.)"/>%22+AND+dc.type:collection
</xsl:attribute>
<xsl:value-of select="normalize-space(.)"/> <xsl:value-of select="normalize-space(.)"/>
</a> </a>
</xsl:template> </xsl:template>
@ -214,7 +219,9 @@
<xsl:attribute name="class">search orgName</xsl:attribute> <xsl:attribute name="class">search orgName</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute>
<xsl:attribute <xsl:attribute
name="href">http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22<xsl:value-of select="normalize-space(.)"/>%22+AND+dc.type:collection</xsl:attribute> name="href">http://islandlives.net/fedora/ilives_book_search/tei.orgNameTERM:%22
<xsl:value-of select="normalize-space(.)"/>%22+AND+dc.type:collection
</xsl:attribute>
<xsl:value-of select="normalize-space(.)"/> <xsl:value-of select="normalize-space(.)"/>
</a> </a>
</xsl:template> </xsl:template>

9
ilives/xsl/MODS3-22simpleDC.xsl

@ -297,7 +297,8 @@ Version 1.0 2007-05-04 Tracy Meehleib <tmee@loc.gov>
<xsl:choose> <xsl:choose>
<xsl:when test="contains ('isbn issn uri doi lccn uri', $type)"> <xsl:when test="contains ('isbn issn uri doi lccn uri', $type)">
<dc:identifier> <dc:identifier>
<xsl:value-of select="$type"/>: <xsl:value-of select="."/> <xsl:value-of select="$type"/>: 
<xsl:value-of select="."/>
</dc:identifier> </dc:identifier>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
@ -389,12 +390,14 @@ Version 1.0 2007-05-04 Tracy Meehleib <tmee@loc.gov>
<xsl:template match="mods:dateIssued[@point='start'] | mods:dateCreated[@point='start'] | mods:dateCaptured[@point='start'] | mods:dateOther[@point='start'] "> <xsl:template match="mods:dateIssued[@point='start'] | mods:dateCreated[@point='start'] | mods:dateCaptured[@point='start'] | mods:dateOther[@point='start'] ">
<xsl:variable name="dateName" select="local-name()"/> <xsl:variable name="dateName" select="local-name()"/>
<dc:date> <dc:date>
<xsl:value-of select="."/>-<xsl:value-of select="../*[local-name()=$dateName][@point='end']"/> <xsl:value-of select="."/>-
<xsl:value-of select="../*[local-name()=$dateName][@point='end']"/>
</dc:date> </dc:date>
</xsl:template> </xsl:template>
<xsl:template match="mods:temporal[@point='start'] "> <xsl:template match="mods:temporal[@point='start'] ">
<xsl:value-of select="."/>-<xsl:value-of select="../mods:temporal[@point='end']"/> <xsl:value-of select="."/>-
<xsl:value-of select="../mods:temporal[@point='end']"/>
</xsl:template> </xsl:template>
<xsl:template match="mods:temporal[@point!='start' and @point!='end'] "> <xsl:template match="mods:temporal[@point!='start' and @point!='end'] ">

183
ilives/xsl/book_view.xsl

@ -2,64 +2,173 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:mods="http://www.loc.gov/mods/v3"> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:mods="http://www.loc.gov/mods/v3">
<xsl:variable name="OBJECTSPAGE"> <xsl:variable name="OBJECTSPAGE">
<xsl:value-of select="$objectsPage"/> <xsl:value-of select="$objectsPage"/>
</xsl:variable> </xsl:variable>
<xsl:variable name="PID"> <xsl:variable name="PID">
<xsl:value-of select="$pid"/> <xsl:value-of select="$pid"/>
</xsl:variable> </xsl:variable>
<xsl:variable name="RECORDID"> <xsl:variable name="RECORDID">
<xsl:value-of select='substring-after($PID,":")'/> <xsl:value-of select='substring-after($PID,":")'/>
</xsl:variable> </xsl:variable>
<xsl:variable name="USER" select="$userID"/> <xsl:variable name="USER" select="$userID"/>
<xsl:variable name="INGESTED" select="$ingested"/> <xsl:variable name="INGESTED" select="$ingested"/>
<xsl:template match="/"> <xsl:template match="/">
<h1 ><xsl:value-of select="//mods:titleInfo/mods:nonSort"/><xsl:text> </xsl:text><xsl:value-of select="//mods:titleInfo/mods:title"/> <xsl:for-each select="//mods:titleInfo/mods:subTitle"> <h1 >
: <xsl:value-of select="."/></xsl:for-each></h1> <xsl:value-of select="//mods:titleInfo/mods:nonSort"/>
<xsl:for-each select="//mods:titleInfo[@type='alternative']/mods.title"><h3> <xsl:text> </xsl:text>
<xsl:value-of select="//mods:titleInfo/mods:title"/>
<xsl:for-each select="//mods:titleInfo/mods:subTitle">
:
<xsl:value-of select="."/>
</xsl:for-each>
</h1>
<xsl:for-each select="//mods:titleInfo[@type='alternative']/mods.title">
<h3>
<!-- <xsl:value-of select="substring-before(text(),'/')"/>--> <!-- <xsl:value-of select="substring-before(text(),'/')"/>-->
<xsl:value-of select="."/><xsl:text> </xsl:text> </h3> <xsl:value-of select="."/>
<xsl:text> </xsl:text>
</h3>
</xsl:for-each> </xsl:for-each>
<table cellpadding="3" cellspacing="2" valign="top" ><tr><td valign="top"> <table cellpadding="3" cellspacing="2" valign="top" >
<tr>
<td valign="top">
<img> <img>
<xsl:attribute name="src"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/repository/<xsl:copy-of select="$PID"/>/TN <xsl:attribute name="src">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/repository/
<xsl:copy-of select="$PID"/>/TN
</xsl:attribute> </xsl:attribute>
</img> </img>
</td><td ><div style="align:left"><table cellpadding="3" cellspacing="2" width="90%" > </td>
<tr><td align="right" valign="top"><b>By Statement: </b></td><td valign="top"><xsl:value-of select="//mods:note[@type='statement of responsibility']"/></td></tr> <td >
<tr><td align="right" valign="top"><b>Place of Publication: </b></td ><td valign="top"><xsl:value-of select="//mods:placeTerm[@type='text']"/></td></tr> <div style="align:left">
<tr><td align="right" valign="top"><b>Publisher: </b></td><td valign="top"><xsl:value-of select="//mods:publisher"/></td></tr> <table cellpadding="3" cellspacing="2" width="90%" >
<tr><td align="right" valign="top"><b>Date: </b></td><td valign="top"><xsl:value-of select="//mods:dateIssued"/></td></tr> <tr>
<tr><td align="right" valign="top"><b>Language: </b></td><td valign="top"><xsl:value-of select="//mods:languageTerm"/></td></tr> <td align="right" valign="top">
<tr><td align="right" valign="top"><b>Pagination: </b></td><td valign="top"><xsl:value-of select="//mods:extent"/></td></tr> <b>By Statement: </b>
<tr><td align="right" valign="top"><b>ISBN 10: </b></td><td valign="top"><xsl:value-of select="//mods:identifier[@type='isbn']"/></td></tr> </td>
<tr><td align="right" valign="top"><b>Subjects: </b></td><td valign="top"><xsl:for-each select="//mods:subject"> <td valign="top">
<xsl:value-of select="//mods:note[@type='statement of responsibility']"/>
</td>
</tr>
<tr>
<td align="right" valign="top">
<b>Place of Publication: </b>
</td >
<td valign="top">
<xsl:value-of select="//mods:placeTerm[@type='text']"/>
</td>
</tr>
<tr>
<td align="right" valign="top">
<b>Publisher: </b>
</td>
<td valign="top">
<xsl:value-of select="//mods:publisher"/>
</td>
</tr>
<tr>
<td align="right" valign="top">
<b>Date: </b>
</td>
<td valign="top">
<xsl:value-of select="//mods:dateIssued"/>
</td>
</tr>
<tr>
<td align="right" valign="top">
<b>Language: </b>
</td>
<td valign="top">
<xsl:value-of select="//mods:languageTerm"/>
</td>
</tr>
<tr>
<td align="right" valign="top">
<b>Pagination: </b>
</td>
<td valign="top">
<xsl:value-of select="//mods:extent"/>
</td>
</tr>
<tr>
<td align="right" valign="top">
<b>ISBN 10: </b>
</td>
<td valign="top">
<xsl:value-of select="//mods:identifier[@type='isbn']"/>
</td>
</tr>
<tr>
<td align="right" valign="top">
<b>Subjects: </b>
</td>
<td valign="top">
<xsl:for-each select="//mods:subject">
<xsl:for-each select="*"> <xsl:for-each select="*">
<a><xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/mods.subject:"<xsl:value-of select="normalize-space(.)"/>"%20AND%20dc.type:collection%20AND%20dc.type:ingested <a>
<xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/mods.subject:"
<xsl:value-of select="normalize-space(.)"/>"%20AND%20dc.type:collection%20AND%20dc.type:ingested
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="."/></a><xsl:text> </xsl:text></xsl:for-each><br /></xsl:for-each> <xsl:value-of select="."/>
</td></tr> </a>
</table></div></td><td valign="top"> <xsl:text> </xsl:text>
</xsl:for-each>
<br />
</xsl:for-each>
</td>
</tr>
</table>
</div>
</td>
<td valign="top">
<xsl:if test="$INGESTED = 'true'"> <xsl:if test="$INGESTED = 'true'">
<div><a><xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_viewer/<xsl:value-of select="$PID"/></xsl:attribute>Read</a> <div>
</div></xsl:if> <a>
<div> <xsl:attribute name="href">
<a><xsl:attribute name="href">http://islandpines.roblib.upei.ca/opac/en-CA/skin/roblib/xml/rdetail.xml?r=<xsl:value-of select="$RECORDID"/></xsl:attribute> <xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_viewer/
<xsl:value-of select="$PID"/>
</xsl:attribute>Read
</a>
</div>
</xsl:if>
<div>
<a>
<xsl:attribute name="href">http://islandpines.roblib.upei.ca/opac/en-CA/skin/roblib/xml/rdetail.xml?r=
<xsl:value-of select="$RECORDID"/>
</xsl:attribute>
Checkout Checkout
</a> </a>
</div> <xsl:if test="$INGESTED = 'true'"><div> </div>
<a><xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/repository/<xsl:value-of select="$PID"/>/PDF/<xsl:value-of select="$PID"/>.pdf</xsl:attribute>Download</a> <xsl:if test="$INGESTED = 'true'">
</div></xsl:if> <div>
<xsl:if test="($USER > 0) and ($INGESTED = 'true')"> <a>
<div> <xsl:attribute name="href">
<a><xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>teieditor/<xsl:value-of select="$PID"/></xsl:attribute>Edit</a> <xsl:copy-of select="$OBJECTSPAGE"/>fedora/repository/
</div> <xsl:value-of select="$PID"/>/PDF/
</xsl:if> <xsl:value-of select="$PID"/>.pdf
</td></tr></table> </xsl:attribute>Download
</a>
</div>
</xsl:if>
<xsl:if test="($USER > 0) and ($INGESTED = 'true')">
<div>
<a>
<xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>teieditor/
<xsl:value-of select="$PID"/>
</xsl:attribute>Edit
</a>
</div>
</xsl:if>
</td>
</tr>
</table>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

13
ilives/xsl/pageResults.xsl

@ -118,21 +118,26 @@
<td valign="top" width="16%"> <td valign="top" width="16%">
<a> <a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_viewer/<xsl:copy-of select="$PIDVALUE"/> <xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_viewer/
<xsl:copy-of select="$PIDVALUE"/>
</xsl:attribute> </xsl:attribute>
<img> <img>
<xsl:attribute name="alt">Thumbnail <xsl:copy-of select="$PIDVALUE"/></xsl:attribute> <xsl:attribute name="alt">Thumbnail
<xsl:copy-of select="$PIDVALUE"/>
</xsl:attribute>
<xsl:attribute name="src"> <xsl:attribute name="src">
<!--http://islandlives.ca:8080/adore-djatoka/resolver?url_ver=Z39.88-2004&amp;rft_id=http://islandlives.ca/fedora/repository/<xsl:copy-of select="$PIDVALUE"/>/JP2/jp2.jp2&amp;svc_id=info:lanl-repo/svc/getRegion&amp;svc_val_fmt=info:ofi/fmt:kev:mtx:jpeg2000&amp;svc.format=image/jpeg&amp;svc.level=0&amp;svc.rotate=0&amp;svc.region=0,0,100,100</xsl:attribute> <!--http://islandlives.ca:8080/adore-djatoka/resolver?url_ver=Z39.88-2004&amp;rft_id=http://islandlives.ca/fedora/repository/<xsl:copy-of select="$PIDVALUE"/>/JP2/jp2.jp2&amp;svc_id=info:lanl-repo/svc/getRegion&amp;svc_val_fmt=info:ofi/fmt:kev:mtx:jpeg2000&amp;svc.format=image/jpeg&amp;svc.level=0&amp;svc.rotate=0&amp;svc.region=0,0,100,100</xsl:attribute>
--> -->
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/repository/<xsl:copy-of select="$PIDVALUE"/>/TN <xsl:copy-of select="$OBJECTSPAGE"/>fedora/repository/
<xsl:copy-of select="$PIDVALUE"/>/TN
</xsl:attribute> </xsl:attribute>
</img> </img>
</a> </a>
<br /> <br />
<a> <a>
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_viewer/<xsl:value-of select="$PIDVALUE"/> <xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_viewer/
<xsl:value-of select="$PIDVALUE"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="substring-before($DCTITLE, '-')"/> <xsl:value-of select="substring-before($DCTITLE, '-')"/>
<br /> <br />

143
ilives/xsl/results.xsl

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:php="http://php.net/xsl" exclude-result-prefixes="php"> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:php="http://php.net/xsl" exclude-result-prefixes="php">
<xsl:variable name="OBJECTSPAGE"> <xsl:variable name="OBJECTSPAGE">
<xsl:value-of select="$objectsPage"/> <xsl:value-of select="$objectsPage"/>
</xsl:variable> </xsl:variable>
<xsl:variable name="ALLOWEDNAMESPACES" select="$allowedPidNameSpaces"/> <xsl:variable name="ALLOWEDNAMESPACES" select="$allowedPidNameSpaces"/>
<xsl:variable name="FULLQUERY" select="$fullQuery"/> <xsl:variable name="FULLQUERY" select="$fullQuery"/>
<!--<xsl:variable name="PATHTOMAKEIMAGE"> <!--<xsl:variable name="PATHTOMAKEIMAGE">
<xsl:value-of select="$pathToMakeImage"/> <xsl:value-of select="$pathToMakeImage"/>
</xsl:variable>--> </xsl:variable>-->
<xsl:template match="gfindObjects"> <xsl:template match="gfindObjects">
<xsl:variable name="INDEXNAME" select="@indexName"/> <xsl:variable name="INDEXNAME" select="@indexName"/>
<xsl:variable name="PREQUERY" select="substring-before(@query,':')"/> <xsl:variable name="PREQUERY" select="substring-before(@query,':')"/>
<xsl:variable name="QUERY" select="substring-after(@query,':')"/> <xsl:variable name="QUERY" select="substring-after(@query,':')"/>
@ -38,11 +38,15 @@
<xsl:variable name="HITPAGENO" select="ceiling($HITPAGESTART div $HITPAGESIZE)"/> <xsl:variable name="HITPAGENO" select="ceiling($HITPAGESTART div $HITPAGESIZE)"/>
<xsl:variable name="HITPAGENOLAST" select="ceiling($HITTOTAL div $HITPAGESIZE)"/> <xsl:variable name="HITPAGENOLAST" select="ceiling($HITTOTAL div $HITPAGESIZE)"/>
<xsl:variable name="HITPAGESTARTT" select="(($HITPAGENO - 1) * $HITPAGESIZE + 1)"/> <xsl:variable name="HITPAGESTARTT" select="(($HITPAGENO - 1) * $HITPAGESIZE + 1)"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$HITTOTAL > 0"> <xsl:when test="$HITTOTAL > 0">
Total Hits = <strong><xsl:value-of select="$HITTOTAL"/>,</strong> Total Hits =
Number of Hits/page = <xsl:value-of select="$HITPAGESIZE"/> <strong>
<xsl:value-of select="$HITTOTAL"/>,
</strong>
Number of Hits/page =
<xsl:value-of select="$HITPAGESIZE"/>
<!-- <br />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.--> <!-- <br />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.-->
<!--Current page = <xsl:value-of select="@hitPageStart"/>--> <!--Current page = <xsl:value-of select="@hitPageStart"/>-->
<br/> <br/>
@ -54,15 +58,24 @@
<xsl:if test="$HITPAGENO > 1"> <xsl:if test="$HITPAGENO > 1">
<li class="pager-previous"> <li class="pager-previous">
<a> <a>
<xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/<xsl:value-of select="$FULLQUERY"/>/<xsl:value-of select="$HITPAGESTARTT - $HITPAGESIZE"/></xsl:attribute> <xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/
<xsl:value-of select="$FULLQUERY"/>/
<xsl:value-of select="$HITPAGESTARTT - $HITPAGESIZE"/>
</xsl:attribute>
&lt; Previous &lt; Previous
</a> </a>
</li> </li>
</xsl:if><xsl:text> </xsl:text> </xsl:if>
<xsl:text> </xsl:text>
<xsl:if test="$HITPAGENO &lt; $HITPAGENOLAST"> <xsl:if test="$HITPAGENO &lt; $HITPAGENOLAST">
<li class="pager-next"> <li class="pager-next">
<a> <a>
<xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/<xsl:value-of select="$FULLQUERY"/>/<xsl:value-of select="$HITPAGESTARTT+$HITPAGESIZE"/></xsl:attribute> <xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/
<xsl:value-of select="$FULLQUERY"/>/
<xsl:value-of select="$HITPAGESTARTT+$HITPAGESIZE"/>
</xsl:attribute>
Next > Next >
</a> </a>
</li> </li>
@ -81,23 +94,32 @@
{ {
font-weight: bold font-weight: bold
} }
</style> </style>
<xsl:apply-templates select="objects"/> <xsl:apply-templates select="objects"/>
<xsl:if test="$HITTOTAL > $HITPAGESIZE"> <xsl:if test="$HITTOTAL > $HITPAGESIZE">
<div class="item-list"> <div class="item-list">
<ul class="pager"> <ul class="pager">
<xsl:if test="$HITPAGENO > 1"> <xsl:if test="$HITPAGENO > 1">
<li class="pager-previous"> <li class="pager-previous">
<a> <a>
<xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/<xsl:value-of select="$FULLQUERY"/>/<xsl:value-of select="$HITPAGESTARTT - $HITPAGESIZE"/></xsl:attribute> <xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/
<xsl:value-of select="$FULLQUERY"/>/
<xsl:value-of select="$HITPAGESTARTT - $HITPAGESIZE"/>
</xsl:attribute>
&lt; Previous &lt; Previous
</a> </a>
</li> </li>
</xsl:if><xsl:text> </xsl:text> </xsl:if>
<xsl:text> </xsl:text>
<xsl:if test="$HITPAGENO &lt; $HITPAGENOLAST"> <xsl:if test="$HITPAGENO &lt; $HITPAGENOLAST">
<li class="pager-next"> <li class="pager-next">
<a> <a>
<xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/<xsl:value-of select="$FULLQUERY"/>/<xsl:value-of select="$HITPAGESTARTT+$HITPAGESIZE"/></xsl:attribute> <xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives_book_search/
<xsl:value-of select="$FULLQUERY"/>/
<xsl:value-of select="$HITPAGESTARTT+$HITPAGESIZE"/>
</xsl:attribute>
Next > Next >
</a> </a>
</li> </li>
@ -105,33 +127,45 @@
</ul> </ul>
</div> </div>
</xsl:if> </xsl:if>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<div class="box"> <div class="box">
<h2>Your search yielded no results</h2> <h2>Your search yielded no results</h2>
<div class="content"><ul> <div class="content">
<li>Check if your spelling is correct.</li> <ul>
<li>Check if your spelling is correct.</li>
<li>Remove quotes around phrases to match each word individually: <em>"blue smurf"</em> will match less than <em>blue smurf</em>.</li> <li>Remove quotes around phrases to match each word individually:
<li>Consider loosening your query with <em>OR</em>: <em>blue smurf</em> will match less than <em>blue OR smurf</em>.</li> <em>"blue smurf"</em> will match less than
</ul></div> <em>blue smurf</em>.
</li>
<li>Consider loosening your query with
<em>OR</em>:
<em>blue smurf</em> will match less than
<em>blue OR smurf</em>.
</li>
</ul>
</div>
</div> </div>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="objects"> <xsl:template match="objects">
<table cellpadding="3" cellspacing="3" width="100%"><div class="search-results"> <table cellpadding="3" cellspacing="3" width="100%">
<tr><td colspan="2"> <div class="search-results">
<tr>
<td colspan="2">
</td></tr> </td>
</tr>
<xsl:for-each select="object"> <xsl:for-each select="object">
<xsl:variable name="PIDVALUE"> <xsl:variable name="PIDVALUE">
<xsl:choose> <xsl:choose>
@ -156,9 +190,10 @@
</xsl:for-each> </xsl:for-each>
</div></table> </div>
</table>
</xsl:template> </xsl:template>
<xsl:template name="splitBySpace"> <xsl:template name="splitBySpace">
<xsl:param name="str"/> <xsl:param name="str"/>
@ -199,7 +234,7 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template name="showResult"> <xsl:template name="showResult">
<xsl:param name="PIDVALUE"/> <xsl:param name="PIDVALUE"/>
<xsl:variable name="DCTITLE"> <xsl:variable name="DCTITLE">
@ -209,15 +244,21 @@
<xsl:variable name="CLEANTITLE"> <xsl:variable name="CLEANTITLE">
<xsl:value-of select="php:functionString('fedora_repository_urlencode_string', $DCTITLE)"/> <xsl:value-of select="php:functionString('fedora_repository_urlencode_string', $DCTITLE)"/>
</xsl:variable> </xsl:variable>
<tr><td valign="top"> <tr>
<td valign="top">
<a> <a>
<xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives/<xsl:copy-of select="$PIDVALUE"/>/<xsl:value-of select="$FULLQUERY"/> <xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives/
<xsl:copy-of select="$PIDVALUE"/>/
<xsl:value-of select="$FULLQUERY"/>
</xsl:attribute> </xsl:attribute>
<!--<xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/><![CDATA[&pid=]]><xsl:value-of select="$PIDVALUE"/><![CDATA[&collection=object]]> <!--<xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/><![CDATA[&pid=]]><xsl:value-of select="$PIDVALUE"/><![CDATA[&collection=object]]>
</xsl:attribute>--> </xsl:attribute>-->
<img> <img>
<xsl:attribute name="src"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/repository/<xsl:copy-of select="$PIDVALUE"/>/TN <xsl:attribute name="src">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/repository/
<xsl:copy-of select="$PIDVALUE"/>/TN
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="height">100</xsl:attribute> <xsl:attribute name="height">100</xsl:attribute>
</img> </img>
@ -234,17 +275,22 @@
<span class="searchtitle"> <span class="searchtitle">
<a> <a>
<xsl:attribute name="href"><xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives/<xsl:value-of select="$PIDVALUE"/>/<xsl:value-of select="$FULLQUERY"/> <xsl:attribute name="href">
<xsl:copy-of select="$OBJECTSPAGE"/>fedora/ilives/
<xsl:value-of select="$PIDVALUE"/>/
<xsl:value-of select="$FULLQUERY"/>
</xsl:attribute> </xsl:attribute>
<xsl:for-each select="field[@name='mods.title']"> <xsl:for-each select="field[@name='mods.title']">
<!-- <xsl:value-of select="substring-before(text(),'/')"/>--> <!-- <xsl:value-of select="substring-before(text(),'/')"/>-->
<xsl:value-of select="node()"/><xsl:text> </xsl:text> <xsl:value-of select="node()"/>
<xsl:text> </xsl:text>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="field[@name='mods.subTitle']"> <xsl:for-each select="field[@name='mods.subTitle']">
<span class="searchsubtitle"> <span class="searchsubtitle">
<xsl:text> : </xsl:text><xsl:value-of select="node()"/> <xsl:text> : </xsl:text>
<xsl:value-of select="node()"/>
</span> </span>
</xsl:for-each> </xsl:for-each>
@ -255,35 +301,40 @@
<xsl:for-each select="field[@name='mods.sor']"> <xsl:for-each select="field[@name='mods.sor']">
<span class="searchcreator"> <span class="searchcreator">
<xsl:text> / </xsl:text> <xsl:value-of select="node()"/> <xsl:text> / </xsl:text>
<xsl:value-of select="node()"/>
</span> </span>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="field[@name='mods.place_of_publication']"> <xsl:for-each select="field[@name='mods.place_of_publication']">
<span class="searchpop"> <span class="searchpop">
<xsl:text> </xsl:text> <xsl:value-of select="node()"/> <xsl:text> </xsl:text>
<xsl:value-of select="node()"/>
</span> </span>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="field[@name='mods.publisher']"> <xsl:for-each select="field[@name='mods.publisher']">
<span class="searchpop"> <span class="searchpop">
<xsl:text> : </xsl:text> <xsl:value-of select="node()"/> <xsl:text> : </xsl:text>
<xsl:value-of select="node()"/>
</span> </span>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="field[@name='mods.dateIssued']"> <xsl:for-each select="field[@name='mods.dateIssued']">
<span class="searchdateIssued"> <span class="searchdateIssued">
<xsl:text>, </xsl:text> <xsl:value-of select="node()"/>. <xsl:text>, </xsl:text>
<xsl:value-of select="node()"/>.
</span> </span>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="field[@name='mods.edition']"> <xsl:for-each select="field[@name='mods.edition']">
<span class="searchedition"> <span class="searchedition">
<xsl:text> </xsl:text> <xsl:value-of select="node()"/> <xsl:text> </xsl:text>
<xsl:value-of select="node()"/>
</span> </span>
</xsl:for-each> </xsl:for-each>
@ -339,6 +390,6 @@
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

1
islandoracm.xsd

@ -1,3 +1,4 @@
<xsd:schema xmlns="http://www.islandora.ca" xmlns:xsd="http://www.w3.org/2001/XMLSchema" <xsd:schema xmlns="http://www.islandora.ca" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.islandora.ca" elementFormDefault="qualified"> targetNamespace="http://www.islandora.ca" elementFormDefault="qualified">
<xsd:annotation> <xsd:annotation>

6
js/AC_Quicktime.js

@ -55,7 +55,7 @@ Copyright © 2006-2007 Apple Computer, Inc., All Rights Reserved
/************** LOCALIZABLE GLOBAL VARIABLES ****************/ /************** LOCALIZABLE GLOBAL VARIABLES ****************/
var gArgCountErr = 'The "%%" function requires an even number of arguments.' var gArgCountErr = 'The "%%" function requires an even number of arguments.'
+ '\nArguments should be in the form "atttributeName", "attributeValue", ...'; + '\nArguments should be in the form "atttributeName", "attributeValue", ...';
/******************** END LOCALIZABLE **********************/ /******************** END LOCALIZABLE **********************/
@ -64,7 +64,9 @@ var gQTGeneratorVersion = 1.2;
var gQTBehaviorID = "qt_event_source"; var gQTBehaviorID = "qt_event_source";
var gQTEventsEnabled = false; var gQTEventsEnabled = false;
function AC_QuickTimeVersion() { return gQTGeneratorVersion; } function AC_QuickTimeVersion() {
return gQTGeneratorVersion;
}
function _QTComplain(callingFcnName, errMsg) function _QTComplain(callingFcnName, errMsg)
{ {

23
js/printer_tool.js

@ -3,12 +3,19 @@
var PrinterTool = {}; var PrinterTool = {};
PrinterTool.windowSettings = 'toolbar=no,location=no,' + 'status=no,menu=no,scrollbars=yes,width=650,height=400'; 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. */ /** * 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; PrinterTool.print = function (tagID) {
if(!target || target.childNodes.length === 0) { alert("Nothing to Print"); return; var target = document.getElementById(tagID);
} var title = document.title;
var content = target.innerHTML; if(!target || target.childNodes.length === 0) {
var text = '<html><head><title>' + title + alert("Nothing to Print");
'</title><body>' + content +'</body></html>'; return;
printerWindow = window.open('', '', PrinterTool.windowSettings); printerWindow.document.open(); printerWindow.document.write(text); printerWindow.document.close(); }
printerWindow.print(); var content = target.innerHTML;
var text = '<html><head><title>' + title +
'</title><body>' + content +'</body></html>';
printerWindow = window.open('', '', PrinterTool.windowSettings);
printerWindow.document.open();
printerWindow.document.write(text);
printerWindow.document.close();
printerWindow.print();
}; };

51
js/swfobject.js

@ -10,23 +10,37 @@ if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object(); if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object(); if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) { deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
if (!document.getElementById) { return; } if (!document.getElementById) {
return;
}
this.DETECT_KEY = detectKey ? detectKey : 'detectflash'; this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY); this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params = new Object(); this.params = new Object();
this.variables = new Object(); this.variables = new Object();
this.attributes = new Array(); this.attributes = new Array();
if(swf) { this.setAttribute('swf', swf); } if(swf) {
if(id) { this.setAttribute('id', id); } this.setAttribute('swf', swf);
if(w) { this.setAttribute('width', w); } }
if(h) { this.setAttribute('height', h); } if(id) {
if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); } 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(); this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
if (!window.opera && document.all && this.installedVer.major > 7) { 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 // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
deconcept.SWFObject.doPrepUnload = true; deconcept.SWFObject.doPrepUnload = true;
} }
if(c) { this.addParam('bgcolor', c); } if(c) {
this.addParam('bgcolor', c);
}
var q = quality ? quality : 'high'; var q = quality ? quality : 'high';
this.addParam('quality', q); this.addParam('quality', q);
this.setAttribute('useExpressInstall', false); this.setAttribute('useExpressInstall', false);
@ -34,7 +48,9 @@ deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, re
var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location; var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
this.setAttribute('xiRedirectUrl', xir); this.setAttribute('xiRedirectUrl', xir);
this.setAttribute('redirectUrl', ''); this.setAttribute('redirectUrl', '');
if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); } if(redirectUrl) {
this.setAttribute('redirectUrl', redirectUrl);
}
} }
deconcept.SWFObject.prototype = { deconcept.SWFObject.prototype = {
useExpressInstall: function(path) { useExpressInstall: function(path) {
@ -81,9 +97,13 @@ deconcept.SWFObject.prototype = {
swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"'; swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" '; swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
var params = this.getParams(); var params = this.getParams();
for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; } for(var key in params){
swfNode += [key] +'="'+ params[key] +'" ';
}
var pairs = this.getVariablePairs().join("&"); var pairs = this.getVariablePairs().join("&");
if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; } if (pairs.length > 0){
swfNode += 'flashvars="'+ pairs +'"';
}
swfNode += '/>'; swfNode += '/>';
} else { // PC IE } else { // PC IE
if (this.getAttribute("doExpressInstall")) { if (this.getAttribute("doExpressInstall")) {
@ -97,7 +117,9 @@ deconcept.SWFObject.prototype = {
swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />'; swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
} }
var pairs = this.getVariablePairs().join("&"); var pairs = this.getVariablePairs().join("&");
if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';} if(pairs.length > 0) {
swfNode += '<param name="flashvars" value="'+ pairs +'" />';
}
swfNode += "</object>"; swfNode += "</object>";
} }
return swfNode; return swfNode;
@ -209,7 +231,12 @@ if (deconcept.SWFObject.doPrepUnload) {
window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload); window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
} }
/* add Array.push if needed (ie5) */ /* 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 */ /* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter; var getQueryParamValue = deconcept.util.getRequestParameter;

12
plugins/CollectionFormBuilder.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/* /*
@ -9,7 +10,9 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
* implements methods from content model ingest form xml * implements methods from content model ingest form xml
* builds a dc metadata form * builds a dc metadata form
*/ */
class CollectionFormBuilder extends FormBuilder { class CollectionFormBuilder extends FormBuilder {
function CollectionFormBuilder() { function CollectionFormBuilder() {
module_load_include('inc', 'CollectionFormBuilder', ''); module_load_include('inc', 'CollectionFormBuilder', '');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
@ -21,9 +24,9 @@ class CollectionFormBuilder extends FormBuilder {
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;
$file=$form_values['ingest-file-location']; $file = $form_values['ingest-file-location'];
$dformat = $mimetype->getType($file); $dformat = $mimetype->getType($file);
$fileUrl = $base_url . '/'. drupal_urlencode($file); $fileUrl = $base_url . '/' . drupal_urlencode($file);
$beginIndex = strrpos($fileUrl, '/'); $beginIndex = strrpos($fileUrl, '/');
$dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = substr($fileUrl, $beginIndex + 1);
$dtitle = substr($dtitle, 0, strpos($dtitle, ".")); $dtitle = substr($dtitle, 0, strpos($dtitle, "."));
@ -31,7 +34,7 @@ class CollectionFormBuilder extends FormBuilder {
$ds1->setAttribute("ID", "COLLECTION_POLICY"); //set the ID $ds1->setAttribute("ID", "COLLECTION_POLICY"); //set the ID
$ds1->setAttribute("STATE", "A"); $ds1->setAttribute("STATE", "A");
$ds1->setAttribute("CONTROL_GROUP", "M"); $ds1->setAttribute("CONTROL_GROUP", "M");
$ds1v= $dom->createElement("foxml:datastreamVersion"); $ds1v = $dom->createElement("foxml:datastreamVersion");
$ds1v->setAttribute("ID", "COLLECTION_POLICY.0"); $ds1v->setAttribute("ID", "COLLECTION_POLICY.0");
$ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("MIMETYPE", "$dformat");
$ds1v->setAttribute("LABEL", "$dtitle"); $ds1v->setAttribute("LABEL", "$dtitle");
@ -42,4 +45,5 @@ class CollectionFormBuilder extends FormBuilder {
$ds1v->appendChild($ds1content); $ds1v->appendChild($ds1content);
$rootElement->appendChild($ds1); $rootElement->appendChild($ds1);
} }
} }

7
plugins/CreateCollection.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
/* /*
* *
@ -8,8 +9,8 @@
*/ */
class CreateCollection { class CreateCollection {
function CreateCollection() {
function CreateCollection() {
} }
@ -17,6 +18,4 @@ class CreateCollection {
return TRUE; //nothing needed here as we are not transforming any files return TRUE; //nothing needed here as we are not transforming any files
} }
} }

15
plugins/DarwinCore.inc

@ -1,6 +1,6 @@
<?php <?php
// $Id$
class DarwinCore { class DarwinCore {
@ -8,7 +8,7 @@ class DarwinCore {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
if (!empty($item)) { if (!empty($item)) {
$this->owner = $item; $this->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'); $dwc = $item->get_datastream_dissemination('DARWIN_CORE');
if (!empty($dwc)) { if (!empty($dwc)) {
$this->darwinCoreXML = $dwc; $this->darwinCoreXML = $dwc;
@ -213,7 +213,7 @@ class DarwinCore {
} }
public function asHTML() { 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', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
@ -226,8 +226,7 @@ class DarwinCore {
try { try {
$proc = new XsltProcessor(); $proc = new XsltProcessor();
} } catch (Exception $e) {
catch (Exception $e) {
drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error');
return " "; return " ";
} }
@ -238,7 +237,7 @@ class DarwinCore {
$input->loadXML(trim($xmlstr)); $input->loadXML(trim($xmlstr));
$xsl = $proc->importStylesheet($xsl); $xsl = $proc->importStylesheet($xsl);
$newdom = $proc->transformToDoc($input); $newdom = $proc->transformToDoc($input);
$content=$newdom->saveXML(); $content = $newdom->saveXML();
return $content; return $content;
} }
@ -256,9 +255,7 @@ class DarwinCore {
'MachineObservation' => 'MachineObservation', 'MachineObservation' => 'MachineObservation',
'NomenclaturalChecklist' => 'NomenclaturalChecklist', 'NomenclaturalChecklist' => 'NomenclaturalChecklist',
), ),
); );
public $dwcFields = array( public $dwcFields = array(
'dc:type', 'dc:type',
'dc:language', 'dc:language',
@ -283,8 +280,6 @@ class DarwinCore {
'dwc:eventDate', 'dwc:eventDate',
'dwc:eventTime', 'dwc:eventTime',
); );
public $darwinCoreXML = ' public $darwinCoreXML = '
<SimpleDarwinRecordSet xmlns="http://rs.tdwg.org/dwc/xsd/simpledarwincore/" xmlns:dc="http://purl.org/dc/terms/" xmlns:dwc="http://rs.tdwg.org/dwc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rs.tdwg.org/dwc/xsd/simpledarwincore/ http://rs.tdwg.org/dwc/xsd/tdwg_dwc_simple.xsd"> <SimpleDarwinRecordSet xmlns="http://rs.tdwg.org/dwc/xsd/simpledarwincore/" xmlns:dc="http://purl.org/dc/terms/" xmlns:dwc="http://rs.tdwg.org/dwc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rs.tdwg.org/dwc/xsd/simpledarwincore/ http://rs.tdwg.org/dwc/xsd/tdwg_dwc_simple.xsd">
<SimpleDarwinRecord> <SimpleDarwinRecord>

14
plugins/DemoFormBuilder.inc

@ -1,5 +1,6 @@
<?php <?php
// $Id$
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/* /*
@ -9,7 +10,9 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
* implements methods from content model ingest form xml * implements methods from content model ingest form xml
* builds a dc metadata form * builds a dc metadata form
*/ */
class DemoFormBuilder extends FormBuilder { class DemoFormBuilder extends FormBuilder {
function DemoFormBuilder() { function DemoFormBuilder() {
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
@ -21,11 +24,11 @@ class DemoFormBuilder extends FormBuilder {
global $base_url; global $base_url;
$mimetype = new MimeClass(); $mimetype = new MimeClass();
$server = NULL; $server = NULL;
$file=$form_values['ingest-file-location']; $file = $form_values['ingest-file-location'];
if (!empty($file)) { if (!empty($file)) {
$dformat = $mimetype->getType($file); $dformat = $mimetype->getType($file);
$fileUrl = $base_url .'/'. drupal_urlencode($file); $fileUrl = $base_url . '/' . drupal_urlencode($file);
$beginIndex = strrpos($fileUrl, '/'); $beginIndex = strrpos($fileUrl, '/');
$dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = substr($fileUrl, $beginIndex + 1);
$dtitle = urldecode($dtitle); $dtitle = urldecode($dtitle);
@ -50,7 +53,7 @@ class DemoFormBuilder extends FormBuilder {
foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) {
$createdFile = strstr($createdFile, $file); $createdFile = strstr($createdFile, $file);
$dformat = $mimetype->getType($createdFile); $dformat = $mimetype->getType($createdFile);
$fileUrl = $base_url .'/'. drupal_urlencode( $createdFile ); $fileUrl = $base_url . '/' . drupal_urlencode($createdFile);
$beginIndex = strrpos($fileUrl, '/'); $beginIndex = strrpos($fileUrl, '/');
$dtitle = substr($fileUrl, $beginIndex + 1); $dtitle = substr($fileUrl, $beginIndex + 1);
$dtitle = urldecode($dtitle); $dtitle = urldecode($dtitle);
@ -60,7 +63,7 @@ class DemoFormBuilder extends FormBuilder {
$ds1->setAttribute("ID", "$dsid"); $ds1->setAttribute("ID", "$dsid");
$ds1->setAttribute("STATE", "A"); $ds1->setAttribute("STATE", "A");
$ds1->setAttribute("CONTROL_GROUP", "M"); $ds1->setAttribute("CONTROL_GROUP", "M");
$ds1v= $dom->createElement("foxml:datastreamVersion"); $ds1v = $dom->createElement("foxml:datastreamVersion");
$ds1v->setAttribute("ID", "$dsid.0"); $ds1v->setAttribute("ID", "$dsid.0");
$ds1v->setAttribute("MIMETYPE", "$dformat"); $ds1v->setAttribute("MIMETYPE", "$dformat");
$ds1v->setAttribute("LABEL", "$dtitle"); $ds1v->setAttribute("LABEL", "$dtitle");
@ -73,5 +76,6 @@ class DemoFormBuilder extends FormBuilder {
} }
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save