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