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 activity achievement local service. This utility wraps {@link com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl} 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 SocialActivityAchievementLocalService
029     * @see com.liferay.portlet.social.service.base.SocialActivityAchievementLocalServiceBaseImpl
030     * @see com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl
031     * @generated
032     */
033    public class SocialActivityAchievementLocalServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Adds the social activity achievement to the database. Also notifies the appropriate model listeners.
042            *
043            * @param socialActivityAchievement the social activity achievement
044            * @return the social activity achievement that was added
045            * @throws SystemException if a system exception occurred
046            */
047            public static com.liferay.portlet.social.model.SocialActivityAchievement addSocialActivityAchievement(
048                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement)
049                    throws com.liferay.portal.kernel.exception.SystemException {
050                    return getService()
051                                       .addSocialActivityAchievement(socialActivityAchievement);
052            }
053    
054            /**
055            * Creates a new social activity achievement with the primary key. Does not add the social activity achievement to the database.
056            *
057            * @param activityAchievementId the primary key for the new social activity achievement
058            * @return the new social activity achievement
059            */
060            public static com.liferay.portlet.social.model.SocialActivityAchievement createSocialActivityAchievement(
061                    long activityAchievementId) {
062                    return getService()
063                                       .createSocialActivityAchievement(activityAchievementId);
064            }
065    
066            /**
067            * Deletes the social activity achievement with the primary key from the database. Also notifies the appropriate model listeners.
068            *
069            * @param activityAchievementId the primary key of the social activity achievement
070            * @return the social activity achievement that was removed
071            * @throws PortalException if a social activity achievement with the primary key could not be found
072            * @throws SystemException if a system exception occurred
073            */
074            public static com.liferay.portlet.social.model.SocialActivityAchievement deleteSocialActivityAchievement(
075                    long activityAchievementId)
076                    throws com.liferay.portal.kernel.exception.PortalException,
077                            com.liferay.portal.kernel.exception.SystemException {
078                    return getService()
079                                       .deleteSocialActivityAchievement(activityAchievementId);
080            }
081    
082            /**
083            * Deletes the social activity achievement from the database. Also notifies the appropriate model listeners.
084            *
085            * @param socialActivityAchievement the social activity achievement
086            * @return the social activity achievement that was removed
087            * @throws SystemException if a system exception occurred
088            */
089            public static com.liferay.portlet.social.model.SocialActivityAchievement deleteSocialActivityAchievement(
090                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement)
091                    throws com.liferay.portal.kernel.exception.SystemException {
092                    return getService()
093                                       .deleteSocialActivityAchievement(socialActivityAchievement);
094            }
095    
096            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
097                    return getService().dynamicQuery();
098            }
099    
100            /**
101            * Performs a dynamic query on the database and returns the matching rows.
102            *
103            * @param dynamicQuery the dynamic query
104            * @return the matching rows
105            * @throws SystemException if a system exception occurred
106            */
107            @SuppressWarnings("rawtypes")
108            public static java.util.List dynamicQuery(
109                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
110                    throws com.liferay.portal.kernel.exception.SystemException {
111                    return getService().dynamicQuery(dynamicQuery);
112            }
113    
114            /**
115            * Performs a dynamic query on the database and returns a range of the matching rows.
116            *
117            * <p>
118            * 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.
119            * </p>
120            *
121            * @param dynamicQuery the dynamic query
122            * @param start the lower bound of the range of model instances
123            * @param end the upper bound of the range of model instances (not inclusive)
124            * @return the range of matching rows
125            * @throws SystemException if a system exception occurred
126            */
127            @SuppressWarnings("rawtypes")
128            public static java.util.List dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
130                    int end) throws com.liferay.portal.kernel.exception.SystemException {
131                    return getService().dynamicQuery(dynamicQuery, start, end);
132            }
133    
134            /**
135            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
136            *
137            * <p>
138            * 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.
139            * </p>
140            *
141            * @param dynamicQuery the dynamic query
142            * @param start the lower bound of the range of model instances
143            * @param end the upper bound of the range of model instances (not inclusive)
144            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
145            * @return the ordered range of matching rows
146            * @throws SystemException if a system exception occurred
147            */
148            @SuppressWarnings("rawtypes")
149            public static java.util.List dynamicQuery(
150                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
151                    int end,
152                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
153                    throws com.liferay.portal.kernel.exception.SystemException {
154                    return getService()
155                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
156            }
157    
158            /**
159            * Returns the number of rows that match the dynamic query.
160            *
161            * @param dynamicQuery the dynamic query
162            * @return the number of rows that match the dynamic query
163            * @throws SystemException if a system exception occurred
164            */
165            public static long dynamicQueryCount(
166                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
167                    throws com.liferay.portal.kernel.exception.SystemException {
168                    return getService().dynamicQueryCount(dynamicQuery);
169            }
170    
171            public static com.liferay.portlet.social.model.SocialActivityAchievement fetchSocialActivityAchievement(
172                    long activityAchievementId)
173                    throws com.liferay.portal.kernel.exception.SystemException {
174                    return getService().fetchSocialActivityAchievement(activityAchievementId);
175            }
176    
177            /**
178            * Returns the social activity achievement with the primary key.
179            *
180            * @param activityAchievementId the primary key of the social activity achievement
181            * @return the social activity achievement
182            * @throws PortalException if a social activity achievement with the primary key could not be found
183            * @throws SystemException if a system exception occurred
184            */
185            public static com.liferay.portlet.social.model.SocialActivityAchievement getSocialActivityAchievement(
186                    long activityAchievementId)
187                    throws com.liferay.portal.kernel.exception.PortalException,
188                            com.liferay.portal.kernel.exception.SystemException {
189                    return getService().getSocialActivityAchievement(activityAchievementId);
190            }
191    
192            public static com.liferay.portal.model.PersistedModel getPersistedModel(
193                    java.io.Serializable primaryKeyObj)
194                    throws com.liferay.portal.kernel.exception.PortalException,
195                            com.liferay.portal.kernel.exception.SystemException {
196                    return getService().getPersistedModel(primaryKeyObj);
197            }
198    
199            /**
200            * Returns a range of all the social activity achievements.
201            *
202            * <p>
203            * 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.
204            * </p>
205            *
206            * @param start the lower bound of the range of social activity achievements
207            * @param end the upper bound of the range of social activity achievements (not inclusive)
208            * @return the range of social activity achievements
209            * @throws SystemException if a system exception occurred
210            */
211            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getSocialActivityAchievements(
212                    int start, int end)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getService().getSocialActivityAchievements(start, end);
215            }
216    
217            /**
218            * Returns the number of social activity achievements.
219            *
220            * @return the number of social activity achievements
221            * @throws SystemException if a system exception occurred
222            */
223            public static int getSocialActivityAchievementsCount()
224                    throws com.liferay.portal.kernel.exception.SystemException {
225                    return getService().getSocialActivityAchievementsCount();
226            }
227    
228            /**
229            * Updates the social activity achievement in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
230            *
231            * @param socialActivityAchievement the social activity achievement
232            * @return the social activity achievement that was updated
233            * @throws SystemException if a system exception occurred
234            */
235            public static com.liferay.portlet.social.model.SocialActivityAchievement updateSocialActivityAchievement(
236                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getService()
239                                       .updateSocialActivityAchievement(socialActivityAchievement);
240            }
241    
242            /**
243            * Updates the social activity achievement in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
244            *
245            * @param socialActivityAchievement the social activity achievement
246            * @param merge whether to merge the social activity achievement 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.
247            * @return the social activity achievement that was updated
248            * @throws SystemException if a system exception occurred
249            */
250            public static com.liferay.portlet.social.model.SocialActivityAchievement updateSocialActivityAchievement(
251                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement,
252                    boolean merge)
253                    throws com.liferay.portal.kernel.exception.SystemException {
254                    return getService()
255                                       .updateSocialActivityAchievement(socialActivityAchievement,
256                            merge);
257            }
258    
259            /**
260            * Returns the Spring bean ID for this bean.
261            *
262            * @return the Spring bean ID for this bean
263            */
264            public static java.lang.String getBeanIdentifier() {
265                    return getService().getBeanIdentifier();
266            }
267    
268            /**
269            * Sets the Spring bean ID for this bean.
270            *
271            * @param beanIdentifier the Spring bean ID for this bean
272            */
273            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
274                    getService().setBeanIdentifier(beanIdentifier);
275            }
276    
277            public static void addActivityAchievement(long userId, long groupId,
278                    com.liferay.portlet.social.model.SocialAchievement achievement)
279                    throws com.liferay.portal.kernel.exception.PortalException,
280                            com.liferay.portal.kernel.exception.SystemException {
281                    getService().addActivityAchievement(userId, groupId, achievement);
282            }
283    
284            public static com.liferay.portlet.social.model.SocialActivityAchievement fetchUserAchievement(
285                    long userId, long groupId, java.lang.String name)
286                    throws com.liferay.portal.kernel.exception.SystemException {
287                    return getService().fetchUserAchievement(userId, groupId, name);
288            }
289    
290            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getGroupAchievements(
291                    long groupId)
292                    throws com.liferay.portal.kernel.exception.SystemException {
293                    return getService().getGroupAchievements(groupId);
294            }
295    
296            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getGroupAchievements(
297                    long groupId, java.lang.String name)
298                    throws com.liferay.portal.kernel.exception.SystemException {
299                    return getService().getGroupAchievements(groupId, name);
300            }
301    
302            public static int getGroupAchievementsCount(long groupId)
303                    throws com.liferay.portal.kernel.exception.SystemException {
304                    return getService().getGroupAchievementsCount(groupId);
305            }
306    
307            public static int getGroupAchievementsCount(long groupId,
308                    java.lang.String name)
309                    throws com.liferay.portal.kernel.exception.SystemException {
310                    return getService().getGroupAchievementsCount(groupId, name);
311            }
312    
313            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getGroupFirstAchievements(
314                    long groupId)
315                    throws com.liferay.portal.kernel.exception.SystemException {
316                    return getService().getGroupFirstAchievements(groupId);
317            }
318    
319            public static int getGroupFirstAchievementsCount(long groupId)
320                    throws com.liferay.portal.kernel.exception.SystemException {
321                    return getService().getGroupFirstAchievementsCount(groupId);
322            }
323    
324            public static int getUserAchievementCount(long userId, long groupId,
325                    java.lang.String name)
326                    throws com.liferay.portal.kernel.exception.SystemException {
327                    return getService().getUserAchievementCount(userId, groupId, name);
328            }
329    
330            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getUserAchievements(
331                    long userId, long groupId, java.lang.String name)
332                    throws com.liferay.portal.kernel.exception.SystemException {
333                    return getService().getUserAchievements(userId, groupId, name);
334            }
335    
336            public static SocialActivityAchievementLocalService getService() {
337                    if (_service == null) {
338                            _service = (SocialActivityAchievementLocalService)PortalBeanLocatorUtil.locate(SocialActivityAchievementLocalService.class.getName());
339    
340                            ReferenceRegistry.registerReference(SocialActivityAchievementLocalServiceUtil.class,
341                                    "_service");
342                    }
343    
344                    return _service;
345            }
346    
347            /**
348             * @deprecated
349             */
350            public void setService(SocialActivityAchievementLocalService service) {
351            }
352    
353            private static SocialActivityAchievementLocalService _service;
354    }