AquaLogic User Interaction Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Creating Collaboration Discussion Messages Using IDK Remote APIs

To create Collaboration discussion messages and reply messages from a remote application, use the IDiscussion interface in the IDK.

Messages and replies are structured in a tree hierarchy. Each message and reply in the hierarchy is represented by an instance of IDiscussionMessage.
  • To create a new message thread in a discussion, use the IDiscussion.createMessage method to create a new IDiscussionMessage object.
  • To create a reply to a message, use the associated IDiscussionMessage.createDiscussionReplyMessage method. This creates a child message (reply) that is also represented by an instance of IDiscussionMessage. You can create a reply at any level in the hierarchy (the root message, the latest message, or a specific message in the thread).
These methods use the same syntax, and take in the subject and body for the message. You can also set the description and approval status when you create a message. To create a new discussion message, follow the steps below.
  1. Create a PRC session. For details, see Initiating a PRC Session to Use IDK Remote APIs.
  2. Retrieve the discussion ID and retrieve the discussion instance.
  3. Create a new discussion message as shown in the code samples below.
    Note: You must call store after creating a discussion message, or it will not be persisted.

Java

...

//create the discussion message
IDiscussionMessage discussionMessage = discussion.createDiscussionMessage(subject, body);

//call store before asking for the id.
discussionMessage.store();
int id = discussionMessage.getID();
String url = discussionMessage.getDetailsURL();

%>
<tr>
	<td>
	<%
	out.println("<a href=\"" + url + "\">Link to collab message " + id + "</a>");
	%>
	</td>
</tr>

...

.NET (C#)

...

//create the discussion message
Plumtree.Remote.PRC.Collaboration.Discussion.IDiscussionMessage discussionMessage = discussion.CreateDiscussionMessage(subject, body);

//call store before asking for the id.
discussionMessage.Store();
int id = discussionMessage.ID;
String url = discussionMessage.DetailsURL;

%>
<tr>
	<td colspan="6">
	<%
	Response.Write("<a href=\"" + url + "\">Link to collab message " + id + "</a>");
	%>
	</td>
</tr>
...

.NET (VB)

...

'create the discussion message
dim discussionMessage as Plumtree.Remote.PRC.Collaboration.Discussion.IDiscussionMessage = discussion.CreateDiscussionMessage(subject, body)

'call store before asking for the id.
discussionMessage.Store()
dim id as Integer = discussionMessage.ID
dim url as String = discussionMessage.DetailsURL

%>
<tr>
	<td colspan="6">
	<%
	Response.Write("<a href=""" & url & """>Link to collab message " & Cstr(id) & "</a>")
	%>
	</td>
</tr>
...

  Back to Top      Previous Next