001 /** 002 * Copyright (c) 2000-2012 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 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 interpreters. 071 * 072 * @param activityInterpreter the activity interpreter 073 */ 074 public static void deleteActivityInterpreter( 075 com.liferay.portlet.social.model.SocialActivityInterpreter activityInterpreter) { 076 getService().deleteActivityInterpreter(activityInterpreter); 077 } 078 079 /** 080 * Creates a human readable activity feed entry for the activity using an 081 * available compatible activity interpreter. 082 * 083 * <p> 084 * This method finds the appropriate interpreter for the activity by going 085 * through the available interpreters and asking them if they can handle the 086 * asset type of the activity. 087 * </p> 088 * 089 * @param activity the activity to be translated to human readable form 090 * @param themeDisplay the theme display needed by interpreters to create 091 links and get localized text fragments 092 * @return the activity feed that is a human readable form of the activity 093 record or <code>null</code> if a compatible interpreter is not 094 found 095 */ 096 public static com.liferay.portlet.social.model.SocialActivityFeedEntry interpret( 097 com.liferay.portlet.social.model.SocialActivity activity, 098 com.liferay.portal.theme.ThemeDisplay themeDisplay) { 099 return getService().interpret(activity, themeDisplay); 100 } 101 102 public static SocialActivityInterpreterLocalService getService() { 103 if (_service == null) { 104 _service = (SocialActivityInterpreterLocalService)PortalBeanLocatorUtil.locate(SocialActivityInterpreterLocalService.class.getName()); 105 106 ReferenceRegistry.registerReference(SocialActivityInterpreterLocalServiceUtil.class, 107 "_service"); 108 MethodCache.remove(SocialActivityInterpreterLocalService.class); 109 } 110 111 return _service; 112 } 113 114 public void setService(SocialActivityInterpreterLocalService service) { 115 MethodCache.remove(SocialActivityInterpreterLocalService.class); 116 117 _service = service; 118 119 ReferenceRegistry.registerReference(SocialActivityInterpreterLocalServiceUtil.class, 120 "_service"); 121 MethodCache.remove(SocialActivityInterpreterLocalService.class); 122 } 123 124 private static SocialActivityInterpreterLocalService _service; 125 }