- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::formfield::import_archive
::xowiki::formfield::import_archive create ... \
[ -cleanup (default "false") ]
Class Relations
::xotcl::Class create ::xowiki::formfield::import_archive \ -superclass ::xowiki::formfield::fileMethods (to be applied on instances)
cleanup (setter)
initialize (scripted)
next if {${:help_text} eq ""} { set :help_text "#xowiki.formfield-import_archive-help_text#" }pretty_value (scripted)
set package_id [${:object} package_id] set parent_id [${:object} parent_id] if {$v eq ""} {return ""} set entry_info [:entry_info] set fn [:get_from_value $v name $v] # # Get the file object of the imported file to obtain is full name and path # set file_id [::$package_id lookup -parent_id [${:object} item_id] -name [dict get $entry_info name]] ::xo::db::CrClass get_instance_from_db -item_id $file_id set full_file_name [::$file_id full_file_name] # # Call the archiver to unpack and handle the archive # set f [::xowiki::ArchiveFile new -file $full_file_name -name $fn -parent_id $parent_id] if {[$f unpack]} { # # So, all the hard work is done. We take a hard measure here to # cleanup the entry in case everything was imported # successful. Note that setting "cleanup" without thought might # lead to maybe unexpected deletions of the form-page # if {[:cleanup]} { set return_url [::$package_id query_parameter return_url:localurl [::$parent_id pretty_link]] ::$package_id returnredirect [${:object} pretty_link -query [export_vars {{m delete} return_url}]] } }
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables