001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.social.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the social activity local service. This utility wraps {@link com.liferay.portlet.social.service.impl.SocialActivityLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see SocialActivityLocalService
030     * @see com.liferay.portlet.social.service.base.SocialActivityLocalServiceBaseImpl
031     * @see com.liferay.portlet.social.service.impl.SocialActivityLocalServiceImpl
032     * @generated
033     */
034    public class SocialActivityLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the social activity to the database. Also notifies the appropriate model listeners.
043            *
044            * @param socialActivity the social activity
045            * @return the social activity that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.social.model.SocialActivity addSocialActivity(
049                    com.liferay.portlet.social.model.SocialActivity socialActivity)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addSocialActivity(socialActivity);
052            }
053    
054            /**
055            * Creates a new social activity with the primary key. Does not add the social activity to the database.
056            *
057            * @param activityId the primary key for the new social activity
058            * @return the new social activity
059            */
060            public static com.liferay.portlet.social.model.SocialActivity createSocialActivity(
061                    long activityId) {
062                    return getService().createSocialActivity(activityId);
063            }
064    
065            /**
066            * Deletes the social activity with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param activityId the primary key of the social activity
069            * @throws PortalException if a social activity with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteSocialActivity(long activityId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteSocialActivity(activityId);
076            }
077    
078            /**
079            * Deletes the social activity from the database. Also notifies the appropriate model listeners.
080            *
081            * @param socialActivity the social activity
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteSocialActivity(
085                    com.liferay.portlet.social.model.SocialActivity socialActivity)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteSocialActivity(socialActivity);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * 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.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * 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.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            /**
162            * Returns the social activity with the primary key.
163            *
164            * @param activityId the primary key of the social activity
165            * @return the social activity
166            * @throws PortalException if a social activity with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portlet.social.model.SocialActivity getSocialActivity(
170                    long activityId)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getService().getSocialActivity(activityId);
174            }
175    
176            public static com.liferay.portal.model.PersistedModel getPersistedModel(
177                    java.io.Serializable primaryKeyObj)
178                    throws com.liferay.portal.kernel.exception.PortalException,
179                            com.liferay.portal.kernel.exception.SystemException {
180                    return getService().getPersistedModel(primaryKeyObj);
181            }
182    
183            /**
184            * Returns a range of all the social activities.
185            *
186            * <p>
187            * 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.
188            * </p>
189            *
190            * @param start the lower bound of the range of social activities
191            * @param end the upper bound of the range of social activities (not inclusive)
192            * @return the range of social activities
193            * @throws SystemException if a system exception occurred
194            */
195            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getSocialActivities(
196                    int start, int end)
197                    throws com.liferay.portal.kernel.exception.SystemException {
198                    return getService().getSocialActivities(start, end);
199            }
200    
201            /**
202            * Returns the number of social activities.
203            *
204            * @return the number of social activities
205            * @throws SystemException if a system exception occurred
206            */
207            public static int getSocialActivitiesCount()
208                    throws com.liferay.portal.kernel.exception.SystemException {
209                    return getService().getSocialActivitiesCount();
210            }
211    
212            /**
213            * Updates the social activity in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
214            *
215            * @param socialActivity the social activity
216            * @return the social activity that was updated
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portlet.social.model.SocialActivity updateSocialActivity(
220                    com.liferay.portlet.social.model.SocialActivity socialActivity)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getService().updateSocialActivity(socialActivity);
223            }
224    
225            /**
226            * Updates the social activity in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
227            *
228            * @param socialActivity the social activity
229            * @param merge whether to merge the social activity with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
230            * @return the social activity that was updated
231            * @throws SystemException if a system exception occurred
232            */
233            public static com.liferay.portlet.social.model.SocialActivity updateSocialActivity(
234                    com.liferay.portlet.social.model.SocialActivity socialActivity,
235                    boolean merge)
236                    throws com.liferay.portal.kernel.exception.SystemException {
237                    return getService().updateSocialActivity(socialActivity, merge);
238            }
239    
240            /**
241            * Returns the Spring bean ID for this bean.
242            *
243            * @return the Spring bean ID for this bean
244            */
245            public static java.lang.String getBeanIdentifier() {
246                    return getService().getBeanIdentifier();
247            }
248    
249            /**
250            * Sets the Spring bean ID for this bean.
251            *
252            * @param beanIdentifier the Spring bean ID for this bean
253            */
254            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
255                    getService().setBeanIdentifier(beanIdentifier);
256            }
257    
258            public static com.liferay.portlet.social.model.SocialActivity addActivity(
259                    long userId, long groupId, java.util.Date createDate,
260                    java.lang.String className, long classPK, int type,
261                    java.lang.String extraData, long receiverUserId)
262                    throws com.liferay.portal.kernel.exception.PortalException,
263                            com.liferay.portal.kernel.exception.SystemException {
264                    return getService()
265                                       .addActivity(userId, groupId, createDate, className,
266                            classPK, type, extraData, receiverUserId);
267            }
268    
269            public static com.liferay.portlet.social.model.SocialActivity addActivity(
270                    long userId, long groupId, java.lang.String className, long classPK,
271                    int type, java.lang.String extraData, long receiverUserId)
272                    throws com.liferay.portal.kernel.exception.PortalException,
273                            com.liferay.portal.kernel.exception.SystemException {
274                    return getService()
275                                       .addActivity(userId, groupId, className, classPK, type,
276                            extraData, receiverUserId);
277            }
278    
279            public static com.liferay.portlet.social.model.SocialActivity addUniqueActivity(
280                    long userId, long groupId, java.util.Date createDate,
281                    java.lang.String className, long classPK, int type,
282                    java.lang.String extraData, long receiverUserId)
283                    throws com.liferay.portal.kernel.exception.PortalException,
284                            com.liferay.portal.kernel.exception.SystemException {
285                    return getService()
286                                       .addUniqueActivity(userId, groupId, createDate, className,
287                            classPK, type, extraData, receiverUserId);
288            }
289    
290            public static com.liferay.portlet.social.model.SocialActivity addUniqueActivity(
291                    long userId, long groupId, java.lang.String className, long classPK,
292                    int type, java.lang.String extraData, long receiverUserId)
293                    throws com.liferay.portal.kernel.exception.PortalException,
294                            com.liferay.portal.kernel.exception.SystemException {
295                    return getService()
296                                       .addUniqueActivity(userId, groupId, className, classPK,
297                            type, extraData, receiverUserId);
298            }
299    
300            public static void deleteActivities(long classNameId, long classPK)
301                    throws com.liferay.portal.kernel.exception.SystemException {
302                    getService().deleteActivities(classNameId, classPK);
303            }
304    
305            public static void deleteActivities(java.lang.String className, long classPK)
306                    throws com.liferay.portal.kernel.exception.SystemException {
307                    getService().deleteActivities(className, classPK);
308            }
309    
310            public static void deleteActivity(long activityId)
311                    throws com.liferay.portal.kernel.exception.PortalException,
312                            com.liferay.portal.kernel.exception.SystemException {
313                    getService().deleteActivity(activityId);
314            }
315    
316            public static void deleteActivity(
317                    com.liferay.portlet.social.model.SocialActivity activity)
318                    throws com.liferay.portal.kernel.exception.SystemException {
319                    getService().deleteActivity(activity);
320            }
321    
322            public static void deleteUserActivities(long userId)
323                    throws com.liferay.portal.kernel.exception.SystemException {
324                    getService().deleteUserActivities(userId);
325            }
326    
327            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
328                    long classNameId, int start, int end)
329                    throws com.liferay.portal.kernel.exception.SystemException {
330                    return getService().getActivities(classNameId, start, end);
331            }
332    
333            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
334                    long mirrorActivityId, long classNameId, long classPK, int start,
335                    int end) throws com.liferay.portal.kernel.exception.SystemException {
336                    return getService()
337                                       .getActivities(mirrorActivityId, classNameId, classPK,
338                            start, end);
339            }
340    
341            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
342                    long mirrorActivityId, java.lang.String className, long classPK,
343                    int start, int end)
344                    throws com.liferay.portal.kernel.exception.SystemException {
345                    return getService()
346                                       .getActivities(mirrorActivityId, className, classPK, start,
347                            end);
348            }
349    
350            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getActivities(
351                    java.lang.String className, int start, int end)
352                    throws com.liferay.portal.kernel.exception.SystemException {
353                    return getService().getActivities(className, start, end);
354            }
355    
356            public static int getActivitiesCount(long classNameId)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    return getService().getActivitiesCount(classNameId);
359            }
360    
361            public static int getActivitiesCount(long mirrorActivityId,
362                    long classNameId, long classPK)
363                    throws com.liferay.portal.kernel.exception.SystemException {
364                    return getService()
365                                       .getActivitiesCount(mirrorActivityId, classNameId, classPK);
366            }
367    
368            public static int getActivitiesCount(long mirrorActivityId,
369                    java.lang.String className, long classPK)
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    return getService()
372                                       .getActivitiesCount(mirrorActivityId, className, classPK);
373            }
374    
375            public static int getActivitiesCount(java.lang.String className)
376                    throws com.liferay.portal.kernel.exception.SystemException {
377                    return getService().getActivitiesCount(className);
378            }
379    
380            public static com.liferay.portlet.social.model.SocialActivity getActivity(
381                    long activityId)
382                    throws com.liferay.portal.kernel.exception.PortalException,
383                            com.liferay.portal.kernel.exception.SystemException {
384                    return getService().getActivity(activityId);
385            }
386    
387            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getGroupActivities(
388                    long groupId, int start, int end)
389                    throws com.liferay.portal.kernel.exception.SystemException {
390                    return getService().getGroupActivities(groupId, start, end);
391            }
392    
393            public static int getGroupActivitiesCount(long groupId)
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    return getService().getGroupActivitiesCount(groupId);
396            }
397    
398            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getGroupUsersActivities(
399                    long groupId, int start, int end)
400                    throws com.liferay.portal.kernel.exception.SystemException {
401                    return getService().getGroupUsersActivities(groupId, start, end);
402            }
403    
404            public static int getGroupUsersActivitiesCount(long groupId)
405                    throws com.liferay.portal.kernel.exception.SystemException {
406                    return getService().getGroupUsersActivitiesCount(groupId);
407            }
408    
409            public static com.liferay.portlet.social.model.SocialActivity getMirrorActivity(
410                    long mirrorActivityId)
411                    throws com.liferay.portal.kernel.exception.PortalException,
412                            com.liferay.portal.kernel.exception.SystemException {
413                    return getService().getMirrorActivity(mirrorActivityId);
414            }
415    
416            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getOrganizationActivities(
417                    long organizationId, int start, int end)
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    return getService().getOrganizationActivities(organizationId, start, end);
420            }
421    
422            public static int getOrganizationActivitiesCount(long organizationId)
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    return getService().getOrganizationActivitiesCount(organizationId);
425            }
426    
427            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getOrganizationUsersActivities(
428                    long organizationId, int start, int end)
429                    throws com.liferay.portal.kernel.exception.SystemException {
430                    return getService()
431                                       .getOrganizationUsersActivities(organizationId, start, end);
432            }
433    
434            public static int getOrganizationUsersActivitiesCount(long organizationId)
435                    throws com.liferay.portal.kernel.exception.SystemException {
436                    return getService().getOrganizationUsersActivitiesCount(organizationId);
437            }
438    
439            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getRelationActivities(
440                    long userId, int start, int end)
441                    throws com.liferay.portal.kernel.exception.SystemException {
442                    return getService().getRelationActivities(userId, start, end);
443            }
444    
445            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getRelationActivities(
446                    long userId, int type, int start, int end)
447                    throws com.liferay.portal.kernel.exception.SystemException {
448                    return getService().getRelationActivities(userId, type, start, end);
449            }
450    
451            public static int getRelationActivitiesCount(long userId)
452                    throws com.liferay.portal.kernel.exception.SystemException {
453                    return getService().getRelationActivitiesCount(userId);
454            }
455    
456            public static int getRelationActivitiesCount(long userId, int type)
457                    throws com.liferay.portal.kernel.exception.SystemException {
458                    return getService().getRelationActivitiesCount(userId, type);
459            }
460    
461            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserActivities(
462                    long userId, int start, int end)
463                    throws com.liferay.portal.kernel.exception.SystemException {
464                    return getService().getUserActivities(userId, start, end);
465            }
466    
467            public static int getUserActivitiesCount(long userId)
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    return getService().getUserActivitiesCount(userId);
470            }
471    
472            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserGroupsActivities(
473                    long userId, int start, int end)
474                    throws com.liferay.portal.kernel.exception.SystemException {
475                    return getService().getUserGroupsActivities(userId, start, end);
476            }
477    
478            public static int getUserGroupsActivitiesCount(long userId)
479                    throws com.liferay.portal.kernel.exception.SystemException {
480                    return getService().getUserGroupsActivitiesCount(userId);
481            }
482    
483            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserGroupsAndOrganizationsActivities(
484                    long userId, int start, int end)
485                    throws com.liferay.portal.kernel.exception.SystemException {
486                    return getService()
487                                       .getUserGroupsAndOrganizationsActivities(userId, start, end);
488            }
489    
490            public static int getUserGroupsAndOrganizationsActivitiesCount(long userId)
491                    throws com.liferay.portal.kernel.exception.SystemException {
492                    return getService().getUserGroupsAndOrganizationsActivitiesCount(userId);
493            }
494    
495            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> getUserOrganizationsActivities(
496                    long userId, int start, int end)
497                    throws com.liferay.portal.kernel.exception.SystemException {
498                    return getService().getUserOrganizationsActivities(userId, start, end);
499            }
500    
501            public static int getUserOrganizationsActivitiesCount(long userId)
502                    throws com.liferay.portal.kernel.exception.SystemException {
503                    return getService().getUserOrganizationsActivitiesCount(userId);
504            }
505    
506            public static SocialActivityLocalService getService() {
507                    if (_service == null) {
508                            _service = (SocialActivityLocalService)PortalBeanLocatorUtil.locate(SocialActivityLocalService.class.getName());
509    
510                            ReferenceRegistry.registerReference(SocialActivityLocalServiceUtil.class,
511                                    "_service");
512                            MethodCache.remove(SocialActivityLocalService.class);
513                    }
514    
515                    return _service;
516            }
517    
518            public void setService(SocialActivityLocalService service) {
519                    MethodCache.remove(SocialActivityLocalService.class);
520    
521                    _service = service;
522    
523                    ReferenceRegistry.registerReference(SocialActivityLocalServiceUtil.class,
524                            "_service");
525                    MethodCache.remove(SocialActivityLocalService.class);
526            }
527    
528            private static SocialActivityLocalService _service;
529    }