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