diff --git a/islandora/islandora.info b/islandora/islandora.info index 25abf43a..b01bb45d 100644 --- a/islandora/islandora.info +++ b/islandora/islandora.info @@ -6,3 +6,4 @@ core = 7.x dependencies[] = rest_server dependencies[] = xml_field dependencies[] = xpath_field +dependencies[] = islandora_dcterms diff --git a/islandora/islandora.install b/islandora/islandora.install index f78b2c78..af5a5798 100644 --- a/islandora/islandora.install +++ b/islandora/islandora.install @@ -23,110 +23,6 @@ function islandora_install() { ); field_create_field($mods_field); - $dc_contributor_field = array( - 'field_name' => ISLANDORA_DC_CONTRIBUTOR_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_contributor_field); - - $dc_coverage_field = array( - 'field_name' => ISLANDORA_DC_COVERAGE_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_coverage_field); - - $dc_creator_field = array( - 'field_name' => ISLANDORA_DC_CREATOR_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_creator_field); - - $dc_date_field = array( - 'field_name' => ISLANDORA_DC_DATE_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_date_field); - - $dc_description_field = array( - 'field_name' => ISLANDORA_DC_DESCRIPTION_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_description_field); - - $dc_format_field = array( - 'field_name' => ISLANDORA_DC_FORMAT_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_format_field); - - $dc_identifier_field = array( - 'field_name' => ISLANDORA_DC_IDENTIFIER_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_identifier_field); - - $dc_language_field = array( - 'field_name' => ISLANDORA_DC_LANGUAGE_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_language_field); - - $dc_publisher_field = array( - 'field_name' => ISLANDORA_DC_PUBLISHER_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_publisher_field); - - $dc_relation_field = array( - 'field_name' => ISLANDORA_DC_RELATION_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_relation_field); - - $dc_rights_field = array( - 'field_name' => ISLANDORA_DC_RIGHTS_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_rights_field); - - $dc_source_field = array( - 'field_name' => ISLANDORA_DC_SOURCE_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_source_field); - - $dc_subject_field = array( - 'field_name' => ISLANDORA_DC_SUBJECT_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_subject_field); - - $dc_title_field = array( - 'field_name' => ISLANDORA_DC_TITLE_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_title_field); - - $dc_type_field = array( - 'field_name' => ISLANDORA_DC_TYPE_FIELD, - 'type' => 'text_long', - 'cardinality' => FIELD_CARDINALITY_UNLIMITED, - ); - field_create_field($dc_type_field); } /** diff --git a/islandora/islandora.module b/islandora/islandora.module index 3d314cd8..849f48f0 100644 --- a/islandora/islandora.module +++ b/islandora/islandora.module @@ -8,22 +8,6 @@ define('ISLANDORA_TN_FIELD', 'field_tn'); define('ISLANDORA_MODS_FIELD', 'field_mods'); -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'); - /** * Implements hook_ctools_plugin_api(). */ diff --git a/islandora_basic_image/islandora_basic_image.install b/islandora_basic_image/islandora_basic_image.install index b6ced94c..de5b4489 100644 --- a/islandora_basic_image/islandora_basic_image.install +++ b/islandora_basic_image/islandora_basic_image.install @@ -9,6 +9,8 @@ * Implements hook_install(). */ function islandora_basic_image_install() { + module_load_include('inc', 'islandora_dcterms', 'include/fields'); + $t = get_t(); // Create basic_image bundle. @@ -83,200 +85,7 @@ function islandora_basic_image_install() { drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_MODS_FIELD))); } - if (field_info_field(ISLANDORA_DC_CONTRIBUTOR_FIELD)) { - $dc_contributor_field_instance = array( - 'field_name' => ISLANDORA_DC_CONTRIBUTOR_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Contributor"), - 'description' => $t("Dublin Core Contributor Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_contributor_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_CONTRIBUTOR_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_COVERAGE_FIELD)) { - $dc_coverage_field_instance = array( - 'field_name' => ISLANDORA_DC_COVERAGE_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Coverage"), - 'description' => $t("Dublin Core Coverage Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_coverage_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_COVERAGE_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_CREATOR_FIELD)) { - $dc_creator_field_instance = array( - 'field_name' => ISLANDORA_DC_CREATOR_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Creator"), - 'description' => $t("Dublin Core Creator Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_creator_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_CREATOR_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_DATE_FIELD)) { - $dc_date_field_instance = array( - 'field_name' => ISLANDORA_DC_DATE_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Date"), - 'description' => $t("Dublin Core Date Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_date_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_DATE_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_DESCRIPTION_FIELD)) { - $dc_description_field_instance = array( - 'field_name' => ISLANDORA_DC_DESCRIPTION_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Description"), - 'description' => $t("Dublin Core Description Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_description_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_DESCRIPTION_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_FORMAT_FIELD)) { - $dc_format_field_instance = array( - 'field_name' => ISLANDORA_DC_FORMAT_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Format"), - 'description' => $t("Dublin Core Format Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_format_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_FORMAT_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_IDENTIFIER_FIELD)) { - $dc_identifier_field_instance = array( - 'field_name' => ISLANDORA_DC_IDENTIFIER_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Identfier"), - 'description' => $t("Dublin Core Identifier Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_identifier_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_IDENTIFIER_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_LANGUAGE_FIELD)) { - $dc_language_field_instance = array( - 'field_name' => ISLANDORA_DC_LANGUAGE_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Language"), - 'description' => $t("Dublin Core Language Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_language_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_LANGUAGE_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_PUBLISHER_FIELD)) { - $dc_publisher_field_instance = array( - 'field_name' => ISLANDORA_DC_PUBLISHER_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Publisher"), - 'description' => $t("Dublin Core Publisher Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_publisher_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_PUBLISHER_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_RELATION_FIELD)) { - $dc_relation_field_instance = array( - 'field_name' => ISLANDORA_DC_RELATION_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Relation"), - 'description' => $t("Dublin Core Relation Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_relation_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_RELATION_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_RIGHTS_FIELD)) { - $dc_rights_field_instance = array( - 'field_name' => ISLANDORA_DC_RIGHTS_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Rights"), - 'description' => $t("Dublin Core Rights Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_rights_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_RIGHTS_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_SOURCE_FIELD)) { - $dc_source_field_instance = array( - 'field_name' => ISLANDORA_DC_SOURCE_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Source"), - 'description' => $t("Dublin Core Source Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_source_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_SOURCE_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_SUBJECT_FIELD)) { - $dc_subject_field_instance = array( - 'field_name' => ISLANDORA_DC_SUBJECT_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Subject"), - 'description' => $t("Dublin Core Subject Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_subject_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_SUBJECT_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_TITLE_FIELD)) { - $dc_title_field_instance = array( - 'field_name' => ISLANDORA_DC_TITLE_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Title"), - 'description' => $t("Dublin Core Title Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_title_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_TITLE_FIELD))); - } - - if (field_info_field(ISLANDORA_DC_TYPE_FIELD)) { - $dc_type_field_instance = array( - 'field_name' => ISLANDORA_DC_TYPE_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_BUNDLE, - 'label' => $t("DC Type"), - 'description' => $t("Dublin Core Type Metadata"), - 'required' => FALSE, - ); - field_create_instance($dc_type_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_DC_TYPE_FIELD))); - } + islandora_dcterms_attach_fields_to_bundle(ISLANDORA_BASIC_IMAGE_BUNDLE); } /** diff --git a/islandora_dcterms/.islandora_dc.install.swp b/islandora_dcterms/.islandora_dc.install.swp new file mode 100644 index 00000000..dda83b8b Binary files /dev/null and b/islandora_dcterms/.islandora_dc.install.swp differ diff --git a/islandora_dcterms/.islandora_dc.module.swp b/islandora_dcterms/.islandora_dc.module.swp new file mode 100644 index 00000000..926efeb0 Binary files /dev/null and b/islandora_dcterms/.islandora_dc.module.swp differ diff --git a/islandora_dcterms/.islandora_dcterms.install.swp b/islandora_dcterms/.islandora_dcterms.install.swp new file mode 100644 index 00000000..88e9882a Binary files /dev/null and b/islandora_dcterms/.islandora_dcterms.install.swp differ diff --git a/islandora_dcterms/.islandora_dcterms.module.swp b/islandora_dcterms/.islandora_dcterms.module.swp new file mode 100644 index 00000000..b3ae59c6 Binary files /dev/null and b/islandora_dcterms/.islandora_dcterms.module.swp differ diff --git a/islandora_dcterms/include/.fields.inc.swp b/islandora_dcterms/include/.fields.inc.swp new file mode 100644 index 00000000..26c79095 Binary files /dev/null and b/islandora_dcterms/include/.fields.inc.swp differ diff --git a/islandora_dcterms/include/fields.inc b/islandora_dcterms/include/fields.inc new file mode 100644 index 00000000..78212a43 --- /dev/null +++ b/islandora_dcterms/include/fields.inc @@ -0,0 +1,211 @@ + 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))); + } +} diff --git a/islandora_dcterms/islandora_dcterms.info b/islandora_dcterms/islandora_dcterms.info new file mode 100644 index 00000000..5b9f4e25 --- /dev/null +++ b/islandora_dcterms/islandora_dcterms.info @@ -0,0 +1,5 @@ +name = Islandora DC Terms +description = "Fields and utilities for managing dcterms metadata in Islandora" +package = Islandora +version = 7.x-dev +core = 7.x diff --git a/islandora_dcterms/islandora_dcterms.install b/islandora_dcterms/islandora_dcterms.install new file mode 100644 index 00000000..2275341b --- /dev/null +++ b/islandora_dcterms/islandora_dcterms.install @@ -0,0 +1,40 @@ + $field_name, + 'type' => 'text_long', + 'cardinality' => FIELD_CARDINALITY_UNLIMITED, + ); + field_create_field($field); + } +} diff --git a/islandora_dcterms/islandora_dcterms.module b/islandora_dcterms/islandora_dcterms.module new file mode 100644 index 00000000..bebe4394 --- /dev/null +++ b/islandora_dcterms/islandora_dcterms.module @@ -0,0 +1,22 @@ +