Index: openacs-4/packages/xotcl-core/xotcl-core.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/xotcl-core.info,v diff -u -r1.29 -r1.30 --- openacs-4/packages/xotcl-core/xotcl-core.info 14 Jul 2007 18:01:13 -0000 1.29 +++ openacs-4/packages/xotcl-core/xotcl-core.info 22 Jul 2007 12:35:19 -0000 1.30 @@ -8,10 +8,10 @@ t xotcl - + Gustaf Neumann XOTcl library functionality (e.g. thread handling, online documentation, Generic Form and List Classes) - 2007-07-14 + 2007-07-22 This component contains some core functionality for OACS applications using XOTcl. It includes XOTcl thread handling for OACS (supporting persistent and @@ -39,7 +39,7 @@ BSD-Style 0 - + Index: openacs-4/packages/xotcl-core/catalog/xotcl-core.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/catalog/xotcl-core.de_DE.ISO-8859-1.xml,v diff -u -r1.5 -r1.6 --- openacs-4/packages/xotcl-core/catalog/xotcl-core.de_DE.ISO-8859-1.xml 25 Jun 2007 12:15:46 -0000 1.5 +++ openacs-4/packages/xotcl-core/catalog/xotcl-core.de_DE.ISO-8859-1.xml 22 Jul 2007 12:35:20 -0000 1.6 @@ -1,5 +1,5 @@ - + Neu: %type% Neue Seite vom Type %type% erzeugen Index: openacs-4/packages/xotcl-core/catalog/xotcl-core.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/catalog/xotcl-core.en_US.ISO-8859-1.xml,v diff -u -r1.7 -r1.8 --- openacs-4/packages/xotcl-core/catalog/xotcl-core.en_US.ISO-8859-1.xml 12 Jul 2007 17:57:02 -0000 1.7 +++ openacs-4/packages/xotcl-core/catalog/xotcl-core.en_US.ISO-8859-1.xml 22 Jul 2007 12:35:20 -0000 1.8 @@ -1,5 +1,5 @@ - + Add %type% Add new item of type %type% @@ -8,8 +8,8 @@ Edit %type% has entered the room Live Revision - <blockquote> -You don't have sufficient permissions for performing method %method% on object %object%. + <blockquote> +You don't have sufficient permissions for performing method %method% on object %object%. </blockquote> Revisions of Entry Revisions 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 -r1.18 -r1.19 --- openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 25 Jun 2007 13:45:26 -0000 1.18 +++ openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 22 Jul 2007 12:35:20 -0000 1.19 @@ -522,7 +522,7 @@ set href [export_vars -base [ad_conn url] $query] html::a -href $href -title $title { html::t [my _ label] - html::img -src $img -alt "" + html::img -src $img -alt "" -border 0 } } Index: openacs-4/packages/xotcl-core/tcl/generic-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/generic-procs.tcl,v diff -u -r1.81 -r1.82 --- openacs-4/packages/xotcl-core/tcl/generic-procs.tcl 16 Jul 2007 12:01:34 -0000 1.81 +++ openacs-4/packages/xotcl-core/tcl/generic-procs.tcl 22 Jul 2007 12:35:20 -0000 1.82 @@ -212,15 +212,16 @@ $o destroy_on_cleanup foreach att [$o children] { - $att instvar attribute_name datatype pretty_name sqltype default + $att instvar attribute_name datatype pretty_name sqltype references default # provide a default pretty name for the attribute based on message keys if {![info exists pretty_name]} { set pretty_name "#xowiki.[namespace tail [self]]-$attribute_name#" } set column_spec [::xo::db::sql map_datatype $sqltype] #my log "--SQL $attribute_name datatype=$datatype, sqltype=$sqltype, column_spec=$column_spec" - if {[info exists default]} {append column_spec " default '$default'" } + if {[info exists references]} {append column_spec " references $references" } + if {[info exists default]} {append column_spec " default '$default'" } append column_spec " " \ [::xo::db::sql datatype_constraint $sqltype [my table_name] $attribute_name] @@ -480,6 +481,11 @@ and i.item_id = n.item_id \ and o.object_id = $revision_id" } else { +my log "select [join $atts ,], i.parent_id \ + from [my set table_name]i n, cr_items i, acs_objects o \ + where i.item_id = $item_id \ + and n.[my id_column] = coalesce(i.live_revision, i.latest_revision) \ + and o.object_id = i.item_id" $object db_1row [my qn fetch_from_view_item_id] "\ select [join $atts ,], i.parent_id \ from [my set table_name]i n, cr_items i, acs_objects o \ @@ -675,7 +681,7 @@ } Class create Attribute -parameter { - attribute_name datatype pretty_name {sqltype "text"} + attribute_name datatype pretty_name {sqltype "text"} references default help_text spec validator } @@ -691,14 +697,14 @@ # dummy action, to be refined } - CrItem ad_proc instantiate { + CrItem ad_proc get_object_type { -item_id {-revision_id 0} } { - Instantiate the live revision or the specified revision of an - CrItem. - @return object containing the attributes of the CrItem - } { + Return the object type for an item_id or revision_id. + + @retun object_type typically an XOTcl class + } { set object_type [ns_cache eval xotcl_object_type_cache \ [expr {$item_id ? $item_id : $revision_id}] { if {$item_id} { @@ -708,6 +714,17 @@ } return $object_type }] + } + + CrItem ad_proc instantiate { + -item_id + {-revision_id 0} + } { + Instantiate the live revision or the specified revision of an + CrItem. + @return object containing the attributes of the CrItem + } { + set object_type [my get_object_type -item_id $item_id -revision_id $revision_id] #if {![string match "::*" $object_type]} {set object_type ::$object_type} return [$object_type instantiate -item_id $item_id -revision_id $revision_id] } @@ -718,8 +735,7 @@ } { Delete a CrItem in the database } { - db_1row [my qn get_class_and_folder] \ - "select content_type as object_type from cr_items where item_id = $item_id" + set object_type [my get_object_type -item_id $item_id] $object_type delete -item_id $item_id }