com.silverpeas.profile.web
Class UserGroupProfileEntity

java.lang.Object
  extended by com.stratelia.webactiv.beans.admin.Group
      extended by com.silverpeas.profile.web.UserGroupProfileEntity
All Implemented Interfaces:
Exposable, Serializable, Comparable<Group>

public class UserGroupProfileEntity
extends Group
implements Exposable

The profile of the user group exposable in the WEB. It is a web entity representing a group of users that can be serialized into a given media type (JSON, XML). It is a decorator that decorates a Group object with additional properties concerning its exposition in the WEB.

See Also:
Serialized Form

Constructor Summary
protected UserGroupProfileEntity()
           
 
Method Summary
 int compareTo(Group o)
           
 boolean equals(Object obj)
           
static UserGroupProfileEntity fromGroup(Group group)
          Decorates the specified user group with the required WEB exposition features.
static UserGroupProfileEntity[] fromGroups(List<? extends Group> groups, URI groupsURI)
          Decorates the specified user groups with required WEB exposition features.
 URI getChildrenUri()
          Gets the URI at which its direct children groups can be retrieved.
 String getDescription()
          Get the group description
 String getDomainId()
          Get the domain id where the group is stored
 String getDomainName()
           
 String getId()
          Get the group id
 String getName()
          Get the group name
 int getNbUsers()
          Gets the number of direct users in this group; the users from its subgroups aren't counted.
 URI getParentUri()
          Gets the URI of its parent group.
 String getRule()
           
 String getSpecificId()
          Get the group specific id
 List<? extends Group> getSubGroups()
          Gets the direct subgroups of this user group.
 String getSuperGroupId()
          Get the father group id
 int getTotalNbUsers()
          Gets the total number of users in this group and in its subgroups.
 URI getURI()
          Gets the URI at which this resource is published and can be accessed.
 String[] getUserIds()
          Get the list of users in the group
 URI getUsersUri()
           
 int hashCode()
           
 boolean isRoot()
          Is this group is a root one?
 boolean isSynchronized()
           
 void setDescription(String newDescription)
          Set the group description
 void setDomainId(String newDomainId)
          Set the domain id where the group is stored
 void setId(String newId)
          Set the group id
 void setName(String newName)
          Set the group name
 void setRule(String rule)
           
 void setSpecificId(String newSpecificId)
          Set the group specific id
 void setSuperGroupId(String newSuperGroupId)
          Set the father group id
 void setUserIds(String[] sUserIds)
          Set the list of users in the group
 void traceGroup()
          Trace the group's values
 UserGroupProfileEntity withAsUri(URI groupUri)
           
 
Methods inherited from class com.stratelia.webactiv.beans.admin.Group
getAllRoots, getAllRootsInDomain, getAllUsers, getById, getOrganisationController, setTotalNbUsers
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserGroupProfileEntity

protected UserGroupProfileEntity()
Method Detail

fromGroup

public static UserGroupProfileEntity fromGroup(Group group)
Decorates the specified user group with the required WEB exposition features.

Parameters:
group - the user group to decorate.
Returns:
a web entity representing the specified group profile.

fromGroups

public static UserGroupProfileEntity[] fromGroups(List<? extends Group> groups,
                                                  URI groupsURI)
Decorates the specified user groups with required WEB exposition features.

Parameters:
groups - a list of user groups to decorate.
groupsURI - the URI at which the specified groups are defined.
Returns:
a list of web entities representing the specified group profiles.

withAsUri

public UserGroupProfileEntity withAsUri(URI groupUri)

getParentUri

public URI getParentUri()
Gets the URI of its parent group.

Returns:
the URI of its parent group or null if this group is a root one.

getChildrenUri

public URI getChildrenUri()
Gets the URI at which its direct children groups can be retrieved.

Returns:
the URI at which its subgroups can be get.

getUsersUri

public URI getUsersUri()

getDescription

public String getDescription()
Description copied from class: Group
Get the group description

Overrides:
getDescription in class Group

getId

public String getId()
Description copied from class: Group
Get the group id

Overrides:
getId in class Group

getName

public String getName()
Description copied from class: Group
Get the group name

Overrides:
getName in class Group

getNbUsers

public int getNbUsers()
Description copied from class: Group
Gets the number of direct users in this group; the users from its subgroups aren't counted. To count also the users in its subgroups, please use the com.stratelia.webactiv.beans.admin.Group#getTotalNbUsers method instead.

Overrides:
getNbUsers in class Group
Returns:
the number of direct users.

getTotalNbUsers

public int getTotalNbUsers()
Description copied from class: Group
Gets the total number of users in this group and in its subgroups. Users that are in several groups are counted only once.

Depending on the requester, the total number of users can omit some users by their state (usually the users whose their account is deactivated). By default, all the users whose the account is deleted aren't taken into account.

Overrides:
getTotalNbUsers in class Group
Returns:
the total number of distinct users in its group and subgroups.

getSpecificId

public String getSpecificId()
Description copied from class: Group
Get the group specific id

Overrides:
getSpecificId in class Group

setDescription

public void setDescription(String newDescription)
Description copied from class: Group
Set the group description

Overrides:
setDescription in class Group

setId

public void setId(String newId)
Description copied from class: Group
Set the group id

Overrides:
setId in class Group

setName

public void setName(String newName)
Description copied from class: Group
Set the group name

Overrides:
setName in class Group

getDomainId

public String getDomainId()
Description copied from class: Group
Get the domain id where the group is stored

Overrides:
getDomainId in class Group

getSuperGroupId

public String getSuperGroupId()
Description copied from class: Group
Get the father group id

Overrides:
getSuperGroupId in class Group

setDomainId

public void setDomainId(String newDomainId)
Description copied from class: Group
Set the domain id where the group is stored

Overrides:
setDomainId in class Group

setSpecificId

public void setSpecificId(String newSpecificId)
Description copied from class: Group
Set the group specific id

Overrides:
setSpecificId in class Group

setSuperGroupId

public void setSuperGroupId(String newSuperGroupId)
Description copied from class: Group
Set the father group id

Overrides:
setSuperGroupId in class Group

getDomainName

public String getDomainName()

getSubGroups

public List<? extends Group> getSubGroups()
Description copied from class: Group
Gets the direct subgroups of this user group.

Overrides:
getSubGroups in class Group
Returns:
a list with its direct subgroups. If this group hasn't children group, then the returned list is empty.

traceGroup

public void traceGroup()
Description copied from class: Group
Trace the group's values

Overrides:
traceGroup in class Group

setUserIds

public void setUserIds(String[] sUserIds)
Description copied from class: Group
Set the list of users in the group

Overrides:
setUserIds in class Group

setRule

public void setRule(String rule)
Overrides:
setRule in class Group

isSynchronized

public boolean isSynchronized()
Overrides:
isSynchronized in class Group

isRoot

public boolean isRoot()
Description copied from class: Group
Is this group is a root one? A root group is a group that has no father group.

Overrides:
isRoot in class Group
Returns:
true if this group is a root one, false otherwise.

getUserIds

public String[] getUserIds()
Description copied from class: Group
Get the list of users in the group

Overrides:
getUserIds in class Group

getRule

public String getRule()
Overrides:
getRule in class Group

compareTo

public int compareTo(Group o)
Specified by:
compareTo in interface Comparable<Group>
Overrides:
compareTo in class Group

equals

public boolean equals(Object obj)
Overrides:
equals in class Group

hashCode

public int hashCode()
Overrides:
hashCode in class Group

getURI

public URI getURI()
Description copied from interface: Exposable
Gets the URI at which this resource is published and can be accessed.

Specified by:
getURI in interface Exposable
Returns:
the web resource URI.


Copyright © 2016 Silverpeas. All Rights Reserved.