1   /**
2    * Copyright (c) 2000-2007 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  import com.liferay.portal.service.http.TunnelUtil;
35  
36  /**
37   * <a href="LayoutServiceHttp.java.html"><b><i>View Source</i></b></a>
38   *
39   * <p>
40   * ServiceBuilder generated this class. Modifications in this class will be overwritten
41   * the next time is generated.
42   * </p>
43   *
44   * <p>
45   * This class provides a HTTP utility for the <code>com.liferay.portal.service.LayoutServiceUtil</code>
46   * service 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> parameter.
49   * </p>
50   *
51   * <p>
52   * The benefits of using the HTTP utility is that it is fast and allows for tunneling
53   * without the cost of serializing to text. The drawback is that it only works with
54   * Java.
55   * </p>
56   *
57   * <p>
58   * Set the property <code>tunnel.servlet.hosts.allowed</code> in portal.properties
59   * 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.LayoutServiceUtil
70   * @see com.liferay.portal.service.http.LayoutServiceSoap
71   *
72   */
73  public class LayoutServiceHttp {
74      public static com.liferay.portal.model.Layout addLayout(
75          HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
76          long parentLayoutId, java.lang.String name, java.lang.String title,
77          java.lang.String description, java.lang.String type, boolean hidden,
78          java.lang.String friendlyURL)
79          throws com.liferay.portal.SystemException, 
80              com.liferay.portal.PortalException {
81          try {
82              Object paramObj0 = new LongWrapper(groupId);
83              Object paramObj1 = new BooleanWrapper(privateLayout);
84              Object paramObj2 = new LongWrapper(parentLayoutId);
85              Object paramObj3 = name;
86  
87              if (name == null) {
88                  paramObj3 = new NullWrapper("java.lang.String");
89              }
90  
91              Object paramObj4 = title;
92  
93              if (title == null) {
94                  paramObj4 = new NullWrapper("java.lang.String");
95              }
96  
97              Object paramObj5 = description;
98  
99              if (description == null) {
100                 paramObj5 = new NullWrapper("java.lang.String");
101             }
102 
103             Object paramObj6 = type;
104 
105             if (type == null) {
106                 paramObj6 = new NullWrapper("java.lang.String");
107             }
108 
109             Object paramObj7 = new BooleanWrapper(hidden);
110             Object paramObj8 = friendlyURL;
111 
112             if (friendlyURL == null) {
113                 paramObj8 = new NullWrapper("java.lang.String");
114             }
115 
116             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
117                     "addLayout",
118                     new Object[] {
119                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
120                         paramObj5, paramObj6, paramObj7, paramObj8
121                     });
122             Object returnObj = null;
123 
124             try {
125                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
126             }
127             catch (Exception e) {
128                 if (e instanceof com.liferay.portal.SystemException) {
129                     throw (com.liferay.portal.SystemException)e;
130                 }
131 
132                 if (e instanceof com.liferay.portal.PortalException) {
133                     throw (com.liferay.portal.PortalException)e;
134                 }
135 
136                 throw new com.liferay.portal.SystemException(e);
137             }
138 
139             return (com.liferay.portal.model.Layout)returnObj;
140         }
141         catch (com.liferay.portal.SystemException se) {
142             _log.error(se, se);
143             throw se;
144         }
145     }
146 
147     public static void deleteLayout(HttpPrincipal httpPrincipal, long plid)
148         throws com.liferay.portal.SystemException, 
149             com.liferay.portal.PortalException {
150         try {
151             Object paramObj0 = new LongWrapper(plid);
152             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
153                     "deleteLayout", new Object[] { paramObj0 });
154 
155             try {
156                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
157             }
158             catch (Exception e) {
159                 if (e instanceof com.liferay.portal.SystemException) {
160                     throw (com.liferay.portal.SystemException)e;
161                 }
162 
163                 if (e instanceof com.liferay.portal.PortalException) {
164                     throw (com.liferay.portal.PortalException)e;
165                 }
166 
167                 throw new com.liferay.portal.SystemException(e);
168             }
169         }
170         catch (com.liferay.portal.SystemException se) {
171             _log.error(se, se);
172             throw se;
173         }
174     }
175 
176     public static void deleteLayout(HttpPrincipal httpPrincipal, long groupId,
177         boolean privateLayout, long layoutId)
178         throws com.liferay.portal.SystemException, 
179             com.liferay.portal.PortalException {
180         try {
181             Object paramObj0 = new LongWrapper(groupId);
182             Object paramObj1 = new BooleanWrapper(privateLayout);
183             Object paramObj2 = new LongWrapper(layoutId);
184             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
185                     "deleteLayout",
186                     new Object[] { paramObj0, paramObj1, paramObj2 });
187 
188             try {
189                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
190             }
191             catch (Exception e) {
192                 if (e instanceof com.liferay.portal.SystemException) {
193                     throw (com.liferay.portal.SystemException)e;
194                 }
195 
196                 if (e instanceof com.liferay.portal.PortalException) {
197                     throw (com.liferay.portal.PortalException)e;
198                 }
199 
200                 throw new com.liferay.portal.SystemException(e);
201             }
202         }
203         catch (com.liferay.portal.SystemException se) {
204             _log.error(se, se);
205             throw se;
206         }
207     }
208 
209     public static java.lang.String getLayoutName(HttpPrincipal httpPrincipal,
210         long groupId, boolean privateLayout, long layoutId,
211         java.lang.String languageId)
212         throws com.liferay.portal.SystemException, 
213             com.liferay.portal.PortalException {
214         try {
215             Object paramObj0 = new LongWrapper(groupId);
216             Object paramObj1 = new BooleanWrapper(privateLayout);
217             Object paramObj2 = new LongWrapper(layoutId);
218             Object paramObj3 = languageId;
219 
220             if (languageId == null) {
221                 paramObj3 = new NullWrapper("java.lang.String");
222             }
223 
224             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
225                     "getLayoutName",
226                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
227             Object returnObj = null;
228 
229             try {
230                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
231             }
232             catch (Exception e) {
233                 if (e instanceof com.liferay.portal.SystemException) {
234                     throw (com.liferay.portal.SystemException)e;
235                 }
236 
237                 if (e instanceof com.liferay.portal.PortalException) {
238                     throw (com.liferay.portal.PortalException)e;
239                 }
240 
241                 throw new com.liferay.portal.SystemException(e);
242             }
243 
244             return (java.lang.String)returnObj;
245         }
246         catch (com.liferay.portal.SystemException se) {
247             _log.error(se, se);
248             throw se;
249         }
250     }
251 
252     public static com.liferay.portal.model.LayoutReference[] getLayoutReferences(
253         HttpPrincipal httpPrincipal, long companyId,
254         java.lang.String portletId, java.lang.String prefsKey,
255         java.lang.String prefsValue) throws com.liferay.portal.SystemException {
256         try {
257             Object paramObj0 = new LongWrapper(companyId);
258             Object paramObj1 = portletId;
259 
260             if (portletId == null) {
261                 paramObj1 = new NullWrapper("java.lang.String");
262             }
263 
264             Object paramObj2 = prefsKey;
265 
266             if (prefsKey == null) {
267                 paramObj2 = new NullWrapper("java.lang.String");
268             }
269 
270             Object paramObj3 = prefsValue;
271 
272             if (prefsValue == null) {
273                 paramObj3 = new NullWrapper("java.lang.String");
274             }
275 
276             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
277                     "getLayoutReferences",
278                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
279             Object returnObj = null;
280 
281             try {
282                 returnObj = 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                 throw new com.liferay.portal.SystemException(e);
290             }
291 
292             return (com.liferay.portal.model.LayoutReference[])returnObj;
293         }
294         catch (com.liferay.portal.SystemException se) {
295             _log.error(se, se);
296             throw se;
297         }
298     }
299 
300     public static byte[] exportLayouts(HttpPrincipal httpPrincipal,
301         long groupId, boolean privateLayout, java.util.Map parameterMap)
302         throws com.liferay.portal.SystemException, 
303             com.liferay.portal.PortalException {
304         try {
305             Object paramObj0 = new LongWrapper(groupId);
306             Object paramObj1 = new BooleanWrapper(privateLayout);
307             Object paramObj2 = parameterMap;
308 
309             if (parameterMap == null) {
310                 paramObj2 = new NullWrapper("java.util.Map");
311             }
312 
313             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
314                     "exportLayouts",
315                     new Object[] { paramObj0, paramObj1, paramObj2 });
316             Object returnObj = null;
317 
318             try {
319                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
320             }
321             catch (Exception e) {
322                 if (e instanceof com.liferay.portal.SystemException) {
323                     throw (com.liferay.portal.SystemException)e;
324                 }
325 
326                 if (e instanceof com.liferay.portal.PortalException) {
327                     throw (com.liferay.portal.PortalException)e;
328                 }
329 
330                 throw new com.liferay.portal.SystemException(e);
331             }
332 
333             return (byte[])returnObj;
334         }
335         catch (com.liferay.portal.SystemException se) {
336             _log.error(se, se);
337             throw se;
338         }
339     }
340 
341     public static void importLayouts(HttpPrincipal httpPrincipal, long groupId,
342         boolean privateLayout, java.util.Map parameterMap, java.io.File file)
343         throws com.liferay.portal.SystemException, 
344             com.liferay.portal.PortalException {
345         try {
346             Object paramObj0 = new LongWrapper(groupId);
347             Object paramObj1 = new BooleanWrapper(privateLayout);
348             Object paramObj2 = parameterMap;
349 
350             if (parameterMap == null) {
351                 paramObj2 = new NullWrapper("java.util.Map");
352             }
353 
354             Object paramObj3 = file;
355 
356             if (file == null) {
357                 paramObj3 = new NullWrapper("java.io.File");
358             }
359 
360             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
361                     "importLayouts",
362                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
363 
364             try {
365                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
366             }
367             catch (Exception e) {
368                 if (e instanceof com.liferay.portal.SystemException) {
369                     throw (com.liferay.portal.SystemException)e;
370                 }
371 
372                 if (e instanceof com.liferay.portal.PortalException) {
373                     throw (com.liferay.portal.PortalException)e;
374                 }
375 
376                 throw new com.liferay.portal.SystemException(e);
377             }
378         }
379         catch (com.liferay.portal.SystemException se) {
380             _log.error(se, se);
381             throw se;
382         }
383     }
384 
385     public static void setLayouts(HttpPrincipal httpPrincipal, long groupId,
386         boolean privateLayout, long parentLayoutId, long[] layoutIds)
387         throws com.liferay.portal.SystemException, 
388             com.liferay.portal.PortalException {
389         try {
390             Object paramObj0 = new LongWrapper(groupId);
391             Object paramObj1 = new BooleanWrapper(privateLayout);
392             Object paramObj2 = new LongWrapper(parentLayoutId);
393             Object paramObj3 = layoutIds;
394 
395             if (layoutIds == null) {
396                 paramObj3 = new NullWrapper("[J");
397             }
398 
399             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
400                     "setLayouts",
401                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
402 
403             try {
404                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
405             }
406             catch (Exception e) {
407                 if (e instanceof com.liferay.portal.SystemException) {
408                     throw (com.liferay.portal.SystemException)e;
409                 }
410 
411                 if (e instanceof com.liferay.portal.PortalException) {
412                     throw (com.liferay.portal.PortalException)e;
413                 }
414 
415                 throw new com.liferay.portal.SystemException(e);
416             }
417         }
418         catch (com.liferay.portal.SystemException se) {
419             _log.error(se, se);
420             throw se;
421         }
422     }
423 
424     public static com.liferay.portal.model.Layout updateLayout(
425         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
426         long layoutId, long parentLayoutId, java.lang.String name,
427         java.lang.String title, java.lang.String languageId,
428         java.lang.String description, java.lang.String type, boolean hidden,
429         java.lang.String friendlyURL)
430         throws com.liferay.portal.SystemException, 
431             com.liferay.portal.PortalException {
432         try {
433             Object paramObj0 = new LongWrapper(groupId);
434             Object paramObj1 = new BooleanWrapper(privateLayout);
435             Object paramObj2 = new LongWrapper(layoutId);
436             Object paramObj3 = new LongWrapper(parentLayoutId);
437             Object paramObj4 = name;
438 
439             if (name == null) {
440                 paramObj4 = new NullWrapper("java.lang.String");
441             }
442 
443             Object paramObj5 = title;
444 
445             if (title == null) {
446                 paramObj5 = new NullWrapper("java.lang.String");
447             }
448 
449             Object paramObj6 = languageId;
450 
451             if (languageId == null) {
452                 paramObj6 = new NullWrapper("java.lang.String");
453             }
454 
455             Object paramObj7 = description;
456 
457             if (description == null) {
458                 paramObj7 = new NullWrapper("java.lang.String");
459             }
460 
461             Object paramObj8 = type;
462 
463             if (type == null) {
464                 paramObj8 = new NullWrapper("java.lang.String");
465             }
466 
467             Object paramObj9 = new BooleanWrapper(hidden);
468             Object paramObj10 = friendlyURL;
469 
470             if (friendlyURL == null) {
471                 paramObj10 = new NullWrapper("java.lang.String");
472             }
473 
474             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
475                     "updateLayout",
476                     new Object[] {
477                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
478                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
479                         paramObj10
480                     });
481             Object returnObj = null;
482 
483             try {
484                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
485             }
486             catch (Exception e) {
487                 if (e instanceof com.liferay.portal.SystemException) {
488                     throw (com.liferay.portal.SystemException)e;
489                 }
490 
491                 if (e instanceof com.liferay.portal.PortalException) {
492                     throw (com.liferay.portal.PortalException)e;
493                 }
494 
495                 throw new com.liferay.portal.SystemException(e);
496             }
497 
498             return (com.liferay.portal.model.Layout)returnObj;
499         }
500         catch (com.liferay.portal.SystemException se) {
501             _log.error(se, se);
502             throw se;
503         }
504     }
505 
506     public static com.liferay.portal.model.Layout updateLayout(
507         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
508         long layoutId, long parentLayoutId, java.lang.String name,
509         java.lang.String title, java.lang.String languageId,
510         java.lang.String description, java.lang.String type, boolean hidden,
511         java.lang.String friendlyURL, java.lang.Boolean iconImage,
512         byte[] iconBytes)
513         throws com.liferay.portal.SystemException, 
514             com.liferay.portal.PortalException {
515         try {
516             Object paramObj0 = new LongWrapper(groupId);
517             Object paramObj1 = new BooleanWrapper(privateLayout);
518             Object paramObj2 = new LongWrapper(layoutId);
519             Object paramObj3 = new LongWrapper(parentLayoutId);
520             Object paramObj4 = name;
521 
522             if (name == null) {
523                 paramObj4 = new NullWrapper("java.lang.String");
524             }
525 
526             Object paramObj5 = title;
527 
528             if (title == null) {
529                 paramObj5 = new NullWrapper("java.lang.String");
530             }
531 
532             Object paramObj6 = languageId;
533 
534             if (languageId == null) {
535                 paramObj6 = new NullWrapper("java.lang.String");
536             }
537 
538             Object paramObj7 = description;
539 
540             if (description == null) {
541                 paramObj7 = new NullWrapper("java.lang.String");
542             }
543 
544             Object paramObj8 = type;
545 
546             if (type == null) {
547                 paramObj8 = new NullWrapper("java.lang.String");
548             }
549 
550             Object paramObj9 = new BooleanWrapper(hidden);
551             Object paramObj10 = friendlyURL;
552 
553             if (friendlyURL == null) {
554                 paramObj10 = new NullWrapper("java.lang.String");
555             }
556 
557             Object paramObj11 = iconImage;
558 
559             if (iconImage == null) {
560                 paramObj11 = new NullWrapper("java.lang.Boolean");
561             }
562 
563             Object paramObj12 = iconBytes;
564 
565             if (iconBytes == null) {
566                 paramObj12 = new NullWrapper("[B");
567             }
568 
569             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
570                     "updateLayout",
571                     new Object[] {
572                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
573                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
574                         paramObj10, paramObj11, paramObj12
575                     });
576             Object returnObj = null;
577 
578             try {
579                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
580             }
581             catch (Exception e) {
582                 if (e instanceof com.liferay.portal.SystemException) {
583                     throw (com.liferay.portal.SystemException)e;
584                 }
585 
586                 if (e instanceof com.liferay.portal.PortalException) {
587                     throw (com.liferay.portal.PortalException)e;
588                 }
589 
590                 throw new com.liferay.portal.SystemException(e);
591             }
592 
593             return (com.liferay.portal.model.Layout)returnObj;
594         }
595         catch (com.liferay.portal.SystemException se) {
596             _log.error(se, se);
597             throw se;
598         }
599     }
600 
601     public static com.liferay.portal.model.Layout updateLayout(
602         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
603         long layoutId, java.lang.String typeSettings)
604         throws com.liferay.portal.SystemException, 
605             com.liferay.portal.PortalException {
606         try {
607             Object paramObj0 = new LongWrapper(groupId);
608             Object paramObj1 = new BooleanWrapper(privateLayout);
609             Object paramObj2 = new LongWrapper(layoutId);
610             Object paramObj3 = typeSettings;
611 
612             if (typeSettings == null) {
613                 paramObj3 = new NullWrapper("java.lang.String");
614             }
615 
616             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
617                     "updateLayout",
618                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
619             Object returnObj = null;
620 
621             try {
622                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
623             }
624             catch (Exception e) {
625                 if (e instanceof com.liferay.portal.SystemException) {
626                     throw (com.liferay.portal.SystemException)e;
627                 }
628 
629                 if (e instanceof com.liferay.portal.PortalException) {
630                     throw (com.liferay.portal.PortalException)e;
631                 }
632 
633                 throw new com.liferay.portal.SystemException(e);
634             }
635 
636             return (com.liferay.portal.model.Layout)returnObj;
637         }
638         catch (com.liferay.portal.SystemException se) {
639             _log.error(se, se);
640             throw se;
641         }
642     }
643 
644     public static com.liferay.portal.model.Layout updateLookAndFeel(
645         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
646         long layoutId, java.lang.String themeId,
647         java.lang.String colorSchemeId, java.lang.String css, boolean wapTheme)
648         throws com.liferay.portal.SystemException, 
649             com.liferay.portal.PortalException {
650         try {
651             Object paramObj0 = new LongWrapper(groupId);
652             Object paramObj1 = new BooleanWrapper(privateLayout);
653             Object paramObj2 = new LongWrapper(layoutId);
654             Object paramObj3 = themeId;
655 
656             if (themeId == null) {
657                 paramObj3 = new NullWrapper("java.lang.String");
658             }
659 
660             Object paramObj4 = colorSchemeId;
661 
662             if (colorSchemeId == null) {
663                 paramObj4 = new NullWrapper("java.lang.String");
664             }
665 
666             Object paramObj5 = css;
667 
668             if (css == null) {
669                 paramObj5 = new NullWrapper("java.lang.String");
670             }
671 
672             Object paramObj6 = new BooleanWrapper(wapTheme);
673             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
674                     "updateLookAndFeel",
675                     new Object[] {
676                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
677                         paramObj5, paramObj6
678                     });
679             Object returnObj = null;
680 
681             try {
682                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
683             }
684             catch (Exception e) {
685                 if (e instanceof com.liferay.portal.SystemException) {
686                     throw (com.liferay.portal.SystemException)e;
687                 }
688 
689                 if (e instanceof com.liferay.portal.PortalException) {
690                     throw (com.liferay.portal.PortalException)e;
691                 }
692 
693                 throw new com.liferay.portal.SystemException(e);
694             }
695 
696             return (com.liferay.portal.model.Layout)returnObj;
697         }
698         catch (com.liferay.portal.SystemException se) {
699             _log.error(se, se);
700             throw se;
701         }
702     }
703 
704     public static com.liferay.portal.model.Layout updateName(
705         HttpPrincipal httpPrincipal, long plid, java.lang.String name,
706         java.lang.String languageId)
707         throws com.liferay.portal.SystemException, 
708             com.liferay.portal.PortalException {
709         try {
710             Object paramObj0 = new LongWrapper(plid);
711             Object paramObj1 = name;
712 
713             if (name == null) {
714                 paramObj1 = new NullWrapper("java.lang.String");
715             }
716 
717             Object paramObj2 = languageId;
718 
719             if (languageId == null) {
720                 paramObj2 = new NullWrapper("java.lang.String");
721             }
722 
723             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
724                     "updateName",
725                     new Object[] { paramObj0, paramObj1, paramObj2 });
726             Object returnObj = null;
727 
728             try {
729                 returnObj = 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             return (com.liferay.portal.model.Layout)returnObj;
744         }
745         catch (com.liferay.portal.SystemException se) {
746             _log.error(se, se);
747             throw se;
748         }
749     }
750 
751     public static com.liferay.portal.model.Layout updateName(
752         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
753         long layoutId, java.lang.String name, java.lang.String languageId)
754         throws com.liferay.portal.SystemException, 
755             com.liferay.portal.PortalException {
756         try {
757             Object paramObj0 = new LongWrapper(groupId);
758             Object paramObj1 = new BooleanWrapper(privateLayout);
759             Object paramObj2 = new LongWrapper(layoutId);
760             Object paramObj3 = name;
761 
762             if (name == null) {
763                 paramObj3 = new NullWrapper("java.lang.String");
764             }
765 
766             Object paramObj4 = languageId;
767 
768             if (languageId == null) {
769                 paramObj4 = new NullWrapper("java.lang.String");
770             }
771 
772             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
773                     "updateName",
774                     new Object[] {
775                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
776                     });
777             Object returnObj = null;
778 
779             try {
780                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
781             }
782             catch (Exception e) {
783                 if (e instanceof com.liferay.portal.SystemException) {
784                     throw (com.liferay.portal.SystemException)e;
785                 }
786 
787                 if (e instanceof com.liferay.portal.PortalException) {
788                     throw (com.liferay.portal.PortalException)e;
789                 }
790 
791                 throw new com.liferay.portal.SystemException(e);
792             }
793 
794             return (com.liferay.portal.model.Layout)returnObj;
795         }
796         catch (com.liferay.portal.SystemException se) {
797             _log.error(se, se);
798             throw se;
799         }
800     }
801 
802     public static com.liferay.portal.model.Layout updateParentLayoutId(
803         HttpPrincipal httpPrincipal, long plid, long parentPlid)
804         throws com.liferay.portal.SystemException, 
805             com.liferay.portal.PortalException {
806         try {
807             Object paramObj0 = new LongWrapper(plid);
808             Object paramObj1 = new LongWrapper(parentPlid);
809             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
810                     "updateParentLayoutId",
811                     new Object[] { paramObj0, paramObj1 });
812             Object returnObj = null;
813 
814             try {
815                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
816             }
817             catch (Exception e) {
818                 if (e instanceof com.liferay.portal.SystemException) {
819                     throw (com.liferay.portal.SystemException)e;
820                 }
821 
822                 if (e instanceof com.liferay.portal.PortalException) {
823                     throw (com.liferay.portal.PortalException)e;
824                 }
825 
826                 throw new com.liferay.portal.SystemException(e);
827             }
828 
829             return (com.liferay.portal.model.Layout)returnObj;
830         }
831         catch (com.liferay.portal.SystemException se) {
832             _log.error(se, se);
833             throw se;
834         }
835     }
836 
837     public static com.liferay.portal.model.Layout updateParentLayoutId(
838         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
839         long layoutId, long parentLayoutId)
840         throws com.liferay.portal.SystemException, 
841             com.liferay.portal.PortalException {
842         try {
843             Object paramObj0 = new LongWrapper(groupId);
844             Object paramObj1 = new BooleanWrapper(privateLayout);
845             Object paramObj2 = new LongWrapper(layoutId);
846             Object paramObj3 = new LongWrapper(parentLayoutId);
847             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
848                     "updateParentLayoutId",
849                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
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             throw se;
872         }
873     }
874 
875     public static com.liferay.portal.model.Layout updatePriority(
876         HttpPrincipal httpPrincipal, long plid, int priority)
877         throws com.liferay.portal.SystemException, 
878             com.liferay.portal.PortalException {
879         try {
880             Object paramObj0 = new LongWrapper(plid);
881             Object paramObj1 = new IntegerWrapper(priority);
882             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
883                     "updatePriority", new Object[] { paramObj0, paramObj1 });
884             Object returnObj = null;
885 
886             try {
887                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
888             }
889             catch (Exception e) {
890                 if (e instanceof com.liferay.portal.SystemException) {
891                     throw (com.liferay.portal.SystemException)e;
892                 }
893 
894                 if (e instanceof com.liferay.portal.PortalException) {
895                     throw (com.liferay.portal.PortalException)e;
896                 }
897 
898                 throw new com.liferay.portal.SystemException(e);
899             }
900 
901             return (com.liferay.portal.model.Layout)returnObj;
902         }
903         catch (com.liferay.portal.SystemException se) {
904             _log.error(se, se);
905             throw se;
906         }
907     }
908 
909     public static com.liferay.portal.model.Layout updatePriority(
910         HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
911         long layoutId, int priority)
912         throws com.liferay.portal.SystemException, 
913             com.liferay.portal.PortalException {
914         try {
915             Object paramObj0 = new LongWrapper(groupId);
916             Object paramObj1 = new BooleanWrapper(privateLayout);
917             Object paramObj2 = new LongWrapper(layoutId);
918             Object paramObj3 = new IntegerWrapper(priority);
919             MethodWrapper methodWrapper = new MethodWrapper(LayoutServiceUtil.class.getName(),
920                     "updatePriority",
921                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
922             Object returnObj = null;
923 
924             try {
925                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
926             }
927             catch (Exception e) {
928                 if (e instanceof com.liferay.portal.SystemException) {
929                     throw (com.liferay.portal.SystemException)e;
930                 }
931 
932                 if (e instanceof com.liferay.portal.PortalException) {
933                     throw (com.liferay.portal.PortalException)e;
934                 }
935 
936                 throw new com.liferay.portal.SystemException(e);
937             }
938 
939             return (com.liferay.portal.model.Layout)returnObj;
940         }
941         catch (com.liferay.portal.SystemException se) {
942             _log.error(se, se);
943             throw se;
944         }
945     }
946 
947     private static Log _log = LogFactoryUtil.getLog(LayoutServiceHttp.class);
948 }