Class ::xo::db::sql::etp (public)
::xo::db::Class ::xo::db::sql::etp
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::etp {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::etp
set :security_inherit_p t
set :sql_package_name etp
set :supertype acs_object
set :with_table true}
::xo::db::sql::etp proc create_page {{-dbn {}} -item_id:required -package_id:required -name:required -title:required -content_type} {
foreach var [list ITEM_ID PACKAGE_ID NAME TITLE CONTENT_TYPE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select etp__create_page($_ITEM_ID, $_PACKAGE_ID, $_NAME, $_TITLE, $_CONTENT_TYPE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::etp proc get_relative_url {{-dbn {}} -item_id:required -name:required} {
foreach var [list ITEM_ID NAME] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select etp__get_relative_url($_ITEM_ID, $_NAME)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::etp proc get_title {{-dbn {}} -item_id:required -revision_title:required} {
foreach var [list ITEM_ID REVISION_TITLE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select etp__get_title($_ITEM_ID, $_REVISION_TITLE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::etp proc create_extlink {{-dbn {}} -item_id -package_id:required -url:required -title:required -description:required} {
foreach var [list ITEM_ID PACKAGE_ID URL TITLE DESCRIPTION] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select etp__create_extlink($_ITEM_ID, $_PACKAGE_ID, $_URL, $_TITLE, $_DESCRIPTION)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::etp proc create_symlink {{-dbn {}} -package_id:required -target_id:required} {
foreach var [list PACKAGE_ID TARGET_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select etp__create_symlink($_PACKAGE_ID, $_TARGET_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::etp proc create_new_revision {{-dbn {}} -package_id:required -name:required -user_id:required -revision_id:required} {
foreach var [list PACKAGE_ID NAME USER_ID REVISION_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select etp__create_new_revision($_PACKAGE_ID, $_NAME, $_USER_ID, $_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::etp proc get_attribute_value {{-dbn {}} -object_id:required -attribute_id:required} {
foreach var [list OBJECT_ID ATTRIBUTE_ID] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select etp__get_attribute_value($_OBJECT_ID, $_ATTRIBUTE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::etp proc get_folder_id {{-dbn {}} -package_id:required} {
foreach var [list 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 etp__get_folder_id($_PACKAGE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::etp proc get_description {{-dbn {}} -item_id:required -revision_description:required} {
foreach var [list ITEM_ID REVISION_DESCRIPTION] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select etp__get_description($_ITEM_ID, $_REVISION_DESCRIPTION)
"
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 ]