Class CRMUserAttributesService

  • All Implemented Interfaces:
    fr.paris.lutece.portal.service.security.UserAttributesService

    public final class CRMUserAttributesService
    extends Object
    implements fr.paris.lutece.portal.service.security.UserAttributesService
    CRMUserAttributesService
    • Method Detail

      • setCRMUserService

        public void setCRMUserService​(CRMUserService crmUserService)
        Set the CRMUserService
        Parameters:
        crmUserService - the CRMUserService
      • getAttribute

        public String getAttribute​(String strUserId,
                                   String strAttribute)
        Specified by:
        getAttribute in interface fr.paris.lutece.portal.service.security.UserAttributesService
      • getAttributes

        public Map<String,​String> getAttributes​(String strUserId)
        Specified by:
        getAttributes in interface fr.paris.lutece.portal.service.security.UserAttributesService
      • getAttributes

        public Map<String,​String> getAttributes​(int nIdCRMUser)
        Get the user attributes from a given id crm user
        Parameters:
        nIdCRMUser - the id crm user
        Returns:
        a map of user attribute key, user attribute value
      • remove

        public void remove​(int nIdCRMUser)
        Remove the user attributes of the crm user
        Parameters:
        nIdCRMUser - the id crm user
      • create

        public void create​(int nIdCRMUser,
                           String strUserAttributeKey,
                           String strUserAttributeValue)
        Create a new user attribute
        Parameters:
        nIdCRMUser - the id crm user
        strUserAttributeKey - the user attribute key
        strUserAttributeValue - the user attribute value
      • getUserAttributeKeys

        public List<String> getUserAttributeKeys()
        Get the list of user attribute keys defined in crm.properties
        Returns:
        a list of user attribute keys
      • getUserAttributeKeyLabels

        public List<String> getUserAttributeKeyLabels​(Locale locale)
        Gets the user attribute key labels.
        Parameters:
        locale - the locale
        Returns:
        the user attribute key labels
      • isAttributeValueInUse

        public boolean isAttributeValueInUse​(String strAttributeValue,
                                             String strUserAttributeKey)
        Check if a value of an attribute is used by a user for a given attribute key
        Parameters:
        strUserAttributeValue - The value of the attribute
        strUserAttributeKey - The key of the attribute
        Returns:
        True if a user has an attribute matching the given key and value, false otherwise. Also return false if the given attribute key is null or empty.