Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community
Interface ModerationManager

All Superinterfaces:
JiveManager

public interface ModerationManager
extends JiveManager

Manages the moderation feature within Clearspace


Field Summary
static java.lang.String PROPERTY_EMAIL_ADDRESS
           
static java.lang.String PROPERTY_EMAIL_BODY
           
static java.lang.String PROPERTY_EMAIL_ENABLED
           
static java.lang.String PROPERTY_EMAIL_NAME
           
static java.lang.String PROPERTY_EMAIL_SUBJECT
           
static java.lang.String PROPERTY_MESSAGE_TIME_APPROVED
           
 
Method Summary
 void approve(AuthToken authToken, ForumMessage message)
          Approve a moderated message
 void editAndApprove(AuthToken authToken, ForumMessage message, java.lang.String subject, java.lang.String body, java.lang.String tags)
          Edit and approve a moderated message
 java.util.List<Community> getCommunities(AuthToken authToken)
          This method will return a list of communities where the user is a moderator.
 int getMessageCount(Community community)
          Gets the number of moderated messages in a community
 int getMessageCount(ModerationFilter modFilter, AuthToken authToken)
          Gets the number of moderated messages in the system
 int getMessageCount(ModerationFilter modFilter, Community community)
          Gets the number of moderated messages in a community
 java.util.List<ForumMessage> getMessages(AuthToken authToken)
          This method will return a list of messages where the user is a moderator.
 java.lang.Iterable<ForumMessage> getMessages(AuthToken authToken, Community community)
          Gets a list of moderated messages for a particular community.
 java.util.List<ForumMessage> getMessages(ModerationFilter modFilter, AuthToken authToken)
          This method will return a list of messages where the user is a moderator.
 java.lang.Iterable<ForumMessage> getMessages(ModerationFilter modFilter, AuthToken authToken, Community community)
          Gets a list of moderated messages for a particular community.
 boolean isCommentModerationEnabled()
          Returns whether comment moderation is enabled or not.
 boolean isEmailAlertEnabled()
          Returns true if moderation email alerts enabled.
 void reject(AuthToken authToken, ForumMessage message)
          Reject a moderated message
 void setCommentModerationEnabled(boolean enabled)
          Sets whether comment moderation is enabled or not.
 void setEmailAlertEnabled(boolean emailAlertEnabled)
          Enables or disables moderation email alerts.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

Field Detail

PROPERTY_EMAIL_ENABLED

static final java.lang.String PROPERTY_EMAIL_ENABLED
See Also:
Constant Field Values

PROPERTY_EMAIL_NAME

static final java.lang.String PROPERTY_EMAIL_NAME
See Also:
Constant Field Values

PROPERTY_EMAIL_ADDRESS

static final java.lang.String PROPERTY_EMAIL_ADDRESS
See Also:
Constant Field Values

PROPERTY_EMAIL_SUBJECT

static final java.lang.String PROPERTY_EMAIL_SUBJECT
See Also:
Constant Field Values

PROPERTY_EMAIL_BODY

static final java.lang.String PROPERTY_EMAIL_BODY
See Also:
Constant Field Values

PROPERTY_MESSAGE_TIME_APPROVED

static final java.lang.String PROPERTY_MESSAGE_TIME_APPROVED
See Also:
Constant Field Values
Method Detail

getCommunities

java.util.List<Community> getCommunities(AuthToken authToken)
This method will return a list of communities where the user is a moderator. If the user doesn't have those permissions on at least 1 community, a list of size zero is returned.

Parameters:
authToken - the users authToken
Returns:
a list of communities where the user is a moderator.

getMessages

java.util.List<ForumMessage> getMessages(AuthToken authToken)
This method will return a list of messages where the user is a moderator. If the user doesn't have those permissions on at least 1 community, an UnauthorizedException is thrown

Parameters:
authToken - the users authToken
Returns:
a list of messages where the user is a moderator.

getMessages

java.util.List<ForumMessage> getMessages(ModerationFilter modFilter,
                                         AuthToken authToken)
This method will return a list of messages where the user is a moderator. If the user doesn't have those permissions on at least 1 community, an UnauthorizedException is thrown

Parameters:
modFilter - the moderation filter
authToken - the users authToken
Returns:
a list of messages where the user is a moderator.

getMessages

java.lang.Iterable<ForumMessage> getMessages(AuthToken authToken,
                                             Community community)
                                             throws UnauthorizedException
Gets a list of moderated messages for a particular community.

Parameters:
authToken - the users authToken
community - the community to retrieve the moderated messages for
Returns:
a list of moderated messages for a particular community
Throws:
UnauthorizedException - if the user is not a moderator of the community

getMessages

java.lang.Iterable<ForumMessage> getMessages(ModerationFilter modFilter,
                                             AuthToken authToken,
                                             Community community)
                                             throws UnauthorizedException
Gets a list of moderated messages for a particular community.

Parameters:
modFilter - the moderation filter
authToken - the users authToken
community - the community to retrieve the moderated messages for
Returns:
a list of moderated messages for a particular community
Throws:
UnauthorizedException - if the user is not a moderator of the community

getMessageCount

int getMessageCount(ModerationFilter modFilter,
                    AuthToken authToken)
Gets the number of moderated messages in the system

Parameters:
modFilter - the moderation filter
authToken - the users authToken
Returns:
the number of moderated messages in the system

getMessageCount

int getMessageCount(Community community)
Gets the number of moderated messages in a community

Parameters:
community - the community to retrieve the moderated message count for
Returns:
the number of moderated messages in the community

getMessageCount

int getMessageCount(ModerationFilter modFilter,
                    Community community)
Gets the number of moderated messages in a community

Parameters:
modFilter - the moderation filter
community - the community to scan
Returns:
the number of moderated messages in the community

approve

void approve(AuthToken authToken,
             ForumMessage message)
             throws UnauthorizedException
Approve a moderated message

Parameters:
authToken - the users authToken
message - the message to approve
Throws:
UnauthorizedException - if the user is not a moderator of the community in which the message belongs

editAndApprove

void editAndApprove(AuthToken authToken,
                    ForumMessage message,
                    java.lang.String subject,
                    java.lang.String body,
                    java.lang.String tags)
                    throws UnauthorizedException
Edit and approve a moderated message

Parameters:
authToken - the users authToken
message - the message to edit and approve
subject - the new message subject
body - the new message body
tags - the new tags for the message
Throws:
UnauthorizedException - if the user is not a moderator of the community in which the message belongs

reject

void reject(AuthToken authToken,
            ForumMessage message)
            throws UnauthorizedException
Reject a moderated message

Parameters:
authToken - the users authToken
message - the message to reject
Throws:
UnauthorizedException - if the user is not a moderator of the community in which the message belongs

isEmailAlertEnabled

boolean isEmailAlertEnabled()
Returns true if moderation email alerts enabled. When enabled, an email alert will be sent out when a moderator rejects a message.

Returns:
true if the validation is enabled.

setEmailAlertEnabled

void setEmailAlertEnabled(boolean emailAlertEnabled)
Enables or disables moderation email alerts. When enabled, an email alert will be sent out when a moderator rejects a message.

Parameters:
emailAlertEnabled - true to enable the email alert feature, false to disable.

isCommentModerationEnabled

boolean isCommentModerationEnabled()
Returns whether comment moderation is enabled or not. Default is that comment moderation is not enabled.

Returns:
whether comment moderation is enabled or not.

setCommentModerationEnabled

void setCommentModerationEnabled(boolean enabled)
                                 throws UnauthorizedException
Sets whether comment moderation is enabled or not. Default is that comment moderation is not enabled.

Parameters:
enabled - true if comment moderation is enabled, false otherwise.
Throws:
UnauthorizedException - if not an administator.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.