An OpenDJ extension providing a virtual attribute that can combine other attributes and static strings through a template.
- Build the project or download the packaged JAR
- Place
src/main/resources/schema/99-template-virtual-attribute.ldif
in$OPENDJ_INSTALL_DIR/config/schema
- Place the JAR (with dependencies) in
$OPENDJ_INSTALL_DIR/lib/extensions
- Restart OpenDJ
Use dsconfig
to create or configure template virtual attributes.
For instance, if we want to fill in the "mail" attribute of "Person" entries according to the "@mydomain.com" template, we would create a virtual attribute using the following command:
dsconfig -h localhost -p 4444 \
-D "cn=Directory Manager" -w password \
-n create-virtual-attribute \
--type template --name "mailFromUID" \
--set attribute-type:mail --set enabled:true \
--set template:"<uid>@mydomain.com" --set filter:"(objectClass=Person)"
For a person with uid "mike.litoris", the virtual attribute would generate "[email protected]" as value for the "mail" attribute.
- Fork
- Branch (
git checkout -b my-new-feature
) - Commit (
git commit -am 'Added some feature'
) - Push (
git push origin my-new-feature
) - Pull request