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.32 -r1.33 --- openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 7 Aug 2017 23:48:30 -0000 1.32 +++ openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 20 Oct 2017 11:53:31 -0000 1.33 @@ -20,7 +20,7 @@ PackageMgr ad_instproc first_instance {-privilege -party_id} { @return return first mounted instance of this type } { - my instvar package_key + set package_key ${:package_key} if {[info exists privilege]} { set sql [::xo::dc select -vars package_id \ -from "apm_packages, site_nodes s" \ @@ -40,17 +40,18 @@ @param closure include instances of subclasses of the package @return list of package_ids of xowiki instances } { - my instvar package_key + set package_key ${:package_key} if {$include_unmounted} { set result [::xo::dc list get_xowiki_packages {select package_id \ from apm_packages where package_key = :package_key}] } else { set result [::xo::dc list 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}] + from apm_packages p, site_nodes s \ + where package_key = :package_key \ + and s.object_id = p.package_id}] } if {$closure} { - foreach subclass [my info subclass] { + foreach subclass [:info subclass] { foreach id [$subclass instances -include_unmounted $include_unmounted -closure true] { lappend result $id } @@ -120,9 +121,9 @@ # create package object if necessary if {$keep_cc} { - my require $package_id + :require $package_id } else { - my require -url $url $package_id + :require -url $url $package_id } # @@ -173,9 +174,9 @@ error "package_id must not be empty" } - #my log "--R $package_id exists? [my isobject ::$package_id] url='$url'" + #my log "--R $package_id exists? [:isobject ::$package_id] url='$url'" - if {![my isobject ::$package_id]} { + if {![:isobject ::$package_id]} { #my log "--R we have to create ::$package_id //url='$url'" # # To make initialization code generic, we obtain from the @@ -234,14 +235,14 @@ {force_refresh_login false} } - ::xo::Package instforward query_parameter {%my set context} %proc - ::xo::Package instforward exists_query_parameter {%my set context} %proc - ::xo::Package instforward form_parameter {%my set context} %proc - ::xo::Package instforward exists_form_parameter {%my set context} %proc - ::xo::Package instforward returnredirect {%my set context} %proc + ::xo::Package instforward query_parameter {%set :context} %proc + ::xo::Package instforward exists_query_parameter {%set :context} %proc + ::xo::Package instforward form_parameter {%set :context} %proc + ::xo::Package instforward exists_form_parameter {%set :context} %proc + ::xo::Package instforward returnredirect {%set :context} %proc ::xo::Package instproc get_parameter {attribute {default ""}} { - set package_id [my id] + set package_id ${:id} set parameter_obj [::xo::parameter get_parameter_object \ -parameter_name $attribute \ -package_id $package_id \ @@ -267,26 +268,26 @@ } } return [parameter::get_global_value \ - -package_key [my set package_key] \ + -package_key ${:package_key} \ -parameter $attribute \ -default $default] } ::xo::Package instproc init args { - my instvar id url + set id ${:id} set package_url [lindex [site_node::get_url_from_object_id -object_id $id] 0] #my log "--R creating package_url='$package_url'" if {$package_url ne ""} { array set info [site_node::get -url $package_url] #set package_url $info(url) - my package_key $info(package_key) - my instance_name $info(instance_name) + :package_key $info(package_key) + :instance_name $info(instance_name) } else { ::xo::dc 1row package_info { select package_key, instance_name from apm_packages where package_id = :id } - my package_key $package_key - my instance_name $instance_name + :package_key $package_key + :instance_name $instance_name } if {[ns_conn isconnected]} { @@ -297,29 +298,29 @@ regexp "^${root}(.*)$" $package_url _ package_url } #my log "--R package_url= $package_url (was $info(url))" - my package_url $package_url + :package_url $package_url - if {[my exists url] && [info exists root]} { - regexp "^${root}(.*)$" $url _ url - } elseif {![my exists url]} { + if {[info exists :url] && [info exists root]} { + regexp "^${root}(.*)$" ${:url} _ :url + } elseif {![info exists :url]} { #my log "--R we have no url, use package_url '$package_url'" # if we have no more information, we use the package_url as actual url set url $package_url } - my set_url -url $url - my set mime_type text/html - my set delivery ns_return - set target_class ::[my package_key]::Package - if {[my info class] ne $target_class && [my isclass $target_class]} { - my class $target_class + :set_url -url ${:url} + set :mime_type text/html + set :delivery ns_return + set target_class ::${:package_key}::Package + if {[:info class] ne $target_class && [:isclass $target_class]} { + :class $target_class } # # Save the relation between class and package_key for fast lookup # - set ::xo::package_class([my set package_key]) [my info class] + set ::xo::package_class(${:package_key}) [:info class] - my initialize + :initialize } ::xo::Package instproc initialize {} { @@ -336,18 +337,16 @@ @return folder_id } { - my instvar id - - set folder_id [ns_cache eval xotcl_object_type_cache root_folder-$id { + set folder_id [ns_cache eval xotcl_object_type_cache root_folder-${:id} { set folder_id [::xo::db::CrClass lookup -name $name -parent_id $parent_id] if {$folder_id == 0} { - my log "folder with name '$name' and parent $parent_id does NOT EXIST" + :log "folder with name '$name' and parent $parent_id does NOT EXIST" set folder_id [::xo::db::sql::content_folder new \ -name $name -label $name \ -parent_id $parent_id \ - -package_id $id -context_id $id] - my log "CREATED folder '$name' and parent $parent_id ==> $folder_id" + -package_id ${:id} -context_id ${:id}] + :log "CREATED folder '$name' and parent $parent_id ==> $folder_id" } # register all specified content types @@ -362,9 +361,9 @@ } ::xo::Package instproc set_url {-url} { - my url $url - my set object [string range [my url] [string length [my package_url]] end] - #my msg "--R object set to [my set object], url=$url, [my serialize]" + :url $url + set :object [string range [:url] [string length [:package_url]] end] + #my msg "--R object set to ${:object}, url=$url, [:serialize]" } ::xo::Package instproc handle_http_caching {} { @@ -386,7 +385,7 @@ ::xo::Package instproc reply_to_user {text} { - my handle_http_caching + :handle_http_caching #my log "REPLY [::xo::cc exists __continuation]" if {[::xo::cc exists __continuation]} { @@ -395,8 +394,8 @@ } else { if {[string length $text] > 1} { set status_code [expr {[::xo::cc exists status_code] ? [::xo::cc set status_code] : 200}] - #my log "REPLY [my set delivery] 200 [my set mime_type]" - [my set delivery] $status_code [my set mime_type] $text + #my log "REPLY ${:delivery} 200 ${:mime_type}" + ${:delivery} $status_code ${:mime_type} $text } } } 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 -r1.18 -r1.19 --- openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl 1 Oct 2017 11:57:04 -0000 1.18 +++ openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl 20 Oct 2017 11:53:31 -0000 1.19 @@ -204,12 +204,12 @@ } { #::xo::PackageMgr instvar package_class if {![info exists package_key]} { - set package_key [my get_package_key_from_id -package_id $package_id] + set package_key [:get_package_key_from_id -package_id $package_id] } while {$package_key ne ""} { set key Parameter_id($package_key,$parameter_name) - if {[my exists $key]} { - return [my set $key] + if {[info exists :$key]} { + return [set :$key] } # # We did not find the parameter object for the current package @@ -220,7 +220,7 @@ # #my log "--p looking for $parameter_name in superclass of package_key=$package_key" set success 0 - set pkg_class [my get_package_class_from_package_key -package_key $package_key] + set pkg_class [:get_package_class_from_package_key -package_key $package_key] if {$pkg_class ne ""} { set sc [$pkg_class info superclass] if {[$sc exists package_key]} { @@ -252,7 +252,7 @@ # seems as if this parameter was newly defined # if {![info exists package_id]} {set package_id ""} - return [my get_parameter_object \ + return [:get_parameter_object \ -retry false \ -parameter_name $parameter_name \ -package_id $package_id \ @@ -270,12 +270,12 @@ -parameter:required -default } { - set parameter_obj [my get_parameter_object -package_key $package_key -parameter_name $parameter] + set parameter_obj [:get_parameter_object -package_key $package_key -parameter_name $parameter] if {$parameter_obj eq ""} { if {[info exists default]} {return $default} error "No parameter '$parameter' for package_key '$package_key' defined" } - set package_id [my get_package_id_from_package_key -package_key $package_key] + set package_id [:get_package_id_from_package_key -package_key $package_key] set value [$parameter_obj get -package_id $package_id] if {$value eq "" && [$parameter_obj set __success] == 0 && [info exists default]} { return $default @@ -297,7 +297,7 @@ [::xo::cc package_id] : [ns_conn isconnected] ? [ad_conn package_id] : [ad_acs_kernel_id]}] } - set parameter_obj [my get_parameter_object -parameter_name $parameter -package_id $package_id -retry $retry] + set parameter_obj [:get_parameter_object -parameter_name $parameter -package_id $package_id -retry $retry] if {$parameter_obj ne ""} { set value [$parameter_obj get -package_id $package_id] if {$value eq "" && [$parameter_obj set __success] == 0} {return $default} @@ -311,18 +311,17 @@ # Methods for parameter instances # parameter instproc set_per_package_instance_value {package_id value} { - set array [my per_package_id_name $package_id] - nsv_set $array [my parameter_name] $value + set array [:per_package_id_name $package_id] + nsv_set $array [:parameter_name] $value } parameter instproc clear_per_package_instance_value {package_id value} { - set array [my per_package_id_name $package_id] - if {[nsv_exists $array [my parameter_name]]} { - nsv_unset $array [my parameter_name] + set array [:per_package_id_name $package_id] + if {[nsv_exists $array [:parameter_name]]} { + nsv_unset $array [:parameter_name] } } parameter instproc initialize_loaded_object {} { - my instvar package_key parameter_name - [self class] set Parameter_id($package_key,$parameter_name) [self] + [self class] set Parameter_id(${:package_key},${:parameter_name}) [self] } parameter instproc per_package_id_name {package_id} { return "CFG-$package_id" @@ -331,11 +330,11 @@ # return "CFG-$package_class" # } parameter instproc get {-package_id:required} { - set key [my parameter_name] - set nsv_array_name [my per_package_id_name $package_id] + set key [:parameter_name] + set nsv_array_name [:per_package_id_name $package_id] if {[nsv_exists $nsv_array_name $key]} { #my log "--parameter get <$key> from $nsv_array_name --> '[nsv_get $nsv_array_name $key]'" - my set __success 1 + set :__success 1 return [nsv_get $nsv_array_name $key] } # We could as well store per-package-key values, @@ -345,16 +344,16 @@ # a very simple "reset to default" for package-key values. # # foreach cls $package_class_hierarchy { - # set nsv_array_name [my per_package_class_name $cls] + # set nsv_array_name [:per_package_class_name $cls] # if {[nsv_exists $nsv_array_name $key]} { # #my log "--parameter get <$key> from $nsv_array_name --> '[nsv_get $nsv_array_name $key]'" # return [nsv_get $nsv_array_name $key] # } # } # - #my log "--parameter get <$key> from default of [my package_key] --> '[my default_value]'" - my set __success 0 - return [my default_value] + #my log "--parameter get <$key> from default of [:package_key] --> '[:default_value]'" + set :__success 0 + return [:default_value] } # get apm_parameter objects