1
|
<!--
|
2
|
* Authors: Chad Berkley
|
3
|
* Copyright: 2000 Regents of the University of California and the
|
4
|
* National Center for Ecological Analysis and Synthesis
|
5
|
* For Details: http://www.nceas.ucsb.edu/
|
6
|
* Created: 2007 November 5
|
7
|
* Version:
|
8
|
* File Info: '$Id: pagedreturn.html 3780 2008-04-02 23:28:31Z daigle $'
|
9
|
*
|
10
|
*
|
11
|
-->
|
12
|
<HTML>
|
13
|
<HEAD>
|
14
|
<TITLE>Metacat</TITLE>
|
15
|
<link rel="stylesheet" type="text/css" href="./default.css">
|
16
|
</HEAD>
|
17
|
<BODY>
|
18
|
<table width="100%">
|
19
|
<tr>
|
20
|
<td class="tablehead" colspan="2"><p class="label">Paged Query Returns</p></td>
|
21
|
<td class="tablehead" colspan="2" align="right">
|
22
|
<a href="./spatial_option.html">Back</a> | <a href="./metacattour.html">Home</a> |
|
23
|
<a href="./unimplem.html">Next</a>
|
24
|
</td>
|
25
|
</tr>
|
26
|
</table>
|
27
|
|
28
|
<p>Metacat allows results sets to be broken up into "pages" to aid in the loading
|
29
|
of large result sets and to make the result sets more readable to users. This is
|
30
|
facilitated by the addition of two variables to the parameter list. Pagesize
|
31
|
indicates how many results should be returned for a given page. Pagestart
|
32
|
indicates which page you are currently viewing. These parameters can be
|
33
|
passed to Metacat when a query is submited. </p>
|
34
|
|
35
|
<p>When a paged query is performed, the resultset of that query contains
|
36
|
four extra fields. Pagestart and pagesize are contained in the xml resultset
|
37
|
along with nextpage and previouspage. This allows the xslt tranformation to
|
38
|
include navigational links in the rendered resultset. Here's an example
|
39
|
xml resultset.</p>
|
40
|
|
41
|
<pre>
|
42
|
<resultset>
|
43
|
<pagestart>1</pagestart>
|
44
|
<pagesize>10</pagesize>
|
45
|
<nextpage>2</nextpage>
|
46
|
<previouspage>0</previouspage>
|
47
|
<query>
|
48
|
...
|
49
|
</query>
|
50
|
<document>...</document>
|
51
|
<document>...</document>
|
52
|
</resultset>
|
53
|
</pre>
|
54
|
|
55
|
<p>In the case of the resultset, pagestart will always indicate the page you
|
56
|
are currently viewing.</p>
|
57
|
|
58
|
<p>Here's an example of the rendered result.</p>
|
59
|
|
60
|
<img src="images/pagedquery.jpg"/>
|
61
|
|
62
|
<p>The links to the previous and next pages look like this.</p>
|
63
|
|
64
|
<pre>
|
65
|
<a href="metacat?action=query&operator=INTERSECT&enableediting=false&anyfield=actor&qformat=kepler&pagestart=0&pagesize=10">Previous Page</a>
|
66
|
<a href="metacat?action=query&operator=INTERSECT&enableediting=false&anyfield=actor&qformat=kepler&pagestart=2&pagesize=10">Next Page</a>
|
67
|
</pre>
|
68
|
|
69
|
<p>The important bits of these links are the incremented pagestart parameters.
|
70
|
The rendered page is on page 1 so the previous page is 0 and the next
|
71
|
page is 2. By sequencing through the pages, the user can see the
|
72
|
entire resultset. </p>
|
73
|
|
74
|
<p>The Kepler skin in lib/style/skins/kepler is a good example of how to
|
75
|
render the resultset with paged query returns. The XSLT uses the four extra
|
76
|
fields in the resultset to render the next and previous links. This could
|
77
|
also be used within a non-web application.
|
78
|
</p>
|
79
|
|
80
|
<br>
|
81
|
<a href="./spatial_option.html">Back</a> | <a href="./metacattour.html">Home</a> |
|
82
|
<a href="./unimplem.html">Next</a>
|
83
|
|
84
|
|
85
|
</BODY>
|
86
|
</HTML>
|