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>
 
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.
 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.
 List<RestLike> getLikes()
          Gets the list of likes.
 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.
 int getTotalNumberOfComments()
          Gets the number of total comments.
 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 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.
 
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
 

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.

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

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

getLikes

List<RestLike> getLikes()
Gets the list of likes.


getPosterIdentity

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

Returns:
the poster identity

getAvailableComments

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

Returns:
maximum 5 latest comments
See Also:
getTotalComments()

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()
Gets the total number of comments.

Returns:
the total comment list

getActivityStream

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

Returns:
the associated activity stream.

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.