-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcover-page.xsl
148 lines (138 loc) · 7.66 KB
/
cover-page.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"
xmlns:ead3="http://ead3.archivists.org/schema/" exclude-result-prefixes="xs ead3 fox"
version="2.0">
<!-- this file is imported by "ead3-to-pdf-ua.xsl" -->
<!--========== Cover Page ========-->
<xsl:template match="ead3:control">
<fo:page-sequence master-reference="cover" xsl:use-attribute-sets="center-text">
<fo:static-content flow-name="xsl-region-before">
<fo:block id="cover-page">
<xsl:choose>
<xsl:when test="$repository-code = ('ypm', 'ycba')">
<xsl:text>Yale University</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Yale University Library</xsl:text>
</xsl:otherwise>
</xsl:choose>
</fo:block>
<fo:block xsl:use-attribute-sets="margin-after-large">
<xsl:apply-templates select="$holding-repository"/>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<!-- use something with rightsdeclaration once we're on EAD3 1.1.0
in the meantime, i should also add the creative commons license to our PDFs, right? -->
<fo:block>
<xsl:apply-templates select="ead3:maintenancehistory[1]/ead3:maintenanceevent[1]/ead3:eventdatetime[1]" mode="titlepage.pdf.creation.date"/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:if test="$unpublished-draft eq true()">
<fo:block xsl:use-attribute-sets="unpublished">
<xsl:value-of select="$resource-unpublished-note"/>
</fo:block>
</xsl:if>
<fo:block xsl:use-attribute-sets="h1">
<xsl:apply-templates select="$finding-aid-title"/>
</fo:block>
<xsl:if test="$unpublished-subelements">
<fo:block xsl:use-attribute-sets="unpublished">
<xsl:value-of select="$sub-resource-unpublished-note"/>
</fo:block>
</xsl:if>
<fo:block xsl:use-attribute-sets="h2 margin-after-large">
<xsl:apply-templates select="$collection-identifier"/>
</fo:block>
<xsl:call-template name="coverpage.image"/>
<fo:block xsl:use-attribute-sets="margin-after-small">
<xsl:apply-templates select="$finding-aid-author"/>
</fo:block>
<fo:block xsl:use-attribute-sets="margin-after-small">
<xsl:apply-templates select="ead3:filedesc/ead3:publicationstmt[1]/ead3:date[1]"/>
</fo:block>
<fo:block>
<xsl:apply-templates select="ead3:filedesc/ead3:publicationstmt[1]/ead3:address[1]"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:template>
<!--========== End: Cover Page ======== -->
<xsl:template name="coverpage.image">
<fo:block xsl:use-attribute-sets="margin-after-small">
<xsl:choose>
<xsl:when test="$repository-code='divinity'">
<xsl:variable name="image" select="concat($logo-location, 'config/logos/divshield.jpg')"/>
<fo:external-graphic src="url({$image})"
content-width="scale-to-fit"
scaling="uniform"
fox:alt-text="Divinity school shield logo"/>
</xsl:when>
<xsl:when test="$repository-code='med'">
<xsl:variable name="image" select="concat($logo-location, 'config/logos/medshield.jpg')"/>
<fo:external-graphic src="url({$image})"
content-width="scale-to-fit"
scaling="uniform"
fox:alt-text="Medical school shield logo"/>
</xsl:when>
<xsl:when test="$repository-code='beinecke'">
<xsl:variable name="image" select="concat($logo-location, 'config/logos/brbl_bldg.jpg')"/>
<fo:external-graphic src="url({$image})"
content-width="scale-to-fit"
scaling="uniform"
fox:alt-text="A drawing of an exterior view of the Beinecke Library"/>
</xsl:when>
<xsl:when test="$repository-code='ypm'">
<xsl:variable name="image" select="concat($logo-location, 'config/logos/peabody.jpg')"/>
<fo:external-graphic src="url({$image})"
content-width="scale-to-fit"
scaling="uniform"
fox:alt-text="A view from outside the Peabody Museum, with a statue of a triceratops horridus in the foreground"/>
</xsl:when>
<xsl:when test="$repository-code='lwl'">
<xsl:variable name="image" select="concat($logo-location, 'config/logos/walpole-summer.jpg')"/>
<fo:external-graphic src="url({$image})"
content-width="scale-to-fit"
scaling="uniform"
fox:alt-text="A view of the Lewis Walpole Library, during summertime"/>
</xsl:when>
<xsl:when test="$repository-code='ycba'">
<xsl:variable name="image" select="concat($logo-location, 'config/logos/YCBA_logo.jpg')"/>
<fo:external-graphic src="url({$image})"
content-width="scale-to-fit"
width="75%"
scaling="uniform"
fox:alt-text="Yale Center for British Art, Library Court. Photograph by Richard Caspole, YCBA, 2016."/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="image" select="concat($logo-location, 'config/logos/Yale_University_Shield_1.svg')"/>
<fo:external-graphic src="url({$image})"
width="70%"
content-height="70%"
content-width="scale-to-fit"
scaling="uniform"
fox:alt-text="Yale University logo, with the Lux et Veritas motto"/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template>
<xsl:template match="ead3:addressline">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="ead3:eventdatetime" mode="titlepage.pdf.creation.date">
<!-- if kept like this, we'll need paramertize the time zone
if no parameter is passed, it should still be able to get the time zone, but not sure about the timezone
if the server becomes hosted, etc., so i'm passing the value for now.
-->
<xsl:variable name="adjustedDateTime" select="adjust-dateTime-to-timezone(xs:dateTime(.), xs:dayTimeDuration('-PT5H0M'))"/>
<fo:block font-size="9pt">
<xsl:text>Last exported at </xsl:text>
<xsl:value-of select="format-dateTime($adjustedDateTime, '[h]:[m01] [Pn] on [FNn], [MNn] [D1o], [Y0001]')"/>
</fo:block>
</xsl:template>
</xsl:stylesheet>