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 -r1.23 -r1.24 --- openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 3 Sep 2007 21:06:42 -0000 1.23 +++ openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 4 Sep 2007 11:31:18 -0000 1.24 @@ -80,6 +80,11 @@ } } } + + proc package_id_from_package_key { key } { + return [db_string dbqd.null.get_package_id_from_key \ + {select package_id from apm_packages where package_key = :key}] + } } ::xotcl::Object instforward db_1row -objscope 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 -r1.30 -r1.31 --- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 3 Sep 2007 21:06:42 -0000 1.30 +++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 4 Sep 2007 11:31:18 -0000 1.31 @@ -624,8 +624,6 @@ ::xo::db::Class proc create_all_functions {} { db_foreach [my qn ""] [::xo::db::sql set all_package_functions] { - #if {![my isobject $package_name]} { ::xo::db::Class create $package_name } - #$package_name dbproc_exportvars $object_name set class_name ::xo::db::sql::[string tolower $package_name] if {![my isobject $class_name]} { ::xo::db::Class create $class_name } $class_name dbproc_nonposargs [string tolower $object_name] @@ -768,7 +766,8 @@ my slots [subst { ::xo::db::Attribute create $id_column \ -pretty_name "ID" \ - -datatype integer + -datatype integer \ + -create_acs_attribute false }] set db_slot($id_column) [self]::slot::$id_column } @@ -1197,9 +1196,12 @@ {references ""} {min_n_values 1} {max_n_values 1} + {create_acs_attribute true} } ::xo::db::Attribute instproc create_attribute {} { + if {![my create_acs_attribute]} return + my instvar name datatype pretty_name min_n_values max_n_values domain set object_type [$domain object_type] if {[db_string dbqd..check_att {select 0 from acs_attributes where @@ -1271,10 +1273,7 @@ ::xo::db::Class create ::xo::db::CrAttribute \ -superclass {::xo::db::Attribute} \ -pretty_name "Cr Attribute" \ - -with_table false \ - -parameter { - {create_acs_attribute true} - } + -with_table false ::xo::db::CrAttribute instproc create_attribute {} { # do nothing, if create_acs_attribute is set to false Index: openacs-4/packages/xotcl-core/tcl/context-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/context-procs.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 26 Jun 2007 18:34:21 -0000 1.22 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 4 Sep 2007 11:31:18 -0000 1.23 @@ -343,7 +343,24 @@ # Meta-Class for Application Package Classes # - Class PackageMgr -superclass Class + Class PackageMgr -superclass Class -parameter { + package_key + } + + PackageMgr ad_instproc instances {{-include_unmounted false}} { + @return list of package_ids of xowiki instances + } { + my instvar package_key + if {$include_unmounted} { + return [db_list [my qn get_xowiki_packages] {select package_id \ + from apm_packages where package_key = :package_key}] + } else { + return [db_list [my qn get_mounted_packages] {select package_id \ + from apm_packages p, site_nodes s \ + where package_key = :package_key and s.object_id = p.package_id}] + } + } + PackageMgr ad_instproc initialize { -ad_doc {-parameter ""} @@ -427,7 +444,6 @@ Package instforward exists_form_parameter {%my set context} %proc Package instforward returnredirect {%my set context} %proc - Package instproc get_parameter {attribute {default ""}} { return [parameter::get -parameter $attribute -package_id [my id] \ -default $default] Index: openacs-4/packages/xotcl-core/tcl/cr-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/cr-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 3 Sep 2007 21:06:42 -0000 1.1 +++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 4 Sep 2007 11:31:18 -0000 1.2 @@ -123,11 +123,6 @@ my log "unknown called with $obj $args" } - # TODO this should go into 01-debug procs, or at least into the ::xo namespace - proc package_id_from_package_key { key } { - return [db_string dbqd.null.get_package_id_from_key \ - {select package_id from apm_packages where package_key = :key}] - } # # The following methods are used oracle, postgres specific code (locking, @@ -459,7 +454,8 @@ my create $object } set raw_atts [::xo::db::CrClass set common_query_atts] - my log "-- raw_atts = '$raw_atts'" + #my log "-- raw_atts = '$raw_atts'" + set atts [list] foreach v $raw_atts { switch -glob -- $v { Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.84 -r1.85 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 3 Sep 2007 21:07:53 -0000 1.84 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 4 Sep 2007 11:31:20 -0000 1.85 @@ -10,6 +10,7 @@ ::xo::PackageMgr create Package \ -superclass ::xo::Package \ + -package_key xowiki \ -parameter {{folder_id "[::xo::cc query_parameter folder_id 0]"}} Package ad_proc instantiate_page_from_id { @@ -42,19 +43,6 @@ return $page } - Package ad_proc instances {{-include_unmounted false}} { - @return list of package_ids of xowiki instances - } { - if {$include_unmounted} { - return [db_list [my qn get_xowiki_packages] {select package_id \ - from apm_packages where package_key = 'xowiki'}] - } else { - return [db_list [my qn get_mounted_packages] {select package_id \ - from apm_packages p, site_nodes s \ - where package_key = 'xowiki' and s.object_id = p.package_id}] - } - } - Package ad_proc get_url_from_id {{-item_id 0} {-revision_id 0}} { Get the full URL from a page in situations, where the context is not set up. @see instantiate_page_from_id Index: openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl,v diff -u -r1.33 -r1.34 --- openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 3 Sep 2007 21:07:53 -0000 1.33 +++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 4 Sep 2007 11:31:20 -0000 1.34 @@ -45,7 +45,7 @@ if {$to_version_name eq "0.13"} { ns_log notice "-- upgrading to 0.13" - set package_id [::Generic::package_id_from_package_key xowiki] + set package_id [::xo::package_id_from_package_key xowiki] set folder_id [::xowiki::Page require_folder \ -package_id $package_id \ -content_types ::xowki::Page* \