diff --git a/bcelndora.module b/bcelndora.module
index 1d7c607..4f4e251 100644
--- a/bcelndora.module
+++ b/bcelndora.module
@@ -15,7 +15,16 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
+ 'template' => FALSE,
+ ),
+ 'bceln_pdf_form' => array(
+ 'content_model' => 'islandora:sp_pdf',
+ 'form_name' => 'BC ELN PDF Form',
+ 'dsid' => 'MODS',
+ 'title_field' => array('titleInfo', 'title'),
+ 'transform' => 'mods_to_dc.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_audio_form' => array(
@@ -24,7 +33,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_basic_image_form' => array(
@@ -33,7 +42,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_citation_form' => array(
@@ -42,7 +51,25 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
+ 'template' => FALSE,
+ ),
+ 'bceln_compound_form' => array(
+ 'content_model' => 'islandora:compoundCModel',
+ 'form_name' => 'BC ELN Compound Object Form',
+ 'dsid' => 'MODS',
+ 'title_field' => array('titleInfo', 'title'),
+ 'transform' => 'mods_to_dc.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
+ 'template' => FALSE,
+ ),
+ 'bceln_collection_form' => array(
+ 'content_model' => 'islandora:collectionCModel',
+ 'form_name' => 'BC ELN Collection Form',
+ 'dsid' => 'MODS',
+ 'title_field' => array('titleInfo', 'title'),
+ 'transform' => 'mods_to_dc.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_newspaper_issue_form' => array(
@@ -51,7 +78,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_thesis_form' => array(
@@ -60,7 +87,16 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
+ 'template' => FALSE,
+ ),
+ 'bceln_book_form' => array(
+ 'content_model' => 'islandora:bookCModel',
+ 'form_name' => 'BC ELN Book Form',
+ 'dsid' => 'MODS',
+ 'title_field' => array('titleInfo', 'title'),
+ 'transform' => 'mods_to_dc.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_video_form' => array(
@@ -69,7 +105,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfo', 'title'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_serials_form_root_serial' => array(
@@ -78,7 +114,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfoTab', 'titleInfoPanel', 'titleInfo'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_serials_form_stub' => array(
@@ -87,7 +123,7 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfoTab', 'titleInfoPanel', 'titleInfo'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
'bceln_serials_form_intermediate' => array(
@@ -96,12 +132,43 @@ function bcelndora_islandora_xml_form_builder_form_associations() {
'dsid' => 'MODS',
'title_field' => array('titleInfoTab', 'titleInfoPanel', 'titleInfo'),
'transform' => 'mods_to_dc.xsl',
- 'self_transform' => 'islandora_cleanup_mods_extended.xsl',
+ 'self_transform' => 'islandora_cleanup_mods_strip_nameless.xsl',
'template' => FALSE,
),
);
}
+/**
+ * Implements hook_form_islandora_solr_simple_search_form_alter().
+ */
+function bcelndora_form_islandora_solr_simple_search_form_alter(&$form, &$form_state, $form_id) {
+ $form['simple']['islandora_simple_search_query']['#title_display'] = 'invisible';
+}
+
+/**
+ * Implementa hook_islandora_datastream_filename_alter().
+ */
+function bcelndora_islandora_datastream_filename_alter(&$filename, AbstractDatastream $datastream) {
+ // XXX: The MIME-type/mapping facilities do not really allow for multiple
+ // MIME-types to be mapped to a single extension... so remap here, to account.
+ // Essentially copypasta of https://github.com/Islandora/islandora/blob/5e88176861ce4c29e77b31f0c6e0ee4ce5cc3750/includes/datastream.inc#L54-L65
+ if ($datastream->mimetype === 'application/x-zip') {
+ module_load_include('inc', 'islandora', 'includes/mime_detect');
+ // Browsers will not append all extensions.
+ $extension = '.' . (new MimeDetect())->getExtension($datastream->mimetype);
+ // Prevent adding on a duplicate extension.
+ $label = $datastream->label;
+ $extension_length = strlen($extension);
+ $duplicate_extension_position = strlen($label) > $extension_length ?
+ strripos($label, $extension, -$extension_length) :
+ FALSE;
+ $filename = $label;
+ if ($duplicate_extension_position === FALSE) {
+ $filename .= $extension;
+ }
+ }
+}
+
/**
* Implements hook_islandora_xml_form_builder_forms().
*/
@@ -114,12 +181,24 @@ function bcelndora_islandora_xml_form_builder_forms() {
'BC ELN Audio Form' => array(
'form_file' => "$module_path/xml/bceln_audio_form.xml",
),
+ 'BC ELN Book Form' => array(
+ 'form_file' => "$module_path/xml/bceln_book_form.xml",
+ ),
'BC ELN Basic Image Form' => array(
'form_file' => "$module_path/xml/bceln_basc_image_form.xml",
),
'BC ELN Citation Form' => array(
'form_file' => "$module_path/xml/bceln_citation_form.xml",
),
+ 'BC ELN Compound Object Form' => array(
+ 'form_file' => "$module_path/xml/bceln_compound_form.xml",
+ ),
+ 'BC ELN Collection Form' => array(
+ 'form_file' => "$module_path/xml/bceln_collection_form.xml",
+ ),
+ 'BC ELN PDF Form' => array(
+ 'form_file' => "$module_path/xml/bceln_pdf_form.xml",
+ ),
'BC ELN Newspaper Issue Form' => array(
'form_file' => "$module_path/xml/bceln_newspaper_issue_form.xml",
),
@@ -135,26 +214,6 @@ function bcelndora_islandora_xml_form_builder_forms() {
);
}
-/**
- * Implements hook_form_FORM_ID_alter().
- *
- * Adds autocomplete for the custom bceln citation and thesis forms.
- */
-function bcelndora_form_xml_form_builder_datastream_form_alter(&$form, &$form_state, $form_id) {
- if (module_exists('islandora_scholar') && module_exists('islandora_entities')) {
- module_load_include('inc', 'islandora_entities', 'includes/utilities');
- if (isset($form_state['association']['id'])) {
- $id = $form_state['association']['id'];
- if (strcmp($id, 'bceln_citation_form') == 0) {
- islandora_entities_add_autocompletes_to_citation_form($form);
- }
- elseif (strcmp($id, 'bceln_thesis_form') == 0) {
- islandora_entities_add_autocompletes_to_thesis_form($form);
- }
- }
- }
-}
-
/**
* Implements hook_form_FORM_ID_alter().
*
@@ -174,34 +233,3 @@ function bcelndora_form_xml_form_builder_ingest_form_alter(&$form, &$form_state,
}
}
}
-
-/**
- * Implements hook_form_islandora_solr_simple_search_form_alter().
- */
-function bcelndora_form_islandora_solr_simple_search_form_alter(&$form, &$form_state, $form_id) {
- $form['simple']['islandora_simple_search_query']['#title_display'] = 'invisible';
-}
-
-/**
- * Implementa hook_islandora_datastream_filename_alter().
- */
-function bcelndora_islandora_datastream_filename_alter(&$filename, AbstractDatastream $datastream) {
- // XXX: The MIME-type/mapping facilities do not really allow for multiple
- // MIME-types to be mapped to a single extension... so remap here, to account.
- // Essentially copypasta of https://github.com/Islandora/islandora/blob/5e88176861ce4c29e77b31f0c6e0ee4ce5cc3750/includes/datastream.inc#L54-L65
- if ($datastream->mimetype === 'application/x-zip') {
- module_load_include('inc', 'islandora', 'includes/mime_detect');
- // Browsers will not append all extensions.
- $extension = '.' . (new MimeDetect())->getExtension($datastream->mimetype);
- // Prevent adding on a duplicate extension.
- $label = $datastream->label;
- $extension_length = strlen($extension);
- $duplicate_extension_position = strlen($label) > $extension_length ?
- strripos($label, $extension, -$extension_length) :
- FALSE;
- $filename = $label;
- if ($duplicate_extension_position === FALSE) {
- $filename .= $extension;
- }
- }
-}
diff --git a/xml/bceln_artwork_form.xml b/xml/bceln_artwork_form.xml
index 41f1f25..313dfec 100644
--- a/xml/bceln_artwork_form.xml
+++ b/xml/bceln_artwork_form.xml
@@ -1,2115 +1,2576 @@
-
-
-
- mods
- http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
-
- http://www.loc.gov/mods/v3
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1999/xlink
-
-
-
-
+
+
+
+ mods
+ http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_audio_form.xml b/xml/bceln_audio_form.xml
index 21a8de9..c73a314 100644
--- a/xml/bceln_audio_form.xml
+++ b/xml/bceln_audio_form.xml
@@ -1,1413 +1,1623 @@
-
-
-
- mods
- http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
-
- http://www.loc.gov/mods/v3
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1999/xlink
-
-
-
-
+
+
+
+ mods
+ http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_basc_image_form.xml b/xml/bceln_basc_image_form.xml
index 99775ba..9156834 100644
--- a/xml/bceln_basc_image_form.xml
+++ b/xml/bceln_basc_image_form.xml
@@ -1,1297 +1,1934 @@
-
-
-
- mods
-
-
- http://www.loc.gov/mods/v3
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1999/xlink
-
-
-
-
+
+
+
+ mods
+
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_book_form.xml b/xml/bceln_book_form.xml
new file mode 100644
index 0000000..545b64b
--- /dev/null
+++ b/xml/bceln_book_form.xml
@@ -0,0 +1,1884 @@
+
+
+
+ mods
+ http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_citation_form.xml b/xml/bceln_citation_form.xml
index 05f1b03..1ed5a06 100644
--- a/xml/bceln_citation_form.xml
+++ b/xml/bceln_citation_form.xml
@@ -1,2638 +1,2612 @@
-
-
-
- mods
-
-
- http://www.loc.gov/mods/v3
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1999/xlink
-
-
-
-
+
+
+
+ mods
+
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_collection_form.xml b/xml/bceln_collection_form.xml
new file mode 100644
index 0000000..c1fa7b3
--- /dev/null
+++ b/xml/bceln_collection_form.xml
@@ -0,0 +1,1574 @@
+
+
+
+ mods
+
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_compound_form.xml b/xml/bceln_compound_form.xml
new file mode 100644
index 0000000..37c9b1a
--- /dev/null
+++ b/xml/bceln_compound_form.xml
@@ -0,0 +1,1572 @@
+
+
+
+ mods
+
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_newspaper_issue_form.xml b/xml/bceln_newspaper_issue_form.xml
index 9442a7f..bb8aa25 100644
--- a/xml/bceln_newspaper_issue_form.xml
+++ b/xml/bceln_newspaper_issue_form.xml
@@ -1,831 +1,1783 @@
-
-
-
- mods
- http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
-
- http://www.loc.gov/mods/v3
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1999/xlink
-
-
-
-
+
+
+
+ mods
+ http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_pdf_form.xml b/xml/bceln_pdf_form.xml
new file mode 100644
index 0000000..5d9e8f7
--- /dev/null
+++ b/xml/bceln_pdf_form.xml
@@ -0,0 +1,1104 @@
+
+
+
+ mods
+ http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_serials_form.xml b/xml/bceln_serials_form.xml
index b8e1668..f85d1b9 100644
--- a/xml/bceln_serials_form.xml
+++ b/xml/bceln_serials_form.xml
@@ -1,10075 +1,10178 @@
-
-
-
- mods
-
-
- info:flvc/manifest/v1
- http://www.loc.gov/mods/v3
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1999/xlink
-
-
-
-
+
+
+
+ mods
+
+
+ info:flvc/manifest/v1
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_thesis_form.xml b/xml/bceln_thesis_form.xml
index 69c35af..658de9d 100644
--- a/xml/bceln_thesis_form.xml
+++ b/xml/bceln_thesis_form.xml
@@ -1,1915 +1,2440 @@
-
-
-
- mods
- http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
-
- http://www.ndltd.org/standards/metadata/etdms/1.0
- http://www.loc.gov/mods/v3
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1999/xlink
-
-
-
-
+
+
+
+ mods
+ http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
+
+ http://www.ndltd.org/standards/metadata/etdms/1.0
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+
diff --git a/xml/bceln_video_form.xml b/xml/bceln_video_form.xml
index 9dff89e..bbf055c 100644
--- a/xml/bceln_video_form.xml
+++ b/xml/bceln_video_form.xml
@@ -1,1524 +1,1726 @@
-
-
-
- mods
- http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
-
- http://www.loc.gov/mods/v3
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1999/xlink
-
-
-
-
+
+
+
+ mods
+ http://www.loc.gov/standards/mods/v3/mods-3-4.xsd
+
+ http://www.loc.gov/mods/v3
+ http://www.w3.org/2001/XMLSchema-instance
+ http://www.w3.org/1999/xlink
+
+
+
+