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