Transformation parameters provide the value of a virtual attribute. This value can either be a default value, or rule that creates the value from other attribute values.
The following transformation parameters are accepted:
value. This parameter is applied to all transformation actions that add an attribute value, other than the attr-value-mapping action.
internal-value:value. This parameter applies only to the attr-value-mapping action, and to the remove-attr-value action when used with the mapping model. It describes the value of the attribute that is written to or read from the physical data source.
view-value:value. This parameter applies only to the attr-value-mapping action, and to the remove-attr-value action when used with the mapping model. It describes the value of the attribute that is returned to or sent by the client application.
Transformation parameters take the following syntaxes:
Constant. Used to generate an attribute with a static default value.
For example, the parameter 0800–5994654 might be used to provide a default telephone number.
Attribute value. Used to create a new attribute from an existing attribute in the entry that is being processed.
For example, the parameter \${cn} specifies that the value of the new attribute must be taken from the value of the cn attribute The escape character is required before the $.
Constant and attribute value. Used to create a new attribute by combining an existing attribute and a static value.
For example, the parameter \${cn}@example.com specifies that the value of the new attribute must be taken from the value of the cn attribute and a static domain name.
Macro. Used to create an attribute by manipulating the value of an existing attribute.
The macro is a Java regular expression. For more information about Java regular expressions, see http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html.
The following macros are supported:
Increase the value of an attribute by a consistent amount:
increment(source-attribute-value,increment)
For example, the macro increment(\$(uid),10) specifies that the value of the new attribute is obtained by adding 10 to the value of the uid attribute present in the entry.
Decrease the value of an attribute by a consistent amount:
decrement(source-attribute-value,decrement)
For example, the macro decrement($(uid),10) specifies that the value of the new attribute is obtained by subtracting 10 from the value of the uid attribute present in the entry.
Use part of an existing attribute value.
substring(source-attribute-value,begin-index[,end-index])
The begin-index is inclusive and the end-index is exclusive. That is, the substring begins on the character specified by the begin-index and ends on the character just before the end-index.
For example, to create a new attribute whose value is the value of the cn attribute minus the first two characters, you would define the following macro:
substring(\${cn},2)
To create a new attribute whose value contains only the first two characters of the value of the cn attribute, you would define the following macro:
substring(\${cn},0,2)
Use part of an existing attribute value by splitting that value at a certain point.
split(source-attribute-value,token-index,regular-expression)
For example, the macro split\(\${mail},1,"@"\) returns the domain.
The transformation parameter syntax is slightly different when used in the context of a join data view. For more information, see Virtual Data Transformations on Join Data Views.