Project

General

Profile

« Previous | Next » 

Revision 3679

Added by barteau almost 17 years ago

Turnkey installer modifications: replace cgi-prefix tokens with 'cgi-url' param.

View differences:

lib/style/common/resultset-table.xsl
29 29
	* into an HTML format suitable for rendering with modern web browsers.
30 30
-->
31 31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
32
	version="1.0">
33
									
32
                version="1.0">
33
  <xsl:param name="cgi-url" select='string("")'/>
34 34
    <xsl:template name="resultstable">
35
			<body leftmargin="0" topmargin="0" marginwidth="0"
36
				marginheight="0">
37

  
38
				<p class="emphasis">
39
					<xsl:number value="count(resultset/document)" />
40
					data packages found
41
				</p>
42

  
43
				<!-- This tests to see if there are returned documents,
35
        <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
36
            
37
            <p class="emphasis">
38
                <xsl:number value="count(resultset/document)" />
39
                data packages found
40
            </p>
41
            
42
            <!-- This tests to see if there are returned documents,
44 43
					if there are not then don't show the query results -->
45
				<xsl:if test="count(resultset/document) &gt; 0">
46

  
47
					<table class="resultstable" width="95%" align="center" border="0"
48
						cellpadding="0" cellspacing="0">
49
						<tr>
50
							<th class="tablehead_lcorner" align="right"
51
								valign="top">
52
								<img
53
									src="./skins/default/images/transparent1x1.gif"
54
									width="1" height="1" />
55
							</th>
56
							<th class="tablehead"
57
								style="text-align: left">
58
								Title
59
							</th>
60
							<th width="15%" class="tablehead"
61
								style="text-align: left">
62
								Contacts
63
							</th>
64
							<th width="15%" class="tablehead"
65
								style="text-align: left">
66
								Organization
67
							</th>
68
							<th width="15%" class="tablehead"
69
								style="text-align: left">
70
								Keywords
71
							</th>
72
							<xsl:if test="$enableediting = 'true'">
73
								<th width="10%" class="tablehead"
74
									style="text-align: middle">
75
									Actions
76
								</th>
77
							</xsl:if>
78
							<th class="tablehead_rcorner" align="right"
79
								valign="top">
80
								<img
81
									src="./skins/default/images/transparent1x1.gif"
82
									width="1" height="1" />
83
							</th>
84
						</tr>
85

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

  
103
								<td width="10">&#160;</td>
104
								<td class="text_plain">
105
									<form action="./metacat"
106
										method="POST">
107
										<xsl:attribute name="name"><xsl:value-of
108
												select="translate(./docid, '()-.', '____')" /></xsl:attribute>
109

  
110
										<input type="hidden"
111
											name="qformat" />
112
										<input type="hidden"
113
											name="sessionid" />
114
										<xsl:if
115
											test="$enableediting = 'true'">
116
											<input type="hidden"
117
												name="enableediting" value="{$enableediting}" />
118
										</xsl:if>
119
										<input type="hidden"
120
											name="action" value="read" />
121
										<input type="hidden"
122
											name="docid">
123
											<xsl:attribute
124
												name="value"><xsl:value-of
125
												select="./docid" /></xsl:attribute>
126
										</input>
127
										<xsl:for-each
128
											select="./relation">
129
											<input type="hidden"
130
												name="docid">
131
												<xsl:attribute
132
													name="value"><xsl:value-of
133
														select="./relationdoc" /></xsl:attribute>
134
											</input>
135
										</xsl:for-each>
136

  
137
										<a>
138
											<xsl:attribute
139
												name="href">javascript:submitform('read',document.<xsl:value-of
140
													select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
141
											<xsl:text>
142
												&#187;&#160;
143
											</xsl:text>
144
											<xsl:choose>
145
												<xsl:when test="./param[@name='dataset/title']!=''"><xsl:value-of
146
														select="./param[@name='dataset/title']" />
147
												</xsl:when>
148
												<xsl:otherwise>
149
													<xsl:value-of
150
														select="./param[@name='citation/title']" />
151
													<xsl:value-of
152
														select="./param[@name='software/title']" />
153
													<xsl:value-of
154
														select="./param[@name='protocol/title']" />
155
													<xsl:value-of
156
														select="./param[@name='idinfo/citation/citeinfo/title']" />
157
												</xsl:otherwise>
158
											</xsl:choose>
159
										</a>
160
										<br />
161
										<br />
162
										<p>
163
											<pre>ID: <xsl:value-of
164
													select="./docid" /></pre>
165
										</p>
166

  
167
									</form>
168
								</td>
169

  
170
								<td class="text_plain">
171
									<xsl:for-each
172
										select="./param[@name='originator/individualName/surName']">
173
										<xsl:value-of select="." />
174
										<br />
175
									</xsl:for-each>
176
									<xsl:for-each
177
										select="./param[@name='creator/individualName/surName']">
178
										<xsl:value-of select="." />
179
										<br />
180
									</xsl:for-each>
181
									<xsl:for-each
182
										select="./param[@name='idinfo/citation/citeinfo/origin']">
183
										<xsl:value-of select="." />
184
										<br />
185
									</xsl:for-each>
186

  
187
								</td>
188
								<td class="text_plain">
189
									<xsl:value-of
190
										select="./param[@name='originator/organizationName']" />
191
									<xsl:value-of
192
										select="./param[@name='creator/organizationName']" />
193

  
194
								</td>
195

  
196
								<td class="text_plain">
197
									<xsl:for-each
198
										select="./param[@name='keyword']">
199
										<xsl:value-of select="." />
200
										<br />
201
									</xsl:for-each>
202
									<xsl:for-each
203
										select="./param[@name='idinfo/keywords/theme/themekey']">
204
										<xsl:value-of select="." />
205
										<br />
206
									</xsl:for-each>
207

  
208
								</td>
209

  
210
								<xsl:if test="$enableediting = 'true'">
211
									<td class="text_plain">
212
										<form action="./metacat"
213
											method="POST">
214
											<input type="hidden"
215
												name="action" value="read" />
216
											<input type="hidden"
217
												name="qformat" value="{$qformat}" />
218
											<input type="hidden"
219
												name="sessionid" value="{$sessid}" />
220
											<input type="hidden"
221
												name="docid">
222
												<xsl:attribute
223
													name="value">
224
													<xsl:value-of
225
														select="./docid" />
226
												</xsl:attribute>
227
											</input>
228
											<center>
229
												<input type="SUBMIT"
230
													value=" View " name="View">
231
												</input>
232
											</center>
233
										</form>
234
										<form
235
											action="/cgi-bin/register-dataset.cgi" method="POST">
236
											<input type="hidden"
237
												name="stage" value="modify" />
238
											<input type="hidden"
239
												name="cfg" value="{$qformat}" />
240
											<input type="hidden"
241
												name="sessionid" value="{$sessid}" />
242
											<input type="hidden"
243
												name="docid">
244
												<xsl:attribute
245
													name="value">
246
													<xsl:value-of
247
														select="./docid" />
248
												</xsl:attribute>
249
											</input>
250
											<center>
251
												<input type="SUBMIT"
252
													value=" Edit " name="Edit">
253
												</input>
254
											</center>
255
										</form>
256
										<form
257
											action="/cgi-bin/register-dataset.cgi" method="POST">
258
											<input type="hidden"
259
												name="stage" value="delete" />
260
											<input type="hidden"
261
												name="cfg" value="{$qformat}" />
262
											<input type="hidden"
263
												name="sessionid" value="{$sessid}" />
264
											<input type="hidden"
265
												name="docid">
266
												<xsl:attribute
267
													name="value">
268
													<xsl:value-of
269
														select="./docid" />
270
												</xsl:attribute>
271
											</input>
272
											<center>
273
												<input type="SUBMIT"
274
													value="Delete" name="Delete">
275
												</input>
276
											</center>
277
										</form>
278
									</td>
279
								</xsl:if>
280
								<td width="10">&#160;</td>
281
							</tr>
282
							<tr>
283
                <td width="10" class="searchresultslead"></td>
284
								<td colspan="5" class="searchresultsdivider">&#160;</td>
285
							</tr>
286

  
287
						</xsl:for-each>
288
					</table>
289

  
290
				</xsl:if>
291
			</body>
44
            <xsl:if test="count(resultset/document) &gt; 0">
45
                
46
                <table class="resultstable" width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
47
                    <tr>
48
                        <th class="tablehead_lcorner" align="right" valign="top">
49
                            <img src="./style/skins/default/images/transparent1x1.gif" width="1" height="1" />
50
                        </th>
51
                        <th class="tablehead" style="text-align: left">
52
                            Title
53
                        </th>
54
                        <th width="15%" class="tablehead" style="text-align: left">
55
                            Contacts
56
                        </th>
57
                        <th width="15%" class="tablehead" style="text-align: left">
58
                            Organization
59
                        </th>
60
                        <th width="15%" class="tablehead" style="text-align: left">
61
                            Keywords
62
                        </th>
63
                        <xsl:if test="$enableediting = 'true'">
64
                            <th width="10%" class="tablehead" style="text-align: middle">
65
                                Actions
66
                            </th>
67
                        </xsl:if>
68
                        <th class="tablehead_rcorner" align="right" valign="top">
69
                            <img src="./style/skins/default/images/transparent1x1.gif" width="1" height="1" />
70
                        </th>
71
                    </tr>
72
                    
73
                    <xsl:for-each select="resultset/document">
74
                        <xsl:sort select="./param[@name='dataset/title']" />
75
                        <tr valign="top" class="subpanel">
76
                            <xsl:attribute name="class">
77
                                <xsl:choose>
78
                                    <xsl:when
79
                                        test="position() mod 2 = 1">
80
                                        rowodd
81
                                    </xsl:when>
82
                                    <xsl:when
83
                                        test="position() mod 2 = 0">
84
                                        roweven
85
                                    </xsl:when>
86
                                </xsl:choose>
87
                            </xsl:attribute>
88
                            
89
                            <td width="10">&#160;</td>
90
                            <td class="text_plain">
91
                                <form action="./metacat" method="POST">
92
                                    <xsl:attribute name="name"><xsl:value-of
93
                                        select="translate(./docid, '()-.', '____')" /></xsl:attribute>
94
                                    
95
                                    <input type="hidden" name="qformat" />
96
                                    <input type="hidden" name="sessionid" />
97
                                    <xsl:if
98
                                        test="$enableediting = 'true'">
99
                                        <input type="hidden" name="enableediting" value="{$enableediting}" />
100
                                    </xsl:if>
101
                                    <input type="hidden" name="action" value="read" />
102
                                    <input type="hidden" name="docid">
103
                                        <xsl:attribute
104
                                            name="value"><xsl:value-of
105
                                            select="./docid" /></xsl:attribute>
106
                                    </input>
107
                                    <xsl:for-each
108
                                        select="./relation">
109
                                        <input type="hidden" name="docid">
110
                                            <xsl:attribute
111
                                                name="value"><xsl:value-of
112
                                                select="./relationdoc" /></xsl:attribute>
113
                                        </input>
114
                                    </xsl:for-each>
115
                                    
116
                                    <a>
117
                                        <xsl:attribute
118
                                            name="href">javascript:submitform('read',document.<xsl:value-of
119
                                            select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
120
                                        <xsl:text>
121
                                            &#187;&#160;
122
                                        </xsl:text>
123
                                        <xsl:choose>
124
                                            <xsl:when test="./param[@name='dataset/title']!=''"><xsl:value-of select="./param[@name='dataset/title']" />
125
                                            </xsl:when>
126
                                            <xsl:otherwise>
127
                                                <xsl:value-of select="./param[@name='citation/title']" />
128
                                                <xsl:value-of select="./param[@name='software/title']" />
129
                                                <xsl:value-of select="./param[@name='protocol/title']" />
130
                                                <xsl:value-of select="./param[@name='idinfo/citation/citeinfo/title']" />
131
                                            </xsl:otherwise>
132
                                        </xsl:choose>
133
                                    </a>
134
                                    <br />
135
                                    <br />
136
                                    <p>
137
                                        <pre>ID: <xsl:value-of select="./docid" /></pre>
138
                                    </p>
139
                                    
140
                                </form>
141
                            </td>
142
                            
143
                            <td class="text_plain">
144
                                <xsl:for-each
145
                                    select="./param[@name='originator/individualName/surName']">
146
                                    <xsl:value-of select="." />
147
                                    <br />
148
                                </xsl:for-each>
149
                                <xsl:for-each
150
                                    select="./param[@name='creator/individualName/surName']">
151
                                    <xsl:value-of select="." />
152
                                    <br />
153
                                </xsl:for-each>
154
                                <xsl:for-each
155
                                    select="./param[@name='idinfo/citation/citeinfo/origin']">
156
                                    <xsl:value-of select="." />
157
                                    <br />
158
                                </xsl:for-each>
159
                                
160
                            </td>
161
                            <td class="text_plain">
162
                                <xsl:value-of
163
                                    select="./param[@name='originator/organizationName']" />
164
                                <xsl:value-of
165
                                    select="./param[@name='creator/organizationName']" />
166
                                
167
                            </td>
168
                            
169
                            <td class="text_plain">
170
                                <xsl:for-each
171
                                    select="./param[@name='keyword']">
172
                                    <xsl:value-of select="." />
173
                                    <br />
174
                                </xsl:for-each>
175
                                <xsl:for-each
176
                                    select="./param[@name='idinfo/keywords/theme/themekey']">
177
                                    <xsl:value-of select="." />
178
                                    <br />
179
                                </xsl:for-each>
180
                                
181
                            </td>
182
                            
183
                            <xsl:if test="$enableediting = 'true'">
184
                                <td class="text_plain">
185
                                    <form action="./metacat" method="POST">
186
                                        <input type="hidden" name="action" value="read" />
187
                                        <input type="hidden" name="qformat" value="{$qformat}" />
188
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
189
                                        <input type="hidden" name="docid">
190
                                            <xsl:attribute name="value">
191
                                                <xsl:value-of select="./docid" />
192
                                            </xsl:attribute>
193
                                        </input>
194
                                        <center>
195
                                            <input type="SUBMIT" value=" View " name="View">
196
                                            </input>
197
                                        </center>
198
                                    </form>
199
                                    <form action="{$cgi-url}/register-dataset.cgi" method="POST">
200
                                        <input type="hidden" name="stage" value="modify" />
201
                                        <input type="hidden" name="cfg" value="{$qformat}" />
202
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
203
                                        <input type="hidden" name="docid">
204
                                            <xsl:attribute name="value">
205
                                                <xsl:value-of select="./docid" />
206
                                            </xsl:attribute>
207
                                        </input>
208
                                        <center>
209
                                            <input type="SUBMIT" value=" Edit " name="Edit">
210
                                            </input>
211
                                        </center>
212
                                    </form>
213
                                    <form action="{$cgi-url}/register-dataset.cgi" method="POST">
214
                                        <input type="hidden" name="stage" value="delete" />
215
                                        <input type="hidden" name="cfg" value="{$qformat}" />
216
                                        <input type="hidden" name="sessionid" value="{$sessid}" />
217
                                        <input type="hidden" name="docid">
218
                                            <xsl:attribute name="value">
219
                                                <xsl:value-of select="./docid" />
220
                                            </xsl:attribute>
221
                                        </input>
222
                                        <center>
223
                                            <input type="SUBMIT" value="Delete" name="Delete">
224
                                            </input>
225
                                        </center>
226
                                    </form>
227
                                </td>
228
                            </xsl:if>
229
                            <td width="10">&#160;</td>
230
                        </tr>
231
                        <tr>
232
                            <td width="10" class="searchresultslead"></td>
233
                            <td colspan="5" class="searchresultsdivider">&#160;</td>
234
                        </tr>
235
                        
236
                    </xsl:for-each>
237
                </table>
238
                
239
            </xsl:if>
240
        </body>
292 241
    </xsl:template>
293

  
242
    
294 243
</xsl:stylesheet>

Also available in: Unified diff