Index: openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 21 Jun 2006 11:12:11 -0000 1.23 +++ openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 10 Jul 2006 13:15:13 -0000 1.24 @@ -7,6 +7,7 @@ Activity Structures Acts in play %count% Admin IMS LD + Calculate(expression) Caluclate Identifier Calulate Identifier Class @@ -156,12 +157,14 @@ Information given but no item associated to it for the role %role_title% Information given but no item associated to it for the activity structure %identifier% Invalid type %type% in imsld::next_activity + learning-desing tag not found in imsmanifest.xml Learning Activity Identifier Learning Object Identifier Learning Objective ID Learning Objectives ID Learning Unit finished <li> desc (no file associated) </li> + manifest namespace is not imscp More than one service in environment %identifier%. Just one used (the first one) More than one validation tried at the same time No imsmanifest.xml found @@ -172,6 +175,7 @@ Number of Organizations: On Completion Identifier Organization Identifier + organizations tag not found in imsmanifest.xml Parent Item Identifier Parent Manifest Identifier Parent Role Identifier @@ -203,10 +207,21 @@ Service type %service_type% not implemented Sorry, that service type (%service_type%) hasn't been implemented yet. Support Activity Identifier + The decimal digits can't be more than %restriction_value% The file %filex_href% was not created, it wasn't found in the manifest + The integer part can't have more than %restriction_value% digits + The length must be greather than %restriction_value% + The length must be lower than %restriction_value% + The length must be %restriction_value% The referenced play in 'when play completed' in the method does not exist The referenced role part in 'when role part completed' of the act %identifier% does not exist The resource %resource_identifier% has a reference to a non existing file (%resource_href%). + The value must be greather than %restriction_value% (inclusive) + The value must be greather than %restriction_value% + The value must be lower than %restriction_value% (inclusive + The value must be lower than %restriction_value% + The value (%value%) doesn't match with the expression %restriction_value% + The value %value% is not alowed There can't be less than %multiplicity% %element_name% and there are %tree_length%. This is not supported, sorry. There can't greather than %multiplicity% %element_name% and there are %tree_length%. This is not supported, sorry. There is no property-group with the identifier %ref% (referenced by property-group %identifier%) Index: openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-create.sql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-create.sql 29 Jun 2006 09:27:57 -0000 1.5 +++ openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-create.sql 10 Jul 2006 13:15:13 -0000 1.6 @@ -120,8 +120,8 @@ constraint imsld_pin_rn_fk references imsld_runs, is_visible_p char(1) - check (is_visible_p in ('t','f')), -- title for the class - title varchar(100), + check (is_visible_p in ('t','f')), + title varchar(100), -- title for the class with_control_p char(1) check (with_control_p in ('t','f')) -- class attribute according to the spec ); Index: openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl 6 Jul 2006 11:27:00 -0000 1.9 +++ openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl 10 Jul 2006 13:15:13 -0000 1.10 @@ -21,10 +21,12 @@ set method_rev_id [db_string get_method_rev_id {SELECT method_id FROM imsld_methods WHERE imsld_id = :imsld_id}] set method_id [db_string get_method_id {SELECT item_id FROM cr_revisions WHERE revision_id = :method_rev_id}] - db_foreach foreach_condition {SELECT condition_xml FROM imsld_conditions WHERE method_id = :method_id} { - dom parse $condition_xml document - $document documentElement condition - imsld::condition::execute -run_id $run_id -condition $condition + foreach condition_xml [db_list foreach_condition { + SELECT condition_xml FROM imsld_conditions WHERE method_id = :method_id + }] { + dom parse $condition_xml document + $document documentElement condition + imsld::condition::execute -run_id $run_id -condition $condition } } @@ -39,19 +41,19 @@ foreach ifNode $ifNodes { if {[imsld::expression::eval -run_id $run_id -expression [$ifNode childNodes]]} { - foreach thenNode $thenNodes { - imsld::statement::execute -run_id $run_id -statement [$thenNode childNodes] - } - } else { - foreach elseNode $elseNodes { - #an else node may contain an expression or another if_then_else - if { [string eq [ [$elseNode selectNodes {*[position()=1] } ] localName] "if" ] } { - imsld::condition::execute -run_id $run_id -condition $elseNode - } else { - imsld::statement::execute -run_id $run_id -statement [$elseNode childNodes] + foreach thenNode $thenNodes { + imsld::statement::execute -run_id $run_id -statement [$thenNode childNodes] } - } - } + } else { + foreach elseNode $elseNodes { + #an else node may contain an expression or another if_then_else + if { [string eq [ [$elseNode selectNodes {*[position()=1] } ] localName] "if" ] } { + imsld::condition::execute -run_id $run_id -condition $elseNode + } else { + imsld::statement::execute -run_id $run_id -statement [$elseNode childNodes] + } + } + } } } @@ -67,214 +69,225 @@ foreach expressionNode $expression { switch -- [$expressionNode localName] { - {complete} { + {complete} { - return 1 + return 1 - set activityNode [$expressionNode childNodes] - switch -- [$activityNode localName] { - {learning-activity-ref} { - set la_ref [$activityNode getAttribute {ref}] - db_1row get_la_id { - select ila.activity_id as la_id - iii.imsld_id as imsld_id - from imsld_learning_activities ila, - imsld_imsldsi iii, - imsld_componentsi ici, - imsld_runs ir - where ir.run_id=:run_id and - ir.imsld_id=iii.imsld_id and - iii.item_id=ici.imsld_id and - ici.item_id=ila.component_id - and ila.identifier=:la_ref - } - imsld::finish_component_element -imsld_id $imsld_id \ - -run_id $run_id \ - -element_id $la_id \ - -type learning \ - -user_id $user_id \ - -code_call + set activityNode [$expressionNode childNodes] + switch -- [$activityNode localName] { + {learning-activity-ref} { + set la_ref [$activityNode getAttribute {ref}] + db_1row get_la_id { + select ila.activity_id as la_id + iii.imsld_id as imsld_id + from imsld_learning_activities ila, + imsld_imsldsi iii, + imsld_componentsi ici, + imsld_runs ir + where ir.run_id=:run_id and + ir.imsld_id=iii.imsld_id and + iii.item_id=ici.imsld_id and + ici.item_id=ila.component_id + and ila.identifier=:la_ref + } + imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ + -element_id $la_id \ + -type learning \ + -user_id $user_id \ + -code_call - } - {support-activity-ref} { - set sa_ref [$activityNode getAttribute {ref}] - db_1row get_sa_id { - select isa.activity_id as sa_id - iii.imsld_id as imsld_id - ir.run_id as run_id - from imsld_support_activities isa, - imsld_imsldsi iii, - imsld_componentsi ici, - imsld_runs ir - where ir.run_id=:run_id and - ir.imsld_id=iii.imsld_id and - iii.item_id=ici.imsld_id and - ici.item_id=isa.component_id and - isa.identifier=:sa_ref - } - imsld::finish_component_element -imsld_id $imsld_id \ - -run_id $run_id \ - -element_id $sa_id \ - -type support \ - -user_id $user_id \ - -code_call - - } - {unit-of-learning-href} { - #TODO - } - {activity-structure-ref} { - se as_ref [$activityNode getAttribute {ref}] - db_1row get_as_id { - select ias.structure_id as as_id - from imsld_activity_structures ias, - imsld_componentsi ici, - imsld_imsldsi iii, - imsld_runs ir - where ir.run_id=:run_id and - ir.imsld_id=iii.imsld_id and - iii.item_id=ici.imsld_id and - ias.component_id=ici.item_id - ias.identifier=:as_ref - } - #TODO meter la funci�n finish - } - {act-ref} { - set actref [$activityNode getAttribute {ref}] - db_1row get_act_id { - select iai.act_id as act_id - imi.imsld_id as imsld_id - ipi.play_id as play_id - from imsld_acts iai, - imsld_imsldsi iii, - imsld_playsi ipi, - imsld_methodsi imi, - imsld_runs ir - where ir.run_id=:run_id and - ir.imsld_id=iii.imsld_id and - iii.item_id=imi.imsld_id and - imi.item_id=ipi.method_id and - ipi.item_id=iai.play_id and - iai.identifier=:actref - } - imsld:mark_act_finished -play_id $play_id -imsld_id $imsld_id \ - -act_id $act_id -run_id $run_id -user_id $user_id - } - {play-ref} { - set playref [$activityNode getAttribute {ref}] - db_1row get_play_id { - select ipi.play_id as play_id - iii.imsld_id as imsld_id - from imsld_imsldsi iii, - imsld_plays ipi, - imsld_methodsi imi, - imsld_runs ir - where ir.run_id=:run_id and - ir.imsld_id=iii.imsld_id and - iii.item_id=imi.imsld_id and - imi.item_id=ipi.method_id and - ipi.identifier=:playref - } - imsld::mark_play_finished -play_id $play_id -imsld_id $imsld_id \ - -run_id $run_id -user_id $user_id - } - } - } - {not} { return [expr ![imsld::expression::eval -run_id $run_id -expression $expressionNode]] } - {current-datetime} { return [clock format [clock seconds] -format "%Y-%m-%dT%H:%M:%S"] -gmt 1 } - {datetime-activity-started} { - # TODO what's the actual way this is enconded in the XML? any examples? - return TODO - set activity_ref [$expressionNode getAttribute {ref}] - #set activity_id [] # need to get the activity_id from the activity_ref - return [imsld::runtime::date_time_activity_started -run_id $run_id -user_id $user_id -activity_id $activity_id] - } - {time-unit-of-learning-started} { - return [imsld::runtime::time_uol_started -run_id $run_id] - } - {no-value} { - set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] - set propertyvalue [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [string tolower [$propertyref getAttribute {ref}]]] - return [empty_string_p $propertyvalue] - } - {users-in-role} { - # TODO Investigate usage in an expression - set roleref_value [$expressionNode selectNodes {*[local-name()='role-ref']/@ref}] - set role_id [imsld::roles::get_role_id -ref $roleref_value -run_id $run_id] - set persons_in_role [imsld::roles::get_users_in_role -run_id $run_id -role_id $role_id] - - } - {less-than} { - set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] - set propertyvalue0 [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [string tolower [$propertyref getAttribute {ref}]]] - set propertyvalue1 [[$expressionNode selectNodes {*[local-name()='property-value']}] text] - return [expr {$propertyvalue0 < $propertyvalue1}] - } - {greater-than} { - set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] - set propertyvalue0 [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [string tolower [$propertyref getAttribute {ref}]]] - set propertyvalue1 [[$expressionNode selectNodes {*[local-name()='property-value']}] text] - return [expr {$propertyvalue0 > $propertyvalue1}] - } - {divide} { - set childs [$expressionNode childNodes] - return [expr {[imsld::expression::eval -run_id $run_id -expression $childs[0]] / [imsld::expression::eval -run_id $run_id -expression $childs[1]]}] - } - {multiply} { - set childs [$expressionNode childNodes] - set returnvalue 0 - foreach child $childs { - set returnvalue [expr {$returnvalue * [imsld::expression::eval -run_id $run_id -expression $child]}] - } - return $returnvalue - } - {substract} { - set childs [$expressionNode childNodes] - return [expr {[imsld::expression::eval -run_id $run_id -expression $childs[0]] - [imsld::expression::eval -run_id $run_id -expression $childs[1]]}] - } - {sum} { - set childs [$expressionNode childNodes] - set returnvalue 0 - foreach child $childs { - set returnvalue [expr {$returnvalue + [imsld::expression::eval -run_id $run_id -expression $child]}] - } - return $returnvalue - } - {or} { - set childs [$expressionNode childNodes] - set returnvalue 0 - foreach child $childs { - set returnvalue [expr {$returnvalue || [imsld::expression::eval -run_id $run_id -expression $child]}] - } - return $returnvalue - } - {and} { - set childs [$expressionNode childNodes] - set returnvalue 1 - foreach child $childs { - set returnvalue [expr {$returnvalue && [imsld::expression::eval -run_id $run_id -expression $child]}] - } - return $returnvalue - } - {is-not} { - set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] - set propertyvalue0 [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [string tolower [$propertyref getAttribute {ref}]]] - set propertyvalue1 [[$expressionNode selectNodes {*[local-name()='property-value']}] text] - return [expr {$propertyvalue0 != $propertyvalue1}] - } - {is} { - set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] - set propertyvalue0 [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [string tolower [$propertyref getAttribute {ref}]]] - set propertyvalue1 [[$expressionNode selectNodes {*[local-name()='property-value']}] text] - return [expr {$propertyvalue0 == $propertyvalue1}] - } - {is-member-of-role} { - set roleref [$expressionNode getAttribute {ref}] - set role_id [imsld::roles::get_role_id -ref $roleref -run_id $run_id] - set users_list [imsld::roles::get_users_in_role -role_id $role_id -run_id $run_id] - return [ expr { [lsearch $users_list $user_id] > -1} ] - } - } + } + {support-activity-ref} { + set sa_ref [$activityNode getAttribute {ref}] + db_1row get_sa_id { + select isa.activity_id as sa_id + iii.imsld_id as imsld_id + ir.run_id as run_id + from imsld_support_activities isa, + imsld_imsldsi iii, + imsld_componentsi ici, + imsld_runs ir + where ir.run_id=:run_id and + ir.imsld_id=iii.imsld_id and + iii.item_id=ici.imsld_id and + ici.item_id=isa.component_id and + isa.identifier=:sa_ref + } + imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ + -element_id $sa_id \ + -type support \ + -user_id $user_id \ + -code_call + + } + {unit-of-learning-href} { + #TODO + } + {activity-structure-ref} { + se as_ref [$activityNode getAttribute {ref}] + db_1row get_as_id { + select ias.structure_id as as_id + from imsld_activity_structures ias, + imsld_componentsi ici, + imsld_imsldsi iii, + imsld_runs ir + where ir.run_id=:run_id and + ir.imsld_id=iii.imsld_id and + iii.item_id=ici.imsld_id and + ias.component_id=ici.item_id + ias.identifier=:as_ref + } + #TODO meter la funci�n finish + } + {act-ref} { + set actref [$activityNode getAttribute {ref}] + db_1row get_act_id { + select iai.act_id as act_id + imi.imsld_id as imsld_id + ipi.play_id as play_id + from imsld_acts iai, + imsld_imsldsi iii, + imsld_playsi ipi, + imsld_methodsi imi, + imsld_runs ir + where ir.run_id=:run_id and + ir.imsld_id=iii.imsld_id and + iii.item_id=imi.imsld_id and + imi.item_id=ipi.method_id and + ipi.item_id=iai.play_id and + iai.identifier=:actref + } + imsld:mark_act_finished -play_id $play_id -imsld_id $imsld_id \ + -act_id $act_id -run_id $run_id -user_id $user_id + } + {play-ref} { + set playref [$activityNode getAttribute {ref}] + db_1row get_play_id { + select ipi.play_id as play_id + iii.imsld_id as imsld_id + from imsld_imsldsi iii, + imsld_plays ipi, + imsld_methodsi imi, + imsld_runs ir + where ir.run_id=:run_id and + ir.imsld_id=iii.imsld_id and + iii.item_id=imi.imsld_id and + imi.item_id=ipi.method_id and + ipi.identifier=:playref + } + imsld::mark_play_finished -play_id $play_id -imsld_id $imsld_id \ + -run_id $run_id -user_id $user_id + } + } + } + {not} { + return [expr ![imsld::expression::eval -run_id $run_id -expression $expressionNode]] + } + {current-datetime} { return [clock format [clock seconds] -format "%Y-%m-%dT%H:%M:%S"] -gmt 1 } + {datetime-activity-started} { + # TODO what's the actual way this is enconded in the XML? any examples? + return TODO + set activity_ref [$expressionNode getAttribute {ref}] + #set activity_id [] # need to get the activity_id from the activity_ref + return [imsld::runtime::date_time_activity_started -run_id $run_id -user_id $user_id -activity_id $activity_id] + } + {time-unit-of-learning-started} { + return [imsld::runtime::time_uol_started -run_id $run_id] + } + {no-value} { + set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] + set propertyvalue [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [$propertyref getAttribute {ref}]] + return [empty_string_p $propertyvalue] + } + {users-in-role} { + # TODO Investigate usage in an expression + set roleref_value [$expressionNode selectNodes {*[local-name()='role-ref']/@ref}] + set role_id [imsld::roles::get_role_id -ref $roleref_value -run_id $run_id] + set persons_in_role [imsld::roles::get_users_in_role -run_id $run_id -role_id $role_id] + + } + {less-than} { + set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] + set propertyvalue0 [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [$propertyref getAttribute {ref}]] + set propertyvalue1 [[$expressionNode selectNodes {*[local-name()='property-value']}] text] + return [expr {$propertyvalue0 < $propertyvalue1}] + } + {greater-than} { + set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] + set propertyvalue0 [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [$propertyref getAttribute {ref}]] + set propertyvalue1 [[$expressionNode selectNodes {*[local-name()='property-value']}] text] + return [expr {$propertyvalue0 > $propertyvalue1}] + } + {divide} { + set childs [$expressionNode childNodes] + return [expr {[imsld::expression::eval -run_id $run_id -expression [lindex $childs 0]] / [imsld::expression::eval -run_id $run_id -expression [lindex $childs 1]]}] + } + {multiply} { + set childs [$expressionNode childNodes] + set returnvalue 1 + set count 0 + foreach child $childs { + set returnvalue [expr {$returnvalue * [imsld::expression::eval -run_id $run_id -expression $child]}] + incr count + } + set returnvalue [expr { [string eq 0 $count] ? 0 : $returnvalue }] + return $returnvalue + } + {substract} { + set childs [$expressionNode childNodes] + return [expr {[imsld::expression::eval -run_id $run_id -expression [lindex $childs 0]] - [imsld::expression::eval -run_id $run_id -expression [lindex $childs 1]]}] + } + {sum} { + set childs [$expressionNode childNodes] + set returnvalue 0 + foreach child $childs { + set returnvalue [expr {$returnvalue + [imsld::expression::eval -run_id $run_id -expression $child]}] + } + return $returnvalue + } + {or} { + set childs [$expressionNode childNodes] + set returnvalue 0 + foreach child $childs { + set returnvalue [expr {$returnvalue || [imsld::expression::eval -run_id $run_id -expression $child]}] + } + return $returnvalue + } + {and} { + set childs [$expressionNode childNodes] + set returnvalue 1 + foreach child $childs { + set returnvalue [expr {$returnvalue && [imsld::expression::eval -run_id $run_id -expression $child]}] + } + return $returnvalue + } + {is-not} { + set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] + set propertyvalue0 [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [$propertyref getAttribute {ref}]] + set propertyvalue1 [[$expressionNode selectNodes {*[local-name()='property-value']}] text] + return [expr {$propertyvalue0 != $propertyvalue1}] + } + {is} { + set propertyref [$expressionNode selectNodes {*[local-name()='property-ref']}] + set propertyvalue0 [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [$propertyref getAttribute {ref}]] + set propertyvalue1 [[$expressionNode selectNodes {*[local-name()='property-value']}] text] + return [expr {$propertyvalue0 == $propertyvalue1}] + } + {is-member-of-role} { + set roleref [$expressionNode getAttribute {ref}] + set role_id [imsld::roles::get_role_id -ref $roleref -run_id $run_id] + set users_list [imsld::roles::get_users_in_role -role_id $role_id -run_id $run_id] + return [ expr { [lsearch $users_list $user_id] > -1} ] + } + {property-ref} { + return [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [$expressionNode getAttribute {ref}]] + } + {property-value} { + return [$expressionNode text] + } + } } } @@ -373,8 +386,27 @@ } {change-property-value} { set propertyref [$executeNode selectNodes {*[local-name()='property-ref']}] - set propertyvalue [[$executeNode selectNodes {*[local-name()='property-value']}] text] - imsld::runtime::property::property_value_set -run_id $run_id -user_id $user_id -identifier [$propertyref getAttribute {ref}] -value $propertyvalue + set propertyvalueNode [$executeNode selectNodes {*[local-name()='property-value']}] + set propertyvalueChildNode [$propertyvalueNode childNodes] + set nodeType [$propertyvalueChildNode nodeType] + switch -- $nodeType { + {ELEMENT_NODE} { + switch -- [$propertyvalueChildNode localName] { + {calculate} { + set propertyValue [imsld::expression::eval -run_id $run_id -expression [$propertyvalueChildNode childNodes]] + } + {property-ref} { + set propertyValue [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [$propertyvalueChildNode getAttribute {ref}]] + } + + } + } + {TEXT_NODE} { + set propertyValue [$propertyvalueNode text] + } + } + + imsld::runtime::property::property_value_set -run_id $run_id -user_id $user_id -identifier [$propertyref getAttribute {ref}] -value $propertyValue } {notification} {} } Index: openacs-4/packages/imsld/tcl/imsld-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-install-procs.tcl,v diff -u -N -r1.28 -r1.29 --- openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 21 Jun 2006 13:01:34 -0000 1.28 +++ openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 10 Jul 2006 13:15:13 -0000 1.29 @@ -276,7 +276,7 @@ content::type::attribute::new -content_type imsld_property_value -attribute_name property_id -datatype number -pretty_name "#imsld.Property_Identifier#" -column_spec "integer" content::type::attribute::new -content_type imsld_property_value -attribute_name langstring -datatype string -pretty_name "#imsld.Langstring#" -column_spec "varchar(4000)" - content::type::attribute::new -content_type imsld_property_value -attribute_name expression_xml -datatype number -pretty_name "<#_ Calculate(expression) #>" -column_spec "integer" + content::type::attribute::new -content_type imsld_property_value -attribute_name expression_xml -datatype number -pretty_name "#imsld.Calculateexpression#" -column_spec "integer" content::type::attribute::new -content_type imsld_property_value -attribute_name property_value_ref -datatype number -pretty_name "#imsld.Property_Value_Ref#" -column_spec "integer" # complete acts Index: openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 29 Jun 2006 09:27:57 -0000 1.5 +++ openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 10 Jul 2006 13:15:13 -0000 1.6 @@ -337,7 +337,8 @@ foreach imsld_item_id $linear_item_list { db_foreach nested_associated_items { select ii.imsld_item_id, ii.item_id, - coalesce(ii.is_visible_p, 't') as is_visible_p + coalesce(ii.is_visible_p, 't') as is_visible_p, + ii.identifier from imsld_itemsi ii where (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) @@ -350,15 +351,16 @@ and run_id = :run_id and type = 'isvisible' }] } { - set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $imsld_item_id] [list type "isvisible"] [list identifier ""] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $imsld_item_id] [list type "isvisible"] [list identifier $identifier] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] } } } # 1.2. learning activities db_foreach learning_activity { select la.activity_id, - coalesce(la.is_visible_p, 't') as is_visible_p + coalesce(la.is_visible_p, 't') as is_visible_p, + la.identifier from imsld_learning_activities la where la.component_id = :component_item_id } { @@ -369,14 +371,15 @@ and run_id = :run_id and type = 'isvisible' }] } { - set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $activity_id] [list type "isvisible"] [list identifier ""] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $activity_id] [list type "isvisible"] [list identifier $identifier] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] } } # 1.3. support activities db_foreach support_activity { select sa.activity_id, - coalesce(sa.is_visible_p, 't') as is_visible_p + coalesce(sa.is_visible_p, 't') as is_visible_p, + sa.identifier from imsld_support_activities sa where sa.component_id = :component_item_id } { @@ -387,15 +390,16 @@ and run_id = :run_id and type = 'isvisible' }] } { - set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $activity_id] [list type "isvisible"] [list identifier ""] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $activity_id] [list type "isvisible"] [list identifier $identifier] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] } } # 1.4. learning object (environment) db_foreach learning_object { select lo.learning_object_id, coalesce(lo.is_visible_p, 't') as is_visible_p, - class + class, + lo.identifier from imsld_learning_objects lo, imsld_environmentsi env where lo.environment_id = env.item_id and env.component_id = :component_item_id @@ -407,7 +411,7 @@ and run_id = :run_id and type = 'isvisible' }] } { - set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $learning_object_id] [list type "isvisible"] [list identifier ""] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $learning_object_id] [list type "isvisible"] [list identifier $identifier] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] } if { ![string eq "" $class] && ![db_0or1row lo_env_already_instantiated_p { select 1 @@ -424,7 +428,8 @@ db_foreach service { select serv.service_id, coalesce(serv.is_visible_p, 't') as is_visible_p, - class + class, + serv.identifier from imsld_services serv, imsld_environmentsi env where serv.environment_id = env.item_id and env.component_id = :component_item_id @@ -436,7 +441,7 @@ and run_id = :run_id and type = 'isvisible' }] } { - set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $service_id] [list type "isvisible"] [list identifier ""] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $service_id] [list type "isvisible"] [list identifier $identifier] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] } if { ![string eq "" $class] && ![db_0or1row serv_env_already_instantiated_p { select 1 @@ -452,7 +457,8 @@ # 1.6. play db_foreach play { select play.play_id, - coalesce(play.is_visible_p, 't') as is_visible_p + coalesce(play.is_visible_p, 't') as is_visible_p, + play.identifier from imsld_plays play, imsld_methodsi im where play.method_id = im.item_id and im.imsld_id = :run_imsld_item_id @@ -464,7 +470,7 @@ and run_id = :run_id and type = 'isvisible' }] } { - set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $play_id] [list type "isvisible"] [list identifier ""] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $play_id] [list type "isvisible"] [list identifier $identifier] [list run_id $run_id] [list is_visible_p $is_visible_p] [list title ""] [list with_control_p ""]] imsld_attribute_instance new] } } Index: openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl,v diff -u -N -r1.47 -r1.48 --- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 27 Jun 2006 10:39:11 -0000 1.47 +++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 10 Jul 2006 13:15:13 -0000 1.48 @@ -115,19 +115,19 @@ #Check the base URI if { ![string eq [$tree namespaceURI] [imsld::parse::get_URI -type "imscp"] ]} { - return -code error "IMSLD:imsld::parse::is_imsld: <#_ manifest namespace is not imscp#>" + return -code error "IMSLD:imsld::parse::is_imsld: [_ imsld.lt_manifest_namespace_is]" } # Check organizations set organizations [ $tree selectNodes { *[local-name()='organizations'] } ] if { ![string eq [$organizations namespaceURI] [imsld::parse::get_URI -type "imscp"] ] } { - return -code error "IMSLD:imsld::parse::is_imsld: <#_ organizations tag not found in imsmanifest.xml#>" + return -code error "IMSLD:imsld::parse::is_imsld: [_ imsld.lt_organizations_tag_not]" } imsld::parse::validate_multiplicity -tree $organizations -multiplicity 1 -element_name organizations -equal # Check learning-design tag set ld_tag [ $organizations selectNodes { *[local-name()='learning-design'] } ] if { ! [string eq [$ld_tag namespaceURI] [imsld::parse::get_URI -type "imsld"] ] } { - return -code error "IMSLD:imsld::parse::is_imsld: <#_ learning-desing tag not found in imsmanifest.xml#>" + return -code error "IMSLD:imsld::parse::is_imsld: [_ imsld.lt_learning-desing_tag_n]" } imsld::parse::validate_multiplicity -tree $ld_tag -multiplicity 1 -element_name IMD-LD -equal @@ -579,7 +579,7 @@ } { upvar files_struct_list files_struct_list # verify that the resource hasn't been already created - set resource_identifier [string tolower [imsld::parse::get_attribute -node $resource_node -attr_name identifier]] + set resource_identifier [imsld::parse::get_attribute -node $resource_node -attr_name identifier] if { ![db_0or1row redundancy_protection { select item_id as resource_id from imsld_cp_resourcesi @@ -722,7 +722,7 @@ upvar files_struct_list files_struct_list set item_title [imsld::parse::get_title -node $item_node -prefix imsld] - set item_identifier [string tolower [imsld::parse::get_attribute -node $item_node -attr_name identifier]] + set item_identifier [imsld::parse::get_attribute -node $item_node -attr_name identifier] set item_is_visible_p [imsld::parse::get_bool_attribute -node $item_node -attr_name isvisible -default t] set item_parameters [imsld::parse::get_attribute -node $item_node -attr_name parameters] set item_identifierref [imsld::parse::get_attribute -node $item_node -attr_name identifierref] @@ -731,7 +731,7 @@ -attributes [list [list identifier $item_identifier] \ [list is_visible_p $item_is_visible_p] \ [list parameters $item_parameters] \ - [list identifierref [string tolower $item_identifierref]] \ + [list identifierref $item_identifierref] \ [list parent_item_id $parent_item_id]] \ -parent_id $parent_id] @@ -821,7 +821,7 @@ } } set role_href [imsld::parse::get_attribute -node $roles_node -attr_name href] - set role_identifier [string tolower [imsld::parse::get_attribute -node $roles_node -attr_name identifier]] + set role_identifier [imsld::parse::get_attribute -node $roles_node -attr_name identifier] set role_match_persons [imsld::parse::get_attribute -node $roles_node -attr_name match-persons] switch [string tolower $role_match_persons] { exclusively-in-roles { @@ -1023,7 +1023,7 @@ } { upvar files_struct_list files_struct_list - set identifier [string tolower [imsld::parse::get_attribute -node $property_group_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $property_group_node -attr_name identifier] set title [imsld::parse::get_title -node $property_group_node -prefix imsld] set property_group_id [imsld::item_revision_new -attributes [list [list identifier $identifier] \ @@ -1034,7 +1034,7 @@ set property_refs [$property_group_node selectNodes "*\[local-name()='property-ref'\]"] foreach property $property_refs { - set ref [string tolower [imsld::parse::get_attribute -node $property -attr_name ref]] + set ref [imsld::parse::get_attribute -node $property -attr_name ref] if { ![db_0or1row get_property_id { select item_id as property_item_id from imsld_propertiesi @@ -1050,7 +1050,7 @@ set property_group_refs [$property_group_node selectNodes "*\[local-name()='property-group-ref'\]"] foreach property_group $property_group_refs { - set ref [string tolower [imsld::parse::get_attribute -node $property_group -attr_name ref]] + set ref [imsld::parse::get_attribute -node $property_group -attr_name ref] if { ![db_0or1row get_group_property_id { select item_id as group_property_item_id from imsld_propertiesi @@ -1066,7 +1066,7 @@ set found_p 0 foreach referenced_property_group $property_groups { - set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_property_group -attr_name identifier]] + set referenced_identifier [imsld::parse::get_attribute -node $referenced_property_group -attr_name identifier] if { [string eq $ref $referenced_identifier] } { set found_p 1 set referenced_property_group_node $referenced_property_group @@ -1129,7 +1129,7 @@ set loc_properties [$property_node selectNodes "*\[local-name()='loc-property' \]"] foreach loc_property $loc_properties { set lp_title [imsld::parse::get_title -node $loc_property -prefix imsld] - set lp_identifier [string tolower [imsld::parse::get_attribute -node $loc_property -attr_name identifier]] + set lp_identifier [imsld::parse::get_attribute -node $loc_property -attr_name identifier] set lp_datatype [$loc_property selectNodes "*\[local-name()='datatype' \]"] imsld::parse::validate_multiplicity -tree $lp_datatype -multiplicity 1 -element_name "loc-property datatype" -equal set lp_datatype [string tolower [imsld::parse::get_attribute -node $lp_datatype -attr_name datatype]] @@ -1171,7 +1171,7 @@ set locpers_properties [$property_node selectNodes "*\[local-name()='locpers-property' \]"] foreach locpers_property $locpers_properties { set lpp_title [imsld::parse::get_title -node $locpers_property -prefix imsld] - set lpp_identifier [string tolower [imsld::parse::get_attribute -node $locpers_property -attr_name identifier]] + set lpp_identifier [imsld::parse::get_attribute -node $locpers_property -attr_name identifier] set lpp_datatype [$locpers_property selectNodes "*\[local-name()='datatype' \]"] imsld::parse::validate_multiplicity -tree $lpp_datatype -multiplicity 1 -element_name "locpers-property datatype" -equal set lpp_datatype [string tolower [imsld::parse::get_attribute -node $lpp_datatype -attr_name datatype]] @@ -1213,14 +1213,14 @@ set locrole_properties [$property_node selectNodes "*\[local-name()='locrole-property'\]"] foreach locrole_property $locrole_properties { set lrp_title [imsld::parse::get_title -node $locrole_property -prefix imsld] - set lrp_identifier [string tolower [imsld::parse::get_attribute -node $locrole_property -attr_name identifier]] + set lrp_identifier [imsld::parse::get_attribute -node $locrole_property -attr_name identifier] set lrp_datatype [$locrole_property selectNodes "*\[local-name()='datatype'\]"] imsld::parse::validate_multiplicity -tree $lrp_datatype -multiplicity 1 -element_name "locrole-property datatype" -equal set lrp_datatype [string tolower [imsld::parse::get_attribute -node $lrp_datatype -attr_name datatype]] set role_ref [$lrp_datatype selectNodes "*\[local-name()='role-ref'\]"] imsld::parse::validate_multiplicity -tree $lrp_datatype -multiplicity 1 -element_name "locrole-property role" -equal - set ref [string tolower [imsld::parse::get_attribute -node $role_ref -attr_name ref]] + set ref [imsld::parse::get_attribute -node $role_ref -attr_name ref] if { ![db_0or1row get_role_id { select item_id as role_id from imsld_rolesi @@ -1270,11 +1270,11 @@ # globpers properties set globpers_properties [$property_node selectNodes "*\[local-name()='globpers-property'\]"] foreach globpers_property $globpers_properties { - set gp_identifier [string tolower [imsld::parse::get_attribute -node $globpers_property -attr_name identifier]] + set gp_identifier [imsld::parse::get_attribute -node $globpers_property -attr_name identifier] set gp_existing [$globpers_property selectNodes "*\[local-name()='existing'\]"] imsld::parse::validate_multiplicity -tree $gp_existing -multiplicity 1 -element_name "existing(globpers)" -lower_than if { [llength $gp_existing] } { - set gp_existing_href [string tolower [imsld::parse::get_attribute -node $gp_exiting -attr_name href]] + set gp_existing_href [imsld::parse::get_attribute -node $gp_exiting -attr_name href] } else { set gp_existing_href "" } @@ -1300,11 +1300,11 @@ # globp properties set glob_properties [$property_node selectNodes "*\[local-name()='glob-property'\]"] foreach glob_property $glob_properties { - set g_identifier [string tolower [imsld::parse::get_attribute -node $glob_property -attr_name identifier]] + set g_identifier [imsld::parse::get_attribute -node $glob_property -attr_name identifier] set g_existing [$glob_property selectNodes "*\[local-name()='existing'\]"] imsld::parse::validate_multiplicity -tree $g_exiting -multiplicity 1 -element_name "existing(glob)" -lower_than if { [llength $g_existing] } { - set g_existing_href [string tolower [imsld::parse::get_attribute -node $g_exiting -attr_name href]] + set g_existing_href [imsld::parse::get_attribute -node $g_exiting -attr_name href] } else { set g_existing_href "" } @@ -1516,7 +1516,7 @@ # get learning object info set learning_object_class [imsld::parse::get_attribute -node $learning_object_node -attr_name class] - set identifier [string tolower [imsld::parse::get_attribute -node $learning_object_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $learning_object_node -attr_name identifier] set is_visible_p [imsld::parse::get_bool_attribute -node $learning_object_node -attr_name isvisible -default t] set parameters [imsld::parse::get_attribute -node $learning_object_node -attr_name parameters] set type [imsld::parse::get_attribute -node $learning_object_node -attr_name type] @@ -1599,7 +1599,7 @@ # get service info set service_class [imsld::parse::get_attribute -node $service_node -attr_name class] - set identifier [string tolower [imsld::parse::get_attribute -node $service_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $service_node -attr_name identifier] set is_visible_p [imsld::parse::get_bool_attribute -node $service_node -attr_name isvisible -default t] set parameters [imsld::parse::get_attribute -node $service_node -attr_name parameters] @@ -1641,7 +1641,7 @@ foreach email_data $email_data_list { set role_ref [$email_data selectNodes "*\[local-name()='role-ref'\]"] imsld::parse::validate_multiplicity -tree $role_ref -multiplicity 1 -element_name role-ref(email-data) -equal - set ref [string tolower [imsld::parse::get_attribute -node $role_ref -attr_name ref]] + set ref [imsld::parse::get_attribute -node $role_ref -attr_name ref] if { ![db_0or1row get_role_id_from_ref { select ir.item_id as role_id from imsld_rolesi ir @@ -1654,7 +1654,7 @@ } # email-property-ref - set email_property_ref [string tolower [imsld::parse::get_attribute -node $email_data -attr_name email-property-ref]] + set email_property_ref [imsld::parse::get_attribute -node $email_data -attr_name email-property-ref] if { ![string eq $email_property_ref ""] } { if { ![db_0or1row get_property_id { select item_id as email_property_id @@ -1670,7 +1670,7 @@ } # username-property-ref - set username_property_ref [string tolower [imsld::parse::get_attribute -node $email_data -attr_name username-property-ref]] + set username_property_ref [imsld::parse::get_attribute -node $email_data -attr_name username-property-ref] if { ![string eq $username_property_ref ""] } { if { ![db_0or1row get_property_id { select item_id as username_property_id @@ -1708,7 +1708,7 @@ set manager_id "" if { [llength $manager] } { imsld::parse::validate_multiplicity -tree $manager -multiplicity 1 -element_name conference-manager -equal - set role_ref [string tolower [imsld::parse::get_attribute -node $manager -attr_name role-ref]] + set role_ref [imsld::parse::get_attribute -node $manager -attr_name role-ref] if { ![db_0or1row get_role_id_from_role_ref { select item_id as manager_id from imsld_rolesi @@ -1784,7 +1784,7 @@ set participant_list [$conference selectNodes "*\[local-name()='participant'\]"] imsld::parse::validate_multiplicity -tree $participant_list -multiplicity 1 -element_name conference-participant -greather_than foreach participant $participant_list { - set role_ref [string tolower [imsld::parse::get_attribute -node $participant -attr_name role-ref]] + set role_ref [imsld::parse::get_attribute -node $participant -attr_name role-ref] if { ![db_0or1row get_role_id_from_role_ref { select item_id as participant_id from imsld_rolesi @@ -1805,7 +1805,7 @@ set observer_list [$conference selectNodes "*\[local-name()='observer'\]"] if { [llength $observer_list] } { foreach observer $observer_list { - set role_ref [string tolower [imsld::parse::get_attribute -node $observer -attr_name role-ref]] + set role_ref [imsld::parse::get_attribute -node $observer -attr_name role-ref] if { ![db_0or1row get_role_id_from_role_ref { select item_id as observer_id from imsld_rolesi @@ -1827,7 +1827,7 @@ set moderator_list [$conference selectNodes "*\[local-name()='moderator'\]"] if { [llength $moderator_list] } { foreach moderator $moderator_list { - set role_ref [string tolower [imsld::parse::get_attribute -node $moderator -attr_name role-ref]] + set role_ref [imsld::parse::get_attribute -node $moderator -attr_name role-ref] if { ![db_0or1row get_role_id_from_role_ref { select item_id as moderator_id from imsld_rolesi @@ -1872,7 +1872,7 @@ # monitor: role-ref set role_ref [$monitor_service selectNodes "*\[local-name()='role-ref'\]"] imsld::parse::validate_multiplicity -tree $role_ref -multiplicity 1 -element_name role-ref -equal - set ref [string tolower [imsld::parse::get_attribute -node $role_ref -attr_name ref]] + set ref [imsld::parse::get_attribute -node $role_ref -attr_name ref] if { ![db_0or1row get_role_id { select ir.item_id as role_id from imsld_rolesi ir @@ -1942,7 +1942,7 @@ upvar warnings warnings # get environment info - set identifier [string tolower [imsld::parse::get_attribute -node $environment_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $environment_node -attr_name identifier] set title [imsld::parse::get_title -node $environment_node -prefix imsld] # check if the environmet hasn't been already created by the reference of another environment previously parsed @@ -1998,7 +1998,7 @@ set environment_ref_list [$environment_node selectNodes "*\[local-name()='environment-ref'\]"] if { [llength $environment_ref_list] } { foreach environment_ref $environment_ref_list { - set ref [string tolower [imsld::parse::get_attribute -node $environment_ref -attr_name ref]] + set ref [imsld::parse::get_attribute -node $environment_ref -attr_name ref] # we have to search for the referenced environment and there are two cases: # 1. the referenced environment has been created: get the id from the database and do the mappings # 2. the referenced environment hasn't been created: invoke the parse_and_create_environment proc, @@ -2019,7 +2019,7 @@ # set environments [[[$organizations child all imsld:learning-design] child all imsld:components] child all imsld:environments] set found_p 0 foreach referenced_environment [$environments selectNodes "*\[local-name()='environment'\]"] { - set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_environment -attr_name identifier]] + set referenced_identifier [imsld::parse::get_attribute -node $referenced_environment -attr_name identifier] if { [string eq $ref $referenced_identifier] } { set found_p 1 set environment_referenced_node $referenced_environment @@ -2069,7 +2069,7 @@ # Property Ref set property_ref [$property_value_node selectNodes "*\[local-name()='property-ref'\]"] imsld::parse::validate_multiplicity -tree $property_ref -multiplicity 1 -element_name property-ref(property-value) -equal - set ref [string tolower [imsld::parse::get_attribute -node $property_ref -attr_name ref]] + set ref [imsld::parse::get_attribute -node $property_ref -attr_name ref] if { ![db_0or1row get_property_id { select ip.item_id as property_id from imsld_propertiesi ip, imsld_componentsi ic, imsld_imsldsi ii, imsld_cp_organizationsi ico @@ -2147,7 +2147,7 @@ upvar files_struct_list files_struct_list # get the info of the learning activity and create it - set identifier [string tolower [imsld::parse::get_attribute -node $activity_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $activity_node -attr_name identifier] set is_visible_p [imsld::parse::get_bool_attribute -node $activity_node -attr_name isvisible -default t] set parameters [imsld::parse::get_attribute -node $activity_node -attr_name parameters] set title [imsld::parse::get_title -node $activity_node -prefix imsld] @@ -2327,7 +2327,7 @@ # the environments have been already parsed by now, # so the referenced environment has to be in the database. # If not found, return the error - set environment_ref [string tolower [imsld::parse::get_attribute -node $environment_ref_node -attr_name ref]] + set environment_ref [imsld::parse::get_attribute -node $environment_ref_node -attr_name ref] if { ![db_0or1row get_environment_id { select item_id as environment_id from imsld_environmentsi @@ -2370,7 +2370,7 @@ upvar files_struct_list files_struct_list # get the info of the support activity and create it - set identifier [string tolower [imsld::parse::get_attribute -node $activity_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $activity_node -attr_name identifier] set is_visible_p [imsld::parse::get_bool_attribute -node $activity_node -attr_name isvisible -default t] set parameters [imsld::parse::get_attribute -node $activity_node -attr_name parameters] set title [imsld::parse::get_title -node $activity_node -prefix imsld] @@ -2506,7 +2506,7 @@ # Support Activity: Role ref set role_ref_list [$activity_node selectNodes "*\[local-name()='role-ref'\]"] foreach role_ref $role_ref_list { - set ref [string tolower [imsld::parse::get_attribute -node $role_ref -attr_name ref]] + set ref [imsld::parse::get_attribute -node $role_ref -attr_name ref] if { ![db_0or1row get_role_id { select item_id as role_id from imsld_rolesi @@ -2528,7 +2528,7 @@ # the environments have been already parsed by now, # so the referenced environment has to be in the database. # If not found, return the error - set environment_ref [string tolower [imsld::parse::get_attribute -node $environment_ref_node -attr_name ref]] + set environment_ref [imsld::parse::get_attribute -node $environment_ref_node -attr_name ref] if { ![db_0or1row get_environment_id { select item_id as environment_id from imsld_environmentsi @@ -2570,7 +2570,7 @@ upvar warnings warnings # get the info of the activity structure and create it - set identifier [string tolower [imsld::parse::get_attribute -node $activity_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $activity_node -attr_name identifier] set number_to_select [imsld::parse::get_attribute -node $activity_node -attr_name number-to-select] set sort [imsld::parse::get_attribute -node $activity_node -attr_name sort] set sort [expr { [string eq "" $sort] ? "as-is" : "[string tolower $sort]" }] @@ -2632,7 +2632,7 @@ # the environments have been already parsed by now, # so the referenced environment has to be in the database. # If not found, return the error - set environment_ref [string tolower [imsld::parse::get_attribute -node $node_ref -attr_name ref]] + set environment_ref [imsld::parse::get_attribute -node $node_ref -attr_name ref] if { ![db_0or1row get_environment_id { select item_id as environment_id from imsld_environmentsi @@ -2652,7 +2652,7 @@ if { [string eq [$node_ref nodeName] imsld:learning-activity-ref] } { # the learning activities have been already parsed by now, so the referenced learning activity has to be in the database. # If not, return the error - set learning_activity_ref [string tolower [imsld::parse::get_attribute -node $node_ref -attr_name ref]] + set learning_activity_ref [imsld::parse::get_attribute -node $node_ref -attr_name ref] if { ![db_0or1row get_learning_activity_id { select item_id as activity_id, activity_id as learning_activity_id @@ -2697,7 +2697,7 @@ set found_p 0 foreach referenced_activity_structure $activity_structures { - set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier]] + set referenced_identifier [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier] if { [string eq $learning_activity_ref $referenced_identifier] } { set found_p 1 set referenced_structure_node $referenced_activity_structure @@ -2758,7 +2758,7 @@ # the support activities have been already parsed by now, so the referenced support activity has to be in the database. # If not, return the error - set support_activity_ref [string tolower [imsld::parse::get_attribute -node $node_ref -attr_name ref]] + set support_activity_ref [imsld::parse::get_attribute -node $node_ref -attr_name ref] if { ![db_0or1row get_support_activity_id { select item_id as activity_id, activity_id as support_activity_id @@ -2802,7 +2802,7 @@ set found_p 0 foreach referenced_activity_structure $activity_structures { - set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier]] + set referenced_identifier [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier] if { [string eq $support_activity_ref $referenced_identifier] } { set found_p 1 set referenced_structure_node $referenced_activity_structure @@ -2862,7 +2862,7 @@ # Activity Structure: Activity Structures ref if { [string eq [$node_ref nodeName] imsld:activity-structure-ref] } { - set ref [string tolower [imsld::parse::get_attribute -node $node_ref -attr_name ref]] + set ref [imsld::parse::get_attribute -node $node_ref -attr_name ref] # we have to search for the referenced activity structure and there are two cases: # 1. the referenced activity structure has already been created: get the id from the database and do the mappings # 2. the referenced activity structure hasn't been created: invoke the parse_and_create_activity_structure proc, @@ -2890,7 +2890,7 @@ set found_p 0 foreach referenced_activity_structure $activity_structures { - set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier]] + set referenced_identifier [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier] if { [string eq $ref $referenced_identifier] } { set found_p 1 set referenced_structure_node $referenced_activity_structure @@ -2950,7 +2950,7 @@ } { upvar warnings warnings # get the info of the role part and create it - set identifier [string tolower [imsld::parse::get_attribute -node $role_part_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $role_part_node -attr_name identifier] set title [imsld::parse::get_title -node $role_part_node -prefix imsld] set component_id [db_string get_component_id { select cr4.item_id as component_id @@ -2976,7 +2976,7 @@ imsld::parse::validate_multiplicity -tree $role_ref -multiplicity 1 -element_name role-ref(role-part) -equal # the roles have already been parsed by now, so the referenced role has to be in the database. # If not, return the error - set role_ref_ref [string tolower [imsld::parse::get_attribute -node $role_ref -attr_name ref]] + set role_ref_ref [imsld::parse::get_attribute -node $role_ref -attr_name ref] if { ![db_0or1row get_role_id { select ir.item_id as role_id from imsld_rolesi ir @@ -2998,7 +2998,7 @@ imsld::parse::validate_multiplicity -tree $learning_activity_ref -multiplicity 1 -element_name learning-activity-ref(role-part) -equal # the learning activities have already been parsed by now, so the referenced learning activity has to be in the database. # If not, return the error - set learning_activity_ref_ref [string tolower [imsld::parse::get_attribute -node $learning_activity_ref -attr_name ref]] + set learning_activity_ref_ref [imsld::parse::get_attribute -node $learning_activity_ref -attr_name ref] if { ![db_0or1row get_learning_activity_id { select la.item_id as learning_activity_id from imsld_learning_activitiesi la @@ -3041,7 +3041,7 @@ imsld::parse::validate_multiplicity -tree $support_activity_ref -multiplicity 1 -element_name support-activity-ref(role-part) -equal # the support activities have already been parsed by now, so the referenced support activity has to be in the database. # If not, return the error - set support_activity_ref_ref [string tolower [imsld::parse::get_attribute -node $support_activity_ref -attr_name ref]] + set support_activity_ref_ref [imsld::parse::get_attribute -node $support_activity_ref -attr_name ref] if { ![db_0or1row get_support_activity_id { select sa.item_id as support_activity_id from imsld_support_activitiesi sa @@ -3086,7 +3086,7 @@ imsld::parse::validate_multiplicity -tree $activity_structure_ref -multiplicity 1 -element_name activity-structure-ref(role-part) -equal # the activity structures have already been parsed by now, so the referenced activity structure has to be in the database. # If not, return the error - set activity_structure_ref_ref [string tolower [imsld::parse::get_attribute -node $activity_structure_ref -attr_name ref]] + set activity_structure_ref_ref [imsld::parse::get_attribute -node $activity_structure_ref -attr_name ref] if { ![db_0or1row get_activity_structure_id { select ias.item_id as activity_structure_id from imsld_activity_structuresi ias @@ -3130,7 +3130,7 @@ imsld::parse::validate_multiplicity -tree $environment_ref -multiplicity 1 -element_name environment-ref(role-part) -equal # the environments have already been parsed by now, so the referenced environment has to be in the database. # If not, return the error - set environment_ref_ref [string tolower [imsld::parse::get_attribute -node $environment_ref -attr_name ref]] + set environment_ref_ref [imsld::parse::get_attribute -node $environment_ref -attr_name ref] if { ![db_0or1row get_env_id { select env.item_id as environment_id from imsld_environmentsi env @@ -3183,7 +3183,7 @@ upvar warnings warnings # get the info of the act and create it - set identifier [string tolower [imsld::parse::get_attribute -node $act_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $act_node -attr_name identifier] set title [imsld::parse::get_title -node $act_node -prefix imsld] # Act: Complete Act: Time Limit @@ -3223,7 +3223,7 @@ imsld::parse::validate_multiplicity -tree $role_ref -multiplicity 1 -element_name role-ref(when-condition-true) -equal # the roles have already been parsed by now, so the referenced role has to be in the database. # If not, return the error - set role_ref_ref [string tolower [imsld::parse::get_attribute -node $role_ref -attr_name ref]] + set role_ref_ref [imsld::parse::get_attribute -node $role_ref -attr_name ref] if { ![db_0or1row get_role_id { select ir.item_id as role_id from imsld_rolesi ir @@ -3337,7 +3337,7 @@ imsld::parse::validate_multiplicity -tree $complete_act -multiplicity 1 -element_name complete-act -equal set when_rp_completed_list [$complete_act selectNodes "*\[local-name()='when-role-part-completed'\]"] foreach when_rp_completed $when_rp_completed_list { - set ref [string tolower [imsld::parse::get_attribute -node $when_rp_completed -attr_name ref]] + set ref [imsld::parse::get_attribute -node $when_rp_completed -attr_name ref] # verify that the referenced role part exists if { ![db_0or1row get_rp_id { select item_id as role_part_id @@ -3381,7 +3381,7 @@ upvar warnings warnings # get the info of the play and create it - set identifier [string tolower [imsld::parse::get_attribute -node $play_node -attr_name identifier]] + set identifier [imsld::parse::get_attribute -node $play_node -attr_name identifier] set is_visible_p [imsld::parse::get_bool_attribute -node $play_node -attr_name isvisible -default t] set title [imsld::parse::get_title -node $play_node -prefix imsld] @@ -3490,7 +3490,7 @@ imsld::parse::validate_multiplicity -tree $acts -multiplicity 1 -element_name acts -greather_than set count 1 foreach act $acts { - set act_identifier [string tolower [imsld::parse::get_attribute -node $act -attr_name identifier]] + set act_identifier [imsld::parse::get_attribute -node $act -attr_name identifier] set act_title [imsld::parse::get_title -node $act -prefix imsld] set act_list [imsld::parse::parse_and_create_act -play_id $play_id \ -act_node $act \ @@ -3615,7 +3615,7 @@ $document documentElement manifest # manifest - set manifest_identifier [string tolower [imsld::parse::get_attribute -node $manifest -attr_name identifier]] + set manifest_identifier [imsld::parse::get_attribute -node $manifest -attr_name identifier] set manifest_version [imsld::parse::get_attribute -node $manifest -attr_name version] # initialize folders @@ -3647,7 +3647,7 @@ imsld::parse::validate_multiplicity -tree $imsld -multiplicity 1 -element_name IMD-LD -equal set imsld_title [imsld::parse::get_title -node $imsld -prefix imsld] - set imsld_identifier [string tolower [imsld::parse::get_attribute -node $imsld -attr_name identifier]] + set imsld_identifier [imsld::parse::get_attribute -node $imsld -attr_name identifier] set imsld_level [imsld::parse::get_attribute -node $imsld -attr_name level] set imsld_level [expr { [empty_string_p $imsld_level] ? "" : [string tolower $imsld_level] }] set imsld_version [imsld::parse::get_attribute -node $imsld -attr_name version] @@ -3964,7 +3964,7 @@ imsld::parse::validate_multiplicity -tree $complete_play -multiplicity 1 -element_name complete-play -equal set when_play_completed_list [$complete_play selectNodes "*\[local-name()='when-play-completed'\]"] foreach when_play_completed $when_play_completed_list { - set ref [string tolower [imsld::parse::get_attribute -node $when_play_completed -attr_name ref]] + set ref [imsld::parse::get_attribute -node $when_play_completed -attr_name ref] # verify that the referenced play exists if { ![db_0or1row get_rp_id { select item_id as play_id @@ -4003,7 +4003,7 @@ set resources_list [$manifest_resources_list selectNodes {*[local-name()='resource']}] foreach resource_left $resources_list { - set resource_identifier [string tolower [imsld::parse::get_attribute -node $resource_left -attr_name identifier]] + set resource_identifier [imsld::parse::get_attribute -node $resource_left -attr_name identifier] # the resource can't be duplicated if { ![db_0or1row already_created_p { select 1 from imsld_cp_resources where identifier = :resource_identifier and manifest_id = :manifest_id Index: openacs-4/packages/imsld/tcl/imsld-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.tcl,v diff -u -N -r1.71 -r1.72 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 5 Jul 2006 14:59:10 -0000 1.71 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 10 Jul 2006 13:15:14 -0000 1.72 @@ -2366,7 +2366,7 @@ and run_id = :run_id and status = 'finished' }] - if { $completed_activity_p || [lsearch -exact $next_activity_id_list $activity_id] != -1 && ([string eq $complete_act_id ""] || [string eq $is_visible_p "t"]) } { + if { $completed_activity_p || [lsearch -exact $next_activity_id_list $activity_id] != -1 && ([string eq $complete_act_id ""] || [string eq $is_visible_p "t"]) } { set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] @@ -2406,7 +2406,7 @@ and run_id = :run_id and status = 'finished' }] - if { $completed_activity_p || [lsearch -exact $next_activity_id_list $activity_id] != -1 && ([string eq $complete_act_id ""] || [string eq $is_visible_p "t"]) } { + if { $completed_activity_p || [lsearch -exact $next_activity_id_list $activity_id] != -1 && ([string eq $complete_act_id ""] || [string eq $is_visible_p "t"]) } { set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] Index: openacs-4/packages/imsld/tcl/imsld-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.xql,v diff -u -N -r1.26 -r1.27 --- openacs-4/packages/imsld/tcl/imsld-procs.xql 5 Jul 2006 14:59:10 -0000 1.26 +++ openacs-4/packages/imsld/tcl/imsld-procs.xql 10 Jul 2006 13:15:14 -0000 1.27 @@ -1683,15 +1683,19 @@ - select title as activity_title, - item_id as activity_item_id, - activity_id, - complete_act_id, - is_visible_p - from imsld_learning_activitiesi - where item_id = :object_id_two - and content_revision__is_live(activity_id) = 't' - + select la.title as activity_title, + la.item_id as activity_item_id, + la.activity_id, + la.complete_act_id, + attr.is_visible_p + from imsld_learning_activitiesi la, imsld_attribute_instances attr + where la.item_id = :object_id_two + and content_revision__is_live(la.activity_id) = 't' + and attr.owner_id = la.activity_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + + @@ -1710,14 +1714,17 @@ - select title as activity_title, - item_id as activity_item_id, - activity_id, - complete_act_id, - is_visible_p - from imsld_support_activitiesi - where item_id = :object_id_two - and content_revision__is_live(activity_id) = 't' + select sa.title as activity_title, + sa.item_id as activity_item_id, + sa.activity_id, + sa.complete_act_id, + attr.is_visible_p + from imsld_support_activitiesi sa, imsld_attribute_instances attr + where sa.item_id = :object_id_two + and content_revision__is_live(sa.activity_id) = 't' + and attr.owner_id = sa.activity_id + and attr.run_id = :run_id + and attr.type = 'isvisible' @@ -1786,27 +1793,33 @@ - select title as activity_title, - item_id as activity_item_id, - activity_id, - is_visible_p, - complete_act_id - from imsld_learning_activitiesi + select la.title as activity_title, + la.item_id as activity_item_id, + la.activity_id, + attr.is_visible_p, + la.complete_act_id + from imsld_learning_activitiesi la, imsld_attribute_instances attr where activity_id = :activity_id + and attr.owner_id = la.activity_id + and attr.run_id = :run_id + and attr.type = 'isvisible' - select title as activity_title, - item_id as activity_item_id, - activity_id, - is_visible_p, - complete_act_id - from imsld_support_activitiesi - where activity_id = :activity_id + select sa.title as activity_title, + sa.item_id as activity_item_id, + sa.activity_id, + attr.is_visible_p, + sa.complete_act_id + from imsld_support_activitiesi sa, imsld_attribute_instances attr + where sa.activity_id = :activity_id + and attr.owner_id = sa.activity_id + and attr.run_id = :run_id + and attr.type = 'isvisible' Index: openacs-4/packages/imsld/tcl/imsld-runtime-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-runtime-procs.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/imsld/tcl/imsld-runtime-procs.tcl 6 Jul 2006 11:27:00 -0000 1.7 +++ openacs-4/packages/imsld/tcl/imsld-runtime-procs.tcl 10 Jul 2006 13:15:14 -0000 1.8 @@ -76,62 +76,62 @@ switch $restriction_type { length { if { [length $value] <> $restriction_value } { - return [list 0 "<#_ The length must be %restriction_value% #>"] + return [list 0 "[_ imsld.lt_The_length_must_be_re]"] } } minLength { if { [length $value] < $restriction_value } { - return [list 0 "<#_ The length must be greather than %restriction_value% #>"] + return [list 0 "[_ imsld.lt_The_length_must_be_gr]"] } } maxLength { if { [length $value] > $restriction_value } { - return [list 0 "<#_ The length must be lower than %restriction_value% #>"] + return [list 0 "[_ imsld.lt_The_length_must_be_lo]"] } } enumeration { lappend enumeration_list $restriction_value } maxInclusive { if { $value > $restriction_value } { - return [list 0 "<#_ The value must be lower than %restriction_value% (inclusive #>"] + return [list 0 "[_ imsld.lt_The_value_must_be_low]"] } } minInclusive { if {$value < $restriction_value } { - return [list 0 "<#_ The value must be greather than %restriction_value% (inclusive) #>"] + return [list 0 "[_ imsld.lt_The_value_must_be_gre]"] } } maxExclusive { if { $value >= $restriction_value } { - return [list 0 "<#_ The value must be lower than %restriction_value% #>"] + return [list 0 "[_ imsld.lt_The_value_must_be_low_1]"] } } minExclusive { if { $value <= $restriction_value } { - return [list 0 "<#_ The value must be greather than %restriction_value% #>"] + return [list 0 "[_ imsld.lt_The_value_must_be_gre_1]"] } } totalDigits { if { [expr int($value)] <> $restriction_value } { - return [list 0 "<#_ The integer part can't have more than %restriction_value% digits #>"] + return [list 0 "[_ imsld.lt_The_integer_part_cant]"] } } fractionDigits { if { [expr [string length "$value"] - [string last "." "$value"] - 1] > $restriction_value } { - return [list 0 "<#_ The decimal digits can't be more than %restriction_value% #>"] + return [list 0 "[_ imsld.lt_The_decimal_digits_ca]"] } } pattern { if { ![regexp "$restriction_value" $value] } { - return [list 0 "<#_ The value (%value%) doesn't match with the expression %restriction_value% #>"] + return [list 0 "[_ imsld.lt_The_value_value_doesn]"] } } } } if { [llength $enumeration_list] && [lsearch -exact $enumeration_list $value] == -1 } { - return [list 0 "<#_ The value %value% is not alowed #>"] + return [list 0 "[_ imsld.lt_The_value_value_is_no]"] } @@ -148,7 +148,8 @@ } db_1row get_property_instance { - select ins.instance_id + select ins.instance_id, + ins.value as old_value from imsld_propertiesi prop, imsld_property_instances ins where prop.property_id = ins.property_id @@ -161,7 +162,10 @@ } imsld::runtime::property::instance_value_set -instance_id $instance_id -value $value - imsld::condition::execute_all -run_id $run_id + # recursive call only if the property value has changed + if { $old_value != $value } { + imsld::condition::execute_all -run_id $run_id + } } ad_proc -public imsld::runtime::time_uol_started { @@ -266,15 +270,16 @@ ad_proc -public imsld::runtime::isvisible::show_hide { -run_id -identifier - -action_required + -action:required } { mark a isvisible as showh. NOTE: not recursively } { if { [string eq $action "show"] } { - set is_visible_p "t" + set is_visible_p "t" } else { - set is_visible_p "f" + set is_visible_p "f" } + db_dml set_isvisible_shown_hidden { *SQL* } } Index: openacs-4/packages/imsld/www/imsld-content-serve.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-content-serve.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/imsld/www/imsld-content-serve.tcl 4 Jul 2006 18:06:03 -0000 1.3 +++ openacs-4/packages/imsld/www/imsld-content-serve.tcl 10 Jul 2006 13:15:14 -0000 1.4 @@ -63,7 +63,7 @@ set view_property_nodes [$dom_root selectNodes {//*[local-name()='view-property']}] foreach view_property_node $view_property_nodes { # get requested info - set identifier [string tolower [$view_property_node getAttribute ref]] + set identifier [$view_property_node getAttribute ref] set view [$view_property_node getAttribute view "value"] set property_of [$view_property_node getAttribute property-of "self"] @@ -133,7 +133,7 @@ set view_property_group_new_node [$dom_doc createElement p] foreach view_property_group_node $view_property_group_nodes { # get requested info - set identifier [string tolower [$view_property_group_node getAttribute ref]] + set identifier [$view_property_group_node getAttribute ref] set view [$view_property_group_node getAttribute view "value"] set property_of [$view_property_group_node getAttribute property-of "self"] @@ -203,7 +203,7 @@ set set_property_nodes [$dom_root selectNodes {//*[local-name()='set-property']}] foreach set_property_node $set_property_nodes { # get requested info - set identifier [string tolower [$set_property_node getAttribute ref]] + set identifier [$set_property_node getAttribute ref] set view [$set_property_node getAttribute view "value"] set property_of [$set_property_node getAttribute property-of "self"] @@ -337,7 +337,7 @@ set set_property_group_nodes [$dom_root selectNodes {//*[local-name()='set-property-group']}] foreach set_property_group_node $set_property_group_nodes { # get requested info - set identifier [string tolower [$set_property_group_node getAttribute ref]] + set identifier [$set_property_group_node getAttribute ref] set view [$set_property_group_node getAttribute view "value"] set property_of [$set_property_group_node getAttribute property-of "self"] @@ -485,7 +485,7 @@ set class_nodes [$dom_root selectNodes {//*[@class]}] foreach class_node $class_nodes { # get requested info - set class_name_list [split [string tolower [$class_node getAttribute class]] " "] + set class_name_list [split [$class_node getAttribute class] " "] foreach class_name $class_name_list { # get class info