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.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.search.Indexable; 026 import com.liferay.portal.kernel.search.IndexableType; 027 import com.liferay.portal.kernel.transaction.Isolation; 028 import com.liferay.portal.kernel.transaction.Propagation; 029 import com.liferay.portal.kernel.transaction.Transactional; 030 import com.liferay.portal.kernel.util.OrderByComparator; 031 import com.liferay.portal.model.PersistedModel; 032 import com.liferay.portal.service.BaseLocalService; 033 import com.liferay.portal.service.PersistedModelLocalService; 034 035 import com.liferay.portlet.social.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 public SocialActivitySet addActivitySet(long activityId) 064 throws PortalException; 065 066 /** 067 * Adds the social activity set to the database. Also notifies the appropriate model listeners. 068 * 069 * @param socialActivitySet the social activity set 070 * @return the social activity set that was added 071 */ 072 @Indexable(type = IndexableType.REINDEX) 073 public SocialActivitySet addSocialActivitySet( 074 SocialActivitySet socialActivitySet); 075 076 /** 077 * Creates a new social activity set with the primary key. Does not add the social activity set to the database. 078 * 079 * @param activitySetId the primary key for the new social activity set 080 * @return the new social activity set 081 */ 082 public SocialActivitySet createSocialActivitySet(long activitySetId); 083 084 public void decrementActivityCount(long activitySetId) 085 throws PortalException; 086 087 public void decrementActivityCount(long classNameId, long classPK) 088 throws PortalException; 089 090 /** 091 * @throws PortalException 092 */ 093 @Override 094 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 095 throws PortalException; 096 097 /** 098 * Deletes the social activity set with the primary key from the database. Also notifies the appropriate model listeners. 099 * 100 * @param activitySetId the primary key of the social activity set 101 * @return the social activity set that was removed 102 * @throws PortalException if a social activity set with the primary key could not be found 103 */ 104 @Indexable(type = IndexableType.DELETE) 105 public SocialActivitySet deleteSocialActivitySet(long activitySetId) 106 throws PortalException; 107 108 /** 109 * Deletes the social activity set from the database. Also notifies the appropriate model listeners. 110 * 111 * @param socialActivitySet the social activity set 112 * @return the social activity set that was removed 113 */ 114 @Indexable(type = IndexableType.DELETE) 115 public SocialActivitySet deleteSocialActivitySet( 116 SocialActivitySet socialActivitySet); 117 118 public DynamicQuery dynamicQuery(); 119 120 /** 121 * Performs a dynamic query on the database and returns the matching rows. 122 * 123 * @param dynamicQuery the dynamic query 124 * @return the matching rows 125 */ 126 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 127 128 /** 129 * Performs a dynamic query on the database and returns a range of the matching rows. 130 * 131 * <p> 132 * 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. 133 * </p> 134 * 135 * @param dynamicQuery the dynamic query 136 * @param start the lower bound of the range of model instances 137 * @param end the upper bound of the range of model instances (not inclusive) 138 * @return the range of matching rows 139 */ 140 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 141 int end); 142 143 /** 144 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 145 * 146 * <p> 147 * 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. 148 * </p> 149 * 150 * @param dynamicQuery the dynamic query 151 * @param start the lower bound of the range of model instances 152 * @param end the upper bound of the range of model instances (not inclusive) 153 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 154 * @return the ordered range of matching rows 155 */ 156 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 157 int end, OrderByComparator<T> orderByComparator); 158 159 /** 160 * Returns the number of rows matching the dynamic query. 161 * 162 * @param dynamicQuery the dynamic query 163 * @return the number of rows matching the dynamic query 164 */ 165 public long dynamicQueryCount(DynamicQuery dynamicQuery); 166 167 /** 168 * Returns the number of rows matching the dynamic query. 169 * 170 * @param dynamicQuery the dynamic query 171 * @param projection the projection to apply to the query 172 * @return the number of rows matching the dynamic query 173 */ 174 public long dynamicQueryCount(DynamicQuery dynamicQuery, 175 Projection projection); 176 177 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 178 public SocialActivitySet fetchSocialActivitySet(long activitySetId); 179 180 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 181 public ActionableDynamicQuery getActionableDynamicQuery(); 182 183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 184 public SocialActivitySet getClassActivitySet(long classNameId, 185 long classPK, int type); 186 187 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 188 public SocialActivitySet getClassActivitySet(long userId, long classNameId, 189 long classPK, int type); 190 191 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 192 public List<SocialActivitySet> getGroupActivitySets(long groupId, 193 int start, int end); 194 195 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 196 public int getGroupActivitySetsCount(long groupId); 197 198 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 199 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 200 201 /** 202 * Returns the OSGi service identifier. 203 * 204 * @return the OSGi service identifier 205 */ 206 public java.lang.String getOSGiServiceIdentifier(); 207 208 @Override 209 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 210 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 211 throws PortalException; 212 213 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 214 public List<SocialActivitySet> getRelationActivitySets(long userId, 215 int start, int end); 216 217 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 218 public List<SocialActivitySet> getRelationActivitySets(long userId, 219 int type, int start, int end); 220 221 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 222 public int getRelationActivitySetsCount(long userId); 223 224 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 225 public int getRelationActivitySetsCount(long userId, int type); 226 227 /** 228 * Returns the social activity set with the primary key. 229 * 230 * @param activitySetId the primary key of the social activity set 231 * @return the social activity set 232 * @throws PortalException if a social activity set with the primary key could not be found 233 */ 234 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 235 public SocialActivitySet getSocialActivitySet(long activitySetId) 236 throws PortalException; 237 238 /** 239 * Returns a range of all the social activity sets. 240 * 241 * <p> 242 * 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. 243 * </p> 244 * 245 * @param start the lower bound of the range of social activity sets 246 * @param end the upper bound of the range of social activity sets (not inclusive) 247 * @return the range of social activity sets 248 */ 249 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 250 public List<SocialActivitySet> getSocialActivitySets(int start, int end); 251 252 /** 253 * Returns the number of social activity sets. 254 * 255 * @return the number of social activity sets 256 */ 257 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 258 public int getSocialActivitySetsCount(); 259 260 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 261 public SocialActivitySet getUserActivitySet(long groupId, long userId, 262 long classNameId, int type); 263 264 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 265 public SocialActivitySet getUserActivitySet(long groupId, long userId, 266 int type); 267 268 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 269 public List<SocialActivitySet> getUserActivitySets(long userId, int start, 270 int end); 271 272 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 273 public int getUserActivitySetsCount(long userId); 274 275 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 276 public List<SocialActivitySet> getUserGroupsActivitySets(long userId, 277 int start, int end); 278 279 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 280 public int getUserGroupsActivitySetsCount(long userId); 281 282 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 283 public List<SocialActivitySet> getUserViewableActivitySets(long userId, 284 int start, int end); 285 286 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 287 public int getUserViewableActivitySetsCount(long userId); 288 289 public void incrementActivityCount(long activitySetId, long activityId) 290 throws PortalException; 291 292 /** 293 * Updates the social activity set in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 294 * 295 * @param socialActivitySet the social activity set 296 * @return the social activity set that was updated 297 */ 298 @Indexable(type = IndexableType.REINDEX) 299 public SocialActivitySet updateSocialActivitySet( 300 SocialActivitySet socialActivitySet); 301 }