namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::acs_event {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_event
set :security_inherit_p t
set :sql_package_name acs_event
set :supertype acs_object
set :with_table true}
::xo::db::sql::acs_event proc activity_set {{-dbn {}} -event_id:required -activity_id:required} {
foreach var [list EVENT_ID ACTIVITY_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_event__activity_set($_EVENT_ID, $_ACTIVITY_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc get_name {{-dbn {}} -event_id:required} {
foreach var [list EVENT_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_event__get_name($_EVENT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc new {{-dbn {}} -event_id -name -description -html_p -status_summary -timespan_id -activity_id -recurrence_id {-object_type acs_event} {-creation_date now()} -creation_user -creation_ip -context_id -package_id -location -related_link_url -related_link_text -redirect_to_rel_link_p -childof} {
foreach var [list EVENT_ID NAME DESCRIPTION HTML_P STATUS_SUMMARY TIMESPAN_ID ACTIVITY_ID RECURRENCE_ID OBJECT_TYPE CREATION_DATE CREATION_USER CREATION_IP CONTEXT_ID PACKAGE_ID LOCATION RELATED_LINK_URL RELATED_LINK_TEXT REDIRECT_TO_REL_LINK_P] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_event__new($_EVENT_ID, $_NAME, $_DESCRIPTION, $_HTML_P, $_STATUS_SUMMARY, $_TIMESPAN_ID, $_ACTIVITY_ID, $_RECURRENCE_ID, $_OBJECT_TYPE, $_CREATION_DATE, $_CREATION_USER, $_CREATION_IP, $_CONTEXT_ID, $_PACKAGE_ID, $_LOCATION, $_RELATED_LINK_URL, $_RELATED_LINK_TEXT, $_REDIRECT_TO_REL_LINK_P)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc delete_all_recurrences {{-dbn {}} -recurrence_id} {
foreach var [list RECURRENCE_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_event__delete_all_recurrences($_RECURRENCE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc delete {{-dbn {}} -event_id:required} {
foreach var [list EVENT_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_event__delete($_EVENT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc delete_all {{-dbn {}} -event_id:required} {
foreach var [list EVENT_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_event__delete_all($_EVENT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc instances_exist_p {{-dbn {}} -recurrence_id:required} {
foreach var [list RECURRENCE_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_event__instances_exist_p($_RECURRENCE_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc get_description {{-dbn {}} -event_id:required} {
foreach var [list EVENT_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_event__get_description($_EVENT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc recurs_p {{-dbn {}} -event_id:required} {
foreach var [list EVENT_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_event__recurs_p($_EVENT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc recurrence_timespan_edit {{-dbn {}} -event_id:required -start_date:required -end_date:required -edit_past_events_p:required} {
foreach var [list EVENT_ID START_DATE END_DATE EDIT_PAST_EVENTS_P] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_event__recurrence_timespan_edit($_EVENT_ID, $_START_DATE, $_END_DATE, $_EDIT_PAST_EVENTS_P)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc timespan_set {{-dbn {}} -event_id:required -timespan_id:required} {
foreach var [list EVENT_ID TIMESPAN_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_event__timespan_set($_EVENT_ID, $_TIMESPAN_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc party_map {{-dbn {}} -event_id:required -party_id:required} {
foreach var [list EVENT_ID PARTY_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_event__party_map($_EVENT_ID, $_PARTY_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc new_instance {{-dbn {}} -event_id:required -date_offset:required} {
foreach var [list EVENT_ID DATE_OFFSET] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_event__new_instance($_EVENT_ID, $_DATE_OFFSET)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc party_unmap {{-dbn {}} -event_id:required -party_id:required} {
foreach var [list EVENT_ID PARTY_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_event__party_unmap($_EVENT_ID, $_PARTY_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc get_status_summary {{-dbn {}} -event_id:required} {
foreach var [list EVENT_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_event__get_status_summary($_EVENT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc get_html_p {{-dbn {}} -event_id:required} {
foreach var [list EVENT_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_event__get_html_p($_EVENT_ID)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc insert_instances {{-dbn {}} -event_id:required -cutoff_date} {
foreach var [list EVENT_ID CUTOFF_DATE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_event__insert_instances($_EVENT_ID, $_CUTOFF_DATE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc get_value {{-dbn {}} -parameter_name:required} {
foreach var [list PARAMETER_NAME] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_event__get_value($_PARAMETER_NAME)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc shift_all {{-dbn {}} -event_id {-start_offset 0} {-end_offset 0}} {
foreach var [list EVENT_ID START_OFFSET END_OFFSET] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_event__shift_all($_EVENT_ID, $_START_OFFSET, $_END_OFFSET)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_event proc shift {{-dbn {}} -event_id {-start_offset 0} {-end_offset 0}} {
foreach var [list EVENT_ID START_OFFSET END_OFFSET] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_event__shift($_EVENT_ID, $_START_OFFSET, $_END_OFFSET)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}