1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.http;
21  
22  import com.liferay.portal.kernel.log.Log;
23  import com.liferay.portal.kernel.log.LogFactoryUtil;
24  import com.liferay.portal.kernel.util.BooleanWrapper;
25  import com.liferay.portal.kernel.util.IntegerWrapper;
26  import com.liferay.portal.kernel.util.LongWrapper;
27  import com.liferay.portal.kernel.util.MethodWrapper;
28  import com.liferay.portal.kernel.util.NullWrapper;
29  import com.liferay.portal.security.auth.HttpPrincipal;
30  import com.liferay.portal.service.GroupServiceUtil;
31  
32  /**
33   * <a href="GroupServiceHttp.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * <p>
41   * This class provides a HTTP utility for the
42   * <code>com.liferay.portal.service.GroupServiceUtil</code> service
43   * utility. The static methods of this class calls the same methods of the
44   * service utility. However, the signatures are different because it requires an
45   * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
46   * parameter.
47   * </p>
48   *
49   * <p>
50   * The benefits of using the HTTP utility is that it is fast and allows for
51   * tunneling without the cost of serializing to text. The drawback is that it
52   * only works with Java.
53   * </p>
54   *
55   * <p>
56   * Set the property <code>tunnel.servlet.hosts.allowed</code> in
57   * portal.properties to configure security.
58   * </p>
59   *
60   * <p>
61   * The HTTP utility is only generated for remote services.
62   * </p>
63   *
64   * @author Brian Wing Shun Chan
65   *
66   * @see com.liferay.portal.security.auth.HttpPrincipal
67   * @see com.liferay.portal.service.GroupServiceUtil
68   * @see com.liferay.portal.service.http.GroupServiceSoap
69   *
70   */
71  public class GroupServiceHttp {
72      public static com.liferay.portal.model.Group addGroup(
73          HttpPrincipal httpPrincipal, java.lang.String name,
74          java.lang.String description, int type, java.lang.String friendlyURL,
75          boolean active)
76          throws com.liferay.portal.PortalException,
77              com.liferay.portal.SystemException {
78          try {
79              Object paramObj0 = name;
80  
81              if (name == null) {
82                  paramObj0 = new NullWrapper("java.lang.String");
83              }
84  
85              Object paramObj1 = description;
86  
87              if (description == null) {
88                  paramObj1 = new NullWrapper("java.lang.String");
89              }
90  
91              Object paramObj2 = new IntegerWrapper(type);
92  
93              Object paramObj3 = friendlyURL;
94  
95              if (friendlyURL == null) {
96                  paramObj3 = new NullWrapper("java.lang.String");
97              }
98  
99              Object paramObj4 = new BooleanWrapper(active);
100 
101             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
102                     "addGroup",
103                     new Object[] {
104                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
105                     });
106 
107             Object returnObj = null;
108 
109             try {
110                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
111             }
112             catch (Exception e) {
113                 if (e instanceof com.liferay.portal.PortalException) {
114                     throw (com.liferay.portal.PortalException)e;
115                 }
116 
117                 if (e instanceof com.liferay.portal.SystemException) {
118                     throw (com.liferay.portal.SystemException)e;
119                 }
120 
121                 throw new com.liferay.portal.SystemException(e);
122             }
123 
124             return (com.liferay.portal.model.Group)returnObj;
125         }
126         catch (com.liferay.portal.SystemException se) {
127             _log.error(se, se);
128 
129             throw se;
130         }
131     }
132 
133     public static com.liferay.portal.model.Group addGroup(
134         HttpPrincipal httpPrincipal, long liveGroupId, java.lang.String name,
135         java.lang.String description, int type, java.lang.String friendlyURL,
136         boolean active)
137         throws com.liferay.portal.PortalException,
138             com.liferay.portal.SystemException {
139         try {
140             Object paramObj0 = new LongWrapper(liveGroupId);
141 
142             Object paramObj1 = name;
143 
144             if (name == null) {
145                 paramObj1 = new NullWrapper("java.lang.String");
146             }
147 
148             Object paramObj2 = description;
149 
150             if (description == null) {
151                 paramObj2 = new NullWrapper("java.lang.String");
152             }
153 
154             Object paramObj3 = new IntegerWrapper(type);
155 
156             Object paramObj4 = friendlyURL;
157 
158             if (friendlyURL == null) {
159                 paramObj4 = new NullWrapper("java.lang.String");
160             }
161 
162             Object paramObj5 = new BooleanWrapper(active);
163 
164             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
165                     "addGroup",
166                     new Object[] {
167                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
168                         paramObj5
169                     });
170 
171             Object returnObj = null;
172 
173             try {
174                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
175             }
176             catch (Exception e) {
177                 if (e instanceof com.liferay.portal.PortalException) {
178                     throw (com.liferay.portal.PortalException)e;
179                 }
180 
181                 if (e instanceof com.liferay.portal.SystemException) {
182                     throw (com.liferay.portal.SystemException)e;
183                 }
184 
185                 throw new com.liferay.portal.SystemException(e);
186             }
187 
188             return (com.liferay.portal.model.Group)returnObj;
189         }
190         catch (com.liferay.portal.SystemException se) {
191             _log.error(se, se);
192 
193             throw se;
194         }
195     }
196 
197     public static void addRoleGroups(HttpPrincipal httpPrincipal, long roleId,
198         long[] groupIds)
199         throws com.liferay.portal.PortalException,
200             com.liferay.portal.SystemException {
201         try {
202             Object paramObj0 = new LongWrapper(roleId);
203 
204             Object paramObj1 = groupIds;
205 
206             if (groupIds == null) {
207                 paramObj1 = new NullWrapper("[J");
208             }
209 
210             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
211                     "addRoleGroups", new Object[] { paramObj0, paramObj1 });
212 
213             try {
214                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
215             }
216             catch (Exception e) {
217                 if (e instanceof com.liferay.portal.PortalException) {
218                     throw (com.liferay.portal.PortalException)e;
219                 }
220 
221                 if (e instanceof com.liferay.portal.SystemException) {
222                     throw (com.liferay.portal.SystemException)e;
223                 }
224 
225                 throw new com.liferay.portal.SystemException(e);
226             }
227         }
228         catch (com.liferay.portal.SystemException se) {
229             _log.error(se, se);
230 
231             throw se;
232         }
233     }
234 
235     public static void deleteGroup(HttpPrincipal httpPrincipal, long groupId)
236         throws com.liferay.portal.PortalException,
237             com.liferay.portal.SystemException {
238         try {
239             Object paramObj0 = new LongWrapper(groupId);
240 
241             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
242                     "deleteGroup", new Object[] { paramObj0 });
243 
244             try {
245                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
246             }
247             catch (Exception e) {
248                 if (e instanceof com.liferay.portal.PortalException) {
249                     throw (com.liferay.portal.PortalException)e;
250                 }
251 
252                 if (e instanceof com.liferay.portal.SystemException) {
253                     throw (com.liferay.portal.SystemException)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 com.liferay.portal.model.Group getGroup(
267         HttpPrincipal httpPrincipal, long groupId)
268         throws com.liferay.portal.PortalException,
269             com.liferay.portal.SystemException {
270         try {
271             Object paramObj0 = new LongWrapper(groupId);
272 
273             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
274                     "getGroup", new Object[] { paramObj0 });
275 
276             Object returnObj = null;
277 
278             try {
279                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
280             }
281             catch (Exception e) {
282                 if (e instanceof com.liferay.portal.PortalException) {
283                     throw (com.liferay.portal.PortalException)e;
284                 }
285 
286                 if (e instanceof com.liferay.portal.SystemException) {
287                     throw (com.liferay.portal.SystemException)e;
288                 }
289 
290                 throw new com.liferay.portal.SystemException(e);
291             }
292 
293             return (com.liferay.portal.model.Group)returnObj;
294         }
295         catch (com.liferay.portal.SystemException se) {
296             _log.error(se, se);
297 
298             throw se;
299         }
300     }
301 
302     public static com.liferay.portal.model.Group getGroup(
303         HttpPrincipal httpPrincipal, long companyId, java.lang.String name)
304         throws com.liferay.portal.PortalException,
305             com.liferay.portal.SystemException {
306         try {
307             Object paramObj0 = new LongWrapper(companyId);
308 
309             Object paramObj1 = name;
310 
311             if (name == null) {
312                 paramObj1 = new NullWrapper("java.lang.String");
313             }
314 
315             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
316                     "getGroup", new Object[] { paramObj0, paramObj1 });
317 
318             Object returnObj = null;
319 
320             try {
321                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
322             }
323             catch (Exception e) {
324                 if (e instanceof com.liferay.portal.PortalException) {
325                     throw (com.liferay.portal.PortalException)e;
326                 }
327 
328                 if (e instanceof com.liferay.portal.SystemException) {
329                     throw (com.liferay.portal.SystemException)e;
330                 }
331 
332                 throw new com.liferay.portal.SystemException(e);
333             }
334 
335             return (com.liferay.portal.model.Group)returnObj;
336         }
337         catch (com.liferay.portal.SystemException se) {
338             _log.error(se, se);
339 
340             throw se;
341         }
342     }
343 
344     public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
345         HttpPrincipal httpPrincipal,
346         java.util.List<com.liferay.portal.model.Organization> organizations)
347         throws com.liferay.portal.SystemException {
348         try {
349             Object paramObj0 = organizations;
350 
351             if (organizations == null) {
352                 paramObj0 = new NullWrapper("java.util.List");
353             }
354 
355             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
356                     "getOrganizationsGroups", new Object[] { paramObj0 });
357 
358             Object returnObj = null;
359 
360             try {
361                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
362             }
363             catch (Exception e) {
364                 throw new com.liferay.portal.SystemException(e);
365             }
366 
367             return (java.util.List<com.liferay.portal.model.Group>)returnObj;
368         }
369         catch (com.liferay.portal.SystemException se) {
370             _log.error(se, se);
371 
372             throw se;
373         }
374     }
375 
376     public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
377         HttpPrincipal httpPrincipal,
378         java.util.List<com.liferay.portal.model.UserGroup> userGroups)
379         throws com.liferay.portal.SystemException {
380         try {
381             Object paramObj0 = userGroups;
382 
383             if (userGroups == null) {
384                 paramObj0 = new NullWrapper("java.util.List");
385             }
386 
387             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
388                     "getUserGroupsGroups", new Object[] { paramObj0 });
389 
390             Object returnObj = null;
391 
392             try {
393                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
394             }
395             catch (Exception e) {
396                 throw new com.liferay.portal.SystemException(e);
397             }
398 
399             return (java.util.List<com.liferay.portal.model.Group>)returnObj;
400         }
401         catch (com.liferay.portal.SystemException se) {
402             _log.error(se, se);
403 
404             throw se;
405         }
406     }
407 
408     public static boolean hasUserGroup(HttpPrincipal httpPrincipal,
409         long userId, long groupId) throws com.liferay.portal.SystemException {
410         try {
411             Object paramObj0 = new LongWrapper(userId);
412 
413             Object paramObj1 = new LongWrapper(groupId);
414 
415             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
416                     "hasUserGroup", new Object[] { paramObj0, paramObj1 });
417 
418             Object returnObj = null;
419 
420             try {
421                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
422             }
423             catch (Exception e) {
424                 if (e instanceof com.liferay.portal.SystemException) {
425                     throw (com.liferay.portal.SystemException)e;
426                 }
427 
428                 throw new com.liferay.portal.SystemException(e);
429             }
430 
431             return ((Boolean)returnObj).booleanValue();
432         }
433         catch (com.liferay.portal.SystemException se) {
434             _log.error(se, se);
435 
436             throw se;
437         }
438     }
439 
440     public static java.util.List<com.liferay.portal.model.Group> search(
441         HttpPrincipal httpPrincipal, long companyId, java.lang.String name,
442         java.lang.String description, java.lang.String[] params, int start,
443         int end) throws com.liferay.portal.SystemException {
444         try {
445             Object paramObj0 = new LongWrapper(companyId);
446 
447             Object paramObj1 = name;
448 
449             if (name == null) {
450                 paramObj1 = new NullWrapper("java.lang.String");
451             }
452 
453             Object paramObj2 = description;
454 
455             if (description == null) {
456                 paramObj2 = new NullWrapper("java.lang.String");
457             }
458 
459             Object paramObj3 = params;
460 
461             if (params == null) {
462                 paramObj3 = new NullWrapper("[Ljava.lang.String;");
463             }
464 
465             Object paramObj4 = new IntegerWrapper(start);
466 
467             Object paramObj5 = new IntegerWrapper(end);
468 
469             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
470                     "search",
471                     new Object[] {
472                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
473                         paramObj5
474                     });
475 
476             Object returnObj = null;
477 
478             try {
479                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
480             }
481             catch (Exception e) {
482                 if (e instanceof com.liferay.portal.SystemException) {
483                     throw (com.liferay.portal.SystemException)e;
484                 }
485 
486                 throw new com.liferay.portal.SystemException(e);
487             }
488 
489             return (java.util.List<com.liferay.portal.model.Group>)returnObj;
490         }
491         catch (com.liferay.portal.SystemException se) {
492             _log.error(se, se);
493 
494             throw se;
495         }
496     }
497 
498     public static int searchCount(HttpPrincipal httpPrincipal, long companyId,
499         java.lang.String name, java.lang.String description,
500         java.lang.String[] params) throws com.liferay.portal.SystemException {
501         try {
502             Object paramObj0 = new LongWrapper(companyId);
503 
504             Object paramObj1 = name;
505 
506             if (name == null) {
507                 paramObj1 = new NullWrapper("java.lang.String");
508             }
509 
510             Object paramObj2 = description;
511 
512             if (description == null) {
513                 paramObj2 = new NullWrapper("java.lang.String");
514             }
515 
516             Object paramObj3 = params;
517 
518             if (params == null) {
519                 paramObj3 = new NullWrapper("[Ljava.lang.String;");
520             }
521 
522             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
523                     "searchCount",
524                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
525 
526             Object returnObj = null;
527 
528             try {
529                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
530             }
531             catch (Exception e) {
532                 if (e instanceof com.liferay.portal.SystemException) {
533                     throw (com.liferay.portal.SystemException)e;
534                 }
535 
536                 throw new com.liferay.portal.SystemException(e);
537             }
538 
539             return ((Integer)returnObj).intValue();
540         }
541         catch (com.liferay.portal.SystemException se) {
542             _log.error(se, se);
543 
544             throw se;
545         }
546     }
547 
548     public static void setRoleGroups(HttpPrincipal httpPrincipal, long roleId,
549         long[] groupIds)
550         throws com.liferay.portal.PortalException,
551             com.liferay.portal.SystemException {
552         try {
553             Object paramObj0 = new LongWrapper(roleId);
554 
555             Object paramObj1 = groupIds;
556 
557             if (groupIds == null) {
558                 paramObj1 = new NullWrapper("[J");
559             }
560 
561             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
562                     "setRoleGroups", new Object[] { paramObj0, paramObj1 });
563 
564             try {
565                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
566             }
567             catch (Exception e) {
568                 if (e instanceof com.liferay.portal.PortalException) {
569                     throw (com.liferay.portal.PortalException)e;
570                 }
571 
572                 if (e instanceof com.liferay.portal.SystemException) {
573                     throw (com.liferay.portal.SystemException)e;
574                 }
575 
576                 throw new com.liferay.portal.SystemException(e);
577             }
578         }
579         catch (com.liferay.portal.SystemException se) {
580             _log.error(se, se);
581 
582             throw se;
583         }
584     }
585 
586     public static void unsetRoleGroups(HttpPrincipal httpPrincipal,
587         long roleId, long[] groupIds)
588         throws com.liferay.portal.PortalException,
589             com.liferay.portal.SystemException {
590         try {
591             Object paramObj0 = new LongWrapper(roleId);
592 
593             Object paramObj1 = groupIds;
594 
595             if (groupIds == null) {
596                 paramObj1 = new NullWrapper("[J");
597             }
598 
599             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
600                     "unsetRoleGroups", new Object[] { paramObj0, paramObj1 });
601 
602             try {
603                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
604             }
605             catch (Exception e) {
606                 if (e instanceof com.liferay.portal.PortalException) {
607                     throw (com.liferay.portal.PortalException)e;
608                 }
609 
610                 if (e instanceof com.liferay.portal.SystemException) {
611                     throw (com.liferay.portal.SystemException)e;
612                 }
613 
614                 throw new com.liferay.portal.SystemException(e);
615             }
616         }
617         catch (com.liferay.portal.SystemException se) {
618             _log.error(se, se);
619 
620             throw se;
621         }
622     }
623 
624     public static com.liferay.portal.model.Group updateFriendlyURL(
625         HttpPrincipal httpPrincipal, long groupId, java.lang.String friendlyURL)
626         throws com.liferay.portal.PortalException,
627             com.liferay.portal.SystemException {
628         try {
629             Object paramObj0 = new LongWrapper(groupId);
630 
631             Object paramObj1 = friendlyURL;
632 
633             if (friendlyURL == null) {
634                 paramObj1 = new NullWrapper("java.lang.String");
635             }
636 
637             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
638                     "updateFriendlyURL", new Object[] { paramObj0, paramObj1 });
639 
640             Object returnObj = null;
641 
642             try {
643                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
644             }
645             catch (Exception e) {
646                 if (e instanceof com.liferay.portal.PortalException) {
647                     throw (com.liferay.portal.PortalException)e;
648                 }
649 
650                 if (e instanceof com.liferay.portal.SystemException) {
651                     throw (com.liferay.portal.SystemException)e;
652                 }
653 
654                 throw new com.liferay.portal.SystemException(e);
655             }
656 
657             return (com.liferay.portal.model.Group)returnObj;
658         }
659         catch (com.liferay.portal.SystemException se) {
660             _log.error(se, se);
661 
662             throw se;
663         }
664     }
665 
666     public static com.liferay.portal.model.Group updateGroup(
667         HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
668         java.lang.String description, int type, java.lang.String friendlyURL,
669         boolean active)
670         throws com.liferay.portal.PortalException,
671             com.liferay.portal.SystemException {
672         try {
673             Object paramObj0 = new LongWrapper(groupId);
674 
675             Object paramObj1 = name;
676 
677             if (name == null) {
678                 paramObj1 = new NullWrapper("java.lang.String");
679             }
680 
681             Object paramObj2 = description;
682 
683             if (description == null) {
684                 paramObj2 = new NullWrapper("java.lang.String");
685             }
686 
687             Object paramObj3 = new IntegerWrapper(type);
688 
689             Object paramObj4 = friendlyURL;
690 
691             if (friendlyURL == null) {
692                 paramObj4 = new NullWrapper("java.lang.String");
693             }
694 
695             Object paramObj5 = new BooleanWrapper(active);
696 
697             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
698                     "updateGroup",
699                     new Object[] {
700                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
701                         paramObj5
702                     });
703 
704             Object returnObj = null;
705 
706             try {
707                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
708             }
709             catch (Exception e) {
710                 if (e instanceof com.liferay.portal.PortalException) {
711                     throw (com.liferay.portal.PortalException)e;
712                 }
713 
714                 if (e instanceof com.liferay.portal.SystemException) {
715                     throw (com.liferay.portal.SystemException)e;
716                 }
717 
718                 throw new com.liferay.portal.SystemException(e);
719             }
720 
721             return (com.liferay.portal.model.Group)returnObj;
722         }
723         catch (com.liferay.portal.SystemException se) {
724             _log.error(se, se);
725 
726             throw se;
727         }
728     }
729 
730     public static com.liferay.portal.model.Group updateGroup(
731         HttpPrincipal httpPrincipal, long groupId, java.lang.String typeSettings)
732         throws com.liferay.portal.PortalException,
733             com.liferay.portal.SystemException {
734         try {
735             Object paramObj0 = new LongWrapper(groupId);
736 
737             Object paramObj1 = typeSettings;
738 
739             if (typeSettings == null) {
740                 paramObj1 = new NullWrapper("java.lang.String");
741             }
742 
743             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
744                     "updateGroup", new Object[] { paramObj0, paramObj1 });
745 
746             Object returnObj = null;
747 
748             try {
749                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
750             }
751             catch (Exception e) {
752                 if (e instanceof com.liferay.portal.PortalException) {
753                     throw (com.liferay.portal.PortalException)e;
754                 }
755 
756                 if (e instanceof com.liferay.portal.SystemException) {
757                     throw (com.liferay.portal.SystemException)e;
758                 }
759 
760                 throw new com.liferay.portal.SystemException(e);
761             }
762 
763             return (com.liferay.portal.model.Group)returnObj;
764         }
765         catch (com.liferay.portal.SystemException se) {
766             _log.error(se, se);
767 
768             throw se;
769         }
770     }
771 
772     public static com.liferay.portal.model.Group updateWorkflow(
773         HttpPrincipal httpPrincipal, long groupId, boolean workflowEnabled,
774         int workflowStages, java.lang.String workflowRoleNames)
775         throws com.liferay.portal.PortalException,
776             com.liferay.portal.SystemException {
777         try {
778             Object paramObj0 = new LongWrapper(groupId);
779 
780             Object paramObj1 = new BooleanWrapper(workflowEnabled);
781 
782             Object paramObj2 = new IntegerWrapper(workflowStages);
783 
784             Object paramObj3 = workflowRoleNames;
785 
786             if (workflowRoleNames == null) {
787                 paramObj3 = new NullWrapper("java.lang.String");
788             }
789 
790             MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
791                     "updateWorkflow",
792                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
793 
794             Object returnObj = null;
795 
796             try {
797                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
798             }
799             catch (Exception e) {
800                 if (e instanceof com.liferay.portal.PortalException) {
801                     throw (com.liferay.portal.PortalException)e;
802                 }
803 
804                 if (e instanceof com.liferay.portal.SystemException) {
805                     throw (com.liferay.portal.SystemException)e;
806                 }
807 
808                 throw new com.liferay.portal.SystemException(e);
809             }
810 
811             return (com.liferay.portal.model.Group)returnObj;
812         }
813         catch (com.liferay.portal.SystemException se) {
814             _log.error(se, se);
815 
816             throw se;
817         }
818     }
819 
820     private static Log _log = LogFactoryUtil.getLog(GroupServiceHttp.class);
821 }