Previous | Next | Contents | Index |
The recipe language includes C like variables and variable assignment. There are no type declarations; variables have the type of their current value. In addition to regular C data types, there are also lists and string, described further in Section 37.8.1.
Variable names are not case sensitive.
In addition to any variables explicitly defined in a recipe file, there
are also so-called context variables; variables defined
automatically when a recipe file is executed, corresponding to the
input directory attributes. That is, when a recipe file is executed on
a input directory LDIF file, each directory entry in turn is read from
the input LDIF file and a corresponding context variable is created for
each attribute in that entry.3 The name of each variable is
the name of the attribute;4 the value of the variable is the
value of the attribute. Context variables are normally always lists,
even if the attribute is single valued (so the list has only one
entry). The exception is single-valued attributes where the value is
over 1024 bytes long; for such attributes a string context variable is
created. (An example of such a long string would be a
jpegPhoto
attribute.)
One additional context variable is also created,
explodedDN
. The value of this variable is a list
representation of the DN attribute of the input directory entry. Note
that there will also be an DN
context variable, whose
value is the actual string of the DN from the input directory entry.
The list representation stored in explodedDN
is often more
convenient to work with, particularly to construct a
"canonical" form of the DN (of which there can be more than
one semantically equivalent string represention).
As with every string or list variable in a recipe file, each context string variable has an associated tag, and each context list variable has an associated list of tags. The tag values for context variables correspond to the !, +, *, (space), markings in the LDIF input file.
3 An LDIF file entry is a multilined set of attributes and values corresponding to a particular directory entry, with one attribute-value pair per line. Entries in an LDIF file are separated by a blank line.4 Hyphens in attribute names are converted to underscores in context variable names. |
Previous | Next | Contents | Index |