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