1
22
23 package com.liferay.portlet.announcements.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.IntegerWrapper;
29 import com.liferay.portal.kernel.util.LongWrapper;
30 import com.liferay.portal.kernel.util.MethodWrapper;
31 import com.liferay.portal.kernel.util.NullWrapper;
32 import com.liferay.portal.security.auth.HttpPrincipal;
33 import com.liferay.portal.service.http.TunnelUtil;
34
35 import com.liferay.portlet.announcements.service.AnnouncementsEntryServiceUtil;
36
37
76 public class AnnouncementsEntryServiceHttp {
77 public static com.liferay.portlet.announcements.model.AnnouncementsEntry addEntry(
78 HttpPrincipal httpPrincipal, long plid, long classNameId, long classPK,
79 java.lang.String title, java.lang.String content, java.lang.String url,
80 java.lang.String type, int displayDateMonth, int displayDateDay,
81 int displayDateYear, int displayDateHour, int displayDateMinute,
82 int expirationDateMonth, int expirationDateDay, int expirationDateYear,
83 int expirationDateHour, int expirationDateMinute, int priority,
84 boolean alert)
85 throws com.liferay.portal.PortalException,
86 com.liferay.portal.SystemException {
87 try {
88 Object paramObj0 = new LongWrapper(plid);
89
90 Object paramObj1 = new LongWrapper(classNameId);
91
92 Object paramObj2 = new LongWrapper(classPK);
93
94 Object paramObj3 = title;
95
96 if (title == null) {
97 paramObj3 = new NullWrapper("java.lang.String");
98 }
99
100 Object paramObj4 = content;
101
102 if (content == null) {
103 paramObj4 = new NullWrapper("java.lang.String");
104 }
105
106 Object paramObj5 = url;
107
108 if (url == null) {
109 paramObj5 = new NullWrapper("java.lang.String");
110 }
111
112 Object paramObj6 = type;
113
114 if (type == null) {
115 paramObj6 = new NullWrapper("java.lang.String");
116 }
117
118 Object paramObj7 = new IntegerWrapper(displayDateMonth);
119
120 Object paramObj8 = new IntegerWrapper(displayDateDay);
121
122 Object paramObj9 = new IntegerWrapper(displayDateYear);
123
124 Object paramObj10 = new IntegerWrapper(displayDateHour);
125
126 Object paramObj11 = new IntegerWrapper(displayDateMinute);
127
128 Object paramObj12 = new IntegerWrapper(expirationDateMonth);
129
130 Object paramObj13 = new IntegerWrapper(expirationDateDay);
131
132 Object paramObj14 = new IntegerWrapper(expirationDateYear);
133
134 Object paramObj15 = new IntegerWrapper(expirationDateHour);
135
136 Object paramObj16 = new IntegerWrapper(expirationDateMinute);
137
138 Object paramObj17 = new IntegerWrapper(priority);
139
140 Object paramObj18 = new BooleanWrapper(alert);
141
142 MethodWrapper methodWrapper = new MethodWrapper(AnnouncementsEntryServiceUtil.class.getName(),
143 "addEntry",
144 new Object[] {
145 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
146 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
147 paramObj10, paramObj11, paramObj12, paramObj13,
148 paramObj14, paramObj15, paramObj16, paramObj17,
149 paramObj18
150 });
151
152 Object returnObj = null;
153
154 try {
155 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
156 }
157 catch (Exception e) {
158 if (e instanceof com.liferay.portal.PortalException) {
159 throw (com.liferay.portal.PortalException)e;
160 }
161
162 if (e instanceof com.liferay.portal.SystemException) {
163 throw (com.liferay.portal.SystemException)e;
164 }
165
166 throw new com.liferay.portal.SystemException(e);
167 }
168
169 return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
170 }
171 catch (com.liferay.portal.SystemException se) {
172 _log.error(se, se);
173
174 throw se;
175 }
176 }
177
178 public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
179 throws com.liferay.portal.PortalException,
180 com.liferay.portal.SystemException {
181 try {
182 Object paramObj0 = new LongWrapper(entryId);
183
184 MethodWrapper methodWrapper = new MethodWrapper(AnnouncementsEntryServiceUtil.class.getName(),
185 "deleteEntry", new Object[] { paramObj0 });
186
187 try {
188 TunnelUtil.invoke(httpPrincipal, methodWrapper);
189 }
190 catch (Exception e) {
191 if (e instanceof com.liferay.portal.PortalException) {
192 throw (com.liferay.portal.PortalException)e;
193 }
194
195 if (e instanceof com.liferay.portal.SystemException) {
196 throw (com.liferay.portal.SystemException)e;
197 }
198
199 throw new com.liferay.portal.SystemException(e);
200 }
201 }
202 catch (com.liferay.portal.SystemException se) {
203 _log.error(se, se);
204
205 throw se;
206 }
207 }
208
209 public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateEntry(
210 HttpPrincipal httpPrincipal, long entryId, java.lang.String title,
211 java.lang.String content, java.lang.String url, java.lang.String type,
212 int displayDateMonth, int displayDateDay, int displayDateYear,
213 int displayDateHour, int displayDateMinute, int expirationDateMonth,
214 int expirationDateDay, int expirationDateYear, int expirationDateHour,
215 int expirationDateMinute, int priority)
216 throws com.liferay.portal.PortalException,
217 com.liferay.portal.SystemException {
218 try {
219 Object paramObj0 = new LongWrapper(entryId);
220
221 Object paramObj1 = title;
222
223 if (title == null) {
224 paramObj1 = new NullWrapper("java.lang.String");
225 }
226
227 Object paramObj2 = content;
228
229 if (content == null) {
230 paramObj2 = new NullWrapper("java.lang.String");
231 }
232
233 Object paramObj3 = url;
234
235 if (url == null) {
236 paramObj3 = new NullWrapper("java.lang.String");
237 }
238
239 Object paramObj4 = type;
240
241 if (type == null) {
242 paramObj4 = new NullWrapper("java.lang.String");
243 }
244
245 Object paramObj5 = new IntegerWrapper(displayDateMonth);
246
247 Object paramObj6 = new IntegerWrapper(displayDateDay);
248
249 Object paramObj7 = new IntegerWrapper(displayDateYear);
250
251 Object paramObj8 = new IntegerWrapper(displayDateHour);
252
253 Object paramObj9 = new IntegerWrapper(displayDateMinute);
254
255 Object paramObj10 = new IntegerWrapper(expirationDateMonth);
256
257 Object paramObj11 = new IntegerWrapper(expirationDateDay);
258
259 Object paramObj12 = new IntegerWrapper(expirationDateYear);
260
261 Object paramObj13 = new IntegerWrapper(expirationDateHour);
262
263 Object paramObj14 = new IntegerWrapper(expirationDateMinute);
264
265 Object paramObj15 = new IntegerWrapper(priority);
266
267 MethodWrapper methodWrapper = new MethodWrapper(AnnouncementsEntryServiceUtil.class.getName(),
268 "updateEntry",
269 new Object[] {
270 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
271 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
272 paramObj10, paramObj11, paramObj12, paramObj13,
273 paramObj14, paramObj15
274 });
275
276 Object returnObj = null;
277
278 try {
279 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
280 }
281 catch (Exception e) {
282 if (e instanceof com.liferay.portal.PortalException) {
283 throw (com.liferay.portal.PortalException)e;
284 }
285
286 if (e instanceof com.liferay.portal.SystemException) {
287 throw (com.liferay.portal.SystemException)e;
288 }
289
290 throw new com.liferay.portal.SystemException(e);
291 }
292
293 return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
294 }
295 catch (com.liferay.portal.SystemException se) {
296 _log.error(se, se);
297
298 throw se;
299 }
300 }
301
302 private static Log _log = LogFactoryUtil.getLog(AnnouncementsEntryServiceHttp.class);
303 }