Index: openacs-4/packages/imsld/imsld.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/imsld.info,v diff -u -r1.16 -r1.17 --- openacs-4/packages/imsld/imsld.info 27 Apr 2009 09:52:50 -0000 1.16 +++ openacs-4/packages/imsld/imsld.info 17 Jun 2009 08:00:01 -0000 1.17 @@ -9,15 +9,15 @@ f t - + Derick Leony Jose Pablo Escobedo Del Cid IMS LD integration with dotLRN. 2009-04-27 This package is the implementation of IMS LD in dotLRN. The course admin can create a sequence of activities for the students, as well as decide who does what, when and using what resources. 0 - + @@ -31,6 +31,8 @@ + + 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.42 -r1.43 --- openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 4 Mar 2009 12:15:08 -0000 1.42 +++ openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 17 Jun 2009 08:00:01 -0000 1.43 @@ -415,6 +415,7 @@ Type Unknown type Learning Units + Units of learning Administration Uploading IMS LD URI user @@ -434,6 +435,7 @@ Warnings Not associated to any resource UoL Name + Repository Export files not associated to resources? Yes No Index: openacs-4/packages/imsld/catalog/imsld.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/catalog/imsld.es_ES.ISO-8859-1.xml,v diff -u -r1.7 -r1.8 --- openacs-4/packages/imsld/catalog/imsld.es_ES.ISO-8859-1.xml 4 Mar 2009 12:15:08 -0000 1.7 +++ openacs-4/packages/imsld/catalog/imsld.es_ES.ISO-8859-1.xml 17 Jun 2009 08:00:01 -0000 1.8 @@ -431,6 +431,7 @@ Advertencias No asociado a recurso Nombre UoL + Repositorio Desea exportar archivos no asociados a recursos? S� No Index: openacs-4/packages/imsld/lib/activity-resource.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/activity-resource.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/lib/activity-resource.adp 5 Mar 2009 16:22:59 -0000 1.2 +++ openacs-4/packages/imsld/lib/activity-resource.adp 17 Jun 2009 08:00:01 -0000 1.3 @@ -6,13 +6,12 @@ - @files.title@ + @files.title@ @files.title@ - @@ -26,7 +25,7 @@ - @files.file_name@ + @files.file_name@ @files.file_name@ @@ -45,7 +44,7 @@ - @object_title@ + @object_title@ @object_title@ Index: openacs-4/packages/imsld/lib/activity-tree.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/activity-tree.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/lib/activity-tree.adp 18 Feb 2009 19:01:13 -0000 1.1 +++ openacs-4/packages/imsld/lib/activity-tree.adp 17 Jun 2009 08:00:01 -0000 1.2 @@ -4,11 +4,23 @@ @imsld_title@ Index: openacs-4/packages/imsld/lib/activity.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/activity.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/lib/activity.adp 3 Jun 2009 14:15:08 -0000 1.3 +++ openacs-4/packages/imsld/lib/activity.adp 17 Jun 2009 08:00:01 -0000 1.4 @@ -8,7 +8,7 @@ #imsld.completed# + title="#imsld.completed#" > @@ -31,7 +31,7 @@ #imsld.completed# + title="#imsld.completed#" > Index: openacs-4/packages/imsld/lib/imsld-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-master.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/imsld/lib/imsld-master.adp 22 Oct 2008 10:58:43 -0000 1.4 +++ openacs-4/packages/imsld/lib/imsld-master.adp 17 Jun 2009 08:00:01 -0000 1.5 @@ -1,8 +1,15 @@ + + + + + @doc.title@ + lang="@link.lang;noquote@" title="@link.title;noquote@" type="@link.type;noquote@" - media="@link.media@"/> + media="@link.media@"> + type="text/css" media="all"> @@ -72,29 +79,14 @@ + + + - - - - - #imsld.Hide# - - - - - #imsld.Show# - - - - + + Index: openacs-4/packages/imsld/lib/wiki-default.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/wiki-default.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/lib/wiki-default.adp 14 Nov 2008 18:33:28 -0000 1.2 +++ openacs-4/packages/imsld/lib/wiki-default.adp 17 Jun 2009 08:00:01 -0000 1.3 @@ -68,7 +68,7 @@
-
+
#xowiki.edit# · #xotcl-core.revisions# · #xowiki.new_page# · Index: openacs-4/packages/imsld/lib/monitor/activity-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/monitor/activity-info.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/lib/monitor/activity-info.adp 18 Feb 2009 19:01:13 -0000 1.1 +++ openacs-4/packages/imsld/lib/monitor/activity-info.adp 17 Jun 2009 08:00:01 -0000 1.2 @@ -12,21 +12,21 @@ - Up + Up - Down + Down [ - #imsld.Edit# + #imsld.Edit# - #imsld.Delete# + #imsld.Delete# ]
Index: openacs-4/packages/imsld/lib/monitor/activity-tree.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/monitor/activity-tree.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/lib/monitor/activity-tree.adp 18 Feb 2009 19:01:13 -0000 1.1 +++ openacs-4/packages/imsld/lib/monitor/activity-tree.adp 17 Jun 2009 08:00:01 -0000 1.2 @@ -4,10 +4,22 @@ @imsld_title@
    -
  • - +
  • +
      + +
    • +
        + +
      • + +
      • +
        +
      +
    • +
      +
Index: openacs-4/packages/imsld/sql/postgresql/imsld-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-create.sql,v diff -u -r1.16 -r1.17 --- openacs-4/packages/imsld/sql/postgresql/imsld-create.sql 24 Oct 2006 10:09:50 -0000 1.16 +++ openacs-4/packages/imsld/sql/postgresql/imsld-create.sql 17 Jun 2009 08:00:01 -0000 1.17 @@ -12,3 +12,5 @@ \i imsld-production-delivery-package-create.sql \i imsld-tree-create.sql \i imsld-level-c-create.sql + +\i imsld-gsi-a-create.sql Index: openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql 24 Oct 2006 10:09:50 -0000 1.10 +++ openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql 17 Jun 2009 08:00:01 -0000 1.11 @@ -11,10 +11,10 @@ \i imsld-cp-drop.sql -\i imsld-production-delivery-drop.sql - \i imsld-production-delivery-package-drop.sql +\i imsld-production-delivery-drop.sql + \i imsld-level-b-drop.sql \i imsld-level-c-drop.sql Index: openacs-4/packages/imsld/sql/postgresql/imsld-level-a-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-level-a-drop.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/sql/postgresql/imsld-level-a-drop.sql 5 Jun 2008 17:40:03 -0000 1.5 +++ openacs-4/packages/imsld/sql/postgresql/imsld-level-a-drop.sql 17 Jun 2009 08:00:01 -0000 1.6 @@ -7,6 +7,10 @@ drop table imsld_scheduled_time_limits; +drop table imsld_res_files_rels; + +drop table imsld_res_xowiki_rels; + drop table imsld_learning_objects cascade; drop table imsld_imslds cascade; Index: openacs-4/packages/imsld/sql/postgresql/imsld-level-c-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-level-c-drop.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/sql/postgresql/imsld-level-c-drop.sql 21 Dec 2006 15:20:47 -0000 1.2 +++ openacs-4/packages/imsld/sql/postgresql/imsld-level-c-drop.sql 17 Jun 2009 08:00:01 -0000 1.3 @@ -11,4 +11,6 @@ drop table imsld_runtime_activities_rels cascade; -drop sequence imsld_rar_seq; +drop view imsld_rar_seq; + +drop sequence t_imsld_rar_seq; Index: openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-drop.sql 16 May 2006 09:24:35 -0000 1.1 +++ openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-drop.sql 17 Jun 2009 08:00:01 -0000 1.2 @@ -5,6 +5,12 @@ delete from acs_objects where object_type = 'imsld_run'; +select acs_attribute__drop_attribute('imsld_run', 'imsld_id'); + +select acs_attribute__drop_attribute('imsld_run', 'status'); + +delete from acs_object_type_tables where object_type = 'imsld_run'; + select acs_object_type__drop_type('imsld_run','f'); delete from acs_rels where rel_type = 'imsld_run_users_group_rel'; Index: openacs-4/packages/imsld/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/apm-callback-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/imsld/tcl/apm-callback-procs.tcl 18 Dec 2008 19:12:12 -0000 1.11 +++ openacs-4/packages/imsld/tcl/apm-callback-procs.tcl 17 Jun 2009 08:00:01 -0000 1.12 @@ -26,6 +26,9 @@ # create default relationships with non IMS-LD objects imsld::install::init_ext_rels + #create the GSI model + imsld::gsi::install::do_install + return 1 } @@ -51,7 +54,9 @@ } { Proc calls and tasks needed to be donde before the uninstallation of the imsld package. } { - + #clean the GSI model + imsld::gsi::uninstall::do_uninstall + # clean rels imsld::uninstall::delete_rels imsld::uninstall::delete_ext_rels @@ -95,6 +100,9 @@ -attribute_name resource_handler -datatype string \ -pretty_name "#imsld.Resource_Handler#" -column_spec "varchar(100)" } + 1.7d 1.8d { + imsld::gsi::install::do_install + } } } 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 -r1.25 -r1.26 --- openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl 17 Apr 2008 17:18:16 -0000 1.25 +++ openacs-4/packages/imsld/tcl/imsld-condition-procs.tcl 17 Jun 2009 08:00:01 -0000 1.26 @@ -180,12 +180,20 @@ ad_proc -public imsld::condition::eval_change_property_value { -change_property_value_xml:required -run_id:required + -user_id } { Executes the expression of the change-property-value and sets the result to the associated property. } { dom parse $change_property_value_xml document $document documentElement change_property_value_root - imsld::statement::execute -run_id $run_id -statement [$change_property_value_root childNodes] + ns_log Notice "[info vars]" + if {![info exists user_id]} { + ns_log Notice "eval_change_property_value without user_id" + imsld::statement::execute -run_id $run_id -statement [$change_property_value_root childNodes] + } { + ns_log Notice "eval_change_property_value with user_id: $user_id" + imsld::statement::execute -run_id $run_id -statement [$change_property_value_root childNodes] -user_id $user_id + } } ad_proc -public imsld::condition::eval_when_prop_value_is_set { @@ -637,6 +645,7 @@ if {![info exist user_id]} { set user_id [ad_conn user_id] } + ns_log Notice "statement::execute with user_id: $user_id" foreach executeNode $statement { switch -- [$executeNode localName] { @@ -751,7 +760,13 @@ {property-ref} { set propertyValue [imsld::runtime::property::property_value_get -run_id $run_id -user_id $user_id -identifier [$propertyvalueChildNode getAttribute {ref}]] } - + {external-value} { + #gsi-hook for external-value type. + #The value will be extracted from the proper service + set propertyValue [imsld::gsi::get_external_value -run_id $run_id \ + -user_id $user_id \ + -node $propertyvalueChildNode] + } } } {TEXT_NODE} { Index: openacs-4/packages/imsld/tcl/imsld-export-files-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-export-files-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/tcl/imsld-export-files-procs.tcl 18 Feb 2009 11:10:46 -0000 1.1 +++ openacs-4/packages/imsld/tcl/imsld-export-files-procs.tcl 17 Jun 2009 08:00:01 -0000 1.2 @@ -1,3 +1,5 @@ +package require http + namespace eval imsld::export::files {} ############################################################################### @@ -20,8 +22,6 @@ file mkdir $path/$inside_path/ } - - if {[fs_file_p [expr $imsld_file_id-1]] == 1} { set data [fs__datasource $imsld_file_id] set url [lindex $data [expr [lsearch $data content]+1]] @@ -31,3 +31,484 @@ } } } + + +############################################################################### +# Call this function to change references in html labels +############################################################################### +ad_proc -public imsld::export::files::modify_links { + -manifest_id:required + -xo_page_id:required + -path:required +} { + This proc is called to change references in html labels for exporting the UoL +} { + #Get page name + db_1row get_page_name {select title from acs_objects where object_id=:xo_page_id} + set page_title [string map {"%2f" "/"} $title] + set page_name [string range $page_title [expr [string last "/" $page_title]+1] end] +############################################## + #Change : for _ in case language is specified in name + regsub -all {:} $page_name {_} page_name + if {[string first "." $page_name] == -1} { + set page_name ${page_name}.html + } +############################################## + + #Get Xowiki page + set file_data "[imsld::xowiki::page_content -item_id $xo_page_id]" + + #Get root path to files stored in xowiki + #Get xowiki package url + db_1row get_xowiki_package_id {select package_id, title from acs_objects where object_id=:xo_page_id} + set xowiki_package_url [apm_package_url_from_id $package_id] + + #Parse Xowiki page + set data_tree [dom parse -html $file_data] + set root [$data_tree documentElement] + + + #Call proc that changes href attribute in a labels + imsld::export::files::modify_a -root $root -xowiki_package_url $xowiki_package_url + imsld::export::files::modify_frame -root $root -xowiki_package_url $xowiki_package_url + imsld::export::files::modify_css -root $root -xowiki_package_url $xowiki_package_url + set resource_files_list [imsld::export::files::modify_img -root $root -xowiki_package_url $xowiki_package_url -xowiki_package_id $package_id -path $path] + + #Once we have changed the references of the file, then we copy the file + #Write page file + set new_file [open "${path}/$page_name" w] + #Delete unnecessary code from page + set data [$root asHTML] + set pos [string last "content-chunk-footer" $data] + if {$pos > 0} {set data [string range $data 0 [expr $pos-13]]} + if {[string first "${data}"} + puts $new_file $data + close $new_file + + return $resource_files_list + +} + + +############################################################################### +# Call this function to change href attribute in anchor labels +############################################################################### +ad_proc -public imsld::export::files::modify_a { + -root:required + -xowiki_package_url:required +} { + This proc is called to change href attribute in anchor labels +} { + #Get all anchor elements + set a_nodes [$root selectNodes //a] + + #Loop to work with all anchor nodes + set num_elements [llength $a_nodes] + for {set i 0} {$i<$num_elements} {incr i} { + set a_href [[lindex $a_nodes $i] getAttribute href NONE] + if {[string first "http://" $a_href] == 0 || [string first "https://" $a_href] == 0 || [string first "#" $a_href] == 0 || $a_href == "NONE"} { + continue + } else { + #If the code reaches this point, it means that there is a local reference to another file + #Check if a_href is a reference to a xowiki file + if {[string first $xowiki_package_url $a_href] == 0} { + #Build reference to export + set a_href [string range $a_href [string length $xowiki_package_url] end] + set a_href [string map {"%2f" "/"} $a_href] + set a_href [string range $a_href [expr [string first "/" $a_href]+1] end] + + #Change href attribute value to write in it the new reference + [lindex $a_nodes $i] setAttribute href $a_href + } + ########################################################################################## + # May take into account other possibilities in an else block + ########################################################################################## + } + } +} + + +############################################################################### +# Call this function to change src attribute in frame labels +############################################################################### +ad_proc -public imsld::export::files::modify_frame { + -root:required + -xowiki_package_url:required +} { + This proc is called to change src attribute in frame labels +} { + #Get all frame elements + set frame_nodes [$root selectNodes //frame] + + #Loop to work with all frame nodes + set num_elements [llength $frame_nodes] + for {set i 0} {$i<$num_elements} {incr i} { + set frame_src [[lindex $frame_nodes $i] getAttribute src NONE] + #If frame is inside same xowiki community then change src attribute + if {[string first $xowiki_package_url $frame_src] == 0} { + #Build reference to export + set frame_src [string range $frame_src [string length $xowiki_package_url] end] + set frame_src [string map {"%2f" "/"} $frame_src] + set frame_src [string range $frame_src [expr [string first "/" $frame_src]+1] end] + #Change src attribute value to write in it the new reference + [lindex $frame_nodes $i] setAttribute src $frame_src + } + ########################################################################################## + # May take into account other possibilities in an else block + ########################################################################################## + } +} + + +############################################################################### +# Call this function to change href attribute in link labels (for css) +############################################################################### +ad_proc -public imsld::export::files::modify_css { + -root:required + -xowiki_package_url:required +} { + This proc is called to change href attribute in link labels that link to css files +} { + #Get all frame elements + set link_nodes [$root selectNodes //link] + + #Loop to work with all link nodes + set num_elements [llength $link_nodes] + for {set i 0} {$i<$num_elements} {incr i} { + set link_type [[lindex $link_nodes $i] getAttribute type NONE] + set link_href [[lindex $link_nodes $i] getAttribute href NONE] + #Check that the link is of text/css type + if {$link_type == "text/css"} { + #If link is inside same xowiki community then change href attribute + if {[string first $xowiki_package_url $link_href] == 0} { + #Build reference to export + set link_href [string range $link_href [string length $xowiki_package_url] end] + set link_href [string map {"%2f" "/"} $link_href] + set link_href [string range $link_href [expr [string first "/" $link_href]+1] end] +######################################################################################### +######################################################################################### +############ The following code has not been tested ################## +######################################################################################### +######################################################################################### + if {[string first "download/file/" $link_href] == 0} { + set link_href [string range $link_href 14 end] + } + set file_title "file:$link_href" + #Get id of the file where the css file is stored + set content_item_id [string range [$xowiki_package_id resolve_page "$file_title" method] 2 end] + + db_1row get_file_id {select object_id from acs_objects where title=:file_title and object_type='::xowiki::File' and context_id=:content_item_id} + + #Get file and copy it to export folder + set data [fs__datasource $object_id] + #Get url of folder to copy file + set url [lindex $data [expr [lsearch $data content]+1]] + #Copy file + set link_href [string range $link_href [expr [string first "/" $link_href]+1] end] + if {[db_0or1row is_imsls_cp_file {select imsld_file_id from imsld_cp_files where path_to_file=:file_name}] == 1} { + file copy -force $url "$path/$link_href" + } else { + set position [string last "/" $link_href] + if {$position != -1} { + #Delete file path from file name + set link_href [string range [expr $position+1] end] + } + + #Create folder to store resources if it doesn't exist + set aux_folder_name "export_res" + if {[file isdirectory "$path/$aux_folder_name"] == 0} { + exec mkdir "$path/$aux_folder_name" + } + + #Build new file path + set link_href "${aux_folder_name}/$link_href" + file copy -force $url "$path/$link_href" + } +######################################################################################### +######################################################################################### + #Change src attribute value to write in it the new reference + [lindex $link_nodes $i] setAttribute href $link_href + } + } + ########################################################################################## + # May take into account other possibilities in an else block + ########################################################################################## + } +} + + +############################################################################### +# Call this function to change src attribute in img labels +############################################################################### +ad_proc -public imsld::export::files::modify_img { + -root:required + -xowiki_package_url:required + -xowiki_package_id:required + -path:required +} { + This proc is called to change src attribute in img labels +} { + #Get package_id + set package_id [ad_conn package_id] + #Store community path + set community_path [apm_package_url_from_id $package_id] + set community_path [string range $community_path 0 [expr [string last "/imsld" $community_path]-1]] + set community_name [string range $community_path [expr [string last "/" $community_path]+1] end] + + set resource_files_list [list] + + #Get all image elements + set image_nodes [$root selectNodes //img] + + #Loop to work with all image nodes + set num_elements [llength $image_nodes] + for {set i 0} {$i<$num_elements} {incr i} { + set src [[lindex $image_nodes $i] getAttribute src NONE] + if {$src != "NONE"} { + #Check if image src is a xowiki file + if {[string first $xowiki_package_url $src] == 0} { + #Compute file name + set position [string length $xowiki_package_url] + set file_name [string range $src $position end] + if {[string first "download/file/" $file_name] == 0} { + set file_name [string range $file_name 14 end] + } + set file_name [string map {"%2f" "/"} $file_name] + set file_title "file:$file_name" + #Get id of the file where the image is stored + set content_item_id [string range [$xowiki_package_id resolve_page "$file_title" method] 2 end] + + db_1row get_file_id {select object_id from acs_objects where title=:file_title and object_type='::xowiki::File' and context_id=:content_item_id} + + #Get file and copy it to export folder + set data [fs__datasource $object_id] + #Get url of folder to copy file + set url [lindex $data [expr [lsearch $data content]+1]] + #Copy file + set file_name [string range $file_name [expr [string first "/" $file_name]+1] end] + if {[db_0or1row is_imsls_cp_file {select imsld_file_id from imsld_cp_files where path_to_file=:file_name}] == 1} { + file copy -force $url "$path/$file_name" + } else { + set position [string last "/" $file_name] + if {$position != -1} { + #Delete file path from file name + set file_name [string range [expr $position+1] end] + } + + #Create folder to store resources if it doesn't exist + set aux_folder_name "export_res" + if {[file isdirectory "$path/$aux_folder_name"] == 0} { + exec mkdir "$path/$aux_folder_name" + } + + #Build new file path + set file_name "${aux_folder_name}/$file_name" + file copy -force $url "$path/$file_name" + } + #Add file to resource file list + lappend resource_files_list $file_name + + #Change src attribute value to write it in file to be exported + [lindex $image_nodes $i] setAttribute src $file_name + } else { + #There is another case we have to compute. it is when the referenced file is stored in the same host + # but it is not in the xowiki community of imsld (it may be stored in a different xowiki community or + # in the file storage) + + #First check that the url is local + if {[string first "http://" $src] != 0} { + #Create folder to store resources if it doesn't exist + set aux_folder_name "export_res" + if {[file isdirectory "$path/$aux_folder_name"] == 0} { + exec mkdir "$path/$aux_folder_name" + } + + if {[string first "${community_path}/" $src] == 0} { + set src [string range $src [expr [string length $community_path]+1] end] + set type [string range $src 0 [expr [string first "/" $src]-1]] + #If type == file-storage + if {$type == "file-storage"} { + set src [string range $src 13 end] + #Here we can find to possibilities: view or download + if {[string first "view" $src] == 0} { + set src [string range $src 5 end] + #Get file name + set position [string last "/" $src] + set file_name [string range $src [expr $position+1] end] + set file_name "$aux_folder_name/$file_name" + if {$position != -1} { + set file_path [string range $src 0 [expr $position-1]] + } else { + set file_path "" + } + + #Get file storage folder + db_1row get_folder_id {select acs1.object_id from acs_objects acs1, acs_objects acs2, acs_objects acs3 where acs1.context_id = acs2.object_id and acs2.title='#file-storage.file-storage#' and acs2.context_id = acs3.object_id and acs3.object_type = 'apm_package' and acs3.context_id = dotlrn_communities.community_id and dotlrn_communities.community_key = :community_name} + set folder_id $object_id + if {$file_path != ""} { + set position [string first "/" $file_path] + if {$position == 0} { + set file_path [string range $file_path 1 end] + set position [string first "/" $file_path] + } + while {$position > 0} { + #Get folder key name + set folder_name [string range $file_path 0 [expr $position-1]] + + #Get folder_id + db_1row get_folder_id {select folder_id from fs_folders where key=:folder_name and parent_id=:folder_id} + + set file_path [string range $file_path [expr $position+1] end] + #Update loop variable + set position [string first "/" $file_path] + } + } + #Check that the file exist + if {[db_0or1row get_file_id {select file_id, live_revision from fs_files where key=:file_name and parent_id=:folder_id}] == 1} { + #Copy file + if {[fs_file_p [expr $file_id]] == 1} { + set data [fs__datasource $live_revision] + set url [lindex $data [expr [lsearch $data content]+1]] + file copy -force $url "$path/$file_name" + } + #Add file to resource file list + lappend resource_files_list $file_name + } + #Change src attribute value to write it in file to be exported + [lindex $image_nodes $i] setAttribute src "$file_name" + + } else { + #If the url is download + #Get file id + set position [string last "file%5fid=" $src] + if {$position > 0} { + set src [string range $src [expr $position+10] end] + } else { + set position [string last "file_id=" $src] + if {$position > 0} { + set src [string range $src [expr $position+8] end] + } + #If none of the previous conditions is fullfill, then a new kind of local url + # not taken into account appears or there is an error in the computed url. + } + #Copy file + if {[fs_file_p $src] == 1} { + #Get live revision and file name + db_1row get_live_revision {select live_revision, key from fs_files where file_id=:src} + set data [fs__datasource $live_revision] + set url [lindex $data [expr [lsearch $data content]+1]] + set file_name "$aux_folder_name/$key" + file copy -force $url "$path/$file_name" + } + + #Add file to resource file list + lappend resource_files_list $file_name + + #Change src attribute value to write it in file to be exported + [lindex $image_nodes $i] setAttribute src "$file_name" + } + } + } else { + #This is the case when the resource is stored in a different community + set src [string range $src 14 end] + #Get community name + set other_comm_name [string range $src 0 [expr [string first "/" $src]-1]] + set src [string range $src [expr [string first "/" $src]+1] end] + #Get storage type (file-storage or xowiki) + set type [string range $src 0 [expr [string first "/" $src]-1]] + set src [string range $src [expr [string first "/" $src]+1] end] + if {$type == "file-storage"} { + #Here we can find to possibilities: view or download + if {[string first "view" $src] == 0} { + set src [string range $src 5 end] + #Get file name + set position [string last "/" $src] + set file_nam [string range $src [expr $position+1] end] + set file_name "$aux_folder_name/$file_name" + if {$position != -1} { + set file_path [string range $src 0 [expr $position-1]] + } else { + set file_path "" + } + + #Get file storage folder + db_1row get_folder_id {select acs1.object_id from acs_objects acs1, acs_objects acs2, acs_objects acs3 where acs1.context_id = acs2.object_id and acs2.title='#file-storage.file-storage#' and acs2.context_id = acs3.object_id and acs3.object_type = 'apm_package' and acs3.context_id = dotlrn_communities.community_id and dotlrn_communities.community_key = :other_comm_name} + set folder_id $object_id + if {$file_path != ""} { + set position [string first "/" $file_path] + if {$position == 0} { + set file_path [string range $file_path 1 end] + set position [string first "/" $file_path] + } + while {$position > 0} { + #Get folder key name + set folder_name [string range $file_path 0 [expr $position-1]] + + #Get folder_id + db_1row get_folder_id {select folder_id from fs_folders where key=:folder_name and parent_id=:folder_id} + + set file_path [string range $file_path [expr $position+1] end] + #Update loop variable + set position [string first "/" $file_path] + } + } + #Check that the file exist + if {[db_0or1row get_file_id {select file_id, live_revision from fs_files where key=:file_nam and parent_id=:folder_id}] == 1} { + #Copy file + if {[fs_file_p [expr $file_id]] == 1} { + set data [fs__datasource $live_revision] + set url [lindex $data [expr [lsearch $data content]+1]] + set file_name "$aux_folder_name/$file_nam" + file copy -force $url "$path/$file_name" + } + #Add file to resource file list + lappend resource_files_list $file_name + } + #Change src attribute value to write it in file to be exported + [lindex $image_nodes $i] setAttribute src "$file_name" + + } else { + #If the url is download + #Get file id + set position [string last "file%5fid=" $src] + if {$position > 0} { + set src [string range $src [expr $position+10] end] + } else { + set position [string last "file_id=" $src] + if {$position > 0} { + set src [string range $src [expr $position+8] end] + } + } + #Copy file + if {[fs_file_p $src] == 1} { + #Get live revision and file name + db_1row get_live_revision {select live_revision, key from fs_files where file_id=:src} + set data [fs__datasource $live_revision] + set url [lindex $data [expr [lsearch $data content]+1]] + set file_name "$aux_folder_name/$key" + file copy -force $url "$path/$file_name" + } + + #Add file to resource file list + lappend resource_files_list $file_name + + #Change src attribute value to write it in file to be exported + [lindex $image_nodes $i] setAttribute src "$file_name" + } + } + ##################################################################### + # Here may be an else block for Xowiki in other communities + ##################################################################### + } + } + ######################################################################### + # Here may be an else block for external urls + # This case has not been considered for implementation. + ######################################################################### + } + } + } + return $resource_files_list +} + + Index: openacs-4/packages/imsld/tcl/imsld-export-ld-components-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-export-ld-components-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/tcl/imsld-export-ld-components-procs.tcl 18 Feb 2009 11:10:46 -0000 1.1 +++ openacs-4/packages/imsld/tcl/imsld-export-ld-components-procs.tcl 17 Jun 2009 08:00:01 -0000 1.2 @@ -105,6 +105,10 @@ if {$identifier != ""} { $imsld_item setAttribute identifier $identifier } + #Check if the reference is of a xowiki page, if it is the case, fill identifierref with resource_(resource_number) + if {[string first "item_" $identifier] == 0} { + set identifierref "resource_[string range $identifier [expr [string first "_" $identifier]+1] end]" + } $imsld_item setAttribute identifierref $identifierref if {$is_visible_p == "t"} { set is_visible "true" @@ -501,6 +505,11 @@ if {$identifier != ""} { $imsld_item setAttribute identifier $identifier } + #Check if the reference is of a xowiki page, if it is the case, fill identifierref with resource_(resource_number) + if {[string first "item_" $identifier] == 0} { + set identifierref "resource_[string range $identifier [expr [string first "_" $identifier]+1] end]" + } + $imsld_item setAttribute identifierref $identifierref if {$is_visible_p == "t"} { set is_visible "true" @@ -541,7 +550,6 @@ if {$change_property_value_xml == ""} { - if {$feedback_title != ""} { #Create feedback-description label set feedback_description [$doc createElement "imsld:feedback-description"] @@ -563,6 +571,10 @@ if {$identifier != ""} { $imsld_item setAttribute identifier $identifier } + #Check if the reference is of a xowiki page, if it is the case, fill identifierref with resource_(resource_number) + if {[string first "item_" $identifier] == 0} { + set identifierref "resource_[string range $identifier [expr [string first "_" $identifier]+1] end]" + } $imsld_item setAttribute identifierref $identifierref if {$is_visible_p == "t"} { set is_visible "true" @@ -788,14 +800,18 @@ } #Get items associated to the learning_object - db_multirow get_learning_object_item get_learning_object_item {select imsld_item_id, identifier, identifierref, is_visible_p, title from acs_rels, cr_items cr1, cr_items cr2, imsld_items, cr_revisions where :learning_object_id = cr1.latest_revision and cr1.item_id = object_id_one and object_id_two = cr2.item_id and cr2.latest_revision = imsld_item_id and revision_id = imsld_item_id} { + db_foreach get_learning_object_item {select imsld_item_id, identifier, identifierref, is_visible_p, title from acs_rels, cr_items cr1, cr_items cr2, imsld_items, cr_revisions where :learning_object_id = cr1.latest_revision and cr1.item_id = object_id_one and object_id_two = cr2.item_id and cr2.latest_revision = imsld_item_id and revision_id = imsld_item_id} { #Write imsld:item label and content set imsld_item [$doc createElement "imsld:item"] $learning_object appendChild $imsld_item #Add attributes of imsld:item label if {$identifier != ""} { $imsld_item setAttribute identifier $identifier } + #Check if the reference is of a xowiki page, if it is the case, fill identifierref with resource_(resource_number) + if {[string first "item_" $identifier] == 0} { + set identifierref "resource_[string range $identifier [expr [string first "_" $identifier]+1] end]" + } $imsld_item setAttribute identifierref $identifierref if {$is_visible_p == "t"} { set is_visible "true" @@ -812,8 +828,12 @@ } } } + + + #If the current environment has one or more services, then write them db_multirow get_services get_services {select service_id, identifier, is_visible_p, service_type from imsld_services where environment_id = cr_items.item_id and cr_items.latest_revision = :environment_id} { + #Write imsld:service label and content set imsld_service [$doc createElement "imsld:service"] $environment appendChild $imsld_service @@ -908,6 +928,10 @@ if {$identifier != ""} { $imsld_item setAttribute identifier $identifier } + #Check if the reference is of a xowiki page, if it is the case, fill identifierref with resource_(resource_number) + if {[string first "item_" $identifier] == 0} { + set identifierref "resource_[string range $identifier [expr [string first "_" $identifier]+1] end]" + } $imsld_item setAttribute identifierref $identifierref if {$is_visible_p == "t"} { set is_visible "true" @@ -927,7 +951,7 @@ } } elseif {$service_type == "send-mail"} { #If service is of type send-mail, write send-mail content - db_1row get_send_mail_data {select mail_id, recipients, is_visible_p, parameters from imsld_send_mail_services where service_id = cr_items.item_id and cr_items.latest_revision = :service_id} + db_1row get_send_mail_data {select mail_id, recipients, is_visible_p, parameters from imsld_send_mail_services, cr_items where service_id = cr_items.item_id and cr_items.latest_revision = :service_id} #Write imsld:send-mail label and content set imsld_send_mail [$doc createElement "imsld:send-mail"] $imsld_service appendChild $imsld_send_mail @@ -951,8 +975,9 @@ $imsld_title appendChild [$doc createTextNode "$title"] } + #Add mail data if it exists - db_multirow get_mail_data get_mail_data {select identifier, mail_data, email_property_id, username_property_id from imsld_roles roles, imsld_send_mail_data data, acs_rels, cr_items cr1, cr_items cr2, cr_items cr3 where object_id_one = cr1.item_id and cr1.latest_revision = :mail_id and rel_type = 'imsld_send_mail_serv_data_rel' and object_id_two = cr2.item_id and cr2.latest_revision = data_id and data.role_id = cr3.item_id and cr3.latest_revision = roles.role_id} { + db_foreach get_mail_data {select identifier, mail_data, email_property_id, username_property_id from imsld_roles roles, imsld_send_mail_data data, acs_rels, cr_items cr1, cr_items cr2, cr_items cr3 where object_id_one = cr1.item_id and cr1.latest_revision = :mail_id and rel_type = 'imsld_send_mail_serv_data_rel' and object_id_two = cr2.item_id and cr2.latest_revision = data_id and data.role_id = cr3.item_id and cr3.latest_revision = roles.role_id} { #Write imsld:email-data label and content set imsld_email_data [$doc createElement "imsld:email-data"] $imsld_send_mail appendChild $imsld_email_data @@ -962,19 +987,13 @@ $imsld_email_data appendChild $imsld_role_ref #Add ref attribute $imsld_role_ref setAttribute ref $identifier -################################################### -################################################### -############# Under construction ################## -################################################### -# #Write imsld:email-property-ref label and content -# set email_property_ref [$doc createElement "imsld:email-property-ref"] -# $imsld_email_data appendChild $email_property_ref + + #Write imsld:email-property-ref label and content + set email_property_ref [$doc createElement "imsld:email-property-ref"] + $imsld_email_data appendChild $email_property_ref -# #Add ref attribute -# $email_property_ref setAttribute ref $identifier -################################################### -################################################### -################################################### + #Add ref attribute + $email_property_ref setAttribute ref $identifier } } } Index: openacs-4/packages/imsld/tcl/imsld-export-ld-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-export-ld-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/tcl/imsld-export-ld-procs.tcl 18 Feb 2009 11:10:46 -0000 1.1 +++ openacs-4/packages/imsld/tcl/imsld-export-ld-procs.tcl 17 Jun 2009 08:00:01 -0000 1.2 @@ -29,7 +29,13 @@ db_1row get_learning_objectives_info {select imsld_item_id, identifier, identifierref, is_visible_p from acs_rels, cr_items cr, imsld_items where :learning_objective_id = object_id_one and object_id_two = cr.item_id and cr.latest_revision = imsld_item_id} #Add attributes of imsld:item label $imsld_item setAttribute identifier $identifier + #Check if the reference is of a xowiki page, if it is the case, fill identifierref with resource_(resource_number) + if {[string first "item_" $identifier] == 0} { + set identifierref "resource_[string range $identifier [expr [string first "_" $identifier]+1] end]" + } + $imsld_item setAttribute identifierref $identifierref + if {$is_visible_p == "t"} { set is_visible "true" } else { @@ -77,6 +83,10 @@ db_1row get_prerequisites_info {select imsld_item_id, identifier, identifierref, is_visible_p from acs_rels, cr_items cr, imsld_items where :prerequisite_id = object_id_one and object_id_two = cr.item_id and cr.latest_revision = imsld_item_id} #Add attributes of imsld:item label $imsld_item setAttribute identifier $identifier + #Check if the reference is of a xowiki page, if it is the case, fill identifierref with resource_(resource_number) + if {[string first "item_" $identifier] == 0} { + set identifierref "resource_[string range $identifier [expr [string first "_" $identifier]+1] end]" + } $imsld_item setAttribute identifierref $identifierref if {$is_visible_p == "t"} { set is_visible "true" Index: openacs-4/packages/imsld/tcl/imsld-export-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-export-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/tcl/imsld-export-procs.tcl 18 Feb 2009 11:10:46 -0000 1.1 +++ openacs-4/packages/imsld/tcl/imsld-export-procs.tcl 17 Jun 2009 08:00:01 -0000 1.2 @@ -5,6 +5,7 @@ ############################################################################### ad_proc -public imsld::export::uol { -run_imsld_id:required + -resource_list:required } { This proc is called when an UoL is needed to be exported } { @@ -31,7 +32,7 @@ imsld::export::write_organizations -doc $doc -manifest $root -manifest_id $manifest_id -imsld_id $run_imsld_id -learning_objective_id $learning_objective_id -prerequisite_id $prerequisite_id #Call proc to fill resources part of imsmanifest.xml - imsld::export::write_resources -doc $doc -manifest $root -manifest_id $manifest_id + imsld::export::write_resources -doc $doc -manifest $root -manifest_id $manifest_id -resource_list $resource_list #Return the document as xml $root asXML @@ -79,9 +80,9 @@ } { This proc is called to write metadata label and content } { - ################################### - # This is not implemented - ################################### + ############################################################## + # This is not implemented due to it is not supported in Grail + ############################################################## #Not stored in grail #set metadata [$doc createElement metadata] #$metadata appendChild [$doc createTextNode "Estoy en funcion write_metadata"] @@ -116,16 +117,15 @@ -doc:required -manifest:required -manifest_id:required + -resource_list:required } { This proc is called to write resources label and content } { #First, create resources label set resources [$doc createElement resources] $manifest appendChild $resources - #Get resources and write them into the manifest document db_multirow get_resources get_resources {select * from imsld_cp_resources where manifest_id = :manifest_id} { - if {$href != ""} { #First, I need to create a resource label set resource [$doc createElement "resource"] $resources appendChild $resource @@ -134,10 +134,22 @@ $resource setAttribute identifier $identifier } $resource setAttribute type $type - $resource setAttribute href $href + if {$href != ""} { + $resource setAttribute href $href + } + #Check resource_list to look for additional resource files to the ones referenced in the database + if {[lindex $resource_list 0] == "NONE" || $href == ""} { + set resource_files_list [list] + } else { + set position [lsearch $resource_list $href] + if {$position != -1} { + set resource_files_list [lindex $resource_list [expr $position+1]] + } else { + set resource_files_list [list] + } + } #Call proc to fill files information for the resource - imsld::export::write_files -doc $doc -resource $resource -resource_id $resource_id - } + imsld::export::write_files -doc $doc -resource $resource -resource_id $resource_id -resource_files_list $resource_files_list } } @@ -148,20 +160,53 @@ -doc:required -resource:required -resource_id:required + -resource_files_list:required } { This proc is called to write files label and content } { #Get file_ids of the resource given db_multirow get_file_ids get_file_ids {select object_id_two from acs_rels where object_id_one = cr_items.item_id and cr_items.latest_revision = :resource_id} { - #Get href for each file returned in the get_files_ids query - if {[db_0or1row get_file_href {select href from imsld_cp_files where imsld_file_id = cr_items.latest_revision and cr_items.item_id = :object_id_two}] == 1} { - #Create file label - set one_file [$doc createElement "file"] - $resource appendChild $one_file - #Add href attribute - $one_file setAttribute href $href + #Get content type to proceed depending on type (imsld_cp_file, ::xowiki::Page or ::xowiki::File) + db_1row get_content_type {select content_type, name from cr_items where item_id = :object_id_two} + + if {$content_type == "imsld_cp_file"} { + #Get href for each file returned in the get_files_ids query + if {[db_0or1row get_file_href {select href from imsld_cp_files where imsld_file_id = cr_items.latest_revision and cr_items.item_id = :object_id_two}] == 1} { + #Create file label + set one_file [$doc createElement "file"] + $resource appendChild $one_file + #Add href attribute + $one_file setAttribute href ${href} + } + } else { + if {[string first "link" $name] != 0} { + #Create file label + set one_file [$doc createElement "file"] + $resource appendChild $one_file + + set pos [string first "/" $name] + if {$pos == -1} { + regsub -all {:} $name {_} name + if {[string last "." $name] < [string length $name]-5} { + set name ${name}.html + } + } + set href [string range $name [expr $pos+1] end] + + #Add href attribute + $one_file setAttribute href ${href} + } } } + #Write file resources from resource_file_list + if {[llength $resource_files_list] > 0} { + foreach res_file $resource_files_list { + set one_file [$doc createElement "file"] + $resource appendChild $one_file + #Add href attribute + $one_file setAttribute href ${res_file} + } + } } ############################################################################### Index: openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl 17 Apr 2008 17:18:16 -0000 1.7 +++ openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl 17 Jun 2009 08:00:01 -0000 1.8 @@ -252,6 +252,7 @@ ad_proc -public imsld::fs::traverse_zip { -dir:required -pattern:required + {-resource_handler "file-storage"} } { Function to recursively traverse the files in a ZIP to then detect those that are not reerenced in a resource, but still need to be in the file @@ -266,16 +267,23 @@ -file_list $files_struct_list \ -path_prefix $dir] } { # Create the new file - imsld::fs::file_new \ - -path_to_file $fname \ - -type file \ - -complete_path "[ns_urldecode ${dir}/${fname}]" + if {$resource_handler eq "file-storage"} { + imsld::fs::file_new \ + -path_to_file $fname \ + -type file \ + -complete_path "[ns_urldecode ${dir}/${fname}]" + } else { + imsld::xowiki::file_new \ + -path_to_file $fname \ + -type file \ + -complete_path "[ns_urldecode ${dir}/${fname}]" + } } } # Recur over the directories foreach subd [glob -tail -nocomplain -types d -directory $dir $pattern] { - imsld::fs::traverse_zip -dir $dir -pattern "$subd/*" + imsld::fs::traverse_zip -dir $dir -pattern "$subd/*" -resource_handler $resource_handler } } @@ -300,7 +308,7 @@ if { [lsearch -exact [string tolower $content] \ [string tolower "$path_prefix/$file_name"]] >=0 && \ [lindex $content 1] eq "file" } { - # If the object_id is zero, the file was found + # If the object_id is zero, the file was not found if { [lindex $content 2] == 0 } { return 1 } else { 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 -r1.47 -r1.48 --- openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 18 Dec 2008 19:12:13 -0000 1.47 +++ openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 17 Jun 2009 08:00:01 -0000 1.48 @@ -121,7 +121,7 @@ content::type::attribute::new -content_type imsld_activity_structure -attribute_name sort_order -datatype number -pretty_name "#imsld.Sort_Order#" -column_spec "integer" # environments - content::type::new -content_type imsld_environment -supertype content_revision -pretty_name "#imsld.IMD-LD_Environment#" -pretty_plural "#imsld.IMD-LD_Environments#" -table_name imsld_environments -id_column environment_id + content::type::new -content_type imsld_environment -supertype content_revision -pretty_name "#imsld.IMS-LD_Environment#" -pretty_plural "#imsld.IMS-LD_Environments#" -table_name imsld_environments -id_column environment_id content::type::attribute::new -content_type imsld_environment -attribute_name component_id -datatype number -pretty_name "#imsld.Component_Identifier#" -column_spec "integer" content::type::attribute::new -content_type imsld_environment -attribute_name identifier -datatype string -pretty_name "#imsld.Identifier#" -column_spec "varchar(100)" @@ -208,7 +208,7 @@ # on completion content::type::new -content_type imsld_on_completion -supertype content_revision -pretty_name "#imsld.IMS-LD_On_Completion#" -pretty_plural "#imsld.lt_IMS-LD_On_Completions#" -table_name imsld_on_completion -id_column on_completion_id - content::type::attribute::new -content_type imsld_on_completion -attribute_name feedback_title -datatype string -pretty_name "#imsld.Feedbach_Title#" -column_spec "varchar(200)" + content::type::attribute::new -content_type imsld_on_completion -attribute_name feedback_title -datatype string -pretty_name "#imsld.Feedback_Title#" -column_spec "varchar(200)" # classes content::type::new -content_type imsld_class -supertype content_revision -pretty_name "#imsld.IMS-LD_Class#" -pretty_plural "#imsld.IMS-LD_Classes#" -table_name imsld_classes -id_column class_id @@ -247,7 +247,7 @@ content::type::attribute::new -content_type imsld_cp_dependency -attribute_name identifierref -datatype string -pretty_name "#imsld.Identifierref#" -column_spec "varchar(100)" # imsld cp files - content::type::new -content_type imsld_cp_file -supertype content_revision -pretty_name "#imsld.IMS-LD_CP_File#" -pretty_plural "#imsld.IMS-LD_CP_Filed#" -table_name imsld_cp_files -id_column imsld_file_id + content::type::new -content_type imsld_cp_file -supertype content_revision -pretty_name "#imsld.IMS-LD_CP_File#" -pretty_plural "#imsld.IMS-LD_CP_Files#" -table_name imsld_cp_files -id_column imsld_file_id content::type::attribute::new -content_type imsld_cp_file -attribute_name path_to_file -datatype string -pretty_name "#imsld.Path_to_File#" -column_spec "varchar(2000)" content::type::attribute::new -content_type imsld_cp_file -attribute_name file_name -datatype string -pretty_name "#imsld.File_name#" -column_spec "varchar(2000)" @@ -322,6 +322,9 @@ content::type::attribute::new -content_type imsld_condition -attribute_name method_id -datatype number -pretty_name "#imsld.Method_Identifier#" -column_spec "integer" content::type::attribute::new -content_type imsld_condition -attribute_name condition_xml -datatype string -pretty_name "#imsld.Condition#" -column_spec "varchar(4000)" + # global properties folder + imsld::install::create_global_folder + ### IMS-LD LEVEL C # notifications @@ -1083,6 +1086,7 @@ content::type::attribute::delete -content_type imsld_imsld -attribute_name sequence_used_p content::type::attribute::delete -content_type imsld_imsld -attribute_name learning_objective_id content::type::attribute::delete -content_type imsld_imsld -attribute_name prerequisite_id + content::type::attribute::delete -content_type imsld_imsld -attribute_name resource_handler # learning objectives content::type::attribute::delete -content_type imsld_learning_objective -attribute_name pretty_title @@ -1205,6 +1209,7 @@ # complete acts content::type::attribute::delete -content_type imsld_complete_act -attribute_name time_in_seconds + content::type::attribute::delete -content_type imsld_complete_act -attribute_name time_string content::type::attribute::delete -content_type imsld_complete_act -attribute_name user_choice_p content::type::attribute::delete -content_type imsld_complete_act -attribute_name when_last_act_completed_p @@ -1297,3 +1302,52 @@ } + +ad_proc -private imsld::install::create_global_folder { +} { + Creates the CR folder for global properties + + @author Derick Leony (derick@inv.it.uc3m.es) + @creation-date 2009-05-28 + + @return + + @error +} { + set folder_name "imsld_global_folder" + set dotlrn_root_folder_id [dotlrn_fs::get_dotlrn_root_folder_id] + + db_transaction { + # create the root cr dir + + set global_folder_id [imsld::cr::folder_new \ + -parent_id $dotlrn_root_folder_id \ + -folder_name $folder_name \ + -folder_label "IMS-LD"] + + # PERMISSIONS FOR FILE-STORAGE + + # Before we go about anything else, lets just set permissions + # straight. + # Disable folder permissions inheritance + permission::set_not_inherit -object_id $global_folder_id + + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) + set party_id_professor [dotlrn::user::type::get_segment_id -type professor] + permission::grant -party_id $party_id_professor -object_id $global_folder_id -privilege read + + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) + set party_id_admins [dotlrn::user::type::get_segment_id -type admin] + permission::grant -party_id $party_id_admins -object_id $global_folder_id -privilege read + } + # register content types + content::folder::register_content_type -folder_id $global_folder_id \ + -content_type imsld_property_instance + + # allow subfolders inside our parent folder + content::folder::register_content_type -folder_id $global_folder_id \ + -content_type content_folder +} + 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 -r1.15 -r1.16 --- openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 4 Jul 2008 15:29:26 -0000 1.15 +++ openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 17 Jun 2009 08:00:01 -0000 1.16 @@ -191,14 +191,24 @@ # before we can continue we create the folder where the properties of type # file will be stored set run_folder_id [imsld::instance::create_run_folder -run_id $run_id] + set community_id [dotlrn_community::get_community_id] set cr_root_folder_id \ [imsld::cr::get_root_folder \ - -community_id [dotlrn_community::get_community_id]] + -community_id $community_id] set cr_folder_id [content::item::get_id \ -item_path "cr_manifest_${manifest_id}" \ -root_folder_id $cr_root_folder_id -resolve_index f] set global_folder_id [imsld::global_folder_id] + # Set read permissions for community/class dotlrn_member_rel + set party_id_member [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_member_rel] + permission::grant -party_id $party_id_member -object_id $global_folder_id -privilege read + + # Set read permissions for community/class dotlrn_admin_rel + set party_id_admin [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_admin_rel] + permission::grant -party_id $party_id_admin -object_id $global_folder_id -privilege read + + # 1. loc-property: We create only one entry in the imsld_property_instances # table for each property of this type db_foreach loc_property { @@ -886,6 +896,11 @@ } } + #5.5 Generic Service (GSI) + #in another file, to ensure an non-intrussive add-on (as much as possible) + imsld::gsi::instance::instantiate_service -component_item_id $component_item_id -run_id $run_id -user_id $user_id + + # 6. play db_foreach play { select play.play_id, Index: openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl 5 Feb 2009 17:18:18 -0000 1.9 +++ openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl 17 Jun 2009 08:00:01 -0000 1.10 @@ -129,6 +129,21 @@ -sort_order $sort_order \ -number_elements $activities_number] + set del_node [$dom_doc createElement a] + $del_node setAttribute onclick "return loadTree('[export_vars -base activity-del {run_id activity_id}]')" + $del_node setAttribute href "#no" + $del_node setAttribute title "[_ imsld.Delete_URL]" + + set del_icon [$dom_doc createElement img] + $del_node appendChild $del_icon + $del_icon setAttribute src "/resources/acs-subsite/Delete16.gif" + $del_icon setAttribute alt "[_ imsld.Delete]" + + $del_node appendChild $del_icon + $activity_node appendChild [$dom_doc createTextNode " \["] + $activity_node appendChild $del_node + $activity_node appendChild [$dom_doc createTextNode "]"] + set completed_list [linsert $completed_list \ $sort_order [$activity_node asList]] } 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.75 -r1.76 --- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 19 Dec 2008 18:57:01 -0000 1.75 +++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 17 Jun 2009 08:00:01 -0000 1.76 @@ -264,7 +264,7 @@ } elseif { [regexp {.zip$} $upload_file] } { set type zip } else { - set type "[_ imsld.Uknown_type]" + set type "[_ imsld.Unknown_type]" } switch $type { @@ -533,6 +533,7 @@ -community_id:required -manifest_id:required {-manifest_identifier ""} + {-resource_handler "file-storage"} } { Initializes the cr folders where all the cr items of the manifest will be stored in, and sets the respective permissions. There are two folders for each imsld. One to store the files and show them in the fs, and the other to store the items.. It won't create the files in the cr since not every file will be handled by the cr (some files may be handled by other packages). @@ -564,7 +565,7 @@ set fs_folder_id [content::item::get_id -item_path "manifest_${manifest_id}" -root_folder_id $fs_root_folder_id -resolve_index f] set cr_folder_id [content::item::get_id -item_path "cr_manifest_${manifest_id}" -root_folder_id $cr_root_folder_id -resolve_index f] - if { [empty_string_p $fs_folder_id] } { + if { [empty_string_p $fs_folder_id] && ($resource_handler eq "file-storage") } { db_transaction { set folder_name "manifest_${manifest_id}" @@ -721,6 +722,11 @@ permission::set_not_inherit -object_id $acs_object_id } + set import_with_xowiki 0 + if { $resource_handler eq "xowiki" } { + set import_with_xowiki 1 + } + set resource_id [imsld::cp::resource_new -manifest_id $manifest_id \ -identifier $resource_identifier \ -type $resource_type \ @@ -733,11 +739,6 @@ set filex_list [$resource_node selectNodes {*[local-name()='file']}] set found_id_in_list 0 - # TODO: set this variable properly: - set import_with_xowiki 0 - if { $resource_handler eq "xowiki" } { - set import_with_xowiki 1 - } foreach filex $filex_list { set filex_href [imsld::parse::get_attribute -node $filex -attr_name href] @@ -750,7 +751,7 @@ -type file \ -complete_path "[ns_urldecode ${tmp_dir}/${filex_href}]"] } else { - set filex_id [imsld::fs::file_new -href $filex_href \ + set filex_id [imsld::fs::file_new -href $filex_href \ -path_to_file $filex_href \ -type file \ -complete_path "[ns_urldecode ${tmp_dir}/${filex_href}]"] @@ -2203,6 +2204,22 @@ } } + +# GSI integration: support for generic services +# environment: genericService + set gsi_services [$environment_node selectNodes "*\[local-name()='genericService'\]"] + foreach gservice $gsi_services { + set gsi_service_id [imsld::gsi::parse::parse_and_create_genericService -service_node $gservice \ + -environment_id $environment_id \ + -parent_id $parent_id \ + -manifest_id $manifest_id \ + -manifest $manifest \ + -tmp_dir $tmp_dir \ + -resource_handler $resource_handler \ + ] + } + + # environment: environment ref set environment_ref_list [$environment_node selectNodes "*\[local-name()='environment-ref'\]"] if { [llength $environment_ref_list] } { @@ -2499,8 +2516,10 @@ # create a node where all the change-property-values will be stored set temporal_doc [dom createDocument change-property-values] set temporal_node [$temporal_doc documentElement] - - $temporal_node appendChild $change_property_value_list + + foreach cpv $change_property_value_list { + $temporal_node appendChild $cpv + } set change_property_value_xml [$temporal_node asXML] } @@ -2720,8 +2739,10 @@ # create a node where all the change-property-values will be stored set temporal_doc [dom createDocument change-property-values] set temporal_node [$temporal_doc documentElement] - - $temporal_node appendChild $change_property_value_list + + foreach cpv $change_property_value_list { + $temporal_node appendChild $cpv + } set change_property_value_xml [$temporal_node asXML] } @@ -3600,8 +3621,9 @@ # create a node where all the change-property-values will be stored set temporal_doc [dom createDocument change-property-values] set temporal_node [$temporal_doc documentElement] - - $temporal_node appendChild $change_property_value_list + foreach cpv $change_property_value_list { + $temporal_node appendChild $cpv + } set change_property_value_xml [$temporal_node asXML] } @@ -3810,8 +3832,10 @@ # create a node where all the change-property-values will be stored set temporal_doc [dom createDocument change-property-values] set temporal_node [$temporal_doc documentElement] - - $temporal_node appendChild $change_property_value_list + + foreach cpv $change_property_value_list { + $temporal_node appendChild $cpv + } set change_property_value_xml [$temporal_node asXML] } @@ -4234,9 +4258,10 @@ # initialize folders set folders_list [imsld::parse::initialize_folders -community_id $community_id \ - -manifest_id $manifest_id \ - -manifest_identifier $manifest_identifier] - + -manifest_id $manifest_id \ + -manifest_identifier $manifest_identifier \ + -resource_handler $resource_handler] + set fs_folder_id [lindex $folders_list 0] set cr_folder_id [lindex $folders_list 1] @@ -4552,8 +4577,10 @@ # create a node where all the change-property-values will be stored set temporal_doc [dom createDocument change-property-values] set temporal_node [$temporal_doc documentElement] - - $temporal_node appendChild $change_property_value_list + + foreach cpv $change_property_value_list { + $temporal_node appendChild $cpv + } set change_property_value_xml [$temporal_node asXML] } @@ -4820,7 +4847,7 @@ # them. Those that still have a zero as object_id are files that are not # referenced as resources by the manifest, but they are in the ZIP, # therefore, they need to be moved to the FS. - imsld::fs::traverse_zip -dir $tmp_dir -pattern "*" + imsld::fs::traverse_zip -dir $tmp_dir -pattern "*" -resource_handler $resource_handler 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.116 -r1.117 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 27 Mar 2009 03:22:41 -0000 1.116 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 17 Jun 2009 08:00:01 -0000 1.117 @@ -668,63 +668,13 @@ This folder is a subfolder of the dotlrn root folder and there must be only one in the .LRN installation } { - set community_id [expr { [empty_string_p $community_id] ? \ - [dotlrn_community::get_community_id] : \ - $community_id }] - set dotlrn_root_folder_id [dotlrn_fs::get_dotlrn_root_folder_id] + set global_folder_id [content::item::get_id \ -item_path "imsld_global_folder" \ -root_folder_id $dotlrn_root_folder_id \ -resolve_index f] - if { [empty_string_p $global_folder_id] } { - db_transaction { - set folder_name "imsld_global_folder" - - # checks for write permission on the parent folder - ad_require_permission $dotlrn_root_folder_id write - - # create the root cr dir - - set global_folder_id [imsld::cr::folder_new \ - -parent_id $dotlrn_root_folder_id \ - -folder_name $folder_name \ - -folder_label "IMS-LD"] - - # PERMISSIONS FOR FILE-STORAGE - - # Before we go about anything else, lets just set permissions - # straight. - # Disable folder permissions inheritance - permission::toggle_inherit -object_id $global_folder_id - - # Set read permissions for community/class dotlrn_member_rel - set party_id_member [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_member_rel] - permission::grant -party_id $party_id_member -object_id $global_folder_id -privilege read - - # Set read permissions for community/class dotlrn_admin_rel - set party_id_admin [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_admin_rel] - permission::grant -party_id $party_id_admin -object_id $global_folder_id -privilege read - - # Set read permissions for *all* other professors within .LRN - # (so they can see the content) - set party_id_professor [dotlrn::user::type::get_segment_id -type professor] - permission::grant -party_id $party_id_professor -object_id $global_folder_id -privilege read - - # Set read permissions for *all* other admins within .LRN - # (so they can see the content) - set party_id_admins [dotlrn::user::type::get_segment_id -type admin] - permission::grant -party_id $party_id_admins -object_id $global_folder_id -privilege read - } - # register content types - content::folder::register_content_type -folder_id $global_folder_id \ - -content_type imsld_property_instance - - # allow subfolders inside our parent folder - content::folder::register_content_type -folder_id $global_folder_id \ - -content_type content_folder - } return $global_folder_id } @@ -1228,6 +1178,7 @@ set url [ns_conn url] regexp {finish-component-element-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([a-z]+).imsld$} $url match imsld_id run_id play_id act_id role_part_id element_id type } + ns_log Notice "finish_component element: act_id ($act_id), role_part_id ($role_part_id), user_id ($user_id)" if { ![db_0or1row marked_as_started { *SQL* }] } { # NOTE: this should not happen... UNLESS the activity is marked as # finished automatically @@ -1283,7 +1234,8 @@ and content_revision__is_live(on_completion_id) = 't' and change_property_value_xml is not null }] } { - imsld::condition::eval_change_property_value -change_property_value_xml $change_property_value_xml -run_id $run_id + ns_log Notice "->eval: $user_id" + imsld::condition::eval_change_property_value -change_property_value_xml $change_property_value_xml -run_id $run_id -user_id $user_id } # notifications set notified_users_list [list] @@ -1337,6 +1289,14 @@ } } } + #FIXME: on-complete-actions are only defined form acts, because all users finish the component at the + #same time. I have to define the behaviour for other components. + #look for matching gsi_triggers + set action_list [imsld::gsi::get_triggered_actions -trigger "on-complete-action" -run_id $run_id] + #FIXME: hay que restringir la lista a las acciones que apuntan al component actual + if {[llength $action_list]} { + imsld::gsi::action_list_execute -actions $action_list -run_id $run_id + } } if { [string eq $type "learning"] || [string eq $type "support"] || [string eq $type "structure"] } { @@ -2171,7 +2131,7 @@ lappend resource_item_list $resource_item_id set monitor_node_li [$dom_doc createElement li] set a_node [$dom_doc createElement a] - set file_url [export_vars -base "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]]imsld/monitor-frame" { monitor_id }] + set file_url [export_vars -base "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]]imsld/monitor-frame" { monitor_id role_id}] $a_node setAttribute href [export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]imsld-finish-resource" {file_url $file_url resource_item_id $resource_item_id run_id $run_id}] set service_title [$dom_doc createTextNode "$monitor_service_title"] $a_node appendChild $service_title @@ -2302,6 +2262,13 @@ } } +#gsi generic services + set environment_gservices_list [imsld::gsi::find_and_process_gsi_service_as_ul -environment_id $environment_id \ + -user_id $user_id \ + -run_id $run_id \ + -dom_node $environment_node \ + -dom_doc $dom_doc] + set nested_environment_list [list] # environments foreach nested_environment_item_id [db_list nested_environment { *SQL* }] { @@ -2371,7 +2338,7 @@ imsld::process_resource_as_ul -resource_item_id $resource_item_id \ -run_id $run_id \ -dom_doc $dom_doc \ - -dom_node $list_node + -dom_node $dom_node } if_no_rows { ns_log notice "[_ imsld.lt_li_desc_no_file_assoc]" } @@ -4472,6 +4439,7 @@ imsld_activity_descsi ades where ades.item_id = :object_id_nested and la.activity_description_id = ades.item_id + and content_revision__is_live(la.activity_id) }] } { set activities_list [concat $activities_list [list [list $activity_id $activity_item_id learning]]] } else { @@ -4719,17 +4687,7 @@ #get the user active role - db_1row get_active_role { - select iruns.active_role_id as active_role - from imsld_run_users_group_rels iruns, - acs_rels ar, - imsld_run_users_group_ext iruge - where iruge.run_id=:run_id - and ar.object_id_one=iruge.group_id - and ar.object_id_two=:user_id - and ar.rel_type='imsld_run_users_group_rel' - and ar.rel_id=iruns.rel_id - } + set active_role [imsld::roles::get_active_role -run_id $run_id -user_id $user_id] #get the permissions related to that role set manager_in_forum 0 @@ -4951,6 +4909,40 @@ } } +ad_proc -public imsld::get_imsld_cp_file_id { + -run_id + -identifier +} { + Return the imsld_file_id (cr_item_id, in fact) related with an identifier and a run_id + @author Luis de la Fuente Valentín (lfuente@it.uc3m.es) +} { + set imsld_file_id "" + if { [db_0or1row get_resource_from_identifier { + select icr.item_id as resource_item_id + from imsld_runs ir, + imsld_imslds ii, + imsld_cp_organizationsi ico, + imsld_cp_manifestsi icm, + imsld_cp_resourcesi icr + where ir.imsld_id=ii.imsld_id and + ii.organization_id=ico.item_id and + ir.run_id=:run_id and + ico.manifest_id=icm.item_id and + icm.item_id=icr.manifest_id and + icr.identifier=:identifier + }]} { + # get file info from resource + set imsld_file_id [db_string get_file_from_resource { + select ar.object_id_two as imsld_file_id + from acs_rels ar + where ar.rel_type ='imsld_res_files_rel' and + ar.object_id_one=:resource_item_id + } -default ""] + } + return "$imsld_file_id" +} + + ad_register_proc GET /finish-component-element* imsld::finish_component_element ad_register_proc POST /finish-component-element* imsld::finish_component_element Index: openacs-4/packages/imsld/tcl/imsld-roles-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-roles-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/imsld/tcl/imsld-roles-procs.tcl 2 Dec 2008 17:26:35 -0000 1.18 +++ openacs-4/packages/imsld/tcl/imsld-roles-procs.tcl 17 Jun 2009 08:00:01 -0000 1.19 @@ -158,8 +158,12 @@ } { @param roles_list the list of roles to get the name } { - if {[info exist run_id]} { - set groups [db_list get_community_related_groups {}] + if {[exists_and_not_null run_id]} { + if {[exists_and_not_null role_id]} { + set groups [db_list get_community_role_related_groups {}] + } else { + set groups [db_list get_community_related_groups {}] + } } else { set groups [db_list get_related_groups {}] } @@ -467,3 +471,24 @@ return $groups } + +ad_proc -public imsld::roles::get_active_role { + -run_id:required + -user_id:required +} { + Return the active role for a given user in a given run. +} { + db_1row get_active_role { + select iruns.active_role_id as active_role + from imsld_run_users_group_rels iruns, + acs_rels ar, + imsld_run_users_group_ext iruge + where iruge.run_id=:run_id + and ar.object_id_one=iruge.group_id + and ar.object_id_two=:user_id + and ar.rel_type='imsld_run_users_group_rel' + and ar.rel_id=iruns.rel_id + } + return $active_role +} + Index: openacs-4/packages/imsld/tcl/imsld-roles-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-roles-procs.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/imsld/tcl/imsld-roles-procs.xql 18 Apr 2008 14:42:32 -0000 1.6 +++ openacs-4/packages/imsld/tcl/imsld-roles-procs.xql 17 Jun 2009 08:00:01 -0000 1.7 @@ -139,7 +139,7 @@ - + select ar.object_id_two from acs_rels ar, @@ -156,6 +156,22 @@ + + + select ar.object_id_two + from acs_rels ar, + acs_rels ar2, + imsld_rolesi iri, + imsld_run_users_group_ext iruge + where ar.object_id_one=iri.item_id + and ar.rel_type='imsld_role_group_rel' + and ar.object_id_two=ar2.object_id_one + and ar2.rel_type='imsld_roleinstance_run_rel' + and ar2.object_id_two=iruge.group_id + and iruge.run_id=:run_id + + + select ar.object_id_two Index: openacs-4/packages/imsld/tcl/imsld-xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-xowiki-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/tcl/imsld-xowiki-procs.tcl 19 Dec 2008 18:57:01 -0000 1.3 +++ openacs-4/packages/imsld/tcl/imsld-xowiki-procs.tcl 17 Jun 2009 08:00:01 -0000 1.4 @@ -37,7 +37,37 @@ @error } { + upvar files_struct_list files_struct_list + # search the file and while doing so, create all the parent folders for that file (if they were not already creatd) + set found_p 0 + + # structx = directory loop, count_y and count_x are going to be used to update the files_structure_list + set structx $files_struct_list + set count_y 0 + while { [llength $structx] > 0 && $found_p == 0 } { + # for each directory + set dirx [lindex $structx 0] + set count_x 0 + # search in the dir contents + foreach contentsx [lindex $dirx 1] { + if { [lsearch -exact [string tolower $contentsx] [string tolower $complete_path]] >= 0 && [string eq [lindex $contentsx 1] $type] } { + # file found, see if the parent dir is created + set found_p 1 + # have we already created this file? + set found_id [lindex $contentsx 2] + set parent_id [lindex [lindex $dirx 0] 1] + break + } + incr count_x + } + if { !$found_p } { + # proceed only if the file hasn't been found, since we will use the counter later + incr count_y + set structx [lrange $structx 1 [expr [llength $structx] -1]] + } + } + set mime_type [cr_filename_to_mime_type $complete_path] set community_id [dotlrn_community::get_community_id] @@ -48,7 +78,7 @@ ::xowiki::Package initialize -package_id $package_id -url $xw_url -user_id [ad_conn user_id] - if { [string match "text/*" $mime_type] } { + if { $mime_type eq "text/html" || $mime_type eq "text/xml" } { set file [open $complete_path] set content [read $file] close $file @@ -93,6 +123,13 @@ $page save } } + # update file structure + if { $found_p } { + set file_list [list $complete_path file [$page item_id]] + set content_list [lreplace [lindex [lindex $files_struct_list $count_y] 1] $count_x $count_x $file_list] + set dir_list [list [lindex [lindex $files_struct_list $count_y] 0] $content_list] + set files_struct_list [lreplace $files_struct_list $count_y $count_y $dir_list] + } return [$page item_id] @@ -101,6 +138,7 @@ ad_proc -public imsld::xowiki::page_content { -item_id + -run_id } { @author Derick Leony (derick@inv.it.uc3m.es) @@ -113,8 +151,19 @@ @error } { set page [::xowiki::Package instantiate_page_from_id -item_id $item_id] - set result [$page render] + set result [$page render_content] + set manifest_identifier [db_string select_identifier { + select im.identifier + from imsld_cp_manifestsx im, imsld_cp_organizationsx io, imsld_imslds ii, imsld_runs ir + where ir.run_id = :run_id + and ir.imsld_id = ii.imsld_id + and ii.organization_id = io.item_id + and io.manifest_id = im.item_id + } -default ""] + + regsub {src="([^\"]*)"} $result "src=\"../xowiki/download/file/${manifest_identifier}/\\1\"" result + return $result } Index: openacs-4/packages/imsld/www/activity-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/activity-frame.adp,v diff -u -r1.18 -r1.19 --- openacs-4/packages/imsld/www/activity-frame.adp 27 Apr 2009 10:02:07 -0000 1.18 +++ openacs-4/packages/imsld/www/activity-frame.adp 17 Jun 2009 08:00:01 -0000 1.19 @@ -1,16 +1,21 @@ - - init_activity() - - - - 1 - - @page_title;noquote@ - @context;noquote@ - 1 -
@frame_header@
@environments;noquote@ 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 -r1.26 -r1.27 --- openacs-4/packages/imsld/www/imsld-content-serve.tcl 8 Jan 2009 19:48:35 -0000 1.26 +++ openacs-4/packages/imsld/www/imsld-content-serve.tcl 17 Jun 2009 08:00:01 -0000 1.27 @@ -74,7 +74,7 @@ and map.displayable_p = 't' } - set xml_string "[imsld::xowiki::page_content -item_id $item_id]" + set xml_string "[imsld::xowiki::page_content -item_id $item_id -run_id $run_id]" } # context info Index: openacs-4/packages/imsld/www/imsld-divset.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-divset.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/www/imsld-divset.adp 27 Apr 2009 10:02:07 -0000 1.5 +++ openacs-4/packages/imsld/www/imsld-divset.adp 17 Jun 2009 08:00:01 -0000 1.6 @@ -1,28 +1,19 @@ - - - - - @course_name@ - - - + + @course_name@ + 1 + init_activity() + + + + 1 + +
@@ -36,5 +27,3 @@
- - Index: openacs-4/packages/imsld/www/imsld-divset.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-divset.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/www/imsld-divset.tcl 8 Jul 2008 15:32:34 -0000 1.2 +++ openacs-4/packages/imsld/www/imsld-divset.tcl 17 Jun 2009 08:00:01 -0000 1.3 @@ -25,3 +25,5 @@ set environment_src [export_vars -base "environment-frame" {{run_id $run_id} {activity_id $activity_id}}] } +set page_title {} +set context [list] Index: openacs-4/packages/imsld/www/imsld-tree.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-tree.adp,v diff -u -r1.19 -r1.20 --- openacs-4/packages/imsld/www/imsld-tree.adp 29 Mar 2009 15:27:40 -0000 1.19 +++ openacs-4/packages/imsld/www/imsld-tree.adp 17 Jun 2009 08:00:01 -0000 1.20 @@ -1,6 +1,3 @@ - - 1 -
#imsld.Exit# @@ -22,7 +19,7 @@
#imsld.Activities#
-
+
Index: openacs-4/packages/imsld/www/monitor-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/monitor-frame.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/imsld/www/monitor-frame.adp 17 Apr 2008 17:17:54 -0000 1.6 +++ openacs-4/packages/imsld/www/monitor-frame.adp 17 Jun 2009 08:00:01 -0000 1.7 @@ -17,7 +17,7 @@ - + @@ -50,10 +50,14 @@ var a = as[i]; a.setAttribute('target', 'object'); } -document.getElementById('object').src = as[0].getAttribute('href'); +if (as[0].getAttribute('href') != '') { + document.getElementById('object').src = as[0].getAttribute('href'); +} - + Index: openacs-4/packages/imsld/www/monitor-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/monitor-frame.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/monitor-frame.tcl 8 Jul 2008 15:32:35 -0000 1.3 +++ openacs-4/packages/imsld/www/monitor-frame.tcl 17 Jun 2009 08:00:01 -0000 1.4 @@ -16,7 +16,7 @@ set user_id [ad_conn user_id] -if { ![ string eq $role_id ""] } { +if { $role_id ne "" } { db_1row monitor_service_info { *SQL* } } else { db_1row monitor_service_info_no_role_id { *SQL* } Index: openacs-4/packages/imsld/www/properties-value-set.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/properties-value-set.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/www/properties-value-set.tcl 17 Apr 2008 17:17:54 -0000 1.5 +++ openacs-4/packages/imsld/www/properties-value-set.tcl 17 Jun 2009 08:00:01 -0000 1.6 @@ -21,12 +21,11 @@ # avoiding hacks db_1row instance_info_id { select ins.property_id, - prop.datatype + prop.datatype from imsld_property_instances ins, - imsld_properties prop + imsld_properties prop where ins.instance_id = :instance_id - and ins.property_id = prop.property_id - and content_revision__is_live(ins.instance_id) = 't' + and ins.property_id = prop.property_id } if { [string eq "file" $datatype] } { Index: openacs-4/packages/imsld/www/admin/imsld-confirm-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-confirm-finish.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/imsld/www/admin/imsld-confirm-finish.tcl 17 Apr 2008 17:17:54 -0000 1.9 +++ openacs-4/packages/imsld/www/admin/imsld-confirm-finish.tcl 17 Jun 2009 08:00:01 -0000 1.10 @@ -10,13 +10,28 @@ # NOTE: we should verify the permissions here -set conditions 1 -if {$conditions == 1} { +set has_services_p [db_string get_services_in_run { + select count(*) + from imsld_gsi_service_status stat, + imsld_gsi_servicesi serv, + imsld_gsi_toolsi tools + where stat.run_id=:run_id and + serv.gsi_tool_id=tools.item_id and + stat.owner_id=serv.gsi_service_id +}] + +if {$has_services_p == 0} { db_dml set_run_active { update imsld_runs set status = 'active', status_date = now() where run_id=:run_id and imsld_id=:imsld_id } +} else { + db_dml set_run_waitingservices { + update imsld_runs set status = 'waitingservices', + status_date = now() + where run_id=:run_id and imsld_id=:imsld_id + } } # excecute all conditions for all users Index: openacs-4/packages/imsld/www/admin/imsld-export-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-export-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-export-2.tcl 18 Feb 2009 11:03:03 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-export-2.tcl 17 Jun 2009 08:00:01 -0000 1.2 @@ -7,6 +7,7 @@ imsld_id:integer uol_name:nohtml include_all:nohtml + manifest_id:integer } #Check if the user who attemps to enter the page has admin priviledges @@ -36,20 +37,19 @@ #Create new temporal directory to store output set in_path [ns_tmpnam] -############################################################################# -############################################################################# + set path [acs_package_root_dir imsld]/www$in_path -#set path $in_path -############################################################################# -############################################################################# exec mkdir $path #Open a new file to write imsmanifest.xml set manifest [open "${path}/imsmanifest.xml" w] +#Create resource list with one element call NONE +set resource_list [list NONE] + #Write manifest document -set information [imsld::export::uol -run_imsld_id $imsld_id] +set information [imsld::export::uol -run_imsld_id $imsld_id -resource_list $resource_list] #Write manifest file puts $manifest "" @@ -68,73 +68,71 @@ set out_file [file join ${path} ${download_name}] #Get manifest_id -db_1row get_imsld_data {select organization_id from imsld_imslds where imsld_id = :imsld_id} +db_1row get_imsld_data {select organization_id, resource_handler from imsld_imslds where imsld_id = :imsld_id} db_1row get_manifest_id {select manifest_id from imsld_cp_organizations where organization_id = cr_items.latest_revision and cr_items.item_id = :organization_id} #Store imsld_id in a variable to use it later set this_imsld $imsld_id +if {$resource_handler != "xowiki"} { + #Get files and include them in our export directory + db_multirow get_files get_files {select resource_id, href from imsld_cp_resources where manifest_id = :manifest_id} { + #Create folders if necessary to create directory tree + set inside_path "" + set position [string last "/" $href] + if {$position > 0 && [string first "http:" $href] == -1} { + set inside_path [string range $href 0 [expr $position-1]] + #file mkdir $path/$inside_path/ + } -#Get files and include them in our export directory -db_multirow get_files get_files {select resource_id, href from imsld_cp_resources where manifest_id = :manifest_id} { - #Create folders if necessary to create directory tree - set inside_path "" - set position [string last "/" $href] - if {$position > 0 && [string first "http:" $href] == -1} { - set inside_path [string range $href 0 [expr $position-1]] - #file mkdir $path/$inside_path/ + #If the resources is a link, it has no files to be copied + if {[string first "http:" $href] == -1} { + #Call proc to copy resource files to export temporal directory + imsld::export::files::copy_files -resource_id $resource_id -path $path + } } - - #If the resources is a link, it has no files to be copied - if {[string first "http:" $href] == -1} { - #Call proc to copy resource files to export temporal directory - imsld::export::files::copy_files -resource_id $resource_id -path $path - } - -} - -if {$include_all == "Yes"} { - #Save additional files of the UoL which are not used in the player - #Get imsld_id of next UoL - if {[db_0or1row get_next_imsld {select organization_id from imsld_imslds where imsld_id > :this_imsld limit 1}] == 1} { - set next_imsld $organization_id - db_multirow get_files get_files_1 {} { - #Create directories if necessary to complete the tree - set inside_path "" - set position [string last $file_name $path_to_file] - if {$position > 0} { - set inside_path ${inside_path}[string range $path_to_file 0 [expr $position-1]] - file mkdir $path/$inside_path/ + if {$include_all == "Yes"} { + #Save additional files of the UoL which are not used in the player + #Get imsld_id of next UoL + if {[db_0or1row get_next_imsld {select organization_id from imsld_imslds where imsld_id > :this_imsld limit 1}] == 1} { + set next_imsld $organization_id + db_multirow get_files get_files_1 {} { + #Create directories if necessary to complete the tree + set inside_path "" + set position [string last $file_name $path_to_file] + if {$position > 0} { + set inside_path ${inside_path}[string range $path_to_file 0 [expr $position-1]] + file mkdir $path/$inside_path/ + } + #Copy file + if {[fs_file_p [expr $imsld_file_id-1]] == 1} { + set data [fs__datasource $imsld_file_id] + set url [lindex $data [expr [lsearch $data content]+1]] + file copy -force $url "$path/${inside_path}${file_name}" + } } - #Copy file - if {[fs_file_p [expr $imsld_file_id-1]] == 1} { - set data [fs__datasource $imsld_file_id] - set url [lindex $data [expr [lsearch $data content]+1]] - file copy -force $url "$path/${inside_path}${file_name}" + } else { + #If the UoL we are going to export is the last one stored, then copy all + # files with id greater than imsld_id + db_multirow get_files get_files_2 {} { + #Create directories if necessary to complete the tree + set inside_path "" + set position [string last $file_name $path_to_file] + if {$position > 0} { + set inside_path ${inside_path}[string range $path_to_file 0 [expr $position-1]] + file mkdir $path/$inside_path/ + } + #Copy file + if {[fs_file_p [expr $imsld_file_id-1]] == 1} { + set data [fs__datasource $imsld_file_id] + set url [lindex $data [expr [lsearch $data content]+1]] + file copy -force $url "$path/${inside_path}${file_name}" + } } } - } else { - #If the UoL we are going to export is the last one stored, then copy all - # files with id greater than imsld_id - db_multirow get_files get_files_2 {} { - #Create directories if necessary to complete the tree - set inside_path "" - set position [string last $file_name $path_to_file] - if {$position > 0} { - set inside_path ${inside_path}[string range $path_to_file 0 [expr $position-1]] - file mkdir $path/$inside_path/ - } - #Copy file - if {[fs_file_p [expr $imsld_file_id-1]] == 1} { - set data [fs__datasource $imsld_file_id] - set url [lindex $data [expr [lsearch $data content]+1]] - file copy -force $url "$path/${inside_path}${file_name}" - } - } } } - #Create zip archive set cmd "zip -r '$out_file' *" set copy "cp ${path}/imsmanifest.xml ./imsmanifest.xml" Index: openacs-4/packages/imsld/www/admin/imsld-export.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-export.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-export.adp 18 Feb 2009 11:03:03 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-export.adp 17 Jun 2009 08:00:01 -0000 1.2 @@ -3,6 +3,7 @@

@heading@

@intro@@anchor_msg@

+

The resources of this UoL are stored in @resource_handler@ repository.

Index: openacs-4/packages/imsld/www/admin/imsld-export.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-export.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-export.tcl 18 Feb 2009 11:03:03 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-export.tcl 17 Jun 2009 08:00:01 -0000 1.2 @@ -29,10 +29,14 @@ set export_url "./imsld-export-2.tcl?imsld_id=$imsld_id" set anchor_msg "export" +db_1row get_file_type {select resource_handler from imsld_imslds where imsld_id = :imsld_id} +if {$resource_handler == "xowiki"} { + ad_returnredirect "./imsld-export-xo.tcl?imsld_id=$imsld_id" +} else { set get_files get_fs_files } template::list::create \ -name resource_files \ - -multirow get_resource_files \ + -multirow $get_files \ -elements { path_to_file { label "[_ imsld.export_files]" @@ -51,15 +55,23 @@ set get_files get_files_2 } + + set number_of_files 0 db_multirow -local \ - -extend {warning} \ - get_resource_files $get_files {} { + -extend {warning item_id name} \ + get_fs_files $get_files {} { if {[db_0or1row get_file_resource {select object_id_one from acs_rels, cr_items where latest_revision = :imsld_file_id and item_id = object_id_two and rel_type = 'imsld_res_files_rel' limit 1}] == 1} { set warning "OK" } else {set warning "[_ imsld.export_warning_msg1]"} } + +#Where are the resources of this UoL stored? +#First, we need the manifest_id +db_1row get_manifest {select manifest_id from imsld_cp_organizations, cr_items cr1 where organization_id = cr1.latest_revision and cr1.item_id = imsld_imslds.organization_id and imsld_imslds.imsld_id = :imsld_id} + + #Create Export button ad_form -name export_button \ -form { @@ -72,6 +84,6 @@ set include_all "Yes" } \ -on_submit { - ad_returnredirect "${export_url}&uol_name=${name}&include_all=${include_all}" + ad_returnredirect "${export_url}&uol_name=${name}&include_all=${include_all}&manifest_id=${manifest_id}" ad_script_abort } Index: openacs-4/packages/imsld/www/admin/imsld-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-new-2.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/imsld/www/admin/imsld-new-2.tcl 18 Dec 2008 19:14:10 -0000 1.11 +++ openacs-4/packages/imsld/www/admin/imsld-new-2.tcl 17 Jun 2009 08:00:01 -0000 1.12 @@ -19,7 +19,7 @@ permission::require_permission -object_id $package_id -privilege create set page_title "[_ imsld.Creating_new_IMS-LD]" -set context [list [list "[_ imsld.New_IMS-LD]" "new-imsld"] [list "[_ imsld.lt_Creaginting_new_IMS-L]"]] +set context [list [list "[_ imsld.New_IMS-LD]" "new-imsld"] [list "[_ imsld.lt_Creating_new_IMS-L]"]] set user_id [ad_conn user_id] Index: openacs-4/packages/imsld/www/admin/imsld-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-new.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/imsld/www/admin/imsld-new.tcl 18 Dec 2008 19:14:10 -0000 1.10 +++ openacs-4/packages/imsld/www/admin/imsld-new.tcl 17 Jun 2009 08:00:01 -0000 1.11 @@ -78,8 +78,8 @@ set imsld_title [imsld::parse::get_title -node $imsld -prefix imsld] set imsld_level [imsld::parse::get_attribute -node $imsld -attr_name level] set imsld_level [expr { [empty_string_p $imsld_level] ? "[_ imsld.Not_defined]" : $imsld_level }] - multirow append imsld_info "[_ imsld.IMD_LD_Title]" "$imsld_title" - multirow append imsld_info "[_ imsld.IMD_LD_Level]" "$imsld_level" + multirow append imsld_info "[_ imsld.IMS-LD_Title]" "$imsld_title" + multirow append imsld_info "[_ imsld.IMS-LD_Level]" "$imsld_level" # Components set components [$imsld child all imsld:components] Index: openacs-4/packages/imsld/www/admin/imsld-view-roles.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-view-roles.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/imsld/www/admin/imsld-view-roles.adp 17 Apr 2008 17:17:54 -0000 1.4 +++ openacs-4/packages/imsld/www/admin/imsld-view-roles.adp 17 Jun 2009 08:00:01 -0000 1.5 @@ -2,11 +2,11 @@ @page_title;noquote@ @context;noquote@ - + -
@@ -29,24 +29,25 @@

#imsld.Descendant#

- - -

#imsld.There#

+ + + +

#imsld.There#

+

#imsld.Groups#



#imsld.Back# - + Index: openacs-4/packages/imsld/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/index.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/imsld/www/admin/index.tcl 18 Feb 2009 11:03:03 -0000 1.20 +++ openacs-4/packages/imsld/www/admin/index.tcl 17 Jun 2009 08:00:01 -0000 1.21 @@ -42,7 +42,7 @@ # form to upload an IMS LD ZIP file -ad_form -name upload_file_form -html {enctype multipart/form-data} -cancel_url $return_url -action imsld-new -form { +ad_form -name upload_file_form -html {enctype multipart/form-data} -action imsld-new -form { {upload_file:file {label "[_ imsld.lt_Import_IMS-LD_ZIP_Fil]"}} {return_url:text {widget hidden} {value $return_url}} {manifest_id:integer {widget hidden} {value $manifest_id}} @@ -69,7 +69,7 @@ create_run { label {} display_template { - [_ imsld.create_new_run] + [_ imsld.create_new_run] } } export { @@ -113,13 +113,15 @@ label "[_ imsld.Run_IMS-LD_Name]" orderby_asc {imsld_title asc} orderby_desc {imsld_title desc} - display_template {@imsld_runs.imsld_title@} + link_url_eval {[export_vars -base "../imsld-divset" {run_id}]} } status { label "[_ imsld.Status]" orderby_asc {status asc} orderby_desc {status desc} - display_template {@imsld_runs.image_alt@} + display_template { + @imsld_runs.image_alt@ + } } creation_date { label "[_ imsld.Creation_Date]" @@ -135,6 +137,9 @@ [_ imsld.Manage_Members] + + Configure Services + } } delete { @@ -144,7 +149,7 @@ [_ imsld.Deleted] [_ imsld.Make_it_live] - [_ imsld.Delte] + [_ imsld.Delete] } link_html { title "[_ imsld.Delete_Run]" } } @@ -164,6 +169,7 @@ set image_title "[_ imsld.active]" set image_path "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]/resources/active.png" } + waitingservices - waiting { set image_alt "[_ imsld.waiting]" set image_title "[_ imsld.waiting]" Index: openacs-4/packages/imsld/www/admin/monitor/activity-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/activity-frame.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/imsld/www/admin/monitor/activity-frame.adp 22 Oct 2008 18:27:15 -0000 1.7 +++ openacs-4/packages/imsld/www/admin/monitor/activity-frame.adp 17 Jun 2009 08:00:01 -0000 1.8 @@ -21,6 +21,19 @@
+
+ +

Edit activity

+ +
+
+ Activity Information + +
+
+ +
+
Index: openacs-4/packages/imsld/www/admin/monitor/activity-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/activity-frame.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/imsld/www/admin/monitor/activity-frame.tcl 27 Feb 2009 11:20:01 -0000 1.15 +++ openacs-4/packages/imsld/www/admin/monitor/activity-frame.tcl 17 Jun 2009 08:00:01 -0000 1.16 @@ -21,9 +21,12 @@ {property:optional ""} {value:optional ""} {option ""} + {title ""} + {is_visible_p:boolean t} + {resource_file_id ""} } -validate { non_empty_id { - if { [string eq "" $activity_item_id] && [string eq "" $learning_object_id] && [string eq "" $service_id] } { + if { $activity_item_id eq "" && $learning_object_id eq "" && $service_id eq "" } { ad_complain "[_ imsld.lt_You_must_provide_an_a]" } } @@ -416,8 +419,6 @@ }] -set activity_item_id [content::revision::item_id -revision_id $activity_id] - if { $type eq "learning" || $type eq "support" } { ad_form \ @@ -615,11 +616,19 @@ } -if { $type eq "structure" } { +set imsld_id [content::revision::item_id \ + -revision_id [imsld::get_imsld_from_activity -activity_id $activity_id -activity_type $type]] + +content::item::get -item_id $imsld_id -array_name imsld_array +set res_options [list] +if { $imsld_array(resource_handler) eq "xowiki" } { + set res_options [imsld::xowiki::page_list] +} else { + set community_id [dotlrn_community::get_community_id] + set fs_package_id [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"] - set imsld_id [content::revision::item_id \ - -revision_id [imsld::get_imsld_from_activity -activity_id $activity_id -activity_type "structure"]] - content::item::get -item_id $imsld_id -array_name imsld_array set res_options [list] if { $imsld_array(resource_handler) eq "xowiki" } { @@ -649,19 +658,37 @@ order by ci1.tree_sortkey, ci1.name }] } +} + +set res_options [linsert $res_options 0 {{} {}}] + +if { $type eq "structure" } { ad_form \ -name new_activity \ -export {run_id activity_item_id type} \ -html { onsubmit "return submitForm(this, 'imsld_activity_tree')" } \ -form { { title:text - {label "Title"} + {label Title} } - { resource_file_id:integer(select) - {label "Resource"} + { is_visible_p:text(checkbox),optional + {options {{"" t}}} + {label "Visible"} + {value "t"} + } + { resource_file_id:integer(select),optional + {label "Description"} {options $res_options} } + { lo_file_id:integer(select),optional + {label "Learning Objectives"} + {options $res_options} + } + { pr_file_id:integer(select),optional + {label "Prerequisites"} + {options $res_options} + } } \ -on_submit { @@ -716,19 +743,26 @@ set learning_activity_id [imsld::item_revision_new -attributes [list [list identifier $identifier] \ [list component_id $component_id] \ [list activity_description_id $activity_description_id] \ - [list is_visible_p t] \ + [list is_visible_p $is_visible_p] \ ] \ -content_type imsld_learning_activity \ -title $title \ -parent_id $parent_id] # relation_add imsld_al_info_i_rel $activity_item_id $information_id - set sort_order 0 + set sort_order [db_string select_max_order { + select max(ir.sort_order)+1 + from acs_rels ar, imsld_activity_structuresi ias, + (select * from imsld_as_la_rels union select * from imsld_as_sa_rels union + select * from imsld_as_as_rels) as ir + where ar.object_id_one = ias.item_id + and ar.rel_id = ir.rel_id + and ias.structure_id = :activity_id + and content_item__get_live_revision(ar.object_id_two) is not null + }] set extra_vars [ns_set create] - oacs_util::vars_to_ns_set \ - -ns_set $extra_vars \ - -var_list { sort_order } + ns_set put $extra_vars sort_order $sort_order relation_add -extra_vars $extra_vars imsld_as_la_rel $activity_item_id $learning_activity_id @@ -768,3 +802,130 @@ # end new_activity on_submit } + +ad_form \ + -name edit_activity \ + -export {run_id activity_item_id type} \ + -html { onsubmit "return submitForm(this)" } \ + -form { + { title:text + {label Title} + } + { is_visible_p:text(checkbox),optional + {options {{"" t}}} + {label "Visible"} + {value "t"} + } + { resource_file_id:integer(select),optional + {label "Description"} + {options $res_options} + } + { lo_file_id:integer(select),optional + {label "Learning Objectives"} + {options $res_options} + } + { pr_file_id:integer(select),optional + {label "Prerequisites"} + {options $res_options} + } + } \ + -on_submit { + + set component_id [db_string select_component { + select item_id + from imsld_componentsx + where imsld_id = :imsld_id + }] + + set parent_id [content::item::get_parent_folder -item_id $activity_item_id] + + # start the activity creation + # create the activity description + set activity_description_id [imsld::item_revision_new -title $title \ + -content_type imsld_activity_desc \ + -parent_id $parent_id] + + # now create the activity description item + set item_identifier "item_${activity_description_id}" + set res_item_id [imsld::item_revision_new -title $title \ + -content_type imsld_item \ + -attributes [list [list identifier $item_identifier] \ + [list is_visible_p "t"]] \ + -parent_id $parent_id] + + + relation_add imsld_actdesc_item_rel $activity_description_id $res_item_id + + # now the resource + set resource_identifier "resource_${activity_description_id}" + set manifest_id [db_string select_manifest { + select ico.manifest_id + from imsld_cp_organizationsi ico, imsld_imsldsi ii + where ii.item_id = :imsld_id + and ico.item_id = ii.organization_id + and content_revision__is_live(ii.imsld_id) = 't' + and content_revision__is_live(ico.organization_id) = 't' + }] + set resource_item_id [imsld::cp::resource_new -manifest_id $manifest_id \ + -identifier $resource_identifier \ + -type "webcontent" \ + -parent_id $parent_id] + + set extra_vars [util_list_to_ns_set [list displayable_p "t"]] + + relation_add -extra_vars $extra_vars imsld_res_files_rel $resource_item_id $resource_file_id + relation_add imsld_item_res_rel $res_item_id $resource_item_id + + # now the learning activity + set identifier "$title-${activity_description_id}" + + set learning_activity_id [imsld::item_revision_new -attributes [list [list identifier $identifier] \ + [list component_id $component_id] \ + [list activity_description_id $activity_description_id] \ + [list is_visible_p $is_visible_p] \ + ] \ + -content_type imsld_learning_activity \ + -title $title \ + -parent_id $parent_id] + + # relation_add imsld_al_info_i_rel $activity_item_id $information_id + + set sort_order 0 + set extra_vars [ns_set create] + oacs_util::vars_to_ns_set \ + -ns_set $extra_vars \ + -var_list { sort_order } + + relation_add -extra_vars $extra_vars imsld_as_la_rel $activity_item_id $learning_activity_id + + # set involved_roles \ + # [imsld::roles::get_list_of_roles \ + # -imsld_id [db_string get_imsld_from_run \ + # {select imsld_id from imsld_runs where run_id=:run_id}] ] + + # set involved_users [list] + # foreach role $involved_roles { + # set involved_users [concat $involved_users \ + # [imsld::roles::get_users_in_role \ + # -role_id [lindex $role 0] -run_id $run_id]] + # } + + # set involved_users [list] + + # foreach user_id [lsort -unique $involved_users] { + + # set instance_id \ + # [package_exec_plsql \ + # -var_list [list [list instance_id ""] \ + # [list owner_id [content::item::get_live_revision -item_id $learning_activity_id]] \ + # [list type "isvisible"] \ + # [list identifier $identifier] \ + # [list run_id $run_id] \ + # [list user_id $user_id] \ + # [list is_visible_p "t"] \ + # [list title ""] \ + # [list with_control_p ""]] \ + # imsld_attribute_instance new] + # } + + } Index: openacs-4/packages/imsld/www/admin/monitor/environment-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/environment-frame.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/www/admin/monitor/environment-frame.adp 8 Jul 2008 15:35:47 -0000 1.5 +++ openacs-4/packages/imsld/www/admin/monitor/environment-frame.adp 17 Jun 2009 08:00:01 -0000 1.6 @@ -1,7 +1,3 @@ - - @page_title;noquote@ - @context;noquote@ - 1
@frame_header@
Index: openacs-4/packages/imsld/www/admin/monitor/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/index.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/www/admin/monitor/index.adp 20 Feb 2009 09:57:44 -0000 1.5 +++ openacs-4/packages/imsld/www/admin/monitor/index.adp 17 Jun 2009 08:00:01 -0000 1.6 @@ -1,11 +1,29 @@ - - - - - @course_name@ - - + + @course_name@ + 1 + 1 + + + + + + +
@@ -22,5 +40,3 @@
- - Index: openacs-4/packages/imsld/www/admin/monitor/monitor-tree.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/monitor-tree.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/imsld/www/admin/monitor/monitor-tree.adp 19 Feb 2009 13:05:34 -0000 1.7 +++ openacs-4/packages/imsld/www/admin/monitor/monitor-tree.adp 17 Jun 2009 08:00:01 -0000 1.8 @@ -1,15 +1,11 @@ - - @page_title;noquote@ - @context;noquote@ - 1
#imsld.Activities#
-
+
@properties_tree;noquote@ Index: openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp 29 Mar 2009 15:27:40 -0000 1.3 +++ openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp 17 Jun 2009 08:00:02 -0000 1.4 @@ -1,6 +1,3 @@ - - @page_title;noquote@ - 1
@@ -18,7 +15,7 @@ @frame_header;noquote@
-
+
Index: openacs-4/packages/imsld/www/admin/monitor/run-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/run-info.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/admin/monitor/run-info.adp 8 Jul 2008 15:35:47 -0000 1.3 +++ openacs-4/packages/imsld/www/admin/monitor/run-info.adp 17 Jun 2009 08:00:02 -0000 1.4 @@ -1,22 +1,3 @@ - - - -

#imsld.Runinfo_Name# Index: openacs-4/packages/imsld/www/doc/README.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/doc/README.txt,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/doc/README.txt 5 Jul 2005 16:13:45 -0000 1.3 +++ openacs-4/packages/imsld/www/doc/README.txt 17 Jun 2009 08:00:02 -0000 1.4 @@ -1,14 +1,16 @@ Read this before editing: -You are welcome to edit this specification, but please do it following the next steps: +You are welcome to edit this specification, but please do it following the +next steps: -1. This specification has been written in DocBook format, so edit the specification - using any xml editor you want (we use xmlmind) +1. This specification has been written in DocBook format, so edit the + specification using any xml editor you want (we use xmlmind) 2. Edit the specification version number in the imsld-spec.xml file -3. Generate the html. Note that the document has been chunked into several files, with - two hierarchy levels. Please keep this organization. We use xsltproc like this: +3. Generate the html. Note that the document has been chunked into several + files, with two hierarchy levels. Please keep this organization. We use + xsltproc like this: xsltproc -o out_dir/ --xinclude stylesheets_dir/mychunk.xsl imsld-spec.xml (you can download the stylesheets from http://sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608 Index: openacs-4/packages/imsld/www/doc/users_guide/html.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/doc/users_guide/html.css,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/doc/users_guide/html.css 26 Jul 2006 15:15:49 -0000 1.1 +++ openacs-4/packages/imsld/www/doc/users_guide/html.css 17 Jun 2009 08:00:02 -0000 1.2 @@ -1,362 +1,362 @@ - -th{ - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - font-style: normal; - height:50px; -} - -h1{ - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight: bold; - font-style: normal; - color: #000000; -} - h2, h3, h4, h5 { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight: bold; - font-style: normal; - color: #000000; -} - -span.term { - font-weight: bold; -} - -div.sidebar { - background: #F0F0F0; - border: 1px solid gray; - padding: 5px; - margin: 20px; -} - -pre.programlisting { - background: #F0F0F0; - border: 1px solid gray; - padding: 2px; - font-size: 10pt; - white-space: pre; -} - - -.Pretitulo { - - font-family: Arial, Helvetica, sans-serif; - font-size: 8pt; - color: #CC0033; - text-align: justify; - font-weight: bold; -} -.Titulo { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 18px; - font-weight: bold; - color: #000066; - text-align: center; -} -.Subtitulo { - font-family: Arial, Helvetica, sans-serif; - font-size: 10pt; - font-weight: bold; - text-align: center; - color: #000000; -} -.TitDate { - font-family: Arial, Helvetica, sans-serif; - font-size: 10px; - font-weight: bold; - color: #000066; - text-align: right; -} -.copyRight { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 9px; - color: #999999; - text-decoration: none; - text-align: center; - font-weight: normal; -} -.pieFoto { - - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 7pt; - color: #000000; - font-weight: normal; - text-align: left; -} -.textosNotaF { - - font-family: Arial, Helvetica, sans-serif; - font-size: 10pt; - color: #000066; - text-align: justify; -} -.textosLlamados { - font-family: Arial, Helvetica, sans-serif; - font-size: 11px; - color: #000066; - text-align: left; -} - -a:link { - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #001F48; - text-decoration: none; - -} -a:visited { - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #001F48; - text-decoration: none; -} -a:hover { - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #007ECC; - text-decoration: none; -} -a:active { - font-family: Verdana, Arial, Helvetica, sans-serif; - color: #001F48; - text-decoration: none; -} - -.claro { - font-family: Arial, Helvetica, sans-serif; - font-size: 9px; - color: #001F48; - background-color: #DCF2FF; - text-align: center; -} -.oscuro { - font-family: Arial, Helvetica, sans-serif; - font-size: 9px; - color: #001F48; - background-color: #D3E5FD; - text-align: center; -} -select { - font-family: Arial, Helvetica, sans-serif; - font-size: 9pt; - color: #FFFFFF; - background-color: #037ECC; - padding: 0px; - margin: 0px; - BORDER: 0px none #037ECC; - scrollbar-face-color: #DEE3E7; - scrollbar-highlight-color: #FFFFFF; - scrollbar-shadow-color: #DEE3E7; - scrollbar-3dlight-color: #D1D7DC; - scrollbar-arrow-color: #006699; - scrollbar-track-color: #EFEFEF; - scrollbar-darkshadow-color: #98AAB1; - TEXT-DECORATION: none -} - - - -.titularPrinci { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; - font-weight: bold; - color: #000066; - background-color: #EDEDED; -} - -.GenTable { - border-top: 1px #000066; - border-right: 2px solid #000066; - border-bottom: 2px solid #000066; - border-left: 1px #000066; - -} -.bgLeft { - background-color: #001F48; - border-bottom-width: 1px; - border-bottom-style: solid; - border-bottom-color: #FFFFFF; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - color: #FFFFFF; -} -.bgRight01 { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - color: #003333; - background-color: #E4E7EB; -} -.bgRight02 { - - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - color: #003333; - background-color: #F0F2F5; -} -.GenTableRed { - border-top: 1px #000066; - border-right: 2px solid #E30A17; - border-bottom: 2px solid #E30A17; - border-left: 1px #000066; -} -body { - background-color: #FFFFFF; - scrollbar-face-color: #DEE3E7; - scrollbar-highlight-color: #FFFFFF; - scrollbar-shadow-color: #DEE3E7; - scrollbar-3dlight-color: #D1D7DC; - scrollbar-arrow-color: #006699; - scrollbar-track-color: #EFEFEF; - scrollbar-darkshadow-color: #98AAB1; - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - color: #000066; -} - -.TitPrincipal { - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - color: #FFFFFF; - font-weight: bold; - clip: rect(auto auto auto auto); -} - -.subTitu { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight: bold; - font-style: normal; - color: #000000; -} -.CelCeleste { - font-family: Arial, Helvetica, sans-serif; - font-size: 10px; - font-weight: bold; - background-color: #DEE3E7; - border-top-width: thin; - border-right-width: thin; - border-bottom-width: thin; - border-left-width: thin; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-color: #FFFFFF; - border-right-color: #001F48; - border-bottom-color: #001F48; - border-left-color: #FFFFFF; - color: #000066; -} - - -.copyRight { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 9px; - color: #BACAD3; - text-decoration: none; - text-align: center; - font-weight: normal; -} -.TitSecundario2 { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; - color: #000066; - font-weight: bold; - background-color: #DBF1FF; -} -.menu { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 7pt; - color: #001F48; - text-decoration: none; - text-align: left; - font-weight: 400; - background-image: url(../images/bUp.gif); -} - -.CelCeleste { - font-family: Arial, Helvetica, sans-serif; - font-size: 10px; - font-weight: bold; - background-color: #C5E9FF; - border-top-width: thin; - border-right-width: thin; - border-bottom-width: thin; - border-left-width: thin; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-color: #FFFFFF; - border-right-color: #001F48; - border-bottom-color: #001F48; - border-left-color: #FFFFFF; - color: #000066; -} -.inputRight { - BORDER-RIGHT: thin solid #CCCCCC; - BORDER-TOP: thin solid #000000; - SCROLLBAR-FACE-COLOR: #ffffff; - FONT-SIZE: 12px; - SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; - BORDER-LEFT: thin solid #000000; - SCROLLBAR-SHADOW-COLOR: #ffffff; - COLOR: #001F48; - SCROLLBAR-3DLIGHT-COLOR: #cccccc; - SCROLLBAR-ARROW-COLOR: #758cb3; - SCROLLBAR-TRACK-COLOR: #eeeeee; - BORDER-BOTTOM: thin solid #CCCCCC; - FONT-FAMILY: arial, helvetica, verdana, sans-serif; - SCROLLBAR-DARKSHADOW-COLOR: #ffffff; - TEXT-DECORATION: none; - background-color: #FFFFFF; - left: 0px; - top: 0px; -} -.CelWhite { - font-family: Arial, Helvetica, sans-serif; - font-size: 10px; - font-weight: bold; - border-top-width: thin; - border-right-width: thin; - border-bottom-width: thin; - border-left-width: thin; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-color: #FFFFFF; - border-right-color: #001F48; - border-bottom-color: #001F48; - border-left-color: #FFFFFF; - color: #000066; - background-color: #ebebeb; - -} - -.CelCelesteBold { - font-family: Arial, Helvetica, sans-serif; - font-size: 11px; - font-weight: bold; - background-color: #C5E9FF; - border-top-width: thin; - border-right-width: thin; - border-bottom-width: thin; - border-left-width: thin; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-color: #FFFFFF; - border-right-color: #001F48; - border-bottom-color: #001F48; - border-left-color: #FFFFFF; - color: #000066; -} -table{ - background-color: #FFFFFF; - border-color: #FFFFFF; - font-size: 12px; - font-family: Verdana, Arial, Helvetica, sans-serif; -} - + +th{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + font-style: normal; + height:50px; +} + +h1{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 14px; + font-weight: bold; + font-style: normal; + color: #000000; +} + h2, h3, h4, h5 { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 14px; + font-weight: bold; + font-style: normal; + color: #000000; +} + +span.term { + font-weight: bold; +} + +div.sidebar { + background: #F0F0F0; + border: 1px solid gray; + padding: 5px; + margin: 20px; +} + +pre.programlisting { + background: #F0F0F0; + border: 1px solid gray; + padding: 2px; + font-size: 10pt; + white-space: pre; +} + + +.Pretitulo { + + font-family: Arial, Helvetica, sans-serif; + font-size: 8pt; + color: #CC0033; + text-align: justify; + font-weight: bold; +} +.Titulo { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 18px; + font-weight: bold; + color: #000066; + text-align: center; +} +.Subtitulo { + font-family: Arial, Helvetica, sans-serif; + font-size: 10pt; + font-weight: bold; + text-align: center; + color: #000000; +} +.TitDate { + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-weight: bold; + color: #000066; + text-align: right; +} +.copyRight { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + color: #999999; + text-decoration: none; + text-align: center; + font-weight: normal; +} +.pieFoto { + + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 7pt; + color: #000000; + font-weight: normal; + text-align: left; +} +.textosNotaF { + + font-family: Arial, Helvetica, sans-serif; + font-size: 10pt; + color: #000066; + text-align: justify; +} +.textosLlamados { + font-family: Arial, Helvetica, sans-serif; + font-size: 11px; + color: #000066; + text-align: left; +} + +a:link { + font-family: Verdana, Arial, Helvetica, sans-serif; + color: #001F48; + text-decoration: none; + +} +a:visited { + font-family: Verdana, Arial, Helvetica, sans-serif; + color: #001F48; + text-decoration: none; +} +a:hover { + font-family: Verdana, Arial, Helvetica, sans-serif; + color: #007ECC; + text-decoration: none; +} +a:active { + font-family: Verdana, Arial, Helvetica, sans-serif; + color: #001F48; + text-decoration: none; +} + +.claro { + font-family: Arial, Helvetica, sans-serif; + font-size: 9px; + color: #001F48; + background-color: #DCF2FF; + text-align: center; +} +.oscuro { + font-family: Arial, Helvetica, sans-serif; + font-size: 9px; + color: #001F48; + background-color: #D3E5FD; + text-align: center; +} +select { + font-family: Arial, Helvetica, sans-serif; + font-size: 9pt; + color: #FFFFFF; + background-color: #037ECC; + padding: 0px; + margin: 0px; + BORDER: 0px none #037ECC; + scrollbar-face-color: #DEE3E7; + scrollbar-highlight-color: #FFFFFF; + scrollbar-shadow-color: #DEE3E7; + scrollbar-3dlight-color: #D1D7DC; + scrollbar-arrow-color: #006699; + scrollbar-track-color: #EFEFEF; + scrollbar-darkshadow-color: #98AAB1; + TEXT-DECORATION: none +} + + + +.titularPrinci { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + font-weight: bold; + color: #000066; + background-color: #EDEDED; +} + +.GenTable { + border-top: 1px #000066; + border-right: 2px solid #000066; + border-bottom: 2px solid #000066; + border-left: 1px #000066; + +} +.bgLeft { + background-color: #001F48; + border-bottom-width: 1px; + border-bottom-style: solid; + border-bottom-color: #FFFFFF; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + color: #FFFFFF; +} +.bgRight01 { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #003333; + background-color: #E4E7EB; +} +.bgRight02 { + + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #003333; + background-color: #F0F2F5; +} +.GenTableRed { + border-top: 1px #000066; + border-right: 2px solid #E30A17; + border-bottom: 2px solid #E30A17; + border-left: 1px #000066; +} +body { + background-color: #FFFFFF; + scrollbar-face-color: #DEE3E7; + scrollbar-highlight-color: #FFFFFF; + scrollbar-shadow-color: #DEE3E7; + scrollbar-3dlight-color: #D1D7DC; + scrollbar-arrow-color: #006699; + scrollbar-track-color: #EFEFEF; + scrollbar-darkshadow-color: #98AAB1; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #000066; +} + +.TitPrincipal { + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + color: #FFFFFF; + font-weight: bold; + clip: rect(auto auto auto auto); +} + +.subTitu { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 14px; + font-weight: bold; + font-style: normal; + color: #000000; +} +.CelCeleste { + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-weight: bold; + background-color: #DEE3E7; + border-top-width: thin; + border-right-width: thin; + border-bottom-width: thin; + border-left-width: thin; + border-top-style: solid; + border-right-style: solid; + border-bottom-style: solid; + border-left-style: solid; + border-top-color: #FFFFFF; + border-right-color: #001F48; + border-bottom-color: #001F48; + border-left-color: #FFFFFF; + color: #000066; +} + + +.copyRight { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + color: #BACAD3; + text-decoration: none; + text-align: center; + font-weight: normal; +} +.TitSecundario2 { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + color: #000066; + font-weight: bold; + background-color: #DBF1FF; +} +.menu { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 7pt; + color: #001F48; + text-decoration: none; + text-align: left; + font-weight: 400; + background-image: url(../images/bUp.gif); +} + +.CelCeleste { + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-weight: bold; + background-color: #C5E9FF; + border-top-width: thin; + border-right-width: thin; + border-bottom-width: thin; + border-left-width: thin; + border-top-style: solid; + border-right-style: solid; + border-bottom-style: solid; + border-left-style: solid; + border-top-color: #FFFFFF; + border-right-color: #001F48; + border-bottom-color: #001F48; + border-left-color: #FFFFFF; + color: #000066; +} +.inputRight { + BORDER-RIGHT: thin solid #CCCCCC; + BORDER-TOP: thin solid #000000; + SCROLLBAR-FACE-COLOR: #ffffff; + FONT-SIZE: 12px; + SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; + BORDER-LEFT: thin solid #000000; + SCROLLBAR-SHADOW-COLOR: #ffffff; + COLOR: #001F48; + SCROLLBAR-3DLIGHT-COLOR: #cccccc; + SCROLLBAR-ARROW-COLOR: #758cb3; + SCROLLBAR-TRACK-COLOR: #eeeeee; + BORDER-BOTTOM: thin solid #CCCCCC; + FONT-FAMILY: arial, helvetica, verdana, sans-serif; + SCROLLBAR-DARKSHADOW-COLOR: #ffffff; + TEXT-DECORATION: none; + background-color: #FFFFFF; + left: 0px; + top: 0px; +} +.CelWhite { + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-weight: bold; + border-top-width: thin; + border-right-width: thin; + border-bottom-width: thin; + border-left-width: thin; + border-top-style: solid; + border-right-style: solid; + border-bottom-style: solid; + border-left-style: solid; + border-top-color: #FFFFFF; + border-right-color: #001F48; + border-bottom-color: #001F48; + border-left-color: #FFFFFF; + color: #000066; + background-color: #ebebeb; + +} + +.CelCelesteBold { + font-family: Arial, Helvetica, sans-serif; + font-size: 11px; + font-weight: bold; + background-color: #C5E9FF; + border-top-width: thin; + border-right-width: thin; + border-bottom-width: thin; + border-left-width: thin; + border-top-style: solid; + border-right-style: solid; + border-bottom-style: solid; + border-left-style: solid; + border-top-color: #FFFFFF; + border-right-color: #001F48; + border-bottom-color: #001F48; + border-left-color: #FFFFFF; + color: #000066; +} +table{ + background-color: #FFFFFF; + border-color: #FFFFFF; + font-size: 12px; + font-family: Verdana, Arial, Helvetica, sans-serif; +} + Index: openacs-4/packages/imsld/www/resources/example-print.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/example-print.css,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/resources/example-print.css 5 Apr 2006 18:39:58 -0000 1.1 +++ openacs-4/packages/imsld/www/resources/example-print.css 17 Jun 2009 08:00:02 -0000 1.2 @@ -1,8 +1,8 @@ -/* $Id$ */ -/* When printing, hide the tab navigation list - and don't use any other styles -*/ - -.tabbernav { - display:none; -} +/* $Id$ */ +/* When printing, hide the tab navigation list + and don't use any other styles +*/ + +.tabbernav { + display:none; +} Index: openacs-4/packages/imsld/www/resources/example.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/example.css,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/resources/example.css 5 Apr 2006 18:39:58 -0000 1.1 +++ openacs-4/packages/imsld/www/resources/example.css 17 Jun 2009 08:00:02 -0000 1.2 @@ -1,109 +1,109 @@ -/* $Id$ */ - -/*-------------------------------------------------- - REQUIRED to hide the non-active tab content. - But do not hide them in the print stylesheet! - --------------------------------------------------*/ -.tabberlive .tabbertabhide { - display:none; -} - -/*-------------------------------------------------- - .tabber = before the tabber interface is set up - .tabberlive = after the tabber interface is set up - --------------------------------------------------*/ -.tabber { -} -.tabberlive { - margin-top:1em; -} - -/*-------------------------------------------------- - ul.tabbernav = the tab navigation list - li.tabberactive = the active tab - --------------------------------------------------*/ -ul.tabbernav -{ - margin:0; - padding: 3px 0; - border-bottom: 1px solid #778; - font: bold 12px Verdana, sans-serif; -} - -ul.tabbernav li -{ - list-style: none; - margin: 0; - display: inline; -} - -ul.tabbernav li a -{ - padding: 3px 0.5em; - margin-left: 3px; - border: 1px solid #778; - border-bottom: none; - background: #DDE; - text-decoration: none; -} - -ul.tabbernav li a:link { color: #448; } -ul.tabbernav li a:visited { color: #667; } - -ul.tabbernav li a:hover -{ - color: #000; - background: #AAE; - border-color: #227; -} - -ul.tabbernav li.tabberactive a -{ - background-color: #fff; - border-bottom: 1px solid #fff; -} - -ul.tabbernav li.tabberactive a:hover -{ - color: #000; - background: white; - border-bottom: 1px solid white; -} - -/*-------------------------------------------------- - .tabbertab = the tab content - Add style only after the tabber interface is set up (.tabberlive) - --------------------------------------------------*/ -.tabberlive .tabbertab { - padding:5px; - border:1px solid #aaa; - border-top:0; - - /* If you don't want the tab size changing whenever a tab is changed - you can set a fixed height */ - - /* height:200px; */ - - /* If you set a fix height set overflow to auto and you will get a - scrollbar when necessary */ - - /* overflow:auto; */ -} - -/* If desired, hide the heading since a heading is provided by the tab */ -.tabberlive .tabbertab h2 { - display:none; -} -.tabberlive .tabbertab h3 { - display:none; -} - -/* Example of using an ID to set different styles for the tabs on the page */ -.tabberlive#tab1 { -} -.tabberlive#tab2 { -} -.tabberlive#tab2 .tabbertab { - height:200px; - overflow:auto; -} +/* $Id$ */ + +/*-------------------------------------------------- + REQUIRED to hide the non-active tab content. + But do not hide them in the print stylesheet! + --------------------------------------------------*/ +.tabberlive .tabbertabhide { + display:none; +} + +/*-------------------------------------------------- + .tabber = before the tabber interface is set up + .tabberlive = after the tabber interface is set up + --------------------------------------------------*/ +.tabber { +} +.tabberlive { + margin-top:1em; +} + +/*-------------------------------------------------- + ul.tabbernav = the tab navigation list + li.tabberactive = the active tab + --------------------------------------------------*/ +ul.tabbernav +{ + margin:0; + padding: 3px 0; + border-bottom: 1px solid #778; + font: bold 12px Verdana, sans-serif; +} + +ul.tabbernav li +{ + list-style: none; + margin: 0; + display: inline; +} + +ul.tabbernav li a +{ + padding: 3px 0.5em; + margin-left: 3px; + border: 1px solid #778; + border-bottom: none; + background: #DDE; + text-decoration: none; +} + +ul.tabbernav li a:link { color: #448; } +ul.tabbernav li a:visited { color: #667; } + +ul.tabbernav li a:hover +{ + color: #000; + background: #AAE; + border-color: #227; +} + +ul.tabbernav li.tabberactive a +{ + background-color: #fff; + border-bottom: 1px solid #fff; +} + +ul.tabbernav li.tabberactive a:hover +{ + color: #000; + background: white; + border-bottom: 1px solid white; +} + +/*-------------------------------------------------- + .tabbertab = the tab content + Add style only after the tabber interface is set up (.tabberlive) + --------------------------------------------------*/ +.tabberlive .tabbertab { + padding:5px; + border:1px solid #aaa; + border-top:0; + + /* If you don't want the tab size changing whenever a tab is changed + you can set a fixed height */ + + /* height:200px; */ + + /* If you set a fix height set overflow to auto and you will get a + scrollbar when necessary */ + + /* overflow:auto; */ +} + +/* If desired, hide the heading since a heading is provided by the tab */ +.tabberlive .tabbertab h2 { + display:none; +} +.tabberlive .tabbertab h3 { + display:none; +} + +/* Example of using an ID to set different styles for the tabs on the page */ +.tabberlive#tab1 { +} +.tabberlive#tab2 { +} +.tabberlive#tab2 .tabbertab { + height:200px; + overflow:auto; +} Index: openacs-4/packages/imsld/www/resources/imsld.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.css,v diff -u -r1.6 -r1.7 --- openacs-4/packages/imsld/www/resources/imsld.css 26 Feb 2009 12:09:21 -0000 1.6 +++ openacs-4/packages/imsld/www/resources/imsld.css 17 Jun 2009 08:00:02 -0000 1.7 @@ -72,15 +72,18 @@ } .hide { - position:absolute; + position:relative; top:0px; left:0px; display:none; + float:left; } .show { position:relative; top:0px; left:0px; + display:block; + float:left; } .centered-table table { Index: openacs-4/packages/imsld/www/resources/imsld.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.js,v diff -u -r1.10 -r1.11 --- openacs-4/packages/imsld/www/resources/imsld.js 25 Mar 2009 19:39:07 -0000 1.10 +++ openacs-4/packages/imsld/www/resources/imsld.js 17 Jun 2009 08:00:02 -0000 1.11 @@ -14,18 +14,18 @@ var body = bodies[0]; if (document.documentElement && document.documentElement.currentStyle && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) { - o.width = document.documentElement.clientWidth + 2*parseInt(document.documentElement.currentStyle.borderWidth,10) - o.style.left; - o.height = document.documentElement.clientHeight + 2*parseInt(document.documentElement.currentStyle.borderWidth,10) - o.style.top; + o.width = document.documentElement.clientWidth - 6; + o.height = document.documentElement.clientHeight - 6; } else if (document.all && document.body && typeof document.body.clientWidth != "undefined") { - o.width = document.body.clientWidth + 2*parseInt(document.body.currentStyle.borderWidth,10) - o.style.left; - o.height = document.body.clientHeight + 2*parseInt(document.body.currentStyle.borderWidth,10) - o.style.top; + o.width = document.body.clientWidth - 6; + o.height = document.body.clientHeight - 6; } else if (window.innerWidth) { - o.width = window.innerWidth - o.style.left - 30; - o.height = window.innerHeight - o.style.top - 50; + o.width = window.innerWidth - 30; + o.height = window.innerHeight - 50; } else if (document.body && typeof document.body.clientWidth != "undefined") { @@ -244,14 +244,11 @@ ac.className=ai; ab.className=aj; - ac.style.float = 'left'; - ab.style.float = 'left'; - return false; } function submitForm(form, contentDiv) { - var objXmlHttp=null + var objXmlHttp=null; try { objXmlHttp = new XMLHttpRequest(); } catch(e) { @@ -275,7 +272,11 @@ e.style.display = "none"; } if (contentDiv == "imsld_activity_tree" || contentDiv == "imsld_environment") { - delete window.treeClass; + try { + delete window.treeClass; + } catch(e) { + window.treeClass = undefined; + } convertTrees(); } } @@ -292,24 +293,32 @@ url = url.replace(/\/$/, ''); } } - objXmlHttp.open(method,url,true); - var enctype = (form.enctype == "application/x-www-form-urlencoded") ? "POST" : form.enctype; - objXmlHttp.setRequestHeader('Content-Type', enctype); - var list = new Array(); for (var i=0; i