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