• 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.176 2023/07/10 08:53:32 gustafn Exp $

Procedures in this file

Detailed information

xowiki::FormPage instproc get_property (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)

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_test_items create_test_items (test xowf) xowiki::FormPage instproc get_property xowiki::FormPage instproc get_property test_create_test_items->xowiki::FormPage instproc get_property

Testcases:
create_test_items

xowiki::FormPage instproc is_folder_page (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
(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):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xowiki::FormPage instproc is_folder_page xowiki::FormPage instproc is_folder_page test_xowiki_test_cases->xowiki::FormPage instproc is_folder_page

Testcases:
xowiki_test_cases

xowiki::FormPage instproc property (public)

 <instance of xowiki::FormPage[i]> 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):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xowiki::FormPage instproc property xowiki::FormPage instproc property test_xowiki_test_cases->xowiki::FormPage instproc property

Testcases:
xowiki_test_cases

xowiki::FormPage instproc set_live_revision (public)

 <instance of xowiki::FormPage[i]> 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):
%3 test_create_folder_with_page create_folder_with_page (test xowf) xowiki::FormPage instproc set_live_revision xowiki::FormPage instproc set_live_revision test_create_folder_with_page->xowiki::FormPage instproc set_live_revision test_create_workflow_with_instance create_workflow_with_instance (test xowf) test_create_workflow_with_instance->xowiki::FormPage instproc set_live_revision xowiki::update_item_index xowiki::update_item_index (public) xowiki::FormPage instproc set_live_revision->xowiki::update_item_index

Testcases:
create_folder_with_page, create_workflow_with_instance

xowiki::FormPage instproc set_property (public)

 <instance of xowiki::FormPage[i]> 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):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xowiki::FormPage instproc set_property xowiki::FormPage instproc set_property test_create_form_with_form_instance->xowiki::FormPage instproc set_property

Testcases:
create_form_with_form_instance

xowiki::FormPage instproc update_attribute_from_slot (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
value

Partial Call Graph (max 5 caller/called nodes):
%3 test_slot_interactions slot_interactions (test xowiki) xowiki::FormPage instproc update_attribute_from_slot xowiki::FormPage instproc update_attribute_from_slot test_slot_interactions->xowiki::FormPage instproc update_attribute_from_slot xowiki::update_item_index xowiki::update_item_index (public) xowiki::FormPage instproc update_attribute_from_slot->xowiki::update_item_index

Testcases:
slot_interactions

xowiki::FormPage instproc update_item_index (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.

Partial Call Graph (max 5 caller/called nodes):
%3 test_link_tests link_tests (test xowiki) xowiki::FormPage instproc update_item_index xowiki::FormPage instproc update_item_index test_link_tests->xowiki::FormPage instproc update_item_index xowiki::hstore::dict_as_hkey xowiki::hstore::dict_as_hkey (public) xowiki::FormPage instproc update_item_index->xowiki::hstore::dict_as_hkey

Testcases:
link_tests

xowiki::FormPage proc compute_filter_clauses (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)

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_composite_test_item create_composite_test_item (test xowf) xowiki::FormPage proc compute_filter_clauses xowiki::FormPage proc compute_filter_clauses test_create_composite_test_item->xowiki::FormPage proc compute_filter_clauses

Testcases:
create_composite_test_item

xowiki::FormPage proc fetch_object (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
(defaults to "0") (optional)
-object
(required)
-initialize
(boolean) (defaults to "true") (optional)
Returns:
cr item object

Partial Call Graph (max 5 caller/called nodes):
%3 test_link_tests link_tests (test xowiki) xowiki::FormPage proc fetch_object xowiki::FormPage proc fetch_object test_link_tests->xowiki::FormPage proc fetch_object test_path_resolve path_resolve (test xowiki) test_path_resolve->xowiki::FormPage proc fetch_object test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xowiki::FormPage proc fetch_object db_exec db_exec (public) xowiki::FormPage proc fetch_object->db_exec db_with_handle db_with_handle (public) xowiki::FormPage proc fetch_object->db_with_handle

Testcases:
xowiki_test_cases, link_tests, path_resolve

xowiki::Page instproc create_form_fields_from_form_constraints (public)

 <instance of xowiki::Page[i]> 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):
%3 test_form_fields_from_form_constraints form_fields_from_form_constraints (test xowiki) xowiki::Page instproc create_form_fields_from_form_constraints xowiki::Page instproc create_form_fields_from_form_constraints test_form_fields_from_form_constraints->xowiki::Page instproc create_form_fields_from_form_constraints

Testcases:
form_fields_from_form_constraints

xowiki::Page instproc include (public)

 <instance of xowiki::Page[i]> 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):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xowiki::Page instproc include xowiki::Page instproc include test_create_form_with_form_instance->xowiki::Page instproc include test_includelet_childresources includelet_childresources (test xowiki) test_includelet_childresources->xowiki::Page instproc include test_includelet_toc includelet_toc (test xowiki) test_includelet_toc->xowiki::Page instproc include _ _ (public) xowiki::Page instproc include->_

Testcases:
includelet_toc, includelet_childresources, create_form_with_form_instance

xowiki::Page instproc is_folder_page (public)

 <instance of xowiki::Page[i]> 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):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xowiki::Page instproc is_folder_page xowiki::Page instproc is_folder_page test_xowiki_test_cases->xowiki::Page instproc is_folder_page

Testcases:
xowiki_test_cases

xowiki::Page instproc pretty_link (public)

 <instance of xowiki::Page[i]> 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):
%3 test_nested_self_references nested_self_references (test xowiki) xowiki::Page instproc pretty_link xowiki::Page instproc pretty_link test_nested_self_references->xowiki::Page instproc pretty_link test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xowiki::Page instproc pretty_link ad_log ad_log (public) xowiki::Page instproc pretty_link->ad_log

Testcases:
xowiki_test_cases, nested_self_references

xowiki::Page instproc render (public)

 <instance of xowiki::Page[i]> 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):
%3 test_link_tests link_tests (test xowiki) xowiki::Page instproc render xowiki::Page instproc render test_link_tests->xowiki::Page instproc render test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xowiki::Page instproc render

Testcases:
xowiki_test_cases, link_tests

xowiki::Page instproc resolve_included_page_name (public)

 <instance of xowiki::Page[i]> 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):
%3

Testcases:
No testcase defined.

xowiki::PageInstance instproc get_from_template (public)

 <instance of xowiki::PageInstance[i]> 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):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xowiki::PageInstance instproc get_from_template xowiki::PageInstance instproc get_from_template test_create_form_with_form_instance->xowiki::PageInstance instproc get_from_template

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):
%3 test_slot_interactions slot_interactions (test xowiki) xowiki::update_item_index xowiki::update_item_index test_slot_interactions->xowiki::update_item_index xowiki::hstore::dict_as_hkey xowiki::hstore::dict_as_hkey (public) xowiki::update_item_index->xowiki::hstore::dict_as_hkey xowiki::FormPage instproc set_live_revision xowiki::FormPage instproc set_live_revision (public) xowiki::FormPage instproc set_live_revision->xowiki::update_item_index xowiki::FormPage instproc update_attribute_from_slot xowiki::FormPage instproc update_attribute_from_slot (public) xowiki::FormPage instproc update_attribute_from_slot->xowiki::update_item_index xowiki::Package instproc reparent xowiki::Package instproc reparent (public) xowiki::Package instproc reparent->xowiki::update_item_index

Testcases:
slot_interactions
[ show source ]