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