|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
IDiscussionManager is an interface for discussion-related
functionality. It handles discussion message creation, deletion and query.
| Method Summary | |
IDiscussion |
createDiscussion(IProject project,
java.lang.String name,
java.lang.String description)
Returns a new IDiscussion object in the given project. |
IDiscussionFilter |
createDiscussionFilter()
Returns a discussion filter object that shows all discussions. |
IDiscussionMessageFilter |
createDiscussionMessageFilter()
Returns a discussion message filter for narrowing query results. |
IDiscussion |
getDiscussion(int discussionID)
Returns a discussion by the given ID. |
IDiscussionMessage |
getDiscussionMessage(int messageID)
Returns a discussion message by its ID. |
int[] |
getSubscribedUserIDs(IDiscussion discussion)
Returns the ids of the users who are subscribed to the given discussion. |
IDiscussionMessage[] |
queryDiscussionMessages(IDiscussion discussion,
IDiscussionMessageFilter messageFilter)
Returns an array of IDiscussionMessage containing
zero or more discussion messages in a discussion, satisfying the given
discussion message filter. |
IDiscussionMessage[] |
queryDiscussionMessages(IProject project,
IDiscussionMessageFilter filter)
Returns an array of IDiscussionMessage containing
zero or more discussion messages in a given project,
satisfying the discussion message filter criteria. |
IDiscussion[] |
queryDiscussions(IProject project,
IDiscussionFilter discussionfilter)
Returns an array of IDiscussion that contains discussions
within the given project; the returned results will be sorted according
to the given IFilter. |
void |
removeDiscussion(IDiscussion discussion)
Removes the given discussion. |
void |
subscribeUsers(IDiscussion discussion,
int[] userIDs)
Subscribe users of the given ids to the given discussion and all discussion posts within that discussion. |
void |
unsubscribeUsers(IDiscussion discussion,
int[] userIDs)
Unsubscribe users of the given ids from a discussion, including all the posts within the discussion. |
| Method Detail |
public IDiscussion createDiscussion(IProject project,
java.lang.String name,
java.lang.String description)
IDiscussion object in the given project.
project - parent project; cannot be null.name - name of the discussion; cannot be null.description - description of the discussion; cannot be null.
CollaborationException - if the method call resulted in an error.public IDiscussionFilter createDiscussionFilter()
MaximumResult is unlimited,
DefaultSecurity is set to false.
No sortBy option or filter type is supported for querying discussion.
public IDiscussionMessageFilter createDiscussionMessageFilter()
DiscussionMessageStatusFilterType is set to DiscussionMessageStatusFilterType.ALL;
DiscussionMessageModeratorFilterType is set to DiscussionMessageModeratorFilterType.ALL;
DiscussionMessageQueryOrders is set to an array of one element with an attribute of DiscussionMessageAttribute.PROJECT_NAME, ascending.
public IDiscussion getDiscussion(int discussionID)
throws CollaborationException,
java.rmi.RemoteException
discussionID - ID of the discussion; must be positive. The ID of an object can
be obtained using the getID method in the object class.
null if the discussion does not exist, or
the user does not have the rights to see the discussion.
CollaborationException - if the method call resulted in an error.
java.lang.IllegalArgumentException - if the discussion ID is not > 0.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.
public IDiscussionMessage getDiscussionMessage(int messageID)
throws CollaborationException,
java.rmi.RemoteException
messageID - id of the message; must be positive. The ID of an object can
be obtained using the getID method in the object class.
null if it does not
exist, or the user does not have the rights to see the object.
CollaborationException - if the method call resulted in an error.
java.lang.IllegalArgumentException - if the messageID is not > 0.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.
public int[] getSubscribedUserIDs(IDiscussion discussion)
throws CollaborationException,
java.rmi.RemoteException
discussion - the discussion; cannot be null.
java.lang.IllegalStateException - if the discussion has not yet
been stored or has already been removed.
CollaborationException - it the method resulted in an error.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.
public IDiscussionMessage[] queryDiscussionMessages(IProject project,
IDiscussionMessageFilter filter)
throws CollaborationException,
java.rmi.RemoteException
IDiscussionMessage containing
zero or more discussion messages in a given project,
satisfying the discussion message filter criteria.
//The following sample code shows how to query for discussion messagess in a project.
IDiscussionMessageFilter messageFilter = discussionManager.createDiscussionMessageFilter();
//search for ALL messages; other options include searching for APPROVED, or UNAPPROVED messages
messageFilter.setMessageStatusType(DiscussionMessageStatusFilterType.ALL);
//limit the return results to be 10; setting this to 0 will return all results
messageFilter.setMaximumResults(10);
//disable security checking on the returned objects against the user who performs this query,
//so that all objects will be returned
messageFilter.setRestoreSecurity(false);
//user DiscussionMessageQueryOrder to sort the query result; below DiscussionMessageQueryOrder
//shows sorting the returned messages by CREATED date in descending order
DiscussionMessageQueryOrder messageQueryOrder = new DiscussionMessageQueryOrder(DiscussionMessageAttribute.CREATED, false);
messageFilter.setQueryOrders(new DiscussionMessageQueryOrder[] { messageQueryOrder });
//an array of IDiscussionMessage objects are returned from queryDiscussionMessages(); if no result is retrieved, a zero-length array will be returned
IDiscussionMessage[] retrievedMessages = discussionManager.queryDiscussionMessages(project, messageFilter);
project - project to query discussion messages; cannot be null.filter - the discussion message query filter; cannot be null.
IDiscussionMessage containing
zero or more discussion messages in a given discussion,
satisfying the discussion message filter criteria.
java.lang.IllegalStateException - if the project 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.
public IDiscussionMessage[] queryDiscussionMessages(IDiscussion discussion,
IDiscussionMessageFilter messageFilter)
throws CollaborationException,
java.rmi.RemoteException
IDiscussionMessage containing
zero or more discussion messages in a discussion, satisfying the given
discussion message filter.
//The following sample code shows how to query for discussion messagess in a discussion.
IDiscussionMessageFilter messageFilter = discussionManager.createDiscussionMessageFilter();
//search for ALL messages; other options include searching for APPROVED, or UNAPPROVED messages
messageFilter.setMessageStatusType(DiscussionMessageStatusFilterType.ALL);
//limit the return results to be 10; setting this to 0 will return all results
messageFilter.setMaximumResults(10);
//disable security checking on the returned objects against the user who performs this query,
//so that all objects will be returned
messageFilter.setRestoreSecurity(false);
//user DiscussionMessageQueryOrder to sort the query result; below DiscussionMessageQueryOrder
//shows sorting the returned messages by CREATED date in descending order
DiscussionMessageQueryOrder messageQueryOrder = new DiscussionMessageQueryOrder(DiscussionMessageAttribute.CREATED, false);
messageFilter.setQueryOrders(new DiscussionMessageQueryOrder[] { messageQueryOrder });
//an array of IDiscussionMessage objects are returned from queryDiscussionMessages(); if no result is retrieved, a zero-length array will be returned
IDiscussionMessage[] retrievedMessages = discussionManager.queryDiscussionMessages(discussion, messageFilter);
discussion - the discussion to query from; cannot be null.messageFilter - the discussion message query filter; cannot be null.
IDiscussionMessage containing
zero or more discussion messages in a discussion, satisfying the given
discussion message filter.
java.lang.IllegalStateException - if the discussion 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.
public IDiscussion[] queryDiscussions(IProject project,
IDiscussionFilter discussionfilter)
throws CollaborationException,
java.rmi.RemoteException
IDiscussion that contains discussions
within the given project; the returned results will be sorted according
to the given IFilter.
//The following sample code shows how to query for discussions, maximum results to return = 10. IDiscussionFilter discussionFilter = discussionManager.createDiscussionFilter(); //limit the return results to be 10; setting this to 0 will return all results discussionFilter.setMaximumResults(10); //disable security checking on the returned objects against the user who performs this query, //so that all objects will be returned discussionFilter.setRestoreSecurity(false); //an array of IDiscussion are returned from queryDiscussions(); if no result is retrieved, a zero-length array will be returned IDiscussion[] retrievedDiscussions = discussionManager.queryDiscussions(project, discussionFilter);
project - the project; cannot be null.discussionfilter - the filter specifying the sort fields and the sort order,
and maximum number of rows to return; cannot be null.
IDiscussion that contains discussions
within the given project.
java.lang.IllegalStateException - if the project 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.
public void removeDiscussion(IDiscussion discussion)
throws CollaborationException,
java.rmi.RemoteException
discussion - the discussion to be removed; cannot be null.
CollaborationException - if the method call resulted in an error.
java.lang.IllegalArgumentException - if the id of the discussion is not > 0.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.
public void subscribeUsers(IDiscussion discussion,
int[] userIDs)
throws CollaborationException,
MultipleObjectException,
java.rmi.RemoteException
ADMIN access to the project containing this discussion,
and the users to be subscribed have to have at least READ access
to the discussion. The call will make a best attempt to subscribe all supplied,
valid users. A MultipleObjectException will be
thrown specifying the IDs that failed to be subscribed.
discussion - the discussion to subcribe users to; cannot be null.userIDs - the ids of the users to subscribe; cannot be null; all IDs must be positive.
java.lang.IllegalStateException - if the discussion has not yet
been stored or has already been removed.
MultipleObjectException - if any users cannot be subscribed.
CollaborationException - if the method call resulted in an error.
java.lang.IllegalArgumentException - if any of the userIDs is not > 0.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.
public void unsubscribeUsers(IDiscussion discussion,
int[] userIDs)
throws CollaborationException,
java.rmi.RemoteException
discussion - the discussion to unsubcribe users from.userIDs - the ids of the users to unsubscribe; cannot be null; all IDs must be positive.
java.lang.IllegalStateException - if the discussion has not yet
been stored or has already been removed.
CollaborationException - it the method resulted in an error.
java.lang.IllegalArgumentException - if any of the userIDs is not > 0.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©2007 BEA Systems, Inc. All Rights Reserved.