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