From e3e085e8a6fc0bf9047576832768979a79eff1fe Mon Sep 17 00:00:00 2001 From: Clinton Graham Date: Mon, 8 Nov 2021 10:40:13 -0500 Subject: [PATCH] Enhancements #66, #67, #70: render EAD to HTML more semantically. --- README.md | 1 + includes/blocks.inc | 10 + includes/ead_html.inc | 21 ++ includes/jstreebuilder.inc | 4 +- includes/link.inc | 10 + transforms/ead_to_html.xslt | 416 ++++++++++++++++++++++++++++++++++-- 6 files changed, 441 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1917c91..961edd2 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Having problems or solved a problem? Check out the Islandora google groups for a ### Q. What elements are necessary in finding aid EAD metadata? A. Components (`c`, `c01`, `c02`, `c03`, _etc_) *MUST* have `id` attributes unique to the given XML document in order to reliably produce links and relationships. Components *MUST* have a `level` as one of: +* `subgrp` * `series` * `subseries` * `file` diff --git a/includes/blocks.inc b/includes/blocks.inc index 70cdbf7..512f557 100644 --- a/includes/blocks.inc +++ b/includes/blocks.inc @@ -66,6 +66,16 @@ function islandora_manuscript_container_list($object) { 'default' => array( 'select_node' => FALSE, ), + 'recordgrp' => array( + 'valid_children' => array( + 'subgrp', + ), + ), + 'subgrp' => array( + 'valid_children' => array( + 'series', + ), + ), 'series' => array( 'valid_children' => array( 'subseries', diff --git a/includes/ead_html.inc b/includes/ead_html.inc index a5d97ba..a894180 100644 --- a/includes/ead_html.inc +++ b/includes/ead_html.inc @@ -23,8 +23,29 @@ define('ISLANDORA_MANUSCRIPT_CONTAINER_TAG_URI', 'http://islandora.ca/manuscript */ function islandora_manuscript_preprocess_ead_display_variables(&$variables) { $variables['xslt_parameters'][''] = (isset($variables['xslt_parameters']['']) ? $variables['xslt_parameters'][''] : array()) + array( + "containerlist_string" => t('Container List'), "container_string" => t('Containers'), + "unitid_string" => t('Unit Id'), + "physdesc_string" => t('Extent'), + "physloc_string" => t('Physical Location'), + "langmaterial_string" => t('Language'), + "controlaccess_string" => t('Subjects'), + "corpname_string" => t('Corporate Names'), + "persname_string" => t('Personal Names'), + "famname_string" => t('Family Names'), + "geogname_string" => t('Geographic Names'), + "occupation_string" => t('Occupations'), + "subject_string" => t('Other Subjects'), + "genreform_string" => t('Genres'), + "recordgrp_string" => t('Record Group'), + "subgrp_string" => t('Subgroup'), + "series_string" => t('Series'), + "subseries_string" => t('Subseries'), + "subfonds" => t('Subfonds'), + "file_string" => t('File'), + "item_string" => t('Item'), ); + $variables['doc'] = $doc = new DOMDocument(); $doc->loadXML($variables['object']['EAD']->content); diff --git a/includes/jstreebuilder.inc b/includes/jstreebuilder.inc index fa60e80..42685dc 100644 --- a/includes/jstreebuilder.inc +++ b/includes/jstreebuilder.inc @@ -214,12 +214,12 @@ class ContainerListJSTreeBuilder extends JSTreeBuilder { /** * Inherits. * - * Only return results for series and subseries, and make a couple + * Only return results for recordgrp, subgrp, series and subseries, and make a couple * adjustments to the data. */ protected function getComponentTree(DOMElement $element) { $type = $element->getAttribute('level'); - if (in_array($type, array('series', 'subseries'))) { + if (in_array($type, array('recordgrp', 'subgrp', 'series', 'subseries'))) { $to_return = parent::getComponentTree($element); $to_return['a_attr']['href'] = url("islandora/object/{$this->object->id}", array('fragment' => $to_return['id'])); $to_return['id'] = "container_list_{$to_return['id']}"; diff --git a/includes/link.inc b/includes/link.inc index 46d5ea8..6c9034c 100644 --- a/includes/link.inc +++ b/includes/link.inc @@ -210,6 +210,16 @@ function islandora_manuscript_link_to_finding_aid_form($form, &$form_state, Abst 'default' => array( 'select_node' => FALSE, ), + 'recordgrp' => array( + 'valid_children' => array( + 'subgrp', + ), + ), + 'subgrp' => array( + 'valid_children' => array( + 'series', + ), + ), 'series' => array( 'valid_children' => array( 'subseries', diff --git a/transforms/ead_to_html.xslt b/transforms/ead_to_html.xslt index b1462f8..05d0d0a 100644 --- a/transforms/ead_to_html.xslt +++ b/transforms/ead_to_html.xslt @@ -6,8 +6,29 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:php="http://php.net/xsl" xsl:extension-element-prefixes="php" + exclude-result-prefixes="xsl ead xlink php" > + Container List Containers + Unit ID + Extent + Physical Location + Language + Subjects + Corporate Names + Personal Names + Family Names + Geographic Names + Occupations + Other Subjects + Genres + Record Group + Subgroup + Series + Subseries + Subfonds + File + Item
@@ -16,12 +37,34 @@ - -

- -

-
- + + + + + + h2 + + + h3 + + + + + +
+ + + + + + + + h3 + + + + + @@ -44,8 +87,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + +
ead-component collapsible collapsed @@ -55,9 +134,23 @@ - - - + + + + + + + + + + + + + + + + , +
@@ -68,6 +161,44 @@
+
+ +
    + + + + +
  • +
    + + + + + + + + + + + + + + + + , + +
    + +
  • +
    + +
  • + +
  • +
    +
+
+
@@ -76,19 +207,71 @@ -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -

+ + +

+ + ead- + + + + + + + + + + + + + + + + +
+
+ + ead- + -

+
@@ -106,7 +289,7 @@ -
+
@@ -114,7 +297,7 @@ -
+
@@ -123,10 +306,16 @@
+ + + + container-target container-type- + + @@ -138,7 +327,7 @@ -
+
@@ -153,17 +342,198 @@ - + , + + + container-target container-type- + + + + + + + h2 + + + +

+
+
+ +
+ + + + +
+ + + + h1 + + + +

+
+
+
    + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+ + + +
+

+
    + +
  • +
    +
+
+
+ + +
+

+
    + +
  • +
    +
+
+
+ + +
+

+
    + +
  • +
    +
+
+
+ + +
+

+
    + +
  • +
    +
+
+
+ + +
+

+
    + +
  • +
    +
+
+
+ + +
+

+
    + +
  • +
    +
+
+
+ + +
+

+
    + +
  • +
    +
+
+
+ + + +
+ + + +
    + +
  • + +
  • +
    +
+
+
+
+ + + + + + ol + + + ul + + + +
+ +

+
+ + +
  • +
    +
    +
    +
    +

    @@ -179,4 +549,12 @@ + + + + + + + +