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