com.plumtree.remote.prc.collaboration.discussion
Interface IDiscussionMessage


public interface IDiscussionMessage

Interface that represents a Collaboration discussion message object. This interface handles message modification and reply message creation.

A message is the smallest unit in a discussion contains zero or one parent and zero or more children. A child of a message is a reply.

To create a reply message to a topic, call createDiscussionReplyMessage method on the topic message. To create a reply to a reply message, call createDiscussionReplyMessage method on the parent reply message, which is also an IDiscussionMessage. This will create a tree-like structure of the messages with various levels of reply.

Note: Discussion message modifications will not be stored permanently until the store method is called.


Method Summary
 IDiscussionMessage createDiscussionReplyMessage(java.lang.String subject, java.lang.String body)
          Returns a discussion message that represents a reply.
 java.lang.String getBody()
          Returns the full message body.
 IDiscussion getContainingDiscussion()
          Returns IDiscussion object representing the discussion that this message belongs to.
 IProject getContainingProject()
          Returns an IProject object representing the project that this object belongs to.
 java.util.Date getCreatedDate()
          Returns the creation date.
 java.lang.String getDescription()
          Returns the message description.
 java.lang.String getDetailsURL()
          Returns the URL at which the discussion message details can be viewed.
 int getID()
          Returns the message ID.
 java.util.Date getLastModifiedDate()
          Returns the last modified date; the last modified date will also get updated whenever a new reply message is created.
 int getOwnerUserID()
          Returns the user ID of the owner of this object.
 int getParentID()
          Returns the parent ID, or -1 if there is no parent.
 java.lang.String getSubject()
          Returns the subject of the message.
 boolean hasCreatedDate()
          Returns true if the created date is available, else false.
 boolean hasLastModifiedDate()
          Returns true if the last modified date is available, else false.
 boolean isApproved()
          Returns whether or not the message has been approved to display.
 void setApproved(boolean isApproved)
          Sets the approval status of a message.
 void setBody(java.lang.String body)
          Sets the full message body.
 void setDescription(java.lang.String description)
          Sets the message description.
 void setSubject(java.lang.String subject)
          Sets the subject of the message.
 void store()
          Stores the discussion message.
 

Method Detail

createDiscussionReplyMessage

public IDiscussionMessage createDiscussionReplyMessage(java.lang.String subject,
                                                       java.lang.String body)
                                                throws CollaborationException,
                                                       java.rmi.RemoteException
Returns a discussion message that represents a reply. This method cannot be called before the parent message has been stored. The created reply message will become persistent after this call, and no store method is required afterwards. Note: This is different from IDiscussion.createDiscussionMessage, where store must be called to persist the object. A reply can be created for either an approved or unapproved message using this method.
 //Below sample code shows how to create a reply message.
 //createDiscussionReplyMessage() will create a persisted message, so
 //store() does not need to be called to persist the reply message properties unless additional properties are set.
 IDiscussionMessage reply = parentMessage.createDiscussionReplyMessage("Sample Reply Subject" , " Sample Reply Body");
 
 //set additional properties
 reply.setDescription("Optional description for reply message");
 reply.setApproved(true);
 
 //make sure store() is called or the changes will not be persisted.
 reply.store();
 

Parameters:
subject - {the subject of the reply; cannot be null
body - the body of the reply; cannot be null
Returns:
a discussion message that represents a reply. The returned discussion message has already been stored with the supplied subject and body
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed
CollaborationException - if the method call resulted in an error
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

getBody

public java.lang.String getBody()
Returns the full message body.

Returns:
the full message body
Throws:
java.lang.IllegalStateException - if the object has already been removed

getContainingDiscussion

public IDiscussion getContainingDiscussion()
                                    throws CollaborationException,
                                           java.rmi.RemoteException
Returns IDiscussion object representing the discussion that this message belongs to.

Returns:
the discussion that this message belongs to
Throws:
CollaborationException - if the method call resulted in an error
java.lang.IllegalStateException - if the object has already been removed
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

getContainingProject

public IProject getContainingProject()
                              throws CollaborationException,
                                     java.rmi.RemoteException
Returns an IProject object representing the project that this object belongs to.

Returns:
the project to which this object belongs
Throws:
CollaborationException - if the method call resulted in an error
java.lang.IllegalStateException - if the object has already been removed
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

getCreatedDate

public java.util.Date getCreatedDate()
Returns the creation date.

Returns:
the creation date
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getDescription

public java.lang.String getDescription()
Returns the message description.

Returns:
the message description
Throws:
java.lang.IllegalStateException - if the object has already been removed

getDetailsURL

public java.lang.String getDetailsURL()
Returns the URL at which the discussion message details can be viewed.

Note: This URL is gatewayed using the Collaboration server's primary portal.

Returns:
the discussion message details URL
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getID

public int getID()
Returns the message ID.

Returns:
the message ID
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getLastModifiedDate

public java.util.Date getLastModifiedDate()
Returns the last modified date; the last modified date will also get updated whenever a new reply message is created.

Returns:
the last modified date
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getOwnerUserID

public int getOwnerUserID()
Returns the user ID of the owner of this object. The owner of an object is the user who creates the object.

Returns:
the owner ID
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getParentID

public int getParentID()
Returns the parent ID, or -1 if there is no parent.

Returns:
the parent message ID
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed

getSubject

public java.lang.String getSubject()
Returns the subject of the message.

Returns:
the subject of the message
Throws:
java.lang.IllegalStateException - if the object has already been removed

hasCreatedDate

public boolean hasCreatedDate()
Returns true if the created date is available, else false.

Returns:
true if the created date is available, else false
Throws:
java.lang.IllegalStateException - if the object has already been removed

hasLastModifiedDate

public boolean hasLastModifiedDate()
Returns true if the last modified date is available, else false.

Returns:
true if the last modified date is available, else false
Throws:
java.lang.IllegalStateException - if the object has already been removed

isApproved

public boolean isApproved()
Returns whether or not the message has been approved to display.

Returns:
true if the message is approved, otherwise false
Throws:
java.lang.IllegalStateException - if the object has already been removed

setApproved

public void setApproved(boolean isApproved)
Sets the approval status of a message.

Parameters:
isApproved - true if the message is approved, otherwise false. Default value is true
Throws:
java.lang.IllegalStateException - if the object has already been removed

setBody

public void setBody(java.lang.String body)
Sets the full message body.

Parameters:
body - the full message body; cannot be null
Throws:
java.lang.IllegalStateException - if the object has already been removed

setDescription

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

Parameters:
description - the message description; not the message body
Throws:
java.lang.IllegalStateException - if the object has already been removed

setSubject

public void setSubject(java.lang.String subject)
Sets the subject of the message.

Parameters:
subject - the message subject
Throws:
java.lang.IllegalStateException - if the object has already been removed

store

public void store()
           throws CollaborationException,
                  java.rmi.RemoteException
Stores the discussion message. Can be used to persist a newly created discussion message, or edit an existing discussion message.

Throws:
CollaborationException - if the method call resulted in an error
java.lang.IllegalStateException - if the object has already been removed
java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call


For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Copyright ©2010 Oracle® Corporation. All Rights Reserved.