Class UserProfileEntity
- java.lang.Object
-
- org.silverpeas.core.admin.user.model.UserDetail
-
- org.silverpeas.core.webapi.profile.UserProfileEntity
-
- All Implemented Interfaces:
Serializable
,Comparable<User>
,User
,WebEntity
- Direct Known Subclasses:
ChatUserProfileEntity
,UserProfileExtendedEntity
public class UserProfileEntity extends UserDetail implements WebEntity
The profile of a user that is web entity in the WEB. It is a web entity representing the profile of a user that can be serialized into a given media type (JSON, XML). It is a decorator that decorates a UserDetail object with additional properties concerning its exposition in the WEB.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.silverpeas.core.admin.user.model.UserDetail
UserDetail.OnCreationDate, UserDetail.OnFirstNameAndLastName
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.admin.user.model.UserDetail
BLANK_NAME, SYSTEM_USER_ID
-
Fields inherited from interface org.silverpeas.core.admin.user.model.User
DEFAULT_AVATAR_PATH
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UserProfileEntity()
protected
UserProfileEntity(UserDetail user)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
static UserProfileEntity
fromUser(User user)
Decorates the specified user details with the required WEB exposition features.static UserProfileEntity[]
fromUsers(List<? extends UserDetail> users, URI usersUri)
Decorates the specified user details with the required WEB exposition features.UserAccessLevel
getAccessLevel()
Gets the user access level.String
getAvatar()
Gets the avatar URL of the user.URI
getContactsURI()
String
getDomainId()
Gets the user domain id.String
getDomainName()
String
getEmailAddress()
Gets the user email.String
getFirstName()
Gets the first name of the user.String
getFullName()
Gets the full name of the user.String
getId()
The unique identifier of the user into Silverpeas.String
getLanguage()
Gets the language used by the user.String
getLastName()
Gets the last name of the user.String
getLogin()
Gets the user login.String
getSpecificId()
Get specific user idString
getStatus()
Gets the current status filled by the user itself.URI
getURI()
Gets the URI at which this web entity is published and can be accessed.String
getWebPage()
Gets the URL of the WEB page in which is presented the profile of this user.int
hashCode()
boolean
isAnonymous()
Indicates if the user is an anonymous one.boolean
isBlockedState()
This method is the only one able to indicate the user blocked state.boolean
isConnected()
Is this user connected to Silverpeas?boolean
isDeactivatedState()
This method is the only one able to indicate the user deactivated state.boolean
isDeletedState()
This method is the only one able to indicate the user deletion state.boolean
isExpiredState()
This method is the only one able to indicate the user expiration state.boolean
isRemovedState()
This method is the only one able to indicate the user removed state.boolean
isSystem()
Is this user the system one?void
setAccessLevel(UserAccessLevel accessLevel)
Set user access levelvoid
setDeactivatedState(boolean deactivatedState)
void
setDeletedState(boolean deletedState)
void
setDomainId(String sDomainId)
Set user domain idvoid
setEmailAddress(String emailAddress)
Set user's emailvoid
setFirstName(String sFirstName)
Set user first namevoid
setId(String id)
Set user identifiervoid
setLastName(String sLastName)
Set user last namevoid
setLogin(String sLogin)
Set user loginvoid
setSpecificId(String sSpecificId)
Set specific user idvoid
setStatus(String newStatus)
UserDetail
toUserDetail()
UserProfileEntity
withAsUri(URI userUri)
-
Methods inherited from class org.silverpeas.core.admin.user.model.UserDetail
compareTo, from, getAll, getAnonymousUser, getAnonymousUserId, getAvatarFileName, getById, getCreationDate, getCurrentRequester, getDisplayedName, getDomain, getDurationOfCurrentSession, getExpirationDate, getInvitationReceivedFrom, getInvitationSentTo, getLastLoginCredentialUpdateDate, getLastLoginDate, getLoginAnswer, getLoginQuestion, getNbSuccessfulLoginAttempts, getNotifManualReceiverLimit, getOrganisationController, getSaveDate, getSmallAvatar, getState, getStateSaveDate, getSystemUser, getToken, getTosAcceptanceDate, getUserManualNotificationUserReceiverLimitValue, getUserPreferences, getVersion, hasSensitiveData, isAccessAdmin, isAccessDomainManager, isAccessGuest, isAccessPdcManager, isAccessUnknown, isAccessUser, isActivatedState, isAnonymousUser, isAnonymousUserExist, isAvatarDefined, isBackOfficeVisible, isBlanked, isDomainAdminRestricted, isDomainRestricted, isFullyDefined, isInRelationWith, isPlayingAdminRole, isUserManualNotificationUserReceiverLimit, isValidState, setCreationDate, setExpirationDate, setLastLoginCredentialUpdateDate, setLastLoginDate, setLoginAnswer, setLoginQuestion, setNbSuccessfulLoginAttempts, setNotifManualReceiverLimit, setSaveDate, setSensitiveData, setState, setStateSaveDate, setTosAcceptanceDate, setUserManualNotificationUserReceiverLimit, setVersion, traceUser
-
-
-
-
Constructor Detail
-
UserProfileEntity
protected UserProfileEntity()
-
UserProfileEntity
protected UserProfileEntity(UserDetail user)
-
-
Method Detail
-
fromUser
public static UserProfileEntity fromUser(User user)
Decorates the specified user details with the required WEB exposition features.- Parameters:
user
- the user details to decorate.- Returns:
- a web entity representing the profile of a user.
-
fromUsers
public static UserProfileEntity[] fromUsers(List<? extends UserDetail> users, URI usersUri)
Decorates the specified user details with the required WEB exposition features.- Parameters:
users
- a list of details on some users.usersUri
- the URI at which the specified users are defined.- Returns:
- a list of web entities representing the profile of the specified users.
-
getId
public String getId()
Description copied from interface:User
The unique identifier of the user into Silverpeas.- Specified by:
getId
in interfaceUser
- Overrides:
getId
in classUserDetail
- Returns:
- identifier as string.
-
getAccessLevel
public UserAccessLevel getAccessLevel()
Description copied from interface:User
Gets the user access level.- Specified by:
getAccessLevel
in interfaceUser
- Overrides:
getAccessLevel
in classUserDetail
- Returns:
- the access level as
UserAccessLevel
.
-
getDomainId
public String getDomainId()
Description copied from interface:User
Gets the user domain id.- Specified by:
getDomainId
in interfaceUser
- Overrides:
getDomainId
in classUserDetail
- Returns:
- user domain id as string.
-
getFirstName
public String getFirstName()
Description copied from interface:User
Gets the first name of the user.- Specified by:
getFirstName
in interfaceUser
- Overrides:
getFirstName
in classUserDetail
- Returns:
- first name as string.
-
getLastName
public String getLastName()
Description copied from interface:User
Gets the last name of the user.- Specified by:
getLastName
in interfaceUser
- Overrides:
getLastName
in classUserDetail
- Returns:
- last name as string.
-
getEmailAddress
public String getEmailAddress()
Description copied from interface:User
Gets the user email.- Specified by:
getEmailAddress
in interfaceUser
- Overrides:
getEmailAddress
in classUserDetail
- Returns:
- user email as string.
-
isBlockedState
public boolean isBlockedState()
Description copied from interface:User
This method is the only one able to indicate the user blocked state. Please do not useUser.getState()
to retrieve user blocked information.- Specified by:
isBlockedState
in interfaceUser
- Overrides:
isBlockedState
in classUserDetail
- Returns:
- true if blocked state, false otherwise.
-
isExpiredState
public boolean isExpiredState()
Description copied from interface:User
This method is the only one able to indicate the user expiration state. Please do not useUser.getState()
to retrieve user expiration information.- Specified by:
isExpiredState
in interfaceUser
- Overrides:
isExpiredState
in classUserDetail
- Returns:
- true if user is expired.
-
isDeletedState
public boolean isDeletedState()
Description copied from interface:User
This method is the only one able to indicate the user deletion state. Please do not useUser.getState()
to retrieve user deletion information.- Specified by:
isDeletedState
in interfaceUser
- Overrides:
isDeletedState
in classUserDetail
- Returns:
- true if deleted state, false otherwise.
-
isRemovedState
public boolean isRemovedState()
Description copied from interface:User
This method is the only one able to indicate the user removed state. Please do not useUser.getState()
to retrieve user removed information.- Specified by:
isRemovedState
in interfaceUser
- Overrides:
isRemovedState
in classUserDetail
- Returns:
- true if deleted state, false otherwise.
-
isDeactivatedState
public boolean isDeactivatedState()
Description copied from interface:User
This method is the only one able to indicate the user deactivated state. Please do not useUser.getState()
to retrieve user deactivated information.- Specified by:
isDeactivatedState
in interfaceUser
- Overrides:
isDeactivatedState
in classUserDetail
- Returns:
- true if deactivated state, false otherwise.
-
getLanguage
public String getLanguage()
Gets the language used by the user.- Returns:
- the code of the language used by the user.
-
setAccessLevel
public void setAccessLevel(UserAccessLevel accessLevel)
Description copied from class:UserDetail
Set user access level- Overrides:
setAccessLevel
in classUserDetail
- Parameters:
accessLevel
- the access level of the user
-
setDomainId
public void setDomainId(String sDomainId)
Description copied from class:UserDetail
Set user domain id- Overrides:
setDomainId
in classUserDetail
- Parameters:
sDomainId
- the unique identifier of the user domain he belongs to.
-
setFirstName
public void setFirstName(String sFirstName)
Description copied from class:UserDetail
Set user first name- Overrides:
setFirstName
in classUserDetail
- Parameters:
sFirstName
- user first name
-
setLastName
public void setLastName(String sLastName)
Description copied from class:UserDetail
Set user last name- Overrides:
setLastName
in classUserDetail
- Parameters:
sLastName
- user last name
-
setEmailAddress
public void setEmailAddress(String emailAddress)
Description copied from class:UserDetail
Set user's email- Overrides:
setEmailAddress
in classUserDetail
- Parameters:
emailAddress
- the email address of the user.
-
setDeletedState
public void setDeletedState(boolean deletedState)
-
setDeactivatedState
public void setDeactivatedState(boolean deactivatedState)
-
getAvatar
public String getAvatar()
Description copied from interface:User
Gets the avatar URL of the user.- Specified by:
getAvatar
in interfaceUser
- Overrides:
getAvatar
in classUserDetail
- Returns:
- the avatar URL as string.
-
getWebPage
public String getWebPage()
Gets the URL of the WEB page in which is presented the profile of this user.- Returns:
- the URL of the user profile WEB page.
-
getFullName
public String getFullName()
Gets the full name of the user. The full name is made up of its firstname and of its lastname.- Returns:
- the user fullname.
-
isConnected
public boolean isConnected()
Is this user connected to Silverpeas?- Specified by:
isConnected
in interfaceUser
- Overrides:
isConnected
in classUserDetail
- Returns:
- true if the user is connected, false otherwise.
-
getSpecificId
public String getSpecificId()
Description copied from class:UserDetail
Get specific user id- Overrides:
getSpecificId
in classUserDetail
- Returns:
- the user identifier specific to the identity service into which his account is registered.
-
setSpecificId
public void setSpecificId(String sSpecificId)
Description copied from class:UserDetail
Set specific user id- Overrides:
setSpecificId
in classUserDetail
- Parameters:
sSpecificId
- set the identifier of the user specific to the identity server into which his account is registered.
-
getLogin
public String getLogin()
Description copied from interface:User
Gets the user login.- Specified by:
getLogin
in interfaceUser
- Overrides:
getLogin
in classUserDetail
- Returns:
- user login as string.
-
setLogin
public void setLogin(String sLogin)
Description copied from class:UserDetail
Set user login- Overrides:
setLogin
in classUserDetail
- Parameters:
sLogin
- the login to set
-
getStatus
public String getStatus()
Description copied from interface:User
Gets the current status filled by the user itself.- Specified by:
getStatus
in interfaceUser
- Overrides:
getStatus
in classUserDetail
- Returns:
- current status as string.
-
setStatus
public void setStatus(String newStatus)
-
getDomainName
public String getDomainName()
-
isAnonymous
public boolean isAnonymous()
Description copied from interface:User
Indicates if the user is an anonymous one.- Specified by:
isAnonymous
in interfaceUser
- Overrides:
isAnonymous
in classUserDetail
- Returns:
- true if anonymous, false otherwise.
-
isSystem
public boolean isSystem()
Description copied from interface:User
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.- Specified by:
isSystem
in interfaceUser
- Overrides:
isSystem
in classUserDetail
- Returns:
- true if this user is the virtual system one. False otherwise.
-
withAsUri
public UserProfileEntity withAsUri(URI userUri)
-
toUserDetail
public UserDetail toUserDetail()
-
setId
public void setId(String id)
Description copied from class:UserDetail
Set user identifier- Overrides:
setId
in classUserDetail
- Parameters:
id
- the user identifier to set
-
equals
public boolean equals(Object other)
- Overrides:
equals
in classUserDetail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classUserDetail
-
getURI
public URI getURI()
Description copied from interface:WebEntity
Gets the URI at which this web entity is published and can be accessed.
-
getContactsURI
public URI getContactsURI()
-
-