Oracle Collaboration Suite Discussions Web Services Java API Reference
10g (10.1.2.2)

Part No. B28210-01


oracle.discussions.ws
Interface MessageService


public interface MessageService

Webservice interface representing the operations related to Oracle Discussions Message.

Messages are either new posts into a board (and therefore topics) or replies to other messages. Messages may contain attachments. In general, the first message of a thread is also referred to as the thread itself, while all its replies are just simply referred as messages.
The interface provides operations for

It also provides bulk operations to hide/show multiple messages in one invocation.
Axis specific Sample code illustrating the invocation/usage of MessageService.Relevant changes are to be done, if a non-axis web services client is used.

 //Initialize the webservice locator.The locator contains information about webservices endpoint. 
 MessageServiceServiceLocator mdssl = new MessageServiceServiceLocator();
 //Retrieve a reference to the remote webservices interface.
 MessageService mdsl = mdssl.getMessageService();
 //Notify the axis server that client is interested in maintaining session.
 ((MessageServiceSoapBindingStub)mdsl).setMaintainSession(true);
 //Set the cookie, retrieved during login service invocation.
 ((javax.xml.rpc.Stub)mdsl)._setProperty(HTTPConstants.HEADER_COOKIE,cookie);
 //Prepare the input parameters
 MessageDefinition cDefn = new MessageDefinition();
 cDefn.setSubject("First category");
 cDefn.setBody("First Category");
 //Invoke the webservices method.
 ForumMessage message = mdsl.reply(1045,1000,1000,cDefn);//forumid, topic id, msg id, msgDefn
 if(message != null)
 {
 //Process the message bean, representing reply created.
 ........
 }
 

Method Summary
 Topic clipMessage(long lForumId, int iTopicId, int iMsgId)
          Promotes the message and all its replies into a new topic in the forum.
 ForumMessage createMessageFromByte(long lForumId, int iTopicId, int iMsgId, byte[] bytes)
          Replies to the message specified by iMsgId.
 Topic deleteMessage(long lForumId, int iTopicId, int iMsgId)
          The message and all its replies are physically removed from the system.
 ForumMessage editMessage(long lForumId, int iTopicId, int iMsgId, java.lang.String subject, java.lang.String content)
          Edits the message subject and content with those supplied.
 ForumMessage editMessageWithByte(long lForumId, int iTopicId, int iMsgId, byte[] bytes)
          Edits the topic with the byte array supplied.
 ForumMessage getMessage(long lForumId, int iTopicId, int iMsgId)
          Returns a forum message bean representing the Discussions message, depicted by iMsgId.
 byte[] getMessageInByte(long lForumId, int iTopicId, int iMsgId)
          Returns a MIME compatible byte array representing the message retrieved.
 ForumMessage hideMessage(long lForumId, int iTopicId, int iMsgId)
          Marks the message specified by iMsgId, for deletion.
 MessagesBulkResponse[] hideMessages(long lForumId, int iTopicId, int[] iMsgIds)
          Marks the messages specified by iMsgIds, for deletion.
 ForumMessage reply(long lForumId, int iTopicId, int iMsgId, MessageDefinition mDefn)
          Replies to the message specified by iMsgId.
 ForumMessage showMessage(long lForumId, int iTopicId, int iMsgId)
          A previously deleted single message is cleared from its deleted flag.
 MessagesBulkResponse[] showMessages(long lForumId, int iTopicId, int[] iMsgIds)
          Messages depicted by supplied iMsgIds are cleared from thrir deleted flags.

 

Method Detail

deleteMessage

public Topic deleteMessage(long lForumId,
                           int iTopicId,
                           int iMsgId)
                    throws TdWSException
The message and all its replies are physically removed from the system. Forum writers can delete the messages posted by them only. Users with forum moderator or higher role, can delete any message is a forum.
The Board Delete Policy controls who can perform which of the above operations. The default delete policy for a Threaded Discussions installation is defined as part of the Global Settings. Board Moderators can override the default policy as part of the Board settings.
There are three possible policies: These policies are not applicable to the users with role of forum moderator or higher.
Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message to be deleted.
Returns:
Topic - Parent topic of the message deleted.
Throws:
TdWSException - - Thrown on
  • any exception in deleting the message
  • if the user doesnot have permissions to delete the message
  • if any of the lForumId, iTopicId or iMsgId is invalid
  • if the user doesnot have access to the forum
  • if the lForumId doesnot represent the parent forum of the messsage

clipMessage

public Topic clipMessage(long lForumId,
                         int iTopicId,
                         int iMsgId)
                  throws TdWSException
Promotes the message and all its replies into a new topic in the forum.

Forum moderators may promote a message in the topic to a new topic whose topic is the message subject. This functionality is useful in controlling sub-threads within a thread as well as the overall length of a thread. Furthermore, BoardModerators may wish to promote a message into a new topic when the replies to a thread are determined to be unrelated to the original topic. There will be a visual indication that the newly created topic is the result of a Promotion operation.

Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message to be clipped.
Returns:
ForumMessage - Bean depicting the clipped message.
Throws:
TdWSException - - Thrown on
  • any exception in clipping the message
  • if the user doesnot have permissions to clip the message
  • if any of the lForumId, iTopicId or iMsgId is invalid
  • if the user doesnot have access to the forum
  • if the lForumId doesnot represent the parent forum of the messsage

hideMessage

public ForumMessage hideMessage(long lForumId,
                                int iTopicId,
                                int iMsgId)
                         throws TdWSException
Marks the message specified by iMsgId, for deletion.

When a message is deleted, Oracle Threaded Discussions will mark the message as deleted. In its depiction, the deleted message will have a visual indication that it has been deleted as well as who deleted it and when.
If the deleted message had any replies, those replies will not be marked as deleted.
Users with role forum moderator and higher,can see the body of the message. For others, For others, the message body will not be visible, instead a text "Message Hidden" will be visible.
Only users, with role forum moderator or higher can post to a hidden message.
The Board Delete Policy controls who can perform which of the above operations. The default delete policy for a Threaded Discussions installation is defined as part of the Global Settings. Board Moderators can override the default policy as part of the Board settings.
There are three possible policies:

These policies are not applicable to the users with role of forum moderator or higher.
Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message to be hidden.
Returns:
ForumMessage - Bean depicting the hidden message.
Throws:
TdWSException - - Thrown on
  • any exception in hiding the message
  • if the user doesnot have permissions to hide the message
  • if any of the lForumId, iTopicId or iMsgId is invalid
  • if the user doesnot have access to the forum
  • if the message is already hidden
  • if the lForumId doesnot represent the parent forum of the messsage

showMessage

public ForumMessage showMessage(long lForumId,
                                int iTopicId,
                                int iMsgId)
                         throws TdWSException
A previously deleted single message is cleared from its deleted flag.

Once the message is un-hidden, users can post to it normally and the message body is made visible. The Board Delete Policy controls who can perform which of the above operations. The default delete policy for a Threaded Discussions installation is defined as part of the Global Settings. Board Moderators can override the default policy as part of the Board settings.
There are three possible policies:

These policies are not applicable to the users with role of forum moderator or higher.
Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message to be un-hidden.
Returns:
ForumMessage - Bean depicting the un-hidden message.
Throws:
TdWSException - - Thrown on
  • any exception in unhiding the message
  • if the user doesnot have permissions to unhide the message
  • if any of the lForumId, iTopicId or iMsgId is invalid
  • if the user doesnot have access to the forum
  • if the message is already un-hidden
  • if the lForumId doesnot represent the parent forum of the messsage

getMessage

public ForumMessage getMessage(long lForumId,
                               int iTopicId,
                               int iMsgId)
                        throws TdWSException
Returns a forum message bean representing the Discussions message, depicted by iMsgId.

lorumId, iTopicId should represent the parent forum and parent topic of the message respectively.

Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message to be retrieved.
Returns:
ForumMessage - Bean depicting the retrieved message.
Throws:
TdWSException - - Thrown on
  • any exception in retrieving the message
  • if any of the lForumId, iTopicId or iMsgId is invalid
  • if the user doesnot have access to the forum
  • if the lForumId doesnot represent the parent forum of the messsage

reply

public ForumMessage reply(long lForumId,
                          int iTopicId,
                          int iMsgId,
                          MessageDefinition mDefn)
                   throws TdWSException
Replies to the message specified by iMsgId.

The reply posted will be a child message of the message specified. Only users with forum writer or higher role can post a reply, unless the forum is public, with anonymous posting setting enabled.

Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message to be retrieved.
mDefn - - Bean representing the message properties.
Returns:
ForumMessage - Bean representing the new message created.
Throws:
TdWSException - - Thrown on
  • any exception in posting the reply
  • if any of the lForumId, iTopicId or iMsgId is invalid
  • if user doesnot have permissions to post the message
  • if the user doesnot have access to the forum
  • if the lForumId doesnot represent the parent forum of the messsage

getMessageInByte

public byte[] getMessageInByte(long lForumId,
                               int iTopicId,
                               int iMsgId)
                        throws TdWSException
Returns a MIME compatible byte array representing the message retrieved. The byte array retrieved can be posted as a new message in any Discussions forum, basing its message posting on java mail semantics.
Parameters:
iTopicId - - Id representing the parent topic of the message, being returned.
iMsgId - - Id representing the message, being retrieved.
Returns:
byte[] - byte array representing the message retrieved.
Throws:
TdWSException - - Thrown on
  • any exception in retrieving the messge
  • if the user doesnot have access to forum specified by lForumId
  • if any of the lForumId,iTopicId,iMsgId doesnot represent a valid Discussions element.
  • if lForumId doesnot represent the parent forum of the message.

createMessageFromByte

public ForumMessage createMessageFromByte(long lForumId,
                                          int iTopicId,
                                          int iMsgId,
                                          byte[] bytes)
                                   throws TdWSException
Replies to the message specified by iMsgId.

The reply posted will be a child message of the message specified.
The byte[] array should be MIME compatible. Useful in creating messages with attachments. The entire message, along with all the headers and attachments is converted into a byte array. The same byte array can be used in creating message.
Only users with forum writer or higher role can post a reply, unless the forum is public, with anonymous posting setting enabled.

Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message to be retrieved.
Returns:
ForumMessage - Bean representing the new message created.
Throws:
TdWSException - - Thrown on
  • any exception in posting the reply
  • if any of the lForumId, iTopicId or iMsgId is invalid
  • if user doesnot have permissions to post the message
  • if the user doesnot have access to the forum
  • if the lForumId doesnot represent the parent forum of the messsage

editMessageWithByte

public ForumMessage editMessageWithByte(long lForumId,
                                        int iTopicId,
                                        int iMsgId,
                                        byte[] bytes)
                                 throws TdWSException
Edits the topic with the byte array supplied.

The byte array should be MIME compatible.
The entire message is replaced with the content of the byte array.A new mime message object is constructed and it overwrites the entire old message.

Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message being edited.
Throws:
TdWSException - - Thrown on
  • any exception in editing the message
  • if the user doesnot have access to forum specified by lForumId
  • if any of lForumId,iTopicId, iMsgId doesnot represent a valid Discussions element.
  • if lForumId,iTopicId doesnot represent the parent forum and topic of the message respectively.
  • if topic byte array is null or invalid
  • if the user doesnot have permission to edit the message in the forum
See Also:
editMessage

editMessage

public ForumMessage editMessage(long lForumId,
                                int iTopicId,
                                int iMsgId,
                                java.lang.String subject,
                                java.lang.String content)
                         throws TdWSException
Edits the message subject and content with those supplied.

A message should have either a subject or a body. The topic posted will be of text/plain content type.
lForumId,iTopicId should represent the parent forum and topic of the message respectively. The old values of the message subject and content will be overwritten with the values supplied.

Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
iMsgId - - Id representing the message, to be edited.
subject - - Subject to be applied to the message.
Throws:
TdWSException - - Thrown on
  • any exception in editing the message
  • if the user doesnot have access to forum specified by lForumId
  • if any of the lForumId,iTopicId, iMsgId doesnot represent a valid Discussions element.
  • if lForumId doesnot represent the parent forum of the message.
  • if message subject and body are null

showMessages

public MessagesBulkResponse[] showMessages(long lForumId,
                                           int iTopicId,
                                           int[] iMsgIds)
                                    throws TdWSException
Messages depicted by supplied iMsgIds are cleared from thrir deleted flags.

Once a message is un-hidden, users can post to it normally and the message body is made visible. The Board Delete Policy controls who can perform which of the above operations. The default delete policy for a Threaded Discussions installation is defined as part of the Global Settings. Board Moderators can override the default policy as part of the Board settings.
There are three possible policies:

These policies are not applicable to the users with role of forum moderator or higher.An array of beans representing the result of the bulk operation is returned to the user.
Each of the beans in the array wraps around
Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
Returns:
MessagesBulkResponse[] - An array of bulk response beans.
Throws:
TdWSException - - Thrown on
  • any fatal exception in unhiding the messages. If there is an exception the exception details are returned in a bulk response bean. But if the exception is fatal enough to prevent further processsing, it is not handled and is reported to the user.
  • if the user doesnot have access to the forum specified by lForumId
  • if the user doesnot have permissions to the unhide the message
  • if any of the lForumId,iTopicId,iMsgIds doesnot represent a valid Discussions element
  • if lForumId doesnot represent the parent forum of the messages
  • if iMsgIds is null

hideMessages

public MessagesBulkResponse[] hideMessages(long lForumId,
                                           int iTopicId,
                                           int[] iMsgIds)
                                    throws TdWSException
Marks the messages specified by iMsgIds, for deletion.

When a message is deleted, Oracle Threaded Discussions will mark the message as deleted. In its depiction, the deleted message will have a visual indication that it has been deleted as well as who deleted it and when.
If the deleted message had any replies, those replies will not be marked as deleted.
Users with role forum moderator and higher,can see the body of the message. For others, For others, the message body will not be visible, instead a text "Message Hidden" will be visible.
Only users, with role forum moderator or higher can post to a hidden message.
The Board Delete Policy controls who can perform which of the above operations. The default delete policy for a Threaded Discussions installation is defined as part of the Global Settings. Board Moderators can override the default policy as part of the Board settings.
There are three possible policies:

These policies are not applicable to the users with role of forum moderator or higher.
Returns an array of bulk response beans if there is any error in hiding any of the messages. Each of the beans will have information about the element failed, the error message and the error stacktrace. Nothing is returned if all messages are hidden successfully.
Parameters:
lForumId - - Id representing the parent forum of the message.
iTopicId - - Id representing the parent topic of the message.
Returns:
MessagesBulkResponse[] - An array of bulk response beans.
Throws:
TdWSException - - Thrown on
  • any exception in hiding the messages. Normally, the exception is handled and is returned in the bulk response, but if the exception is fatal enough to stop further processing, it is not handled and is reported to the user.
  • if the user doesnot have access to the forum specified by lForumId
  • if any of the lForumId,iTopicId,iMsgIds doesnot represent a valid Discussions element
  • if lForumId doesnot represent the parent forum of the messages
  • if iMsgIds is null

Copyright © 2005, Oracle. All rights reserved.