You can dynamically build a list of DN strings if you specify a user ID and base context.
The following example shows how to use user IDs and base context to build a dynamic list of DN strings.
The following code first defines the base context to append to users.
<Field name=’baseMemberContextContractor’>
<Default>
<s>ou=Contractors,dc=example,dc=com</s>
</Default>
</Field>
<Field name=’baseMemberContextEmployee’>
<Default>
<s>ou=Employees,dc=example,dc=com</s>
</Default>
</Field>
The user of this form enters data in the following field. This is a likely place for providing a dynamically generated list of user IDs.
<Field name=’userIds’>
<Display class=’TextArea’>
<Property name=’title’ value=’UserIds’/>
</Display>
</Field>
The following hidden field includes logic that calculates values.
<Field name=’Members’>
<Expansion>
<switch>
// Look at the role assigned to the users
<ref>waveset.role</ref>
<case>
// If user has "Contractor Role" then build DN like this:
// ex: CN=jsmith,ou=Contractors,dc=example,dc=com
<s>Contractor Role</s>
<invoke name=’buildDns’ class=’com.waveset.ui.FormUtil’>
<ref>userId</ref>
<ref>baseMemberContextContractor</ref>
</invoke>
</case>
<case>
// Otherwise, if user has "Employee Role", then build DN like this:
// ex: CN=jdoe,ou=Employees,dc=example,dc=com
s>Employee Role</s>
<invoke name=’buildDns’ class=’com.waveset.ui.FormUtil’>
<ref>userId</ref>
<ref>baseMemberContextEmployee</ref>
</invoke>
</case>
</switch>
</Expansion>
</Field>