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