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            public void addMessageAttachment(long messageId, java.lang.String fileName,
092                    File file, java.lang.String mimeType) throws PortalException;
093    
094            /**
095            * @deprecated As of 7.0.0, replaced by {@link
096            #deleteDiscussionMessage(long)}
097            */
098            @java.lang.Deprecated
099            public void deleteDiscussionMessage(long groupId,
100                    java.lang.String className, long classPK,
101                    java.lang.String permissionClassName, long permissionClassPK,
102                    long permissionOwnerId, long messageId) throws PortalException;
103    
104            public void deleteDiscussionMessage(long messageId)
105                    throws PortalException;
106    
107            public void deleteMessage(long messageId) throws PortalException;
108    
109            public void deleteMessageAttachment(long messageId,
110                    java.lang.String fileName) throws PortalException;
111    
112            public void deleteMessageAttachments(long messageId)
113                    throws PortalException;
114    
115            public void emptyMessageAttachments(long messageId)
116                    throws PortalException;
117    
118            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
119            public List<MBMessage> getCategoryMessages(long groupId, long categoryId,
120                    int status, int start, int end) throws PortalException;
121    
122            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123            public int getCategoryMessagesCount(long groupId, long categoryId,
124                    int status);
125    
126            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
127            public java.lang.String getCategoryMessagesRSS(long groupId,
128                    long categoryId, int status, int max, java.lang.String type,
129                    double version, java.lang.String displayStyle,
130                    java.lang.String feedURL, java.lang.String entryURL,
131                    ThemeDisplay themeDisplay) throws PortalException;
132    
133            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134            public java.lang.String getCompanyMessagesRSS(long companyId, int status,
135                    int max, java.lang.String type, double version,
136                    java.lang.String displayStyle, java.lang.String feedURL,
137                    java.lang.String entryURL, ThemeDisplay themeDisplay)
138                    throws PortalException;
139    
140            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
141            public int getGroupMessagesCount(long groupId, int status);
142    
143            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144            public java.lang.String getGroupMessagesRSS(long groupId, int status,
145                    int max, java.lang.String type, double version,
146                    java.lang.String displayStyle, java.lang.String feedURL,
147                    java.lang.String entryURL, ThemeDisplay themeDisplay)
148                    throws PortalException;
149    
150            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
151            public java.lang.String getGroupMessagesRSS(long groupId, long userId,
152                    int status, int max, java.lang.String type, double version,
153                    java.lang.String displayStyle, java.lang.String feedURL,
154                    java.lang.String entryURL, ThemeDisplay themeDisplay)
155                    throws PortalException;
156    
157            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
158            public MBMessage getMessage(long messageId) throws PortalException;
159    
160            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
161            public MBMessageDisplay getMessageDisplay(long messageId, int status,
162                    boolean includePrevAndNext) throws PortalException;
163    
164            /**
165            * @deprecated As of 7.0.0, replaced by {@link #getMessageDisplay(long, int,
166            boolean)}
167            */
168            @java.lang.Deprecated
169            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170            public MBMessageDisplay getMessageDisplay(long messageId, int status,
171                    java.lang.String threadView, boolean includePrevAndNext)
172                    throws PortalException;
173    
174            /**
175            * Returns the OSGi service identifier.
176            *
177            * @return the OSGi service identifier
178            */
179            public java.lang.String getOSGiServiceIdentifier();
180    
181            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182            public int getThreadAnswersCount(long groupId, long categoryId,
183                    long threadId);
184    
185            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186            public List<MBMessage> getThreadMessages(long groupId, long categoryId,
187                    long threadId, int status, int start, int end);
188    
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public int getThreadMessagesCount(long groupId, long categoryId,
191                    long threadId, int status);
192    
193            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
194            public java.lang.String getThreadMessagesRSS(long threadId, int status,
195                    int max, java.lang.String type, double version,
196                    java.lang.String displayStyle, java.lang.String feedURL,
197                    java.lang.String entryURL, ThemeDisplay themeDisplay)
198                    throws PortalException;
199    
200            public void restoreMessageAttachmentFromTrash(long messageId,
201                    java.lang.String fileName) throws PortalException;
202    
203            public void subscribeMessage(long messageId) throws PortalException;
204    
205            public void unsubscribeMessage(long messageId) throws PortalException;
206    
207            public void updateAnswer(long messageId, boolean answer, boolean cascade)
208                    throws PortalException;
209    
210            public MBMessage updateDiscussionMessage(java.lang.String className,
211                    long classPK, long messageId, java.lang.String subject,
212                    java.lang.String body, ServiceContext serviceContext)
213                    throws PortalException;
214    
215            public MBMessage updateMessage(long messageId, java.lang.String subject,
216                    java.lang.String body,
217                    List<ObjectValuePair<java.lang.String, InputStream>> inputStreamOVPs,
218                    List<java.lang.String> existingFiles, double priority,
219                    boolean allowPingbacks, ServiceContext serviceContext)
220                    throws PortalException;
221    }