%3 ::xowiki::FormPage ::xowiki::FormPage → compute_filter_clauses → fetch_object → filter_expression → get_all_children → get_folder_children → get_form_entries → get_super_folders → get_table_form_fields → sql_value action_url adp_subst combine_data_and_form_field_default compute_link_properties condition=in_state condition=is_true configure_page=regression_test create_category_fields create_form_field create_form_fields create_form_fields_from_names demarshall exists_property extra_html_fields field_names field_names_from_form footer form_field_as_html form_fields_sanity_check get_anon_instances get_form_constraints get_form_value get_parameter get_property get_value group_assign group_require hstore_attributes include_header_info initialize initialize_loaded_object is_folder_page is_form is_link_page langstring lappend_property load_values_into_form_fields map_value map_values marshall new_link notification_render post_process_dom_tree post_process_form_fields pretty_name property render_content render_form_action_buttons render_icon render_thumbnails reverse_map_value reverse_map_values setCSSDefaults set_content set_form_data set_form_value set_live_revision set_property set_publish_status update update_attribute_from_slot update_item_index update_langstring_property www-edit www-file-upload www-toggle-modebutton ::xowiki::PageInstance ::xowiki::PageInstance → get_list_from_form_constraints → get_short_spec_from_form_constraints adp_subst count_usages create_raw_form_field demarshall field_names_from_form_constraints get_field_label get_field_type get_form get_form_constraints get_from_template get_short_spec get_template_object render_content template_vars update widget_spec_from_folder_object www-use-template ::xowiki::FormPage->::xowiki::PageInstance ::xo::db::CrCache::Item ::xo::db::CrCache::Item delete flush_from_cache_and_refresh remove_non_persistent_vars rename save save_new set_non_persistent_vars update_attribute_from_slot ::xotcl::Object ::xotcl::Object ::xo::db::CrCache::Item->::xotcl::Object ::xowiki::Page ::xowiki::Page ::xowiki::PageInstance->::xowiki::Page

Class ::xowiki::FormPage

::xowiki::FormPage[i] create ...

Defined in

Class Relations

  • class: ::xo::db::CrClass[i]
  • superclass: ::xowiki::PageInstance[i]

Methods (to be applied on the object)

  • compute_filter_clauses (scripted, public)

     xowiki::FormPage[i] compute_filter_clauses [ -unless unless ] \
        [ -where where ]

    Compute from "-unless" or "-where" specs the "tcl", "sql" and optional "hstore" query fragments.

    Switches:
    -unless (optional)
    -where (optional)
    Returns:
    dict containing "init_vars", "uc" (unless clauses) and "wc" (where clauses)

    Testcases:
    create_composite_test_item
  • fetch_object (scripted, public)

     xowiki::FormPage[i] fetch_object -item_id item_id  \
        [ -revision_id revision_id ] -object object  \
        [ -initialize on|off ]

    Load a content item into the specified object. If revision_id is provided, the specified revision is returned, otherwise the live revision of the item_id. If the object does not exist, we create it.

    Switches:
    -item_id (required)
    -revision_id (optional, defaults to "0")
    -object (required)
    -initialize (optional, boolean, defaults to "true")
    Returns:
    cr item object

    Testcases:
    xowiki_test_cases, link_tests, path_resolve
  • filter_expression (scripted)

     xowiki::FormPage[i] filter_expression

    Testcases:
    xowiki_test_cases, xowiki
  • get_all_children (scripted)

     xowiki::FormPage[i] get_all_children

    Testcases:
    includelet_childresources, xowiki
  • get_folder_children (scripted)

  • get_form_entries (scripted)

  • get_super_folders (scripted)

  • get_table_form_fields (scripted)

  • sql_value (scripted)

Methods (to be applied on instances)

  • action_url (scripted)

  • adp_subst (scripted)

  • assignee (setter)

  • combine_data_and_form_field_default (scripted, public)

     <instance of xowiki::FormPage[i]> combine_data_and_form_field_default \
        is_new form_field data_value

    Combine the value of the form field (e.g. determined by the default) with the value in the instance attributes. This function decides, whether it should honor the data value or the form field value for e.g. rendering forms.

    Parameters:
    is_new (required)
    is this a new entry?
    form_field (required)
    object id of the form field
    data_value (required)
    the data from the instance attributes.

    Testcases:
    create_form_with_form_instance
  • compute_link_properties (scripted)

  • condition=in_state (scripted)

  • condition=is_true (scripted)

  • configure_page=regression_test (scripted)

  • create_category_fields (scripted)

  • create_form_field (scripted)

  • create_form_fields (scripted)

  • create_form_fields_from_names (scripted)

  • demarshall (scripted)

  • exists_property (scripted)

  • extra_html_fields (scripted, public)

     <instance of xowiki::FormPage[i]> extra_html_fields

    Should be overloaded to provide extra content to some forms. This method can be used to add additional (e.g. hidden) HTML input fields to form pages. Example: ::html::input -type hidden -name __object_name -value [::security::parameter::signed ${:name}]

    Testcases:
    create_test_items
  • field_names (scripted)

  • field_names_from_form (scripted)

  • footer (scripted)

  • form_field_as_html (scripted)

  • form_fields_sanity_check (scripted)

  • get_anon_instances (scripted)

  • get_form_constraints (scripted)

  • get_form_value (scripted)

  • get_parameter (scripted)

  • get_property (scripted, public)

     <instance of xowiki::FormPage[i]> get_property [ -source source ] \
        -name name  [ -default default ]

    Retrieves a FormPage property

    Switches:
    -source (optional)
    page name to be resolved and used instead this FormPage to fetch the property
    -name (required)
    -default (optional)

    Testcases:
    create_test_items
  • get_value (scripted)

  • group_assign (scripted)

  • group_require (scripted)

  • hstore_attributes (scripted)

  • include_header_info (scripted)

  • initialize (scripted)

  • initialize_loaded_object (scripted)

  • is_folder_page (scripted, public)

     <instance of xowiki::FormPage[i]> is_folder_page \
        [ -include_folder_links include_folder_links ]

    Check, if FormPage is a folder. A FormPage is a folder when its page template is the folder.form or if this is a link pointing to a folder.

    Switches:
    -include_folder_links (optional, defaults to "true")
    return true, if the current page is a link to a folder.
    Returns:
    boolean

    Testcases:
    xowiki_test_cases
  • is_form (scripted)

  • is_link_page (scripted)

  • langstring (scripted)

  • lappend_property (scripted)

  • load_values_into_form_fields (scripted, public)

     <instance of xowiki::FormPage[i]> load_values_into_form_fields \
        form_fields

    Load either the instance variables or the instance attributes into the provided form-fields. The function sets the values based on the default values and the values for the current object.

    Parameters:
    form_fields (required)

    Testcases:
    create_form_with_form_instance, create_form_with_numeric
  • map_value (scripted)

  • map_values (scripted)

  • marshall (scripted)

  • mime_type (setter)

  • new_link (scripted)

  • notification_render (scripted)

  • post_process_dom_tree (scripted)

  • post_process_form_fields (scripted)

  • pretty_name (scripted)

  • property (scripted, public)

     <instance of xowiki::FormPage[i]> property name [ default ]

    Retrieve a FormPage property.

    Parameters:
    name (required)
    property name. Names starting with _ refer to object's members, rather than instance attributes.
    default (optional)
    fallback value when property is not set.

    Testcases:
    xowiki_test_cases
  • render_content (scripted)

  • render_form_action_buttons (scripted)

  • render_icon (scripted)

  • render_thumbnails (scripted, public)

     <instance of xowiki::FormPage[i]> render_thumbnails upload_info

    Renderer of the thumbnail file(s). This method is a stub to be refined (e.g. in xowf).

    Parameters:
    upload_info (required)
    dict containing the "file_object" and "file_name"
    Returns:
    HTML content

    Testcases:
    No testcase defined.
  • reverse_map_value (scripted)

  • reverse_map_values (scripted)

  • setCSSDefaults (scripted)

  • set_content (scripted)

  • set_form_data (scripted, public)

     <instance of xowiki::FormPage[i]> set_form_data form_fields

    Store the instance attributes or default values into the form via set_form_value. This function iterates over the provided form-fields and checks, if these are known fields in the current form. These known field names are defined via the method "field_names" that extracts these names from a form. If one wants to load all values from an FormPage into the provided form-fields, use method "load_values_into_form_fields" instead.

    Parameters:
    form_fields (required)

    Testcases:
    create_form_with_form_instance
  • set_form_value (scripted)

  • set_live_revision (scripted, public)

     <instance of xowiki::FormPage[i]> set_live_revision \
        -revision_id revision_id  [ -publish_status publish_status ]
    Switches:
    -revision_id (required)
    -publish_status (optional, defaults to "ready")
    one of 'live', 'ready' or 'production'

    Testcases:
    create_folder_with_page, create_workflow_with_instance
  • set_property (scripted, public)

     <instance of xowiki::FormPage[i]> set_property [ -new new ] name \
        value

    Stores a value as FormPage property

    Switches:
    -new (optional, defaults to "0")
    boolean flag telling if the property is new. Setting a value on a non-existing property without specifying this flag will result in an error.
    Parameters:
    name (required)
    property name. Names starting with _ indicate an object variable rather than a property stored in instance_attributes
    value (required)
    property value
    Returns:
    value (eventually converted to a has-notation message key)

    Testcases:
    create_form_with_form_instance
  • set_publish_status (scripted)

  • state (setter)

  • update (scripted)

  • update_attribute_from_slot (scripted, public)

     <instance of xowiki::FormPage[i]> update_attribute_from_slot \
        [ -revision_id revision_id ] slot value

    Tailored version of update_attribute_from_slot to keep insert_xowiki_form_instance_item_index in sync after single attribute updates.

    Switches:
    -revision_id (optional)
    Parameters:
    slot (required, object)
    value (required)

    Testcases:
    slot_interactions
  • update_item_index (scripted, public)

     <instance of xowiki::FormPage[i]> update_item_index

    Tailored version of CrItem.update_item_index to keep insert_xowiki_form_instance_item_index in sync after updates.

    Testcases:
    link_tests
  • update_langstring_property (scripted)

  • www-edit (scripted, public)

     <instance of xowiki::FormPage[i]> www-edit \
        [ -validation_errors validation_errors ] \
        [ -disable_input_fields disable_input_fields ] [ -view on|off ]

    This web-callable method renders a form page in "edit" mode (i.e. provide input fields). The following query parameters can be used to influene the results "return_url", "title", "detail_link", "text", and "description".

    Switches:
    -validation_errors (optional)
    -disable_input_fields (optional, defaults to "0")
    -view (optional, boolean, defaults to "true")

    Testcases:
    create_workflow_with_instance
  • www-file-upload (scripted, public)

     <instance of xowiki::FormPage[i]> www-file-upload

    This web-callable method can be used for uploading files using the current object as parent object for the new content. This method is typically called via drop-zone in a POST request, where the FormPage is a folder (which is treated as parent object)

    Testcases:
    No testcase defined.
  • www-toggle-modebutton (scripted, public)

     <instance of xowiki::FormPage[i]> www-toggle-modebutton

    AJAX called function, called via POST. The function toggles the state of a button in the backend. The client provides the name of the button as form field named "button". If none is provided, the button is named as default "admin"

    Testcases:
    No testcase defined.
  • xowiki_form_page_id (setter)