Class Member

All Implemented Interfaces:
EditableData, JcmsConstants, ImportConstants, MashupConstants, Storable, JaliosConstants, LangPropertyArgument, Cloneable, Comparable<BasicStorable>
Direct Known Subclasses:
DBMember

public class Member extends Data implements EditableData
A Member object contains a set of information about a JCMS referenced user.
Author:
Olivier Dedieu, Olivier Jaquemet
See Also:
  • Field Details

    • USE_CATEGORY_GROUP_AND_MEMBER

      public static final int USE_CATEGORY_GROUP_AND_MEMBER
      See Also:
    • USE_CATEGORY_MEMBER_ONLY

      public static final int USE_CATEGORY_MEMBER_ONLY
      See Also:
    • USE_CATEGORY_GROUP_ONLY

      public static final int USE_CATEGORY_GROUP_ONLY
      See Also:
    • USAGE_ACCOUNT

      public static final int USAGE_ACCOUNT
      See Also:
    • USAGE_CONTACT

      public static final int USAGE_CONTACT
      See Also:
    • UGC_COUNT_LIMIT_THREAD

      public static final int UGC_COUNT_LIMIT_THREAD
      See Also:
    • CTX_SKIP_ACTIVITY

      public static final String CTX_SKIP_ACTIVITY
      See Also:
    • FEATURE_CADDY_ACL

      public static final String FEATURE_CADDY_ACL
      See Also:
    • DISABLED_PASSWORD

      public static final String DISABLED_PASSWORD
      The value to use in a Member's password to indicate that the member is disabled and should not be allowed to log in.
      See Also:
    • DELETE_PHOTO_ON_DISABLE_PROP

      public static final String DELETE_PHOTO_ON_DISABLE_PROP
      Specify if member photo must be deleted on opDisable.
      Since:
      jcms-10.0.8 JCMS-10422
      See Also:
    • EXTERNAL_PASSWORD

      public static final String EXTERNAL_PASSWORD
      Specify this value as parameter of setPassword(String) :
      • To indicate that user is enabled, but with an authentication handled through an external authentication system (ie user cannot sign in using local login/password).
      • To set the password field value with a random UUID (the value WILL NOT be valid password as it is NOT a bcrypt hash)
      See Also:
    • GUEST_GROUP_VID

      public static final String GUEST_GROUP_VID
      The CollaborativeSpace's Guest Group virtual identifier property.
      Since:
      jcms-9.0.1
      See Also:
    • DO_NOT_REASSIGN_PUBLICATION

      public static final String DO_NOT_REASSIGN_PUBLICATION
      When a member is deleted his publications are reassigned to the workspace admin or the default admin. To avoid a publication to be reassigned, put an extraInfo {DO_NOT_REASSIGN_PUBLICATION, Boolean.TRUE} in this pub.
      See Also:
    • CTX_SKIP_DUPLICATE_LOGIN_CHECK

      public static final String CTX_SKIP_DUPLICATE_LOGIN_CHECK
      Add this attribute in the context map with a true boolean value, to skip the duplicate login verification in checkIntegrity
      See Also:
    • CTX_SKIP_DUPLICATE_EMAIL_CHECK

      public static final String CTX_SKIP_DUPLICATE_EMAIL_CHECK
      Add this attribute in the context map with a true boolean value, to skip the duplicate email verification in checkIntegrity
      See Also:
    • usage

      protected int usage
    • login

      protected String login
    • password

      protected String password
    • name

      protected String name
    • firstName

      protected String firstName
    • salutation

      protected String salutation
    • organization

      protected String organization
    • department

      protected String department
    • jobTitle

      protected String jobTitle
    • email

      protected String email
    • isEmailVisible

      protected boolean isEmailVisible
    • phone

      protected String phone
    • mobile

      protected String mobile
    • street

      protected String street
    • postalCode

      protected String postalCode
    • poBox

      protected String poBox
    • region

      protected String region
    • locality

      protected String locality
    • country

      protected String country
    • zoneId

      protected ZoneId zoneId
    • address

      protected String address
    • info

      protected String info
    • photo

      protected String photo
    • declaredGroups

      protected Group[] declaredGroups
    • isAdmin

      protected boolean isAdmin
    • assistant

      protected Member assistant
    • assistantDBID

      protected String assistantDBID
    • declaredManager

      protected Member declaredManager
    • declaredManagerDBID

      protected String declaredManagerDBID
    • clearanceLevel

      protected int clearanceLevel
    • ldapSync

      protected boolean ldapSync
    • lastLdapSynchro

      protected Date lastLdapSynchro
    • rightFromClassMap

      protected HashMap<String,DataRight> rightFromClassMap
    • useCategoryMode

      protected int useCategoryMode
    • language

      protected String language
    • notification

      protected Notification notification
    • useCategorySet

      protected TreeSet<Category> useCategorySet
    • readCategorySet

      protected TreeSet<Category> readCategorySet
    • delegateMemberSet

      protected TreeSet<Member> delegateMemberSet
    • delegateMemberSetDBID

      protected HashSet<String> delegateMemberSetDBID
    • encodedAlertRules

      protected String encodedAlertRules
    • groups

      protected transient Group[] groups
    • canPublishContent

      protected transient boolean canPublishContent
    • canUpdateDeleteContent

      protected transient boolean canUpdateDeleteContent
    • canEditCategories

      protected transient boolean canEditCategories
    • canManageContentStaled

      protected transient boolean canManageContentStaled
    • fullName

      protected transient String fullName
    • fullEmail

      protected transient String fullEmail
    • locale

      protected transient Locale locale
    • isWorkspaceSetUpToDate

      protected transient boolean isWorkspaceSetUpToDate
    • alertRuleSet

      protected transient Set<AlertRule> alertRuleSet
    • delegateMbrIdSet

      protected transient Set<String> delegateMbrIdSet
    • delegateMbrIdSetInit

      protected transient boolean delegateMbrIdSetInit
    • MEMBER_STATUS_OFFLINE

      public static final int MEMBER_STATUS_OFFLINE
      See Also:
    • MEMBER_STATUS_ONLINE

      public static final int MEMBER_STATUS_ONLINE
      See Also:
    • MEMBER_STATUS_AWAY

      public static final int MEMBER_STATUS_AWAY
      See Also:
    • MEMBER_STATUS_DND

      public static final int MEMBER_STATUS_DND
      See Also:
    • ASYNC_DELETE

      public static final String ASYNC_DELETE
      Name of context map attribute that can be specified when invoking performDelete(Member, Map) to explicitely request If context map attribute is not specified, the default behavior can be configured with property member.async-delete.enabled: true
      Since:
      10.0.7 / JCMS-9292
      See Also:
    • PHOTO_DELETE

      public static final String PHOTO_DELETE
      Name of context map attribute that can be specified when invoking performDelete(Member, Map) to explicitely request If context map attribute is not specified, the default behavior can be configured with value true
      Since:
      11.0.0 / JCMS-11542
      See Also:
    • EXTRADBDATA_LAST_LOGIN_TIME

      @Deprecated public static final String EXTRADBDATA_LAST_LOGIN_TIME
      Deprecated.
      since JCMS-6281, last login time are store in dedicated table
      The extra data name for the last login time value.
      Since:
      jcms-6.0.0
      See Also:
    • MAX_LAST_LOGIN_DATE_HISTORY

      @Deprecated public static int MAX_LAST_LOGIN_DATE_HISTORY
      Deprecated.
      since JCMS-6281. Read max login through property "member.max-last-login-date"
      The maximum number of Date to keep in the last login date Set.

      member.max-last-login-date

      Since:
      jcms-6.0.1
    • IGNORE_LOGIN_DATE

      public static final String IGNORE_LOGIN_DATE
      It is possible to specify the date must not be registered, by setting the request attribute with this key and Boolean.TRUE as value.
      Since:
      jcms-6.1.0
      See Also:
  • Constructor Details

    • Member

      public Member()
    • Member

      public Member(Member other)
      Constructor by copy : creates a new instance of Member from the specified Member.

      Warning : Do not use this constructor to create an update instance for a DBMember, instead use getUpdateInstance() :

       Member updated = (Member) member.getUpdateInstance();
       update.performUpdate(...)
       
      Parameters:
      other - the member to copy, must not be null.
  • Method Details

    • getUpdateInstance

      public Data getUpdateInstance()
      Description copied from class: Data
      Returns an instance of this object to update it.
      Overrides:
      getUpdateInstance in class Data
      Returns:
      an instance of this object to update it.
    • getFieldValue

      public Object getFieldValue(String fieldName, String lang, boolean useDefault) throws NoSuchFieldException
      Gets the Object value of the given field name for this Member.
      Overrides:
      getFieldValue in class Data
      Parameters:
      fieldName - the field name from which to retrieve the field value.
      lang - the language (ISO-639 code) in which to retrieve the field value (used only for multilingual fields).
      useDefault - whether to use the publication main language if the field value is not available in the requested language (used only for multilingual fields).
      Returns:
      the Object field value
      Throws:
      NoSuchFieldException - if the field was not found in the given Publication.
      Since:
      jcms-7.0.0
    • getDefaultFieldStatus

      protected Map<String,FieldStatus> getDefaultFieldStatus(Member mbr)
      Description copied from class: Data
      Return a default Map of fieldname to FieldStatus when fields are displayed for the specified member editing this Data.
      Overrides:
      getDefaultFieldStatus in class Data
      Parameters:
      mbr - the member editing this data, may be null
      Returns:
      never return null, default implementation is to return a new empty map instance
    • setFieldValue

      public void setFieldValue(String fieldName, Object value, String lang) throws NoSuchFieldException
      Sets the value of the given Object field name for the current Member.
      If the field is multilingual, the given language will be used.
      Do not retrieve Category fields, see #getCategoryFieldValue(String, Member).
      Overrides:
      setFieldValue in class Data
      Parameters:
      fieldName - the field name from which to retrieve the field value.
      value - whether to use the publication main language if the field value is not available in the requested language (used only for multilingual fields).
      lang - the language (ISO-639 code) in which to retrieve the field value (used only for multilingual fields).
      Throws:
      NoSuchFieldException - if the field was not found in the given Data.
      Since:
      jcms-7.0.0
    • toString

      public String toString()
      Overrides:
      toString in class Data
    • toFullString

      public String toFullString()
      Overrides:
      toFullString in class Data
    • toCSV

      public String toCSV(String lang)
      Returns a CSV view of this object
      Overrides:
      toCSV in class Data
      Parameters:
      lang - the output language
      Returns:
      a CSV view of this object
      Since:
      jcms-5.0.0
    • getPublicationCount

      public int getPublicationCount()
      Returns:
      the number of publications authored by this member.
    • getCSVHeader

      public static String getCSVHeader(String lang)
      Returns the CSV header of this object
      Parameters:
      lang - the output language
      Returns:
      the CSV header of this object
      Since:
      jcms-5.0.0
    • isImportEnabled

      public static boolean isImportEnabled()
      Returns:
      true if property member.csv-import.enabled is true, false by default
      Since:
      jcms 10.0.8
    • fillExportXmlFieldAttributes

      public void fillExportXmlFieldAttributes(StringBuffer sb)
      Fill the given string buffer with specific attributes of this data.
      Overrides:
      fillExportXmlFieldAttributes in class Data
      Parameters:
      sb - the StringBuffer
      Since:
      jcms-5.7.1
      See Also:
    • exportXmlField

      public void exportXmlField(StringBuffer sb, int indentLevel)
      Description copied from class: Data
      Fills the given StringBuffer with Xml export of fields of this data.
      Overrides:
      exportXmlField in class Data
      Parameters:
      sb - the StringBuffer
      indentLevel - the indent level
    • getFullName

      public String getFullName()
      Returns:
      the full name of the member (first name + name)
      Since:
      jcms-4.0
    • getUsageLabel

      public String getUsageLabel(String userLang)
      Parameters:
      userLang - the user language
      Returns:
      the usage label of the member (Guest / Contact)
      Since:
      jcms-11.0.0
    • getIcon

      public String getIcon()
      Returns:
      String the image path for the icon
      Since:
      jcms-5.0.0
    • getDataIcon

      public String getDataIcon()
      Description copied from class: Data
      Returns source information for the icon associated to this Data, either a relative path or sprite classes name.

      If this method behavior has not been overriden by subclass, the default icon can be declared using property types.{Type}.icon, where {Type} is the short class name of the type concerned.

      • Either by specifying a relative image path :
        types.Article.icon: images/jalios/icon/abstract.gif 
      • or else by using a sprite icon :
        types.Article.icon: ss_sprite ss_date
      Overrides:
      getDataIcon in class Data
      Returns:
      a relative path (eg images/jalios/icon/abstract.gif) or sprite classes name (eg ss_sprite ss_date).
      See Also:
    • getIcon

      public String getIcon(Workspace ws)
      Parameters:
      ws - the current Workspace
      Returns:
      String the image path for the icon
      Since:
      jcms-5.0.0
    • getDataIconHtml

      public String getDataIconHtml(String userLang)
      Description copied from class: Data
      Returns the HTML code of the icon for this data in the specified language.

      This method uses value returned by methods Data.getDataIcon(), Data.getDataIconAlt(String) and Data.getDataIconTitle(String) to build an HTML IMG tag.

      Overrides:
      getDataIconHtml in class Data
      Parameters:
      userLang - the user language.
      Returns:
      the HTML code of the icon for this data.
      See Also:
    • getHtmlIcon

      public String getHtmlIcon(String userLang)
      Return the img tag for the icon
      Parameters:
      userLang - the current language
      Returns:
      the img tag for the icon
      Since:
      jcms-5.0.0
    • getHtmlIcon

      public String getHtmlIcon(Workspace ws, String userLang)
      Return the img tag for the icon
      Parameters:
      ws - the current Workspace
      userLang - the current language
      Returns:
      the img tag for the icon
      Since:
      jcms-5.0.0
    • getIconParameter

      protected String[] getIconParameter(Workspace ws, String userLang)
      Return a String[2]: Title / Alt for the given parameters
      Parameters:
      ws - the Workspace or Null
      userLang - the UserLang or null
      Returns:
      a String[2]
      Since:
      jcms-5.0.0
    • getStatus

      public int getStatus()
      Return an interger Status of the Member
      Returns:
      int the Member status
      Since:
      jcms-7.0.0
    • canRead

      public boolean canRead(Group grp)
      This convenient method checks if this member can read a group.
      Parameters:
      grp - the group
      Returns:
      tur if this member can read the group.
      Since:
      jcms-7.1.0
    • canRead

      public boolean canRead(Category cat, boolean searchInGroups, boolean searchInParent)
      This convenient method checks if a member can read a categorie.
      Parameters:
      cat - the categorie
      searchInGroups - if true check if one of the group this member belongs to is authorized to read the categorie.
      searchInParent - if true check right on parent categories
      Returns:
      true if this member can read the categorie
      Since:
      jcms-4.1
      See Also:
    • canRead

      public boolean canRead(Publication pub, boolean searchInGroups)
      This convenient method checks if a member can read a publication.
      Parameters:
      pub - the publication
      searchInGroups - if true check if one of the group this member belongs to is authorized to read the publication.
      Returns:
      true if this member can read the publication
      Since:
      jcms-2.1
      See Also:
    • canPublishContent

      public boolean canPublishContent()
      Checks if if this member can publish something else than UGC.
      Returns:
      true if this member can publish something else than UGC.
      Since:
      jcms-3.0
    • canPublishContent

      public boolean canPublishContent(Workspace ws)
      Checks if if this member can publish something else than UGC.
      Parameters:
      ws - the Workspace to work on
      Returns:
      true if this member can publish something else than UGC.
      Since:
      jcms-5.0.0
    • canUpdateDeleteContent

      public boolean canUpdateDeleteContent()
      Returns:
      true if this member has the "update other" / "delete other" right" on at least one CPT.
      Since:
      jcms-3.0
    • canUpdateDeleteContent

      public boolean canUpdateDeleteContent(Workspace ws)
      Check if member can perform Update or Delete for the gicen Workspace
      Parameters:
      ws - the Workspace to ckeck
      Returns:
      true if this member has the "update other" / "delete other" right" on at least one CPT.
      Since:
      jcms-5.0.0
    • invalidateCanManageContent

      public void invalidateCanManageContent()
      Invalidate the current status of canManageContent (the next time it will be called, it will be computed).
      Since:
      jcms-3.0
    • canPublishSome

      public boolean canPublishSome(Class<?> clazz)
      Check if this member can publish on this class or one of it's subclass
      Parameters:
      clazz - the class to be checked
      Returns:
      true if this member can publish on this class or one of it's subclass
      Since:
      jcms-4.0
    • canPublishSome

      public boolean canPublishSome(Class<?> clazz, Workspace ws)
      Check if this member can publish on this class or one of it's subclass in the given workspace.
      Parameters:
      clazz - the class to be checked
      ws - the workspace to be checked
      Returns:
      true if this member can publish on this class or one of it's subclass
      Since:
      jcms-5.0.5
    • canPublishSome

      public boolean canPublishSome(Class<?> clazz, Workspace ws, Map<String,?> contextMap)
      Check if this member can publish on this class or one of it's subclass in the given workspace.
      Parameters:
      clazz - the class to be checked
      ws - the workspace to be checked
      contextMap - an optional context map providing information on publish request context, may be null
      Returns:
      true if this member can publish on this class or one of it's subclass
      Since:
      jcms-10.0.6 / JCMS-8882
    • canPublishAll

      public boolean canPublishAll(Class<?> clazz)
      Check if this member can publish on this class and all it's subclass
      Parameters:
      clazz - the class to be checked
      Returns:
      true if this member can publish on this class and all it's subclass
      Since:
      jcms-4.0
    • canPublish

      public boolean canPublish(Class<?> clazz)
      Check if this member can publish the specified class of publication in at least one of his workspaces.
      Parameters:
      clazz - a publication class to test (eg Article.class, FileDocument.class, ...)
      Returns:
      true if member has right to publish an instance of such class in one of his workspaces.
      Since:
      jcms-3.0
      See Also:
    • canPublish

      public boolean canPublish(Class<?> clazz, Workspace ws)
      Check if this member can publish the specified class of publication in the specified workspace.
      Parameters:
      clazz - a publication class to test (eg Article.class, FileDocument.class, ...)
      ws - the Workspace in which to check publish right
      Returns:
      true if member has right to publish an instance of such class in the given workspace
      Since:
      jcms-4.1
      See Also:
    • canPublish

      public boolean canPublish(Class<?> clazz, Workspace ws, Map<String,?> contextMap)
      Check if this member can publish the specified class of publication in the specified workspace.
      Parameters:
      clazz - a publication class to test (eg Article.class, FileDocument.class, ...)
      ws - the Workspace in which to check publish right
      contextMap - an optional context map providing information on publish request context, may be null
      Returns:
      true if member has right to publish an instance of such class in the given workspace
      Since:
      jcms-10.0.6 / JCMS-8882
      See Also:
    • canPublish

      public boolean canPublish(Class clazz, Set<? extends Workspace> workspaceSet)
      Check if this member can publish the specified class of publication in at least one of the workspaces specified.

      As of current implementation, a member can publish the class of publication in a workspace if :

      • workspace is not closed
      • publication type is enabled in workspace
      • member is an admin, OR member has the publish rights for this class, or belongs to at least one group that have to publish for this class

      These rules may be modified by RightPolicyFilter.canPublish(boolean, Member, Class, Set)

      Additionnal restrictions are often required by the member to create/update a publication and are verified through other ways during operation when Data.checkCreate(Member) or Data.checkUpdate(Member) is invoked.

      • ability to work on the current state of a publication given its workflow in the workspace
      • ability to use some categories
      • ...
      Parameters:
      clazz - a publication class to test (eg Article.class, FileDocument.class, ...)
      workspaceSet - the set of workspace in which to check publish right
      Returns:
      true if member has right to publish an instance of such class
      Since:
      jcms-4.1
    • canPublish

      public boolean canPublish(Class clazz, Set<? extends Workspace> workspaceSet, Map<String,?> contextMap)
      Check if this member can publish the specified class of publication in at least one of the workspaces specified.

      As of current implementation, a member can publish the class of publication in a workspace if :

      • workspace is not closed
      • publication type is enabled in workspace
      • member is an admin, OR member has the publish rights for this class, or belongs to at least one group that have to publish for this class

      These rules may be modified by RightPolicyFilter.canPublish(boolean, Member, Class, Set)

      Additionnal restrictions are often required by the member to create/update a publication and are verified through other ways during operation when Data.checkCreate(Member) or Data.checkUpdate(Member) is invoked.

      • ability to work on the current state of a publication given its workflow in the workspace
      • ability to use some categories
      • ...
      Parameters:
      clazz - a publication class to test (eg Article.class, FileDocument.class, ...)
      workspaceSet - the set of workspace in which to check publish right
      contextMap - an optional context map providing information on publish request context, may be null
      Returns:
      true if member has right to publish an instance of such class
      Since:
      jcms-10.0.6 / JCMS-8882
    • internalCanPublish

      protected boolean internalCanPublish(Class<?> clazz, Set<? extends Workspace> workspaceSet)
    • canPublish

      public boolean canPublish(Data data)
      Convenient method
      Parameters:
      data - the Data to check
      Returns:
      true if the member can publish the class of the given data class
      See Also:
    • canArchive

      public boolean canArchive(Publication pub)
      Check if the member is in a role that can archive the given publication. It checks if the member has the right to put this publication in the archived state in the workflow of the publication, but it does not take into account the current state of the publication.
      Parameters:
      pub - the publication to check
      Returns:
      true if it can archive the publication false otherwise
    • canUpdateOther

      public boolean canUpdateOther(Class<?> clazz)
    • internalCanUpdateDeleteOtherCommon

      protected boolean internalCanUpdateDeleteOtherCommon(Class<?> clazz, Workspace ws, boolean checkUpdate)
    • canUpdateOther

      public boolean canUpdateOther(Class<?> clazz, Workspace ws)
      Check if this member can update content of the specified class, published by other user, in the given workspace.
      Parameters:
      clazz - the class to be checked
      ws - the workspace to be checked
      Returns:
      true if this member can update on this class or one of it's subclass
    • canUpdateOther

      public boolean canUpdateOther(Class<?> clazz, Workspace ws, Map<String,?> contextMap)
      Check if this member can update content of the specified class, published by other user, in the given workspace.
      Parameters:
      clazz - the class to be checked
      ws - the workspace to be checked
      contextMap - an optional context map providing information on update request context, may be null
      Returns:
      true if this member can update on this class or one of it's subclass
      Since:
      jcms-10.0.6 / JCMS-8882
    • canUpdateOther

      public boolean canUpdateOther(Data data)
    • canUpdateOther

      public boolean canUpdateOther(Data data, RightInfo rightInfo)
    • internalCanUpdateOther

      protected boolean internalCanUpdateOther(Data data, RightInfo rightInfo)
    • checkManagerInRole

      public boolean checkManagerInRole(Publication pub)
      Check if this Member is an authorized manager actor in the current workflow state of the specified publication.

      In current implementation, the following condition are required :

      • the manager has been declared as a member of the role corresponding to the current publication's state
      • this member is the manager of the publication, as determined by WorkflowManager.getManager(Publication)
      Parameters:
      pub - the publication (false is returned if null is specified)
      Returns:
      true if this Member is a manager allowed to work in specified publication state, false otherwise
      Since:
      jcms-10.0.4 / JCMS-7967
      See Also:
    • canDeleteOther

      public boolean canDeleteOther(Data data)
    • canDeleteOther

      public boolean canDeleteOther(Data data, RightInfo rightInfo)
    • internalCanDeleteOther

      protected boolean internalCanDeleteOther(Data data, RightInfo rightInfo)
    • canDeleteOther

      public boolean canDeleteOther(Class<?> clazz)
    • canDeleteOther

      public boolean canDeleteOther(Class<?> clazz, Workspace ws)
      Check if this member can delete content of the specified class, published by other user, in the given workspace.
      Parameters:
      clazz - the class to be checked
      ws - the workspace to be checked
      Returns:
      true if this member can delete on this class or one of it's subclass
    • canDeleteOther

      public boolean canDeleteOther(Class<?> clazz, Workspace ws, Map<String,?> contextMap)
      Check if this member can delete content of the specified class, published by other user, in the given workspace.
      Parameters:
      clazz - the class to be checked
      ws - the workspace to be checked
      contextMap - an optional context map providing information on delete request context, may be null
      Returns:
      true if this member can delete on this class or one of it's subclass
      Since:
      jcms-10.0.6 / JCMS-8882
    • getRight

      public DataRight getRight(Data data)
    • getRight

      public DataRight getRight(Class<?> clazz, boolean searchInGroups)
      Search for a Right object bound to clazz or one of its super class. If none right are found, search in the groups rights.
      Parameters:
      clazz - the Class the right is searched for
      searchInGroups - if true, the search will be continued in the groups rights if none member rights have been found
      Returns:
      the Right object bound to the clazz (or null if none)
    • getRight

      public DataRight getRight(Class<?> clazz, boolean searchInGroups, Workspace ws)
      Search for a Right object bound to clazz or one class. If none right are found, search in the groups rights of the given workspace. If searchInGroups is false and result is null, that means for that member, the DataRight has to be looked for in the groups.
      Parameters:
      clazz - the Class the right is searched for
      searchInGroups - if true, the search will be continued in the groups rights if none member rights have been found
      ws - only used if searchInGroups true. If ws is null, search in the global groups otherwise search in groups of ws.
      Returns:
      the Right object bound to the clazz (or null if none)
      Since:
      jcms-4.1
    • canWorkOn

      public boolean canWorkOn(Publication pub)
      Check if this member can work on the given publication (ie, if it has the rights and if it is in a state the member can work in).
      Parameters:
      pub - the publication
      Returns:
      true if the member can work on the publication
      Since:
      jcms-3.0
    • canWorkOn

      public boolean canWorkOn(Publication pub, RightInfo rightInfo)
    • isWorker

      public boolean isWorker()
      Check if this member can work either on publications or on categories (this is a convenient method wich performs a 'or' on the values returned by canPublishContent(), canUpdateDeleteContent() and canEditCategories()).
      Returns:
      true if the member can work at least on one publication type (except review) or he can edit the categories.
      Since:
      jcms-4.0
      See Also:
    • internalIsWorker

      protected boolean internalIsWorker()
    • isWorker

      public boolean isWorker(Workspace ws)
      Check if this member can work either on publications or on categories (this is a convenient method wich performs a 'or' on the values returned by canPublishContent(Workspace), canUpdateDeleteContent(Workspace) and canEditCategories()).
      Parameters:
      ws - the workspace to check
      Returns:
      true if the member can work at least on one publication type (except review) or he can edit the categories.
      Since:
      jcms-5.0.0
      See Also:
    • internalIsWorker

      protected boolean internalIsWorker(Workspace ws)
    • getEditCategoryMode

      public int getEditCategoryMode()
    • isAdmin

      public boolean isAdmin(Workspace ws)
      Returns true if this member is an administrator of the given workspace
      Parameters:
      ws - the workspace to be checked
      Returns:
      true if this member is an administrator of the given workspace
      Since:
      jcms-4.1
    • hasExplicitRights

      public boolean hasExplicitRights()
    • canUseCaddy

      public boolean canUseCaddy()
    • isDisabled

      public boolean isDisabled()
      Check if this member account has been disabled.

      Returns:
      true if the account is disabeld
      Since:
      jcms-4.0
    • disable

      public void disable()
      Disable this account.

      This method disables the account by setting the password field value of this Member to constant DISABLED_PASSWORD.

      Important : LDAP account disable status is automatically managed by LDAP synchronization ; Member is disabled when account cannot be found on LDAP, and is enabled again when account is found.
      To definitively disable an LDAP account you MUST detach the Member from the LDAP synchronization :

       mbr.setLastLdapSynchro(null); // cancel the LDAP status of the member
       mbr.setLdapSync(false); // prevent further LDAP synchronization attempt
       
      Since:
      jcms-4.0.2
    • isLdapAccount

      public boolean isLdapAccount()
      Check if this member account has been created from LDAP or synchronized with LDAP.

      Implementation detail : a Member is considered as an LDAP account if and only if its last LDAP synchronization date (getLastLdapSynchro()) is not null.

      Returns:
      boolean true if it is an LDAP Account
      Since:
      jcms-4.0
    • isGuest

      public boolean isGuest()
      Check if this member belongs to the CollaborativeSpace's Guests Group.
      Returns:
      boolean true if it is a Guest account.
      Since:
      jcms-9.0.1
      See Also:
    • getLastLdapSynchro

      public Date getLastLdapSynchro()
      Get the Date of the last LDAP synchronization of this member.

      Returns:
      a Date or null if member was never synchronized with LDAP
      Since:
      jcms-4.0
    • setLastLdapSynchro

      public void setLastLdapSynchro(Date lastSyncDate)
      Set the Date of the last LDAP synchronization of this member.
      Parameters:
      lastSyncDate - a Date or null
      Since:
      jcms-4.0
    • getLdapSync

      public boolean getLdapSync()
      Returns:
      true if this member is allowed to be synchronized with ldap.
      Since:
      JCMS-2450
    • setLdapSync

      public void setLdapSync(boolean ldapSync)
      Set if this Member should be synchronized with ldap or not.
      Parameters:
      ldapSync - true if LDAP synchronization of this Member should be performed if needed, false otherwise.
      Since:
      JCMS-2450
    • isEmailVisible

      public boolean isEmailVisible()
      Retrieves whether this member's email is visible to other members or not.
      Returns:
      true if it is visible, false otherwise
    • setEmailVisible

      public void setEmailVisible(boolean visible)
      Sets whether this member's email is visible to other members or not.
      Parameters:
      visible - true if it is visible, false otherwise
    • belongsToGroup

      public boolean belongsToGroup(Group group)
      This convenient method returns true if this member belongs to a given group.
      Parameters:
      group - the group
      Returns:
      true if this member belongs to the given group, false otherwise.
      Since:
      jcms-2.1
    • belongsToGroup

      public boolean belongsToGroup(Group[] grps)
      This convenient method returns true if this member belongs to at least one of the given groups.
      Parameters:
      grps - the groups to be checked
      Returns:
      true if this member belongs to one of the given groups, false otherwise.
      Since:
      jcms-3.0
    • getCookieMaxAge

      public int getCookieMaxAge()
      Return the lowerest cookieMaxAge value of the groups the member belongs to.
      Returns:
      the cookie max-age value in seconds.
      Since:
      jcms-2.1
    • getGroups

      public Group[] getGroups()
      Returns all the groups this member belongs to.
      Returns:
      all the groups this member belongs to.
      Since:
      jcms-5.6.0
    • getGroupSet

      public Set<Group> getGroupSet(Workspace ws)
      Returns the groups of the given workspace the member belongs to.
      Parameters:
      ws - the workspace
      Returns:
      the groups of the given workspace the member belongs to.
      Since:
      jcms-7.0.0
    • isDeclaredGroup

      public boolean isDeclaredGroup(Group group)
      Returns true if the given group is a declared groups.
      Parameters:
      group - the group to be tests.
      Returns:
      true if the given group is a declared groups.
      Since:
      jcms-5.6.0
    • refreshGroups

      public void refreshGroups()
      Refresh the groups (force groups to be inferred from declared groups)
      Since:
      jcms-5.6.0
    • getDeclaredGroups

      public Group[] getDeclaredGroups()
      Get the value of declaredGroups.
      Returns:
      Value of declaredGroups.
      Since:
      jcms-5.6.0
      See Also:
    • getDeclaredGroupSet

      public Set<Group> getDeclaredGroupSet()
      Get the value of declaredGroups ordered by name.

      Returns an empty collection if declared groups are null.

      Returns:
      Value of declaredGroups.
      Since:
      jcms-10.0.4
      See Also:
    • getDeclaredGroupSet

      public Set<Group> getDeclaredGroupSet(Comparator<Group> comp)
      Get the value of declaredGroups ordered by given comparator.

      Returns an empty collection if declared groups are null.

      Parameters:
      comp - the comparator to use to sort the set. If null, defaults using a Name comparator.
      Returns:
      Value of declaredGroups.
      Since:
      jcms-10.0.4
      See Also:
    • setDeclaredGroups

      public void setDeclaredGroups(Group[] v)
      Set the value of declaredGroups.
      Parameters:
      v - Value to assign to declaredGroups.
      Since:
      jcms-5.6.0
    • addGroup

      public void addGroup(Group group)
      Add this member to a given group (this changes is not saved)
      Parameters:
      group - the group to be added.
      Since:
      jcms-5.6.2
    • removeGroup

      public void removeGroup(Group group)
      Remove this member from a given group(this changes is not saved)
      Parameters:
      group - the group to be removed.
      Since:
      jcms-5.6.2
    • hasRead

      public boolean hasRead(Publication pub)
      Check if the given publication has been read by this member
      Parameters:
      pub - the publication read
      Returns:
      true if readed false instead
      Since:
      jcms-4.0.2
      See Also:
    • getNotification

      public Notification getNotification()
      Get the Notification
      Returns:
      the notification
    • setNotification

      public void setNotification(Notification notification)
      Sets the Notification
      Parameters:
      notification - the notification
      Since:
      jcms-4.0
    • canEditCategories

      public boolean canEditCategories()
      Check if the member can edit categories. Caution: the semantics of this method changed since jcms-3.0. To have fine grain information, please use getCategoryRootSet() method.
      Returns:
      true if the member can edit at least on root of category
      See Also:
    • canEditCategories

      public boolean canEditCategories(Workspace ws)
      Return true if this member can edit at least one category of this workspace
      Parameters:
      ws - the Workspace to check with
      Returns:
      true if this member can edit at least one category of this workspace
      See Also:
    • getAllCategoryRootSet

      public Set<Category> getAllCategoryRootSet()
      Returns all the categories root this member can manage (ie either those declared on the member, on its group or on the categories)
      Returns:
      all the categories root this member can manage (ie either those declared on the member, on its group or on the categories)
      Since:
      jcms-10.0.5
    • getCategoryRootSet

      public Set<Category> getCategoryRootSet()
      Returns the set of category roots the member can manage.
      Returns:
      a Set of Category (or an empty set if this member has no category right)
    • getCategoryRootSet

      public Set<Category> getCategoryRootSet(Workspace ws)
      Returns the set of category roots the member can manage in a given workspace.
      Parameters:
      ws - the Workspace to be test (null for all workspace)
      Returns:
      a Set of Category (or an empty set if this member has no category right)
    • canManageCategory

      public boolean canManageCategory(Category cat)
      Check if the member can manage the given category (ie if the given category is a descendant of one of the member's root category)
      Parameters:
      cat - the category to test
      Returns:
      true if this member can manage the category
      Since:
      jcms-3.0
    • canManageCategory

      public boolean canManageCategory(Category cat, boolean searchInGroups, boolean searchInParent)
      Check if the member can manage the given category (ie if the given category is a descendant of one of the member's root category)
      Parameters:
      cat - the category to test
      searchInGroups - if true check if one of the group this member belongs to is authorized to read the categorie.
      searchInParent - if true check right on parent categories
      Returns:
      true if this member can manage the category
      Since:
      jcms-4.1
    • internalCanManageCategory

      protected boolean internalCanManageCategory(Category cat, boolean searchInGroups, boolean searchInParent)
    • canCreateWorkspace

      public boolean canCreateWorkspace()
      Check if the member can create a workspace
      Returns:
      true if this member can create a Workspace
      Since:
      jcms-5.7.3
    • canCreateWorkspace

      public boolean canCreateWorkspace(Workspace model)
      Check if the member can duplicate the model to create a workspace
      Parameters:
      model - the workspace to duplicate
      Returns:
      true if this member can create a Workspace from the model
      Since:
      jcms-5.7.3
    • internalCanCreateWorkspace

      protected boolean internalCanCreateWorkspace(Workspace model)
    • canCreateContact

      public boolean canCreateContact()
      Check if this member can create a new contact
      Returns:
      true if this member can create a new contact
      Since:
      jcms-8.0.0
    • getExpandedUseCategorySet

      public TreeSet<Category> getExpandedUseCategorySet()
      Return the category set this member can use according his category use mode (group, member or group and member).

      This method include use right specified on categories themself (since JCMS-8769)

      Returns:
      a TreeSet of category this member can use
      Since:
      jcms-4.0
    • canUseCategory

      public boolean canUseCategory(Category cat)
      Check if this member can use the given category.
      Parameters:
      cat - the category to check
      Returns:
      true if this member can use the given category.
      Since:
      jcms-4.0
      See Also:
    • canUseCategory

      public boolean canUseCategory(Category cat, boolean searchInGroups, boolean searchInParent)
      Check if this member can use the given category.

      Use of a Category:

      • that cannot be read by member is refused
      • that is not selectable is refused.
      Note: use of any category is always granted for central admins.
      Parameters:
      cat - the category to check
      searchInGroups - if true check if one of the group this member belongs to is authorized to read the categorie.
      searchInParent - if true check right on parent categories
      Returns:
      true if this member can use the given category.
      Since:
      jcms-5.5.0
    • internalCanUseCategory

      protected boolean internalCanUseCategory(Category cat, boolean searchInGroups, boolean searchInParent)
    • canUseDescendantCategories

      public boolean canUseDescendantCategories(Category cat, boolean checkRoot)
      Check if this member can use at least one descendant of the given category.
      Parameters:
      cat - the category to check
      checkRoot - if true check also the given category
      Returns:
      true if this member can use at least one descendant of the given category.
      Since:
      jcms-4.0
    • getUseCategorySet

      public TreeSet<Category> getUseCategorySet()
      Get the value of useCategorySet.
      Returns:
      Value of useCategorySet.
      Since:
      jcms-4.0
    • setUseCategorySet

      public void setUseCategorySet(TreeSet<Category> v)
      Set the value of useCategorySet.
      Parameters:
      v - Value to assign to useCategorySet.
      Since:
      jcms-4.0
    • getUseCategoryMode

      public int getUseCategoryMode()
      Get the value of useCategoryMode.
      Returns:
      Value of useCategoryMode.
      Since:
      jcms-4.0
    • setUseCategoryMode

      public void setUseCategoryMode(int v)
      Set the value of useCategoryMode.
      Parameters:
      v - Value to assign to useCategoryMode.
      Since:
      jcms-4.0
    • getUsage

      public int getUsage()
      Get the value of usage.
      Returns:
      the value of usage (ie: Account or Contact).
      Since:
      jcms-6.1.0
    • setUsage

      public void setUsage(int usage)
      Set the value of usage (ie: Account or Contact).
      Parameters:
      usage - value to assign to usage, choose from USAGE_ACCOUNT or USAGE_CONTACT
      Since:
      jcms-6.1.0
    • getUsageName

      public String getUsageName(String lang)
      Returns the name of the usage (eg: Account, Contact).
      Parameters:
      lang - the language code (ISO-639) in which you would like to retrieve the usage
      Returns:
      the name of the usage.
      Since:
      jcms-6.1.0
    • isAccount

      public boolean isAccount()
      Returns true if this Member's usage is USAGE_ACCOUNT.
      Returns:
      true if getUsage() is USAGE_ACCOUNT, otherwise false.
    • isAllAuthentication

      public boolean isAllAuthentication()
      Check if this Member support all authentication, including local password and external authentication.
      Returns:
      true if this Member is an enabled account with a valid local password, false in any other case
      Since:
      jcms-10.0.6 / JCMS-9072
    • isExternalAuthentication

      public boolean isExternalAuthentication()
      Check if this Member is an account whose authentication is not the local password.
      Returns:
      true if this Member is an enabled account without a valid local password, false in any other case
      Since:
      jcms-10.0.6 / JCMS-9072
    • isContact

      public boolean isContact()
      Returns true if this Member's usage is USAGE_CONTACT.
      Returns:
      true if getUsage() is USAGE_CONTACT, otherwise false.
    • isValidAccount

      public boolean isValidAccount()
      Returns:
      true if this member is an account and it is not disabled
      Since:
      jcms-7.1.1
    • getReadCategorySet

      public TreeSet<Category> getReadCategorySet()
      Gets the TreeSet of Category used for Publication read right. This category set contains all the categories a publication must match in order to be visible by this member.
      Returns:
      a TreeSet of Category.
      Since:
      jcms-5.5.0
    • setReadCategorySet

      public void setReadCategorySet(TreeSet<Category> v)
      Set the value of readCategorySet.
      Parameters:
      v - Value to assign to readCategorySet.
      Since:
      jcms-5.5.0
    • getDelegateMemberSet

      public TreeSet<Member> getDelegateMemberSet()
      Gets the Members allowed to login as this member using delegation.
      Returns:
      a TreeSet of Member. never return null
      Since:
      jcms-5.7.0
    • getDelegateMemberSet

      public TreeSet<Member> getDelegateMemberSet(boolean queryDB)
      Internal method used to guarantee proper access to both JStore Member and JcmsDB DBMember set in the delegated members set.
      Parameters:
      queryDB - true to include any DBMember that may have been set in delegated member, false to retrieve only JStore members
      Returns:
      a TreeSet of Member. never return null
      Since:
      jcms-10.0.3 / JCMS-7349
    • setDelegateMemberSet

      public void setDelegateMemberSet(TreeSet<Member> memberSet)
      Set which members are authorized to delegate to this member.
      Parameters:
      memberSet - A Set of member which are granted delegation right to this member.
      Since:
      jcms-5.7.0
    • getDelegateMemberSetDBID

      public HashSet<String> getDelegateMemberSetDBID()
      Internal method used to guarantee proper storage of DBMember set delegated members.
      Returns:
      an HashSet containing id of DBMember which have been set as delegated members. may return null
      Since:
      jcms-10.0.3 / JCMS-7349
    • setDelegateMemberSetDBID

      public void setDelegateMemberSetDBID(HashSet<String> idSet)
      Internal method used to guarantee proper storage of DBMember set delegated members.
      Parameters:
      idSet - an HashSet containing id of DBMember which have been set as delegated members.
      Since:
      jcms-10.0.3 / JCMS-7349
    • updateDelegationHolderSet

      public void updateDelegationHolderSet(Member mbr, boolean add)
      Internal method used to update the (transient) delegation holder set.
      Parameters:
      mbr - the member to add or remove from the delegation holder set.
      add - true -> add, false -> remove
    • getDelegationHolderSet

      public Set<Member> getDelegationHolderSet()
      Retrieves the list of member into which this member has been allowed to log in.

      Warning : If some Member have been excluded from delegation using property "auth-mgr.delegation.excluded-mbr-ids" or if a Member has been converted as a contact since it was previously authorized, this list will not filter them !
      Use either DelegationAuthenticationHandler.getDelegationHolderSet(Member) to retrieve a filtered set,
      or DelegationAuthenticationHandler.canDelegateTo(Member, Member, HttpServletRequest) if you want to perform the control yourself.

      This method can be used safely with DBMember (since jcms-10.0.3 / JCMS-7349).

      Returns:
      a TreeSet of Member (internal variable exposed, do not modify the returned set)
    • splitHybridCollections

      protected void splitHybridCollections(Data previousData)
      Description copied from class: Data
      This method must be overrided by sub-classes that are persisted in JStore and that have hybrid collection/array.
      Overrides:
      splitHybridCollections in class Data
      Parameters:
      previousData - the previous data (provided for update only)
    • cleanHybridCollections

      protected void cleanHybridCollections()
      Description copied from class: Data
      This method must be overrided by sub-classes that are persisted in JStore and that have hybrid collection/array.
      Overrides:
      cleanHybridCollections in class Data
    • getEncodedAlertRules

      public String getEncodedAlertRules()
      Returns the JSON encoded alert rule set.
      Returns:
      the JSON encoded alert rule set.
      Since:
      jcms-8.0.0
    • setEncodedAlertRules

      public void setEncodedAlertRules(String encodedAlertRules)
      Sets the JSON encoded alert rule set.
      Parameters:
      encodedAlertRules - the JSON encoded alert rule set.
      Since:
      jcms-8.0.0
    • getAlertRuleSet

      public Set<AlertRule> getAlertRuleSet()
      Returns the alert rule set.
      Returns:
      the alert rule set.
      Since:
      jcms-8.0.0
    • setAlertRuleSet

      public void setAlertRuleSet(Set<AlertRule> alertRuleSet)
      Set the alert rule set.
      Parameters:
      alertRuleSet - the alert rule set.
      Since:
      jcms-8.0.0
    • getAlertRuleSet

      public Set<AlertRule> getAlertRuleSet(boolean useDefault)
      Returns the alert rule set.
      Parameters:
      useDefault - if true and this member has no alert rule set returns the default alert rule set.
      Returns:
      the alert rule set.
      Since:
      jcms-10.0.0
    • getAlertList

      public List<Alert> getAlertList()
      Returns the alert list for this member.
      Returns:
      the alert list for this member.
      Since:
      jcms-8.0.0
    • getAlertList

      public List<Alert> getAlertList(Alert.Level level, Boolean read)
      Returns the alert list for this member.
      Parameters:
      level - the alert level. Null means any level.
      read - true for read alerts, false for not read alerts, null for read or not read alerts.
      Returns:
      the alert list for this member.
      Since:
      jcms-8.0.0
    • getLangSalutation

      public String getLangSalutation(String lang)
      Return the salutation in the given language
      Parameters:
      lang - the language
      Returns:
      the String bound to the member's salutation
      Since:
      jcms-4.0
    • getLanguage

      public String getLanguage()
      Retrieve the language of this Member.
      Returns:
      an ISO-639 language code (eg fr), with an optional script indication (eg zh-Hant)
      Since:
      jcms-4.0
    • setLanguage

      public void setLanguage(String languageKey)
      Set the language of this Member.

      The language is the ISO-639-1 language code (eg fr, de) mut it may include an optional script indication (eg zh-Hant).

      Valid value (which is enforced) can be found in jcms.prop by looking at properties prefixed with lang. string, it must be a language currently configured on the site, otherwise the default site language will be used.

      Parameters:
      languageKey - language key to use for this language.
      Since:
      jcms-4.0
      See Also:
    • getCountry

      public String getCountry()
      Retrieves the country of this member.
      Returns:
      an ISO 3166 country code as used by java Locale
      Since:
      jcms-7.1
    • setCountry

      public void setCountry(String countryCode)
      Set the country of this member.
      Parameters:
      countryCode - an ISO 3166 country code as used by java Locale
      Since:
      jcms-7.1
    • canCreateWorkCopy

      public boolean canCreateWorkCopy(Publication pub)
      Convenience method
      Parameters:
      pub - used to create work copy
      Returns:
      true if the publication can be used
      Since:
      jcms-4.0
      See Also:
    • canMergeWorkCopy

      public boolean canMergeWorkCopy(Publication pub)
      Convenience method
      Parameters:
      pub - The publication to merge.
      Returns:
      boolean true if publication can be merged
      Since:
      jcms-4.0
      See Also:
    • getWorkspaceSet

      public Set<Workspace> getWorkspaceSet()
      Returns:
      a Set of all Workspace the member belongs to.
      Since:
      jcms-4.1
    • refreshWorkspaceSet

      public void refreshWorkspaceSet()
      Refresh the workspaces this member belongs to.
      Since:
      jcms-5.6.2
    • updateWorkspaceSet

      public void updateWorkspaceSet(Workspace ws, boolean add)
      Update workspaceSet index
      Parameters:
      ws - the workspace to be added or removed
      add - add if true, remove if false
      Since:
      jcms-5.0.1
    • belongsToWorkspace

      public boolean belongsToWorkspace(Workspace ws)
      This convenient method returns true if this member belongs to the given workspace.
      Parameters:
      ws - the workspace to be checked
      Returns:
      true if this member belongs to this workspace
      Since:
      jcms-4.1
    • getWorkspacePublicationSet

      public Set<Publication> getWorkspacePublicationSet()
    • belongsToRole

      public WKRole belongsToRole()
      Returns:
      the first WKRole the member belongs to
      Since:
      jcms-4.1
    • belongsToRole

      public WKRole belongsToRole(boolean checkGroups)
      Parameters:
      checkGroups - check also for member groups
      Returns:
      the first WKRole the member belongs to
      Since:
      jcms-4.1
    • belongsToRole

      public boolean belongsToRole(WKRole role)
      Parameters:
      role - a WKRole
      Returns:
      true if member belongs to the WKRole
      Since:
      jcms-4.1
    • belongsToRole

      public boolean belongsToRole(WKRole role, boolean checkGroups)
      Parameters:
      role - a WKRole
      checkGroups - check also for member groups
      Returns:
      true if member belongs to the WKRole
      Since:
      jcms-4.1
    • getAdministratedWorkspaceSet

      public SortedSet<Workspace> getAdministratedWorkspaceSet()
      This convenient method returns all the workspace this member is the administrator of.
      Returns:
      a set of workspace.
      Since:
      jcms-5.5.0
    • isWorkAdmin

      public boolean isWorkAdmin()
      This convenient method check if this member is administrator of at least one workspace.
      Returns:
      true if this member is administrator of at least one workspace.
      Since:
      jcms-4.1
    • getFavoriteWorkspace

      public Workspace getFavoriteWorkspace(Workspace currentWS, Class<?> clazz)
      Return the favorite Member Workspace where it can work on
      Parameters:
      currentWS - the current Workspace
      clazz - the class to publish
      Returns:
      the workspace to use
    • getTeamPortal

      public PortalInterface getTeamPortal()
      Returns the team portal for this member.
      Returns:
      the team portal for this member.
      Since:
      jcms-10.0.0
    • isEmailValid

      public boolean isEmailValid(boolean checkDisable)
      Check if the email of this member is not empty (does not check email format validity).
      Parameters:
      checkDisable - check if the account is disabled (set to true to consider disabled member as invalid emails)
      Returns:
      true if this member has set an email
      Since:
      jcms-6.0.2
      See Also:
    • getFullEmail

      public String getFullEmail()
      Return the full email address of this Member.

      Composed of both fullname (firstname+lastname) and email address in the form "FirstName Name <user@company.com>"

      Return a properly formatted address (RFC 822 syntax) of Unicode characters.

      Important : this value is NOT suitable for presentation to the end user in HTML interface, is is meant to be used in MailMessage from value.

      Returns:
      Unicode address string
      Since:
      jcms-5.0.0
    • getFriendlyName

      public String getFriendlyName()
      Return the name of this member nicely formated for a communication purpose (email, newsletter, welcome)
      Returns:
      String the Friendly Name
      Since:
      jcms-5.0.0
    • getSignupConfirmationUrl

      public String getSignupConfirmationUrl(String password)
      Build an URL for SignUp validation using password and other secret data.
      Parameters:
      password - the password
      Returns:
      String representing confirmation url
      Since:
      jcms-5.0.3
    • alertSignup

      public boolean alertSignup(String password, boolean signupValidationRequired, boolean sendPassword)
      - Send mails to signup administrators - Send validation mail or confirmation mail
      Parameters:
      password - the password
      signupValidationRequired - true if the signup validation is required
      sendPassword - if true the password will be sent
      Returns:
      boolean true if alert has been done
    • hasPhoto

      public boolean hasPhoto()
      Returns true if this member has got a photo.
      Returns:
      true if this member has got a photo.
      Since:
      jcms-5.7.0
    • canUploadPhoto

      public boolean canUploadPhoto()
      Returns true if this member can upload a photo.
      Returns:
      true if this member can upload a photo.
      Since:
      jcms-5.7.0
    • canSendMail

      public boolean canSendMail(Workspace workspace)
      Checks if Member can send Email to the given Workspace.
      Parameters:
      workspace - the Workspace to send Email.
      Returns:
      true if
      • site incoming mail is enabled,
      • ws is not closed nor model,
      • ws incoming mail setup is valid,
      • and member have Publication rights for mail archiving
      Since:
      jcms-9.0.0
    • getDataName

      public String getDataName(String language)
      Description copied from class: Data
      Return the name of this Data, every sub class Data which will be displayed to user should implements this method already.
      • The Title (multi-language) for a Publication.
      • The Name (multi-language) for a Category.
      • The Name for a Group, a Member.
      • The Title (multi-language) for a Workspace.
      Can be seen as a smart multi-language toString(), but never returning null.
      Default behaviour is to return toFullString() of Data or empty string if toFullString is null.
      Overrides:
      getDataName in class Data
      Parameters:
      language - the language in which to return the name if multilang available for the data.
      Returns:
      name of Member or empty String if not specified.
      Since:
      jcms-5.1
      See Also:
    • getDataImage

      public String getDataImage()
      Description copied from class: Data
      Retrieves the image path of this data in the channel's main language.

      This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
      Default behaviour is to return empty string.

      Overrides:
      getDataImage in class Data
      Returns:
      a path relative to the webapp root.
    • getDataImage

      public String getDataImage(String lang, boolean useDefault)
      Description copied from class: Data
      Retrieves the image path of this data.

      This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
      Default behaviour is to return empty string.

      Overrides:
      getDataImage in class Data
      Parameters:
      lang - the user language (ISO-639 language code)
      useDefault - should the default language be used if no value is found for the specified language
      Returns:
      a path relative to the webapp root.
    • getLastName

      public String getLastName()
      Gets the last name of this member.

      This method simply invoke getName() which does exactly the same thing.

      Returns:
      the member's last name or null if the last name has not been set.
      Since:
      jcms-6.1
    • setLastName

      public void setLastName(String lastName)
      Sets the last name of this member.

      This method simply invoke setName(String) which does exactly the same thing.

      Parameters:
      lastName - the last name to use for this member.
      Since:
      jcms-6.1
    • getName

      public String getName()
      Gets the name of this member.
      Returns:
      the member's name or null if the name has not been set.
    • setName

      public void setName(String name)
      Set the name of this member.
      Parameters:
      name - the name to use.
    • getFirstName

      public String getFirstName()
      Gets the first name of this member.
      Returns:
      the member's first name or null if the first name has not been set.
      Since:
      jcms-4.0
    • setFirstName

      public void setFirstName(String firstName)
      Set the first name of this member.
      Parameters:
      firstName - the first name to use.
      Since:
      jcms-4.0
    • isAdmin

      public boolean isAdmin()
      Checks if this member is an administrator of the site.
      Returns:
      true if this member is and administrator, false otherwise.
    • setAdmin

      public void setAdmin(boolean isAdmin)
      Sets if this member can administrate the site.
      Parameters:
      isAdmin - true if this member is and administrator, false otherwise.
    • getEffectiveClearanceLevel

      public int getEffectiveClearanceLevel()
      Retrieve the effective clearance level of this member using baseline classification level configured on site.

      If this member clearance clerance level was not specified (getClearanceLevel() is zero), the effective level used for read right, feature access and constraint required is the baseline level ClassificationManager.getBaselineLevel().

      Returns:
      a value from 1 (if baseline is 1) to ClassificationManager.getMaximumLevel() (if baseline is the maximum level)
      Since:
      10.0.8 / JCMS-10746
      See Also:
    • getClearanceLevel

      public int getClearanceLevel()
      Retrieve the clearance level of this member.
      Returns:
      a value from 0 to ClassificationManager.getMaximumLevel() (included)
      Since:
      10.0.8 / JCMS-10746
      See Also:
    • setClearanceLevel

      public void setClearanceLevel(Integer level)
      Set the clearance level of this member, indicating the level of classified publication he can access.
      Parameters:
      level - a value from 0 to ClassificationManager.getMaximumLevel() (included)
      Since:
      10.0.8 / JCMS-10746
      See Also:
    • getSalutation

      public String getSalutation()
      Gets the salutation of this member as an internal non localized token.
      The salutation is usually one those values :
      • "mr"
      • "mrs"
      • "miss"
      You can then append this value to the language property "ui.com.lbl.salut." to retrieve the salutation in a localized form.
      Returns:
      the member's salutation or null if the salutation has not been set.
      Since:
      jcms-4.0
    • setSalutation

      public void setSalutation(String salutation)
      Set the salutation of this member.
      Parameters:
      salutation - the salutation token to use, usually one those values
      • "mr"
      • "mrs"
      • "miss"
      Even these are the usual string used for the salutation, you can use any other value, as long as you provide the corresponding I18N language property "ui.com.lbl.salut.{value}"
      Since:
      jcms-4.0
    • getOrganization

      public String getOrganization()
      Gets the organization of this member.
      Returns:
      the organization of this member.
      Since:
      jcms-6.1.0
    • setOrganization

      public void setOrganization(String organization)
      Set the organization of this member.
      Parameters:
      organization - the organization to use.
      Since:
      jcms-6.1.0
    • getDepartment

      public String getDepartment()
      Gets the department of this member.
      Returns:
      the department of this member.
      Since:
      jcms-7.0.0
    • setDepartment

      public void setDepartment(String department)
      Set the department of this member.
      Parameters:
      department - the department to use for this Member.
      Since:
      jcms-7.0.0
    • getOrganizationAndDepartment

      public String getOrganizationAndDepartment()
      A convenient method which returns the organization and the department.
      Returns:
      the organization and the department.
      Since:
      jcms-7.0.0
    • getJobTitle

      public String getJobTitle()
      Gets the job title of this member.
      Returns:
      the job title of this member.
      Since:
      jcms-4.0
    • setJobTitle

      public void setJobTitle(String jobTitle)
      Set the job title of this member.
      Parameters:
      jobTitle - the job title to use.
      Since:
      jcms-4.0
    • getPhone

      public String getPhone()
      Gets the phone number of this member.
      Returns:
      the member's phone number or null if the phone number has not been set.
      Since:
      jcms-4.0
    • setPhone

      public void setPhone(String phone)
      Set the phone number of this member.
      Parameters:
      phone - the phone number to use.
      Since:
      jcms-4.0
    • getPhoneNumber

      public PhoneNumber getPhoneNumber()
      Retrieve a PhoneNumber instance for this member phone number.
      Returns:
      a PhoneNumber instance or null if phone number could not be parsed
      Since:
      jcms-9.0.0 - JCMS-3741
      See Also:
    • getMobile

      public String getMobile()
      Gets the mobile phone number of this member.
      Returns:
      the member's mobile phone number or null if the mobile phone number has not been set.
      Since:
      jcms-4.0
    • setMobile

      public void setMobile(String mobile)
      Set the mobile phone number of this member.
      Parameters:
      mobile - the mobile phone number to use.
      Since:
      jcms-4.0
    • getMobilePhoneNumber

      public PhoneNumber getMobilePhoneNumber()
      Retrieve a PhoneNumber instance for this member mobile phone number.
      Returns:
      a PhoneNumber instance or null if phone number could not be parsed
      Since:
      jcms-9.0.0 - JCMS-3741
      See Also:
    • getStreet

      public String getStreet()
      Retrieve the street address of this Member.

      Example: "58, rue Pottier"

      Returns:
      site information from a postal address (i.e., the street name, place, avenue, and the house number).
      Since:
      jcms-9.0.0
    • setStreet

      public void setStreet(String street)
      Set the street address of this Member.

      Example: "58, rue Pottier"

      Parameters:
      street - the site information from a postal address (i.e., the street name, place, avenue, and the house number).
      Since:
      jcms-9.0.0
    • getPostalCode

      public String getPostalCode()
      Retrieve the address postal code of this Member.

      Example: "78150", to identify Le Chesnay in France.

      Returns:
      code used by Postal Service to identify postal service zone.
      Since:
      jcms-9.0.0
    • setPostalCode

      public void setPostalCode(String postalCode)
      Set the address postal code of this Member.

      Example: "78150", to identify Le Chesnay in France.

      Parameters:
      postalCode - code used by Postal Service to identify postal service zone.
      Since:
      jcms-9.0.0
    • getPoBox

      public String getPoBox()
      Retrieve the address postal office box of this Member.

      Example: "BP 90 123".

      Returns:
      postal box identifier that a Postal Service uses when a customer arranges to receive mail at a box on the premises of the Postal Service
      Since:
      jcms-9.0.0
    • setPoBox

      public void setPoBox(String postOfficeBox)
      Set the address postal office box of this Member.

      Example: "BP 90 123".

      Parameters:
      postOfficeBox - postal box identifier that a Postal Service uses when a customer arranges to receive mail at a box on the premises of the Postal Service
      Since:
      jcms-9.0.0
    • getRegion

      public String getRegion()
      Retrieve the address region of this Member.

      Example: "Ile de France"

      Returns:
      full name of state or province
      Since:
      jcms-9.0.0
    • setRegion

      public void setRegion(String region)
      Set the address region of this Member.

      Example: "Ile de France"

      Parameters:
      region - full name of state or province
      Since:
      jcms-9.0.0
    • getLocality

      public String getLocality()
      Retrieve the address locality of this Member.

      Example: "Le Chesnay"

      Returns:
      name of a locality or place, such as a city, county, or other geographic region
      Since:
      jcms-9.0.0
    • setLocality

      public void setLocality(String locality)
      Set the address locality of this Member.

      Example: "Le Chesnay"

      Parameters:
      locality - name of a locality or place, such as a city, county, or other geographic region
      Since:
      jcms-9.0.0
    • getAddress

      public String getAddress()
      Gets the address of this member (street address, postal code, city, country and all).
      Returns:
      the member's address or null if the address has not been set.
      Since:
      jcms-4.0
    • hasAnyAddress

      public boolean hasAnyAddress()
      Checks if current member has any address
      Returns:
      true if current Member has any address (old format and new format)
      Since:
      jcms-9.0
      See Also:
    • hasStructuredAddress

      public boolean hasStructuredAddress()
      Checks if current member address uses the new structured address format.
      Returns:
      true if current Member uses the new structured address format
      Since:
      jcms-9.0
      See Also:
    • getStructuredAddress

      public String getStructuredAddress()
    • setAddress

      @Deprecated public void setAddress(String address)
      Deprecated.
      since jcms-9.0.0, use individual fields
      Set the address of this member.
      Parameters:
      address - the address (street address, postal code, city, country and all) to use.
      Since:
      jcms-4.0
      See Also:
    • getEmail

      public String getEmail()
      Gets the email address of this member.
      Returns:
      the member's email addres or null if the email address has not been set.
    • setEmail

      public void setEmail(String email)
      Set the email address of this member.
      Parameters:
      email - the email address to use.
    • getInfo

      public String getInfo()
      Gets informations available for this member.
      Returns:
      the member's information or null if the information has not been set.
    • setInfo

      public void setInfo(String info)
      Set some informations available for this member.
      Parameters:
      info - the informations to use.
    • getPhoto

      public String getPhoto()
      Returns the member's photo.
      Returns:
      the member's photo.
      Since:
      jcms-5.7.0
    • setPhoto

      public void setPhoto(String photo)
      Set the member's photo.
      Parameters:
      photo - the member's photo
      Since:
      jcms-5.7.0
    • getLogin

      public String getLogin()
      Gets the login of this member.
      Returns:
      the member's login or null if the login has not been set (which should never happen).
    • setLogin

      public void setLogin(String login)
      Set the login of this member.
      Parameters:
      login - the login to use, can be any string (id, email, ...), as long as it is kept unique over all members.
    • getPassword

      public String getPassword()
      Gets the (hashed) password of this member as defined by setter.

      The original clear text is never stored, see setPassword(String) for more information.

      Returns:
      the member's password or null if the password has not been set.
    • setPassword

      public void setPassword(String password)
      Set the (hashed) password of this member.

      The password value specified must be crypted using method Channel.crypt(String)

       mbr.setPassword(channel.crypt("abc42def"));
       
      Parameters:
      password - a hashed version of the password to use
    • getRightFromClassMap

      public HashMap<String,DataRight> getRightFromClassMap()
      Get the value of rightFromClassMap.
      Returns:
      Value of rightFromClassMap.
    • setRightFromClassMap

      public void setRightFromClassMap(HashMap<String,DataRight> v)
      Set the value of rightFromClassMap.
      Parameters:
      v - Value to assign to rightFromClassMap.
    • getPublicationSet

      public Set<Publication> getPublicationSet()
      Retrieve a Set containing all the Publication of which this member is the author.
      Returns:
      a Set of Publication, never return null.
    • updatePublicationSet

      public void updatePublicationSet(Publication pub, boolean add)
      Update publicationSet index
      Parameters:
      pub - the publication to be added or removed
      add - add if true, remove if false
      Since:
      jcms-5.0.1
    • getContentSet

      public Set<Content> getContentSet()
      Get the value of contentSet.
      Returns:
      Value of contentSet.
      Since:
      jcms-4.0
    • updateContentSet

      public void updateContentSet(Content content, boolean add)
      Update contentSet index
      Parameters:
      content - the content to be added or removed
      add - add if true, remove if false
      Since:
      jcms-5.0.1
    • getNameComparator

      public static Comparator<Member> getNameComparator()
    • getFirstNameComparator

      public static Comparator<Member> getFirstNameComparator()
    • getLoginComparator

      public static Comparator<Member> getLoginComparator()
    • getGroupComparator

      public static Comparator<Member> getGroupComparator(Comparator<Group> groupComparator)
    • getPublicationCountComparator

      public static Comparator<Member> getPublicationCountComparator()
    • getRightComparator

      public static Comparator<Member> getRightComparator()
    • getLdapComparator

      public static Comparator<Member> getLdapComparator()
    • getLastLdapSyncComparator

      public static Comparator<Member> getLastLdapSyncComparator()
    • getLangComparator

      public static Comparator<Member> getLangComparator()
    • getSessionComparator

      public static Comparator<Member> getSessionComparator()
    • getLastLoginDateComparator

      public static Comparator<Member> getLastLoginDateComparator()
    • getComparator

      @Deprecated public static Comparator getComparator(String str, boolean reverse)
      Deprecated.
      Retrieves a new Comparator given a name representing it. The returned comparator can be used to sort any Collection containing Members.

      You can specify any of the following value:
      And also any of the value available through Data.getComparator(String, boolean)
      Parameters:
      str - a string representing the comparator
      reverse - a boolean indicating whether the comparator should have its behavior reversed (true) or unchanged (false)
      Returns:
      a new instance of Comparator.
      See Also:
    • checkIntegrity

      public ControllerStatus checkIntegrity(Map context)
      Checks whether or not data integrity constraints are respected.
      Overrides:
      checkIntegrity in class Data
      Parameters:
      context - a map which contains context parameters (may be null)
      Returns:
      a ControllerStatus
      Since:
      jcms-6.1
    • checkMember

      public ControllerStatus checkMember(int op, Member mbr, Map context)
      Checks if the given member can perform the given operation.
      Overrides:
      checkMember in class Data
      Parameters:
      op - the operation (OP_CREATE, OP_UPDATE, ...)
      mbr - the member which requests the write operation
      context - a map which contains context parameters (may be null)
      Returns:
      a ControllerStatus
      Since:
      jcms-5.0.0
    • internalCheckMember

      protected ControllerStatus internalCheckMember(int op, Member mbr, Map context)
    • checkCreate

      public ControllerStatus checkCreate(Member mbr, Map context)
      Description copied from class: Data
      Checks if the creation can be performed
      Overrides:
      checkCreate in class Data
      Parameters:
      mbr - the member which requests the write operation
      context - a map which contains context parameters (may be null)
      Returns:
      a ControllerStatus
    • checkWrite

      public ControllerStatus checkWrite(int op, Member mbr, boolean checkIntegrity, Map context)
      Checks if the given write operation can be performed
      Overrides:
      checkWrite in class Data
      Parameters:
      op - the operation (OP_CREATE, OP_UPDATE, ...)
      mbr - the member which requests the write operation
      checkIntegrity - if true, requires the constraints integrity to be checked
      context - a map which contains context parameters (may be null)
      Returns:
      a ControllerStatus
      Since:
      jcms-5.0.0
    • checkDelete

      public ControllerStatus checkDelete(Member mbr, Map context)
      Checks if the deletion can be performed
      Overrides:
      checkDelete in class Data
      Parameters:
      mbr - the member which requests the write operation
      context - a map which contains context parameters (may be null)
      Returns:
      a ControllerStatus
      Since:
      jcms-5.0.0
    • checkMemberGroupModification

      public static ControllerStatus checkMemberGroupModification(Member opAuthor, Group modifiedGroup, Member modifiedMember, boolean checkParentGroup)
      Check if the specified Member (opAuthor) is authorized to add or remove a member to the specified group to this member.

      Important explanation regarding this method :

      • This method is public due to technical limitation for existing packages of JCMS, but it MUST ONLY BE USED by internal JCMS code.
      • This method DOES NOT check that the operation on a member would be authorized, this complete verification must go through other checkUpdate method
      • It exists to prevent code duplication
      Parameters:
      opAuthor - the Member performing the modification
      modifiedGroup - the group to which the modifiedMember is added or removed
      modifiedMember - the member which is added or removed from the modifiedGroup
      checkParentGroup - set to true to check parent groups of the specified group, if they did not already belong to the specified member
      Returns:
      a ControllerStatus indicating the result, never return null
      Since:
      jcms-7.0.4 jcms-7.1.1
    • performBeforeWrite

      protected void performBeforeWrite(int op, Member mbr, Map context)
      Description copied from class: Data
      Called to perform some action before the write.
      Overrides:
      performBeforeWrite in class Data
      Parameters:
      op - the operation (OP_CREATE, OP_UPDATE, ...)
      mbr - the member which requests the write operation
      context - a map which contains context parameters (may be null)
    • performUpdate

      public void performUpdate(Member mbr, Map context)
      Performs update.

      Since 10.0.8, member photo can be deleted when member is being disabled depending on property "member.photo.delete-on-disable".

      Overrides:
      performUpdate in class Data
      Parameters:
      mbr - the member which requests the write operation
      context - a map which contains context parameters (may be null)
      Since:
      jcms-10.0.5
    • performDeleteAsync

      public CompletableFuture<Void> performDeleteAsync(Member opAuthor, Map<String,?> contextMap)
      Request asynchronously deletion of this member, if async delete is enabled.

      When asynchronous deletion is enabled, deletion is requested and queued, method returns immediately with a CompletableFuture to monitor delete operation.

      When asynchronous deletion is disabled, a synchronous delete will be performed. In such case an already completed CompletableFuture is returned when delete has been performed.

      Parameters:
      opAuthor - the member which requests the write operation
      contextMap - a map which contains context parameters (may be null)
      Since:
      10.0.7 / JCMS-9292
      See Also:
    • performDelete

      public void performDelete(Member mbr, Map context)
      Performs deletion
      Overrides:
      performDelete in class Data
      Parameters:
      mbr - the member which requests the write operation
      context - a map which contains context parameters (may be null)
      Since:
      jcms-5.0.0
    • removeMemberAttendeeCalendarEvent

      protected void removeMemberAttendeeCalendarEvent(Member mbr, Map context)
      Find all the CalendarEventInterface in which the member attends, and remove the member from those events, called on delete of member (this).
      Parameters:
      mbr - the member which requests the operation
      context - a map which contains context parameters (may be null)
    • deleteMemberData

      protected void deleteMemberData(Member mbr, Map context)
    • reassignMemberPubs

      protected void reassignMemberPubs(Member mbr, Map context)
      JStore publications (Content and Portlet types) are reassigned.
      Since JCMS-8509, DBPublication (Content only) are reassigned too.
      Parameters:
      mbr - the opAuthor to use on each JStore update operation
      context - the performUpdate context
    • handleDeleteMemberUserContent

      protected void handleDeleteMemberUserContent(String mbrId)
    • deleteMemberUserContent

      protected static void deleteMemberUserContent(String mbrId)
    • updateRights

      protected void updateRights(Member mbr, Map context)
      Clears the references of current Member in category, and publication authorizedMemberSet, updateMemberSet. Should only be called after Member deletion.
      Parameters:
      mbr - the member which requests the write operation
      context - a map which contains context parameters (may be null)
    • updatePhoto

      public ControllerStatus updatePhoto(File file, boolean deleteFileOnFailure, Member updater, Map<String,Object> contextMap, String userLang)
      Parameters:
      file - the new photo File
      deleteFileOnFailure - if true, deletes the provided file if the operation fails
      updater - the Member who performs the update
      contextMap - an optional context map providing information on publish request context, may be null
      userLang - the current user language for error messages
      Returns:
      a ControllerStatus as a result of the update action
      Since:
      jplatform-10.0.8
    • getMemberFromLogin

      public static Member getMemberFromLogin(String login, boolean checkDisabled)
      Returns the member with the given login.
      Parameters:
      login - the member's login
      checkDisabled - if true, return null if accound is disabled
      Returns:
      the member or null if no active member has this login.
      Since:
      jcms-5.0.1
    • refreshLoginIndex

      public static void refreshLoginIndex()
      Refresh login index.
      Since:
      jcms-5.0.3
    • indexLogin

      public static void indexLogin(Member mbr)
      Index the login of the given member.
      Parameters:
      mbr - the member to be registered
      Since:
      jcms-5.0.1
    • unindexLogin

      public static void unindexLogin(Member mbr)
      Unindex the login of the given member.
      Parameters:
      mbr - the member to be unregistered
      Since:
      jcms-5.0.1
    • getLocale

      public Locale getLocale()
      Retrieve the Locale of this member.
      Returns:
      a Locale object initialized with this Member language and country
      Since:
      jcms-5.7
    • setLocale

      public void setLocale(Locale locale)
    • getZoneId

      public ZoneId getZoneId()
      Retrieve the ZoneId of this member.

      Always returns a valid ZoneId object when TimeZone is enabled for site (see channel.timezone.enabled: property).

      Returns:
      a ZoneId object, never return null when TimeZone is enabled (default to channel default ZoneId if Member had no zone defined), always return null when TimeZone is disabled.
      Since:
      jcms-10.0.1 / JCMS-4865
    • setZoneId

      public void setZoneId(ZoneId zoneId)
      Set the ZoneId of this member.
      Parameters:
      zoneId - the zoneId to set
      Since:
      jcms-10.0.1 / JCMS-4865
    • buildPhotoFilename

      public String buildPhotoFilename(String ext)
      Returns the photo filename for this member.
      Parameters:
      ext - the file extension (eg. "gif", "jpg" or "png");
      Returns:
      the photo filename for this member
      Since:
      jcms-5.7.0
    • getMemberFromPhoto

      public static Member getMemberFromPhoto(String photoPath)
      Retrieve the Member using the specified photo in its profile.

      Implementation detail : Member is resolved by looking for the photo file name which is expected to contains the Member id.
      This method does not verify the Member is still using this photo.

      Parameters:
      photoPath - a path relative to the webapp root, such as upload/photos/2018-01/mbr_c_42.jpg
      Returns:
      a Member instance or null if Member could not be retrieved from photo path
      Since:
      jcms-10.0.1 / JCMS-4784
      See Also:
    • removeAllPhotos

      public void removeAllPhotos(boolean removePhoto)
      Removes all photo and thumbnail files for this member.
      Parameters:
      removePhoto - if true the file of the photo will be deleted.
      Since:
      jcms-5.7.0
    • getLastLoginDateSet

      public SortedSet<Date> getLastLoginDateSet()
      Retrieve the last login Date of this Member.
      Returns:
      a Set of Date, return an empty set if this user has never been logged, (never return null).
      Since:
      jcms-6.0.1
    • getLastLoginDate

      public Date getLastLoginDate()
      Retrieves the last login Date of this Member.
      Returns:
      a Date (GMT) or null if this user has never been logged in.
      Since:
      jcms-6.0.0
    • setLastLoginDate

      public final void setLastLoginDate(Date date)
      Sets the last login Date of this Member.
      Parameters:
      date - the last login date, or null to use now.
      Since:
      jcms-6.0.0
    • internalSetLastLoginDate

      protected void internalSetLastLoginDate(Date date)
      Performs the persistance of the new last login date.
      Parameters:
      date - the date
      Since:
      jcms-6.1.3
    • exportXmlRelated

      protected void exportXmlRelated(StringBuffer sb, String related, int indentLevel)
      Overrides:
      exportXmlRelated in class Data
    • getIndexingDate

      public Date getIndexingDate()
      Retrieve the Date at which this Member was indexed in its search engine.
      Returns:
      a Date or null if was not indexed.
      Since:
      jcms-6.1.0
    • getFollowedPublicationList

      public List<Publication> getFollowedPublicationList()
      Returns the list of publications followed by this member.
      Returns:
      the list of publications followed by this member.
      Since:
      jcms-7.0.0
    • checkAccess

      public boolean checkAccess(String resource, Map<String,Object> context)
      Check if this member is authorized to access the specified resource.
      Parameters:
      resource - a resource URI using a path representation, eg "admin/dev/store-cleaner"
      context - an optional context map containing relevant information such as workspace
      Returns:
      true if the access is authorized, false otherwise
      Since:
      jcms-7.0.0
      See Also:
    • checkAccessIfAclExists

      public boolean checkAccessIfAclExists(String resource, Map<String,Object> context)
      Check if this member is authorized to access the specified resource IF AND ONLY IF resource has been configured.

      This method ONLY performs the ACL check when the specified resource has been configured on at least one AccessControlList, if resource has not been specified explicitely in any AccessControlList, access is AUTHORIZED..

      DO NOT use this method for any security related resource that MUST be enforced by an implicit or explicit assignement of the ACL resource to a user. In such case, use checkAccess(String, Map).

      Parameters:
      resource - a resource URI using a path representation, eg "admin/dev/store-cleaner"
      context - an optional context map containing relevant information such as workspace or data
      Returns:
      true if the access is authorized, false otherwise
      Since:
      jcms-10.0.7
    • hasAcl

      public boolean hasAcl()
      Check if this member belongs to at least one group with an Access Control List
      Returns:
      true if this member benefit from at least one ACL, false otherwise
      Since:
      jcms-7.0.0
      See Also:
    • getBelongsToWorkspaceSelector

      public static DataSelector getBelongsToWorkspaceSelector(Workspace ws)
      DataSelector which select a Member which belongs to a workspace (directly)
      Parameters:
      ws - the workspace
      Returns:
      true if the Data is a Member and belongs to the workspace
    • canRequestUnlock

      public boolean canRequestUnlock(Data data)
      Returns true if this member can request unlock for the given data.
      Parameters:
      data - the data
      Returns:
      true if this member can request unlock for the given data.
      Since:
      jcms-9.0.0
    • canUnlock

      public boolean canUnlock(Data data)
      Returns true if this member can unlock the given data.
      Parameters:
      data - the data
      Returns:
      true if this member can unlock the given data.
      Since:
      jcms-9.0.0
    • canExportMembers

      public boolean canExportMembers(Workspace ws, Group grp)
      Check if this member is authorized to export (eg in CSV) the members matching specified criteria.
      Parameters:
      ws - workspace of members to export, set to null to check export right for members of all workspace
      grp - group of members to export, set to null to check export right for members of all groups
      Returns:
      true if member can export, false otherwise
      Since:
      JCMS-4425 / JCMS-5342
    • canExportGroups

      public boolean canExportGroups(Workspace ws)
      Check if this member is authorized to export (eg in CSV) the groups matching specified criteria.
      Parameters:
      ws - workspace of groups to export, set to null to check export right for groups of all workspace
      Returns:
      true if member can export, false otherwise
      Since:
      JCMS-4425 / JCMS-5342
    • getAssistant

      public Member getAssistant()
      Returns the assistant of this Member. If the assistant is a DBMember it is loaded. This method must not be called before the database as been initialized (e.g. it must not be called by a StoreListener). The assistant returned by method must not be kept in data structures that are longer than the DB transaction (e.g. an index). In those cases, call getAssistant(false).
      Returns:
      the assistant of this Member.
      Since:
      jcms-10.0.6 / JCMS-8978
      See Also:
    • getAssistant

      public Member getAssistant(boolean queryDB)
      Returns the assistant of this Member. If queryDB is true query the DB to find the assistant from assistantDBID.
      Parameters:
      queryDB - indicates if the database must be queried.
      Returns:
      the assistant of this Member
      Since:
      jcms-10.0.6 / JCMS-8978
    • setAssistant

      public void setAssistant(Member v)
      Sets the assistant of this Member.
      Parameters:
      v - the assistant
      Since:
      jcms-10.0.6 / JCMS-8978
    • getAssistantDBID

      public String getAssistantDBID()
      Returns a JCMS ID of the assistant if it is persisted in the DB.
      Returns:
      a JCMS ID.
      Since:
      jcms-10.0.6 / JCMS-8978
    • setAssistantDBID

      public void setAssistantDBID(String v)
      Sets the assistantDBID of this Member.
      Parameters:
      v - the assistantDBID
      Since:
      jcms-10.0.6 / JCMS-8978
    • isAssistedBy

      public boolean isAssistedBy(Member mbr)
      Returns true if the given member is the assistant of this Member.
      Parameters:
      mbr - the member
      Returns:
      true if the given member is the assistant of this Member.
      Since:
      jcms-10.0.6 / JCMS-8978
    • getDeclaredManager

      public Member getDeclaredManager()
      Returns the declared manager of this member. If the manager is a DBMember it is loaded. This method must not be called before the database as been initialized (e.g. it must not be called by a StoreListener). The manager returned by method must not be kept in data structures that are longer than the DB transaction (e.g. an index). In those cases, call getDeclaredManager(false).
      Returns:
      the declared manager of this member.
      Since:
      jcms-10.0.0
      See Also:
    • getDeclaredManagerId

      public String getDeclaredManagerId()
      Retrieve the id of the declared manager, without loading it in DB if it as DBMember
      Returns:
      the id of the declaredManager Member (JStore or DBMember), if any.
      Since:
      jcms-10.0.7 / JCMS-9477
    • getDeclaredManager

      public Member getDeclaredManager(boolean queryDB)
      Returns the declared manager of this member. If queryDB is true query the DB to find the manager from managerDBID.
      Parameters:
      queryDB - indicates if the database must be queried.
      Since:
      jcms-10.0.0
    • setDeclaredManager

      public void setDeclaredManager(Member v)
      Sets the declared manager of this member.
      Parameters:
      v - the declared manager
      Since:
      jcms-10.0.0
    • getDeclaredManagerDBID

      public String getDeclaredManagerDBID()
      Returns a JCMS ID of the declared manager if it is persisted in the DB.
      Returns:
      a JCMS ID.
      Since:
      jcms-10.0.0
    • setDeclaredManagerDBID

      public void setDeclaredManagerDBID(String v)
      Sets the declaredManagerDBID of this member.
      Parameters:
      v - the declaredManagerDBID
      Since:
      jcms-10.0.0
    • getManager

      public Member getManager()
      Returns the manager of this member.
      Returns:
      the manager of this member.
    • getManager

      public Member getManager(DataSelector dataSelector)
      Find first manager of this member matching the given dataSelector (if not null).
      Parameters:
      dataSelector - DataSelector add restrictions
      Returns:
      first manager of this member matching the given dataSelector.
    • isAManager

      public boolean isAManager()
      Check if this member is a manager of at least one Member or group.

      Implementation detail : this method is named isAManager and not isManager to prevent conflict semantic with existing getManager()

      Returns:
      true if this member is manager of at least one Member or group.
      Since:
      jcms-10.0.7 / JCMS-9477
    • isManagerOf

      public boolean isManagerOf(Group group)
      Returns true if this member is manager of the given group.
      Parameters:
      group - the group.
      Returns:
      true if this member is manager of the given group.
    • getManagedMemberSet

      public Set<Member> getManagedMemberSet()
      Returns the set of member managed by this member.
      Returns:
      the set of member managed by this member.
    • getManagedMemberSet

      public Set<Member> getManagedMemberSet(boolean supportDBMember)
      Returns the set of member managed by this member.
      Parameters:
      supportDBMember - set to true to include DBMember, false to skip them.
      Returns:
      the set of member managed by this member.
      Since:
      jcms-10.0.7 / JCMS-9477
    • getOrganizationGroupSet

      public Set<Group> getOrganizationGroupSet()
      Returns the set of groups of the organization the given member belongs to.
      Returns:
      the set of groups of the organization the given member belongs to.
    • getPreference

      public String getPreference(String key)
      Returns the given preference for the this member
      Parameters:
      key - the key of the preference
      Returns:
      the given preference for this member
      Since:
      jcms-10.0.0
    • getPreference

      public String getPreference(String key, boolean useDefault)
      Returns the given preference for the this member
      Parameters:
      key - the key of the preference
      useDefault - if true and there is no preference fo this member, search for a default preference
      Returns:
      the given preference for this member
      Since:
      jcms-10.0.0
    • savePreference

      public void savePreference(String key, String value)
      Save the preference (key/value) for this member.
      Parameters:
      key - the key of the preference
      value - the value of the preference
      Since:
      jcms-10.0.0
    • canBeReadBy

      public boolean canBeReadBy(Member member, boolean searchInGroups, RightInfo rightInfo)
      Checks if the specified member is authorized to read this Member.

      This method is the implementation of Data read right control for Member.
      Current implementation grants read access to anyone.

      Overrides:
      canBeReadBy in class Data
      Parameters:
      member - the member requesting a read check (may be null for anonymous user)
      searchInGroups - set to true to check for read right authorization using Member's group(s).
      rightInfo - a RightInfo instance in which explanation of read right authorization acceptance or refusal will be indicated. Value is required and cannot be null.
      Returns:
      true if the member can read this Member, false otherwise
      Since:
      jcms-10.0.1 / JCMS-4784
    • updateDisplayLinkCss

      public StringBuilder updateDisplayLinkCss(StringBuilder builder)
      Description copied from class: Data
      Returns a StringBuilder which contains css, whom you can modify or replace in your subclasses
      Overrides:
      updateDisplayLinkCss in class Data
      Parameters:
      builder - the StringBuilder
      Returns:
      a StringBuilder which contains css of display link
    • updateDisplayLinkDataAttribute

      public DataAttribute updateDisplayLinkDataAttribute(DataAttribute dataAttribute)
      Description copied from class: Data
      Returns a DataAttribute which contains data attributes, whom you can modify or replace in your subclasses
      Overrides:
      updateDisplayLinkDataAttribute in class Data
      Parameters:
      dataAttribute - the DataAttribute
      Returns:
      a DataAttribute which contains data attributes of display link
    • getInitials

      public String getInitials()
      Returns member's initials based on its name and firstname.
      Returns:
      member's initials
      Since:
      jcms-10.0.4 JCMS-6025
    • getInitialsColor

      public String getInitialsColor()
      Returns an hexadecimal color code based on Member metaDatas.
      Returns:
      a color hex hexadecimal code
      Since:
      jcms-10.0.4 JCMS-6025
    • getInitialsTextColor

      public String getInitialsTextColor()
      Returns the text color to use with the initials color based on Member metaDatas.
      Returns:
      a CSS var of a color
      Since:
      jplatform-11
    • getTypeBadge

      public BadgeItem getTypeBadge(boolean displayAccountBadge)
      Parameters:
      displayAccountBadge - will show the badge if it is an account
      Returns:
      the BadgeItem for this member
      Since:
      jplatform-11
    • getMemberColorPreference

      public String getMemberColorPreference()
      Return member color preference as a CSS var of a jpalette color, or null
      Returns:
      member color preference
      Since:
      jplatform-11 / JCMS-11658
    • saveMemberColorPreference

      public void saveMemberColorPreference(String v)
      Parameters:
      v - the value to set
      Since:
      jplatform-11 / JCMS-11658
    • getAppearance

      public Member.Appearance getAppearance()
      Returns:
      the appearance from member preference
      Since:
      jplatform-11 / JCMS-11750
    • saveMemberAppearancePreference

      public void saveMemberAppearancePreference(String v)
      Parameters:
      v - the value to set
      Since:
      jplatform-11 / JCMS-11750