form-field-procs.tcl

XoWiki - form fields

Location:
packages/xowiki/tcl/form-field-procs.tcl
Created:
2007-06-22
Author:
Gustaf Neumann
CVS Identification:
$Id: form-field-procs.tcl,v 1.290 2024/10/24 17:02:23 gustafn Exp $

Procedures in this file

Detailed information

xowiki::formfield::child_components (public)

 xowiki::formfield::child_components [ -filter filter ] objs

For every form-field obj in the provided objs, return a list of all child components (potentially leaf components of compound fields). The result list is filtered by the optional filter expression, which can refer to the current object via variable $_.

Switches:
-filter (optional, defaults to "true")
Parameters:
objs (required, object)
input form-field objs

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xowiki::formfield::dict_to_fc (public)

 xowiki::formfield::dict_to_fc [ -name name ] [ -type type ] dict

Convert the provided dict into form_constraint syntax (comma separated). The other direction would be more complex, since the fcs are interpreted from left to right, overwriting potentially previous values. The fc-interpretation creates already the form fields, produces intended errors, when certain attributes are not allowed, etc.

Switches:
-name (optional)
optional form-field name
-type (optional)
type of the form-field; if not specified, take it from key "_type" of the dict
Parameters:
dict (required)
dict to be converted.

Partial Call Graph (max 5 caller/called nodes):
%3 test_dict_to_xx dict_to_xx (test xowiki) xowiki::formfield::dict_to_fc xowiki::formfield::dict_to_fc test_dict_to_xx->xowiki::formfield::dict_to_fc xowiki::formfield::dict_to_spec xowiki::formfield::dict_to_spec (public) xowiki::formfield::dict_to_spec->xowiki::formfield::dict_to_fc

Testcases:
dict_to_xx

xowiki::formfield::dict_to_spec (public)

 xowiki::formfield::dict_to_spec [ -aspair ] [ -name name ] dict

Convert the provided dict into a form-field spec together with the form-field name. When "-aspair" is specified the spec is returned in the list format as used by "create_components". If "-name" is not specified, the name has to be provided via dict member "_name", otherwise an exception is triggered.

Switches:
-aspair (optional, boolean, defaults to "false")
-name (optional)
Parameters:
dict (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_dict_to_xx dict_to_xx (test xowiki) xowiki::formfield::dict_to_spec xowiki::formfield::dict_to_spec test_dict_to_xx->xowiki::formfield::dict_to_spec xowiki::formfield::dict_to_fc xowiki::formfield::dict_to_fc (public) xowiki::formfield::dict_to_spec->xowiki::formfield::dict_to_fc

Testcases:
dict_to_xx

xowiki::formfield::dict_value (public)

 xowiki::formfield::dict_value dict key [ default ]

Return the dict value of the specified "key" when this member exists. Otherwise return the default.

Parameters:
dict (required)
key (required)
default (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_dict_to_xx dict_to_xx (test xowiki) xowiki::formfield::dict_value xowiki::formfield::dict_value test_dict_to_xx->xowiki::formfield::dict_value

Testcases:
dict_to_xx

xowiki::formfield::fc_to_dict (public)

 xowiki::formfield::fc_to_dict form_constraints

Convert from form_constraint syntax to a dict. This is just a partial implementation to be probably extended in the future. it expects that the type is the first element and ignores everything not in the syntax "*=*", or skips "@*" fields. Don't expect this to be fully reversible.

Parameters:
form_constraints (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_dict_to_xx dict_to_xx (test xowiki) xowiki::formfield::fc_to_dict xowiki::formfield::fc_to_dict test_dict_to_xx->xowiki::formfield::fc_to_dict xowiki::formfield::spec_to_dict xowiki::formfield::spec_to_dict (private) xowiki::formfield::fc_to_dict->xowiki::formfield::spec_to_dict

Testcases:
dict_to_xx

xowiki::formfield::spec_to_dict (private)

 xowiki::formfield::spec_to_dict -name name spec

Convert a single spec to a Tcl dict structure

Switches:
-name (required)
Parameters:
spec (required)

Partial Call Graph (max 5 caller/called nodes):
%3 xowiki::formfield::fc_to_dict xowiki::formfield::fc_to_dict (public) xowiki::formfield::spec_to_dict xowiki::formfield::spec_to_dict xowiki::formfield::fc_to_dict->xowiki::formfield::spec_to_dict

Testcases:
No testcase defined.
[ show source ]