org.exoplatform.social.client.api.model
Interface RestActivity

All Superinterfaces:
org.json.simple.JSONAware, org.json.simple.JSONStreamAware, Map, Model
All Known Implementing Classes:
RestActivityImpl

public interface RestActivity
extends Model

eXo Social Activity model based on OpenSocial Activity Spec 0.8.1: http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/opensocial-reference#opensocial.Activity and org.exoplatform.social.core.activity.model.ExoSocialActivity class on eXo Social project.

Since:
May 19, 2011
Author:
hoatle (hoatlevan at gmail dot com)

Nested Class Summary
static class RestActivity.Field
          The fields that represent the activity object in json form.
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static String DEFAULT_ACTIVITY_TYPE
           
static String DOC_ACTIVITY_TYPE
           
static String LINK_ACTIVITY_TYPE
           
 
Method Summary
 void addTemplateParameter(String name, String value)
          Adds a new template parameter with the specified name and value.
 RestActivityStream getActivityStream()
          Gets activity stream.
 String getAppId()
          Gets a string specifying the application that this activity is associated with.
 List<RestComment> getAvailableComments()
          Gets the available list of comments for this activity.
 List<RestIdentity> getAvailableLikes()
          Gets the available list of likes for this activity.
 String getBody()
          gets the body fields of Activity, this field is optional and use to storage the extended attribute of activity.
 String getId()
          Gets a string ID that is permanently associated with this activity.
 String getIdentityId()
          Gets a string uuid of the identity who created this activity.
 Long getPostedTime()
          Gets the time at which this activity took place in milliseconds since the epoch.
 RestIdentity getPosterIdentity()
          Gets the poster identity who created this activity.
 Double getPriority()
          Gets the priority, a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source.
 String getTemplateParameter(String name)
          Returns the template parameter with the specified name.
 Map<String,String> getTemplateParams()
          Gets a map of custom key/value pairs associated with this activity.
 String getTitle()
          Gets a string specifying the primary text of an activity.
 String getTitleId()
          Gets a string specifying the title template message ID in the gadget spec.
 List<RestComment> getTotalComments()
          Gets the total number of comments.
 List<RestIdentity> getTotalLikes()
          Gets the total number of likes.
 int getTotalNumberOfComments()
          Gets the number of total comments.
 int getTotalNumberOfLikes()
          Gets the number of total likes.
 String getType()
          Gets a string specifying the type of activity.
 boolean isLiked()
          Checks if this activity is liked by current user.
 void setAppId(String appId)
          Sets a string specifying the application that this activity is associated with.
 void setAvailableComments(List<RestComment> restCommentList)
          Sets the available list of comments for this activity.
 void setBody(String body)
          Sets the body fields of Activity, this field is optional and use to storage the extended attribute of activity.
 void setId(String id)
          Sets a string ID that is permanently associated with this activity.
 void setIdentityId(String identityId)
          Sets a string uuid of the identity who created this activity.
 void setPostedTime(Long postedTime)
          Sets the time at which this activity took place in milliseconds since the epoch Container support for this field is OPTIONAL.
 void setPriority(Double priority)
          Sets the priority, a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source.
 void setTemplateParams(Map<String,String> templateParams)
          Set a map of custom key/value pairs associated with this activity.
 void setTitle(String title)
          Sets a string specifying the primary text of an activity.
 void setTitleId(String titleId)
          Sets a string specifying the title template message ID in the gadget spec.
 void setType(String type)
          Sets a string specifying the type of activity.
 
Methods inherited from interface org.exoplatform.social.client.api.model.Model
addPropertyChangeListener, addToListField, findPropertyChangeListeners, getField, getFieldAsList, getFieldAsMap, getFieldAsString, getFieldNames, hasField, isFieldMultikeyed, isFieldMultivalued, removePropertyChangeListener, setField
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from interface org.json.simple.JSONAware
toJSONString
 
Methods inherited from interface org.json.simple.JSONStreamAware
writeJSONString
 

Field Detail

DOC_ACTIVITY_TYPE

static final String DOC_ACTIVITY_TYPE
See Also:
Constant Field Values

DEFAULT_ACTIVITY_TYPE

static final String DEFAULT_ACTIVITY_TYPE
See Also:
Constant Field Values

LINK_ACTIVITY_TYPE

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

getId

String getId()
Gets a string ID that is permanently associated with this activity. Container support for this field is OPTIONAL.

Returns:
a string ID that is permanently associated with this activity.

setId

void setId(String id)
Sets a string ID that is permanently associated with this activity. Container support for this field is OPTIONAL.

Parameters:
id - a string ID that is permanently associated with this activity.

getTitle

String getTitle()
Gets a string specifying the primary text of an activity. Container support for this field is REQUIRED. Titles may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Returns:
astring specifying the primary text of an activity.

setTitle

void setTitle(String title)
Sets a string specifying the primary text of an activity. Container support for this field is REQUIRED. Titles may only have the following HTML tags: <b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Parameters:
title - a string specifying the primary text of an activity.

getTitleId

String getTitleId()
Gets a string specifying the title template message ID in the gadget spec. Container support for this field is REQUIRED. The title is the primary text of an activity. Titles may only have the following HTML tags: <<b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Returns:
a string specifying the title template message ID in the gadget spec.

setBody

void setBody(String body)
Sets the body fields of Activity, this field is optional and use to storage the extended attribute of activity.

Parameters:
body -

getBody

String getBody()
gets the body fields of Activity, this field is optional and use to storage the extended attribute of activity.

Returns:

setTitleId

void setTitleId(String titleId)
Sets a string specifying the title template message ID in the gadget spec. Container support for this field is REQUIRED. The title is the primary text of an activity. Titles may only have the following HTML tags: <<b> <i>, <a>, <span>. The container may ignore this formatting when rendering the activity.

Parameters:
titleId - a string specifying the title template message ID in the gadget spec.

getAppId

String getAppId()
Gets a string specifying the application that this activity is associated with. Container support for this field is REQUIRED.

Returns:
A string specifying the application that this activity is associated with

setAppId

void setAppId(String appId)
Sets a string specifying the application that this activity is associated with. Container support for this field is REQUIRED.

Parameters:
appId - A string specifying the application that this activity is associated with

getType

String getType()
Gets a string specifying the type of activity. Container support for this field is REQUIRED.

Returns:
A string specifying the application that this activity is associated with

setType

void setType(String type)
Sets a string specifying the type of activity. Container support for this field is REQUIRED.

Parameters:
appId - A string specifying the application that this activity is associated with

getPostedTime

Long getPostedTime()
Gets the time at which this activity took place in milliseconds since the epoch. Container support for this field is OPTIONAL. Higher priority ones are higher in the list.

Returns:
The time at which this activity took place in milliseconds since the epoch

setPostedTime

void setPostedTime(Long postedTime)
Sets the time at which this activity took place in milliseconds since the epoch Container support for this field is OPTIONAL. This value can not be set by the end user.

Parameters:
postedTime - the time at which this activity took place in milliseconds since the epoch

getPriority

Double getPriority()
Gets the priority, a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source. Container support for this field is OPTIONAL.

Returns:
a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source

setPriority

void setPriority(Double priority)
Sets the priority, a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source. Container support for this field is OPTIONAL.

Parameters:
priority - a number between 0 and 1 representing the relative priority of this activity in relation to other activities from the same source.

getTemplateParams

Map<String,String> getTemplateParams()
Gets a map of custom key/value pairs associated with this activity. Container support for this field is OPTIONAL.

Returns:
a map of custom key/value pairs associated with this activity.

setTemplateParams

void setTemplateParams(Map<String,String> templateParams)
Set a map of custom key/value pairs associated with this activity. The data has type Map. The object may be either a String or a Person. When passing in a person with key PersonKey, can use the following replacement variables in the template: Container support for this field is OPTIONAL.

Parameters:
templateParams - a map of custom key/value pairs associated with this activity.

getIdentityId

String getIdentityId()
Gets a string uuid of the identity who created this activity.

Returns:
a string ID of the identity who created this activity.

setIdentityId

void setIdentityId(String identityId)
Sets a string uuid of the identity who created this activity.

Parameters:
identityId - a string ID of the identity who created this activity.

isLiked

boolean isLiked()
Checks if this activity is liked by current user.

Returns:
boolean value

getPosterIdentity

RestIdentity getPosterIdentity()
                               throws SocialClientLibException
Gets the poster identity who created this activity.

Returns:
the poster identity
Throws:
SocialClientLibException

getAvailableComments

List<RestComment> getAvailableComments()
Gets the available list of comments for this activity. Return Number of latest comments of this activity.

Returns:
Number of latest comments
See Also:
getTotalComments()

getAvailableLikes

List<RestIdentity> getAvailableLikes()
Gets the available list of likes for this activity. Return Number of latest likes of this activity.

Returns:
Number of latest likes
See Also:
getTotalLikes()

setAvailableComments

void setAvailableComments(List<RestComment> restCommentList)
Sets the available list of comments for this activity.

Parameters:
restCommentList - available comment list

getTotalNumberOfComments

int getTotalNumberOfComments()
Gets the number of total comments.

Returns:
the the number of total comments

getTotalComments

List<RestComment> getTotalComments()
                                   throws SocialClientLibException
Gets the total number of comments.

Returns:
the total comment list
Throws:
SocialClientLibException

getTotalNumberOfLikes

int getTotalNumberOfLikes()
Gets the number of total likes.

Returns:
the the number of total likes

getTotalLikes

List<RestIdentity> getTotalLikes()
                                 throws SocialClientLibException
Gets the total number of likes.

Returns:
the total like list
Throws:
SocialClientLibException

getActivityStream

RestActivityStream getActivityStream()
                                     throws SocialClientLibException
Gets activity stream. This is lazy loading.

Returns:
the associated activity stream.
Throws:
SocialClientLibException

getTemplateParameter

String getTemplateParameter(String name)
Returns the template parameter with the specified name. This is a helper method.

Parameters:
name - name of template parameter whose value is to be returned
Returns:
a string associated with a name

addTemplateParameter

void addTemplateParameter(String name,
                          String value)
Adds a new template parameter with the specified name and value. This is a helper method.

Parameters:
name - name of new template parameter to add
value - value of template parameter to associate with passed name


Copyright © 2011 eXo Platform. All Rights Reserved.