001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portlet.social.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the local service utility for SocialRequestInterpreter. This utility wraps 024 * {@link com.liferay.portlet.social.service.impl.SocialRequestInterpreterLocalServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on the local server. Methods of this service will not have security checks 027 * based on the propagated JAAS credentials because this service can only be 028 * accessed from within the same VM. 029 * 030 * @author Brian Wing Shun Chan 031 * @see SocialRequestInterpreterLocalService 032 * @see com.liferay.portlet.social.service.base.SocialRequestInterpreterLocalServiceBaseImpl 033 * @see com.liferay.portlet.social.service.impl.SocialRequestInterpreterLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class SocialRequestInterpreterLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialRequestInterpreterLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the social request interpreter to the list of available 046 * interpreters. 047 * 048 * @param requestInterpreter the social request interpreter 049 */ 050 public static void addRequestInterpreter( 051 com.liferay.portlet.social.model.SocialRequestInterpreter requestInterpreter) { 052 getService().addRequestInterpreter(requestInterpreter); 053 } 054 055 /** 056 * Removes the social request interpreter from the list of available 057 * interpreters. 058 * 059 * @param requestInterpreter the social request interpreter 060 */ 061 public static void deleteRequestInterpreter( 062 com.liferay.portlet.social.model.SocialRequestInterpreter requestInterpreter) { 063 getService().deleteRequestInterpreter(requestInterpreter); 064 } 065 066 /** 067 * Returns the OSGi service identifier. 068 * 069 * @return the OSGi service identifier 070 */ 071 public static java.lang.String getOSGiServiceIdentifier() { 072 return getService().getOSGiServiceIdentifier(); 073 } 074 075 /** 076 * Creates a human readable request feed entry for the social request using 077 * an available compatible request interpreter. 078 * 079 * <p> 080 * This method finds the appropriate interpreter for the request by going 081 * through the available interpreters to find one that can handle the asset 082 * type of the request. 083 * </p> 084 * 085 * @param request the social request to be translated to human readable 086 form 087 * @param themeDisplay the theme display needed by interpreters to create 088 links and get localized text fragments 089 * @return the social request feed entry 090 */ 091 public static com.liferay.portlet.social.model.SocialRequestFeedEntry interpret( 092 com.liferay.portlet.social.model.SocialRequest request, 093 com.liferay.portal.theme.ThemeDisplay themeDisplay) { 094 return getService().interpret(request, themeDisplay); 095 } 096 097 /** 098 * Processes the confirmation of the social request. 099 * 100 * <p> 101 * Confirmations are handled by finding the appropriate social request 102 * interpreter and calling its processConfirmation() method. To find the 103 * appropriate interpreter this method goes through the available 104 * interpreters to find one that can handle the asset type of the request. 105 * </p> 106 * 107 * @param request the social request being confirmed 108 * @param themeDisplay the theme display needed by interpreters to create 109 links and get localized text fragments 110 */ 111 public static void processConfirmation( 112 com.liferay.portlet.social.model.SocialRequest request, 113 com.liferay.portal.theme.ThemeDisplay themeDisplay) { 114 getService().processConfirmation(request, themeDisplay); 115 } 116 117 /** 118 * Processes the rejection of the social request. 119 * 120 * <p> 121 * Rejections are handled by finding the appropriate social request 122 * interpreters and calling their processRejection() methods. To find the 123 * appropriate interpreters this method goes through the available 124 * interpreters and asks them if they can handle the asset type of the 125 * request. 126 * </p> 127 * 128 * @param request the social request being rejected 129 * @param themeDisplay the theme display needed by interpreters to create 130 links and get localized text fragments 131 */ 132 public static void processRejection( 133 com.liferay.portlet.social.model.SocialRequest request, 134 com.liferay.portal.theme.ThemeDisplay themeDisplay) { 135 getService().processRejection(request, themeDisplay); 136 } 137 138 public static SocialRequestInterpreterLocalService getService() { 139 if (_service == null) { 140 _service = (SocialRequestInterpreterLocalService)PortalBeanLocatorUtil.locate(SocialRequestInterpreterLocalService.class.getName()); 141 142 ReferenceRegistry.registerReference(SocialRequestInterpreterLocalServiceUtil.class, 143 "_service"); 144 } 145 146 return _service; 147 } 148 149 private static SocialRequestInterpreterLocalService _service; 150 }