Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
*  '$RCSfile$'
4
*      Authors: Matt Jones, CHad Berkley
5
*    Copyright: 2000 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: 2008-04-10 18:35:17 -0700 (Thu, 10 Apr 2008) $'
11
* '$Revision: 3792 $'
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" version="1.0">
32

    
33
  <xsl:output method="html"/>
34
  <xsl:param name="cgi-url" select='string("")'/>
35
  <xsl:param name="contextURL"/>
36
  <xsl:param name="sessid"/>
37
  <xsl:param name="qformat">default</xsl:param>
38
  <xsl:param name="enableediting">false</xsl:param>
39
  <xsl:template match="/">
40
   <html>
41
      <head>
42
        <link rel="stylesheet" type="text/css" 
43
              href="{$contextURL}/style/skins/{$qformat}/{$qformat}.css" />
44
        <script language="Javascript" type="text/JavaScript"
45
                src="{$contextURL}/style/skins/{$qformat}/{$qformat}.js" />
46
        <script language="Javascript" type="text/JavaScript"
47
                src="{$contextURL}/style/common/branding.js" />
48
        <script language="JavaScript">
49
          <![CDATA[
50
          function submitform(action,form_ref) {
51
              form_ref.action.value=action;
52
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
53
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
54
              form_ref.submit();
55
          }
56

    
57
          ]]>
58
        </script>
59
      </head>
60

    
61
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
62
      <script language="JavaScript">
63
          insertTemplateOpening("{$contextURL}");
64
          insertSearchBox("{$contextURL}");
65
      </script>
66
        <table width="100%" align="center" border="0" cellpadding="5" cellspacing="0">
67
           <tr>
68
             <td align="left"><br></br><p class="emphasis"><xsl:number value="count(resultset/document)" /> data packages found</p></td>
69
           </tr></table>
70
<!-- This tests to see if there are returned documents,
71
            if there are not then don't show the query results -->
72

    
73
      <xsl:if test="count(resultset/document) &gt; 0">
74

    
75
         <table width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
76
           <tr>
77
             <th class="tablehead_lcorner" align="right" valign="top"><img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" /></th>
78
             <th class="tablehead">Title</th>
79
             <th width="15%" class="tablehead" style="text-align: left">Contacts</th>
80
             <th width="15%" class="tablehead" style="text-align: left">Organization</th>
81
             <th width="15%" class="tablehead" style="text-align: left">Keywords</th>
82
             <xsl:if test="$enableediting = 'true'">
83
               <th width="10%" class="tablehead" style="text-align: middle">Actions</th>
84
             </xsl:if>
85
             <th class="tablehead_rcorner" align="right" valign="top"><img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" /></th>
86
           </tr>
87

    
88
         <xsl:for-each select="resultset/document">
89
           <xsl:sort select="./param[@name='dataset/title']"/>
90
           <tr valign="top" class="subpanel">
91
             <xsl:attribute name="class">
92
               <xsl:choose>
93
                 <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
94
                 <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
95
               </xsl:choose>
96
             </xsl:attribute>
97

    
98
             <td width="10">&#160;</td>
99
             <td class="text_plain">
100
               <form action="{$servletURL}" method="POST">
101
                 <xsl:attribute name="name">
102
                   <xsl:value-of select="translate(./docid, '()-.', '')" />
103
                 </xsl:attribute>
104

    
105
                 <input type="hidden" name="qformat" />
106
                 <input type="hidden" name="sessionid" />
107
                 <xsl:if test="$enableediting = 'true'">
108
	 	           <input type="hidden" name="enableediting" value="{$enableediting}"/>
109
                 </xsl:if>
110
                 <input type="hidden" name="action" value="read"/>
111
                 <input type="hidden" name="docid">
112
                   <xsl:attribute name="value">
113
                     <xsl:value-of select="./docid"/>
114
                   </xsl:attribute>
115
                 </input>
116
                 <xsl:for-each select="./relation">
117
                   <input type="hidden" name="docid">
118
                     <xsl:attribute name="value" >
119
                       <xsl:value-of select="./relationdoc" />
120
                     </xsl:attribute>
121
                   </input>
122
                 </xsl:for-each>
123

    
124
                 <a>
125
                   <xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '')"/>)</xsl:attribute>
126
                   <xsl:text>&#187;&#160;</xsl:text>
127
                   <xsl:choose>
128
                     <xsl:when test="./param[@name='dataset/title']!=''">
129
                        <xsl:value-of select="./param[@name='dataset/title']"/>
130
                     </xsl:when>
131
                     <xsl:otherwise>
132
                       <xsl:value-of select="./param[@name='citation/title']"/>
133
                       <xsl:value-of select="./param[@name='software/title']"/>
134
                       <xsl:value-of select="./param[@name='protocol/title']"/>
135
                     </xsl:otherwise>
136
                   </xsl:choose>
137
                 </a><br />
138
                 <br/>
139
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
140

    
141
                 <xsl:if test="starts-with(./doctype, 'eml://ecoinformatics.org/eml-2.0.0')">
142
                 <a>
143
                   <xsl:attribute name="href"><![CDATA[http://nebulous.nceas.ucsb.edu:8080/httprenderer/servlet/jalamafrontservlet?action=loadxmlinstance&url={$servletURL}%3Faction=read%26qformat=xml%26docid=]]><xsl:value-of select="./docid"/></xsl:attribute>
144
                   <xsl:attribute name="target">_blank</xsl:attribute>
145
                   <xsl:text>&#187;&#160;</xsl:text>
146
                   <b>Create data entry form</b>
147
                 </a><br/>
148
                 </xsl:if>
149

    
150
               </form>
151
             </td>
152

    
153
             <td class="text_plain">
154
               <xsl:for-each select="./param[@name='originator/individualName/surName']" >
155
                 <xsl:value-of select="." />
156
                 <br/>
157
                </xsl:for-each>
158
               <xsl:for-each select="./param[@name='creator/individualName/surName']" >
159
                 <xsl:value-of select="." />
160
                 <br/>
161
               </xsl:for-each>
162

    
163
             </td>
164
             <td class="text_plain">
165
                 <xsl:value-of select="./param[@name='originator/organizationName']" />
166
                 <xsl:value-of select="./param[@name='creator/organizationName']" />
167

    
168
             </td>
169

    
170
             <td class="text_plain">
171
               <xsl:for-each
172
                select="./param[@name='keyword']">
173
                 <xsl:value-of select="." />
174
                 <br/>
175
               </xsl:for-each>
176

    
177
             </td>
178
	   
179
             <xsl:if test="$enableediting = 'true'">
180
               <td class="text_plain">
181
	       <form action="{$servletURL}" method="POST">
182
	               <input type="hidden" name="action" value="read"/>
183
	 	       <input type="hidden" name="qformat" value="{$qformat}"/>
184
				<input type="hidden" name="sessionid"  value="{$sessid}"/>
185
                       <input type="hidden" name="docid">
186
                       <xsl:attribute name="value">
187
                          <xsl:value-of select="./docid"/>
188
                       </xsl:attribute>
189
                       </input>
190
                       <center>
191
		       <input type="SUBMIT"  value=" View " name="View">
192
 	               </input>
193
	               </center>
194
	             </form>
195
                 <form action="{$cgi-url}/register-dataset.cgi" 
196
                       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="./docid"/>
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-url}/register-dataset.cgi" 
211
                       method="POST">
212
	               <input type="hidden" name="stage" value="delete"/>	
213
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
214
					<input type="hidden" name="sessionid"  value="{$sessid}"/>
215
                   <input type="hidden" name="docid">
216
                     <xsl:attribute name="value">
217
                       <xsl:value-of select="./docid"/>
218
                     </xsl:attribute>
219
                   </input>
220
                   <center>
221
		             <input type="SUBMIT"  value="Delete" name="Delete">
222
 	                 </input>
223
	               </center>
224
	             </form>
225
	           </td>	  
226
             </xsl:if>
227
             <td width="10">&#160;</td>
228
             </tr>
229
             <tr class="searchresultsdivider"><td colspan="6">
230
             <img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" /></td></tr>
231

    
232
          </xsl:for-each>
233
          </table>
234

    
235
       </xsl:if>
236
      <script language="JavaScript">
237
          insertTemplateClosing("{$contextURL}");
238
      </script>
239
    </body>
240
    </html>
241
    </xsl:template>
242

    
243
</xsl:stylesheet>
(19-19/19)