001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * The utility for the social request local service. This utility wraps {@link com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
022     *
023     * <p>
024     * 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.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see SocialRequestLocalService
029     * @see com.liferay.portlet.social.service.base.SocialRequestLocalServiceBaseImpl
030     * @see com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl
031     * @generated
032     */
033    public class SocialRequestLocalServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Adds the social request to the database. Also notifies the appropriate model listeners.
042            *
043            * @param socialRequest the social request
044            * @return the social request that was added
045            * @throws SystemException if a system exception occurred
046            */
047            public static com.liferay.portlet.social.model.SocialRequest addSocialRequest(
048                    com.liferay.portlet.social.model.SocialRequest socialRequest)
049                    throws com.liferay.portal.kernel.exception.SystemException {
050                    return getService().addSocialRequest(socialRequest);
051            }
052    
053            /**
054            * Creates a new social request with the primary key. Does not add the social request to the database.
055            *
056            * @param requestId the primary key for the new social request
057            * @return the new social request
058            */
059            public static com.liferay.portlet.social.model.SocialRequest createSocialRequest(
060                    long requestId) {
061                    return getService().createSocialRequest(requestId);
062            }
063    
064            /**
065            * Deletes the social request with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param requestId the primary key of the social request
068            * @return the social request that was removed
069            * @throws PortalException if a social request with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static com.liferay.portlet.social.model.SocialRequest deleteSocialRequest(
073                    long requestId)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException {
076                    return getService().deleteSocialRequest(requestId);
077            }
078    
079            /**
080            * Deletes the social request from the database. Also notifies the appropriate model listeners.
081            *
082            * @param socialRequest the social request
083            * @return the social request that was removed
084            * @throws SystemException if a system exception occurred
085            */
086            public static com.liferay.portlet.social.model.SocialRequest deleteSocialRequest(
087                    com.liferay.portlet.social.model.SocialRequest socialRequest)
088                    throws com.liferay.portal.kernel.exception.SystemException {
089                    return getService().deleteSocialRequest(socialRequest);
090            }
091    
092            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
093                    return getService().dynamicQuery();
094            }
095    
096            /**
097            * Performs a dynamic query on the database and returns the matching rows.
098            *
099            * @param dynamicQuery the dynamic query
100            * @return the matching rows
101            * @throws SystemException if a system exception occurred
102            */
103            @SuppressWarnings("rawtypes")
104            public static java.util.List dynamicQuery(
105                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
106                    throws com.liferay.portal.kernel.exception.SystemException {
107                    return getService().dynamicQuery(dynamicQuery);
108            }
109    
110            /**
111            * Performs a dynamic query on the database and returns a range of the matching rows.
112            *
113            * <p>
114            * 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.
115            * </p>
116            *
117            * @param dynamicQuery the dynamic query
118            * @param start the lower bound of the range of model instances
119            * @param end the upper bound of the range of model instances (not inclusive)
120            * @return the range of matching rows
121            * @throws SystemException if a system exception occurred
122            */
123            @SuppressWarnings("rawtypes")
124            public static java.util.List dynamicQuery(
125                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
126                    int end) throws com.liferay.portal.kernel.exception.SystemException {
127                    return getService().dynamicQuery(dynamicQuery, start, end);
128            }
129    
130            /**
131            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
132            *
133            * <p>
134            * 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.
135            * </p>
136            *
137            * @param dynamicQuery the dynamic query
138            * @param start the lower bound of the range of model instances
139            * @param end the upper bound of the range of model instances (not inclusive)
140            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
141            * @return the ordered range of matching rows
142            * @throws SystemException if a system exception occurred
143            */
144            @SuppressWarnings("rawtypes")
145            public static java.util.List dynamicQuery(
146                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
147                    int end,
148                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
149                    throws com.liferay.portal.kernel.exception.SystemException {
150                    return getService()
151                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
152            }
153    
154            /**
155            * Returns the number of rows that match the dynamic query.
156            *
157            * @param dynamicQuery the dynamic query
158            * @return the number of rows that match the dynamic query
159            * @throws SystemException if a system exception occurred
160            */
161            public static long dynamicQueryCount(
162                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().dynamicQueryCount(dynamicQuery);
165            }
166    
167            public static com.liferay.portlet.social.model.SocialRequest fetchSocialRequest(
168                    long requestId)
169                    throws com.liferay.portal.kernel.exception.SystemException {
170                    return getService().fetchSocialRequest(requestId);
171            }
172    
173            /**
174            * Returns the social request with the primary key.
175            *
176            * @param requestId the primary key of the social request
177            * @return the social request
178            * @throws PortalException if a social request with the primary key could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portlet.social.model.SocialRequest getSocialRequest(
182                    long requestId)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().getSocialRequest(requestId);
186            }
187    
188            public static com.liferay.portal.model.PersistedModel getPersistedModel(
189                    java.io.Serializable primaryKeyObj)
190                    throws com.liferay.portal.kernel.exception.PortalException,
191                            com.liferay.portal.kernel.exception.SystemException {
192                    return getService().getPersistedModel(primaryKeyObj);
193            }
194    
195            /**
196            * Returns the social request with the UUID in the group.
197            *
198            * @param uuid the UUID of social request
199            * @param groupId the group id of the social request
200            * @return the social request
201            * @throws PortalException if a social request with the UUID in the group could not be found
202            * @throws SystemException if a system exception occurred
203            */
204            public static com.liferay.portlet.social.model.SocialRequest getSocialRequestByUuidAndGroupId(
205                    java.lang.String uuid, long groupId)
206                    throws com.liferay.portal.kernel.exception.PortalException,
207                            com.liferay.portal.kernel.exception.SystemException {
208                    return getService().getSocialRequestByUuidAndGroupId(uuid, groupId);
209            }
210    
211            /**
212            * Returns a range of all the social requests.
213            *
214            * <p>
215            * 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.
216            * </p>
217            *
218            * @param start the lower bound of the range of social requests
219            * @param end the upper bound of the range of social requests (not inclusive)
220            * @return the range of social requests
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequests(
224                    int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getService().getSocialRequests(start, end);
227            }
228    
229            /**
230            * Returns the number of social requests.
231            *
232            * @return the number of social requests
233            * @throws SystemException if a system exception occurred
234            */
235            public static int getSocialRequestsCount()
236                    throws com.liferay.portal.kernel.exception.SystemException {
237                    return getService().getSocialRequestsCount();
238            }
239    
240            /**
241            * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
242            *
243            * @param socialRequest the social request
244            * @return the social request that was updated
245            * @throws SystemException if a system exception occurred
246            */
247            public static com.liferay.portlet.social.model.SocialRequest updateSocialRequest(
248                    com.liferay.portlet.social.model.SocialRequest socialRequest)
249                    throws com.liferay.portal.kernel.exception.SystemException {
250                    return getService().updateSocialRequest(socialRequest);
251            }
252    
253            /**
254            * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
255            *
256            * @param socialRequest the social request
257            * @param merge whether to merge the social request 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.
258            * @return the social request that was updated
259            * @throws SystemException if a system exception occurred
260            */
261            public static com.liferay.portlet.social.model.SocialRequest updateSocialRequest(
262                    com.liferay.portlet.social.model.SocialRequest socialRequest,
263                    boolean merge)
264                    throws com.liferay.portal.kernel.exception.SystemException {
265                    return getService().updateSocialRequest(socialRequest, merge);
266            }
267    
268            /**
269            * Returns the Spring bean ID for this bean.
270            *
271            * @return the Spring bean ID for this bean
272            */
273            public static java.lang.String getBeanIdentifier() {
274                    return getService().getBeanIdentifier();
275            }
276    
277            /**
278            * Sets the Spring bean ID for this bean.
279            *
280            * @param beanIdentifier the Spring bean ID for this bean
281            */
282            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
283                    getService().setBeanIdentifier(beanIdentifier);
284            }
285    
286            /**
287            * Adds a social request to the database.
288            *
289            * <p>
290            * In order to add a social request, both the requesting user and the
291            * receiving user must be from the same company and neither of them can be
292            * the default user.
293            * </p>
294            *
295            * @param userId the primary key of the requesting user
296            * @param groupId the primary key of the group
297            * @param className the class name of the asset that is the subject of the
298            request
299            * @param classPK the primary key of the asset that is the subject of the
300            request
301            * @param type the request's type
302            * @param extraData the extra data regarding the request
303            * @param receiverUserId the primary key of the user receiving the request
304            * @return the social request
305            * @throws PortalException if the users could not be found, if the users
306            were not from the same company, or if either of the users was the
307            default user
308            * @throws SystemException if a system exception occurred
309            */
310            public static com.liferay.portlet.social.model.SocialRequest addRequest(
311                    long userId, long groupId, java.lang.String className, long classPK,
312                    int type, java.lang.String extraData, long receiverUserId)
313                    throws com.liferay.portal.kernel.exception.PortalException,
314                            com.liferay.portal.kernel.exception.SystemException {
315                    return getService()
316                                       .addRequest(userId, groupId, className, classPK, type,
317                            extraData, receiverUserId);
318            }
319    
320            /**
321            * Removes all the social requests for the receiving user.
322            *
323            * @param receiverUserId the primary key of the receiving user
324            * @throws SystemException if a system exception occurred
325            */
326            public static void deleteReceiverUserRequests(long receiverUserId)
327                    throws com.liferay.portal.kernel.exception.SystemException {
328                    getService().deleteReceiverUserRequests(receiverUserId);
329            }
330    
331            /**
332            * Removes the social request identified by its primary key from the
333            * database.
334            *
335            * @param requestId the primary key of the social request
336            * @throws PortalException if the social request could not be found
337            * @throws SystemException if a system exception occurred
338            */
339            public static void deleteRequest(long requestId)
340                    throws com.liferay.portal.kernel.exception.PortalException,
341                            com.liferay.portal.kernel.exception.SystemException {
342                    getService().deleteRequest(requestId);
343            }
344    
345            /**
346            * Removes the social request from the database.
347            *
348            * @param request the social request to be removed
349            * @throws SystemException if a system exception occurred
350            */
351            public static void deleteRequest(
352                    com.liferay.portlet.social.model.SocialRequest request)
353                    throws com.liferay.portal.kernel.exception.SystemException {
354                    getService().deleteRequest(request);
355            }
356    
357            /**
358            * Removes all the social requests for the requesting user.
359            *
360            * @param userId the primary key of the requesting user
361            * @throws SystemException if a system exception occurred
362            */
363            public static void deleteUserRequests(long userId)
364                    throws com.liferay.portal.kernel.exception.SystemException {
365                    getService().deleteUserRequests(userId);
366            }
367    
368            /**
369            * Returns a range of all the social requests for the receiving user.
370            *
371            * <p>
372            * Useful when paginating results. Returns a maximum of <code>end -
373            * start</code> instances. <code>start</code> and <code>end</code> are not
374            * primary keys, they are indexes in the result set. Thus, <code>0</code>
375            * refers to the first result in the set. Setting both <code>start</code>
376            * and <code>end</code> to {@link
377            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
378            * result set.
379            * </p>
380            *
381            * @param receiverUserId the primary key of the receiving user
382            * @param start the lower bound of the range of results
383            * @param end the upper bound of the range of results (not inclusive)
384            * @return the range of matching social requests
385            * @throws SystemException if a system exception occurred
386            */
387            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests(
388                    long receiverUserId, int start, int end)
389                    throws com.liferay.portal.kernel.exception.SystemException {
390                    return getService().getReceiverUserRequests(receiverUserId, start, end);
391            }
392    
393            /**
394            * Returns a range of all the social requests with the given status for the
395            * receiving user.
396            *
397            * <p>
398            * Useful when paginating results. Returns a maximum of <code>end -
399            * start</code> instances. <code>start</code> and <code>end</code> are not
400            * primary keys, they are indexes in the result set. Thus, <code>0</code>
401            * refers to the first result in the set. Setting both <code>start</code>
402            * and <code>end</code> to {@link
403            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
404            * result set.
405            * </p>
406            *
407            * @param receiverUserId the primary key of the receiving user
408            * @param status the social request's status
409            * @param start the lower bound of the range of results
410            * @param end the upper bound of the range of results (not inclusive)
411            * @return the range of matching social requests
412            * @throws SystemException if a system exception occurred
413            */
414            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests(
415                    long receiverUserId, int status, int start, int end)
416                    throws com.liferay.portal.kernel.exception.SystemException {
417                    return getService()
418                                       .getReceiverUserRequests(receiverUserId, status, start, end);
419            }
420    
421            /**
422            * Returns the number of social requests for the receiving user.
423            *
424            * @param receiverUserId the primary key of the receiving user
425            * @return the number of matching social requests
426            * @throws SystemException if a system exception occurred
427            */
428            public static int getReceiverUserRequestsCount(long receiverUserId)
429                    throws com.liferay.portal.kernel.exception.SystemException {
430                    return getService().getReceiverUserRequestsCount(receiverUserId);
431            }
432    
433            /**
434            * Returns the number of social requests with the given status for the
435            * receiving user.
436            *
437            * @param receiverUserId the primary key of the receiving user
438            * @param status the social request's status
439            * @return the number of matching social requests
440            * @throws SystemException if a system exception occurred
441            */
442            public static int getReceiverUserRequestsCount(long receiverUserId,
443                    int status) throws com.liferay.portal.kernel.exception.SystemException {
444                    return getService().getReceiverUserRequestsCount(receiverUserId, status);
445            }
446    
447            /**
448            * Returns a range of all the social requests for the requesting user.
449            *
450            * <p>
451            * Useful when paginating results. Returns a maximum of <code>end -
452            * start</code> instances. <code>start</code> and <code>end</code> are not
453            * primary keys, they are indexes in the result set. Thus, <code>0</code>
454            * refers to the first result in the set. Setting both <code>start</code>
455            * and <code>end</code> to {@link
456            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
457            * result set.
458            * </p>
459            *
460            * @param userId the primary key of the requesting user
461            * @param start the lower bound of the range of results
462            * @param end the upper bound of the range of results (not inclusive)
463            * @return the range of matching social requests
464            * @throws SystemException if a system exception occurred
465            */
466            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests(
467                    long userId, int start, int end)
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    return getService().getUserRequests(userId, start, end);
470            }
471    
472            /**
473            * Returns a range of all the social requests with the given status for the
474            * requesting user.
475            *
476            * <p>
477            * Useful when paginating results. Returns a maximum of <code>end -
478            * start</code> instances. <code>start</code> and <code>end</code> are not
479            * primary keys, they are indexes in the result set. Thus, <code>0</code>
480            * refers to the first result in the set. Setting both <code>start</code>
481            * and <code>end</code> to {@link
482            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
483            * result set.
484            * </p>
485            *
486            * @param userId the primary key of the requesting user
487            * @param status the social request's status
488            * @param start the lower bound of the range of results
489            * @param end the upper bound of the range of results (not inclusive)
490            * @return the range of matching social requests
491            * @throws SystemException if a system exception occurred
492            */
493            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests(
494                    long userId, int status, int start, int end)
495                    throws com.liferay.portal.kernel.exception.SystemException {
496                    return getService().getUserRequests(userId, status, start, end);
497            }
498    
499            /**
500            * Returns the number of social requests for the requesting user.
501            *
502            * @param userId the primary key of the requesting user
503            * @return the number of matching social requests
504            * @throws SystemException if a system exception occurred
505            */
506            public static int getUserRequestsCount(long userId)
507                    throws com.liferay.portal.kernel.exception.SystemException {
508                    return getService().getUserRequestsCount(userId);
509            }
510    
511            /**
512            * Returns the number of social requests with the given status for the
513            * requesting user.
514            *
515            * @param userId the primary key of the requesting user
516            * @param status the social request's status
517            * @return the number of matching social request
518            * @throws SystemException if a system exception occurred
519            */
520            public static int getUserRequestsCount(long userId, int status)
521                    throws com.liferay.portal.kernel.exception.SystemException {
522                    return getService().getUserRequestsCount(userId, status);
523            }
524    
525            /**
526            * Returns <code>true</code> if a matching social requests exists in the
527            * database.
528            *
529            * @param userId the primary key of the requesting user
530            * @param className the class name of the asset that is the subject of the
531            request
532            * @param classPK the primary key of the asset that is the subject of the
533            request
534            * @param type the request's type
535            * @param status the social request's status
536            * @return <code>true</code> if the request exists; <code>false</code>
537            otherwise
538            * @throws SystemException if a system exception occurred
539            */
540            public static boolean hasRequest(long userId, java.lang.String className,
541                    long classPK, int type, int status)
542                    throws com.liferay.portal.kernel.exception.SystemException {
543                    return getService().hasRequest(userId, className, classPK, type, status);
544            }
545    
546            /**
547            * Returns <code>true</code> if a matching social request exists in the
548            * database.
549            *
550            * @param userId the primary key of the requesting user
551            * @param className the class name of the asset that is the subject of the
552            request
553            * @param classPK the primary key of the asset that is the subject of the
554            request
555            * @param type the request's type
556            * @param receiverUserId the primary key of the receiving user
557            * @param status the social request's status
558            * @return <code>true</code> if the social request exists;
559            <code>false</code> otherwise
560            * @throws SystemException if a system exception occurred
561            */
562            public static boolean hasRequest(long userId, java.lang.String className,
563                    long classPK, int type, long receiverUserId, int status)
564                    throws com.liferay.portal.kernel.exception.SystemException {
565                    return getService()
566                                       .hasRequest(userId, className, classPK, type,
567                            receiverUserId, status);
568            }
569    
570            /**
571            * Updates the social request replacing its status.
572            *
573            * <p>
574            * If the status is updated to {@link
575            * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_CONFIRM}
576            * then {@link
577            * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processConfirmation(
578            * SocialRequest, ThemeDisplay)} is called. If the status is updated to
579            * {@link
580            * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_IGNORE}
581            * then {@link
582            * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processRejection(
583            * SocialRequest, ThemeDisplay)} is called.
584            * </p>
585            *
586            * @param requestId the primary key of the social request
587            * @param status the new status
588            * @param themeDisplay the theme display
589            * @return the updated social request
590            * @throws PortalException if the social request could not be found
591            * @throws SystemException if a system exception occurred
592            */
593            public static com.liferay.portlet.social.model.SocialRequest updateRequest(
594                    long requestId, int status,
595                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
596                    throws com.liferay.portal.kernel.exception.PortalException,
597                            com.liferay.portal.kernel.exception.SystemException {
598                    return getService().updateRequest(requestId, status, themeDisplay);
599            }
600    
601            public static SocialRequestLocalService getService() {
602                    if (_service == null) {
603                            _service = (SocialRequestLocalService)PortalBeanLocatorUtil.locate(SocialRequestLocalService.class.getName());
604    
605                            ReferenceRegistry.registerReference(SocialRequestLocalServiceUtil.class,
606                                    "_service");
607                    }
608    
609                    return _service;
610            }
611    
612            /**
613             * @deprecated
614             */
615            public void setService(SocialRequestLocalService service) {
616            }
617    
618            private static SocialRequestLocalService _service;
619    }