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 deleteOrganization(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                     "deleteOrganization", 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 java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
375         HttpPrincipal httpPrincipal, long userId, java.lang.String actionId)
376         throws com.liferay.portal.PortalException,
377             com.liferay.portal.SystemException {
378         try {
379             Object paramObj0 = new LongWrapper(userId);
380 
381             Object paramObj1 = actionId;
382 
383             if (actionId == null) {
384                 paramObj1 = new NullWrapper("java.lang.String");
385             }
386 
387             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
388                     "getManageableOrganizations",
389                     new Object[] { paramObj0, paramObj1 });
390 
391             Object returnObj = null;
392 
393             try {
394                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
395             }
396             catch (Exception e) {
397                 if (e instanceof com.liferay.portal.PortalException) {
398                     throw (com.liferay.portal.PortalException)e;
399                 }
400 
401                 if (e instanceof com.liferay.portal.SystemException) {
402                     throw (com.liferay.portal.SystemException)e;
403                 }
404 
405                 throw new com.liferay.portal.SystemException(e);
406             }
407 
408             return (java.util.List<com.liferay.portal.model.Organization>)returnObj;
409         }
410         catch (com.liferay.portal.SystemException se) {
411             _log.error(se, se);
412 
413             throw se;
414         }
415     }
416 
417     public static java.util.List<com.liferay.portal.model.Organization> getManageableOrganizations(
418         HttpPrincipal httpPrincipal, long userId, java.lang.String actionId,
419         boolean recurse)
420         throws com.liferay.portal.PortalException,
421             com.liferay.portal.SystemException {
422         try {
423             Object paramObj0 = new LongWrapper(userId);
424 
425             Object paramObj1 = actionId;
426 
427             if (actionId == null) {
428                 paramObj1 = new NullWrapper("java.lang.String");
429             }
430 
431             Object paramObj2 = new BooleanWrapper(recurse);
432 
433             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
434                     "getManageableOrganizations",
435                     new Object[] { paramObj0, paramObj1, paramObj2 });
436 
437             Object returnObj = null;
438 
439             try {
440                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
441             }
442             catch (Exception e) {
443                 if (e instanceof com.liferay.portal.PortalException) {
444                     throw (com.liferay.portal.PortalException)e;
445                 }
446 
447                 if (e instanceof com.liferay.portal.SystemException) {
448                     throw (com.liferay.portal.SystemException)e;
449                 }
450 
451                 throw new com.liferay.portal.SystemException(e);
452             }
453 
454             return (java.util.List<com.liferay.portal.model.Organization>)returnObj;
455         }
456         catch (com.liferay.portal.SystemException se) {
457             _log.error(se, se);
458 
459             throw se;
460         }
461     }
462 
463     public static com.liferay.portal.model.Organization getOrganization(
464         HttpPrincipal httpPrincipal, long organizationId)
465         throws com.liferay.portal.PortalException,
466             com.liferay.portal.SystemException {
467         try {
468             Object paramObj0 = new LongWrapper(organizationId);
469 
470             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
471                     "getOrganization", new Object[] { paramObj0 });
472 
473             Object returnObj = null;
474 
475             try {
476                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
477             }
478             catch (Exception e) {
479                 if (e instanceof com.liferay.portal.PortalException) {
480                     throw (com.liferay.portal.PortalException)e;
481                 }
482 
483                 if (e instanceof com.liferay.portal.SystemException) {
484                     throw (com.liferay.portal.SystemException)e;
485                 }
486 
487                 throw new com.liferay.portal.SystemException(e);
488             }
489 
490             return (com.liferay.portal.model.Organization)returnObj;
491         }
492         catch (com.liferay.portal.SystemException se) {
493             _log.error(se, se);
494 
495             throw se;
496         }
497     }
498 
499     public static long getOrganizationId(HttpPrincipal httpPrincipal,
500         long companyId, java.lang.String name)
501         throws com.liferay.portal.SystemException {
502         try {
503             Object paramObj0 = new LongWrapper(companyId);
504 
505             Object paramObj1 = name;
506 
507             if (name == null) {
508                 paramObj1 = new NullWrapper("java.lang.String");
509             }
510 
511             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
512                     "getOrganizationId", new Object[] { paramObj0, paramObj1 });
513 
514             Object returnObj = null;
515 
516             try {
517                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
518             }
519             catch (Exception e) {
520                 if (e instanceof com.liferay.portal.SystemException) {
521                     throw (com.liferay.portal.SystemException)e;
522                 }
523 
524                 throw new com.liferay.portal.SystemException(e);
525             }
526 
527             return ((Long)returnObj).longValue();
528         }
529         catch (com.liferay.portal.SystemException se) {
530             _log.error(se, se);
531 
532             throw se;
533         }
534     }
535 
536     public static java.util.List<com.liferay.portal.model.Organization> getUserOrganizations(
537         HttpPrincipal httpPrincipal, long userId)
538         throws com.liferay.portal.SystemException {
539         try {
540             Object paramObj0 = new LongWrapper(userId);
541 
542             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
543                     "getUserOrganizations", new Object[] { paramObj0 });
544 
545             Object returnObj = null;
546 
547             try {
548                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
549             }
550             catch (Exception e) {
551                 if (e instanceof com.liferay.portal.SystemException) {
552                     throw (com.liferay.portal.SystemException)e;
553                 }
554 
555                 throw new com.liferay.portal.SystemException(e);
556             }
557 
558             return (java.util.List<com.liferay.portal.model.Organization>)returnObj;
559         }
560         catch (com.liferay.portal.SystemException se) {
561             _log.error(se, se);
562 
563             throw se;
564         }
565     }
566 
567     public static void setGroupOrganizations(HttpPrincipal httpPrincipal,
568         long groupId, long[] organizationIds)
569         throws com.liferay.portal.PortalException,
570             com.liferay.portal.SystemException {
571         try {
572             Object paramObj0 = new LongWrapper(groupId);
573 
574             Object paramObj1 = organizationIds;
575 
576             if (organizationIds == null) {
577                 paramObj1 = new NullWrapper("[J");
578             }
579 
580             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
581                     "setGroupOrganizations",
582                     new Object[] { paramObj0, paramObj1 });
583 
584             try {
585                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
586             }
587             catch (Exception e) {
588                 if (e instanceof com.liferay.portal.PortalException) {
589                     throw (com.liferay.portal.PortalException)e;
590                 }
591 
592                 if (e instanceof com.liferay.portal.SystemException) {
593                     throw (com.liferay.portal.SystemException)e;
594                 }
595 
596                 throw new com.liferay.portal.SystemException(e);
597             }
598         }
599         catch (com.liferay.portal.SystemException se) {
600             _log.error(se, se);
601 
602             throw se;
603         }
604     }
605 
606     public static void unsetGroupOrganizations(HttpPrincipal httpPrincipal,
607         long groupId, long[] organizationIds)
608         throws com.liferay.portal.PortalException,
609             com.liferay.portal.SystemException {
610         try {
611             Object paramObj0 = new LongWrapper(groupId);
612 
613             Object paramObj1 = organizationIds;
614 
615             if (organizationIds == null) {
616                 paramObj1 = new NullWrapper("[J");
617             }
618 
619             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
620                     "unsetGroupOrganizations",
621                     new Object[] { paramObj0, paramObj1 });
622 
623             try {
624                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
625             }
626             catch (Exception e) {
627                 if (e instanceof com.liferay.portal.PortalException) {
628                     throw (com.liferay.portal.PortalException)e;
629                 }
630 
631                 if (e instanceof com.liferay.portal.SystemException) {
632                     throw (com.liferay.portal.SystemException)e;
633                 }
634 
635                 throw new com.liferay.portal.SystemException(e);
636             }
637         }
638         catch (com.liferay.portal.SystemException se) {
639             _log.error(se, se);
640 
641             throw se;
642         }
643     }
644 
645     public static void unsetPasswordPolicyOrganizations(
646         HttpPrincipal httpPrincipal, long passwordPolicyId,
647         long[] organizationIds)
648         throws com.liferay.portal.PortalException,
649             com.liferay.portal.SystemException {
650         try {
651             Object paramObj0 = new LongWrapper(passwordPolicyId);
652 
653             Object paramObj1 = organizationIds;
654 
655             if (organizationIds == null) {
656                 paramObj1 = new NullWrapper("[J");
657             }
658 
659             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
660                     "unsetPasswordPolicyOrganizations",
661                     new Object[] { paramObj0, paramObj1 });
662 
663             try {
664                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
665             }
666             catch (Exception e) {
667                 if (e instanceof com.liferay.portal.PortalException) {
668                     throw (com.liferay.portal.PortalException)e;
669                 }
670 
671                 if (e instanceof com.liferay.portal.SystemException) {
672                     throw (com.liferay.portal.SystemException)e;
673                 }
674 
675                 throw new com.liferay.portal.SystemException(e);
676             }
677         }
678         catch (com.liferay.portal.SystemException se) {
679             _log.error(se, se);
680 
681             throw se;
682         }
683     }
684 
685     public static com.liferay.portal.model.Organization updateOrganization(
686         HttpPrincipal httpPrincipal, long organizationId,
687         long parentOrganizationId, java.lang.String name,
688         java.lang.String type, boolean recursable, long regionId,
689         long countryId, int statusId, java.lang.String comments,
690         com.liferay.portal.service.ServiceContext serviceContext)
691         throws com.liferay.portal.PortalException,
692             com.liferay.portal.SystemException {
693         try {
694             Object paramObj0 = new LongWrapper(organizationId);
695 
696             Object paramObj1 = new LongWrapper(parentOrganizationId);
697 
698             Object paramObj2 = name;
699 
700             if (name == null) {
701                 paramObj2 = new NullWrapper("java.lang.String");
702             }
703 
704             Object paramObj3 = type;
705 
706             if (type == null) {
707                 paramObj3 = new NullWrapper("java.lang.String");
708             }
709 
710             Object paramObj4 = new BooleanWrapper(recursable);
711 
712             Object paramObj5 = new LongWrapper(regionId);
713 
714             Object paramObj6 = new LongWrapper(countryId);
715 
716             Object paramObj7 = new IntegerWrapper(statusId);
717 
718             Object paramObj8 = comments;
719 
720             if (comments == null) {
721                 paramObj8 = new NullWrapper("java.lang.String");
722             }
723 
724             Object paramObj9 = serviceContext;
725 
726             if (serviceContext == null) {
727                 paramObj9 = new NullWrapper(
728                         "com.liferay.portal.service.ServiceContext");
729             }
730 
731             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
732                     "updateOrganization",
733                     new Object[] {
734                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
735                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9
736                     });
737 
738             Object returnObj = null;
739 
740             try {
741                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
742             }
743             catch (Exception e) {
744                 if (e instanceof com.liferay.portal.PortalException) {
745                     throw (com.liferay.portal.PortalException)e;
746                 }
747 
748                 if (e instanceof com.liferay.portal.SystemException) {
749                     throw (com.liferay.portal.SystemException)e;
750                 }
751 
752                 throw new com.liferay.portal.SystemException(e);
753             }
754 
755             return (com.liferay.portal.model.Organization)returnObj;
756         }
757         catch (com.liferay.portal.SystemException se) {
758             _log.error(se, se);
759 
760             throw se;
761         }
762     }
763 
764     public static com.liferay.portal.model.Organization updateOrganization(
765         HttpPrincipal httpPrincipal, long organizationId,
766         long parentOrganizationId, java.lang.String name,
767         java.lang.String type, boolean recursable, long regionId,
768         long countryId, int statusId, java.lang.String comments,
769         java.util.List<com.liferay.portal.model.Address> addresses,
770         java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
771         java.util.List<com.liferay.portal.model.OrgLabor> orgLabors,
772         java.util.List<com.liferay.portal.model.Phone> phones,
773         java.util.List<com.liferay.portal.model.Website> websites,
774         com.liferay.portal.service.ServiceContext serviceContext)
775         throws com.liferay.portal.PortalException,
776             com.liferay.portal.SystemException {
777         try {
778             Object paramObj0 = new LongWrapper(organizationId);
779 
780             Object paramObj1 = new LongWrapper(parentOrganizationId);
781 
782             Object paramObj2 = name;
783 
784             if (name == null) {
785                 paramObj2 = new NullWrapper("java.lang.String");
786             }
787 
788             Object paramObj3 = type;
789 
790             if (type == null) {
791                 paramObj3 = new NullWrapper("java.lang.String");
792             }
793 
794             Object paramObj4 = new BooleanWrapper(recursable);
795 
796             Object paramObj5 = new LongWrapper(regionId);
797 
798             Object paramObj6 = new LongWrapper(countryId);
799 
800             Object paramObj7 = new IntegerWrapper(statusId);
801 
802             Object paramObj8 = comments;
803 
804             if (comments == null) {
805                 paramObj8 = new NullWrapper("java.lang.String");
806             }
807 
808             Object paramObj9 = addresses;
809 
810             if (addresses == null) {
811                 paramObj9 = new NullWrapper("java.util.List");
812             }
813 
814             Object paramObj10 = emailAddresses;
815 
816             if (emailAddresses == null) {
817                 paramObj10 = new NullWrapper("java.util.List");
818             }
819 
820             Object paramObj11 = orgLabors;
821 
822             if (orgLabors == null) {
823                 paramObj11 = new NullWrapper("java.util.List");
824             }
825 
826             Object paramObj12 = phones;
827 
828             if (phones == null) {
829                 paramObj12 = new NullWrapper("java.util.List");
830             }
831 
832             Object paramObj13 = websites;
833 
834             if (websites == null) {
835                 paramObj13 = new NullWrapper("java.util.List");
836             }
837 
838             Object paramObj14 = serviceContext;
839 
840             if (serviceContext == null) {
841                 paramObj14 = new NullWrapper(
842                         "com.liferay.portal.service.ServiceContext");
843             }
844 
845             MethodWrapper methodWrapper = new MethodWrapper(OrganizationServiceUtil.class.getName(),
846                     "updateOrganization",
847                     new Object[] {
848                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
849                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
850                         paramObj10, paramObj11, paramObj12, paramObj13,
851                         paramObj14
852                     });
853 
854             Object returnObj = null;
855 
856             try {
857                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
858             }
859             catch (Exception e) {
860                 if (e instanceof com.liferay.portal.PortalException) {
861                     throw (com.liferay.portal.PortalException)e;
862                 }
863 
864                 if (e instanceof com.liferay.portal.SystemException) {
865                     throw (com.liferay.portal.SystemException)e;
866                 }
867 
868                 throw new com.liferay.portal.SystemException(e);
869             }
870 
871             return (com.liferay.portal.model.Organization)returnObj;
872         }
873         catch (com.liferay.portal.SystemException se) {
874             _log.error(se, se);
875 
876             throw se;
877         }
878     }
879 
880     private static Log _log = LogFactoryUtil.getLog(OrganizationServiceHttp.class);
881 }