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:
- a general xml block, displaying info about the way your parameterized your the PollListGenerator and some general info about all polls available
- a paging block returning an xml presentation of paging
- 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:
- dateformat = "yyyyMMddHHmmssSS" (sortable timestamp format, any format possible)
- poll-status = "any" (list all polls, possible {any|active|inactive})
- offset = 0 (start from {1,....})
- nresults = 1000 (the maximum value of results (for example, if 50, and and your pagesize = 5, you will have at most 10 pages))
- paging = false ( {true|false})
- crpage = 1 ( {1,....} )
- pagesize = 10 ( {1,....} )
- 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>