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 -r1.10 -r1.11
--- openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 23 Nov 2005 17:41:43 -0000 1.10
+++ openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 13 Dec 2005 17:35:23 -0000 1.11
@@ -120,7 +120,7 @@
Referenced activity structure (%activity_structure_ref_ref%) in role part %identifier% does not exist.
Referenced activity structure %activity_structure_ref_ref% in role part %identifier% is actually an support activity.
Referenced activity structure %activity_structure_ref_ref% in role part %identifier% is actually a learning activity.
- Referenced environment %referenced_identifier% does not exist
+ Referenced environment %referenced_identifier% (referenced from environment %identifier%) does not exist
Referenced environment (%environment_ref%) in learning activity does not exist.
Referenced environment (%environment_ref%) in support activity does not exist.
Referenced environment (%environment_ref%) in activity structure %identifier% does not exist.
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 -r1.23 -r1.24
--- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 9 Dec 2005 12:01:31 -0000 1.23
+++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 13 Dec 2005 17:35:24 -0000 1.24
@@ -164,7 +164,7 @@
@option prefix Prefix for the "title"
} {
- set prefix [expr { [empty_string_p $prefix] ? "" : "${prefix}:" }]
+ set prefix [expr { [string eq "" $prefix] ? "" : "${prefix}:" }]
set titles_list [$node child all ${prefix}title]
if { [llength $titles_list] } {
imsld::parse::validate_multiplicity -tree $titles_list -multiplicity 1 -element_name title -equal
@@ -505,8 +505,8 @@
# verify that the resource hasn't been already created
set resource_identifier [string tolower [imsld::parse::get_attribute -node $resource_node -attr_name identifier]]
if { ![db_0or1row redundancy_protection {
- select resource_id
- from imsld_cp_resources
+ select item_id as resource_id
+ from imsld_cp_resourcesi
where identifier = :resource_identifier
and manifest_id = :manifest_id
}] } {
@@ -551,8 +551,11 @@
}
if { ![empty_string_p $resource_href] && !$found_p } {
- # we should have fond the referenced file, aborting
- return [list 0 "[_ imsld.lt_The_resource_resource]"]
+ # the file is not in the manifest, assming it's an external (and existing) url
+ set link_id [content::extlink::new -url $resource_href \
+ -parent_id $parent_id]
+ # map resource with file
+ relation_add imsld_res_files_rel $resource_id $link_id
}
set resource_dependencies [$resource_node child all imscp:dependency]
@@ -1142,10 +1145,10 @@
set conference_item [$conference child all imsld:item]
imsld::parse::validate_multiplicity -tree $conference_item -multiplicity 1 -element_name conference-item -equal
set item_list [imsld::parse::parse_and_create_item -manifest $manifest \
- -manifest_id $manifest_id \
- -item_node $conference_item \
- -parent_id $parent_id \
- -tmp_dir $tmp_dir]
+ -manifest_id $manifest_id \
+ -item_node $conference_item \
+ -parent_id $parent_id \
+ -tmp_dir $tmp_dir]
set imsld_item_id [lindex $item_list 0]
if { !$imsld_item_id } {
@@ -1252,6 +1255,7 @@
@param tmp_dir Temporary directory where the files were exctracted
} {
upvar files_struct_list files_struct_list
+ upvar warnings warnings
# get environment info
set identifier [string tolower [imsld::parse::get_attribute -node $environment_node -attr_name identifier]]
@@ -1269,7 +1273,6 @@
if { [llength $learning_object] } {
if { [llength $learning_object] > 1 } {
set learning_object [lindex $learning_object 0]
- global warnings
append warnings "
[_ imsld.lt_Warning_More_than_one] "
}
set learning_object_list [imsld::parse::parse_and_create_learning_object -learning_object_node $learning_object \
@@ -1330,7 +1333,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 {
+ foreach referenced_environment [$environments child all imsld:environment] {
set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_environment -attr_name identifier]]
if { [string eq $ref $referenced_identifier] } {
set found_p 1
@@ -1723,6 +1726,7 @@
@param tmp_dir Temporary directory where the files were exctracted
} {
upvar files_struct_list files_struct_list
+ 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]]
@@ -1823,7 +1827,6 @@
and component_id = :component_id
}] } {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_support_ac] "
# do the mappings
relation_add imsld_as_as_rel $activity_structure_id $refrenced_struct_id
@@ -1865,7 +1868,6 @@
return $activity_structure_ref_list
}
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_learning_a] "
# finally, do the mappings
relation_add imsld_as_as_rel $activity_structure_id $activity_structure_ref_id
@@ -1883,7 +1885,6 @@
}
} else {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_learning_a_2] "
# map support activity with activity structure
relation_add imsld_as_sa_rel $activity_structure_id $activity_id
@@ -1941,7 +1942,6 @@
and component_id = :component_id
}] } {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_support_ac_1] "
# do the mappings
relation_add imsld_as_as_rel $activity_structure_id $refrenced_struct_id
@@ -1983,7 +1983,6 @@
return $activity_structure_ref_list
}
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_support_ac_1] "
# finally, do the mappings
relation_add imsld_as_as_rel $activity_structure_id $activity_structure_ref_id
@@ -2000,7 +1999,6 @@
}
} else {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_support_ac_3] "
# map the learning activity with activity structure
relation_add imsld_as_la_rel $activity_structure_id $activity_id
@@ -2120,6 +2118,7 @@
@param tmp_dir Temporary directory where the files were exctracted
@param sort_order
} {
+ 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 title [imsld::parse::get_title -node $role_part_node -prefix imsld]
@@ -2197,12 +2196,10 @@
return [list 0 "[_ imsld.lt_Referenced_learning_a_3]"]
} else {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_learning_a_4] "
}
} else {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_learning_a_5] "
}
}
@@ -2242,12 +2239,10 @@
return [list 0 "[_ imsld.lt_Referenced_support_ac_4]"]
} else {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_support_ac_5] "
}
} else {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_support_ac_6] "
}
}
@@ -2289,12 +2284,10 @@
return [list 0 "[_ imsld.lt_Referenced_activity_s_1]"]
} else {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_activity_s_2] "
}
} else {
# warning message
- global warnings
append warnings " [_ imsld.lt_Referenced_activity_s_3] "
}
}
@@ -2357,6 +2350,7 @@
@param sort_order
} {
upvar files_struct_list files_struct_list
+ 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]]
@@ -2486,6 +2480,7 @@
@param sort_order
} {
upvar files_struct_list files_struct_list
+ 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]]
@@ -2596,7 +2591,6 @@
@param tmp_dir tmp dir where the files were extracted to
} {
set community_id [expr { [empty_string_p $community_id] ? [dotlrn_community::get_community_id] : $community_id }]
- global warnings
set warnings ""
# get the files structure
@@ -2958,7 +2952,6 @@
}
}
- global warnings
if { ![empty_string_p $warnings] } {
set warnings "[_ imsld.lt_br__Warnings_ul_warni]"
}
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 -r1.12 -r1.13
--- openacs-4/packages/imsld/tcl/imsld-procs.tcl 25 Nov 2005 12:11:36 -0000 1.12
+++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 13 Dec 2005 17:35:24 -0000 1.13
@@ -457,7 +457,7 @@
if { [string eq "" $one_service_url] } {
lappend services_list "[_ imsld.lt_li_desc_no_file_assoc]"
} else {
- set services_list [concat [list $services_list] [list $one_service_url]]
+ set services_list [expr { [llength $services_list] ? [concat [list $services_list] [list $one_service_url]] : $one_service_url }]
}
} if_no_rows {
ns_log notice "[_ imsld.lt_li_desc_no_file_assoc]"
@@ -560,9 +560,9 @@
and ar.rel_type = 'imsld_env_env_rel'
} {
set one_nested_environment_list [imsld::process_environment -environment_item_id $nested_environment_item_id]
+ # the title is stored in [lindex $one_nested_environment_list 0], but is not returned for displaying porpouses
set nested_environment_list [concat [list $nested_environment_list] \
- [list "Nested Environment: [lindex $one_nested_environment_list 0]" \
- [lindex $one_nested_environment_list 1] \
+ [list [lindex $one_nested_environment_list 1] \
[lindex $one_nested_environment_list 2] \
[lindex $one_nested_environment_list 3]]]
}
@@ -608,7 +608,7 @@
# get learning object info
db_1row objective_info {
- select coalesce(lo.pretty_title, lo.title) as objective_title,
+ select coalesce(lo.pretty_title, '') as objective_title,
lo.learning_objective_id
from imsld_learning_objectivesi lo
where lo.item_id = :learning_objective_item_id
@@ -691,7 +691,7 @@
# get prerequisite info
db_1row prerequisite_info {
- select coalesce(pre.pretty_title, pre.title) as prerequisite_title,
+ select coalesce(pre.pretty_title, '') as prerequisite_title,
pre.prerequisite_id
from imsld_prerequisitesi pre
where pre.item_id = :prerequisite_item_id
@@ -845,6 +845,7 @@
-package_id [dotlrn_community::get_package_id $community_id] \
-package_key "file-storage"]
set root_folder_id [fs::get_root_folder -package_id $fs_package_id]
+ # get associated files
db_foreach associated_files {
select cpf.imsld_file_id,
cpf.file_name,
@@ -869,7 +870,17 @@
}]
set file_url "[apm_package_url_from_id $fs_package_id]view/${file_url}"
append files_lis " $file_name "
- }
+ }
+ # get associated urls
+ db_foreach associated_urls {
+ select url
+ from acs_rels ar,
+ cr_extlinks links
+ where ar.object_id_one = :resource_item_id
+ and ar.object_id_two = links.extlink_id
+ } {
+ append files_lis " $url "
+ }
}
}
return $files_lis
@@ -1451,7 +1462,7 @@
set environments "[lindex [lindex $activities_list 2] 0]"
append environments "- [join [lindex [lindex $activities_list 2] 1] "
- "]"
append environments "
- [join [lindex [lindex $activities_list 2] 2] "
- "]"
- append environments "
- [join [lindex [lindex $activities_list 2] 3] "
- >"]"
+ append environments "
- [join [lindex [lindex $activities_list 2] 3] "
- "]"
append environments "
"
regsub -all {[ ]*} $environments "" environments
}