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.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.http.TunnelUtil;
23
24 import com.liferay.portlet.polls.service.PollsQuestionServiceUtil;
25
26
63 public class PollsQuestionServiceHttp {
64 public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
65 HttpPrincipal httpPrincipal, java.lang.String title,
66 java.lang.String description, int expirationDateMonth,
67 int expirationDateDay, int expirationDateYear, int expirationDateHour,
68 int expirationDateMinute, boolean neverExpire,
69 java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
70 com.liferay.portal.service.ServiceContext serviceContext)
71 throws com.liferay.portal.PortalException,
72 com.liferay.portal.SystemException {
73 try {
74 MethodKey methodKey = new MethodKey(PollsQuestionServiceUtil.class.getName(),
75 "addQuestion", _addQuestionParameterTypes0);
76
77 MethodHandler methodHandler = new MethodHandler(methodKey, title,
78 description, expirationDateMonth, expirationDateDay,
79 expirationDateYear, expirationDateHour,
80 expirationDateMinute, neverExpire, choices, serviceContext);
81
82 Object returnObj = null;
83
84 try {
85 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
86 }
87 catch (Exception e) {
88 if (e instanceof com.liferay.portal.PortalException) {
89 throw (com.liferay.portal.PortalException)e;
90 }
91
92 if (e instanceof com.liferay.portal.SystemException) {
93 throw (com.liferay.portal.SystemException)e;
94 }
95
96 throw new com.liferay.portal.SystemException(e);
97 }
98
99 return (com.liferay.portlet.polls.model.PollsQuestion)returnObj;
100 }
101 catch (com.liferay.portal.SystemException se) {
102 _log.error(se, se);
103
104 throw se;
105 }
106 }
107
108 public static void deleteQuestion(HttpPrincipal httpPrincipal,
109 long questionId)
110 throws com.liferay.portal.PortalException,
111 com.liferay.portal.SystemException {
112 try {
113 MethodKey methodKey = new MethodKey(PollsQuestionServiceUtil.class.getName(),
114 "deleteQuestion", _deleteQuestionParameterTypes1);
115
116 MethodHandler methodHandler = new MethodHandler(methodKey,
117 questionId);
118
119 try {
120 TunnelUtil.invoke(httpPrincipal, methodHandler);
121 }
122 catch (Exception e) {
123 if (e instanceof com.liferay.portal.PortalException) {
124 throw (com.liferay.portal.PortalException)e;
125 }
126
127 if (e instanceof com.liferay.portal.SystemException) {
128 throw (com.liferay.portal.SystemException)e;
129 }
130
131 throw new com.liferay.portal.SystemException(e);
132 }
133 }
134 catch (com.liferay.portal.SystemException se) {
135 _log.error(se, se);
136
137 throw se;
138 }
139 }
140
141 public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
142 HttpPrincipal httpPrincipal, long questionId)
143 throws com.liferay.portal.PortalException,
144 com.liferay.portal.SystemException {
145 try {
146 MethodKey methodKey = new MethodKey(PollsQuestionServiceUtil.class.getName(),
147 "getQuestion", _getQuestionParameterTypes2);
148
149 MethodHandler methodHandler = new MethodHandler(methodKey,
150 questionId);
151
152 Object returnObj = null;
153
154 try {
155 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
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.polls.model.PollsQuestion)returnObj;
170 }
171 catch (com.liferay.portal.SystemException se) {
172 _log.error(se, se);
173
174 throw se;
175 }
176 }
177
178 public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
179 HttpPrincipal httpPrincipal, long questionId, java.lang.String title,
180 java.lang.String description, int expirationDateMonth,
181 int expirationDateDay, int expirationDateYear, int expirationDateHour,
182 int expirationDateMinute, boolean neverExpire,
183 java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
184 com.liferay.portal.service.ServiceContext serviceContext)
185 throws com.liferay.portal.PortalException,
186 com.liferay.portal.SystemException {
187 try {
188 MethodKey methodKey = new MethodKey(PollsQuestionServiceUtil.class.getName(),
189 "updateQuestion", _updateQuestionParameterTypes3);
190
191 MethodHandler methodHandler = new MethodHandler(methodKey,
192 questionId, title, description, expirationDateMonth,
193 expirationDateDay, expirationDateYear, expirationDateHour,
194 expirationDateMinute, neverExpire, choices, serviceContext);
195
196 Object returnObj = null;
197
198 try {
199 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
200 }
201 catch (Exception e) {
202 if (e instanceof com.liferay.portal.PortalException) {
203 throw (com.liferay.portal.PortalException)e;
204 }
205
206 if (e instanceof com.liferay.portal.SystemException) {
207 throw (com.liferay.portal.SystemException)e;
208 }
209
210 throw new com.liferay.portal.SystemException(e);
211 }
212
213 return (com.liferay.portlet.polls.model.PollsQuestion)returnObj;
214 }
215 catch (com.liferay.portal.SystemException se) {
216 _log.error(se, se);
217
218 throw se;
219 }
220 }
221
222 private static Log _log = LogFactoryUtil.getLog(PollsQuestionServiceHttp.class);
223 private static final Class<?>[] _addQuestionParameterTypes0 = new Class[] {
224 java.lang.String.class, java.lang.String.class, int.class, int.class,
225 int.class, int.class, int.class, boolean.class, java.util.List.class,
226 com.liferay.portal.service.ServiceContext.class
227 };
228 private static final Class<?>[] _deleteQuestionParameterTypes1 = new Class[] {
229 long.class
230 };
231 private static final Class<?>[] _getQuestionParameterTypes2 = new Class[] {
232 long.class
233 };
234 private static final Class<?>[] _updateQuestionParameterTypes3 = new Class[] {
235 long.class, java.lang.String.class, java.lang.String.class,
236 int.class, int.class, int.class, int.class, int.class, boolean.class,
237 java.util.List.class,
238 com.liferay.portal.service.ServiceContext.class
239 };
240 }