001    /**
002     * Copyright (c) 2000-2012 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.messageboards.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 message boards category local service. This utility wraps {@link com.liferay.portlet.messageboards.service.impl.MBCategoryLocalServiceImpl} 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 MBCategoryLocalService
030     * @see com.liferay.portlet.messageboards.service.base.MBCategoryLocalServiceBaseImpl
031     * @see com.liferay.portlet.messageboards.service.impl.MBCategoryLocalServiceImpl
032     * @generated
033     */
034    public class MBCategoryLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBCategoryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the message boards category to the database. Also notifies the appropriate model listeners.
043            *
044            * @param mbCategory the message boards category
045            * @return the message boards category that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.messageboards.model.MBCategory addMBCategory(
049                    com.liferay.portlet.messageboards.model.MBCategory mbCategory)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addMBCategory(mbCategory);
052            }
053    
054            /**
055            * Creates a new message boards category with the primary key. Does not add the message boards category to the database.
056            *
057            * @param categoryId the primary key for the new message boards category
058            * @return the new message boards category
059            */
060            public static com.liferay.portlet.messageboards.model.MBCategory createMBCategory(
061                    long categoryId) {
062                    return getService().createMBCategory(categoryId);
063            }
064    
065            /**
066            * Deletes the message boards category with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param categoryId the primary key of the message boards category
069            * @throws PortalException if a message boards category with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteMBCategory(long categoryId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteMBCategory(categoryId);
076            }
077    
078            /**
079            * Deletes the message boards category from the database. Also notifies the appropriate model listeners.
080            *
081            * @param mbCategory the message boards category
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteMBCategory(
085                    com.liferay.portlet.messageboards.model.MBCategory mbCategory)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteMBCategory(mbCategory);
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            public static com.liferay.portlet.messageboards.model.MBCategory fetchMBCategory(
162                    long categoryId)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().fetchMBCategory(categoryId);
165            }
166    
167            /**
168            * Returns the message boards category with the primary key.
169            *
170            * @param categoryId the primary key of the message boards category
171            * @return the message boards category
172            * @throws PortalException if a message boards category with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portlet.messageboards.model.MBCategory getMBCategory(
176                    long categoryId)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getService().getMBCategory(categoryId);
180            }
181    
182            public static com.liferay.portal.model.PersistedModel getPersistedModel(
183                    java.io.Serializable primaryKeyObj)
184                    throws com.liferay.portal.kernel.exception.PortalException,
185                            com.liferay.portal.kernel.exception.SystemException {
186                    return getService().getPersistedModel(primaryKeyObj);
187            }
188    
189            /**
190            * Returns the message boards category with the UUID in the group.
191            *
192            * @param uuid the UUID of message boards category
193            * @param groupId the group id of the message boards category
194            * @return the message boards category
195            * @throws PortalException if a message boards category with the UUID in the group could not be found
196            * @throws SystemException if a system exception occurred
197            */
198            public static com.liferay.portlet.messageboards.model.MBCategory getMBCategoryByUuidAndGroupId(
199                    java.lang.String uuid, long groupId)
200                    throws com.liferay.portal.kernel.exception.PortalException,
201                            com.liferay.portal.kernel.exception.SystemException {
202                    return getService().getMBCategoryByUuidAndGroupId(uuid, groupId);
203            }
204    
205            /**
206            * Returns a range of all the message boards categories.
207            *
208            * <p>
209            * 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.
210            * </p>
211            *
212            * @param start the lower bound of the range of message boards categories
213            * @param end the upper bound of the range of message boards categories (not inclusive)
214            * @return the range of message boards categories
215            * @throws SystemException if a system exception occurred
216            */
217            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getMBCategories(
218                    int start, int end)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getService().getMBCategories(start, end);
221            }
222    
223            /**
224            * Returns the number of message boards categories.
225            *
226            * @return the number of message boards categories
227            * @throws SystemException if a system exception occurred
228            */
229            public static int getMBCategoriesCount()
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getService().getMBCategoriesCount();
232            }
233    
234            /**
235            * Updates the message boards category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
236            *
237            * @param mbCategory the message boards category
238            * @return the message boards category that was updated
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portlet.messageboards.model.MBCategory updateMBCategory(
242                    com.liferay.portlet.messageboards.model.MBCategory mbCategory)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getService().updateMBCategory(mbCategory);
245            }
246    
247            /**
248            * Updates the message boards category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
249            *
250            * @param mbCategory the message boards category
251            * @param merge whether to merge the message boards category 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.
252            * @return the message boards category that was updated
253            * @throws SystemException if a system exception occurred
254            */
255            public static com.liferay.portlet.messageboards.model.MBCategory updateMBCategory(
256                    com.liferay.portlet.messageboards.model.MBCategory mbCategory,
257                    boolean merge)
258                    throws com.liferay.portal.kernel.exception.SystemException {
259                    return getService().updateMBCategory(mbCategory, merge);
260            }
261    
262            /**
263            * Returns the Spring bean ID for this bean.
264            *
265            * @return the Spring bean ID for this bean
266            */
267            public static java.lang.String getBeanIdentifier() {
268                    return getService().getBeanIdentifier();
269            }
270    
271            /**
272            * Sets the Spring bean ID for this bean.
273            *
274            * @param beanIdentifier the Spring bean ID for this bean
275            */
276            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
277                    getService().setBeanIdentifier(beanIdentifier);
278            }
279    
280            public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
281                    long userId, long parentCategoryId, java.lang.String name,
282                    java.lang.String description, java.lang.String displayStyle,
283                    java.lang.String emailAddress, java.lang.String inProtocol,
284                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
285                    java.lang.String inUserName, java.lang.String inPassword,
286                    int inReadInterval, java.lang.String outEmailAddress,
287                    boolean outCustom, java.lang.String outServerName, int outServerPort,
288                    boolean outUseSSL, java.lang.String outUserName,
289                    java.lang.String outPassword, boolean allowAnonymous,
290                    boolean mailingListActive,
291                    com.liferay.portal.service.ServiceContext serviceContext)
292                    throws com.liferay.portal.kernel.exception.PortalException,
293                            com.liferay.portal.kernel.exception.SystemException {
294                    return getService()
295                                       .addCategory(userId, parentCategoryId, name, description,
296                            displayStyle, emailAddress, inProtocol, inServerName, inServerPort,
297                            inUseSSL, inUserName, inPassword, inReadInterval, outEmailAddress,
298                            outCustom, outServerName, outServerPort, outUseSSL, outUserName,
299                            outPassword, allowAnonymous, mailingListActive, serviceContext);
300            }
301    
302            public static void addCategoryResources(long categoryId,
303                    boolean addGroupPermissions, boolean addGuestPermissions)
304                    throws com.liferay.portal.kernel.exception.PortalException,
305                            com.liferay.portal.kernel.exception.SystemException {
306                    getService()
307                            .addCategoryResources(categoryId, addGroupPermissions,
308                            addGuestPermissions);
309            }
310    
311            public static void addCategoryResources(long categoryId,
312                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
313                    throws com.liferay.portal.kernel.exception.PortalException,
314                            com.liferay.portal.kernel.exception.SystemException {
315                    getService()
316                            .addCategoryResources(categoryId, groupPermissions, guestPermissions);
317            }
318    
319            public static void addCategoryResources(
320                    com.liferay.portlet.messageboards.model.MBCategory category,
321                    boolean addGroupPermissions, boolean addGuestPermissions)
322                    throws com.liferay.portal.kernel.exception.PortalException,
323                            com.liferay.portal.kernel.exception.SystemException {
324                    getService()
325                            .addCategoryResources(category, addGroupPermissions,
326                            addGuestPermissions);
327            }
328    
329            public static void addCategoryResources(
330                    com.liferay.portlet.messageboards.model.MBCategory category,
331                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
332                    throws com.liferay.portal.kernel.exception.PortalException,
333                            com.liferay.portal.kernel.exception.SystemException {
334                    getService()
335                            .addCategoryResources(category, groupPermissions, guestPermissions);
336            }
337    
338            public static void deleteCategories(long groupId)
339                    throws com.liferay.portal.kernel.exception.PortalException,
340                            com.liferay.portal.kernel.exception.SystemException {
341                    getService().deleteCategories(groupId);
342            }
343    
344            public static void deleteCategory(long categoryId)
345                    throws com.liferay.portal.kernel.exception.PortalException,
346                            com.liferay.portal.kernel.exception.SystemException {
347                    getService().deleteCategory(categoryId);
348            }
349    
350            public static void deleteCategory(
351                    com.liferay.portlet.messageboards.model.MBCategory category)
352                    throws com.liferay.portal.kernel.exception.PortalException,
353                            com.liferay.portal.kernel.exception.SystemException {
354                    getService().deleteCategory(category);
355            }
356    
357            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
358                    long groupId)
359                    throws com.liferay.portal.kernel.exception.SystemException {
360                    return getService().getCategories(groupId);
361            }
362    
363            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
364                    long groupId, long parentCategoryId, int start, int end)
365                    throws com.liferay.portal.kernel.exception.SystemException {
366                    return getService().getCategories(groupId, parentCategoryId, start, end);
367            }
368    
369            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
370                    long groupId, long[] parentCategoryIds, int start, int end)
371                    throws com.liferay.portal.kernel.exception.SystemException {
372                    return getService().getCategories(groupId, parentCategoryIds, start, end);
373            }
374    
375            public static int getCategoriesCount(long groupId)
376                    throws com.liferay.portal.kernel.exception.SystemException {
377                    return getService().getCategoriesCount(groupId);
378            }
379    
380            public static int getCategoriesCount(long groupId, long parentCategoryId)
381                    throws com.liferay.portal.kernel.exception.SystemException {
382                    return getService().getCategoriesCount(groupId, parentCategoryId);
383            }
384    
385            public static int getCategoriesCount(long groupId, long[] parentCategoryIds)
386                    throws com.liferay.portal.kernel.exception.SystemException {
387                    return getService().getCategoriesCount(groupId, parentCategoryIds);
388            }
389    
390            public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
391                    long categoryId)
392                    throws com.liferay.portal.kernel.exception.PortalException,
393                            com.liferay.portal.kernel.exception.SystemException {
394                    return getService().getCategory(categoryId);
395            }
396    
397            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCompanyCategories(
398                    long companyId, int start, int end)
399                    throws com.liferay.portal.kernel.exception.SystemException {
400                    return getService().getCompanyCategories(companyId, start, end);
401            }
402    
403            public static int getCompanyCategoriesCount(long companyId)
404                    throws com.liferay.portal.kernel.exception.SystemException {
405                    return getService().getCompanyCategoriesCount(companyId);
406            }
407    
408            public static java.util.List<java.lang.Long> getSubcategoryIds(
409                    java.util.List<java.lang.Long> categoryIds, long groupId,
410                    long categoryId)
411                    throws com.liferay.portal.kernel.exception.SystemException {
412                    return getService().getSubcategoryIds(categoryIds, groupId, categoryId);
413            }
414    
415            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getSubscribedCategories(
416                    long groupId, long userId, int start, int end)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    return getService().getSubscribedCategories(groupId, userId, start, end);
419            }
420    
421            public static int getSubscribedCategoriesCount(long groupId, long userId)
422                    throws com.liferay.portal.kernel.exception.SystemException {
423                    return getService().getSubscribedCategoriesCount(groupId, userId);
424            }
425    
426            public static void subscribeCategory(long userId, long groupId,
427                    long categoryId)
428                    throws com.liferay.portal.kernel.exception.PortalException,
429                            com.liferay.portal.kernel.exception.SystemException {
430                    getService().subscribeCategory(userId, groupId, categoryId);
431            }
432    
433            public static void unsubscribeCategory(long userId, long groupId,
434                    long categoryId)
435                    throws com.liferay.portal.kernel.exception.PortalException,
436                            com.liferay.portal.kernel.exception.SystemException {
437                    getService().unsubscribeCategory(userId, groupId, categoryId);
438            }
439    
440            public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
441                    long categoryId, long parentCategoryId, java.lang.String name,
442                    java.lang.String description, java.lang.String displayStyle,
443                    java.lang.String emailAddress, java.lang.String inProtocol,
444                    java.lang.String inServerName, int inServerPort, boolean inUseSSL,
445                    java.lang.String inUserName, java.lang.String inPassword,
446                    int inReadInterval, java.lang.String outEmailAddress,
447                    boolean outCustom, java.lang.String outServerName, int outServerPort,
448                    boolean outUseSSL, java.lang.String outUserName,
449                    java.lang.String outPassword, boolean allowAnonymous,
450                    boolean mailingListActive, boolean mergeWithParentCategory,
451                    com.liferay.portal.service.ServiceContext serviceContext)
452                    throws com.liferay.portal.kernel.exception.PortalException,
453                            com.liferay.portal.kernel.exception.SystemException {
454                    return getService()
455                                       .updateCategory(categoryId, parentCategoryId, name,
456                            description, displayStyle, emailAddress, inProtocol, inServerName,
457                            inServerPort, inUseSSL, inUserName, inPassword, inReadInterval,
458                            outEmailAddress, outCustom, outServerName, outServerPort,
459                            outUseSSL, outUserName, outPassword, allowAnonymous,
460                            mailingListActive, mergeWithParentCategory, serviceContext);
461            }
462    
463            public static MBCategoryLocalService getService() {
464                    if (_service == null) {
465                            _service = (MBCategoryLocalService)PortalBeanLocatorUtil.locate(MBCategoryLocalService.class.getName());
466    
467                            ReferenceRegistry.registerReference(MBCategoryLocalServiceUtil.class,
468                                    "_service");
469                            MethodCache.remove(MBCategoryLocalService.class);
470                    }
471    
472                    return _service;
473            }
474    
475            public void setService(MBCategoryLocalService service) {
476                    MethodCache.remove(MBCategoryLocalService.class);
477    
478                    _service = service;
479    
480                    ReferenceRegistry.registerReference(MBCategoryLocalServiceUtil.class,
481                            "_service");
482                    MethodCache.remove(MBCategoryLocalService.class);
483            }
484    
485            private static MBCategoryLocalService _service;
486    }