param (struct)
Compound parameters may be defined through the use of the STRUCT param type. A struct contains a collection of parameters. Structs may not be nested. Struct must have a constrainttype of STRUCT. Members of the struct are declared through subparam tags within the value tag.
A struct may also use another param as a template to pre-populate the member sub-param declarations. This is done through the templateoid attribute.
Syntax
<param constrainttype="STRUCT" oid="oid" type="STRUCT" attributes>
<value>
<subparam suboid="sub-oid" sub-param-attributes/>
<subparam suboid="sub-oid" sub-param-attributes/>
. . .
</value>
</param>
Attributes
Attribute |
Values |
Restrictions |
Description |
oid |
String |
Required |
The OID of the parameter (can be used to override an existing parameter). |
access |
0 |
|
Parameter is read-only in DashBoard |
1 |
Parameter is read-write in DashBoard |
||
name |
String |
|
Parameter Name |
widget |
Positive integer |
Must be a valid widget hint |
Defines the default widget hint for the param. |
type |
STRUCT |
|
Must be set to STRUCT. |
structtype |
String |
|
Defines the structure type. Specifies a dependency of a widget upon a global struct parameter with matching structtype. Currently this type checking is restricted only to PanelBuilder UI; a custom widget will only be available in PanelBuilder if a parameter exists with matching structtype. |
templateoid |
String |
|
Specifies a template struct parameter to pre-populate the subparams. |
constrainttype |
STRUCT |
|
Must be set to STRUCT |
value |
|
|
Container for subparam elements. |
subparam |
param |
May not be a nested struct param |
Member parameters, declared using the same syntax as a param declaration, with the exception that its oid is specified in the attribute suboid. |
Default values shown in bold.
Example
The following declares a struct parameter.
<param access="1" constrainttype="STRUCT" name="Clip Info" oid="clipInfo" type="STRUCT" widget="36">
<value>
<subparam name="Clip Name" suboid="ClipName" type="STRING" value="Test"/>
<subparam name="Director" suboid="Director" type="STRING" value="Test"/>
<subparam name="Air Date" suboid="AirDate" type="STRING" value="Test"/>
<subparam name="Author" suboid="Author" type="STRING" value="Test"/>
</value>
</param>
The following declares an array of struct params, using the previous example as its template. Note that any attributes specified explicitly will override the values provided in the template.
<param access="1" constrainttype="STRUCT" name="Clip List" oid="clipList" templateoid="clipInfo" type="STRUCT_ARRAY" widget="36">
<value>
<subparam suboid="ClipName" value="Winter is Coming"/>
<subparam suboid="Director" value="Tim Van Patten"/>
<subparam suboid="AirDate" value="April 24, 2011"/>
<subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>
</value>
<value>
<subparam suboid="ClipName" value="The Kingsroad"/>
<subparam suboid="Director" value="Brian Kirk"/>
<subparam suboid="AirDate" value="April 24, 2011"/>
<subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>
</value>
<value>
<subparam suboid="ClipName" value="Lord Snow"/>
<subparam suboid="Director" value="Brian Kirk"/>
<subparam suboid="AirDate" value="May 1, 2011"/>
<subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>
</value>
</param>