1
22
23 package com.liferay.portlet.messageboards.service.http;
24
25 import com.liferay.portlet.messageboards.service.MBMessageServiceUtil;
26
27 import org.json.JSONArray;
28 import org.json.JSONObject;
29
30
74 public class MBMessageServiceJSON {
75 public static JSONObject addMessage(long categoryId,
76 java.lang.String subject, java.lang.String body,
77 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
78 boolean anonymous, double priority, java.lang.String[] tagsEntries,
79 boolean addCommunityPermissions, boolean addGuestPermissions)
80 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
81 com.liferay.portal.PortalException {
82 com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
83 subject, body, files, anonymous, priority, tagsEntries,
84 addCommunityPermissions, addGuestPermissions);
85
86 return MBMessageJSONSerializer.toJSONObject(returnValue);
87 }
88
89 public static JSONObject addMessage(long categoryId,
90 java.lang.String subject, java.lang.String body,
91 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
92 boolean anonymous, double priority, java.lang.String[] tagsEntries,
93 java.lang.String[] communityPermissions,
94 java.lang.String[] guestPermissions)
95 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
96 com.liferay.portal.PortalException {
97 com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
98 subject, body, files, anonymous, priority, tagsEntries,
99 communityPermissions, guestPermissions);
100
101 return MBMessageJSONSerializer.toJSONObject(returnValue);
102 }
103
104 public static JSONObject addMessage(long categoryId, long threadId,
105 long parentMessageId, java.lang.String subject, java.lang.String body,
106 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
107 boolean anonymous, double priority, java.lang.String[] tagsEntries,
108 boolean addCommunityPermissions, boolean addGuestPermissions)
109 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
110 com.liferay.portal.PortalException {
111 com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
112 threadId, parentMessageId, subject, body, files, anonymous,
113 priority, tagsEntries, addCommunityPermissions,
114 addGuestPermissions);
115
116 return MBMessageJSONSerializer.toJSONObject(returnValue);
117 }
118
119 public static JSONObject addMessage(long categoryId, long threadId,
120 long parentMessageId, java.lang.String subject, java.lang.String body,
121 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
122 boolean anonymous, double priority, java.lang.String[] tagsEntries,
123 java.lang.String[] communityPermissions,
124 java.lang.String[] guestPermissions)
125 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
126 com.liferay.portal.PortalException {
127 com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(categoryId,
128 threadId, parentMessageId, subject, body, files, anonymous,
129 priority, tagsEntries, communityPermissions, guestPermissions);
130
131 return MBMessageJSONSerializer.toJSONObject(returnValue);
132 }
133
134 public static void deleteDiscussionMessage(long groupId,
135 java.lang.String className, long classPK, long messageId)
136 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
137 com.liferay.portal.PortalException {
138 MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
139 classPK, messageId);
140 }
141
142 public static void deleteMessage(long messageId)
143 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
144 com.liferay.portal.PortalException {
145 MBMessageServiceUtil.deleteMessage(messageId);
146 }
147
148 public static JSONArray getCategoryMessages(long categoryId, int begin,
149 int end)
150 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
151 com.liferay.portal.PortalException {
152 java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
153 MBMessageServiceUtil.getCategoryMessages(categoryId, begin, end);
154
155 return MBMessageJSONSerializer.toJSONArray(returnValue);
156 }
157
158 public static int getCategoryMessagesCount(long categoryId)
159 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
160 com.liferay.portal.PortalException {
161 int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(categoryId);
162
163 return returnValue;
164 }
165
166 public static java.lang.String getCategoryMessagesRSS(long categoryId,
167 int max, java.lang.String type, double version,
168 java.lang.String displayStyle, java.lang.String feedURL,
169 java.lang.String entryURL)
170 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
171 com.liferay.portal.PortalException {
172 java.lang.String returnValue = MBMessageServiceUtil.getCategoryMessagesRSS(categoryId,
173 max, type, version, displayStyle, feedURL, entryURL);
174
175 return returnValue;
176 }
177
178 public static java.lang.String getCompanyMessagesRSS(long companyId,
179 int max, java.lang.String type, double version,
180 java.lang.String displayStyle, java.lang.String feedURL,
181 java.lang.String entryURL)
182 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
183 com.liferay.portal.PortalException {
184 java.lang.String returnValue = MBMessageServiceUtil.getCompanyMessagesRSS(companyId,
185 max, type, version, displayStyle, feedURL, entryURL);
186
187 return returnValue;
188 }
189
190 public static java.lang.String getGroupMessagesRSS(long groupId, int max,
191 java.lang.String type, double version, java.lang.String displayStyle,
192 java.lang.String feedURL, java.lang.String entryURL)
193 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
194 com.liferay.portal.PortalException {
195 java.lang.String returnValue = MBMessageServiceUtil.getGroupMessagesRSS(groupId,
196 max, type, version, displayStyle, feedURL, entryURL);
197
198 return returnValue;
199 }
200
201 public static java.lang.String getGroupMessagesRSS(long groupId,
202 long userId, int max, java.lang.String type, double version,
203 java.lang.String displayStyle, java.lang.String feedURL,
204 java.lang.String entryURL)
205 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
206 com.liferay.portal.PortalException {
207 java.lang.String returnValue = MBMessageServiceUtil.getGroupMessagesRSS(groupId,
208 userId, max, type, version, displayStyle, feedURL, entryURL);
209
210 return returnValue;
211 }
212
213 public static JSONObject getMessage(long messageId)
214 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
215 com.liferay.portal.PortalException {
216 com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
217
218 return MBMessageJSONSerializer.toJSONObject(returnValue);
219 }
220
221 public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
222 long messageId)
223 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
224 com.liferay.portal.PortalException {
225 com.liferay.portlet.messageboards.model.MBMessageDisplay returnValue = MBMessageServiceUtil.getMessageDisplay(messageId);
226
227 return returnValue;
228 }
229
230 public static java.lang.String getThreadMessagesRSS(long threadId, int max,
231 java.lang.String type, double version, java.lang.String displayStyle,
232 java.lang.String feedURL, java.lang.String entryURL)
233 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
234 com.liferay.portal.PortalException {
235 java.lang.String returnValue = MBMessageServiceUtil.getThreadMessagesRSS(threadId,
236 max, type, version, displayStyle, feedURL, entryURL);
237
238 return returnValue;
239 }
240
241 public static void subscribeMessage(long messageId)
242 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
243 com.liferay.portal.PortalException {
244 MBMessageServiceUtil.subscribeMessage(messageId);
245 }
246
247 public static void unsubscribeMessage(long messageId)
248 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
249 com.liferay.portal.PortalException {
250 MBMessageServiceUtil.unsubscribeMessage(messageId);
251 }
252
253 public static JSONObject updateDiscussionMessage(long groupId,
254 java.lang.String className, long classPK, long messageId,
255 java.lang.String subject, java.lang.String body)
256 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
257 com.liferay.portal.PortalException {
258 com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(groupId,
259 className, classPK, messageId, subject, body);
260
261 return MBMessageJSONSerializer.toJSONObject(returnValue);
262 }
263
264 public static JSONObject updateMessage(long messageId,
265 java.lang.String subject, java.lang.String body,
266 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
267 java.util.List<String> existingFiles, double priority,
268 java.lang.String[] tagsEntries)
269 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
270 com.liferay.portal.PortalException {
271 com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
272 subject, body, files, existingFiles, priority, tagsEntries);
273
274 return MBMessageJSONSerializer.toJSONObject(returnValue);
275 }
276 }