Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
	*  '$RCSfile$'
4
	*      Authors: Matt Jones, Chad Berkley
5
	*    Copyright: 2000-2007 Regents of the University of California and the
6
	*               National Center for Ecological Analysis and Synthesis
7
	*  For Details: http://www.nceas.ucsb.edu/
8
	*
9
	*   '$Author: leinfelder $'
10
	*     '$Date: 2013-05-01 15:33:12 -0700 (Wed, 01 May 2013) $'
11
	* '$Revision: 7650 $'
12
	*
13
	* This program is free software; you can redistribute it and/or modify
14
	* it under the terms of the GNU General Public License as published by
15
	* the Free Software Foundation; either version 2 of the License, or
16
	* (at your option) any later version.
17
	*
18
	* This program is distributed in the hope that it will be useful,
19
	* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
	* GNU General Public License for more details.
22
	*
23
	* You should have received a copy of the GNU General Public License
24
	* along with this program; if not, write to the Free Software
25
	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
	*
27
	* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
	* convert an XML file showing the resultset of a query
29
	* into an HTML format suitable for rendering with modern web browsers.
30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
32
                version="1.0">
33
    <xsl:template name="resultstablesolr">
34
        <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
35
            
36
            <p class="emphasis">
37
                <xsl:number value="count(response/result/doc)" />
38
                data packages found
39
            </p>
40
            
41
            <!-- This tests to see if there are returned documents,
42
					if there are not then don't show the query results -->
43
            <xsl:if test="count(response/result/doc) &gt; 0">
44
                
45
                <table class="resultstable" width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
46
                    <tr>
47
                        <th class="tablehead_lcorner" align="right" valign="top">
48
                            <img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" />
49
                        </th>
50
                        <th class="tablehead" style="text-align: left">
51
                            Title
52
                        </th>
53
                        <th width="15%" class="tablehead" style="text-align: left">
54
                            Contacts
55
                        </th>
56
                        <th width="15%" class="tablehead" style="text-align: left">
57
                            Organization
58
                        </th>
59
                        <th width="15%" class="tablehead" style="text-align: left">
60
                            Keywords
61
                        </th>
62
                        <xsl:if test="$enableediting = 'true'">
63
                            <th width="10%" class="tablehead" style="text-align: middle">
64
                                Actions
65
                            </th>
66
                        </xsl:if>
67
                        <th class="tablehead_rcorner" align="right" valign="top">
68
                            <img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" />
69
                        </th>
70
                    </tr>
71
                    
72
                    <xsl:for-each select="response/result/doc">
73
                        <xsl:sort select="./str[@name='title']" />
74
                        <tr valign="top" class="subpanel">
75
                            <xsl:attribute name="class">
76
                                <xsl:choose>
77
                                    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
78
                                    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
79
                                </xsl:choose>
80
                            </xsl:attribute>
81
                            
82
                            <td width="10">&#160;</td>
83
                            <td class="text_plain">
84
                            
85
	                            <a>
86
	                                <xsl:attribute name="href">
87
	                                	<!-- construct the view link for Metacat API -->
88
	                                	<xsl:value-of select="$contextURL" />
89
	                            	  	<![CDATA[/metacat?action=read]]>
90
	                            	  	<![CDATA[&qformat=]]><xsl:value-of select="$qformat" />                            	  	
91
	                            	  	<![CDATA[&sessionid=]]><xsl:value-of select="$sessionid" />
92
	                            	  	<![CDATA[&docid=]]><xsl:value-of select="./str[@name='id']" />
93
	                            	  	<xsl:if test="$enableediting = 'true'">
94
											<![CDATA[&enableediting=]]><xsl:value-of select="$enableediting" />                                        
95
	                                    </xsl:if>
96
	                                </xsl:attribute>
97
	                                <xsl:text>
98
	                                    &#187;&#160;
99
	                                </xsl:text>
100
	                                <xsl:choose>
101
	                                    <xsl:when test="./str[@name='title']!=''">
102
	                                    	<xsl:value-of select="./str[@name='title']" />
103
	                                    	<xsl:if test="count(./str[@name='title/value']) != 0">
104
	                                    		<br/>
105
	                                     		<xsl:for-each select="./str[@name='title/value']" >
106
													<xsl:value-of select="." />
107
													<br/>
108
												</xsl:for-each>
109
										</xsl:if>
110
	                                    </xsl:when>
111
	                                    <xsl:otherwise>
112
	                                        <xsl:value-of select="./str[@name='citation/title']" />
113
	                                        <xsl:value-of select="./str[@name='software/title']" />
114
	                                        <xsl:value-of select="./str[@name='protocol/title']" />
115
	                                        <xsl:value-of select="./str[@name='idinfo/citation/citeinfo/title']" />
116
	                                    </xsl:otherwise>
117
	                                </xsl:choose>
118
	                            </a>
119
	                            <br />
120
	                            <br />
121
	                            <p>
122
	                                <pre>Identifier: <xsl:value-of select="./str[@name='id']" /></pre>
123
	                            </p>
124
                                    
125
                            </td>
126
                            
127
                            <td class="text_plain">
128
                                <xsl:for-each
129
                                    select="./str[@name='author']">
130
                                    <xsl:value-of select="." />
131
                                    <br />
132
                                </xsl:for-each>
133
                                <xsl:for-each
134
                                    select="./str[@name='investigator']">
135
                                    <xsl:value-of select="." />
136
                                    <br />
137
                                </xsl:for-each>
138
                                <xsl:for-each
139
                                    select="./str[@name='rightsHolder']">
140
                                    <xsl:value-of select="." />
141
                                    <br />
142
                                </xsl:for-each>
143
                                
144
                            </td>
145
                            <td class="text_plain">
146
                                <xsl:value-of
147
                                    select="./str[@name='contactOrganization']" />
148
                                <xsl:value-of
149
                                    select="./str[@name='originator']" />
150
                                
151
                            </td>
152
                            
153
                            <td class="text_plain">
154
                                <xsl:for-each
155
                                    select="./str[@name='keyword']">
156
                                    <xsl:value-of select="." />
157
                                    <br />
158
                                </xsl:for-each>
159
                                <xsl:for-each
160
                                    select="./str[@name='keyword/value']">
161
                                    <xsl:value-of select="." />
162
                                    <br />
163
                                </xsl:for-each>
164
                                <xsl:for-each
165
                                    select="./str[@name='keyConcept']">
166
                                    <xsl:value-of select="." />
167
                                    <br />
168
                                </xsl:for-each>
169
                                
170
                            </td>
171
                            
172
                            <xsl:if test="$enableediting = 'true'">
173
                                <td class="text_plain">
174
                                   	<!-- for cgi-based editing -->
175
                                    <form action="{$cgi-prefix}/register-dataset.cgi" method="POST">
176
                                        <input type="hidden" name="stage" value="modify" />
177
                                        <input type="hidden" name="cfg" value="{$qformat}" />
178
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
179
                                        <input type="hidden" name="docid">
180
                                            <xsl:attribute name="value">
181
                                                <xsl:value-of select="./str[@name='id']" />
182
                                            </xsl:attribute>
183
                                        </input>
184
                                        <center>
185
                                            <input type="SUBMIT" value=" Edit " name="Edit">
186
                                            </input>
187
                                        </center>
188
                                    </form>
189
                                    <form action="{$cgi-prefix}/register-dataset.cgi" method="POST">
190
                                        <input type="hidden" name="stage" value="delete" />
191
                                        <input type="hidden" name="cfg" value="{$qformat}" />
192
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
193
                                        <input type="hidden" name="docid">
194
                                            <xsl:attribute name="value">
195
                                                <xsl:value-of select="./str[@name='id']" />
196
                                            </xsl:attribute>
197
                                        </input>
198
                                        <center>
199
                                            <input type="SUBMIT" value="Delete" name="Delete">
200
                                            </input>
201
                                        </center>
202
                                    </form>
203
                                </td>
204
                            </xsl:if>
205
                            
206
                            <td width="10">&#160;</td>
207
                        </tr>
208
                        <tr>
209
                            <td width="10" class="searchresultslead"></td>
210
                            <td colspan="5" class="searchresultsdivider">&#160;</td>
211
                        </tr>
212
                        
213
                    </xsl:for-each>
214
                </table>
215
                
216
            </xsl:if>
217
        </body>
218
    </xsl:template>
219
    
220
</xsl:stylesheet>
(20-20/33)