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-17 10:41:33 -0700 (Fri, 17 May 2013) $'
11
	* '$Revision: 7705 $'
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:variable name="viewLink">
74
                        	<xsl:value-of select="$contextURL" /><![CDATA[/metacat?action=read]]><![CDATA[&qformat=]]><xsl:value-of select="$qformat" /><![CDATA[&sessionid=]]><xsl:value-of select="$sessid" /><![CDATA[&pid=]]><xsl:value-of select="./str[@name='id']" /><xsl:if test="$enableediting = 'true'"><![CDATA[&enableediting=]]><xsl:value-of select="$enableediting" /></xsl:if>
75
                        </xsl:variable>
76
                        
77
                        <tr valign="top" class="subpanel">
78
                            <xsl:attribute name="class">
79
                                <xsl:choose>
80
                                    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
81
                                    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
82
                                </xsl:choose>
83
                            </xsl:attribute>
84
                            
85
                            <td width="10">&#160;</td>
86
                            <td class="text_plain">
87
                            
88
	                            <a>
89
	                                <xsl:attribute name="href">
90
	                                	<xsl:value-of select="$viewLink" />
91
	                                </xsl:attribute>
92
	                                <xsl:text>
93
	                                    &#187;&#160;
94
	                                </xsl:text>
95
	                                
96
	                                <!-- <xsl:value-of select="./str[@name='title']" />-->
97
	                                <!-- <xsl:value-of select="./str[@name='author']" /> -->
98
	                                <xsl:for-each select="./arr[@name='authorLastName']" >
99
	                                	<xsl:value-of select="./str" />
100
	                                </xsl:for-each>.
101
	                                <xsl:value-of select="./str[@name='title']" />. <xsl:value-of select="./str[@name='pubDate']" />
102

    
103
	                            </a>
104
	                            <p>
105
	                                <b><xsl:value-of select="./str[@name='id']" /></b>
106
	                            </p>
107
	                            <p>
108
	                            	<xsl:value-of select="substring(./str[@name='abstract'], 0, 140)" />...
109
	                            	<a>
110
		                            	<xsl:attribute name="href">
111
		                                	<xsl:value-of select="$viewLink" />
112
		                                </xsl:attribute>
113
		                            	(more)
114
	                            	</a>
115
	                            </p>
116
	                            <br />
117
                            </td>
118
                            
119
                            <td class="text_plain">
120
                                <xsl:for-each
121
                                    select="./str[@name='author']">
122
                                    <xsl:value-of select="." />
123
                                    <br />
124
                                </xsl:for-each>
125
                                <xsl:for-each
126
                                    select="./str[@name='investigator']">
127
                                    <xsl:value-of select="." />
128
                                    <br />
129
                                </xsl:for-each>
130
                                <!--
131
                                <xsl:for-each
132
                                    select="./arr[@name='origin']">
133
                                    <xsl:value-of select="./str" />
134
                                    <br />
135
                                </xsl:for-each>
136
                                -->
137
                                <!--  
138
                                <xsl:for-each
139
                                    select="./str[@name='rightsHolder']">
140
                                    <xsl:value-of select="." />
141
                                    <br />
142
                                </xsl:for-each>
143
                                -->
144
                                
145
                            </td>
146
                            
147
                            <td class="text_plain">
148
                            	<xsl:for-each
149
                                    select="./arr[@name='contactOrganization']">
150
                                    <xsl:value-of select="./str" />
151
                                    <br />
152
                                </xsl:for-each>
153
                            </td>
154
                            
155
                            <td class="text_plain">
156
                                <xsl:for-each
157
                                    select="./arr[@name='keywords']">
158
                                    <xsl:value-of select="./str" />
159
                                    <br />
160
                                </xsl:for-each>
161
                                <xsl:for-each
162
                                    select="./arr[@name='keyConcept']">
163
                                    <xsl:value-of select="./str" />
164
                                    <br />
165
                                </xsl:for-each>
166
                            </td>
167
                            
168
                            <xsl:if test="$enableediting = 'true'">
169
                                <td class="text_plain">
170
                                   	<!-- for cgi-based editing -->
171
                                    <form action="{$cgi-prefix}/register-dataset.cgi" method="POST">
172
                                        <input type="hidden" name="stage" value="modify" />
173
                                        <input type="hidden" name="cfg" value="{$qformat}" />
174
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
175
                                        <input type="hidden" name="pid">
176
                                            <xsl:attribute name="value">
177
                                                <xsl:value-of select="./str[@name='id']" />
178
                                            </xsl:attribute>
179
                                        </input>
180
                                        <center>
181
                                            <input type="SUBMIT" value=" Edit " name="Edit">
182
                                            </input>
183
                                        </center>
184
                                    </form>
185
                                    <form action="{$cgi-prefix}/register-dataset.cgi" method="POST">
186
                                        <input type="hidden" name="stage" value="delete" />
187
                                        <input type="hidden" name="cfg" value="{$qformat}" />
188
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
189
                                        <input type="hidden" name="pid">
190
                                            <xsl:attribute name="value">
191
                                                <xsl:value-of select="./str[@name='id']" />
192
                                            </xsl:attribute>
193
                                        </input>
194
                                        <center>
195
                                            <input type="SUBMIT" value="Delete" name="Delete">
196
                                            </input>
197
                                        </center>
198
                                    </form>
199
                                </td>
200
                            </xsl:if>
201
                            
202
                            <td width="10">&#160;</td>
203
                        </tr>
204
                        <tr>
205
                            <td width="10" class="searchresultslead"></td>
206
                            <td colspan="5" class="searchresultsdivider">&#160;</td>
207
                        </tr>
208
                        
209
                    </xsl:for-each>
210
                </table>
211
                
212
            </xsl:if>
213
        </body>
214
    </xsl:template>
215
    
216
</xsl:stylesheet>
(21-21/34)