Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

public interface IDiscussionMessage

`IDiscussionMessage` 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 that all discussion message modifications will not be stored permanently until `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 the discussion that this message belongs to.
`IProject` | `getContainingProject()` Returns the project that this object belongs to.
`java.util.Date` | `getCreatedDate()` Returns the creation date.
`java.lang.String` | `getDescription()` Returns the 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.
`java.lang.String` | `getSubject()` Returns the subject of the message.
`boolean` | `hasCreatedDate()` Returns `true` if created date is available, else `false`.
`boolean` | `hasLastModifiedDate()` Returns `true` if last modified date is available, else `false`.
`boolean` | `isApproved()` Returns if the message has been approved to display.
`void` | `setApproved(boolean isApproved)` Sets the approval of a message.
`void` | `setBody(java.lang.String body)` Sets the full message body.
`void` | `setDescription(java.lang.String description)` Sets the 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. It 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. Notice this is different from `IDiscussion.createDiscussionMessage`, where `store` needs to be call to persist the object. A reply can be created for both an approved and 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` - subject of the reply; cannot be `null`.
    `body` - body of the reply; cannot be `null`.
  Returns:
    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 is 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 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 already been removed.
    `java.rmi.RemoteException` - if there is a communication problem during the execution of the remote method call.

### getContainingProject

    public IProject getContainingProject()
                                  throws CollaborationException,
                                         java.rmi.RemoteException

  Returns the project that this object belongs to.

  Returns:
    the project that this object belongs to.
  Throws:
    `CollaborationException` - if the method call resulted in an error.
    `java.lang.IllegalStateException` - if the object already been removed.
    `java.rmi.RemoteException` - if there is 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 description.

  Returns:
    the description.
  Throws:
    `java.lang.IllegalStateException` - if the object 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.

### 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 created date is available, else `false`.

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

### hasLastModifiedDate

    public boolean hasLastModifiedDate()

  Returns `true` if last modified date is available, else `false`.

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

### isApproved

    public boolean isApproved()

  Returns if 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 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 description.

  Parameters:
    `description` - the message description; not the message body
  Throws:
    `java.lang.IllegalStateException` - if the object 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 exising 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 is a communication problem during the execution of the remote method call.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

For additional information on the IDK, including tutorials, blogs, code samples and more,see the AquaLogic User Interaction Developer Center on BEA dev2dev.

Copyright ©2007 BEA Systems, Inc. All Rights Reserved.