Project

General

Profile

1 3442 jones
<?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$'
10
	*     '$Date$'
11
	* '$Revision$'
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 3679 barteau
                version="1.0">
33
  <xsl:param name="cgi-url" select='string("")'/>
34 3442 jones
    <xsl:template name="resultstable">
35 3679 barteau
        <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
36
37
            <p class="emphasis">
38
                <xsl:number value="count(resultset/document)" />
39
                data packages found
40
            </p>
41
42
            <!-- This tests to see if there are returned documents,
43 3442 jones
					if there are not then don't show the query results -->
44 3679 barteau
            <xsl:if test="count(resultset/document) &gt; 0">
45
46
                <table class="resultstable" width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
47
                    <tr>
48
                        <th class="tablehead_lcorner" align="right" valign="top">
49
                            <img src="./style/skins/default/images/transparent1x1.gif" width="1" height="1" />
50
                        </th>
51
                        <th class="tablehead" style="text-align: left">
52
                            Title
53
                        </th>
54
                        <th width="15%" class="tablehead" style="text-align: left">
55
                            Contacts
56
                        </th>
57
                        <th width="15%" class="tablehead" style="text-align: left">
58
                            Organization
59
                        </th>
60
                        <th width="15%" class="tablehead" style="text-align: left">
61
                            Keywords
62
                        </th>
63
                        <xsl:if test="$enableediting = 'true'">
64
                            <th width="10%" class="tablehead" style="text-align: middle">
65
                                Actions
66
                            </th>
67
                        </xsl:if>
68
                        <th class="tablehead_rcorner" align="right" valign="top">
69
                            <img src="./style/skins/default/images/transparent1x1.gif" width="1" height="1" />
70
                        </th>
71
                    </tr>
72
73
                    <xsl:for-each select="resultset/document">
74
                        <xsl:sort select="./param[@name='dataset/title']" />
75
                        <tr valign="top" class="subpanel">
76
                            <xsl:attribute name="class">
77
                                <xsl:choose>
78
                                    <xsl:when
79
                                        test="position() mod 2 = 1">
80
                                        rowodd
81
                                    </xsl:when>
82
                                    <xsl:when
83
                                        test="position() mod 2 = 0">
84
                                        roweven
85
                                    </xsl:when>
86
                                </xsl:choose>
87
                            </xsl:attribute>
88
89
                            <td width="10">&#160;</td>
90
                            <td class="text_plain">
91
                                <form action="./metacat" method="POST">
92
                                    <xsl:attribute name="name"><xsl:value-of
93
                                        select="translate(./docid, '()-.', '____')" /></xsl:attribute>
94
95
                                    <input type="hidden" name="qformat" />
96
                                    <input type="hidden" name="sessionid" />
97
                                    <xsl:if
98
                                        test="$enableediting = 'true'">
99
                                        <input type="hidden" name="enableediting" value="{$enableediting}" />
100
                                    </xsl:if>
101
                                    <input type="hidden" name="action" value="read" />
102
                                    <input type="hidden" name="docid">
103
                                        <xsl:attribute
104
                                            name="value"><xsl:value-of
105
                                            select="./docid" /></xsl:attribute>
106
                                    </input>
107
                                    <xsl:for-each
108
                                        select="./relation">
109
                                        <input type="hidden" name="docid">
110
                                            <xsl:attribute
111
                                                name="value"><xsl:value-of
112
                                                select="./relationdoc" /></xsl:attribute>
113
                                        </input>
114
                                    </xsl:for-each>
115
116
                                    <a>
117
                                        <xsl:attribute
118
                                            name="href">javascript:submitform('read',document.<xsl:value-of
119
                                            select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
120
                                        <xsl:text>
121
                                            &#187;&#160;
122
                                        </xsl:text>
123
                                        <xsl:choose>
124
                                            <xsl:when test="./param[@name='dataset/title']!=''"><xsl:value-of select="./param[@name='dataset/title']" />
125
                                            </xsl:when>
126
                                            <xsl:otherwise>
127
                                                <xsl:value-of select="./param[@name='citation/title']" />
128
                                                <xsl:value-of select="./param[@name='software/title']" />
129
                                                <xsl:value-of select="./param[@name='protocol/title']" />
130
                                                <xsl:value-of select="./param[@name='idinfo/citation/citeinfo/title']" />
131
                                            </xsl:otherwise>
132
                                        </xsl:choose>
133
                                    </a>
134
                                    <br />
135
                                    <br />
136
                                    <p>
137
                                        <pre>ID: <xsl:value-of select="./docid" /></pre>
138
                                    </p>
139
140
                                </form>
141
                            </td>
142
143
                            <td class="text_plain">
144
                                <xsl:for-each
145
                                    select="./param[@name='originator/individualName/surName']">
146
                                    <xsl:value-of select="." />
147
                                    <br />
148
                                </xsl:for-each>
149
                                <xsl:for-each
150
                                    select="./param[@name='creator/individualName/surName']">
151
                                    <xsl:value-of select="." />
152
                                    <br />
153
                                </xsl:for-each>
154
                                <xsl:for-each
155
                                    select="./param[@name='idinfo/citation/citeinfo/origin']">
156
                                    <xsl:value-of select="." />
157
                                    <br />
158
                                </xsl:for-each>
159
160
                            </td>
161
                            <td class="text_plain">
162
                                <xsl:value-of
163
                                    select="./param[@name='originator/organizationName']" />
164
                                <xsl:value-of
165
                                    select="./param[@name='creator/organizationName']" />
166
167
                            </td>
168
169
                            <td class="text_plain">
170
                                <xsl:for-each
171
                                    select="./param[@name='keyword']">
172
                                    <xsl:value-of select="." />
173
                                    <br />
174
                                </xsl:for-each>
175
                                <xsl:for-each
176
                                    select="./param[@name='idinfo/keywords/theme/themekey']">
177
                                    <xsl:value-of select="." />
178
                                    <br />
179
                                </xsl:for-each>
180
181
                            </td>
182
183
                            <xsl:if test="$enableediting = 'true'">
184
                                <td class="text_plain">
185
                                    <form action="./metacat" method="POST">
186
                                        <input type="hidden" name="action" value="read" />
187
                                        <input type="hidden" name="qformat" value="{$qformat}" />
188
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
189
                                        <input type="hidden" name="docid">
190
                                            <xsl:attribute name="value">
191
                                                <xsl:value-of select="./docid" />
192
                                            </xsl:attribute>
193
                                        </input>
194
                                        <center>
195
                                            <input type="SUBMIT" value=" View " name="View">
196
                                            </input>
197
                                        </center>
198
                                    </form>
199
                                    <form action="{$cgi-url}/register-dataset.cgi" method="POST">
200
                                        <input type="hidden" name="stage" value="modify" />
201
                                        <input type="hidden" name="cfg" value="{$qformat}" />
202
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
203
                                        <input type="hidden" name="docid">
204
                                            <xsl:attribute name="value">
205
                                                <xsl:value-of select="./docid" />
206
                                            </xsl:attribute>
207
                                        </input>
208
                                        <center>
209
                                            <input type="SUBMIT" value=" Edit " name="Edit">
210
                                            </input>
211
                                        </center>
212
                                    </form>
213
                                    <form action="{$cgi-url}/register-dataset.cgi" method="POST">
214
                                        <input type="hidden" name="stage" value="delete" />
215
                                        <input type="hidden" name="cfg" value="{$qformat}" />
216
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
217
                                        <input type="hidden" name="docid">
218
                                            <xsl:attribute name="value">
219
                                                <xsl:value-of select="./docid" />
220
                                            </xsl:attribute>
221
                                        </input>
222
                                        <center>
223
                                            <input type="SUBMIT" value="Delete" name="Delete">
224
                                            </input>
225
                                        </center>
226
                                    </form>
227
                                </td>
228
                            </xsl:if>
229
                            <td width="10">&#160;</td>
230
                        </tr>
231
                        <tr>
232
                            <td width="10" class="searchresultslead"></td>
233
                            <td colspan="5" class="searchresultsdivider">&#160;</td>
234
                        </tr>
235
236
                    </xsl:for-each>
237
                </table>
238
239
            </xsl:if>
240
        </body>
241 3442 jones
    </xsl:template>
242 3679 barteau
243 3442 jones
</xsl:stylesheet>