Class ::xo::db::sql::content_revision (public)
::xo::db::Class ::xo::db::sql::content_revision
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::content_revision {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_revision
set :security_inherit_p t
set :sql_package_name content_revision
set :supertype acs_object
set :with_table true}
::xo::db::sql::content_revision proc get_number {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__get_number($_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc copy_attributes {{-dbn {}} -content_type:required -revision_id:required -copy_id:required} {
foreach var [list CONTENT_TYPE REVISION_ID COPY_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_revision__copy_attributes($_CONTENT_TYPE, $_REVISION_ID, $_COPY_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc get_content {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__get_content($_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc new {{-dbn {}} -title:required -description {-publish_date now()} {-mime_type text/plain} -nls_language {-text { }} -item_id:required -revision_id {-creation_date now()} -creation_user -creation_ip -content_length -package_id -childof} {
foreach var [list TITLE DESCRIPTION PUBLISH_DATE MIME_TYPE NLS_LANGUAGE TEXT ITEM_ID REVISION_ID CREATION_DATE CREATION_USER CREATION_IP CONTENT_LENGTH 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_revision__new($_TITLE, $_DESCRIPTION, $_PUBLISH_DATE, $_MIME_TYPE, $_NLS_LANGUAGE, $_TEXT, $_ITEM_ID, $_REVISION_ID, $_CREATION_DATE, $_CREATION_USER, $_CREATION_IP, $_CONTENT_LENGTH, $_PACKAGE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc is_live {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__is_live($_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc delete {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__delete($_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc copy {{-dbn {}} -revision_id:required -copy_id -target_item_id -creation_user -creation_ip} {
foreach var [list REVISION_ID COPY_ID TARGET_ITEM_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_revision__copy($_REVISION_ID, $_COPY_ID, $_TARGET_ITEM_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_revision proc to_html {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__to_html($_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc is_latest {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__is_latest($_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc to_temporary_clob {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__to_temporary_clob($_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc del {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__del($_REVISION_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc content_copy {{-dbn {}} -revision_id:required -revision_id_dest} {
foreach var [list REVISION_ID REVISION_ID_DEST] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select content_revision__content_copy($_REVISION_ID, $_REVISION_ID_DEST)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::content_revision proc revision_name {{-dbn {}} -revision_id:required} {
foreach var [list 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 content_revision__revision_name($_REVISION_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 ]