Class ::xo::db::sql::content_template (public)
::xo::db::Class ::xo::db::sql::content_template
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::content_template {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::content_template
set :security_inherit_p t
set :sql_package_name content_template
set :supertype acs_object
set :with_table true}
::xo::db::sql::content_template proc get_path {{-dbn {}} -template_id:required {-root_folder_id content_template_globals.c_root_folder_id}} {
foreach var [list TEMPLATE_ID ROOT_FOLDER_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_template__get_path($_TEMPLATE_ID, $_ROOT_FOLDER_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_template proc del {{-dbn {}} -template_id:required} {
foreach var [list TEMPLATE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_template__del($_TEMPLATE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_template proc new {{-dbn {}} -name:required -parent_id -template_id {-creation_date now} -creation_user -creation_ip -text {-is_live f} -childof} {
foreach var [list NAME PARENT_ID TEMPLATE_ID CREATION_DATE CREATION_USER CREATION_IP TEXT IS_LIVE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_template__new($_NAME, $_PARENT_ID, $_TEMPLATE_ID, $_CREATION_DATE, $_CREATION_USER, $_CREATION_IP, $_TEXT, $_IS_LIVE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_template proc get_root_folder {{-dbn {}}} {
foreach var [list ] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_template__get_root_folder()
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_template proc is_template {{-dbn {}} -template_id:required} {
foreach var [list TEMPLATE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_template__is_template($_TEMPLATE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_template proc delete {{-dbn {}} -template_id:required} {
foreach var [list TEMPLATE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_template__delete($_TEMPLATE_ID)
"
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 ]