xotcl.wu-wien.ac.at
Begin main content
Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]

::xotcl::Class[i] ::xowiki::FileForm

Class Hierarchy of ::xowiki::FileForm

  • ::xotcl::Object[i]
    Meta-class:
    ::xotcl::Class[i]
    Methods for instances:
    __api_make_doc, __api_make_forward_doc, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, check, classC, cleanupC, configureC, containsC, copyC, db_0or1rowC, db_1rowC, debug, defaultmethodC, destroyC, destroy_on_cleanup, ds, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearch, forward, hasclass, incrC, infoC, init, instvarC, invarC, isclass, ismetaclass, ismixin, isobject, istype, lappendC, log, method, mixinC, mixinguardC, moveC, msg, noinitC, objectparameter, parametercmdC, proc, procsearch, qn, requireNamespaceC, residualargsC, self, serialize, setC, set_instance_vars_defaults, show-object, substC, traceC, unknown, unsetC, uplevelC, upvarC, volatileC, vwait
    Methods to be applied on the class (in addition to the methods provided by the meta-class):
    getExitHandler, setExitHandler, unsetExitHandler
    • ::Generic::Form[i]
      Meta-class:
      ::xotcl::Class[i]
      Parameter for instances:
      action (default "[::xo::cc url]"), add_page_title, data, edit_page_title, fields, folder_id (default "-100"), html (default ""), name (default "[namespace tail [self]]"), submit_link (default "."), validate (default ""), with_categories (default "false")
      Methods for instances:
      after_submit, edit_data, edit_request, form_vars, generate, init, new_data, new_request, on_submit, on_validation_error, request, set_form_data
      Methods to be applied on the class:
      Methods provided by the meta-class
      • ::xowiki::WikiForm[i]
        Meta-class:
        ::xotcl::Class[i]
        Parameter for instances:
        autoname (default "0"), f.creator (default "="), f.description (default "="), f.item_id (default "item_id:key"), f.name (default "="), f.nls_language (default "="), f.page_order (default "="), f.text (default "= richtext,editor=xinha"), f.title (default "="), field_list (default "item_id name page_order title creator text description nls_language"), folderspec (default ""), submit_link (default "view"), validate (default " {name {\[::xowiki::validate_name\]} {Another item with this name exists already in this folder}} {page_order {\[::xowiki::validate_form_field page_order\]} {Page Order invalid; might only contain upper and lower case letters, underscore, digits and dots}} "), with_categories (default "true")
        Methods for instances:
        after_submit, data_from_form, edit_data, edit_request, mkFields, new_data, new_request, tidy, update_references
        Methods to be applied on the class:
        Methods provided by the meta-class
        • ::xowiki::FileForm[i]
          Meta-class:
          ::xotcl::Class[i]
          Parameter for instances:
          f.name (default "= optional,help_text=Can be obtained from the name of the uploaded file"), f.text (default "upload_file:file(file) {label 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 lower case letters, underscore, digits and dots}} {name {\[::xowiki::validate_name\]} {Another item with this name exists already in this folder}} ")
          Methods for instances:
          edit_data, get_uploaded_file, new_data, tidy
          Methods to be applied on the class:
          Methods provided by the meta-class

Class Relations

  • superclass: ::xowiki::WikiForm[i]
  • subclass: ::xowiki::PodcastForm[i]
::xotcl::Class create ::xowiki::FileForm \
     -superclass ::xowiki::WikiForm \
     -parameter {{f.name  "= optional,help_text=Can be obtained from the name of the uploaded file"} {f.text
          {upload_file:file(file) 
            {label Content}
            {html {size 30}} }} {f.title "= optional"} {field_list \
       {item_id name page_order text title creator description}} {html \
       { enctype multipart/form-data }} {validate {
          {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 lower case letters, underscore, digits and \
       dots}}
          {name {\[::xowiki::validate_name\]} \
       {Another item with this name exists  already in this folder}}
          }}}

Methods

  • instproc edit_data

    ::248205 instproc edit_data {} {
        #my get_uploaded_file
        return [next]
      }
    
  • instproc get_uploaded_file

    ::248205 instproc get_uploaded_file {} {
        my instvar data
        #my log "--F... [ns_conn url] [ns_conn query] form vars = [ns_set array [ns_getform]]"
        set upload_file [$data form_parameter upload_file]
        # my 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::db_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]
            #my 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 ""} {
          # my log "--F no upload_file provided [lsort [$data info vars]]"
          if {[$data exists mime_type]} {
            my log "--mime_type=[$data set mime_type]"
            #my 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]
            # my log "--F upload_file $upload_file  import_file [$data full_file_name]"
            #my log "   import_type=[$data set import_file]"
          } 
        } else {
          # my log "--F no name and no upload file"
          $data set upload_file ""
        }
      }
    
  • instproc new_data

    ::248205 instproc new_data {} {
        #my get_uploaded_file
        return [next]
      }
    
  • instproc tidy

    ::248205 instproc tidy {} {
        # nothing
      }
    

Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]