- Publicity: Public Only All
xowiki-procs.tcl
XoWiki - main library classes and objects
- Location:
- packages/xowiki/tcl/xowiki-procs.tcl
- Created:
- 2006-01-10
- Author:
- Gustaf Neumann
- CVS Identification:
$Id: xowiki-procs.tcl,v 1.542.2.182 2024/08/27 10:52:19 gustafn Exp $
Procedures in this file
- xowiki::FormPage instproc get_property (public)
- xowiki::FormPage instproc is_folder_page (public)
- xowiki::FormPage instproc property (public)
- xowiki::FormPage instproc set_live_revision (public)
- xowiki::FormPage instproc set_property (public)
- xowiki::FormPage instproc update_attribute_from_slot (public)
- xowiki::FormPage instproc update_item_index (public)
- xowiki::FormPage proc compute_filter_clauses (public)
- xowiki::FormPage proc fetch_object (public)
- xowiki::Page instproc create_form_fields_from_form_constraints (public)
- xowiki::Page instproc include (public)
- xowiki::Page instproc is_folder_page (public)
- xowiki::Page instproc pretty_link (public)
- xowiki::Page instproc render (public)
- xowiki::Page instproc resolve_included_page_name (public)
- xowiki::PageInstance instproc get_from_template (public)
- xowiki::update_item_index (public)
Detailed information
xowiki::FormPage instproc get_property (public)
<instance of xowiki::FormPage> 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)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
xowiki::FormPage instproc is_folder_page (public)
<instance of xowiki::FormPage> 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
(defaults to"true"
) (optional)- return true, if the current page is a link to a folder.
- Returns:
- boolean
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xowiki_test_cases
xowiki::FormPage instproc property (public)
<instance of xowiki::FormPage> property name [ default ]
Retrieve a FormPage property.
- Parameters:
- name - property name. Names starting with _ refer to object's members, rather than instance attributes.
default (optional) - fallback value when property is not set.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xowiki_test_cases
xowiki::FormPage instproc set_live_revision (public)
<instance of xowiki::FormPage> set_live_revision \ -revision_id revision_id [ -publish_status publish_status ]
- Switches:
- -revision_id
(required)- -publish_status
(defaults to"ready"
) (optional)- one of 'live', 'ready' or 'production'
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_folder_with_page, create_workflow_with_instance
xowiki::FormPage instproc set_property (public)
<instance of xowiki::FormPage> set_property [ -new new ] name \ value
Stores a value as FormPage property
- Switches:
- -new
(defaults to"0"
) (optional)- 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 - property name. Names starting with _ indicate an object variable rather than a property stored in instance_attributes
value - property value
- Returns:
- value (eventually converted to a has-notation message key)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_form_with_form_instance
xowiki::FormPage instproc update_attribute_from_slot (public)
<instance of xowiki::FormPage> 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
value
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- slot_interactions
xowiki::FormPage instproc update_item_index (public)
<instance of xowiki::FormPage> update_item_index
Tailored version of CrItem.update_item_index to keep insert_xowiki_form_instance_item_index in sync after updates.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- link_tests
xowiki::FormPage proc compute_filter_clauses (public)
xowiki::FormPage 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)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_composite_test_item
xowiki::FormPage proc fetch_object (public)
xowiki::FormPage 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
(defaults to"0"
) (optional)- -object
(required)- -initialize
(boolean) (defaults to"true"
) (optional)- Returns:
- cr item object
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xowiki_test_cases, link_tests, path_resolve
xowiki::Page instproc create_form_fields_from_form_constraints (public)
<instance of xowiki::Page> create_form_fields_from_form_constraints \ [ -lookup ] form_constraints
Create form-fields from form constraints. When "-lookup" is specified, the code reuses existing form-field instead of recreating it. Since create_raw_form_field uses destroy_on_cleanup, we do not have to care here about destroying the objects.
- Switches:
- -lookup
(optional)- Parameters:
- form_constraints
- Returns:
- potentially empty list of form-field objects
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- form_fields_from_form_constraints
xowiki::Page instproc include (public)
<instance of xowiki::Page> include [ -configure configure ] arg
Include the html of the includelet. The method generates an includelet object (might be another xowiki page) and renders it and returns either html or an error message.
- Switches:
- -configure
(optional)- Parameters:
- arg
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- includelet_toc, includelet_childresources, create_form_with_form_instance
xowiki::Page instproc is_folder_page (public)
<instance of xowiki::Page> is_folder_page \ [ -include_folder_links include_folder_links ]
Check, if page is a folder. This function is typically overlaaded by specializations. Plain xowiki::Pages are never folders.
- Switches:
- -include_folder_links
(defaults to"true"
) (optional)- return true, if the current page is a link to a folder.
- Returns:
- boolean
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xowiki_test_cases
xowiki::Page instproc pretty_link (public)
<instance of xowiki::Page> pretty_link [ -anchor anchor ] \ [ -query query ] [ -absolute on|off ] [ -siteurl siteurl ] \ [ -lang lang ] [ -download download ] [ -path_encode on|off ]
This method is a convenience stub for Package->pretty_link and can be overloaded for different pages types. Note that it is necessary to initialize the package before this method can be used.
- Switches:
- -anchor
(optional)- anchor to be added to the link
- -query
(optional)- query parameters to be added literally to the resulting URL
- -absolute
(boolean) (defaults to"false"
) (optional)- make an absolute link (including protocol and host)
- -siteurl
(optional)- -lang
(optional)- use the specified 2 character language code (rather than computing the value)
- -download
(defaults to"false"
) (optional)- create download link (without m=download)
- -path_encode
(boolean) (defaults to"true"
) (optional)- control encoding of the url path. Returns the URL path urlencoded, unless path_encode is set to false.
- Returns:
- the pretty_link for the current page
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xowiki_test_cases, nested_self_references
xowiki::Page instproc render (public)
<instance of xowiki::Page> render \ [ -update_references update_references ] [ -with_footer on|off ]
Render a wiki page with some optional features, such as including a footer or updating references for this page.
- Switches:
- -update_references
(defaults to"unresolved"
) (optional)- might be "all", "unresolved" or "never"
- -with_footer
(boolean) (defaults to"true"
) (optional)- boolean value
- Returns:
- rendered HTML content.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xowiki_test_cases, link_tests
xowiki::Page instproc resolve_included_page_name (public)
<instance of xowiki::Page> resolve_included_page_name page_name
Determine the page object for the specified page name. The specified page name might have the form //some_other_instance/page_name, in which case the page is resolved from some other package instance. If the page_name does not contain a language prefix, the language prefix of the including page is used.
- Parameters:
- page_name
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::PageInstance instproc get_from_template (public)
<instance of xowiki::PageInstance> get_from_template var \ [ default ]
Get a property from the parent object (template). The parent object might by either an ::xowiki::Form or an ::xowiki::FormPage
- Parameters:
- var
default (optional)
- Returns:
- either the property value or a default value
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_form_with_form_instance
xowiki::update_item_index (public)
xowiki::update_item_index -item_id item_id [ -name name ] \ [ -package_id package_id ] [ -parent_id parent_id ] \ [ -publish_status publish_status ] \ [ -page_template page_template ] [ -assignee assignee ] \ [ -state state ] [ -hstore_attributes hstore_attributes ]
Helper function to update single or multiple fields of the xowiki_form_instance_item_index. Call this function only when updating fields of the xowiki_form_instance_item_index in cases where the standard API based on save and save_use can not be used.
- Switches:
- -item_id
(required)- -name
(optional)- -package_id
(optional)- -parent_id
(optional)- -publish_status
(optional)- -page_template
(optional)- -assignee
(optional)- -state
(optional)- -hstore_attributes
(optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- slot_interactions