- Publicity: Public Only All
xowiki-utility-procs.tcl
XoWiki - Utility procs
- Location:
- packages/xowiki/tcl/xowiki-utility-procs.tcl
- Created:
- 2006-08-08
- Author:
- Gustaf Neumann
- CVS Identification:
$Id: xowiki-utility-procs.tcl,v 1.57.2.37 2022/11/29 08:54:37 antoniop Exp $
Procedures in this file
- callback::subsite::url::impl::apm_package (private)
- xowiki::add_ltree_order_column (private)
- xowiki::cr_thin_out (private)
- xowiki::filter_option_list (public)
- xowiki::fix_all_package_ids (private)
- xowiki::hstore::dict_as_hkey (public)
- xowiki::hstore::double_quote (public)
- xowiki::hstore::update_form_instance_item_index (private)
- xowiki::hstore::update_hstore (private)
- xowiki::randomized_index (public)
- xowiki::randomized_indices (public)
- xowiki::update_views (private)
- xowiki::utility proc change_page_order (public)
- xowiki::utility proc formCSSclass (public)
- xowiki::utility proc publish_status_next_state (private)
- xowiki::utility proc user_is_active (public)
Detailed information
callback::subsite::url::impl::apm_package (private)
callback::subsite::url::impl::apm_package -package_id package_id \ -object_id object_id [ -type type ]
return the page_url for an object of type tasks_task
- Switches:
- -package_id
(required)- -object_id
(required)- -type
(optional)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::add_ltree_order_column (private)
xowiki::add_ltree_order_column
Add page_order of type ltree, when ltree is configured (otherwise string)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::cr_thin_out (private)
xowiki::cr_thin_out [ -doit ] [ -delete_orphans ] \ [ -delete_sequences ] [ -edit_interval edit_interval ] \ [ -older_than older_than ] [ -package_id package_id ] \ [ -item_id item_id ]
Delete supposedly unimportant items and revision from the content repository.
- Switches:
- -doit
(boolean) (defaults to"false"
) (optional)- if not true, then just write delete operation to the logfile
- -delete_orphans
(boolean) (defaults to"false"
) (optional)- if true, delete orphaned items
- -delete_sequences
(boolean) (defaults to"false"
) (optional)- if true, delete revisions from edit sequences lower than edit_interval
- -edit_interval
(defaults to"300"
) (optional)- delete entries, which never become older than this interval (in seconds, default 300)
- -older_than
(defaults to"1 month ago"
) (optional)- delete only entries, which were modified longer than the provided time ago
- -package_id
(optional)- if specified, perform operation just on the specified package
- -item_id
(optional)- if specified, perform operation just on the specified item
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::filter_option_list (public)
xowiki::filter_option_list option_list except
Process an option list (pairs of label and id) suitable to be passed to several widgets and remove all entries having an id from the except list.
- Parameters:
- option_list - list of labels and ids
except - list of internal ids
- Returns:
- filtered option list
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- api_filter_option_list
xowiki::fix_all_package_ids (private)
xowiki::fix_all_package_ids
Earlier versions of OpenACS did not have the package_id set correctly in acs_objects; this proc updates the package_ids of all items and revisions in acs_objects
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::hstore::dict_as_hkey (public)
xowiki::hstore::dict_as_hkey dict
- Parameters:
- dict
- Returns:
- dict value in form of a hstore key.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- api_hstore
xowiki::hstore::double_quote (public)
xowiki::hstore::double_quote value
From hstore manual: "Double-quote keys and values that include whitespace, commas, =s or >s. To include a double quote or a backslash in a key or value, escape it with a backslash." https://www.postgresql.org/docs/current/hstore.html
- Parameters:
- value
- Returns:
- double_quoted value as appropriate for hstore
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- api_hstore, xowiki_test_cases
xowiki::hstore::update_form_instance_item_index (private)
xowiki::hstore::update_form_instance_item_index \ [ -package_id package_id ] [ -object_class object_class ] \ [ -initialize initialize ]
update all instance attributes in hstore
- Switches:
- -package_id
(optional)- -object_class
(defaults to"::xowiki::FormPage"
) (optional)- -initialize
(defaults to"false"
) (optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::hstore::update_hstore (private)
xowiki::hstore::update_hstore package_id
Update all instance attributes in hstore. This proc can be used from ds/shell as follows: ::xo::Package initialize -url /xowiki ::xowiki::hstore::update_hstore $package_id
- Parameters:
- package_id
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::randomized_index (public)
xowiki::randomized_index [ -seed seed ] length
Return a single randomized value between 0 and length-1.
- Switches:
- -seed
(optional)- Parameters:
- length
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- api_randomized
xowiki::randomized_indices (public)
xowiki::randomized_indices [ -seed seed ] length
Produce a list of "length" random numbers between 0 and length-1. Measure quality of randomization:
time {lappend _ [xowiki::randomized_indices -seed [clock microseconds] 3]} 1000 foreach t $_ { lassign $t a b c; dict incr stats "a $a"; dict incr stats "b $b"; dict incr stats "c $c" } set stats
- Switches:
- -seed
(optional)- Parameters:
- length
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- api_randomized
xowiki::update_views (private)
xowiki::update_views
update all automatic views of xowiki
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::utility proc change_page_order (public)
xowiki::utility change_page_order -from from -to to [ -clean clean ] \ -folder_id folder_id -package_id package_id \ [ -publish_status publish_status ]
Update page_order attributes for pages by renumbering and filling gaps.
- Switches:
- -from
(required)- list of page_orders before a move/insert operation
- -to
(required)- list of page_orders after a move/insert operation
- -clean
(optional)- list of page_orders for insert operations, to update the hierarchy from where items were moved to the new hierarchy.
- -folder_id
(required)- -package_id
(required)- -publish_status
(defaults to"ready|live|expired"
) (optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::utility proc formCSSclass (public)
xowiki::utility formCSSclass form_name
Obtain CSS class name for a form from its name
- Parameters:
- form_name
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- link_tests, create_form_with_form_instance
xowiki::utility proc publish_status_next_state (private)
xowiki::utility publish_status_next_state publish_status
Determine next publish status and return dict containing CSSclass and next state.
- Parameters:
- publish_status
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xowiki::utility proc user_is_active (public)
xowiki::utility user_is_active [ -asHTML on|off ] uid
Tell whether a user is active according to the Request Monitor.
- Switches:
- -asHTML
(boolean) (defaults to"false"
) (optional)- when true, the proc will return an HTML rendering of the user information.
- Parameters:
- uid - the user id
- Returns:
- boolean or HTML according to the 'asHTML' flag.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.