Project

General

Profile

metacat / docs / user / pagedreturn.html @ 4506

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 4506 2008-11-04 19:34:57Z 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="./sitemaps.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
    &lt;resultset&gt;
43
      &lt;pagestart&gt;1&lt;/pagestart&gt;
44
      &lt;pagesize&gt;10&lt;/pagesize&gt;
45
      &lt;nextpage&gt;2&lt;/nextpage&gt;
46
      &lt;previouspage&gt;0&lt;/previouspage&gt;
47
      &lt;query&gt;
48
      ...
49
      &lt;/query&gt;
50
      &lt;document&gt;...&lt;/document&gt;
51
      &lt;document&gt;...&lt;/document&gt;
52
    &lt;/resultset&gt;
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
   &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;
66
   &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;
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="./sitemaps.html">Next</a>
83
  
84

    
85
</BODY>
86
</HTML>