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.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            /**
162            * Returns the message boards category with the primary key.
163            *
164            * @param categoryId the primary key of the message boards category
165            * @return the message boards category
166            * @throws PortalException if a message boards category with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portlet.messageboards.model.MBCategory getMBCategory(
170                    long categoryId)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getService().getMBCategory(categoryId);
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 the message boards category with the UUID in the group.
185            *
186            * @param uuid the UUID of message boards category
187            * @param groupId the group id of the message boards category
188            * @return the message boards category
189            * @throws PortalException if a message boards category with the UUID in the group could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portlet.messageboards.model.MBCategory getMBCategoryByUuidAndGroupId(
193                    java.lang.String uuid, long groupId)
194                    throws com.liferay.portal.kernel.exception.PortalException,
195                            com.liferay.portal.kernel.exception.SystemException {
196                    return getService().getMBCategoryByUuidAndGroupId(uuid, groupId);
197            }
198    
199            /**
200            * Returns a range of all the message boards categories.
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 message boards categories
207            * @param end the upper bound of the range of message boards categories (not inclusive)
208            * @return the range of message boards categories
209            * @throws SystemException if a system exception occurred
210            */
211            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getMBCategories(
212                    int start, int end)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getService().getMBCategories(start, end);
215            }
216    
217            /**
218            * Returns the number of message boards categories.
219            *
220            * @return the number of message boards categories
221            * @throws SystemException if a system exception occurred
222            */
223            public static int getMBCategoriesCount()
224                    throws com.liferay.portal.kernel.exception.SystemException {
225                    return getService().getMBCategoriesCount();
226            }
227    
228            /**
229            * Updates the message boards category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
230            *
231            * @param mbCategory the message boards category
232            * @return the message boards category that was updated
233            * @throws SystemException if a system exception occurred
234            */
235            public static com.liferay.portlet.messageboards.model.MBCategory updateMBCategory(
236                    com.liferay.portlet.messageboards.model.MBCategory mbCategory)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getService().updateMBCategory(mbCategory);
239            }
240    
241            /**
242            * Updates the message boards category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
243            *
244            * @param mbCategory the message boards category
245            * @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.
246            * @return the message boards category that was updated
247            * @throws SystemException if a system exception occurred
248            */
249            public static com.liferay.portlet.messageboards.model.MBCategory updateMBCategory(
250                    com.liferay.portlet.messageboards.model.MBCategory mbCategory,
251                    boolean merge)
252                    throws com.liferay.portal.kernel.exception.SystemException {
253                    return getService().updateMBCategory(mbCategory, merge);
254            }
255    
256            /**
257            * Returns the Spring bean ID for this bean.
258            *
259            * @return the Spring bean ID for this bean
260            */
261            public static java.lang.String getBeanIdentifier() {
262                    return getService().getBeanIdentifier();
263            }
264    
265            /**
266            * Sets the Spring bean ID for this bean.
267            *
268            * @param beanIdentifier the Spring bean ID for this bean
269            */
270            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
271                    getService().setBeanIdentifier(beanIdentifier);
272            }
273    
274            public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
275                    long userId, long parentCategoryId, java.lang.String name,
276                    java.lang.String description, java.lang.String emailAddress,
277                    java.lang.String inProtocol, java.lang.String inServerName,
278                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
279                    java.lang.String inPassword, int inReadInterval,
280                    java.lang.String outEmailAddress, boolean outCustom,
281                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
282                    java.lang.String outUserName, java.lang.String outPassword,
283                    boolean allowAnonymous, boolean mailingListActive,
284                    com.liferay.portal.service.ServiceContext serviceContext)
285                    throws com.liferay.portal.kernel.exception.PortalException,
286                            com.liferay.portal.kernel.exception.SystemException {
287                    return getService()
288                                       .addCategory(userId, parentCategoryId, name, description,
289                            emailAddress, inProtocol, inServerName, inServerPort, inUseSSL,
290                            inUserName, inPassword, inReadInterval, outEmailAddress, outCustom,
291                            outServerName, outServerPort, outUseSSL, outUserName, outPassword,
292                            allowAnonymous, mailingListActive, serviceContext);
293            }
294    
295            /**
296            * @deprecated {@link #addCategory(long, long, String, String, String,
297            String, String, int, boolean, String, String, int, String,
298            boolean, String, int, boolean, String, String, boolean,
299            boolean, ServiceContext)}
300            */
301            public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
302                    long userId, long parentCategoryId, java.lang.String name,
303                    java.lang.String description, java.lang.String emailAddress,
304                    java.lang.String inProtocol, java.lang.String inServerName,
305                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
306                    java.lang.String inPassword, int inReadInterval,
307                    java.lang.String outEmailAddress, boolean outCustom,
308                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
309                    java.lang.String outUserName, java.lang.String outPassword,
310                    boolean mailingListActive,
311                    com.liferay.portal.service.ServiceContext serviceContext)
312                    throws com.liferay.portal.kernel.exception.PortalException,
313                            com.liferay.portal.kernel.exception.SystemException {
314                    return getService()
315                                       .addCategory(userId, parentCategoryId, name, description,
316                            emailAddress, inProtocol, inServerName, inServerPort, inUseSSL,
317                            inUserName, inPassword, inReadInterval, outEmailAddress, outCustom,
318                            outServerName, outServerPort, outUseSSL, outUserName, outPassword,
319                            mailingListActive, serviceContext);
320            }
321    
322            public static void addCategoryResources(long categoryId,
323                    boolean addCommunityPermissions, boolean addGuestPermissions)
324                    throws com.liferay.portal.kernel.exception.PortalException,
325                            com.liferay.portal.kernel.exception.SystemException {
326                    getService()
327                            .addCategoryResources(categoryId, addCommunityPermissions,
328                            addGuestPermissions);
329            }
330    
331            public static void addCategoryResources(long categoryId,
332                    java.lang.String[] communityPermissions,
333                    java.lang.String[] guestPermissions)
334                    throws com.liferay.portal.kernel.exception.PortalException,
335                            com.liferay.portal.kernel.exception.SystemException {
336                    getService()
337                            .addCategoryResources(categoryId, communityPermissions,
338                            guestPermissions);
339            }
340    
341            public static void addCategoryResources(
342                    com.liferay.portlet.messageboards.model.MBCategory category,
343                    boolean addCommunityPermissions, boolean addGuestPermissions)
344                    throws com.liferay.portal.kernel.exception.PortalException,
345                            com.liferay.portal.kernel.exception.SystemException {
346                    getService()
347                            .addCategoryResources(category, addCommunityPermissions,
348                            addGuestPermissions);
349            }
350    
351            public static void addCategoryResources(
352                    com.liferay.portlet.messageboards.model.MBCategory category,
353                    java.lang.String[] communityPermissions,
354                    java.lang.String[] guestPermissions)
355                    throws com.liferay.portal.kernel.exception.PortalException,
356                            com.liferay.portal.kernel.exception.SystemException {
357                    getService()
358                            .addCategoryResources(category, communityPermissions,
359                            guestPermissions);
360            }
361    
362            public static void deleteCategories(long groupId)
363                    throws com.liferay.portal.kernel.exception.PortalException,
364                            com.liferay.portal.kernel.exception.SystemException {
365                    getService().deleteCategories(groupId);
366            }
367    
368            public static void deleteCategory(long categoryId)
369                    throws com.liferay.portal.kernel.exception.PortalException,
370                            com.liferay.portal.kernel.exception.SystemException {
371                    getService().deleteCategory(categoryId);
372            }
373    
374            public static void deleteCategory(
375                    com.liferay.portlet.messageboards.model.MBCategory category)
376                    throws com.liferay.portal.kernel.exception.PortalException,
377                            com.liferay.portal.kernel.exception.SystemException {
378                    getService().deleteCategory(category);
379            }
380    
381            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
382                    long groupId)
383                    throws com.liferay.portal.kernel.exception.SystemException {
384                    return getService().getCategories(groupId);
385            }
386    
387            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
388                    long groupId, long parentCategoryId, int start, int end)
389                    throws com.liferay.portal.kernel.exception.SystemException {
390                    return getService().getCategories(groupId, parentCategoryId, start, end);
391            }
392    
393            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
394                    long groupId, long[] parentCategoryIds, int start, int end)
395                    throws com.liferay.portal.kernel.exception.SystemException {
396                    return getService().getCategories(groupId, parentCategoryIds, start, end);
397            }
398    
399            public static int getCategoriesCount(long groupId)
400                    throws com.liferay.portal.kernel.exception.SystemException {
401                    return getService().getCategoriesCount(groupId);
402            }
403    
404            public static int getCategoriesCount(long groupId, long parentCategoryId)
405                    throws com.liferay.portal.kernel.exception.SystemException {
406                    return getService().getCategoriesCount(groupId, parentCategoryId);
407            }
408    
409            public static int getCategoriesCount(long groupId, long[] parentCategoryIds)
410                    throws com.liferay.portal.kernel.exception.SystemException {
411                    return getService().getCategoriesCount(groupId, parentCategoryIds);
412            }
413    
414            public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
415                    long categoryId)
416                    throws com.liferay.portal.kernel.exception.PortalException,
417                            com.liferay.portal.kernel.exception.SystemException {
418                    return getService().getCategory(categoryId);
419            }
420    
421            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCompanyCategories(
422                    long companyId, int start, int end)
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    return getService().getCompanyCategories(companyId, start, end);
425            }
426    
427            public static int getCompanyCategoriesCount(long companyId)
428                    throws com.liferay.portal.kernel.exception.SystemException {
429                    return getService().getCompanyCategoriesCount(companyId);
430            }
431    
432            public static java.util.List<java.lang.Long> getSubcategoryIds(
433                    java.util.List<java.lang.Long> categoryIds, long groupId,
434                    long categoryId)
435                    throws com.liferay.portal.kernel.exception.SystemException {
436                    return getService().getSubcategoryIds(categoryIds, groupId, categoryId);
437            }
438    
439            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getSubscribedCategories(
440                    long groupId, long userId, int start, int end)
441                    throws com.liferay.portal.kernel.exception.SystemException {
442                    return getService().getSubscribedCategories(groupId, userId, start, end);
443            }
444    
445            public static int getSubscribedCategoriesCount(long groupId, long userId)
446                    throws com.liferay.portal.kernel.exception.SystemException {
447                    return getService().getSubscribedCategoriesCount(groupId, userId);
448            }
449    
450            public static void subscribeCategory(long userId, long groupId,
451                    long categoryId)
452                    throws com.liferay.portal.kernel.exception.PortalException,
453                            com.liferay.portal.kernel.exception.SystemException {
454                    getService().subscribeCategory(userId, groupId, categoryId);
455            }
456    
457            public static void unsubscribeCategory(long userId, long groupId,
458                    long categoryId)
459                    throws com.liferay.portal.kernel.exception.PortalException,
460                            com.liferay.portal.kernel.exception.SystemException {
461                    getService().unsubscribeCategory(userId, groupId, categoryId);
462            }
463    
464            public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
465                    long categoryId, long parentCategoryId, java.lang.String name,
466                    java.lang.String description, java.lang.String emailAddress,
467                    java.lang.String inProtocol, java.lang.String inServerName,
468                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
469                    java.lang.String inPassword, int inReadInterval,
470                    java.lang.String outEmailAddress, boolean outCustom,
471                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
472                    java.lang.String outUserName, java.lang.String outPassword,
473                    boolean allowAnonymous, boolean mailingListActive,
474                    boolean mergeWithParentCategory,
475                    com.liferay.portal.service.ServiceContext serviceContext)
476                    throws com.liferay.portal.kernel.exception.PortalException,
477                            com.liferay.portal.kernel.exception.SystemException {
478                    return getService()
479                                       .updateCategory(categoryId, parentCategoryId, name,
480                            description, emailAddress, inProtocol, inServerName, inServerPort,
481                            inUseSSL, inUserName, inPassword, inReadInterval, outEmailAddress,
482                            outCustom, outServerName, outServerPort, outUseSSL, outUserName,
483                            outPassword, allowAnonymous, mailingListActive,
484                            mergeWithParentCategory, serviceContext);
485            }
486    
487            /**
488            * @deprecated {@link #updateCategory(long, long, String, String, String,
489            String, String, int, boolean, String, String, int, String,
490            boolean, String, int, boolean, String, String, boolean,
491            boolean, boolean, ServiceContext)}
492            */
493            public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
494                    long categoryId, long parentCategoryId, java.lang.String name,
495                    java.lang.String description, java.lang.String emailAddress,
496                    java.lang.String inProtocol, java.lang.String inServerName,
497                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
498                    java.lang.String inPassword, int inReadInterval,
499                    java.lang.String outEmailAddress, boolean outCustom,
500                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
501                    java.lang.String outUserName, java.lang.String outPassword,
502                    boolean mailingListActive, boolean mergeWithParentCategory,
503                    com.liferay.portal.service.ServiceContext serviceContext)
504                    throws com.liferay.portal.kernel.exception.PortalException,
505                            com.liferay.portal.kernel.exception.SystemException {
506                    return getService()
507                                       .updateCategory(categoryId, parentCategoryId, name,
508                            description, emailAddress, inProtocol, inServerName, inServerPort,
509                            inUseSSL, inUserName, inPassword, inReadInterval, outEmailAddress,
510                            outCustom, outServerName, outServerPort, outUseSSL, outUserName,
511                            outPassword, mailingListActive, mergeWithParentCategory,
512                            serviceContext);
513            }
514    
515            public static MBCategoryLocalService getService() {
516                    if (_service == null) {
517                            _service = (MBCategoryLocalService)PortalBeanLocatorUtil.locate(MBCategoryLocalService.class.getName());
518    
519                            ReferenceRegistry.registerReference(MBCategoryLocalServiceUtil.class,
520                                    "_service");
521                            MethodCache.remove(MBCategoryLocalService.class);
522                    }
523    
524                    return _service;
525            }
526    
527            public void setService(MBCategoryLocalService service) {
528                    MethodCache.remove(MBCategoryLocalService.class);
529    
530                    _service = service;
531    
532                    ReferenceRegistry.registerReference(MBCategoryLocalServiceUtil.class,
533                            "_service");
534                    MethodCache.remove(MBCategoryLocalService.class);
535            }
536    
537            private static MBCategoryLocalService _service;
538    }