Index: openacs-4/packages/xowiki/tcl/import-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/import-procs.tcl,v diff -u -r1.27.2.4 -r1.27.2.5 --- openacs-4/packages/xowiki/tcl/import-procs.tcl 13 Mar 2014 13:00:01 -0000 1.27.2.4 +++ openacs-4/packages/xowiki/tcl/import-procs.tcl 13 Mar 2014 17:28:16 -0000 1.27.2.5 @@ -321,10 +321,10 @@ return [array names items] } - exporter proc marshall_all {item_ids} { + exporter proc marshall_all {{-mode export} item_ids} { set content "" foreach item_id $item_ids { - if {[catch {set obj [$item_id marshall]} errorMsg]} { + if {[catch {set obj [$item_id marshall -mode $mode]} errorMsg]} { ns_log error "Error while exporting $item_id [$item_id name]\n$errorMsg\n$::errorInfo" error $errorMsg } else { Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.472.2.9 -r1.472.2.10 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 13 Mar 2014 13:00:02 -0000 1.472.2.9 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 13 Mar 2014 17:28:16 -0000 1.472.2.10 @@ -291,7 +291,7 @@ # # Page marshall/demarshall # - Page instproc marshall {} { + Page instproc marshall {{-mode export}} { my instvar name my unset_temporary_instance_variables set old_creation_user [my creation_user] @@ -321,9 +321,13 @@ return $content } - File instproc marshall {} { + File instproc marshall {{-mode export}} { set fn [my full_file_name] - my set __file_content [::base64::encode [::xowiki::read_file $fn]] + if {$mode eq "export"} { + my set __file_content [::base64::encode [::xowiki::read_file $fn]] + } else { + my set __file_name $fn + } next } @@ -427,7 +431,7 @@ } - Form instproc marshall {} { + Form instproc marshall {{-mode export}} { #set form_fields [my create_form_fields_from_form_constraints \ # [my get_form_constraints]] #my log "--ff=$form_fields" @@ -461,7 +465,7 @@ } } - FormPage instproc marshall {} { + FormPage instproc marshall {{-mode export}} { # # Handle mapping from IDs to symbolic representations in # form-field values. We perform the mapping on xowiki::FormPages @@ -633,11 +637,20 @@ File instproc demarshall {args} { next # we have to care about recoding the file content - my instvar import_file __file_content - set import_file [ns_tmpnam] - ::xowiki::write_file $import_file [::base64::decode $__file_content] - catch {my unset full_file_name} - unset __file_content + + if {[my exists __file_content]} { + my instvar import_file __file_content + set import_file [ns_tmpnam] + ::xowiki::write_file $import_file [::base64::decode $__file_content] + catch {my unset full_file_name} + unset __file_content + } elseif {[my exists __file_name]} { + my instvar import_file __file_name + set import_file $__file_name + unset __file_name + } else { + error "either __file_content or __file_name must be set" + } } # set default values. Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.320.2.11 -r1.320.2.12 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 13 Mar 2014 13:00:02 -0000 1.320.2.11 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 13 Mar 2014 17:28:17 -0000 1.320.2.12 @@ -76,7 +76,7 @@ my instvar package_id set clipboard [::xowiki::clipboard get] set item_ids [::xowiki::exporter include_needed_objects $clipboard] - set content [::xowiki::exporter marshall_all $item_ids] + set content [::xowiki::exporter marshall_all -mode copy $item_ids] if {[catch {namespace eval ::xo::import $content} error]} { my msg "Error: $error\n$::errorInfo" return