Liferay 7.0-ce-b4

com.liferay.portal.model.impl
Class UserImpl

java.lang.Object
  extended by com.liferay.portal.model.impl.BaseModelImpl<User>
      extended by com.liferay.portal.model.impl.UserModelImpl
          extended by com.liferay.portal.model.impl.UserBaseImpl
              extended by com.liferay.portal.model.impl.UserImpl
All Implemented Interfaces:
BaseModel<User>, ClassedModel, MVCCModel, PersistedModel, ShardedModel, StagedModel, User, UserModel, Serializable, Cloneable, Comparable<User>

public class UserImpl
extends UserBaseImpl

Represents a portal user, providing access to the user's contact information, groups, organizations, teams, user groups, roles, locale, timezone, and more.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.liferay.portal.model.impl.UserModelImpl
COLUMN_BITMASK_ENABLED, COMPANYID_COLUMN_BITMASK, CONTACTID_COLUMN_BITMASK, CREATEDATE_COLUMN_BITMASK, DATA_SOURCE, DEFAULTUSER_COLUMN_BITMASK, EMAILADDRESS_COLUMN_BITMASK, ENTITY_CACHE_ENABLED, FACEBOOKID_COLUMN_BITMASK, FINDER_CACHE_ENABLED, FINDER_CACHE_ENABLED_USERS_GROUPS, FINDER_CACHE_ENABLED_USERS_ORGS, FINDER_CACHE_ENABLED_USERS_ROLES, FINDER_CACHE_ENABLED_USERS_TEAMS, FINDER_CACHE_ENABLED_USERS_USERGROUPS, LOCK_EXPIRATION_TIME, MAPPING_TABLE_USERS_GROUPS_COLUMNS, MAPPING_TABLE_USERS_GROUPS_NAME, MAPPING_TABLE_USERS_GROUPS_SQL_CREATE, MAPPING_TABLE_USERS_ORGS_COLUMNS, MAPPING_TABLE_USERS_ORGS_NAME, MAPPING_TABLE_USERS_ORGS_SQL_CREATE, MAPPING_TABLE_USERS_ROLES_COLUMNS, MAPPING_TABLE_USERS_ROLES_NAME, MAPPING_TABLE_USERS_ROLES_SQL_CREATE, MAPPING_TABLE_USERS_TEAMS_COLUMNS, MAPPING_TABLE_USERS_TEAMS_NAME, MAPPING_TABLE_USERS_TEAMS_SQL_CREATE, MAPPING_TABLE_USERS_USERGROUPS_COLUMNS, MAPPING_TABLE_USERS_USERGROUPS_NAME, MAPPING_TABLE_USERS_USERGROUPS_SQL_CREATE, MODIFIEDDATE_COLUMN_BITMASK, OPENID_COLUMN_BITMASK, ORDER_BY_JPQL, ORDER_BY_SQL, PORTRAITID_COLUMN_BITMASK, SCREENNAME_COLUMN_BITMASK, SESSION_FACTORY, STATUS_COLUMN_BITMASK, TABLE_COLUMNS, TABLE_COLUMNS_MAP, TABLE_NAME, TABLE_SQL_CREATE, TABLE_SQL_DROP, TX_MANAGER, USERID_COLUMN_BITMASK, UUID_COLUMN_BITMASK
 
Fields inherited from interface com.liferay.portal.model.User
USER_ID_ACCESSOR
 
Constructor Summary
UserImpl()
           
 
Method Summary
 void addRemotePreference(RemotePreference remotePreference)
           
 Contact fetchContact()
           
 List<Address> getAddresses()
          Returns the user's addresses.
 Date getBirthday()
          Returns the user's birth date.
 String getCompanyMx()
          Returns the user's company's mail domain.
 Contact getContact()
          Returns the user's associated contact.
 String getDigest()
          Returns the user's digest.
 String getDigest(String password)
          Returns a digest for the user, incorporating the password.
 String getDisplayEmailAddress()
          Returns the user's primary email address, or a blank string if the address is fake.
 String getDisplayURL(String portalURL, String mainPath)
          Deprecated. As of 7.0.0, replaced by getDisplayURL(ThemeDisplay)
 String getDisplayURL(String portalURL, String mainPath, boolean privateLayout)
          Deprecated. As of 7.0.0, replaced by getDisplayURL(ThemeDisplay)
 String getDisplayURL(ThemeDisplay themeDisplay)
          Returns the user's display URL based on the theme display, discounting the URL of the user's default intranet site home page.
 String getDisplayURL(ThemeDisplay themeDisplay, boolean privateLayout)
          Returns the user's display URL based on the theme display.
 List<EmailAddress> getEmailAddresses()
          Returns the user's email addresses.
 boolean getFemale()
          Returns true if the user is female.
 String getFullName()
          Returns the user's full name.
 String getFullName(boolean usePrefix, boolean useSuffix)
          Returns the user's full name.
 Group getGroup()
           
 long getGroupId()
           
 long[] getGroupIds()
           
 List<Group> getGroups()
           
 String getInitials()
           
 Locale getLocale()
           
 String getLogin()
           
 boolean getMale()
          Returns true if the user is male.
 List<Group> getMySiteGroups()
           
 List<Group> getMySiteGroups(int max)
           
 List<Group> getMySiteGroups(String[] classNames, int max)
           
 long[] getOrganizationIds()
           
 long[] getOrganizationIds(boolean includeAdministrative)
           
 List<Organization> getOrganizations()
           
 List<Organization> getOrganizations(boolean includeAdministrative)
           
 String getOriginalEmailAddress()
           
 boolean getPasswordModified()
           
 PasswordPolicy getPasswordPolicy()
           
 String getPasswordUnencrypted()
           
 List<Phone> getPhones()
           
 String getPortraitURL(ThemeDisplay themeDisplay)
           
 int getPrivateLayoutsPageCount()
           
protected  String getProfileFriendlyURL()
           
 int getPublicLayoutsPageCount()
           
 Set<String> getReminderQueryQuestions()
           
 RemotePreference getRemotePreference(String name)
           
 Iterable<RemotePreference> getRemotePreferences()
           
 long[] getRoleIds()
           
 List<Role> getRoles()
           
 List<Group> getSiteGroups()
           
 List<Group> getSiteGroups(boolean includeAdministrative)
           
 long[] getTeamIds()
           
 List<Team> getTeams()
           
 TimeZone getTimeZone()
           
 Date getUnlockDate()
           
 Date getUnlockDate(PasswordPolicy passwordPolicy)
           
 long[] getUserGroupIds()
           
 List<UserGroup> getUserGroups()
           
 List<Website> getWebsites()
           
 boolean hasCompanyMx()
           
 boolean hasCompanyMx(String emailAddress)
           
 boolean hasMySites()
           
 boolean hasOrganization()
           
 boolean hasPrivateLayouts()
           
 boolean hasPublicLayouts()
           
 boolean hasReminderQuery()
           
 boolean isActive()
           
 boolean isEmailAddressComplete()
           
 boolean isEmailAddressVerificationComplete()
           
 boolean isFemale()
           
 boolean isMale()
           
 boolean isPasswordModified()
           
 boolean isReminderQueryComplete()
           
 boolean isSetupComplete()
           
 boolean isTermsOfUseComplete()
           
 void setLanguageId(String languageId)
          Sets the language ID of this user.
 void setPasswordModified(boolean passwordModified)
           
 void setPasswordUnencrypted(String passwordUnencrypted)
           
 void setTimeZoneId(String timeZoneId)
          Sets the time zone ID of this user.
 
Methods inherited from class com.liferay.portal.model.impl.UserBaseImpl
persist
 
Methods inherited from class com.liferay.portal.model.impl.UserModelImpl
clone, compareTo, equals, getAgreedToTermsOfUse, getColumnBitmask, getComments, getCompanyId, getContactId, getCreateDate, getDefaultUser, getEmailAddress, getEmailAddressVerified, getExpandoBridge, getFacebookId, getFailedLoginAttempts, getFirstName, getGraceLoginCount, getGreeting, getJobTitle, getLanguageId, getLastFailedLoginDate, getLastLoginDate, getLastLoginIP, getLastName, getLdapServerId, getLockout, getLockoutDate, getLoginDate, getLoginIP, getMiddleName, getModelAttributes, getModelClass, getModelClassName, getModifiedDate, getMvccVersion, getOpenId, getOriginalCompanyId, getOriginalContactId, getOriginalCreateDate, getOriginalDefaultUser, getOriginalFacebookId, getOriginalModifiedDate, getOriginalOpenId, getOriginalPortraitId, getOriginalScreenName, getOriginalStatus, getOriginalUserId, getOriginalUuid, getPassword, getPasswordEncrypted, getPasswordModifiedDate, getPasswordReset, getPortraitId, getPrimaryKey, getPrimaryKeyObj, getReminderQueryAnswer, getReminderQueryQuestion, getScreenName, getStagedModelType, getStatus, getTimeZoneId, getUserId, getUserUuid, getUuid, hashCode, hasSetModifiedDate, isAgreedToTermsOfUse, isDefaultUser, isEmailAddressVerified, isEntityCacheEnabled, isFinderCacheEnabled, isLockout, isPasswordEncrypted, isPasswordReset, resetOriginalValues, setAgreedToTermsOfUse, setComments, setCompanyId, setContactId, setCreateDate, setDefaultUser, setDigest, setEmailAddress, setEmailAddressVerified, setExpandoBridgeAttributes, setFacebookId, setFailedLoginAttempts, setFirstName, setGraceLoginCount, setGreeting, setJobTitle, setLastFailedLoginDate, setLastLoginDate, setLastLoginIP, setLastName, setLdapServerId, setLockout, setLockoutDate, setLoginDate, setLoginIP, setMiddleName, setModelAttributes, setModifiedDate, setMvccVersion, setOpenId, setPassword, setPasswordEncrypted, setPasswordModifiedDate, setPasswordReset, setPortraitId, setPrimaryKey, setPrimaryKeyObj, setReminderQueryAnswer, setReminderQueryQuestion, setScreenName, setStatus, setUserId, setUserUuid, setUuid, toCacheModel, toEscapedModel, toModel, toModels, toString, toXmlString
 
Methods inherited from class com.liferay.portal.model.impl.BaseModelImpl
getLocale, isCachedModel, isEscapedModel, isNew, setCachedModel, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setNew, toUnescapedModel
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.liferay.portal.model.UserModel
clone, compareTo, getAgreedToTermsOfUse, getComments, getCompanyId, getContactId, getCreateDate, getDefaultUser, getEmailAddress, getEmailAddressVerified, getExpandoBridge, getFacebookId, getFailedLoginAttempts, getFirstName, getGraceLoginCount, getGreeting, getJobTitle, getLanguageId, getLastFailedLoginDate, getLastLoginDate, getLastLoginIP, getLastName, getLdapServerId, getLockout, getLockoutDate, getLoginDate, getLoginIP, getMiddleName, getModifiedDate, getMvccVersion, getOpenId, getPassword, getPasswordEncrypted, getPasswordModifiedDate, getPasswordReset, getPortraitId, getPrimaryKey, getPrimaryKeyObj, getReminderQueryAnswer, getReminderQueryQuestion, getScreenName, getStatus, getTimeZoneId, getUserId, getUserUuid, getUuid, hashCode, isAgreedToTermsOfUse, isCachedModel, isDefaultUser, isEmailAddressVerified, isEscapedModel, isLockout, isNew, isPasswordEncrypted, isPasswordReset, setAgreedToTermsOfUse, setCachedModel, setComments, setCompanyId, setContactId, setCreateDate, setDefaultUser, setDigest, setEmailAddress, setEmailAddressVerified, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setFacebookId, setFailedLoginAttempts, setFirstName, setGraceLoginCount, setGreeting, setJobTitle, setLastFailedLoginDate, setLastLoginDate, setLastLoginIP, setLastName, setLdapServerId, setLockout, setLockoutDate, setLoginDate, setLoginIP, setMiddleName, setModifiedDate, setMvccVersion, setNew, setOpenId, setPassword, setPasswordEncrypted, setPasswordModifiedDate, setPasswordReset, setPortraitId, setPrimaryKey, setPrimaryKeyObj, setReminderQueryAnswer, setReminderQueryQuestion, setScreenName, setStatus, setUserId, setUserUuid, setUuid, toCacheModel, toEscapedModel, toString, toUnescapedModel, toXmlString
 
Methods inherited from interface com.liferay.portal.model.BaseModel
getModelAttributes, isEntityCacheEnabled, isFinderCacheEnabled, resetOriginalValues, setModelAttributes
 
Methods inherited from interface com.liferay.portal.model.StagedModel
getStagedModelType
 
Methods inherited from interface com.liferay.portal.model.ClassedModel
getModelClass, getModelClassName
 

Constructor Detail

UserImpl

public UserImpl()
Method Detail

addRemotePreference

public void addRemotePreference(RemotePreference remotePreference)

fetchContact

public Contact fetchContact()

getAddresses

public List<Address> getAddresses()
Returns the user's addresses.

Returns:
the user's addresses

getBirthday

public Date getBirthday()
                 throws PortalException
Returns the user's birth date.

Returns:
the user's birth date
Throws:
PortalException

getCompanyMx

public String getCompanyMx()
                    throws PortalException
Returns the user's company's mail domain.

Returns:
the user's company's mail domain
Throws:
PortalException

getContact

public Contact getContact()
                   throws PortalException
Returns the user's associated contact.

Returns:
the user's associated contact
Throws:
PortalException
See Also:
Contact

getDigest

public String getDigest()
Returns the user's digest.

Specified by:
getDigest in interface UserModel
Overrides:
getDigest in class UserModelImpl
Returns:
the user's digest

getDigest

public String getDigest(String password)
Returns a digest for the user, incorporating the password.

Parameters:
password - a password to incorporate with the digest
Returns:
a digest for the user, incorporating the password

getDisplayEmailAddress

public String getDisplayEmailAddress()
Returns the user's primary email address, or a blank string if the address is fake.

Returns:
the user's primary email address, or a blank string if the address is fake

getDisplayURL

@Deprecated
public String getDisplayURL(String portalURL,
                                       String mainPath)
                     throws PortalException
Deprecated. As of 7.0.0, replaced by getDisplayURL(ThemeDisplay)

Returns the user's display URL, discounting the URL of the user's default intranet site home page.

The logic for the display URL to return is as follows:

  1. If the user is the guest user, return an empty string.
  2. Else, if a friendly URL is available for the user's profile, return that friendly URL.
  3. Otherwise, return the URL of the user's default extranet site home page.

Parameters:
portalURL - the portal's URL
mainPath - the main path
Returns:
the user's display URL
Throws:
PortalException

getDisplayURL

@Deprecated
public String getDisplayURL(String portalURL,
                                       String mainPath,
                                       boolean privateLayout)
                     throws PortalException
Deprecated. As of 7.0.0, replaced by getDisplayURL(ThemeDisplay)

Returns the user's display URL.

The logic for the display URL to return is as follows:

  1. If the user is the guest user, return an empty string.
  2. Else, if a friendly URL is available for the user's profile, return that friendly URL.
  3. Else, if privateLayout is true, return the URL of the user's default intranet site home page.
  4. Otherwise, return the URL of the user's default extranet site home page.

Parameters:
portalURL - the portal's URL
mainPath - the main path
privateLayout - whether to use the URL of the user's default intranet(versus extranet) site home page, if no friendly URL is available for the user's profile
Returns:
the user's display URL
Throws:
PortalException
PortalException

getDisplayURL

public String getDisplayURL(ThemeDisplay themeDisplay)
                     throws PortalException
Returns the user's display URL based on the theme display, discounting the URL of the user's default intranet site home page.

The logic for the display URL to return is as follows:

  1. If the user is the guest user, return an empty string.
  2. Else, if a friendly URL is available for the user's profile, return that friendly URL.
  3. Otherwise, return the URL of the user's default extranet site home page.

Parameters:
themeDisplay - the theme display
Returns:
the user's display URL
Throws:
PortalException

getDisplayURL

public String getDisplayURL(ThemeDisplay themeDisplay,
                            boolean privateLayout)
                     throws PortalException
Returns the user's display URL based on the theme display.

The logic for the display URL to return is as follows:

  1. If the user is the guest user, return an empty string.
  2. Else, if a friendly URL is available for the user's profile, return that friendly URL.
  3. Else, if privateLayout is true, return the URL of the user's default intranet site home page.
  4. Otherwise, return the URL of the user's default extranet site home page.

Parameters:
themeDisplay - the theme display
privateLayout - whether to use the URL of the user's default intranet (versus extranet) site home page, if no friendly URL is available for the user's profile
Returns:
the user's display URL
Throws:
PortalException
PortalException

getEmailAddresses

public List<EmailAddress> getEmailAddresses()
Returns the user's email addresses.

Returns:
the user's email addresses

getFemale

public boolean getFemale()
                  throws PortalException
Returns true if the user is female.

Returns:
true if the user is female; false otherwise
Throws:
PortalException

getFullName

@AutoEscape
public String getFullName()
Returns the user's full name.

Returns:
the user's full name

getFullName

@AutoEscape
public String getFullName(boolean usePrefix,
                                     boolean useSuffix)
Returns the user's full name.

Returns:
the user's full name

getGroup

public Group getGroup()

getGroupId

public long getGroupId()

getGroupIds

public long[] getGroupIds()

getGroups

public List<Group> getGroups()

getInitials

public String getInitials()

getLocale

public Locale getLocale()

getLogin

public String getLogin()
                throws PortalException
Throws:
PortalException

getMale

public boolean getMale()
                throws PortalException
Returns true if the user is male.

Returns:
true if the user is male; false otherwise
Throws:
PortalException

getMySiteGroups

public List<Group> getMySiteGroups()
                            throws PortalException
Throws:
PortalException

getMySiteGroups

public List<Group> getMySiteGroups(int max)
                            throws PortalException
Throws:
PortalException

getMySiteGroups

public List<Group> getMySiteGroups(String[] classNames,
                                   int max)
                            throws PortalException
Throws:
PortalException

getOrganizationIds

public long[] getOrganizationIds()
                          throws PortalException
Throws:
PortalException

getOrganizationIds

public long[] getOrganizationIds(boolean includeAdministrative)
                          throws PortalException
Throws:
PortalException

getOrganizations

public List<Organization> getOrganizations()
                                    throws PortalException
Throws:
PortalException

getOrganizations

public List<Organization> getOrganizations(boolean includeAdministrative)
                                    throws PortalException
Throws:
PortalException

getOriginalEmailAddress

public String getOriginalEmailAddress()
Specified by:
getOriginalEmailAddress in interface User
Overrides:
getOriginalEmailAddress in class UserModelImpl

getPasswordModified

public boolean getPasswordModified()

getPasswordPolicy

public PasswordPolicy getPasswordPolicy()
                                 throws PortalException
Throws:
PortalException

getPasswordUnencrypted

public String getPasswordUnencrypted()

getPhones

public List<Phone> getPhones()

getPortraitURL

public String getPortraitURL(ThemeDisplay themeDisplay)
                      throws PortalException
Throws:
PortalException

getPrivateLayoutsPageCount

public int getPrivateLayoutsPageCount()
                               throws PortalException
Throws:
PortalException

getPublicLayoutsPageCount

public int getPublicLayoutsPageCount()
                              throws PortalException
Throws:
PortalException

getReminderQueryQuestions

public Set<String> getReminderQueryQuestions()
                                      throws PortalException
Throws:
PortalException

getRemotePreference

public RemotePreference getRemotePreference(String name)

getRemotePreferences

public Iterable<RemotePreference> getRemotePreferences()

getRoleIds

public long[] getRoleIds()

getRoles

public List<Role> getRoles()

getSiteGroups

public List<Group> getSiteGroups()
                          throws PortalException
Throws:
PortalException

getSiteGroups

public List<Group> getSiteGroups(boolean includeAdministrative)
                          throws PortalException
Throws:
PortalException

getTeamIds

public long[] getTeamIds()

getTeams

public List<Team> getTeams()

getTimeZone

public TimeZone getTimeZone()

getUnlockDate

public Date getUnlockDate()
                   throws PortalException
Throws:
PortalException

getUnlockDate

public Date getUnlockDate(PasswordPolicy passwordPolicy)

getUserGroupIds

public long[] getUserGroupIds()

getUserGroups

public List<UserGroup> getUserGroups()

getWebsites

public List<Website> getWebsites()

hasCompanyMx

public boolean hasCompanyMx()
                     throws PortalException
Throws:
PortalException

hasCompanyMx

public boolean hasCompanyMx(String emailAddress)
                     throws PortalException
Throws:
PortalException

hasMySites

public boolean hasMySites()
                   throws PortalException
Throws:
PortalException

hasOrganization

public boolean hasOrganization()

hasPrivateLayouts

public boolean hasPrivateLayouts()
                          throws PortalException
Throws:
PortalException

hasPublicLayouts

public boolean hasPublicLayouts()
                         throws PortalException
Throws:
PortalException

hasReminderQuery

public boolean hasReminderQuery()

isActive

public boolean isActive()

isEmailAddressComplete

public boolean isEmailAddressComplete()

isEmailAddressVerificationComplete

public boolean isEmailAddressVerificationComplete()

isFemale

public boolean isFemale()
                 throws PortalException
Throws:
PortalException

isMale

public boolean isMale()
               throws PortalException
Throws:
PortalException

isPasswordModified

public boolean isPasswordModified()

isReminderQueryComplete

public boolean isReminderQueryComplete()

isSetupComplete

public boolean isSetupComplete()

isTermsOfUseComplete

public boolean isTermsOfUseComplete()

setLanguageId

public void setLanguageId(String languageId)
Description copied from interface: UserModel
Sets the language ID of this user.

Specified by:
setLanguageId in interface UserModel
Overrides:
setLanguageId in class UserModelImpl
Parameters:
languageId - the language ID of this user

setPasswordModified

public void setPasswordModified(boolean passwordModified)

setPasswordUnencrypted

public void setPasswordUnencrypted(String passwordUnencrypted)

setTimeZoneId

public void setTimeZoneId(String timeZoneId)
Description copied from interface: UserModel
Sets the time zone ID of this user.

Specified by:
setTimeZoneId in interface UserModel
Overrides:
setTimeZoneId in class UserModelImpl
Parameters:
timeZoneId - the time zone ID of this user

getProfileFriendlyURL

protected String getProfileFriendlyURL()

Liferay 7.0-ce-b4