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.message.boards.kernel.model.MBMessage;
020    import com.liferay.message.boards.kernel.model.MBMessageDisplay;
021    
022    import com.liferay.portal.kernel.exception.PortalException;
023    import com.liferay.portal.kernel.exception.SystemException;
024    import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
025    import com.liferay.portal.kernel.security.access.control.AccessControlled;
026    import com.liferay.portal.kernel.service.BaseService;
027    import com.liferay.portal.kernel.service.ServiceContext;
028    import com.liferay.portal.kernel.theme.ThemeDisplay;
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    
034    import java.io.File;
035    import java.io.FileNotFoundException;
036    import java.io.InputStream;
037    
038    import java.util.List;
039    
040    /**
041     * Provides the remote service interface for MBMessage. Methods of this
042     * service are expected to have security checks based on the propagated JAAS
043     * credentials because this service can be accessed remotely.
044     *
045     * @author Brian Wing Shun Chan
046     * @see MBMessageServiceUtil
047     * @see com.liferay.portlet.messageboards.service.base.MBMessageServiceBaseImpl
048     * @see com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl
049     * @generated
050     */
051    @AccessControlled
052    @JSONWebService
053    @ProviderType
054    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
055            PortalException.class, SystemException.class})
056    public interface MBMessageService extends BaseService {
057            /*
058             * NOTE FOR DEVELOPERS:
059             *
060             * Never modify or reference this interface directly. Always use {@link MBMessageServiceUtil} to access the message-boards message remote service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBMessageServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
061             */
062            public MBMessage addDiscussionMessage(long groupId,
063                    java.lang.String className, long classPK, long threadId,
064                    long parentMessageId, java.lang.String subject, java.lang.String body,
065                    ServiceContext serviceContext) throws PortalException;
066    
067            public MBMessage addMessage(long categoryId, java.lang.String subject,
068                    java.lang.String body, ServiceContext serviceContext)
069                    throws PortalException;
070    
071            public MBMessage addMessage(long groupId, long categoryId,
072                    java.lang.String subject, java.lang.String body,
073                    java.lang.String format, java.lang.String fileName, File file,
074                    boolean anonymous, double priority, boolean allowPingbacks,
075                    ServiceContext serviceContext)
076                    throws PortalException, FileNotFoundException;
077    
078            public MBMessage addMessage(long groupId, long categoryId,
079                    java.lang.String subject, java.lang.String body,
080                    java.lang.String format,
081                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
082                    boolean anonymous, double priority, boolean allowPingbacks,
083                    ServiceContext serviceContext) throws PortalException;
084    
085            public MBMessage addMessage(long parentMessageId, java.lang.String subject,
086                    java.lang.String body, java.lang.String format,
087                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
088                    boolean anonymous, double priority, boolean allowPingbacks,
089                    ServiceContext serviceContext) throws PortalException;
090    
091            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
092            public MBMessage getMessage(long messageId) throws PortalException;
093    
094            public MBMessage updateDiscussionMessage(java.lang.String className,
095                    long classPK, long messageId, java.lang.String subject,
096                    java.lang.String body, ServiceContext serviceContext)
097                    throws PortalException;
098    
099            public MBMessage updateMessage(long messageId, java.lang.String subject,
100                    java.lang.String body,
101                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
102                    List<java.lang.String> existingFiles, double priority,
103                    boolean allowPingbacks, ServiceContext serviceContext)
104                    throws PortalException;
105    
106            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
107            public MBMessageDisplay getMessageDisplay(long messageId, int status)
108                    throws PortalException;
109    
110            /**
111            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long,
112            int)}
113            */
114            @java.lang.Deprecated
115            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
116            public MBMessageDisplay getMessageDisplay(long messageId, int status,
117                    java.lang.String threadView, boolean includePrevAndNext)
118                    throws PortalException;
119    
120            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
121            public int getCategoryMessagesCount(long groupId, long categoryId,
122                    int status);
123    
124            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125            public int getGroupMessagesCount(long groupId, int status);
126    
127            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
128            public int getThreadAnswersCount(long groupId, long categoryId,
129                    long threadId);
130    
131            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132            public int getThreadMessagesCount(long groupId, long categoryId,
133                    long threadId, int status);
134    
135            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
136            public java.lang.String getCategoryMessagesRSS(long groupId,
137                    long categoryId, int status, int max, java.lang.String type,
138                    double version, java.lang.String displayStyle,
139                    java.lang.String feedURL, java.lang.String entryURL,
140                    ThemeDisplay themeDisplay) throws PortalException;
141    
142            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
143            public java.lang.String getCompanyMessagesRSS(long companyId, int status,
144                    int max, java.lang.String type, double version,
145                    java.lang.String displayStyle, java.lang.String feedURL,
146                    java.lang.String entryURL, ThemeDisplay themeDisplay)
147                    throws PortalException;
148    
149            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
150            public java.lang.String getGroupMessagesRSS(long groupId, int status,
151                    int max, java.lang.String type, double version,
152                    java.lang.String displayStyle, java.lang.String feedURL,
153                    java.lang.String entryURL, ThemeDisplay themeDisplay)
154                    throws PortalException;
155    
156            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
157            public java.lang.String getGroupMessagesRSS(long groupId, long userId,
158                    int status, int max, java.lang.String type, double version,
159                    java.lang.String displayStyle, java.lang.String feedURL,
160                    java.lang.String entryURL, ThemeDisplay themeDisplay)
161                    throws PortalException;
162    
163            /**
164            * Returns the OSGi service identifier.
165            *
166            * @return the OSGi service identifier
167            */
168            public java.lang.String getOSGiServiceIdentifier();
169    
170            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171            public java.lang.String getThreadMessagesRSS(long threadId, int status,
172                    int max, java.lang.String type, double version,
173                    java.lang.String displayStyle, java.lang.String feedURL,
174                    java.lang.String entryURL, ThemeDisplay themeDisplay)
175                    throws PortalException;
176    
177            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178            public List<MBMessage> getCategoryMessages(long groupId, long categoryId,
179                    int status, int start, int end) throws PortalException;
180    
181            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182            public List<MBMessage> getThreadMessages(long groupId, long categoryId,
183                    long threadId, int status, int start, int end);
184    
185            public void addMessageAttachment(long messageId, java.lang.String fileName,
186                    File file, java.lang.String mimeType) throws PortalException;
187    
188            /**
189            * @deprecated As of 7.0.0, replaced by {@link
190            #deleteDiscussionMessage(long)}
191            */
192            @java.lang.Deprecated
193            public void deleteDiscussionMessage(long groupId,
194                    java.lang.String className, long classPK,
195                    java.lang.String permissionClassName, long permissionClassPK,
196                    long permissionOwnerId, long messageId) throws PortalException;
197    
198            public void deleteDiscussionMessage(long messageId)
199                    throws PortalException;
200    
201            public void deleteMessage(long messageId) throws PortalException;
202    
203            public void deleteMessageAttachment(long messageId,
204                    java.lang.String fileName) throws PortalException;
205    
206            public void deleteMessageAttachments(long messageId)
207                    throws PortalException;
208    
209            public void emptyMessageAttachments(long messageId)
210                    throws PortalException;
211    
212            public void restoreMessageAttachmentFromTrash(long messageId,
213                    java.lang.String fileName) throws PortalException;
214    
215            public void subscribeMessage(long messageId) throws PortalException;
216    
217            public void unsubscribeMessage(long messageId) throws PortalException;
218    
219            public void updateAnswer(long messageId, boolean answer, boolean cascade)
220                    throws PortalException;
221    }