fr.paris.lutece.plugins.crm.service.user
Class CRMUserAttributesService

java.lang.Object
  extended by 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
 void create(int nIdCRMUser, String strUserAttributeKey, String strUserAttributeValue)
          Create a new user attribute
 String getAttribute(String strUserId, String strAttribute)
          
 Map<String,String> getAttributes(int nIdCRMUser)
          Get the user attributes from a given id crm user
 Map<String,String> getAttributes(String strUserId)
          
static CRMUserAttributesService getService()
          Get the instance of CRMUserAttributesService
 List<String> getUserAttributeKeyLabels(Locale locale)
          Gets the user attribute key labels.
 List<String> getUserAttributeKeys()
          Get the list of user attribute keys defined in crm.properties
 boolean isAttributeValueInUse(String strAttributeValue, String strUserAttributeKey)
          Check if a value of an attribute is used by a user for a given attribute key
 void remove(int nIdCRMUser)
          Remove the user attributes of the crm user
 void setCRMUserService(CRMUserService crmUserService)
          Set the CRMUserService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
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.


Copyright © 2013 Mairie de Paris. All Rights Reserved.