deprecated-procs.tcl

Provides a collection of deprecated procs to provide backward compatibility for sites who have not yet removed calls to the deprecated functions. This file should contain only long-time deprecated functions, which are going to be removed unless there is a good reason not to do. Note that FRESHLY DEPRECATED PROCS SHOULD NOT BE moved here, otherwise, site using "WithDeprecatedCode" set to 0 will break immediately. One should give people at least one release time to fix invocation of deprecated code. In order to skip loading of deprecated code, use the following snippet in your config file ns_section ns/server/${server}/acs ns_param WithDeprecatedCode 0

Location:
packages/acs-tcl/tcl/deprecated-procs.tcl
CVS Identification:
$Id: deprecated-procs.tcl,v 1.34 2024/11/26 08:18:55 gustafn Exp $

Procedures in this file

Detailed information

DoubleApos (public, deprecated)

 DoubleApos string
Deprecated. Invoking this procedure generates a warning.

When the value "O'Malley" is inserted int an SQL database, the single quote can cause troubles in SQL, one has to insert 'O''Malley' instead. Deprecated: in general, one should be using bind variables rather than calling DoubleApos.

Parameters:
string (required)
Returns:
string with single quotes converted to a pair of single quotes
See Also:

Testcases:
No testcase defined.

NsSettoTclString (public, deprecated)

 NsSettoTclString set_id
Deprecated. Invoking this procedure generates a warning.

returns a plain text version of the passed ns_set id

Parameters:
set_id (required)
See Also:
  • util::ns_set_to_tcl_string DEPRECATED: does not comply with OpenACS naming convention

Testcases:
No testcase defined.

ReturnHeaders (public, deprecated)

 ReturnHeaders [ args... ]
Deprecated. Invoking this procedure generates a warning.

We use this when we want to send out just the headers and then do incremental writes with ns_write. This way the user doesn't have to wait for streamed output (useful when doing bulk uploads, installs, etc.). It returns status 200 and all headers including any added to outputheaders. DEPRECATED: does not comply with OpenACS naming convention.

See Also:

Testcases:
No testcase defined.

_http_read (private, deprecated)

 _http_read timeout sock length
Deprecated. Invoking this procedure generates a warning.

deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3

Parameters:
timeout (required)
sock (required)
length (required)

Testcases:
No testcase defined.

_ns_dateentrywidget (private, deprecated)

 _ns_dateentrywidget column
Deprecated. Invoking this procedure generates a warning.

deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3

Parameters:
column (required)

Testcases:
No testcase defined.

_ns_timeentrywidget (private, deprecated)

 _ns_timeentrywidget column
Deprecated. Invoking this procedure generates a warning.

deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3

Parameters:
column (required)

Testcases:
No testcase defined.

_ns_updatebutton (private, deprecated)

 _ns_updatebutton table var
Deprecated. Invoking this procedure generates a warning.

deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3

Parameters:
table (required)
var (required)

Testcases:
No testcase defined.

ad_admin_context_bar (public, deprecated)

 ad_admin_context_bar [ args... ]
Deprecated. Invoking this procedure generates a warning.

Returns a Yahoo-style hierarchical navbar. Use ad_context_bar instead.

Returns:
an HTML fragment generated by ad_context_bar
See Also:

Testcases:
No testcase defined.

ad_admin_footer (public, deprecated)

 ad_admin_footer
Deprecated. Invoking this procedure generates a warning.

Signs pages with ad_admin_owner (usually a programmer who can fix bugs) rather than the signatory of the user pages

See Also:
  • Documentation on the site master template for the proper way to standardize page footers

Testcases:
No testcase defined.

ad_admin_header (public, deprecated)

 ad_admin_header [ -focus focus ] page_title
Deprecated. Invoking this procedure generates a warning.

Switches:
-focus (optional)
Parameters:
page_title (required)
See Also:
  • Documentation on the site master template for the proper way to standardize page headers

Testcases:
No testcase defined.

ad_admin_owner (public, deprecated)

 ad_admin_owner
Deprecated. Invoking this procedure generates a warning.

Returns:
E-mail address of the Administrator of this site.
See Also:

Testcases:
No testcase defined.

ad_admin_present_user (public, deprecated)

 ad_admin_present_user user_id name
Deprecated. Invoking this procedure generates a warning.

This function is an alias to acs_community_member_admin_link and receives identical parameters, but the former finds out the name of the user if a blank is passed. That's why it's marked as deprecated.

Parameters:
user_id (required)
name (required)
Returns:
the HTML link of the community member page of a particular admin user.
Authors:
Unknown
Roberto Mello
See Also:

Testcases:
No testcase defined.

ad_approval_system_inuse_p (public, deprecated)

 ad_approval_system_inuse_p
Deprecated. Invoking this procedure generates a warning.

Returns 1 if the system is configured to use and approval system. DEPRECATED: this proc's utility was probably transitional and is as of 2022-09-07 not used anywhere in the codebase. One can always query the parameters directly in case.

See Also:

Testcases:
No testcase defined.

ad_block_sql_urls (public, deprecated)

 ad_block_sql_urls conn args why
Deprecated. Invoking this procedure generates a warning.

A filter that detect attempts to smuggle in SQL code through form data variables. The use of bind variables and ad_page_contract input validation to prevent SQL smuggling is preferred.

Parameters:
conn (required)
args (required)
why (required)
See Also:

Testcases:
No testcase defined.

ad_call_proc_if_exists (public, deprecated)

 ad_call_proc_if_exists proc [ args... ]
Deprecated. Invoking this procedure generates a warning.

Calls a procedure with particular arguments, only if the procedure is defined. Deprecated: very simple tcl commands idioms can replace this proc

Parameters:
proc (required)
See Also:
  • "info commands" based idioms

Testcases:
No testcase defined.

ad_context_bar_ws (public, deprecated)

 ad_context_bar_ws [ args... ]
Deprecated. Invoking this procedure generates a warning.

Returns a Yahoo-style hierarchical navbar. Use ad_context_bar instead.

Returns:
an HTML fragment generated by ad_context_bar_html
See Also:

Testcases:
No testcase defined.

ad_context_bar_ws_or_index (public, deprecated)

 ad_context_bar_ws_or_index [ args... ]
Deprecated. Invoking this procedure generates a warning.

Returns a Yahoo-style hierarchical navbar. Use ad_context_bar instead.

Returns:
an HTML fragment generated by ad_context_bar
See Also:

Testcases:
No testcase defined.

ad_custom_form (public, deprecated)

 ad_custom_form return_url item_group item
Deprecated. Invoking this procedure generates a warning.

sets up the head of a form to feed to /tools/form-custom.tcl Deprecated: there are many better ways now to create forms in OpenACS

Parameters:
return_url (required)
item_group (required)
item (required)
See Also:

Testcases:
No testcase defined.

ad_custom_list (public, deprecated)

 ad_custom_list user_id item_group item_set item_type target_url \
    custom_url [ new_string ]
Deprecated. Invoking this procedure generates a warning.

Generates the HTML fragment for choosing, editing and creating user customized data This proc was ported from the old ACS, but the data model was not.

Parameters:
user_id (required)
item_group (required)
item_set (required)
item_type (required)
target_url (required)
custom_url (required)
new_string (optional, defaults to "new view")
See Also:

Testcases:
No testcase defined.

ad_custom_load (public, deprecated)

 ad_custom_load user_id item_group item item_type
Deprecated. Invoking this procedure generates a warning.

load a persisted user customization as saved by for example table-custom.tcl. This proc was ported from the old ACS, but the data model was not.

Parameters:
user_id (required)
item_group (required)
item (required)
item_type (required)
See Also:

Testcases:
No testcase defined.

ad_custom_page_defaults (public, deprecated)

 ad_custom_page_defaults defaults
Deprecated. Invoking this procedure generates a warning.

set the page defaults. If the form is empty do a returnredirect with the defaults set

Parameters:
defaults (required)
See Also:

Testcases:
No testcase defined.

ad_dbclick_check_dml (public, deprecated)

 ad_dbclick_check_dml [ -bind bind ] statement_name table_name \
    id_column_name generated_id return_url insert_dml
Deprecated. Invoking this procedure generates a warning.

This proc is used for pages using double click protection. table_name is table_name for which we are checking whether the double click occurred. id_column_name is the name of the id table column. generated_id is the generated id, which is supposed to have been generated on the previous page. return_url is url to which this procedure will return redirect in the case of successful insertion in the database. insert_sql is the sql insert statement. if data is ok this procedure will insert data into the database in a double click safe manner and will returnredirect to the page specified by return_url. if database insert fails, this procedure will return a sensible error message to the user.

Switches:
-bind (optional)
Parameters:
statement_name (required)
table_name (required)
id_column_name (required)
generated_id (required)
return_url (required)
insert_dml (required)
See Also:
  • xotcl-request-monitor provides a double-click protection feature that does not rely on the database and is transparent to the developer.

Testcases:
No testcase defined.

ad_dimensional_set_variables (public, deprecated)

 ad_dimensional_set_variables option_list [ options_set ]
Deprecated. Invoking this procedure generates a warning.

set the variables defined in option_list from the form provided (form defaults to ad_conn form) or to default value from option_list if not in the form data.

You only really need to call this if you need the variables (for example to pick which select statement and table to actually use)

Parameters:
option_list (required)
options_set (optional)
See Also:
  • ns_set

Testcases:
No testcase defined.

ad_dimensional_settings (public, deprecated)

 ad_dimensional_settings define current
Deprecated. Invoking this procedure generates a warning.

given a dimensional slider definition this routine returns a form to set the defaults for the given slider. NB...this does not close either the table or the form...

Parameters:
define (required)
current (required)
See Also:

Testcases:
No testcase defined.

ad_export_vars (public, deprecated)

 ad_export_vars [ -form ] [ -exclude exclude ] [ -override override ] \
    [ include ]
Deprecated. Invoking this procedure generates a warning.

Note This proc is deprecated in favor of export_vars. They're very similar, but export_vars have a number of advantages:

  • It can sign variables (the :sign flag)
  • It can export variables as a :multiple.
  • It can export arrays with on-the-fly values (not pulled from the environment)
It doesn't have the foo(bar) syntax to pull a single value from an array, however, but you can do the same by saying export_vars {{foo.bar $foo(bar)}}.

Helps export variables from one page to the next, either as URL variables or hidden form variables. It'll reach into arrays and grab either all values or individual values out and export them in a way that will be consistent with the ad_page_contract :array flag.

Example:

doc_body_append [export_vars { msg_id user(email) { order_by date } }]
will export the variable msg_id and the value email from the array user, and it will export a variable named order_by with the value date.

The args is a list of variable names that you want exported. You can name

  • a scalar variable, foo,
  • the name of an array, bar, in which case all the values in that array will get exported, or
  • an individual value in an array, bar(baz)
  • a list in [array get] format { name value name value ..}. The value will get substituted normally, so you can put a computation in there.

A more involved example:

set my_vars { msg_id user(email) order_by }
    doc_body_append [export_vars -override { order_by $new_order_by } $my_vars]

Switches:
-form (optional, boolean)
set this parameter if you want the variables exported as hidden form variables, as opposed to URL variables, which is the default.
-exclude (optional)
takes a list of names of variables you don't want exported, even though they might be listed in the args. The names take the same form as in the args list.
-override (optional)
takes a list of the same format as args, which will get exported no matter what you have excluded.
Parameters:
include (optional)
Author:
Lars Pind <lars@pinds.com>
Created:
21 July 2000
See Also:

Testcases:
No testcase defined.

ad_footer (public, deprecated)

 ad_footer [ signatory ] [ suppress_curriculum_bar_p ]
Deprecated. Invoking this procedure generates a warning.

Writes a horizontal rule, a mailto address box (ad_system_owner if not specified as an argument), and then closes the BODY and HTML tags

Parameters:
signatory (optional)
suppress_curriculum_bar_p (optional, defaults to "0")
See Also:
  • Documentation on the site master template for the proper way to standardize page footers

Testcases:
No testcase defined.

ad_get_user_id (public, deprecated)

 ad_get_user_id
Deprecated. Invoking this procedure generates a warning.

Gets the user ID. 0 indicates the user is not logged in. Deprecated since user_id now provided via ad_conn user_id

See Also:

Testcases:
No testcase defined.

ad_get_user_info (public, deprecated)

 ad_get_user_info
Deprecated. Invoking this procedure generates a warning.

Sets first_names, last_name, email in the environment of its caller.

Returns:
ad_return_error if user_id can't be found.
Authors:
Unknown
Roberto Mello
See Also:

Testcases:
No testcase defined.

ad_header (public, deprecated)

 ad_header [ -focus focus ] page_title \
    [ extra_stuff_for_document_head ]
Deprecated. Invoking this procedure generates a warning.

writes HEAD, TITLE, and BODY tags to start off pages in a consistent fashion

Switches:
-focus (optional)
Parameters:
page_title (required)
extra_stuff_for_document_head (optional)
See Also:
  • Documentation on the site master template for the proper way to standardize page headers

Testcases:
No testcase defined.

ad_header_with_extra_stuff (public, deprecated)

 ad_header_with_extra_stuff [ -focus focus ] page_title \
    [ extra_stuff_for_document_head ] [ pre_content_html ]
Deprecated. Invoking this procedure generates a warning.

This is the version of the ad_header that accepts extra stuff for the document head and pre-page content html

Switches:
-focus (optional)
Parameters:
page_title (required)
extra_stuff_for_document_head (optional)
pre_content_html (optional)
See Also:
  • Documentation on the site master template for the proper way to standardize page headers

Testcases:
No testcase defined.

ad_httpget (public, deprecated)

 ad_httpget [ -url url ] [ -headers headers ] [ -timeout timeout ] \
    [ -depth depth ]
Deprecated. Invoking this procedure generates a warning.

Just like ns_httpget, but first headers is an ns_set of headers to send during the fetch. ad_httpget also makes use of Conditional GETs (if called with a Last-Modified header). Returns the data in array get form with array elements page status modified.

Switches:
-url (optional)
-headers (optional)
-timeout (optional, defaults to "30")
-depth (optional, defaults to "0")
See Also:

Testcases:
No testcase defined.

ad_maybe_redirect_for_registration (public, deprecated)

 ad_maybe_redirect_for_registration
Deprecated. Invoking this procedure generates a warning.

Checks to see if a user is logged in. If not, redirects to [subsite]/register/index to require the user to register. When registration is complete, the user will return to the current location. All variables in ns_getform (both posts and gets) will be maintained. Note that this will return out of its caller so that the caller need not explicitly call "return". Returns the user id if login was successful.

See Also:

Testcases:
No testcase defined.

ad_new_sort_by (public, deprecated)

 ad_new_sort_by key keys
Deprecated. Invoking this procedure generates a warning.

Makes a new sort_by string, sorting by "key". If the key is followed by "*", that indicates the ordering should be reversed from the default ordering for that key. Old sort keys are retained, so the sort appears to be a little more stable. That is, suppose two things are sorted into an order, and their values for a different column are the same. If that different column is used as the primary sort key to reorder, the things which have the same value for the newly-sorted column will remain in the same relative order.

Parameters:
key (required)
keys (required)
See Also:

Testcases:
No testcase defined.

ad_ns_set_keys (public, deprecated)

 ad_ns_set_keys [ -colon ] [ -exclude exclude ] set_id
Deprecated. Invoking this procedure generates a warning.

Returns the keys of an ns_set as a Tcl list, like array names. This proc can be easily replaced by a Tcl dict operation. Furthermore, newer versions of NaviServer have "ns_set keys" and "ns_set values" operations.

Switches:
-colon (optional, boolean)
If set, will prepend all the keys with a colon; useful for bind variables
-exclude (optional)
Optional Tcl list of key names to exclude
Parameters:
set_id (required)
Author:
Lars Pind <lars@pinds.com>
See Also:
  • ns_set keys

Testcases:
No testcase defined.

ad_order_by_from_sort_spec (public, deprecated)

 ad_order_by_from_sort_spec sort_by tabledef
Deprecated. Invoking this procedure generates a warning.

Takes a sort_by spec, and translates it into an "order by" clause with each sort_by key dictated by the sort info in tabledef

Parameters:
sort_by (required)
tabledef (required)
See Also:

Testcases:
No testcase defined.

ad_parameter (public, deprecated)

 ad_parameter [ -localize ] [ -set set ] [ -package_id package_id ] \
    name [ package_key ] [ default ]
Deprecated. Invoking this procedure generates a warning.

Package instances can have parameters associated with them. This function is used for accessing and setting these values. Parameter values are stored in the database and cached within memory. New parameters can be created with the APM and values can be set using the Site Map UI.. Because parameters are specified on an instance basis, setting the package_key parameter (preserved from the old version of this function) does not affect the parameter retrieved. If the code that calls ad_parameter is being called within the scope of a running server, the package_id will be determined automatically. However, if you want to use a parameter on server startup or access an arbitrary parameter (e.g., you are writing bboard code, but want to know an acs-kernel parameter), specify the package_id parameter to the object id of the package you want.

Note: The parameters/ad.ini file is deprecated.

Switches:
-localize (optional, boolean)
-set (optional)
Use this if you want to indicate a value to set the parameter to.
-package_id (optional)
Specify this if you want to manually specify what object id to use the new parameter.
Parameters:
name (required)
package_key (optional)
default (optional)
Returns:
The parameter of the object or if it doesn't exist, the default.
See Also:

Testcases:
No testcase defined.

ad_present_user (public, deprecated)

 ad_present_user user_id name
Deprecated. Invoking this procedure generates a warning.

This function is an alias to acs_community_member_link and receives identical parameters, but the former finds out the name of the user if a blank is passed. That's why it's marked as deprecated.

Parameters:
user_id (required)
name (required)
Returns:
the HTML link of the community member page of a particular user
Authors:
Unknown
Roberto Mello
See Also:

Testcases:
No testcase defined.

ad_privacy_threshold (public, deprecated)

 ad_privacy_threshold
Deprecated. Invoking this procedure generates a warning.

Pages that are consider whether to display a user's name or email address should test to make sure that a user's priv_ from the database is less than or equal to what ad_privacy_threshold returns. Now deprecated.

See Also:

Testcases:
No testcase defined.

ad_return (public, deprecated)

 ad_return [ args... ]
Deprecated. Invoking this procedure generates a warning.

Works like the "return" Tcl command, with one difference. Where "return" will always return TCL_RETURN, regardless of the -code switch this way, by burying it inside a proc, the proc will return the code you specify.

Why? Because "return" only sets the "returnCode" attribute of the interpreter object, which the function actually interpreting the procedure then reads and uses as the return code of the procedure. This proc adds just that level of processing to the statement.

When is that useful or necessary? Here:

    set errno [catch {
        return -code error "Boo!"
    } error]
    
In this case, errno will always contain 2 (TCL_RETURN). If you use ad_return instead, it'll contain what you wanted, namely 1 (TCL_ERROR).

See Also:

Testcases:
No testcase defined.

ad_reverse (public, deprecated)

 ad_reverse order
Deprecated. Invoking this procedure generates a warning.

returns the opposite sort order from the one it is given. Mostly for columns whose natural sort order is not the default.

Parameters:
order (required)
See Also:

Testcases:
No testcase defined.

ad_same_page_link (public, deprecated)

 ad_same_page_link variable value text [ form ]
Deprecated. Invoking this procedure generates a warning.

Makes a link to this page, with a new value for "variable".

Parameters:
variable (required)
value (required)
text (required)
form (optional)
See Also:

Testcases:
No testcase defined.

ad_secure_conn_p (public, deprecated)

 ad_secure_conn_p
Deprecated. Invoking this procedure generates a warning.

Use security::secure_conn_p instead.

See Also:

Testcases:
No testcase defined.

ad_set_typed_form_variable_filter (public, deprecated)

 ad_set_typed_form_variable_filter url_pattern [ args... ]
Deprecated. Invoking this procedure generates a warning.

    #
    # Register special rules for form variables.
    #
    # Example:
    #
    #    ad_set_typed_form_variable_filter /my_module/* {a_id number} {b_id word} {*_id integer}
    #
    # For all pages under /my_module, set_form_variables would set
    # $a_id only if it was number, and $b_id only if it was a 'word'
    # (a string that contains only letters, numbers, dashes, and
    # underscores), and all other variables that match the pattern
    # *_id would be set only if they were integers.
    #
    # Variables not listed have no restrictions on them.
    #
    # By default, the three supported datatypes are 'integer', 'number',
    # and 'word', although you can add your own type by creating
    # functions named ad_var_type_check_${type_name}_p which should
    # return 1 if the value is a valid $type_name, or 0 otherwise.
    #
    # There's also a special datatype named 'nocheck', which will
    # return success regardless of the value. (See the docs for
    # ad_var_type_check_${type_name}_p to see how this might be
    # useful.)
    #
    # The default data_type is 'integer', which allows you shorten the
    # command above to:
    #
    #    ad_set_typed_form_variable_filter /my_module/* a_id {b_id word}
    #

    ad_page_contract is the preferred mechanism to do automated
    validation of form variables.
    

Parameters:
url_pattern (required)
See Also:

Testcases:
No testcase defined.

ad_sort_primary_key (public, deprecated)

 ad_sort_primary_key orderby
Deprecated. Invoking this procedure generates a warning.

return the primary (first) key of an order spec used by

Parameters:
orderby (required)
See Also:

Testcases:
No testcase defined.

ad_sql_append (public, deprecated)

 ad_sql_append [ -select select ] [ -from from ] [ -where where ] \
    [ -groupby groupby ] [ -orderby orderby ] sqlarrayname
Deprecated. Invoking this procedure generates a warning.

Adds to the SQL statement. This is unused and untested code.

Switches:
-select (optional)
-from (optional)
-where (optional)
-groupby (optional)
-orderby (optional)
Parameters:
sqlarrayname (required)
See Also:
  • plain SQL statements + trivial Tcl idioms

Testcases:
No testcase defined.

ad_sql_get (public, deprecated)

 ad_sql_get sqlarrayname
Deprecated. Invoking this procedure generates a warning.

Parameters:
sqlarrayname (required)
array reference
Returns:
a SQL statement constructed from the pieces provided via ad_sql_append This is unused and untested code.
See Also:

Testcases:
No testcase defined.

ad_table (public, deprecated)

 ad_table [ -Torder_target_url Torder_target_url ] \
    [ -Torderby Torderby ] [ -Tasc_order_img Tasc_order_img ] \
    [ -Tdesc_order_img Tdesc_order_img ] \
    [ -Tmissing_text Tmissing_text ] [ -Tsuffix Tsuffix ] \
    [ -Tcolumns Tcolumns ] [ -Taudit Taudit ] \
    [ -Trows_per_band Trows_per_band ] [ -Tband_colors Tband_colors ] \
    [ -Tband_classes Tband_classes ] \
    [ -Trows_per_page Trows_per_page ] [ -Tmax_rows Tmax_rows ] \
    [ -Ttable_extra_html Ttable_extra_html ] \
    [ -Theader_row_extra Theader_row_extra ] \
    [ -Ttable_break_html Ttable_break_html ] \
    [ -Tpre_row_code Tpre_row_code ] [ -Trow_code Trow_code ] \
    [ -Tpost_data_ns_sets Tpost_data_ns_sets ] \
    [ -Textra_vars Textra_vars ] [ -Textra_rows Textra_rows ] \
    [ -bind bind ] [ -dbn dbn ] statement_name sql_qry Tdatadef
Deprecated. Invoking this procedure generates a warning.

DRB: New code should use the listbuilder. Note: all the variables in this function are named Tblah since we could potentially have namespace collisions

build and return an HTML fragment given an active query and a data definition.

  • sql_qry -- The query that should be executed to generate the table.
    You can specify an optional -bind argument to specify an ns_set of bind variables.
  • Tdatadef -- the table declaration.
Datadef structure :
    {
        {column_id "Column_Heading" order_clause display_info}
        ...
    }
    
  • column_id -- what to set as orderby for sorting and also is the default variable for the table cell.
  • the text for the heading to be wrapped in <th> and </th> tags. I am not entirely happy that things are wrapped automatically since you might not want plain old th tags but I also don;t want to add another field in the structure.
  • order_clause -- the order clause for the field. If null it defaults to "column_id $order". It is also interpolated, with orderby and order defined as variables so that:
                 {upper(last_name) $order, upper(first_names) $order}
             
    would do the right thing.

    the value "no_sort" should be used for columns which should not allow sorting.

    the value "sort_by_pos" should be used if the columns passed in are column positions rather than column names.

  • display_info. If this is a null string you just default to generating <td>column_id</td>. If it is a string in the lookup list then special formatting is applied; this is l r c tf 01 for align=left right center, Yes/No (from tf), Yes/No from 0/1.

    if the display stuff is not any of the above then it is interpolated and the results returned (w/o any <td> tags put in). An example:

        set table_def {
            {ffn "Full Name"
                {upper(last_name) $order, upper(first_names) $order}
                {<td><a href="/admin/users/one?user_id=$user_id">$first_names $last_name</a></td>}}
            {email "e-Mail" {} {<td><a href="mailto:$email">$email</a>}}
            {email_bouncing_p "e-Bouncing?" {} tf}
            {user_state "State" {} {}}
            {last_visit "Last Visit" {} r}
            {actions "Actions" no_sort {<td>
                    <a href="/admin/users/basic-info-update?user_id=$user_id">Edit Info</a> |
                    <a href="/admin/users/password-update?user_id=$user_id">New Password</a> |
                [ad_registration_finite_state_machine_admin_links $user_state $user_id]}}
        }
        

Switches:
-Torder_target_url (optional)
-Torderby (optional)
-Tasc_order_img (optional, defaults to "^")
-Tdesc_order_img (optional, defaults to "v")
-Tmissing_text (optional, defaults to "<em>No data found.</em>")
-Tsuffix (optional)
-Tcolumns (optional)
-Taudit (optional)
-Trows_per_band (optional, defaults to "1")
-Tband_colors (optional, defaults to "{} "#ececec"")
-Tband_classes (optional, defaults to "{even} {odd}")
-Trows_per_page (optional, defaults to "0")
-Tmax_rows (optional, defaults to "0")
-Ttable_extra_html (optional, defaults to "cellpadding=3 cellspacing=0 class="table-display"")
-Theader_row_extra (optional, defaults to "style="background-color:#f8f8f8" class="table-header"")
-Ttable_break_html (optional, defaults to "<br><br>")
-Tpre_row_code (optional)
-Trow_code (optional, defaults to "[subst $Trow_default]")
-Tpost_data_ns_sets (optional)
-Textra_vars (optional)
-Textra_rows (optional)
-bind (optional)
-dbn (optional)
The database name to use. If empty_string, uses the default database.
Parameters:
statement_name (required)
sql_qry (required)
Tdatadef (required)
See Also:

Testcases:
No testcase defined.

ad_table_column_list (public, deprecated)

 ad_table_column_list [ -sortable sortable ] datadef columns
Deprecated. Invoking this procedure generates a warning.

build a list of pointers into the list of column definitions

returns a list of indexes into the columns one per column it found

-sortable from t/f/all

Switches:
-sortable (optional, defaults to "all")
Parameters:
datadef (required)
columns (required)
See Also:

Testcases:
No testcase defined.

ad_table_form (public, deprecated)

 ad_table_form datadef [ type ] [ return_url ] [ item_group ] [ item ] \
    [ columns ] [ allowed ]
Deprecated. Invoking this procedure generates a warning.

builds a form for choosing the columns to display

columns is a list of the currently selected columns.

allowed is the list of all the displayable columns, if empty all columns are allowed.

Parameters:
datadef (required)
type (optional, defaults to "select")
return_url (optional)
item_group (optional)
item (optional)
columns (optional)
allowed (optional)
See Also:

Testcases:
No testcase defined.

ad_table_orderby_sql (public, deprecated)

 ad_table_orderby_sql datadef orderby order
Deprecated. Invoking this procedure generates a warning.

create the order by clause consistent with the orderby and order variables and the datadef which built the table

Parameters:
datadef (required)
orderby (required)
order (required)
See Also:

Testcases:
No testcase defined.

ad_table_same (public, deprecated)

 ad_table_same varname
Deprecated. Invoking this procedure generates a warning.

Called from inside ad_table. returns true if the variable has same value as on the previous row. Always false for 1st row.

Parameters:
varname (required)
See Also:

Testcases:
No testcase defined.

ad_table_sort_form (public, deprecated)

 ad_table_sort_form datadef [ type ] [ return_url ] [ item_group ] \
    [ item ] [ sort_spec ] [ allowed ]
Deprecated. Invoking this procedure generates a warning.

builds a form for setting up custom sorts.

  • datadef is the table definition as in ad_table.
  • type is select or radio (only select is implemented now)
  • return_url is the return url passed through to the page that validates and saves the sort customization.
  • item_group is a string identifying the customization "ticket_tracker_main_sort" for example.
  • item is the user entered identifier
  • sort_spec is the sort specifier as in ad_new_sort_by
  • allowed is the list of all the columns allowed, if empty all are allowed.

An example from the ticket system:

      ad_table_sort_form $tabledef select $return_url ticket_tracker_main_sort $ticket_sort $orderby
    

Parameters:
datadef (required)
type (optional, defaults to "select")
return_url (optional)
item_group (optional)
item (optional)
sort_spec (optional)
allowed (optional)
See Also:

Testcases:
No testcase defined.

ad_table_span (public, deprecated)

 ad_table_span str [ td_html ]
Deprecated. Invoking this procedure generates a warning.

given string the function generates a row which spans the whole table.

Parameters:
str (required)
td_html (optional, defaults to "align="left"")
See Also:

Testcases:
No testcase defined.

ad_user_new (public, deprecated)

 ad_user_new email first_names last_name password password_question \
    password_answer [ url ] [ email_verified_p ] [ member_state ] \
    [ user_id ] [ username ] [ authority_id ] [ screen_name ]
Deprecated. Invoking this procedure generates a warning.

Creates a new user in the system. The user_id can be specified as an argument to enable double click protection. If this procedure succeeds, returns the new user_id. Otherwise, returns 0.

Parameters:
email (required)
first_names (required)
last_name (required)
password (required)
password_question (required)
password_answer (required)
url (optional)
email_verified_p (optional, defaults to "t")
member_state (optional, defaults to "approved")
user_id (optional)
username (optional)
authority_id (optional)
screen_name (optional)
See Also:

Testcases:
No testcase defined.

ad_var_type_check_dirname_p (public, deprecated)

 ad_var_type_check_dirname_p value
Deprecated. Invoking this procedure generates a warning.

Parameters:
value (required)
Returns:
0 if $value contains a / or \, 1 otherwise.
See Also:

Testcases:
No testcase defined.

ad_var_type_check_fail_p (public, deprecated)

 ad_var_type_check_fail_p value
Deprecated. Invoking this procedure generates a warning.

A check that always returns 0. Useful if you want to disable all access to a page.

Parameters:
value (required)
See Also:

Testcases:
No testcase defined.

ad_var_type_check_integer_p (public, deprecated)

 ad_var_type_check_integer_p value
Deprecated. Invoking this procedure generates a warning.

Parameters:
value (required)
Returns:
1 if $value is an integer, 0 otherwise. This function is deprecated. Use either template::data::validate::integer or "string is integer -strict" instead.
See Also:

Testcases:
No testcase defined.

ad_var_type_check_integerlist_p (public, deprecated)

 ad_var_type_check_integerlist_p value
Deprecated. Invoking this procedure generates a warning.

Parameters:
value (required)
Returns:
1 if list contains only numbers, spaces, and commas. Example '5, 3, 1'. Note: it doesn't allow negative numbers, because that could let people sneak in numbers that get treated like math expressions like '1, 5-2'
See Also:

Testcases:
No testcase defined.

ad_var_type_check_nocheck_p (public, deprecated)

 ad_var_type_check_nocheck_p [ value ]
Deprecated. Invoking this procedure generates a warning.

Parameters:
value (optional)
Returns:
1 regardless of the value. This is useful if you want to set a filter over the entire site, then create a few exceptions. For example: ad_set_typed_form_variable_filter /my-dangerous-page.tcl {user_id nocheck} ad_set_typed_form_variable_filter /*.tcl user_id
See Also:

Testcases:
No testcase defined.

ad_var_type_check_noquote_p (public, deprecated)

 ad_var_type_check_noquote_p value
Deprecated. Invoking this procedure generates a warning.

Parameters:
value (required)
Returns:
1 if $value contains any single-quotes
See Also:

Testcases:
No testcase defined.

ad_var_type_check_number_p (public, deprecated)

 ad_var_type_check_number_p value
Deprecated. Invoking this procedure generates a warning.

Parameters:
value (required)
Returns:
1 if $value is a valid number
See Also:

Testcases:
No testcase defined.

ad_var_type_check_safefilename_p (public, deprecated)

 ad_var_type_check_safefilename_p value
Deprecated. Invoking this procedure generates a warning.

Parameters:
value (required)
Returns:
0 if the file contains ".."
See Also:

Testcases:
No testcase defined.

ad_var_type_check_third_urlv_integer_p (public, deprecated)

 ad_var_type_check_third_urlv_integer_p [ args ]
Deprecated. Invoking this procedure generates a warning.

Deprecated: too specific to make sense as a public api, can be replaced via a simple tcl oneliner

Parameters:
args (optional)
Returns:
1 if the third path element in the URL is integer.
See Also:

Testcases:
No testcase defined.

ad_var_type_check_word_p (public, deprecated)

 ad_var_type_check_word_p value
Deprecated. Invoking this procedure generates a warning.

Parameters:
value (required)
Returns:
1 if $value contains only letters, numbers, dashes, and underscores, otherwise returns 0.
See Also:

Testcases:
No testcase defined.

ad_verify_and_get_user_id (public, deprecated)

 ad_verify_and_get_user_id [ -secure secure ]
Deprecated. Invoking this procedure generates a warning.

Returns the current user's ID. 0 indicates user is not logged in Deprecated since user_id now provided via ad_conn user_id

Switches:
-secure (optional, defaults to "f")
See Also:

Testcases:
No testcase defined.

apm_db_type_keys (public, deprecated)

 apm_db_type_keys
Deprecated. Invoking this procedure generates a warning.

Returns a list of valid database type keys.

See Also:

Testcases:
No testcase defined.

apm_doc_body_callback (public, deprecated)

 apm_doc_body_callback string
Deprecated. Invoking this procedure generates a warning.

This callback uses the document API to append more text to the stream.

Parameters:
string (required)

Testcases:
No testcase defined.

cc_email_from_party (public, deprecated)

 cc_email_from_party party_id
Deprecated. Invoking this procedure generates a warning.

Parameters:
party_id (required)
Returns:
The email address of the indicated party.
See Also:

Testcases:
No testcase defined.

cc_email_user (public, deprecated)

 cc_email_user email
Deprecated. Invoking this procedure generates a warning.

Parameters:
email (required)
Returns:
Returns the user ID for a particular email address, or an empty string if none exists.
See Also:

Testcases:
No testcase defined.

cc_lookup_email_user (private, deprecated)

 cc_lookup_email_user email
Deprecated. Invoking this procedure generates a warning.

Return the user_id of a user given the email. Returns the empty string if no such user exists.

Parameters:
email (required)
See Also:

Testcases:
No testcase defined.

cc_lookup_name_group (private, deprecated)

 cc_lookup_name_group name
Deprecated. Invoking this procedure generates a warning.

Parameters:
name (required)
See Also:

Testcases:
No testcase defined.

cc_lookup_screen_name_user (private, deprecated)

 cc_lookup_screen_name_user screen_name
Deprecated. Invoking this procedure generates a warning.

Parameters:
screen_name (required)
See Also:

Testcases:
No testcase defined.

cc_name_to_group (public, deprecated)

 cc_name_to_group name
Deprecated. Invoking this procedure generates a warning.

Returns the group ID for a particular name, or an empty string if none exists.

Parameters:
name (required)
See Also:

Testcases:
No testcase defined.

cc_screen_name_user (public, deprecated)

 cc_screen_name_user screen_name
Deprecated. Invoking this procedure generates a warning.

Parameters:
screen_name (required)
Returns:
Returns the user ID for a particular screen name, or an empty string if none exists.
See Also:

Testcases:
No testcase defined.

check_for_form_variable_naughtiness (public, deprecated)

 check_for_form_variable_naughtiness name value
Deprecated. Invoking this procedure generates a warning.

stuff to process the data that comes back from the users if the form looked like <input type=text name=yow> and <input type=text name=bar> then after you run this function you'll have Tcl vars $foo and $bar set to whatever the user typed in the form

this uses the initially nauseating but ultimately delicious Tcl system function "uplevel" that lets a subroutine bash the environment and local vars of its caller. It ain't Common Lisp...

This is an ad-hoc check to make sure users aren't trying to pass in "naughty" form variables in an effort to hack the database by passing in SQL. It is called in all instances where a Tcl variable is set from a form variable.

Checks the given variable for against known form variable exploits. If it finds anything objectionable, it throws an error.

Parameters:
name (required)
value (required)

Testcases:
No testcase defined.

db_package_supports_rdbms_p (public, deprecated)

 db_package_supports_rdbms_p db_type_list
Deprecated. Invoking this procedure generates a warning.

Parameters:
db_type_list (required)
Returns:
1 if db_type_list contains the current RDMBS type. A package intended to run with a given RDBMS must note this in its package info file regardless of whether or not it actually uses the database.
See Also:

Testcases:
No testcase defined.

doc_body_append (public, deprecated)

 doc_body_append str
Deprecated. Invoking this procedure generates a warning.

Appends $str to the body property.

Parameters:
str (required)

Testcases:
No testcase defined.

doc_body_flush (public, deprecated)

 doc_body_flush
Deprecated. Invoking this procedure generates a warning.

Flushes the body (if possible).

Testcases:
No testcase defined.

doc_exists_p (public, deprecated)

 doc_exists_p
Deprecated. Invoking this procedure generates a warning.

Returns 1 if there is a document in the global environment.

Testcases:
No testcase defined.

doc_find_template (public, deprecated)

 doc_find_template filename
Deprecated. Invoking this procedure generates a warning.

Finds a master.adp file which can be used as a master template, looking in the directory containing $filename and working our way down the directory tree.

Parameters:
filename (required)

Testcases:
No testcase defined.

doc_get_property (public, deprecated)

 doc_get_property name
Deprecated. Invoking this procedure generates a warning.

Returns a property (or an empty string if no such property exists).

Parameters:
name (required)

Testcases:
No testcase defined.

doc_init (public, deprecated)

 doc_init
Deprecated. Invoking this procedure generates a warning.

Initializes the global environment for document handling.

Testcases:
No testcase defined.

doc_property_exists_p (public, deprecated)

 doc_property_exists_p name
Deprecated. Invoking this procedure generates a warning.

Return 1 if a property exists, or 0 if not.

Parameters:
name (required)

Testcases:
No testcase defined.

doc_serve_document (public, deprecated)

 doc_serve_document
Deprecated. Invoking this procedure generates a warning.

Serves the document currently in the environment.

Testcases:
No testcase defined.

doc_serve_template (public, deprecated)

 doc_serve_template __template_path
Deprecated. Invoking this procedure generates a warning.

Serves the document in the environment using a particular template.

Parameters:
__template_path (required)

Testcases:
No testcase defined.

doc_set_mime_type (public, deprecated)

 doc_set_mime_type mime_type
Deprecated. Invoking this procedure generates a warning.

Sets the mime-type property.

Parameters:
mime_type (required)

Testcases:
No testcase defined.

doc_set_property (public, deprecated)

 doc_set_property name value
Deprecated. Invoking this procedure generates a warning.

Sets a document property.

Parameters:
name (required)
value (required)

Testcases:
No testcase defined.

doc_tag_ad_document (public, deprecated)

 doc_tag_ad_document contents params
Deprecated. Invoking this procedure generates a warning.

Parameters:
contents (required)
params (required)

Testcases:
No testcase defined.

doc_tag_ad_property (public, deprecated)

 doc_tag_ad_property contents params
Deprecated. Invoking this procedure generates a warning.

Parameters:
contents (required)
params (required)

Testcases:
No testcase defined.

exists_and_equal (public, deprecated)

 exists_and_equal varname value
Deprecated. Invoking this procedure generates a warning.

Returns 1 if the variable name exists in the caller's environment and is equal to the given value. DEPRECATED: the value provided by this proc is arguable, as it can be replaced by a plain tcl oneliner.

Parameters:
varname (required)
value (required)
Author:
Peter Marklund
See Also:

Testcases:
No testcase defined.

exists_and_not_null (public, deprecated)

 exists_and_not_null varname
Deprecated. Invoking this procedure generates a warning.

Returns 1 if the variable name exists in the caller's environment and is not the empty string. Note you should enter the variable name, and not the variable value (varname not $varname which will pass variable varnames value into this function). DEPRECATED: the value provided by this proc is arguable, as it can be replaced by a plain tcl oneliner.

Parameters:
varname (required)
See Also:
  • plain tcl idioms

Testcases:
No testcase defined.

exists_or_null (public, deprecated)

 exists_or_null varname
Deprecated. Invoking this procedure generates a warning.

Returns the contents of the variable if it exists, otherwise returns empty string

Parameters:
varname (required)

Testcases:
No testcase defined.

export_form_vars (public, deprecated)

 export_form_vars [ -sign ] [ args... ]
Deprecated. Invoking this procedure generates a warning.

Exports a number of variables as hidden input fields in a form. Specify a list of variable names. The proc will reach up in the caller's name space to grab the value of the variables. Variables that are not defined are silently ignored. You can append :multiple to the name of a variable. In this case, the value will be treated as a list, and each of the elements output separately.

export_vars is now the preferred interface.

Example usage: [export_vars -form -sign {foo bar:multiple baz}]

Switches:
-sign (optional, boolean)
If this flag is set, all the variables output will be signed using ad_sign. These variables should then be verified using the :verify flag to ad_page_contract, which in turn uses ad_verify_signature. This ensures that the value hasn't been tampered with at the user's end.
See Also:

Testcases:
No testcase defined.

export_url_vars (public, deprecated)

 export_url_vars [ -sign ] [ args... ]
Deprecated. Invoking this procedure generates a warning.

export_vars is now the preferred interface. Returns a string of key=value pairs suitable for inclusion in a URL; you can pass it any number of variables as arguments. If any are defined in the caller's environment, they are included. See also export_entire_form_as_url_vars.

Instead of naming a variable you can also say name=value. Note that the value here is not the name of a variable but the literal value you want to export e.g., export_url_vars [ns_urlencode foo]=[ns_urlencode $the_value].

For normal variables, you can say export_url_vars foo:multiple. In this case, the value of foo will be treated as a Tcl list, and each value will be output separately e.g., foo=item0&foo=item1&foo=item2...

You cannot combine the foo=bar syntax with the foo:multiple syntax. Why? Because there's no way we can distinguish between the :multiple being part of the value of foo or being a flag intended for export_url_vars.

Switches:
-sign (optional, boolean)
If this flag is set, all the variables output will be signed using ad_sign. These variables should then be verified using the :verify flag to ad_page_contract, which in turn uses ad_verify_signature. This ensures that the value hasn't been tampered with at the user's end.
See Also:

Testcases:
No testcase defined.

get_referrer (public, deprecated)

 get_referrer [ args... ]
Deprecated. Invoking this procedure generates a warning.

Returns:
referrer from the request headers.
See Also:

Testcases:
No testcase defined.

max (public, deprecated)

 max [ args... ]
Deprecated. Invoking this procedure generates a warning.

Returns the maximum of a list of numbers. Example: max 2 3 1.5 returns 3. DEPRECATED: this proc does not respect OpenACS naming convention.

Author:
Lars Pind <lars@pinds.com>
Created:
31 August 2000
See Also:

Testcases:
No testcase defined.

merge_form_with_query (public, deprecated)

 merge_form_with_query [ -bind bind ] form statement_name sql_qry
Deprecated. Invoking this procedure generates a warning.

Merges a form with a query string. DEPRECATED: this proc does not comply with OpenACS naming convention. Furthermore, ns_formvalueput supports a limited number of HTML variants and input tag types and is subject to various other limitations. For a modern implementation addressing the use-case of this proc one should probably use tools such as tDOM.

Switches:
-bind (optional)
A ns_set stuffed with bind variables for the sql_qry.
Parameters:
form (required)
the form to be stuffed.
statement_name (required)
An identifier for the sql_qry to be executed.
sql_qry (required)
The sql that must be executed.
See Also:

Testcases:
No testcase defined.

min (public, deprecated)

 min [ args... ]
Deprecated. Invoking this procedure generates a warning.

Returns the minimum of a list of numbers. Example: min 2 3 1.5 returns 1.5. DEPRECATED: this proc does not respect OpenACS naming convention.

Author:
Ken Mayer <kmayer@bitwrangler.com>
Created:
26 September 2002
See Also:

Testcases:
No testcase defined.

ns_dbformvalue (public, deprecated)

 ns_dbformvalue formdata column type valuebyref
Deprecated. Invoking this procedure generates a warning.

deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3 returnvalues: -1 = Not there or value was "" 0 = NULL, set value to NULL. 1 = Got value, set value to it.

Parameters:
formdata (required)
column (required)
type (required)
valuebyref (required)

Testcases:
No testcase defined.

ns_dbformvalueput (public, deprecated)

 ns_dbformvalueput htmlform column type value
Deprecated. Invoking this procedure generates a warning.

deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3

Parameters:
htmlform (required)
column (required)
type (required)
value (required)

Testcases:
No testcase defined.

ns_putscript (public, deprecated)

 ns_putscript conn ignored
Deprecated. Invoking this procedure generates a warning.

deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3

Parameters:
conn (required)
ignored (required)

Testcases:
No testcase defined.

oacs::user::get (public, deprecated)

 oacs::user::get -user_id user_id -array array
Deprecated. Invoking this procedure generates a warning.

Load up user information

Switches:
-user_id (required)
-array (required)
See Also:

Testcases:
No testcase defined.

party::permission_p (public, deprecated)

 party::permission_p [ -user_id user_id ] [ -privilege privilege ] \
    party_id
Deprecated. Invoking this procedure generates a warning.

Wrapper for ad_permission to allow us to bypass having to specify the read privilege Deprecated: just another wrapper for permission::permission_p

Switches:
-user_id (optional)
-privilege (optional, defaults to "read")
Parameters:
party_id (required)
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
10/2000
See Also:

Testcases:
No testcase defined.

philg_quote_double_quotes (public, deprecated)

 philg_quote_double_quotes arg
Deprecated. Invoking this procedure generates a warning.

This proc does exactly the same as ns_quotehtml. Use that instead. This one will be deleted eventually.

Parameters:
arg (required)
See Also:
  • ns_quotehtml

Testcases:
No testcase defined.

pkg_home (public, deprecated)

 pkg_home package_key
Deprecated. Invoking this procedure generates a warning.

Parameters:
package_key (required)
Returns:
A server-root relative path to the directory for a package. Usually, /packages/package-key
See Also:

Testcases:
No testcase defined.

proc_doc (public, deprecated)

 proc_doc [ args... ]
Deprecated. Invoking this procedure generates a warning.

A synonym for ad_proc (to support legacy code).

See Also:

Testcases:
No testcase defined.

proc_source_file_full_path (private, deprecated)

 proc_source_file_full_path proc_name
Deprecated. Invoking this procedure generates a warning.

This is a used function solely kept here for (unclear) backward compatibility in acs-bootstrap-installer/tcl/00-proc-procs.tcl. AFIKT, there is no need for this function in OpenACS, it should be removed after the release of OpenACS 5.10.

Parameters:
proc_name (required)

Testcases:
No testcase defined.

random (public, deprecated)

 random
Deprecated. Invoking this procedure generates a warning.

Return a pseudo-random number between 0 and 1. DEPRECATED: this proc does not respect OpenACS naming convention

See Also:

Testcases:
No testcase defined.

randomInit (public, deprecated)

 randomInit seed
Deprecated. Invoking this procedure generates a warning.

seed the random number generator. DEPRECATED: this proc does not respect OpenACS naming convention

Parameters:
seed (required)
See Also:

Testcases:
No testcase defined.

randomRange (public, deprecated)

 randomRange range
Deprecated. Invoking this procedure generates a warning.

Returns a pseudo-random number between 0 and range. DEPRECATED: this proc does not respect OpenACS naming convention

Parameters:
range (required)
Returns:
integer
See Also:

Testcases:
No testcase defined.

remove_nulls_from_ns_set (public, deprecated)

 remove_nulls_from_ns_set old_set_id
Deprecated. Invoking this procedure generates a warning.

Creates and returns a new ns_set without any null value fields DEPRECATED: does not comply with OpenACS naming convention.

Parameters:
old_set_id (required)
Returns:
new ns_set
See Also:

Testcases:
No testcase defined.

root_of_host (public, deprecated)

 root_of_host host
Deprecated. Invoking this procedure generates a warning.

Maps a hostname to the corresponding subdirectory. DEPRECATED: this proc does not comply with OpenACS naming convention.

Parameters:
host (required)
See Also:

Testcases:
No testcase defined.

rp_form_put (public, deprecated)

 rp_form_put name value
Deprecated. Invoking this procedure generates a warning.

This proc adds a query variable to AOLserver's internal ns_getform form, so that it'll be picked up by ad_page_contract and other procs that look at the query variables or form supplied. This is useful when you do an rp_internal_redirect to a new page, and you want to feed that page with certain query variables. Note that the variable will just be appended to the form ns_set which may not be what you want, if it exists already you will now have two entries in the ns_set which may cause ad_page_contract to break. Also, only simple variables may be added, not arrays. DEPRECATED: this proc is a trivial wrapper over NaviServer functionalities. One should use the native api directly.

Parameters:
name (required)
value (required)
Returns:
the form ns_set, in case you're interested. Mostly you will want to discard the result.
Author:
Lars Pind <lars@pinds.com>
Created:
August 20, 2002
See Also:
  • ns_getform
  • ns_set

Testcases:
No testcase defined.

rp_form_update (public, deprecated)

 rp_form_update name value
Deprecated. Invoking this procedure generates a warning.

Identical to rp_form_put, but uses ns_set update instead. DEPRECATED: this proc is a trivial wrapper over NaviServer functionalities. One should use the native api directly.

Parameters:
name (required)
value (required)
Returns:
the form ns_set, in case you're interested. Mostly you will want to discard the result.
See Also:
  • ns_getform
  • ns_set

Testcases:
No testcase defined.

rp_getform (public, deprecated)

 rp_getform
Deprecated. Invoking this procedure generates a warning.

This proc is a simple wrapper around AOLserver's standard ns_getform proc, that will create the form if it doesn't exist, so that you can then add values to that form. This is useful in conjunction with rp_internal_redirect to redirect to a different page with certain query variables set. DEPRECATED: modern ns_getform from NaviServer will never return the empty string, assuming that we are in a connection. When we are not in a connection, it makes little sense that we set request variables.

Returns:
the form ns_set, just like ns_getform, except it will always be nonempty.
Author:
Lars Pind <lars@pinds.com>
Created:
August 20, 2002
See Also:
  • ns_getform

Testcases:
No testcase defined.

rp_handle_adp_request (private, deprecated)

 rp_handle_adp_request
Deprecated. Invoking this procedure generates a warning.

Handles a request for an .adp file.

See Also:

Testcases:
No testcase defined.

safe_eval (public, deprecated)

 safe_eval [ args... ]
Deprecated. Invoking this procedure generates a warning.

Deprecated version of ad_safe_eval

See Also:

Testcases:
No testcase defined.

set_append! (public, deprecated)

 set_append! s-name v
Deprecated. Invoking this procedure generates a warning.

Adds the element v to the set named s-name in the calling environment, if it isn't already there.

Parameters:
s-name (required)
v (required)

Testcases:
No testcase defined.

set_difference (public, deprecated)

 set_difference u v
Deprecated. Invoking this procedure generates a warning.

Returns the difference of sets $u and $v. (i.e. The set of all members of u that aren't also members of $v.)

Parameters:
u (required)
v (required)

Testcases:
No testcase defined.

set_difference! (public, deprecated)

 set_difference! u-name v
Deprecated. Invoking this procedure generates a warning.

Computes the difference of the set stored in the variable named $u-name in the calling environment and the set v, sets the variable named $u-name in the calling environment to that difference, and also returns that difference.

Parameters:
u-name (required)
v (required)

Testcases:
No testcase defined.

set_encoding (private, deprecated)

 set_encoding [ -text_translation text_translation ] content_type \
    channel
Deprecated. Invoking this procedure generates a warning.

The ad_http* and util_http* machineries depend on the AOLserver/NaviServer socket I/O layer provided by [ns_sockopen]. This proc allows you to request Tcl encoding filtering for ns_sockopen channels (i.e., the read and write channels return by [ns_sockopen]), to be applied right before performing socket I/O operations (i.e., reads).

The major task is to resolve the corresponding Tcl encoding (e.g.: ascii) for a given IANA/MIME charset name (or alias; e.g.: US-ASCII); the main resolution scheme is implemented by [ns_encodingfortype] which is available bother under AOLserver and NaviServer (see tcl/charsets.tcl). The mappings between Tcl encoding names (as shown by [encoding names]) and IANA/MIME charset names (i.e., names and aliases in the sense of IANA's character sets registry) is provided by:

  • A static, built-in correspondence map: see nsd/encoding.c
  • An extensible correspondence map (i.e., the ns/charsets section in config.tcl).

[ns_encodingfortype] introduces several levels of precedence when resolving the actual IANA/MIME charset and the corresponding Tcl encoding to use:

  1. The "content_type" string contains a charset specification, e.g.: "text/xml; charset=UTF-8". This spec fragment takes the highest precedence.
  2. The "content_type" string points to a "text/*" media subtype, but does not specify a charset (e.g., "text/xml"). In this case, the charset defined by ns/parameters/OutputCharset (see config.tcl) applies. If this parameter is missing, the default is "iso-8859-1" (see tcl/charsets.tcl; this follows from RFC 2616 (HTTP 1.1); Section 3.7.1).
  3. If neither case 1 or case 2 become effective, the encoding is resolved to "binary".
  4. If [ns_encodingfortype] fails to resolve any Tcl encoding name (i.e., returns an empty string), the general fallback is "iso8859-1" for text/* media subtypes and "binary" for any other. This is the case in two situations:
    • Invalid IANA/MIME charsets: The name in the "charset" parameter of the content type spec is not a valid name or alias in IANA's character sets registry (a special variant would be an empty charset value, e.g. "text/plain; charset=")
    • Unknown IANA/MIME charsets: The name in the "charset" parameter of the content type spec does not match any known (= registered) IANA/MIME charset in the MIME/Tcl mappings.
References:

Switches:
-text_translation (optional, defaults to "auto binary")
Parameters:
content_type (required)
channel (required)
Author:
stefan.sobernig@wu.ac.at

Testcases:
No testcase defined.

set_intersection (public, deprecated)

 set_intersection u v
Deprecated. Invoking this procedure generates a warning.

Returns the intersection of sets $u and $v.

Parameters:
u (required)
v (required)

Testcases:
No testcase defined.

set_intersection! (public, deprecated)

 set_intersection! u-name v
Deprecated. Invoking this procedure generates a warning.

Computes the intersection of the set stored in the variable named $u-name in the calling environment and the set v, sets the variable named $u-name in the calling environment to that intersection, and also returns that intersection.

Parameters:
u-name (required)
v (required)

Testcases:
No testcase defined.

set_member? (public, deprecated)

 set_member? s v
Deprecated. Invoking this procedure generates a warning.

Tests whether or not $v is a member of set $s.

Parameters:
s (required)
v (required)

Testcases:
No testcase defined.

set_union (public, deprecated)

 set_union u v
Deprecated. Invoking this procedure generates a warning.

Returns the union of sets $u and $v.

Parameters:
u (required)
v (required)

Testcases:
No testcase defined.

set_union! (public, deprecated)

 set_union! u-name v
Deprecated. Invoking this procedure generates a warning.

Computes the union of the set stored in the variable named $u-name in the calling environment and the set v, sets the variable named $u-name in the calling environment to that union, and also returns that union.

Parameters:
u-name (required)
v (required)

Testcases:
No testcase defined.

set_variables_after_query (public, deprecated)

 set_variables_after_query
Deprecated. Invoking this procedure generates a warning.

to be removed.

See Also:
  • packages/acs-tcl/tcl/00-database-procs.tcl

Testcases:
No testcase defined.

set_variables_after_query_not_selection (public, deprecated)

 set_variables_after_query_not_selection selection_variable \
    [ name_prefix ]
Deprecated. Invoking this procedure generates a warning.

to be removed.

Parameters:
selection_variable (required)
name_prefix (optional)
See Also:
  • packages/acs-tcl/tcl/00-database-procs.tcl

Testcases:
No testcase defined.

set_variables_after_subquery (public, deprecated)

 set_variables_after_subquery
Deprecated. Invoking this procedure generates a warning.

to be removed.

See Also:
  • packages/acs-tcl/tcl/00-database-procs.tcl

Testcases:
No testcase defined.

site_map_unmount_application (public, deprecated)

 site_map_unmount_application [ -sync_p sync_p ] [ -delete_p delete_p ] \
    node_id
Deprecated. Invoking this procedure generates a warning.

Unmounts the specified node.

Switches:
-sync_p (optional, defaults to "t")
If "t", we flush the in-memory site map
-delete_p (optional, defaults to "f")
If "t", we attempt to delete the site node. This will fail if you have not cleaned up child nodes
Parameters:
node_id (required)
The node_id to unmount
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
2001-02-07
See Also:

Testcases:
No testcase defined.

site_node::conn_url (public, deprecated)

 site_node::conn_url
Deprecated. Invoking this procedure generates a warning.

Use this in place of ns_conn url when referencing host_nodes. This proc returns the appropriate ns_conn url value, depending on if host_node_map is used for current connection, or hostname's domain.

See Also:

Testcases:
No testcase defined.

site_node_closest_ancestor_package (public, deprecated)

 site_node_closest_ancestor_package [ -default default ] [ -url url ] \
    package_keys
Deprecated. Invoking this procedure generates a warning.

Use site_node::closest_ancestor_package. Note that site_node_closest_ancestor_package will include the passed-in node in the search, whereas the new proc doesn't by default. If you want to include the passed-in node, call site_node::closest_ancestor_package with the -include_self flag

Finds the package id of a package of specified type that is closest to the node id represented by url (or by ad_conn url).Note that closest means the nearest ancestor node of the specified type, or the current node if it is of the correct type.

Usage:

    # Pull out the package_id of the subsite closest to our current node
    set pkg_id [site_node::closest_ancestor_package -include_self -package_key "acs-subsite"]
    

Switches:
-default (optional)
The value to return if no package can be found
-url (optional)
The url of the node from which to start the search
Parameters:
package_keys (required)
The type(s) of the package(s) for which we are looking
Returns:
package_id of the nearest package of the specified type (package_key). Returns $default if no such package can be found.
See Also:

Testcases:
No testcase defined.

site_node_closest_ancestor_package_url (public, deprecated)

 site_node_closest_ancestor_package_url [ -default default ] \
    [ -package_key package_key ]
Deprecated. Invoking this procedure generates a warning.

Returns the url stub of the nearest application of the specified type.

Switches:
-default (optional)
The default value to return if no package of the specified type was found
-package_key (optional)
The types of packages for which we're looking (defaults to subsite packages)
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
2001-02-05
See Also:
  • site::node::closest_ancestor_package

Testcases:
No testcase defined.

site_node_delete_package_instance (public, deprecated)

 site_node_delete_package_instance -node_id node_id
Deprecated. Invoking this procedure generates a warning.

Wrapper for apm_package_instance_delete

Switches:
-node_id (required)
Author:
Arjun Sanyal <arjun@openforc.net>
Created:
2002-05-02
See Also:

Testcases:
No testcase defined.

site_node_id (public, deprecated)

 site_node_id url
Deprecated. Invoking this procedure generates a warning.

Returns the node_id of a site node. Throws an error if there is no matching node.

Parameters:
url (required)
See Also:

Testcases:
No testcase defined.

site_nodes_sync (public, deprecated)

 site_nodes_sync [ args... ]
Deprecated. Invoking this procedure generates a warning.

Brings the in-memory copy of the url hierarchy in sync with the database version.

See Also:

Testcases:
No testcase defined.

util_PrettyBoolean (public, deprecated)

 util_PrettyBoolean t_or_f [ default ]
Deprecated. Invoking this procedure generates a warning.

Parameters:
t_or_f (required)
default (optional, defaults to "default")
See Also:

Testcases:
No testcase defined.

util_PrettyTclBoolean (public, deprecated)

 util_PrettyTclBoolean zero_or_one
Deprecated. Invoking this procedure generates a warning.

Turns a 1 (or anything else that makes a Tcl IF happy) into Yes; anything else into No DEPRECATED: this proc is not localized, does not comply with OpenACS naming convention and can be replaced by simple oneliner idioms based e.g. on expr command

Parameters:
zero_or_one (required)
See Also:
  • plain tcl idioms involving message keys

Testcases:
No testcase defined.

util_ReturnMetaRefresh (public, deprecated)

 util_ReturnMetaRefresh url [ seconds_delay ]
Deprecated. Invoking this procedure generates a warning.

Ugly workaround to deal with IE5.0 bug handling multipart/form-data using Meta Refresh page instead of a redirect.

Parameters:
url (required)
seconds_delay (optional, defaults to "0")
See Also:

Testcases:
No testcase defined.

util_convert_plaintext_to_html (public, deprecated)

 util_convert_plaintext_to_html raw_string
Deprecated. Invoking this procedure generates a warning.

Almost everything this proc does can be accomplished with the ad_text_to_html. Use that proc instead.

Only difference is that ad_text_to_html doesn't check to see if the plaintext might in fact be HTML already by mistake. But we usually don't want that anyway, because maybe the user wanted a <p> tag in his plaintext. We'd rather let the user change our opinion about the text, e.g. html_p = 't'.

Parameters:
raw_string (required)
See Also:

Testcases:
No testcase defined.

util_get_http_status (public, deprecated)

 util_get_http_status url [ use_get_p ] [ timeout ]
Deprecated. Invoking this procedure generates a warning.

Returns the HTTP status code, e.g., 200 for a normal response or 500 for an error, of a URL. By default this uses the GET method instead of HEAD since not all servers will respond properly to a HEAD request even when the URL is perfectly valid. Note that this means AOLserver may be sucking down a lot of bits that it doesn't need.

Parameters:
url (required)
use_get_p (optional, defaults to "1")
timeout (optional, defaults to "30")
See Also:

Testcases:
No testcase defined.

util_http_file_upload (public, deprecated)

 util_http_file_upload [ -file file ] [ -data data ] [ -binary ] \
    [ -filename filename ] [ -name name ] [ -mime_type mime_type ] \
    [ -mode mode ] [ -rqset rqset ] url [ formvars ] [ timeout ] \
    [ depth ] [ http_referer ]
Deprecated. Invoking this procedure generates a warning.

Implement client-side HTTP file uploads as multipart/form-data as per RFC 1867.

Similar to util_httppost, but enhanced to be able to upload a file as multipart/form-data. Also useful for posting to forms that require their input to be encoded as multipart/form-data instead of as application/x-www-form-urlencoded.

The switches -file /path/to/file and -data $raw_data are mutually exclusive. You can specify one or the other, but not both. NOTE: it is perfectly valid to not specify either, in which case no file is uploaded, but form variables are encoded using multipart/form-data instead of the usual encoding (as noted above).

If you specify either -file or -data you must supply a value for -name, which is the name of the <INPUT TYPE="file" NAME="..."> form tag.

Specify the -binary switch if the file (or data) needs to be base-64 encoded. Not all servers seem to be able to handle this. (For example, http://mol-stage.usps.com/mml.adp, which expects to receive an XML file doesn't seem to grok any kind of Content-Transfer-Encoding.)

If you specify -file then -filename is optional (it can be inferred from the name of the file). However, if you specify -data then it is mandatory.

If -mime_type is not specified then ns_guesstype is used to try and find a mime type based on the filename. If ns_guesstype returns */* the generic value of application/octet-stream will be used.

Any form variables may be specified in one of four formats:

  • array (list of key value pairs like what [array get] returns)
  • formvars (list of url encoded formvars, i.e. foo=bar&x=1)
  • ns_set (an ns_set containing key/value pairs)
  • vars (a list of Tcl vars to grab from the calling environment)

-rqset specifies an ns_set of extra headers to send to the server when doing the POST.

timeout, depth, and http_referer are optional, and are included as optional positional variables in the same order they are used in util_httppost. NOTE: util_http_file_upload does not (currently) follow any redirects, so depth is superfluous.

Switches:
-file (optional)
-data (optional)
-binary (optional, boolean)
-filename (optional)
-name (optional)
-mime_type (optional, defaults to "*/*")
-mode (optional, defaults to "formvars")
-rqset (optional)
Parameters:
url (required)
formvars (optional)
timeout (optional, defaults to "30")
depth (optional, defaults to "10")
http_referer (optional)
Author:
Michael A. Cleverly <michael@cleverly.com>
Created:
3 September 2002
See Also:

Testcases:
No testcase defined.

util_httpget (public, deprecated)

 util_httpget url [ headers ] [ timeout ] [ depth ]
Deprecated. Invoking this procedure generates a warning.

util_httpget simply calls util::http::get which also returns status and last_modified

Parameters:
url (required)
headers (optional)
timeout (optional, defaults to "30")
depth (optional, defaults to "0")
See Also:

Testcases:
No testcase defined.

util_httpopen (public, deprecated)

 util_httpopen method url [ rqset ] [ timeout ] [ http_referer ]
Deprecated. Invoking this procedure generates a warning.

Like ns_httpopen but works for POST as well; called by util_httppost

Parameters:
method (required)
url (required)
rqset (optional)
timeout (optional, defaults to "30")
http_referer (optional)
See Also:

Testcases:
No testcase defined.

util_httppost (public, deprecated)

 util_httppost url formvars [ timeout ] [ depth ] [ http_referer ]
Deprecated. Invoking this procedure generates a warning.

Returns the result of POSTing to another Web server or -1 if there is an error or timeout. formvars should be in the form \"arg1=value1&arg2=value2\".

post is encoded as application/x-www-form-urlencoded. See util_http_file_upload for file uploads via post (encoded multipart/form-data).

Parameters:
url (required)
formvars (required)
timeout (optional, defaults to "30")
depth (optional, defaults to "0")
http_referer (optional)
See Also:

Testcases:
No testcase defined.

util_link_responding_p (public, deprecated)

 util_link_responding_p url [ list_of_bad_codes ]
Deprecated. Invoking this procedure generates a warning.

Returns 1 if the URL is responding (generally we think that anything other than 404 (not found) is okay).

Parameters:
url (required)
list_of_bad_codes (optional, defaults to "404")
See Also:

Testcases:
No testcase defined.

util_list_to_ns_set (public, deprecated)

 util_list_to_ns_set aList
Deprecated. Invoking this procedure generates a warning.

Convert a list in the form "key value key value ..." into an ns_set. DEPRECATED: this proc can be replaced with a oneliner using list expansion.

Parameters:
aList (required)
The list to convert
Returns:
The id of a (non-persistent) ns_set
See Also:
  • ns_set create ?name? ?key? ?value? ...

Testcases:
No testcase defined.

util_maybe_convert_to_html (public, deprecated)

 util_maybe_convert_to_html raw_string html_p
Deprecated. Invoking this procedure generates a warning.

This proc is deprecated. Use ad_convert_to_html instead.

Parameters:
raw_string (required)
html_p (required)
See Also:

Testcases:
No testcase defined.

util_ns_set_to_list (public, deprecated)

 util_ns_set_to_list -set set
Deprecated. Invoking this procedure generates a warning.

Convert an ns_set into a list suitable for passing in to the "array set" command (key value key value ...). DEPRECATED: ns_set array is an equivalent oneliner

Switches:
-set (required)
The ns_set to convert
Returns:
An array of equivalent keys and values as the ns_set specified.
See Also:
  • ns_set array

Testcases:
No testcase defined.

util_quote_double_quotes (public, deprecated)

 util_quote_double_quotes arg
Deprecated. Invoking this procedure generates a warning.

This proc does exactly the same as ns_quotehtml. Use that instead. This one will be deleted eventually.

Parameters:
arg (required)
See Also:
  • ns_quotehtml

Testcases:
No testcase defined.

util_quotehtml (public, deprecated)

 util_quotehtml arg
Deprecated. Invoking this procedure generates a warning.

This proc does exactly the same as ns_quotehtml. Use that instead. This one will be deleted eventually.

Parameters:
arg (required)
See Also:
  • ns_quotehtml

Testcases:
No testcase defined.

util_search_list_of_lists (public, deprecated)

 util_search_list_of_lists list_of_lists query_string \
    [ sublist_element_pos ]
Deprecated. Invoking this procedure generates a warning.

Returns position of sublist that contains QUERY_STRING at SUBLIST_ELEMENT_POS. The function can be replaced by "lsearch -index $pos $list_of_lists $query_string"

Parameters:
list_of_lists (required)
query_string (required)
sublist_element_pos (optional, defaults to "0")
See Also:
  • lsearch

Testcases:
No testcase defined.

util_striphtml (public, deprecated)

 util_striphtml html
Deprecated. Invoking this procedure generates a warning.

Deprecated. Use ad_html_to_text instead.

Parameters:
html (required)
See Also:

Testcases:
No testcase defined.

util_unlist (public, deprecated)

 util_unlist list [ args... ]
Deprecated. Invoking this procedure generates a warning.

Places the nth element of list into the variable named by the nth element of args. One should use the built-in Tcl command "lassign" instead of this proc.

Parameters:
list (required)
See Also:
  • lassign

Testcases:
No testcase defined.

validate_ad_dateentrywidget (public, deprecated)

 validate_ad_dateentrywidget field_name column form [ allow_null ]
Deprecated. Invoking this procedure generates a warning.

validate via ad_page_contract

Parameters:
field_name (required)
column (required)
form (required)
allow_null (optional, defaults to "0")
See Also:

Testcases:
No testcase defined.

validate_integer (public, deprecated)

 validate_integer field_name string
Deprecated. Invoking this procedure generates a warning.

Throws an error if the string isn't a decimal integer; otherwise strips any leading zeros (so this won't work for octals) and returns the result.

validate via ad_page_contract

Parameters:
field_name (required)
string (required)
See Also:

Testcases:
No testcase defined.

validate_zip_code (public, deprecated)

 validate_zip_code field_name zip_string country_code
Deprecated. Invoking this procedure generates a warning.

Given a string, signals an error if it's not a legal zip code

validate via ad_page_contract

Parameters:
field_name (required)
zip_string (required)
country_code (required)
See Also:

Testcases:
No testcase defined.

value_if_exists (public, deprecated)

 value_if_exists var_name
Deprecated. Invoking this procedure generates a warning.

If the specified variable exists in the calling environment, returns the value of that variable. Otherwise, returns the empty_string. DEPRECATED: this proc does not respect OpenACS naming convention and can be replaced with a plain tcl oneliner.

Parameters:
var_name (required)
See Also:
  • plain tcl idioms

Testcases:
No testcase defined.

with_catch (public, deprecated)

 with_catch error_var body on_error
Deprecated. Invoking this procedure generates a warning.

execute code in body with the catch errorMessage in error_var and if there is a nonzero return code from body execute the on_error block. DEPRECATED: does not comply with OpenACS naming convention and can be replaced with better api such as ad_try or native Tcl constructs such as ::try (8.6)

Parameters:
error_var (required)
body (required)
on_error (required)
See Also:

Testcases:
No testcase defined.

with_finally (public, deprecated)

 with_finally -code code -finally finally
Deprecated. Invoking this procedure generates a warning.

Execute CODE, then execute cleanup code FINALLY. If CODE completes normally, its value is returned after executing FINALLY. If CODE exits non-locally (as with error or return), FINALLY is executed anyway.

Switches:
-code (required)
Code to be executed that could throw and error
-finally (required)
Cleanup code to be executed even if an error occurs DEPRECATED: does not comply with OpenACS naming convention and can be replaced with better api such as ad_try or native Tcl constructs such as ::try (8.6)
See Also:

Testcases:
No testcase defined.
[ show source ]