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.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 {