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