Interface User

    • Field Detail

      • DEFAULT_AVATAR_PATH

        static final String DEFAULT_AVATAR_PATH
        The path of the default avatar to use when a user has not specific avatar representing him.
        See Also:
        Constant Field Values
    • Method Detail

      • getById

        static User getById​(String userId)
        Gets the detail about the specified user.
        Parameters:
        userId - the unique identifier of the user to get.
        Returns:
        the detail about the user with the specified identifier or null if no such user exists.
      • isActivatedStateFor

        static boolean isActivatedStateFor​(String userId)
        Parameters:
        userId - the unique identifier of a user.
        Returns:
        true if the user account in Silverpeas is activated, false otherwise.
        See Also:
        isActivatedState()
      • getCurrentUser

        static User getCurrentUser()
        Gets the current user behind the current treatment processing.

        If the current process is linked to an HTTP request, then the current user will be the one attached to the session of the request. Otherwise, the given user is the system one.

        If the SYSTEM user MUST NOT be returned in case it does not exist a real user linked to the thread, then use getCurrentRequester().

        Returns:
        the User instance of current user.
      • getCurrentRequester

        static User getCurrentRequester()
        Gets the current user behind a request of treatment processing.
        Returns:
        the User instance of current requester.
      • getMainAdministrator

        static User getMainAdministrator()
        Gets the main administrator of Silverpeas. It is the root administrator of the platform (the first administrator created at Silverpeas installation).
        Returns:
        the main administrator of Silverpeas.
      • getSystemUser

        static User getSystemUser()
        Gets the system user of Silverpeas. It is a virtual user (that is to say a user without any account in Silverpeas) used in some processes that are triggered by no real users or executed for one or more users but by the system itself (like batch processes).
        Returns:
        the system user of Silverpeas.
      • getId

        String getId()
        The unique identifier of the user into Silverpeas.
        Returns:
        identifier as string.
      • getDomainId

        String getDomainId()
        Gets the user domain id.
        Returns:
        user domain id as string.
      • isDomainRestricted

        boolean isDomainRestricted()
        Indicates if the user is restricted to access the resource in its own domain only.
        Returns:
        true if it's restricted, false otherwise.
      • isDomainAdminRestricted

        boolean isDomainAdminRestricted()
        Indicates if the user has admin account and is restricted to access the resource in its own domain only.
        Returns:
        true if it's restricted, false otherwise.
      • getLogin

        String getLogin()
        Gets the user login.
        Returns:
        user login as string.
      • getLastName

        String getLastName()
        Gets the last name of the user.
        Returns:
        last name as string.
      • getFirstName

        String getFirstName()
        Gets the first name of the user.
        Returns:
        first name as string.
      • geteMail

        String geteMail()
        Gets the user email.
        Returns:
        user email as string.
      • getCreationDate

        Date getCreationDate()
        Gets the date of the user creation.
        Returns:
        creation date of the user as Date.
      • getSaveDate

        Date getSaveDate()
        Gets the date of the last user save.
        Returns:
        the date of the last user save as Date.
      • getVersion

        int getVersion()
        Gets the version of the user data. The number of time the entity has been saved in other words.
        Returns:
        the version of the last save as integer.
      • getStateSaveDate

        Date getStateSaveDate()
        Gets the last date of the last user save.
        Returns:
        the date of last user state save (when it changes) as Date.
      • isFullyDefined

        boolean isFullyDefined()
        Indicates if the mandatory user data are defined.
        Returns:
        true if all mandatory are defined, false otherwise.
      • getDisplayedName

        default String getDisplayedName()
        Default first name and last name concatenation.
        Returns:
        concatenation of first name and last name as string (without outer space).
      • isSystem

        boolean isSystem()
        Is this user the system one? A system user is a virtual one played by the Silverpeas platform to perform tasks that aren't invoked explicitly by a user in Silverpeas but triggered either by a scheduler or a batch process like a workflow.
        Returns:
        true if this user is the virtual system one. False otherwise.
      • isAnonymous

        boolean isAnonymous()
        Indicates if the user is an anonymous one.
        Returns:
        true if anonymous, false otherwise.
      • isBlanked

        boolean isBlanked()
        Indicates if the user was blanked after its deletion. Blank a user means its data has been blanked and therefore any of his contributions in Silverpeas can be figured out; his contributions were anonymized.
        Returns:
        true if the user was blanked.
      • isAccessAdmin

        boolean isAccessAdmin()
        Indicates if the user has admin access on the platform.
        Returns:
        true if admin access, false otherwise.
      • isAccessDomainManager

        boolean isAccessDomainManager()
        Indicates if the user has domain manager access on the platform.
        Returns:
        true if domain manager access, false otherwise.
      • isAccessSpaceManager

        boolean isAccessSpaceManager()
        Indicates if the user has space manager access on the platform.
        Returns:
        true if space manager access, false otherwise.
      • isAccessPdcManager

        boolean isAccessPdcManager()
        Indicates if the user has PDC manager access on the platform.
        Returns:
        true if PDC manager access, false otherwise.
      • isAccessUser

        boolean isAccessUser()
        Indicates if the user has user access on the platform.
        Returns:
        true if user access, false otherwise.
      • isAccessGuest

        boolean isAccessGuest()
        Indicates if the user has guest access on the platform.
        Returns:
        true if guest access, false otherwise.
      • isAccessUnknown

        boolean isAccessUnknown()
        Indicates if the user has unknown access on the platform.
        Returns:
        true if unknown access, false otherwise.
      • getState

        UserState getState()
        Please use isValidState() to retrieve user validity information. Please use isDeletedState() to retrieve user deletion information. Please use isBlockedState() to retrieve user blocked information. Please use isDeactivatedState() to retrieve user deactivated information. Please use isExpiredState() to retrieve user expiration information. This method returns the stored state information but not the functional information.
        Returns:
        the state of the user (account)
      • isActivatedState

        boolean isActivatedState()
        This method indicates if the user is activated. The returned value is a combination of following method call result :
        Returns:
        true if activated state, false otherwise.
      • isValidState

        boolean isValidState()
        This method is the only one able to indicate the user validity state. Please do not use getState() to retrieve user validity information.
        Returns:
        true if valid state, false otherwise.
      • isDeletedState

        boolean isDeletedState()
        This method is the only one able to indicate the user deletion state. Please do not use getState() to retrieve user deletion information.
        Returns:
        true if deleted state, false otherwise.
      • isRemovedState

        boolean isRemovedState()
        This method is the only one able to indicate the user removed state. Please do not use getState() to retrieve user removed information.
        Returns:
        true if deleted state, false otherwise.
      • isBlockedState

        boolean isBlockedState()
        This method is the only one able to indicate the user blocked state. Please do not use getState() to retrieve user blocked information.
        Returns:
        true if blocked state, false otherwise.
      • isDeactivatedState

        boolean isDeactivatedState()
        This method is the only one able to indicate the user deactivated state. Please do not use getState() to retrieve user deactivated information.
        Returns:
        true if deactivated state, false otherwise.
      • isExpiredState

        boolean isExpiredState()
        This method is the only one able to indicate the user expiration state. Please do not use getState() to retrieve user expiration information.
        Returns:
        true if user is expired.
      • isConnected

        boolean isConnected()
        Indicates if the user is currently connected to Silverpeas.
        Returns:
        true if the user is currently connected to Silverpeas, false otherwise.
      • getUserPreferences

        UserPreferences getUserPreferences()
        Gets the preferences of this user.
        Returns:
        the user preferences.
      • getAvatar

        String getAvatar()
        Gets the avatar URL of the user.
        Returns:
        the avatar URL as string.
      • getSmallAvatar

        String getSmallAvatar()
        Gets the URL of a smaller version of avatar than the one provided by getAvatar() method.
        Returns:
        the small avatar URL as string.
      • getStatus

        String getStatus()
        Gets the current status filled by the user itself.
        Returns:
        current status as string.
      • getDurationOfCurrentSession

        String getDurationOfCurrentSession()
        Gets the duration of the current user session since its last registered login date.
        Returns:
        the formatted duration of the current user session, or empty string if the user is not connected.
      • isUserManualNotificationUserReceiverLimit

        boolean isUserManualNotificationUserReceiverLimit()
        Indicates if a limitation exists about the number of receivers the user can notify manually.
        Returns:
        true if the limitation exists, false otherwise.
      • getUserManualNotificationUserReceiverLimitValue

        int getUserManualNotificationUserReceiverLimitValue()
        Gets the maximum user receivers the user can notify manually.
        Returns:
        the maximum user receivers the user can notify manually. If the value is not greater than 0, the user is not limited.