Jive API (3.0.13) Core Javadocs

com.jivesoftware.community
Interface CommentableTypeInfoProvider


public interface CommentableTypeInfoProvider

The comments subsystem (primarily CommentManager) uses this provider to perform comment-related operations on behalf of objects of this type.

See Also:
CommentableType

Method Summary
 int getCommentStatus(CommentContentResource commentTarget)
          Returns the comment status of the comment target.
 InterceptorManager getInterceptorManager(CommentContentResource commentTarget)
          Gets the interceptor manager for the comment target, so that the comments subsystem will can use it to invoke the correct interceptors when comments are added or modified for the target.
 EntityDescriptor getParentObject(CommentContentResource commentTarget)
          Get an entity descriptor indicating the comment target's parent's object type and object id.
 boolean isAuthorizedInBackChannel(CommentContentResource commentTarget, User user)
          Returns true if the comment target can be commented upon in the back-channel by the specified user.
 boolean isCommentAttachedToCommentTarget(EntityDescriptor commentTarget, EntityDescriptor comment)
          Returns true if the comment is attached to the comment target.
 boolean isCommentsEnabled()
          Returns true if comments are enabled for this type.
 boolean isDeleteable(CommentContentResource commentTarget, Comment comment)
          Returns true if the comment is deleteable, based on the deletable status of the comment target and comment itself.
 boolean isInDraftState(CommentContentResource commentTarget)
          Returns true if the comment target is in draft state.
 boolean validateCommentOptions(CommentContentResource commentTarget, Comment comment, boolean isAnonymousUser)
          Returns true if the options for comment authentication are valid.
 

Method Detail

getInterceptorManager

InterceptorManager getInterceptorManager(CommentContentResource commentTarget)
                                         throws NotFoundException
Gets the interceptor manager for the comment target, so that the comments subsystem will can use it to invoke the correct interceptors when comments are added or modified for the target.

Parameters:
commentTarget - the object that was commented upon.
Returns:
the comment.
Throws:
NotFoundException - thrown when an object could not be loaded.

getParentObject

EntityDescriptor getParentObject(CommentContentResource commentTarget)
                                 throws NotFoundException
Get an entity descriptor indicating the comment target's parent's object type and object id.

Parameters:
commentTarget - the object that was commented upon.
Returns:
the comment.
Throws:
NotFoundException - thrown when an object could not be loaded.

isDeleteable

boolean isDeleteable(CommentContentResource commentTarget,
                     Comment comment)
Returns true if the comment is deleteable, based on the deletable status of the comment target and comment itself.

Parameters:
commentTarget - the object that was commented upon.
comment - the comment.
Returns:
true if the comment is deleteable, based on the deletable status of the comment target and comment itself.

getCommentStatus

int getCommentStatus(CommentContentResource commentTarget)
                     throws NotFoundException
Returns the comment status of the comment target. See the comment status constants in the CommentManager for possible values.

Parameters:
commentTarget - the object that was commented upon.
Returns:
the comment status of the comment target. See the comment status constants in the CommentManager for possible values.
Throws:
NotFoundException - thrown when an object could not be loaded.

isCommentAttachedToCommentTarget

boolean isCommentAttachedToCommentTarget(EntityDescriptor commentTarget,
                                         EntityDescriptor comment)
Returns true if the comment is attached to the comment target.

Parameters:
commentTarget - the object that was commented upon.
comment - the comment.
Returns:
true if the comment is attached to the comment target.

isInDraftState

boolean isInDraftState(CommentContentResource commentTarget)
Returns true if the comment target is in draft state.

Parameters:
commentTarget - the object that was commented upon.
Returns:
true if the comment target is in draft state.

isCommentsEnabled

boolean isCommentsEnabled()
Returns true if comments are enabled for this type. Though the type may be intrinsically commentable, configuration options may render comments disabled for this type.

Returns:
true if comments are enabled for this type.

isAuthorizedInBackChannel

boolean isAuthorizedInBackChannel(CommentContentResource commentTarget,
                                  User user)
Returns true if the comment target can be commented upon in the back-channel by the specified user. Usually, implementors will return false since most comment content resources do not have back-channels.

Parameters:
commentTarget - the object that was commented upon.
user - the user whose authorization is in question.
Returns:
true if the comment target can be commented upon in the back-channel by the specified user.

validateCommentOptions

boolean validateCommentOptions(CommentContentResource commentTarget,
                               Comment comment,
                               boolean isAnonymousUser)
Returns true if the options for comment authentication are valid. Usually, implementors will return true here. Blog Posts provide comment options dealing with whether or not an e-mail address is required for the comment.

Parameters:
commentTarget - the object that was commented upon.
comment - the comment.
isAnonymousUser - whether or not the user is anonymous.
Returns:
true if the options for comment authentication are valid.

Jive Product Page

Copyright © 1999-2007 Jive Software.