|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
An IDiscussion represents a collaboration
discussion object. A Discussion contains zero or more
messages and reply messages. This interface handles creation
of messages, modifications of discussion metadata and
security. Note that all operations modifying the
discussion will not be stored permanently
until store method is called.
| Method Summary | |
void |
addModerator(int userID)
Adds a user to the discussion moderator list. |
IDiscussionMessage |
createDiscussionMessage(java.lang.String subject,
java.lang.String body)
Creates and returns a discussion message. |
AccessLevel |
getAccessLevel(RoleType roleType)
Returns object access level for a given role type. |
IProject |
getContainingProject()
Returns the project that this object belongs to. |
java.util.Date |
getCreatedDate()
Returns the creation date. |
java.lang.String |
getDescription()
Returns the discussion description. |
java.lang.String |
getDetailsURL()
Returns the URL at which the discussion details can be viewed. |
int |
getID()
Returns the discussion ID. |
java.util.Date |
getLastModifiedDate()
Returns the last modified date; the last modified date will also get updated whenever a new discussion message is created in this discussion. |
int[] |
getModeratorIDs()
Returns an int array of ids of the current discussion's moderators. |
java.lang.String |
getName()
Returns the discussion name. |
int |
getOwnerUserID()
Returns the user ID of the owner of this object. |
boolean |
hasCreatedDate()
Returns true if created date is available, else false. |
boolean |
hasLastModifiedDate()
Returns true if last modified date is available, else false. |
boolean |
isActionAllowed(DiscussionPermission permission)
Returns if a given DiscussionPermission
is allowed for this discussion. |
boolean |
isDefaultSecurity()
Indicates if this object uses project-default security. |
void |
removeDiscussionMessage(IDiscussionMessage message)
Removes a discussion message and all its replies. |
void |
removeModerator(int userID)
Removes a user from the discussion moderator list. |
void |
setAccessLevel(RoleType roleType,
AccessLevel accessLevel)
Set object access level for a given role type. |
void |
setDefaultSecurity(boolean isDefaultSecurity)
Enables or disables this object's use of project default security. |
void |
setDescription(java.lang.String description)
Sets the discussion description. |
void |
setName(java.lang.String name)
Sets the discussion name. |
void |
store()
Stores the discussion. |
| Method Detail |
public void addModerator(int userID)
getModeratorIDs.
The user who creates a discussion is not added automatically
as its moderator.
userID - the user id; must be positive.
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.
java.lang.IllegalArgumentException - if the userID is not positive.
public IDiscussionMessage createDiscussionMessage(java.lang.String subject,
java.lang.String body)
store method is called on the new message.
This method is only used for creating topic messages (non-reply messages).
To create reply messages, use IDiscussionMessage.createDiscussionReplyMessage
//Below sample code shows how to create a discussion message in a discussion.
IDiscussionMessage message = discussion.createDiscussionMessage("Sample Message Subject", "Sample Message Body");
//sets optional message properties
message.setApproved(true);
message.setDescription("Option description for discussion message");
//store() needs to be called to persist the message.
message.store();
subject - the message subject; cannot be null.body - the message body, cannot be null.
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.public AccessLevel getAccessLevel(RoleType roleType)
roleType - the role type; cannot be null.
java.lang.IllegalStateException - if the object has already been removed.
public IProject getContainingProject()
throws CollaborationException,
java.rmi.RemoteException
CollaborationException - if the method call resulted in an error.
java.lang.IllegalStateException - if the object 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 java.util.Date getCreatedDate()
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.public java.lang.String getDescription()
java.lang.IllegalStateException - if the object has already been removed.public java.lang.String getDetailsURL()
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.public int getID()
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.public java.util.Date getLastModifiedDate()
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.public int[] getModeratorIDs()
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.public java.lang.String getName()
java.lang.IllegalStateException - if the object has already been removed.public int getOwnerUserID()
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.public boolean hasCreatedDate()
true if created date is available, else false.
true if created date is available, else false.
java.lang.IllegalStateException - if the object has already
been removed.public boolean hasLastModifiedDate()
true if last modified date is available, else false.
true if last modified date is available, else false.
java.lang.IllegalStateException - if the object has already
been removed.
public boolean isActionAllowed(DiscussionPermission permission)
throws CollaborationException,
java.rmi.RemoteException
DiscussionPermission
is allowed for this discussion. This method can be used to
determine if a user can perform a given action within
the context of a discussion such as editing,
copying, and modifying security, etc.
See the enumeration type DiscussionPermission
for details about specific Discussion permissions
permission - discussion permission; cannot be null.
true if the user can perform
the given action, else false.
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.public boolean isDefaultSecurity()
true, trying to modify security on the
current object alone will not have any effect.
setDefaultSecurity must be set to
false in order to modify individual
object's security. Default value for
isDefaultSecurity is true.
true if the object uses
project-default security, false if the
object is enabled to use its own security, ie.
setDefaultSecurity is set to
false.
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.
public void removeDiscussionMessage(IDiscussionMessage message)
throws CollaborationException,
java.rmi.RemoteException
message - the discussion message to remove; cannot be null.
CollaborationException - if the method call resulted in an error.
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.public void removeModerator(int userID)
userID - the user id to remove; must be positive.
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.
java.lang.IllegalArgumentException - if the userID is not positive.
public void setAccessLevel(RoleType roleType,
AccessLevel accessLevel)
roleType - the role type for which access level will be set; cannot be null.accessLevel - the access level; cannot be null.
java.lang.IllegalStateException - if project default security is used; call setDefaultSecurity(false) prior
to modify object access level.public void setDefaultSecurity(boolean isDefaultSecurity)
true will
enable defaultSecurity, calling it with false
will disable defaultSecurity.
true. To modify security on individual
objects in a project, the objects must have defaultSecurity
disabled prior to modification. After this method is called,
any project-level security modification will not be applied
to the objects, and only individual object's security
modification will be used.
isDefaultSecurity ,
which would indicate if the current object has default security enabled.
isDefaultSecurity - true if it uses
default security, otherwise false
java.lang.IllegalStateException - if the object has not yet
been stored or has already been removed.public void setDescription(java.lang.String description)
description - the discussion description.
java.lang.IllegalStateException - if the object has already been removed.public void setName(java.lang.String name)
name - the discussion name.
java.lang.IllegalStateException - if the object has already been removed.
public void store()
throws CollaborationException,
java.rmi.RemoteException
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©2007 BEA Systems, Inc. All Rights Reserved.