Browse Source

Renaming dcterms to dc and using old namespace with dc11 prefix so as not to clash with Drupal core.

7.x-2.x
Daniel Lamb 10 years ago
parent
commit
fb7690b7c0
  1. 72
      islandora/include/rdf_mapping.inc
  2. 2
      islandora/islandora.info
  3. 4
      islandora/islandora.module
  4. 4
      islandora_basic_image/islandora_basic_image.install
  5. 5
      islandora_collection/include/fields.inc
  6. 1
      islandora_collection/islandora_collection.info
  7. 107
      islandora_dc/include/fields.inc
  8. 5
      islandora_dc/islandora_dc.info
  9. 40
      islandora_dc/islandora_dc.install
  10. 24
      islandora_dc/islandora_dc.module
  11. BIN
      islandora_dcterms/.islandora_dc.install.swp
  12. BIN
      islandora_dcterms/.islandora_dc.module.swp
  13. BIN
      islandora_dcterms/.islandora_dcterms.install.swp
  14. BIN
      islandora_dcterms/.islandora_dcterms.module.swp
  15. BIN
      islandora_dcterms/include/.fields.inc.swp
  16. 212
      islandora_dcterms/include/fields.inc
  17. 5
      islandora_dcterms/islandora_dcterms.info
  18. 40
      islandora_dcterms/islandora_dcterms.install
  19. 22
      islandora_dcterms/islandora_dcterms.module

72
islandora/include/rdf_mapping.inc

@ -23,64 +23,76 @@ function islandora_get_default_rdf_mapping($bundle, $rdf_type) {
'bundle' => $bundle,
'mapping' => array(
'rdftype' => array($rdf_type),
ISLANDORA_DCTERMS_CONTRIBUTOR_FIELD => array(
'predicates' => array('dc:contributor'),
'uuid' => array(
'predicates' => array('dc11:identifier'),
'datatype' => 'xsd:ID'
),
ISLANDORA_FEDORA_HAS_PARENT => array(
'predicates' => array('fedora:hasParent'),
'datatype' => 'xsd:string',
),
ISLANDORA_PCDM_HAS_MEMBER => array(
'predicates' => array('pcdm:hasMember'),
'datatype' => 'xsd:string',
),
ISLANDORA_DC_CONTRIBUTOR_FIELD => array(
'predicates' => array('dc11:contributor'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_COVERAGE_FIELD => array(
'predicates' => array('dc:coverage'),
ISLANDORA_DC_COVERAGE_FIELD => array(
'predicates' => array('dc11:coverage'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_CREATOR_FIELD => array(
'predicates' => array('dc:creator'),
ISLANDORA_DC_CREATOR_FIELD => array(
'predicates' => array('dc11:creator'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_DATE_FIELD => array(
'predicates' => array('dc:date'),
ISLANDORA_DC_DATE_FIELD => array(
'predicates' => array('dc11:date'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_DESCRIPTION_FIELD => array(
'predicates' => array('dc:description'),
ISLANDORA_DC_DESCRIPTION_FIELD => array(
'predicates' => array('dc11:description'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_FORMAT_FIELD => array(
'predicates' => array('dc:format'),
ISLANDORA_DC_FORMAT_FIELD => array(
'predicates' => array('dc11:format'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_IDENTIFIER_FIELD => array(
'predicates' => array('dc:identifier'),
ISLANDORA_DC_IDENTIFIER_FIELD => array(
'predicates' => array('dc11:identifier'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_LANGUAGE_FIELD => array(
'predicates' => array('dc:language'),
ISLANDORA_DC_LANGUAGE_FIELD => array(
'predicates' => array('dc11:language'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_PUBLISHER_FIELD => array(
'predicates' => array('dc:publisher'),
ISLANDORA_DC_PUBLISHER_FIELD => array(
'predicates' => array('dc11:publisher'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_RELATION_FIELD => array(
'predicates' => array('dc:relation'),
ISLANDORA_DC_RELATION_FIELD => array(
'predicates' => array('dc11:relation'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_RIGHTS_FIELD => array(
'predicates' => array('dc:rights'),
ISLANDORA_DC_RIGHTS_FIELD => array(
'predicates' => array('dc11:rights'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_SOURCE_FIELD => array(
'predicates' => array('dc:source'),
ISLANDORA_DC_SOURCE_FIELD => array(
'predicates' => array('dc11:source'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_SUBJECT_FIELD => array(
'predicates' => array('dc:subject'),
ISLANDORA_DC_SUBJECT_FIELD => array(
'predicates' => array('dc11:subject'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_TITLE_FIELD => array(
'predicates' => array('dc:title'),
ISLANDORA_DC_TITLE_FIELD => array(
'predicates' => array('dc11:title'),
'datatype' => 'xsd:string',
),
ISLANDORA_DCTERMS_TYPE_FIELD => array(
'predicates' => array('dc:type'),
ISLANDORA_DC_TYPE_FIELD => array(
'predicates' => array('dc11:type'),
'datatype' => 'xsd:string',
),
),

2
islandora/islandora.info

@ -11,4 +11,4 @@ dependencies[] = views_ui
dependencies[] = rdfui
dependencies[] = xml_field
dependencies[] = xpath_field
dependencies[] = islandora_dcterms
dependencies[] = islandora_dc

4
islandora/islandora.module

@ -7,6 +7,7 @@
define('ISLANDORA_NAMESPACE', 'http://islandora.ca/ontology/v2/');
define('ISLANDORA_FEDORA_NAMESPACE', 'http://fedora.info/definitions/v4/repository#');
define('ISLANDORA_PCDM_NAMESPACE', 'http://pcdm.org/models#');
define('ISLANDORA_TN_FIELD', 'field_tn');
define('ISLANDORA_MODS_FIELD', 'field_mods');
define('ISLANDORA_FEDORA_HAS_PARENT', 'field_fedora_has_parent');
@ -29,7 +30,8 @@ function islandora_ctools_plugin_api($owner, $api) {
function islandora_rdf_namespaces() {
return array(
'islandora' => ISLANDORA_NAMESPACE,
'fedora' => FEDORA_NAMESPACE,
'fedora' => ISLANDORA_FEDORA_NAMESPACE,
'pcdm' => ISLANDORA_PCDM_NAMESPACE,
);
}

4
islandora_basic_image/islandora_basic_image.install

@ -9,8 +9,6 @@
* Implements hook_install().
*/
function islandora_basic_image_install() {
module_load_include('inc', 'islandora_dcterms', 'include/fields');
// Ensure the basic image node type is available.
node_types_rebuild();
@ -62,6 +60,4 @@ function islandora_basic_image_install() {
field_create_instance($mods_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_MODS_FIELD)));
}
islandora_dcterms_attach_fields_to_bundle(ISLANDORA_BASIC_IMAGE_CONTENT_TYPE);
}

5
islandora_collection/include/fields.inc

@ -9,8 +9,6 @@
* Attaches default fields for this module's content type.
*/
function islandora_collection_attach_default_fields() {
module_load_include('inc', 'islandora_dcterms', 'include/fields');
$t = get_t();
// Add thumbnail field.
@ -40,7 +38,4 @@ function islandora_collection_attach_default_fields() {
field_create_instance($mods_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_MODS_FIELD)));
}
// Add dcterms fields.
islandora_dcterms_attach_fields_to_bundle(ISLANDORA_COLLECTION_CONTENT_TYPE);
}

1
islandora_collection/islandora_collection.info

@ -4,4 +4,3 @@ package = Islandora
version = 7.x-dev
core = 7.x
dependencies[] = islandora
dependencies[] = islandora_dcterms

107
islandora_dc/include/fields.inc

@ -0,0 +1,107 @@
<?php
/**
* @file
* Utility functions for working with DC fields.
*/
/**
* Adds all the DC fields to a bundle.
*
* @param string $bundle_name
* The name of the bundle to give the fields.
*/
function islandora_dc_add_fields_to_bundle($bundle_name) {
// If this gets called from an install hook, we can't guarantee the t's
// existance.
$t = get_t();
// Big list of field names/labels/descriptions.
$field_data = array(
ISLANDORA_DC_CONTRIBUTOR_FIELD => array(
'label' => 'DC Contributor',
'description' => 'Dublin Core 1.1 Contributor Metadata',
),
ISLANDORA_DC_COVERAGE_FIELD => array(
'label' => 'DC Coverage',
'description' => 'Dublin Core 1.1 Coverage Metadata',
),
ISLANDORA_DC_CREATOR_FIELD => array(
'label' => 'DC Creator',
'description' => 'Dublin Core 1.1 Creator Metadata',
),
ISLANDORA_DC_DATE_FIELD => array(
'label' => 'DC Date',
'description' => 'Dublin Core 1.1 Date Metadata',
),
ISLANDORA_DC_DESCRIPTION_FIELD => array(
'label' => 'DC Description',
'description' => 'Dublin Core 1.1 Description Metadata',
),
ISLANDORA_DC_FORMAT_FIELD => array(
'label' => 'DC Format',
'description' => 'Dublin Core 1.1 Format Metadata',
),
ISLANDORA_DC_IDENTIFIER_FIELD => array(
'label' => 'DC Identifier',
'description' => 'Dublin Core 1.1 Identifier Metadata',
),
ISLANDORA_DC_LANGUAGE_FIELD => array(
'label' => 'DC Language',
'description' => 'Dublin Core 1.1 Language Metadata',
),
ISLANDORA_DC_PUBLISHER_FIELD => array(
'label' => 'DC Publisher',
'description' => 'Dublin Core 1.1 Publisher Metadata',
),
ISLANDORA_DC_RELATION_FIELD => array(
'label' => 'DC Relation',
'description' => 'Dublin Core 1.1 Relation Metadata',
),
ISLANDORA_DC_RIGHTS_FIELD => array(
'label' => 'DC Rights',
'description' => 'Dublin Core 1.1 Rights Metadata',
),
ISLANDORA_DC_SOURCE_FIELD => array(
'label' => 'DC Source',
'description' => 'Dublin Core 1.1 Source Metadata',
),
ISLANDORA_DC_SUBJECT_FIELD => array(
'label' => 'DC Subject',
'description' => 'Dublin Core 1.1 Subject Metadata',
),
ISLANDORA_DC_TITLE_FIELD => array(
'label' => 'DC Title',
'description' => 'Dublin Core 1.1 Title Metadata',
),
ISLANDORA_DC_TYPE_FIELD => array(
'label' => 'DC Type',
'description' => 'Dublin Core 1.1 Type Metadata',
),
);
// Iterate over fields and add each to the specified bundle.
foreach ($field_data as $field_name => $data) {
$field_label = $data['label'];
$field_description = $data['description'];
if (field_info_field($field_name)) {
$field_instance = array(
'field_name' => $field_name,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("%label", array("%description" => $field_label)),
'description' => $t("%description", array("%description" => $field_description)),
'required' => FALSE,
);
field_create_instance($field_instance);
$message = $t('Field %name was added to %bundle successfully',
array(
'%name' => $field_name,
'%bundle' => $bundle,
));
drupal_set_message($message);
}
}
}

5
islandora_dc/islandora_dc.info

@ -0,0 +1,5 @@
name = Islandora DC
description = "Fields and utilities for managing DC 1.1 metadata in Islandora"
package = Islandora
version = 7.x-dev
core = 7.x

40
islandora_dc/islandora_dc.install

@ -0,0 +1,40 @@
<?php
/**
* @file
* Install hooks for this module.
*/
/**
* Implements hook_install().
*
* Creates shared fields for content types using DC metadata.
*/
function islandora_dc_install() {
$field_names = array(
ISLANDORA_DC_CONTRIBUTOR_FIELD,
ISLANDORA_DC_COVERAGE_FIELD,
ISLANDORA_DC_CREATOR_FIELD,
ISLANDORA_DC_DATE_FIELD,
ISLANDORA_DC_DESCRIPTION_FIELD,
ISLANDORA_DC_FORMAT_FIELD,
ISLANDORA_DC_IDENTIFIER_FIELD,
ISLANDORA_DC_LANGUAGE_FIELD,
ISLANDORA_DC_PUBLISHER_FIELD,
ISLANDORA_DC_RELATION_FIELD,
ISLANDORA_DC_RIGHTS_FIELD,
ISLANDORA_DC_SOURCE_FIELD,
ISLANDORA_DC_SUBJECT_FIELD,
ISLANDORA_DC_TITLE_FIELD,
ISLANDORA_DC_TYPE_FIELD,
);
foreach ($field_names as $field_name) {
$field = array(
'field_name' => $field_name,
'type' => 'text_long',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
);
field_create_field($field);
}
}

24
islandora_dc/islandora_dc.module

@ -0,0 +1,24 @@
<?php
/**
* @file
* Islandora module for working with DC Metadata.
*/
define('ISLANDORA_DC_NAMESPACE', 'http://purl.org/dc/elements/1.1/');
define('ISLANDORA_DC_NAMESPACE_PREFIX', 'dc11');
define('ISLANDORA_DC_CONTRIBUTOR_FIELD', 'field_dc_contributor');
define('ISLANDORA_DC_COVERAGE_FIELD', 'field_dc_coverage');
define('ISLANDORA_DC_CREATOR_FIELD', 'field_dc_creator');
define('ISLANDORA_DC_DATE_FIELD', 'field_dc_date');
define('ISLANDORA_DC_DESCRIPTION_FIELD', 'field_dc_description');
define('ISLANDORA_DC_FORMAT_FIELD', 'field_dc_format');
define('ISLANDORA_DC_IDENTIFIER_FIELD', 'field_dc_identifier');
define('ISLANDORA_DC_LANGUAGE_FIELD', 'field_dc_language');
define('ISLANDORA_DC_PUBLISHER_FIELD', 'field_dc_publisher');
define('ISLANDORA_DC_RELATION_FIELD', 'field_dc_relation');
define('ISLANDORA_DC_RIGHTS_FIELD', 'field_dc_rights');
define('ISLANDORA_DC_SOURCE_FIELD', 'field_dc_source');
define('ISLANDORA_DC_SUBJECT_FIELD', 'field_dc_subject');
define('ISLANDORA_DC_TITLE_FIELD', 'field_dc_title');
define('ISLANDORA_DC_TYPE_FIELD', 'field_dc_type');

BIN
islandora_dcterms/.islandora_dc.install.swp

Binary file not shown.

BIN
islandora_dcterms/.islandora_dc.module.swp

Binary file not shown.

BIN
islandora_dcterms/.islandora_dcterms.install.swp

Binary file not shown.

BIN
islandora_dcterms/.islandora_dcterms.module.swp

Binary file not shown.

BIN
islandora_dcterms/include/.fields.inc.swp

Binary file not shown.

212
islandora_dcterms/include/fields.inc

@ -1,212 +0,0 @@
<?php
/**
* @file
* Utility functions for working with dcterms fields.
*/
/**
* Attaches all the dcterms fields to a bundle.
*
* @param string $bundle_name
* The name of the bundle to give the fields.
*/
function islandora_dcterms_attach_fields_to_bundle($bundle_name) {
$t = get_t();
if (field_info_field(ISLANDORA_DCTERMS_CONTRIBUTOR_FIELD)) {
$dcterms_contributor_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_CONTRIBUTOR_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Contributor"),
'description' => $t("Dublin Core Contributor Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_contributor_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_CONTRIBUTOR_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_COVERAGE_FIELD)) {
$dcterms_coverage_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_COVERAGE_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Coverage"),
'description' => $t("Dublin Core Coverage Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_coverage_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_COVERAGE_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_CREATOR_FIELD)) {
$dcterms_creator_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_CREATOR_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Creator"),
'description' => $t("Dublin Core Creator Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_creator_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_CREATOR_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_DATE_FIELD)) {
$dcterms_date_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_DATE_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Date"),
'description' => $t("Dublin Core Date Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_date_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_DATE_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_DESCRIPTION_FIELD)) {
$dcterms_description_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_DESCRIPTION_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Description"),
'description' => $t("Dublin Core Description Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_description_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_DESCRIPTION_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_FORMAT_FIELD)) {
$dcterms_format_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_FORMAT_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Format"),
'description' => $t("Dublin Core Format Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_format_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_FORMAT_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_IDENTIFIER_FIELD)) {
$dcterms_identifier_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_IDENTIFIER_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Identfier"),
'description' => $t("Dublin Core Identifier Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_identifier_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_IDENTIFIER_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_LANGUAGE_FIELD)) {
$dcterms_language_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_LANGUAGE_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Language"),
'description' => $t("Dublin Core Language Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_language_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_LANGUAGE_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_PUBLISHER_FIELD)) {
$dcterms_publisher_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_PUBLISHER_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Publisher"),
'description' => $t("Dublin Core Publisher Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_publisher_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_PUBLISHER_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_RELATION_FIELD)) {
$dcterms_relation_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_RELATION_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Relation"),
'description' => $t("Dublin Core Relation Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_relation_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_RELATION_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_RIGHTS_FIELD)) {
$dcterms_rights_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_RIGHTS_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Rights"),
'description' => $t("Dublin Core Rights Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_rights_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_RIGHTS_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_SOURCE_FIELD)) {
$dcterms_source_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_SOURCE_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Source"),
'description' => $t("Dublin Core Source Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_source_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_SOURCE_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_SUBJECT_FIELD)) {
$dcterms_subject_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_SUBJECT_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Subject"),
'description' => $t("Dublin Core Subject Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_subject_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_SUBJECT_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_TITLE_FIELD)) {
$dcterms_title_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_TITLE_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Title"),
'description' => $t("Dublin Core Title Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_title_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_TITLE_FIELD)));
}
if (field_info_field(ISLANDORA_DCTERMS_TYPE_FIELD)) {
$dcterms_type_field_instance = array(
'field_name' => ISLANDORA_DCTERMS_TYPE_FIELD,
'entity_type' => 'node',
'bundle' => $bundle_name,
'label' => $t("DC Terms Type"),
'description' => $t("Dublin Core Type Metadata"),
'required' => FALSE,
);
field_create_instance($dcterms_type_field_instance);
drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DCTERMS_TYPE_FIELD)));
}
}

5
islandora_dcterms/islandora_dcterms.info

@ -1,5 +0,0 @@
name = Islandora DC Terms
description = "Fields and utilities for managing dcterms metadata in Islandora"
package = Islandora
version = 7.x-dev
core = 7.x

40
islandora_dcterms/islandora_dcterms.install

@ -1,40 +0,0 @@
<?php
/**
* @file
* Install hook for dcterms metadata.
*/
/**
* Implements hook_install().
*
* Creates shared fields for all content types using dcterms metadata.
*/
function islandora_dcterms_install() {
$dcterms_field_names = array(
ISLANDORA_DCTERMS_CONTRIBUTOR_FIELD,
ISLANDORA_DCTERMS_COVERAGE_FIELD,
ISLANDORA_DCTERMS_CREATOR_FIELD,
ISLANDORA_DCTERMS_DATE_FIELD,
ISLANDORA_DCTERMS_DESCRIPTION_FIELD,
ISLANDORA_DCTERMS_FORMAT_FIELD,
ISLANDORA_DCTERMS_IDENTIFIER_FIELD,
ISLANDORA_DCTERMS_LANGUAGE_FIELD,
ISLANDORA_DCTERMS_PUBLISHER_FIELD,
ISLANDORA_DCTERMS_RELATION_FIELD,
ISLANDORA_DCTERMS_RIGHTS_FIELD,
ISLANDORA_DCTERMS_SOURCE_FIELD,
ISLANDORA_DCTERMS_SUBJECT_FIELD,
ISLANDORA_DCTERMS_TITLE_FIELD,
ISLANDORA_DCTERMS_TYPE_FIELD,
);
foreach ($dcterms_field_names as $field_name) {
$field = array(
'field_name' => $field_name,
'type' => 'text_long',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
);
field_create_field($field);
}
}

22
islandora_dcterms/islandora_dcterms.module

@ -1,22 +0,0 @@
<?php
/**
* @file
* Collection of fields and utility functions for working with DC Metadata.
*/
define('ISLANDORA_DCTERMS_CONTRIBUTOR_FIELD', 'field_dcterms_contributor');
define('ISLANDORA_DCTERMS_COVERAGE_FIELD', 'field_dcterms_coverage');
define('ISLANDORA_DCTERMS_CREATOR_FIELD', 'field_dcterms_creator');
define('ISLANDORA_DCTERMS_DATE_FIELD', 'field_dcterms_date');
define('ISLANDORA_DCTERMS_DESCRIPTION_FIELD', 'field_dcterms_description');
define('ISLANDORA_DCTERMS_FORMAT_FIELD', 'field_dcterms_format');
define('ISLANDORA_DCTERMS_IDENTIFIER_FIELD', 'field_dcterms_identifier');
define('ISLANDORA_DCTERMS_LANGUAGE_FIELD', 'field_dcterms_language');
define('ISLANDORA_DCTERMS_PUBLISHER_FIELD', 'field_dcterms_publisher');
define('ISLANDORA_DCTERMS_RELATION_FIELD', 'field_dcterms_relation');
define('ISLANDORA_DCTERMS_RIGHTS_FIELD', 'field_dcterms_rights');
define('ISLANDORA_DCTERMS_SOURCE_FIELD', 'field_dcterms_source');
define('ISLANDORA_DCTERMS_SUBJECT_FIELD', 'field_dcterms_subject');
define('ISLANDORA_DCTERMS_TITLE_FIELD', 'field_dcterms_title');
define('ISLANDORA_DCTERMS_TYPE_FIELD', 'field_dcterms_type');
Loading…
Cancel
Save