Project

General

Profile

1 2950 berkley
<?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$'
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" version="1.0">
32
33
  <xsl:output method="html"/>
34
  <xsl:param name="sessid"/>
35
  <xsl:param name="qformat">default</xsl:param>
36
  <xsl:param name="enableediting">false</xsl:param>
37
  <xsl:template match="/">
38
   <html>
39
      <head>
40
        <link rel="stylesheet" type="text/css"
41
              href="@style-skins-path@/{$qformat}/{$qformat}.css" />
42
        <script language="Javascript" type="text/JavaScript"
43
                src="@style-skins-path@/{$qformat}/{$qformat}.js" />
44
        <script language="Javascript" type="text/JavaScript"
45
                src="@style-common-path@/branding.js" />
46
        <script language="JavaScript">
47
          <![CDATA[
48
          function submitform(action,form_ref) {
49
              form_ref.action.value=action;
50
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
51
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
52
              form_ref.submit();
53
          }
54
55
          ]]>
56
        </script>
57
      </head>
58
59
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
60
      <script language="JavaScript">
61
          insertTemplateOpening();
62
          insertSearchBox();
63
      </script>
64
        <table width="100%" align="center" border="0" cellpadding="5" cellspacing="0">
65
           <tr>
66
             <td align="left"><br></br><p class="emphasis"><xsl:number value="count(resultset/document)" /> components found</p></td>
67
           </tr></table>
68
<!-- This tests to see if there are returned documents,
69
            if there are not then don't show the query results -->
70
71
      <xsl:if test="count(resultset/document) &gt; 0">
72
73
         <table width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
74
           <tr>
75
             <th class="tablehead_lcorner" align="right" valign="top"><img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></th>
76
             <th class="tablehead" style="text-align: left">Component Name</th>
77
             <!--<th width="15%" class="tablehead" style="text-align: left">Class</th>
78
             <th width="15%" class="tablehead" style="text-align: left">Organization</th>
79
             <th width="15%" class="tablehead" style="text-align: left">Keywords</th>
80
             <xsl:if test="$enableediting = 'true'">
81
               <th width="10%" class="tablehead" style="text-align: middle">Actions</th>
82
             </xsl:if>
83
             <th class="tablehead_rcorner" align="right" valign="top"><img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></th>
84
             -->
85
           </tr>
86
87
         <xsl:for-each select="resultset/document">
88
           <xsl:sort select="./param[@name='/entity/@name']"/>
89
           <tr valign="top" class="subpanel">
90
             <xsl:attribute name="class">
91
               <xsl:choose>
92
                 <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
93
                 <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
94
               </xsl:choose>
95
             </xsl:attribute>
96
97
             <td width="10">&#160;</td>
98
             <td class="text_plain">
99
               <form action="@servlet-path@" method="POST">
100
                 <xsl:attribute name="name">
101
                   <xsl:value-of select="translate(./docid, '()-.', '____')" />
102
                 </xsl:attribute>
103
104
                 <input type="hidden" name="qformat" />
105
                 <input type="hidden" name="sessionid" />
106
                 <xsl:if test="$enableediting = 'true'">
107
	 	           <input type="hidden" name="enableediting" value="{$enableediting}"/>
108
                 </xsl:if>
109
                 <input type="hidden" name="action" value="read"/>
110
                 <input type="hidden" name="docid">
111
                   <xsl:attribute name="value">
112
                     <xsl:value-of select="./docid"/>
113
                   </xsl:attribute>
114
                 </input>
115
                 <xsl:for-each select="./relation">
116
                   <input type="hidden" name="docid">
117
                     <xsl:attribute name="value" >
118
                       <xsl:value-of select="./relationdoc" />
119
                     </xsl:attribute>
120
                   </input>
121
                 </xsl:for-each>
122
123
                 <a>
124
                   <xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')"/>)</xsl:attribute>
125
                   <xsl:text>&#187;&#160;</xsl:text>
126
                   <xsl:choose>
127
                     <xsl:when test="./param[@name='entity/@name']!=''">
128
                        <xsl:value-of select="./param[@name='entity/@name']"/>
129
                     </xsl:when>
130
                   </xsl:choose>
131
                 </a><br />
132
                 <br/>
133
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
134
135
               </form>
136
             </td>
137
138
             <!--<td class="text_plain">
139
               <xsl:for-each select="./param[@name='entity/property[@name=semanticType]']" >
140
                 <xsl:value-of select="./param" />
141
                 <br/>
142
                </xsl:for-each>
143
             </td>-->
144
145
             <xsl:if test="$enableediting = 'true'">
146
               <td class="text_plain">
147
	       <form action="@servlet-path@" method="POST">
148
	               <input type="hidden" name="action" value="read"/>
149
	 	       <input type="hidden" name="qformat" value="{$qformat}"/>
150
				<input type="hidden" name="sessionid"  value="{$sessid}"/>
151
                       <input type="hidden" name="docid">
152
                       <xsl:attribute name="value">
153
                          <xsl:value-of select="./docid"/>
154
                       </xsl:attribute>
155
                       </input>
156
                       <center>
157
		       <input type="SUBMIT"  value=" View " name="View">
158
 	               </input>
159
	               </center>
160
	             </form>
161
                 <form action="@cgi-prefix@/register-dataset.cgi"
162
                       method="POST">
163
	               <input type="hidden" name="stage" value="modify"/>
164
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
165
					<input type="hidden" name="sessionid"  value="{$sessid}"/>
166
                   <input type="hidden" name="docid">
167
                     <xsl:attribute name="value">
168
                       <xsl:value-of select="./docid"/>
169
                     </xsl:attribute>
170
                   </input>
171
                   <center>
172
		             <input type="SUBMIT"  value=" Edit " name="Edit">
173
 	                 </input>
174
	               </center>
175
	             </form>
176
                 <form action="@cgi-prefix@/register-dataset.cgi"
177
                       method="POST">
178
	               <input type="hidden" name="stage" value="delete"/>
179
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
180
					<input type="hidden" name="sessionid"  value="{$sessid}"/>
181
                   <input type="hidden" name="docid">
182
                     <xsl:attribute name="value">
183
                       <xsl:value-of select="./docid"/>
184
                     </xsl:attribute>
185
                   </input>
186
                   <center>
187
		             <input type="SUBMIT"  value="Delete" name="Delete">
188
 	                 </input>
189
	               </center>
190
	             </form>
191
	           </td>
192
             </xsl:if>
193
             <td width="10">&#160;</td>
194
             </tr>
195
             <tr class="searchresultsdivider"><td colspan="6">
196
             <img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></td></tr>
197
198
          </xsl:for-each>
199
          </table>
200
201
       </xsl:if>
202
      <script language="JavaScript">
203
          insertTemplateClosing();
204
      </script>
205
    </body>
206
    </html>
207
    </xsl:template>
208
209
</xsl:stylesheet>