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.social.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.Projection; 023 import com.liferay.portal.kernel.exception.PortalException; 024 import com.liferay.portal.kernel.exception.SystemException; 025 import com.liferay.portal.kernel.model.PersistedModel; 026 import com.liferay.portal.kernel.search.Indexable; 027 import com.liferay.portal.kernel.search.IndexableType; 028 import com.liferay.portal.kernel.service.BaseLocalService; 029 import com.liferay.portal.kernel.service.PersistedModelLocalService; 030 import com.liferay.portal.kernel.transaction.Isolation; 031 import com.liferay.portal.kernel.transaction.Propagation; 032 import com.liferay.portal.kernel.transaction.Transactional; 033 import com.liferay.portal.kernel.util.OrderByComparator; 034 035 import com.liferay.social.kernel.model.SocialActivityCounterDefinition; 036 import com.liferay.social.kernel.model.SocialActivityDefinition; 037 import com.liferay.social.kernel.model.SocialActivitySetting; 038 039 import java.io.Serializable; 040 041 import java.util.List; 042 043 /** 044 * Provides the local service interface for SocialActivitySetting. Methods of this 045 * service will not have security checks based on the propagated JAAS 046 * credentials because this service can only be accessed from within the same 047 * VM. 048 * 049 * @author Brian Wing Shun Chan 050 * @see SocialActivitySettingLocalServiceUtil 051 * @see com.liferay.portlet.social.service.base.SocialActivitySettingLocalServiceBaseImpl 052 * @see com.liferay.portlet.social.service.impl.SocialActivitySettingLocalServiceImpl 053 * @generated 054 */ 055 @ProviderType 056 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 057 PortalException.class, SystemException.class}) 058 public interface SocialActivitySettingLocalService extends BaseLocalService, 059 PersistedModelLocalService { 060 /* 061 * NOTE FOR DEVELOPERS: 062 * 063 * Never modify or reference this interface directly. Always use {@link SocialActivitySettingLocalServiceUtil} to access the social activity setting local service. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivitySettingLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 064 */ 065 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 066 public boolean isEnabled(long groupId, long classNameId); 067 068 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 069 public boolean isEnabled(long groupId, long classNameId, long classPK); 070 071 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 072 public ActionableDynamicQuery getActionableDynamicQuery(); 073 074 public DynamicQuery dynamicQuery(); 075 076 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 077 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 078 079 /** 080 * @throws PortalException 081 */ 082 @Override 083 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 084 throws PortalException; 085 086 @Override 087 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 088 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 089 throws PortalException; 090 091 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 092 public SocialActivityDefinition getActivityDefinition(long groupId, 093 java.lang.String className, int activityType); 094 095 /** 096 * Adds the social activity setting to the database. Also notifies the appropriate model listeners. 097 * 098 * @param socialActivitySetting the social activity setting 099 * @return the social activity setting that was added 100 */ 101 @Indexable(type = IndexableType.REINDEX) 102 public SocialActivitySetting addSocialActivitySetting( 103 SocialActivitySetting socialActivitySetting); 104 105 /** 106 * Creates a new social activity setting with the primary key. Does not add the social activity setting to the database. 107 * 108 * @param activitySettingId the primary key for the new social activity setting 109 * @return the new social activity setting 110 */ 111 public SocialActivitySetting createSocialActivitySetting( 112 long activitySettingId); 113 114 /** 115 * Deletes the social activity setting from the database. Also notifies the appropriate model listeners. 116 * 117 * @param socialActivitySetting the social activity setting 118 * @return the social activity setting that was removed 119 */ 120 @Indexable(type = IndexableType.DELETE) 121 public SocialActivitySetting deleteSocialActivitySetting( 122 SocialActivitySetting socialActivitySetting); 123 124 /** 125 * Deletes the social activity setting with the primary key from the database. Also notifies the appropriate model listeners. 126 * 127 * @param activitySettingId the primary key of the social activity setting 128 * @return the social activity setting that was removed 129 * @throws PortalException if a social activity setting with the primary key could not be found 130 */ 131 @Indexable(type = IndexableType.DELETE) 132 public SocialActivitySetting deleteSocialActivitySetting( 133 long activitySettingId) throws PortalException; 134 135 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 136 public SocialActivitySetting fetchSocialActivitySetting( 137 long activitySettingId); 138 139 /** 140 * Returns the social activity setting with the primary key. 141 * 142 * @param activitySettingId the primary key of the social activity setting 143 * @return the social activity setting 144 * @throws PortalException if a social activity setting with the primary key could not be found 145 */ 146 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 147 public SocialActivitySetting getSocialActivitySetting( 148 long activitySettingId) throws PortalException; 149 150 /** 151 * Updates the social activity setting in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 152 * 153 * @param socialActivitySetting the social activity setting 154 * @return the social activity setting that was updated 155 */ 156 @Indexable(type = IndexableType.REINDEX) 157 public SocialActivitySetting updateSocialActivitySetting( 158 SocialActivitySetting socialActivitySetting); 159 160 /** 161 * Returns the number of social activity settings. 162 * 163 * @return the number of social activity settings 164 */ 165 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 166 public int getSocialActivitySettingsCount(); 167 168 /** 169 * Returns the OSGi service identifier. 170 * 171 * @return the OSGi service identifier 172 */ 173 public java.lang.String getOSGiServiceIdentifier(); 174 175 /** 176 * Performs a dynamic query on the database and returns the matching rows. 177 * 178 * @param dynamicQuery the dynamic query 179 * @return the matching rows 180 */ 181 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 182 183 /** 184 * Performs a dynamic query on the database and returns a range of the matching rows. 185 * 186 * <p> 187 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialActivitySettingModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 188 * </p> 189 * 190 * @param dynamicQuery the dynamic query 191 * @param start the lower bound of the range of model instances 192 * @param end the upper bound of the range of model instances (not inclusive) 193 * @return the range of matching rows 194 */ 195 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 196 int end); 197 198 /** 199 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 200 * 201 * <p> 202 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialActivitySettingModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 203 * </p> 204 * 205 * @param dynamicQuery the dynamic query 206 * @param start the lower bound of the range of model instances 207 * @param end the upper bound of the range of model instances (not inclusive) 208 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 209 * @return the ordered range of matching rows 210 */ 211 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 212 int end, OrderByComparator<T> orderByComparator); 213 214 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 215 public List<SocialActivityDefinition> getActivityDefinitions(long groupId, 216 java.lang.String className); 217 218 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 219 public List<SocialActivitySetting> getActivitySettings(long groupId); 220 221 /** 222 * Returns a range of all the social activity settings. 223 * 224 * <p> 225 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialActivitySettingModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 226 * </p> 227 * 228 * @param start the lower bound of the range of social activity settings 229 * @param end the upper bound of the range of social activity settings (not inclusive) 230 * @return the range of social activity settings 231 */ 232 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 233 public List<SocialActivitySetting> getSocialActivitySettings(int start, 234 int end); 235 236 /** 237 * Returns the number of rows matching the dynamic query. 238 * 239 * @param dynamicQuery the dynamic query 240 * @return the number of rows matching the dynamic query 241 */ 242 public long dynamicQueryCount(DynamicQuery dynamicQuery); 243 244 /** 245 * Returns the number of rows matching the dynamic query. 246 * 247 * @param dynamicQuery the dynamic query 248 * @param projection the projection to apply to the query 249 * @return the number of rows matching the dynamic query 250 */ 251 public long dynamicQueryCount(DynamicQuery dynamicQuery, 252 Projection projection); 253 254 public void deleteActivitySetting(long groupId, java.lang.String className, 255 long classPK); 256 257 public void deleteActivitySettings(long groupId); 258 259 public void updateActivitySetting(long groupId, java.lang.String className, 260 boolean enabled) throws PortalException; 261 262 public void updateActivitySetting(long groupId, java.lang.String className, 263 int activityType, 264 SocialActivityCounterDefinition activityCounterDefinition) 265 throws PortalException; 266 267 public void updateActivitySetting(long groupId, java.lang.String className, 268 long classPK, boolean enabled) throws PortalException; 269 270 public void updateActivitySettings(long groupId, 271 java.lang.String className, int activityType, 272 List<SocialActivityCounterDefinition> activityCounterDefinitions) 273 throws PortalException; 274 }