Browse Source

switched to islandora repository

pull/43/head
Ben Woodhead 13 years ago
parent
commit
ab131a672f
  1. 14
      api/fedora_collection.inc
  2. 4
      api/fedora_export.inc
  3. 10
      api/fedora_item.inc
  4. 12
      api/fedora_utils.inc
  5. 9
      islandora_repository.info
  6. 107
      islandora_repository.install
  7. 2251
      islandora_repository.module
  8. 10
      islandoracm.xsd
  9. 4
      plugins/CollectionFormBuilder.inc
  10. 8
      plugins/DarwinCore.inc
  11. 6
      plugins/DemoFormBuilder.inc
  12. 2
      plugins/DocumentConverter.inc
  13. 2
      plugins/Exiftool.inc
  14. 12
      plugins/FedoraObjectDetailedContent.inc
  15. 2
      plugins/Flv.inc
  16. 6
      plugins/FlvFormBuilder.inc
  17. 8
      plugins/FormBuilder.inc
  18. 2
      plugins/ImageManipulation.inc
  19. 16
      plugins/ModsFormBuilder.inc
  20. 2
      plugins/PersonalCollectionClass.inc
  21. 4
      plugins/QtFormBuilder.php
  22. 12
      plugins/Refworks.inc
  23. 18
      plugins/ShowStreamsInFieldSets.inc
  24. 28
      plugins/herbarium.inc
  25. 7
      plugins/islandora_imageapi.info
  26. 116
      plugins/islandora_imageapi.module
  27. 10
      plugins/map_viewer.inc
  28. 6
      plugins/qt_viewer.inc
  29. 6
      plugins/slide_viewer.inc
  30. 22
      plugins/tagging_form.inc
  31. 2
      tests/README_TESTING.txt
  32. 20
      tests/fedora_repository.test

14
api/fedora_collection.inc

@ -4,10 +4,10 @@
* @file
* Operations that affect a Fedora repository at a collection level.
*/
module_load_include('inc', 'fedora_repository', 'CollectionClass');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('module', 'fedora_repository');
module_load_include('inc', 'islandora_repository', 'CollectionClass');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils');
module_load_include('module', 'islandora_repository');
/**
* Exports a fedora collection object and all of its children in a format
@ -68,10 +68,10 @@ function export_collection($collection_pid, $relationship = 'isMemberOfCollectio
* @param <type> $query_format R
*/
function get_related_items_as_xml($collection_pid, $relationship = array('isMemberOfCollection'), $limit = 10000, $offset = 0, $active_objects_only = TRUE, $cmodel = NULL, $orderby = '$title') {
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'ObjectHelper');
global $user;
if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
if (!islandora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied."), 'error');
return array();
}
@ -111,7 +111,7 @@ function get_related_items_as_xml($collection_pid, $relationship = array('isMemb
$content = '';
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=TRUE&format=Sparql&limit=$limit&offset=$offset&lang=itql&stream=on&query=" . $query_string;
$content .= do_curl($url);

4
api/fedora_export.inc

@ -41,7 +41,7 @@ function export_to_export_area($pid, $foxml_dir, $ob_dir, &$log = array()) {
* @return string
*/
function export_objects_for_pid($pid, $dir, &$log) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$item = new Fedora_Item($pid);
if (!$object = $item->get_datastreams_list_as_SimpleXML($pid)) {
$log[] = log_line(t("Failed to get datastream %dsid for pid %pid", array('%dsid' => $ds->ID, '%pid' => $pid)), 'error');
@ -85,7 +85,7 @@ function export_objects_for_pid($pid, $dir, &$log) {
* @return type
*/
function export_foxml_for_pid($pid, $dir, $paths, &$log, $format = FOXML_11, $remove_islandora = FALSE) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'ObjectHelper');
$ob_helper = new ObjectHelper();
if (!$object_xml = $ob_helper->getObject($pid, 'migrate', $format)) {
$log[] = log_line(t("Failed to get foxml for %pid", array('%pid' => $pid)), 'error');

10
api/fedora_item.inc

@ -28,8 +28,8 @@ class Fedora_Item {
*/
function __construct($pid) {
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'islandora_repository', 'ConnectionHelper');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils');
$this->pid = $pid;
if (isset(Fedora_Item::$instantiated_pids[$pid])) {
@ -75,7 +75,7 @@ class Fedora_Item {
* @return type
*/
function add_datastream_from_file($datastream_file, $datastream_id, $datastream_label = NULL, $datastream_mimetype = '', $controlGroup = 'M', $logMessage = NULL) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
if (!is_file($datastream_file)) {
drupal_set_message("$datastream_file not found<br />", 'warning');
return;
@ -285,7 +285,7 @@ class Fedora_Item {
* @return Array of pid => title pairs that match the results
*/
static function find_objects_by_pattern($pattern = '*', $field = 'pid', $max_results = 100, $resultFields = array()) {
module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils');
$pattern = drupal_urlencode($pattern);
$done = FALSE;
@ -848,7 +848,7 @@ class Fedora_Item {
*/
static function soap_call($function_name, $params_array, $quiet = FALSE) {
if (!self::$connection_helper) {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
module_load_include('inc', 'islandora_repository', 'ConnectionHelper');
self::$connection_helper = new ConnectionHelper();
}
switch ($function_name) {

12
api/fedora_utils.inc

@ -158,7 +158,7 @@ function fedora_available() {
*/
function risearch_available() {
$response = do_curl_ext(variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'));
$response = do_curl_ext(variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch'));
return ($response != NULL) ? ($response[1] == 0): FALSE;
}
@ -238,13 +238,13 @@ function fix_dsid($dsid) {
* @return array
*/
function get_collections_as_option_array() {
module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils');
$query = 'select $object $title from <#ri>
where ($object <dc:title> $title
and $object <info:fedora/fedora-system:def/model#hasModel> <info:fedora/islandora:collectionCModel>
and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
order by $title';
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query=";
$content = do_curl($url . htmlentities(urlencode($query)));
$list = explode("\n", $content);
@ -269,8 +269,8 @@ function get_collections_as_option_array() {
* @return array
*/
function get_content_models_as_option_array() {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_utils');
$restricted = variable_get('fedora_namespace_restriction_enforced', true);
$allowed_string = variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora:');
$namespaces = explode(':', $allowed_string);
@ -286,7 +286,7 @@ function get_content_models_as_option_array() {
and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
order by $title';
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url = variable_get('islandora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=true&format=csv&limit=1000&lang=itql&stream=on&query=";
$content = do_curl($url . htmlentities(urlencode($query)));
$list = explode("\n", $content);

9
islandora_repository.info

@ -0,0 +1,9 @@
; $Id$
name = Islandora Repository
dependencies[] = imageapi
dependencies[] = tabs
dependencies[] = islandora_content_model_forms
description = Shows a list of items in a fedora collection.
package = Islandora
version = 11.2.beta2
core = 6.x

107
islandora_repository.install

@ -0,0 +1,107 @@
<?php
/**
* @file islandora_repository.install
*/
/**
* Implementation of hook_enable().
*/
function fedora_collections_enable() {
//nothing to do as we do not currently touch the drupal database.
//other than the variables table
}
/**
* Implementation of hook_requirements().
*
* @return
* An array describing the status of the site regarding available updates.
* If there is no update data, only one record will be returned, indicating
* that the status of core can't be determined. If data is available, there
* will be two records: one for core, and another for all of contrib
* (assuming there are any contributed modules or themes enabled on the
* site). In addition to the fields expected by hook_requirements ('value',
* 'severity', and optionally 'description'), this array will contain a
* 'reason' attribute, which is an integer constant to indicate why the
* given status is being returned (UPDATE_NOT_SECURE, UPDATE_NOT_CURRENT, or
* UPDATE_UNKNOWN). This is used for generating the appropriate e-mail
* notification messages during update_cron(), and might be useful for other
* modules that invoke update_requirements() to find out if the site is up
* to date or not.
*
* @see _update_message_text()
* @see _update_cron_notify()
*/
function islandora_repository_requirements($phase) {
global $base_url;
$requirements = array();
if ($phase == 'install') {
// Test for SOAP
$requirements['fedora-soap']['title'] = t("PHP SOAP extension library");
if (!class_exists('SoapClient')) {
$requirements['fedora-soap']['value'] = t("Not installed");
$requirements['fedora-soap']['severity'] = REQUIREMENT_ERROR;
$requirements['fedora-soap']['description'] = t('Ensure that the PHP SOAP extension is installed.');
}
else {
$requirements['fedora-soap']['value'] = t("Installed");
$requirements['fedora-soap']['severity'] = REQUIREMENT_OK;
}
// Test for Curl
$requirements['curl']['title'] = "PHP Curl extension library";
if (!function_exists('curl_init')) {
$requirements['curl']['value'] = t("Not installed");
$requirements['curl']['severity'] = REQUIREMENT_ERROR;
$requirements['curl']['description'] = t("Ensure that the PHP Curl extension is installed.");
}
else {
$requirements['curl']['value'] = t("Installed");
$requirements['curl']['severity'] = REQUIREMENT_OK;
}
// Test for DOM
$requirements['dom']['title'] = "PHP DOM XML extension library";
if (!method_exists('DOMDocument', 'loadHTML')) {
$requirements['dom']['value'] = t("Not installed");
$requirements['dom']['severity'] = REQUIREMENT_ERROR;
$requirements['dom']['description'] = t("Ensure that the PHP DOM XML extension is installed.");
}
else {
$requirements['dom']['value'] = t("Installed");
$requirements['dom']['severity'] = REQUIREMENT_OK;
}
// Test for XSLT
$requirements['xsl']['title'] = "PHP XSL extension library";
if (!class_exists('XSLTProcessor')) {
$requirements['xslt']['value'] = t("Not installed");
$requirements['xslt']['severity'] = REQUIREMENT_ERROR;
$requirements['xslt']['description'] = t("Ensure that the PHP XSL extension is installed.");
}
else {
$requirements['xslt']['value'] = t("Installed");
$requirements['xslt']['severity'] = REQUIREMENT_OK;
}
}
elseif ($phase == 'runtime') {
module_load_include('inc', 'islandora_repository', 'api/fedora_utils');
$requirements['fedora-repository']['title'] = t("Fedora server");
if (!fedora_available()) {
$requirements['fedora-repository']['value'] = t("Not available");
$requirements['fedora-repository']['severity'] = REQUIREMENT_ERROR;
$requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/islandora_repository'));
}
else {
$requirements['fedora-repository']['value'] = t("Available");
$requirements['fedora-repository']['severity'] = REQUIREMENT_OK;
}
}
return $requirements;
}

2251
islandora_repository.module

File diff suppressed because it is too large Load Diff

10
islandoracm.xsd

@ -48,14 +48,14 @@
</xsd:complexType>
<xsd:complexType name="form_builder_methodType">
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="handler" type="xsd:normalizedString" use="required"/>
</xsd:complexType>
<xsd:complexType name="edit_metadata_methodType">
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="handler" type="xsd:normalizedString" use="required"/>
@ -118,7 +118,7 @@
</xsd:all>
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/>
@ -149,7 +149,7 @@
<xsd:element name="parameters" type="parametersType" minOccurs="0"/>
</xsd:all>
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="dsid" type="xsd:normalizedString" use="required"/>
@ -171,7 +171,7 @@
<xsd:complexContent>
<xsd:restriction base="xsd:anyType">
<xsd:attribute name="file" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="fedora_repository"/>
<xsd:attribute name="module" type="xsd:normalizedString" default="islandora_repository"/>
<xsd:attribute name="class" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="method" type="xsd:normalizedString" use="required"/>
<xsd:attribute name="default" type="xsd:boolean" default="false"/>

4
plugins/CollectionFormBuilder.inc

@ -7,7 +7,7 @@
* Collection Form Builder
*/
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder');
/**
* implements methods from content model ingest form xml
@ -32,7 +32,7 @@ class CollectionFormBuilder extends FormBuilder {
* @param type $rootElement
*/
function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
global $base_url;
$mimetype = new MimeClass();

8
plugins/DarwinCore.inc

@ -21,7 +21,7 @@ class DarwinCore {
* @param type $item
*/
function __construct($item = NULL) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
if (!empty($item)) {
$this->owner = $item;
if (array_key_exists('DARWIN_CORE', $item->get_datastreams_list_as_array())) {
@ -200,7 +200,7 @@ class DarwinCore {
* @param type $form_values
*/
public function handleForm($form_values) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
global $user;
//$new_item = Fedora_Item::ingest_new_item($form_values['pid'], 'A', $form_values['dwc:institutionCode'].':'.$form_values['dwc:collectionCode'].':'.$form_values['dwc:catalogNumber'], $user->name);
//$new_item->add_datastream_from_string($this->darwinCoreXML, 'DARWIN_CORE', 'Darwin Core Metadata', 'text/xml', 'X');
@ -248,8 +248,8 @@ class DarwinCore {
*/
public function asHTML() {
$path = drupal_get_path('module', 'Fedora_Repository');
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'CollectionClass');
module_load_include('inc', 'islandora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'CollectionClass');
$xmlstr = $this->darwinCoreXML;
html_entity_decode($xmlstr);

6
plugins/DemoFormBuilder.inc

@ -6,7 +6,7 @@
* @file
*
*/
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder');
/**
* implements methods from content model ingest form xml
@ -19,7 +19,7 @@ class DemoFormBuilder extends FormBuilder {
* Constructor
*/
function DemoFormBuilder() {
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
@ -31,7 +31,7 @@ class DemoFormBuilder extends FormBuilder {
* @param type $rootElement
*/
function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
global $base_url;
$mimetype = new MimeClass();
$server = NULL;

2
plugins/DocumentConverter.inc

@ -32,7 +32,7 @@ class DocumentConverter {
* @return string
*/
function convert($parameterArray = NULL, $dsid, $file, $output_ext) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
#debug:
#drupal_set_message("Sending $file to ". $this->converter_service_url ." for convertsion to $output_ext", 'status');

2
plugins/Exiftool.inc

@ -22,7 +22,7 @@ class Exiftool {
function __construct($pid) {
//drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$this->pid = $pid;
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$this->item = new Fedora_Item($this->pid);
}

12
plugins/FedoraObjectDetailedContent.inc

@ -19,7 +19,7 @@ class FedoraObjectDetailedContent {
* @param type $pid
*/
function __construct($pid = '') {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
if (!empty($pid)) {
$this->pid = $pid;
@ -36,9 +36,9 @@ class FedoraObjectDetailedContent {
global $user;
$objectHelper = new ObjectHelper();
$tabset = array();
$show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form');
$show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_form');
$purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path()))));
$show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_purge_object_form');
$show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'islandora_repository_edit_qdc_form');
$purge_form = drupal_get_form('islandora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path()))));
$tabset['fedora_object_details'] = array(
'#type' => 'tabpage',
@ -59,8 +59,8 @@ class FedoraObjectDetailedContent {
'#content' => $dc_html . $ds_list . $purge_form,
);
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC');
if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DC');
$tabset['fedora_object_details']['tabset']['edit'] = array(
'#type' => 'tabpage',
'#title' => t('Edit'),

2
plugins/Flv.inc

@ -138,7 +138,7 @@ class FormBuilder {
* @param type $rootElement
*/
function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
$mimetype = new MimeClass();
$server = NULL;
$file = $form_values['ingest-file-location'];

6
plugins/FlvFormBuilder.inc

@ -6,7 +6,7 @@
* @file
* FLVFormBuilder
*/
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder');
/**
* implements methods from content model ingest form xml
@ -19,7 +19,7 @@ class FlvFormBuilder extends FormBuilder {
* Constructor
*/
function FlvFormBuilder() {
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
@ -32,7 +32,7 @@ class FlvFormBuilder extends FormBuilder {
*/
function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
global $base_url;
$mimetype = new MimeClass();
$server = NULL;

8
plugins/FormBuilder.inc

@ -84,7 +84,7 @@ class FormBuilder {
* @return type
*/
function createPolicy($collectionPid, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'ObjectHelper');
$objectHelper = new ObjectHelper();
$dsid = 'CHILD_SECURITY';
@ -135,8 +135,8 @@ class FormBuilder {
* @return type
*/
function handleQDCForm($form_values) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'CollectionPolicy');
$dom = new DomDocument("1.0", "UTF-8");
$dom->formatOutput = TRUE;
@ -196,7 +196,7 @@ class FormBuilder {
* @param type $rootElement
*/
function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
global $base_url;
$mimetype = new MimeClass();
$server = NULL;

2
plugins/ImageManipulation.inc

@ -16,7 +16,7 @@ class ImageManipulation {
* Constructor
*/
function ImageManipulation() {
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'ObjectHelper');
}
/**

16
plugins/ModsFormBuilder.inc

@ -6,7 +6,7 @@
* @file
* ModsFormBuilder class
*/
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder');
/**
* ModsFormBuilder class ???
@ -25,8 +25,8 @@ class ModsFormBuilder extends FormBuilder {
function __construct($pid=NULL) {
parent::__construct();
if ($pid !== NULL) {
module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'ContentModel');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$this->pid = $pid;
$this->cm = ContentModel::loadFromObject($pid);
@ -241,7 +241,7 @@ class ModsFormBuilder extends FormBuilder {
$form['submit'] = array(
'#type' => 'submit',
'#submit' => array('fedora_repository_edit_qdc_form_submit'),
'#submit' => array('islandora_repository_edit_qdc_form_submit'),
'#value' => 'Save Metadata'
);
@ -256,8 +256,8 @@ class ModsFormBuilder extends FormBuilder {
* @param &$form_state
*/
function handleModsForm(&$form_values, &$form_state) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'CollectionPolicy');
$form_state['storage']['people'] = NULL; //clears out old entities for the next run of the formbuilder.
@ -329,7 +329,7 @@ class ModsFormBuilder extends FormBuilder {
* @param &$rootElement
*/
function createCollectionPolicy($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$model = new fedora_item($form_values['content_model_pid']);
$ds_list = $model->get_datastreams_list_as_array();
if (isset($ds_list['COLLECTION_POLICY_TMPL'])) {
@ -364,7 +364,7 @@ class ModsFormBuilder extends FormBuilder {
* @param &$rootElement
*/
function createWorkflowStream($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$model = new fedora_item($form_values['content_model_pid']);
$ds_list = $model->get_datastreams_list_as_array();
if (isset($ds_list['WORKFLOW_TMPL'])) {

2
plugins/PersonalCollectionClass.inc

@ -120,7 +120,7 @@ class PersonalCollectionClass {
* @return type
*/
function createPolicyStream($user, $dom, $rootElement) {
module_load_include('inc', 'fedora_repository', 'SecurityClass');
module_load_include('inc', 'islandora_repository', 'SecurityClass');
$securityClass = new SecurityClass();
$policyStreamDoc = $securityClass->createPersonalPolicy($user);

4
plugins/QtFormBuilder.php

@ -6,7 +6,7 @@
* @file
* QTFormBuilder class
*/
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
module_load_include('inc', 'islandora_repository', 'plugins/FormBuilder');
/**
* Implements methods from content model ingest form xml
@ -30,7 +30,7 @@ class QtFormBuilder extends FormBuilder {
* @param type $rootElement
*/
function createFedoraDataStreams($form_values, &$dom, &$rootElement) {
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
global $base_url;
$mimetype = new MimeClass();
$server = null;

12
plugins/Refworks.inc

@ -7,7 +7,7 @@
* Refworks class
*/
module_load_include('inc', 'fedora_repository', 'SecurityClass');
module_load_include('inc', 'islandora_repository', 'SecurityClass');
/**
* Refworks class ???
@ -222,9 +222,9 @@ class Refworks {
*/
function handleForm(&$form_values) {
$errorMessage = NULL;
module_load_include('inc', 'fedora_repository', 'CollectionClass');
module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'CollectionClass');
module_load_include('inc', 'islandora_repository', 'ContentModel');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$contentModelPid = ContentModel::getPidFromIdentifier($form_values['models']);
$contentModelDsid = ContentModel::getDSIDFromIdentifier($form_values['models']);
$collectionHelper = new CollectionClass();
@ -238,7 +238,7 @@ class Refworks {
$collection_item = new Fedora_Item($collection_pid);
$this->collectionPolicyStream = $collection_item->get_datastream_dissemination('CHILD_SECURITY');
if (empty($this->collectionPolicyStream)) {
$this->collectionPolicyStream = file_get_contents(drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml');
$this->collectionPolicyStream = file_get_contents(drupal_get_path('module', 'islandora_repository') . '/policies/noObjectEditPolicy.xml');
}
$success = 0;
$errors = 0;
@ -388,7 +388,7 @@ class Refworks {
*/
function createFedoraDataStreams($form_values, &$dom, &$rootElement, $reference) {
global $base_url;
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'MimeClass');
$mimetype = new MimeClass();
$server = NULL;
$this->createRomeoDataStream($dom, $rootElement);

18
plugins/ShowStreamsInFieldSets.inc

@ -87,7 +87,7 @@ class ShowStreamsInFieldSets {
global $base_url;
global $base_path;
global $user;
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$tabset = array();
@ -105,7 +105,7 @@ class ShowStreamsInFieldSets {
$tn_url = $base_url . '/fedora/repository/' . $item->pid . '/TN';
}
else {
$tn_url = $base_path . drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_app_download_manager.png';
$tn_url = $base_path . drupal_get_path('module', 'islandora_repository') . '/images/Crystal_Clear_app_download_manager.png';
}
$dc_html = $objectHelper->getFormattedDC($item);
@ -117,8 +117,8 @@ class ShowStreamsInFieldSets {
'#content' => $dl_link . $dc_html,
);
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DC');
if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DC');
$tabset['first_tab']['tabs']['edit'] = array(
'#type' => 'tabpage',
'#title' => t('Edit'),
@ -142,7 +142,7 @@ class ShowStreamsInFieldSets {
* @return type
*/
function showQdc() {
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'ObjectHelper');
$objectHelper = new ObjectHelper();
$content = $objectHelper->getQDC($this->pid);
$collection_fieldset = array(
@ -161,7 +161,7 @@ class ShowStreamsInFieldSets {
*/
function showOBJLink() {
global $base_url;
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$item = new Fedora_Item($this->pid);
$streams = $item->get_datastreams_list_as_array();
return "<a href='" . $base_url . "/fedora/repository/" . $this->pid . "/OBJ/" . $streams['OBJ']['label'] . "'>" . $streams['OBJ']['label'] . "</a>";
@ -172,8 +172,8 @@ class ShowStreamsInFieldSets {
* @return type
*/
function showRefworks() {
$path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$path = drupal_get_path('module', 'islandora_repository');
module_load_include('inc', 'islandora_repository', 'ObjectHelper');
$collectionHelper = new CollectionClass();
$xmlstr = $collectionHelper->getStream($this->pid, "refworks");
html_entity_decode($xmlstr);
@ -226,7 +226,7 @@ class ShowStreamsInFieldSets {
*/
function showRomeo($collapsed = FALSE) {
$path = drupal_get_path('module', 'Fedora_Repository');
module_load_include('inc', 'fedora_repository', 'CollectionClass');
module_load_include('inc', 'islandora_repository', 'CollectionClass');
$collectionHelper = new CollectionClass();
$xmlstr = $collectionHelper->getStream($this->pid, "ROMEO", 0);

28
plugins/herbarium.inc

@ -16,7 +16,7 @@
class Herbarium {
function __construct($pid = '') {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
if (!empty($pid)) {
$this->pid = $pid;
$this->item = new Fedora_Item($pid);
@ -32,7 +32,7 @@ class Herbarium {
public function buildDrupalForm($form = array(), $form_state = array()) {
// We don't need to add anything beyond the standard Darwin Core form so just pass this through
// If we wanted to we could add other fields.
module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore');
$dwc = new DarwinCore($this->item);
return $dwc->buildDrupalForm($form);
@ -73,9 +73,9 @@ class Herbarium {
* Process the metadata form
* Update the datastreams
*/
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore');
module_load_include('inc', 'islandora_repository', 'MimeClass');
global $user;
$mimetype = new MimeClass();
$dwc = new DarwinCore($this->item);
@ -97,9 +97,9 @@ class Herbarium {
* Create fedora object
* Add the datastreams
*/
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
module_load_include('inc', 'islandora_repository', 'MimeClass');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore');
global $user;
$mimetype = new MimeClass();
$dwc = new DarwinCore();
@ -141,8 +141,8 @@ class Herbarium {
* @return string
*/
public function showFieldSets() {
module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore');
module_load_include('inc', 'islandora_repository', 'plugins/tagging_form');
module_load_include('inc', 'islandora_repository', 'plugins/DarwinCore');
global $base_url;
$tabset = array();
@ -167,7 +167,7 @@ class Herbarium {
'#title' => t('View'),
// This will be the content of the tab.
'#content' => '<a href="' . $base_url . '/fedora/repository/' . $this->pid . '/FULL_JPG/"><img src="' . $base_url . '/fedora/imageapi/' .
$this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>',
$this->pid . '/JPG/JPG.jpg' . '" /></a>' . '<p>' . drupal_get_form('islandora_repository_image_tagging_form', $this->pid) . '</p>',
);
$dwc = new DarwinCore($this->item);
@ -184,10 +184,10 @@ class Herbarium {
'#title' => t('Darwin Core'),
'#content' => $dwc->asHTML(),
);
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'islandora_repository', 'ObjectHelper');
$obj = new ObjectHelper();
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('fedora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE');
if (islandora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$editform = drupal_get_form('islandora_repository_edit_qdc_form', $this->pid, 'DARWIN_CORE');
$tabset['third_tab']['tabset']['edit'] = array(
'#type' => 'tabpage',
'#title' => t('Edit'),

7
plugins/islandora_imageapi.info

@ -0,0 +1,7 @@
name = Fedora ImageAPI
description = Adds image manipulation support through a REST interface
package = Islandora Dependencies
dependencies[] = islandora_repository
dependencies[] = imageapi
version = 11.2.beta2
core = 6.x

116
plugins/islandora_imageapi.module

@ -0,0 +1,116 @@
<?php
function fedora_imageapi_menu() {
$items = array();
$items['fedora/imageapi'] = array(
'title' => t('Image manipulation functions'),
'page callback' => 'islandora_repository_image_manip',
'type' => MENU_CALLBACK,
'access arguments' => array('view fedora collection'),
);
return $items;
}
/**
* Call out to the Drupal ImageAPI module and return the resulting image as a stream.
*
* @param string $pid
* @param string $dsid
* @param string $op
* @param string $params
*/
function islandora_repository_image_manip($pid = '', $dsid = '', $op = '', $params = '') {
module_load_include('inc', 'Fedora_Repository', 'ObjectHelper');
module_load_include('module', 'imageapi');
$obj = new ObjectHelper();
$mimetype = $obj->getMimeType($pid, $dsid);
$ext = substr(strstr($mimetype, '/'), 1);
$op = (!empty($_GET['op']) ? $_GET['op'] : '');
$safe_pid = str_replace(':', '_', $pid);
$cache_key = 'islandora_repository_image_manip_' . md5($safe_pid . '_' . $dsid . '_' . $ext . '_' . $op . (isset($_GET['width']) ? '_' . $_GET['width'] : '') . (isset($_GET['height']) ? '_' . $_GET['height'] : ''));
if (($file = cache_get($cache_key)) === 0) {
//added the slash as sys_get_temp_dir in linux does not seem to include the slash
$tmp_file_name = sys_get_temp_dir() . '/' . $safe_pid . '_' . $dsid . '.' . $ext;
$handle = fopen($tmp_file_name, "w");
$numbytes = fwrite($handle, $obj->getStream($pid, $dsid));
fclose($handle);
if ($numbytes == 0) {
return;
}
$image = imageapi_image_open($tmp_file_name);
switch ($op) {
case 'scale':
if (!empty($_GET['height']) || !empty($_GET['width'])) {
imageapi_image_scale($image, $_GET['width'], $_GET['height']);
}
case 'centerscale':
if (!empty($_GET['height']) && !empty($_GET['width'])) {
imageapi_image_scale_and_crop($image, $_GET['width'], $_GET['height']);
}
}
imageapi_image_close($image);
$file = file_get_contents($tmp_file_name);
cache_set($cache_key, $file, 'cache', time() + variable_get('fedora_image_blocks_cache_time', 3600));
file_delete($tmp_file_name);
}
else {
$file = $file->data;
}
header("Content-type: $mimetype");
header('Content-Disposition: attachment; filename="' . $dsid . '.' . $ext . '"');
echo $file;
// return "$numbytes bytes written to ".sys_get_temp_dir()."$pid_$dsid.$ext\n";
}
/**
* Implementation of hook_form_alter
*
* @param unknown_type $form
* @param unknown_type $form_state
* @param unknown_type $form_id
*/
/*
function fedora_imageapi_form_alter( &$form, $form_state, $form_id) {
switch ( $form_id ) {
case 'islandora_repository_admin':
$fedora_base_url = $form['fedora_base_url']['#default_value'];
$fedora_server_url = substr($fedora_base_url,0,strpos($fedora_base_url,'/',7));
// Add the Djatoka server location. Set it to default to the same server as fedora.
$form['djatoka_server_url'] = array (
'#type' => 'textfield',
'#title' => '<h3>'.t('Fedora Image API Module').'</h3><br />'.t('aDORe Djatoka image server resolver URL'),
'#default_value' => variable_get('djatoka_server_url', $fedora_server_url.'/adore-djatoka/resolver' ),
'#description' => t('The location of your <a href="http://african.lanl.gov/aDORe/projects/djatoka/" title="aDORe Djatoka Home Page">aDORe Djatoka</a> image server, if you have one installed.'),
'#weight' => 1,
);
$form['openlayers_server_url'] = array(
'#type' => 'textfield',
'#title' => t('OpenLayers servlet URL'),
'#default_value' => variable_get('openlayers_server_url', $fedora_server_url.'/islandora/OpenLayers'),
'#description' => t('URL of your installation of the <a href="http://openlayers.org/">OpenLayers</a> servlet, if you have one.'),
'#weight' => 1,
);
$form['buttons']['#weight'] = 2;
break;
}
}
function show_openlayers_viewer() {
$output = 'Hi.';
return $output;
}
*/

10
plugins/map_viewer.inc

@ -29,9 +29,9 @@ class ShowMapStreamsInFieldSets {
* @return type
*/
function showJPG() {
module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'plugins/tagging_form');
module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
global $base_url;
@ -51,8 +51,8 @@ class ShowMapStreamsInFieldSets {
$html = '<iframe src="' . $viewer_url . '" scrolling="no" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>';
drupal_add_css(path_to_theme() . '/header-viewer.css', 'theme');
drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css');
drupal_add_css(drupal_get_path('module', 'fedora_repository') . '/js/iiv/css/iiv.css');
drupal_add_css(drupal_get_path('module', 'islandora_repository') . '/js/iiv/css/jquery-ui/smoothness/jquery-ui-1.7.2.custom.css');
drupal_add_css(drupal_get_path('module', 'islandora_repository') . '/js/iiv/css/iiv.css');
$tabset['my_tabset']['second_tab'] = array(

6
plugins/qt_viewer.inc

@ -112,9 +112,9 @@ class ShowQtStreamsInFieldSets {
* @return type
*/
function showQt() {
module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'plugins/tagging_form');
module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
$info = $this->technicalMetadata(array('width' => 640, 'height' => 480));
$width = $info['width'];

6
plugins/slide_viewer.inc

@ -30,8 +30,8 @@ class ShowSlideStreamsInFieldSets {
* @return type
*/
function showJPG() {
module_load_include('inc', 'fedora_repository', 'plugins/tagging_form');
module_load_include('inc', 'fedora_repository', 'plugins/ShowStreamsInFieldSets');
module_load_include('inc', 'islandora_repository', 'plugins/tagging_form');
module_load_include('inc', 'islandora_repository', 'plugins/ShowStreamsInFieldSets');
global $base_url;
global $user;
@ -58,7 +58,7 @@ class ShowSlideStreamsInFieldSets {
'#title' => t('View'),
// This will be the content of the tab.
'#content' => '<img src="' . $base_url .
'/fedora/imageapi/' . $this->pid . '/JPG/JPG.jpg' . '" />' . '<p>' . drupal_get_form('fedora_repository_image_tagging_form', $this->pid) . '</p>',
'/fedora/imageapi/' . $this->pid . '/JPG/JPG.jpg' . '" />' . '<p>' . drupal_get_form('islandora_repository_image_tagging_form', $this->pid) . '</p>',
);
return $tabset;

22
plugins/tagging_form.inc

@ -13,9 +13,9 @@
* @return string
*/
function _show_subject_tags($pid) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/dublin_core');
module_load_include('inc', 'fedora_repository', 'api/tagging');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/dublin_core');
module_load_include('inc', 'islandora_repository', 'api/tagging');
$obj = new Fedora_Item($pid);
$tags = new TagSet($obj);
if (!empty($tags->tags)) {
@ -35,10 +35,10 @@ function _show_subject_tags($pid) {
* @param type $pid
* @return type
*/
function fedora_repository_image_tagging_form($form_state, $pid) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/dublin_core');
module_load_include('inc', 'fedora_repository', 'api/tagging');
function islandora_repository_image_tagging_form($form_state, $pid) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/dublin_core');
module_load_include('inc', 'islandora_repository', 'api/tagging');
global $base_url;
if (!empty($form_state['post']['pid'])) {
@ -71,7 +71,7 @@ function fedora_repository_image_tagging_form($form_state, $pid) {
// Delete button for each existing tag.
$form['tags-wrapper']['tags'][$tag['name']]['delete'] = array(
'#type' => 'imagebutton',
'#image' => $base_url . '/' . drupal_get_path('module', 'fedora_repository') . '/images/remove_icon.png',
'#image' => $base_url . '/' . drupal_get_path('module', 'islandora_repository') . '/images/remove_icon.png',
'#default_value' => $tag['name'],
'#title' => t('Delete this tag'),
);
@ -122,9 +122,9 @@ function hook_imagebutton_process($form) {
* @param type $form
* @param type $form_state
*/
function fedora_repository_image_tagging_form_submit($form, &$form_state) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/tagging');
function islandora_repository_image_tagging_form_submit($form, &$form_state) {
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/tagging');
global $user;
$item = new Fedora_Item($form_state['values']['pid']);

2
tests/README_TESTING.txt

@ -21,7 +21,7 @@ $FEDORA_HOME/server/config/fedora-users.xml:
</attribute>
</user>
If you look in the fedora_repository.test file we see that we are creating
If you look in the islandora_repository.test file we see that we are creating
a user with a password set to 'simpletestpass'. Fedora requires the hashed
version of this password to do a servlet filter-based authentication.

20
tests/fedora_repository.test

@ -16,9 +16,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
}
function setUp() {
parent::setUp('tabs', 'fedora_repository');
parent::setUp('tabs', 'islandora_repository');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_repository', 'api/fedora_item');
// Create and login user.
$repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams',
@ -57,11 +57,11 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2['dc:title'] = $this->randomName(32);
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$this->assertText('mimetype (application/pdf) is not associated with this Content Model', 'PDF mime type not accepted in collection content model.', 'message');
$this->outputScreenContents('Initial ingest form submit step 2', 'fedora_repository');
$this->outputScreenContents('Initial ingest form submit step 2', 'islandora_repository');
// Now try ingesting a proper collection policy.
$ingest_form = array();
@ -72,9 +72,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2 = array();
$ingest_form_step_2['dc:title'] = $this->randomName(32);
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml');
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
//$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'fedora_repository');
//$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'islandora_repository');
$this->assertPattern('/Item .* created successfully./', "Verified item created.");
$pid = $this->getIngestedPid();
@ -88,7 +88,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2 = array();
$ingest_form_step_2['dc:title'] = "Lorem Ipsum";
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islandora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$pid = $this->getIngestedPid();
$pid_list[] = $pid;
@ -104,7 +104,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$admin_tester = $this->drupalCreateUser(array('administer site configuration', 'view fedora collection'));
$this->drupalLogin($admin_tester);
$pageContent = $this->drupalGet('admin/settings/fedora_repository');
$pageContent = $this->drupalGet('admin/settings/islandora_repository');
$hasOption = preg_match('/Enforce namespace restrictions/', $pageContent);
@ -115,13 +115,13 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$this->pass('Removal of namespace restrictions is enabled');
$inVal['fedora_namespace_restriction_enforced'] = TRUE;
$inVal['fedora_pids_allowed'] = 'simpletest:';
$this->drupalPost('admin/settings/fedora_repository', $inVal, 'Save configuration');
$this->drupalPost('admin/settings/islandora_repository', $inVal, 'Save configuration');
$this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.');
$this->drupalGet('fedora/repository/islandora:largeimages/');
$this->assertPattern('/Access denied/', 'No access to Large image Collection Collection');
$inVal['fedora_namespace_restriction_enforced'] = 0;
$this->drupalPost('admin/settings/fedora_repository', $inVal, 'Save configuration');
$this->drupalPost('admin/settings/islandora_repository', $inVal, 'Save configuration');
$this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.');
$this->drupalLogin($this->repository_user);
$this->drupalGet('fedora/repository/islandora:largeimages/');

Loading…
Cancel
Save