02/28/2005
 

com.epicentric.user
Class UserGroup

java.lang.Object
  |
  +--com.epicentric.entity.implementations.generic.EntityWrapper
        |
        +--com.epicentric.entity.implementations.generic.ParentEntityWrapper
              |
              +--com.epicentric.entity.implementations.generic.ParentAndChildEntityWrapper
                    |
                    +--com.epicentric.user.UserGroup
All Implemented Interfaces:
ChildEntity, ChildEntity, Entity, Entity, Entity, Entity, Entity, ParentEntity, ParentEntity, com.epicentric.authorization.Permissionable, com.epicentric.authorization.Permissionable, com.epicentric.authorization.Principal, com.epicentric.repository.RepositoryElement, com.epicentric.repository.ShareableRepositoryElement, UniquelyIdentifiable, UniquelyIdentifiable, UniquelyIdentifiable, UniquelyIdentifiable, UniquelyIdentifiable, UniquelyIdentifiable, UniquelyIdentifiable, UniquelyIdentifiable, UniquelyIdentifiable

public class UserGroup
extends com.epicentric.entity.implementations.generic.ParentAndChildEntityWrapper
implements ParentEntity, ChildEntity, com.epicentric.authorization.Permissionable, com.epicentric.repository.ShareableRepositoryElement, com.epicentric.authorization.Principal

Object representation of a Vignette Portal user group. This class uses the Entity Management Subsystem to allow flexibility in the user group definition. A user group's attributes, such as its property set and allowable parent/child relationships, are specified through descriptors in the entity management configuration file (config/entity_management.xml by default). At startup, this configuration information is loaded into an EntityType object, which is accessible through the UserGroup.getEntityType() method.

Users in Vignette Portal also utilize the Entity Management Subsystem. An Entity parent/child relationship is used to represent user group membership. The following provides an example of how to get a set of all users that are immediate members of a group:


 EntityType userEntityType = UserManager.getInstance().getUserEntityType();
 try
 {
      Set users = userGroup.getChildren(userEntityType, false);
 }
 catch (EntityPersistenceException exception)
 {
      // handle exception
 }

 
User groups can be retrieved through the UserGroupManager or the UIDRegistry.

Since:
4.0

Field Summary
static String TITLE_PROPERTY_ID
          ID for the 'title' user group property.
 
Fields inherited from class com.epicentric.entity.implementations.generic.EntityWrapper
wrappedEntity
 
Method Summary
 void addChild(ChildEntity entityToAdd)
          Makes the supplied child entity a child of this user group.
 void addParent(ParentEntity entityToAdd)
          Makes the supplied parent entity a parent of this user group.
 boolean canAddChild(ChildEntity childEntity)
          Determines if the supplied child entity can be made a child of this user group.
 boolean canAddParent(ParentEntity parentEntity)
          Determines if the supplied parent entity can be made a parent of this user group.
 boolean canRemoveChild(ChildEntity childEntity)
          Determines if the supplied child entity can be removed as a child of this user group.
 boolean canRemoveParent(ParentEntity parentEntity)
          Determines if the supplied parent entity can be removed as a parent of this user group.
 void delete()
          Deletes the user group from the persistence store.
 boolean equals(Object obj)
           
 Set getChildren(EntityType entityType, boolean recursive)
          Gets a Set of all children of this user group.
 EntityType getEntityType()
          Get the entity type of this entity.
 Set getParents(EntityType entityType, boolean recursive)
          Gets a Set of all parents of this user group.
 Object getProperty(String propertyID)
          Gets the value of a particular property for this user group.
 String getUID()
          Gets the unique identifier for this user group.
 String getUIDType()
          Gets the user group UID type.
 boolean hasChild(ChildEntity childEntity, boolean recursive)
          Determines if this user group has a particular child entity as a child.
 int hashCode()
           
 boolean hasParent(ParentEntity parentEntity, boolean recursive)
          Determines if this user group has a particular parent entity as a parent.
 boolean isSystemPrincipal()
          Determines whether this user group is internal (not visible outside the system).
 void removeChild(ChildEntity entityToRemove)
          Removes the supplied child entity as a child of this user group.
 void removeParent(ParentEntity entityToRemove)
          Removes the specified parent entity as a parent of this user group.
 void save()
          Saves the user group to the persistence store.
 void setProperty(String propertyID, Object value)
          Sets the value of a particular property for this user group.
 
Methods inherited from class com.epicentric.entity.implementations.generic.EntityWrapper
getPropertyDescriptor, getPropertyIDs, getPropertyIDs, propertyDescriptorIterator, propertyDescriptorIterator
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.epicentric.authorization.Permissionable
getAuthorizationSpace, hasEndUserPermissions
 
Methods inherited from interface com.epicentric.authorization.Permissionable
getAuthorizationSpace, hasEndUserPermissions
 
Methods inherited from interface com.epicentric.authorization.Principal
getAllChildPrincipals, getAllParentPrincipals, getChildPrincipals, getParentPrincipals
 

Field Detail

TITLE_PROPERTY_ID

public static final String TITLE_PROPERTY_ID
ID for the 'title' user group property. The value of this property is the name of the user group. This property is required by Vignette Portal.
Method Detail

getUID

public String getUID()
Gets the unique identifier for this user group.
Specified by:
getUID in interface Entity
Overrides:
getUID in class com.epicentric.entity.implementations.generic.EntityWrapper
Returns:
Unique ID for this user group

getProperty

public Object getProperty(String propertyID)
Gets the value of a particular property for this user group. Note that the value returned may be null. The property IDs are specified in the entity management configuration file (config/entity_management.xml by default).
Specified by:
getProperty in interface Entity
Overrides:
getProperty in class com.epicentric.entity.implementations.generic.EntityWrapper
Parameters:
propertyID - ID of the property for which to return a value
Returns:
Value of the requested property

setProperty

public void setProperty(String propertyID,
                        Object value)
                 throws UniquePropertyValueConflictException,
                        EntityPersistenceException
Sets the value of a particular property for this user group. The property IDs are specified in the entity management configuration file (config/entity_management.xml by default).
Specified by:
setProperty in interface Entity
Overrides:
setProperty in class com.epicentric.entity.implementations.generic.EntityWrapper
Parameters:
propertyID - ID of the property for which to set the new value
value - Value to be set for propertyID. The data type of the object specified should match the data type of the property being set.

save

public void save()
          throws EntityPersistenceException
Saves the user group to the persistence store.
Specified by:
save in interface Entity
Overrides:
save in class com.epicentric.entity.implementations.generic.EntityWrapper

delete

public void delete()
            throws EntityPersistenceException,
                   EntityTypeNotDeletableException
Deletes the user group from the persistence store.
Specified by:
delete in interface Entity
Overrides:
delete in class com.epicentric.entity.implementations.generic.EntityWrapper

getParents

public Set getParents(EntityType entityType,
                      boolean recursive)
               throws EntityPersistenceException
Gets a Set of all parents of this user group.
Specified by:
getParents in interface ChildEntity
Overrides:
getParents in class com.epicentric.entity.implementations.generic.ParentAndChildEntityWrapper
Parameters:
entityType - Type of parents to return
recursive - If "true", this method recursively returns all parents. If "false", this method returns only immediate parents.
Returns:
Immutable Set of parents. The Set will be empty if no parents of entityType exist.

hasParent

public boolean hasParent(ParentEntity parentEntity,
                         boolean recursive)
                  throws EntityPersistenceException
Determines if this user group has a particular parent entity as a parent.
Specified by:
hasParent in interface ChildEntity
Overrides:
hasParent in class com.epicentric.entity.implementations.generic.ParentAndChildEntityWrapper
Parameters:
parentEntity - Parent entity to test
recursive - If "true", all ancestors of this user group are searched for parentEntity. If "false", only the set of immediate parents is searched for parentEntity.
Returns:
true if this user group has the supplied parent entity as a parent; false otherwise

addParent

public void addParent(ParentEntity entityToAdd)
               throws EntityPersistenceException
Makes the supplied parent entity a parent of this user group.
Specified by:
addParent in interface ChildEntity
Overrides:
addParent in class com.epicentric.entity.implementations.generic.ParentAndChildEntityWrapper
Parameters:
entityToAdd - Parent entity to be added

canAddParent

public boolean canAddParent(ParentEntity parentEntity)
Determines if the supplied parent entity can be made a parent of this user group.
Specified by:
canAddParent in interface ChildEntity
Overrides:
canAddParent in class com.epicentric.entity.implementations.generic.ParentAndChildEntityWrapper
Returns:
true if the parent entity can be made a parent of this user; false otherwise.

removeParent

public void removeParent(ParentEntity entityToRemove)
                  throws EntityPersistenceException
Removes the specified parent entity as a parent of this user group.
Specified by:
removeParent in interface ChildEntity
Overrides:
removeParent in class com.epicentric.entity.implementations.generic.ParentAndChildEntityWrapper
Parameters:
entityToRemove - Parent entity to be removed

canRemoveParent

public boolean canRemoveParent(ParentEntity parentEntity)
Determines if the supplied parent entity can be removed as a parent of this user group.
Specified by:
canRemoveParent in interface ChildEntity
Overrides:
canRemoveParent in class com.epicentric.entity.implementations.generic.ParentAndChildEntityWrapper
Returns:
true if the supplied parent entity can be removed as a parent of this user group; false otherwise.

getChildren

public Set getChildren(EntityType entityType,
                       boolean recursive)
                throws EntityPersistenceException
Gets a Set of all children of this user group.
Specified by:
getChildren in interface ParentEntity
Overrides:
getChildren in class com.epicentric.entity.implementations.generic.ParentEntityWrapper
Parameters:
entityType - Type of children to return.
recursive - If "true", this method recursively returns all children. If "false", this method returns only immediate children.
Returns:
Immutable Set of children. The Set will be empty if no children of entityType exist.

hasChild

public boolean hasChild(ChildEntity childEntity,
                        boolean recursive)
                 throws EntityPersistenceException
Determines if this user group has a particular child entity as a child.
Specified by:
hasChild in interface ParentEntity
Overrides:
hasChild in class com.epicentric.entity.implementations.generic.ParentEntityWrapper
Parameters:
childEntity - Child entity to test
recursive - If "true", all ancestors of this user group are searched for childEntity. If "false", only the set of immediate parents is searched for childEntity.
Returns:
true if this user group has childEntity as a child; false otherwise

addChild

public void addChild(ChildEntity entityToAdd)
              throws EntityPersistenceException
Makes the supplied child entity a child of this user group.
Specified by:
addChild in interface ParentEntity
Overrides:
addChild in class com.epicentric.entity.implementations.generic.ParentEntityWrapper
Parameters:
entityToAdd - Child entity to be added

canAddChild

public boolean canAddChild(ChildEntity childEntity)
Determines if the supplied child entity can be made a child of this user group.
Specified by:
canAddChild in interface ParentEntity
Overrides:
canAddChild in class com.epicentric.entity.implementations.generic.ParentEntityWrapper
Returns:
true if the child entity can be made a child of this user group; false otherwise.

removeChild

public void removeChild(ChildEntity entityToRemove)
                 throws EntityPersistenceException
Removes the supplied child entity as a child of this user group.
Specified by:
removeChild in interface ParentEntity
Overrides:
removeChild in class com.epicentric.entity.implementations.generic.ParentEntityWrapper
Parameters:
entityToRemove - Child entity to be removed

canRemoveChild

public boolean canRemoveChild(ChildEntity childEntity)
Determines if the supplied child entity can be removed as a child of this user group.
Specified by:
canRemoveChild in interface ParentEntity
Overrides:
canRemoveChild in class com.epicentric.entity.implementations.generic.ParentEntityWrapper
Returns:
true if the supplied child entity can be removed as a child of this user group; false otherwise.

isSystemPrincipal

public boolean isSystemPrincipal()
Determines whether this user group is internal (not visible outside the system).
Specified by:
isSystemPrincipal in interface com.epicentric.authorization.Principal
Following copied from interface: com.epicentric.authorization.Principal
Returns:
true if this principal is not visible outside the system, false otherwise

equals

public boolean equals(Object obj)
Overrides:
equals in class com.epicentric.entity.implementations.generic.EntityWrapper

hashCode

public int hashCode()
Overrides:
hashCode in class com.epicentric.entity.implementations.generic.EntityWrapper

getEntityType

public EntityType getEntityType()
Description copied from interface: Entity
Get the entity type of this entity.
Specified by:
getEntityType in interface Entity
Overrides:
getEntityType in class com.epicentric.entity.implementations.generic.EntityWrapper
Following copied from interface: com.epicentric.entity.Entity
Returns:
The entity type of this entity.

getUIDType

public String getUIDType()
Gets the user group UID type.
Specified by:
getUIDType in interface Entity
Overrides:
getUIDType in class com.epicentric.entity.implementations.generic.EntityWrapper
Returns:
UIDType of this user group.

02/28/2005
 

Copyright and Trademark Notices