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