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-04-16 14:51:27 -0700 (Mon, 16 Apr 2007) $'
11
* '$Revision: 3236 $'
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
          <xsl:text disable-output-escaping="yes">
54
          </xsl:text>
55
        </script>
56
        <script language="Javascript" type="text/JavaScript"
57
            src="@style-common-path@/branding.js">
58
          <xsl:text disable-output-escaping="yes">
59
          </xsl:text>
60
        </script>
61
        <style type="text/css">
62

    
63
a
64
{
65
    color: inherit;
66
    font-weight: inherit;
67
    font-size: inherit; 
68
    text-decoration: underline;
69
}
70

    
71

    
72
div.body
73
{
74
    margin-left: 2em;
75
    margin-right: 2em;
76
}
77

    
78
th.tablehead
79
{
80
    text-align: left;
81
}
82

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

    
89
th.tablehead:first-child,
90
td.text_plain:first-child
91
{
92
    padding: 0.375em 0.375em 0;
93
}
94

    
95
td.text_plain
96
{
97
    vertical-align: top;
98
}
99

    
100
tr.entry td
101
{
102
    border-bottom: 1px solid #ddd;
103
}
104

    
105
tr.entry + tr td
106
{
107
    border-bottom: 1px solid #066;
108
    padding-top: 0.375em;
109
    padding-bottom: 0.375em;
110
}
111

    
112
.dl
113
{
114
    background: #eeeeee url(@style-skins-path@/<xsl:value-of select="$qformat"/>/download2.png) 2px center no-repeat;
115
    border: 1px solid black;
116
    font-weight: bold;
117
    text-decoration: none;
118
    padding: 0.063em 0.375em 0.063em 20px;
119
    font-size: smaller;
120
}
121

    
122
        </style>
123
      </head>
124

    
125
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
126
        <script language="JavaScript">
127
insertTemplateOpening();
128
insertSearchBox();
129
        </script>
130

    
131
        <div class="body">
132
          <p class="emphasis">
133
            <xsl:number value="count(resultset/document)" /> components found
134
          </p>
135

    
136
          <!-- This tests to see if there are returned documents,
137
              if there are not then don't show the query results -->
138

    
139
          <xsl:if test="count(resultset/document) &gt; 0">
140
            <table cellspacing="0" cellpadding="0" style="width: 100%;">
141
              <tr>
142
                <th class="tablehead" style="width: 1px;"></th>
143
                <th class="tablehead" style="width: 1px;">Component</th>
144
                <th class="tablehead" style="width: 15em;">Author</th>
145
                <th class="tablehead">Version</th>
146
                <th class="tablehead"></th>
147
              </tr>
148

    
149
              <xsl:for-each select="resultset/document">
150
                <xsl:sort select="./param[@name='/entity/@name']"/>
151
                <xsl:variable name="sq">'</xsl:variable>
152
                <tr class="entry">
153

    
154
                  <td class="text_plain">
155
                    <xsl:value-of select="position()"/>.
156
                  </td>
157

    
158
                  <td class="text_plain" style="white-space: nowrap;">
159
                    <xsl:if test="./param[@name='entity/@name']!=''">
160
                      <b style="font-size: larger;">
161
                        <xsl:value-of select="./param[@name='entity/@name']"/>
162
                      </b>
163
                    </xsl:if>
164
                  </td>
165

    
166
                  <td class="text_plain">
167
                    <xsl:value-of select="./param[@name=concat('entity/property[@name=', $sq, 'documentation', $sq, ']/property[@name=', $sq, 'author', $sq, ']/configure')]"/>
168
                  </td>
169

    
170
                  <td class="text_plain">
171
                    <xsl:value-of select="./param[@name=concat('entity/property[@name=', $sq, 'documentation', $sq, ']/property[@name=', $sq, 'version', $sq, ']/configure')]"/>
172
                  </td>
173

    
174
                  <td class="text_plain">
175
                    <a class="dl">
176
                      <xsl:attribute name="href">
177
                        <xsl:text>http://@server@/authority/data?lsid=</xsl:text>
178
                        <xsl:value-of select="./param[@name=concat('entity/property[@name=', $sq, 'karId', $sq, ']/@value')]"/>
179
                      </xsl:attribute>
180

    
181
                      <xsl:text>Download</xsl:text>
182
                    </a>
183
                  </td>
184

    
185
                  <!--xsl:if test="$enableediting = 'true'">
186
                    <td class="text_plain">
187
                      <form action="@servlet-path@" method="get">
188
                        <input type="hidden" name="action" value="read"/>
189
                        <input type="hidden" name="qformat" value="{$qformat}"/>
190
                        <input type="hidden" name="sessionid"  value="{$sessid}"/>
191

    
192
                        <input type="hidden" name="docid">
193
                          <xsl:attribute name="value">
194
                            <xsl:value-of select="./docid"/>
195
                          </xsl:attribute>
196
                        </input>
197

    
198
                        <center>
199
                          <input type="SUBMIT"  value=" View " name="View"></input>
200
                        </center>
201
                      </form>
202

    
203
                      <form action="@cgi-prefix@/register-dataset.cgi" method="get">
204
                        <input type="hidden" name="stage" value="modify"/>
205
                        <input type="hidden" name="cfg" value="{$qformat}"/>
206
                        <input type="hidden" name="sessionid"  value="{$sessid}"/>
207

    
208
                        <input type="hidden" name="docid">
209
                          <xsl:attribute name="value">
210
                            <xsl:value-of select="./docid"/>
211
                          </xsl:attribute>
212
                        </input>
213

    
214
                        <center>
215
                          <input type="SUBMIT"  value=" Edit " name="Edit"></input>
216
                        </center>
217
                      </form>
218

    
219
                      <form action="@cgi-prefix@/register-dataset.cgi" method="get">
220
                        <input type="hidden" name="stage" value="delete"/>
221
                        <input type="hidden" name="cfg" value="{$qformat}"/>
222
                        <input type="hidden" name="sessionid"  value="{$sessid}"/>
223

    
224
                        <input type="hidden" name="docid">
225
                          <xsl:attribute name="value">
226
                            <xsl:value-of select="./docid"/>
227
                          </xsl:attribute>
228
                        </input>
229

    
230
                        <center>
231
                          <input type="SUBMIT"  value="Delete" name="Delete"></input>
232
                        </center>
233
                      </form>
234
                    </td>
235
                  </xsl:if-->
236
                </tr>
237

    
238
                <tr>
239
                  <td class="text_plain"></td>
240
                  <td class="text_plain" colspan="6">
241
                    <xsl:variable name="docClip" select="substring(./param[@name=concat('entity/property[@name=', $sq, 'documentation', $sq, ']/property[@name=', $sq, 'description', $sq, ']/configure')], 0, 200)"/>
242
                    <xsl:value-of select="$docClip"/>
243
                    <xsl:text> </xsl:text>
244
                    <xsl:value-of select="substring(./param[@name=concat('entity/property[@name=', $sq, 'documentation', $sq, ']/property[@name=', $sq, 'userLevelDocumentation', $sq, ']/configure')], 0, 200 - $docClip)"/>
245
                    <xsl:text>... [</xsl:text>
246

    
247
                    <a style="font-size: smaller;">
248
                      <xsl:attribute name="href">
249
                        <xsl:text>metacat?qformat=</xsl:text>
250
                        <xsl:value-of select="$qformat"/>
251
                        <xsl:text>&amp;sessionid=</xsl:text>
252
                        <xsl:value-of select="$sessid"/>
253
                        <xsl:text>&amp;action=read&amp;docid=</xsl:text>
254
                        <xsl:value-of select="./docid"/>
255

    
256
                        <xsl:if test="$enableediting = 'true'">
257
                          <xsl:text>&amp;enableediting=</xsl:text>
258
                          <xsl:value-of select="$enableediting"/>
259
                        </xsl:if>
260
                      </xsl:attribute>
261

    
262
                      <xsl:text>View Documentation</xsl:text>
263
                    </a>
264

    
265
                    <xsl:text>]</xsl:text>
266
                  </td>
267
                </tr>
268
              </xsl:for-each>
269
            </table>
270
          </xsl:if>
271
        </div>
272
        <script language="JavaScript">
273
insertTemplateClosing();
274
        </script>
275
      </body>
276
    </html>
277
  </xsl:template>
278
</xsl:stylesheet>
279

    
(10-10/11)