Browse Source

Deleted fedora attach, newspaper and pidfield

pull/24/head
Ben Woodhead 13 years ago
parent
commit
cfae7317a3
  1. 36
      plugins/fedora_attach/fedora_attach.admin.inc
  2. 8
      plugins/fedora_attach/fedora_attach.info
  3. 14
      plugins/fedora_attach/fedora_attach.install
  4. 487
      plugins/fedora_attach/fedora_attach.module
  5. BIN
      plugins/islandora_newspaper/Crystal_Clear_mimetype_document.png
  6. 177
      plugins/islandora_newspaper/Newspaper.inc
  7. 7
      plugins/islandora_newspaper/islandora_newspaper.info
  8. 63
      plugins/islandora_newspaper/islandora_newspaper.module
  9. 22
      plugins/islandora_newspaper/newspapers_collection_policy.xml
  10. 379
      plugins/islandora_newspaper/newspapers_guardian.xml
  11. 25
      plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml
  12. 149
      plugins/islandora_newspaper/newspapers_pageCModel.xml
  13. 241
      plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml
  14. 217
      plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml
  15. 8
      plugins/pidfield/pidfield.info
  16. 40
      plugins/pidfield/pidfield.install
  17. 459
      plugins/pidfield/pidfield.module

36
plugins/fedora_attach/fedora_attach.admin.inc

@ -1,36 +0,0 @@
<?php
/**
* @file
* Administration page callbacks for the redmine_issuer module.
*/
/**
* Form builder. Configure Redmine parameters.
*
* @ingroup forms
* @see system_settings_form().
*/
function fedora_attach_admin() {
$options = drupal_map_assoc(explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: ')));
$default_value = variable_get('fedora_attach_pid_namespace', 'default:');
$is_restricted = variable_get('fedora_namespace_restriction_enforced', TRUE);
if (!in_array($default_value, $options) && $is_restricted) {
drupal_set_message(t("The value last set here ($default_value) is not in the list of available PID namespaces (perhaps it has changed?). Please choose a valid option from the list."), 'warning');
}
$form = array();
$form['fedora_attach_pid_namespace'] = array(
'#type' => 'select',
'#title' => t('Fedora Attach PID namespace'),
'#options' => $options,
'#default_value' => $default_value,
'#description' => t('The PID namespace into which the Fedora Attach module will ingest objects.'),
);
return (system_settings_form($form));
}

8
plugins/fedora_attach/fedora_attach.info

@ -1,8 +0,0 @@
; $Id$
name = Fedora Attach
description = Allows users to attach files to node content which then get ingested into Fedora.
package = Fedora Repository
dependencies[] = fedora_repository
dependencies[] = upload
version = 6.1dev
core = 6.x

14
plugins/fedora_attach/fedora_attach.install

@ -1,14 +0,0 @@
<?php
// @file fedora_attach.install
/**
* Implementation of hook_install().
*
* Ensures fedora_attach runs after module upload
*/
function fedora_attach_install() {
$weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'upload'"));
db_query("UPDATE {system} SET weight = %d WHERE name = 'fedora_attach'", $weight + 1);
}

487
plugins/fedora_attach/fedora_attach.module

@ -1,487 +0,0 @@
<?php
/**
* Implementation of hook_perm()
*
* @return Array of permissions defined in this module.
*/
function fedora_attach_perm() {
return array(
'select file access by role',
);
}
/**
* Implementation of hook_nodeapi.
* On Update and Insert operations alters the file attach form to add option to ingest into fedora.
* On View option hilights files that are in the repository.
*/
function fedora_attach_nodeapi(&$node, $op, $teaser) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils.inc');
switch ($op) {
case 'insert':
case 'update':
// ******************************************************
// *** INSERT/UPDATE
// *** Ingest a selected file into the repository.
// ******************************************************
if (user_access('upload files') && user_access('add fedora datastreams')) {
if (is_array($node->files)) {
foreach ($node->files as $fid => $file) {
$file = (object) $file; // Convert file to object type for compatibility.
$fid = $file->fid; // For the cases where we have temp fid for uplaoded files.
$success = FALSE;
$filepath = $file->filepath; // Need copy if file_move fails.
$public = file_directory_path();
$file_is_ingested = _fedora_attach_is_file_in_repository($filepath);
if (!empty($file->ingested) && !$file_is_ingested) {
// Attach flag is set, but file is not listed as being in the repository.
// so try and ingest it now.
if (user_access('select file access by role')) {
$roles = array();
if (!empty($file->roles)) {
foreach ($file->roles as $rolename => $rolevalue) {
if (!empty($rolevalue)) {
array_push($roles, $rolevalue);
}
}
}
// if (!empty($roles)) {
// Generate the security policy datastream.
$policy_stream = _fedora_attach_create_policy($roles);
// }
}
try {
$pid_namespace = variable_get('fedora_attach_pid_namespace', 'default:');
$pid_namespace = substr($pid_namespace, 0, strpos($pid_namespace, ":"));
$pid = fedora_item::get_next_PID_in_namespace($pid_namespace);
$new_item = fedora_item::ingest_new_item($pid, 'A', $file->description); // PID will be generated using getNextPID
if (empty($new_item->objectProfile)) {
drupal_set_message("Unable to create fedora object. Check Watchdog log for details.", "error");
$success = FALSE;
}
else {
if (user_access('select file access by role')) {
$new_item->add_datastream_from_string($policy_stream, 'POLICY', "Security Policy", "text/xml", "X");
}
$new_item->add_datastream_from_file($file->filepath, 'OBJ', $file->filename, $file->filemime, 'M');
$new_item->add_relationship("hasModel", "islandora:genericCModel", FEDORA_MODEL_URI);
module_load_include('inc', 'fedora_repository', 'api/dublin_core');
$dc = new Dublin_Core();
$dc->add_element('dc:title', $file->description);
$dc->add_element('dc:identifier', $new_item->pid);
$new_item->modify_datastream_by_value($dc->as_xml(), 'DC', 'Default Dublin Core Metadata', 'text/xml', 'X');
$success = TRUE;
}
} catch (exception $e) {
drupal_set_message(t('An error occurred ingesting the file: ') . $e, 'error');
$new_item->purge();
drupal_set_message(t('The item has been removed from the repository'));
}
if ($success) { // We were able to ingest the file, so update the file path.
$new_filepath = '/fedora/repository/' . $new_item->pid . '/OBJ/' . $file->description;
_fedora_attach_update_filepath($new_filepath, $fid);
file_delete($filepath);
}
}
// Convert file to object for compatibility
// Remove file. Process removals first since no further processing
// will be required.
if (!empty($file->remove)) {
// If the file isn't used by any other revisions warn the user.
$count = db_result(db_query('SELECT COUNT(fid) FROM {upload} WHERE fid = %d', $fid));
if ($count < 1) {
file_delete($file->filepath);
db_query('DELETE FROM {files} WHERE fid = %d', $fid);
}
// Remove it from the session in the case of new uploads,
// that you want to disassociate before node submission.
unset($node->files[$fid]);
// Move on, so the removed file won't be added to new revisions.
continue;
}
}
}
}
break;
case 'view':
// ******************************************************
// *** VIEW
// Re-theme the file attachments table.
// Rebuild the files table and overwrite default.
// Using the rules from upload.module.
if (isset($node->files) && count($node->files) && user_access('view uploaded files') && !$teaser) {
$node->content['files']['#value'] = theme('fedora_attach_attachments', $node->files);
}
break;
}
}
/**
* Implementation of hook_menu().
*/
function fedora_attach_menu() {
$items['admin/settings/fedora_repository/attach'] = array(
'title' => 'Fedora Attach',
'page callback' => 'drupal_get_form',
'page arguments' => array('fedora_attach_admin'),
'access arguments' => array('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'file' => 'fedora_attach.admin.inc',
);
return $items;
}
function fedora_attach_save(&$node) {
print ("FNARF!");
}
/**
* Implements hook_form_alter()
*
* Add a 'add to repository' checkbox to the file attach form.
*
* @param unknown_type $form
* @param unknown_type $form_state
* @param unknown_type $form_id
* Two paths, one for normal submit, one for JavaScript
*/
function fedora_attach_form_alter(&$form, $form_state, $form_id) {
$disabled = TRUE;
global $base_url;
if (isset($form['type'])) {
$node = $form['#node'];
if ($form['type']['#value'] . '_node_form' == $form_id && variable_get("upload_$node->type", TRUE)) {
$form['#submit'][] = 'fedora_attach_form_submit';
if (!empty($node->files) && is_array($node->files) && count($node->files)) { // Hijack theme function.
$form['attachments']['wrapper']['files']['#theme'] = 'fedora_attach_form';
$form['#validate']['private_upload_form_validate'] = array();
foreach ($node->files as $fid => $file) {
// Add ingest checkbox
if (is_array($file) && isset($file['ingest'])) { // Preview
$default_value = $file['ingest'];
}
else { // Node load
$default_value = _fedora_attach_is_file_in_repository($file->filepath);
$disabled = $default_value;
}
$form['attachments']['wrapper']['files'][$fid]['ingested'] = array(
'#type' => 'checkbox',
'#default_value' => $default_value,
'#disabled' => $disabled,
);
$form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url . $file->filepath;
}
if (user_access('select file access by role')) {
_fedora_attach_build_roles_form($form, FALSE);
}
}
}
}
elseif ($form_id == 'upload_js') {
$form['files']['#theme'] = 'fedora_attach_form';
foreach ($form['files'] as $fid => $file) {
if (!_fedora_attach_starts_with($fid, '#')) {// Ignore properties.
if (!empty($_POST['files'][$fid])) {
$ingested = (!empty($_POST['files'][$fid]['ingested']) ? $_POST['files'][$fid]['ingested'] : FALSE);
//$form['files'][$fid]['list']['#default_value'] = (!empty($_POST['files'][$fid]['[$_POST['files'][$fid]['list'];
//$form['files'][$fid]['remove']['#default_value'] = $_POST['files'][$fid]['remove'];
}
else {
$ingested = (variable_get('fedora_attach_default', 'ingested') == 'ingested');
}
$form['files'][$fid]['ingested'] = array(
'#type' => 'checkbox',
'#default_value' => $ingested,
);
$form['attachments']['wrapper']['files'][$fid]['description']['#description'] = $base_url . $file['filepath'];
if (user_access('select file access by role')) {
_fedora_attach_build_roles_form($form, TRUE);
}
}
}
}
}
/**
* Called to validate the attach form.
*
* @param string $formid
* @param array $form_values
*/
function fedora_attach_form_validate($formid, $form_values) {
if (is_array($form_values['files']) && count($form_values['files'])) {
$file = array_shift($form_values['files']);
if (!isset($file['ingested'])) {
drupal_set_message(t('Fedora Attach cannot find add repository settings.'), 'error');
// Be sure we are going after core upload module
$upload_weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'upload'"));
$attach_weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'fedora_attach'"));
if ($attach_weight <= $uplaod_weight) {
$new_weight = $upload_weight + 1;
drupal_set_message(t('Adjusting Fedora Attach module\'s weight to') . $new_weight, 'warning');
db_query("UPDATE {system} SET weight = '%d' WHERE name = 'fedora_attach'", $new_weight);
;
}
else {
drupal_set_message(t('Please check for modules that conflict with Fedora Attach'), 'error');
}
}
}
}
/**
* Fixes edge case: When the node is first being created, the file->private info does not
* get moved automatically into the node. So we need to copy it by hand.
*
* @param array $form
* @param array $form_state
*/
function fedora_attach_form_submit($form, &$form_state) {
global $base_url;
if ($form_state['values'] && $form_state['values']['files']) {
foreach ($form_state['values']['files'] as $fid => $file) {
if ($file['remove'] && !empty($file['ingested']) && $file['ingested']) {
drupal_set_message("The attachment <a href=\"$base_url/" . substr($file['filepath'], 0, strpos($file['filepath'], 'OBJ')) . "\">${file['filename']}</a> was removed from this node but it will remain in the repository until it is purged it directly.");
}
if (!isset($file->ingested)) { // Newly-inserted file.
if (isset($form['attachments']['wrapper']['files'])) {
// I know it is naughty to look at the $_POST, but I can't find this value anywhere else.
// Seems like it should be in $form_state somewhere.
$ingested = !empty($_POST['files'][$fid]['ingested']);
}
else {
$ingested = (variable_get('fedora_attach_ingested', 'ingested') == 'ingested'); // Submit before attach
}
$form_state['values']['files'][$fid]['ingested'] = $ingested;
}
$form_state['values']['files'][$fid]['roles'] = (!empty($_POST['files']['roles']) ? $_POST['files']['roles'] : array());
}
}
}
// *****************************************************************************
// Theme functions ***********************************************************
// *****************************************************************************
/**
* hook_theme = Theme registry
*
* @return array
*/
function fedora_attach_theme() {
return array(
'fedora_attach_form' => array(
'arguments' => array('form' => NULL),
),
'fedora_attach_attachments' => array(
'arguments' => array('files' => NULL),
),
);
}
/**
* Based on theme_upload_form_current
* Adds the Ingest checkbox.
*
* @param array $form
*/
function theme_fedora_attach_form(&$form) {
$header = array(t('Delete'), t('List'), t('Add to Repository'), t('Label'), t('Weight'), t('Size'), '');
drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight');
foreach (element_children($form) as $key) {
// Add class to group weight fields for drag and drop.
$form[$key]['weight']['#attributes']['class'] = 'upload-weight';
$row = array();
$row[] = drupal_render($form[$key]['remove']);
$row[] = drupal_render($form[$key]['list']);
$row[] = drupal_render($form[$key]['ingested']);
$row[] = drupal_render($form[$key]['description']);
$row[] = drupal_render($form[$key]['weight']);
$row[] = drupal_render($form[$key]['size']);
$row[] = drupal_render($form[$key]['msg']);
$rows[] = array('data' => $row, 'class' => 'draggable');
}
$output = theme('table', $header, $rows, array('id' => 'upload-attachments'));
$output .= drupal_render($form);
return $output;
}
/**
* Displays file attachments in table.
*
* @param array $files
*/
function theme_fedora_attach_attachments($files) {
$header = array(t('Attachment'), t('Size'));
$rows = array();
if (is_array($files)) {
foreach ($files as $file) {
$file = (object) $file;
if ($file->list && empty($file->remove)) {
$inspect_item = '';
if (_fedora_attach_is_file_in_repository($file->filepath)) {
$inspect_item = ' <a href="' . $GLOBALS['base_url'] . substr($file->filepath, 0, strpos($file->filepath, 'OBJ')) .
'">' . theme_image(drupal_get_path('module', 'Fedora_Repository') . '/images/view.gif', '', 'View the item\'s repository page') . '</a>';
}
$href = _fedora_attach_create_url($file); // this is the changed line
$text = $file->description ? $file->description : $file->filename;
$rows[] = array(l($text, $href) . $inspect_item, format_size($file->filesize));
}
}
if (count($rows)) {
return theme('table', $header, $rows, array('id' => 'attachments'));
}
}
}
function _fedora_attach_build_roles_form(&$form, $inside_js = FALSE) {
//$result = db_query("SELECT {name} from {role}");
global $user;
//while ($role = db_fetch_array($result)) {
foreach ($user->roles as $role) {
if ($role != 'anonymous user') {
$roles[] = $role;
}
}
if (empty($roles)) {
return '';
}
$new_form_elements = array(
'#type' => 'checkboxes',
'#title' => t('Roles which can view the attached items'),
'#options' => array_combine($roles, $roles),
'#description' => t('This only applies to files which you add to the repository. If no roles are checked the item will be public.'),
);
if ($inside_js) {
$form['files']['roles'] = $new_form_elements;
}
else {
$form['attachments']['wrapper']['roles'] = $new_form_elements;
}
// var_dump($form['files']);
//return $output;
}
function _fedora_attach_create_policy($roles) {
$policy_filename = !empty($roles) ? drupal_get_path('module', 'fedora_repository') . '/policies/viewANDeditbyrole.xml' : drupal_get_path('module', 'fedora_repository') . '/policies/noObjectEditPolicy.xml';
$policy_document = new DOMDocument();
$policy_document->load($policy_filename);
$designators = $policy_document->getElementsByTagName("SubjectAttributeDesignator");
if (!empty($designators)) {
foreach ($designators as $designator) {
if ($designator->hasAttribute("AttributeId")) {
if ($designator->getAttribute('AttributeId') == 'fedoraRole') {
foreach ($roles as $role) {
//$apply = $designator->nextSibling;
foreach ($designator->parentNode->childNodes as $apply) {
if ($apply->nodeName == "Apply") {
$new_role_node = $policy_document->createElement('AttributeValue', $role);
$new_role_node->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string');
$apply->appendChild($new_role_node);
}
}
}
}
elseif ($designator->getAttribute('AttributeId') == 'urn:fedora:names:fedora:2.1:subject:loginId') {
// $apply = $designator->nextSibling;
foreach ($designator->parentNode->childNodes as $apply) {
if ($apply->nodeName == "Apply") {
global $user;
$new_user_node = $policy_document->createElement('AttributeValue', $user->name);
$new_user_node->setAttribute('DataType', 'http://www.w3.org/2001/XMLSchema#string');
$apply->appendChild($new_user_node);
}
}
}
}
}
}
return $policy_document->saveXML();
}
function fedora_attach_file_download($filepath) {
// Pass through if this isn't a repository item.
if (!strstr($filepath, 'fedora/repository')) {
return;
}
$result = db_query("SELECT DISTINCT(u.nid) FROM {upload} u INNER JOIN {files} f ON u.fid = f.fid " .
"WHERE f.filepath LIKE '%s'", $filepath . '%');
$has_results = FALSE;
while ($row = db_fetch_array($result)) {
$has_results = TRUE;
$node = node_load($row['nid']);
if (node_access('view', $node)) {
return; // Access is ok as far as we are concerned.
}
}
if ($has_results) {
return -1;
}
else {
return;
}
}
/**
* Create a URL to a file that changes if the file is in the repository.
*
* @param file object $file
* @return str: the correct URL
*/
function _fedora_attach_create_url($file) {
if (_fedora_attach_is_file_in_repository($file->filepath)) {
$href = $GLOBALS['base_url'] . $file->filepath;
}
else {
$href = file_create_url((strpos($file->fid, 'upload') === FALSE ? $file->filepath : file_create_filename($file->filename, file_create_path())));
}
return $href;
}
/**
* Checks if the file path references a file in the repository.
*
* @param string $filepath
* @return boolean
*/
function _fedora_attach_is_file_in_repository($filepath) {
$repository_path = '/fedora/repository';
$is_in = _fedora_attach_starts_with($filepath, $repository_path);
return $is_in;
}
function _fedora_attach_starts_with($str, $start) {
if (count($str) == 0) { // Avoid FALSE positives.
return FALSE;
}
return strstr($str, $start) == $str;
}
/**
* Alters the file's path in the files table to point to the repository datastream.
*
* @param string $filepath
* @param int $fid
*/
function _fedora_attach_update_filepath($filepath, $fid) {
db_query("UPDATE {files} SET filepath = '%s' WHERE fid=%d", $filepath, $fid);
}

BIN
plugins/islandora_newspaper/Crystal_Clear_mimetype_document.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

177
plugins/islandora_newspaper/Newspaper.inc

@ -1,177 +0,0 @@
<?php
/* @file
* News Paper Plugin for Fedora Repository module.
*/
class Newspaper {
function __construct($pid = '') {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
if (!empty($pid)) {
$this->pid = $pid;
$this->item = new Fedora_Item($pid);
}
}
public function buildDrupalForm($form = array(), $ingest_form = array(), &$form_state = array()) {
// Give the user an option to enter a custom PID
$form['custom_pid'] = array(
'#type' => 'textfield',
'#title' => 'Custom PID',
'#description' => 'If you want to manually specify the PID for the new object, enter it here. ' .
'Leave it blank for an automatically-generated PID.',
);
$form['mods'] = array(
'#tree' => TRUE,
'#prefix' => '<div id="mods-wrapper">',
'#suffix' => '</div>',
);
$form['mods']['mods_record'] = array(
'#type' => 'textarea',
'#title' => 'MODS Record to Import',
'#rows' => 20,
);
return $form;
}
public function handleIngestForm($form_values, &$form_state) {
/*
* process the metadata form
* Create fedora object
* Add the datastreams
*/
module_load_include('inc', 'fedora_repository', 'MimeClass');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_ilives', 'book');
$mods_list_doc = new DomDocument();
$mods_list_doc->loadXML($form_values['mods']['mods_record']);
$mods_item_doc = new DomDocument();
$mods_item = $mods_list_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'mods')->item(0);
$new_mods_item = $mods_item_doc->importNode($mods_item, TRUE);
$mods_item_doc->appendChild($new_mods_item);
$title_info = $mods_item_doc->getElementsByTagNameNS('http://www.loc.gov/mods/v3', 'titleInfo')->item(0);
$title = '';
foreach (array('nonSort', 'title') as $title_field) {
$title .= $title_info->getElementsByTagNameNS('http://www.loc.gov/mods/v3', $title_field)->item(0)->nodeValue;
}
$mods_text = $mods_item_doc->saveXML();
global $user;
$mimetype = new MimeClass();
$new_item = Fedora_Item::ingest_new_item(!empty($form_values['custom_pid']) ? $form_values['custom_pid'] : $form_values['pid'], 'A', $title,
$user->name);
$new_item->add_datastream_from_string($mods_text, 'MODS',
'MODS Metadata', 'text/xml', 'X');
$dc = transform_mods_to_dc($mods_text);
if ($dc) {
// Add the PID to a dc:identifier field.
$dc_doc = simplexml_load_string($dc);
$dc_doc->registerXPathNamespace('oai_dc', 'http://www.openarchives.org/OAI/2.0/oai_dc/');
$dc_item = $dc_doc->xpath('//oai_dc:dc');
foreach ($dc_item as $node) {
$node->addChild('dc:identifier', $new_item->pid, 'http://purl.org/dc/elements/1.1/');
}
$new_item->modify_datastream_by_value($dc_doc->saveXML(), 'DC', 'Dublin Core XML Metadata', 'text/xml');
}
$new_item->add_relationship('hasModel', $form_values['content_model_pid'], FEDORA_MODEL_URI);
$new_item->add_relationship(!empty($form_values['relationship']) ? $form_values['relationship'] : 'isMemberOfCollection', $form_values['collection_pid']);
drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($new_item->pid, 'fedora/repository/' . $new_item->pid))), "status");
}
public function showFieldSets() {
module_load_include('inc', 'fedora_ilives', 'book');
global $base_url;
$tabset = array();
$tabset = array(
'#type' => 'tabset',
);
global $user;
$qs = '';
if ($user->uid != 0) {
$qs = '?uid=' . base64_encode($user->name . ':' . $user->pass);
}
$viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs;
$html = '<iframe src="' . $viewer_url . '" scrolling="no" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>';
$tabset['read'] = array(
'#type' => 'tabpage',
'#title' => t('Read'),
'#weight' => -1,
'#content' => $html
);
$item = new Fedora_Item($this->pid);
$tabset['description'] = array(
'#type' => 'tabpage',
'#title' => 'Description',
'#content' => $item->get_dissemination('islandora:mods2htmlSdef', 'mods2html'),
);
$tabset['add_pages'] = array(
'#type' => 'tabpage',
'#title' => t('Add pages'),
'#content' => drupal_get_form('book_add_pages_form', $this->pid, 'newspapers:pageCModel', 'isPartOf'),
);
return $tabset;
}
public function showPageFieldSets() {
global $base_url;
$tabset = array();
$tabset = array(
'#type' => 'tabset',
);
global $user;
$qs = '';
if ($user->uid != 0) {
$qs = '?uid=' . base64_encode($user->name . ':' . $user->pass);
}
$viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/ilives:viewerSdef/getViewer' . $qs;
$html = '<iframe src="' . $viewer_url . '" frameborder="0" style="width: 100%; height: 800px;">Errors: unable to load viewer</iframe>';
$tabset['first_tab'] = array(
'#type' => 'tabpage',
'#title' => t('Read'),
'#content' => $html
);
$item = new Fedora_Item($this->pid);
// Get this page's parent item to show the issue's metadata.
$rels = $item->get_relationships();
$parent_pid = '';
foreach ($rels as $rel) {
if (strstr($rel['predicate'], 'isPartOf')) {
$parent_pid = $rel['object'];
break;
}
}
$parent_item = new Fedora_Item($parent_pid);
$tabset['second_tab'] = array(
'#type' => 'tabpage',
'#title' => 'Description',
'#content' => $parent_item->get_dissemination('islandora:mods2htmlSdef', 'mods2html'),
);
return $tabset;
}
}

7
plugins/islandora_newspaper/islandora_newspaper.info

@ -1,7 +0,0 @@
; $Id$
name = Islandora Newspaper
description = Content models and support code for Newspapers
package = Fedora Repository
dependencies[] = fedora_repository
version = 6.1dev
core = 6.x

63
plugins/islandora_newspaper/islandora_newspaper.module

@ -1,63 +0,0 @@
<?php
/**
* Implementation of hook_requried_fedora_objects()
*/
function islandora_newspaper_required_fedora_objects() {
// array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required)
$module_path = drupal_get_path('module', 'islandora_newspaper');
return array(
'islandora_newspaper' => array(
'module' => 'islandora_newspaper',
'title' => 'Islandora Newspaper',
'objects' => array(
array(
//'foxml_file' => "$module_path/newspapers_issueCModel.xml",
'pid' => 'newspapers:issueCModel',
'dsid' => 'ISLANDORACM',
'cmodel' => 'fedora-system:ContentModel-3.0',
'datastream_file' => "$module_path/newspapers_issueCModel_islandoracm.xml",
'dsversion' => 2,
),
array(
'foxml_file' => "$module_path/newspapers_pageCModel.xml",
'pid' => 'newspapers:pageCModel',
'dsid' => NULL,
'datastream_file' => NULL,
'dsversion' => NULL,
),
array(
'foxml_file' => "$module_path/newspapers_viewerSdep-issueCModel.xml",
'pid' => 'newspapers:viewerSdep-issueCModel',
'dsid' => NULL,
'datastream_file' => NULL,
'dsversion' => NULL,
),
array(
'foxml_file' => "$module_path/newspapers_viewerSdep-pageCModel.xml",
'pid' => 'newspapers:viewerSdep-pageCModel',
'dsid' => NULL,
'datastream_file' => NULL,
'dsversion' => NULL,
),
array(
'pid' => 'newspapers:collection',
'label' => 'Newspapers Collection',
'cmodel' => 'islandora:collectionCModel',
'parent' => 'islandora:demos',
'datastreams' => array(
array(
'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/newspapers_collection_policy.xml",
),
array(
'dsid' => 'TN',
'datastream_file' => "$module_path/Crystal_Clear_mimetype_document.png",
'mimetype' => 'image/png',
),
),
),
),
),
);
}

22
plugins/islandora_newspaper/newspapers_collection_policy.xml

@ -1,22 +0,0 @@
<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 dsid="ISLANDORACM" name="Newspaper" namespace="islandora" pid="newspapers:issueCModel"></content_model>
</content_models>
<search_terms>
<term field="dc.title">dc.title</term>
<term field="dc.creator">dc.creator</term>
<term default="true" field="dc.description">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>

379
plugins/islandora_newspaper/newspapers_guardian.xml

@ -1,379 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject PID="newspapers:guardian" VERSION="1.1" xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="newspapers:guardian"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2010-05-27T13:55:30.474Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-05-31T15:14:58.313Z"/>
</foxml:objectProperties>
<foxml:datastream CONTROL_GROUP="X" ID="AUDIT" STATE="A" VERSIONABLE="false">
<foxml:datastreamVersion CREATED="2010-05-27T13:55:30.474Z"
FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit" ID="AUDIT.0" LABEL="Audit Trail for this object" MIMETYPE="text/xml">
<foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>MODS</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-28T18:38:36.223Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-31T15:14:58.313Z</audit:date>
<audit:justification>Ingested from local file /Users/al/Desktop/newspapers_guardian.xml</audit:justification>
</audit:record>
</audit:auditTrail>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="POLICY" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-27T13:55:30.556Z" ID="POLICY.0" LABEL="POLICY" MIMETYPE="text/xml" SIZE="9027">
<foxml:xmlContent>
<Policy PolicyId="noObjectEditbyUserAndRole"
RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:1.0:policy">
<Description>This is an object-specific policy. It could be stored inside the digital object in the POLICY datastream OR in the directory for object-specific policies. (The directory location is set in the Authorization module configuration in the Fedora server configuration file (fedora.fcfg). By using multiple policy Rules, this policy shows how to deny access to all raw datastreams in the object except to particular users (e.g., the object owners). It also shows how to deny access to a particular disseminations to selected user roles.</Description>
<Target>
<Subjects>
<AnySubject/>
</Subjects>
<Resources>
<AnyResource/>
</Resources>
<Actions>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-ingest</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByReference</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-modifyDatastreamByValue</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-modifyDisseminator</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-modifyDisseminator</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-purgeObject</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-purgeDatastream</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-purgeDisseminator</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-setDatastreamState</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-setDisseminatorState</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-setDatastreamVersionable</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-addDatastream</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">urn:fedora:names:fedora:2.1:action:id-addDisseminator</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:action:id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
</Actions>
</Target>
<Rule Effect="Deny" RuleId="denyapi-except-to-user">
<Condition FunctionId="urn:oasis:names:tc:xacml:1.0:function:not">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:or">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of">
<SubjectAttributeDesignator AttributeId="fedoraRole"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">administrator</AttributeValue>
</Apply>
</Apply>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of">
<SubjectAttributeDesignator AttributeId="urn:fedora:names:fedora:2.1:subject:loginId"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">fedoraAdmin</AttributeValue>
</Apply>
</Apply>
</Apply>
</Condition>
</Rule>
<Rule Effect="Permit" RuleId="3"/>
</Policy>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="M" ID="TN" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-27T13:55:30.556Z" ID="TN.0" LABEL="Thumbnail" MIMETYPE="image/jpeg">
<foxml:contentLocation REF="http://localhost:8080/fedora/get/newspapers:guardian/TN/2010-05-27T13:55:30.556Z" TYPE="INTERNAL_ID"/>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DC" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-27T13:55:30.556Z" ID="DC.0" LABEL="Default Dublin Core Record"
MIMETYPE="text/xml" SIZE="2631">
<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">
<dc:title>The Guardian</dc:title>
<dc:title>Guardian (Charlottetown, P.E.I.)</dc:title>
<dc:title>The Island guardian</dc:title>
<dc:title>The Charlottetown guardian</dc:title>
<dc:title>The Morning guardian</dc:title>
<dc:subject>Newspapers</dc:subject>
<dc:subject>Newspapers</dc:subject>
<dc:description>The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian.
The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade.
.... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers.
</dc:description>
<dc:description>Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian.</dc:description>
<dc:description>Ceased publication in 1920?</dc:description>
<dc:description>Missing issues.</dc:description>
<dc:description>Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels.</dc:description>
<dc:contributor>Hood, J. P.</dc:contributor>
<dc:date>1887-1920</dc:date>
<dc:type>Text</dc:type>
<dc:format>v.</dc:format>
<dc:format>microfilm</dc:format>
<dc:identifier>http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634</dc:identifier>
<dc:identifier>newspapers:guardian</dc:identifier>
<dc:language>eng</dc:language>
<dc:coverage>Prince Edward Island</dc:coverage>
<dc:coverage>Charlottetown (P.E.I.)</dc:coverage>
</oai_dc:dc>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="MODS" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-27T13:55:30.557Z" ID="MODS.0" LABEL="Mods Record" MIMETYPE="text/xml" SIZE="4405">
<foxml:xmlContent>
<mods version="3.3" xmlns="http://www.loc.gov/mods/v3"
xmlns:xsisnippet="http://www.w3.org/2001/XMLSchema-instance" xsisnippet:schemaLocation="http://www.loc.gov/mods/ http://www.loc.gov/standards/mods/mods.xsd">
<titleInfo>
<nonSort>The</nonSort>
<title>Guardian</title>
</titleInfo>
<titleInfo type="uniform">
<title>Guardian (Charlottetown, P.E.I.)</title>
</titleInfo>
<titleInfo type="alternative">
<nonSort>The</nonSort>
<title>Island guardian</title>
</titleInfo>
<titleInfo type="alternative">
<nonSort>The</nonSort>
<title>Charlottetown guardian</title>
</titleInfo>
<titleInfo type="alternative">
<nonSort>The</nonSort>
<title>Morning guardian</title>
</titleInfo>
<name>
<namePart>Hood, J. P.
</namePart>
<role>
<roleTerm>Manager</roleTerm>
</role>
<description>
Business Manager from Dec. 29, 1891 - Mar. 9, 1903; Managing Director from July 2, 1912 - Jan. 30, 1913.
</description>
</name>
<typeOfResource>text</typeOfResource>
<originInfo>
<place>
<placeTerm authority="marccountry" type="code">pic</placeTerm>
</place>
<place>
<placeTerm type="text">Charlottetown, P.E.I</placeTerm>
</place>
<dateIssued>1887-1920</dateIssued>
<dateIssued encoding="marc" point="start">1887</dateIssued>
<dateIssued encoding="marc" point="end">1920</dateIssued>
<issuance>continuing</issuance>
</originInfo>
<language>
<languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<abstract>The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian.
The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade.
.... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers.
</abstract>
<physicalDescription>
<form authority="marcform">microfilm</form>
<form authority="gmd">microform</form>
<extent>v.</extent>
</physicalDescription>
<note>Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian.</note>
<note>Ceased publication in 1920?</note>
<note>Missing issues.</note>
<note type="reproduction">Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels.</note>
<subject authority="lcsh">
<geographic>Prince Edward Island</geographic>
<topic>Newspapers</topic>
</subject>
<subject authority="lcsh">
<geographic>Charlottetown (P.E.I.)</geographic>
<topic>Newspapers</topic>
</subject>
<identifier type="islandpines">http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634</identifier>
<recordInfo>
<recordContentSource authority="marcorg">CaPCU</recordContentSource>
<recordCreationDate encoding="marc">760913</recordCreationDate>
<recordChangeDate encoding="iso8601">20090407151822.0</recordChangeDate>
</recordInfo>
</mods>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-05-28T18:38:36.223Z" ID="MODS.1" LABEL="Mods Record" MIMETYPE="text/xml" SIZE="4405">
<foxml:xmlContent>
<mods version="3.3" xmlns="http://www.loc.gov/mods/v3"
xmlns:xsisnippet="http://www.w3.org/2001/XMLSchema-instance" xsisnippet:schemaLocation="http://www.loc.gov/mods/ http://www.loc.gov/standards/mods/mods.xsd">
<titleInfo>
<nonSort>The</nonSort>
<title>Guardian</title>
</titleInfo>
<titleInfo type="uniform">
<title>Guardian (Charlottetown, P.E.I.)</title>
</titleInfo>
<titleInfo type="alternative">
<nonSort>The</nonSort>
<title>Island guardian</title>
</titleInfo>
<titleInfo type="alternative">
<nonSort>The</nonSort>
<title>Charlottetown guardian</title>
</titleInfo>
<titleInfo type="alternative">
<nonSort>The</nonSort>
<title>Morning guardian</title>
</titleInfo>
<name>
<namePart>Hood, J. P.
</namePart>
<role>
<roleTerm>Manager</roleTerm>
</role>
<description>
Business Manager from Dec. 29, 1891 - Mar. 9, 1903; Managing Director from July 2, 1912 - Jan. 30, 1913.
</description>
</name>
<typeOfResource>text</typeOfResource>
<originInfo>
<place>
<placeTerm authority="marccountry" type="code">pic</placeTerm>
</place>
<place>
<placeTerm type="text">Charlottetown, P.E.I</placeTerm>
</place>
<dateIssued>1887-1920</dateIssued>
<dateIssued encoding="marc" point="start">1887</dateIssued>
<dateIssued encoding="marc" point="end">1920</dateIssued>
<issuance>continuing</issuance>
</originInfo>
<language>
<languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<abstract>The Guardian, the successor to the Island Guardian, began publication in 1890 a a politically independent newspaper printing news and advertisements. Its editorials often discussed trade and tariffs, and it supported temperance and the Scott Act. Lcal, national and international news coverage was excellent in the paper. Twoards the end of the 1890s, headlines and line drawings illustrating the news stories began appearing in the Guardian.
The tone of the newspaper changed during the first decade of the twentieth century; its news coverage became more sensational and its editorials offered less political commentary. Special weekend issues were printed during the second half of this decade, featuring comic strips, housekeeping articles, popular songs, sermons, local history and Sunday School lessons. Photographs and line drawings appeared frequently during the final years of the decade.
.... more in Heather Boylan ... p.54-Checklist and Historical Directory of Prince Edward Island Newspapers.
</abstract>
<physicalDescription>
<form authority="marcform">microfilm</form>
<form authority="gmd">microform</form>
<extent>v.</extent>
</physicalDescription>
<note>Title varies: 1887- , The Island guardian; Dec. 1890-Jan. 1891, The Daily guardian; Jan. 1891- , The Morning guardian.</note>
<note>Ceased publication in 1920?</note>
<note>Missing issues.</note>
<note type="reproduction">Microfilm of the original in Prince Edward Island Public and Legislative Libraries. Ottawa, Canadian Library Association Newspaper Microfilming Project, 1963- reels.</note>
<subject authority="lcsh">
<geographic>Prince Edward Island</geographic>
<topic>Newspapers</topic>
</subject>
<subject authority="lcsh">
<geographic>Charlottetown (P.E.I.)</geographic>
<topic>Newspapers</topic>
</subject>
<identifier type="islandpines">http://islandpines.roblib.upei.ca/opac/extras/supercat/mods33/record/274634</identifier>
<recordInfo>
<recordContentSource authority="marcorg">CaPCU</recordContentSource>
<recordCreationDate encoding="marc">760913</recordCreationDate>
<recordChangeDate encoding="iso8601">20090407151822.0</recordChangeDate>
</recordInfo>
</mods>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="RELS-EXT" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-27T13:55:30.557Z" ID="RELS-EXT.0"
LABEL="Fedora Object-to-Object Relationship Metadata" MIMETYPE="text/xml" SIZE="679">
<foxml:xmlContent>
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:fedora="info:fedora/fedora-system:def/relations-external#"
xmlns:fedora-model="info:fedora/fedora-system:def/model#"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<rdf:description rdf:about="info:fedora/newspapers:guardian">
<fedora:isMemberOf rdf:resource="info:fedora/newspapers:collection"/>
<fedora-model:hasModel rdf:resource="info:fedora/newspapers:newspaperCModel"/>
</rdf:description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
</foxml:digitalObject>

25
plugins/islandora_newspaper/newspapers_issueCModel_islandoracm.xml

@ -1,25 +0,0 @@
<content_model name="Newspaper" xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.islandora.ca http://localhost/islandoracm.xsd" version="2">
<mimetypes>
<type>text/xml</type>
</mimetypes>
<ingest_rules>
<rule>
<applies_to>text/xml</applies_to>
<ingest_methods>
<ingest_method class="IslandoraBook" dsid="MODS" file="book.inc" method="ingestBook" modified_files_ext="" module="fedora_ilives"/>
</ingest_methods>
</rule>
</ingest_rules>
<datastreams>
<datastream dsid="MODS">
<display_method class="Newspaper" file="Newspaper.inc" method="showFieldSets" module="islandora_newspaper"/>
</datastream>
<datastream dsid="TN"/>
<datastream dsid="DC"/>
</datastreams>
<ingest_form dsid="MODS" page="2">
<form_builder_method class="Newspaper" file="Newspaper.inc" handler="handleIngestForm" method="buildDrupalForm" module="islandora_newspaper"/>
<form_elements/>
</ingest_form>
</content_model>

149
plugins/islandora_newspaper/newspapers_pageCModel.xml

@ -1,149 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject PID="newspapers:pageCModel" VERSION="1.1" xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Newspaper Page Content Model"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2010-05-28T19:37:09.514Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-06-21T19:39:20.139Z"/>
</foxml:objectProperties>
<foxml:datastream CONTROL_GROUP="X" ID="AUDIT" STATE="A" VERSIONABLE="false">
<foxml:datastreamVersion CREATED="2010-05-28T19:37:09.514Z"
FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit" ID="AUDIT.0" LABEL="Audit Trail for this object" MIMETYPE="text/xml">
<foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-28T19:37:09.514Z</audit:date>
<audit:justification>Created with Admin GUI "New Object" command</audit:justification>
</audit:record>
<audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-31T15:15:26.657Z</audit:date>
<audit:justification>Ingested from local file /Users/al/Desktop/newspapers_pageCModel.xml</audit:justification>
</audit:record>
<audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-06-01T13:22:40.275Z</audit:date>
<audit:justification>Ingested from local file /Users/aoneill/fedora_repository/plugins/newspaper/newspapers_pageCModel.xml</audit:justification>
</audit:record>
<audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>ISLANDORACM</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-06-21T16:26:53.809Z</audit:date>
<audit:justification>DatastreamsPane generated this logMessage.</audit:justification>
</audit:record>
<audit:record ID="AUDREC5">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-06-21T19:39:20.139Z</audit:date>
<audit:justification>Ingested from source repository with pid newspapers:pageCModel</audit:justification>
</audit:record>
</audit:auditTrail>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="RELS-EXT" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-28T19:37:09.556Z" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0"
ID="RELS-EXT1.0" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" SIZE="365">
<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:Description rdf:about="info:fedora/newspapers:pageCModel">
<fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ContentModel-3.0"/>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DS-COMPOSITE-MODEL" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-28T19:37:09.556Z"
FORMAT_URI="info:fedora/fedora-system:FedoraDSCompositeModel-1.0" ID="DS-COMPOSITE-MODEL1.0"
LABEL="Datastream Composite Model" MIMETYPE="text/xml" SIZE="1120">
<foxml:xmlContent>
<dsCompositeModel xmlns="info:fedora/fedora-system:def/dsCompositeModel#">
<comment xmlns="info:fedora/fedora-system:def/comment#">
This DS-COMPOSITE-MODEL datastream is included as a starting point to
assist in the creation of a content model. The DS-COMPOSITE-MODEL
should define the datastreams that are required for any objects
conforming to this content model.
For more information about content models, see:
http://fedora-commons.org/confluence/x/dgBI.
For examples of completed content model objects, see the demonstration
objects included with your Fedora distribution, such as:
demo:CMImage, demo:UVA_STD_IMAGE, demo:DualResImageCollection,
demo:TEI_TO_PDFDOC, and demo:XML_TO_HTMLDOC.
For more information about the demonstration objects, see:
http://fedora-commons.org/confluence/x/AwFI.
</comment>
<dsTypeModel ID="DSID">
<form MIME="text/xml"/>
</dsTypeModel>
</dsCompositeModel>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DC" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-28T19:37:09.514Z" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/"
ID="DC1.0" LABEL="Dublin Core Record for this object" MIMETYPE="text/xml" SIZE="402">
<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">
<dc:title>Newspaper Page Content Model</dc:title>
<dc:identifier>newspapers:pageCModel</dc:identifier>
</oai_dc:dc>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="ISLANDORACM" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-06-21T16:26:53.809Z" ID="ISLANDORACM.0"
LABEL="Islandora content model description" MIMETYPE="text/xml" SIZE="1254">
<foxml:xmlContent>
<content_model name="standard_herb">
<mimetypes/>
<display_in_fieldset>
<datastream id="JPG">
<method>
<file>plugins/Newspaper.inc</file>
<class_name>Newspaper</class_name>
<method_name>showPageFieldSets</method_name>
</method>
</datastream>
<datastream id="JP2"/>
<datastream id="LOSSLESS_JP2"/>
<datastream id="JPG"/>
<datastream id="TN"/>
<datastream id="DC"/>
<datastream id="MODS"/>
</display_in_fieldset>
<edit_metadata>
<build_form_method dsid="MODS">
<file>plugins/Newspaper.inc</file>
<class_name>Newspaper</class_name>
<method_name>buildEditMetadataForm</method_name>
</build_form_method>
<submit_form_method dsid="MODS">
<file>plugins/Newspaper.inc</file>
<class_name>Newspaper</class_name>
<method_name>handleEditMetadataForm</method_name>
</submit_form_method>
</edit_metadata>
</content_model>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
</foxml:digitalObject>

241
plugins/islandora_newspaper/newspapers_viewerSdep-issueCModel.xml

@ -1,241 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject PID="newspapers:viewerSdep-issueCModel" VERSION="1.1"
xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Viewer service deployment for Newspaper content model"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2010-05-31T20:54:30.053Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-05-31T20:59:03.704Z"/>
</foxml:objectProperties>
<foxml:datastream CONTROL_GROUP="X" ID="AUDIT" STATE="A" VERSIONABLE="false">
<foxml:datastreamVersion CREATED="2010-05-31T20:54:30.053Z"
FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit" ID="AUDIT.0" LABEL="Audit Trail for this object" MIMETYPE="text/xml">
<foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-31T20:54:30.053Z</audit:date>
<audit:justification>Created with Admin GUI "New Object" command</audit:justification>
</audit:record>
<audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>DSINPUTSPEC</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-31T20:55:13.521Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>METHODMAP</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-31T20:55:35.100Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>WSDL</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-31T20:55:59.039Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC5">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-31T20:57:54.728Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC6">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>METHODMAP</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-05-31T20:59:03.704Z</audit:date>
<audit:justification/>
</audit:record>
</audit:auditTrail>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="RELS-EXT" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-31T20:54:30.208Z" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0"
ID="RELS-EXT1.0" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" SIZE="604">
<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:Description rdf:about="info:fedora/newspapers:viewerSdep-issueCModel">
<fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"/>
<fedora-model:isDeploymentOf rdf:resource="info:fedora/changeme-to-sDefPid"/>
<fedora-model:isContractorOf rdf:resource="info:fedora/changeme-to-cModelPid"/>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-05-31T20:57:54.728Z" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0"
ID="RELS-EXT.1" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" SIZE="572">
<foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/newspapers:viewerSdep-issueCModel">
<hasModel rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0" xmlns="info:fedora/fedora-system:def/model#"/>
<isDeploymentOf rdf:resource="info:fedora/ilives:viewerSdef" xmlns="info:fedora/fedora-system:def/model#"/>
<isContractorOf rdf:resource="info:fedora/newspapers:issueCModel" xmlns="info:fedora/fedora-system:def/model#"/>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="METHODMAP" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-31T20:54:30.208Z"
FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" ID="METHODMAP1.0" LABEL="Deployment Method Map"
MIMETYPE="text/xml" SIZE="298">
<foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#">
This METHODMAP datastream is included as a starting point to
assist in the creation of a service deployment. The METHODMAP
should define the the mapping of the WSDL to Fedora object methods.
</comment>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-05-31T20:55:35.100Z"
FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" ID="METHODMAP.1" LABEL="Deployment Method Map"
MIMETYPE="text/xml" SIZE="891">
<foxml:xmlContent>
<fmm:MethodMap name="methodmap" xmlns:fmm="http://fedora.comm.nsdlib.org/service/methodmap">
<fmm:Method operationName="getViewer" wsdlMsgName="getViewerRequestMsg" wsdlMsgOutput="getViewerResponseMsg">
<fmm:DefaultInputParm defaultValue="$PID" label="fedora object pid" parmName="PID" passBy="VALUE" required="true"/>
<fmm:DefaultInputParm defaultValue="ilives:bookCModel" label="content model" parmName="CMODEL"
passBy="VALUE" required="true"/>
<fmm:DefaultInputParm defaultValue="JP2" label="content model" parmName="DSID" passBy="VALUE" required="true"/>
<fmm:UserInputParm defaultValue="" parmName="uid" passBy="VALUE" required="false"/>
<fmm:MethodReturnType wsdlMsgName="getViewerResponseMsg" wsdlMsgTOMIME="text/html"/>
</fmm:Method>
</fmm:MethodMap>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-05-31T20:59:03.704Z"
FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" ID="METHODMAP.2" LABEL="Deployment Method Map"
MIMETYPE="text/xml" SIZE="896">
<foxml:xmlContent>
<fmm:MethodMap name="methodmap" xmlns:fmm="http://fedora.comm.nsdlib.org/service/methodmap">
<fmm:Method operationName="getViewer" wsdlMsgName="getViewerRequestMsg" wsdlMsgOutput="getViewerResponseMsg">
<fmm:DefaultInputParm defaultValue="$PID" label="fedora object pid" parmName="PID" passBy="VALUE" required="true"/>
<fmm:DefaultInputParm defaultValue="newspapers:issueCModel" label="content model" parmName="CMODEL"
passBy="VALUE" required="true"/>
<fmm:DefaultInputParm defaultValue="JP2" label="content model" parmName="DSID" passBy="VALUE" required="true"/>
<fmm:UserInputParm defaultValue="" parmName="uid" passBy="VALUE" required="false"/>
<fmm:MethodReturnType wsdlMsgName="getViewerResponseMsg" wsdlMsgTOMIME="text/html"/>
</fmm:Method>
</fmm:MethodMap>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DSINPUTSPEC" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-31T20:54:30.208Z"
FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1" ID="DSINPUTSPEC1.0"
LABEL="Datastream Input Specification" MIMETYPE="text/xml" SIZE="300">
<foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#">
This DSINPUTSPEC datastream is included as a starting point to
assist in the creation of a service deployment. The DSINPUTSPEC
should define the datastreams to be used by WSDL-defined methods.
</comment>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-05-31T20:55:13.521Z"
FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1" ID="DSINPUTSPEC.1"
LABEL="Datastream Input Specification" MIMETYPE="text/xml" SIZE="356">
<foxml:xmlContent>
<fbs:DSInputSpec label="viewerSdepInputSpec" xmlns:fbs="http://fedora.comm.nsdlib.org/service/bindspec">
<fbs:DSInput DSMax="1" DSMin="1" DSOrdinality="false" wsdlMsgPartName="DC">
<fbs:DSInputLabel>DC</fbs:DSInputLabel>
<fbs:DSMIME>text/xml</fbs:DSMIME>
<fbs:DSInputInstruction/>
</fbs:DSInput>
</fbs:DSInputSpec>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="WSDL" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-31T20:54:30.214Z" FORMAT_URI="http://schemas.xmlsoap.org/wsdl/"
ID="WSDL1.0" LABEL="WSDL Bindings" MIMETYPE="text/xml" SIZE="752">
<foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#">
This WSDL datastream is included as a starting point to
assist in the creation of a service deployment. The WSDL
should define the services provided by this
service deployment.
For more information about service deployments, see:
http://fedora-commons.org/confluence/x/dgBI.
For examples of completed service deployment objects, see the demonstration
objects included with your Fedora distribution, such as:
demo:2, demo:13, demo:20, and demo:28.
For more information about the demonstration objects, see:
http://fedora-commons.org/confluence/x/AwFI.
</comment>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-05-31T20:55:59.039Z" FORMAT_URI="http://schemas.xmlsoap.org/wsdl/"
ID="WSDL.1" LABEL="WSDL Bindings" MIMETYPE="text/xml" SIZE="1809">
<foxml:xmlContent>
<wsdl:definitions name="viewerSdep" targetNamespace="viewerSdep"
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="viewerSdep"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="getViewerRequestMsg">
<wsdl:part name="PID" type="xsd:string"/>
<wsdl:part name="CMODEL" type="xsd:string"/>
<wsdl:part name="DSID" type="xsd:string"/>
<wsdl:part name="uid" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getViewerResponseMsg">
<wsdl:part name="RESPONSE" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="viewer_portType">
<wsdl:operation name="getViewer">
<wsdl:input message="this:getViewerRequestMsg"/>
<wsdl:output message="this:getViewerResponseMsg"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="viewer_service">
<wsdl:port binding="this:viewer_binding" name="viewer_port">
<http:address location="http://local.fedora.server/iiv/viewer.jsp"/>
</wsdl:port>
</wsdl:service>
<wsdl:binding name="viewer_binding" type="this:viewer_portType">
<http:binding verb="GET"/>
<wsdl:operation name="getViewer">
<http:operation location="?pid=(PID)&amp;cmodel=(CMODEL)&amp;dsid=(DSID)&amp;uid=(uid)"/>
<wsdl:input>
<http:urlReplacement/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/html"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DC" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-05-31T20:54:30.053Z" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/"
ID="DC1.0" LABEL="Dublin Core Record for this object" MIMETYPE="text/xml" SIZE="439">
<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">
<dc:title>Viewer service deployment for Newspaper content model</dc:title>
<dc:identifier>newspapers:viewerSdep-issueCModel</dc:identifier>
</oai_dc:dc>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
</foxml:digitalObject>

217
plugins/islandora_newspaper/newspapers_viewerSdep-pageCModel.xml

@ -1,217 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject PID="newspapers:viewerSdep-pageCModel" VERSION="1.1"
xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Viewer for newspaper pages"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2010-06-21T17:47:30.096Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-06-21T17:51:49.022Z"/>
</foxml:objectProperties>
<foxml:datastream CONTROL_GROUP="X" ID="AUDIT" STATE="A" VERSIONABLE="false">
<foxml:datastreamVersion CREATED="2010-06-21T17:47:30.096Z"
FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit" ID="AUDIT.0" LABEL="Audit Trail for this object" MIMETYPE="text/xml">
<foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-06-21T17:47:30.096Z</audit:date>
<audit:justification>Created with Admin GUI "New Object" command</audit:justification>
</audit:record>
<audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-06-21T17:49:00.674Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>METHODMAP</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-06-21T17:50:01.411Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>DSINPUTSPEC</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-06-21T17:50:23.252Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC5">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>WSDL</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-06-21T17:51:49.022Z</audit:date>
<audit:justification/>
</audit:record>
</audit:auditTrail>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="RELS-EXT" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-06-21T17:47:30.621Z" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0"
ID="RELS-EXT1.0" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" SIZE="603">
<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:Description rdf:about="info:fedora/newspapers:viewerSdep-pageCModel">
<fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"/>
<fedora-model:isDeploymentOf rdf:resource="info:fedora/changeme-to-sDefPid"/>
<fedora-model:isContractorOf rdf:resource="info:fedora/changeme-to-cModelPid"/>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-06-21T17:49:00.674Z" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0"
ID="RELS-EXT.1" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" SIZE="570">
<foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/newspapers:viewerSdep-pageCModel">
<hasModel rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0" xmlns="info:fedora/fedora-system:def/model#"/>
<isDeploymentOf rdf:resource="info:fedora/ilives:viewerSdef" xmlns="info:fedora/fedora-system:def/model#"/>
<isContractorOf rdf:resource="info:fedora/newspapers:pageCModel" xmlns="info:fedora/fedora-system:def/model#"/>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="METHODMAP" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-06-21T17:47:30.621Z"
FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" ID="METHODMAP1.0" LABEL="Deployment Method Map"
MIMETYPE="text/xml" SIZE="298">
<foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#">
This METHODMAP datastream is included as a starting point to
assist in the creation of a service deployment. The METHODMAP
should define the the mapping of the WSDL to Fedora object methods.
</comment>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-06-21T17:50:01.411Z"
FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1" ID="METHODMAP.1" LABEL="Deployment Method Map"
MIMETYPE="text/xml" SIZE="895">
<foxml:xmlContent>
<fmm:MethodMap name="methodmap" xmlns:fmm="http://fedora.comm.nsdlib.org/service/methodmap">
<fmm:Method operationName="getViewer" wsdlMsgName="getViewerRequestMsg" wsdlMsgOutput="getViewerResponseMsg">
<fmm:DefaultInputParm defaultValue="$PID" label="fedora object pid" parmName="PID" passBy="VALUE" required="true"/>
<fmm:DefaultInputParm defaultValue="newspapers:pageCModel" label="content model" parmName="CMODEL"
passBy="VALUE" required="true"/>
<fmm:DefaultInputParm defaultValue="JP2" label="content model" parmName="DSID" passBy="VALUE" required="true"/>
<fmm:UserInputParm defaultValue="" parmName="uid" passBy="VALUE" required="false"/>
<fmm:MethodReturnType wsdlMsgName="getViewerResponseMsg" wsdlMsgTOMIME="text/html"/>
</fmm:Method>
</fmm:MethodMap>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DSINPUTSPEC" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-06-21T17:47:30.621Z"
FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1" ID="DSINPUTSPEC1.0"
LABEL="Datastream Input Specification" MIMETYPE="text/xml" SIZE="300">
<foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#">
This DSINPUTSPEC datastream is included as a starting point to
assist in the creation of a service deployment. The DSINPUTSPEC
should define the datastreams to be used by WSDL-defined methods.
</comment>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-06-21T17:50:23.252Z"
FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1" ID="DSINPUTSPEC.1"
LABEL="Datastream Input Specification" MIMETYPE="text/xml" SIZE="356">
<foxml:xmlContent>
<fbs:DSInputSpec label="viewerSdepInputSpec" xmlns:fbs="http://fedora.comm.nsdlib.org/service/bindspec">
<fbs:DSInput DSMax="1" DSMin="1" DSOrdinality="false" wsdlMsgPartName="DC">
<fbs:DSInputLabel>DC</fbs:DSInputLabel>
<fbs:DSMIME>text/xml</fbs:DSMIME>
<fbs:DSInputInstruction/>
</fbs:DSInput>
</fbs:DSInputSpec>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="WSDL" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-06-21T17:47:30.623Z" FORMAT_URI="http://schemas.xmlsoap.org/wsdl/"
ID="WSDL1.0" LABEL="WSDL Bindings" MIMETYPE="text/xml" SIZE="752">
<foxml:xmlContent>
<comment xmlns="info:fedora/fedora-system:def/comment#">
This WSDL datastream is included as a starting point to
assist in the creation of a service deployment. The WSDL
should define the services provided by this
service deployment.
For more information about service deployments, see:
http://fedora-commons.org/confluence/x/dgBI.
For examples of completed service deployment objects, see the demonstration
objects included with your Fedora distribution, such as:
demo:2, demo:13, demo:20, and demo:28.
For more information about the demonstration objects, see:
http://fedora-commons.org/confluence/x/AwFI.
</comment>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-06-21T17:51:49.022Z" FORMAT_URI="http://schemas.xmlsoap.org/wsdl/"
ID="WSDL.1" LABEL="WSDL Bindings" MIMETYPE="text/xml" SIZE="1809">
<foxml:xmlContent>
<wsdl:definitions name="viewerSdep" targetNamespace="viewerSdep"
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="viewerSdep"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="getViewerRequestMsg">
<wsdl:part name="PID" type="xsd:string"/>
<wsdl:part name="CMODEL" type="xsd:string"/>
<wsdl:part name="DSID" type="xsd:string"/>
<wsdl:part name="uid" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getViewerResponseMsg">
<wsdl:part name="RESPONSE" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="viewer_portType">
<wsdl:operation name="getViewer">
<wsdl:input message="this:getViewerRequestMsg"/>
<wsdl:output message="this:getViewerResponseMsg"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="viewer_service">
<wsdl:port binding="this:viewer_binding" name="viewer_port">
<http:address location="http://local.fedora.server/iiv/viewer.jsp"/>
</wsdl:port>
</wsdl:service>
<wsdl:binding name="viewer_binding" type="this:viewer_portType">
<http:binding verb="GET"/>
<wsdl:operation name="getViewer">
<http:operation location="?pid=(PID)&amp;cmodel=(CMODEL)&amp;dsid=(DSID)&amp;uid=(uid)"/>
<wsdl:input>
<http:urlReplacement/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/html"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DC" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-06-21T17:47:30.096Z" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/"
ID="DC1.0" LABEL="Dublin Core Record for this object" MIMETYPE="text/xml" SIZE="411">
<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">
<dc:title>Viewer for newspaper pages</dc:title>
<dc:identifier>newspapers:viewerSdep-pageCModel</dc:identifier>
</oai_dc:dc>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
</foxml:digitalObject>

8
plugins/pidfield/pidfield.info

@ -1,8 +0,0 @@
; $Id$
name = PID Field
description = Defines a field type for referencing a Fedora item from a node.
dependencies[] = content
dependencies[] = fedora_repository
package = Fedora Repository
core = 6.x

40
plugins/pidfield/pidfield.install

@ -1,40 +0,0 @@
<?php
/**
* @file
* Implementation of hook_install().
*/
function pidfield_install() {
drupal_load('module', 'content');
content_notify('install', 'pidfield');
}
/**
* Implementation of hook_uninstall().
*/
function pidfield_uninstall() {
drupal_load('module', 'content');
content_notify('uninstall', 'pidfield');
}
/**
* Implementation of hook_enable().
*
* Notify content module when this module is enabled.
*/
function pidfield_enable() {
drupal_load('module', 'content');
content_notify('enable', 'pidfield');
}
/**
* Implementation of hook_disable().
*
* Notify content module when this module is disabled.
*/
function pidfield_disable() {
drupal_load('module', 'content');
content_notify('disable', 'pidfield');
}

459
plugins/pidfield/pidfield.module

@ -1,459 +0,0 @@
<?php
/**
* @file
* An example to define a simple field, widget, and formatter.
* A module could define only a field, only a widget, only a
* formatter, or any combination. Widgets and formatters must
* declare what kind of field they work with, which can be any
* existing field as well as any new field the module creates.
*/
//==========================================//
// DEFINING A FIELD
//==========================================//
/**
* Implementation of hook_field_info().
*/
function pidfield_field_info() {
return array(
// The machine name of the field,
// no more than 32 characters.
'pidfield' => array(
// The human-readable label of the field that will be
// seen in the Manage fields screen.
'label' => t('Fedora PID field'),
// A description of what type of data the field stores.
'description' => t('Store a reference to a PID in this site\'s Fedora repository.'),
// An icon to use in Panels.
'content_icon' => 'icon_content_text.png',
),
);
}
/**
* Implementation of hook_field_settings().
*/
function pidfield_field_settings($op, $field) {
switch ($op) {
// Create the form element to be used on the field
// settings form. Field settings will be the same for
// all shared instances of the same field and should
// define the way the value will be stored
// in the database.
case 'form':
$form = array();
$form['max_length'] = array(
'#type' => 'textfield',
'#title' => t('Maximum length'),
'#default_value' => is_numeric($field['max_length']) ? $field['max_length'] : 64,
'#required' => FALSE,
// Use #element_validate to validate the settings.
'#element_validate' => array('_pidfield_length_validate'),
'#description' => t('The maximum length of the field in characters. Must be a number between 1 and 255'),
);
return $form;
// Return an array of the names of the field settings
// defined by this module. These are the items that
// CCK will store in the field definition
// and they will be available in the $field array.
// This should match the items defined in 'form' above.
case 'save':
return array('max_length');
// Define the database storage for this field using
// the same construct used by schema API. Most fields
// have only one column, but there can be any number
// of different columns. After the schema API values,
// add two optional values to each column,
// 'views', to define a Views field
// 'sortable', to add a Views sort field
case 'database columns':
$columns['value'] = array(
'type' => 'varchar',
'length' => is_numeric($field['max_length']) ? $field['max_length'] : 64,
'not null' => FALSE,
'sortable' => TRUE,
'views' => TRUE,
);
return $columns;
// Optional: Make changes to the default $data array
// created for Views. Omit this if no changes are
// needed, use it to add a custom handler or make
// other changes.
case 'views data':
// Start with the $data created by CCK
// and alter it as needed. The following
// code illustrates how you would retrieve
// the necessary data.
$data = content_views_field_views_data($field);
$db_info = content_database_info($field);
$table_alias = content_views_tablename($field);
$field_data = $data[$table_alias][$field['field_name'] . '_value'];
// Make changes to $data as needed here.
return $data;
}
}
/**
* Custom validation of settings values.
*
* Create callbacks like this to do settings validation.
*/
function _pidfield_length_validate($element, &$form_state) {
$value = $form_state['values']['max_length'];
if ($value && !is_numeric($value) || $value < 1 || $value > 255) {
form_set_error('max_length', t('"Max length" must be a number between 1 and 64.'));
}
}
/**
* Implementation of hook_field().
*/
function pidfield_field($op, &$node, $field, &$items, $teaser, $page) {
switch ($op) {
// Do validation on the field values here. The widget
// will do its own validation and you cannot make any
// assumptions about what kind of widget has been used,
// so don't validate widget values, only field values.
case 'validate':
if (is_array($items)) {
foreach ($items as $delta => $item) {
// The error_element is needed so that CCK can
// set an error on the right sub-element when
// fields are deeply nested in the form.
$error_element = isset($item['_error_element']) ? $item['_error_element'] : '';
if (is_array($item) && isset($item['_error_element']))
unset($item['_error_element']);
if (!empty($item['value'])) {
if (!empty($field['max_length']) && drupal_strlen($item['value']) > $field['max_length']) {
form_set_error($error_element, t('%name: the value may not be longer than %max characters.', array('%name' => $field['widget']['label'], '%max' => $field['max_length'])));
}
}
}
}
return $items;
// This is where you make sure that user-provided
// data is sanitized before being displayed.
case 'sanitize':
foreach ($items as $delta => $item) {
$pid_field_text = check_plain($item['value']);
$items[$delta]['safe'] = $pid_field_text;
}
}
}
/**
* Implementation of hook_content_is_empty().
*
* CCK has no way to know if something like a zero is
* an empty value or a valid value, so return
* TRUE or FALSE to a populated field $item array.
* CCK uses this to remove empty multi-value elements
* from forms.
*/
function pidfield_content_is_empty($item, $field) {
if (empty($item['value'])) {
return TRUE;
}
return FALSE;
}
/**
* Implementation of hook content_generate().
*
* Optional, provide dummy value for nodes created
* by the Devel Generate module.
*/
function pidfield_content_generate($node, $field) {
$node_field = array();
// Generate a value that respects max_length.
if (empty($field['max_length'])) {
$field['max_length'] = 12;
}
$node_field['value'] = user_password($field['max_length']);
return $node_field;
}
/**
* Implementation of hook_token_list()
* and hook_token_values().
*
* Optional, provide token values for this field.
*/
function pidfield_token_list($type = 'all') {
if ($type == 'field' || $type == 'all') {
$tokens = array();
$tokens['pidfield']['raw'] = t('Just the PID itself.');
$tokens['pidfield']['formatted'] = t('A PID with a hyperlink');
return $tokens;
}
}
function pidfield_token_values($type, $object = NULL) {
if ($type == 'field') {
$item = $object[0];
$tokens['raw'] = $item['value'];
$tokens['formatted'] = isset($item['view']) ? $item['view'] : '';
return $tokens;
}
}
//==========================================//
// DEFINING A FORMATTER
//==========================================//
/**
* Implementation of hook_theme().
*/
function pidfield_theme() {
return array(
// Themes for the formatters.
'pidfield_formatter_default' => array(
'arguments' => array('element' => NULL),
),
'pidfield_formatter_plain' => array(
'arguments' => array('element' => NULL),
),
);
}
/**
* Implementation of hook_field_formatter_info().
*
* All fields should have a 'default' formatter.
* Any number of other formatters can be defined as well.
* It's nice for there always to be a 'plain' option
* for the raw value, but that is not required.
*
*/
function pidfield_field_formatter_info() {
return array(
// The machine name of the formatter.
'default' => array(
// The human-readable label shown on the Display
// fields screen.
'label' => t('Default'),
// An array of the field types this formatter
// can be used on.
'field types' => array('pidfield'),
// CONTENT_HANDLE_CORE: CCK will pass the formatter
// a single value.
// CONTENT_HANDLE_MODULE: CCK will pass the formatter
// an array of all the values. None of CCK's core
// formatters use multiple values, that is an option
// available to other modules that want it.
'multiple values' => CONTENT_HANDLE_CORE,
),
'plain' => array(
'label' => t('Plain text'),
'field types' => array('pidfield'),
'multiple values' => CONTENT_HANDLE_CORE,
),
);
}
/**
* Theme function for 'default' example field formatter.
*
* $element['#item']: the sanitized $delta value for the item,
* $element['#field_name']: the field name,
* $element['#type_name']: the $node->type,
* $element['#formatter']: the $formatter_name,
* $element'#node']: the $node,
* $element['#delta']: the delta of this item, like '0',
*
*/
function theme_pidfield_formatter_default($element) {
$pid = $element['#item']['safe'];
if (!empty($pid)) {
return fedora_repository_get_items($pid);
}
return null;
}
/**
* Theme function for 'plain' example field formatter.
*/
function theme_pidfield_formatter_plain($element) {
return strip_tags($element['#item']['safe']);
}
//==========================================//
// DEFINING A WIDGET
//==========================================//
/**
* Implementation of hook_widget_info().
*
* Here we indicate that the content module will handle
* the default value and multiple values for these widgets.
*
* Callbacks can be omitted if default handing is used.
* They're included here just so this module can be used
* as an example for custom modules that might do things
* differently.
*/
function pidfield_widget_info() {
return array(
// The machine name of the widget, no more than 32
// characters.
'pidfield_widget' => array(
// The human-readable label of the field that will be
// seen in the Manage fields screen.
'label' => t('PID Field widget'),
// An array of the field types this widget can be
// used with.
'field types' => array('pidfield'),
// Who will handle multiple values, default is core.
// 'CONTENT_HANDLE_MODULE' means the module does it.
// See optionwidgets for an example of a module that
// handles its own multiple values.
'multiple values' => CONTENT_HANDLE_CORE,
'callbacks' => array(
// Who will create the default value, default is core.
// 'CONTENT_CALLBACK_CUSTOM' means the module does it.
// 'CONTENT_CALLBACK_NONE' means this widget has
// no default value.
'default value' => CONTENT_CALLBACK_DEFAULT,
),
),
);
}
/**
* Implementation of hook_widget_settings().
*/
function pidfield_widget_settings($op, $widget) {
switch ($op) {
// Create the form element to be used on the widget
// settings form. Widget settings can be different
// for each shared instance of the same field and
// should define the way the value is displayed to
// the user in the edit form for that content type.
case 'form':
$form = array();
$size = (isset($widget['size']) && is_numeric($widget['size'])) ? $widget['size'] : 60;
$form['size'] = array(
'#type' => 'textfield',
'#title' => t('Size of textfield'),
'#default_value' => $size,
'#element_validate' => array('_element_validate_integer_positive'),
'#required' => TRUE,
);
return $form;
// Return an array of the names of the widget settings
// defined by this module. These are the items that
// CCK will store in the widget definition and they
// will be available in the $field['widget'] array.
// This should match the items defined in 'form' above.
case 'save':
return array('size');
}
}
/**
* Implementation of hook_widget().
*
* Attach a single form element to the form.
*
* CCK core fields only add a stub element and builds
* the complete item in #process so reusable elements
* created by hook_elements can be plugged into any
* module that provides valid $field information.
*
* Custom widgets that don't care about using hook_elements
* can be built out completely at this time.
*
* If there are multiple values for this field and CCK is
* handling multiple values, the content module will call
* this function as many times as needed.
*
* @param $form
* the entire form array,
* $form['#node'] holds node information
* @param $form_state
* the form_state,
* $form_state['values'][$field['field_name']]
* holds the field's form values.
* @param $field
* the field array
* @param $items
* array of default values for this field
* @param $delta
* the order of this item in the array of
* subelements (0, 1, 2, etc)
*
* @return
* the form item for a single element for this field
*/
function pidfield_widget(&$form, &$form_state, $field, $items, $delta = 0) {
$element['value'] = array(
'#type' => 'textfield',
'#title' => $field['widget']['label'],
'#default_value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : NULL,
'#autocomplete_path' => $element['#autocomplete_path'],
'#size' => !empty($field['widget']['size']) ? $field['widget']['size'] : 60,
'#attributes' => array('class' => 'pidfield'),
'#maxlength' => !empty($field['max_length']) ? $field['max_length'] : NULL,
);
// Used so that hook_field('validate') knows where to
// flag an error in deeply nested forms.
if (empty($form['#parents'])) {
$form['#parents'] = array();
}
$element['_error_element'] = array(
'#type' => 'value',
'#value' => implode('][', array_merge($form['#parents'], array('value'))),
);
return $element;
}
function get_node_references_for_fedora_item($item) {
$result = db_query("SELECT *
FROM {content_node_field} nf
INNER JOIN {content_node_field_instance} ni ON nf.field_name = ni.field_name
WHERE nf.type = 'pidfield'");
while ($field = db_fetch_array($result)) {
$db_info = content_database_info($field);
$ids = db_query("SELECT nid FROM {" . $db_info['table'] . "} WHERE " . $field['field_name'] . "_value=\"" . $item->pid . "\"");
$results = array();
while ($data = db_fetch_object($ids)) {
//$additions[] = node_load($data->vid);
$results[] = $data->nid;
//$referred_node = node_load(array('nid'=>$data->nid) );
}
return $results;
}
}
function fedora_pidfield_redirect_to_node($item) {
$node_references = get_node_references_for_fedora_item($item);
if (!empty($node_references)) {
if (strstr(drupal_get_destination(), urlencode('fedora/repository'))) {
drupal_goto(drupal_get_path_alias("node/" . $node_references[0]));
}
}
}
Loading…
Cancel
Save