1
14
15 package com.liferay.portlet.messageboards.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18 import com.liferay.portal.kernel.util.MethodCache;
19 import com.liferay.portal.kernel.util.ReferenceRegistry;
20
21
41 public class MBMessageServiceUtil {
42 public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
43 java.lang.String className, long classPK, long ownerId, long threadId,
44 long parentMessageId, java.lang.String subject, java.lang.String body,
45 com.liferay.portal.service.ServiceContext serviceContext)
46 throws com.liferay.portal.PortalException,
47 com.liferay.portal.SystemException {
48 return getService()
49 .addDiscussionMessage(className, classPK, ownerId, threadId,
50 parentMessageId, subject, body, serviceContext);
51 }
52
53 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
54 long categoryId, long threadId, long parentMessageId,
55 java.lang.String subject, java.lang.String body,
56 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
57 boolean anonymous, double priority,
58 com.liferay.portal.service.ServiceContext serviceContext)
59 throws com.liferay.portal.PortalException,
60 com.liferay.portal.SystemException {
61 return getService()
62 .addMessage(categoryId, threadId, parentMessageId, subject,
63 body, files, anonymous, priority, serviceContext);
64 }
65
66 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
67 long categoryId, java.lang.String subject, java.lang.String body,
68 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
69 boolean anonymous, double priority,
70 com.liferay.portal.service.ServiceContext serviceContext)
71 throws com.liferay.portal.PortalException,
72 com.liferay.portal.SystemException {
73 return getService()
74 .addMessage(categoryId, subject, body, files, anonymous,
75 priority, serviceContext);
76 }
77
78 public static void deleteDiscussionMessage(long groupId,
79 java.lang.String className, long classPK, long ownerId, long messageId)
80 throws com.liferay.portal.PortalException,
81 com.liferay.portal.SystemException {
82 getService()
83 .deleteDiscussionMessage(groupId, className, classPK, ownerId,
84 messageId);
85 }
86
87 public static void deleteMessage(long messageId)
88 throws com.liferay.portal.PortalException,
89 com.liferay.portal.SystemException {
90 getService().deleteMessage(messageId);
91 }
92
93 public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
94 long categoryId, int start, int end)
95 throws com.liferay.portal.PortalException,
96 com.liferay.portal.SystemException {
97 return getService().getCategoryMessages(categoryId, start, end);
98 }
99
100 public static int getCategoryMessagesCount(long categoryId)
101 throws com.liferay.portal.SystemException {
102 return getService().getCategoryMessagesCount(categoryId);
103 }
104
105 public static java.lang.String getCategoryMessagesRSS(long categoryId,
106 int max, java.lang.String type, double version,
107 java.lang.String displayStyle, java.lang.String feedURL,
108 java.lang.String entryURL,
109 com.liferay.portal.theme.ThemeDisplay themeDisplay)
110 throws com.liferay.portal.PortalException,
111 com.liferay.portal.SystemException {
112 return getService()
113 .getCategoryMessagesRSS(categoryId, max, type, version,
114 displayStyle, feedURL, entryURL, themeDisplay);
115 }
116
117 public static java.lang.String getCompanyMessagesRSS(long companyId,
118 int max, java.lang.String type, double version,
119 java.lang.String displayStyle, java.lang.String feedURL,
120 java.lang.String entryURL,
121 com.liferay.portal.theme.ThemeDisplay themeDisplay)
122 throws com.liferay.portal.PortalException,
123 com.liferay.portal.SystemException {
124 return getService()
125 .getCompanyMessagesRSS(companyId, max, type, version,
126 displayStyle, feedURL, entryURL, themeDisplay);
127 }
128
129 public static java.lang.String getGroupMessagesRSS(long groupId, int max,
130 java.lang.String type, double version, java.lang.String displayStyle,
131 java.lang.String feedURL, java.lang.String entryURL,
132 com.liferay.portal.theme.ThemeDisplay themeDisplay)
133 throws com.liferay.portal.PortalException,
134 com.liferay.portal.SystemException {
135 return getService()
136 .getGroupMessagesRSS(groupId, max, type, version,
137 displayStyle, feedURL, entryURL, themeDisplay);
138 }
139
140 public static java.lang.String getGroupMessagesRSS(long groupId,
141 long userId, int max, java.lang.String type, double version,
142 java.lang.String displayStyle, java.lang.String feedURL,
143 java.lang.String entryURL,
144 com.liferay.portal.theme.ThemeDisplay themeDisplay)
145 throws com.liferay.portal.PortalException,
146 com.liferay.portal.SystemException {
147 return getService()
148 .getGroupMessagesRSS(groupId, userId, max, type, version,
149 displayStyle, feedURL, entryURL, themeDisplay);
150 }
151
152 public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
153 long messageId)
154 throws com.liferay.portal.PortalException,
155 com.liferay.portal.SystemException {
156 return getService().getMessage(messageId);
157 }
158
159 public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
160 long messageId, java.lang.String threadView)
161 throws com.liferay.portal.PortalException,
162 com.liferay.portal.SystemException {
163 return getService().getMessageDisplay(messageId, threadView);
164 }
165
166 public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
167 long messageId, java.lang.String threadView, boolean includePrevAndNext)
168 throws com.liferay.portal.PortalException,
169 com.liferay.portal.SystemException {
170 return getService()
171 .getMessageDisplay(messageId, threadView, includePrevAndNext);
172 }
173
174 public static java.lang.String getThreadMessagesRSS(long threadId, int max,
175 java.lang.String type, double version, java.lang.String displayStyle,
176 java.lang.String feedURL, java.lang.String entryURL,
177 com.liferay.portal.theme.ThemeDisplay themeDisplay)
178 throws com.liferay.portal.PortalException,
179 com.liferay.portal.SystemException {
180 return getService()
181 .getThreadMessagesRSS(threadId, max, type, version,
182 displayStyle, feedURL, entryURL, themeDisplay);
183 }
184
185 public static void subscribeMessage(long messageId)
186 throws com.liferay.portal.PortalException,
187 com.liferay.portal.SystemException {
188 getService().subscribeMessage(messageId);
189 }
190
191 public static void unsubscribeMessage(long messageId)
192 throws com.liferay.portal.PortalException,
193 com.liferay.portal.SystemException {
194 getService().unsubscribeMessage(messageId);
195 }
196
197 public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
198 java.lang.String className, long classPK, long ownerId, long messageId,
199 java.lang.String subject, java.lang.String body,
200 com.liferay.portal.service.ServiceContext serviceContext)
201 throws com.liferay.portal.PortalException,
202 com.liferay.portal.SystemException {
203 return getService()
204 .updateDiscussionMessage(className, classPK, ownerId,
205 messageId, subject, body, serviceContext);
206 }
207
208 public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
209 long messageId, java.lang.String subject, java.lang.String body,
210 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
211 java.util.List<java.lang.String> existingFiles, double priority,
212 com.liferay.portal.service.ServiceContext serviceContext)
213 throws com.liferay.portal.PortalException,
214 com.liferay.portal.SystemException {
215 return getService()
216 .updateMessage(messageId, subject, body, files,
217 existingFiles, priority, serviceContext);
218 }
219
220 public static MBMessageService getService() {
221 if (_service == null) {
222 _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
223
224 ReferenceRegistry.registerReference(MBMessageServiceUtil.class,
225 "_service");
226 MethodCache.remove(MBMessageService.class);
227 }
228
229 return _service;
230 }
231
232 public void setService(MBMessageService service) {
233 MethodCache.remove(MBMessageService.class);
234
235 _service = service;
236
237 ReferenceRegistry.registerReference(MBMessageServiceUtil.class,
238 "_service");
239 MethodCache.remove(MBMessageService.class);
240 }
241
242 private static MBMessageService _service;
243 }