Class ::xo::db::sql::content_keyword (public)
::xo::db::Class ::xo::db::sql::content_keyword
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::content_keyword {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_keyword
set :security_inherit_p t
set :sql_package_name content_keyword
set :supertype acs_object
set :with_table true}
::xo::db::sql::content_keyword proc is_assigned {{-dbn {}} -item_id:required -keyword_id:required {-recurse none}} {
foreach var [list ITEM_ID KEYWORD_ID RECURSE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_keyword__is_assigned($_ITEM_ID, $_KEYWORD_ID, $_RECURSE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc new {{-dbn {}} -heading:required -description -parent_id -keyword_id {-creation_date now} -creation_user -creation_ip {-object_type content_keyword} -package_id -childof} {
foreach var [list HEADING DESCRIPTION PARENT_ID KEYWORD_ID CREATION_DATE CREATION_USER CREATION_IP OBJECT_TYPE 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 content_keyword__new($_HEADING, $_DESCRIPTION, $_PARENT_ID, $_KEYWORD_ID, $_CREATION_DATE, $_CREATION_USER, $_CREATION_IP, $_OBJECT_TYPE, $_PACKAGE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc delete {{-dbn {}} -keyword_id:required} {
foreach var [list KEYWORD_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_keyword__delete($_KEYWORD_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc set_heading {{-dbn {}} -keyword_id:required -heading:required} {
foreach var [list KEYWORD_ID HEADING] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_keyword__set_heading($_KEYWORD_ID, $_HEADING)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc get_description {{-dbn {}} -keyword_id:required} {
foreach var [list KEYWORD_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_keyword__get_description($_KEYWORD_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc is_leaf {{-dbn {}} -keyword_id:required} {
foreach var [list KEYWORD_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_keyword__is_leaf($_KEYWORD_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc item_assign {{-dbn {}} -item_id:required -keyword_id:required -context_id -creation_user -creation_ip} {
foreach var [list ITEM_ID KEYWORD_ID CONTEXT_ID CREATION_USER CREATION_IP] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_keyword__item_assign($_ITEM_ID, $_KEYWORD_ID, $_CONTEXT_ID, $_CREATION_USER, $_CREATION_IP)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc get_path {{-dbn {}} -keyword_id:required} {
foreach var [list KEYWORD_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_keyword__get_path($_KEYWORD_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc get_heading {{-dbn {}} -keyword_id:required} {
foreach var [list KEYWORD_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_keyword__get_heading($_KEYWORD_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc del {{-dbn {}} -keyword_id:required} {
foreach var [list KEYWORD_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_keyword__del($_KEYWORD_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc item_unassign {{-dbn {}} -item_id:required -keyword_id:required} {
foreach var [list ITEM_ID KEYWORD_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_keyword__item_unassign($_ITEM_ID, $_KEYWORD_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_keyword proc set_description {{-dbn {}} -keyword_id:required -description:required} {
foreach var [list KEYWORD_ID DESCRIPTION] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_keyword__set_description($_KEYWORD_ID, $_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 ]