• Publicity: Public Only All

request-procs.tcl

Request handling procs for the ArsDigita Templating System

Location:
packages/acs-templating/tcl/request-procs.tcl
Author:
Karl Goldstein <karlg@arsdigita.com>
CVS Identification:
$Id: request-procs.tcl,v 1.13 2024/09/11 06:15:48 gustafn Exp $

Procedures in this file

Detailed information

template::request (public)

 template::request command [ args... ]

Dispatch procedure for requests.

Parameters:
command (required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

template::request::create (public)

 template::request::create [ args... ]

Create the request data structure. Typically called at the beginning of the code for any page that accepts query parameters.

Options:
-params
A block of parameter declarations, separated by newlines. Equivalent to calling set_param for each parameter, but requiring slightly less typing.

Partial Call Graph (max 5 caller/called nodes):
%3 template::adp_level template::adp_level (public) template::form::create template::form::create (public) template::request::set_param template::request::set_param (public) template::request::create template::request::create template::request::create->template::adp_level template::request::create->template::form::create template::request::create->template::request::set_param

Testcases:
No testcase defined.

template::request::error (public)

 template::request::error [ args... ]

Manually report request error(s) by setting error messages and then calling is_valid to handle display. Useful for conditions not tied to a single query parameter. The arguments to the procedure may be any number of name-message combinations.

Partial Call Graph (max 5 caller/called nodes):
%3 template::adp_level template::adp_level (public) template::request::is_valid template::request::is_valid (public) template::request::error template::request::error template::request::error->template::adp_level template::request::error->template::request::is_valid

Testcases:
No testcase defined.

template::request::get_param (public)

 template::request::get_param name

Retrieves the value(s) of the specified parameter.

Parameters:
name (required)
The name of the parameter.
Returns:
The value of the specified parameter.

Partial Call Graph (max 5 caller/called nodes):
%3 template::adp_level template::adp_level (public) template::element::get_value template::element::get_value (public) template::element::get_values template::element::get_values (public) template::request::get_param template::request::get_param template::request::get_param->template::adp_level template::request::get_param->template::element::get_value template::request::get_param->template::element::get_values

Testcases:
No testcase defined.

template::request::is_valid (public)

 template::request::is_valid [ url ]

Checks for any param errors. If errors are found, sets the display template to the specified URL (a system-wide request error page by default).

Parameters:
url (optional)
The URL of the template to use to display error messages. The special value "self" may be used to indicate that the template for the requested page itself will handle reporting error conditions.
Returns:
1 if no error conditions exist, 0 otherwise.

Partial Call Graph (max 5 caller/called nodes):
%3 template::request::error template::request::error (public) template::request::is_valid template::request::is_valid template::request::error->template::request::is_valid template::adp_level template::adp_level (public) template::request::is_valid->template::adp_level template::resource_path template::resource_path (public) template::request::is_valid->template::resource_path template::set_file template::set_file (public) template::request::is_valid->template::set_file

Testcases:
No testcase defined.

template::request::set_param (public)

 template::request::set_param name [ args... ]

Declares a query parameter as part of the page request. Validates the values associated with the parameter, in the same fashion as for form elements.

Parameters:
name (required)
The name of the parameter to declare.
Options:
-name
The name of parameter in the query (may be different from the reference name).
-multiple
A flag indicating that multiple values may be specified for this parameter.
-datatype
The name of a datatype for the element values. Valid datatypes must have a validation procedure defined in the template::data::validate namespace.
-optional
A flag indicating that no value is required for this element. If a default value is specified, the default is used instead.
-validate
A list of custom validation blocks in the form { name { expression } { message } name { expression } { message } ...} where name is a unique identifier for the validation step, expression is a block to Tcl code that evaluates to 1 or 0, and message is to be displayed to the user when the validation step fails.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 template::request::create template::request::create (public) template::request::set_param template::request::set_param template::request::create->template::request::set_param template::adp_level template::adp_level (public) template::request::set_param->template::adp_level template::element::create template::element::create (public) template::request::set_param->template::element::create

Testcases:
No testcase defined.
[ show source ]