Project

General

Profile

1 3569 berkley
<!--
2
  * replication.html
3
  *
4
  *      Authors: 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
  *      Created: 2001 January 23
9
  *      Version:
10
  *    File Info: '$ '
11
  *
12
  *
13
-->
14
<HTML>
15
<HEAD>
16
<TITLE>Metacat</TITLE>
17
<link rel="stylesheet" type="text/css" href="@docrooturl@default.css">
18
</HEAD>
19
<BODY>
20
  <table width="100%">
21
    <tr>
22
      <td class="tablehead" colspan="2"><p class="label">Paged Query Returns</p></td>
23
      <td class="tablehead" colspan="2" align="right">
24
          <a href="./spatial_option.html">Back</a> | <a href="./metacattour.html">Home</a> |
25
          <a href="./unimplem.html">Next</a>
26
      </td>
27
    </tr>
28
  </table>
29
30 3570 berkley
  <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
    &lt;resultset&gt;
45
      &lt;pagestart&gt;1&lt;/pagestart&gt;
46
      &lt;pagesize&gt;10&lt;/pagesize&gt;
47
      &lt;nextpage&gt;2&lt;/nextpage&gt;
48
      &lt;previouspage&gt;0&lt;/previouspage&gt;
49
      &lt;query&gt;
50
      ...
51
      &lt;/query&gt;
52
      &lt;document&gt;...&lt;/document&gt;
53
      &lt;document&gt;...&lt;/document&gt;
54
    &lt;/resultset&gt;
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
   &lt;a href="metacat?action=query&amp;operator=INTERSECT&amp;enableediting=false&amp;anyfield=actor&amp;qformat=kepler&amp;pagestart=0&amp;pagesize=10"&gt;Previous Page&lt;/a&gt;
68
   &lt;a href="metacat?action=query&amp;operator=INTERSECT&amp;enableediting=false&amp;anyfield=actor&amp;qformat=kepler&amp;pagestart=2&amp;pagesize=10"&gt;Next Page&lt;/a&gt;
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
82 3569 berkley
  <br>
83
  <a href="./spatial_option.html">Back</a> | <a href="./metacattour.html">Home</a> |
84
  <a href="./unimplem.html">Next</a>
85
86
87
</BODY>
88
</HTML>