com.arsdigita.messaging
Class MessageThread

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.messaging.MessageThread

public class MessageThread
extends ACSObject

This class abstracts the concept of a Thread of messages. I.e. it frees you from needing to know implementation details of the ThreadedMessage class.

Since:
4.8.11
Version:
$Revision: #12 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Kevin Scaldeferri

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE, versionId
 
Constructor Summary
MessageThread(BigDecimal id)
           
MessageThread(DataObject data)
           
MessageThread(OID id)
           
MessageThread(ThreadedMessage rootMsg)
           
 
Method Summary
 void doWriteCheck()
          Allow writes if user has read on the parent (forum).
 Party getAuthor()
           
 String getAuthorName()
           
 ACSObject getContainer()
          Returns the container for this object, or null if there is no container.
static MessageThread getFromRootMessage(ThreadedMessage msg)
          retrieves the MessageThread object which has the specified ThreadedMessage as its root
 Date getLatestUpdateDate()
          Gets the Date of the most recent message added to this thread
 long getNumReplies()
          Gets the total number of messages in this thread
 ThreadedMessage getRootMessage()
          This method retrieves the root message, i.e.
 String getSubject()
           
protected  void initialize()
          Called from base class (DomainObject) constructors.
 String toString()
          Return the OID plus the flags N,M,D,U depending on whether the object is new, modified, deleted, or unknown.
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, getBaseDataObjectType, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values
Constructor Detail

MessageThread

public MessageThread(ThreadedMessage rootMsg)

MessageThread

public MessageThread(DataObject data)

MessageThread

public MessageThread(BigDecimal id)
              throws DataObjectNotFoundException

MessageThread

public MessageThread(OID id)
              throws DataObjectNotFoundException
Method Detail

initialize

protected void initialize()
Description copied from class: ACSObject
Called from base class (DomainObject) constructors.

Overrides:
initialize in class ACSObject

getRootMessage

public ThreadedMessage getRootMessage()
This method retrieves the root message, i.e. the message that is the start of the thread


getContainer

public ACSObject getContainer()
Description copied from class: ACSObject
Returns the container for this object, or null if there is no container. The container is produced by domain-specific logic based on any properties of the domain object. The resulting container is denormalized internally by ACSObject.save(). The denormalized container hierarchy is currently only used for generically determining what package instance an object belongs to. In the future, other generic services may be introduced that take advantage of the denormalized container hierarchy. While this method is not abstract, the default implementation "guesses" the container based on metadata about the object. If this object's data object type has a composite role property (required, visible property where com.arsdigita.persistence.metadata.Property.isComposite()==true), then we fetch the value of the composite role property, pass it to the DomainObjectFactory, and return the resulting domain object. If no composite role property is found, then the return value is null. Subclasses should provide their own implementations if the metadata driven default implementation is inadequate. For example, in a File Storage application, a "Folder" domain class could provide an implementationof getContainer() that returns the parent folder (if it exists) OR the package instance (if the folder is the root folder of one File Storage application instance).

Overrides:
getContainer in class ACSObject
Returns:
this object's container.

doWriteCheck

public void doWriteCheck()
Allow writes if user has read on the parent (forum).

Overrides:
doWriteCheck in class ACSObject

getNumReplies

public long getNumReplies()
Gets the total number of messages in this thread


getLatestUpdateDate

public Date getLatestUpdateDate()
Gets the Date of the most recent message added to this thread


getSubject

public String getSubject()

getAuthorName

public String getAuthorName()

getAuthor

public Party getAuthor()

getFromRootMessage

public static MessageThread getFromRootMessage(ThreadedMessage msg)
retrieves the MessageThread object which has the specified ThreadedMessage as its root


toString

public String toString()
Description copied from class: DomainObject
Return the OID plus the flags N,M,D,U depending on whether the object is new, modified, deleted, or unknown. Unknown is for objects that have been invalidated.

Overrides:
toString in class DomainObject


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC