Added by Ard Schrijvers, last edited by Jasha Joachimsthal on Sep 21, 2007  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Location: nl.hippo.cocoon.generation.poll.PollListGenerator

The PollListGenerator returns an xml representation of all available polls. See here for an xml example.

Basically, the result consists of three parts:

  1. a general xml block, displaying info about the way your parameterized your the PollListGenerator and some general info about all polls available
  2. a paging block returning an xml presentation of paging
  3. all polls on the current requested page

A default xsl stylesheet transforming this xml into xhtml can be found here

Parameterizing your PollListGenerator

You can parameterize your PollListGenerator to return the polls in a specific manner, like: "give me all polls from offset = 3, maximum number of 200, paging is true, pagesize = 4, of poll-status must be active, the results is allowed to be cached for 200 seconds, and I want date format like dd-MM-yyyy".

The defaults are:

  1. dateformat = "yyyyMMddHHmmssSS" (sortable timestamp format, any format possible)
  2. poll-status = "any" (list all polls, possible {any|active|inactive})
  3. offset = 0 (start from {1,....})
  4. nresults = 1000 (the maximum value of results (for example, if 50, and and your pagesize = 5, you will have at most 10 pages))
  5. paging = false ( {true|false})
  6. crpage = 1 ( {1,....} )
  7. pagesize = 10 ( {1,....} )
  8. expires = 300 ( {1,....} )

A possible configuration would be:

<map:generate type="polls">
    <map:parameter name="dateformat" value="dd-MM-yyyy"/>
    <map:parameter name="expires" value="200"/>
    <map:parameter name="poll-status" value="active"/>
    <map:parameter name="offset" value="3"/>
    <map:parameter name="nresults" value="500"/>
    <map:parameter name="paging" value="true"/>
    <map:parameter name="crpage" value="{request-param:page}"/>
    <map:parameter name="pagesize" value="4"/>
 </map:generate>