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