1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
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.OrganizationServiceUtil;
34  
35  /**
36   * <a href="OrganizationServiceHttp.java.html"><b><i>View Source</i></b></a>
37   *
38   * <p>
39   * ServiceBuilder generated this class. Modifications in this class will be
40   * overwritten the next time is generated.
41   * </p>
42   *
43   * <p>
44   * This class provides a HTTP utility for the
45   * <code>com.liferay.portal.service.OrganizationServiceUtil</code> service
46   * utility. The static methods of this class calls the same methods of the
47   * service utility. However, the signatures are different because it requires an
48   * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
49   * parameter.
50   * </p>
51   *
52   * <p>
53   * The benefits of using the HTTP utility is that it is fast and allows for
54   * tunneling without the cost of serializing to text. The drawback is that it
55   * only works with Java.
56   * </p>
57   *
58   * <p>
59   * Set the property <code>tunnel.servlet.hosts.allowed</code> in
60   * portal.properties to configure security.
61   * </p>
62   *
63   * <p>
64   * The HTTP utility is only generated for remote services.
65   * </p>
66   *
67   * @author Brian Wing Shun Chan
68   *
69   * @see com.liferay.portal.security.auth.HttpPrincipal
70   * @see com.liferay.portal.service.OrganizationServiceUtil
71   * @see com.liferay.portal.service.http.OrganizationServiceSoap
72   *
73   */
74  public class OrganizationServiceHttp {
75      public static void addGroupOrganizations(HttpPrincipal httpPrincipal,
76          long groupId, long[] organizationIds)
77          throws com.liferay.portal.PortalException,
78              com.liferay.portal.SystemException {
79          try {
80              Object paramObj0 = new LongWrapper(groupId);
81  
82              Object paramObj1 = organizationIds;
83  
84              if (organizationIds == null) {
85                  paramObj1 = new NullWrapper("[J");
86              }
87  
88              MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
89                      "addGroupOrganizations",
90                      new Object[] { paramObj0, paramObj1 });
91  
92              try {
93                  TunnelUtil.invoke(httpPrincipal, methodWrapper);
94              }
95              catch (Exception e) {
96                  if (e instanceof com.liferay.portal.PortalException) {
97                      throw (com.liferay.portal.PortalException)e;
98                  }
99  
100                 if (e instanceof com.liferay.portal.SystemException) {
101                     throw (com.liferay.portal.SystemException)e;
102                 }
103 
104                 throw new com.liferay.portal.SystemException(e);
105             }
106         }
107         catch (com.liferay.portal.SystemException se) {
108             _log.error(se, se);
109 
110             throw se;
111         }
112     }
113 
114     public static void addPasswordPolicyOrganizations(
115         HttpPrincipal httpPrincipal, long passwordPolicyId,
116         long[] organizationIds)
117         throws com.liferay.portal.PortalException,
118             com.liferay.portal.SystemException {
119         try {
120             Object paramObj0 = new LongWrapper(passwordPolicyId);
121 
122             Object paramObj1 = organizationIds;
123 
124             if (organizationIds == null) {
125                 paramObj1 = new NullWrapper("[J");
126             }
127 
128             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
129                     "addPasswordPolicyOrganizations",
130                     new Object[] { paramObj0, paramObj1 });
131 
132             try {
133                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
134             }
135             catch (Exception e) {
136                 if (e instanceof com.liferay.portal.PortalException) {
137                     throw (com.liferay.portal.PortalException)e;
138                 }
139 
140                 if (e instanceof com.liferay.portal.SystemException) {
141                     throw (com.liferay.portal.SystemException)e;
142                 }
143 
144                 throw new com.liferay.portal.SystemException(e);
145             }
146         }
147         catch (com.liferay.portal.SystemException se) {
148             _log.error(se, se);
149 
150             throw se;
151         }
152     }
153 
154     public static com.liferay.portal.model.Organization addOrganization(
155         HttpPrincipal httpPrincipal, long parentOrganizationId,
156         java.lang.String name, java.lang.String type, boolean recursable,
157         long regionId, long countryId, int statusId, java.lang.String comments,
158         com.liferay.portal.service.ServiceContext serviceContext)
159         throws com.liferay.portal.PortalException,
160             com.liferay.portal.SystemException {
161         try {
162             Object paramObj0 = new LongWrapper(parentOrganizationId);
163 
164             Object paramObj1 = name;
165 
166             if (name == null) {
167                 paramObj1 = new NullWrapper("java.lang.String");
168             }
169 
170             Object paramObj2 = type;
171 
172             if (type == null) {
173                 paramObj2 = new NullWrapper("java.lang.String");
174             }
175 
176             Object paramObj3 = new BooleanWrapper(recursable);
177 
178             Object paramObj4 = new LongWrapper(regionId);
179 
180             Object paramObj5 = new LongWrapper(countryId);
181 
182             Object paramObj6 = new IntegerWrapper(statusId);
183 
184             Object paramObj7 = comments;
185 
186             if (comments == null) {
187                 paramObj7 = new NullWrapper("java.lang.String");
188             }
189 
190             Object paramObj8 = serviceContext;
191 
192             if (serviceContext == null) {
193                 paramObj8 = new NullWrapper(
194                         "com.liferay.portal.service.ServiceContext");
195             }
196 
197             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
198                     "addOrganization",
199                     new Object[] {
200                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
201                         paramObj5, paramObj6, paramObj7, paramObj8
202                     });
203 
204             Object returnObj = null;
205 
206             try {
207                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
208             }
209             catch (Exception e) {
210                 if (e instanceof com.liferay.portal.PortalException) {
211                     throw (com.liferay.portal.PortalException)e;
212                 }
213 
214                 if (e instanceof com.liferay.portal.SystemException) {
215                     throw (com.liferay.portal.SystemException)e;
216                 }
217 
218                 throw new com.liferay.portal.SystemException(e);
219             }
220 
221             return (com.liferay.portal.model.Organization)returnObj;
222         }
223         catch (com.liferay.portal.SystemException se) {
224             _log.error(se, se);
225 
226             throw se;
227         }
228     }
229 
230     public static com.liferay.portal.model.Organization addOrganization(
231         HttpPrincipal httpPrincipal, long parentOrganizationId,
232         java.lang.String name, java.lang.String type, boolean recursable,
233         long regionId, long countryId, int statusId, java.lang.String comments,
234         java.util.List<com.liferay.portal.model.Address> addresses,
235         java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
236         java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
237         java.util.List<com.liferay.portal.model.Phone> phones,
238         java.util.List<com.liferay.portal.model.Website> websites,
239         com.liferay.portal.service.ServiceContext serviceContext)
240         throws com.liferay.portal.PortalException,
241             com.liferay.portal.SystemException {
242         try {
243             Object paramObj0 = new LongWrapper(parentOrganizationId);
244 
245             Object paramObj1 = name;
246 
247             if (name == null) {
248                 paramObj1 = new NullWrapper("java.lang.String");
249             }
250 
251             Object paramObj2 = type;
252 
253             if (type == null) {
254                 paramObj2 = new NullWrapper("java.lang.String");
255             }
256 
257             Object paramObj3 = new BooleanWrapper(recursable);
258 
259             Object paramObj4 = new LongWrapper(regionId);
260 
261             Object paramObj5 = new LongWrapper(countryId);
262 
263             Object paramObj6 = new IntegerWrapper(statusId);
264 
265             Object paramObj7 = comments;
266 
267             if (comments == null) {
268                 paramObj7 = new NullWrapper("java.lang.String");
269             }
270 
271             Object paramObj8 = addresses;
272 
273             if (addresses == null) {
274                 paramObj8 = new NullWrapper("java.util.List");
275             }
276 
277             Object paramObj9 = emailAddresses;
278 
279             if (emailAddresses == null) {
280                 paramObj9 = new NullWrapper("java.util.List");
281             }
282 
283             Object paramObj10 = orgLabors;
284 
285             if (orgLabors == null) {
286                 paramObj10 = new NullWrapper("java.util.List");
287             }
288 
289             Object paramObj11 = phones;
290 
291             if (phones == null) {
292                 paramObj11 = new NullWrapper("java.util.List");
293             }
294 
295             Object paramObj12 = websites;
296 
297             if (websites == null) {
298                 paramObj12 = new NullWrapper("java.util.List");
299             }
300 
301             Object paramObj13 = serviceContext;
302 
303             if (serviceContext == null) {
304                 paramObj13 = new NullWrapper(
305                         "com.liferay.portal.service.ServiceContext");
306             }
307 
308             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
309                     "addOrganization",
310                     new Object[] {
311                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
312                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
313                         paramObj10, paramObj11, paramObj12, paramObj13
314                     });
315 
316             Object returnObj = null;
317 
318             try {
319                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
320             }
321             catch (Exception e) {
322                 if (e instanceof com.liferay.portal.PortalException) {
323                     throw (com.liferay.portal.PortalException)e;
324                 }
325 
326                 if (e instanceof com.liferay.portal.SystemException) {
327                     throw (com.liferay.portal.SystemException)e;
328                 }
329 
330                 throw new com.liferay.portal.SystemException(e);
331             }
332 
333             return (com.liferay.portal.model.Organization)returnObj;
334         }
335         catch (com.liferay.portal.SystemException se) {
336             _log.error(se, se);
337 
338             throw se;
339         }
340     }
341 
342     public static void deleteLogo(HttpPrincipal httpPrincipal,
343         long organizationId)
344         throws com.liferay.portal.PortalException,
345             com.liferay.portal.SystemException {
346         try {
347             Object paramObj0 = new LongWrapper(organizationId);
348 
349             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
350                     "deleteLogo", new Object[] { paramObj0 });
351 
352             try {
353                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
354             }
355             catch (Exception e) {
356                 if (e instanceof com.liferay.portal.PortalException) {
357                     throw (com.liferay.portal.PortalException)e;
358                 }
359 
360                 if (e instanceof com.liferay.portal.SystemException) {
361                     throw (com.liferay.portal.SystemException)e;
362                 }
363 
364                 throw new com.liferay.portal.SystemException(e);
365             }
366         }
367         catch (com.liferay.portal.SystemException se) {
368             _log.error(se, se);
369 
370             throw se;
371         }
372     }
373 
374     public static void deleteOrganization(HttpPrincipal httpPrincipal,
375         long organizationId)
376         throws com.liferay.portal.PortalException,
377             com.liferay.portal.SystemException {
378         try {
379             Object paramObj0 = new LongWrapper(organizationId);
380 
381             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
382                     "deleteOrganization", new Object[] { paramObj0 });
383 
384             try {
385                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
386             }
387             catch (Exception e) {
388                 if (e instanceof com.liferay.portal.PortalException) {
389                     throw (com.liferay.portal.PortalException)e;
390                 }
391 
392                 if (e instanceof com.liferay.portal.SystemException) {
393                     throw (com.liferay.portal.SystemException)e;
394                 }
395 
396                 throw new com.liferay.portal.SystemException(e);
397             }
398         }
399         catch (com.liferay.portal.SystemException se) {
400             _log.error(se, se);
401 
402             throw se;
403         }
404     }
405 
406     public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
407         HttpPrincipal httpPrincipal, java.lang.String actionId, int max)
408         throws com.liferay.portal.PortalException,
409             com.liferay.portal.SystemException {
410         try {
411             Object paramObj0 = actionId;
412 
413             if (actionId == null) {
414                 paramObj0 = new NullWrapper("java.lang.String");
415             }
416 
417             Object paramObj1 = new IntegerWrapper(max);
418 
419             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
420                     "getManageableOrganizations",
421                     new Object[] { paramObj0, paramObj1 });
422 
423             Object returnObj = null;
424 
425             try {
426                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
427             }
428             catch (Exception e) {
429                 if (e instanceof com.liferay.portal.PortalException) {
430                     throw (com.liferay.portal.PortalException)e;
431                 }
432 
433                 if (e instanceof com.liferay.portal.SystemException) {
434                     throw (com.liferay.portal.SystemException)e;
435                 }
436 
437                 throw new com.liferay.portal.SystemException(e);
438             }
439 
440             return (java.util.List<com.liferay.portal.model.Organization>)returnObj;
441         }
442         catch (com.liferay.portal.SystemException se) {
443             _log.error(se, se);
444 
445             throw se;
446         }
447     }
448 
449     public static com.liferay.portal.model.Organization getOrganization(
450         HttpPrincipal httpPrincipal, long organizationId)
451         throws com.liferay.portal.PortalException,
452             com.liferay.portal.SystemException {
453         try {
454             Object paramObj0 = new LongWrapper(organizationId);
455 
456             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
457                     "getOrganization", new Object[] { paramObj0 });
458 
459             Object returnObj = null;
460 
461             try {
462                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
463             }
464             catch (Exception e) {
465                 if (e instanceof com.liferay.portal.PortalException) {
466                     throw (com.liferay.portal.PortalException)e;
467                 }
468 
469                 if (e instanceof com.liferay.portal.SystemException) {
470                     throw (com.liferay.portal.SystemException)e;
471                 }
472 
473                 throw new com.liferay.portal.SystemException(e);
474             }
475 
476             return (com.liferay.portal.model.Organization)returnObj;
477         }
478         catch (com.liferay.portal.SystemException se) {
479             _log.error(se, se);
480 
481             throw se;
482         }
483     }
484 
485     public static long getOrganizationId(HttpPrincipal httpPrincipal,
486         long companyId, java.lang.String name)
487         throws com.liferay.portal.SystemException {
488         try {
489             Object paramObj0 = new LongWrapper(companyId);
490 
491             Object paramObj1 = name;
492 
493             if (name == null) {
494                 paramObj1 = new NullWrapper("java.lang.String");
495             }
496 
497             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
498                     "getOrganizationId", new Object[] { paramObj0, paramObj1 });
499 
500             Object returnObj = null;
501 
502             try {
503                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
504             }
505             catch (Exception e) {
506                 if (e instanceof com.liferay.portal.SystemException) {
507                     throw (com.liferay.portal.SystemException)e;
508                 }
509 
510                 throw new com.liferay.portal.SystemException(e);
511             }
512 
513             return ((Long)returnObj).longValue();
514         }
515         catch (com.liferay.portal.SystemException se) {
516             _log.error(se, se);
517 
518             throw se;
519         }
520     }
521 
522     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
523         HttpPrincipal httpPrincipal, long userId)
524         throws com.liferay.portal.SystemException {
525         try {
526             Object paramObj0 = new LongWrapper(userId);
527 
528             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
529                     "getUserOrganizations", new Object[] { paramObj0 });
530 
531             Object returnObj = null;
532 
533             try {
534                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
535             }
536             catch (Exception e) {
537                 if (e instanceof com.liferay.portal.SystemException) {
538                     throw (com.liferay.portal.SystemException)e;
539                 }
540 
541                 throw new com.liferay.portal.SystemException(e);
542             }
543 
544             return (java.util.List<com.liferay.portal.model.Organization>)returnObj;
545         }
546         catch (com.liferay.portal.SystemException se) {
547             _log.error(se, se);
548 
549             throw se;
550         }
551     }
552 
553     public static void setGroupOrganizations(HttpPrincipal httpPrincipal,
554         long groupId, long[] organizationIds)
555         throws com.liferay.portal.PortalException,
556             com.liferay.portal.SystemException {
557         try {
558             Object paramObj0 = new LongWrapper(groupId);
559 
560             Object paramObj1 = organizationIds;
561 
562             if (organizationIds == null) {
563                 paramObj1 = new NullWrapper("[J");
564             }
565 
566             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
567                     "setGroupOrganizations",
568                     new Object[] { paramObj0, paramObj1 });
569 
570             try {
571                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
572             }
573             catch (Exception e) {
574                 if (e instanceof com.liferay.portal.PortalException) {
575                     throw (com.liferay.portal.PortalException)e;
576                 }
577 
578                 if (e instanceof com.liferay.portal.SystemException) {
579                     throw (com.liferay.portal.SystemException)e;
580                 }
581 
582                 throw new com.liferay.portal.SystemException(e);
583             }
584         }
585         catch (com.liferay.portal.SystemException se) {
586             _log.error(se, se);
587 
588             throw se;
589         }
590     }
591 
592     public static void unsetGroupOrganizations(HttpPrincipal httpPrincipal,
593         long groupId, long[] organizationIds)
594         throws com.liferay.portal.PortalException,
595             com.liferay.portal.SystemException {
596         try {
597             Object paramObj0 = new LongWrapper(groupId);
598 
599             Object paramObj1 = organizationIds;
600 
601             if (organizationIds == null) {
602                 paramObj1 = new NullWrapper("[J");
603             }
604 
605             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
606                     "unsetGroupOrganizations",
607                     new Object[] { paramObj0, paramObj1 });
608 
609             try {
610                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
611             }
612             catch (Exception e) {
613                 if (e instanceof com.liferay.portal.PortalException) {
614                     throw (com.liferay.portal.PortalException)e;
615                 }
616 
617                 if (e instanceof com.liferay.portal.SystemException) {
618                     throw (com.liferay.portal.SystemException)e;
619                 }
620 
621                 throw new com.liferay.portal.SystemException(e);
622             }
623         }
624         catch (com.liferay.portal.SystemException se) {
625             _log.error(se, se);
626 
627             throw se;
628         }
629     }
630 
631     public static void unsetPasswordPolicyOrganizations(
632         HttpPrincipal httpPrincipal, long passwordPolicyId,
633         long[] organizationIds)
634         throws com.liferay.portal.PortalException,
635             com.liferay.portal.SystemException {
636         try {
637             Object paramObj0 = new LongWrapper(passwordPolicyId);
638 
639             Object paramObj1 = organizationIds;
640 
641             if (organizationIds == null) {
642                 paramObj1 = new NullWrapper("[J");
643             }
644 
645             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
646                     "unsetPasswordPolicyOrganizations",
647                     new Object[] { paramObj0, paramObj1 });
648 
649             try {
650                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
651             }
652             catch (Exception e) {
653                 if (e instanceof com.liferay.portal.PortalException) {
654                     throw (com.liferay.portal.PortalException)e;
655                 }
656 
657                 if (e instanceof com.liferay.portal.SystemException) {
658                     throw (com.liferay.portal.SystemException)e;
659                 }
660 
661                 throw new com.liferay.portal.SystemException(e);
662             }
663         }
664         catch (com.liferay.portal.SystemException se) {
665             _log.error(se, se);
666 
667             throw se;
668         }
669     }
670 
671     public static com.liferay.portal.model.Organization updateOrganization(
672         HttpPrincipal httpPrincipal, long organizationId,
673         long parentOrganizationId, java.lang.String name,
674         java.lang.String type, boolean recursable, long regionId,
675         long countryId, int statusId, java.lang.String comments,
676         com.liferay.portal.service.ServiceContext serviceContext)
677         throws com.liferay.portal.PortalException,
678             com.liferay.portal.SystemException {
679         try {
680             Object paramObj0 = new LongWrapper(organizationId);
681 
682             Object paramObj1 = new LongWrapper(parentOrganizationId);
683 
684             Object paramObj2 = name;
685 
686             if (name == null) {
687                 paramObj2 = new NullWrapper("java.lang.String");
688             }
689 
690             Object paramObj3 = type;
691 
692             if (type == null) {
693                 paramObj3 = new NullWrapper("java.lang.String");
694             }
695 
696             Object paramObj4 = new BooleanWrapper(recursable);
697 
698             Object paramObj5 = new LongWrapper(regionId);
699 
700             Object paramObj6 = new LongWrapper(countryId);
701 
702             Object paramObj7 = new IntegerWrapper(statusId);
703 
704             Object paramObj8 = comments;
705 
706             if (comments == null) {
707                 paramObj8 = new NullWrapper("java.lang.String");
708             }
709 
710             Object paramObj9 = serviceContext;
711 
712             if (serviceContext == null) {
713                 paramObj9 = new NullWrapper(
714                         "com.liferay.portal.service.ServiceContext");
715             }
716 
717             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
718                     "updateOrganization",
719                     new Object[] {
720                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
721                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9
722                     });
723 
724             Object returnObj = null;
725 
726             try {
727                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
728             }
729             catch (Exception e) {
730                 if (e instanceof com.liferay.portal.PortalException) {
731                     throw (com.liferay.portal.PortalException)e;
732                 }
733 
734                 if (e instanceof com.liferay.portal.SystemException) {
735                     throw (com.liferay.portal.SystemException)e;
736                 }
737 
738                 throw new com.liferay.portal.SystemException(e);
739             }
740 
741             return (com.liferay.portal.model.Organization)returnObj;
742         }
743         catch (com.liferay.portal.SystemException se) {
744             _log.error(se, se);
745 
746             throw se;
747         }
748     }
749 
750     public static com.liferay.portal.model.Organization updateOrganization(
751         HttpPrincipal httpPrincipal, long organizationId,
752         long parentOrganizationId, java.lang.String name,
753         java.lang.String type, boolean recursable, long regionId,
754         long countryId, int statusId, java.lang.String comments,
755         java.util.List<com.liferay.portal.model.Address> addresses,
756         java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
757         java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
758         java.util.List<com.liferay.portal.model.Phone> phones,
759         java.util.List<com.liferay.portal.model.Website> websites,
760         com.liferay.portal.service.ServiceContext serviceContext)
761         throws com.liferay.portal.PortalException,
762             com.liferay.portal.SystemException {
763         try {
764             Object paramObj0 = new LongWrapper(organizationId);
765 
766             Object paramObj1 = new LongWrapper(parentOrganizationId);
767 
768             Object paramObj2 = name;
769 
770             if (name == null) {
771                 paramObj2 = new NullWrapper("java.lang.String");
772             }
773 
774             Object paramObj3 = type;
775 
776             if (type == null) {
777                 paramObj3 = new NullWrapper("java.lang.String");
778             }
779 
780             Object paramObj4 = new BooleanWrapper(recursable);
781 
782             Object paramObj5 = new LongWrapper(regionId);
783 
784             Object paramObj6 = new LongWrapper(countryId);
785 
786             Object paramObj7 = new IntegerWrapper(statusId);
787 
788             Object paramObj8 = comments;
789 
790             if (comments == null) {
791                 paramObj8 = new NullWrapper("java.lang.String");
792             }
793 
794             Object paramObj9 = addresses;
795 
796             if (addresses == null) {
797                 paramObj9 = new NullWrapper("java.util.List");
798             }
799 
800             Object paramObj10 = emailAddresses;
801 
802             if (emailAddresses == null) {
803                 paramObj10 = new NullWrapper("java.util.List");
804             }
805 
806             Object paramObj11 = orgLabors;
807 
808             if (orgLabors == null) {
809                 paramObj11 = new NullWrapper("java.util.List");
810             }
811 
812             Object paramObj12 = phones;
813 
814             if (phones == null) {
815                 paramObj12 = new NullWrapper("java.util.List");
816             }
817 
818             Object paramObj13 = websites;
819 
820             if (websites == null) {
821                 paramObj13 = new NullWrapper("java.util.List");
822             }
823 
824             Object paramObj14 = serviceContext;
825 
826             if (serviceContext == null) {
827                 paramObj14 = new NullWrapper(
828                         "com.liferay.portal.service.ServiceContext");
829             }
830 
831             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
832                     "updateOrganization",
833                     new Object[] {
834                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
835                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
836                         paramObj10, paramObj11, paramObj12, paramObj13,
837                         paramObj14
838                     });
839 
840             Object returnObj = null;
841 
842             try {
843                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
844             }
845             catch (Exception e) {
846                 if (e instanceof com.liferay.portal.PortalException) {
847                     throw (com.liferay.portal.PortalException)e;
848                 }
849 
850                 if (e instanceof com.liferay.portal.SystemException) {
851                     throw (com.liferay.portal.SystemException)e;
852                 }
853 
854                 throw new com.liferay.portal.SystemException(e);
855             }
856 
857             return (com.liferay.portal.model.Organization)returnObj;
858         }
859         catch (com.liferay.portal.SystemException se) {
860             _log.error(se, se);
861 
862             throw se;
863         }
864     }
865 
866     private static Log _log = LogFactoryUtil.getLog(OrganizationServiceHttp.class);
867 }