%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 after_submit edit_data edit_request form_vars generate get_id_field init new_data new_request on_submit on_validation_error request set_form_data ::xowiki::WikiForm->::Generic::Form ::xotcl::Object ::xotcl::Object ::Generic::Form->::xotcl::Object

Class ::xowiki::PageInstanceEditForm

::xowiki::PageInstanceEditForm[i] create ... \
           [ -f.name (default "= inform") ] \
           [ -f.nls_language (default "nls_language:text(hidden)") ] \
           [ -f.page_template (default "page_template:text(hidden)") ] \
           [ -field_list_bottom (default "page_template description nls_language") ] \
           [ -field_list_top (default "item_id name page_order title creator") ] \
           [ -textfieldspec (default "text(textarea),nospell {html {cols 60 rows 5}}") ] \
           [ -with_categories (default "true") ]

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xowiki::WikiForm[i]
::xotcl::Class create ::xowiki::PageInstanceEditForm \
     -superclass ::xowiki::WikiForm

Methods (to be applied on instances)

  • edit_data (scripted)

    :log "-- "
    
    set __ia [${:data} set instance_attributes]
    foreach var ${:page_instance_form_atts} {
      dict set __ia $var [:var $var]
    }
    ${:data} set instance_attributes $__ia
    
    set item_id [next]
    :log "-- edit_data item_id=$item_id"
    return $item_id
  • edit_request (scripted)

    :log "-- "
    next
    
    set __ia [${:data} set instance_attributes]
    foreach var ${:page_instance_form_atts} {
      if {[dict exists $__ia $var]} {:var $var [list [dict get $__ia $var]]}
    }
  • f.name (setter)

  • f.nls_language (setter)

  • f.page_template (setter)

  • field_list_bottom (setter)

  • field_list_top (setter)

  • init (scripted)

    set item_id [${:data} form_parameter item_id:int32]
    #
    # make sure to have page template object loaded
    #
    set page_template_id [${:data} form_parameter page_template ""]
    if {$page_template_id eq ""} {
      set page_template_id [${:data} set page_template]
    }
    set template [::xo::db::CrClass get_instance_from_db -item_id $page_template_id]
    set dont_edit [concat [[${:data} info class] array names db_slot]  [::xo::db::CrClass set common_query_atts]]
    
    set category_spec [${:data} get_short_spec @categories]
    foreach f [split $category_spec ,] {
      if {$f eq "off"} {set :with_categories false}
    }
    
    #
    # compute list of form instance attributes
    #
    set :page_instance_form_atts [list]
    foreach {var _} [${:data} template_vars [$template set text]] {
      if {$var ni $dont_edit} {lappend :page_instance_form_atts $var}
    }
    set :field_list [concat [:field_list_top] ${:page_instance_form_atts} [:field_list_bottom]]
    
    #
    # get widget specs from folder.
    # All other specs are taken form attributes or form constraints.
    # The widget_spec functionality might be deprecated in the future.
    #
    foreach __var ${:page_instance_form_atts} {
      set spec [${:data} widget_spec_from_folder_object $__var [$template set name]]
      if {$spec ne ""} {
        set :f.$__var "$__var:$spec"
      }
    }
    
    :edit_page_title [${:data} get_from_template title]
    next
    #:log "--fields = [:fields]"
  • new_data (scripted)

    set __vars {folder_id item_id page_template return_url}
    set object_type [[${:data} info class] object_type]
    #:log "-- class=[${:data} info class] object_type=$object_type $__vars"
    foreach __v $__vars {set $__v [${:data} from_parameter $__v""}
    set item_id [next]
    
    set link [${:data} pretty_link]
    :submit_link [export_vars -no_base_encode -base $link {{m edit} $__vars}]
    # :log "-- submit_link = [:submit_link]"
    return $item_id
  • textfieldspec (setter)

  • tidy (scripted)

    # nothing
  • with_categories (setter)