Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
    <xsl:output indent="yes" method="html"/>
4
    <xsl:param name="docid"/>
5
    <xsl:param name="sessionid" select="public"/>
6
    <xsl:param name="qformat"/>
7
    <xsl:param name="publicRead"/>
8
    <xsl:param name="message"/>
9
    
10
    <xsl:template match="/metadata">
11
        <html>
12
            <head>
13
                <link rel="stylesheet" type="text/css" href="./style/skins/{$qformat}/{$qformat}.css" media="all"/>
14
                <script language="JavaScript" type="text/JavaScript" src="./style/skins/{$qformat}/{$qformat}.js"/>
15
                <script language="JavaScript" type="text/JavaScript" src="./style/common/branding.js"/>
16
                <title>FGDC Identification and Metacat Data Package Information</title>
17
            </head>
18
            <body>
19
                <script language="JavaScript">
20
                    insertTemplateOpening();
21
                </script>
22
                <div class="centerContentBorder">
23
                    <div class="templatecontentareaclass">
24
                        <xsl:apply-templates select="idinfo"/>
25
                        <xsl:apply-templates
26
                            select="distinfo/resdesc[text()=$docid]/ancestor::distinfo"/>
27
                    </div>
28
                </div>
29
                <script language="JavaScript">
30
                    insertTemplateClosing();
31
                </script>
32
            </body>
33
        </html>
34
    </xsl:template>
35
    
36
    <xsl:template match="idinfo">
37
        <table border="0" cellspacing="10">
38
            <tr>
39
                <td colspan="2" align="center">
40
                    <span class="greenbold"><xsl:value-of select="$message"/></span>
41
                </td>
42
            </tr>
43
            <tr>
44
                <td colspan="2" align="center">
45
                    <span class="greenbold">FGDC Identification Information</span>
46
                </td>
47
            </tr>
48
            <xsl:apply-templates select="citation"/>
49
            <xsl:apply-templates select="descript"/>
50
            <xsl:apply-templates select="spdom"/>
51
            <xsl:apply-templates select="keywords"/>
52
        </table>
53
    </xsl:template>
54
    
55
    <xsl:template match="citation">
56
        <xsl:apply-templates select="citeinfo"/>
57
    </xsl:template>
58
    
59
    <xsl:template match="citeinfo">
60
        <tr>
61
            <td colspan="2">
62
                <span class="greenbold">Citation Information </span>
63
            </td>
64
        </tr>
65
        
66
        <tr>
67
            <xsl:apply-templates select="title"/>
68
        </tr>
69
        <tr>
70
            <xsl:apply-templates select="origin"/>
71
        </tr>
72
        <tr>
73
            <xsl:apply-templates select="pubdate"/>
74
        </tr>
75
        <tr>
76
            <xsl:apply-templates select="edition"/>
77
        </tr>
78
        <tr>
79
            <xsl:apply-templates select="geoform"/>
80
        </tr>
81
        <tr>
82
            <xsl:apply-templates select="pubinfo"/>
83
        </tr>
84
        <tr>
85
            <xsl:apply-templates select="othercit"/>
86
        </tr>
87
    </xsl:template>
88
    
89
    <xsl:template match="descript">
90
        <tr>
91
            <td colspan="2">
92
                <span class="greenbold">Description</span>
93
            </td>
94
        </tr>
95
        <tr>
96
            <xsl:apply-templates select="abstract"/>
97
        </tr>
98
        <tr>
99
            <xsl:apply-templates select="purpose"/>
100
        </tr>
101
    </xsl:template>
102
    
103
    <xsl:template match="spdom">
104
        <tr>
105
            <xsl:apply-templates select="bounding"/>
106
        </tr>
107
    </xsl:template>
108
    
109
    <xsl:template match="keywords">
110
        <tr>
111
            <xsl:apply-templates select="theme"/>
112
        </tr>
113
        <tr>
114
            <xsl:apply-templates select="place"/>
115
        </tr>
116
    </xsl:template>
117
    
118
    <xsl:template match="theme">
119
        <td valign="top">Theme Keywords</td>
120
        <td>
121
            <xsl:apply-templates select="themekey[position()!=last()]">
122
                <xsl:with-param name="lastPlace">f</xsl:with-param>
123
            </xsl:apply-templates>
124
            <xsl:apply-templates select="themekey[position()=last()]">
125
                <xsl:with-param name="lastPlace">t</xsl:with-param>
126
            </xsl:apply-templates>
127
        </td>
128
    </xsl:template>
129
    
130
    <xsl:template match="place">
131
        <td valign="top">Place Keywords</td>
132
        <td>
133
            <xsl:apply-templates select="placekey[position()!=last()]">
134
                <xsl:with-param name="lastPlace">f</xsl:with-param>
135
            </xsl:apply-templates>
136
            <xsl:apply-templates select="placekey[position()=last()]">
137
                <xsl:with-param name="lastPlace">t</xsl:with-param>
138
            </xsl:apply-templates>
139
        </td>
140
    </xsl:template>
141
    
142
    <xsl:template match="themekey">
143
        <xsl:param name="lastPlace"/>
144
        <xsl:value-of select="."/>
145
        <xsl:if test="$lastPlace = 'f'">, </xsl:if>
146
    </xsl:template>
147
    
148
    <xsl:template match="placekey">
149
        <xsl:param name="lastPlace"/>
150
        <xsl:value-of select="."/>
151
        <xsl:if test="$lastPlace = 'f'">, </xsl:if>
152
    </xsl:template>
153
    
154
    <xsl:template match="bounding">
155
        <td valign="top">Bounding Coordinates</td>
156
        <td>
157
            <table>
158
                <tr>
159
                    <td align="right">West</td>
160
                    <td>
161
                        <xsl:value-of select="westbc"/>
162
                    </td>
163
                    <td align="right">East</td>
164
                    <td>
165
                        <xsl:value-of select="eastbc"/>
166
                    </td>
167
                </tr>
168
                <tr>
169
                    <td align="right">North</td>
170
                    <td>
171
                        <xsl:value-of select="northbc"/>
172
                    </td>
173
                    <td align="right">South</td>
174
                    <td>
175
                        <xsl:value-of select="southbc"/>
176
                    </td>
177
                </tr>
178
            </table>
179
        </td>
180
    </xsl:template>
181
    
182
    <xsl:template match="abstract">
183
        <td valign="top">Abstract</td>
184
        <td>
185
            <xsl:value-of select="."/>
186
        </td>
187
    </xsl:template>
188
    
189
    <xsl:template match="purpose">
190
        <td valign="top">Purpose</td>
191
        <td>
192
            <xsl:value-of select="."/>
193
        </td>
194
    </xsl:template>
195
    
196
    <xsl:template match="title">
197
        <td>Title</td>
198
        <td>
199
            <xsl:value-of select="."/>
200
        </td>
201
    </xsl:template>
202
    
203
    <xsl:template match="origin">
204
        <td>Originator </td>
205
        <td>
206
            <xsl:value-of select="."/>
207
        </td>
208
    </xsl:template>
209
    
210
    <xsl:template match="pubdate">
211
        <td>Publication Date</td>
212
        <td>
213
            <xsl:call-template name="long_date">
214
                <xsl:with-param name="date">
215
                    <xsl:value-of select="."/>
216
                </xsl:with-param>
217
            </xsl:call-template>
218
        </td>
219
    </xsl:template>
220
    
221
    <xsl:template match="edition">
222
        <td>Edition</td>
223
        <td>
224
            <xsl:value-of select="."/>
225
        </td>
226
    </xsl:template>
227
    
228
    <xsl:template match="geoform">
229
        <td valign="top">Geospatial Data Presentation Form</td>
230
        <td>
231
            <xsl:value-of select="."/>
232
        </td>
233
    </xsl:template>
234
    
235
    <xsl:template match="othercit">
236
        <td valign="top">Other Citation Details</td>
237
        <td>
238
            <xsl:value-of select="."/>
239
        </td>
240
    </xsl:template>
241
    
242
    <xsl:template match="pubinfo">
243
        <td valign="top"> Publication Information </td>
244
        <td>
245
            <table>
246
                <tr>
247
                    <xsl:apply-templates select="pubplace"/>
248
                </tr>
249
                <tr>
250
                    <xsl:apply-templates select="publish"/>
251
                </tr>
252
            </table>
253
        </td>
254
    </xsl:template>
255
    
256
    <xsl:template match="pubplace">
257
        <td>Publication Place</td>
258
        <td>
259
            <xsl:value-of select="."/>
260
        </td>
261
    </xsl:template>
262
    
263
    <xsl:template match="publish">
264
        <td>Publisher</td>
265
        <td>
266
            <xsl:value-of select="."/>
267
        </td>
268
    </xsl:template>
269
    
270
    <xsl:template match="distinfo">
271
        <table width="100%" border="0" cellspacing="10">
272
            <tr>
273
                <td colspan="3" align="center">
274
                    <span class="greenbold">Metacat Data Package Information</span>
275
                </td>
276
            </tr>
277
            <tr>
278
                <td>
279
                    <span class="greenbold">File type</span>
280
                </td>
281
                <td>
282
                    <span class="greenbold">File name (Doc Id)</span>
283
                </td>
284
                <xsl:if test="not($sessionid = 'null')">
285
                    <td align="center" colspan="3">
286
                        <span class="greenbold">Update with...</span>
287
                    </td>
288
                </xsl:if>
289
            </tr>
290
            <tr>
291
                <xsl:apply-templates select="resdesc"/>
292
            </tr>
293
            <xsl:apply-templates select="stdorder/digform/digtopt/onlinopt/computer/networka"/>
294
        </table>
295
    </xsl:template>
296
    
297
    <xsl:template match="resdesc">
298
        <td align="left">Metadata</td>
299
        <td align="left">
300
        <xsl:value-of select="../custom"/> (<xsl:value-of select="."/>)</td>
301
        <td>
302
            <form method="get" action="./style/common/ClientViewHelper.jspx">
303
                <input name="action" value="Download" type="submit"/>
304
                <input name="docid" type="hidden" value="{.}"/>
305
                <input name="qformat" type="hidden" value="{$qformat}"/>
306
                <input name="metadataDocId" type="hidden" value="{$docid}"/>
307
            </form>
308
            <xsl:if test="not($sessionid = 'null')">
309
                <form method="get" action="./style/common/ClientViewHelper.jspx"
310
                      enctype="text/html">
311
                    <input name="action" value="Delete" type="submit"/>
312
                    <input name="docid" type="hidden" value="{.}"/>
313
                    <input name="qformat" type="hidden" value="{$qformat}"/>
314
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
315
                </form>
316
            </xsl:if>
317
        </td>
318
        <td>
319
            <xsl:if test="not($sessionid = 'null')">
320
                <form method="get" action="./style/common/ClientViewHelper.jspx">
321
                    <input name="action" value="Set Access" type="submit"/>
322
                    <xsl:choose>
323
                        <xsl:when test="$publicRead = 'true'">
324
                            <input name="publicAccess" type="checkbox" checked=''/> Public read     
325
                        </xsl:when>
326
                        <xsl:otherwise>
327
                            <input name="publicAccess" type="checkbox"/> Public read                         
328
                        </xsl:otherwise>
329
                    </xsl:choose>
330
                    <input name="docid" type="hidden" value="{.}"/>
331
                    <input name="qformat" type="hidden" value="{$qformat}"/>
332
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
333
                    <input name="contentStandard" type="hidden" value="FGDC"/>
334
                </form>
335
                <form method="post" action="./style/common/ClientViewHelper.jspx"
336
                      enctype="multipart/form-data">
337
                    <input name="action" value="Update Metadata" type="submit"/>
338
                    <input name="docid" type="hidden" value="{.}"/>
339
                    <input name="qformat" type="hidden" value="{$qformat}"/>
340
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
341
                    <input name="updateFile" type="file"/>
342
                </form>
343
            </xsl:if>
344
        </td>
345
    </xsl:template>
346
    
347
    <xsl:template match="networka">
348
        <tr>
349
            <xsl:apply-templates select="networkr"/>
350
        </tr>
351
    </xsl:template>
352
    
353
    <xsl:template match="networkr">
354
        <td align="right">Data</td>
355
        <td align="center">
356
            <xsl:value-of select="./ancestor::digform/digtinfo/formcont"/> (<xsl:value-of select="."/>) </td>
357
        <td>
358
            <form method="get" action="./style/common/ClientViewHelper.jspx" enctype="application/octet-stream">
359
                <input name="action" value="Download" type="submit"/>
360
                <input name="docid" type="hidden" value="{.}"/>
361
                <input name="qformat" type="hidden" value="{$qformat}"/>
362
                <input name="metadataDocId" type="hidden" value="{$docid}"/>
363
            </form>
364
            <xsl:if test="not($sessionid = 'null')">
365
                <form method="get" action="./style/common/ClientViewHelper.jspx"
366
                      enctype="text/html">
367
                    <input name="action" value="Delete" type="submit"/>
368
                    <input name="docid" type="hidden" value="{.}"/>
369
                    <input name="qformat" type="hidden" value="{$qformat}"/>
370
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
371
                </form>
372
            </xsl:if>
373
        </td>
374
        <td>
375
            <xsl:if test="not($sessionid = 'null')">
376
                <form method="post" action="./style/common/ClientViewHelper.jspx"
377
                      enctype="multipart/form-data">
378
                    <input name="action" value="Update Data" type="submit"/>
379
                    <input name="docid" type="hidden" value="{.}"/>
380
                    <input name="qformat" type="hidden" value="{$qformat}"/>
381
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
382
                    <input name="updateFile" type="file"/>
383
                </form>
384
            </xsl:if>
385
        </td>
386
    </xsl:template>
387
    
388
    <xsl:template name="long_date">
389
        <xsl:param name="date"/>
390
        <!-- Day -->
391
        <xsl:value-of select="number(substring($date, 7, 2))"/>
392
        <xsl:text> </xsl:text>
393
        <!-- Month -->
394
        <xsl:variable name="month" select="number(substring($date, 5, 2))"/>
395
        <xsl:choose>
396
            <xsl:when test="$month=1">January</xsl:when>
397
            <xsl:when test="$month=2">February</xsl:when>
398
            <xsl:when test="$month=3">March</xsl:when>
399
            <xsl:when test="$month=4">April</xsl:when>
400
            <xsl:when test="$month=5">May</xsl:when>
401
            <xsl:when test="$month=6">June</xsl:when>
402
            <xsl:when test="$month=7">July</xsl:when>
403
            <xsl:when test="$month=8">August</xsl:when>
404
            <xsl:when test="$month=9">September</xsl:when>
405
            <xsl:when test="$month=10">October</xsl:when>
406
            <xsl:when test="$month=11">November</xsl:when>
407
            <xsl:when test="$month=12">December</xsl:when>
408
            <xsl:otherwise>INVALID MONTH</xsl:otherwise>
409
        </xsl:choose>
410
        <xsl:text> </xsl:text>
411
        <!-- Year -->
412
        <xsl:value-of select="substring($date, 1, 4)"/>
413
    </xsl:template>
414
    
415
</xsl:stylesheet>
(2-2/3)