
Creating Wizard Output Templates
189
Creating Wizard Output Templates
The Wizard Markup Language (WIZML) enables the customization of files produced
by the wizards. WIZML is used inside the templates to dynamically create files based
on the data provided by the wizard. For example, if a wizard generates a tag called
<GIZMO>
with a single attribute FILEPATH, the template could look as simple as this:
<GIZMO FILEPATH="$${txtFilePath}">
This example will create a file with a single <GIZMO> tag. Notice the syntax
$${variablename} that is used to populate the value of FilePath with the actual value
entered in the wizard.
WIZML output templates use a high-level markup syntax that works very much like
CFML. Supported tags include WIZSET, WIZELSE/WIZELSEIF, WIZLOOP, and
WIZINCLUDE. In addition, a simple expression syntax that is a subset of the
ColdFusion expression syntax and function library is supported within output
templates.
Parameters
Output templates are driven by the values of parameters, much like ColdFusion
templates are driven by the values of Form and URL parameters. Parameters can be
output directly or can be used to customize the type of output generated. The values
of these wizard parameters can originate from several locations:
•
From a value set by a PARAM tag provided by the wizard
•
From an embedded tag editor control
•
Through execution of the WIZSET tag within the output template
To output the value of a parameter within a template, use a double dollar sign escape
sequence. For example, to output the value of a variable named Color you would use
the syntax
$${Color}
. While this is the recommended syntax, you can use a simpler
form when for a parameter value within the attribute of a WIZ tag. For example,
<WIZIF Color= "black">
is valid.
Expressions and functions
In addition to outputting and manipulating simple parameter values, an expression
syntax is also provided. To output the value of an expression, you add a set of curly
braces to the $$ and include the expression within the braces, for example:
$${ ’This is the ’ & Color }
$$( ’The result of 7 divided by 22 is ’ & 7/22 }
$$( Left( ’FooBar’, 3 ) }
Strings are delimited using the single quote character. Arithmetic and concatenation
operators are supported (+,-,*,/,&). The comparison operators LT, LTE, GT EQ, and
NEQ are supported, and logical comparisons using AND, NOT, and OR are
supported.
Содержание COLDFUSION STUDIO 5-USING COLDFUSION 5...
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...