• Publicity: Public Only All

dimensional-procs.tcl

Definition of dimensional selection bar widget and helper functions.

Location:
packages/acs-templating/tcl/dimensional-procs.tcl
CVS Identification:
$Id: dimensional-procs.tcl,v 1.6 2024/10/16 09:21:22 gustafn Exp $

Procedures in this file

Detailed information

ad_dimensional (public)

 ad_dimensional [ -style style ] option_list [ url ] [ options_set ] \
    [ optionstype ]

Generate an option bar from an option_list, which has the structure:

    {
        {variable "Title" defaultvalue
            {
                {value "Label" {key sql-clause}}
                ...
            }
        }
        ...
    }
    
Here is an example of the option_list:
    set dimensional_list {
        {visited "Last Visit" 1w {
            {never "Never" {where "last_visit is null"}}
            {1m "Last Month" {where "last_visit + 30 > sysdate"}}
            {1w "Last Week" {where "last_visit + 7 > sysdate"}}
            {1d "Today" {where "last_visit > trunc(sysdate)"}}
        }}
        ..(more of the same)..
    }
    

Switches:
-style (optional)
name of the adp file (without extension)
Parameters:
option_list (required)
the structure with the option data provided
url (optional)
url target for select (if blank we set it to ad_conn url).
options_set (optional)
if not provided defaults to [ns_getform], for hilite of selected options.
optionstype (optional, defaults to "url")
only url is used now, was thinking about extending so we get radio buttons and a form since with a slow select updating one thing at a time would be stupid.
Returns:
HTML rendering

Partial Call Graph (max 5 caller/called nodes):
%3 test_ad_dimensional ad_dimensional (test acs-templating) ad_dimensional ad_dimensional test_ad_dimensional->ad_dimensional ad_conn ad_conn (public) ad_dimensional->ad_conn apm_package_id_from_key apm_package_id_from_key (public) ad_dimensional->apm_package_id_from_key export_vars export_vars (public) ad_dimensional->export_vars parameter::get parameter::get (public) ad_dimensional->parameter::get template::adp_include template::adp_include (public) ad_dimensional->template::adp_include packages/acs-admin/www/apm/index.tcl packages/acs-admin/ www/apm/index.tcl packages/acs-admin/www/apm/index.tcl->ad_dimensional packages/acs-admin/www/apm/packages-install.tcl packages/acs-admin/ www/apm/packages-install.tcl packages/acs-admin/www/apm/packages-install.tcl->ad_dimensional packages/acs-admin/www/apm/version-parameters.tcl packages/acs-admin/ www/apm/version-parameters.tcl packages/acs-admin/www/apm/version-parameters.tcl->ad_dimensional packages/acs-api-browser/www/package-view.tcl packages/acs-api-browser/ www/package-view.tcl packages/acs-api-browser/www/package-view.tcl->ad_dimensional packages/acs-api-browser/www/proc-browse.tcl packages/acs-api-browser/ www/proc-browse.tcl packages/acs-api-browser/www/proc-browse.tcl->ad_dimensional

Testcases:
ad_dimensional

ad_dimensional_sql (public)

 ad_dimensional_sql option_list [ what ] [ joiner ] [ options_set ]

Given what clause we are asking for and the joiner this returns the sql fragment

Parameters:
option_list (required)
the structure with the option data provided
what (optional, defaults to "where")
look for such keys in the option_list
joiner (optional, defaults to "and")
join string for combining multiple clauses
options_set (optional)
ns_set for reading variables
Returns:
SQL clause
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_ad_dimensional ad_dimensional (test acs-templating) ad_dimensional_sql ad_dimensional_sql test_ad_dimensional->ad_dimensional_sql packages/acs-admin/www/apm/index.tcl packages/acs-admin/ www/apm/index.tcl packages/acs-admin/www/apm/index.tcl->ad_dimensional_sql packages/acs-admin/www/apm/version-parameters.tcl packages/acs-admin/ www/apm/version-parameters.tcl packages/acs-admin/www/apm/version-parameters.tcl->ad_dimensional_sql packages/general-comments/www/admin/index.tcl packages/general-comments/ www/admin/index.tcl packages/general-comments/www/admin/index.tcl->ad_dimensional_sql packages/news/www/admin/index.tcl packages/news/ www/admin/index.tcl packages/news/www/admin/index.tcl->ad_dimensional_sql

Testcases:
ad_dimensional
[ show source ]