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.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.systemevent.SystemEvent;
029    import com.liferay.portal.kernel.transaction.Isolation;
030    import com.liferay.portal.kernel.transaction.Propagation;
031    import com.liferay.portal.kernel.transaction.Transactional;
032    import com.liferay.portal.kernel.util.ObjectValuePair;
033    import com.liferay.portal.kernel.util.OrderByComparator;
034    import com.liferay.portal.model.PersistedModel;
035    import com.liferay.portal.model.SystemEventConstants;
036    import com.liferay.portal.service.BaseLocalService;
037    import com.liferay.portal.service.PersistedModelLocalService;
038    import com.liferay.portal.service.ServiceContext;
039    import com.liferay.portal.service.permission.ModelPermissions;
040    
041    import com.liferay.portlet.exportimport.lar.PortletDataContext;
042    import com.liferay.portlet.messageboards.model.MBDiscussion;
043    import com.liferay.portlet.messageboards.model.MBMessage;
044    import com.liferay.portlet.messageboards.model.MBMessageDisplay;
045    
046    import java.io.File;
047    import java.io.FileNotFoundException;
048    import java.io.InputStream;
049    import java.io.Serializable;
050    
051    import java.util.Comparator;
052    import java.util.List;
053    import java.util.Map;
054    
055    /**
056     * Provides the local service interface for MBMessage. Methods of this
057     * service will not have security checks based on the propagated JAAS
058     * credentials because this service can only be accessed from within the same
059     * VM.
060     *
061     * @author Brian Wing Shun Chan
062     * @see MBMessageLocalServiceUtil
063     * @see com.liferay.portlet.messageboards.service.base.MBMessageLocalServiceBaseImpl
064     * @see com.liferay.portlet.messageboards.service.impl.MBMessageLocalServiceImpl
065     * @generated
066     */
067    @ProviderType
068    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
069            PortalException.class, SystemException.class})
070    public interface MBMessageLocalService extends BaseLocalService,
071            PersistedModelLocalService {
072            /*
073             * NOTE FOR DEVELOPERS:
074             *
075             * Never modify or reference this interface directly. Always use {@link MBMessageLocalServiceUtil} to access the message-boards message local service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBMessageLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
076             */
077            public MBMessage addDiscussionMessage(long userId,
078                    java.lang.String userName, long groupId, java.lang.String className,
079                    long classPK, long threadId, long parentMessageId,
080                    java.lang.String subject, java.lang.String body,
081                    ServiceContext serviceContext) throws PortalException;
082    
083            public MBMessage addDiscussionMessage(long userId,
084                    java.lang.String userName, long groupId, java.lang.String className,
085                    long classPK, int workflowAction) throws PortalException;
086    
087            /**
088            * Adds the message-boards message to the database. Also notifies the appropriate model listeners.
089            *
090            * @param mbMessage the message-boards message
091            * @return the message-boards message that was added
092            */
093            @Indexable(type = IndexableType.REINDEX)
094            public MBMessage addMBMessage(MBMessage mbMessage);
095    
096            /**
097            * @deprecated As of 7.0.0, replaced by {@link #addMessage(long, String,
098            long, long, String, String, ServiceContext)}
099            */
100            @java.lang.Deprecated
101            public MBMessage addMessage(long userId, java.lang.String userName,
102                    long categoryId, java.lang.String subject, java.lang.String body,
103                    ServiceContext serviceContext) throws PortalException;
104    
105            public MBMessage addMessage(long userId, java.lang.String userName,
106                    long groupId, long categoryId, java.lang.String subject,
107                    java.lang.String body, java.lang.String format,
108                    java.lang.String fileName, File file, boolean anonymous,
109                    double priority, boolean allowPingbacks, ServiceContext serviceContext)
110                    throws PortalException, FileNotFoundException;
111    
112            public MBMessage addMessage(long userId, java.lang.String userName,
113                    long groupId, long categoryId, java.lang.String subject,
114                    java.lang.String body, java.lang.String format,
115                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
116                    boolean anonymous, double priority, boolean allowPingbacks,
117                    ServiceContext serviceContext) throws PortalException;
118    
119            public MBMessage addMessage(long userId, java.lang.String userName,
120                    long groupId, long categoryId, java.lang.String subject,
121                    java.lang.String body, ServiceContext serviceContext)
122                    throws PortalException;
123    
124            public MBMessage addMessage(long userId, java.lang.String userName,
125                    long groupId, long categoryId, long threadId, long parentMessageId,
126                    java.lang.String subject, java.lang.String body,
127                    java.lang.String format,
128                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
129                    boolean anonymous, double priority, boolean allowPingbacks,
130                    ServiceContext serviceContext) throws PortalException;
131    
132            public void addMessageAttachment(long userId, long messageId,
133                    java.lang.String fileName, File file, java.lang.String mimeType)
134                    throws PortalException;
135    
136            public void addMessageResources(MBMessage message,
137                    boolean addGroupPermissions, boolean addGuestPermissions)
138                    throws PortalException;
139    
140            public void addMessageResources(MBMessage message,
141                    ModelPermissions modelPermissions) throws PortalException;
142    
143            public void addMessageResources(long messageId,
144                    boolean addGroupPermissions, boolean addGuestPermissions)
145                    throws PortalException;
146    
147            public void addMessageResources(long messageId,
148                    ModelPermissions modelPermissions) throws PortalException;
149    
150            /**
151            * Creates a new message-boards message with the primary key. Does not add the message-boards message to the database.
152            *
153            * @param messageId the primary key for the new message-boards message
154            * @return the new message-boards message
155            */
156            public MBMessage createMBMessage(long messageId);
157    
158            @Indexable(type = IndexableType.DELETE)
159            public MBMessage deleteDiscussionMessage(long messageId)
160                    throws PortalException;
161    
162            public void deleteDiscussionMessages(java.lang.String className,
163                    long classPK) throws PortalException;
164    
165            /**
166            * Deletes the message-boards message from the database. Also notifies the appropriate model listeners.
167            *
168            * @param mbMessage the message-boards message
169            * @return the message-boards message that was removed
170            */
171            @Indexable(type = IndexableType.DELETE)
172            public MBMessage deleteMBMessage(MBMessage mbMessage);
173    
174            /**
175            * Deletes the message-boards message with the primary key from the database. Also notifies the appropriate model listeners.
176            *
177            * @param messageId the primary key of the message-boards message
178            * @return the message-boards message that was removed
179            * @throws PortalException if a message-boards message with the primary key could not be found
180            */
181            @Indexable(type = IndexableType.DELETE)
182            public MBMessage deleteMBMessage(long messageId) throws PortalException;
183    
184            @Indexable(type = IndexableType.DELETE)
185            @SystemEvent(type = SystemEventConstants.TYPE_DELETE)
186            public MBMessage deleteMessage(MBMessage message) throws PortalException;
187    
188            @Indexable(type = IndexableType.DELETE)
189            public MBMessage deleteMessage(long messageId) throws PortalException;
190    
191            public void deleteMessageAttachment(long messageId,
192                    java.lang.String fileName) throws PortalException;
193    
194            public void deleteMessageAttachments(long messageId)
195                    throws PortalException;
196    
197            /**
198            * @throws PortalException
199            */
200            @Override
201            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
202                    throws PortalException;
203    
204            public DynamicQuery dynamicQuery();
205    
206            /**
207            * Performs a dynamic query on the database and returns the matching rows.
208            *
209            * @param dynamicQuery the dynamic query
210            * @return the matching rows
211            */
212            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
213    
214            /**
215            * Performs a dynamic query on the database and returns a range of the matching rows.
216            *
217            * <p>
218            * 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.MBMessageModelImpl}. 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.
219            * </p>
220            *
221            * @param dynamicQuery the dynamic query
222            * @param start the lower bound of the range of model instances
223            * @param end the upper bound of the range of model instances (not inclusive)
224            * @return the range of matching rows
225            */
226            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
227                    int end);
228    
229            /**
230            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
231            *
232            * <p>
233            * 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.MBMessageModelImpl}. 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.
234            * </p>
235            *
236            * @param dynamicQuery the dynamic query
237            * @param start the lower bound of the range of model instances
238            * @param end the upper bound of the range of model instances (not inclusive)
239            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
240            * @return the ordered range of matching rows
241            */
242            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
243                    int end, OrderByComparator<T> orderByComparator);
244    
245            /**
246            * Returns the number of rows matching the dynamic query.
247            *
248            * @param dynamicQuery the dynamic query
249            * @return the number of rows matching the dynamic query
250            */
251            public long dynamicQueryCount(DynamicQuery dynamicQuery);
252    
253            /**
254            * Returns the number of rows matching the dynamic query.
255            *
256            * @param dynamicQuery the dynamic query
257            * @param projection the projection to apply to the query
258            * @return the number of rows matching the dynamic query
259            */
260            public long dynamicQueryCount(DynamicQuery dynamicQuery,
261                    Projection projection);
262    
263            public void emptyMessageAttachments(long messageId)
264                    throws PortalException;
265    
266            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
267            public MBMessage fetchMBMessage(long messageId);
268    
269            /**
270            * Returns the message-boards message matching the UUID and group.
271            *
272            * @param uuid the message-boards message's UUID
273            * @param groupId the primary key of the group
274            * @return the matching message-boards message, or <code>null</code> if a matching message-boards message could not be found
275            */
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public MBMessage fetchMBMessageByUuidAndGroupId(java.lang.String uuid,
278                    long groupId);
279    
280            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281            public ActionableDynamicQuery getActionableDynamicQuery();
282    
283            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
284            public List<MBMessage> getCategoryMessages(long groupId, long categoryId,
285                    int status, int start, int end);
286    
287            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
288            public List<MBMessage> getCategoryMessages(long groupId, long categoryId,
289                    int status, int start, int end, OrderByComparator<MBMessage> obc);
290    
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public int getCategoryMessagesCount(long groupId, long categoryId,
293                    int status);
294    
295            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296            public List<MBMessage> getCompanyMessages(long companyId, int status,
297                    int start, int end);
298    
299            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
300            public List<MBMessage> getCompanyMessages(long companyId, int status,
301                    int start, int end, OrderByComparator<MBMessage> obc);
302    
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public int getCompanyMessagesCount(long companyId, int status);
305    
306            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307            public MBMessageDisplay getDiscussionMessageDisplay(long userId,
308                    long groupId, java.lang.String className, long classPK, int status)
309                    throws PortalException;
310    
311            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312            public MBMessageDisplay getDiscussionMessageDisplay(long userId,
313                    long groupId, java.lang.String className, long classPK, int status,
314                    Comparator<MBMessage> comparator) throws PortalException;
315    
316            /**
317            * @deprecated As of 7.0.0, replaced by {@link
318            #getDiscussionMessageDisplay(long, long, String, long, int)}
319            */
320            @java.lang.Deprecated
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public MBMessageDisplay getDiscussionMessageDisplay(long userId,
323                    long groupId, java.lang.String className, long classPK, int status,
324                    java.lang.String threadView) throws PortalException;
325    
326            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
327            public int getDiscussionMessagesCount(java.lang.String className,
328                    long classPK, int status);
329    
330            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
331            public int getDiscussionMessagesCount(long classNameId, long classPK,
332                    int status);
333    
334            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
335            public List<MBDiscussion> getDiscussions(java.lang.String className);
336    
337            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
338            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
339                    PortletDataContext portletDataContext);
340    
341            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
342            public List<MBMessage> getGroupMessages(long groupId, int status,
343                    int start, int end);
344    
345            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
346            public List<MBMessage> getGroupMessages(long groupId, int status,
347                    int start, int end, OrderByComparator<MBMessage> obc);
348    
349            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
350            public List<MBMessage> getGroupMessages(long groupId, long userId,
351                    int status, int start, int end);
352    
353            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
354            public List<MBMessage> getGroupMessages(long groupId, long userId,
355                    int status, int start, int end, OrderByComparator<MBMessage> obc);
356    
357            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
358            public int getGroupMessagesCount(long groupId, int status);
359    
360            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361            public int getGroupMessagesCount(long groupId, long userId, int status);
362    
363            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
364            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
365    
366            /**
367            * Returns the message-boards message with the primary key.
368            *
369            * @param messageId the primary key of the message-boards message
370            * @return the message-boards message
371            * @throws PortalException if a message-boards message with the primary key could not be found
372            */
373            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
374            public MBMessage getMBMessage(long messageId) throws PortalException;
375    
376            /**
377            * Returns the message-boards message matching the UUID and group.
378            *
379            * @param uuid the message-boards message's UUID
380            * @param groupId the primary key of the group
381            * @return the matching message-boards message
382            * @throws PortalException if a matching message-boards message could not be found
383            */
384            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
385            public MBMessage getMBMessageByUuidAndGroupId(java.lang.String uuid,
386                    long groupId) throws PortalException;
387    
388            /**
389            * Returns a range of all the message-boards messages.
390            *
391            * <p>
392            * 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.MBMessageModelImpl}. 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.
393            * </p>
394            *
395            * @param start the lower bound of the range of message-boards messages
396            * @param end the upper bound of the range of message-boards messages (not inclusive)
397            * @return the range of message-boards messages
398            */
399            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
400            public List<MBMessage> getMBMessages(int start, int end);
401    
402            /**
403            * Returns all the message-boards messages matching the UUID and company.
404            *
405            * @param uuid the UUID of the message-boards messages
406            * @param companyId the primary key of the company
407            * @return the matching message-boards messages, or an empty list if no matches were found
408            */
409            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
410            public List<MBMessage> getMBMessagesByUuidAndCompanyId(
411                    java.lang.String uuid, long companyId);
412    
413            /**
414            * Returns a range of message-boards messages matching the UUID and company.
415            *
416            * @param uuid the UUID of the message-boards messages
417            * @param companyId the primary key of the company
418            * @param start the lower bound of the range of message-boards messages
419            * @param end the upper bound of the range of message-boards messages (not inclusive)
420            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
421            * @return the range of matching message-boards messages, or an empty list if no matches were found
422            */
423            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
424            public List<MBMessage> getMBMessagesByUuidAndCompanyId(
425                    java.lang.String uuid, long companyId, int start, int end,
426                    OrderByComparator<MBMessage> orderByComparator);
427    
428            /**
429            * Returns the number of message-boards messages.
430            *
431            * @return the number of message-boards messages
432            */
433            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
434            public int getMBMessagesCount();
435    
436            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
437            public MBMessage getMessage(long messageId) throws PortalException;
438    
439            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
440            public MBMessageDisplay getMessageDisplay(long userId, MBMessage message,
441                    int status, boolean includePrevAndNext) throws PortalException;
442    
443            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
444            public MBMessageDisplay getMessageDisplay(long userId, MBMessage message,
445                    int status, boolean includePrevAndNext, Comparator<MBMessage> comparator)
446                    throws PortalException;
447    
448            /**
449            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
450            MBMessage, int, boolean)}
451            */
452            @java.lang.Deprecated
453            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
454            public MBMessageDisplay getMessageDisplay(long userId, MBMessage message,
455                    int status, java.lang.String threadView, boolean includePrevAndNext)
456                    throws PortalException;
457    
458            /**
459            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
460            MBMessage, int, boolean, Comparator)} (
461            */
462            @java.lang.Deprecated
463            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
464            public MBMessageDisplay getMessageDisplay(long userId, MBMessage message,
465                    int status, java.lang.String threadView, boolean includePrevAndNext,
466                    Comparator<MBMessage> comparator) throws PortalException;
467    
468            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
469            public MBMessageDisplay getMessageDisplay(long userId, long messageId,
470                    int status, boolean includePrevAndNext) throws PortalException;
471    
472            /**
473            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
474            long, int, boolean)}
475            */
476            @java.lang.Deprecated
477            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
478            public MBMessageDisplay getMessageDisplay(long userId, long messageId,
479                    int status, java.lang.String threadView, boolean includePrevAndNext)
480                    throws PortalException;
481    
482            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
483            public List<MBMessage> getMessages(java.lang.String className,
484                    long classPK, int status);
485    
486            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
487            public List<MBMessage> getNoAssetMessages();
488    
489            /**
490            * Returns the OSGi service identifier.
491            *
492            * @return the OSGi service identifier
493            */
494            public java.lang.String getOSGiServiceIdentifier();
495    
496            @Override
497            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
498            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
499                    throws PortalException;
500    
501            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
502            public int getPositionInThread(long messageId) throws PortalException;
503    
504            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
505            public List<MBMessage> getThreadMessages(long threadId, int status);
506    
507            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
508            public List<MBMessage> getThreadMessages(long threadId, int status,
509                    Comparator<MBMessage> comparator);
510    
511            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
512            public List<MBMessage> getThreadMessages(long threadId, int status,
513                    int start, int end);
514    
515            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
516            public int getThreadMessagesCount(long threadId, int status);
517    
518            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
519            public List<MBMessage> getThreadRepliesMessages(long threadId, int status,
520                    int start, int end);
521    
522            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
523            public List<MBMessage> getUserDiscussionMessages(long userId,
524                    java.lang.String className, long classPK, int status, int start,
525                    int end, OrderByComparator<MBMessage> obc);
526    
527            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
528            public List<MBMessage> getUserDiscussionMessages(long userId,
529                    long classNameId, long classPK, int status, int start, int end,
530                    OrderByComparator<MBMessage> obc);
531    
532            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
533            public List<MBMessage> getUserDiscussionMessages(long userId,
534                    long[] classNameIds, int status, int start, int end,
535                    OrderByComparator<MBMessage> obc);
536    
537            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
538            public int getUserDiscussionMessagesCount(long userId,
539                    java.lang.String className, long classPK, int status);
540    
541            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
542            public int getUserDiscussionMessagesCount(long userId, long classNameId,
543                    long classPK, int status);
544    
545            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
546            public int getUserDiscussionMessagesCount(long userId, long[] classNameIds,
547                    int status);
548    
549            public long moveMessageAttachmentToTrash(long userId, long messageId,
550                    java.lang.String fileName) throws PortalException;
551    
552            public void restoreMessageAttachmentFromTrash(long userId, long messageId,
553                    java.lang.String deletedFileName) throws PortalException;
554    
555            public void subscribeMessage(long userId, long messageId)
556                    throws PortalException;
557    
558            public void unsubscribeMessage(long userId, long messageId)
559                    throws PortalException;
560    
561            public void updateAnswer(MBMessage message, boolean answer, boolean cascade)
562                    throws PortalException;
563    
564            public void updateAnswer(long messageId, boolean answer, boolean cascade)
565                    throws PortalException;
566    
567            public void updateAsset(long userId, MBMessage message,
568                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
569                    long[] assetLinkEntryIds) throws PortalException;
570    
571            public MBMessage updateDiscussionMessage(long userId, long messageId,
572                    java.lang.String className, long classPK, java.lang.String subject,
573                    java.lang.String body, ServiceContext serviceContext)
574                    throws PortalException;
575    
576            /**
577            * Updates the message-boards message in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
578            *
579            * @param mbMessage the message-boards message
580            * @return the message-boards message that was updated
581            */
582            @Indexable(type = IndexableType.REINDEX)
583            public MBMessage updateMBMessage(MBMessage mbMessage);
584    
585            /**
586            * @deprecated As of 7.0.0, with no direct replacement
587            */
588            @java.lang.Deprecated
589            public MBMessage updateMessage(long messageId, java.lang.String body)
590                    throws PortalException;
591    
592            public MBMessage updateMessage(long userId, long messageId,
593                    java.lang.String body, ServiceContext serviceContext)
594                    throws PortalException;
595    
596            public MBMessage updateMessage(long userId, long messageId,
597                    java.lang.String subject, java.lang.String body,
598                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
599                    List<java.lang.String> existingFiles, double priority,
600                    boolean allowPingbacks, ServiceContext serviceContext)
601                    throws PortalException;
602    
603            /**
604            * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, long,
605            int, ServiceContext, Map)}
606            */
607            @java.lang.Deprecated
608            public MBMessage updateStatus(long userId, long messageId, int status,
609                    ServiceContext serviceContext) throws PortalException;
610    
611            public MBMessage updateStatus(long userId, long messageId, int status,
612                    ServiceContext serviceContext,
613                    Map<java.lang.String, Serializable> workflowContext)
614                    throws PortalException;
615    
616            public void updateUserName(long userId, java.lang.String userName);
617    }