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.SocialActivitySet; 036 037 import java.io.Serializable; 038 039 import java.util.List; 040 041 /** 042 * Provides the local service interface for SocialActivitySet. Methods of this 043 * service will not have security checks based on the propagated JAAS 044 * credentials because this service can only be accessed from within the same 045 * VM. 046 * 047 * @author Brian Wing Shun Chan 048 * @see SocialActivitySetLocalServiceUtil 049 * @see com.liferay.portlet.social.service.base.SocialActivitySetLocalServiceBaseImpl 050 * @see com.liferay.portlet.social.service.impl.SocialActivitySetLocalServiceImpl 051 * @generated 052 */ 053 @ProviderType 054 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 055 PortalException.class, SystemException.class}) 056 public interface SocialActivitySetLocalService extends BaseLocalService, 057 PersistedModelLocalService { 058 /* 059 * NOTE FOR DEVELOPERS: 060 * 061 * Never modify or reference this interface directly. Always use {@link SocialActivitySetLocalServiceUtil} to access the social activity set local service. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivitySetLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 062 */ 063 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 064 public ActionableDynamicQuery getActionableDynamicQuery(); 065 066 public DynamicQuery dynamicQuery(); 067 068 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 069 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 070 071 /** 072 * @throws PortalException 073 */ 074 @Override 075 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 076 throws PortalException; 077 078 @Override 079 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 080 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 081 throws PortalException; 082 083 public SocialActivitySet addActivitySet(long activityId) 084 throws PortalException; 085 086 /** 087 * Adds the social activity set to the database. Also notifies the appropriate model listeners. 088 * 089 * @param socialActivitySet the social activity set 090 * @return the social activity set that was added 091 */ 092 @Indexable(type = IndexableType.REINDEX) 093 public SocialActivitySet addSocialActivitySet( 094 SocialActivitySet socialActivitySet); 095 096 /** 097 * Creates a new social activity set with the primary key. Does not add the social activity set to the database. 098 * 099 * @param activitySetId the primary key for the new social activity set 100 * @return the new social activity set 101 */ 102 public SocialActivitySet createSocialActivitySet(long activitySetId); 103 104 /** 105 * Deletes the social activity set from the database. Also notifies the appropriate model listeners. 106 * 107 * @param socialActivitySet the social activity set 108 * @return the social activity set that was removed 109 */ 110 @Indexable(type = IndexableType.DELETE) 111 public SocialActivitySet deleteSocialActivitySet( 112 SocialActivitySet socialActivitySet); 113 114 /** 115 * Deletes the social activity set with the primary key from the database. Also notifies the appropriate model listeners. 116 * 117 * @param activitySetId the primary key of the social activity set 118 * @return the social activity set that was removed 119 * @throws PortalException if a social activity set with the primary key could not be found 120 */ 121 @Indexable(type = IndexableType.DELETE) 122 public SocialActivitySet deleteSocialActivitySet(long activitySetId) 123 throws PortalException; 124 125 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 126 public SocialActivitySet fetchSocialActivitySet(long activitySetId); 127 128 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 129 public SocialActivitySet getClassActivitySet(long classNameId, 130 long classPK, int type); 131 132 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 133 public SocialActivitySet getClassActivitySet(long userId, long classNameId, 134 long classPK, int type); 135 136 /** 137 * Returns the social activity set with the primary key. 138 * 139 * @param activitySetId the primary key of the social activity set 140 * @return the social activity set 141 * @throws PortalException if a social activity set with the primary key could not be found 142 */ 143 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 144 public SocialActivitySet getSocialActivitySet(long activitySetId) 145 throws PortalException; 146 147 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 148 public SocialActivitySet getUserActivitySet(long groupId, long userId, 149 int type); 150 151 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 152 public SocialActivitySet getUserActivitySet(long groupId, long userId, 153 long classNameId, int type); 154 155 /** 156 * Updates the social activity set in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 157 * 158 * @param socialActivitySet the social activity set 159 * @return the social activity set that was updated 160 */ 161 @Indexable(type = IndexableType.REINDEX) 162 public SocialActivitySet updateSocialActivitySet( 163 SocialActivitySet socialActivitySet); 164 165 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 166 public int getGroupActivitySetsCount(long groupId); 167 168 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 169 public int getRelationActivitySetsCount(long userId); 170 171 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 172 public int getRelationActivitySetsCount(long userId, int type); 173 174 /** 175 * Returns the number of social activity sets. 176 * 177 * @return the number of social activity sets 178 */ 179 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 180 public int getSocialActivitySetsCount(); 181 182 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 183 public int getUserActivitySetsCount(long userId); 184 185 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 186 public int getUserGroupsActivitySetsCount(long userId); 187 188 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 189 public int getUserViewableActivitySetsCount(long userId); 190 191 /** 192 * Returns the OSGi service identifier. 193 * 194 * @return the OSGi service identifier 195 */ 196 public java.lang.String getOSGiServiceIdentifier(); 197 198 /** 199 * Performs a dynamic query on the database and returns the matching rows. 200 * 201 * @param dynamicQuery the dynamic query 202 * @return the matching rows 203 */ 204 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 205 206 /** 207 * Performs a dynamic query on the database and returns a range of the matching rows. 208 * 209 * <p> 210 * 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.SocialActivitySetModelImpl}. 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. 211 * </p> 212 * 213 * @param dynamicQuery the dynamic query 214 * @param start the lower bound of the range of model instances 215 * @param end the upper bound of the range of model instances (not inclusive) 216 * @return the range of matching rows 217 */ 218 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 219 int end); 220 221 /** 222 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 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.SocialActivitySetModelImpl}. 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 dynamicQuery the dynamic query 229 * @param start the lower bound of the range of model instances 230 * @param end the upper bound of the range of model instances (not inclusive) 231 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 232 * @return the ordered range of matching rows 233 */ 234 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 235 int end, OrderByComparator<T> orderByComparator); 236 237 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 238 public List<SocialActivitySet> getGroupActivitySets(long groupId, 239 int start, int end); 240 241 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 242 public List<SocialActivitySet> getOrganizationActivitySets( 243 long organizationId, int start, int end); 244 245 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 246 public List<SocialActivitySet> getRelationActivitySets(long userId, 247 int start, int end); 248 249 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 250 public List<SocialActivitySet> getRelationActivitySets(long userId, 251 int type, int start, int end); 252 253 /** 254 * Returns a range of all the social activity sets. 255 * 256 * <p> 257 * 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.SocialActivitySetModelImpl}. 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. 258 * </p> 259 * 260 * @param start the lower bound of the range of social activity sets 261 * @param end the upper bound of the range of social activity sets (not inclusive) 262 * @return the range of social activity sets 263 */ 264 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 265 public List<SocialActivitySet> getSocialActivitySets(int start, int end); 266 267 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 268 public List<SocialActivitySet> getUserActivitySets(long userId, int start, 269 int end); 270 271 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 272 public List<SocialActivitySet> getUserGroupsActivitySets(long userId, 273 int start, int end); 274 275 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 276 public List<SocialActivitySet> getUserViewableActivitySets(long userId, 277 int start, int end); 278 279 /** 280 * Returns the number of rows matching the dynamic query. 281 * 282 * @param dynamicQuery the dynamic query 283 * @return the number of rows matching the dynamic query 284 */ 285 public long dynamicQueryCount(DynamicQuery dynamicQuery); 286 287 /** 288 * Returns the number of rows matching the dynamic query. 289 * 290 * @param dynamicQuery the dynamic query 291 * @param projection the projection to apply to the query 292 * @return the number of rows matching the dynamic query 293 */ 294 public long dynamicQueryCount(DynamicQuery dynamicQuery, 295 Projection projection); 296 297 public void decrementActivityCount(long activitySetId) 298 throws PortalException; 299 300 public void decrementActivityCount(long classNameId, long classPK) 301 throws PortalException; 302 303 public void incrementActivityCount(long activitySetId, long activityId) 304 throws PortalException; 305 }