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

111 lines
2.7 KiB

<?php
/**
* @file
* This is the new Islandora Collection module.
*/
define('ISLANDORA_COLLECTION_CONTENT_TYPE', 'islandora_collection');
/**
* Implements hook_views_api().
*/
function islandora_collection_views_api() {
return array(
'api' => 3.0,
'path' => drupal_get_path('module', 'islandora_collection') . '/include',
);
}
/**
* Implements hook_node_info().
*/
function islandora_collection_node_info() {
return array(
ISLANDORA_COLLECTION_CONTENT_TYPE => array(
'name' => t("Collection"),
'base' => ISLANDORA_COLLECTION_CONTENT_TYPE,
'description' => t("A Drupal node modeling an pcdm:Collection."),
),
);
}
/**
* Function for using a form.
*
* @param string $node
* The Drupal node.
* @param array $form_state
* The Drupal form state.
*/
function islandora_collection_form($node, array &$form_state) {
return node_content_form($node, $form_state);
}
/**
* Implements hook_rdf_namespaces().
*/
function islandora_collection_rdf_namespaces() {
return array(
'islandora' => 'http://islandora.ca/ontology/v2/',
'fedora' => 'http://fedora.info/definitions/v4/repository#',
);
}
/**
* Implements hook_rdf_mapping().
*/
function islandora_collection_rdf_mapping() {
return array(
array(
'type' => 'node',
'bundle' => ISLANDORA_COLLECTION_CONTENT_TYPE,
'mapping' => array(
'rdftype' => array('islandora:collection'),
'field_dcterms_contributor' => array(
'predicates' => array('dc:contributor'),
'datatype' => 'xsd:string',
),
'field_dcterms_coverage' => array(
'predicates' => array('dc:coverage'),
'datatype' => 'xsd:string',
),
'field_dcterms_creator' => array(
'predicates' => array('dc:creator'),
'datatype' => 'xsd:string',
),
'field_dcterms_date' => array(
'predicates' => array('dc:date'),
'datatype' => 'xsd:string',
),
'field_dcterms_description' => array(
'predicates' => array('dc:description'),
'datatype' => 'xsd:string',
),
),
),
);
}
/**
* Implements hook_insert().
*/
function islandora_collection_insert($node) {
/*
if (isset($_SERVER['HTTP_IGNORE_HOOKS']) && strcmp(strtolower($_SERVER['HTTP_IGNORE_HOOKS']), "true") == 0) {
dd("IGNORING SAVING THE COLLECTION");
}
dd("SAVING A COLLECTION");
dd($node);
*/
}
function islandora_collection_update($node) {
/*
if (isset($_SERVER['HTTP_IGNORE_HOOKS']) && strcmp(strtolower($_SERVER['HTTP_IGNORE_HOOKS']), "true") == 0) {
dd("IGNORING UPDATING THE COLLECTION");
}
dd("UPDATING A COLLECTION");
dd($node);
*/
}