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