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