template::paginator::get_query (public)

 template::paginator::get_query name id_column page

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

Returns a query with the data for the rows on the current page.

Parameters:
name (required)
The reference to the paginator object.
id_column (required)
The name of the ID column in the display query (required to order rows properly).
page (required)

Partial Call Graph (max 5 caller/called nodes):
%3 ns_dbquotelist ns_dbquotelist template::paginator::get_row template::paginator::get_row (public) template::paginator::get_row_ids template::paginator::get_row_ids (public) template::util::list_to_lookup template::util::list_to_lookup (public) template::paginator::get_query template::paginator::get_query template::paginator::get_query->ns_dbquotelist template::paginator::get_query->template::paginator::get_row template::paginator::get_query->template::paginator::get_row_ids template::paginator::get_query->template::util::list_to_lookup

Testcases:
No testcase defined.
Source code:
    set ids [get_row_ids $name $page]

    if { $ids ne "" } {
        # calculate the base row number for the page
        upvar 2 __page_firstrow firstrow
        set firstrow [get_row $name $page]

        # build a hash of row order to order the rows on the page
        upvar 2 __page_order row_order
        template::util::list_to_lookup $ids row_order

        set query "CURRENT_PAGE_SET"

        set in_list [::ns_dbquotelist $ids]
        if { ! [regsub CURRENT_PAGE_SET $query $in_list query] } {
            error "Token CURRENT_PAGE_SET not found."
        }

        if {$in_list eq ""} {
            uplevel 2 "set $datasource:rowcount 0"
            return
        }

        # Return the query with CURRENT_PAGE_SET slugged
        return $query
    } else {
        return "null"
    }
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-templating/tcl/paginator-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: