public class SocialRequestInterpreterLocalServiceImpl extends SocialRequestInterpreterLocalServiceBaseImpl
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.
counterLocalService, socialRequestInterpreterLocalService
Constructor and Description |
---|
SocialRequestInterpreterLocalServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addRequestInterpreter(com.liferay.social.kernel.model.SocialRequestInterpreter requestInterpreter)
Adds the social request interpreter to the list of available
interpreters.
|
void |
afterPropertiesSet() |
void |
deleteRequestInterpreter(com.liferay.social.kernel.model.SocialRequestInterpreter requestInterpreter)
Removes the social request interpreter from the list of available
interpreters.
|
protected String |
getSocialRequestPortletId(com.liferay.social.kernel.model.SocialRequest request) |
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.
|
protected boolean |
matches(com.liferay.social.kernel.model.impl.SocialRequestInterpreterImpl requestInterpreter,
String className,
com.liferay.social.kernel.model.SocialRequest request) |
void |
processConfirmation(com.liferay.social.kernel.model.SocialRequest request,
com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
Processes the confirmation of the social request.
|
void |
processRejection(com.liferay.social.kernel.model.SocialRequest request,
com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
Processes the rejection of the social request.
|
destroy, getCounterLocalService, getOSGiServiceIdentifier, getSocialRequestInterpreterLocalService, runSQL, setCounterLocalService, setSocialRequestInterpreterLocalService
public SocialRequestInterpreterLocalServiceImpl()
public void addRequestInterpreter(com.liferay.social.kernel.model.SocialRequestInterpreter requestInterpreter)
requestInterpreter
- the social request interpreterpublic void afterPropertiesSet()
afterPropertiesSet
in class SocialRequestInterpreterLocalServiceBaseImpl
public void deleteRequestInterpreter(com.liferay.social.kernel.model.SocialRequestInterpreter requestInterpreter)
requestInterpreter
- the social request interpreterpublic com.liferay.social.kernel.model.SocialRequestFeedEntry interpret(com.liferay.social.kernel.model.SocialRequest request, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
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.
request
- the social request to be translated to human readable
formthemeDisplay
- the theme display needed by interpreters to create
links and get localized text fragmentspublic void processConfirmation(com.liferay.social.kernel.model.SocialRequest request, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
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.
request
- the social request being confirmedthemeDisplay
- the theme display needed by interpreters to create
links and get localized text fragmentspublic void processRejection(com.liferay.social.kernel.model.SocialRequest request, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
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.
request
- the social request being rejectedthemeDisplay
- the theme display needed by interpreters to create
links and get localized text fragmentsprotected String getSocialRequestPortletId(com.liferay.social.kernel.model.SocialRequest request)
protected boolean matches(com.liferay.social.kernel.model.impl.SocialRequestInterpreterImpl requestInterpreter, String className, com.liferay.social.kernel.model.SocialRequest request)