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