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: sledge $'
10
*     '$Date: 2007-02-12 08:46:27 -0800 (Mon, 12 Feb 2007) $'
11
* '$Revision: 3178 $'
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
32
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
33
    xmlns="http://www.w3.org/1999/xhtml"
34
    version="1.0">
35

    
36
  <xsl:output method="xml" encoding="utf-8"
37
              doctype-public="-//W3C//DTD XHTML 1.1//EN"
38
              doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
39
              indent="yes" />
40

    
41
  <xsl:param name="sessid"/>
42
  <xsl:param name="qformat">default</xsl:param>
43
  <xsl:param name="enableediting">false</xsl:param>
44

    
45
  <xsl:template match="/">
46
    <html xml:lang="en-US">
47
      <head>
48
        <title>Components Search Results</title>
49
        <link rel="stylesheet" type="text/css"
50
            href="@style-skins-path@/{$qformat}/{$qformat}.css" />
51
        <script language="Javascript" type="text/JavaScript"
52
            src="@style-skins-path@/{$qformat}/{$qformat}.js" />
53
        <script language="Javascript" type="text/JavaScript"
54
            src="@style-common-path@/branding.js" />
55
        <style type="text/css">
56

    
57
a
58
{
59
    color: inherit;
60
    font-weight: inherit;
61
    font-size: inherit; 
62
    text-decoration: underline;
63
}
64

    
65

    
66
div.body
67
{
68
    margin-left: 2em;
69
    margin-right: 2em;
70
}
71

    
72
th.tablehead
73
{
74
    text-align: left;
75
}
76

    
77
th.tablehead,
78
td.text_plain
79
{
80
    padding: 0 0.75em;
81
}
82

    
83
th.tablehead:first-child,
84
td.text_plain:first-child
85
{
86
    padding: 0 0.375em;
87
}
88

    
89
td.text_plain
90
{
91
    vertical-align: top;
92
}
93

    
94
tr.entry td
95
{
96
    border-bottom: 1px solid #ddd;
97
}
98

    
99
tr.entry + tr + tr td
100
{
101
    border-bottom: 1px solid #066;
102
    padding-top: 0.375em;
103
    padding-bottom: 0.375em;
104
}
105

    
106
tr.entry + tr + tr td a
107
{
108
    background: #eeeeee url(download.png) 2px center no-repeat;
109
    border: 1px solid black;
110
    font-weight: bold;
111
    text-decoration: none;
112
    padding: 0.063em 0.375em 0.063em 20px;
113
}
114

    
115
        </style>
116
      </head>
117

    
118
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
119
        <script language="JavaScript">
120
insertTemplateOpening();
121
insertSearchBox();
122
        </script>
123

    
124
        <div class="body">
125
          <p class="emphasis">
126
            <xsl:number value="count(resultset/document)" /> components found
127
          </p>
128

    
129
          <!-- This tests to see if there are returned documents,
130
              if there are not then don't show the query results -->
131

    
132
          <xsl:if test="count(resultset/document) &gt; 0">
133
            <table cellspacing="0" cellpadding="0" style="width: 100%;">
134
              <tr>
135
                <th class="tablehead" style="width: 1px;"></th>
136
                <th class="tablehead" style="width: 1px;">Component</th>
137
                <th class="tablehead" style="width: 15em;">Author</th>
138
                <th class="tablehead">Version</th>
139
              </tr>
140

    
141
              <xsl:for-each select="resultset/document">
142
                <xsl:sort select="./param[@name='/entity/@name']"/>
143
                <tr class="entry">
144

    
145
                  <td class="text_plain">
146
                    <xsl:value-of select="position()"/>.
147
                  </td>
148

    
149
                  <td class="text_plain" style="white-space: nowrap;">
150
                    <xsl:if test="./param[@name='entity/@name']!=''">
151
                      <b>
152
                        <xsl:value-of select="./param[@name='entity/@name']"/>
153
                      </b>
154
                    </xsl:if>
155
                  </td>
156

    
157
                  <td class="text_plain">
158
                    <xsl:value-of select="./param[@name='entity/property/@name'][text()='documentation']/following-sibling::param[@name='entity/property/property/@name'][text()='author']/following-sibling::param[@name='entity/property/property/configure'][position()=1]"/>
159
                  </td>
160

    
161
                  <td class="text_plain">
162
                    <xsl:value-of select="./param[@name='entity/property/@name'][text()='documentation']/following-sibling::param[@name='entity/property/property/@name'][text()='version']/following-sibling::param[@name='entity/property/property/configure'][position()=1]"/>
163
                  </td>
164

    
165
                  <xsl:if test="$enableediting = 'true'">
166
                    <td class="text_plain">
167
                      <form action="@servlet-path@" method="get">
168
                        <input type="hidden" name="action" value="read"/>
169
                        <input type="hidden" name="qformat" value="{$qformat}"/>
170
                        <input type="hidden" name="sessionid"  value="{$sessid}"/>
171

    
172
                        <input type="hidden" name="docid">
173
                          <xsl:attribute name="value">
174
                            <xsl:value-of select="./docid"/>
175
                          </xsl:attribute>
176
                        </input>
177

    
178
                        <center>
179
                          <input type="SUBMIT"  value=" View " name="View"></input>
180
                        </center>
181
                      </form>
182

    
183
                      <form action="@cgi-prefix@/register-dataset.cgi" method="get">
184
                        <input type="hidden" name="stage" value="modify"/>
185
                        <input type="hidden" name="cfg" value="{$qformat}"/>
186
                        <input type="hidden" name="sessionid"  value="{$sessid}"/>
187

    
188
                        <input type="hidden" name="docid">
189
                          <xsl:attribute name="value">
190
                            <xsl:value-of select="./docid"/>
191
                          </xsl:attribute>
192
                        </input>
193

    
194
                        <center>
195
                          <input type="SUBMIT"  value=" Edit " name="Edit"></input>
196
                        </center>
197
                      </form>
198

    
199
                      <form action="@cgi-prefix@/register-dataset.cgi" method="get">
200
                        <input type="hidden" name="stage" value="delete"/>
201
                        <input type="hidden" name="cfg" value="{$qformat}"/>
202
                        <input type="hidden" name="sessionid"  value="{$sessid}"/>
203

    
204
                        <input type="hidden" name="docid">
205
                          <xsl:attribute name="value">
206
                            <xsl:value-of select="./docid"/>
207
                          </xsl:attribute>
208
                        </input>
209

    
210
                        <center>
211
                          <input type="SUBMIT"  value="Delete" name="Delete"></input>
212
                        </center>
213
                      </form>
214
                    </td>
215
                  </xsl:if>
216
                </tr>
217

    
218
                <tr>
219
                  <td class="text_plain"></td>
220
                  <td class="text_plain" colspan="6">
221
                    First X words of the actor's description...
222
                    <xsl:text> [</xsl:text>
223

    
224
                    <a>
225
                      <xsl:attribute name="href">
226
                        <xsl:text>metacat?qformat=</xsl:text>
227
                        <xsl:value-of select="$qformat"/>
228
                        <xsl:text>&amp;sessionid=</xsl:text>
229
                        <xsl:value-of select="$sessid"/>
230
                        <xsl:text>&amp;action=read&amp;docid=</xsl:text>
231
                        <xsl:value-of select="./docid"/>
232

    
233
                        <xsl:if test="$enableediting = 'true'">
234
                          <xsl:text>&amp;enableediting=</xsl:text>
235
                          <xsl:value-of select="$enableediting"/>
236
                        </xsl:if>
237
                      </xsl:attribute>
238

    
239
                      <xsl:text>more</xsl:text>
240
                    </a>
241

    
242
                    <xsl:text>]</xsl:text>
243
                  </td>
244
                </tr>
245

    
246
                <tr>
247
                  <td class="text_plain"></td>
248
                  <td class="text_plain" colspan="6">
249
                    <a>
250
                      <xsl:attribute name="href">
251
                        <xsl:text>http://@server@/authority/data?lsid=</xsl:text>
252
                        <xsl:value-of select="./param[@name='entity/property/@name'][text()='karId']/following-sibling::param[@name='entity/property/@value'][position()=1]"/>
253
                      </xsl:attribute>
254

    
255
                      <xsl:text>Download</xsl:text>
256
                    </a>
257
                  </td>
258
                </tr>
259
              </xsl:for-each>
260
            </table>
261
          </xsl:if>
262
        </div>
263
        <script language="JavaScript">
264
insertTemplateClosing();
265
        </script>
266
      </body>
267
    </html>
268
  </xsl:template>
269
</xsl:stylesheet>
270

    
(10-10/11)