Class ExtractUserGroupTranslator


  • public class ExtractUserGroupTranslator
    extends CollectionValueTranslator
    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 parmeter {dn} could be replaced by using the modifier grouid="foo"

    The value of '?value' will be generated from the 'dn' of the current user !!!

    Sample 'configuration.xml' entry:

    Employee organizationalPerson ... memberOf groups (dn)[translator=de.hybris.platform.ldap.impex.ExtractUserGroupTranslator, groupid=dn] ...

    • Field Detail

      • groupid

        protected static java.lang.String groupid
    • Constructor Detail

      • ExtractUserGroupTranslator

        public ExtractUserGroupTranslator()
    • Method Detail

      • 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