001
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
063 @ProviderType
064 @Transactional(isolation = Isolation.PORTAL, rollbackFor = {
065 PortalException.class, SystemException.class})
066 public interface MBThreadLocalService extends BaseLocalService,
067 PersistedModelLocalService {
068
073 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
074 public boolean hasAnswerMessage(long threadId);
075
076
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
094 public MBThread createMBThread(long threadId);
095
096
102 @Indexable(type = IndexableType.DELETE)
103 public MBThread deleteMBThread(MBThread mbThread);
104
105
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
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
139 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
140 public MBThread getMBThread(long threadId) throws PortalException;
141
142
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
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
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
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
256 public java.lang.String getOSGiServiceIdentifier();
257
258
264 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
265
266
278 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
279 int end);
280
281
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
325 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326 public List<MBThread> getMBThreads(int start, int end);
327
328
335 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336 public List<MBThread> getMBThreadsByUuidAndCompanyId(
337 java.lang.String uuid, long companyId);
338
339
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
375 public long dynamicQueryCount(DynamicQuery dynamicQuery);
376
377
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
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 }