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