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 -N -r1.8 -r1.9 --- openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl 17 Jun 2009 08:00:01 -0000 1.8 +++ openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl 1 Jul 2009 11:05:40 -0000 1.9 @@ -252,6 +252,7 @@ ad_proc -public imsld::fs::traverse_zip { -dir:required -pattern:required + -manifest_identifier:required {-resource_handler "file-storage"} } { Function to recursively traverse the files in a ZIP to then detect those @@ -276,14 +277,15 @@ imsld::xowiki::file_new \ -path_to_file $fname \ -type file \ - -complete_path "[ns_urldecode ${dir}/${fname}]" + -complete_path "[ns_urldecode ${dir}/${fname}]" \ + -manifest_identifier $manifest_identifier } } } # Recur over the directories foreach subd [glob -tail -nocomplain -types d -directory $dir $pattern] { - imsld::fs::traverse_zip -dir $dir -pattern "$subd/*" -resource_handler $resource_handler + imsld::fs::traverse_zip -dir $dir -pattern "$subd/*" -resource_handler $resource_handler -manifest_identifier $manifest_identifier } } Index: openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl,v diff -u -N -r1.76 -r1.77 --- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 17 Jun 2009 08:00:01 -0000 1.76 +++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 1 Jul 2009 11:05:40 -0000 1.77 @@ -749,7 +749,8 @@ -path_to_file $filex_href \ -file_name "${manifest_identifier}/${filex_href}" \ -type file \ - -complete_path "[ns_urldecode ${tmp_dir}/${filex_href}]"] + -complete_path "[ns_urldecode ${tmp_dir}/${filex_href}]" \ + -manifest_identifier $manifest_identifier] } else { set filex_id [imsld::fs::file_new -href $filex_href \ -path_to_file $filex_href \ @@ -4847,7 +4848,9 @@ # 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 "*" -resource_handler $resource_handler + imsld::fs::traverse_zip -dir $tmp_dir -pattern "*" \ + -resource_handler $resource_handler \ + -manifest_identifier $manifest_identifier if { ![empty_string_p $warnings] } { set warnings "[_ imsld.lt_br__Warnings_ul_warni]" 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 -N -r1.4 -r1.5 --- openacs-4/packages/imsld/tcl/imsld-xowiki-procs.tcl 17 Jun 2009 08:00:01 -0000 1.4 +++ openacs-4/packages/imsld/tcl/imsld-xowiki-procs.tcl 1 Jul 2009 11:05:40 -0000 1.5 @@ -28,6 +28,7 @@ {-creation_date ""} -edit:boolean -complete_path + -manifest_identifier } { @author Derick Leony (derick@inv.it.uc3m.es) @@ -83,6 +84,7 @@ set content [read $file] close $file + set content [imsld::xowiki::convert_syntax -content $content -manifest_identifier $manifest_identifier] regexp {(.*?)} $content match content set page [$package_id resolve_page $file_name method] @@ -94,13 +96,11 @@ -package_id $package_id \ -parent_id [$package_id folder_id] \ -destroy_on_cleanup \ - -text $content] - $page set_content [string trim [$page text] " \n"] + -text [list $content $mime_type]] $page initialize_loaded_object $page save_new } else { - $page set text $content - $page set_content [string trim [$page text] " \n"] + $page set text [list $content $mime_type] $page save } } else { @@ -136,6 +136,100 @@ } +ad_proc -public imsld::xowiki::convert_syntax { + -content:required + -manifest_identifier:required +} { + Gets a text and returns its convertion to XoWiki Syntax + + @author Derick Leony (derick@inv.it.uc3m.es) + @creation-date 2009-06-15 + + @param content + + @return + + @error +} { + + # Here we assume that resources (URLs referenced by the SRC + # attribute) will be a file in XoWiki, while links (URLs + # referenced by the ALT attribute. + + # small hack to avoid tDOM to escape the LD tags :( + regsub {