1
22
23 package com.liferay.portal.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.PhoneServiceUtil;
34
35
74 public class PhoneServiceHttp {
75 public static com.liferay.portal.model.Phone addPhone(
76 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
77 java.lang.String number, java.lang.String extension, int typeId,
78 boolean primary)
79 throws com.liferay.portal.PortalException,
80 com.liferay.portal.SystemException {
81 try {
82 Object paramObj0 = className;
83
84 if (className == null) {
85 paramObj0 = new NullWrapper("java.lang.String");
86 }
87
88 Object paramObj1 = new LongWrapper(classPK);
89
90 Object paramObj2 = number;
91
92 if (number == null) {
93 paramObj2 = new NullWrapper("java.lang.String");
94 }
95
96 Object paramObj3 = extension;
97
98 if (extension == null) {
99 paramObj3 = new NullWrapper("java.lang.String");
100 }
101
102 Object paramObj4 = new IntegerWrapper(typeId);
103
104 Object paramObj5 = new BooleanWrapper(primary);
105
106 MethodWrapper methodWrapper = new MethodWrapper(PhoneServiceUtil.class.getName(),
107 "addPhone",
108 new Object[] {
109 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
110 paramObj5
111 });
112
113 Object returnObj = null;
114
115 try {
116 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
117 }
118 catch (Exception e) {
119 if (e instanceof com.liferay.portal.PortalException) {
120 throw (com.liferay.portal.PortalException)e;
121 }
122
123 if (e instanceof com.liferay.portal.SystemException) {
124 throw (com.liferay.portal.SystemException)e;
125 }
126
127 throw new com.liferay.portal.SystemException(e);
128 }
129
130 return (com.liferay.portal.model.Phone)returnObj;
131 }
132 catch (com.liferay.portal.SystemException se) {
133 _log.error(se, se);
134
135 throw se;
136 }
137 }
138
139 public static void deletePhone(HttpPrincipal httpPrincipal, long phoneId)
140 throws com.liferay.portal.PortalException,
141 com.liferay.portal.SystemException {
142 try {
143 Object paramObj0 = new LongWrapper(phoneId);
144
145 MethodWrapper methodWrapper = new MethodWrapper(PhoneServiceUtil.class.getName(),
146 "deletePhone", new Object[] { paramObj0 });
147
148 try {
149 TunnelUtil.invoke(httpPrincipal, methodWrapper);
150 }
151 catch (Exception e) {
152 if (e instanceof com.liferay.portal.PortalException) {
153 throw (com.liferay.portal.PortalException)e;
154 }
155
156 if (e instanceof com.liferay.portal.SystemException) {
157 throw (com.liferay.portal.SystemException)e;
158 }
159
160 throw new com.liferay.portal.SystemException(e);
161 }
162 }
163 catch (com.liferay.portal.SystemException se) {
164 _log.error(se, se);
165
166 throw se;
167 }
168 }
169
170 public static com.liferay.portal.model.Phone getPhone(
171 HttpPrincipal httpPrincipal, long phoneId)
172 throws com.liferay.portal.PortalException,
173 com.liferay.portal.SystemException {
174 try {
175 Object paramObj0 = new LongWrapper(phoneId);
176
177 MethodWrapper methodWrapper = new MethodWrapper(PhoneServiceUtil.class.getName(),
178 "getPhone", new Object[] { paramObj0 });
179
180 Object returnObj = null;
181
182 try {
183 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
184 }
185 catch (Exception e) {
186 if (e instanceof com.liferay.portal.PortalException) {
187 throw (com.liferay.portal.PortalException)e;
188 }
189
190 if (e instanceof com.liferay.portal.SystemException) {
191 throw (com.liferay.portal.SystemException)e;
192 }
193
194 throw new com.liferay.portal.SystemException(e);
195 }
196
197 return (com.liferay.portal.model.Phone)returnObj;
198 }
199 catch (com.liferay.portal.SystemException se) {
200 _log.error(se, se);
201
202 throw se;
203 }
204 }
205
206 public static java.util.List<com.liferay.portal.model.Phone> getPhones(
207 HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
208 throws com.liferay.portal.PortalException,
209 com.liferay.portal.SystemException {
210 try {
211 Object paramObj0 = className;
212
213 if (className == null) {
214 paramObj0 = new NullWrapper("java.lang.String");
215 }
216
217 Object paramObj1 = new LongWrapper(classPK);
218
219 MethodWrapper methodWrapper = new MethodWrapper(PhoneServiceUtil.class.getName(),
220 "getPhones", new Object[] { paramObj0, paramObj1 });
221
222 Object returnObj = null;
223
224 try {
225 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
226 }
227 catch (Exception e) {
228 if (e instanceof com.liferay.portal.PortalException) {
229 throw (com.liferay.portal.PortalException)e;
230 }
231
232 if (e instanceof com.liferay.portal.SystemException) {
233 throw (com.liferay.portal.SystemException)e;
234 }
235
236 throw new com.liferay.portal.SystemException(e);
237 }
238
239 return (java.util.List<com.liferay.portal.model.Phone>)returnObj;
240 }
241 catch (com.liferay.portal.SystemException se) {
242 _log.error(se, se);
243
244 throw se;
245 }
246 }
247
248 public static com.liferay.portal.model.Phone updatePhone(
249 HttpPrincipal httpPrincipal, long phoneId, java.lang.String number,
250 java.lang.String extension, int typeId, boolean primary)
251 throws com.liferay.portal.PortalException,
252 com.liferay.portal.SystemException {
253 try {
254 Object paramObj0 = new LongWrapper(phoneId);
255
256 Object paramObj1 = number;
257
258 if (number == null) {
259 paramObj1 = new NullWrapper("java.lang.String");
260 }
261
262 Object paramObj2 = extension;
263
264 if (extension == null) {
265 paramObj2 = new NullWrapper("java.lang.String");
266 }
267
268 Object paramObj3 = new IntegerWrapper(typeId);
269
270 Object paramObj4 = new BooleanWrapper(primary);
271
272 MethodWrapper methodWrapper = new MethodWrapper(PhoneServiceUtil.class.getName(),
273 "updatePhone",
274 new Object[] {
275 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
276 });
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.portal.model.Phone)returnObj;
296 }
297 catch (com.liferay.portal.SystemException se) {
298 _log.error(se, se);
299
300 throw se;
301 }
302 }
303
304 private static Log _log = LogFactoryUtil.getLog(PhoneServiceHttp.class);
305 }