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