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            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
569            public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
570    
571            /**
572            * Returns the activity that has the mirror activity.
573            *
574            * @param mirrorActivityId the primary key of the mirror activity
575            * @return Returns the mirror activity
576            */
577            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
578            public com.liferay.portlet.social.model.SocialActivity getMirrorActivity(
579                    long mirrorActivityId) throws PortalException;
580    
581            /**
582            * Returns the OSGi service identifier.
583            *
584            * @return the OSGi service identifier
585            */
586            public java.lang.String getOSGiServiceIdentifier();
587    
588            /**
589            * Returns a range of all the activities done in the organization. This
590            * method only finds activities without mirrors.
591            *
592            * <p>
593            * Useful when paginating results. Returns a maximum of <code>end -
594            * start</code> instances. <code>start</code> and <code>end</code> are not
595            * primary keys, they are indexes in the result set. Thus, <code>0</code>
596            * refers to the first result in the set. Setting both <code>start</code>
597            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
598            * result set.
599            * </p>
600            *
601            * @param organizationId the primary key of the organization
602            * @param start the lower bound of the range of results
603            * @param end the upper bound of the range of results (not inclusive)
604            * @return the range of matching activities
605            */
606            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
607            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getOrganizationActivities(
608                    long organizationId, int start, int end);
609    
610            /**
611            * Returns the number of activities done in the organization. This method
612            * only counts activities without mirrors.
613            *
614            * @param organizationId the primary key of the organization
615            * @return the number of matching activities
616            */
617            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
618            public int getOrganizationActivitiesCount(long organizationId);
619    
620            /**
621            * Returns a range of all the activities done by users of the organization.
622            * This method only finds activities without mirrors.
623            *
624            * <p>
625            * Useful when paginating results. Returns a maximum of <code>end -
626            * start</code> instances. <code>start</code> and <code>end</code> are not
627            * primary keys, they are indexes in the result set. Thus, <code>0</code>
628            * refers to the first result in the set. Setting both <code>start</code>
629            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
630            * result set.
631            * </p>
632            *
633            * @param organizationId the primary key of the organization
634            * @param start the lower bound of the range of results
635            * @param end the upper bound of the range of results (not inclusive)
636            * @return the range of matching activities
637            */
638            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
639            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getOrganizationUsersActivities(
640                    long organizationId, int start, int end);
641    
642            /**
643            * Returns the number of activities done by users of the organization. This
644            * method only counts activities without mirrors.
645            *
646            * @param organizationId the primary key of the organization
647            * @return the number of matching activities
648            */
649            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
650            public int getOrganizationUsersActivitiesCount(long organizationId);
651    
652            @Override
653            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
654            public com.liferay.portal.model.PersistedModel getPersistedModel(
655                    java.io.Serializable primaryKeyObj) throws PortalException;
656    
657            /**
658            * Returns a range of all the activities done by users in a relationship
659            * with the user identified by the user ID.
660            *
661            * <p>
662            * Useful when paginating results. Returns a maximum of <code>end -
663            * start</code> instances. <code>start</code> and <code>end</code> are not
664            * primary keys, they are indexes in the result set. Thus, <>0</code> refers
665            * to the first result in the set. Setting both <code>start</code> and
666            * <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result
667            * set.
668            * </p>
669            *
670            * @param userId the primary key of the user
671            * @param start the lower bound of the range of results
672            * @param end the upper bound of the range of results (not inclusive)
673            * @return the range of matching activities
674            */
675            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
676            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getRelationActivities(
677                    long userId, int start, int end);
678    
679            /**
680            * Returns a range of all the activities done by users in a relationship of
681            * type <code>type</code> with the user identified by <code>userId</code>.
682            * This method only finds activities without mirrors.
683            *
684            * <p>
685            * Useful when paginating results. Returns a maximum of <code>end -
686            * start</code> instances. <code>start</code> and <code>end</code> are not
687            * primary keys, they are indexes in the result set. Thus, <code>0</code>
688            * refers to the first result in the set. Setting both <code>start</code>
689            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
690            * result set.
691            * </p>
692            *
693            * @param userId the primary key of the user
694            * @param type the relationship type
695            * @param start the lower bound of the range of results
696            * @param end the upper bound of the range of results (not inclusive)
697            * @return the range of matching activities
698            */
699            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
700            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getRelationActivities(
701                    long userId, int type, int start, int end);
702    
703            /**
704            * Returns the number of activities done by users in a relationship with the
705            * user identified by userId.
706            *
707            * @param userId the primary key of the user
708            * @return the number of matching activities
709            */
710            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
711            public int getRelationActivitiesCount(long userId);
712    
713            /**
714            * Returns the number of activities done by users in a relationship of type
715            * <code>type</code> with the user identified by <code>userId</code>. This
716            * method only counts activities without mirrors.
717            *
718            * @param userId the primary key of the user
719            * @param type the relationship type
720            * @return the number of matching activities
721            */
722            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
723            public int getRelationActivitiesCount(long userId, int type);
724    
725            /**
726            * Returns a range of all the social activities.
727            *
728            * <p>
729            * 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.
730            * </p>
731            *
732            * @param start the lower bound of the range of social activities
733            * @param end the upper bound of the range of social activities (not inclusive)
734            * @return the range of social activities
735            */
736            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
737            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getSocialActivities(
738                    int start, int end);
739    
740            /**
741            * Returns the number of social activities.
742            *
743            * @return the number of social activities
744            */
745            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
746            public int getSocialActivitiesCount();
747    
748            /**
749            * Returns the social activity with the primary key.
750            *
751            * @param activityId the primary key of the social activity
752            * @return the social activity
753            * @throws PortalException if a social activity with the primary key could not be found
754            */
755            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
756            public com.liferay.portlet.social.model.SocialActivity getSocialActivity(
757                    long activityId) throws PortalException;
758    
759            /**
760            * Returns a range of all the activities done by the user.
761            *
762            * <p>
763            * Useful when paginating results. Returns a maximum of <code>end -
764            * start</code> instances. <code>start</code> and <code>end</code> are not
765            * primary keys, they are indexes in the result set. Thus, <code>0</code>
766            * refers to the first result in the set. Setting both <code>start</code>
767            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
768            * result set.
769            * </p>
770            *
771            * @param userId the primary key of the user
772            * @param start the lower bound of the range of results
773            * @param end the upper bound of the range of results (not inclusive)
774            * @return the range of matching activities
775            */
776            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
777            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserActivities(
778                    long userId, int start, int end);
779    
780            /**
781            * Returns the number of activities done by the user.
782            *
783            * @param userId the primary key of the user
784            * @return the number of matching activities
785            */
786            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
787            public int getUserActivitiesCount(long userId);
788    
789            /**
790            * Returns a range of all the activities done in the user's groups. This
791            * method only finds activities without mirrors.
792            *
793            * <p>
794            * Useful when paginating results. Returns a maximum of <code>end -
795            * start</code> instances. <code>start</code> and <code>end</code> are not
796            * primary keys, they are indexes in the result set. Thus, <code>0</code>
797            * refers to the first result in the set. Setting both <code>start</code>
798            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
799            * result set.
800            * </p>
801            *
802            * @param userId the primary key of the user
803            * @param start the lower bound of the range of results
804            * @param end the upper bound of the range of results (not inclusive)
805            * @return the range of matching activities
806            */
807            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
808            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserGroupsActivities(
809                    long userId, int start, int end);
810    
811            /**
812            * Returns the number of activities done in user's groups. This method only
813            * counts activities without mirrors.
814            *
815            * @param userId the primary key of the user
816            * @return the number of matching activities
817            */
818            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
819            public int getUserGroupsActivitiesCount(long userId);
820    
821            /**
822            * Returns a range of all the activities done in the user's groups and
823            * organizations. This method only finds activities without mirrors.
824            *
825            * <p>
826            * Useful when paginating results. Returns a maximum of <code>end -
827            * start</code> instances. <code>start</code> and <code>end</code> are not
828            * primary keys, they are indexes in the result set. Thus, <code>0</code>
829            * refers to the first result in the set. Setting both <code>start</code>
830            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
831            * result set.
832            * </p>
833            *
834            * @param userId the primary key of the user
835            * @param start the lower bound of the range of results
836            * @param end the upper bound of the range of results (not inclusive)
837            * @return the range of matching activities
838            */
839            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
840            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserGroupsAndOrganizationsActivities(
841                    long userId, int start, int end);
842    
843            /**
844            * Returns the number of activities done in user's groups and organizations.
845            * This method only counts activities without mirrors.
846            *
847            * @param userId the primary key of the user
848            * @return the number of matching activities
849            */
850            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
851            public int getUserGroupsAndOrganizationsActivitiesCount(long userId);
852    
853            /**
854            * Returns a range of all activities done in the user's organizations. This
855            * method only finds activities without mirrors.
856            *
857            * <p>
858            * Useful when paginating results. Returns a maximum of <code>end -
859            * start</code> instances. <code>start</code> and <code>end</code> are not
860            * primary keys, they are indexes in the result set. Thus, <code>0</code>
861            * refers to the first result in the set. Setting both <code>start</code>
862            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
863            * result set.
864            * </p>
865            *
866            * @param userId the primary key of the user
867            * @param start the lower bound of the range of results
868            * @param end the upper bound of the range of results (not inclusive)
869            * @return the range of matching activities
870            */
871            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
872            public java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserOrganizationsActivities(
873                    long userId, int start, int end);
874    
875            /**
876            * Returns the number of activities done in the user's organizations. This
877            * method only counts activities without mirrors.
878            *
879            * @param userId the primary key of the user
880            * @return the number of matching activities
881            */
882            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
883            public int getUserOrganizationsActivitiesCount(long userId);
884    
885            /**
886            * Updates the social activity in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
887            *
888            * @param socialActivity the social activity
889            * @return the social activity that was updated
890            */
891            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
892            public com.liferay.portlet.social.model.SocialActivity updateSocialActivity(
893                    com.liferay.portlet.social.model.SocialActivity socialActivity);
894    }