Revision 3570
Added by berkley about 17 years ago
docs/user/pagedreturn.html | ||
---|---|---|
26 | 26 |
</td> |
27 | 27 |
</tr> |
28 | 28 |
</table> |
29 |
<h2>Paged Query Returns</h2> |
|
30 | 29 |
|
30 |
<p>Metacat allows results sets to be broken up into "pages" to aid in the loading |
|
31 |
of large result sets and to make the result sets more readable to users. This is |
|
32 |
facilitated by the addition of two variables to the parameter list. Pagesize |
|
33 |
indicates how many results should be returned for a given page. Pagestart |
|
34 |
indicates which page you are currently viewing. These parameters can be |
|
35 |
passed to Metacat when a query is submited. </p> |
|
36 |
|
|
37 |
<p>When a paged query is performed, the resultset of that query contains |
|
38 |
four extra fields. Pagestart and pagesize are contained in the xml resultset |
|
39 |
along with nextpage and previouspage. This allows the xslt tranformation to |
|
40 |
include navigational links in the rendered resultset. Here's an example |
|
41 |
xml resultset.</p> |
|
42 |
|
|
43 |
<pre> |
|
44 |
<resultset> |
|
45 |
<pagestart>1</pagestart> |
|
46 |
<pagesize>10</pagesize> |
|
47 |
<nextpage>2</nextpage> |
|
48 |
<previouspage>0</previouspage> |
|
49 |
<query> |
|
50 |
... |
|
51 |
</query> |
|
52 |
<document>...</document> |
|
53 |
<document>...</document> |
|
54 |
</resultset> |
|
55 |
</pre> |
|
56 |
|
|
57 |
<p>In the case of the resultset, pagestart will always indicate the page you |
|
58 |
are currently viewing.</p> |
|
59 |
|
|
60 |
<p>Here's an example of the rendered result.</p> |
|
61 |
|
|
62 |
<img src="images/pagedquery.jpg"/> |
|
63 |
|
|
64 |
<p>The links to the previous and next pages look like this.</p> |
|
65 |
|
|
66 |
<pre> |
|
67 |
<a href="metacat?action=query&operator=INTERSECT&enableediting=false&anyfield=actor&qformat=kepler&pagestart=0&pagesize=10">Previous Page</a> |
|
68 |
<a href="metacat?action=query&operator=INTERSECT&enableediting=false&anyfield=actor&qformat=kepler&pagestart=2&pagesize=10">Next Page</a> |
|
69 |
</pre> |
|
70 |
|
|
71 |
<p>The important bits of these links are the incremented pagestart parameters. |
|
72 |
The rendered page is on page 1 so the previous page is 0 and the next |
|
73 |
page is 2. By sequencing through the pages, the user can see the |
|
74 |
entire resultset. </p> |
|
75 |
|
|
76 |
<p>The Kepler skin in lib/style/skins/kepler is a good example of how to |
|
77 |
render the resultset with paged query returns. The XSLT uses the four extra |
|
78 |
fields in the resultset to render the next and previous links. This could |
|
79 |
also be used within a non-web application. |
|
80 |
</p> |
|
81 |
|
|
31 | 82 |
<br> |
32 | 83 |
<a href="./spatial_option.html">Back</a> | <a href="./metacattour.html">Home</a> | |
33 | 84 |
<a href="./unimplem.html">Next</a> |
Also available in: Unified diff
added paged resultset docs