Class ActivityTypePlugin

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.social.core.ActivityTypePlugin
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

public class ActivityTypePlugin extends org.exoplatform.container.component.BaseComponentPlugin
A plugin to allow extending A new Activity Type behavior such as enabling activity/comment type notification.
  • Field Details

    • ENABLE_NOTIFICATION_PARAM

      public static final String ENABLE_NOTIFICATION_PARAM
      See Also:
    • ACTIVITY_TYPE_PARAM

      public static final String ACTIVITY_TYPE_PARAM
      See Also:
    • activityType

      protected String activityType
    • enableNotification

      protected boolean enableNotification
  • Constructor Details

    • ActivityTypePlugin

      public ActivityTypePlugin(org.exoplatform.container.xml.InitParams params)
  • Method Details

    • isActivityDeletable

      public boolean isActivityDeletable(ExoSocialActivity activity, org.exoplatform.services.security.Identity userAclIdentity)
      Return whether an activity is deletable or not
      Parameters:
      activity - ExoSocialActivity
      userAclIdentity - user Identity making the change
      Returns:
      true is user can delete activity, else false
    • isActivityEditable

      public boolean isActivityEditable(ExoSocialActivity activity, org.exoplatform.services.security.Identity userAclIdentity)
      Return whether an activity is editable or not
      Parameters:
      activity - ExoSocialActivity
      userAclIdentity - user Identity making the change
      Returns:
      true is user can edit the activity, else false
    • isEnableNotification

      public boolean isEnableNotification(ExoSocialActivity activity, String username)
      Makes a check whether the activity notification is enabled for a given user or not.
      Parameters:
      activity - ExoSocialActivity
      username - Identity remote id
      Returns:
      true if enabled, else false
    • isActivityViewable

      public boolean isActivityViewable(ExoSocialActivity activity, org.exoplatform.services.security.Identity userAclIdentity)
      Return whether an activity is viewable by a user or not
      Parameters:
      activity - ExoSocialActivity
      userAclIdentity - user Identity making the change
      Returns:
      true is user can view the activity, else false
    • getActivityTitle

      public String getActivityTitle(ExoSocialActivity activity)
      Return specific activity title
      Parameters:
      activity - ExoSocialActivity
      Returns:
      activity title to use in notification by example
    • getMetadataObjectType

      public String getMetadataObjectType()
      Return the specific Metadata Object Type that the activities of this type redirect their Metadata facts to (see ExoSocialActivity#hasSpecificMetadataObject) activities. Used to resolve Metadata items (favorites by example) attached to the specific object back to their displaying activities.
      Returns:
      the specific Metadata Object Type, or null when activities of this type hold their Metadata facts themselves (the default)
    • getActivityIds

      public List<String> getActivityIds(List<String> metadataObjectIds)
      Resolve the ids of the activities displaying the given specific Metadata objects (of type getMetadataObjectType())
      Parameters:
      metadataObjectIds - List of Metadata object ids
      Returns:
      List of corresponding activity ids, omitting objects with no resolvable activity