Class SocialActivityInterpreterLocalServiceImpl

Object
com.liferay.portal.kernel.service.BaseLocalServiceImpl
com.liferay.portlet.social.service.base.SocialActivityInterpreterLocalServiceBaseImpl
com.liferay.portlet.social.service.impl.SocialActivityInterpreterLocalServiceImpl
All Implemented Interfaces:
com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService, com.liferay.portal.kernel.service.BaseLocalService, com.liferay.social.kernel.service.SocialActivityInterpreterLocalService

public class SocialActivityInterpreterLocalServiceImpl extends SocialActivityInterpreterLocalServiceBaseImpl
The social activity interpreter local service. Activity interpreters are classes responsible for translating activity records into human readable form. This service holds a list of interpreters and provides methods to add or remove items from this list.

Activity interpreters use the language files to get text fragments based on the activity's type and the type of asset on which the activity was done. Interpreters are created for specific asset types and are only capable of translating activities done on assets of those types. As an example, there is an interpreter BlogsActivityInterpreter that can only translate activity records for blog entries.

Author:
Brian Wing Shun Chan
  • Constructor Details

    • SocialActivityInterpreterLocalServiceImpl

      public SocialActivityInterpreterLocalServiceImpl()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Overrides:
      afterPropertiesSet in class SocialActivityInterpreterLocalServiceBaseImpl
    • destroy

      public void destroy()
      Overrides:
      destroy in class SocialActivityInterpreterLocalServiceBaseImpl
    • getActivityInterpreters

      public Map<String,List<com.liferay.social.kernel.model.SocialActivityInterpreter>> getActivityInterpreters()
    • getActivityInterpreters

      public List<com.liferay.social.kernel.model.SocialActivityInterpreter> getActivityInterpreters(String selector)
    • interpret

      public com.liferay.social.kernel.model.SocialActivityFeedEntry interpret(String selector, com.liferay.social.kernel.model.SocialActivity activity, com.liferay.portal.kernel.service.ServiceContext serviceContext)
      Creates a human readable activity feed entry for the activity using an available compatible activity interpreter.

      This method finds the appropriate interpreter for the activity by going through the available interpreters and asking them if they can handle the asset type of the activity.

      Parameters:
      selector - the context in which the activity interpreter is used
      activity - the activity to be translated to human readable form
      serviceContext - the service context to be applied
      Returns:
      the activity feed that is a human readable form of the activity record or null if a compatible interpreter is not found
    • interpret

      public com.liferay.social.kernel.model.SocialActivityFeedEntry interpret(String selector, com.liferay.social.kernel.model.SocialActivitySet activitySet, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    • updateActivitySet

      public void updateActivitySet(long activityId) throws com.liferay.portal.kernel.exception.PortalException
      Throws:
      com.liferay.portal.kernel.exception.PortalException