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 13:52:49 -0700 (Wed, 01 May 2013) $'
11
	* '$Revision: 7645 $'
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="resultstable">
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
                                <form action="{$contextURL}/metacat" method="POST">
85
                                    <xsl:attribute name="name"><xsl:value-of
86
                                        select="translate(./str[@name='id'], '()-.', '____')" /></xsl:attribute>
87
                                    
88
                                    <input type="hidden" name="qformat" />
89
                                    <input type="hidden" name="sessionid" />
90
                                    <xsl:if
91
                                        test="$enableediting = 'true'">
92
                                        <input type="hidden" name="enableediting" value="{$enableediting}" />
93
                                    </xsl:if>
94
                                    <input type="hidden" name="action" value="read" />
95
                                    <input type="hidden" name="docid">
96
                                        <xsl:attribute
97
                                            name="value"><xsl:value-of
98
                                            select="./str[@name='id']" /></xsl:attribute>
99
                                    </input>
100
                                    <a>
101
                                        <xsl:attribute
102
                                            name="href">javascript:submitform('read',document.<xsl:value-of
103
                                            select="translate(./str[@name='id'], '()-.', '____')" />)</xsl:attribute>
104
                                        <xsl:text>
105
                                            &#187;&#160;
106
                                        </xsl:text>
107
                                        <xsl:choose>
108
                                            <xsl:when test="./str[@name='title']!=''">
109
                                            	<xsl:value-of select="./str[@name='title']" />
110
                                            	<xsl:if test="count(./str[@name='title/value']) != 0">
111
                                            		<br/>
112
	                                            	<xsl:for-each select="./str[@name='title/value']" >
113
														<xsl:value-of select="." />
114
														<br/>
115
	                                            	</xsl:for-each>
116
	                                            </xsl:if>
117
                                            </xsl:when>
118
                                            <xsl:otherwise>
119
                                                <xsl:value-of select="./str[@name='citation/title']" />
120
                                                <xsl:value-of select="./str[@name='software/title']" />
121
                                                <xsl:value-of select="./str[@name='protocol/title']" />
122
                                                <xsl:value-of select="./str[@name='idinfo/citation/citeinfo/title']" />
123
                                            </xsl:otherwise>
124
                                        </xsl:choose>
125
                                    </a>
126
                                    <br />
127
                                    <br />
128
                                    <p>
129
                                        <pre>ID: <xsl:value-of select="./str[@name='id']" /></pre>
130
                                    </p>
131
                                    
132
                                </form>
133
                            </td>
134
                            
135
                            <td class="text_plain">
136
                                <xsl:for-each
137
                                    select="./str[@name='author']">
138
                                    <xsl:value-of select="." />
139
                                    <br />
140
                                </xsl:for-each>
141
                                <xsl:for-each
142
                                    select="./str[@name='investigator']">
143
                                    <xsl:value-of select="." />
144
                                    <br />
145
                                </xsl:for-each>
146
                                <xsl:for-each
147
                                    select="./str[@name='rightsHolder']">
148
                                    <xsl:value-of select="." />
149
                                    <br />
150
                                </xsl:for-each>
151
                                
152
                            </td>
153
                            <td class="text_plain">
154
                                <xsl:value-of
155
                                    select="./str[@name='contactOrganization']" />
156
                                <xsl:value-of
157
                                    select="./str[@name='originator']" />
158
                                
159
                            </td>
160
                            
161
                            <td class="text_plain">
162
                                <xsl:for-each
163
                                    select="./str[@name='keyword']">
164
                                    <xsl:value-of select="." />
165
                                    <br />
166
                                </xsl:for-each>
167
                                <xsl:for-each
168
                                    select="./str[@name='keyword/value']">
169
                                    <xsl:value-of select="." />
170
                                    <br />
171
                                </xsl:for-each>
172
                                <xsl:for-each
173
                                    select="./str[@name='keyConcept']">
174
                                    <xsl:value-of select="." />
175
                                    <br />
176
                                </xsl:for-each>
177
                                
178
                            </td>
179
                            
180
                            <xsl:if test="$enableediting = 'true'">
181
                                <td class="text_plain">
182
                                    <form action="{$contextURL}/metacat" method="POST">
183
                                        <input type="hidden" name="action" value="read" />
184
                                        <input type="hidden" name="qformat" value="{$qformat}" />
185
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
186
                                        <input type="hidden" name="docid">
187
                                            <xsl:attribute name="value">
188
                                                <xsl:value-of select="./str[@name='id']" />
189
                                            </xsl:attribute>
190
                                        </input>
191
                                        <center>
192
                                            <input type="SUBMIT" value=" View " name="View">
193
                                            </input>
194
                                        </center>
195
                                    </form>
196
                                    <form action="{$cgi-prefix}/register-dataset.cgi" method="POST">
197
                                        <input type="hidden" name="stage" value="modify" />
198
                                        <input type="hidden" name="cfg" value="{$qformat}" />
199
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
200
                                        <input type="hidden" name="docid">
201
                                            <xsl:attribute name="value">
202
                                                <xsl:value-of select="./str[@name='id']" />
203
                                            </xsl:attribute>
204
                                        </input>
205
                                        <center>
206
                                            <input type="SUBMIT" value=" Edit " name="Edit">
207
                                            </input>
208
                                        </center>
209
                                    </form>
210
                                    <form action="{$cgi-prefix}/register-dataset.cgi" method="POST">
211
                                        <input type="hidden" name="stage" value="delete" />
212
                                        <input type="hidden" name="cfg" value="{$qformat}" />
213
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
214
                                        <input type="hidden" name="docid">
215
                                            <xsl:attribute name="value">
216
                                                <xsl:value-of select="./str[@name='id']" />
217
                                            </xsl:attribute>
218
                                        </input>
219
                                        <center>
220
                                            <input type="SUBMIT" value="Delete" name="Delete">
221
                                            </input>
222
                                        </center>
223
                                    </form>
224
                                </td>
225
                            </xsl:if>
226
                            <td width="10">&#160;</td>
227
                        </tr>
228
                        <tr>
229
                            <td width="10" class="searchresultslead"></td>
230
                            <td colspan="5" class="searchresultsdivider">&#160;</td>
231
                        </tr>
232
                        
233
                    </xsl:for-each>
234
                </table>
235
                
236
            </xsl:if>
237
        </body>
238
    </xsl:template>
239
    
240
</xsl:stylesheet>
(20-20/33)