org.exoplatform.wcm.ext.component.activity.listener
Class Utils

java.lang.Object
  extended by 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


Constructor Summary
Utils()
           
 
Method Summary
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)
          Create ExoSocialActivity
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)
           
static void deleteFileActivity(javax.jcr.Node node)
           
static String generateThumbnailImageURI(javax.jcr.Node file)
          Generate the Thumbnail Image URI.
static String getContentLink(javax.jcr.Node node)
          Generate the viewer link to site explorer by node
static String getFirstSummaryLines(String source)
           
static String getFirstSummaryLines(String source, int linesCount)
           
static String getIllustrativeImage(javax.jcr.Node node)
          Gets the illustrative image.
static String getMimeType(javax.jcr.Node node)
          Get the MimeType
static String getSummary(javax.jcr.Node node)
           
static Map<String,String> populateActivityData(javax.jcr.Node node, String activityOwnerId, String activityMsgBundleKey)
          Populate activity data with the data from Node
static Map<String,String> populateActivityData(javax.jcr.Node node, String activityOwnerId, String activityMsgBundleKey, boolean isSystemComment, String systemComment)
           
static void postActivity(javax.jcr.Node node, String activityMsgBundleKey)
           
static org.exoplatform.social.core.activity.model.ExoSocialActivity postActivity(javax.jcr.Node node, String activityMsgBundleKey, boolean needUpdate, boolean isSystemComment, String systemComment)
           
static void postFileActivity(javax.jcr.Node node, String activityMsgBundleKey)
           
static org.exoplatform.social.core.activity.model.ExoSocialActivity postFileActivity(javax.jcr.Node node, String activityMsgBundleKey, boolean needUpdate, boolean isSystemComment, String systemComment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

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
String - the message 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 isSystemComment,
                                                      String systemComment)
                                               throws Exception
Throws:
Exception

postActivity

public static void postActivity(javax.jcr.Node node,
                                String activityMsgBundleKey)
                         throws Exception
Throws:
Exception

postFileActivity

public static void postFileActivity(javax.jcr.Node node,
                                    String activityMsgBundleKey)
                             throws Exception
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)
                                                                                 throws Exception
Parameters:
node - : activity raised from this source
activityMsgBundleKey -
isSystemComment -
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

postFileActivity

public static org.exoplatform.social.core.activity.model.ExoSocialActivity postFileActivity(javax.jcr.Node node,
                                                                                            String activityMsgBundleKey,
                                                                                            boolean needUpdate,
                                                                                            boolean isSystemComment,
                                                                                            String systemComment)
                                                                                     throws Exception
Parameters:
node - : activity raised from this source
activityMsgBundleKey -
isSystemComment -
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

getContentLink

public static String getContentLink(javax.jcr.Node node)
                             throws javax.jcr.RepositoryException
Generate the viewer link to site explorer by node

Parameters:
Node - the node
Returns:
String the viewer link
Throws:
javax.jcr.RepositoryException

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
String - the remote user name
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)
                                                                                   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:
node - 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)


Copyright © 2013 eXo Platform SAS. All Rights Reserved.