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
                    <h2>FGDC Identification Information</h2>
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
            <th colspan="2">
62
                <span class="greenbold">Citation Information </span>
63
            </th>
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
            <th colspan="2">
92
                <span class="greenbold">Description</span>
93
            </th>
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 class="highlight" valign="top">Theme Keywords</td>
120
        <td class="secondCol">
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 class="highlight" valign="top">Place Keywords</td>
132
        <td class="secondCol">
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 class="highlight" valign="top">Bounding Coordinates</td>
156
        <td class="secondCol">
157
            <table>
158
                <tr>
159
                    <td class="highlight" align="right">West</td>
160
                    <td class="secondCol">
161
                        <xsl:value-of select="westbc"/>
162
                    </td>
163
                    <td class="highlight" align="right">East</td>
164
                    <td class="secondCol">
165
                        <xsl:value-of select="eastbc"/>
166
                    </td>
167
                </tr>
168
                <tr>
169
                    <td class="highlight" align="right">North</td>
170
                    <td class="secondCol">
171
                        <xsl:value-of select="northbc"/>
172
                    </td>
173
                    <td class="highlight" align="right">South</td>
174
                    <td class="secondCol">
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 class="highlight" valign="top">Abstract</td>
184
        <td class="secondCol">
185
            <xsl:value-of select="."/>
186
        </td>
187
    </xsl:template>
188
    
189
    <xsl:template match="purpose">
190
        <td class="highlight" valign="top">Purpose</td>
191
        <td class="secondCol">
192
            <xsl:value-of select="."/>
193
        </td>
194
    </xsl:template>
195
    
196
    <xsl:template match="title">
197
        <td class="highlight">Title</td>
198
        <td class="secondCol">
199
            <xsl:value-of select="."/>
200
        </td>
201
    </xsl:template>
202
    
203
    <xsl:template match="origin">
204
        <td class="highlight">Originator </td>
205
        <td class="secondCol">
206
            <xsl:value-of select="."/>
207
        </td>
208
    </xsl:template>
209
    
210
    <xsl:template match="pubdate">
211
        <td class="highlight">Publication Date</td>
212
        <td class="secondCol">
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 class="highlight">Edition</td>
223
        <td class="secondCol">
224
            <xsl:value-of select="."/>
225
        </td>
226
    </xsl:template>
227
    
228
    <xsl:template match="geoform">
229
        <td class="highlight" valign="top">Geospatial Data Presentation Form</td>
230
        <td class="secondCol">
231
            <xsl:value-of select="."/>
232
        </td>
233
    </xsl:template>
234
    
235
    <xsl:template match="othercit">
236
        <td class="highlight" valign="top">Other Citation Details</td>
237
        <td class="secondCol">
238
            <xsl:value-of select="."/>
239
        </td>
240
    </xsl:template>
241
    
242
    <xsl:template match="pubinfo">
243
        <td class="highlight" valign="top">Publication Information </td>
244
        <td class="secondCol">
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 class="highlight">Publication Place</td>
258
        <td class="secondCol">
259
            <xsl:value-of select="."/>
260
        </td>
261
    </xsl:template>
262
    
263
    <xsl:template match="publish">
264
        <td class="highlight">Publisher</td>
265
        <td class="secondCol">
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
                <th colspan="5" align="center">
274
                    <span class="greenbold">Metacat Data Package Information</span>
275
                </th>
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
                <td></td>
285
                <xsl:if test="not($sessionid = 'null')">
286
                    <td align="left" colspan="2">
287
                        <span class="greenbold">Actions...</span>
288
                    </td>
289
                </xsl:if>
290
            </tr>
291
            <tr>
292
                <xsl:apply-templates select="resdesc"/>
293
            </tr>
294
            <xsl:apply-templates select="stdorder/digform/digtopt/onlinopt/computer/networka"/>
295
        </table>
296
    </xsl:template>
297
    
298
    <xsl:template match="resdesc">
299
        <td class="highlight" align="left" valign="top">Metadata</td>
300
        <td class="secondCol" align="left" valign="top">
301
        	<xsl:value-of select="../custom"/> (<xsl:value-of select="."/>)
302
        	
303
        	<!-- update -->
304
			<xsl:if test="not($sessionid = 'null')">
305
				<br/>
306
				<br/>
307
				<form method="post" action="./style/common/ClientViewHelper.jspx"
308
                      enctype="multipart/form-data">
309
                    <input name="action" value="Update Metadata" type="hidden"/>
310
                    <input name="docid" type="hidden" value="{.}"/>
311
                    <input name="qformat" type="hidden" value="{$qformat}"/>
312
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
313
                    <input name="updateFile" type="file"/>
314
                    <input name="submit" value="Update" type="submit"/>
315
                </form>
316
			</xsl:if>
317
			
318
        </td>
319
        <!-- download -->
320
        <td class="secondCol" valign="bottom">
321
            <form method="get" action="./style/common/ClientViewHelper.jspx">
322
                <input name="action" value="Download" type="submit"/>
323
                <input name="docid" type="hidden" value="{.}"/>
324
                <input name="qformat" type="hidden" value="{$qformat}"/>
325
                <input name="metadataDocId" type="hidden" value="{$docid}"/>
326
            </form>
327
        </td>
328
        
329
        <xsl:if test="not($sessionid = 'null')">
330
        	<!-- delete -->
331
        	<td class="secondCol" valign="bottom">
332
            	<form method="get" action="./style/common/ClientViewHelper.jspx"
333
                      enctype="text/html">
334
                    <input name="action" value="Delete" type="submit"/>
335
                    <input name="docid" type="hidden" value="{.}"/>
336
                    <input name="qformat" type="hidden" value="{$qformat}"/>
337
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
338
                </form>
339
            </td>
340
            <!-- set access -->
341
        	<td class="secondCol" valign="bottom">
342
				<form method="get" action="./style/common/ClientViewHelper.jspx">
343
                    <input name="action" value="Set Access" type="submit"/>
344
                    <xsl:choose>
345
                        <xsl:when test="$publicRead = 'true'">
346
                            <input name="publicAccess" type="checkbox" checked=''/> Public read     
347
                        </xsl:when>
348
                        <xsl:otherwise>
349
                            <input name="publicAccess" type="checkbox"/> Public read                         
350
                        </xsl:otherwise>
351
                    </xsl:choose>
352
                    <input name="docid" type="hidden" value="{.}"/>
353
                    <input name="qformat" type="hidden" value="{$qformat}"/>
354
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
355
                    <input name="contentStandard" type="hidden" value="FGDC"/>
356
				</form>
357
			</td>
358
		</xsl:if>
359
    </xsl:template>
360
    
361
    <xsl:template match="networka">
362
        <tr>
363
            <xsl:apply-templates select="networkr"/>
364
        </tr>
365
    </xsl:template>
366
    
367
    <xsl:template match="networkr">
368
        <td class="highlight" align="left" valign="top">Data</td>
369
        <td class="secondCol" align="left" valign="top">
370
            <xsl:value-of select="./ancestor::digform/digtinfo/formcont"/> (<xsl:value-of select="."/>)
371
        	<!-- update -->
372
			<xsl:if test="not($sessionid = 'null')">
373
				<br/>
374
				<br/>
375
                <form method="post" action="./style/common/ClientViewHelper.jspx"
376
                      enctype="multipart/form-data">
377
                    <input name="action" value="Update Data" type="hidden"/>
378
                    <input name="docid" type="hidden" value="{.}"/>
379
                    <input name="qformat" type="hidden" value="{$qformat}"/>
380
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
381
                    <input name="updateFile" type="file"/>
382
                    <input name="submit" value="Update" type="submit"/>                    
383
                </form>
384
			</xsl:if>                        
385
        </td>
386
        <!-- download -->
387
        <td class="secondCol" valign="bottom">
388
            <form method="get" action="./style/common/ClientViewHelper.jspx" enctype="application/octet-stream">
389
                <input name="action" value="Download" type="submit"/>
390
                <input name="docid" type="hidden" value="{.}"/>
391
                <input name="qformat" type="hidden" value="{$qformat}"/>
392
                <input name="metadataDocId" type="hidden" value="{$docid}"/>
393
            </form>
394
        </td>
395
        <xsl:if test="not($sessionid = 'null')">
396
        	<!-- delete -->
397
        	<td class="secondCol" valign="bottom">
398
        		<form method="get" action="./style/common/ClientViewHelper.jspx"
399
                      enctype="text/html">
400
                    <input name="action" value="Delete" type="submit"/>
401
                    <input name="docid" type="hidden" value="{.}"/>
402
                    <input name="qformat" type="hidden" value="{$qformat}"/>
403
                    <input name="metadataDocId" type="hidden" value="{$docid}"/>
404
                </form>
405
        	</td>
406
        	<!-- set access -->
407
        	<td class="secondCol" valign="bottom"></td>
408
        	
409
		</xsl:if>
410
    </xsl:template>
411
    
412
    <xsl:template name="long_date">
413
        <xsl:param name="date"/>
414
        <!-- Day -->
415
        <xsl:value-of select="number(substring($date, 7, 2))"/>
416
        <xsl:text> </xsl:text>
417
        <!-- Month -->
418
        <xsl:variable name="month" select="number(substring($date, 5, 2))"/>
419
        <xsl:choose>
420
            <xsl:when test="$month=1">January</xsl:when>
421
            <xsl:when test="$month=2">February</xsl:when>
422
            <xsl:when test="$month=3">March</xsl:when>
423
            <xsl:when test="$month=4">April</xsl:when>
424
            <xsl:when test="$month=5">May</xsl:when>
425
            <xsl:when test="$month=6">June</xsl:when>
426
            <xsl:when test="$month=7">July</xsl:when>
427
            <xsl:when test="$month=8">August</xsl:when>
428
            <xsl:when test="$month=9">September</xsl:when>
429
            <xsl:when test="$month=10">October</xsl:when>
430
            <xsl:when test="$month=11">November</xsl:when>
431
            <xsl:when test="$month=12">December</xsl:when>
432
            <xsl:otherwise>INVALID MONTH</xsl:otherwise>
433
        </xsl:choose>
434
        <xsl:text> </xsl:text>
435
        <!-- Year -->
436
        <xsl:value-of select="substring($date, 1, 4)"/>
437
    </xsl:template>
438
    
439
</xsl:stylesheet>
(2-2/3)