org.exoplatform.social.webui.activity
Class BaseUIActivity

java.lang.Object
  extended by org.exoplatform.webui.core.UIComponent
      extended by org.exoplatform.webui.core.UIContainer
          extended by org.exoplatform.webui.form.UIForm
              extended by org.exoplatform.social.webui.activity.BaseUIActivity
Direct Known Subclasses:
UIDefaultActivity, UIRelationshipActivity, UISpaceActivity, UIStatusActivity, UIUserActivitiesForRelationShip, UIUserActivitiesForSpace, UIUserProfileActivity

public class BaseUIActivity
extends org.exoplatform.webui.form.UIForm

Base UI Activity for other custom activity ui to extend for displaying.

Since:
Jul 23, 2010
Author:
Zun, hoatle (hoatlevan at gmail dot com)

Nested Class Summary
static class BaseUIActivity.CommentStatus
           
static class BaseUIActivity.DeleteActivityActionListener
           
static class BaseUIActivity.DeleteCommentActionListener
           
static class BaseUIActivity.LikeActivityActionListener
           
static class BaseUIActivity.LoadLikesActionListener
           
static class BaseUIActivity.PostCommentActionListener
           
static class BaseUIActivity.SetCommentListStatusActionListener
           
static class BaseUIActivity.ToggleDisplayCommentFormActionListener
           
 
Nested classes/interfaces inherited from class org.exoplatform.webui.core.UIContainer
org.exoplatform.webui.core.UIContainer.SelectTabActionListener
 
Field Summary
protected static int LIKES_NUM_DEFAULT
           
 
Fields inherited from class org.exoplatform.webui.form.UIForm
ACTION, SUBCOMPONENT_ID
 
Fields inherited from class org.exoplatform.webui.core.UIComponent
AJAX_ASYNC, config, OBJECTID, UICOMPONENT, uiparent
 
Constructor Summary
BaseUIActivity()
          Constructor
 
Method Summary
 boolean commentListToggleable()
           
 String event(String actionName, String callback, boolean updateForm)
           
 org.exoplatform.social.core.activity.model.ExoSocialActivity getActivity()
           
 org.exoplatform.social.common.RealtimeListAccess<org.exoplatform.social.core.activity.model.ExoSocialActivity> getActivityCommentsListAccess()
           
 List<org.exoplatform.social.core.activity.model.ExoSocialActivity> getAllComments()
           
 BaseUIActivity.CommentStatus getCommentListStatus()
           
 int getCommentMaxCharactersAllowed()
           
 int getCommentMinCharactersAllowed()
           
 List<org.exoplatform.social.core.activity.model.ExoSocialActivity> getComments()
          Gets all the comments or latest comments or empty list comments Gets latest comments for displaying at the first time if available, returns max LATEST_COMMENTS_SIZE latest comments.
 int getCurrentLoadIndex()
           
 String[] getDisplayedIdentityLikes()
          Removes currently viewing userId if he liked this activity.
protected  org.exoplatform.social.core.activity.model.ExoSocialActivity getI18N(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
          Allow child can be override this method to process I18N
 String[] getIdentityLikes()
           
 int getLoadCapacity()
           
 org.exoplatform.social.core.identity.model.Identity getOwnerIdentity()
           
 String getPostedTimeInSpaceString(org.exoplatform.webui.core.lifecycle.WebuiBindingContext resourceBundle, long postedTime)
          Gets prettyTime by timestamp of activities in space.
 String getPostedTimeString(org.exoplatform.webui.core.lifecycle.WebuiBindingContext resourceBundle, long postedTime)
          Gets prettyTime by timestamp.
 org.exoplatform.social.core.identity.model.Identity getSpaceCreatorIdentity()
           
 boolean isActivityCommentable()
           
 boolean isActivityCommentAndLikable()
           
 boolean isActivityDeletable()
           
 boolean isAllCommentsHidden()
           
 boolean isAllLoaded()
           
 boolean isCommentDeletable(String activityUserId)
           
 boolean isCommentFormDisplayed()
           
 boolean isCommentFormFocused()
           
 boolean isLiked()
          Checks if this activity is liked by the remote user.
protected  boolean isNoLongerExisting(String activityId, org.exoplatform.webui.event.Event<BaseUIActivity> event)
           
 boolean isSpaceActivity()
           
protected  boolean isSpaceStreamOwner()
          Checks stream owner is space or user.
protected  boolean isUISpaceActivitiesDisplay()
          Checks this activity is child of UISpaceActivitiesDisplay or not.
 boolean isUserActivity()
           
 void processRender(org.exoplatform.webui.application.WebuiRequestContext context)
           
protected  void refresh()
          Refresh, regets all likes, comments of this activity.
protected  void saveComment(String remoteUser, String message)
           
 void setActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
           
 void setActivityCommentsListAccess(org.exoplatform.social.common.RealtimeListAccess<org.exoplatform.social.core.activity.model.ExoSocialActivity> activityCommentsListAccess)
           
 void setAllCommentsHidden(boolean allCommentsHidden)
           
 void setAllLoaded(boolean allLoaded)
           
 void setCommentFormDisplayed(boolean commentFormDisplayed)
           
 void setCommentFormFocused(boolean commentFormFocused)
           
 void setCommentListStatus(BaseUIActivity.CommentStatus status)
           
 void setCommentMaxCharactersAllowed(int num)
           
 void setCommentMinCharactersAllowed(int num)
           
 void setIdenityLikes(String[] identityLikes)
           
protected  void setLike(boolean isLiked, String remoteUser)
           
 void setLoadCapacity(int loadCapacity)
           
 void setOwnerIdentity(org.exoplatform.social.core.identity.model.Identity ownerIdentity)
           
 
Methods inherited from class org.exoplatform.webui.form.UIForm
addUIComponentInput, addUIFormInput, addUIFormInput, begin, end, event, event, event, getActions, getLabel, getLabel, getSubmitAction, getUICheckBoxInput, getUIComponentName, getUIFormCheckBoxInput, getUIFormDateTimeInput, getUIFormInputInfo, getUIFormSelectBox, getUIFormTextAreaInput, getUIInput, getUIStringInput, invokeGetBindingBean, invokeSetBindingBean, isMultipart, renderField, renderField, reset, setActions, setMultiPart, setSubmitAction, url
 
Methods inherited from class org.exoplatform.webui.core.UIContainer
addChild, addChild, findComponentById, findComponentOfType, findFirstComponentOfType, getChild, getChild, getChildById, getChildren, hasChildren, removeChild, removeChildById, renderChild, renderChild, renderChild, renderChild, renderChildren, renderChildren, renderUIComponent, replaceChild, replaceChild, setChildren, setRenderedChild, setRenderedChild, setRenderedChildrenOfTypes
 
Methods inherited from class org.exoplatform.webui.core.UIComponent
broadcast, createEvent, createUIComponent, createUIComponent, createUIComponent, doAsync, event, getAncestorOfType, getApplicationComponent, getComponentConfig, getId, getName, getParent, getTemplate, getTemplateResourceResolver, isRendered, loadConfirmMesssage, processAction, processDecode, renderEventURL, setComponentConfig, setComponentConfig, setId, setParent, setRendered, setRenderSibling, url, url
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIKES_NUM_DEFAULT

protected static final int LIKES_NUM_DEFAULT
See Also:
Constant Field Values
Constructor Detail

BaseUIActivity

public BaseUIActivity()
Constructor

Throws:
Exception
Method Detail

getActivityCommentsListAccess

public org.exoplatform.social.common.RealtimeListAccess<org.exoplatform.social.core.activity.model.ExoSocialActivity> getActivityCommentsListAccess()

setActivityCommentsListAccess

public void setActivityCommentsListAccess(org.exoplatform.social.common.RealtimeListAccess<org.exoplatform.social.core.activity.model.ExoSocialActivity> activityCommentsListAccess)

getCurrentLoadIndex

public int getCurrentLoadIndex()

getLoadCapacity

public int getLoadCapacity()

setLoadCapacity

public void setLoadCapacity(int loadCapacity)

setActivity

public void setActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)

getActivity

public org.exoplatform.social.core.activity.model.ExoSocialActivity getActivity()

setCommentMinCharactersAllowed

public void setCommentMinCharactersAllowed(int num)

getCommentMinCharactersAllowed

public int getCommentMinCharactersAllowed()

setCommentMaxCharactersAllowed

public void setCommentMaxCharactersAllowed(int num)

getCommentMaxCharactersAllowed

public int getCommentMaxCharactersAllowed()

setCommentFormDisplayed

public void setCommentFormDisplayed(boolean commentFormDisplayed)

isCommentFormDisplayed

public boolean isCommentFormDisplayed()

isAllLoaded

public boolean isAllLoaded()

setAllLoaded

public void setAllLoaded(boolean allLoaded)

setAllCommentsHidden

public void setAllCommentsHidden(boolean allCommentsHidden)

isAllCommentsHidden

public boolean isAllCommentsHidden()

setCommentFormFocused

public void setCommentFormFocused(boolean commentFormFocused)

isCommentFormFocused

public boolean isCommentFormFocused()

setCommentListStatus

public void setCommentListStatus(BaseUIActivity.CommentStatus status)

getCommentListStatus

public BaseUIActivity.CommentStatus getCommentListStatus()

commentListToggleable

public boolean commentListToggleable()

getComments

public List<org.exoplatform.social.core.activity.model.ExoSocialActivity> getComments()
Gets all the comments or latest comments or empty list comments Gets latest comments for displaying at the first time if available, returns max LATEST_COMMENTS_SIZE latest comments.

Returns:

getAllComments

public List<org.exoplatform.social.core.activity.model.ExoSocialActivity> getAllComments()

getIdentityLikes

public String[] getIdentityLikes()

getDisplayedIdentityLikes

public String[] getDisplayedIdentityLikes()
                                   throws Exception
Removes currently viewing userId if he liked this activity.

Returns:
Throws:
Exception

setIdenityLikes

public void setIdenityLikes(String[] identityLikes)

event

public String event(String actionName,
                    String callback,
                    boolean updateForm)
             throws Exception
Throws:
Exception

getPostedTimeString

public String getPostedTimeString(org.exoplatform.webui.core.lifecycle.WebuiBindingContext resourceBundle,
                                  long postedTime)
                           throws Exception
Gets prettyTime by timestamp.

Parameters:
resourceBundle -
postedTime -
Returns:
String
Throws:
Exception

getPostedTimeInSpaceString

public String getPostedTimeInSpaceString(org.exoplatform.webui.core.lifecycle.WebuiBindingContext resourceBundle,
                                         long postedTime)
                                  throws Exception
Gets prettyTime by timestamp of activities in space.

Parameters:
resourceBundle -
postedTime -
Returns:
String
Throws:
Exception

saveComment

protected void saveComment(String remoteUser,
                           String message)
                    throws Exception
Throws:
Exception

setLike

protected void setLike(boolean isLiked,
                       String remoteUser)
                throws Exception
Throws:
Exception

isLiked

public boolean isLiked()
                throws Exception
Checks if this activity is liked by the remote user.

Returns:
Throws:
Exception

refresh

protected void refresh()
                throws org.exoplatform.social.core.storage.ActivityStorageException
Refresh, regets all likes, comments of this activity.

Throws:
org.exoplatform.social.core.storage.ActivityStorageException

isUserActivity

public boolean isUserActivity()

isSpaceActivity

public boolean isSpaceActivity()

isActivityDeletable

public boolean isActivityDeletable()
                            throws org.exoplatform.social.core.space.SpaceException
Throws:
org.exoplatform.social.core.space.SpaceException

isActivityCommentAndLikable

public boolean isActivityCommentAndLikable()
                                    throws Exception
Throws:
Exception

isActivityCommentable

public boolean isActivityCommentable()
                              throws Exception
Throws:
Exception

isCommentDeletable

public boolean isCommentDeletable(String activityUserId)
                           throws org.exoplatform.social.core.space.SpaceException
Throws:
org.exoplatform.social.core.space.SpaceException

setOwnerIdentity

public void setOwnerIdentity(org.exoplatform.social.core.identity.model.Identity ownerIdentity)

getOwnerIdentity

public org.exoplatform.social.core.identity.model.Identity getOwnerIdentity()

getSpaceCreatorIdentity

public org.exoplatform.social.core.identity.model.Identity getSpaceCreatorIdentity()

isSpaceStreamOwner

protected boolean isSpaceStreamOwner()
Checks stream owner is space or user.

Returns:
Since:
1.2.2

isUISpaceActivitiesDisplay

protected boolean isUISpaceActivitiesDisplay()
Checks this activity is child of UISpaceActivitiesDisplay or not.

Returns:
Since:
1.2.2

processRender

public void processRender(org.exoplatform.webui.application.WebuiRequestContext context)
                   throws Exception
Overrides:
processRender in class org.exoplatform.webui.form.UIForm
Throws:
Exception

isNoLongerExisting

protected boolean isNoLongerExisting(String activityId,
                                     org.exoplatform.webui.event.Event<BaseUIActivity> event)

getI18N

protected org.exoplatform.social.core.activity.model.ExoSocialActivity getI18N(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
Allow child can be override this method to process I18N

Parameters:
activity -
Returns:


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.