Liferay 6.1.2-ce-ga3

com.liferay.portlet.social.service.impl
Class SocialRequestInterpreterLocalServiceImpl

java.lang.Object
  extended by com.liferay.portal.service.BaseLocalServiceImpl
      extended by com.liferay.portlet.social.service.base.SocialRequestInterpreterLocalServiceBaseImpl
          extended by com.liferay.portlet.social.service.impl.SocialRequestInterpreterLocalServiceImpl
All Implemented Interfaces:
IdentifiableBean, BaseLocalService, 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.


Field Summary
 
Fields inherited from class com.liferay.portlet.social.service.base.SocialRequestInterpreterLocalServiceBaseImpl
counterLocalService, resourceFinder, resourceLocalService, resourcePersistence, resourceService, socialActivityAchievementLocalService, socialActivityAchievementPersistence, socialActivityCounterFinder, socialActivityCounterLocalService, socialActivityCounterPersistence, socialActivityFinder, socialActivityInterpreterLocalService, socialActivityLimitLocalService, socialActivityLimitPersistence, socialActivityLocalService, socialActivityPersistence, socialActivitySettingLocalService, socialActivitySettingPersistence, socialActivitySettingService, socialRelationLocalService, socialRelationPersistence, socialRequestInterpreterLocalService, socialRequestLocalService, socialRequestPersistence, userFinder, userLocalService, userPersistence, userService
 
Constructor Summary
SocialRequestInterpreterLocalServiceImpl()
           
 
Method Summary
 void addRequestInterpreter(SocialRequestInterpreter requestInterpreter)
          Adds the social request interpreter to the list of available interpreters.
 void deleteRequestInterpreter(SocialRequestInterpreter requestInterpreter)
          Removes the social request interpreter from the list of available interpreters.
 SocialRequestFeedEntry interpret(SocialRequest request, ThemeDisplay themeDisplay)
          Creates a human readable request feed entry for the social request using an available compatible request interpreter.
 void processConfirmation(SocialRequest request, ThemeDisplay themeDisplay)
          Processes the confirmation of the social request.
 void processRejection(SocialRequest request, ThemeDisplay themeDisplay)
          Processes the rejection of the social request.
 
Methods inherited from class com.liferay.portlet.social.service.base.SocialRequestInterpreterLocalServiceBaseImpl
afterPropertiesSet, destroy, getBeanIdentifier, getCounterLocalService, getResourceFinder, getResourceLocalService, getResourcePersistence, getResourceService, getSocialActivityAchievementLocalService, getSocialActivityAchievementPersistence, getSocialActivityCounterFinder, getSocialActivityCounterLocalService, getSocialActivityCounterPersistence, getSocialActivityFinder, getSocialActivityInterpreterLocalService, getSocialActivityLimitLocalService, getSocialActivityLimitPersistence, getSocialActivityLocalService, getSocialActivityPersistence, getSocialActivitySettingLocalService, getSocialActivitySettingPersistence, getSocialActivitySettingService, getSocialRelationLocalService, getSocialRelationPersistence, getSocialRequestInterpreterLocalService, getSocialRequestLocalService, getSocialRequestPersistence, getUserFinder, getUserLocalService, getUserPersistence, getUserService, runSQL, setBeanIdentifier, setCounterLocalService, setResourceFinder, setResourceLocalService, setResourcePersistence, setResourceService, setSocialActivityAchievementLocalService, setSocialActivityAchievementPersistence, setSocialActivityCounterFinder, setSocialActivityCounterLocalService, setSocialActivityCounterPersistence, setSocialActivityFinder, setSocialActivityInterpreterLocalService, setSocialActivityLimitLocalService, setSocialActivityLimitPersistence, setSocialActivityLocalService, setSocialActivityPersistence, setSocialActivitySettingLocalService, setSocialActivitySettingPersistence, setSocialActivitySettingService, setSocialRelationLocalService, setSocialRelationPersistence, setSocialRequestInterpreterLocalService, setSocialRequestLocalService, setSocialRequestPersistence, setUserFinder, setUserLocalService, setUserPersistence, setUserService
 
Methods inherited from class com.liferay.portal.service.BaseLocalServiceImpl
getClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocialRequestInterpreterLocalServiceImpl

public SocialRequestInterpreterLocalServiceImpl()
Method Detail

addRequestInterpreter

public void addRequestInterpreter(SocialRequestInterpreter requestInterpreter)
Adds the social request interpreter to the list of available interpreters.

Parameters:
requestInterpreter - the social request interpreter

deleteRequestInterpreter

public void deleteRequestInterpreter(SocialRequestInterpreter requestInterpreter)
Removes the social request interpreter from the list of available interpreters.

Parameters:
requestInterpreter - the social request interpreter

interpret

public SocialRequestFeedEntry interpret(SocialRequest request,
                                        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(SocialRequest request,
                                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(SocialRequest request,
                             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

Liferay 6.1.2-ce-ga3