Jive API (3.0.13) Core Javadocs

com.jivesoftware.community.moderation
Interface JiveObjectModerator


public interface JiveObjectModerator

The main function of this class is to aquire the ModerationStrategy implementation for the given JiveObject and delegate all subsequent calls to the strategy.


Nested Class Summary
static class JiveObjectModerator.Type
           
 
Field Summary
static String MOD_PROPERTY
           
 
Method Summary
 void approve(Long workflowID, JiveObject jiveObject, User user, String responseMessage)
          Approves the workflow for the given workflow ID and JiveObject.
 void handleApprovalCallback(Long workflowID, JiveObject jiveObject, User user, String responseMessage)
          Handles the approval callback.
 void handleFinishCallback(Long workflowID, JiveObject jiveObject)
          Handles the finish call back.
 void handleNewCallback(User user, long entryID, JiveObject jiveObject, Set<Long> moderators, String requestMessage)
          Handles the new callback.
 void handleRejectedCallback(Long workflowID, JiveObject jiveObject, User user, String responseMessage)
          Handles the rejection callback.
 void handleStateChangeCallback(JiveObject jiveObject, JiveContentObject.Status status)
          Handles any state changes for a given object.
 boolean isModerationEnabled(JiveContainer jiveContainer, JiveObject jiveObject, User user)
          Determines if moderation is enabled for the given JiveContainer and object Type.
 boolean isModerationEnabled(JiveObject jiveObject, User user)
          Determines if moderation for the given JiveObject is enabled.
 boolean isModerator(JiveObject jiveObject, User user)
          Determines if the given User is a moderator for the given JiveObject.
 void moderate(JiveObject jiveObject, User user)
          Puts the JiveObject into the moderation queue.
 void notificationCallback(Long workflowID, JiveObject jiveObject, User user, String responseMessage)
          Handles the notification callback.
 void reject(Long workflowID, JiveObject jiveObject, User user, String responseMessage)
          Rejects the workflow for the given workflow ID and JiveObject.
 

Field Detail

MOD_PROPERTY

static final String MOD_PROPERTY
See Also:
Constant Field Values
Method Detail

moderate

void moderate(JiveObject jiveObject,
              User user)
Puts the JiveObject into the moderation queue.

Parameters:
jiveObject - the jiveObject to send into moderation.
user - the user that owns the jiveObject.

isModerationEnabled

boolean isModerationEnabled(JiveObject jiveObject,
                            User user)
Determines if moderation for the given JiveObject is enabled. Moderation is enabled for an object if the space/community it is created in has moderation enabled for jiveObject's type.

Parameters:
jiveObject - the jiveObject for which moderation might be enabled.
user - the user that owns the jiveObject.
Returns:
true if moderation is enabled for the given jiveObject, false otherwise.

isModerationEnabled

boolean isModerationEnabled(JiveContainer jiveContainer,
                            JiveObject jiveObject,
                            User user)
Determines if moderation is enabled for the given JiveContainer and object Type. Moderation is enabled if the moderation enabled property is set for the given object type on the container.

Parameters:
jiveContainer - the jiveContainer.
jiveObject - the object for which moderation might be enabled.
user - the user that owns the jiveObject.
Returns:
true if moderation is enabled for the particular object type, false otherwise.

isModerator

boolean isModerator(JiveObject jiveObject,
                    User user)
Determines if the given User is a moderator for the given JiveObject.

Parameters:
jiveObject - the jiveObject.
user - the user.
Returns:
true if the user is a moderator of the jiveObject, false otherwise.

approve

void approve(Long workflowID,
             JiveObject jiveObject,
             User user,
             String responseMessage)
Approves the workflow for the given workflow ID and JiveObject. This method is responsible for advancing the workflow into the "Approved" step and toggling the status of the JiveObject to "APPROVED".

Parameters:
workflowID - the unique ID of the workflow.
jiveObject - the jiveObject.
user - the user approving the workflow item.
responseMessage - an optional message stating why the jiveObject was approved.

handleApprovalCallback

void handleApprovalCallback(Long workflowID,
                            JiveObject jiveObject,
                            User user,
                            String responseMessage)
Handles the approval callback. This method is responsible for any functions that need to happen after the workflow is advanced to the "Approved" step. By default this method will update the workflow bean for the given workflowID and JiveObject.

Parameters:
workflowID - the unique ID of the workflow.
jiveObject - the jiveObject.
user - the user who approved the workflow item.
responseMessage - an optional message stating why the jiveObject was approved.

reject

void reject(Long workflowID,
            JiveObject jiveObject,
            User user,
            String responseMessage)
Rejects the workflow for the given workflow ID and JiveObject. This method is responsible for advancing the workflow into the "Rejected" step and toggling the status of the JiveObject to "REJECTED".

Parameters:
workflowID - the unique ID of the workflow.
jiveObject - the jiveObject.
user - the user who rejected the workflow item.
responseMessage - an optional message stating why the jiveObject was rejected.

handleRejectedCallback

void handleRejectedCallback(Long workflowID,
                            JiveObject jiveObject,
                            User user,
                            String responseMessage)
Handles the rejection callback. This method is responsible for any functions that need to happen after the workflow is advanced to the "Rejected" step. By default this method will update the workflow bean for the given workflowID and JiveObject.

Parameters:
workflowID - the unique ID of the workflow.
jiveObject - the jiveObject.
user - the user who rejected teh workflow item.
responseMessage - an optional message stating why the jiveObject was rejected.

notificationCallback

void notificationCallback(Long workflowID,
                          JiveObject jiveObject,
                          User user,
                          String responseMessage)
Handles the notification callback. This method is responsible for any functions that need to happen after the workflow is advanced to the "Notification" step. This step happens after the approval and rejected callbacks and before the finish callback. By default this method will send a notification email to the content owner notifying them that the content item was approved/rejected.

Parameters:
workflowID - the unique ID of the workflow.
jiveObject - the jiveObject.
user - the user who approved or rejected the workflow item.
responseMessage - an optional message why the jiveObject was approved/rejected.

handleNewCallback

void handleNewCallback(User user,
                       long entryID,
                       JiveObject jiveObject,
                       Set<Long> moderators,
                       String requestMessage)
Handles the new callback. This method is responsible for any functions that need to happen after the workflow is advanced to the "New" step. This step happens automatically when an item is sent into moderation. By default this makes a call to change the status to "AWAITING_MODERATION", assigns moderators for the piece of content and creates a new workflow entry.

Parameters:
user - the user who owns the jiveObject.
entryID - the unique ID that will be used for the workflow ID.
jiveObject - the jiveObject.
moderators - a set of long values representing moderators user ids.
requestMessage - an optional message stating why the message was sent into moderation.

handleFinishCallback

void handleFinishCallback(Long workflowID,
                          JiveObject jiveObject)
Handles the finish call back. This method is responsible for any functions that need to happen after the workflow is advanced to the finish step. This step happens automatically after the notification callback. By default this method will delete any empty workflow entries for the specified workflow id and JiveObject. A workflow entry is considered to be empty if it's neither approved nor rejected and its request/response message field is empty.

Parameters:
workflowID - the unique id of the workflow.
jiveObject - the jiveObject.

handleStateChangeCallback

void handleStateChangeCallback(JiveObject jiveObject,
                               JiveContentObject.Status status)
Handles any state changes for a given object. Currently this method supports the following jiveObjects :

Parameters:
jiveObject - the jiveObject to change.
status - the new status.

Jive Product Page

Copyright © 1999-2007 Jive Software.