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

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.PostCommentActionListener
           
static class BaseUIActivity.SetCommentListStatusActionListener
           
static class BaseUIActivity.ToggleDisplayCommentFormActionListener
           
static class BaseUIActivity.ToggleDisplayLikesActionListener
           
 
Nested classes/interfaces inherited from class org.exoplatform.webui.core.UIContainer
org.exoplatform.webui.core.UIContainer.SelectTabActionListener
 
Field Summary
 
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()
           
 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.
 String[] getDisplayedIdentityLikes()
          Removes currently viewing userId if he liked this activity.
 String[] getIdentityLikes()
           
 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.
 boolean isActivityCommentAndLikable()
           
 boolean isActivityDeletable()
           
 boolean isAllCommentsHidden()
           
 boolean isCommentDeletable(String activityUserId)
           
 boolean isCommentFormDisplayed()
           
 boolean isCommentFormFocused()
           
 boolean isLiked()
          Checks if this activity is liked by the remote user.
 boolean isLikesDisplayed()
           
 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 setAllCommentsHidden(boolean allCommentsHidden)
           
 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 setLikesDisplayed(boolean likesDisplayed)
           
 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
 

Constructor Detail

BaseUIActivity

public BaseUIActivity()
Constructor

Throws:
Exception
Method Detail

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()

setLikesDisplayed

public void setLikesDisplayed(boolean likesDisplayed)

isLikesDisplayed

public boolean isLikesDisplayed()

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

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()

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


Copyright © 2013 eXo Platform SAS. All Rights Reserved.