Class ::xo::db::sql::acs_object (public)
::xo::db::Class ::xo::db::sql::acs_object
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::acs_object {set :__default_metaclass ::xotcl::Class
set :__default_superclass ::xotcl::Object
set :abstract_p f
set :auto_save false
set :name_method {}
set :object_type ::xo::db::sql::acs_object
set :security_inherit_p t
set :sql_package_name acs_object
set :supertype acs_object
set :with_table true}
::xo::db::sql::acs_object proc initialize_attributes {{-dbn {}} -object_id:required} {
foreach var [list OBJECT_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__initialize_attributes($_OBJECT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc check_context_index {{-dbn {}} -object_id:required -ancestor_id:required -n_generations:required} {
foreach var [list OBJECT_ID ANCESTOR_ID N_GENERATIONS] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__check_context_index($_OBJECT_ID, $_ANCESTOR_ID, $_N_GENERATIONS)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc new {{-dbn {}} -object_id {-object_type acs_object} {-creation_date now()} -creation_user -creation_ip -context_id {-security_inherit_p t} -title -package_id -childof} {
foreach var [list OBJECT_ID OBJECT_TYPE CREATION_DATE CREATION_USER CREATION_IP CONTEXT_ID SECURITY_INHERIT_P TITLE PACKAGE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__new($_OBJECT_ID, $_OBJECT_TYPE, $_CREATION_DATE, $_CREATION_USER, $_CREATION_IP, $_CONTEXT_ID, $_SECURITY_INHERIT_P, $_TITLE, $_PACKAGE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc check_path {{-dbn {}} -object_id:required -ancestor_id:required} {
foreach var [list OBJECT_ID ANCESTOR_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__check_path($_OBJECT_ID, $_ANCESTOR_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc delete {{-dbn {}} -object_id:required} {
foreach var [list OBJECT_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__delete($_OBJECT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc get_attribute {{-dbn {}} -object_id_in:required -attribute_name_in:required} {
foreach var [list OBJECT_ID_IN ATTRIBUTE_NAME_IN] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__get_attribute($_OBJECT_ID_IN, $_ATTRIBUTE_NAME_IN)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc get_attr_storage_table {{-dbn {}} -v_vals:required} {
foreach var [list V_VALS] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__get_attr_storage_table($_V_VALS)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc default_name {{-dbn {}} -object_id:required} {
foreach var [list OBJECT_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__default_name($_OBJECT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc check_object_descendants {{-dbn {}} -object_id:required -descendant_id:required -n_generations:required} {
foreach var [list OBJECT_ID DESCENDANT_ID N_GENERATIONS] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__check_object_descendants($_OBJECT_ID, $_DESCENDANT_ID, $_N_GENERATIONS)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc get_attribute_storage {{-dbn {}} -object_id_in:required -attribute_name_in:required} {
foreach var [list OBJECT_ID_IN ATTRIBUTE_NAME_IN] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__get_attribute_storage($_OBJECT_ID_IN, $_ATTRIBUTE_NAME_IN)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc package_id {{-dbn {}} -object_id:required} {
foreach var [list OBJECT_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__package_id($_OBJECT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc name {{-dbn {}} -object_id:required} {
foreach var [list OBJECT_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__name($_OBJECT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc get_attr_storage_column {{-dbn {}} -v_vals:required} {
foreach var [list V_VALS] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__get_attr_storage_column($_V_VALS)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc check_object_ancestors {{-dbn {}} -object_id:required -ancestor_id:required -n_generations:required} {
foreach var [list OBJECT_ID ANCESTOR_ID N_GENERATIONS] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__check_object_ancestors($_OBJECT_ID, $_ANCESTOR_ID, $_N_GENERATIONS)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc get_attr_storage_sql {{-dbn {}} -v_vals:required} {
foreach var [list V_VALS] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__get_attr_storage_sql($_V_VALS)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc update_last_modified {{-dbn {}} -object_id:required -modifying_user:required -modifying_ip:required {-last_modified now()}} {
foreach var [list OBJECT_ID MODIFYING_USER MODIFYING_IP LAST_MODIFIED] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__update_last_modified($_OBJECT_ID, $_MODIFYING_USER, $_MODIFYING_IP, $_LAST_MODIFIED)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object proc set_attribute {{-dbn {}} -object_id_in:required -attribute_name_in:required -value_in:required} {
foreach var [list OBJECT_ID_IN ATTRIBUTE_NAME_IN VALUE_IN] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object__set_attribute($_OBJECT_ID_IN, $_ATTRIBUTE_NAME_IN, $_VALUE_IN)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]