Class ExoSocialActivityImpl
java.lang.Object
org.exoplatform.social.core.activity.model.ExoSocialActivityImpl
- All Implemented Interfaces:
ExoSocialActivity,CacheEntry
Implementation of
ExoSocialActivity.- Since:
- 1.2.0-GA
- Author:
- hoatle (hoatlevan at gmail dot com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.exoplatform.social.core.activity.model.ExoSocialActivity
IS_COMMENT -
Constructor Summary
ConstructorsConstructorDescriptionconstructor.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
Modifier and TypeMethodDescriptionbooleanfinal ActivityStreamGets associated activity stream of this activity.getAppId()getBody()longfinal String[]Gets array of identityIds who comment this activity.getFiles()Get files of the activity.getId()final String[]Gets array of identityIds who like this activity.final String[]Gets array of identityIds who like this activity.final StringgetName()Gets the name; could be the name of the doc, the name of jira task or the page title.intGets number of Liker who like this activity.Get id of parent activity comment.Get id of parent activity.final StringGets the permanent link.Gets the Id of the identity that pinned the activity.Gets the pin datetime.*Gets id of identity who is poster.String[]Gets reply to identity id.final Set<ActivityShareAction> Gets array of identityIds who shared this activity.final Stringfinal StringThe uuid of the node for this stream.final StringGets the stream owner, must be the remoteId of an identity.final Stringfinal Stringfinal Stringfinal StringThis string value provides a human readable description or summary of the activity object.getTitle()final StringgetType()The type of activity, this can be used for displaying activity with different ui components.getUrl()inthashCode()booleanfinal booleanTo indicate if this a comment to an activity.final voidisComment(boolean isCommentOrNot) To indicate if this a comment to an activity.final booleanisHidden()To know if this is a hidden activity.final voidisHidden(boolean isHiddenOrNot) Sets to indicate if this is a hidden activity or not.final booleanisLocked()To know if this is a locked activity.final voidisLocked(boolean isLockedOrNot) Sets to indicate if this is a locked activity or not.booleanisPinned()To know if this is a pinned activity.final voidsetActivityStream(ActivityStream providedAS) Sets activity stream associated with this activity.voidvoidvoidvoidsetCacheTime(long cacheTime) final voidsetCommentedIds(String[] identityIds) Sets array of identityIds who comment this activity.voidsetExternalId(String externalId) voidsetFiles(List<ActivityFile> files) Set activity filesvoidfinal voidsetLikeIdentityIds(String[] identityIds) Sets array of identityIds who like this activity.voidsetLinkedProcessedEntities(Map<String, Object> linkedProcessedEntities) final 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 typefinal voidSets 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 idfinal voidsetPermanLink(String activityPermaLink) Sets the permanent link.voidsetPinAuthorId(Long pinAuthorId) Sets the Id of the identity that pinned the activity.voidsetPinDate(String pinDate) Set the pin datetimevoidsetPinned(boolean pinned) Sets to indicate if this is a pinned activity or not.voidsetPostedTime(Long postedTime) voidsetPosterId(String posterId) Sets poster id.voidsetPriority(Float priority) final voidsetReplyToId(String[] replyToIdentityId) Sets reply to identity id.voidsetShareActions(Set<ActivityShareAction> shareActions) Sets share actions of the activity.voidsetSpaceId(String spaceId) final voidsetStreamId(String sId) The uuid of the node for this stream.final voidsetStreamOwner(String activitySO) Sets the stream owner, must be the remoteId of an identity.final voidsetSummary(String activitySummary) Sets activity summary.voidsetTemplateParams(Map<String, String> templateParams) voidvoidsetTitleId(String titleId) final voidThe type of activity, this can be used for displaying activity with different ui components.voidsetUpdated(Long updated) Set the last update datetimevoidvoidtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.exoplatform.social.core.activity.model.ExoSocialActivity
getCategoryIds, setCategoryIds
-
Field Details
-
ACTIVITY_METADATA_OBJECT_TYPE_PARAM
- See Also:
-
ACTIVITY_METADATA_OBJECT_ID_PARAM
- See Also:
-
ACTIVITY_METADATA_OBJECT_PARENT_ID_PARAM
- See Also:
-
DEFAULT_ACTIVITY_METADATA_OBJECT_TYPE
- See Also:
-
-
Constructor Details
-
ExoSocialActivityImpl
public ExoSocialActivityImpl()constructor. -
ExoSocialActivityImpl
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 Details
-
getId
- Specified by:
getIdin interfaceExoSocialActivity
-
setId
- Specified by:
setIdin interfaceExoSocialActivity
-
getExternalId
- Specified by:
getExternalIdin interfaceExoSocialActivity
-
setExternalId
- Specified by:
setExternalIdin interfaceExoSocialActivity
-
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
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
The type of activity, this can be used for displaying activity with different ui components.- Specified by:
getTypein interfaceExoSocialActivity- Returns:
- the activity type
-
setType
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
Gets reply to identity id.- Specified by:
getReplyToIdin interfaceExoSocialActivity- Returns:
- the reply to identity id
-
setReplyToId
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
-
isPinned
public boolean isPinned()To know if this is a pinned activity.- Specified by:
isPinnedin interfaceExoSocialActivity- Returns:
- true or false
-
setPinned
public void setPinned(boolean pinned) Sets to indicate if this is a pinned activity or not.- Specified by:
setPinnedin interfaceExoSocialActivity- Parameters:
pinned- true or false
-
getPinDate
Gets the pin datetime.*- Specified by:
getPinDatein interfaceExoSocialActivity
-
setPinDate
Set the pin datetime- Specified by:
setPinDatein interfaceExoSocialActivity- Parameters:
pinDate- pin datetime
-
getPinAuthorId
Gets the Id of the identity that pinned the activity.- Specified by:
getPinAuthorIdin interfaceExoSocialActivity- Returns:
- Id of the identity that pinned the activity.
-
setPinAuthorId
Sets the Id of the identity that pinned the activity.- Specified by:
setPinAuthorIdin interfaceExoSocialActivity
-
getLikeIdentityIds
Gets array of identityIds who like this activity.- Specified by:
getLikeIdentityIdsin interfaceExoSocialActivity- Returns:
- array of identity ids
-
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
Sets array of identityIds who like this activity.- Specified by:
setLikeIdentityIdsin interfaceExoSocialActivity- Parameters:
identityIds- array of identity Ids
-
getStreamOwner
Gets the stream owner, must be the remoteId of an identity.- Specified by:
getStreamOwnerin interfaceExoSocialActivity- Returns:
-
setStreamOwner
Sets the stream owner, must be the remoteId of an identity.- Specified by:
setStreamOwnerin interfaceExoSocialActivity- Parameters:
activitySO- the stream owner
-
getStreamId
The uuid of the node for this stream.- Specified by:
getStreamIdin interfaceExoSocialActivity- Returns:
- the stream uuid
-
setStreamId
The uuid of the node for this stream.- Specified by:
setStreamIdin interfaceExoSocialActivity- Parameters:
sId-
-
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
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
- Specified by:
getTitlein interfaceExoSocialActivity
-
setTitle
- Specified by:
setTitlein interfaceExoSocialActivity
-
getTitleId
- Specified by:
getTitleIdin interfaceExoSocialActivity
-
setTitleId
- Specified by:
setTitleIdin interfaceExoSocialActivity
-
getSummary
This string value provides a human readable description or summary of the activity object.- Specified by:
getSummaryin interfaceExoSocialActivity- Returns:
-
setSummary
Sets activity summary.- Specified by:
setSummaryin interfaceExoSocialActivity- Parameters:
activitySummary-
-
getBody
- Specified by:
getBodyin interfaceExoSocialActivity
-
setBody
- Specified by:
setBodyin interfaceExoSocialActivity
-
getBodyId
- Specified by:
getBodyIdin interfaceExoSocialActivity
-
setBodyId
- Specified by:
setBodyIdin interfaceExoSocialActivity
-
getAppId
- Specified by:
getAppIdin interfaceExoSocialActivity
-
setAppId
- Specified by:
setAppIdin interfaceExoSocialActivity
-
getPostedTime
- Specified by:
getPostedTimein interfaceExoSocialActivity
-
setPostedTime
- Specified by:
setPostedTimein interfaceExoSocialActivity
-
getUrl
- Specified by:
getUrlin interfaceExoSocialActivity
-
setUrl
- Specified by:
setUrlin interfaceExoSocialActivity
-
getTemplateParams
- Specified by:
getTemplateParamsin interfaceExoSocialActivity
-
setTemplateParams
- Specified by:
setTemplateParamsin interfaceExoSocialActivity
-
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
Sets the permanent link. Could be the link to the doc, the jira task, or the link- Specified by:
setPermanLinkin interfaceExoSocialActivity- Parameters:
activityPermaLink-
-
getStreamFaviconUrl
- Specified by:
getStreamFaviconUrlin interfaceExoSocialActivity- Returns:
- the stream favicon url
-
getStreamSourceUrl
- Specified by:
getStreamSourceUrlin interfaceExoSocialActivity- Returns:
- the stream source url
-
getStreamTitle
- Specified by:
getStreamTitlein interfaceExoSocialActivity- Returns:
- the activity stream title
-
getStreamUrl
- Specified by:
getStreamUrlin interfaceExoSocialActivity- Returns:
- the activity stream url
-
getMentionedIds
Gets array of identityIds who like this activity.- Specified by:
getMentionedIdsin interfaceExoSocialActivity- Returns:
- array of identity ids
-
setMentionedIds
Sets array of identityIds who like this activity.- Specified by:
setMentionedIdsin interfaceExoSocialActivity- Parameters:
identityIds- array of identity Ids
-
getCommentedIds
Gets array of identityIds who comment this activity.- Specified by:
getCommentedIdsin interfaceExoSocialActivity- Returns:
- array of identity ids
-
setCommentedIds
Sets array of identityIds who comment this activity.- Specified by:
setCommentedIdsin interfaceExoSocialActivity- Parameters:
identityIds- array of identity Ids
-
getUpdated
- Specified by:
getUpdatedin interfaceExoSocialActivity
-
getCacheTime
public long getCacheTime()- Specified by:
getCacheTimein interfaceCacheEntry
-
setCacheTime
public void setCacheTime(long cacheTime) - Specified by:
setCacheTimein interfaceCacheEntry
-
setUpdated
Set the last update datetime- Specified by:
setUpdatedin interfaceExoSocialActivity- Parameters:
updated- last update datetime
-
getPosterId
Description copied from interface:ExoSocialActivityGets id of identity who is poster.- Specified by:
getPosterIdin interfaceExoSocialActivity- Returns:
- Id of poster.
-
setPosterId
Description copied from interface:ExoSocialActivitySets poster id.- Specified by:
setPosterIdin interfaceExoSocialActivity- Parameters:
posterId-
-
getParentId
Description copied from interface:ExoSocialActivityGet id of parent activity.- Specified by:
getParentIdin interfaceExoSocialActivity- Returns:
- Id of parent activity
-
setParentId
Description copied from interface:ExoSocialActivitySet parent activity id- Specified by:
setParentIdin interfaceExoSocialActivity- Parameters:
parentId-
-
getParentCommentId
Description copied from interface:ExoSocialActivityGet id of parent activity comment.- Specified by:
getParentCommentIdin interfaceExoSocialActivity- Returns:
- Id of parent activity
-
setParentCommentId
Description copied from interface:ExoSocialActivitySet parent activity comment id- Specified by:
setParentCommentIdin interfaceExoSocialActivity- Parameters:
parentCommentId-
-
getFiles
Description copied from interface:ExoSocialActivityGet files of the activity.- Specified by:
getFilesin interfaceExoSocialActivity- Returns:
- Files of the activity
-
setFiles
Description copied from interface:ExoSocialActivitySet activity files- Specified by:
setFilesin interfaceExoSocialActivity- Parameters:
files-
-
getMetadatas
- Specified by:
getMetadatasin interfaceExoSocialActivity- Returns:
MapofMetadataItemof the activity grouped by Metadata type
-
setMetadatas
Description copied from interface:ExoSocialActivitySet aMapofMetadataItemof the activity grouped by Metadata type- Specified by:
setMetadatasin interfaceExoSocialActivity- Parameters:
metadatas-
-
getUserId
- Specified by:
getUserIdin interfaceExoSocialActivity
-
setUserId
- Specified by:
setUserIdin interfaceExoSocialActivity
-
getSpaceId
- Specified by:
getSpaceIdin interfaceExoSocialActivity
-
setSpaceId
- Specified by:
setSpaceIdin interfaceExoSocialActivity
-
getPriority
- Specified by:
getPriorityin interfaceExoSocialActivity
-
setPriority
- Specified by:
setPriorityin interfaceExoSocialActivity
-
getLinkedProcessedEntities
- Specified by:
getLinkedProcessedEntitiesin interfaceExoSocialActivity
-
setLinkedProcessedEntities
- Specified by:
setLinkedProcessedEntitiesin interfaceExoSocialActivity
-
getMetadataObjectType
- Specified by:
getMetadataObjectTypein interfaceExoSocialActivity- Returns:
MetadataObjecttype associated to current activity
-
getMetadataObjectId
- Specified by:
getMetadataObjectIdin interfaceExoSocialActivity- Returns:
MetadataObjectid associated to current activity
-
getMetadataObjectParentId
- Specified by:
getMetadataObjectParentIdin interfaceExoSocialActivity- Returns:
MetadataObjectparentId associated to current activity
-
setMetadataObjectType
Description copied from interface:ExoSocialActivitySetMetadataObjecttype for current activity- Specified by:
setMetadataObjectTypein interfaceExoSocialActivity- Parameters:
objectType-
-
setMetadataObjectId
Description copied from interface:ExoSocialActivitySetMetadataObjectid for current activity- Specified by:
setMetadataObjectIdin interfaceExoSocialActivity- Parameters:
objectId-
-
setMetadataObjectParentId
Description copied from interface:ExoSocialActivitySetMetadataObjectparentId for current activity- Specified by:
setMetadataObjectParentIdin interfaceExoSocialActivity- Parameters:
objectParentId-
-
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
-
toString
-
equals
-
hashCode
public int hashCode()
-