Index: openacs-4/packages/xolp/tcl/xolp-activity-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xolp/tcl/xolp-activity-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xolp/tcl/xolp-activity-procs.tcl 11 Apr 2019 15:36:54 -0000 1.4 +++ openacs-4/packages/xolp/tcl/xolp-activity-procs.tcl 12 Apr 2019 11:48:01 -0000 1.5 @@ -84,7 +84,7 @@ Get the most recent version of the Activity from the data base. @return Instance of ::xolp::Activity } { - if {![my iri_exists_in_db -iri $iri]} {error "Activity $iri does not exists"} + if {![:iri_exists_in_db -iri $iri]} {error "Activity $iri does not exists"} set activity_version_id [::xo::dc get_value select_current_activity_version " SELECT activity_version_id FROM xolp_activity_dimension @@ -115,7 +115,7 @@ } { @return IRIs of descendant activities (according to xolp_activity_hierarchy_bridge table) } { - if {![my iri_exists_in_db -iri $iri]} {error "Activity $iri does not exists"} + if {![:iri_exists_in_db -iri $iri]} {error "Activity $iri does not exists"} set sql " WITH RECURSIVE heritage_tree AS ( SELECT activity_iri, 1 as depth @@ -158,8 +158,8 @@ } { @return Instance of ::xolp::Activity } { - if {[my iri_exists_in_db -iri $iri]} { - set latest_persisted_activity [my current -iri $iri] + if {[:iri_exists_in_db -iri $iri]} { + set latest_persisted_activity [:current -iri $iri] if {[::xo::dc get_value is_newer "SELECT '$scd_valid_from' > '[$latest_persisted_activity scd_valid_to]'"] eq f} { error "Activity $iri is already registered.\n$scd_valid_from < [$latest_persisted_activity scd_valid_to]\nUse 'update' (or 'require') instead... " } @@ -187,7 +187,7 @@ Updates the activity in the xolp_activity_dimension table by creating a new version. } { ::xo::dc transaction { - set old [my current -iri $iri] + set old [:current -iri $iri] set scd_valid_to_new [::xo::dc get_value roll-step1 " UPDATE xolp_activity_dimension SET scd_valid_to = NOW() @@ -197,7 +197,7 @@ array set argarray $args set argarray(-iri) $iri set argarray(-scd_valid_from) $scd_valid_to_new - set new [my new_persistent_object {*}[array get argarray]] + set new [:new_persistent_object {*}[array get argarray]] } return $new } @@ -218,8 +218,8 @@ } { @see ::xolp::Activity->add_to_context } { - [my info class] add_to_context \ - -activity_iri [my iri] \ + [:info class] add_to_context \ + -activity_iri ${:iri} \ -context_iri $context_iri \ -weight_numerator $weight_numerator \ -weight_denominator $weight_denominator @@ -323,8 +323,8 @@ Update indicators to reflect their respective activities' current competencies. } { ::xo::dc transaction { - set activity_version_ids [my get_object_ids -iri $activity_iri] - set competency_iris [my get_competencies -activity_iri $activity_iri] + set activity_version_ids [:get_object_ids -iri $activity_iri] + set competency_iris [:get_competencies -activity_iri $activity_iri] set competency_set_id [::xolp::Competency require_set -competency_iris $competency_iris] set sql " UPDATE xolp_indicator_facts Index: openacs-4/packages/xolp/tcl/xolp-competency-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xolp/tcl/xolp-competency-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/xolp/tcl/xolp-competency-procs.tcl 11 Apr 2019 16:28:34 -0000 1.6 +++ openacs-4/packages/xolp/tcl/xolp-competency-procs.tcl 12 Apr 2019 11:48:01 -0000 1.7 @@ -33,9 +33,9 @@ @return competency_set_id } { if {[llength $competency_iris] eq 0} {error "Empty list provided."} - if {![my all_exist -competency_iris $competency_iris]} {error "List contains unknown competencies."} + if {![:all_exist -competency_iris $competency_iris]} {error "List contains unknown competencies."} ::xo::dc transaction { - set set_id [my get_set_id -competency_iris $competency_iris] + set set_id [:get_set_id -competency_iris $competency_iris] if {$set_id eq ""} { set quoted_list [::xolp::util::ltransform -prefix "'" -suffix "'" $competency_iris] set set_id [::xo::dc get_value insert_set " Index: openacs-4/packages/xolp/tcl/xolp-evaluation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xolp/tcl/xolp-evaluation-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xolp/tcl/xolp-evaluation-procs.tcl 11 Apr 2019 11:32:04 -0000 1.4 +++ openacs-4/packages/xolp/tcl/xolp-evaluation-procs.tcl 12 Apr 2019 11:48:01 -0000 1.5 @@ -85,7 +85,7 @@ ::xolp::EvaluationScale ad_instproc initialize_loaded_object {} { Initialize loaded object } { - my levels + :levels } ::xolp::EvaluationScale ad_proc get_evalscales_from_competency_iri { @@ -123,7 +123,7 @@ } { Associate the EvaluationScale with the object, if it isn't already. } { - my instvar evalscale_id + :instvar evalscale_id ::xo::dc dml associate_evalscale_to_activity " INSERT INTO xolp_evalscale_activity_bridge(evalscale_id, activity_version_id) VALUES (:evalscale_id, :activity_version_id) @@ -136,7 +136,7 @@ } { Associate the EvaluationScale with the competency, if it isn't already. } { - my instvar evalscale_id + :instvar evalscale_id ::xo::dc dml associate_evalscale_to_competency " INSERT INTO xolp_evalscale_competency_bridge(evalscale_id, competency_iri) VALUES (:evalscale_id, :competency_iri) @@ -153,7 +153,7 @@ ns_log Warning "Result must be within 0 and 100" return -1 } - foreach l [my levels] { + foreach l [:levels] { if {[$l encompasses -result $result]} {return $l} } error "None of the levels encompassed the result... ($result)" @@ -162,9 +162,8 @@ ::xolp::EvaluationScale ad_instproc levels {} { Get levels based on thresholds. } { - my instvar levels - if {[info exists levels]} {return $levels} - set ticks [list 0 {*}[my thresholds] 100] + if {[info exists :levels]} {return ${:levels}} + set ticks [list 0 {*}${:thresholds} 100] for {set i 0} {$i < [llength $ticks]-1} {incr i} { lappend levels [::xolp::EvaluationScale::Level create [self]::$i \ -min [lindex $ticks $i] \ @@ -189,7 +188,7 @@ set level_index [namespace tail [self]] set scale [namespace qualifiers [self]] set schema [$scale evalschema_id] - if {![my isobject $schema]} { + if {![:isobject $schema]} { ::xo::db::Class get_instance_from_db -id $schema } set name [lindex [$schema level_names] $level_index] @@ -215,11 +214,10 @@ Check whether or not this level encompasses the give result value. @return Boolean } { - my instvar min max - if {$max == 100 && [::math::fuzzy::teq $max $result]} { + if {${:max} == 100 && [::math::fuzzy::teq ${:max} $result]} { return true } - return [expr {[::math::fuzzy::tge $result $min] && [::math::fuzzy::tlt $result $max]}] + return [expr {[::math::fuzzy::tge $result ${:min}] && [::math::fuzzy::tlt $result ${:max}]}] } # Index: openacs-4/packages/xolp/tcl/xolp-indicator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xolp/tcl/xolp-indicator-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/xolp/tcl/xolp-indicator-procs.tcl 11 Apr 2019 16:28:34 -0000 1.8 +++ openacs-4/packages/xolp/tcl/xolp-indicator-procs.tcl 12 Apr 2019 11:48:01 -0000 1.9 @@ -42,7 +42,7 @@ ::xolp::Indicator ad_proc essential_attributes {} { Return essential attributes } { - set attributes [::xolp::util::lremove [my info parameter] { + set attributes [::xolp::util::lremove [:info parameter] { indicator_id begin_date_id end_date_id begin_time_id end_time_id storage_date_id storage_time_id }] return $attributes @@ -52,7 +52,7 @@ Init class } { next - my destroy_on_cleanup + :destroy_on_cleanup } ::xo::db::require table xolp_indicator_facts { @@ -116,7 +116,7 @@ } { Checks for objects existance in the database } { - ::xo::dc get_value [my qn select_object] "select 1 from xolp_indicator_facts where indicator_id = :indicator_id" 0 + ::xo::dc get_value select_object {select 1 from xolp_indicator_facts where indicator_id = :indicator_id} 0 } ::xolp::Indicator ad_proc delete { @@ -127,9 +127,9 @@ Delete object } { if {$indicator_id ne ""} { - ::xo::dc dml [my qn delete] "DELETE FROM xolp_indicator_facts WHERE indicator_id = :indicator_id" + ::xo::dc dml delete {DELETE FROM xolp_indicator_facts WHERE indicator_id = :indicator_id} } elseif {$user_id ne "" and $activity_version_ids ne ""} { - ::xo::dc dml [my qn delete] "DELETE FROM xolp_indicator_facts WHERE user_id = :user_ids AND activity_version_id = :activity_version_ids" + ::xo::dc dml delete {DELETE FROM xolp_indicator_facts WHERE user_id = :user_ids AND activity_version_id = :activity_version_ids} } else { error "Invalid arguments provided..." } @@ -187,7 +187,7 @@ } set properties [::xolp::util::lremove $properties indicator_id] set allowed_properties {user_id result_percentage duration} - lappend allowed_properties {*}[my set datetime_properties] + lappend allowed_properties {*}${:datetime_properties} foreach p $allowed_properties { if {$p in $properties} {lappend ordered_properties $p} @@ -236,7 +236,7 @@ } # Dimension: Time / Date foreach time_filter {begin_time_constraint begin_date_constraint end_time_constraint end_date_constraint storage_time_constraint storage_date_constraint} { - if {[set ${time_filter}] ne "" || [::xolp::util::lcontains $ordered_properties [my set datetime_properties]] } { + if {[set ${time_filter}] ne "" || [::xolp::util::lcontains $ordered_properties ${:datetime_properties}] } { set dimension_table xolp_[string map {"constraint" "dimension"} ${time_filter}] set dimension_table_pk [string map {"constraint" "id"} ${time_filter}] lappend dimensions "INNER JOIN $dimension_table USING ($dimension_table_pk)" @@ -268,7 +268,7 @@ $where_clause $group_by_clause " - set indicators [::xo::dc list_of_lists [my qn select_indicators] $sql] + set indicators [::xo::dc list_of_lists select_indicators $sql] set result_dict {} if {[llength $ordered_properties] <= 1} { # We only have one value @@ -291,8 +291,8 @@ {-indicator_id:required} } { } { - ::xo::dc 1row [my qn fetch] "SELECT * FROM xolp_indicator_facts WHERE indicator_id = :indicator_id" - set attributes [list indicator_id {*}[my essential_attributes]] + ::xo::dc 1row fetch {SELECT * FROM xolp_indicator_facts WHERE indicator_id = :indicator_id} + set attributes [list indicator_id {*}[:essential_attributes]] foreach a $attributes {lappend arguments -$a [set $a]} return [::xolp::Indicator new {*}$arguments] } @@ -336,24 +336,24 @@ -update false] set activity_verb_id [$activity_verb set activity_verb_id] } - set attributes [my essential_attributes] + set attributes [:essential_attributes] set bind_attributes [::xolp::util::ltransform $attributes] set sql "INSERT INTO xolp_indicator_facts ([join $attributes ,]) VALUES ([join $bind_attributes ,])" switch -- $return { "id" { append sql " RETURNING indicator_id" - ::xo::dc 1row [my qn insert_return_id] $sql + ::xo::dc 1row insert_return_id $sql return $indicator_id } object { set attributes [list indicator_id {*}$attributes] append sql " RETURNING [join $attributes ,]" - ::xo::dc 1row [my qn insert_return_all] $sql + ::xo::dc 1row insert_return_all $sql foreach a $attributes {lappend arguments -$a [set $a]} return [::xolp::Indicator new {*}$arguments] } default { - ::xo::dc dml [my qn insert] $sql + ::xo::dc dml insert $sql return } } @@ -363,12 +363,12 @@ ::xolp::Indicator ad_instproc save {} { Save object } { - set attributes [[my info class] essential_attributes] - my instvar indicator_id {*}$attributes + set attributes [[:info class] essential_attributes] + :instvar indicator_id {*}$attributes foreach a $attributes { lappend attribute_update_sql "$a = :$a" } - ::xo::dc dml [my qn update] " + ::xo::dc dml update " UPDATE xolp_indicator_facts SET Index: openacs-4/packages/xolp/tcl/xolp-iri-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xolp/tcl/xolp-iri-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xolp/tcl/xolp-iri-procs.tcl 29 Jun 2018 17:27:19 -0000 1.2 +++ openacs-4/packages/xolp/tcl/xolp-iri-procs.tcl 12 Apr 2019 11:48:01 -0000 1.3 @@ -21,15 +21,14 @@ Initializes the application class with an iri attribute and an accompanying (usually unique) index. } { - my superclass ::xo::db::Object - my slots { + :superclass ::xo::db::Object + :slots { ::xo::db::Attribute create iri } next - if {[::xo::db::require exists_table [my table_name]]} { - my log "Requiring unique index for [my table_name].iri" - #::xo::db::require index -table [my table_name] -col "iri text_pattern_ops" -unique [my iri_unique] - ::xo::db::require index -table [my table_name] -col "iri" -unique [my iri_unique] + if {[::xo::db::require exists_table ${:table_name}]} { + :log "Requiring unique index for ${:table_name}.iri" + ::xo::db::require index -table ${:table_name} -col "iri" -unique ${:iri_unique} } } @@ -40,8 +39,8 @@ For versioned objects like ::xolp::Activity, multiple ACS Object IDs may be returned. @return a list of ACS Object IDs } { - my instvar id_column table_name - ::xo::dc list_of_lists [my qn get_object_ids] "SELECT $id_column FROM $table_name WHERE iri = :iri ORDER BY $id_column DESC" + :instvar id_column table_name + ::xo::dc list_of_lists get_object_ids "SELECT $id_column FROM $table_name WHERE iri = :iri ORDER BY $id_column DESC" } ::xolp::iri::MetaClass ad_instproc require { @@ -57,10 +56,10 @@ and "object", which returns an initialized instance object of type Indicator. @return Returns an id or an instantiated object. } { - set object_ids [my get_object_ids -iri $iri] + set object_ids [:get_object_ids -iri $iri] if {$object_ids eq ""} { # Newly created object - set instance [my new_persistent_object -iri $iri {*}$args] + set instance [:new_persistent_object -iri $iri {*}$args] set object_id [$instance object_id] } else { # Reused object @@ -69,7 +68,7 @@ set instance [::xo::db::Class get_instance_from_db -id $object_id] } if {$update} { - #my log "[self] with IRI $iri already exists. Updating properties of latest..." + #:log "[self] with IRI $iri already exists. Updating properties of latest..." $instance configure {*}$args $instance save set instance [::xo::db::Class get_instance_from_db -id $object_id] @@ -83,7 +82,7 @@ } { Delete all objects identified by this IRI, including any object versions (if iri_unique false). } { - my instvar table_name + :instvar table_name return [::xo::dc dml delete "DELETE FROM $table_name WHERE iri = :iri"] } Index: openacs-4/packages/xolp/tcl/xolp-user-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xolp/tcl/xolp-user-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xolp/tcl/xolp-user-procs.tcl 12 Apr 2019 09:37:20 -0000 1.4 +++ openacs-4/packages/xolp/tcl/xolp-user-procs.tcl 12 Apr 2019 11:48:01 -0000 1.5 @@ -52,7 +52,7 @@ if {$evalscale eq ""} { error "There is no evaluation scale associated with context '$iri'." } - set result [my get_result \ + set result [:get_result \ -format "%s" \ -user_id $user_id \ -context_iri $context_iri \ @@ -131,7 +131,7 @@ } { set agg [string map -nocase {best max worst min average avg} $policy] if {$agg ni "min max avg"} {error "Unknown policy."} - set competency_dict [my get_competencies -user_id $user_id -policy $policy] + set competency_dict [:get_competencies -user_id $user_id -policy $policy] set competency_iris [dict keys $competency_dict] set quoted_list [::xolp::util::ltransform -prefix "'" -suffix "'" $competency_iris] # TODO: Avoid the second "poor mans" union clause @@ -187,7 +187,7 @@ } { Get competency evaluation } { - set result [my get_competency_result \ + set result [:get_competency_result \ -format "%s" \ -user_id $user_id \ -competency_iri $competency_iri \