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