Index: openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 12 Sep 2008 20:02:20 -0000 1.10 +++ openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 1 Oct 2008 22:19:28 -0000 1.11 @@ -17,6 +17,12 @@ package_key } + PackageMgr ad_instproc first_instance {} { + @return return first mounted instance of this type + } { + ::xo::parameter get_package_id_from_package_key -package_key [my package_key] + } + PackageMgr ad_instproc instances {{-include_unmounted false}} { @return list of package_ids of xowiki instances } { @@ -100,6 +106,8 @@ PackageMgr ad_instproc require {{-url ""} package_id} { Create package object if needed. } { + if {$package_id eq ""} {error "package_id must not be empty"} + #my log "--R $package_id exists? [my isobject ::$package_id] url='$url'" if {![my isobject ::$package_id]} { #my log "--R we have to create ::$package_id //url='$url'" @@ -122,7 +130,7 @@ set package_class [self] } #my log "PKG: $package_class" - + if {$url ne ""} { $package_class create ::$package_id -id $package_id -url $url } else { @@ -193,6 +201,7 @@ my package_url $package_url my package_key $info(package_key) my instance_name $info(instance_name) + if {[my exists url] && [info exists root]} { regexp "^${root}(.*)$" $url _ url } elseif {![my exists url]} { 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.42 -r1.43 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 1 Oct 2008 10:12:14 -0000 1.42 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 1 Oct 2008 22:19:28 -0000 1.43 @@ -195,7 +195,7 @@ if {$package_id == 0} { array set "" [site_node::get_from_url -url $url] set package_id $(package_id) - #my log "--i setting pkg tp $package_id" + #my msg "--i setting pkg to $package_id" } # get locale; TODO at some time, we should get rid of the ad_conn init problem @@ -209,7 +209,6 @@ } else { set locale [lang::system::locale -package_id $package_id] } - if {![my isobject ::xo::cc]} { my create ::xo::cc \ -package_id $package_id \ @@ -219,10 +218,10 @@ -locale $locale \ -url $url #::xo::show_stack - #my log "--cc ::xo::cc created $url [::xo::cc serialize]" + #my msg "--cc ::xo::cc created $url [::xo::cc serialize]" ::xo::cc destroy_on_cleanup } else { - #my log "--cc ::xo::cc reused $url -package_id $package_id" + #my msg "--cc ::xo::cc reused $url -package_id $package_id" ::xo::cc configure \ -url $url \ -actual_query $actual_query \