java.lang.Object
org.exoplatform.wcm.ext.component.activity.listener.Utils

public class Utils extends Object
Created by The eXo Platform SAS Author : eXoPlatform exo@exoplatform.com Mar 18, 2011
  • Field Details

  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • getActivityType

      public static String getActivityType()
    • setActivityType

      public static void setActivityType(String activityType)
    • populateActivityData

      public static Map<String,String> populateActivityData(javax.jcr.Node node, String activityOwnerId, String activityMsgBundleKey) throws Exception
      Populate activity data with the data from Node
      Parameters:
      node - the node
      activityOwnerId - the owner id of the activity
      activityMsgBundleKey - the message bundle key of the activity
      Returns:
      Map the mapped data
      Throws:
      Exception
    • populateActivityData

      public static Map<String,String> populateActivityData(javax.jcr.Node node, String activityOwnerId, String activityMsgBundleKey, boolean isComment, String systemComment, String perm) throws Exception
      Throws:
      Exception
    • postActivity

      public static void postActivity(javax.jcr.Node node, String activityMsgBundleKey) throws Exception
      see the postActivity(Node node, String activityMsgBundleKey, Boolean isSystemComment, String systemComment, String perm)
      Throws:
      Exception
    • createShareActivity

      public static org.exoplatform.social.core.activity.model.ExoSocialActivity createShareActivity(javax.jcr.Node node, String activityMsgBundleKey, String activityType, String comments, String perm) throws Exception
      Throws:
      Exception
    • postFileActivity

      public static void postFileActivity(javax.jcr.Node node, String activityMsgBundleKey) throws Exception
      see the postFileActivity(Node node, String activityMsgBundleKey, Boolean isSystemComment, String systemComment, String perm)
      Throws:
      Exception
    • postActivity

      public static org.exoplatform.social.core.activity.model.ExoSocialActivity postActivity(javax.jcr.Node node, String activityMsgBundleKey, boolean needUpdate, boolean isSystemComment, String systemComment, String perm) throws Exception
      Parameters:
      node - : activity raised from this source
      activityMsgBundleKey -
      needUpdate -
      isSystemComment -
      systemComment - the new value of System Posted activity, if (isSystemComment) systemComment can not be set to null, set to empty string instead of.
      perm - the permission accorded for sharing file/content
      Throws:
      Exception
    • postFileActivity

      public static org.exoplatform.social.core.activity.model.ExoSocialActivity postFileActivity(javax.jcr.Node node, String activityMsgBundleKey, boolean needUpdate, boolean isComment, String systemComment, String perm) throws Exception
      Parameters:
      node - : activity raised from this source
      activityMsgBundleKey -
      isComment -
      systemComment - the new value of System Posted activity, if (isSystemComment) systemComment can not be set to null, set to empty string instead of.
      Throws:
      Exception
    • updateNotifyMessages

      public static void updateNotifyMessages(org.exoplatform.social.core.activity.model.ExoSocialActivity activity, String activityMsgBundleKey, String systemComment) throws Exception
      Throws:
      Exception
    • getActivityOwnerId

      public static String getActivityOwnerId(javax.jcr.Node node)
      get activity owner
      Returns:
      activity owner
    • getSpaceName

      public static String getSpaceName(javax.jcr.Node node) throws Exception
      get the space name of node
      Parameters:
      node -
      Returns:
      the group name
      Throws:
      Exception
    • isPublic

      public static boolean isPublic(javax.jcr.Node node)
    • getContentLink

      public static String getContentLink(javax.jcr.Node node) throws Exception
      Generate the viewer link to site explorer by node
      Parameters:
      node - the node
      Returns:
      String the viewer link
      Throws:
      javax.jcr.RepositoryException
      Exception
    • createActivity

      public static org.exoplatform.social.core.activity.model.ExoSocialActivity createActivity(org.exoplatform.social.core.manager.IdentityManager identityManager, String activityOwnerId, javax.jcr.Node node, String activityMsgBundleKey, String activityType) throws Exception
      Create ExoSocialActivity
      Parameters:
      identityManager - the identity Manager
      activityOwnerId - the remote user name
      node - the node
      activityMsgBundleKey - the message bundle key
      activityType - the activity type
      Returns:
      the ExoSocialActivity
      Throws:
      Exception - the activity storage exception
    • createActivity

      public static org.exoplatform.social.core.activity.model.ExoSocialActivity createActivity(org.exoplatform.social.core.manager.IdentityManager identityManager, String activityOwnerId, javax.jcr.Node node, String activityMsgBundleKey, String activityType, boolean isSystemComment, String systemComment, String perm) throws Exception
      Throws:
      Exception
    • deleteFileActivity

      public static void deleteFileActivity(javax.jcr.Node node) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • getIllustrativeImage

      public static String getIllustrativeImage(javax.jcr.Node node)
      Gets the illustrative image.
      Parameters:
      node - the node
      Returns:
      the illustrative image
    • generateThumbnailImageURI

      public static String generateThumbnailImageURI(javax.jcr.Node file) throws Exception
      Generate the Thumbnail Image URI.
      Parameters:
      file - the node
      Returns:
      the Thumbnail uri with medium size
      Throws:
      Exception - the exception
    • getMimeType

      public static String getMimeType(javax.jcr.Node node)
      Get the MimeType
      Parameters:
      node - the node
      Returns:
      the MimeType
    • getSummary

      public static String getSummary(javax.jcr.Node node)
    • getFirstSummaryLines

      public static String getFirstSummaryLines(String source)
    • getFirstSummaryLines

      public static String getFirstSummaryLines(String source, int linesCount)
      Parameters:
      source -
      linesCount -
      Returns:
      first linesCount without HTML tag
    • getSystemCommentTitle

      public static String[] getSystemCommentTitle(Map<String,String> activityParams)
    • getSystemCommentBundle

      public static String[] getSystemCommentBundle(Map<String,String> activityParams)
    • getBundleValue

      public static String getBundleValue(String key)
    • processMentions

      public static String processMentions(String comment)
    • setAvatarUrl

      public static void setAvatarUrl(javax.jcr.Node commentNode) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • addVersionComment

      public static String addVersionComment(javax.jcr.Node node, String commentText, String userId) throws Exception
      Throws:
      Exception