Index: openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl,v diff -u -N -r1.43 -r1.44 --- openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 7 Jan 2010 11:51:36 -0000 1.43 +++ openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 14 Jan 2010 10:34:57 -0000 1.44 @@ -36,7 +36,7 @@ {domain "[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::xotcl::self]] 1]"} {multivalued false} {required false} - default + default type spec pretty_name @@ -65,6 +65,13 @@ } } +if {[info command ::xotcl2::Object] ne ""} { + ns_log notice "Defining minimal XOTcl 1 compatibility for XOTcl 2 Classes" + ::xotcl::alias ::xo::Attribute instvar ::xotcl::cmd::Object::instvar + ::xotcl::alias ::xo::Attribute set -objscope ::set + ::xotcl::Slot method istype {class} {::xotcl::is [self] type $class} +} + namespace eval ::xo { ::xo::Attribute instproc init {} { my instvar name pretty_name @@ -73,11 +80,11 @@ if {![info exists pretty_name]} { set object_type [my domain] if {[regexp {^::([^:]+)::} $object_type _ head]} { - set tail [namespace tail $object_type] - set pretty_name "#$head.$tail-$name#" - #my log "--created pretty_name = $pretty_name" + set tail [namespace tail $object_type] + set pretty_name "#$head.$tail-$name#" + #my log "--created pretty_name = $pretty_name" } else { - error "Cannot determine automatically message key for pretty name. \ + error "Cannot determine automatically message key for pretty name. \ Use namespaces for classes" } } Index: openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl,v diff -u -N -r1.87 -r1.88 --- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 12 Dec 2009 10:48:20 -0000 1.87 +++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 14 Jan 2010 10:34:57 -0000 1.88 @@ -38,6 +38,7 @@ -parameter XOTclObjectTypeCacheSize \ -default 10000] } + # # A few helper functions # @@ -351,6 +352,7 @@ } } + namespace eval ::xo::db { # # ::xo::db::Class is a meta class for interfacing with acs_object_types. @@ -381,7 +383,7 @@ @see ::xo::db::Object } - ::xo::db::Class set __default_superclass ::xo::db::Object ;# will be supported in XOTcl 1.6 + #::xo::db::Class set __default_superclass ::xo::db::Object ;# will be supported in XOTcl 1.6 # # Define an XOTcl interface for creating new object types @@ -842,8 +844,6 @@ } - - ::xo::db::Class instproc dbproc_nonposargs {object_name} { # # This method compiles a stored procedure into a xotcl method @@ -1034,6 +1034,7 @@ } ::xo::db::Class instproc db_slots {} { + my instvar id_column db_slot array set db_slot [list] # @@ -1190,6 +1191,7 @@ } ::xo::db::Class instproc init {} { + if {![::xo::db::Class object_type_exists_in_db -object_type [my object_type]]} { my create_object_type } @@ -1303,7 +1305,6 @@ return ::$id } - ################## # query interface ################## @@ -1348,6 +1349,7 @@ are initialized via initialize_loaded_object, when the are of type ::xo::db::Object } { + if {$object_class eq ""} {set object_class [self]} if {$sql eq ""} {set sql [my instance_select_query]} if {$as_ordered_composite} { Index: openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl 26 Nov 2009 12:02:16 -0000 1.13 +++ openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl 14 Jan 2010 10:34:57 -0000 1.14 @@ -141,8 +141,15 @@ # # Complete some slot definitions: # - package_key configure -required true - default_value configure -required true + # TODO: the following two settings making package_key and + # default_value required are semantically correct. However, this + # prohibits that apm_parameters can be created via ::xo::db::Class + # instantiate_objects, since this functions tries to create + # objects first without parameters. + # + #package_key configure -required true + #default_value configure -required true + section_name configure -default "" } Index: openacs-4/packages/xotcl-core/tcl/20-Ordered-Composite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/20-Ordered-Composite-procs.tcl,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/xotcl-core/tcl/20-Ordered-Composite-procs.tcl 6 May 2008 12:36:07 -0000 1.13 +++ openacs-4/packages/xotcl-core/tcl/20-Ordered-Composite-procs.tcl 14 Jan 2010 10:34:57 -0000 1.14 @@ -94,7 +94,8 @@ } Class OrderedComposite::ChildManager -instproc init args { set r [next] - [self callingobject] lappend __children [self] + [my info parent] lappend __children [self] + #[self callingobject] lappend __children [self] my set __parent [self callingobject] #my __after_insert #my log "-- adding __parent [self callingobject] to [self]" Index: openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl,v diff -u -N -r1.44 -r1.45 --- openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 11 Dec 2009 11:28:27 -0000 1.44 +++ openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 14 Jan 2010 10:34:57 -0000 1.45 @@ -382,10 +382,10 @@ set cl [self class] [self] mixin ${cl}::$renderer foreach child [$cl info classchildren] { - #my log "-- $child heritage [$child info heritage]" - if {[$child info heritage ::xo::OrderedComposite::Child] eq ""} continue + #my log "-- $child class [$child info class] " set mixinname ${cl}::${renderer}::[namespace tail $child] if {[::xotcl::Object isclass $mixinname]} { + #if {![$child istype ::xo::OrderedComposite::Child]} continue $child instmixin $mixinname if {$trn_mixin ne ""} {$child instmixin add $trn_mixin} #my log "-- $child using instmixin <[$child info instmixin]>" Index: openacs-4/packages/xotcl-core/tcl/http-client-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/http-client-procs.tcl,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/xotcl-core/tcl/http-client-procs.tcl 29 Dec 2008 02:17:48 -0000 1.23 +++ openacs-4/packages/xotcl-core/tcl/http-client-procs.tcl 14 Jan 2010 10:34:57 -0000 1.24 @@ -121,15 +121,15 @@ Class create HttpCore \ -slots { - Attribute host - Attribute protocol -default "http" - Attribute port - Attribute path -default "/" - Attribute url - Attribute post_data -default "" - Attribute content_type -default "text/plain" - Attribute request_header_fields -default {} - Attribute user_agent -default "xohttp/0.2" + Attribute create host + Attribute create protocol -default "http" + Attribute create port + Attribute create path -default "/" + Attribute create url + Attribute create post_data -default "" + Attribute create content_type -default "text/plain" + Attribute create request_header_fields -default {} + Attribute create user_agent -default "xohttp/0.2" } # Provide for mapping from HTTP charset encoding labels @@ -439,7 +439,7 @@ # Class HttpRequest -superclass HttpCore -slots { - Attribute timeout -type integer + Attribute create timeout -type integer } HttpRequest instproc init {} { @@ -507,8 +507,8 @@ # Class AsyncHttpRequest -superclass HttpCore -slots { - Attribute timeout -type integer -default 10000 ;# 10 seconds - Attribute request_manager + Attribute create timeout -type integer -default 10000 ;# 10 seconds + Attribute create request_manager } AsyncHttpRequest instproc set_timeout {} { my cancel_timeout @@ -668,7 +668,7 @@ Class create AsyncHttpRequest::RequestManager \ -superclass AsyncHttpRequest::SimpleListener \ -slots { - Attribute condition + Attribute create condition } -instproc finalize {obj status value} { # set the result and do the notify my instvar condition