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]

::xo::db::CrClass[i] ::xowiki::Form

Class Hierarchy of ::xowiki::Form

  • ::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, dot_append_method, dotclass, dotcode, dotquote, dotquotel, 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
    • ::xo::db::Object[i]
      Meta-class:
      ::xo::db::Class[i]
      Methods for instances:
      db_1row, delete, initialize_loaded_object, insert, object_idC, object_titleC, save, save_new
      Methods to be applied on the class:
      Methods provided by the meta-class
      • ::xo::db::CrItem[i]
        Meta-class:
        ::xo::db::CrClass[i]
        Parameter for instances:
        package_id, parent_id (default "-100"), publish_status (default "ready")
        Methods for instances:
        current_user_id, delete, descriptionC, fix_content, initialize_loaded_object, item_idC, mime_typeC, nameC, nls_languageC, privilege=creator, publish_dateC, rename, revision_idC, revisions, save, save_new, set_live_revision, textC, titleC, update_attribute_from_slot, update_content, update_revision
        Methods to be applied on the class:
        Methods provided by the meta-class
        • ::xowiki::Page[i]
          Meta-class:
          ::xo::db::CrClass[i]
          Parameter for instances:
          absolute_links (default "0"), do_substitutions (default "1"), render_adp (default "1")
          Methods for instances:
          adp_subst, anchor, build_instance_attribute_map, build_name, category_export, category_import, check_adp_include_path, clipboard-add, clipboard-clear, clipboard-content, clipboard-copy, clipboard-export, condition=match, condition=regexp, copy_content_vars, create-new, create-or-use, create_form_field, create_form_fields, create_form_fields_from_form_constraints, create_form_page_instance, create_link, create_raw_form_field, creation_userC, creatorC, css_class_name, csv-dump, default_instance_attributes, delete, delete-revision, demarshall, descriptionC, detail_link, diff, div, edit, edit_set_default_values, edit_set_file_selector_folder, error_during_render, error_in_includelet, exists_form_parameterC, exists_query_parameterC, field_names, find_slot, footer, form_field_index, form_parameterC, get_anchor_and_query, get_content, get_description, get_folder, get_form_data, get_html_from_content, get_instance_attributes, get_nls_language_from_lang, get_property_from_link_page, get_rich_text_spec, get_target_from_link_page, htmlFooter, include, include_content, initialize_loaded_object, instantiate_includelet, is_folder_page, is_form, is_link_page, is_new_entry, item_refC, lang, last_modifiedC, list, lookup_cached_form_field, lookup_form_field, make-live-revision, map_categories, map_party, marshall, mime_typeC, mutual_overwrite_occurred, nameC, new_link, nls_languageC, normalize_internal_link_name, page_idC, page_orderC, physical_package_id, physical_parent_id, popular-tags, pretty_link, pretty_name, publish_dateC, query_parameterC, record_last_visited, references_update, regsub_eval, render, render_content, render_icon, render_includelet, reset_resolve_context, resolve_included_page_name, reverse_map_party, reverse_map_party_attribute, revisions, save, save-attributes, save-tags, save_data, save_new, search_render, set_content, set_resolve_context, show_fields, substitute_markup, textC, titleC, translate, unescape, unset_temporary_instance_variables, validate-attribute, validate=form_constraints, validate=name, validate=page_order, view
          Methods to be applied on the class (in addition to the methods provided by the meta-class):
          container_already_rendered, find_slot, get_tags, import, quoted_html_content, save_tags
          • ::xowiki::PageTemplate[i]
            Meta-class:
            ::xo::db::CrClass[i]
            Parameter for instances:
            render_adp (default "0")
            Methods for instances:
            anon_instancesC, count_usages, delete, mime_typeC, page_template_idC
            Methods to be applied on the class (in addition to the methods provided by the meta-class):
            count_usages
            • ::xowiki::Form[i]
              Meta-class:
              ::xo::db::CrClass[i]
              Methods for instances:
              demarshall, footer, formC, form_constraintsC, get_form_constraints, is_form, marshall, mime_typeC, render_content, xowiki_form_idC
              Methods to be applied on the class (in addition to the methods provided by the meta-class):
              add_dom_attribute_value, disable_input_fields, dom_disable_input_fields, requireFormCSS

Class Relations

  • superclass: ::xowiki::PageTemplate[i]
::xo::db::CrClass create ::xowiki::Form \
     -superclass ::xowiki::PageTemplate

Methods

  • proc add_dom_attribute_value

    ::267021 proc add_dom_attribute_value {dom_node attr value} {
        if {[$dom_node hasAttribute $attr]} {
          set old_value [$dom_node getAttribute $attr]
          if {$value ni $old_value} {
            append value " " $old_value
          } else {
            set value $old_value
          }
        }
        $dom_node setAttribute $attr $value
      }
    
  • proc disable_input_fields

    ::267021 proc disable_input_fields {{-with_submit 0} form} {
        dom parse -simple -html $form doc
        $doc documentElement root
        my dom_disable_input_fields -with_submit $with_submit $root
        set form [lindex [$root selectNodes //form] 0]
        Form add_dom_attribute_value $form class "margin-form"
        return [$root asHTML]
      }
    
  • proc dom_disable_input_fields

    ::267021 proc dom_disable_input_fields {{-with_submit 0} root} {
        set fields [$root selectNodes "//button | //input | //optgroup | //option | //select | //textarea "]
        set disabled [list]
        foreach field $fields {
          set type ""
          if {[$field hasAttribute type]} {set type [$field getAttribute type]}
          if {$type eq "submit" && !$with_submit} continue
          # Disabled fields are not transmitted from the form;
          # some applications expect hidden fields to be transmitted
          # to identify the context, so don't disable it...
          if {$type eq "hidden"} continue
          $field setAttribute disabled "disabled"
          if {[$field hasAttribute name]} {
            lappend disabled [$field getAttribute name]
          }
        }
    
        #set fa [$root selectNodes {//input[@name='__form_action']}]
        #if {$fa ne ""} {
        #  $fa setAttribute value "view-form-data"
        #}
        return $disabled
      }
    
  • proc requireFormCSS

    ::267021 proc requireFormCSS {} {
        #my msg requireFormCSS
        set css [my set extraCSS]
        if {$css ne ""} {
          ::xo::Page requireCSS $css
        }
      }
    
  • instproc demarshall

    ::267021 instproc demarshall args {
        # Some older versions do not have anon_instances and no slots
        if {![my exists anon_instances]} {
          my set anon_instances "t"
        }
        next
      }
    
  • instproc footer

    ::267021 instproc footer {} {
        return [my include [list form-menu -form_item_id [my item_id]]]
      }
    
  • instproc get_form_constraints

    ::267021 instproc get_form_constraints args {
        # We define it as a method to ease overloading.
        return [my form_constraints]
      }
    
  • instproc is_form

    ::267021 instproc is_form {} {
        return 1
      }
    
  • instproc marshall

    ::267021 instproc marshall {} {
        #set form_fields [my create_form_fields_from_form_constraints  #                     [my get_form_constraints]]
        #my log "--ff=$form_fields"
        #my build_instance_attribute_map $form_fields
        next
      }
    
  • instproc render_content

    ::267021 instproc render_content {} {
        my instvar text form
        ::xowiki::Form requireFormCSS
    
        # we assume, that the richtext is stored as 2-elem list with mime-type
        #my log "-- text='$text'"
        if {[lindex $text 0] ne ""} {
          my do_substitutions 0
          set html ""; set mime ""
          foreach {html mime} [my set text] break
          set content [my substitute_markup $html]
        } elseif {[lindex $form 0] ne ""} {
          set content [[self class] disable_input_fields [lindex $form 0]]
        } else {
          set content ""
        }
        return $content
      }
    

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