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
        <article id="Metadata" class="container">
10
				    <xsl:apply-templates select="metadata/idinfo"/>
11
			        <br/>
12
			        <xsl:apply-templates
13
			            select="metadata/distinfo/resdesc[starts-with(text(),$docid)]/ancestor::distinfo"/>
14
	    </article>
15
        
16
    </xsl:template>
17
    
18
    <xsl:template match="idinfo">
19
                
20
        <!-- don't want to conflict with the eml-physical.xsl template -->
21
        <xsl:for-each select="citation/citeinfo">
22
        	<xsl:call-template name="fgdcBlockCitation"/>
23
        </xsl:for-each>
24
            
25
        <div class="form-horizontal">
26
        	<xsl:for-each select="citation">
27
	        	<xsl:call-template name="fgdcCitation"/>
28
	        </xsl:for-each>
29
            <xsl:apply-templates select="descript"/>
30
            <xsl:apply-templates select="spdom"/>
31
            <xsl:apply-templates select="keywords"/>
32
            
33
        </div>
34
    </xsl:template>
35
    
36
    <!-- for citation information -->
37
    <xsl:template name="fgdcBlockCitation">
38
    
39
    	<cite class="citation">
40
    			<span class="author">
41
    				<xsl:for-each select="origin">
42
		        		<xsl:if test="position() &gt; 1">
43
		        			<xsl:if test="last() &gt; 2">, </xsl:if>
44
		        			<xsl:if test="position() = last()"> and</xsl:if>
45
		        			<xsl:text> </xsl:text>
46
		        		</xsl:if>
47
		        		<xsl:value-of select="." />
48
		        		<xsl:if test="position() = last()">.</xsl:if>
49
		        		<xsl:text> </xsl:text>    		
50
		        	</xsl:for-each>
51
		      </span>   	
52
    			<span class="pubdate">
53
		        	<xsl:value-of select="substring(string(pubdate),1,4)"/>
54
		        	<xsl:if test="substring(string(pubdate),1,4) != ''">
55
		        		<xsl:text>. </xsl:text>    				     		
56
		        	</xsl:if>
57
		        </span>
58
		        <span class="title">		        	
59
		        	<!-- title -->
60
					<strong>
61
						<xsl:for-each select="./title">
62
			        		<xsl:value-of select="." />
63
			        		<xsl:text> </xsl:text>    				     		
64
				     	</xsl:for-each>				
65
					</strong>
66
				</span>
67
				<span class="id">					
68
					<!-- show link? -->
69
						ID: <xsl:value-of select="$pid"/>
70
				</span>			        		
71
    			<div>
72
    			
73
    				<form method="get" action="{$contextURL}/style/common/ClientViewHelper.jspx" enctype="application/octet-stream">
74
		               <input name="docid" type="hidden" value="{$docid}"/>
75
		               <input name="qformat" type="hidden" value="{$qformat}"/>
76
		               <input name="metadataDocId" type="hidden" value="{$docid}"/>
77
		               <input name="action" value="Download" type="hidden"/>
78
		               <button class="btn" type="submit" id="downloadPackage">
79
		               		<i class="icon-arrow-down"></i> Download Package
80
		               </button>
81
		           </form>
82
           			<!--  
83
   					<a class="btn">
84
   						<xsl:attribute name="href">
85
							<xsl:value-of select="$packageURI"/><xsl:value-of select="$pid"/>
86
						</xsl:attribute>
87
   						<i class="icon-arrow-down"></i> Download Package
88
   					</a>
89
   					-->
90
    			</div>	
91
 				
92
		</cite>
93

    
94
   </xsl:template>
95
    
96
    
97
    <xsl:template name="fgdcCitation">
98
        <xsl:apply-templates select="citeinfo"/>
99
    </xsl:template>
100
    
101
    <xsl:template match="citeinfo">
102
        <h4>Citation Information</h4>
103
        
104
        <xsl:apply-templates select="title"/>
105
        <xsl:call-template name="docid"/>
106
        <xsl:for-each select="origin">
107
            <xsl:apply-templates select="."/>
108
	    </xsl:for-each> 
109
        <xsl:apply-templates select="pubdate"/>
110
        <xsl:apply-templates select="edition"/>
111
        <xsl:apply-templates select="geoform"/>
112
        <xsl:apply-templates select="pubinfo"/>
113
        <xsl:apply-templates select="othercit"/>
114
    </xsl:template>
115
    
116
    <xsl:template match="descript">
117
        <h4>Description</h4>
118
        <xsl:apply-templates select="abstract"/>
119
        <xsl:apply-templates select="purpose"/>
120
    </xsl:template>
121
    
122
    <xsl:template match="spdom">
123
        <xsl:apply-templates select="bounding"/>
124
    </xsl:template>
125
    
126
    <xsl:template match="keywords">
127
	    <xsl:apply-templates select="theme"/>
128
	    <xsl:apply-templates select="place"/>
129
    </xsl:template>
130
    
131
    <xsl:template match="theme">
132
        <div class="control-group">
133
			<label class="control-label">Theme Keywords</label>
134
        	<div class="controls controls-well">
135
	            <xsl:apply-templates select="themekey[position()!=last()]">
136
	                <xsl:with-param name="lastPlace">f</xsl:with-param>
137
	            </xsl:apply-templates>
138
	            <xsl:apply-templates select="themekey[position()=last()]">
139
	                <xsl:with-param name="lastPlace">t</xsl:with-param>
140
	            </xsl:apply-templates>
141
        	</div>
142
        </div>	
143
    </xsl:template>
144
    
145
    <xsl:template match="place">
146
        <div class="control-group">
147
			<label class="control-label">Place Keywords</label>
148
        	<div class="controls controls-well">
149
	            <xsl:apply-templates select="placekey[position()!=last()]">
150
	                <xsl:with-param name="lastPlace">f</xsl:with-param>
151
	            </xsl:apply-templates>
152
	            <xsl:apply-templates select="placekey[position()=last()]">
153
	                <xsl:with-param name="lastPlace">t</xsl:with-param>
154
	            </xsl:apply-templates>
155
        	</div>
156
        </div>	
157
    </xsl:template>
158
    
159
    <xsl:template match="themekey">
160
        <xsl:param name="lastPlace"/>
161
        <xsl:value-of select="."/>
162
        <xsl:if test="$lastPlace = 'f'">, </xsl:if>
163
    </xsl:template>
164
    
165
    <xsl:template match="placekey">
166
        <xsl:param name="lastPlace"/>
167
        <xsl:value-of select="."/>
168
        <xsl:if test="$lastPlace = 'f'">, </xsl:if>
169
    </xsl:template>
170
    
171
    <xsl:template match="bounding">
172
        <div class="control-group boundingCoordinates geographicCoverage" data-content="boundingCoordinates">
173
			<label class="control-label">Bounding Coordinates</label>
174
        	<div class="controls controls-well">
175
        	
176
        	  	<xsl:variable name="west"><xsl:value-of select="westbc"/></xsl:variable>
177
        	  	<xsl:variable name="east"><xsl:value-of select="eastbc"/></xsl:variable>
178
        	  	<xsl:variable name="north"><xsl:value-of select="northbc"/></xsl:variable>
179
        	  	<xsl:variable name="south"><xsl:value-of select="southbc"/></xsl:variable>
180

    
181
	            <div class="control-group westBoundingCoordinate" data-content="westBoundingCoordinate" data-value="{$west}">
182
					<label class="control-label">West</label>
183
	                <div class="controls">
184
                       	<xsl:value-of select="$west"/>
185
	                </div>
186
				</div> 
187
	            <div class="control-group eastBoundingCoordinate" data-content="eastBoundingCoordinate" data-value="{$east}">
188
					<label class="control-label">East</label>
189
                    <div class="controls">
190
                        <xsl:value-of select="$east"/>
191
                    </div>
192
				</div>
193
				<div class="control-group northBoundingCoordinate" data-content="northBoundingCoordinate" data-value="{$north}">
194
					<label class="control-label">North</label>
195
                    <div class="controls">
196
                        <xsl:value-of select="$north"/>
197
                    </div>
198
               	</div>
199
	            <div class="control-group southBoundingCoordinate" data-content="southBoundingCoordinate" data-value="{$south}">
200
					<label class="control-label">South</label>
201
                    <div class="controls">
202
                        <xsl:value-of select="$south"/>
203
                    </div>
204
	            </div>
205
	        </div> 
206
        </div>
207
    </xsl:template>
208
    
209
    <xsl:template match="abstract">
210
        <div class="control-group">
211
			<label class="control-label">Abstract</label>
212
	        <div class="controls controls-well">
213
	            <xsl:value-of select="."/>
214
	        </div>
215
	   	</div> 
216
    </xsl:template>
217
    
218
    <xsl:template match="purpose">
219
        <div class="control-group">
220
			<label class="control-label">Purpose</label>
221
	        <div class="controls controls-well">
222
	            <xsl:value-of select="."/>
223
	        </div>
224
        </div>
225
    </xsl:template>
226
    
227
    <xsl:template match="title">
228
        <div class="control-group">
229
			<label class="control-label">Title</label>
230
	        <div class="controls controls-well">
231
	            <xsl:value-of select="."/>
232
	        </div>
233
        </div>
234
    </xsl:template>
235
    
236
     <xsl:template name="docid">
237
        <div class="control-group">
238
			<label class="control-label">Identifier</label>
239
	        <div class="controls controls-well">
240
	            <xsl:value-of select="$pid"/>
241
	        </div>
242
        </div>
243
    </xsl:template>
244
    
245
    <xsl:template match="origin">
246
        <div class="control-group">
247
			<label class="control-label">Originator</label>
248
	        <div class="controls controls-well">
249
	            <xsl:value-of select="."/>
250
	        </div>
251
       	</div>
252
    </xsl:template>
253
    
254
    <xsl:template match="pubdate">
255
        <div class="control-group">
256
			<label class="control-label">Publication Date</label>
257
	        <div class="controls controls-well">
258
	            <!-- <xsl:call-template name="long_date">-->
259
	            <xsl:call-template name="date_as_is">
260
	                <xsl:with-param name="date">
261
	                    <xsl:value-of select="."/>
262
	                </xsl:with-param>
263
	            </xsl:call-template>
264
	        </div>
265
        </div>
266
    </xsl:template>
267
    
268
    <xsl:template match="edition">
269
        <div class="control-group">
270
			<label class="control-label">Edition</label>
271
	        <div class="controls controls-well">
272
	            <xsl:value-of select="."/>
273
	        </div>
274
        </div>
275
    </xsl:template>
276
    
277
    <xsl:template match="geoform">
278
        <div class="control-group">
279
			<label class="control-label">Geospatial Data Presentation Form</label>
280
	        <div class="controls controls-well">
281
	            <xsl:value-of select="."/>
282
	        </div>
283
        </div>
284
    </xsl:template>
285
    
286
    <xsl:template match="othercit">
287
        <div class="control-group">
288
			<label class="control-label">Other Citation Details</label>
289
	        <div class="controls controls-well">
290
	            <xsl:value-of select="."/>
291
	        </div>
292
        </div>
293
    </xsl:template>
294
    
295
    <xsl:template match="pubinfo">
296
        <div class="control-group">
297
			<label class="control-label">Publication Information</label>
298
	        <div class="controls controls-well">
299
	            <xsl:apply-templates select="pubplace"/>
300
	            <xsl:apply-templates select="publish"/>
301
	        </div>
302
        </div>
303
    </xsl:template>
304
    
305
    <xsl:template match="pubplace">
306
        <div class="control-group">
307
			<label class="control-label">Publication Place</label>
308
	        <div class="controls">
309
	            <xsl:value-of select="."/>
310
	        </div>
311
        </div>
312
    </xsl:template>
313
    
314
    <xsl:template match="publish">
315
        <div class="control-group">
316
			<label class="control-label">Publisher</label>
317
	        <div class="controls">
318
	            <xsl:value-of select="."/>
319
	        </div>
320
        </div>
321
    </xsl:template>
322
    
323
    <xsl:template match="distinfo">
324
    	<h4>Data Package Information</h4>
325
        <div class="form-horizontal">
326
            <xsl:apply-templates select="resdesc"/>
327
            <xsl:apply-templates select="stdorder/digform/digtopt/onlinopt/computer/networka"/>
328
        </div>
329
    </xsl:template>
330
    
331
    <xsl:template match="resdesc">
332
        <div class="control-group">
333
			<label class="control-label">Metadata</label>
334
        	<div class="controls controls-well">
335
        		
336
				<!-- download -->
337
				<form method="get" action="{$contextURL}/style/common/ClientViewHelper.jspx" class="form-inline">
338
					<xsl:value-of select="../custom"/> (<xsl:value-of select="."/>)
339
					<input name="action" value="Download" type="submit"/>
340
					<input name="docid" type="hidden" value="{.}"/>
341
					<input name="qformat" type="hidden" value="{$qformat}"/>
342
					<input name="metadataDocId" type="hidden" value="{.}"/>
343
				</form>
344

    
345
				<xsl:if test="$enableFGDCediting = 'true' and not($sessionid = '')">
346
	
347
					<!-- update -->
348
		       		<form method="post" action="{$contextURL}/style/common/ClientViewHelper.jspx"
349
	                     enctype="multipart/form-data" class="form-inline">
350
	                   <input name="action" value="Update Metadata" type="hidden"/>
351
	                   <input name="docid" type="hidden" value="{.}"/>
352
	                   <input name="qformat" type="hidden" value="{$qformat}"/>
353
	                   <input name="metadataDocId" type="hidden" value="{.}"/>
354
	                   <input name="updateFile" type="file"/>
355
	                   <input name="submit" value="Update" type="submit"/>
356
					</form>
357
				
358
					<!-- set access -->
359
					<form method="get" action="{$contextURL}/style/common/ClientViewHelper.jspx" class="form-inline">
360
		                   <xsl:choose>
361
		                       <xsl:when test="$publicRead = 'true'">
362
		                           <input name="publicAccess" type="checkbox" checked=''/> Public read     
363
		                       </xsl:when>
364
		                       <xsl:otherwise>
365
		                           <input name="publicAccess" type="checkbox"/> Public read                         
366
		                       </xsl:otherwise>
367
		                   </xsl:choose>
368
		                   <input name="docid" type="hidden" value="{.}"/>
369
		                   <input name="qformat" type="hidden" value="{$qformat}"/>
370
		                   <input name="metadataDocId" type="hidden" value="{.}"/>
371
		                   <input name="contentStandard" type="hidden" value="FGDC"/>
372
		                   <input name="action" value="Set Access" type="submit"/>		                   
373
					</form>
374
				
375
					<!-- delete -->
376
		           	<form method="get" action="{$contextURL}/style/common/ClientViewHelper.jspx"
377
		                     enctype="text/html" class="form-inline">
378
		                   <input name="action" value="Delete" type="submit"/>
379
		                   <input name="docid" type="hidden" value="{.}"/>
380
		                   <input name="qformat" type="hidden" value="{$qformat}"/>
381
		                   <input name="metadataDocId" type="hidden" value="{.}"/>
382
					</form>
383
				</xsl:if>
384
			</div>
385
		</div>
386
   </xsl:template>
387
   
388
   <xsl:template match="networka">
389
   		<xsl:apply-templates select="networkr"/>
390
   </xsl:template>
391
   
392
   <xsl:template match="networkr">
393
	<xsl:if test="not(./ancestor::digform/digtinfo/formcont = '')">
394
       <div class="control-group">
395
			<label class="control-label">Data</label>
396
       		<div class="controls controls-well">
397
		        <!-- download -->
398
	           <form method="get" action="{$contextURL}/style/common/ClientViewHelper.jspx" enctype="application/octet-stream" class="form-inline">
399
		        	<xsl:value-of select="./ancestor::digform/digtinfo/formcont"/> (<xsl:value-of select="."/>)
400
					<input name="action" value="Download" type="submit"/>
401
					<input name="docid" type="hidden" value="{.}"/>
402
					<input name="qformat" type="hidden" value="{$qformat}"/>
403
					<input name="metadataDocId" type="hidden" value="{$docid}"/>
404
	           </form>
405
		       	<!-- update -->
406
				<xsl:if test="$enableFGDCediting = 'true' and not($sessionid = '')">
407
		               <form method="post" action="{$contextURL}/style/common/ClientViewHelper.jspx"
408
		                     enctype="multipart/form-data" class="form-inline">
409
		                   <input name="action" value="Update Data" type="hidden"/>
410
		                   <input name="docid" type="hidden" value="{.}"/>
411
		                   <input name="qformat" type="hidden" value="{$qformat}"/>
412
		                   <input name="metadataDocId" type="hidden" value="{$docid}"/>
413
		                   <input name="updateFile" type="file"/>
414
		                   <input name="submit" value="Update" type="submit"/>                    
415
		               </form>
416
		               <!-- delete -->
417
						<form method="get" action="{$contextURL}/style/common/ClientViewHelper.jspx"
418
		                     enctype="text/html" class="form-inline">
419
		                   <input name="action" value="Delete" type="submit"/>
420
		                   <input name="docid" type="hidden" value="{.}"/>
421
		                   <input name="qformat" type="hidden" value="{$qformat}"/>
422
		                   <input name="metadataDocId" type="hidden" value="{$docid}"/>
423
		               </form>	
424
				</xsl:if>                        
425
			</div>
426
		</div>	
427
	</xsl:if>
428
			
429
   </xsl:template>
430
   
431
   <xsl:template name="date_as_is">
432
       <xsl:param name="date"/>
433
       <xsl:value-of select="$date"/>
434
   </xsl:template>
435
   
436
   <xsl:template name="long_date">
437
       <xsl:param name="date"/>
438
       <!-- Day -->
439
       <xsl:value-of select="number(substring($date, 7, 2))"/>
440
       <xsl:text> </xsl:text>
441
       <!-- Month -->
442
       <xsl:variable name="month" select="number(substring($date, 5, 2))"/>
443
       <xsl:choose>
444
           <xsl:when test="$month=1">January</xsl:when>
445
           <xsl:when test="$month=2">February</xsl:when>
446
           <xsl:when test="$month=3">March</xsl:when>
447
           <xsl:when test="$month=4">April</xsl:when>
448
           <xsl:when test="$month=5">May</xsl:when>
449
           <xsl:when test="$month=6">June</xsl:when>
450
           <xsl:when test="$month=7">July</xsl:when>
451
           <xsl:when test="$month=8">August</xsl:when>
452
           <xsl:when test="$month=9">September</xsl:when>
453
           <xsl:when test="$month=10">October</xsl:when>
454
           <xsl:when test="$month=11">November</xsl:when>
455
           <xsl:when test="$month=12">December</xsl:when>
456
           <xsl:otherwise>INVALID MONTH</xsl:otherwise>
457
       </xsl:choose>
458
       <xsl:text> </xsl:text>
459
       <!-- Year -->
460
        <xsl:value-of select="substring($date, 1, 4)"/>
461
    </xsl:template>
462
    
463
</xsl:stylesheet>
    (1-1/1)