|
Oracle Collaboration Suite Discussions Web Services Java API Reference 10g (10.1.2.2) Part No. B28210-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Webservice interface representing the operations related to Oracle Discussions Topic. A topic is a root level message in a forum.It is a stem from which all other messages originate. The interface provides operations for ul>
It also provides bulk operations to create/delete multiple topics in one invocation.
Axis specific Sample code illustrating the invocation/usage of TopicService.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. TopicServiceServiceLocator mdssl = new TopicServiceServiceLocator(); //Retrieve a reference to the remote webservices interface. TopicService mdsl = mdssl.getTopicService(); //Notify the axis server that client is interested in maintaining session. ((TopicServiceSoapBindingStub)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.create(1045,cDefn); if(message != null) { //Process the message bean, representing the first message of the topic created. ........ }
MessageService
Method Summary | |
ForumMessage |
create(long lForumId, MessageDefinition mDefn) Creates a topic from the specified message definition bean. |
ForumMessage |
createTopicFromByte(long lForumId, byte[] msg) Creates a topic from the specified byte array. |
CreateTopicBulkResponse[] |
createTopics(long lForumId, MessageDefinition[] mDefn) Creates topics from the specified message definition bean array. |
Forum |
delete(long lForumId, int iTopicId) Deletes the topic specified by iTopicId, in the forum, specified by lForumId. |
DeleteElementBulkResponse[] |
deleteTopics(long lForumId, int[] iTopicIds) Deletes the topics specified by iTopicId array, from the forum, specified by lForumId. |
Topic |
edit(long lForumId, int iTopicId, java.lang.String subject, java.lang.String body) Edits the topic subject and content with those supplied. |
Topic |
editTopicWithByte(long lForumId, int iTopicId, byte[] topic) Edits the topic with the byte array supplied. |
Topic |
getTopic(long lForumId, int iTopicId) Returns the topic specified by iTopicId, in the forum lForumId. |
byte[] |
getTopicInByte(long lForumId, int iTopicId) Returns a MIME compatible byte array representing the topic retrieved. |
ForumMessage[] |
listMessages(long lForumId, int iTopicId, boolean bSortByPostDate) Lists the messages in the topic specified by iTopicId. |
Topic |
lock(long lForumId, int iTopicId) Locks the topic, specified by iTopicId, in forum specified by lForumId. |
Topic |
unlock(long lForumId, int iTopicId) Unlocks the topic, specified by iTopicId, in forum specified by lForumId. |
Method Detail |
public Topic lock(long lForumId, int iTopicId) throws TdWSException
Once a topic is locked, it cannnot be edited/replied-to normally. A topic can be locked by users with forum moderator and higher role. Topic creators also can lock the topic, that they created.
Only users with forum moderator or higher role can edit/reply-to that topic.
lForumId
- - Id representing a forum, in which the topic to be locked is present.iTopicId
- - Id representing topic to be locked.TdWSException
- - Thrown on
public Forum delete(long lForumId, int iTopicId) throws TdWSException
All the messages of the topic, are also deleted along with the topic. Once a topic is deleted, it cannot be recovered again.
lForumId
- - Id representing the forum, in which the topic is present.iTopicId
- - Id representing the topic, to be deleted.TdWSException
- - Thrown on
public ForumMessage create(long lForumId, MessageDefinition mDefn) throws TdWSException
A topic should have either a subject or a body. The topic posted will be of text/plain content type.
lForumId should represent a forum into which the topic should be posted.
lForumId
- - Id representing forum, in which the topic is to be created.TdWSException
- - Thrown on
createTopicFromByte
public Topic unlock(long lForumId, int iTopicId) throws TdWSException
Once a topic is unlocked, it can be edited/replied-to normally. Only users with forum moderator or higher role can unlock a topic. A topic creator cna unlock his own topic.
lForumId
- - Id representing a forum, in which the topic to be unlocked is present.iTopicId
- - Id representing topic to be unlocked.TdWSException
- - Thrown on
public Topic getTopic(long lForumId, int iTopicId) throws TdWSException
iTopicId
- - Id representing the topic to be returned.TdWSException
- - Thrown on
public ForumMessage[] listMessages(long lForumId, int iTopicId, boolean bSortByPostDate) throws TdWSException
The listed messages can be sorted on their posted date by setting the boolean value bSortByPostDate to true.
iFetchStart indidates the start index from which the topics are returned. lForumId should represent the parent forum of the topic, from which the messages are being listed.
lForumId
- - Id representing the forum, in which the messages are present.iTopicId
- - Id representing the topic, in which the messages are present.bSortByPostDate
- - boolean valud representing if the returned messages are to be sorted by their posted date.TdWSException
- - Thrown on
public ForumMessage createTopicFromByte(long lForumId, byte[] msg) throws TdWSException
The byte[] array should be MIME compatible. Useful in creating topics with attachments. The entire message, along with all the headers and attachments is converted into a byte[]. The same byte[] can be used in creating topic.
lForumId
- - Id representing a forum, in which topic is to be created.msg
- - bytes representing the topic to be created.TdWSException
- - Thrown on
public Topic edit(long lForumId, int iTopicId, java.lang.String subject, java.lang.String body) throws TdWSException
A topic should have either a subject or a body. The topic posted will be of text/plain content type.
lForumId should represent a forum into which the topic should be posted. The old values of the topic subject and conent will be overwritten with the values supplied.
lForumId
- - Id representing the forum in which the topic is present.iTopicId
- - Id representing the topic to be edited.subject
- - Subject to be applied to the topic.body
- - Content to be applied to the topic.TdWSException
- - Thrown on
public Topic editTopicWithByte(long lForumId, int iTopicId, byte[] topic) throws TdWSException
The byte[] array should be MIME compatible.
The entire topic is replaced with the content of the byte array.A new mime message object is constructed and it overwrites the entire old topic.
lForumId
- - Id representing the forum in which the topic is present.iTopicId
- - Id representing the topic to be edited.topic
- - byte[] representing the new topic.TdWSException
- - Thrown on
public byte[] getTopicInByte(long lForumId, int iTopicId) throws TdWSException
iTopicId
- - Id representing the topic to be returned.TdWSException
- - Thrown on
public CreateTopicBulkResponse[] createTopics(long lForumId, MessageDefinition[] mDefn) throws TdWSException
lForum should represent the parent forum, in which the topics are being created. 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
lForumId
- - Id representing forum, in which the topics are to be created.TdWSException
- - Thrown on
create
public DeleteElementBulkResponse[] deleteTopics(long lForumId, int[] iTopicIds) throws TdWSException
All the messages of the topic, are also deleted along with the topic. Once a topic is deleted, it cannot be recovered again.
Only topic creator and users with forum moderator and higher role, can delete a topic.
Returns an array of bulk response beans if there is any error in deleting any of the topics. Each of the beans will have information about the element failed, the error message and the error stacktrace. Nothing is returned if the deletion of all the topics is successful.
lForumId
- - Id representing the forum, in which the topic is present.iTopicIds
- -Array of topic ids representing topics, to be deleted.TdWSException
- - Thrown on
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |