%3 ::xowiki::PlainWikiForm ::xowiki::PlainWikiForm tidy ::xowiki::WikiForm ::xowiki::WikiForm after_submit data_from_form edit_data edit_request mkFields new_data new_request on_submit tidy update_references ::xowiki::PlainWikiForm->::xowiki::WikiForm ::xowiki::PageInstanceEditForm ::xowiki::PageInstanceEditForm edit_data edit_request init new_data tidy ::xowiki::PageInstanceEditForm->::xowiki::WikiForm ::xowiki::PageTemplateForm ::xowiki::PageTemplateForm ::xowiki::PageTemplateForm->::xowiki::WikiForm ::xowiki::PageInstanceForm ::xowiki::PageInstanceForm edit_data new_data set_submit_link_edit tidy ::xowiki::PageInstanceForm->::xowiki::WikiForm ::xowiki::FileForm ::xowiki::FileForm edit_data get_uploaded_file new_data tidy ::xowiki::FileForm->::xowiki::WikiForm ::Generic::Form ::Generic::Form ::xowiki::WikiForm->::Generic::Form ::xowiki::PodcastForm ::xowiki::PodcastForm edit_data edit_request new_data new_request to_timeinfo to_timestamp ::xowiki::PodcastForm->::xowiki::FileForm

Class ::xowiki::FileForm

::xowiki::FileForm[i] create ... \
           [ -f.name (default "= optional,help_text=#xowiki.File-name-help_text#") ] \
           [ -f.text (default "upload_file:file(file),optional {label #xowiki.content#} {html {size 30}} ") ] \
           [ -f.title (default "= optional") ] \
           [ -field_list (default "item_id name page_order text title creator description") ] \
           [ -html (default " enctype multipart/form-data ") ] \
           [ -validate (default " {upload_file {\[::xowiki::validate_file\]} {For new entries, a upload file must be provided}} {page_order {\[::xowiki::validate_form_field page_order\]} {Page Order invalid; might only contain upper and lowercase letters, underscore, digits and dots}} {name {\[::xowiki::validate_name\]} {Another item with this name exists already in this folder}} ") ]

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xowiki::WikiForm[i]
  • subclass: ::xowiki::PodcastForm[i]
::xotcl::Class create ::xowiki::FileForm \
     -superclass ::xowiki::WikiForm

Methods (to be applied on instances)

  • edit_data (scripted)

    #:get_uploaded_file
    return [next]
  • f.name (setter)

  • f.text (setter)

  • f.title (setter)

  • field_list (setter)

  • get_uploaded_file (scripted)

    #:log "--F... [ns_conn url] [ns_conn query] form vars = [ns_set array [ns_getform]]"
    set upload_file [${:data} form_parameter upload_file]
    # :log "--F... upload_file = $upload_file"
    if {$upload_file ne "" && $upload_file ne "{}"} {
      ${:data} set upload_file $upload_file
      ${:data} set import_file [${:data} form_parameter upload_file.tmpfile]
      set mime_type [${:data} form_parameter upload_file.content-type]
      if {[::xo::dc 0or1row check_mimetype {
        select 1 from cr_mime_types where mime_type = :mime_type
      }] == 0
          || $mime_type eq "application/octet-stream"
          || $mime_type eq "application/force-download"} {
        set guessed_mime_type [::xowiki::guesstype $upload_file]
        #:msg guess=$guessed_mime_type
        if {$guessed_mime_type ne "*/*"} {
          set mime_type $guessed_mime_type
        }
      }
      ${:data} set mime_type $mime_type
    } elseif {[${:data} name] ne ""} {
      # :log "--F no upload_file provided [lsort [${:data} info vars]]"
      if {[${:data} exists mime_type]} {
        :log "--mime_type=[${:data} set mime_type]"
        #:log "   text=[${:data} set text]"
        regexp {^[^:]+:(.*)$} [${:data} set name] _ upload_file
        ${:data} set upload_file $upload_file
        ${:data} set import_file [${:data} full_file_name]
        # :log "--F upload_file $upload_file  import_file [${:data} full_file_name]"
        #:log "   import_type=[${:data} set import_file]"
      }
    } else {
      # :log "--F no name and no upload file"
      ${:data} set upload_file ""
    }
  • html (setter)

  • new_data (scripted)

    #:get_uploaded_file
    return [next]
  • tidy (scripted)

    # nothing
  • validate (setter)