Class CRMUserAttributesService
- java.lang.Object
-
- fr.paris.lutece.plugins.crm.service.user.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate(int nIdCRMUser, String strUserAttributeKey, String strUserAttributeValue)Create a new user attributeStringgetAttribute(String strUserId, String strAttribute)Map<String,String>getAttributes(int nIdCRMUser)Get the user attributes from a given id crm userMap<String,String>getAttributes(String strUserId)static CRMUserAttributesServicegetService()Get the instance of CRMUserAttributesServiceList<String>getUserAttributeKeyLabels(Locale locale)Gets the user attribute key labels.List<String>getUserAttributeKeys()Get the list of user attribute keys defined in crm.propertiesbooleanisAttributeValueInUse(String strAttributeValue, String strUserAttributeKey)Check if a value of an attribute is used by a user for a given attribute keyvoidremove(int nIdCRMUser)Remove the user attributes of the crm uservoidsetCRMUserService(CRMUserService crmUserService)Set the CRMUserService
-
-
-
Method Detail
-
getService
public static CRMUserAttributesService getService()
Get the instance of CRMUserAttributesService- Returns:
- the instance of
CRMUserAttributesService
-
setCRMUserService
public void setCRMUserService(CRMUserService crmUserService)
Set the CRMUserService- Parameters:
crmUserService- the CRMUserService
-
getAttribute
public String getAttribute(String strUserId, String strAttribute)
- Specified by:
getAttributein interfacefr.paris.lutece.portal.service.security.UserAttributesService
-
getAttributes
public Map<String,String> getAttributes(String strUserId)
- Specified by:
getAttributesin interfacefr.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 userstrUserAttributeKey- the user attribute keystrUserAttributeValue- 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 attributestrUserAttributeKey- 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.
-
-