Class SocialRequestInterpreterLocalServiceImpl

Object
com.liferay.portal.kernel.service.BaseLocalServiceImpl
com.liferay.portlet.social.service.base.SocialRequestInterpreterLocalServiceBaseImpl
com.liferay.portlet.social.service.impl.SocialRequestInterpreterLocalServiceImpl
All Implemented Interfaces:
com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService, com.liferay.portal.kernel.service.BaseLocalService, com.liferay.social.kernel.service.SocialRequestInterpreterLocalService

public class SocialRequestInterpreterLocalServiceImpl extends SocialRequestInterpreterLocalServiceBaseImpl
The social request interpreter local service. Social request interpreters are responsible for translating social requests into human readable form as well as handling social request confirmations and rejections. This service holds a list of interpreters and provides methods to add or remove items from this list.

Social request interpreters use the language files to get text fragments based on the request's type. An interpreter is created for a specific request type and is only capable of handling requests of that type. As an example, there is an interpreter FriendsRequestInterpreter in the social networking portlet can only translate and handle interpretation, confirmation, and rejection of friend requests.

Author:
Brian Wing Shun Chan
  • Constructor Details

    • SocialRequestInterpreterLocalServiceImpl

      public SocialRequestInterpreterLocalServiceImpl()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Overrides:
      afterPropertiesSet in class SocialRequestInterpreterLocalServiceBaseImpl
    • interpret

      public com.liferay.social.kernel.model.SocialRequestFeedEntry interpret(com.liferay.social.kernel.model.SocialRequest request, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
      Creates a human readable request feed entry for the social request using an available compatible request interpreter.

      This method finds the appropriate interpreter for the request by going through the available interpreters to find one that can handle the asset type of the request.

      Parameters:
      request - the social request to be translated to human readable form
      themeDisplay - the theme display needed by interpreters to create links and get localized text fragments
      Returns:
      the social request feed entry
    • processConfirmation

      public void processConfirmation(com.liferay.social.kernel.model.SocialRequest request, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
      Processes the confirmation of the social request.

      Confirmations are handled by finding the appropriate social request interpreter and calling its processConfirmation() method. To find the appropriate interpreter this method goes through the available interpreters to find one that can handle the asset type of the request.

      Parameters:
      request - the social request being confirmed
      themeDisplay - the theme display needed by interpreters to create links and get localized text fragments
    • processRejection

      public void processRejection(com.liferay.social.kernel.model.SocialRequest request, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
      Processes the rejection of the social request.

      Rejections are handled by finding the appropriate social request interpreters and calling their processRejection() methods. To find the appropriate interpreters this method goes through the available interpreters and asks them if they can handle the asset type of the request.

      Parameters:
      request - the social request being rejected
      themeDisplay - the theme display needed by interpreters to create links and get localized text fragments
    • getSocialRequestPortletId

      protected String getSocialRequestPortletId(com.liferay.social.kernel.model.SocialRequest request)
    • matches

      protected boolean matches(com.liferay.social.kernel.model.impl.SocialRequestInterpreterImpl socialRequestInterpreterImpl, String className, com.liferay.social.kernel.model.SocialRequest request)