|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface that 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: Any modifications made to a
discussion will not be stored permanently
until the 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 the 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. |
java.lang.String |
getEmailAddress()
Returns the discussion email address. |
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 integer array of IDs of the current discussion's moderators. |
java.lang.String |
getName()
Returns the discussion name as a String. |
IObjectReference[] |
getObjectReferences()
Returns an array of IObjectReference . |
int |
getOwnerUserID()
Returns the user ID of the owner of this object. |
boolean |
hasCreatedDate()
Returns true if created date is available, otherwise false . |
boolean |
hasLastModifiedDate()
Returns true if last modified date is available, otherwise false . |
boolean |
isActionAllowed(DiscussionPermission permission)
Returns true 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)
Sets the 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 user ID is not positivepublic 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
//Sample code below 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 removedpublic AccessLevel getAccessLevel(RoleType roleType)
roleType
- the role type; cannot be null
java.lang.IllegalStateException
- if the object has already been removedpublic 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 was a communication problem during the execution of the remote method callpublic 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 removedpublic java.lang.String getDetailsURL()
java.lang.IllegalStateException
- if the object has not yet
been stored or has already been removedpublic java.lang.String getEmailAddress()
null
if email support has not been enabled for Collaboration
java.lang.IllegalStateException
- if the object has already been removedpublic int getID()
java.lang.IllegalStateException
- if the object has not yet
been stored or has already been removedpublic java.util.Date getLastModifiedDate()
java.lang.IllegalStateException
- if the object has not yet been stored or has already been removedpublic int[] getModeratorIDs()
java.lang.IllegalStateException
- if the object has not yet
been stored or has already been removedpublic java.lang.String getName()
java.lang.IllegalStateException
- if the object has already been removedpublic IObjectReference[] getObjectReferences() throws CollaborationException, java.rmi.RemoteException
IObjectReference
.
For discussions, object references are attached task lists or documents.
IObjectReference
for the current discussion
CollaborationException
- if the method call resulted in an error
java.lang.IllegalStateException
- if the document has not yet been inserted or has already been removed, or if the version number does not exist.
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic 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, otherwise false
.
true
if created date is available, else false
java.lang.IllegalStateException
- if the object has already
been removedpublic boolean hasLastModifiedDate()
true
if last modified date is available, otherwise false
.
true
if last modified date is available, else false
java.lang.IllegalStateException
- if the object has already
been removedpublic boolean isActionAllowed(DiscussionPermission permission) throws CollaborationException, java.rmi.RemoteException
true
if a given 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 was a communication problem during the execution of the remote method callpublic 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 an individual
object's security. Default value for
isDefaultSecurity
is true
.
true
if the object uses
project-default security, and false
if the
object is enabled to use its own security, (
setDefaultSecurity
is set to
false
).
java.lang.IllegalStateException
- if the object has not yet
been stored or has already been removedpublic 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 was a communication problem during the execution of the remote method callpublic 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 positivepublic 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 modifying the object access levelpublic void setDefaultSecurity(boolean isDefaultSecurity)
true
will
enable default security, calling it with false
will disable default security.
true
. To modify security on individual
objects in a project, the objects must have default security
disabled prior to modification. After this method is called,
any project-level security modification will not be applied
to the objects, and only the individual object's security
modification will be used.
isDefaultSecurity
method,
which would indicate whether or not 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 removedpublic void setDescription(java.lang.String description)
description
- the discussion description
java.lang.IllegalStateException
- if the object has already been removedpublic void setName(java.lang.String name)
name
- the discussion name
java.lang.IllegalStateException
- if the object has already been removedpublic 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 was 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 ©2010 Oracle® Corporation. All Rights Reserved.