Jive API (3.0.13) Core Javadocs

com.jivesoftware.community.impl.activity
Class DefaultContentActivityEventHandlingStrategy

java.lang.Object
  extended by com.jivesoftware.community.impl.activity.DefaultContentActivityEventHandlingStrategy
All Implemented Interfaces:
ActivityEventHandlingStrategy

public class DefaultContentActivityEventHandlingStrategy
extends Object
implements ActivityEventHandlingStrategy

Base implementation of ActivityEventHandlingStrategy to simplify the implementation of such strategies for future content types. Subclasses may override this to accomodate their particular quirks.


Field Summary
protected  Map<ContentEvent.ModificationType,Activity.Type> eventToTypeMapping
           
 
Constructor Summary
DefaultContentActivityEventHandlingStrategy()
           
 
Method Summary
 EntityDescriptor getActivityActor(BaseJiveEvent event)
          Only ContentEvent events are supported.
 EntityDescriptor getActivityTargetContainer(BaseJiveEvent event)
          Only ContentEvent events are supported.
 EntityDescriptor getActivityTargetObject(BaseJiveEvent event)
          Only ContentEvent events are supported.
 Activity.Type getActivityTypeFrom(BaseJiveEvent event)
          Only ContentEvent events are supported.
 boolean isActivityRecordable(BaseJiveEvent event)
          Only ContentEvent events are supported, and for payloads which are JiveContentObjects.
protected  JiveContainer loadContainer(int objectType, long objectID)
           
protected  JiveObject loadObject(int objectType, long objectID)
           
 boolean shouldDeleteActivities(BaseJiveEvent event)
          Only ContentEvent events are supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventToTypeMapping

protected Map<ContentEvent.ModificationType,Activity.Type> eventToTypeMapping
Constructor Detail

DefaultContentActivityEventHandlingStrategy

public DefaultContentActivityEventHandlingStrategy()
Method Detail

isActivityRecordable

public boolean isActivityRecordable(BaseJiveEvent event)
Only ContentEvent events are supported, and for payloads which are JiveContentObjects. On create, modify, view, and version added events, the activity is by default recordable if the content object is in PUBLISHED status. For delete, rate, moderate, and move, the activity is by default recordable. Other events are not supported.

Specified by:
isActivityRecordable in interface ActivityEventHandlingStrategy
Parameters:
event - the content event
Returns:
true if the payload is in a recordable state

getActivityTypeFrom

public Activity.Type getActivityTypeFrom(BaseJiveEvent event)
Only ContentEvent events are supported. Maps content event types to an activity type.

Specified by:
getActivityTypeFrom in interface ActivityEventHandlingStrategy
Parameters:
event - event the content event
Returns:
the content event type's corresponding activity type

getActivityTargetObject

public EntityDescriptor getActivityTargetObject(BaseJiveEvent event)
Only ContentEvent events are supported. By default, the method identifies the event payload as the target of an activity.

Specified by:
getActivityTargetObject in interface ActivityEventHandlingStrategy
Parameters:
event - event the content event
Returns:
an entity descriptor for the object that the activity in the event payload targets

getActivityTargetContainer

public EntityDescriptor getActivityTargetContainer(BaseJiveEvent event)
Only ContentEvent events are supported. If the event payload is a ContainerAwareEntityDescriptor, the method returns the descriptor for that container; if it isn't, the method tries to determine whether or not the object is a JiveContentObject, and if it is, it tries to load that object's container and return its descriptor. Otherwise no container is returned.

Specified by:
getActivityTargetContainer in interface ActivityEventHandlingStrategy
Parameters:
event - event the content event
Returns:
an entity descriptor for the container of the object that the activity in the event payload targets

getActivityActor

public EntityDescriptor getActivityActor(BaseJiveEvent event)
Only ContentEvent events are supported. For rate, modify, and view content events, by default the activity actor returned is the one from the event. Otherwise, the method determines whether or not the event payload is a JiveContentObject; if it is, the author of the object is returned.

Specified by:
getActivityActor in interface ActivityEventHandlingStrategy
Parameters:
event - event the content event
Returns:
an entity descriptor for the actor in the activity

loadObject

protected JiveObject loadObject(int objectType,
                                long objectID)

loadContainer

protected JiveContainer loadContainer(int objectType,
                                      long objectID)

shouldDeleteActivities

public boolean shouldDeleteActivities(BaseJiveEvent event)
Only ContentEvent events are supported. Returns true if the event type is deleted, or if the event type is moderate, and the the object payload is a JiveContentObject which is not visible due to moderation status.

Specified by:
shouldDeleteActivities in interface ActivityEventHandlingStrategy
Parameters:
event - event the content event
Returns:
whether or not the event constitutes activity removals for the content object in the payload

Jive Product Page

Copyright © 1999-2007 Jive Software.