001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.systemevent.SystemEvent;
029    import com.liferay.portal.kernel.transaction.Isolation;
030    import com.liferay.portal.kernel.transaction.Propagation;
031    import com.liferay.portal.kernel.transaction.Transactional;
032    import com.liferay.portal.kernel.util.OrderByComparator;
033    import com.liferay.portal.model.PersistedModel;
034    import com.liferay.portal.model.SystemEventConstants;
035    import com.liferay.portal.service.BaseLocalService;
036    import com.liferay.portal.service.PersistedModelLocalService;
037    import com.liferay.portal.service.ServiceContext;
038    import com.liferay.portal.service.permission.ModelPermissions;
039    
040    import com.liferay.portlet.exportimport.lar.PortletDataContext;
041    import com.liferay.portlet.messageboards.model.MBCategory;
042    
043    import java.io.Serializable;
044    
045    import java.util.List;
046    
047    /**
048     * Provides the local service interface for MBCategory. Methods of this
049     * service will not have security checks based on the propagated JAAS
050     * credentials because this service can only be accessed from within the same
051     * VM.
052     *
053     * @author Brian Wing Shun Chan
054     * @see MBCategoryLocalServiceUtil
055     * @see com.liferay.portlet.messageboards.service.base.MBCategoryLocalServiceBaseImpl
056     * @see com.liferay.portlet.messageboards.service.impl.MBCategoryLocalServiceImpl
057     * @generated
058     */
059    @ProviderType
060    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
061            PortalException.class, SystemException.class})
062    public interface MBCategoryLocalService extends BaseLocalService,
063            PersistedModelLocalService {
064            /*
065             * NOTE FOR DEVELOPERS:
066             *
067             * Never modify or reference this interface directly. Always use {@link MBCategoryLocalServiceUtil} to access the message boards category local service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBCategoryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
068             */
069            public MBCategory addCategory(long userId, long parentCategoryId,
070                    java.lang.String name, java.lang.String description,
071                    java.lang.String displayStyle, java.lang.String emailAddress,
072                    java.lang.String inProtocol, java.lang.String inServerName,
073                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
074                    java.lang.String inPassword, int inReadInterval,
075                    java.lang.String outEmailAddress, boolean outCustom,
076                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
077                    java.lang.String outUserName, java.lang.String outPassword,
078                    boolean allowAnonymous, boolean mailingListActive,
079                    ServiceContext serviceContext) throws PortalException;
080    
081            public MBCategory addCategory(long userId, long parentCategoryId,
082                    java.lang.String name, java.lang.String description,
083                    ServiceContext serviceContext) throws PortalException;
084    
085            public void addCategoryResources(MBCategory category,
086                    boolean addGroupPermissions, boolean addGuestPermissions)
087                    throws PortalException;
088    
089            public void addCategoryResources(MBCategory category,
090                    ModelPermissions modelPermissions) throws PortalException;
091    
092            public void addCategoryResources(long categoryId,
093                    boolean addGroupPermissions, boolean addGuestPermissions)
094                    throws PortalException;
095    
096            public void addCategoryResources(long categoryId,
097                    ModelPermissions modelPermissions) throws PortalException;
098    
099            /**
100            * Adds the message boards category to the database. Also notifies the appropriate model listeners.
101            *
102            * @param mbCategory the message boards category
103            * @return the message boards category that was added
104            */
105            @Indexable(type = IndexableType.REINDEX)
106            public MBCategory addMBCategory(MBCategory mbCategory);
107    
108            /**
109            * Creates a new message boards category with the primary key. Does not add the message boards category to the database.
110            *
111            * @param categoryId the primary key for the new message boards category
112            * @return the new message boards category
113            */
114            public MBCategory createMBCategory(long categoryId);
115    
116            public void deleteCategories(long groupId) throws PortalException;
117    
118            public void deleteCategory(MBCategory category) throws PortalException;
119    
120            @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
121            public void deleteCategory(MBCategory category,
122                    boolean includeTrashedEntries) throws PortalException;
123    
124            public void deleteCategory(long categoryId) throws PortalException;
125    
126            /**
127            * Deletes the message boards category with the primary key from the database. Also notifies the appropriate model listeners.
128            *
129            * @param categoryId the primary key of the message boards category
130            * @return the message boards category that was removed
131            * @throws PortalException if a message boards category with the primary key could not be found
132            */
133            @Indexable(type = IndexableType.DELETE)
134            public MBCategory deleteMBCategory(long categoryId)
135                    throws PortalException;
136    
137            /**
138            * Deletes the message boards category from the database. Also notifies the appropriate model listeners.
139            *
140            * @param mbCategory the message boards category
141            * @return the message boards category that was removed
142            */
143            @Indexable(type = IndexableType.DELETE)
144            public MBCategory deleteMBCategory(MBCategory mbCategory);
145    
146            /**
147            * @throws PortalException
148            */
149            @Override
150            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
151                    throws PortalException;
152    
153            public DynamicQuery dynamicQuery();
154    
155            /**
156            * Performs a dynamic query on the database and returns the matching rows.
157            *
158            * @param dynamicQuery the dynamic query
159            * @return the matching rows
160            */
161            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
162    
163            /**
164            * Performs a dynamic query on the database and returns a range of the matching rows.
165            *
166            * <p>
167            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
168            * </p>
169            *
170            * @param dynamicQuery the dynamic query
171            * @param start the lower bound of the range of model instances
172            * @param end the upper bound of the range of model instances (not inclusive)
173            * @return the range of matching rows
174            */
175            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
176                    int end);
177    
178            /**
179            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
180            *
181            * <p>
182            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
183            * </p>
184            *
185            * @param dynamicQuery the dynamic query
186            * @param start the lower bound of the range of model instances
187            * @param end the upper bound of the range of model instances (not inclusive)
188            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
189            * @return the ordered range of matching rows
190            */
191            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
192                    int end, OrderByComparator<T> orderByComparator);
193    
194            /**
195            * Returns the number of rows matching the dynamic query.
196            *
197            * @param dynamicQuery the dynamic query
198            * @return the number of rows matching the dynamic query
199            */
200            public long dynamicQueryCount(DynamicQuery dynamicQuery);
201    
202            /**
203            * Returns the number of rows matching the dynamic query.
204            *
205            * @param dynamicQuery the dynamic query
206            * @param projection the projection to apply to the query
207            * @return the number of rows matching the dynamic query
208            */
209            public long dynamicQueryCount(DynamicQuery dynamicQuery,
210                    Projection projection);
211    
212            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
213            public MBCategory fetchMBCategory(long categoryId);
214    
215            /**
216            * Returns the message boards category matching the UUID and group.
217            *
218            * @param uuid the message boards category's UUID
219            * @param groupId the primary key of the group
220            * @return the matching message boards category, or <code>null</code> if a matching message boards category could not be found
221            */
222            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
223            public MBCategory fetchMBCategoryByUuidAndGroupId(java.lang.String uuid,
224                    long groupId);
225    
226            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
227            public ActionableDynamicQuery getActionableDynamicQuery();
228    
229            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
230            public List<MBCategory> getCategories(long groupId);
231    
232            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233            public List<MBCategory> getCategories(long groupId,
234                    long excludedCategoryId, long parentCategoryId, int status, int start,
235                    int end);
236    
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public List<MBCategory> getCategories(long groupId,
239                    long[] excludedCategoryIds, long[] parentCategoryIds, int status,
240                    int start, int end);
241    
242            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
243            public List<MBCategory> getCategories(long groupId, long parentCategoryId,
244                    int start, int end);
245    
246            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247            public List<MBCategory> getCategories(long groupId, long parentCategoryId,
248                    int status, int start, int end);
249    
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public List<MBCategory> getCategories(long groupId,
252                    long[] parentCategoryIds, int start, int end);
253    
254            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255            public List<MBCategory> getCategories(long groupId,
256                    long[] parentCategoryIds, int status, int start, int end);
257    
258            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
259            public List<MBCategory> getCategories(long groupId, int status);
260    
261            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262            public List<java.lang.Object> getCategoriesAndThreads(long groupId,
263                    long categoryId);
264    
265            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266            public List<java.lang.Object> getCategoriesAndThreads(long groupId,
267                    long categoryId, int status);
268    
269            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270            public List<java.lang.Object> getCategoriesAndThreads(long groupId,
271                    long categoryId, int status, int start, int end);
272    
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public int getCategoriesAndThreadsCount(long groupId, long categoryId);
275    
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public int getCategoriesAndThreadsCount(long groupId, long categoryId,
278                    int status);
279    
280            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281            public int getCategoriesCount(long groupId);
282    
283            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
284            public int getCategoriesCount(long groupId, long excludedCategoryId,
285                    long parentCategoryId, int status);
286    
287            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
288            public int getCategoriesCount(long groupId, long[] excludedCategoryIds,
289                    long[] parentCategoryIds, int status);
290    
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public int getCategoriesCount(long groupId, long parentCategoryId);
293    
294            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
295            public int getCategoriesCount(long groupId, long parentCategoryId,
296                    int status);
297    
298            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
299            public int getCategoriesCount(long groupId, long[] parentCategoryIds);
300    
301            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302            public int getCategoriesCount(long groupId, long[] parentCategoryIds,
303                    int status);
304    
305            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
306            public int getCategoriesCount(long groupId, int status);
307    
308            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
309            public MBCategory getCategory(long categoryId) throws PortalException;
310    
311            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312            public List<MBCategory> getCompanyCategories(long companyId, int start,
313                    int end);
314    
315            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
316            public int getCompanyCategoriesCount(long companyId);
317    
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
320                    PortletDataContext portletDataContext);
321    
322            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
324    
325            /**
326            * Returns a range of all the message boards categories.
327            *
328            * <p>
329            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.messageboards.model.impl.MBCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
330            * </p>
331            *
332            * @param start the lower bound of the range of message boards categories
333            * @param end the upper bound of the range of message boards categories (not inclusive)
334            * @return the range of message boards categories
335            */
336            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
337            public List<MBCategory> getMBCategories(int start, int end);
338    
339            /**
340            * Returns all the message boards categories matching the UUID and company.
341            *
342            * @param uuid the UUID of the message boards categories
343            * @param companyId the primary key of the company
344            * @return the matching message boards categories, or an empty list if no matches were found
345            */
346            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
347            public List<MBCategory> getMBCategoriesByUuidAndCompanyId(
348                    java.lang.String uuid, long companyId);
349    
350            /**
351            * Returns a range of message boards categories matching the UUID and company.
352            *
353            * @param uuid the UUID of the message boards categories
354            * @param companyId the primary key of the company
355            * @param start the lower bound of the range of message boards categories
356            * @param end the upper bound of the range of message boards categories (not inclusive)
357            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
358            * @return the range of matching message boards categories, or an empty list if no matches were found
359            */
360            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361            public List<MBCategory> getMBCategoriesByUuidAndCompanyId(
362                    java.lang.String uuid, long companyId, int start, int end,
363                    OrderByComparator<MBCategory> orderByComparator);
364    
365            /**
366            * Returns the number of message boards categories.
367            *
368            * @return the number of message boards categories
369            */
370            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
371            public int getMBCategoriesCount();
372    
373            /**
374            * Returns the message boards category with the primary key.
375            *
376            * @param categoryId the primary key of the message boards category
377            * @return the message boards category
378            * @throws PortalException if a message boards category with the primary key could not be found
379            */
380            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
381            public MBCategory getMBCategory(long categoryId) throws PortalException;
382    
383            /**
384            * Returns the message boards category matching the UUID and group.
385            *
386            * @param uuid the message boards category's UUID
387            * @param groupId the primary key of the group
388            * @return the matching message boards category
389            * @throws PortalException if a matching message boards category could not be found
390            */
391            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
392            public MBCategory getMBCategoryByUuidAndGroupId(java.lang.String uuid,
393                    long groupId) throws PortalException;
394    
395            /**
396            * Returns the OSGi service identifier.
397            *
398            * @return the OSGi service identifier
399            */
400            public java.lang.String getOSGiServiceIdentifier();
401    
402            @Override
403            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
404            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
405                    throws PortalException;
406    
407            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
408            public List<java.lang.Long> getSubcategoryIds(
409                    List<java.lang.Long> categoryIds, long groupId, long categoryId);
410    
411            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
412            public List<MBCategory> getSubscribedCategories(long groupId, long userId,
413                    int start, int end);
414    
415            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
416            public int getSubscribedCategoriesCount(long groupId, long userId);
417    
418            public void moveCategoriesToTrash(long groupId, long userId)
419                    throws PortalException;
420    
421            public MBCategory moveCategory(long categoryId, long parentCategoryId,
422                    boolean mergeWithParentCategory) throws PortalException;
423    
424            public MBCategory moveCategoryFromTrash(long userId, long categoryId,
425                    long newCategoryId) throws PortalException;
426    
427            public MBCategory moveCategoryToTrash(long userId, long categoryId)
428                    throws PortalException;
429    
430            public void restoreCategoryFromTrash(long userId, long categoryId)
431                    throws PortalException;
432    
433            public void subscribeCategory(long userId, long groupId, long categoryId)
434                    throws PortalException;
435    
436            public void unsubscribeCategory(long userId, long groupId, long categoryId)
437                    throws PortalException;
438    
439            public MBCategory updateCategory(long categoryId, long parentCategoryId,
440                    java.lang.String name, java.lang.String description,
441                    java.lang.String displayStyle, java.lang.String emailAddress,
442                    java.lang.String inProtocol, java.lang.String inServerName,
443                    int inServerPort, boolean inUseSSL, java.lang.String inUserName,
444                    java.lang.String inPassword, int inReadInterval,
445                    java.lang.String outEmailAddress, boolean outCustom,
446                    java.lang.String outServerName, int outServerPort, boolean outUseSSL,
447                    java.lang.String outUserName, java.lang.String outPassword,
448                    boolean allowAnonymous, boolean mailingListActive,
449                    boolean mergeWithParentCategory, ServiceContext serviceContext)
450                    throws PortalException;
451    
452            /**
453            * Updates the message boards category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
454            *
455            * @param mbCategory the message boards category
456            * @return the message boards category that was updated
457            */
458            @Indexable(type = IndexableType.REINDEX)
459            public MBCategory updateMBCategory(MBCategory mbCategory);
460    
461            public MBCategory updateMessageCount(long categoryId);
462    
463            public MBCategory updateStatistics(long categoryId);
464    
465            public MBCategory updateStatus(long userId, long categoryId, int status)
466                    throws PortalException;
467    
468            public MBCategory updateThreadCount(long categoryId);
469    }