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