1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  import com.liferay.portal.kernel.util.BooleanWrapper;
28  import com.liferay.portal.kernel.util.IntegerWrapper;
29  import com.liferay.portal.kernel.util.LongWrapper;
30  import com.liferay.portal.kernel.util.MethodWrapper;
31  import com.liferay.portal.kernel.util.NullWrapper;
32  import com.liferay.portal.security.auth.HttpPrincipal;
33  import com.liferay.portal.service.LayoutServiceUtil;
34  
35  /**
36   * <a href="LayoutServiceHttp.java.html"><b><i>View Source</i></b></a>
37   *
38   * <p>
39   * ServiceBuilder generated this class. Modifications in this class will be
40   * overwritten the next time is generated.
41   * </p>
42   *
43   * <p>
44   * This class provides a HTTP utility for the
45   * <code>com.liferay.portal.service.LayoutServiceUtil</code> service
46   * utility. The static methods of this class calls the same methods of the
47   * service utility. However, the signatures are different because it requires an
48   * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
49   * parameter.
50   * </p>
51   *
52   * <p>
53   * The benefits of using the HTTP utility is that it is fast and allows for
54   * tunneling without the cost of serializing to text. The drawback is that it
55   * only works with Java.
56   * </p>
57   *
58   * <p>
59   * Set the property <code>tunnel.servlet.hosts.allowed</code> in
60   * portal.properties to configure security.
61   * </p>
62   *
63   * <p>
64   * The HTTP utility is only generated for remote services.
65   * </p>
66   *
67   * @author Brian Wing Shun Chan
68   *
69   * @see com.liferay.portal.security.auth.HttpPrincipal
70   * @see com.liferay.portal.service.LayoutServiceUtil
71   * @see com.liferay.portal.service.http.LayoutServiceSoap
72   *
73   */
74  public class LayoutServiceHttp {
75      public static com.liferay.portal.model.Layout addLayout(
76          HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
77          long parentLayoutId, java.lang.String name, java.lang.String title,
78          java.lang.String description, java.lang.String type, boolean hidden,
79          java.lang.String friendlyURL)
80          throws com.liferay.portal.SystemException,
81              com.liferay.portal.PortalException {
82          try {
83              Object paramObj0 = new LongWrapper(groupId);
84  
85              Object paramObj1 = new BooleanWrapper(privateLayout);
86  
87              Object paramObj2 = new LongWrapper(parentLayoutId);
88  
89              Object paramObj3 = name;
90  
91              if (name == null) {
92                  paramObj3 = new NullWrapper("java.lang.String");
93              }
94  
95              Object paramObj4 = title;
96  
97              if (title == null) {
98                  paramObj4 = new NullWrapper("java.lang.String");
99              }
100 
101             Object paramObj5 = description;
102 
103             if (description == null) {
104                 paramObj5 = new NullWrapper("java.lang.String");
105             }
106 
107             Object paramObj6 = type;
108 
109             if (type == null) {
110                 paramObj6 = new NullWrapper("java.lang.String");
111             }
112 
113             Object paramObj7 = new BooleanWrapper(hidden);
114 
115             Object paramObj8 = friendlyURL;
116 
117             if (friendlyURL == null) {
118                 paramObj8 = new NullWrapper("java.lang.String");
119             }
120 
121             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
122                     "addLayout",
123                     new Object[] {
124                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
125                         paramObj5, paramObj6, paramObj7, paramObj8
126                     });
127 
128             Object returnObj = null;
129 
130             try {
131                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
132             }
133             catch (Exception e) {
134                 if (e instanceof com.liferay.portal.SystemException) {
135                     throw (com.liferay.portal.SystemException)e;
136                 }
137 
138                 if (e instanceof com.liferay.portal.PortalException) {
139                     throw (com.liferay.portal.PortalException)e;
140                 }
141 
142                 throw new com.liferay.portal.SystemException(e);
143             }
144 
145             return (com.liferay.portal.model.Layout)returnObj;
146         }
147         catch (com.liferay.portal.SystemException se) {
148             _log.error(se, se);
149 
150             throw se;
151         }
152     }
153 
154     public static com.liferay.portal.model.Layout addLayout(
155         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
156         long parentLayoutId,
157         java.util.Map<java.util.Locale, String> localeNamesMap,
158         java.util.Map<java.util.Locale, String> localeTitlesMap,
159         java.lang.String description, java.lang.String type, boolean hidden,
160         java.lang.String friendlyURL)
161         throws com.liferay.portal.SystemException,
162             com.liferay.portal.PortalException {
163         try {
164             Object paramObj0 = new LongWrapper(groupId);
165 
166             Object paramObj1 = new BooleanWrapper(privateLayout);
167 
168             Object paramObj2 = new LongWrapper(parentLayoutId);
169 
170             Object paramObj3 = localeNamesMap;
171 
172             if (localeNamesMap == null) {
173                 paramObj3 = new NullWrapper("java.util.Map");
174             }
175 
176             Object paramObj4 = localeTitlesMap;
177 
178             if (localeTitlesMap == null) {
179                 paramObj4 = new NullWrapper("java.util.Map");
180             }
181 
182             Object paramObj5 = description;
183 
184             if (description == null) {
185                 paramObj5 = new NullWrapper("java.lang.String");
186             }
187 
188             Object paramObj6 = type;
189 
190             if (type == null) {
191                 paramObj6 = new NullWrapper("java.lang.String");
192             }
193 
194             Object paramObj7 = new BooleanWrapper(hidden);
195 
196             Object paramObj8 = friendlyURL;
197 
198             if (friendlyURL == null) {
199                 paramObj8 = new NullWrapper("java.lang.String");
200             }
201 
202             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
203                     "addLayout",
204                     new Object[] {
205                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
206                         paramObj5, paramObj6, paramObj7, paramObj8
207                     });
208 
209             Object returnObj = null;
210 
211             try {
212                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
213             }
214             catch (Exception e) {
215                 if (e instanceof com.liferay.portal.SystemException) {
216                     throw (com.liferay.portal.SystemException)e;
217                 }
218 
219                 if (e instanceof com.liferay.portal.PortalException) {
220                     throw (com.liferay.portal.PortalException)e;
221                 }
222 
223                 throw new com.liferay.portal.SystemException(e);
224             }
225 
226             return (com.liferay.portal.model.Layout)returnObj;
227         }
228         catch (com.liferay.portal.SystemException se) {
229             _log.error(se, se);
230 
231             throw se;
232         }
233     }
234 
235     public static void deleteLayout(HttpPrincipal httpPrincipal, long plid)
236         throws com.liferay.portal.SystemException,
237             com.liferay.portal.PortalException {
238         try {
239             Object paramObj0 = new LongWrapper(plid);
240 
241             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
242                     "deleteLayout", new Object[] { paramObj0 });
243 
244             try {
245                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
246             }
247             catch (Exception e) {
248                 if (e instanceof com.liferay.portal.SystemException) {
249                     throw (com.liferay.portal.SystemException)e;
250                 }
251 
252                 if (e instanceof com.liferay.portal.PortalException) {
253                     throw (com.liferay.portal.PortalException)e;
254                 }
255 
256                 throw new com.liferay.portal.SystemException(e);
257             }
258         }
259         catch (com.liferay.portal.SystemException se) {
260             _log.error(se, se);
261 
262             throw se;
263         }
264     }
265 
266     public static void deleteLayout(HttpPrincipal httpPrincipal, long groupId,
267         boolean privateLayout, long layoutId)
268         throws com.liferay.portal.SystemException,
269             com.liferay.portal.PortalException {
270         try {
271             Object paramObj0 = new LongWrapper(groupId);
272 
273             Object paramObj1 = new BooleanWrapper(privateLayout);
274 
275             Object paramObj2 = new LongWrapper(layoutId);
276 
277             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
278                     "deleteLayout",
279                     new Object[] { paramObj0, paramObj1, paramObj2 });
280 
281             try {
282                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
283             }
284             catch (Exception e) {
285                 if (e instanceof com.liferay.portal.SystemException) {
286                     throw (com.liferay.portal.SystemException)e;
287                 }
288 
289                 if (e instanceof com.liferay.portal.PortalException) {
290                     throw (com.liferay.portal.PortalException)e;
291                 }
292 
293                 throw new com.liferay.portal.SystemException(e);
294             }
295         }
296         catch (com.liferay.portal.SystemException se) {
297             _log.error(se, se);
298 
299             throw se;
300         }
301     }
302 
303     public static java.lang.String getLayoutName(HttpPrincipal httpPrincipal,
304         long groupId, boolean privateLayout, long layoutId,
305         java.lang.String languageId)
306         throws com.liferay.portal.SystemException,
307             com.liferay.portal.PortalException {
308         try {
309             Object paramObj0 = new LongWrapper(groupId);
310 
311             Object paramObj1 = new BooleanWrapper(privateLayout);
312 
313             Object paramObj2 = new LongWrapper(layoutId);
314 
315             Object paramObj3 = languageId;
316 
317             if (languageId == null) {
318                 paramObj3 = new NullWrapper("java.lang.String");
319             }
320 
321             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
322                     "getLayoutName",
323                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
324 
325             Object returnObj = null;
326 
327             try {
328                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
329             }
330             catch (Exception e) {
331                 if (e instanceof com.liferay.portal.SystemException) {
332                     throw (com.liferay.portal.SystemException)e;
333                 }
334 
335                 if (e instanceof com.liferay.portal.PortalException) {
336                     throw (com.liferay.portal.PortalException)e;
337                 }
338 
339                 throw new com.liferay.portal.SystemException(e);
340             }
341 
342             return (java.lang.String)returnObj;
343         }
344         catch (com.liferay.portal.SystemException se) {
345             _log.error(se, se);
346 
347             throw se;
348         }
349     }
350 
351     public static com.liferay.portal.model.LayoutReference[] getLayoutReferences(
352         HttpPrincipal httpPrincipal, long companyId,
353         java.lang.String portletId, java.lang.String prefsKey,
354         java.lang.String prefsValue) throws com.liferay.portal.SystemException {
355         try {
356             Object paramObj0 = new LongWrapper(companyId);
357 
358             Object paramObj1 = portletId;
359 
360             if (portletId == null) {
361                 paramObj1 = new NullWrapper("java.lang.String");
362             }
363 
364             Object paramObj2 = prefsKey;
365 
366             if (prefsKey == null) {
367                 paramObj2 = new NullWrapper("java.lang.String");
368             }
369 
370             Object paramObj3 = prefsValue;
371 
372             if (prefsValue == null) {
373                 paramObj3 = new NullWrapper("java.lang.String");
374             }
375 
376             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
377                     "getLayoutReferences",
378                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
379 
380             Object returnObj = null;
381 
382             try {
383                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
384             }
385             catch (Exception e) {
386                 if (e instanceof com.liferay.portal.SystemException) {
387                     throw (com.liferay.portal.SystemException)e;
388                 }
389 
390                 throw new com.liferay.portal.SystemException(e);
391             }
392 
393             return (com.liferay.portal.model.LayoutReference[])returnObj;
394         }
395         catch (com.liferay.portal.SystemException se) {
396             _log.error(se, se);
397 
398             throw se;
399         }
400     }
401 
402     public static byte[] exportLayouts(HttpPrincipal httpPrincipal,
403         long groupId, boolean privateLayout,
404         java.util.Map<String, String[]> parameterMap)
405         throws com.liferay.portal.SystemException,
406             com.liferay.portal.PortalException {
407         try {
408             Object paramObj0 = new LongWrapper(groupId);
409 
410             Object paramObj1 = new BooleanWrapper(privateLayout);
411 
412             Object paramObj2 = parameterMap;
413 
414             if (parameterMap == null) {
415                 paramObj2 = new NullWrapper("java.util.Map");
416             }
417 
418             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
419                     "exportLayouts",
420                     new Object[] { paramObj0, paramObj1, paramObj2 });
421 
422             Object returnObj = null;
423 
424             try {
425                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
426             }
427             catch (Exception e) {
428                 if (e instanceof com.liferay.portal.SystemException) {
429                     throw (com.liferay.portal.SystemException)e;
430                 }
431 
432                 if (e instanceof com.liferay.portal.PortalException) {
433                     throw (com.liferay.portal.PortalException)e;
434                 }
435 
436                 throw new com.liferay.portal.SystemException(e);
437             }
438 
439             return (byte[])returnObj;
440         }
441         catch (com.liferay.portal.SystemException se) {
442             _log.error(se, se);
443 
444             throw se;
445         }
446     }
447 
448     public static byte[] exportLayouts(HttpPrincipal httpPrincipal,
449         long groupId, boolean privateLayout, long[] layoutIds,
450         java.util.Map<String, String[]> parameterMap)
451         throws com.liferay.portal.SystemException,
452             com.liferay.portal.PortalException {
453         try {
454             Object paramObj0 = new LongWrapper(groupId);
455 
456             Object paramObj1 = new BooleanWrapper(privateLayout);
457 
458             Object paramObj2 = layoutIds;
459 
460             if (layoutIds == null) {
461                 paramObj2 = new NullWrapper("[J");
462             }
463 
464             Object paramObj3 = parameterMap;
465 
466             if (parameterMap == null) {
467                 paramObj3 = new NullWrapper("java.util.Map");
468             }
469 
470             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
471                     "exportLayouts",
472                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
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.SystemException) {
481                     throw (com.liferay.portal.SystemException)e;
482                 }
483 
484                 if (e instanceof com.liferay.portal.PortalException) {
485                     throw (com.liferay.portal.PortalException)e;
486                 }
487 
488                 throw new com.liferay.portal.SystemException(e);
489             }
490 
491             return (byte[])returnObj;
492         }
493         catch (com.liferay.portal.SystemException se) {
494             _log.error(se, se);
495 
496             throw se;
497         }
498     }
499 
500     public static byte[] exportPortletInfo(HttpPrincipal httpPrincipal,
501         long plid, java.lang.String portletId,
502         java.util.Map<String, String[]> parameterMap)
503         throws com.liferay.portal.SystemException,
504             com.liferay.portal.PortalException {
505         try {
506             Object paramObj0 = new LongWrapper(plid);
507 
508             Object paramObj1 = portletId;
509 
510             if (portletId == null) {
511                 paramObj1 = new NullWrapper("java.lang.String");
512             }
513 
514             Object paramObj2 = parameterMap;
515 
516             if (parameterMap == null) {
517                 paramObj2 = new NullWrapper("java.util.Map");
518             }
519 
520             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
521                     "exportPortletInfo",
522                     new Object[] { paramObj0, paramObj1, paramObj2 });
523 
524             Object returnObj = null;
525 
526             try {
527                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
528             }
529             catch (Exception e) {
530                 if (e instanceof com.liferay.portal.SystemException) {
531                     throw (com.liferay.portal.SystemException)e;
532                 }
533 
534                 if (e instanceof com.liferay.portal.PortalException) {
535                     throw (com.liferay.portal.PortalException)e;
536                 }
537 
538                 throw new com.liferay.portal.SystemException(e);
539             }
540 
541             return (byte[])returnObj;
542         }
543         catch (com.liferay.portal.SystemException se) {
544             _log.error(se, se);
545 
546             throw se;
547         }
548     }
549 
550     public static void importLayouts(HttpPrincipal httpPrincipal, long groupId,
551         boolean privateLayout, java.util.Map<String, String[]> parameterMap,
552         java.io.File file)
553         throws com.liferay.portal.SystemException,
554             com.liferay.portal.PortalException {
555         try {
556             Object paramObj0 = new LongWrapper(groupId);
557 
558             Object paramObj1 = new BooleanWrapper(privateLayout);
559 
560             Object paramObj2 = parameterMap;
561 
562             if (parameterMap == null) {
563                 paramObj2 = new NullWrapper("java.util.Map");
564             }
565 
566             Object paramObj3 = file;
567 
568             if (file == null) {
569                 paramObj3 = new NullWrapper("java.io.File");
570             }
571 
572             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
573                     "importLayouts",
574                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
575 
576             try {
577                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
578             }
579             catch (Exception e) {
580                 if (e instanceof com.liferay.portal.SystemException) {
581                     throw (com.liferay.portal.SystemException)e;
582                 }
583 
584                 if (e instanceof com.liferay.portal.PortalException) {
585                     throw (com.liferay.portal.PortalException)e;
586                 }
587 
588                 throw new com.liferay.portal.SystemException(e);
589             }
590         }
591         catch (com.liferay.portal.SystemException se) {
592             _log.error(se, se);
593 
594             throw se;
595         }
596     }
597 
598     public static void importLayouts(HttpPrincipal httpPrincipal, long groupId,
599         boolean privateLayout, java.util.Map<String, String[]> parameterMap,
600         java.io.InputStream is)
601         throws com.liferay.portal.SystemException,
602             com.liferay.portal.PortalException {
603         try {
604             Object paramObj0 = new LongWrapper(groupId);
605 
606             Object paramObj1 = new BooleanWrapper(privateLayout);
607 
608             Object paramObj2 = parameterMap;
609 
610             if (parameterMap == null) {
611                 paramObj2 = new NullWrapper("java.util.Map");
612             }
613 
614             Object paramObj3 = is;
615 
616             if (is == null) {
617                 paramObj3 = new NullWrapper("java.io.InputStream");
618             }
619 
620             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
621                     "importLayouts",
622                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
623 
624             try {
625                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
626             }
627             catch (Exception e) {
628                 if (e instanceof com.liferay.portal.SystemException) {
629                     throw (com.liferay.portal.SystemException)e;
630                 }
631 
632                 if (e instanceof com.liferay.portal.PortalException) {
633                     throw (com.liferay.portal.PortalException)e;
634                 }
635 
636                 throw new com.liferay.portal.SystemException(e);
637             }
638         }
639         catch (com.liferay.portal.SystemException se) {
640             _log.error(se, se);
641 
642             throw se;
643         }
644     }
645 
646     public static void importPortletInfo(HttpPrincipal httpPrincipal,
647         long plid, java.lang.String portletId,
648         java.util.Map<String, String[]> parameterMap, java.io.File file)
649         throws com.liferay.portal.SystemException,
650             com.liferay.portal.PortalException {
651         try {
652             Object paramObj0 = new LongWrapper(plid);
653 
654             Object paramObj1 = portletId;
655 
656             if (portletId == null) {
657                 paramObj1 = new NullWrapper("java.lang.String");
658             }
659 
660             Object paramObj2 = parameterMap;
661 
662             if (parameterMap == null) {
663                 paramObj2 = new NullWrapper("java.util.Map");
664             }
665 
666             Object paramObj3 = file;
667 
668             if (file == null) {
669                 paramObj3 = new NullWrapper("java.io.File");
670             }
671 
672             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
673                     "importPortletInfo",
674                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
675 
676             try {
677                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
678             }
679             catch (Exception e) {
680                 if (e instanceof com.liferay.portal.SystemException) {
681                     throw (com.liferay.portal.SystemException)e;
682                 }
683 
684                 if (e instanceof com.liferay.portal.PortalException) {
685                     throw (com.liferay.portal.PortalException)e;
686                 }
687 
688                 throw new com.liferay.portal.SystemException(e);
689             }
690         }
691         catch (com.liferay.portal.SystemException se) {
692             _log.error(se, se);
693 
694             throw se;
695         }
696     }
697 
698     public static void importPortletInfo(HttpPrincipal httpPrincipal,
699         long plid, java.lang.String portletId,
700         java.util.Map<String, String[]> parameterMap, java.io.InputStream is)
701         throws com.liferay.portal.SystemException,
702             com.liferay.portal.PortalException {
703         try {
704             Object paramObj0 = new LongWrapper(plid);
705 
706             Object paramObj1 = portletId;
707 
708             if (portletId == null) {
709                 paramObj1 = new NullWrapper("java.lang.String");
710             }
711 
712             Object paramObj2 = parameterMap;
713 
714             if (parameterMap == null) {
715                 paramObj2 = new NullWrapper("java.util.Map");
716             }
717 
718             Object paramObj3 = is;
719 
720             if (is == null) {
721                 paramObj3 = new NullWrapper("java.io.InputStream");
722             }
723 
724             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
725                     "importPortletInfo",
726                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
727 
728             try {
729                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
730             }
731             catch (Exception e) {
732                 if (e instanceof com.liferay.portal.SystemException) {
733                     throw (com.liferay.portal.SystemException)e;
734                 }
735 
736                 if (e instanceof com.liferay.portal.PortalException) {
737                     throw (com.liferay.portal.PortalException)e;
738                 }
739 
740                 throw new com.liferay.portal.SystemException(e);
741             }
742         }
743         catch (com.liferay.portal.SystemException se) {
744             _log.error(se, se);
745 
746             throw se;
747         }
748     }
749 
750     public static void setLayouts(HttpPrincipal httpPrincipal, long groupId,
751         boolean privateLayout, long parentLayoutId, long[] layoutIds)
752         throws com.liferay.portal.SystemException,
753             com.liferay.portal.PortalException {
754         try {
755             Object paramObj0 = new LongWrapper(groupId);
756 
757             Object paramObj1 = new BooleanWrapper(privateLayout);
758 
759             Object paramObj2 = new LongWrapper(parentLayoutId);
760 
761             Object paramObj3 = layoutIds;
762 
763             if (layoutIds == null) {
764                 paramObj3 = new NullWrapper("[J");
765             }
766 
767             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
768                     "setLayouts",
769                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
770 
771             try {
772                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
773             }
774             catch (Exception e) {
775                 if (e instanceof com.liferay.portal.SystemException) {
776                     throw (com.liferay.portal.SystemException)e;
777                 }
778 
779                 if (e instanceof com.liferay.portal.PortalException) {
780                     throw (com.liferay.portal.PortalException)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 com.liferay.portal.model.Layout updateLayout(
794         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
795         long layoutId, long parentLayoutId,
796         java.util.Map<java.util.Locale, String> localeNamesMap,
797         java.util.Map<java.util.Locale, String> localeTitlesMap,
798         java.lang.String description, java.lang.String type, boolean hidden,
799         java.lang.String friendlyURL)
800         throws com.liferay.portal.SystemException,
801             com.liferay.portal.PortalException {
802         try {
803             Object paramObj0 = new LongWrapper(groupId);
804 
805             Object paramObj1 = new BooleanWrapper(privateLayout);
806 
807             Object paramObj2 = new LongWrapper(layoutId);
808 
809             Object paramObj3 = new LongWrapper(parentLayoutId);
810 
811             Object paramObj4 = localeNamesMap;
812 
813             if (localeNamesMap == null) {
814                 paramObj4 = new NullWrapper("java.util.Map");
815             }
816 
817             Object paramObj5 = localeTitlesMap;
818 
819             if (localeTitlesMap == null) {
820                 paramObj5 = new NullWrapper("java.util.Map");
821             }
822 
823             Object paramObj6 = description;
824 
825             if (description == null) {
826                 paramObj6 = new NullWrapper("java.lang.String");
827             }
828 
829             Object paramObj7 = type;
830 
831             if (type == null) {
832                 paramObj7 = new NullWrapper("java.lang.String");
833             }
834 
835             Object paramObj8 = new BooleanWrapper(hidden);
836 
837             Object paramObj9 = friendlyURL;
838 
839             if (friendlyURL == null) {
840                 paramObj9 = new NullWrapper("java.lang.String");
841             }
842 
843             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
844                     "updateLayout",
845                     new Object[] {
846                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
847                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9
848                     });
849 
850             Object returnObj = null;
851 
852             try {
853                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
854             }
855             catch (Exception e) {
856                 if (e instanceof com.liferay.portal.SystemException) {
857                     throw (com.liferay.portal.SystemException)e;
858                 }
859 
860                 if (e instanceof com.liferay.portal.PortalException) {
861                     throw (com.liferay.portal.PortalException)e;
862                 }
863 
864                 throw new com.liferay.portal.SystemException(e);
865             }
866 
867             return (com.liferay.portal.model.Layout)returnObj;
868         }
869         catch (com.liferay.portal.SystemException se) {
870             _log.error(se, se);
871 
872             throw se;
873         }
874     }
875 
876     public static com.liferay.portal.model.Layout updateLayout(
877         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
878         long layoutId, long parentLayoutId,
879         java.util.Map<java.util.Locale, String> localeNamesMap,
880         java.util.Map<java.util.Locale, String> localeTitlesMap,
881         java.lang.String description, java.lang.String type, boolean hidden,
882         java.lang.String friendlyURL, java.lang.Boolean iconImage,
883         byte[] iconBytes)
884         throws com.liferay.portal.SystemException,
885             com.liferay.portal.PortalException {
886         try {
887             Object paramObj0 = new LongWrapper(groupId);
888 
889             Object paramObj1 = new BooleanWrapper(privateLayout);
890 
891             Object paramObj2 = new LongWrapper(layoutId);
892 
893             Object paramObj3 = new LongWrapper(parentLayoutId);
894 
895             Object paramObj4 = localeNamesMap;
896 
897             if (localeNamesMap == null) {
898                 paramObj4 = new NullWrapper("java.util.Map");
899             }
900 
901             Object paramObj5 = localeTitlesMap;
902 
903             if (localeTitlesMap == null) {
904                 paramObj5 = new NullWrapper("java.util.Map");
905             }
906 
907             Object paramObj6 = description;
908 
909             if (description == null) {
910                 paramObj6 = new NullWrapper("java.lang.String");
911             }
912 
913             Object paramObj7 = type;
914 
915             if (type == null) {
916                 paramObj7 = new NullWrapper("java.lang.String");
917             }
918 
919             Object paramObj8 = new BooleanWrapper(hidden);
920 
921             Object paramObj9 = friendlyURL;
922 
923             if (friendlyURL == null) {
924                 paramObj9 = new NullWrapper("java.lang.String");
925             }
926 
927             Object paramObj10 = iconImage;
928 
929             if (iconImage == null) {
930                 paramObj10 = new NullWrapper("java.lang.Boolean");
931             }
932 
933             Object paramObj11 = iconBytes;
934 
935             if (iconBytes == null) {
936                 paramObj11 = new NullWrapper("[B");
937             }
938 
939             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
940                     "updateLayout",
941                     new Object[] {
942                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
943                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
944                         paramObj10, paramObj11
945                     });
946 
947             Object returnObj = null;
948 
949             try {
950                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
951             }
952             catch (Exception e) {
953                 if (e instanceof com.liferay.portal.SystemException) {
954                     throw (com.liferay.portal.SystemException)e;
955                 }
956 
957                 if (e instanceof com.liferay.portal.PortalException) {
958                     throw (com.liferay.portal.PortalException)e;
959                 }
960 
961                 throw new com.liferay.portal.SystemException(e);
962             }
963 
964             return (com.liferay.portal.model.Layout)returnObj;
965         }
966         catch (com.liferay.portal.SystemException se) {
967             _log.error(se, se);
968 
969             throw se;
970         }
971     }
972 
973     public static com.liferay.portal.model.Layout updateLayout(
974         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
975         long layoutId, java.lang.String typeSettings)
976         throws com.liferay.portal.SystemException,
977             com.liferay.portal.PortalException {
978         try {
979             Object paramObj0 = new LongWrapper(groupId);
980 
981             Object paramObj1 = new BooleanWrapper(privateLayout);
982 
983             Object paramObj2 = new LongWrapper(layoutId);
984 
985             Object paramObj3 = typeSettings;
986 
987             if (typeSettings == null) {
988                 paramObj3 = new NullWrapper("java.lang.String");
989             }
990 
991             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
992                     "updateLayout",
993                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
994 
995             Object returnObj = null;
996 
997             try {
998                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
999             }
1000            catch (Exception e) {
1001                if (e instanceof com.liferay.portal.SystemException) {
1002                    throw (com.liferay.portal.SystemException)e;
1003                }
1004
1005                if (e instanceof com.liferay.portal.PortalException) {
1006                    throw (com.liferay.portal.PortalException)e;
1007                }
1008
1009                throw new com.liferay.portal.SystemException(e);
1010            }
1011
1012            return (com.liferay.portal.model.Layout)returnObj;
1013        }
1014        catch (com.liferay.portal.SystemException se) {
1015            _log.error(se, se);
1016
1017            throw se;
1018        }
1019    }
1020
1021    public static com.liferay.portal.model.Layout updateLookAndFeel(
1022        HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
1023        long layoutId, java.lang.String themeId,
1024        java.lang.String colorSchemeId, java.lang.String css, boolean wapTheme)
1025        throws com.liferay.portal.SystemException,
1026            com.liferay.portal.PortalException {
1027        try {
1028            Object paramObj0 = new LongWrapper(groupId);
1029
1030            Object paramObj1 = new BooleanWrapper(privateLayout);
1031
1032            Object paramObj2 = new LongWrapper(layoutId);
1033
1034            Object paramObj3 = themeId;
1035
1036            if (themeId == null) {
1037                paramObj3 = new NullWrapper("java.lang.String");
1038            }
1039
1040            Object paramObj4 = colorSchemeId;
1041
1042            if (colorSchemeId == null) {
1043                paramObj4 = new NullWrapper("java.lang.String");
1044            }
1045
1046            Object paramObj5 = css;
1047
1048            if (css == null) {
1049                paramObj5 = new NullWrapper("java.lang.String");
1050            }
1051
1052            Object paramObj6 = new BooleanWrapper(wapTheme);
1053
1054            MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
1055                    "updateLookAndFeel",
1056                    new Object[] {
1057                        paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
1058                        paramObj5, paramObj6
1059                    });
1060
1061            Object returnObj = null;
1062
1063            try {
1064                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1065            }
1066            catch (Exception e) {
1067                if (e instanceof com.liferay.portal.SystemException) {
1068                    throw (com.liferay.portal.SystemException)e;
1069                }
1070
1071                if (e instanceof com.liferay.portal.PortalException) {
1072                    throw (com.liferay.portal.PortalException)e;
1073                }
1074
1075                throw new com.liferay.portal.SystemException(e);
1076            }
1077
1078            return (com.liferay.portal.model.Layout)returnObj;
1079        }
1080        catch (com.liferay.portal.SystemException se) {
1081            _log.error(se, se);
1082
1083            throw se;
1084        }
1085    }
1086
1087    public static com.liferay.portal.model.Layout updateName(
1088        HttpPrincipal httpPrincipal, long plid, java.lang.String name,
1089        java.lang.String languageId)
1090        throws com.liferay.portal.SystemException,
1091            com.liferay.portal.PortalException {
1092        try {
1093            Object paramObj0 = new LongWrapper(plid);
1094
1095            Object paramObj1 = name;
1096
1097            if (name == null) {
1098                paramObj1 = new NullWrapper("java.lang.String");
1099            }
1100
1101            Object paramObj2 = languageId;
1102
1103            if (languageId == null) {
1104                paramObj2 = new NullWrapper("java.lang.String");
1105            }
1106
1107            MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
1108                    "updateName",
1109                    new Object[] { paramObj0, paramObj1, paramObj2 });
1110
1111            Object returnObj = null;
1112
1113            try {
1114                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1115            }
1116            catch (Exception e) {
1117                if (e instanceof com.liferay.portal.SystemException) {
1118                    throw (com.liferay.portal.SystemException)e;
1119                }
1120
1121                if (e instanceof com.liferay.portal.PortalException) {
1122                    throw (com.liferay.portal.PortalException)e;
1123                }
1124
1125                throw new com.liferay.portal.SystemException(e);
1126            }
1127
1128            return (com.liferay.portal.model.Layout)returnObj;
1129        }
1130        catch (com.liferay.portal.SystemException se) {
1131            _log.error(se, se);
1132
1133            throw se;
1134        }
1135    }
1136
1137    public static com.liferay.portal.model.Layout updateName(
1138        HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
1139        long layoutId, java.lang.String name, java.lang.String languageId)
1140        throws com.liferay.portal.SystemException,
1141            com.liferay.portal.PortalException {
1142        try {
1143            Object paramObj0 = new LongWrapper(groupId);
1144
1145            Object paramObj1 = new BooleanWrapper(privateLayout);
1146
1147            Object paramObj2 = new LongWrapper(layoutId);
1148
1149            Object paramObj3 = name;
1150
1151            if (name == null) {
1152                paramObj3 = new NullWrapper("java.lang.String");
1153            }
1154
1155            Object paramObj4 = languageId;
1156
1157            if (languageId == null) {
1158                paramObj4 = new NullWrapper("java.lang.String");
1159            }
1160
1161            MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
1162                    "updateName",
1163                    new Object[] {
1164                        paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
1165                    });
1166
1167            Object returnObj = null;
1168
1169            try {
1170                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1171            }
1172            catch (Exception e) {
1173                if (e instanceof com.liferay.portal.SystemException) {
1174                    throw (com.liferay.portal.SystemException)e;
1175                }
1176
1177                if (e instanceof com.liferay.portal.PortalException) {
1178                    throw (com.liferay.portal.PortalException)e;
1179                }
1180
1181                throw new com.liferay.portal.SystemException(e);
1182            }
1183
1184            return (com.liferay.portal.model.Layout)returnObj;
1185        }
1186        catch (com.liferay.portal.SystemException se) {
1187            _log.error(se, se);
1188
1189            throw se;
1190        }
1191    }
1192
1193    public static com.liferay.portal.model.Layout updateParentLayoutId(
1194        HttpPrincipal httpPrincipal, long plid, long parentPlid)
1195        throws com.liferay.portal.SystemException,
1196            com.liferay.portal.PortalException {
1197        try {
1198            Object paramObj0 = new LongWrapper(plid);
1199
1200            Object paramObj1 = new LongWrapper(parentPlid);
1201
1202            MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
1203                    "updateParentLayoutId",
1204                    new Object[] { paramObj0, paramObj1 });
1205
1206            Object returnObj = null;
1207
1208            try {
1209                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1210            }
1211            catch (Exception e) {
1212                if (e instanceof com.liferay.portal.SystemException) {
1213                    throw (com.liferay.portal.SystemException)e;
1214                }
1215
1216                if (e instanceof com.liferay.portal.PortalException) {
1217                    throw (com.liferay.portal.PortalException)e;
1218                }
1219
1220                throw new com.liferay.portal.SystemException(e);
1221            }
1222
1223            return (com.liferay.portal.model.Layout)returnObj;
1224        }
1225        catch (com.liferay.portal.SystemException se) {
1226            _log.error(se, se);
1227
1228            throw se;
1229        }
1230    }
1231
1232    public static com.liferay.portal.model.Layout updateParentLayoutId(
1233        HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
1234        long layoutId, long parentLayoutId)
1235        throws com.liferay.portal.SystemException,
1236            com.liferay.portal.PortalException {
1237        try {
1238            Object paramObj0 = new LongWrapper(groupId);
1239
1240            Object paramObj1 = new BooleanWrapper(privateLayout);
1241
1242            Object paramObj2 = new LongWrapper(layoutId);
1243
1244            Object paramObj3 = new LongWrapper(parentLayoutId);
1245
1246            MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
1247                    "updateParentLayoutId",
1248                    new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
1249
1250            Object returnObj = null;
1251
1252            try {
1253                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1254            }
1255            catch (Exception e) {
1256                if (e instanceof com.liferay.portal.SystemException) {
1257                    throw (com.liferay.portal.SystemException)e;
1258                }
1259
1260                if (e instanceof com.liferay.portal.PortalException) {
1261                    throw (com.liferay.portal.PortalException)e;
1262                }
1263
1264                throw new com.liferay.portal.SystemException(e);
1265            }
1266
1267            return (com.liferay.portal.model.Layout)returnObj;
1268        }
1269        catch (com.liferay.portal.SystemException se) {
1270            _log.error(se, se);
1271
1272            throw se;
1273        }
1274    }
1275
1276    public static com.liferay.portal.model.Layout updatePriority(
1277        HttpPrincipal httpPrincipal, long plid, int priority)
1278        throws com.liferay.portal.SystemException,
1279            com.liferay.portal.PortalException {
1280        try {
1281            Object paramObj0 = new LongWrapper(plid);
1282
1283            Object paramObj1 = new IntegerWrapper(priority);
1284
1285            MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
1286                    "updatePriority", new Object[] { paramObj0, paramObj1 });
1287
1288            Object returnObj = null;
1289
1290            try {
1291                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1292            }
1293            catch (Exception e) {
1294                if (e instanceof com.liferay.portal.SystemException) {
1295                    throw (com.liferay.portal.SystemException)e;
1296                }
1297
1298                if (e instanceof com.liferay.portal.PortalException) {
1299                    throw (com.liferay.portal.PortalException)e;
1300                }
1301
1302                throw new com.liferay.portal.SystemException(e);
1303            }
1304
1305            return (com.liferay.portal.model.Layout)returnObj;
1306        }
1307        catch (com.liferay.portal.SystemException se) {
1308            _log.error(se, se);
1309
1310            throw se;
1311        }
1312    }
1313
1314    public static com.liferay.portal.model.Layout updatePriority(
1315        HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
1316        long layoutId, int priority)
1317        throws com.liferay.portal.SystemException,
1318            com.liferay.portal.PortalException {
1319        try {
1320            Object paramObj0 = new LongWrapper(groupId);
1321
1322            Object paramObj1 = new BooleanWrapper(privateLayout);
1323
1324            Object paramObj2 = new LongWrapper(layoutId);
1325
1326            Object paramObj3 = new IntegerWrapper(priority);
1327
1328            MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
1329                    "updatePriority",
1330                    new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
1331
1332            Object returnObj = null;
1333
1334            try {
1335                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1336            }
1337            catch (Exception e) {
1338                if (e instanceof com.liferay.portal.SystemException) {
1339                    throw (com.liferay.portal.SystemException)e;
1340                }
1341
1342                if (e instanceof com.liferay.portal.PortalException) {
1343                    throw (com.liferay.portal.PortalException)e;
1344                }
1345
1346                throw new com.liferay.portal.SystemException(e);
1347            }
1348
1349            return (com.liferay.portal.model.Layout)returnObj;
1350        }
1351        catch (com.liferay.portal.SystemException se) {
1352            _log.error(se, se);
1353
1354            throw se;
1355        }
1356    }
1357
1358    private static Log _log = LogFactoryUtil.getLog(LayoutServiceHttp.class);
1359}