1
22
23 package com.liferay.portlet.polls.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.polls.service.PollsQuestionServiceUtil;
36
37
76 public class PollsQuestionServiceHttp {
77 public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
78 HttpPrincipal httpPrincipal, long plid, java.lang.String title,
79 java.lang.String description, int expirationDateMonth,
80 int expirationDateDay, int expirationDateYear, int expirationDateHour,
81 int expirationDateMinute, boolean neverExpire,
82 java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
83 boolean addCommunityPermissions, boolean addGuestPermissions)
84 throws com.liferay.portal.PortalException,
85 com.liferay.portal.SystemException {
86 try {
87 Object paramObj0 = new LongWrapper(plid);
88
89 Object paramObj1 = title;
90
91 if (title == null) {
92 paramObj1 = new NullWrapper("java.lang.String");
93 }
94
95 Object paramObj2 = description;
96
97 if (description == null) {
98 paramObj2 = new NullWrapper("java.lang.String");
99 }
100
101 Object paramObj3 = new IntegerWrapper(expirationDateMonth);
102
103 Object paramObj4 = new IntegerWrapper(expirationDateDay);
104
105 Object paramObj5 = new IntegerWrapper(expirationDateYear);
106
107 Object paramObj6 = new IntegerWrapper(expirationDateHour);
108
109 Object paramObj7 = new IntegerWrapper(expirationDateMinute);
110
111 Object paramObj8 = new BooleanWrapper(neverExpire);
112
113 Object paramObj9 = choices;
114
115 if (choices == null) {
116 paramObj9 = new NullWrapper("java.util.List");
117 }
118
119 Object paramObj10 = new BooleanWrapper(addCommunityPermissions);
120
121 Object paramObj11 = new BooleanWrapper(addGuestPermissions);
122
123 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
124 "addQuestion",
125 new Object[] {
126 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
127 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
128 paramObj10, paramObj11
129 });
130
131 Object returnObj = null;
132
133 try {
134 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
135 }
136 catch (Exception e) {
137 if (e instanceof com.liferay.portal.PortalException) {
138 throw (com.liferay.portal.PortalException)e;
139 }
140
141 if (e instanceof com.liferay.portal.SystemException) {
142 throw (com.liferay.portal.SystemException)e;
143 }
144
145 throw new com.liferay.portal.SystemException(e);
146 }
147
148 return (com.liferay.portlet.polls.model.PollsQuestion)returnObj;
149 }
150 catch (com.liferay.portal.SystemException se) {
151 _log.error(se, se);
152
153 throw se;
154 }
155 }
156
157 public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
158 HttpPrincipal httpPrincipal, long plid, java.lang.String title,
159 java.lang.String description, int expirationDateMonth,
160 int expirationDateDay, int expirationDateYear, int expirationDateHour,
161 int expirationDateMinute, boolean neverExpire,
162 java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
163 java.lang.String[] communityPermissions,
164 java.lang.String[] guestPermissions)
165 throws com.liferay.portal.PortalException,
166 com.liferay.portal.SystemException {
167 try {
168 Object paramObj0 = new LongWrapper(plid);
169
170 Object paramObj1 = title;
171
172 if (title == null) {
173 paramObj1 = new NullWrapper("java.lang.String");
174 }
175
176 Object paramObj2 = description;
177
178 if (description == null) {
179 paramObj2 = new NullWrapper("java.lang.String");
180 }
181
182 Object paramObj3 = new IntegerWrapper(expirationDateMonth);
183
184 Object paramObj4 = new IntegerWrapper(expirationDateDay);
185
186 Object paramObj5 = new IntegerWrapper(expirationDateYear);
187
188 Object paramObj6 = new IntegerWrapper(expirationDateHour);
189
190 Object paramObj7 = new IntegerWrapper(expirationDateMinute);
191
192 Object paramObj8 = new BooleanWrapper(neverExpire);
193
194 Object paramObj9 = choices;
195
196 if (choices == null) {
197 paramObj9 = new NullWrapper("java.util.List");
198 }
199
200 Object paramObj10 = communityPermissions;
201
202 if (communityPermissions == null) {
203 paramObj10 = new NullWrapper("[Ljava.lang.String;");
204 }
205
206 Object paramObj11 = guestPermissions;
207
208 if (guestPermissions == null) {
209 paramObj11 = new NullWrapper("[Ljava.lang.String;");
210 }
211
212 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
213 "addQuestion",
214 new Object[] {
215 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
216 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
217 paramObj10, paramObj11
218 });
219
220 Object returnObj = null;
221
222 try {
223 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
224 }
225 catch (Exception e) {
226 if (e instanceof com.liferay.portal.PortalException) {
227 throw (com.liferay.portal.PortalException)e;
228 }
229
230 if (e instanceof com.liferay.portal.SystemException) {
231 throw (com.liferay.portal.SystemException)e;
232 }
233
234 throw new com.liferay.portal.SystemException(e);
235 }
236
237 return (com.liferay.portlet.polls.model.PollsQuestion)returnObj;
238 }
239 catch (com.liferay.portal.SystemException se) {
240 _log.error(se, se);
241
242 throw se;
243 }
244 }
245
246 public static void deleteQuestion(HttpPrincipal httpPrincipal,
247 long questionId)
248 throws com.liferay.portal.PortalException,
249 com.liferay.portal.SystemException {
250 try {
251 Object paramObj0 = new LongWrapper(questionId);
252
253 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
254 "deleteQuestion", new Object[] { paramObj0 });
255
256 try {
257 TunnelUtil.invoke(httpPrincipal, methodWrapper);
258 }
259 catch (Exception e) {
260 if (e instanceof com.liferay.portal.PortalException) {
261 throw (com.liferay.portal.PortalException)e;
262 }
263
264 if (e instanceof com.liferay.portal.SystemException) {
265 throw (com.liferay.portal.SystemException)e;
266 }
267
268 throw new com.liferay.portal.SystemException(e);
269 }
270 }
271 catch (com.liferay.portal.SystemException se) {
272 _log.error(se, se);
273
274 throw se;
275 }
276 }
277
278 public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
279 HttpPrincipal httpPrincipal, long questionId)
280 throws com.liferay.portal.PortalException,
281 com.liferay.portal.SystemException {
282 try {
283 Object paramObj0 = new LongWrapper(questionId);
284
285 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
286 "getQuestion", new Object[] { paramObj0 });
287
288 Object returnObj = null;
289
290 try {
291 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
292 }
293 catch (Exception e) {
294 if (e instanceof com.liferay.portal.PortalException) {
295 throw (com.liferay.portal.PortalException)e;
296 }
297
298 if (e instanceof com.liferay.portal.SystemException) {
299 throw (com.liferay.portal.SystemException)e;
300 }
301
302 throw new com.liferay.portal.SystemException(e);
303 }
304
305 return (com.liferay.portlet.polls.model.PollsQuestion)returnObj;
306 }
307 catch (com.liferay.portal.SystemException se) {
308 _log.error(se, se);
309
310 throw se;
311 }
312 }
313
314 public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
315 HttpPrincipal httpPrincipal, long questionId, java.lang.String title,
316 java.lang.String description, int expirationDateMonth,
317 int expirationDateDay, int expirationDateYear, int expirationDateHour,
318 int expirationDateMinute, boolean neverExpire,
319 java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices)
320 throws com.liferay.portal.PortalException,
321 com.liferay.portal.SystemException {
322 try {
323 Object paramObj0 = new LongWrapper(questionId);
324
325 Object paramObj1 = title;
326
327 if (title == null) {
328 paramObj1 = new NullWrapper("java.lang.String");
329 }
330
331 Object paramObj2 = description;
332
333 if (description == null) {
334 paramObj2 = new NullWrapper("java.lang.String");
335 }
336
337 Object paramObj3 = new IntegerWrapper(expirationDateMonth);
338
339 Object paramObj4 = new IntegerWrapper(expirationDateDay);
340
341 Object paramObj5 = new IntegerWrapper(expirationDateYear);
342
343 Object paramObj6 = new IntegerWrapper(expirationDateHour);
344
345 Object paramObj7 = new IntegerWrapper(expirationDateMinute);
346
347 Object paramObj8 = new BooleanWrapper(neverExpire);
348
349 Object paramObj9 = choices;
350
351 if (choices == null) {
352 paramObj9 = new NullWrapper("java.util.List");
353 }
354
355 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
356 "updateQuestion",
357 new Object[] {
358 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
359 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9
360 });
361
362 Object returnObj = null;
363
364 try {
365 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
366 }
367 catch (Exception e) {
368 if (e instanceof com.liferay.portal.PortalException) {
369 throw (com.liferay.portal.PortalException)e;
370 }
371
372 if (e instanceof com.liferay.portal.SystemException) {
373 throw (com.liferay.portal.SystemException)e;
374 }
375
376 throw new com.liferay.portal.SystemException(e);
377 }
378
379 return (com.liferay.portlet.polls.model.PollsQuestion)returnObj;
380 }
381 catch (com.liferay.portal.SystemException se) {
382 _log.error(se, se);
383
384 throw se;
385 }
386 }
387
388 private static Log _log = LogFactoryUtil.getLog(PollsQuestionServiceHttp.class);
389 }