edu.northwestern.at.wordhoard.model.userdata
Class UserGroupPermission

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.userdata.UserGroupPermission
All Implemented Interfaces:
PersistentObject, UserDataObject, java.io.Externalizable, java.io.Serializable

public class UserGroupPermission
extends java.lang.Object
implements PersistentObject, java.io.Externalizable, UserDataObject

A permission on an object for a UserGroup.

See Also:
Serialized Form

Field Summary
protected  AuthoredTextAnnotation authoredTextAnnotation
          The object being controlled.
protected  java.util.Date creationTime
          Original creation date/time.
protected  java.lang.String description
          Description of the group.
protected  java.lang.Long id
          Unique persistence id (primary key).
protected  boolean isActive
          True if permission is active (available for use).
protected  boolean isPublic
          True if public (can be seen by other users), false if private word set.
protected  java.util.Date modificationTime
          Last modification date/time.
protected  java.lang.String owner
          These items should be refactored out of UserObject at some point.
protected  java.lang.String permission
          permission string.
protected  java.lang.String query
          The query - part of UserData interface which should probably be factored out
(package private) static long serialVersionUID
           
protected  java.lang.String title
          The title of the permission.
protected  UserGroup userGroup
          Group given permission on the object.
protected  java.lang.String webPageURL
          Web page URL.
 
Constructor Summary
UserGroupPermission()
           
UserGroupPermission(AuthoredTextAnnotation authoredTextAnnotation, UserGroup userGroup, java.lang.String permission, java.lang.String owner)
           
 
Method Summary
 boolean addToDOMDocument(org.w3c.dom.Document document)
          Add word set to DOM document.
 boolean equals(java.lang.Object obj)
          Returns true if some other object is equal to this one.
 AuthoredTextAnnotation getAuthoredTextAnnotation()
          Get the conrolled item.
 java.util.Date getCreationTime()
          Gets the creation date.
 java.lang.String getDescription()
          Gets the description.
 java.lang.Long getId()
          Gets the unique id.
 boolean getIsActive()
          Get the active flag.
 boolean getIsPublic()
          Get the public flag.
 java.util.Date getModificationTime()
          Gets the modification date.
 java.lang.String getOwner()
          Get the owner.
 java.lang.String getPermission()
          Get the permission.
 java.lang.String getQuery()
          Get the query.
 java.lang.String getTitle()
          Gets the title.
 UserGroup getUserGroup()
          Get the group.
 java.lang.String getWebPageURL()
          Gets the web page URL.
 int hashCode()
          Returns a hash code for the object.
 void readExternal(java.io.ObjectInput in)
          Reads the permission from an object input stream (deserializes the object).
 void setAuthoredTextAnnotation(AuthoredTextAnnotation authoredTextAnnotation)
          set the authoredTextAnnotation.
 void setCreationTime(java.util.Date creationTime)
          Sets the creation time.
 void setDescription(java.lang.String description)
          Sets the description.
 boolean setFromDOMDocumentNode(org.w3c.dom.Node wordSetNode)
          Set values from DOM document node.
 void setIsActive(boolean isActive)
          Set the active flag.
 void setIsPublic(boolean isPublic)
          Set the public flag.
 void setModificationTime(java.util.Date modificationTime)
          Sets the modification time.
 void setOwner(java.lang.String owner)
          Set the owner.
 void setPermission(java.lang.String permission)
          set the permission.
 void setQuery(java.lang.String query)
          Set the query.
 void setTitle(java.lang.String title)
          Sets the title.
 void setUserGroup(UserGroup userGroup)
          set the group.
 void setWebPageURL(java.lang.String webPageURL)
          Sets the web page URL.
 java.lang.String toString()
          Gets a string representation of the word set.
 void writeExternal(java.io.ObjectOutput out)
          Writes the permission to an object output stream (serializes the object).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

id

protected java.lang.Long id
Unique persistence id (primary key).


title

protected java.lang.String title
The title of the permission.


description

protected java.lang.String description
Description of the group.


webPageURL

protected java.lang.String webPageURL
Web page URL.


creationTime

protected java.util.Date creationTime
Original creation date/time.


modificationTime

protected java.util.Date modificationTime
Last modification date/time.


userGroup

protected UserGroup userGroup
Group given permission on the object.


authoredTextAnnotation

protected AuthoredTextAnnotation authoredTextAnnotation
The object being controlled.


permission

protected java.lang.String permission
permission string.


owner

protected java.lang.String owner
These items should be refactored out of UserObject at some point. They don't really belong in this class Owner of this permission.


isPublic

protected boolean isPublic
True if public (can be seen by other users), false if private word set.


isActive

protected boolean isActive
True if permission is active (available for use).


query

protected java.lang.String query
The query - part of UserData interface which should probably be factored out

Constructor Detail

UserGroupPermission

public UserGroupPermission()

UserGroupPermission

public UserGroupPermission(AuthoredTextAnnotation authoredTextAnnotation,
                           UserGroup userGroup,
                           java.lang.String permission,
                           java.lang.String owner)
Method Detail

getId

public java.lang.Long getId()
Gets the unique id.

Specified by:
getId in interface PersistentObject
Specified by:
getId in interface UserDataObject
Returns:
The unique id.

getTitle

public java.lang.String getTitle()
Gets the title.

Specified by:
getTitle in interface UserDataObject
Returns:
The title.

getDescription

public java.lang.String getDescription()
Gets the description.

Specified by:
getDescription in interface UserDataObject
Returns:
The description.

getWebPageURL

public java.lang.String getWebPageURL()
Gets the web page URL.

Specified by:
getWebPageURL in interface UserDataObject
Returns:
The web page URL.

getCreationTime

public java.util.Date getCreationTime()
Gets the creation date.

Specified by:
getCreationTime in interface UserDataObject
Returns:
The creation date.

getModificationTime

public java.util.Date getModificationTime()
Gets the modification date.

Specified by:
getModificationTime in interface UserDataObject
Returns:
The modification date.

getOwner

public java.lang.String getOwner()
Get the owner.

Specified by:
getOwner in interface UserDataObject
Returns:
The owner.

getIsPublic

public boolean getIsPublic()
Get the public flag.

Specified by:
getIsPublic in interface UserDataObject
Returns:
True if the word set is public, false if private.

getIsActive

public boolean getIsActive()
Get the active flag.

Specified by:
getIsActive in interface UserDataObject
Returns:
True if the word set is active.

getQuery

public java.lang.String getQuery()
Get the query.

Specified by:
getQuery in interface UserDataObject
Returns:
The query for generating this word set.

setTitle

public void setTitle(java.lang.String title)
Sets the title.

Specified by:
setTitle in interface UserDataObject
Parameters:
title - The title.

setDescription

public void setDescription(java.lang.String description)
Sets the description.

Specified by:
setDescription in interface UserDataObject
Parameters:
description - The description.

setWebPageURL

public void setWebPageURL(java.lang.String webPageURL)
Sets the web page URL.

Specified by:
setWebPageURL in interface UserDataObject
Parameters:
webPageURL - The web page URL.

setCreationTime

public void setCreationTime(java.util.Date creationTime)
Sets the creation time.

Specified by:
setCreationTime in interface UserDataObject
Parameters:
creationTime - The creation time.

setModificationTime

public void setModificationTime(java.util.Date modificationTime)
Sets the modification time.

Specified by:
setModificationTime in interface UserDataObject
Parameters:
modificationTime - The modification time.

setOwner

public void setOwner(java.lang.String owner)
Set the owner.

Parameters:
owner - The owner.

setIsPublic

public void setIsPublic(boolean isPublic)
Set the public flag.

Parameters:
isPublic - True if the word set is public, false if private.

setIsActive

public void setIsActive(boolean isActive)
Set the active flag.

Parameters:
isActive - True if the word set is active.

setQuery

public void setQuery(java.lang.String query)
Set the query.

Parameters:
query - The query for generating this word set.

setFromDOMDocumentNode

public boolean setFromDOMDocumentNode(org.w3c.dom.Node wordSetNode)
Set values from DOM document node.

Specified by:
setFromDOMDocumentNode in interface UserDataObject
Parameters:
wordSetNode - DOM document node with word set settings.
Returns:
true if settings retrieved.

addToDOMDocument

public boolean addToDOMDocument(org.w3c.dom.Document document)
Add word set to DOM document.

Specified by:
addToDOMDocument in interface UserDataObject
Parameters:
document - DOM document to which to add word set. Must not be null. In most cases, this document should have a "wordhoard" node as the root element.
Returns:
true if DOM addition successful, false otherwise.

toString

public java.lang.String toString()
Gets a string representation of the word set.

Overrides:
toString in class java.lang.Object
Returns:
The title.

equals

public boolean equals(java.lang.Object obj)
Returns true if some other object is equal to this one.

The two objects are equal if their ids are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes the permission to an object output stream (serializes the object).

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - Object output stream.
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the permission from an object input stream (deserializes the object).

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - Object input stream.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getPermission

public java.lang.String getPermission()
Get the permission.

Returns:
The permission

setPermission

public void setPermission(java.lang.String permission)
set the permission.

Parameters:
permission - The permission.

getUserGroup

public UserGroup getUserGroup()
Get the group.

Returns:
The group extending permission to

setUserGroup

public void setUserGroup(UserGroup userGroup)
set the group.

Parameters:
userGroup - The group.

getAuthoredTextAnnotation

public AuthoredTextAnnotation getAuthoredTextAnnotation()
Get the conrolled item.

Returns:
The item being controlled

setAuthoredTextAnnotation

public void setAuthoredTextAnnotation(AuthoredTextAnnotation authoredTextAnnotation)
set the authoredTextAnnotation.

Parameters:
authoredTextAnnotation - The object being controlled.