template::paginator::create (public)

 template::paginator::create statement_name name query [ args... ]

Defined in packages/acs-templating/tcl/paginator-procs.tcl

Creates a paginator object. Performs an initial query to get the complete list of rows in the query result and caches the result for subsequent queries.

Parameters:
statement_name - A query name. This is overwritten by the contents of the "query" parameter if it is not the empty string.
name - A unique name corresponding to the query being paginated, including specific values in the where clause and sorting specified in the order by clause.
query - The actual query that returns the IDs of all rows in the results. Bind variables may be used.
Options:
-timeout
The lifetime of a query result in seconds, after which the query must be refreshed (if not reset).
-pagesize
The number of rows to display on a single page.
-groupsize
The number of pages in a group, for UI purposes. This is useful for result sets which span several pages. For example, if you have 1000 results at 10 results per page, that will leave you with 100 pages and you may not want to display 1-100 in the UI. In this case, setting a groupsize of 10 will allow you to display pages 1-10, then 11-20, and so on. The default groupsize is 10.
-contextual
Boolean indicating whether the pagination interface presented to the user will provide some other contextual clue in addition or instead of page number, such as the first few letters of a title or date. By default, the second column in the result set returned by query will be used as the context.
-page_offset
The first page in a set of page groups to be created by this paginator. This can be used to slice very large sets of page groups into paginators, cached separately (be sure to name each page group's paginator uniquely if you're caching pagination query results). Very useful since filling the cache for an entire set of page groups can be very costly, and since often only the first few pages of items (for instance, forum threads) are visited through the pagination interface. The list builder provides an example of how to do this.

Partial Call Graph (max 5 caller/called nodes):
%3 ad_return_top_of_page ad_return_top_of_page (public) ad_script_abort ad_script_abort (public) security::csp::nonce security::csp::nonce (public) template::adp_level template::adp_level (public) template::cache template::cache (public) template::paginator::create template::paginator::create template::paginator::create->ad_return_top_of_page template::paginator::create->ad_script_abort template::paginator::create->security::csp::nonce template::paginator::create->template::adp_level template::paginator::create->template::cache

Testcases:
No testcase defined.
[ show source ]
Show another procedure: