Jive API (3.0.13) Core Javadocs

com.jivesoftware.community
Interface WatchInfoProvider

All Known Implementing Classes:
MediaWatchInfoProvider

public interface WatchInfoProvider

Exposes methods allowing the watch subsystem to decide what objects are watched, and by whom.


Method Summary
 boolean canUserWatchObject(JiveObject objectToWatch, User user, Map<String,Object> objectProperties)
          Returns true if the user is authorized to watch the object.
 boolean eventsHandledExclusivelyByCustomListener()
          This method should return true if a listener has been registered to handle events exclusively, bypassing the generic activity event listener in the core code.
 List<User> getAuthorsToWatchFor(JiveObject object, Map<String,Object> objectProperties)
          Returns a list of authors of the jive object for which watches may be retrieved and converted into mails.
 Map<String,Object> getEmailTemplateContextParams(JiveObject object)
          This method returns a map of objects with which to populate the email template context.
 String getExpirationDatesQuery()
          A SQL select statement which must return objectID,expirationDate in the SELECT clause.
 NotificationTargetStrategy getNotificationTargetStrategy()
          Returns a strategy for computing which object is the target of notification on a watch event.
 WatchCreationStrategy getWatchCreationStrategy()
          Returns a strategy for deciding whether or not a watch should be created for a given event.
 boolean isEnabledByDefault()
          If true, watch preferences for this type are always set to true for all users.
 boolean isNotifyOnEvent(ContentEvent event)
          Returns true if the event triggers a notify.
 boolean isUserProfileConfigurable()
          If true, watch preferences for this type may be configured per user.
 

Method Detail

isUserProfileConfigurable

boolean isUserProfileConfigurable()
If true, watch preferences for this type may be configured per user.

Returns:
whether or not watch preferences for this type may be configured per user.

isEnabledByDefault

boolean isEnabledByDefault()
If true, watch preferences for this type are always set to true for all users.

Returns:
whether or not watch preferences for this type are always set to true for all users.

canUserWatchObject

boolean canUserWatchObject(JiveObject objectToWatch,
                           User user,
                           Map<String,Object> objectProperties)
                           throws Exception
Returns true if the user is authorized to watch the object. A hash of properties may be used to provide more context around that decision.

Parameters:
objectToWatch - the jive object in question.
user - the user in question.
objectProperties - hash of properties that may be used to provide more context around the decision, if needed.
Returns:
true if the user is authorized to watch the object.
Throws:
Exception - a general exception.

getAuthorsToWatchFor

List<User> getAuthorsToWatchFor(JiveObject object,
                                Map<String,Object> objectProperties)
Returns a list of authors of the jive object for which watches may be retrieved and converted into mails.

Parameters:
object - the jive object to get authors of.
objectProperties - hash of properties that may be used to provide more context, if needed.
Returns:
a list of authors of the jive object for which watches may be retrieved and converted into mails.

getExpirationDatesQuery

String getExpirationDatesQuery()
A SQL select statement which must return objectID,expirationDate in the SELECT clause. For example: SELECT internaldocid objectID, expirationDate FROM jiveDocument; Used for determining whether or not watches on those objects should expire also. If returns null or empty string, then watch expiration will not be activated for the type.

Returns:
a SQL select statement used for determining whether or not watches on those objects should expire also.

getEmailTemplateContextParams

Map<String,Object> getEmailTemplateContextParams(JiveObject object)
This method returns a map of objects with which to populate the email template context. Use this if your email templates require special objects not included by default in com.jivesoftware.community.impl.EmailWatchUpdateTask. May return null or empty map if no objects are required.

Parameters:
object - the jive object
Returns:
a map of objects with which to populate the email template context.

eventsHandledExclusivelyByCustomListener

boolean eventsHandledExclusivelyByCustomListener()
This method should return true if a listener has been registered to handle events exclusively, bypassing the generic activity event listener in the core code.

Returns:
true if a listener has been registered to handle events exclusively, bypassing the generic activity event listener in the core code.

isNotifyOnEvent

boolean isNotifyOnEvent(ContentEvent event)
Returns true if the event triggers a notify.

Parameters:
event - the content-event.
Returns:
true if the event triggers a notify.

getWatchCreationStrategy

WatchCreationStrategy getWatchCreationStrategy()
Returns a strategy for deciding whether or not a watch should be created for a given event. May return null if the default strategy is to be used.

Returns:
a strategy for deciding whether or not a watch should be created for a given event.

getNotificationTargetStrategy

NotificationTargetStrategy getNotificationTargetStrategy()
Returns a strategy for computing which object is the target of notification on a watch event. May return null if the default strategy is to be used.

Returns:
a strategy for computing which object is the target of notification on a watch event.

Jive Product Page

Copyright © 1999-2007 Jive Software.