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