001    /**
002     * Copyright (c) 2000-2010 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    
019    /**
020     * 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.
021     *
022     * <p>
023     * 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.
024     * </p>
025     *
026     * <p>
027     * 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.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see MBCategoryLocalService
032     * @see com.liferay.portlet.messageboards.service.base.MBCategoryLocalServiceBaseImpl
033     * @see com.liferay.portlet.messageboards.service.impl.MBCategoryLocalServiceImpl
034     * @generated
035     */
036    public class MBCategoryLocalServiceUtil {
037            /**
038            * Adds the message boards category to the database. Also notifies the appropriate model listeners.
039            *
040            * @param mbCategory the message boards category to add
041            * @return the message boards category that was added
042            * @throws SystemException if a system exception occurred
043            */
044            public static com.liferay.portlet.messageboards.model.MBCategory addMBCategory(
045                    com.liferay.portlet.messageboards.model.MBCategory mbCategory)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getService().addMBCategory(mbCategory);
048            }
049    
050            /**
051            * Creates a new message boards category with the primary key. Does not add the message boards category to the database.
052            *
053            * @param categoryId the primary key for the new message boards category
054            * @return the new message boards category
055            */
056            public static com.liferay.portlet.messageboards.model.MBCategory createMBCategory(
057                    long categoryId) {
058                    return getService().createMBCategory(categoryId);
059            }
060    
061            /**
062            * Deletes the message boards category with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param categoryId the primary key of the message boards category to delete
065            * @throws PortalException if a message boards category with the primary key could not be found
066            * @throws SystemException if a system exception occurred
067            */
068            public static void deleteMBCategory(long categoryId)
069                    throws com.liferay.portal.kernel.exception.PortalException,
070                            com.liferay.portal.kernel.exception.SystemException {
071                    getService().deleteMBCategory(categoryId);
072            }
073    
074            /**
075            * Deletes the message boards category from the database. Also notifies the appropriate model listeners.
076            *
077            * @param mbCategory the message boards category to delete
078            * @throws SystemException if a system exception occurred
079            */
080            public static void deleteMBCategory(
081                    com.liferay.portlet.messageboards.model.MBCategory mbCategory)
082                    throws com.liferay.portal.kernel.exception.SystemException {
083                    getService().deleteMBCategory(mbCategory);
084            }
085    
086            /**
087            * Performs a dynamic query on the database and returns the matching rows.
088            *
089            * @param dynamicQuery the dynamic query to search with
090            * @return the matching rows
091            * @throws SystemException if a system exception occurred
092            */
093            @SuppressWarnings("rawtypes")
094            public static java.util.List dynamicQuery(
095                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
096                    throws com.liferay.portal.kernel.exception.SystemException {
097                    return getService().dynamicQuery(dynamicQuery);
098            }
099    
100            /**
101            * Performs a dynamic query on the database and returns a range of the matching rows.
102            *
103            * <p>
104            * 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.
105            * </p>
106            *
107            * @param dynamicQuery the dynamic query to search with
108            * @param start the lower bound of the range of model instances to return
109            * @param end the upper bound of the range of model instances to return (not inclusive)
110            * @return the range of matching rows
111            * @throws SystemException if a system exception occurred
112            */
113            @SuppressWarnings("rawtypes")
114            public static java.util.List dynamicQuery(
115                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
116                    int end) throws com.liferay.portal.kernel.exception.SystemException {
117                    return getService().dynamicQuery(dynamicQuery, start, end);
118            }
119    
120            /**
121            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
122            *
123            * <p>
124            * 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.
125            * </p>
126            *
127            * @param dynamicQuery the dynamic query to search with
128            * @param start the lower bound of the range of model instances to return
129            * @param end the upper bound of the range of model instances to return (not inclusive)
130            * @param orderByComparator the comparator to order the results by
131            * @return the ordered range of matching rows
132            * @throws SystemException if a system exception occurred
133            */
134            @SuppressWarnings("rawtypes")
135            public static java.util.List dynamicQuery(
136                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
137                    int end,
138                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
139                    throws com.liferay.portal.kernel.exception.SystemException {
140                    return getService()
141                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
142            }
143    
144            /**
145            * Counts the number of rows that match the dynamic query.
146            *
147            * @param dynamicQuery the dynamic query to search with
148            * @return the number of rows that match the dynamic query
149            * @throws SystemException if a system exception occurred
150            */
151            public static long dynamicQueryCount(
152                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
153                    throws com.liferay.portal.kernel.exception.SystemException {
154                    return getService().dynamicQueryCount(dynamicQuery);
155            }
156    
157            /**
158            * Gets the message boards category with the primary key.
159            *
160            * @param categoryId the primary key of the message boards category to get
161            * @return the message boards category
162            * @throws PortalException if a message boards category with the primary key could not be found
163            * @throws SystemException if a system exception occurred
164            */
165            public static com.liferay.portlet.messageboards.model.MBCategory getMBCategory(
166                    long categoryId)
167                    throws com.liferay.portal.kernel.exception.PortalException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    return getService().getMBCategory(categoryId);
170            }
171    
172            /**
173            * Gets the message boards category with the UUID and group id.
174            *
175            * @param uuid the UUID of message boards category to get
176            * @param groupId the group id of the message boards category to get
177            * @return the message boards category
178            * @throws PortalException if a message boards category with the UUID and group id could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portlet.messageboards.model.MBCategory getMBCategoryByUuidAndGroupId(
182                    java.lang.String uuid, long groupId)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().getMBCategoryByUuidAndGroupId(uuid, groupId);
186            }
187    
188            /**
189            * Gets a range of all the message boards categories.
190            *
191            * <p>
192            * 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.
193            * </p>
194            *
195            * @param start the lower bound of the range of message boards categories to return
196            * @param end the upper bound of the range of message boards categories to return (not inclusive)
197            * @return the range of message boards categories
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getMBCategories(
201                    int start, int end)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getService().getMBCategories(start, end);
204            }
205    
206            /**
207            * Gets the number of message boards categories.
208            *
209            * @return the number of message boards categories
210            * @throws SystemException if a system exception occurred
211            */
212            public static int getMBCategoriesCount()
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getService().getMBCategoriesCount();
215            }
216    
217            /**
218            * Updates the message boards category in the database. Also notifies the appropriate model listeners.
219            *
220            * @param mbCategory the message boards category to update
221            * @return the message boards category that was updated
222            * @throws SystemException if a system exception occurred
223            */
224            public static com.liferay.portlet.messageboards.model.MBCategory updateMBCategory(
225                    com.liferay.portlet.messageboards.model.MBCategory mbCategory)
226                    throws com.liferay.portal.kernel.exception.SystemException {
227                    return getService().updateMBCategory(mbCategory);
228            }
229    
230            /**
231            * Updates the message boards category in the database. Also notifies the appropriate model listeners.
232            *
233            * @param mbCategory the message boards category to update
234            * @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.
235            * @return the message boards category that was updated
236            * @throws SystemException if a system exception occurred
237            */
238            public static com.liferay.portlet.messageboards.model.MBCategory updateMBCategory(
239                    com.liferay.portlet.messageboards.model.MBCategory mbCategory,
240                    boolean merge)
241                    throws com.liferay.portal.kernel.exception.SystemException {
242                    return getService().updateMBCategory(mbCategory, merge);
243            }
244    
245            public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
246                    long userId, long parentCategoryId, java.lang.String name,
247                    java.lang.String description, java.lang.String emailAddress,
248                    java.lang.String inProtocol, java.lang.String inServerName,
249                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
250                    java.lang.String inPassword, int inReadInterval,
251                    java.lang.String outEmailAddress, boolean outCustom,
252                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
253                    java.lang.String outUserName, java.lang.String outPassword,
254                    boolean mailingListActive,
255                    com.liferay.portal.service.ServiceContext serviceContext)
256                    throws com.liferay.portal.kernel.exception.PortalException,
257                            com.liferay.portal.kernel.exception.SystemException {
258                    return getService()
259                                       .addCategory(userId, parentCategoryId, name, description,
260                            emailAddress, inProtocol, inServerName, inServerPort, inUseSSL,
261                            inUserName, inPassword, inReadInterval, outEmailAddress, outCustom,
262                            outServerName, outServerPort, outUseSSL, outUserName, outPassword,
263                            mailingListActive, serviceContext);
264            }
265    
266            public static void addCategoryResources(long categoryId,
267                    boolean addCommunityPermissions, boolean addGuestPermissions)
268                    throws com.liferay.portal.kernel.exception.PortalException,
269                            com.liferay.portal.kernel.exception.SystemException {
270                    getService()
271                            .addCategoryResources(categoryId, addCommunityPermissions,
272                            addGuestPermissions);
273            }
274    
275            public static void addCategoryResources(long categoryId,
276                    java.lang.String[] communityPermissions,
277                    java.lang.String[] guestPermissions)
278                    throws com.liferay.portal.kernel.exception.PortalException,
279                            com.liferay.portal.kernel.exception.SystemException {
280                    getService()
281                            .addCategoryResources(categoryId, communityPermissions,
282                            guestPermissions);
283            }
284    
285            public static void addCategoryResources(
286                    com.liferay.portlet.messageboards.model.MBCategory category,
287                    boolean addCommunityPermissions, boolean addGuestPermissions)
288                    throws com.liferay.portal.kernel.exception.PortalException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    getService()
291                            .addCategoryResources(category, addCommunityPermissions,
292                            addGuestPermissions);
293            }
294    
295            public static void addCategoryResources(
296                    com.liferay.portlet.messageboards.model.MBCategory category,
297                    java.lang.String[] communityPermissions,
298                    java.lang.String[] guestPermissions)
299                    throws com.liferay.portal.kernel.exception.PortalException,
300                            com.liferay.portal.kernel.exception.SystemException {
301                    getService()
302                            .addCategoryResources(category, communityPermissions,
303                            guestPermissions);
304            }
305    
306            public static void deleteCategories(long groupId)
307                    throws com.liferay.portal.kernel.exception.PortalException,
308                            com.liferay.portal.kernel.exception.SystemException {
309                    getService().deleteCategories(groupId);
310            }
311    
312            public static void deleteCategory(long categoryId)
313                    throws com.liferay.portal.kernel.exception.PortalException,
314                            com.liferay.portal.kernel.exception.SystemException {
315                    getService().deleteCategory(categoryId);
316            }
317    
318            public static void deleteCategory(
319                    com.liferay.portlet.messageboards.model.MBCategory category)
320                    throws com.liferay.portal.kernel.exception.PortalException,
321                            com.liferay.portal.kernel.exception.SystemException {
322                    getService().deleteCategory(category);
323            }
324    
325            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
326                    long groupId)
327                    throws com.liferay.portal.kernel.exception.SystemException {
328                    return getService().getCategories(groupId);
329            }
330    
331            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
332                    long groupId, long parentCategoryId, int start, int end)
333                    throws com.liferay.portal.kernel.exception.SystemException {
334                    return getService().getCategories(groupId, parentCategoryId, start, end);
335            }
336    
337            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
338                    long groupId, long[] parentCategoryIds, int start, int end)
339                    throws com.liferay.portal.kernel.exception.SystemException {
340                    return getService().getCategories(groupId, parentCategoryIds, start, end);
341            }
342    
343            public static int getCategoriesCount(long groupId)
344                    throws com.liferay.portal.kernel.exception.SystemException {
345                    return getService().getCategoriesCount(groupId);
346            }
347    
348            public static int getCategoriesCount(long groupId, long parentCategoryId)
349                    throws com.liferay.portal.kernel.exception.SystemException {
350                    return getService().getCategoriesCount(groupId, parentCategoryId);
351            }
352    
353            public static int getCategoriesCount(long groupId, long[] parentCategoryIds)
354                    throws com.liferay.portal.kernel.exception.SystemException {
355                    return getService().getCategoriesCount(groupId, parentCategoryIds);
356            }
357    
358            public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
359                    long categoryId)
360                    throws com.liferay.portal.kernel.exception.PortalException,
361                            com.liferay.portal.kernel.exception.SystemException {
362                    return getService().getCategory(categoryId);
363            }
364    
365            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCompanyCategories(
366                    long companyId, int start, int end)
367                    throws com.liferay.portal.kernel.exception.SystemException {
368                    return getService().getCompanyCategories(companyId, start, end);
369            }
370    
371            public static int getCompanyCategoriesCount(long companyId)
372                    throws com.liferay.portal.kernel.exception.SystemException {
373                    return getService().getCompanyCategoriesCount(companyId);
374            }
375    
376            public static java.util.List<java.lang.Long> getSubcategoryIds(
377                    java.util.List<java.lang.Long> categoryIds, long groupId,
378                    long categoryId)
379                    throws com.liferay.portal.kernel.exception.SystemException {
380                    return getService().getSubcategoryIds(categoryIds, groupId, categoryId);
381            }
382    
383            public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getSubscribedCategories(
384                    long groupId, long userId, int start, int end)
385                    throws com.liferay.portal.kernel.exception.SystemException {
386                    return getService().getSubscribedCategories(groupId, userId, start, end);
387            }
388    
389            public static int getSubscribedCategoriesCount(long groupId, long userId)
390                    throws com.liferay.portal.kernel.exception.SystemException {
391                    return getService().getSubscribedCategoriesCount(groupId, userId);
392            }
393    
394            public static void subscribeCategory(long userId, long groupId,
395                    long categoryId)
396                    throws com.liferay.portal.kernel.exception.PortalException,
397                            com.liferay.portal.kernel.exception.SystemException {
398                    getService().subscribeCategory(userId, groupId, categoryId);
399            }
400    
401            public static void unsubscribeCategory(long userId, long groupId,
402                    long categoryId)
403                    throws com.liferay.portal.kernel.exception.PortalException,
404                            com.liferay.portal.kernel.exception.SystemException {
405                    getService().unsubscribeCategory(userId, groupId, categoryId);
406            }
407    
408            public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
409                    long categoryId, long parentCategoryId, java.lang.String name,
410                    java.lang.String description, java.lang.String emailAddress,
411                    java.lang.String inProtocol, java.lang.String inServerName,
412                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
413                    java.lang.String inPassword, int inReadInterval,
414                    java.lang.String outEmailAddress, boolean outCustom,
415                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
416                    java.lang.String outUserName, java.lang.String outPassword,
417                    boolean mailingListActive, boolean mergeWithParentCategory,
418                    com.liferay.portal.service.ServiceContext serviceContext)
419                    throws com.liferay.portal.kernel.exception.PortalException,
420                            com.liferay.portal.kernel.exception.SystemException {
421                    return getService()
422                                       .updateCategory(categoryId, parentCategoryId, name,
423                            description, emailAddress, inProtocol, inServerName, inServerPort,
424                            inUseSSL, inUserName, inPassword, inReadInterval, outEmailAddress,
425                            outCustom, outServerName, outServerPort, outUseSSL, outUserName,
426                            outPassword, mailingListActive, mergeWithParentCategory,
427                            serviceContext);
428            }
429    
430            public static MBCategoryLocalService getService() {
431                    if (_service == null) {
432                            _service = (MBCategoryLocalService)PortalBeanLocatorUtil.locate(MBCategoryLocalService.class.getName());
433                    }
434    
435                    return _service;
436            }
437    
438            public void setService(MBCategoryLocalService service) {
439                    _service = service;
440            }
441    
442            private static MBCategoryLocalService _service;
443    }