- Publicity: Public Only All
package-procs.tcl
Procs to help build PL/SQL packages
- Location:
- packages/acs-subsite/tcl/package-procs.tcl
- Created:
- Wed Dec 27 16:02:44 2000
- Author:
- mbryzek@arsdigita.com
- CVS Identification:
$Id: package-procs.tcl,v 1.40.2.11 2024/07/25 13:08:52 mischa Exp $
Procedures in this file
- package_exec_plsql (public)
- package_instantiate_object (public)
- package_object_attribute_list (public)
- package_object_view (public)
- package_object_view_reset (public)
- package_recreate_hierarchy (public)
- package_type_dynamic_p (public)
Detailed information
package_exec_plsql (public)
package_exec_plsql [ -var_list var_list ] package_name object_name
Calls a pl/[pg]sql proc/func defined within the object type's package. Use of this Tcl API proc avoids the need for the developer to write separate SQL for each RDBMS we support.
- Switches:
- -var_list (optional)
- A list of pairs of additional attributes and their values to pass to the constructor. Each pair is a list of two elements: key => value
- Parameters:
- package_name (required)
- The PL/[pg]SQL package
- object_name (required)
- The PL/[pg]SQL function within the package
- Returns:
- empty string for procs, function return value for funcs
Example:
set var_list [list [list group_id $group_id]] package_exec_plsql -var_list $var_list group delete- Author:
- Don Baccus <dhogaza@pacifier.com>
- Created:
- 12/31/2003
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- auth_authenticate
package_instantiate_object (public)
package_instantiate_object [ -creation_user creation_user ] \ [ -creation_ip creation_ip ] [ -package_name package_name ] \ [ -var_list var_list ] [ -extra_vars extra_vars ] \ [ -start_with start_with ] [ -form_id form_id ] \ [ -variable_prefix variable_prefix ] object_type
Creates a new object of the specified type by calling the associated PL/SQL package new function.
- Switches:
- -creation_user (optional)
- The current user. Defaults to
[ad_conn user_id]
if not specified and there is a connection- -creation_ip (optional)
- The current user's IP address. Defaults to
[ad_conn peeraddr]
if not specified and there is a connection- -package_name (optional)
- The PL/SQL package associated with this object type. Defaults to
acs_object_types.package_name
- -var_list (optional)
- A list of pairs of additional attributes and their values to pass to the constructor. Each pair is a list of two elements: key => value
- -extra_vars (optional)
- an ns_set of extra vars
- -start_with (optional)
- The object type to start with when gathering attributes for this object type. Defaults to the object type.
- -form_id (optional)
- The form id from templating form system if we're using the forms API to specify attributes
- -variable_prefix (optional)
- Parameters:
- object_type (required)
- The object type of the object we are instantiating
- Returns:
- The object id of the newly created object
Example:
template::form create add_group template::element create add_group group_name -value "Publisher" set var_list [list [list context_id $context_id] [list group_id $group_id]] return [package_instantiate_object -start_with "group" -var_list $var_list -form_id "add_group" "group"]- Authors:
- Michael Bryzek <mbryzek@arsdigita.com>
- Ben Adida <ben@openforce.net>
- Created:
- 02/01/2001
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- auth_authenticate, auth_create_user, object_p, category_tree_procs
package_object_attribute_list (public)
package_object_attribute_list [ -start_with start_with ] \ [ -include_storage_types include_storage_types ] object_type
Returns a list of lists all the attributes (column name or attribute_name) to be used for this object type. Each list elements contains:
(attribute_id, table_name, attribute_name, pretty_name, datatype, required_p, default_value)
- Switches:
- -start_with (optional, defaults to
"acs_object"
)- The highest parent object type for which to include attributes
- -include_storage_types (optional, defaults to
"type_specific"
)- Parameters:
- object_type (required)
- The object type for which to include attributes
- Author:
- Michael Bryzek <mbryzek@arsdigita.com>
- Created:
- 12/29/2000
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- image_new, content_item
package_object_view (public)
package_object_view [ -refresh_p refresh_p ] \ [ -start_with start_with ] object_type
Returns a select statement to be used as an inner view for selecting out all the attributes for the object_type. util_memoizes the result
- Switches:
- -refresh_p (optional, defaults to
"f"
)- If t, force a reload of the cache
- -start_with (optional, defaults to
"acs_object"
)- The highest parent object type for which to include attributes
- Parameters:
- object_type (required)
- The object for which to create a package spec
- Author:
- Michael Bryzek <mbryzek@arsdigita.com>
- Created:
- 10/2000
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
package_object_view_reset (public)
package_object_view_reset object_type
Resets the cached views for all chains (e.g. all variations of start_with in package_object_view) for the specified object type.
- Parameters:
- object_type (required)
- Author:
- Michael Bryzek <mbryzek@arsdigita.com>
- Created:
- 12/2000
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
package_recreate_hierarchy (public)
package_recreate_hierarchy object_type
Recreates all the packages for the hierarchy starting with the specified object type down to a leaf. Resets the package_object_view cache. Note: Only updates packages for dynamic objects (those with dynamic_p set to t)
- Parameters:
- object_type (required)
- The object type for which to recreate packages, including all children types.
- Author:
- Michael Bryzek <mbryzek@arsdigita.com>
- Created:
- 12/28/2000
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
package_type_dynamic_p (public)
package_type_dynamic_p object_type
Returns 1 if the object type is dynamic. 0 otherwise
- Parameters:
- object_type (required)
- Author:
- Michael Bryzek <mbryzek@arsdigita.com>
- Created:
- 12/30/2000
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.