Penrose 0.9.9 Source and Field Mappings
A source mapping is defined as follows:
<mapping>
<entry ...>
<source
name="..."
required="true|false"
includeOnAdd="true|false"
includeOnModify="true|false"
includeOnModRDN="true|false"
includeOnDelete="true|false">
<source-name>...</source-name>
<field name="...">
<constant>...</constant>
</field>
<field name="...">
<variable>...</variable>
</field>
<field name="...">
<expression>...</expression>
</field>
</source>
</entry>
</mapping>
Source Properties
Name
The name="..." property is used to specify an alias for the original source name. This is useful if you need to use the same source more than once, so you can assign them different aliases.
Required
The required="..." property determines whether this source is required for generating the LDAP entry during an LDAP Search operation. If the value is true (default), there has to be at least one matching record from this source that matches the mapping. Otherwise, an LDAP entry will be generated regardless of matching records from this entry.
Include On Add
The includeOnAdd="..." property determines whether this source will be included in an LDAP Add operation. If the value is true (default), new records will generated based on the mappings, and added to this source. Otherwise, the source will be ignored.
Include On Modify
The includeOnModify="..." property determines whether this source will be included in an LDAP Modify operation. If the value is true (default), all records from this source that are matching the mappings will be added/updated/deleted accordingly. Otherwise, the source will be ignored.
Include On ModRDN
The includeOnModRDN="..." property determines whether this source will be included in an LDAP ModRDN operation. If the value is true (default), all records from this source that are matching the mappings will be added/updated/deleted accordingly. Otherwise, the source will be ignored.
Include On Delete
The includeOnDelete="..." property determines whether this source will be included in an LDAP Delete operation. If the value is true (default), all records from this source that are matching the mappings will be deleted. Otherwise, the source will be ignored.
Source Name
In the <source-name> you need to specify the original source name that you are using as defined in sources.xml. For example:
<source-name>customers</source-name>
Field Mappings
Field mappings are only needed if you need the fields for search or update operations. To get field value from LDAP attribute, simply specify the attribute name:
<field name="lastName">
<variable>sn</variable>
</field>
You can also execute a script/expression. The following script extracts a last name from a cn attribute.
<field name="lastName"> <expression> if (cn == void || cn == null) return null; int i = cn.indexOf(" "); if (i < 0) return null; return cn.substring(i+1); <expression> </field>