001
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
062 @ProviderType
063 @Transactional(isolation = Isolation.PORTAL, rollbackFor = {
064 PortalException.class, SystemException.class})
065 public interface MBThreadLocalService extends BaseLocalService,
066 PersistedModelLocalService {
067
072
073
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
091 public MBThread createMBThread(long threadId);
092
093
099 @Indexable(type = IndexableType.DELETE)
100 public MBThread deleteMBThread(MBThread mbThread);
101
102
109 @Indexable(type = IndexableType.DELETE)
110 public MBThread deleteMBThread(long threadId) throws PortalException;
111
112
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
138 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
139
140
152 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
153 int end);
154
155
168 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
169 int end, OrderByComparator<T> orderByComparator);
170
171
177 public long dynamicQueryCount(DynamicQuery dynamicQuery);
178
179
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
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
260 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261 public MBThread getMBThread(long threadId) throws PortalException;
262
263
271 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272 public MBThread getMBThreadByUuidAndGroupId(java.lang.String uuid,
273 long groupId) throws PortalException;
274
275
286 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287 public List<MBThread> getMBThreads(int start, int end);
288
289
296 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297 public List<MBThread> getMBThreadsByUuidAndCompanyId(
298 java.lang.String uuid, long companyId);
299
300
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
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
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
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
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 }