Project

General

Profile

« Previous | Next » 

Revision 3744

reuse the fgdc-root.xsl for both nceas and sanparks skins (it is included in different containing stylesheets)
note: still need to pin down the switch that [dis]allows editing of the the files

View differences:

lib/style/common/fgdc/fgdc_1.xsl
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3

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

Also available in: Unified diff