com.nurelm.nucontent.model
Class User

java.lang.Object
  extended bycom.nurelm.nucontent.model.Entity
      extended bycom.nurelm.nucontent.model.User
All Implemented Interfaces:
java.security.Principal, java.io.Serializable

public class User
extends Entity
implements java.security.Principal, java.io.Serializable

This object corresponds to a user in a NuContent Web site.

See Also:
Serialized Form

Field Summary
static java.lang.String SITE_ADMINISTRATOR
          Initial username for default SITE_ADMINISTRATOR
static java.lang.String SITE_ADMINISTRATOR_PASSWORD
          Initial password for default SITE_ADMINISTRATOR
 
Fields inherited from class com.nurelm.nucontent.model.Entity
id, name
 
Constructor Summary
protected User()
          Does nothing, used nowhere, but eliminates JDO complie-time warning about not having a zero-args constructor.
  User(java.lang.String name)
           
 
Method Summary
 boolean addToGroup(Group group)
          Add this User as a member to supplied Group.
 boolean authenticate(java.lang.String password)
          Verify that the passed-in password equals the stored password.
 java.lang.String getEmailAddress()
           
 java.lang.String getGroupNames()
          Returns a String containing the names of the groups in which the user belongs.
 java.lang.String[] getGroupNamesArray()
           
 int getNumOpenTasks()
           
 int getNumPagesBeingEdited()
           
 int getNumPagesBeingReviewed()
           
 java.util.Collection getPagesBeingEdited()
          Returns a collection of pages user is currently editing.
 java.util.Collection getPagesBeingReviewed()
          Returns a collection of pages user is currently reviewing.
 java.util.Collection getPagesWithOpenTasks()
          Returns a collection of pages with open tasks of any type.
 java.util.Collection getPagesWithOpenTasks(int taskType)
          Returns a collection of pages with open tasks of the specified type.
 java.lang.String getPassword()
           
 Site getSite()
          Gets the Site to which this User belongs.
 UserValueObject getValueObject()
           
 java.util.Collection getWorkingPages()
           
 boolean isInGroup(Group group)
          Determine whether User is member of supplied Group.
 boolean isInSiteAdminGroup()
          Determine whether User is member of special Site Administrators group
 boolean removeFromGroup(Group group)
          Removes this User from the supplied Group.
 void replaceGroups(Group[] replacementGroups)
          Replaces any existing groups with the ones supplied.
 void setEmailAddress(java.lang.String emailAdress)
           
 void setPassword(java.lang.String password)
           
 
Methods inherited from class com.nurelm.nucontent.model.Entity
equals, getId, getName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, getName, hashCode, toString
 

Field Detail

SITE_ADMINISTRATOR

public static final java.lang.String SITE_ADMINISTRATOR
Initial username for default SITE_ADMINISTRATOR

See Also:
Constant Field Values

SITE_ADMINISTRATOR_PASSWORD

public static final java.lang.String SITE_ADMINISTRATOR_PASSWORD
Initial password for default SITE_ADMINISTRATOR

See Also:
Constant Field Values
Constructor Detail

User

protected User()
Does nothing, used nowhere, but eliminates JDO complie-time warning about not having a zero-args constructor.


User

public User(java.lang.String name)
Method Detail

authenticate

public boolean authenticate(java.lang.String password)
Verify that the passed-in password equals the stored password.


addToGroup

public boolean addToGroup(Group group)
Add this User as a member to supplied Group.


removeFromGroup

public boolean removeFromGroup(Group group)
Removes this User from the supplied Group.


isInGroup

public boolean isInGroup(Group group)
Determine whether User is member of supplied Group.


isInSiteAdminGroup

public boolean isInSiteAdminGroup()
Determine whether User is member of special Site Administrators group


setPassword

public void setPassword(java.lang.String password)

getValueObject

public UserValueObject getValueObject()

getGroupNames

public java.lang.String getGroupNames()
Returns a String containing the names of the groups in which the user belongs. The names are in alphabetical order, separated by a comma and a space. For example: "Engineering, Staff". The string is empty if the user does not belong to groups. It is not null.


getGroupNamesArray

public java.lang.String[] getGroupNamesArray()

replaceGroups

public void replaceGroups(Group[] replacementGroups)
Replaces any existing groups with the ones supplied. If replacementGroups is null or empty, then all existing groups are cleared and none are added.


getPagesWithOpenTasks

public java.util.Collection getPagesWithOpenTasks(int taskType)
Returns a collection of pages with open tasks of the specified type.

Returns:
Collection of pages with open tasks of the specified type.

getPagesWithOpenTasks

public java.util.Collection getPagesWithOpenTasks()
Returns a collection of pages with open tasks of any type.

Returns:
Collection of pages with open tasks of any type.

getPagesBeingEdited

public java.util.Collection getPagesBeingEdited()
Returns a collection of pages user is currently editing.

Returns:
Collection of pages user is currently editing.

getPagesBeingReviewed

public java.util.Collection getPagesBeingReviewed()
Returns a collection of pages user is currently reviewing.

Returns:
Collection of pages user is currently reviewing.

getWorkingPages

public java.util.Collection getWorkingPages()

getNumPagesBeingEdited

public int getNumPagesBeingEdited()

getNumPagesBeingReviewed

public int getNumPagesBeingReviewed()

getNumOpenTasks

public int getNumOpenTasks()

getSite

public Site getSite()
             throws DataAccessException
Gets the Site to which this User belongs.

Returns:
The Site to which this page User belongs.
Throws:
DataAccessException

getPassword

public java.lang.String getPassword()

setEmailAddress

public void setEmailAddress(java.lang.String emailAdress)

getEmailAddress

public java.lang.String getEmailAddress()