Project

General

Profile

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