• 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

Detailed information

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):
%3 test_api_filter_option_list api_filter_option_list (test xowiki) xowiki::filter_option_list xowiki::filter_option_list test_api_filter_option_list->xowiki::filter_option_list

Testcases:
api_filter_option_list

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):
%3 test_api_hstore api_hstore (test xowiki) xowiki::hstore::dict_as_hkey xowiki::hstore::dict_as_hkey test_api_hstore->xowiki::hstore::dict_as_hkey xowiki::hstore::double_quote xowiki::hstore::double_quote (public) xowiki::hstore::dict_as_hkey->xowiki::hstore::double_quote xowiki::FormPage instproc update_item_index xowiki::FormPage instproc update_item_index (public) xowiki::FormPage instproc update_item_index->xowiki::hstore::dict_as_hkey xowiki::hstore::update_form_instance_item_index xowiki::hstore::update_form_instance_item_index (private) xowiki::hstore::update_form_instance_item_index->xowiki::hstore::dict_as_hkey xowiki::update_item_index xowiki::update_item_index (public) xowiki::update_item_index->xowiki::hstore::dict_as_hkey

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):
%3 test_api_hstore api_hstore (test xowiki) xowiki::hstore::double_quote xowiki::hstore::double_quote test_api_hstore->xowiki::hstore::double_quote test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xowiki::hstore::double_quote xowiki::FormPage proc filter_expression xowiki::FormPage proc filter_expression xowiki::FormPage proc filter_expression->xowiki::hstore::double_quote xowiki::hstore::dict_as_hkey xowiki::hstore::dict_as_hkey (public) xowiki::hstore::dict_as_hkey->xowiki::hstore::double_quote

Testcases:
api_hstore, xowiki_test_cases

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):
%3 test_api_randomized api_randomized (test xowiki) xowiki::randomized_index xowiki::randomized_index test_api_randomized->xowiki::randomized_index Class ::xowf::test_item::Question_manager Class ::xowf::test_item::Question_manager (public) Class ::xowf::test_item::Question_manager->xowiki::randomized_index xowf::test_item::Question_manager instproc percent_substitute xowf::test_item::Question_manager instproc percent_substitute (protected) xowf::test_item::Question_manager instproc percent_substitute->xowiki::randomized_index

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):
%3 test_api_randomized api_randomized (test xowiki) xowiki::randomized_indices xowiki::randomized_indices test_api_randomized->xowiki::randomized_indices Class ::xowf::test_item::Question_manager Class ::xowf::test_item::Question_manager (public) Class ::xowf::test_item::Question_manager->xowiki::randomized_indices Class ::xowiki::formfield::ShuffleField Class ::xowiki::formfield::ShuffleField (public) Class ::xowiki::formfield::ShuffleField->xowiki::randomized_indices xowf::test_item::Question_manager instproc question_objs xowf::test_item::Question_manager instproc question_objs (public) xowf::test_item::Question_manager instproc question_objs->xowiki::randomized_indices xowf::test_item::Question_manager instproc shuffled_index xowf::test_item::Question_manager instproc shuffled_index (public) xowf::test_item::Question_manager instproc shuffled_index->xowiki::randomized_indices

Testcases:
api_randomized

xowiki::utility proc change_page_order (public)

 xowiki::utility[i] 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):
%3 ad_log ad_log (public) xowiki::utility proc change_page_order xowiki::utility proc change_page_order xowiki::utility proc change_page_order->ad_log

Testcases:
No testcase defined.

xowiki::utility proc formCSSclass (public)

 xowiki::utility[i] formCSSclass form_name

Obtain CSS class name for a form from its name

Parameters:
form_name

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xowiki::utility proc formCSSclass xowiki::utility proc formCSSclass test_create_form_with_form_instance->xowiki::utility proc formCSSclass test_link_tests link_tests (test xowiki) test_link_tests->xowiki::utility proc formCSSclass

Testcases:
link_tests, create_form_with_form_instance

xowiki::utility proc user_is_active (public)

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

Testcases:
No testcase defined.
[ show source ]