Class ActiveDirectoryGroupCollectionTranslator


  • public class ActiveDirectoryGroupCollectionTranslator
    extends CollectionValueTranslator
    A very special (ActiveDirectory only) translator class.

    This translator adds the current user to a PrincipalGroup, which will be defined by the distinguishedname of this group!

    Schematic query: SELECT {PK} FROM {PrincipalGroup} WHERE {dn} = ?value // CAUTION: The parameter {dn} could be replaced by using the modifier groupid="foo".

    Sample 'configuration.xml' entry:
     <code>Employee</code>
       <objectclasses>
         <objectclass>organizationalPerson</objectclass>
       </objectclasses>
      ...
       <attributes>
         <attribute>
           <ldap>memberOf</ldap>
           <hybris>groups</hybris>
           <impex>(dn)[translator=de.hybris.platform.ldap.impex.ActiveDirectoryGroupCollectionTranslator, groupid=dn]</impex>
         </attribute>
         ...
     
    • Field Detail

      • groupid

        protected static java.lang.String groupid
    • Constructor Detail

      • ActiveDirectoryGroupCollectionTranslator

        public ActiveDirectoryGroupCollectionTranslator()
    • Method Detail

      • getGroupId

        protected static java.lang.String getGroupId()
      • importValue

        public java.lang.Object importValue​(java.lang.String valueExpr,
                                            Item forItem)
                                     throws JaloInvalidParameterException
        Description copied from class: AbstractValueTranslator
        Translates a tokenized csv value for import usage. This means that the result object must be a instance of the expected attribute type.
        Overrides:
        importValue in class CollectionValueTranslator
        Parameters:
        valueExpr - expression to translate
        forItem - the target item in case it already exist, null otherwise (for partOf attributes!)
        Returns:
        Object translated value
        Throws:
        JaloInvalidParameterException - value can not be translated with this translator or is invalid