Class ExoSocialActivityImpl
- java.lang.Object
-
- org.exoplatform.social.core.activity.model.ExoSocialActivityImpl
-
- All Implemented Interfaces:
ExoSocialActivity,CacheEntry
public class ExoSocialActivityImpl extends Object implements ExoSocialActivity
Implementation ofExoSocialActivity.- Since:
- 1.2.0-GA
- Author:
- hoatle (hoatlevan at gmail dot com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringACTIVITY_METADATA_OBJECT_ID_PARAMstatic StringACTIVITY_METADATA_OBJECT_PARENT_ID_PARAMstatic StringACTIVITY_METADATA_OBJECT_TYPE_PARAMstatic StringDEFAULT_ACTIVITY_METADATA_OBJECT_TYPE-
Fields inherited from interface org.exoplatform.social.core.activity.model.ExoSocialActivity
IS_COMMENT
-
-
Constructor Summary
Constructors Constructor Description ExoSocialActivityImpl()constructor.ExoSocialActivityImpl(String userId, String activityType, String activityTitle)Instantiates a new activity based on userId, type, title.ExoSocialActivityImpl(String userId, String activityType, String activityTitle, String activityBody)Instantiates a new activity based on userId, type, title and its body.ExoSocialActivityImpl(String userId, String activityType, String activityTitle, String activityBody, boolean isAComment)Instantiates a new activity based on userId, type, title, its body and check activity is a comment or not.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ActivityStreamgetActivityStream()Gets associated activity stream of this activity.StringgetAppId()StringgetBody()StringgetBodyId()longgetCacheTime()String[]getCommentedIds()Gets array of identityIds who comment this activity.StringgetExternalId()List<ActivityFile>getFiles()Get files of the activity.StringgetId()String[]getLikeIdentityIds()Gets array of identityIds who like this activity.Map<String,Object>getLinkedProcessedEntities()String[]getMentionedIds()Gets array of identityIds who like this activity.MetadataObjectgetMetadataObject()StringgetMetadataObjectId()StringgetMetadataObjectParentId()StringgetMetadataObjectType()Map<String,List<MetadataItem>>getMetadatas()StringgetName()Gets the name; could be the name of the doc, the name of jira task or the page title.intgetNumberOfLikes()Gets number of Liker who like this activity.StringgetParentCommentId()Get id of parent activity comment.StringgetParentId()Get id of parent activity.StringgetPermaLink()Gets the permanent link.LonggetPostedTime()StringgetPosterId()Gets id of identity who is poster.FloatgetPriority()String[]getReplyToId()Gets reply to identity id.Set<ActivityShareAction>getShareActions()Gets array of identityIds who shared this activity.StringgetSpaceId()StringgetStreamFaviconUrl()StringgetStreamId()The uuid of the node for this stream.StringgetStreamOwner()Gets the stream owner, must be the remoteId of an identity.StringgetStreamSourceUrl()StringgetStreamTitle()StringgetStreamUrl()StringgetSummary()This string value provides a human readable description or summary of the activity object.Map<String,String>getTemplateParams()StringgetTitle()StringgetTitleId()StringgetType()The type of activity, this can be used for displaying activity with different ui components.DategetUpdated()StringgetUrl()StringgetUserId()inthashCode()booleanhasSpecificMetadataObject()booleanisComment()To indicate if this a comment to an activity.voidisComment(boolean isCommentOrNot)To indicate if this a comment to an activity.booleanisHidden()To know if this is a hidden activity.voidisHidden(boolean isHiddenOrNot)Sets to indicate if this is a hidden activity or not.booleanisLocked()To know if this is a locked activity.voidisLocked(boolean isLockedOrNot)Sets to indicate if this is a locked activity or not.voidsetActivityStream(ActivityStream providedAS)Sets activity stream associated with this activity.voidsetAppId(String appId)voidsetBody(String body)voidsetBodyId(String bodyId)voidsetCacheTime(long cacheTime)voidsetCommentedIds(String[] identityIds)Sets array of identityIds who comment this activity.voidsetExternalId(String externalId)voidsetFiles(List<ActivityFile> files)Set activity filesvoidsetId(String id)voidsetLikeIdentityIds(String[] identityIds)Sets array of identityIds who like this activity.voidsetLinkedProcessedEntities(Map<String,Object> linkedProcessedEntities)voidsetMentionedIds(String[] identityIds)Sets array of identityIds who like this activity.voidsetMetadataObjectId(String objectId)SetMetadataObjectid for current activityvoidsetMetadataObjectParentId(String objectParentId)SetMetadataObjectparentId for current activityvoidsetMetadataObjectType(String objectType)SetMetadataObjecttype for current activityvoidsetMetadatas(Map<String,List<MetadataItem>> metadatas)Set aMapofMetadataItemof the activity grouped by Metadata typevoidsetName(String activityName)Sets the name; could be the name of the doc, the name of jira task or the page title.voidsetParentCommentId(String parentCommentId)Set parent activity comment idvoidsetParentId(String parentId)Set parent activity idvoidsetPermanLink(String activityPermaLink)Sets the permanent link.voidsetPostedTime(Long postedTime)voidsetPosterId(String posterId)Sets poster id.voidsetPriority(Float priority)voidsetReplyToId(String[] replyToIdentityId)Sets reply to identity id.voidsetShareActions(Set<ActivityShareAction> shareActions)Sets share actions of the activity.voidsetSpaceId(String spaceId)voidsetStreamId(String sId)The uuid of the node for this stream.voidsetStreamOwner(String activitySO)Sets the stream owner, must be the remoteId of an identity.voidsetSummary(String activitySummary)Sets activity summary.voidsetTemplateParams(Map<String,String> templateParams)voidsetTitle(String title)voidsetTitleId(String titleId)voidsetType(String activityType)The type of activity, this can be used for displaying activity with different ui components.voidsetUpdated(Long updated)Set the last update datetimevoidsetUrl(String url)voidsetUserId(String userId)StringtoString()
-
-
-
Field Detail
-
ACTIVITY_METADATA_OBJECT_TYPE_PARAM
public static final String ACTIVITY_METADATA_OBJECT_TYPE_PARAM
- See Also:
- Constant Field Values
-
ACTIVITY_METADATA_OBJECT_ID_PARAM
public static final String ACTIVITY_METADATA_OBJECT_ID_PARAM
- See Also:
- Constant Field Values
-
ACTIVITY_METADATA_OBJECT_PARENT_ID_PARAM
public static final String ACTIVITY_METADATA_OBJECT_PARENT_ID_PARAM
- See Also:
- Constant Field Values
-
DEFAULT_ACTIVITY_METADATA_OBJECT_TYPE
public static final String DEFAULT_ACTIVITY_METADATA_OBJECT_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExoSocialActivityImpl
public ExoSocialActivityImpl()
constructor.
-
ExoSocialActivityImpl
public ExoSocialActivityImpl(String userId, String activityType, String activityTitle)
Instantiates a new activity based on userId, type, title.
The fieldspostedTimeandupdatedTimestampis automatically initialized.- Parameters:
userId- identity of the user who is the poster of this activityactivityType- the type of activityactivityTitle- activity title for displaying- Since:
- 1.2.0-GA
-
ExoSocialActivityImpl
public ExoSocialActivityImpl(String userId, String activityType, String activityTitle, String activityBody)
Instantiates a new activity based on userId, type, title and its body.
The fieldspostedTimeandupdatedTimestampis automatically initialized.- Parameters:
userId- the user idactivityType- the typeactivityTitle- the titleactivityBody- the body
-
ExoSocialActivityImpl
public ExoSocialActivityImpl(String userId, String activityType, String activityTitle, String activityBody, boolean isAComment)
Instantiates a new activity based on userId, type, title, its body and check activity is a comment or not.
The fieldspostedTimeandupdatedTimestampis automatically initialized.- Parameters:
userId- the user idactivityType- the typeactivityTitle- the titleactivityBody- the body
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceExoSocialActivity
-
setId
public void setId(String id)
- Specified by:
setIdin interfaceExoSocialActivity
-
getExternalId
public String getExternalId()
- Specified by:
getExternalIdin interfaceExoSocialActivity
-
setExternalId
public void setExternalId(String externalId)
- Specified by:
setExternalIdin interfaceExoSocialActivity
-
getActivityStream
public final ActivityStream getActivityStream()
Gets associated activity stream of this activity. If it's null, init its activity stream.- Specified by:
getActivityStreamin interfaceExoSocialActivity- Returns:
- the associated activity stream
-
setActivityStream
public final void setActivityStream(ActivityStream providedAS)
Sets activity stream associated with this activity.- Specified by:
setActivityStreamin interfaceExoSocialActivity- Parameters:
providedAS- the activity stream
-
isComment
public final boolean isComment()
To indicate if this a comment to an activity.- Specified by:
isCommentin interfaceExoSocialActivity- Returns:
- true if this is a comment or false
-
isComment
public final void isComment(boolean isCommentOrNot)
To indicate if this a comment to an activity.- Specified by:
isCommentin interfaceExoSocialActivity- Parameters:
isCommentOrNot- to know if this is a comment
-
getType
public final String getType()
The type of activity, this can be used for displaying activity with different ui components.- Specified by:
getTypein interfaceExoSocialActivity- Returns:
- the activity type
-
setType
public final void setType(String activityType)
The type of activity, this can be used for displaying activity with different ui components.- Specified by:
setTypein interfaceExoSocialActivity- Parameters:
activityType- the type of activity
-
getReplyToId
public String[] getReplyToId()
Gets reply to identity id.- Specified by:
getReplyToIdin interfaceExoSocialActivity- Returns:
- the reply to identity id
-
setReplyToId
public final void setReplyToId(String[] replyToIdentityId)
Sets reply to identity id.- Specified by:
setReplyToIdin interfaceExoSocialActivity- Parameters:
replyToIdentityId- the identity id
-
isHidden
public final boolean isHidden()
To know if this is a hidden activity.- Specified by:
isHiddenin interfaceExoSocialActivity- Returns:
-
isHidden
public final void isHidden(boolean isHiddenOrNot)
Sets to indicate if this is a hidden activity or not.- Specified by:
isHiddenin interfaceExoSocialActivity- Parameters:
isHiddenOrNot- true or false
-
isLocked
public final boolean isLocked()
To know if this is a locked activity.- Specified by:
isLockedin interfaceExoSocialActivity- Returns:
-
isLocked
public final void isLocked(boolean isLockedOrNot)
Sets to indicate if this is a locked activity or not.- Specified by:
isLockedin interfaceExoSocialActivity- Parameters:
isLockedOrNot- true or false
-
getLikeIdentityIds
public final String[] getLikeIdentityIds()
Gets array of identityIds who like this activity.- Specified by:
getLikeIdentityIdsin interfaceExoSocialActivity- Returns:
- array of identity ids
-
getShareActions
public final Set<ActivityShareAction> getShareActions()
Description copied from interface:ExoSocialActivityGets array of identityIds who shared this activity.- Specified by:
getShareActionsin interfaceExoSocialActivity- Returns:
- array of identityIds
-
setShareActions
public void setShareActions(Set<ActivityShareAction> shareActions)
Description copied from interface:ExoSocialActivitySets share actions of the activity.- Specified by:
setShareActionsin interfaceExoSocialActivity- Parameters:
shareActions-Setshare actions of user
-
getNumberOfLikes
public int getNumberOfLikes()
Description copied from interface:ExoSocialActivityGets number of Liker who like this activity.- Specified by:
getNumberOfLikesin interfaceExoSocialActivity- Returns:
- number of liker
-
setLikeIdentityIds
public final void setLikeIdentityIds(String[] identityIds)
Sets array of identityIds who like this activity.- Specified by:
setLikeIdentityIdsin interfaceExoSocialActivity- Parameters:
identityIds- array of identity Ids
-
getStreamOwner
public final String getStreamOwner()
Gets the stream owner, must be the remoteId of an identity.- Specified by:
getStreamOwnerin interfaceExoSocialActivity- Returns:
-
setStreamOwner
public final void setStreamOwner(String activitySO)
Sets the stream owner, must be the remoteId of an identity.- Specified by:
setStreamOwnerin interfaceExoSocialActivity- Parameters:
activitySO- the stream owner
-
getStreamId
public final String getStreamId()
The uuid of the node for this stream.- Specified by:
getStreamIdin interfaceExoSocialActivity- Returns:
- the stream uuid
-
setStreamId
public final void setStreamId(String sId)
The uuid of the node for this stream.- Specified by:
setStreamIdin interfaceExoSocialActivity- Parameters:
sId-
-
getName
public final String getName()
Gets the name; could be the name of the doc, the name of jira task or the page title.- Specified by:
getNamein interfaceExoSocialActivity- Returns:
- activity name
-
setName
public final void setName(String activityName)
Sets the name; could be the name of the doc, the name of jira task or the page title.- Specified by:
setNamein interfaceExoSocialActivity- Parameters:
activityName- the activity name
-
getTitle
public String getTitle()
- Specified by:
getTitlein interfaceExoSocialActivity
-
setTitle
public void setTitle(String title)
- Specified by:
setTitlein interfaceExoSocialActivity
-
getTitleId
public String getTitleId()
- Specified by:
getTitleIdin interfaceExoSocialActivity
-
setTitleId
public void setTitleId(String titleId)
- Specified by:
setTitleIdin interfaceExoSocialActivity
-
getSummary
public final String getSummary()
This string value provides a human readable description or summary of the activity object.- Specified by:
getSummaryin interfaceExoSocialActivity- Returns:
-
setSummary
public final void setSummary(String activitySummary)
Sets activity summary.- Specified by:
setSummaryin interfaceExoSocialActivity- Parameters:
activitySummary-
-
getBody
public String getBody()
- Specified by:
getBodyin interfaceExoSocialActivity
-
setBody
public void setBody(String body)
- Specified by:
setBodyin interfaceExoSocialActivity
-
getBodyId
public String getBodyId()
- Specified by:
getBodyIdin interfaceExoSocialActivity
-
setBodyId
public void setBodyId(String bodyId)
- Specified by:
setBodyIdin interfaceExoSocialActivity
-
getAppId
public String getAppId()
- Specified by:
getAppIdin interfaceExoSocialActivity
-
setAppId
public void setAppId(String appId)
- Specified by:
setAppIdin interfaceExoSocialActivity
-
getPostedTime
public Long getPostedTime()
- Specified by:
getPostedTimein interfaceExoSocialActivity
-
setPostedTime
public void setPostedTime(Long postedTime)
- Specified by:
setPostedTimein interfaceExoSocialActivity
-
getUrl
public String getUrl()
- Specified by:
getUrlin interfaceExoSocialActivity
-
setUrl
public void setUrl(String url)
- Specified by:
setUrlin interfaceExoSocialActivity
-
getTemplateParams
public Map<String,String> getTemplateParams()
- Specified by:
getTemplateParamsin interfaceExoSocialActivity
-
setTemplateParams
public void setTemplateParams(Map<String,String> templateParams)
- Specified by:
setTemplateParamsin interfaceExoSocialActivity
-
getPermaLink
public final String getPermaLink()
Gets the permanent link.
Could be the link to the doc, the jira task, or the link- Specified by:
getPermaLinkin interfaceExoSocialActivity- Returns:
- permalink
-
setPermanLink
public final void setPermanLink(String activityPermaLink)
Sets the permanent link. Could be the link to the doc, the jira task, or the link- Specified by:
setPermanLinkin interfaceExoSocialActivity- Parameters:
activityPermaLink-
-
getStreamFaviconUrl
public final String getStreamFaviconUrl()
- Specified by:
getStreamFaviconUrlin interfaceExoSocialActivity- Returns:
- the stream favicon url
-
getStreamSourceUrl
public final String getStreamSourceUrl()
- Specified by:
getStreamSourceUrlin interfaceExoSocialActivity- Returns:
- the stream source url
-
getStreamTitle
public final String getStreamTitle()
- Specified by:
getStreamTitlein interfaceExoSocialActivity- Returns:
- the activity stream title
-
getStreamUrl
public final String getStreamUrl()
- Specified by:
getStreamUrlin interfaceExoSocialActivity- Returns:
- the activity stream url
-
getMentionedIds
public final String[] getMentionedIds()
Gets array of identityIds who like this activity.- Specified by:
getMentionedIdsin interfaceExoSocialActivity- Returns:
- array of identity ids
-
setMentionedIds
public final void setMentionedIds(String[] identityIds)
Sets array of identityIds who like this activity.- Specified by:
setMentionedIdsin interfaceExoSocialActivity- Parameters:
identityIds- array of identity Ids
-
getCommentedIds
public final String[] getCommentedIds()
Gets array of identityIds who comment this activity.- Specified by:
getCommentedIdsin interfaceExoSocialActivity- Returns:
- array of identity ids
-
setCommentedIds
public final void setCommentedIds(String[] identityIds)
Sets array of identityIds who comment this activity.- Specified by:
setCommentedIdsin interfaceExoSocialActivity- Parameters:
identityIds- array of identity Ids
-
getUpdated
public Date getUpdated()
- Specified by:
getUpdatedin interfaceExoSocialActivity
-
getCacheTime
public long getCacheTime()
- Specified by:
getCacheTimein interfaceCacheEntry
-
setCacheTime
public void setCacheTime(long cacheTime)
- Specified by:
setCacheTimein interfaceCacheEntry
-
setUpdated
public void setUpdated(Long updated)
Set the last update datetime- Specified by:
setUpdatedin interfaceExoSocialActivity- Parameters:
updated- last update datetime
-
getPosterId
public String getPosterId()
Description copied from interface:ExoSocialActivityGets id of identity who is poster.- Specified by:
getPosterIdin interfaceExoSocialActivity- Returns:
- Id of poster.
-
setPosterId
public void setPosterId(String posterId)
Description copied from interface:ExoSocialActivitySets poster id.- Specified by:
setPosterIdin interfaceExoSocialActivity
-
getParentId
public String getParentId()
Description copied from interface:ExoSocialActivityGet id of parent activity.- Specified by:
getParentIdin interfaceExoSocialActivity- Returns:
- Id of parent activity
-
setParentId
public void setParentId(String parentId)
Description copied from interface:ExoSocialActivitySet parent activity id- Specified by:
setParentIdin interfaceExoSocialActivity
-
getParentCommentId
public String getParentCommentId()
Description copied from interface:ExoSocialActivityGet id of parent activity comment.- Specified by:
getParentCommentIdin interfaceExoSocialActivity- Returns:
- Id of parent activity
-
setParentCommentId
public void setParentCommentId(String parentCommentId)
Description copied from interface:ExoSocialActivitySet parent activity comment id- Specified by:
setParentCommentIdin interfaceExoSocialActivity
-
getFiles
public List<ActivityFile> getFiles()
Description copied from interface:ExoSocialActivityGet files of the activity.- Specified by:
getFilesin interfaceExoSocialActivity- Returns:
- Files of the activity
-
setFiles
public void setFiles(List<ActivityFile> files)
Description copied from interface:ExoSocialActivitySet activity files- Specified by:
setFilesin interfaceExoSocialActivity
-
getMetadatas
public Map<String,List<MetadataItem>> getMetadatas()
- Specified by:
getMetadatasin interfaceExoSocialActivity- Returns:
MapofMetadataItemof the activity grouped by Metadata type
-
setMetadatas
public void setMetadatas(Map<String,List<MetadataItem>> metadatas)
Description copied from interface:ExoSocialActivitySet aMapofMetadataItemof the activity grouped by Metadata type- Specified by:
setMetadatasin interfaceExoSocialActivity
-
getUserId
public String getUserId()
- Specified by:
getUserIdin interfaceExoSocialActivity
-
setUserId
public void setUserId(String userId)
- Specified by:
setUserIdin interfaceExoSocialActivity
-
getSpaceId
public String getSpaceId()
- Specified by:
getSpaceIdin interfaceExoSocialActivity
-
setSpaceId
public void setSpaceId(String spaceId)
- Specified by:
setSpaceIdin interfaceExoSocialActivity
-
getPriority
public Float getPriority()
- Specified by:
getPriorityin interfaceExoSocialActivity
-
setPriority
public void setPriority(Float priority)
- Specified by:
setPriorityin interfaceExoSocialActivity
-
getLinkedProcessedEntities
public Map<String,Object> getLinkedProcessedEntities()
- Specified by:
getLinkedProcessedEntitiesin interfaceExoSocialActivity
-
setLinkedProcessedEntities
public void setLinkedProcessedEntities(Map<String,Object> linkedProcessedEntities)
- Specified by:
setLinkedProcessedEntitiesin interfaceExoSocialActivity
-
getMetadataObjectType
public String getMetadataObjectType()
- Specified by:
getMetadataObjectTypein interfaceExoSocialActivity- Returns:
MetadataObjecttype associated to current activity
-
getMetadataObjectId
public String getMetadataObjectId()
- Specified by:
getMetadataObjectIdin interfaceExoSocialActivity- Returns:
MetadataObjectid associated to current activity
-
getMetadataObjectParentId
public String getMetadataObjectParentId()
- Specified by:
getMetadataObjectParentIdin interfaceExoSocialActivity- Returns:
MetadataObjectparentId associated to current activity
-
setMetadataObjectType
public void setMetadataObjectType(String objectType)
Description copied from interface:ExoSocialActivitySetMetadataObjecttype for current activity- Specified by:
setMetadataObjectTypein interfaceExoSocialActivity
-
setMetadataObjectId
public void setMetadataObjectId(String objectId)
Description copied from interface:ExoSocialActivitySetMetadataObjectid for current activity- Specified by:
setMetadataObjectIdin interfaceExoSocialActivity
-
setMetadataObjectParentId
public void setMetadataObjectParentId(String objectParentId)
Description copied from interface:ExoSocialActivitySetMetadataObjectparentId for current activity- Specified by:
setMetadataObjectParentIdin interfaceExoSocialActivity
-
getMetadataObject
public MetadataObject getMetadataObject()
- Specified by:
getMetadataObjectin interfaceExoSocialActivity- Returns:
MetadataObjectwith specific type and id for current activity
-
hasSpecificMetadataObject
public boolean hasSpecificMetadataObject()
- Specified by:
hasSpecificMetadataObjectin interfaceExoSocialActivity- Returns:
- true if Activity has a specific
MetadataObjecttype
-
-