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