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 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 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 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 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 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 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 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 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) throws PortalException;
225    
226            /**
227            * @throws PortalException
228            */
229            @Override
230            public com.liferay.portal.model.PersistedModel deletePersistedModel(
231                    com.liferay.portal.model.PersistedModel persistedModel)
232                    throws PortalException;
233    
234            /**
235            * Deletes the social activity with the primary key from the database. Also notifies the appropriate model listeners.
236            *
237            * @param activityId the primary key of the social activity
238            * @return the social activity that was removed
239            * @throws PortalException if a social activity with the primary key could not be found
240            */
241            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
242            public com.liferay.portlet.social.model.SocialActivity deleteSocialActivity(
243                    long activityId) throws PortalException;
244    
245            /**
246            * Deletes the social activity from the database. Also notifies the appropriate model listeners.
247            *
248            * @param socialActivity the social activity
249            * @return the social activity that was removed
250            */
251            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
252            public com.liferay.portlet.social.model.SocialActivity deleteSocialActivity(
253                    com.liferay.portlet.social.model.SocialActivity socialActivity);
254    
255            /**
256            * Removes the user's stored activities from the database.
257            *
258            * <p>
259            * This method removes all activities where the user is either the actor or
260            * the receiver.
261            * </p>
262            *
263            * @param userId the primary key of the user
264            * @throws PortalException if the user's activity counters could not be
265            deleted
266            */
267            public void deleteUserActivities(long userId) throws PortalException;
268    
269            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
270    
271            /**
272            * Performs a dynamic query on the database and returns the matching rows.
273            *
274            * @param dynamicQuery the dynamic query
275            * @return the matching rows
276            */
277            public <T> java.util.List<T> dynamicQuery(
278                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
279    
280            /**
281            * Performs a dynamic query on the database and returns a range of the matching rows.
282            *
283            * <p>
284            * 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.
285            * </p>
286            *
287            * @param dynamicQuery the dynamic query
288            * @param start the lower bound of the range of model instances
289            * @param end the upper bound of the range of model instances (not inclusive)
290            * @return the range of matching rows
291            */
292            public <T> java.util.List<T> dynamicQuery(
293                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
294                    int end);
295    
296            /**
297            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
298            *
299            * <p>
300            * 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.
301            * </p>
302            *
303            * @param dynamicQuery the dynamic query
304            * @param start the lower bound of the range of model instances
305            * @param end the upper bound of the range of model instances (not inclusive)
306            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
307            * @return the ordered range of matching rows
308            */
309            public <T> java.util.List<T> dynamicQuery(
310                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
311                    int end,
312                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
313    
314            /**
315            * Returns the number of rows matching the dynamic query.
316            *
317            * @param dynamicQuery the dynamic query
318            * @return the number of rows matching the dynamic query
319            */
320            public long dynamicQueryCount(
321                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
322    
323            /**
324            * Returns the number of rows matching the dynamic query.
325            *
326            * @param dynamicQuery the dynamic query
327            * @param projection the projection to apply to the query
328            * @return the number of rows matching the dynamic query
329            */
330            public long dynamicQueryCount(
331                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
332                    com.liferay.portal.kernel.dao.orm.Projection projection);
333    
334            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
335            public com.liferay.portlet.social.model.SocialActivity fetchFirstActivity(
336                    java.lang.String className, long classPK, int type);
337    
338            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
339            public com.liferay.portlet.social.model.SocialActivity fetchSocialActivity(
340                    long activityId);
341    
342            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
343            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
344    
345            /**
346            * Returns a range of all the activities done on assets identified by the
347            * class name.
348            *
349            * <p>
350            * Useful when paginating results. Returns a maximum of <code>end -
351            * start</code> instances. <code>start</code> and <code>end</code> are not
352            * primary keys, they are indexes in the result set. Thus, <code>0</code>
353            * refers to the first result in the set. Setting both <code>start</code>
354            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
355            * result set.
356            * </p>
357            *
358            * @param className the target asset's class name
359            * @param start the lower bound of the range of results
360            * @param end the upper bound of the range of results (not inclusive)
361            * @return the range of matching activities
362            */
363            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
364            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
365                    java.lang.String className, int start, int end);
366    
367            /**
368            * Returns a range of all the activities done on assets identified by the
369            * class name ID.
370            *
371            * <p>
372            * Useful when paginating results. Returns a maximum of <code>end -
373            * start</code> instances. <code>start</code> and <code>end</code> are not
374            * primary keys, they are indexes in the result set. Thus, <code>0</code>
375            * refers to the first result in the set. Setting both <code>start</code>
376            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
377            * result set.
378            * </p>
379            *
380            * @param classNameId the target asset's class name ID
381            * @param start the lower bound of the range of results
382            * @param end the upper bound of the range of results (not inclusive)
383            * @return the range of matching activities
384            */
385            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
386            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
387                    long classNameId, int start, int end);
388    
389            /**
390            * Returns a range of all the activities done on the asset identified by the
391            * class name and the class primary key that are mirrors of the activity
392            * identified by the mirror activity ID.
393            *
394            * <p>
395            * Useful when paginating results. Returns a maximum of <code>end -
396            * start</code> instances. <code>start</code> and <code>end</code> are not
397            * primary keys, they are indexes in the result set. Thus, <code>0</code>
398            * refers to the first result in the set. Setting both <code>start</code>
399            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
400            * result set.
401            * </p>
402            *
403            * @param mirrorActivityId the primary key of the mirror activity
404            * @param className the target asset's class name
405            * @param classPK the primary key of the target asset
406            * @param start the lower bound of the range of results
407            * @param end the upper bound of the range of results (not inclusive)
408            * @return the range of matching activities
409            */
410            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
411            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
412                    long mirrorActivityId, java.lang.String className, long classPK,
413                    int start, int end);
414    
415            /**
416            * Returns a range of all the activities done on the asset identified by the
417            * class name ID and class primary key that are mirrors of the activity
418            * identified by the mirror activity ID.
419            *
420            * <p>
421            * Useful when paginating results. Returns a maximum of <code>end -
422            * start</code> instances. <code>start</code> and <code>end</code> are not
423            * primary keys, they are indexes in the result set. Thus, <code>0</code>
424            * refers to the first result in the set. Setting both <code>start</code>
425            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
426            * result set.
427            * </p>
428            *
429            * @param mirrorActivityId the primary key of the mirror activity
430            * @param classNameId the target asset's class name ID
431            * @param classPK the primary key of the target asset
432            * @param start the lower bound of the range of results
433            * @param end the upper bound of the range of results (not inclusive)
434            * @return the range of matching activities
435            */
436            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
437            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
438                    long mirrorActivityId, long classNameId, long classPK, int start,
439                    int end);
440    
441            /**
442            * Returns the number of activities done on assets identified by class name.
443            *
444            * @param className the target asset's class name
445            * @return the number of matching activities
446            */
447            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
448            public int getActivitiesCount(java.lang.String className);
449    
450            /**
451            * Returns the number of activities done on assets identified by the class
452            * name ID.
453            *
454            * @param classNameId the target asset's class name ID
455            * @return the number of matching activities
456            */
457            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
458            public int getActivitiesCount(long classNameId);
459    
460            /**
461            * Returns the number of activities done on the asset identified by the
462            * class name and class primary key that are mirrors of the activity
463            * identified by the mirror activity ID.
464            *
465            * @param mirrorActivityId the primary key of the mirror activity
466            * @param className the target asset's class name
467            * @param classPK the primary key of the target asset
468            * @return the number of matching activities
469            */
470            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
471            public int getActivitiesCount(long mirrorActivityId,
472                    java.lang.String className, long classPK);
473    
474            /**
475            * Returns the number of activities done on the asset identified by the
476            * class name ID and class primary key that are mirrors of the activity
477            * identified by the mirror activity ID.
478            *
479            * @param mirrorActivityId the primary key of the mirror activity
480            * @param classNameId the target asset's class name ID
481            * @param classPK the primary key of the target asset
482            * @return the number of matching activities
483            */
484            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
485            public int getActivitiesCount(long mirrorActivityId, long classNameId,
486                    long classPK);
487    
488            /**
489            * Returns the activity identified by its primary key.
490            *
491            * @param activityId the primary key of the activity
492            * @return Returns the activity
493            * @throws PortalException if the activity could not be found
494            */
495            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
496            public com.liferay.portlet.social.model.SocialActivity getActivity(
497                    long activityId) throws PortalException;
498    
499            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
500            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivitySetActivities(
501                    long activitySetId, int start, int end);
502    
503            /**
504            * Returns the Spring bean ID for this bean.
505            *
506            * @return the Spring bean ID for this bean
507            */
508            public java.lang.String getBeanIdentifier();
509    
510            /**
511            * Returns a range of all the activities done in the group.
512            *
513            * <p>
514            * This method only finds activities without mirrors.
515            * </p>
516            *
517            * <p>
518            * Useful when paginating results. Returns a maximum of <code>end -
519            * start</code> instances. <code>start</code> and <code>end</code> are not
520            * primary keys, they are indexes in the result set. Thus, <code>0</code>
521            * refers to the first result in the set. Setting both <code>start</code>
522            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
523            * result set.
524            * </p>
525            *
526            * @param groupId the primary key of the group
527            * @param start the lower bound of the range of results
528            * @param end the upper bound of the range of results (not inclusive)
529            * @return the range of matching activities
530            */
531            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
532            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getGroupActivities(
533                    long groupId, int start, int end);
534    
535            /**
536            * Returns the number of activities done in the group.
537            *
538            * <p>
539            * This method only counts activities without mirrors.
540            * </p>
541            *
542            * @param groupId the primary key of the group
543            * @return the number of matching activities
544            */
545            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
546            public int getGroupActivitiesCount(long groupId);
547    
548            /**
549            * Returns a range of activities done by users that are members of the
550            * group.
551            *
552            * <p>
553            * This method only finds activities without mirrors.
554            * </p>
555            *
556            * <p>
557            * Useful when paginating results. Returns a maximum of <code>end -
558            * start</code> instances. <code>start</code> and <code>end</code> are not
559            * primary keys, they are indexes in the result set. Thus, <code>0</code>
560            * refers to the first result in the set. Setting both <code>start</code>
561            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
562            * result set.
563            * </p>
564            *
565            * @param groupId the primary key of the group
566            * @param start the lower bound of the range of results
567            * @param end the upper bound of the range of results (not inclusive)
568            * @return the range of matching activities
569            */
570            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
571            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getGroupUsersActivities(
572                    long groupId, int start, int end);
573    
574            /**
575            * Returns the number of activities done by users that are members of the
576            * group.
577            *
578            * <p>
579            * This method only counts activities without mirrors.
580            * </p>
581            *
582            * @param groupId the primary key of the group
583            * @return the number of matching activities
584            */
585            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
586            public int getGroupUsersActivitiesCount(long groupId);
587    
588            /**
589            * Returns the activity that has the mirror activity.
590            *
591            * @param mirrorActivityId the primary key of the mirror activity
592            * @return Returns the mirror activity
593            * @throws PortalException if the mirror activity could not be found
594            */
595            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
596            public com.liferay.portlet.social.model.SocialActivity getMirrorActivity(
597                    long mirrorActivityId) throws PortalException;
598    
599            /**
600            * Returns a range of all the activities done in the organization. This
601            * method only finds activities without mirrors.
602            *
603            * <p>
604            * Useful when paginating results. Returns a maximum of <code>end -
605            * start</code> instances. <code>start</code> and <code>end</code> are not
606            * primary keys, they are indexes in the result set. Thus, <code>0</code>
607            * refers to the first result in the set. Setting both <code>start</code>
608            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
609            * result set.
610            * </p>
611            *
612            * @param organizationId the primary key of the organization
613            * @param start the lower bound of the range of results
614            * @param end the upper bound of the range of results (not inclusive)
615            * @return the range of matching activities
616            */
617            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
618            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getOrganizationActivities(
619                    long organizationId, int start, int end);
620    
621            /**
622            * Returns the number of activities done in the organization. This method
623            * only counts activities without mirrors.
624            *
625            * @param organizationId the primary key of the organization
626            * @return the number of matching activities
627            */
628            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
629            public int getOrganizationActivitiesCount(long organizationId);
630    
631            /**
632            * Returns a range of all the activities done by users of the organization.
633            * This method only finds activities without mirrors.
634            *
635            * <p>
636            * Useful when paginating results. Returns a maximum of <code>end -
637            * start</code> instances. <code>start</code> and <code>end</code> are not
638            * primary keys, they are indexes in the result set. Thus, <code>0</code>
639            * refers to the first result in the set. Setting both <code>start</code>
640            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
641            * result set.
642            * </p>
643            *
644            * @param organizationId the primary key of the organization
645            * @param start the lower bound of the range of results
646            * @param end the upper bound of the range of results (not inclusive)
647            * @return the range of matching activities
648            */
649            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
650            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getOrganizationUsersActivities(
651                    long organizationId, int start, int end);
652    
653            /**
654            * Returns the number of activities done by users of the organization. This
655            * method only counts activities without mirrors.
656            *
657            * @param organizationId the primary key of the organization
658            * @return the number of matching activities
659            */
660            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
661            public int getOrganizationUsersActivitiesCount(long organizationId);
662    
663            @Override
664            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
665            public com.liferay.portal.model.PersistedModel getPersistedModel(
666                    java.io.Serializable primaryKeyObj) throws PortalException;
667    
668            /**
669            * Returns a range of all the activities done by users in a relationship
670            * with the user identified by the user ID.
671            *
672            * <p>
673            * Useful when paginating results. Returns a maximum of <code>end -
674            * start</code> instances. <code>start</code> and <code>end</code> are not
675            * primary keys, they are indexes in the result set. Thus, <>0</code> refers
676            * to the first result in the set. Setting both <code>start</code> and
677            * <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result
678            * set.
679            * </p>
680            *
681            * @param userId the primary key of the user
682            * @param start the lower bound of the range of results
683            * @param end the upper bound of the range of results (not inclusive)
684            * @return the range of matching activities
685            */
686            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
687            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getRelationActivities(
688                    long userId, int start, int end);
689    
690            /**
691            * Returns a range of all the activities done by users in a relationship of
692            * type <code>type</code> with the user identified by <code>userId</code>.
693            * This method only finds activities without mirrors.
694            *
695            * <p>
696            * Useful when paginating results. Returns a maximum of <code>end -
697            * start</code> instances. <code>start</code> and <code>end</code> are not
698            * primary keys, they are indexes in the result set. Thus, <code>0</code>
699            * refers to the first result in the set. Setting both <code>start</code>
700            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
701            * result set.
702            * </p>
703            *
704            * @param userId the primary key of the user
705            * @param type the relationship type
706            * @param start the lower bound of the range of results
707            * @param end the upper bound of the range of results (not inclusive)
708            * @return the range of matching activities
709            */
710            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
711            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getRelationActivities(
712                    long userId, int type, int start, int end);
713    
714            /**
715            * Returns the number of activities done by users in a relationship with the
716            * user identified by userId.
717            *
718            * @param userId the primary key of the user
719            * @return the number of matching activities
720            */
721            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
722            public int getRelationActivitiesCount(long userId);
723    
724            /**
725            * Returns the number of activities done by users in a relationship of type
726            * <code>type</code> with the user identified by <code>userId</code>. This
727            * method only counts activities without mirrors.
728            *
729            * @param userId the primary key of the user
730            * @param type the relationship type
731            * @return the number of matching activities
732            */
733            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
734            public int getRelationActivitiesCount(long userId, int type);
735    
736            /**
737            * Returns a range of all the social activities.
738            *
739            * <p>
740            * 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.
741            * </p>
742            *
743            * @param start the lower bound of the range of social activities
744            * @param end the upper bound of the range of social activities (not inclusive)
745            * @return the range of social activities
746            */
747            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
748            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getSocialActivities(
749                    int start, int end);
750    
751            /**
752            * Returns the number of social activities.
753            *
754            * @return the number of social activities
755            */
756            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
757            public int getSocialActivitiesCount();
758    
759            /**
760            * Returns the social activity with the primary key.
761            *
762            * @param activityId the primary key of the social activity
763            * @return the social activity
764            * @throws PortalException if a social activity with the primary key could not be found
765            */
766            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
767            public com.liferay.portlet.social.model.SocialActivity getSocialActivity(
768                    long activityId) throws PortalException;
769    
770            /**
771            * Returns a range of all the activities done by the user.
772            *
773            * <p>
774            * Useful when paginating results. Returns a maximum of <code>end -
775            * start</code> instances. <code>start</code> and <code>end</code> are not
776            * primary keys, they are indexes in the result set. Thus, <code>0</code>
777            * refers to the first result in the set. Setting both <code>start</code>
778            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
779            * result set.
780            * </p>
781            *
782            * @param userId the primary key of the user
783            * @param start the lower bound of the range of results
784            * @param end the upper bound of the range of results (not inclusive)
785            * @return the range of matching activities
786            */
787            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
788            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserActivities(
789                    long userId, int start, int end);
790    
791            /**
792            * Returns the number of activities done by the user.
793            *
794            * @param userId the primary key of the user
795            * @return the number of matching activities
796            */
797            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
798            public int getUserActivitiesCount(long userId);
799    
800            /**
801            * Returns a range of all the activities done in the user's groups. This
802            * method only finds activities without mirrors.
803            *
804            * <p>
805            * Useful when paginating results. Returns a maximum of <code>end -
806            * start</code> instances. <code>start</code> and <code>end</code> are not
807            * primary keys, they are indexes in the result set. Thus, <code>0</code>
808            * refers to the first result in the set. Setting both <code>start</code>
809            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
810            * result set.
811            * </p>
812            *
813            * @param userId the primary key of the user
814            * @param start the lower bound of the range of results
815            * @param end the upper bound of the range of results (not inclusive)
816            * @return the range of matching activities
817            */
818            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
819            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserGroupsActivities(
820                    long userId, int start, int end);
821    
822            /**
823            * Returns the number of activities done in user's groups. This method only
824            * counts activities without mirrors.
825            *
826            * @param userId the primary key of the user
827            * @return the number of matching activities
828            */
829            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
830            public int getUserGroupsActivitiesCount(long userId);
831    
832            /**
833            * Returns a range of all the activities done in the user's groups and
834            * organizations. This method only finds activities without mirrors.
835            *
836            * <p>
837            * Useful when paginating results. Returns a maximum of <code>end -
838            * start</code> instances. <code>start</code> and <code>end</code> are not
839            * primary keys, they are indexes in the result set. Thus, <code>0</code>
840            * refers to the first result in the set. Setting both <code>start</code>
841            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
842            * result set.
843            * </p>
844            *
845            * @param userId the primary key of the user
846            * @param start the lower bound of the range of results
847            * @param end the upper bound of the range of results (not inclusive)
848            * @return the range of matching activities
849            */
850            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
851            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserGroupsAndOrganizationsActivities(
852                    long userId, int start, int end);
853    
854            /**
855            * Returns the number of activities done in user's groups and organizations.
856            * This method only counts activities without mirrors.
857            *
858            * @param userId the primary key of the user
859            * @return the number of matching activities
860            */
861            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
862            public int getUserGroupsAndOrganizationsActivitiesCount(long userId);
863    
864            /**
865            * Returns a range of all activities done in the user's organizations. This
866            * method only finds activities without mirrors.
867            *
868            * <p>
869            * Useful when paginating results. Returns a maximum of <code>end -
870            * start</code> instances. <code>start</code> and <code>end</code> are not
871            * primary keys, they are indexes in the result set. Thus, <code>0</code>
872            * refers to the first result in the set. Setting both <code>start</code>
873            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
874            * result set.
875            * </p>
876            *
877            * @param userId the primary key of the user
878            * @param start the lower bound of the range of results
879            * @param end the upper bound of the range of results (not inclusive)
880            * @return the range of matching activities
881            */
882            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
883            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserOrganizationsActivities(
884                    long userId, int start, int end);
885    
886            /**
887            * Returns the number of activities done in the user's organizations. This
888            * method only counts activities without mirrors.
889            *
890            * @param userId the primary key of the user
891            * @return the number of matching activities
892            */
893            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
894            public int getUserOrganizationsActivitiesCount(long userId);
895    
896            /**
897            * Sets the Spring bean ID for this bean.
898            *
899            * @param beanIdentifier the Spring bean ID for this bean
900            */
901            public void setBeanIdentifier(java.lang.String beanIdentifier);
902    
903            /**
904            * Updates the social activity in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
905            *
906            * @param socialActivity the social activity
907            * @return the social activity that was updated
908            */
909            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
910            public com.liferay.portlet.social.model.SocialActivity updateSocialActivity(
911                    com.liferay.portlet.social.model.SocialActivity socialActivity);
912    }