Class UserTemplateVirtualAttributeProvider

  • All Implemented Interfaces:
    ConfigurationChangeListener<UserTemplateVirtualAttributeCfg>

    public final class UserTemplateVirtualAttributeProvider
    extends VirtualAttributeProvider<UserTemplateVirtualAttributeCfg>
    implements ConfigurationChangeListener<UserTemplateVirtualAttributeCfg>
    This class implements a virtual attribute provider that allows administrators to define their own virtual attribute with template that will be evaluated by taking the data from the attributes only for the entry that matches the criteria defined in the virtual attribute rule.

    Note: We will not allow searches based only on user template virtual attributes.

    Valid templates:

    • With no placeholders:

      "No placeholders in template!"

    • With placeholders pointing to other entry attributes:

      "{uid}@{domain}" : "bjensen@example.com"

    • With expression defining default value: "{uid}@{domain|domain.com}"

      (if {domain}="example.com") : "bjensen@example.com"

      (if no {domain} attribute) : "bjensen@domain.com"

    • With reference pointing to a multi-valued attribute :

      "This is {cn}" :

      cn = 1 : "This is 1"

      cn = 2 : "This is 2"

      cn = 3 : "This is 3"

    • With escaping brace:

      "This is \{uid}" : "This is {uid}"

      "This is \{uid\}" : "This is {uid\}"