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.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.search.IndexableType;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    import com.liferay.portal.service.BaseLocalService;
026    import com.liferay.portal.service.PersistedModelLocalService;
027    
028    /**
029     * Provides the local service interface for SocialActivity. Methods of this
030     * service will not have security checks based on the propagated JAAS
031     * credentials because this service can only be accessed from within the same
032     * VM.
033     *
034     * @author Brian Wing Shun Chan
035     * @see SocialActivityLocalServiceUtil
036     * @see com.liferay.portlet.social.service.base.SocialActivityLocalServiceBaseImpl
037     * @see com.liferay.portlet.social.service.impl.SocialActivityLocalServiceImpl
038     * @generated
039     */
040    @ProviderType
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface SocialActivityLocalService extends BaseLocalService,
044            PersistedModelLocalService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * Never modify or reference this interface directly. Always use {@link SocialActivityLocalServiceUtil} to access the social activity local service. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
049             */
050            @com.liferay.portal.kernel.messaging.async.Async
051            public void addActivity(
052                    com.liferay.portlet.social.model.SocialActivity activity,
053                    com.liferay.portlet.social.model.SocialActivity mirrorActivity)
054                    throws com.liferay.portal.kernel.exception.PortalException;
055    
056            /**
057            * Records an activity in the database, using a time based on the current
058            * time in an attempt to make the activity's time unique.
059            *
060            * @param userId the primary key of the acting user
061            * @param groupId the primary key of the group
062            * @param className the target asset's class name
063            * @param classPK the primary key of the target asset
064            * @param type the activity's type
065            * @param extraData any extra data regarding the activity
066            * @param receiverUserId the primary key of the receiving user
067            * @throws PortalException if the user or group could not be found
068            */
069            public void addActivity(long userId, long groupId,
070                    java.lang.String className, long classPK, int type,
071                    java.lang.String extraData, long receiverUserId)
072                    throws com.liferay.portal.kernel.exception.PortalException;
073    
074            /**
075            * Records an activity with the given time in the database.
076            *
077            * <p>
078            * This method records a social activity done on an asset, identified by its
079            * class name and class primary key, in the database. Additional information
080            * (such as the original message ID for a reply to a forum post) is passed
081            * in via the <code>extraData</code> in JSON format. For activities
082            * affecting another user, a mirror activity is generated that describes the
083            * action from the user's point of view. The target user's ID is passed in
084            * via the <code>receiverUserId</code>.
085            * </p>
086            *
087            * <p>
088            * Example for a mirrored activity:<br> When a user replies to a message
089            * boards post, the reply action is stored in the database with the
090            * <code>receiverUserId</code> being the ID of the author of the original
091            * message. The <code>extraData</code> contains the ID of the original
092            * message in JSON format. A mirror activity is generated with the values of
093            * the <code>userId</code> and the <code>receiverUserId</code> swapped. This
094            * mirror activity basically describes a "replied to" event.
095            * </p>
096            *
097            * <p>
098            * Mirror activities are most often used in relation to friend requests and
099            * activities.
100            * </p>
101            *
102            * @param userId the primary key of the acting user
103            * @param groupId the primary key of the group
104            * @param createDate the activity's date
105            * @param className the target asset's class name
106            * @param classPK the primary key of the target asset
107            * @param type the activity's type
108            * @param extraData any extra data regarding the activity
109            * @param receiverUserId the primary key of the receiving user
110            * @throws PortalException if the user or group could not be found
111            */
112            public void addActivity(long userId, long groupId,
113                    java.util.Date createDate, java.lang.String className, long classPK,
114                    int type, java.lang.String extraData, long receiverUserId)
115                    throws com.liferay.portal.kernel.exception.PortalException;
116    
117            /**
118            * Adds the social activity to the database. Also notifies the appropriate model listeners.
119            *
120            * @param socialActivity the social activity
121            * @return the social activity that was added
122            */
123            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
124            public com.liferay.portlet.social.model.SocialActivity addSocialActivity(
125                    com.liferay.portlet.social.model.SocialActivity socialActivity);
126    
127            /**
128            * Records an activity with the current time in the database, but only if
129            * there isn't one with the same parameters.
130            *
131            * <p>
132            * For the main functionality see {@link #addActivity(long, long, Date,
133            * String, long, int, String, long)}
134            * </p>
135            *
136            * @param userId the primary key of the acting user
137            * @param groupId the primary key of the group
138            * @param className the target asset's class name
139            * @param classPK the primary key of the target asset
140            * @param type the activity's type
141            * @param extraData any extra data regarding the activity
142            * @param receiverUserId the primary key of the receiving user
143            * @throws PortalException if the user or group could not be found
144            */
145            public void addUniqueActivity(long userId, long groupId,
146                    java.lang.String className, long classPK, int type,
147                    java.lang.String extraData, long receiverUserId)
148                    throws com.liferay.portal.kernel.exception.PortalException;
149    
150            /**
151            * Records an activity in the database, but only if there isn't already an
152            * activity with the same parameters.
153            *
154            * <p>
155            * For the main functionality see {@link #addActivity(long, long, Date,
156            * String, long, int, String, long)}
157            * </p>
158            *
159            * @param userId the primary key of the acting user
160            * @param groupId the primary key of the group
161            * @param createDate the activity's date
162            * @param className the target asset's class name
163            * @param classPK the primary key of the target asset
164            * @param type the activity's type
165            * @param extraData any extra data regarding the activity
166            * @param receiverUserId the primary key of the receiving user
167            * @throws PortalException if the user or group could not be found
168            */
169            public void addUniqueActivity(long userId, long groupId,
170                    java.util.Date createDate, java.lang.String className, long classPK,
171                    int type, java.lang.String extraData, long receiverUserId)
172                    throws com.liferay.portal.kernel.exception.PortalException;
173    
174            /**
175            * Creates a new social activity with the primary key. Does not add the social activity to the database.
176            *
177            * @param activityId the primary key for the new social activity
178            * @return the new social activity
179            */
180            public com.liferay.portlet.social.model.SocialActivity createSocialActivity(
181                    long activityId);
182    
183            /**
184            * Removes stored activities for the asset.
185            *
186            * @param assetEntry the asset from which to remove stored activities
187            * @throws PortalException if a portal exception occurred
188            */
189            public void deleteActivities(
190                    com.liferay.portlet.asset.model.AssetEntry assetEntry)
191                    throws com.liferay.portal.kernel.exception.PortalException;
192    
193            /**
194            * Removes stored activities for the asset identified by the class name and
195            * class primary key.
196            *
197            * @param className the target asset's class name
198            * @param classPK the primary key of the target asset
199            * @throws PortalException if the user's activity counters could not be
200            deleted
201            */
202            public void deleteActivities(java.lang.String className, long classPK)
203                    throws com.liferay.portal.kernel.exception.PortalException;
204    
205            public void deleteActivities(long groupId);
206    
207            /**
208            * Removes the stored activity and its mirror activity from the database.
209            *
210            * @param activity the activity to be removed
211            * @throws PortalException if the user's activity counters could not be
212            deleted or if a portal exception occurred
213            */
214            public void deleteActivity(
215                    com.liferay.portlet.social.model.SocialActivity activity)
216                    throws com.liferay.portal.kernel.exception.PortalException;
217    
218            /**
219            * Removes the stored activity from the database.
220            *
221            * @param activityId the primary key of the stored activity
222            * @throws PortalException if the activity could not be found
223            */
224            public void deleteActivity(long activityId)
225                    throws com.liferay.portal.kernel.exception.PortalException;
226    
227            /**
228            * @throws PortalException
229            */
230            @Override
231            public com.liferay.portal.model.PersistedModel deletePersistedModel(
232                    com.liferay.portal.model.PersistedModel persistedModel)
233                    throws com.liferay.portal.kernel.exception.PortalException;
234    
235            /**
236            * Deletes the social activity with the primary key from the database. Also notifies the appropriate model listeners.
237            *
238            * @param activityId the primary key of the social activity
239            * @return the social activity that was removed
240            * @throws PortalException if a social activity with the primary key could not be found
241            */
242            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
243            public com.liferay.portlet.social.model.SocialActivity deleteSocialActivity(
244                    long activityId)
245                    throws com.liferay.portal.kernel.exception.PortalException;
246    
247            /**
248            * Deletes the social activity from the database. Also notifies the appropriate model listeners.
249            *
250            * @param socialActivity the social activity
251            * @return the social activity that was removed
252            */
253            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
254            public com.liferay.portlet.social.model.SocialActivity deleteSocialActivity(
255                    com.liferay.portlet.social.model.SocialActivity socialActivity);
256    
257            /**
258            * Removes the user's stored activities from the database.
259            *
260            * <p>
261            * This method removes all activities where the user is either the actor or
262            * the receiver.
263            * </p>
264            *
265            * @param userId the primary key of the user
266            * @throws PortalException if the user's activity counters could not be
267            deleted
268            */
269            public void deleteUserActivities(long userId)
270                    throws com.liferay.portal.kernel.exception.PortalException;
271    
272            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
273    
274            /**
275            * Performs a dynamic query on the database and returns the matching rows.
276            *
277            * @param dynamicQuery the dynamic query
278            * @return the matching rows
279            */
280            public <T> java.util.List<T> dynamicQuery(
281                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
282    
283            /**
284            * Performs a dynamic query on the database and returns a range of the matching rows.
285            *
286            * <p>
287            * 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.SocialActivityModelImpl}. 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.
288            * </p>
289            *
290            * @param dynamicQuery the dynamic query
291            * @param start the lower bound of the range of model instances
292            * @param end the upper bound of the range of model instances (not inclusive)
293            * @return the range of matching rows
294            */
295            public <T> java.util.List<T> dynamicQuery(
296                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
297                    int end);
298    
299            /**
300            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
301            *
302            * <p>
303            * 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.SocialActivityModelImpl}. 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.
304            * </p>
305            *
306            * @param dynamicQuery the dynamic query
307            * @param start the lower bound of the range of model instances
308            * @param end the upper bound of the range of model instances (not inclusive)
309            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
310            * @return the ordered range of matching rows
311            */
312            public <T> java.util.List<T> dynamicQuery(
313                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
314                    int end,
315                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
316    
317            /**
318            * Returns the number of rows matching the dynamic query.
319            *
320            * @param dynamicQuery the dynamic query
321            * @return the number of rows matching the dynamic query
322            */
323            public long dynamicQueryCount(
324                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
325    
326            /**
327            * Returns the number of rows matching the dynamic query.
328            *
329            * @param dynamicQuery the dynamic query
330            * @param projection the projection to apply to the query
331            * @return the number of rows matching the dynamic query
332            */
333            public long dynamicQueryCount(
334                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
335                    com.liferay.portal.kernel.dao.orm.Projection projection);
336    
337            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
338            public com.liferay.portlet.social.model.SocialActivity fetchFirstActivity(
339                    java.lang.String className, long classPK, int type);
340    
341            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
342            public com.liferay.portlet.social.model.SocialActivity fetchSocialActivity(
343                    long activityId);
344    
345            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
346            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
347    
348            /**
349            * Returns a range of all the activities done on assets identified by the
350            * class name.
351            *
352            * <p>
353            * Useful when paginating results. Returns a maximum of <code>end -
354            * start</code> instances. <code>start</code> and <code>end</code> are not
355            * primary keys, they are indexes in the result set. Thus, <code>0</code>
356            * refers to the first result in the set. Setting both <code>start</code>
357            * and <code>end</code> to {@link
358            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
359            * result set.
360            * </p>
361            *
362            * @param className the target asset's class name
363            * @param start the lower bound of the range of results
364            * @param end the upper bound of the range of results (not inclusive)
365            * @return the range of matching activities
366            */
367            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
368            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
369                    java.lang.String className, int start, int end);
370    
371            /**
372            * Returns a range of all the activities done on assets identified by the
373            * class name ID.
374            *
375            * <p>
376            * Useful when paginating results. Returns a maximum of <code>end -
377            * start</code> instances. <code>start</code> and <code>end</code> are not
378            * primary keys, they are indexes in the result set. Thus, <code>0</code>
379            * refers to the first result in the set. Setting both <code>start</code>
380            * and <code>end</code> to {@link
381            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
382            * result set.
383            * </p>
384            *
385            * @param classNameId the target asset's class name ID
386            * @param start the lower bound of the range of results
387            * @param end the upper bound of the range of results (not inclusive)
388            * @return the range of matching activities
389            */
390            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
391            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
392                    long classNameId, int start, int end);
393    
394            /**
395            * Returns a range of all the activities done on the asset identified by the
396            * class name and the class primary key that are mirrors of the activity
397            * identified by the mirror activity ID.
398            *
399            * <p>
400            * Useful when paginating results. Returns a maximum of <code>end -
401            * start</code> instances. <code>start</code> and <code>end</code> are not
402            * primary keys, they are indexes in the result set. Thus, <code>0</code>
403            * refers to the first result in the set. Setting both <code>start</code>
404            * and <code>end</code> to {@link
405            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
406            * result set.
407            * </p>
408            *
409            * @param mirrorActivityId the primary key of the mirror activity
410            * @param className the target asset's class name
411            * @param classPK the primary key of the target asset
412            * @param start the lower bound of the range of results
413            * @param end the upper bound of the range of results (not inclusive)
414            * @return the range of matching activities
415            */
416            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
417            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
418                    long mirrorActivityId, java.lang.String className, long classPK,
419                    int start, int end);
420    
421            /**
422            * Returns a range of all the activities done on the asset identified by the
423            * class name ID and class primary key that are mirrors of the activity
424            * identified by the mirror activity ID.
425            *
426            * <p>
427            * Useful when paginating results. Returns a maximum of <code>end -
428            * start</code> instances. <code>start</code> and <code>end</code> are not
429            * primary keys, they are indexes in the result set. Thus, <code>0</code>
430            * refers to the first result in the set. Setting both <code>start</code>
431            * and <code>end</code> to {@link
432            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
433            * result set.
434            * </p>
435            *
436            * @param mirrorActivityId the primary key of the mirror activity
437            * @param classNameId the target asset's class name ID
438            * @param classPK the primary key of the target asset
439            * @param start the lower bound of the range of results
440            * @param end the upper bound of the range of results (not inclusive)
441            * @return the range of matching activities
442            */
443            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
444            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
445                    long mirrorActivityId, long classNameId, long classPK, int start,
446                    int end);
447    
448            /**
449            * Returns the number of activities done on assets identified by class name.
450            *
451            * @param className the target asset's class name
452            * @return the number of matching activities
453            */
454            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
455            public int getActivitiesCount(java.lang.String className);
456    
457            /**
458            * Returns the number of activities done on assets identified by the class
459            * name ID.
460            *
461            * @param classNameId the target asset's class name ID
462            * @return the number of matching activities
463            */
464            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
465            public int getActivitiesCount(long classNameId);
466    
467            /**
468            * Returns the number of activities done on the asset identified by the
469            * class name and class primary key that are mirrors of the activity
470            * identified by the mirror activity ID.
471            *
472            * @param mirrorActivityId the primary key of the mirror activity
473            * @param className the target asset's class name
474            * @param classPK the primary key of the target asset
475            * @return the number of matching activities
476            */
477            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
478            public int getActivitiesCount(long mirrorActivityId,
479                    java.lang.String className, long classPK);
480    
481            /**
482            * Returns the number of activities done on the asset identified by the
483            * class name ID and class primary key that are mirrors of the activity
484            * identified by the mirror activity ID.
485            *
486            * @param mirrorActivityId the primary key of the mirror activity
487            * @param classNameId the target asset's class name ID
488            * @param classPK the primary key of the target asset
489            * @return the number of matching activities
490            */
491            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
492            public int getActivitiesCount(long mirrorActivityId, long classNameId,
493                    long classPK);
494    
495            /**
496            * Returns the activity identified by its primary key.
497            *
498            * @param activityId the primary key of the activity
499            * @return Returns the activity
500            * @throws PortalException if the activity could not be found
501            */
502            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
503            public com.liferay.portlet.social.model.SocialActivity getActivity(
504                    long activityId)
505                    throws com.liferay.portal.kernel.exception.PortalException;
506    
507            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
508            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivitySetActivities(
509                    long activitySetId, int start, int end);
510    
511            /**
512            * Returns the Spring bean ID for this bean.
513            *
514            * @return the Spring bean ID for this bean
515            */
516            public java.lang.String getBeanIdentifier();
517    
518            /**
519            * Returns a range of all the activities done in the group.
520            *
521            * <p>
522            * This method only finds activities without mirrors.
523            * </p>
524            *
525            * <p>
526            * Useful when paginating results. Returns a maximum of <code>end -
527            * start</code> instances. <code>start</code> and <code>end</code> are not
528            * primary keys, they are indexes in the result set. Thus, <code>0</code>
529            * refers to the first result in the set. Setting both <code>start</code>
530            * and <code>end</code> to {@link
531            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
532            * result set.
533            * </p>
534            *
535            * @param groupId the primary key of the group
536            * @param start the lower bound of the range of results
537            * @param end the upper bound of the range of results (not inclusive)
538            * @return the range of matching activities
539            */
540            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
541            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getGroupActivities(
542                    long groupId, int start, int end);
543    
544            /**
545            * Returns the number of activities done in the group.
546            *
547            * <p>
548            * This method only counts activities without mirrors.
549            * </p>
550            *
551            * @param groupId the primary key of the group
552            * @return the number of matching activities
553            */
554            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
555            public int getGroupActivitiesCount(long groupId);
556    
557            /**
558            * Returns a range of activities done by users that are members of the
559            * group.
560            *
561            * <p>
562            * This method only finds activities without mirrors.
563            * </p>
564            *
565            * <p>
566            * Useful when paginating results. Returns a maximum of <code>end -
567            * start</code> instances. <code>start</code> and <code>end</code> are not
568            * primary keys, they are indexes in the result set. Thus, <code>0</code>
569            * refers to the first result in the set. Setting both <code>start</code>
570            * and <code>end</code> to {@link
571            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
572            * result set.
573            * </p>
574            *
575            * @param groupId the primary key of the group
576            * @param start the lower bound of the range of results
577            * @param end the upper bound of the range of results (not inclusive)
578            * @return the range of matching activities
579            */
580            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
581            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getGroupUsersActivities(
582                    long groupId, int start, int end);
583    
584            /**
585            * Returns the number of activities done by users that are members of the
586            * group.
587            *
588            * <p>
589            * This method only counts activities without mirrors.
590            * </p>
591            *
592            * @param groupId the primary key of the group
593            * @return the number of matching activities
594            */
595            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
596            public int getGroupUsersActivitiesCount(long groupId);
597    
598            /**
599            * Returns the activity that has the mirror activity.
600            *
601            * @param mirrorActivityId the primary key of the mirror activity
602            * @return Returns the mirror activity
603            * @throws PortalException if the mirror activity could not be found
604            */
605            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
606            public com.liferay.portlet.social.model.SocialActivity getMirrorActivity(
607                    long mirrorActivityId)
608                    throws com.liferay.portal.kernel.exception.PortalException;
609    
610            /**
611            * Returns a range of all the activities done in the organization. This
612            * method only finds activities without mirrors.
613            *
614            * <p>
615            * Useful when paginating results. Returns a maximum of <code>end -
616            * start</code> instances. <code>start</code> and <code>end</code> are not
617            * primary keys, they are indexes in the result set. Thus, <code>0</code>
618            * refers to the first result in the set. Setting both <code>start</code>
619            * and <code>end</code> to {@link
620            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
621            * result set.
622            * </p>
623            *
624            * @param organizationId the primary key of the organization
625            * @param start the lower bound of the range of results
626            * @param end the upper bound of the range of results (not inclusive)
627            * @return the range of matching activities
628            */
629            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
630            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getOrganizationActivities(
631                    long organizationId, int start, int end);
632    
633            /**
634            * Returns the number of activities done in the organization. This method
635            * only counts activities without mirrors.
636            *
637            * @param organizationId the primary key of the organization
638            * @return the number of matching activities
639            */
640            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
641            public int getOrganizationActivitiesCount(long organizationId);
642    
643            /**
644            * Returns a range of all the activities done by users of the organization.
645            * This method only finds activities without mirrors.
646            *
647            * <p>
648            * Useful when paginating results. Returns a maximum of <code>end -
649            * start</code> instances. <code>start</code> and <code>end</code> are not
650            * primary keys, they are indexes in the result set. Thus, <code>0</code>
651            * refers to the first result in the set. Setting both <code>start</code>
652            * and <code>end</code> to {@link
653            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
654            * result set.
655            * </p>
656            *
657            * @param organizationId the primary key of the organization
658            * @param start the lower bound of the range of results
659            * @param end the upper bound of the range of results (not inclusive)
660            * @return the range of matching activities
661            */
662            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
663            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getOrganizationUsersActivities(
664                    long organizationId, int start, int end);
665    
666            /**
667            * Returns the number of activities done by users of the organization. This
668            * method only counts activities without mirrors.
669            *
670            * @param organizationId the primary key of the organization
671            * @return the number of matching activities
672            */
673            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
674            public int getOrganizationUsersActivitiesCount(long organizationId);
675    
676            @Override
677            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
678            public com.liferay.portal.model.PersistedModel getPersistedModel(
679                    java.io.Serializable primaryKeyObj)
680                    throws com.liferay.portal.kernel.exception.PortalException;
681    
682            /**
683            * Returns a range of all the activities done by users in a relationship
684            * with the user identified by the user ID.
685            *
686            * <p>
687            * Useful when paginating results. Returns a maximum of <code>end -
688            * start</code> instances. <code>start</code> and <code>end</code> are not
689            * primary keys, they are indexes in the result set. Thus, <>0</code> refers
690            * to the first result in the set. Setting both <code>start</code> and
691            * <code>end</code> to {@link
692            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
693            * result set.
694            * </p>
695            *
696            * @param userId the primary key of the user
697            * @param start the lower bound of the range of results
698            * @param end the upper bound of the range of results (not inclusive)
699            * @return the range of matching activities
700            */
701            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
702            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getRelationActivities(
703                    long userId, int start, int end);
704    
705            /**
706            * Returns a range of all the activities done by users in a relationship of
707            * type <code>type</code> with the user identified by <code>userId</code>.
708            * This method only finds activities without mirrors.
709            *
710            * <p>
711            * Useful when paginating results. Returns a maximum of <code>end -
712            * start</code> instances. <code>start</code> and <code>end</code> are not
713            * primary keys, they are indexes in the result set. Thus, <code>0</code>
714            * refers to the first result in the set. Setting both <code>start</code>
715            * and <code>end</code> to {@link
716            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
717            * result set.
718            * </p>
719            *
720            * @param userId the primary key of the user
721            * @param type the relationship type
722            * @param start the lower bound of the range of results
723            * @param end the upper bound of the range of results (not inclusive)
724            * @return the range of matching activities
725            */
726            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
727            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getRelationActivities(
728                    long userId, int type, int start, int end);
729    
730            /**
731            * Returns the number of activities done by users in a relationship with the
732            * user identified by userId.
733            *
734            * @param userId the primary key of the user
735            * @return the number of matching activities
736            */
737            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
738            public int getRelationActivitiesCount(long userId);
739    
740            /**
741            * Returns the number of activities done by users in a relationship of type
742            * <code>type</code> with the user identified by <code>userId</code>. This
743            * method only counts activities without mirrors.
744            *
745            * @param userId the primary key of the user
746            * @param type the relationship type
747            * @return the number of matching activities
748            */
749            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
750            public int getRelationActivitiesCount(long userId, int type);
751    
752            /**
753            * Returns a range of all the social activities.
754            *
755            * <p>
756            * 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.SocialActivityModelImpl}. 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.
757            * </p>
758            *
759            * @param start the lower bound of the range of social activities
760            * @param end the upper bound of the range of social activities (not inclusive)
761            * @return the range of social activities
762            */
763            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
764            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getSocialActivities(
765                    int start, int end);
766    
767            /**
768            * Returns the number of social activities.
769            *
770            * @return the number of social activities
771            */
772            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
773            public int getSocialActivitiesCount();
774    
775            /**
776            * Returns the social activity with the primary key.
777            *
778            * @param activityId the primary key of the social activity
779            * @return the social activity
780            * @throws PortalException if a social activity with the primary key could not be found
781            */
782            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
783            public com.liferay.portlet.social.model.SocialActivity getSocialActivity(
784                    long activityId)
785                    throws com.liferay.portal.kernel.exception.PortalException;
786    
787            /**
788            * Returns a range of all the activities done by the user.
789            *
790            * <p>
791            * Useful when paginating results. Returns a maximum of <code>end -
792            * start</code> instances. <code>start</code> and <code>end</code> are not
793            * primary keys, they are indexes in the result set. Thus, <code>0</code>
794            * refers to the first result in the set. Setting both <code>start</code>
795            * and <code>end</code> to {@link
796            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
797            * result set.
798            * </p>
799            *
800            * @param userId the primary key of the user
801            * @param start the lower bound of the range of results
802            * @param end the upper bound of the range of results (not inclusive)
803            * @return the range of matching activities
804            */
805            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
806            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserActivities(
807                    long userId, int start, int end);
808    
809            /**
810            * Returns the number of activities done by the user.
811            *
812            * @param userId the primary key of the user
813            * @return the number of matching activities
814            */
815            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
816            public int getUserActivitiesCount(long userId);
817    
818            /**
819            * Returns a range of all the activities done in the user's groups. This
820            * method only finds activities without mirrors.
821            *
822            * <p>
823            * Useful when paginating results. Returns a maximum of <code>end -
824            * start</code> instances. <code>start</code> and <code>end</code> are not
825            * primary keys, they are indexes in the result set. Thus, <code>0</code>
826            * refers to the first result in the set. Setting both <code>start</code>
827            * and <code>end</code> to {@link
828            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
829            * result set.
830            * </p>
831            *
832            * @param userId the primary key of the user
833            * @param start the lower bound of the range of results
834            * @param end the upper bound of the range of results (not inclusive)
835            * @return the range of matching activities
836            */
837            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
838            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserGroupsActivities(
839                    long userId, int start, int end);
840    
841            /**
842            * Returns the number of activities done in user's groups. This method only
843            * counts activities without mirrors.
844            *
845            * @param userId the primary key of the user
846            * @return the number of matching activities
847            */
848            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
849            public int getUserGroupsActivitiesCount(long userId);
850    
851            /**
852            * Returns a range of all the activities done in the user's groups and
853            * organizations. This method only finds activities without mirrors.
854            *
855            * <p>
856            * Useful when paginating results. Returns a maximum of <code>end -
857            * start</code> instances. <code>start</code> and <code>end</code> are not
858            * primary keys, they are indexes in the result set. Thus, <code>0</code>
859            * refers to the first result in the set. Setting both <code>start</code>
860            * and <code>end</code> to {@link
861            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
862            * result set.
863            * </p>
864            *
865            * @param userId the primary key of the user
866            * @param start the lower bound of the range of results
867            * @param end the upper bound of the range of results (not inclusive)
868            * @return the range of matching activities
869            */
870            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
871            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserGroupsAndOrganizationsActivities(
872                    long userId, int start, int end);
873    
874            /**
875            * Returns the number of activities done in user's groups and organizations.
876            * This method only counts activities without mirrors.
877            *
878            * @param userId the primary key of the user
879            * @return the number of matching activities
880            */
881            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
882            public int getUserGroupsAndOrganizationsActivitiesCount(long userId);
883    
884            /**
885            * Returns a range of all activities done in the user's organizations. This
886            * method only finds activities without mirrors.
887            *
888            * <p>
889            * Useful when paginating results. Returns a maximum of <code>end -
890            * start</code> instances. <code>start</code> and <code>end</code> are not
891            * primary keys, they are indexes in the result set. Thus, <code>0</code>
892            * refers to the first result in the set. Setting both <code>start</code>
893            * and <code>end</code> to {@link
894            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
895            * result set.
896            * </p>
897            *
898            * @param userId the primary key of the user
899            * @param start the lower bound of the range of results
900            * @param end the upper bound of the range of results (not inclusive)
901            * @return the range of matching activities
902            */
903            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
904            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserOrganizationsActivities(
905                    long userId, int start, int end);
906    
907            /**
908            * Returns the number of activities done in the user's organizations. This
909            * method only counts activities without mirrors.
910            *
911            * @param userId the primary key of the user
912            * @return the number of matching activities
913            */
914            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
915            public int getUserOrganizationsActivitiesCount(long userId);
916    
917            /**
918            * Sets the Spring bean ID for this bean.
919            *
920            * @param beanIdentifier the Spring bean ID for this bean
921            */
922            public void setBeanIdentifier(java.lang.String beanIdentifier);
923    
924            /**
925            * Updates the social activity in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
926            *
927            * @param socialActivity the social activity
928            * @return the social activity that was updated
929            */
930            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
931            public com.liferay.portlet.social.model.SocialActivity updateSocialActivity(
932                    com.liferay.portlet.social.model.SocialActivity socialActivity);
933    }