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, 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 com.liferay.portal.service.ServiceContext serviceContext)
84 throws com.liferay.portal.PortalException,
85 com.liferay.portal.SystemException {
86 try {
87 Object paramObj0 = title;
88
89 if (title == null) {
90 paramObj0 = new NullWrapper("java.lang.String");
91 }
92
93 Object paramObj1 = description;
94
95 if (description == null) {
96 paramObj1 = new NullWrapper("java.lang.String");
97 }
98
99 Object paramObj2 = new IntegerWrapper(expirationDateMonth);
100
101 Object paramObj3 = new IntegerWrapper(expirationDateDay);
102
103 Object paramObj4 = new IntegerWrapper(expirationDateYear);
104
105 Object paramObj5 = new IntegerWrapper(expirationDateHour);
106
107 Object paramObj6 = new IntegerWrapper(expirationDateMinute);
108
109 Object paramObj7 = new BooleanWrapper(neverExpire);
110
111 Object paramObj8 = choices;
112
113 if (choices == null) {
114 paramObj8 = new NullWrapper("java.util.List");
115 }
116
117 Object paramObj9 = serviceContext;
118
119 if (serviceContext == null) {
120 paramObj9 = new NullWrapper(
121 "com.liferay.portal.service.ServiceContext");
122 }
123
124 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
125 "addQuestion",
126 new Object[] {
127 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
128 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9
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 void deleteQuestion(HttpPrincipal httpPrincipal,
158 long questionId)
159 throws com.liferay.portal.PortalException,
160 com.liferay.portal.SystemException {
161 try {
162 Object paramObj0 = new LongWrapper(questionId);
163
164 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
165 "deleteQuestion", new Object[] { paramObj0 });
166
167 try {
168 TunnelUtil.invoke(httpPrincipal, methodWrapper);
169 }
170 catch (Exception e) {
171 if (e instanceof com.liferay.portal.PortalException) {
172 throw (com.liferay.portal.PortalException)e;
173 }
174
175 if (e instanceof com.liferay.portal.SystemException) {
176 throw (com.liferay.portal.SystemException)e;
177 }
178
179 throw new com.liferay.portal.SystemException(e);
180 }
181 }
182 catch (com.liferay.portal.SystemException se) {
183 _log.error(se, se);
184
185 throw se;
186 }
187 }
188
189 public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
190 HttpPrincipal httpPrincipal, long questionId)
191 throws com.liferay.portal.PortalException,
192 com.liferay.portal.SystemException {
193 try {
194 Object paramObj0 = new LongWrapper(questionId);
195
196 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
197 "getQuestion", new Object[] { paramObj0 });
198
199 Object returnObj = null;
200
201 try {
202 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
203 }
204 catch (Exception e) {
205 if (e instanceof com.liferay.portal.PortalException) {
206 throw (com.liferay.portal.PortalException)e;
207 }
208
209 if (e instanceof com.liferay.portal.SystemException) {
210 throw (com.liferay.portal.SystemException)e;
211 }
212
213 throw new com.liferay.portal.SystemException(e);
214 }
215
216 return (com.liferay.portlet.polls.model.PollsQuestion)returnObj;
217 }
218 catch (com.liferay.portal.SystemException se) {
219 _log.error(se, se);
220
221 throw se;
222 }
223 }
224
225 public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
226 HttpPrincipal httpPrincipal, long questionId, java.lang.String title,
227 java.lang.String description, int expirationDateMonth,
228 int expirationDateDay, int expirationDateYear, int expirationDateHour,
229 int expirationDateMinute, boolean neverExpire,
230 java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
231 com.liferay.portal.service.ServiceContext serviceContext)
232 throws com.liferay.portal.PortalException,
233 com.liferay.portal.SystemException {
234 try {
235 Object paramObj0 = new LongWrapper(questionId);
236
237 Object paramObj1 = title;
238
239 if (title == null) {
240 paramObj1 = new NullWrapper("java.lang.String");
241 }
242
243 Object paramObj2 = description;
244
245 if (description == null) {
246 paramObj2 = new NullWrapper("java.lang.String");
247 }
248
249 Object paramObj3 = new IntegerWrapper(expirationDateMonth);
250
251 Object paramObj4 = new IntegerWrapper(expirationDateDay);
252
253 Object paramObj5 = new IntegerWrapper(expirationDateYear);
254
255 Object paramObj6 = new IntegerWrapper(expirationDateHour);
256
257 Object paramObj7 = new IntegerWrapper(expirationDateMinute);
258
259 Object paramObj8 = new BooleanWrapper(neverExpire);
260
261 Object paramObj9 = choices;
262
263 if (choices == null) {
264 paramObj9 = new NullWrapper("java.util.List");
265 }
266
267 Object paramObj10 = serviceContext;
268
269 if (serviceContext == null) {
270 paramObj10 = new NullWrapper(
271 "com.liferay.portal.service.ServiceContext");
272 }
273
274 MethodWrapper methodWrapper = new MethodWrapper(PollsQuestionServiceUtil.class.getName(),
275 "updateQuestion",
276 new Object[] {
277 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
278 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
279 paramObj10
280 });
281
282 Object returnObj = null;
283
284 try {
285 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
286 }
287 catch (Exception e) {
288 if (e instanceof com.liferay.portal.PortalException) {
289 throw (com.liferay.portal.PortalException)e;
290 }
291
292 if (e instanceof com.liferay.portal.SystemException) {
293 throw (com.liferay.portal.SystemException)e;
294 }
295
296 throw new com.liferay.portal.SystemException(e);
297 }
298
299 return (com.liferay.portlet.polls.model.PollsQuestion)returnObj;
300 }
301 catch (com.liferay.portal.SystemException se) {
302 _log.error(se, se);
303
304 throw se;
305 }
306 }
307
308 private static Log _log = LogFactoryUtil.getLog(PollsQuestionServiceHttp.class);
309 }