Project

General

Profile

Revision 3570

Added by berkley over 13 years ago

added paged resultset docs

View differences:

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
    &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
  
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