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