001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portlet.social.service; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.MethodCache; 019 import com.liferay.portal.kernel.util.ReferenceRegistry; 020 021 /** 022 * The utility for the social activity interpreter local service. This utility wraps {@link com.liferay.portlet.social.service.impl.SocialActivityInterpreterLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server. 023 * 024 * <p> 025 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 026 * </p> 027 * 028 * @author Brian Wing Shun Chan 029 * @see SocialActivityInterpreterLocalService 030 * @see com.liferay.portlet.social.service.base.SocialActivityInterpreterLocalServiceBaseImpl 031 * @see com.liferay.portlet.social.service.impl.SocialActivityInterpreterLocalServiceImpl 032 * @generated 033 */ 034 public class SocialActivityInterpreterLocalServiceUtil { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityInterpreterLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 039 */ 040 041 /** 042 * Returns the Spring bean ID for this bean. 043 * 044 * @return the Spring bean ID for this bean 045 */ 046 public static java.lang.String getBeanIdentifier() { 047 return getService().getBeanIdentifier(); 048 } 049 050 /** 051 * Sets the Spring bean ID for this bean. 052 * 053 * @param beanIdentifier the Spring bean ID for this bean 054 */ 055 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 056 getService().setBeanIdentifier(beanIdentifier); 057 } 058 059 /** 060 * Adds the activity interpreter to the list of available interpreters. 061 * 062 * @param activityInterpreter the activity interpreter 063 */ 064 public static void addActivityInterpreter( 065 com.liferay.portlet.social.model.SocialActivityInterpreter activityInterpreter) { 066 getService().addActivityInterpreter(activityInterpreter); 067 } 068 069 /** 070 * Removes the activity interpreter from the list of available 071 * interpreters. 072 * 073 * @param activityInterpreter the activity interpreter 074 */ 075 public static void deleteActivityInterpreter( 076 com.liferay.portlet.social.model.SocialActivityInterpreter activityInterpreter) { 077 getService().deleteActivityInterpreter(activityInterpreter); 078 } 079 080 /** 081 * Creates a human readable activity feed entry for the activity using an 082 * available compatible activity interpreter. 083 * 084 * <p> 085 * This method finds the appropriate interpreter for the activity by going 086 * through the available interpreters and asking them if they can handle 087 * the asset type of the activity. 088 * </p> 089 * 090 * @param activity the activity to be translated to human readable form 091 * @param themeDisplay the theme display needed by interpreters to create 092 links and get localized text fragments 093 * @return the activity feed that is a human readable form of the activity 094 record or <code>null</code> if a compatible interpreter is not 095 found 096 */ 097 public static com.liferay.portlet.social.model.SocialActivityFeedEntry interpret( 098 com.liferay.portlet.social.model.SocialActivity activity, 099 com.liferay.portal.theme.ThemeDisplay themeDisplay) { 100 return getService().interpret(activity, themeDisplay); 101 } 102 103 public static SocialActivityInterpreterLocalService getService() { 104 if (_service == null) { 105 _service = (SocialActivityInterpreterLocalService)PortalBeanLocatorUtil.locate(SocialActivityInterpreterLocalService.class.getName()); 106 107 ReferenceRegistry.registerReference(SocialActivityInterpreterLocalServiceUtil.class, 108 "_service"); 109 MethodCache.remove(SocialActivityInterpreterLocalService.class); 110 } 111 112 return _service; 113 } 114 115 public void setService(SocialActivityInterpreterLocalService service) { 116 MethodCache.remove(SocialActivityInterpreterLocalService.class); 117 118 _service = service; 119 120 ReferenceRegistry.registerReference(SocialActivityInterpreterLocalServiceUtil.class, 121 "_service"); 122 MethodCache.remove(SocialActivityInterpreterLocalService.class); 123 } 124 125 private static SocialActivityInterpreterLocalService _service; 126 }