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.114 -r1.115 --- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 1 Feb 2018 21:58:01 -0000 1.114 +++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 21 Mar 2018 19:52:50 -0000 1.115 @@ -1195,7 +1195,7 @@ default_value min_n_values max_n_values # ignore some erroneous definitions in the acs meta model - if {[:exists exclude_attribute($table_name,$attribute_name)]} { + if {[info exists :exclude_attribute($table_name,$attribute_name)]} { continue } 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.70 -r1.71 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 24 Dec 2017 12:28:07 -0000 1.70 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 21 Mar 2018 19:52:50 -0000 1.71 @@ -134,7 +134,7 @@ } Context instproc exists_query_parameter {name} { - #my log "--qp :exists $name => [info exists :queryparm($name)]" + #my log "--qp exists $name => [info exists :queryparm($name)]" info exists :queryparm($name) } Context instproc get_all_query_parameter {} { Index: openacs-4/packages/xowf/tcl/xowf-form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/xowf-form-field-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/xowf/tcl/xowf-form-field-procs.tcl 17 Aug 2017 12:38:14 -0000 1.5 +++ openacs-4/packages/xowf/tcl/xowf-form-field-procs.tcl 21 Mar 2018 20:01:42 -0000 1.6 @@ -23,16 +23,16 @@ workflow_definition instproc as_graph {} { set ctx [::xowf::Context new -destroy_on_cleanup -object ${:object} \ -all_roles true -in_role none \ - -workflow_definition [my value] ] - return [$ctx as_graph -dpi [my dpi] -style "max-width: 35%;"] + -workflow_definition [:value] ] + return [$ctx as_graph -dpi [:dpi] -style "max-width: 35%;"] } workflow_definition instproc check=workflow {value} { # Do we have a syntax error in the workflow definition? if {![catch {set ctx [::xowf::Context new \ -destroy_on_cleanup -object ${:object} \ -all_roles true \ - -workflow_definition [my value]]} errorMsg]} { + -workflow_definition [:value]]} errorMsg]} { $ctx initialize_context ${:object} ${:object} wf_context $ctx unset errorMsg @@ -41,18 +41,18 @@ } if {[info exists errorMsg]} { - #my msg errorMsg=$errorMsg - my uplevel [list set errorMsg $errorMsg] + #:msg errorMsg=$errorMsg + :uplevel [list set errorMsg $errorMsg] return 0 } return 1 } workflow_definition instproc pretty_value {v} { ${:object} do_substitutions 0 - set text [string map [list & "&" < "<" > ">" \" """ ' "'" @ "@"] [my value]] + set text [string map [list & "&" < "<" > ">" \" """ ' "'" @ "@"] [:value]] return "
$text
-
[my as_graph]
+
[:as_graph]
[${:object} include my-refers] " } @@ -73,7 +73,7 @@ -all_roles true -in_role none \ -workflow_definition [${:object} wf_property workflow_definition] ] #set ctx [::xowf::Context require ${:object}] - set graph [$ctx as_graph -current_state [my value] -visited [${:object} visited_states] -style "max-height: 250px;"] + set graph [$ctx as_graph -current_state [:value] -visited [${:object} visited_states] -style "max-height: 250px;"] ::html::div -style "width: 35%; float: right;" { ::html::t -disableOutputEscaping $graph } @@ -139,7 +139,7 @@ set members [permission::get_parties_with_permission \ -privilege admin \ -object_id $object_id] - #my msg members=$members + #:msg members=$members return $members } @@ -166,9 +166,9 @@ Role create community_member community_member proc is_member {-user_id:required -package_id} { if {[info commands ::dotlrn_community::get_community_id] ne ""} { - set community_id [my cache [list [dotlrn_community::get_community_id -package_id $package_id]]] + set community_id [:cache [list [dotlrn_community::get_community_id -package_id $package_id]]] if {$community_id ne ""} { - return [my cache [list dotlrn::user_is_community_member_p \ + return [:cache [list dotlrn::user_is_community_member_p \ -user_id $user_id \ -community_id $community_id]] } @@ -195,34 +195,33 @@ } role_member instproc initialize {} { next - my set is_party_id 1 + set :is_party_id 1 } role_member instproc render_input {} { - my instvar role - #my msg role=$role,obj=${:object} - if {[info commands ::xo::role::$role] ne ""} { - set object_id [::xo::role::$role get_object_id ${:object}] - my set options [::xo::role::$role get_members -object_id $object_id] - } elseif {[set gid [group::get_id -group_name $role]] ne ""} { - my set options [list] + #:msg role=${:role},obj=${:object} + if {[info commands ::xo::role::${:role}] ne ""} { + set object_id [::xo::role::${:role} get_object_id ${:object}] + set :options [::xo::role::${:role} get_members -object_id $object_id] + } elseif {[set gid [group::get_id -group_name ${:role}]] ne ""} { + set :options [list] foreach m [group::get_members -group_id $gid] { - my lappend options [list [::xo::get_user_name $m] $m] } + :lappend options [list [::xo::get_user_name $m] $m] } } else { - error "no such role or group '$role'" + error "no such role or group '${:role}'" } next } role_member instproc get_entry_label {v} { set prefix "" - if {[my online_state]} { + if {[:online_state]} { set prefix "[::xowiki::utility user_is_active -asHTML true $v] " } return $prefix[::xo::get_user_name $v] } role_member instproc pretty_value {v} { - my set options [my get_labels $v] + set :options [:get_labels $v] next } } @@ -241,18 +240,17 @@ } mc_exercise instproc initialize {} { - my log "[self class] deprecated, you should switch to test-item procs" - if {[my set __state] ne "after_specs"} return - my instvar feedback inplace - my create_components [subst { + :log "[self class] deprecated, you should switch to test-item procs" + if {${:__state} ne "after_specs"} return + :create_components [subst { {text {richtext,required,height=150px,label=#xowf.exercise-text#}} - {alt-1 {mc_alternative,feedback=$feedback,label=#xowf.alternative#}} - {alt-2 {mc_alternative,feedback=$feedback,label=#xowf.alternative#}} - {alt-3 {mc_alternative,feedback=$feedback,label=#xowf.alternative#}} - {alt-4 {mc_alternative,feedback=$feedback,label=#xowf.alternative#}} - {alt-5 {mc_alternative,feedback=$feedback,label=#xowf.alternative#}} + {alt-1 {mc_alternative,feedback=${:feedback},label=#xowf.alternative#}} + {alt-2 {mc_alternative,feedback=${:feedback},label=#xowf.alternative#}} + {alt-3 {mc_alternative,feedback=${:feedback},label=#xowf.alternative#}} + {alt-4 {mc_alternative,feedback=${:feedback},label=#xowf.alternative#}} + {alt-5 {mc_alternative,feedback=${:feedback},label=#xowf.alternative#}} }] - my set __initialized 1 + set :__initialized 1 } mc_exercise instproc render_input {} { @@ -272,11 +270,11 @@ # set form "
\n\n" set fc "@categories:off @cr_fields:hidden\n" - set intro_text [my get_named_sub_component_value text] + set intro_text [:get_named_sub_component_value text] append form "\n" foreach input_field_name {alt-1 alt-2 alt-3 alt-4 alt-5} { foreach f {text correct feedback_correct feedback_incorrect} { - set value($f) [my get_named_sub_component_value $input_field_name $f] + set value($f) [:get_named_sub_component_value $input_field_name $f] } append form \ "\n" \ @@ -290,7 +288,7 @@ lappend alt_fc "feedback_answer_incorrect=[::xowiki::formfield:::FormField fc_encode $value(feedback_incorrect)]" } if {[llength $alt_fc] > 0} {append fc [list $input_field_name:checkbox,[join $alt_fc ,]]\n} - #my msg "$input_field_name .correct = $value(correct)" + #:msg "$input_field_name .correct = $value(correct)" } append form "
$intro_text
\n" ${:object} set_property -new 1 form $form @@ -309,8 +307,8 @@ } mc_alternative instproc initialize {} { - my log "[self class] deprecated, you should switch to test-item procs" - if {[my set __state] ne "after_specs"} return + :log "[self class] deprecated, you should switch to test-item procs" + if {${:__state} ne "after_specs"} return if {0} { set javascript [::xowiki::formfield::FormField fc_encode { @@ -319,24 +317,24 @@ ['killword','removeformat','htmlmode'] ]; }] - set text_config [subst {editor=xinha,height=100px,label=Text,plugins=OacsFs,inplace=[my inplace],javascript=$javascript}] + set text_config [subst {editor=xinha,height=100px,label=Text,plugins=OacsFs,inplace=$:{inplace},javascript=$javascript}] } else { set text_config [subst {editor=wym,height=100px,label=Text}] } - if {[my feedback] eq "full"} { + if {[:feedback] eq "full"} { set feedback_fields { {feedback_correct {textarea,label=Feedback korrekt}} {feedback_incorrect {textarea,label=Feedback inkorrekt}} } } else { set feedback_fields "" } - my create_components [subst { + :create_components [subst { {text {richtext,$text_config}} {correct {boolean,horizontal=true,label=Korrekt}} $feedback_fields }] - my set __initialized 1 + set :__initialized 1 } } Index: openacs-4/packages/xowf/tcl/xowf-includelet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/xowf-includelet-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowf/tcl/xowf-includelet-procs.tcl 7 Aug 2017 23:48:30 -0000 1.3 +++ openacs-4/packages/xowf/tcl/xowf-includelet-procs.tcl 21 Mar 2018 20:01:42 -0000 1.4 @@ -34,7 +34,7 @@ } wf-todo instproc initialize {} { - my get_parameters + :get_parameters if {![info exists user_id]} {set user_id [::xo::cc user_id]} set sql { @@ -61,37 +61,36 @@ if {[regexp {^/(/.*)/$} $workflow _ package]} { # all workflows from this package ::xowf::Package initialize -url $package - #my msg "using package_id=$package_id" + #:msg "using package_id=$package_id" append sql " and o.package_id = :package_id" } else { if {[regexp {^/(/[^/]+)(/.+)$} $workflow _ package path]} { ::xowf::Package initialize -url $package - #my msg "using package_id=$package_id" + #:msg "using package_id=$package_id" } else { set path $workflow } - set parent_id [[my set __including_page] parent_id] + set parent_id [${:__including_page} parent_id] set wf_page [$package_id get_page_from_item_ref -parent_id $parent_id $path] if {$wf_page eq ""} { - my msg "cannot resolve page $workflow" + :msg "cannot resolve page $workflow" set package_id -1; set page_template -1 } else { set page_template [$wf_page item_id] set package_id [$wf_page package_id] } - #my msg "page_template=$page_template pkg=$package_id" + #:msg "page_template=$page_template pkg=$package_id" append sql " and o.package_id = :package_id and p.page_template = :page_template" } } append sql " order by p.last_modified desc" - my set items [::xowiki::FormPage instantiate_objects -sql $sql] + set :items [::xowiki::FormPage instantiate_objects -sql $sql] } wf-todo instproc render_ical {} { - my instvar items - foreach i [$items children] { + foreach i [${:items} children] { $i instvar wf_name name title state xowiki_form_page_id pid description parent_id ::xowf::Package initialize -package_id $pid @@ -101,27 +100,27 @@ -summary "$title ($state)" \ -description "Workflow instance of workflow $wf_name $description" } - $items mixin ::xo::ical::VCALENDAR - $items configure -prodid "-//WU Wien//NONSGML XoWiki Content Flow//EN" - set text [$items as_ical] - #my log "--ical sending $text" + ${:items} mixin ::xo::ical::VCALENDAR + ${:items} configure -prodid "-//WU Wien//NONSGML XoWiki Content Flow//EN" + set text [${:items} as_ical] + #:log "--ical sending $text" #ns_return 200 text/calendar $text ns_return 200 text/plain $text } wf-todo instproc render {} { - my get_parameters - if {$ical} {return [my render_ical]} - - my instvar items + :get_parameters + if {$ical} { + return [:render_ical] + } set t [TableWidget new -volatile \ -columns { Field create package -label Package AnchorField create wf -label Workflow AnchorField create title -label "Todo" Field create state -label [::xowiki::FormPage::slot::state set pretty_name] }] - foreach i [$items children] { + foreach i [${:items} children] { $i instvar wf_name name title state xowiki_form_page_id pid parent_id ::xowf::Package initialize -package_id $pid $t add \ Index: openacs-4/packages/xowf/tcl/xowf-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/xowf-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/xowf/tcl/xowf-procs.tcl 8 Feb 2018 17:36:44 -0000 1.15 +++ openacs-4/packages/xowf/tcl/xowf-procs.tcl 21 Mar 2018 20:01:42 -0000 1.16 @@ -32,20 +32,20 @@ } { # This method is called, whenever an xowf package is initialized. next - #my msg "::xowiki::FormPage instmixin add ::xowf::WorkflowPage" + #:msg "::xowiki::FormPage instmixin add ::xowf::WorkflowPage" ::xowiki::FormPage instmixin add ::xowf::WorkflowPage } Package instproc call {object method options} { if {[$object istype ::xowiki::FormPage]} { if {[$object is_wf_instance]} { set ctx [::xowf::Context require $object] - #my msg "wfi: creating context form object $object = $ctx, chlds=[$ctx info children]" - #my msg "wfi: o $object has mixins [$object info mixin]" + #:msg "wfi: creating context form object $object = $ctx, chlds=[$ctx info children]" + #:msg "wfi: o $object has mixins [$object info mixin]" } elseif {[$object is_wf]} { set ctx [::xowf::Context require $object] - #my msg "wf: creating context form object $object = $ctx, chlds=[$ctx info children]" - #my msg "wf: o $object has mixins [$object info mixin]" + #:msg "wf: creating context form object $object = $ctx, chlds=[$ctx info children]" + #:msg "wf: o $object has mixins [$object info mixin]" } } next @@ -69,7 +69,7 @@ # # Provide a method to delete the foreign key references, when # # an item for an atjob is deleted. We do here the same magic # # as in ::xowiki::Package to obtain the item_id - # if {![info exists item_id]} {set item_id [my query_parameter item_id]} + # if {![info exists item_id]} {set item_id [:query_parameter item_id]} # if {$item_id ne ""} { # db_dml dbqd..xowf_delete "delete from xowf_atjob where owner_id = :item_id" # } @@ -275,7 +275,7 @@ foreach action [${:current_state} get_actions] { lappend actions ${:wf_container}::$action } - #my msg "for ${:current_state} actions '$actions" + #:msg "for ${:current_state} actions '$actions" return $actions } Context instproc defined {what} { @@ -298,12 +298,12 @@ } Context instproc default_load_form_id {form_name} { - #my msg "resolving $form_name in state [:current_state] via default form loader" + #:msg "resolving $form_name in state [:current_state] via default form loader" set form_id 0 if {$form_name ne ""} { array set "" [:resolve_form_name -object ${:object} $form_name] set form_id $(form_id) - #my msg ".... object ${:object} ==> id = $form_id" + #:msg ".... object ${:object} ==> id = $form_id" } return $form_id } @@ -373,15 +373,15 @@ :log "=== autoform $form_object" } } else { - #my msg "using custom form loader $loader for [:form]" - set form_object [my $loader [:form]] + #:msg "using custom form loader $loader for [:form]" + set form_object [:$loader [:form]] } # # At this place, the variable "form_id" might contain an id # (integer) or an object, provided by the custom file loader. # - #my msg form_id=$form_id + #:msg form_id=$form_id if {![info exists form_object] && [string is integer -strict $form_id] @@ -416,7 +416,7 @@ # set text [$form_object render_content] $form_object set_property -new 1 form "
$text
" - #my msg "_text=[$form_object property _text]" + #:msg "_text=[$form_object property _text]" } } elseif {[$form_object info class] eq "::xowiki::Page"} { # @@ -452,10 +452,10 @@ ns_log error "Error in workflow definition: $errorMsg\n$::errorInfo\n\ ===== default_definition: [:default_definition] \n\ ===== workflow_definition: $workflow_definition" - my msg "Error in workflow definition: $errorMsg" + :msg "Error in workflow definition: $errorMsg" } if {${:all_roles}} { - #my msg want.to.create=[array names :handled_roles] + #:msg want.to.create=[array names :handled_roles] foreach role [array names :handled_roles] { Context create ${:wf_container}-$role -workflow_definition $workflow_definition \ -in_role $role -object ${:object} @@ -650,12 +650,14 @@ Context instproc draw_arc {from_state next_state action label style} { if {$next_state eq ""} {set next_state $from_state} set key transition($from_state,$next_state,$action) - if {[my exists $key]} {return ""} - my set $key 1 + if {[info exists :$key]} { + return "" + } + set :$key 1 return " state_$from_state -> state_$next_state \[label=\"$label\"$style\];\n" } Context instproc draw_transition {from action role} { - #my msg "[self args]" + #:msg "[self args]" if {[$action state_safe]} { set arc_style {,style="dashed",penwidth=1,color=gray} @@ -798,9 +800,9 @@ if {[$p exists parampage]} {set :parampages([$p set parampage]) 1} } - #my msg "forms=[array names :forms], parampages=[array names :parampages] in-role [info exists :in_role] [array names :handled_roles]" + #:msg "forms=[array names :forms], parampages=[array names :parampages] in-role [info exists :in_role] [array names :handled_roles]" - if {![:exists in_role]} { + if {![info exists :in_role]} { foreach role [array names :handled_roles] { set role_ctx [self]-$role if {[llength [info commands $role_ctx]] > 0} { @@ -810,7 +812,7 @@ array set :parampage [$role_ctx array get parampage] } } - #my msg "forms=[array names :forms], parampages=[array names :parampages]" + #:msg "forms=[array names :forms], parampages=[array names :parampages]" set page ${:object} $page references clear $page set __unresolved_object_type ::xowiki::Form @@ -824,18 +826,18 @@ } } set references [$page references get resolved] - #my log "-- link_text=$link_text// $references" + #:log "-- link_text=$link_text// $references" if {[llength $references] > 0} { - #my msg "updating references refs=$references" + #:msg "updating references refs=$references" $page references_update [lsort -unique $references] $page set __extra_references $references $page references clear } if {[llength [$page references get unresolved]] > 0} { # TODO: we should provide a link to create the missing forms. maybe we # change unresolved_references to a list..., or maybe we write these into the DB. - my msg -html t "Missing forms: [join [$page references get unresolved] {, }]" + :msg -html t "Missing forms: [join [$page references get unresolved] {, }]" } } return [list rc 0] @@ -863,13 +865,13 @@ WorkflowConstruct instproc in_role {role configuration} { set ctx [:wf_context] set obj [$ctx object] - #my msg parent=$obj,cl=[$obj info class],name=[$obj name] + #:msg parent=$obj,cl=[$obj info class],name=[$obj name] if {[$ctx exists in_role]} { set success [expr {[$ctx in_role] eq $role}] } else { set success [$obj check_role $role] } - #my msg role-$role->$success + #:msg role-$role->$success lappend :handled_roles $role $ctx set handled_roles($role) 1 if {$success} { @@ -889,7 +891,7 @@ return "" } else { if {[regexp {^(.+):([^ ]+) } $values _ cond value]} { - my msg "switch '$values' to new syntax: ? $cond $value ..." + :msg "switch '$values' to new syntax: ? $cond $value ..." } return [list "" $values] } @@ -899,7 +901,7 @@ if {$cond eq "" || $cond eq "default" || $cond eq "else" || $cond eq "true"} { return $value - } elseif {[my $cond]} { + } elseif {[:$cond]} { return $value } } @@ -1001,7 +1003,7 @@ set action_name [namespace tail [self]] set object [[:wf_context] object] set package_id [$object package_id] - my log "--xowf invoke action [self]" + :log "--xowf invoke action [self]" # We fake a work request with the given instance attributes set last_context [expr {[$package_id exists context] ? [$package_id context] : "::xo::cc"}] set last_object [$package_id set object] @@ -1019,18 +1021,18 @@ $package_id set object "[$package_id folder_path -parent_id [$object parent_id]][$object name]" - #my log "call_action calls: ::$package_id invoke -method edit -batch_mode 1 // obj=[$package_id set object]" + #:log "call_action calls: ::$package_id invoke -method edit -batch_mode 1 // obj=[$package_id set object]" if {[catch {::$package_id invoke -method edit -batch_mode 1} errorMsg]} { - my msg "---call_action returns error $errorMsg" + :msg "---call_action returns error $errorMsg" ns_log error "$errorMsg\n$::errorInfo" error $errorMsg } - #my log "RESETTING package_id object" + #:log "RESETTING package_id object" $package_id set object $last_object $package_id context $last_context $cc destroy - #my log "CHECK batch mode: [$package_id exists __batch_mode]" + #:log "CHECK batch mode: [$package_id exists __batch_mode]" if {[$package_id exists __batch_mode]} { :msg "RESETTING BATCH MODE" :log "RESETTING BATCH MODE" @@ -1070,7 +1072,7 @@ $object instvar instance_attributes if {[info exists :default] && ![dict exists $instance_attributes ${:name}]} { dict set instance_attributes ${:name} ${:default} - #my msg "[self] set default of $object to [my default]" + #:msg "[self] set default of $object to [:default]" } } @@ -1139,7 +1141,7 @@ WorkflowPage instproc check_role {role} { if {[::xo::cc info methods role=$role] eq ""} { - my msg "ignoring unknown role '$role'" + :msg "ignoring unknown role '$role'" return 0 } if {$role eq "creator"} { @@ -1209,7 +1211,7 @@ # Provide feedback for every alternative # foreach f $form_fields { - #my msg "[$f name]: correct? [$f answer_is_correct]" + #:msg "[$f name]: correct? [$f answer_is_correct]" switch -- [$f answer_is_correct] { 0 { continue } -1 { set result "incorrect"} @@ -1321,7 +1323,7 @@ # we make sure that we only check the redirect on views # without content. - #my msg "view [self args] [:is_wf_instance]" + #:msg "view [self args] [:is_wf_instance]" if {[:is_wf_instance] && $content eq ""} { set ctx [::xowf::Context require [self]] @@ -1331,21 +1333,21 @@ if {$method ne "" && $method ne "view"} { set package_id [:package_id] - #my msg "view redirects to $method in state [$ctx get_current_state]" + #:msg "view redirects to $method in state [$ctx get_current_state]" switch -- $method { view_user_input { - #my msg "calling edit with disable_input_fields=1" + #:msg "calling edit with disable_input_fields=1" return [:www-edit -disable_input_fields 1] #return [$package_id call [self] edit [list -disable_input_fields 1]] } view_user_input_with_feedback { set :__feedback_mode 1 - #my msg "calling edit with disable_input_fields=1" + #:msg "calling edit with disable_input_fields=1" return [:www-edit -disable_input_fields 1] #return [$package_id call [self] edit [list -disable_input_fields 1]] } default { - #my msg "calling $method" + #:msg "calling $method" return [$package_id invoke -method $method] } } @@ -1462,7 +1464,7 @@ [:package_id] set __evaluation_error "$error\n\n$::errorInfo" incr validation_errors } else { - my msg -html 1 "$error
$::errorInfo
" + :msg -html 1 "$error
$::errorInfo
" } ad_log error "--WF: evaluation $error\n$::errorInfo" } @@ -1481,13 +1483,13 @@ if {[:is_wf_instance]} { lassign [next] validation_errors category_ids if {$validation_errors == 0} { - #my msg "validation ok" + #:msg "validation ok" set ctx [::xowf::Context require [self]] set cc [[:package_id] context] foreach {name value} [$cc get_all_form_parameter] { if {[regexp {^__action_(.+)$} $name _ action]} { set next_state [:activate $ctx $action] - #my log "after activate next_state=$next_state, current_state=[$ctx get_current_state], ${:instance_attributes}" + #:log "after activate next_state=$next_state, current_state=[$ctx get_current_state], ${:instance_attributes}" if {$next_state ne ""} { set actionObj [$ctx wf_definition_object $action] if {[$actionObj exists assigned_to]} { @@ -1533,10 +1535,10 @@ set correct 0 if {[:get_from_template auto_correct] == true} { foreach f [:instantiated_form_fields] { - #my msg "checking correctness [$f name] [$f info class] answer?[$f exists answer] -- [:get_from_template auto_correct]" + #:msg "checking correctness [$f name] [$f info class] answer?[$f exists answer] -- [:get_from_template auto_correct]" if {[$f exists answer]} { if {[$f answer_is_correct] != 1} { - #my msg "checking correctness [$f name] failed ([$f answer_is_correct])" + #:msg "checking correctness [$f name] failed ([$f answer_is_correct])" set correct -1 break } @@ -1628,7 +1630,7 @@ {-name ""} {-nls_language ""} } { - #my msg "instance = [:is_wf_instance], wf=[:is_wf]" + #:msg "instance = [:is_wf_instance], wf=[:is_wf]" if {[:is_wf]} { # # In a first step, we call "allocate". Allocate is an Action @@ -1673,7 +1675,7 @@ set default_lang [:lang] ${:package_id} get_lang_and_name -default_lang $default_lang -name $name lang stripped_name set id [::xo::db::CrClass lookup -name $lang:$stripped_name -parent_id $parent_id] - #my log "after allocate lookup of $lang:$stripped_name returned $id, default-lang(${:name})=$default_lang [my nls_language]" + #:log "after allocate lookup of $lang:$stripped_name returned $id, default-lang(${:name})=$default_lang [:nls_language]" if {$id != 0} { # # The instance exists already. Either use method "m" (if @@ -1694,7 +1696,7 @@ } else { set nls_language [:nls_language] } - #my msg "We want to create $lang:$stripped_name" + #:msg "We want to create $lang:$stripped_name" set name $lang:$stripped_name } } @@ -1713,7 +1715,7 @@ # -debug WorkflowPage instproc initialize {} { #:log START-initialize - #my log "is_wf_instance [:is_wf_instance]" + #:log "is_wf_instance [:is_wf_instance]" # # A fresh workflow page was created (called only once per # workflow page at initial creation) @@ -1730,7 +1732,7 @@ # Ignore the returned next_state, since the initial state is # always set to the same value from the ctx (initial) - #my msg "[self] is=${:instance_attributes}" + #:msg "[self] is=${:instance_attributes}" } next #:log END-initialize @@ -1751,7 +1753,7 @@ set value [$p default] if {[::xo::cc exists_query_parameter $name]} { # never clobber instance attributes from query parameters blindly - #my msg "ignore $name" + #:msg "ignore $name" continue } if {[::xo::cc exists_query_parameter p.$name] @@ -1765,11 +1767,11 @@ ## save instance attributes #set instance_attributes [array get __ia] - #my msg "[self] ${:name} setting default parameter" - #my log ia=$instance_attributes,props=[$ctx defined Property] + #:msg "[self] ${:name} setting default parameter" + #:log ia=$instance_attributes,props=[$ctx defined Property] :state [$ctx get_current_state] - #my msg "setting initial state to '[:state]'" + #:msg "setting initial state to '[:state]'" return $instance_attributes } else { @@ -1803,7 +1805,7 @@ set wf_specific_constraints [${:page_template} property form_constraints] set m [:merge_constraints $wf_specific_constraints \ $constraints_from_form [$ctx get_form_constraints]] - #my msg "merged:$m" + #:msg "merged:$m" return $m } WorkflowPage instproc wf_merged_form_constraints {constraints_from_form} { @@ -1827,13 +1829,13 @@ WorkflowPage instproc get_form_constraints {{-trylocal false}} { if {[:istype ::xowiki::FormPage] && [:is_wf]} { - #my msg "get_form_constraints is_wf" + #:msg "get_form_constraints is_wf" return [::xo::cc cache [list [self] wf_merged_form_constraints [next]]] } elseif {[:istype ::xowiki::FormPage] && [:is_wf_instance]} { - #my msg "get_form_constraints is_wf_instance" + #:msg "get_form_constraints is_wf_instance" return [::xo::cc cache [list [self] wfi_merged_form_constraints [next]]] } else { - #my msg "get_form_constraints next" + #:msg "get_form_constraints next" next } } @@ -1844,7 +1846,7 @@ where i.item_id = :item_id and r.item_id = i.item_id and xowiki_form_page_id = r.revision_id}] { set visited($state) 1 } - #my msg "visited states of item $item_id = [array names visited]" + #:msg "visited states of item $item_id = [array names visited]" return [array names visited] } @@ -1859,7 +1861,7 @@ set package_id [:package_id] set parent_id [:parent_id] set form_item_id ${:page_template} - #my msg "is wf page [:is_wf], is wf instance page [:is_wf_instance]" + #:msg "is wf page [:is_wf], is wf instance page [:is_wf_instance]" if {[:is_wf]} { # # page containing a work flow definition @@ -1909,7 +1911,7 @@ set work_flow_base [$work_flow_form pretty_link] set button_objs [list] - #my msg entry_form_item_id=$entry_form_item_id-exists?=[:isobject $entry_form_item_id] + #:msg entry_form_item_id=$entry_form_item_id-exists?=[:isobject $entry_form_item_id] # form definition button if {![:isobject $entry_form_item_id]} { @@ -1927,7 +1929,7 @@ lappend button_objs $obj } - # if {[my exists_property form]} { + # if {[:exists_property form]} { # lappend button_objs \ # [::xowiki::includelet::form-menu-button-new new -volatile \ # -package_id $package_id -parent_id $parent_id \ @@ -2133,22 +2135,21 @@ ::xotcl::Class create ::xowf::dav -superclass ::xo::dav ::xowf::dav instproc get_package_id {} { - my instvar uri package wf package_id - if {$uri eq "/"} { + if {${:uri} eq "/"} { # Take the first package instance - set wf "" - set package_id [lindex [$package instances] 0] - $package initialize -package_id $package_id + set :wf "" + set {:package_id} [lindex [$package instances] 0] + ${:package} initialize -package_id ${:package_id} } else { - set wf /$uri - $package initialize -url $uri + set :wf /${:uri} + ${:package} initialize -url ${:uri} } - # my log package_id=$package_id - return $package_id + # :log package_id=${:package_id} + return ${:package_id} } ::xowf::dav instproc call_action {-uri -action -attributes} { - [my package] initialize -url $uri + ${:package} initialize -url $uri set object_name [$package_id set object] set page [$package_id resolve_request -path $object_name method] if {$page eq ""} { @@ -2169,17 +2170,16 @@ ::xowf::dav create ::xowf::dav-todo -url /dav-todo -package ::xowf::Package ::xowf::dav-todo proc GET {} { - my instvar uri wf package_id - set p [::xowiki::Page new -package_id $package_id] - $p include [list wf-todo -ical 1 -workflow $wf] - #ns_return 200 text/plain GET-$uri-XXX-pid=$package_id-wf=$wf-[::xo::cc serialize] + set p [::xowiki::Page new -package_id ${:package_id}] + $p include [list wf-todo -ical 1 -workflow ${:wf}] + #ns_return 200 text/plain GET-${:uri}-XXX-pid=${:package_id}-wf=${:wf}-[::xo::cc serialize] } # ::xowf::dav-todo proc GET {} { # set uri /xowf/153516 # set uri /xowf/18362 # set uri /xowf/18205 - # my call_action -uri $uri -action work -attributes [list comment hello3 effort 4] + # :call_action -uri $uri -action work -attributes [list comment hello3 effort 4] # } proc include {wfName {vars ""}} {