%3 ::xowiki::formfield::import_archive ::xowiki::formfield::import_archive initialize pretty_value ::xowiki::formfield::file ::xowiki::formfield::file check=virus content-type convert_to_internal entry_info get_from_value get_old_value initialize label_or_value no_value_provided pretty_value render_input reset_on_validation_error store_file tmpfile value ::xowiki::formfield::import_archive->::xowiki::formfield::file ::xowiki::formfield::image ::xowiki::formfield::image pretty_value ::xowiki::formfield::image->::xowiki::formfield::file ::xowiki::formfield::FormField ::xowiki::formfield::FormField → fc_decode → fc_encode → get_from_name → get_single_spec → interprete_condition CSSclass_list_add add_statistics answer_check=AND answer_check=answer_words answer_check=btwn answer_check=contains answer_check=contains-not answer_check=eq answer_check=ge answer_check=gt answer_check=in answer_check=le answer_check=lt answer_check=match answer_is_correct asWidgetSpec behavior booleanAttributes config_from_spec convert_to_external convert_to_internal describe dict_to_fc dict_to_spec dict_value escape_message_keys field_value handle_transmit_always has_instance_variable init initialize interprete_single_spec is_disabled is_repeat_template_p leaf_components localize make_correct pretty_image pretty_value process_correct_when_modifier remove_omit render render_answer_statistics render_collapsed render_disabled_as_div render_error_msg render_form_widget render_help_text render_input render_item render_localizer render_modal render_result_statistics render_word_statistics repeat repeat_add_label resetBooleanAttributes reset_on_validation_error reset_parameter same_value set_disabled set_feedback set_is_repeat_template stats_record_count validate validation_check value_if_nothing_is_returned_from_form word_statistics ::xowiki::formfield::file->::xowiki::formfield::FormField ::xo::tdom::Object ::xo::tdom::Object ::xowiki::formfield::FormField->::xo::tdom::Object

Class ::xowiki::formfield::import_archive

::xowiki::formfield::import_archive[i] create ... \
           [ -cleanup (default "false") ]

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xowiki::formfield::file[i]
::xotcl::Class create ::xowiki::formfield::import_archive \
     -superclass ::xowiki::formfield::file

Methods (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}]]
      }
    }