Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EAD to PDF XSL task files, refs #10591 #978

Merged
merged 1 commit into from Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 24 additions & 36 deletions lib/task/pdf/ead-pdf-full-details.xsl
Expand Up @@ -292,7 +292,7 @@
Finding Aid - <xsl:apply-templates select="ead:titleproper[@type='filing']"/>
</xsl:when>
<xsl:otherwise>
<fo:external-graphic src="images/pdf-logo.png" height="1cm" width="2cm"
<fo:external-graphic src="images/pdf-logo.png" height="4cm" width="3.5cm"
content-width="scale-to-fit" content-height="scale-to-fit"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="(//ead:repository/ead:corpname)[1]"/>
Expand Down Expand Up @@ -331,16 +331,22 @@
<fo:block><xsl:apply-templates/></fo:block>
</xsl:template>

<xsl:template match="ead:profiledesc/ead:descrules"></xsl:template>

<xsl:template match="ead:profiledesc/ead:language">
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="ead:profiledesc/ead:creation">
Generated by <xsl:apply-templates select="/ead:ead/ead:eadheader/ead:filedesc/ead:publicationstmt/ead:publisher" mode="coverPage"/> on <xsl:apply-templates select="ead:date"/>
</xsl:template>

<xsl:template match="ead:profiledesc/ead:creation/ead:date">
<!--
Uses local function to format date into Month, day year.
To print date as seen in xml change to select="."
-->
Printed: <xsl:apply-templates select="local:parseDate(.)"/>
<xsl:apply-templates select="local:parseDate(.)"/>
</xsl:template>

<!-- This template can be modified to include repository specific icons, use the template as a example. -->
Expand Down Expand Up @@ -373,11 +379,6 @@
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:scopecontent[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:arrangement">
<fo:bookmark internal-destination="{local:buildID(ead:arrangement[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:arrangement[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:fileplan">
<fo:bookmark internal-destination="{local:buildID(ead:fileplan[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:fileplan[1])"/></fo:bookmark-title>
Expand Down Expand Up @@ -405,11 +406,6 @@
</fo:bookmark>
</xsl:if>

<xsl:if test="ead:odd">
<fo:bookmark internal-destination="{local:buildID(ead:odd[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:odd[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:bibliography">
<fo:bookmark internal-destination="{local:buildID(ead:bibliography[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:bibliography[1])"/></fo:bookmark-title>
Expand All @@ -429,13 +425,21 @@
</fo:bookmark>
</xsl:if>
<!--Creates descendants bookmarks-->
<!-- if not an item and not a file -->
<xsl:for-each select="//ead:c">
<xsl:if test="child::*/ead:unittitle[1]">
<fo:bookmark internal-destination="{local:buildID(child::*/ead:unittitle[1])}">
<fo:bookmark-title>
<xsl:value-of select="local:tagName(child::*/ead:unittitle[1])"/>
</fo:bookmark-title>
</fo:bookmark>
<xsl:if test="not(@level = 'item') and not(@level = 'file')">
<fo:bookmark internal-destination="{local:buildID(.)}">
<fo:bookmark-title>
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</fo:bookmark-title>
</fo:bookmark>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
Expand Down Expand Up @@ -474,15 +478,6 @@
<fo:page-number-citation ref-id="{local:buildID(ead:scopecontent[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:arrangement">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:arrangement[1])}"><xsl:value-of select="local:tagName(ead:arrangement[1])"/></fo:basic-link>
<xsl:text>&#160;&#160;</xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>&#160;&#160;</xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:arrangement[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:fileplan">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:fileplan[1])}"><xsl:value-of select="local:tagName(ead:fileplan[1])"/></fo:basic-link>
Expand Down Expand Up @@ -527,15 +522,6 @@
</fo:block>
</xsl:if>

<xsl:if test="ead:odd and not(ead:odd[@type='publicationStatus'])">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:odd[1])}"><xsl:value-of select="local:tagName(ead:odd[1])"/></fo:basic-link>
<xsl:text>&#160;&#160;</xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>&#160;&#160;</xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:odd[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:bibliography">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:bibliography[1])}"><xsl:value-of select="local:tagName(ead:bibliography[1])"/></fo:basic-link>
Expand Down Expand Up @@ -568,6 +554,7 @@
</xsl:if>
<!--Creates descendants hierarchy-->
<xsl:for-each select="//ead:c">
<xsl:if test="@level='series' or @level='subseries'">
<xsl:variable name="indention" select="(count(ancestor-or-self::*) - 3) * 8"/>
<fo:block text-align-last="justify" margin-left="{$indention}pt">
<fo:basic-link internal-destination="{local:buildID(.)}">
Expand All @@ -592,6 +579,7 @@
<xsl:text>&#160;&#160;</xsl:text>
<fo:page-number-citation ref-id="{local:buildID(.)}"/>
</fo:block>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</fo:block>
Expand Down
93 changes: 46 additions & 47 deletions lib/task/pdf/ead-pdf-inventory-summary.xsl
Expand Up @@ -287,7 +287,7 @@
Finding Aid - <xsl:apply-templates select="ead:titleproper[@type='filing']"/>
</xsl:when>
<xsl:otherwise>
<fo:external-graphic src="images/pdf-logo.png" height="1cm" width="2cm"
<fo:external-graphic src="images/pdf-logo.png" height="4cm" width="3.5cm"
content-width="scale-to-fit" content-height="scale-to-fit"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="(//ead:repository/ead:corpname)[1]"/>
Expand Down Expand Up @@ -326,16 +326,22 @@
<fo:block><xsl:apply-templates/></fo:block>
</xsl:template>

<xsl:template match="ead:profiledesc/ead:descrules"></xsl:template>

<xsl:template match="ead:profiledesc/ead:language">
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="ead:profiledesc/ead:creation">
Generated by <xsl:apply-templates select="/ead:ead/ead:eadheader/ead:filedesc/ead:publicationstmt/ead:publisher" mode="coverPage"/> on <xsl:apply-templates select="ead:date"/>
</xsl:template>

<xsl:template match="ead:profiledesc/ead:creation/ead:date">
<!--
Uses local function to format date into Month, day year.
To print date as seen in xml change to select="."
-->
Printed: <xsl:apply-templates select="local:parseDate(.)"/>
<xsl:apply-templates select="local:parseDate(.)"/>
</xsl:template>

<!-- This template can be modified to include repository specific icons, use the template as a example. -->
Expand Down Expand Up @@ -368,11 +374,6 @@
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:scopecontent[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:arrangement">
<fo:bookmark internal-destination="{local:buildID(ead:arrangement[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:arrangement[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:fileplan">
<fo:bookmark internal-destination="{local:buildID(ead:fileplan[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:fileplan[1])"/></fo:bookmark-title>
Expand All @@ -399,11 +400,6 @@
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:phystech[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:odd">
<fo:bookmark internal-destination="{local:buildID(ead:odd[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:odd[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:bibliography">
<fo:bookmark internal-destination="{local:buildID(ead:bibliography[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:bibliography[1])"/></fo:bookmark-title>
Expand All @@ -424,22 +420,32 @@
</xsl:if>
<!--Creates a submenu for collections, record groups and series and fonds-->
<xsl:for-each select="child::*[@level = 'collection'] | child::*[@level = 'recordgrp'] | child::*[@level = 'series'] | child::*[@level = 'fonds']">
<xsl:if test="child::*/ead:unittitle[1]">
<fo:bookmark internal-destination="{local:buildID(child::*/ead:unittitle[1])}">
<fo:bookmark internal-destination="{local:buildID(.)}">
<fo:bookmark-title>
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</fo:bookmark-title>
</fo:bookmark>
<!-- Creates a submenu for subfonds, subgrp or subseries -->
<xsl:for-each select="child::*[@level = 'subfonds'] | child::*[@level = 'subgrp'] | child::*[@level = 'subseries']">
<fo:bookmark internal-destination="{local:buildID(.)}">
<fo:bookmark-title>
<xsl:value-of select="local:tagName(child::*/ead:unittitle[1])"/>
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<!-- Creates a submenu for subfonds, subgrp or subseries -->
<xsl:for-each select="child::*[@level = 'subfonds'] | child::*[@level = 'subgrp'] | child::*[@level = 'subseries']">
<xsl:if test="child::*/ead:unittitle[1]">
<fo:bookmark internal-destination="{local:buildID(child::*/ead:unittitle[1])}">
<fo:bookmark-title>
<xsl:value-of select="local:tagName(child::*/ead:unittitle[1])"/>
</fo:bookmark-title>
</fo:bookmark>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
Expand Down Expand Up @@ -478,15 +484,6 @@
<fo:page-number-citation ref-id="{local:buildID(ead:scopecontent[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:arrangement">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:arrangement[1])}"><xsl:value-of select="local:tagName(ead:arrangement[1])"/></fo:basic-link>
<xsl:text>&#160;&#160;</xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>&#160;&#160;</xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:arrangement[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:fileplan">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:fileplan[1])}"><xsl:value-of select="local:tagName(ead:fileplan[1])"/></fo:basic-link>
Expand Down Expand Up @@ -530,15 +527,6 @@
<fo:page-number-citation ref-id="{local:buildID(ead:phystech[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:odd and not(ead:odd[@type='publicationStatus'])">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:odd[1])}"><xsl:value-of select="local:tagName(ead:odd[1])"/></fo:basic-link>
<xsl:text>&#160;&#160;</xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>&#160;&#160;</xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:odd[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:bibliography">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:bibliography[1])}"><xsl:value-of select="local:tagName(ead:bibliography[1])"/></fo:basic-link>
Expand Down Expand Up @@ -578,9 +566,18 @@
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="child::*/ead:unitid"/>,
<xsl:apply-templates select="child::*/ead:unittitle"/>,
<xsl:apply-templates select="child::*/ead:unitdate" mode="did"/>
<xsl:if test="child::*/ead:unitid">
<xsl:value-of select="child::*/ead:unitid"/>,
</xsl:if>
<xsl:choose>
<xsl:when test="child::*/ead:unitdate">
<xsl:apply-templates select="child::*/ead:unittitle"/>,
<xsl:apply-templates select="child::*/ead:unitdate" mode="did"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
Expand All @@ -598,7 +595,9 @@
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="child::*/ead:unitid"/>,
<xsl:if test="child::*/ead:unitid">
<xsl:value-of select="child::*/ead:unitid"/>,
</xsl:if>
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
Expand Down
2 changes: 1 addition & 1 deletion lib/task/pdf/helper-functions.xsl
Expand Up @@ -197,7 +197,7 @@
<xsl:when test="$tag = 'title'">Title</xsl:when>
<xsl:when test="$tag = 'unittitle'">Title</xsl:when>
<xsl:when test="$tag = 'unitdate'">Date</xsl:when>
<xsl:when test="$tag = 'unitid'">ID</xsl:when>
<xsl:when test="$tag = 'unitid'">Reference code</xsl:when>
<xsl:when test="$tag = 'titlepage'">Title page</xsl:when>
<xsl:when test="$tag = 'titleproper'">Title proper of the finding aid</xsl:when>
<xsl:when test="$tag = 'titlestmt'">Title statement</xsl:when>
Expand Down