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.dao.orm.QueryDefinition;
025    import com.liferay.portal.kernel.exception.PortalException;
026    import com.liferay.portal.kernel.exception.SystemException;
027    import com.liferay.portal.kernel.increment.BufferedIncrement;
028    import com.liferay.portal.kernel.search.Hits;
029    import com.liferay.portal.kernel.search.Indexable;
030    import com.liferay.portal.kernel.search.IndexableType;
031    import com.liferay.portal.kernel.systemevent.SystemEvent;
032    import com.liferay.portal.kernel.transaction.Isolation;
033    import com.liferay.portal.kernel.transaction.Propagation;
034    import com.liferay.portal.kernel.transaction.Transactional;
035    import com.liferay.portal.kernel.util.OrderByComparator;
036    import com.liferay.portal.model.PersistedModel;
037    import com.liferay.portal.model.SystemEventConstants;
038    import com.liferay.portal.service.BaseLocalService;
039    import com.liferay.portal.service.PersistedModelLocalService;
040    import com.liferay.portal.service.ServiceContext;
041    
042    import com.liferay.portlet.exportimport.lar.PortletDataContext;
043    import com.liferay.portlet.messageboards.model.MBMessage;
044    import com.liferay.portlet.messageboards.model.MBThread;
045    
046    import java.io.Serializable;
047    
048    import java.util.List;
049    
050    /**
051     * Provides the local service interface for MBThread. Methods of this
052     * service will not have security checks based on the propagated JAAS
053     * credentials because this service can only be accessed from within the same
054     * VM.
055     *
056     * @author Brian Wing Shun Chan
057     * @see MBThreadLocalServiceUtil
058     * @see com.liferay.portlet.messageboards.service.base.MBThreadLocalServiceBaseImpl
059     * @see com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl
060     * @generated
061     */
062    @ProviderType
063    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
064            PortalException.class, SystemException.class})
065    public interface MBThreadLocalService extends BaseLocalService,
066            PersistedModelLocalService {
067            /*
068             * NOTE FOR DEVELOPERS:
069             *
070             * Never modify or reference this interface directly. Always use {@link MBThreadLocalServiceUtil} to access the message boards thread local service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
071             */
072    
073            /**
074            * Adds the message boards thread to the database. Also notifies the appropriate model listeners.
075            *
076            * @param mbThread the message boards thread
077            * @return the message boards thread that was added
078            */
079            @Indexable(type = IndexableType.REINDEX)
080            public MBThread addMBThread(MBThread mbThread);
081    
082            public MBThread addThread(long categoryId, MBMessage message,
083                    ServiceContext serviceContext) throws PortalException;
084    
085            /**
086            * Creates a new message boards thread with the primary key. Does not add the message boards thread to the database.
087            *
088            * @param threadId the primary key for the new message boards thread
089            * @return the new message boards thread
090            */
091            public MBThread createMBThread(long threadId);
092    
093            /**
094            * Deletes the message boards thread from the database. Also notifies the appropriate model listeners.
095            *
096            * @param mbThread the message boards thread
097            * @return the message boards thread that was removed
098            */
099            @Indexable(type = IndexableType.DELETE)
100            public MBThread deleteMBThread(MBThread mbThread);
101    
102            /**
103            * Deletes the message boards thread with the primary key from the database. Also notifies the appropriate model listeners.
104            *
105            * @param threadId the primary key of the message boards thread
106            * @return the message boards thread that was removed
107            * @throws PortalException if a message boards thread with the primary key could not be found
108            */
109            @Indexable(type = IndexableType.DELETE)
110            public MBThread deleteMBThread(long threadId) throws PortalException;
111    
112            /**
113            * @throws PortalException
114            */
115            @Override
116            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
117                    throws PortalException;
118    
119            @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
120            public void deleteThread(MBThread thread) throws PortalException;
121    
122            public void deleteThread(long threadId) throws PortalException;
123    
124            public void deleteThreads(long groupId, long categoryId)
125                    throws PortalException;
126    
127            public void deleteThreads(long groupId, long categoryId,
128                    boolean includeTrashedEntries) throws PortalException;
129    
130            public DynamicQuery dynamicQuery();
131    
132            /**
133            * Performs a dynamic query on the database and returns the matching rows.
134            *
135            * @param dynamicQuery the dynamic query
136            * @return the matching rows
137            */
138            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
139    
140            /**
141            * Performs a dynamic query on the database and returns a range of the matching rows.
142            *
143            * <p>
144            * 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.MBThreadModelImpl}. 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.
145            * </p>
146            *
147            * @param dynamicQuery the dynamic query
148            * @param start the lower bound of the range of model instances
149            * @param end the upper bound of the range of model instances (not inclusive)
150            * @return the range of matching rows
151            */
152            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
153                    int end);
154    
155            /**
156            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
157            *
158            * <p>
159            * 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.MBThreadModelImpl}. 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.
160            * </p>
161            *
162            * @param dynamicQuery the dynamic query
163            * @param start the lower bound of the range of model instances
164            * @param end the upper bound of the range of model instances (not inclusive)
165            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
166            * @return the ordered range of matching rows
167            */
168            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
169                    int end, OrderByComparator<T> orderByComparator);
170    
171            /**
172            * Returns the number of rows matching the dynamic query.
173            *
174            * @param dynamicQuery the dynamic query
175            * @return the number of rows matching the dynamic query
176            */
177            public long dynamicQueryCount(DynamicQuery dynamicQuery);
178    
179            /**
180            * Returns the number of rows matching the dynamic query.
181            *
182            * @param dynamicQuery the dynamic query
183            * @param projection the projection to apply to the query
184            * @return the number of rows matching the dynamic query
185            */
186            public long dynamicQueryCount(DynamicQuery dynamicQuery,
187                    Projection projection);
188    
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public MBThread fetchMBThread(long threadId);
191    
192            /**
193            * Returns the message boards thread matching the UUID and group.
194            *
195            * @param uuid the message boards thread's UUID
196            * @param groupId the primary key of the group
197            * @return the matching message boards thread, or <code>null</code> if a matching message boards thread could not be found
198            */
199            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200            public MBThread fetchMBThreadByUuidAndGroupId(java.lang.String uuid,
201                    long groupId);
202    
203            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
204            public MBThread fetchThread(long threadId);
205    
206            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207            public ActionableDynamicQuery getActionableDynamicQuery();
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public int getCategoryThreadsCount(long groupId, long categoryId, int status);
211    
212            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
213            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
214                    PortletDataContext portletDataContext);
215    
216            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
217            public List<MBThread> getGroupThreads(long groupId,
218                    QueryDefinition<MBThread> queryDefinition);
219    
220            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221            public List<MBThread> getGroupThreads(long groupId, long userId,
222                    QueryDefinition<MBThread> queryDefinition);
223    
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public List<MBThread> getGroupThreads(long groupId, long userId,
226                    boolean subscribed, boolean includeAnonymous,
227                    QueryDefinition<MBThread> queryDefinition);
228    
229            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
230            public List<MBThread> getGroupThreads(long groupId, long userId,
231                    boolean subscribed, QueryDefinition<MBThread> queryDefinition);
232    
233            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
234            public int getGroupThreadsCount(long groupId,
235                    QueryDefinition<MBThread> queryDefinition);
236    
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public int getGroupThreadsCount(long groupId, long userId,
239                    QueryDefinition<MBThread> queryDefinition);
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public int getGroupThreadsCount(long groupId, long userId,
243                    boolean subscribed, boolean includeAnonymous,
244                    QueryDefinition<MBThread> queryDefinition);
245    
246            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247            public int getGroupThreadsCount(long groupId, long userId,
248                    boolean subscribed, QueryDefinition<MBThread> queryDefinition);
249    
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
252    
253            /**
254            * Returns the message boards thread with the primary key.
255            *
256            * @param threadId the primary key of the message boards thread
257            * @return the message boards thread
258            * @throws PortalException if a message boards thread with the primary key could not be found
259            */
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public MBThread getMBThread(long threadId) throws PortalException;
262    
263            /**
264            * Returns the message boards thread matching the UUID and group.
265            *
266            * @param uuid the message boards thread's UUID
267            * @param groupId the primary key of the group
268            * @return the matching message boards thread
269            * @throws PortalException if a matching message boards thread could not be found
270            */
271            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272            public MBThread getMBThreadByUuidAndGroupId(java.lang.String uuid,
273                    long groupId) throws PortalException;
274    
275            /**
276            * Returns a range of all the message boards threads.
277            *
278            * <p>
279            * 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.MBThreadModelImpl}. 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.
280            * </p>
281            *
282            * @param start the lower bound of the range of message boards threads
283            * @param end the upper bound of the range of message boards threads (not inclusive)
284            * @return the range of message boards threads
285            */
286            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287            public List<MBThread> getMBThreads(int start, int end);
288    
289            /**
290            * Returns all the message boards threads matching the UUID and company.
291            *
292            * @param uuid the UUID of the message boards threads
293            * @param companyId the primary key of the company
294            * @return the matching message boards threads, or an empty list if no matches were found
295            */
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public List<MBThread> getMBThreadsByUuidAndCompanyId(
298                    java.lang.String uuid, long companyId);
299    
300            /**
301            * Returns a range of message boards threads matching the UUID and company.
302            *
303            * @param uuid the UUID of the message boards threads
304            * @param companyId the primary key of the company
305            * @param start the lower bound of the range of message boards threads
306            * @param end the upper bound of the range of message boards threads (not inclusive)
307            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
308            * @return the range of matching message boards threads, or an empty list if no matches were found
309            */
310            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
311            public List<MBThread> getMBThreadsByUuidAndCompanyId(
312                    java.lang.String uuid, long companyId, int start, int end,
313                    OrderByComparator<MBThread> orderByComparator);
314    
315            /**
316            * Returns the number of message boards threads.
317            *
318            * @return the number of message boards threads
319            */
320            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
321            public int getMBThreadsCount();
322    
323            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
324            public List<MBThread> getNoAssetThreads();
325    
326            /**
327            * Returns the OSGi service identifier.
328            *
329            * @return the OSGi service identifier
330            */
331            public java.lang.String getOSGiServiceIdentifier();
332    
333            @Override
334            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
335            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
336                    throws PortalException;
337    
338            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
339            public List<MBThread> getPriorityThreads(long categoryId, double priority)
340                    throws PortalException;
341    
342            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
343            public List<MBThread> getPriorityThreads(long categoryId, double priority,
344                    boolean inherit) throws PortalException;
345    
346            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
347            public MBThread getThread(long threadId) throws PortalException;
348    
349            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
350            public List<MBThread> getThreads(long groupId, long categoryId, int status,
351                    int start, int end);
352    
353            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
354            public int getThreadsCount(long groupId, long categoryId, int status);
355    
356            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357            public boolean hasAnswerMessage(long threadId);
358    
359            @BufferedIncrement(configuration = "MBThread", incrementClass = com.liferay.portal.kernel.increment.NumberIncrement.class)
360            public void incrementViewCounter(long threadId, int increment)
361                    throws PortalException;
362    
363            public void moveDependentsToTrash(long groupId, long threadId,
364                    long trashEntryId) throws PortalException;
365    
366            public MBThread moveThread(long groupId, long categoryId, long threadId)
367                    throws PortalException;
368    
369            public MBThread moveThreadFromTrash(long userId, long categoryId,
370                    long threadId) throws PortalException;
371    
372            public MBThread moveThreadToTrash(long userId, MBThread thread)
373                    throws PortalException;
374    
375            public MBThread moveThreadToTrash(long userId, long threadId)
376                    throws PortalException;
377    
378            public void moveThreadsToTrash(long groupId, long userId)
379                    throws PortalException;
380    
381            public void restoreDependentsFromTrash(long groupId, long threadId)
382                    throws PortalException;
383    
384            /**
385            * @deprecated As of 7.0.0, replaced by {@link
386            #restoreDependentsFromTrash(long, long)}
387            */
388            @java.lang.Deprecated
389            public void restoreDependentsFromTrash(long groupId, long threadId,
390                    long trashEntryId) throws PortalException;
391    
392            public void restoreThreadFromTrash(long userId, long threadId)
393                    throws PortalException;
394    
395            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
396            public Hits search(long groupId, long userId, long creatorUserId,
397                    long startDate, long endDate, int status, int start, int end)
398                    throws PortalException;
399    
400            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
401            public Hits search(long groupId, long userId, long creatorUserId,
402                    int status, int start, int end) throws PortalException;
403    
404            public MBThread splitThread(long userId, long messageId,
405                    java.lang.String subject, ServiceContext serviceContext)
406                    throws PortalException;
407    
408            /**
409            * Updates the message boards thread in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
410            *
411            * @param mbThread the message boards thread
412            * @return the message boards thread that was updated
413            */
414            @Indexable(type = IndexableType.REINDEX)
415            public MBThread updateMBThread(MBThread mbThread);
416    
417            public MBThread updateMessageCount(long threadId);
418    
419            public void updateQuestion(long threadId, boolean question)
420                    throws PortalException;
421    
422            public MBThread updateStatus(long userId, long threadId, int status)
423                    throws PortalException;
424    }