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
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.SystemException,
80 com.liferay.portal.PortalException {
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.SystemException) {
117 throw (com.liferay.portal.SystemException)e;
118 }
119
120 if (e instanceof com.liferay.portal.PortalException) {
121 throw (com.liferay.portal.PortalException)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.SystemException,
141 com.liferay.portal.PortalException {
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.SystemException) {
181 throw (com.liferay.portal.SystemException)e;
182 }
183
184 if (e instanceof com.liferay.portal.PortalException) {
185 throw (com.liferay.portal.PortalException)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.SystemException,
203 com.liferay.portal.PortalException {
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.SystemException) {
221 throw (com.liferay.portal.SystemException)e;
222 }
223
224 if (e instanceof com.liferay.portal.PortalException) {
225 throw (com.liferay.portal.PortalException)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.SystemException,
240 com.liferay.portal.PortalException {
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.SystemException) {
252 throw (com.liferay.portal.SystemException)e;
253 }
254
255 if (e instanceof com.liferay.portal.PortalException) {
256 throw (com.liferay.portal.PortalException)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.SystemException,
272 com.liferay.portal.PortalException {
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.SystemException) {
286 throw (com.liferay.portal.SystemException)e;
287 }
288
289 if (e instanceof com.liferay.portal.PortalException) {
290 throw (com.liferay.portal.PortalException)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.SystemException,
308 com.liferay.portal.PortalException {
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.SystemException) {
328 throw (com.liferay.portal.SystemException)e;
329 }
330
331 if (e instanceof com.liferay.portal.PortalException) {
332 throw (com.liferay.portal.PortalException)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> getOrganizationsGroups(
348 HttpPrincipal httpPrincipal,
349 java.util.List<com.liferay.portal.model.Organization> organizations)
350 throws com.liferay.portal.SystemException,
351 com.liferay.portal.PortalException {
352 try {
353 Object paramObj0 = organizations;
354
355 if (organizations == null) {
356 paramObj0 = new NullWrapper("java.util.List");
357 }
358
359 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
360 "getOrganizationsGroups", new Object[] { paramObj0 });
361
362 Object returnObj = null;
363
364 try {
365 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
366 }
367 catch (Exception e) {
368 if (e instanceof com.liferay.portal.SystemException) {
369 throw (com.liferay.portal.SystemException)e;
370 }
371
372 if (e instanceof com.liferay.portal.PortalException) {
373 throw (com.liferay.portal.PortalException)e;
374 }
375
376 throw new com.liferay.portal.SystemException(e);
377 }
378
379 return (java.util.List<com.liferay.portal.model.Group>)returnObj;
380 }
381 catch (com.liferay.portal.SystemException se) {
382 _log.error(se, se);
383
384 throw se;
385 }
386 }
387
388 public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
389 HttpPrincipal httpPrincipal,
390 java.util.List<com.liferay.portal.model.UserGroup> userGroups)
391 throws com.liferay.portal.SystemException,
392 com.liferay.portal.PortalException {
393 try {
394 Object paramObj0 = userGroups;
395
396 if (userGroups == null) {
397 paramObj0 = new NullWrapper("java.util.List");
398 }
399
400 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
401 "getUserGroupsGroups", new Object[] { paramObj0 });
402
403 Object returnObj = null;
404
405 try {
406 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
407 }
408 catch (Exception e) {
409 if (e instanceof com.liferay.portal.SystemException) {
410 throw (com.liferay.portal.SystemException)e;
411 }
412
413 if (e instanceof com.liferay.portal.PortalException) {
414 throw (com.liferay.portal.PortalException)e;
415 }
416
417 throw new com.liferay.portal.SystemException(e);
418 }
419
420 return (java.util.List<com.liferay.portal.model.Group>)returnObj;
421 }
422 catch (com.liferay.portal.SystemException se) {
423 _log.error(se, se);
424
425 throw se;
426 }
427 }
428
429 public static boolean hasUserGroup(HttpPrincipal httpPrincipal,
430 long userId, long groupId) throws com.liferay.portal.SystemException {
431 try {
432 Object paramObj0 = new LongWrapper(userId);
433
434 Object paramObj1 = new LongWrapper(groupId);
435
436 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
437 "hasUserGroup", new Object[] { paramObj0, paramObj1 });
438
439 Object returnObj = null;
440
441 try {
442 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
443 }
444 catch (Exception e) {
445 if (e instanceof com.liferay.portal.SystemException) {
446 throw (com.liferay.portal.SystemException)e;
447 }
448
449 throw new com.liferay.portal.SystemException(e);
450 }
451
452 return ((Boolean)returnObj).booleanValue();
453 }
454 catch (com.liferay.portal.SystemException se) {
455 _log.error(se, se);
456
457 throw se;
458 }
459 }
460
461 public static java.util.List<com.liferay.portal.model.Group> search(
462 HttpPrincipal httpPrincipal, long companyId, java.lang.String name,
463 java.lang.String description, java.lang.String[] params, int begin,
464 int end) throws com.liferay.portal.SystemException {
465 try {
466 Object paramObj0 = new LongWrapper(companyId);
467
468 Object paramObj1 = name;
469
470 if (name == null) {
471 paramObj1 = new NullWrapper("java.lang.String");
472 }
473
474 Object paramObj2 = description;
475
476 if (description == null) {
477 paramObj2 = new NullWrapper("java.lang.String");
478 }
479
480 Object paramObj3 = params;
481
482 if (params == null) {
483 paramObj3 = new NullWrapper("[Ljava.lang.String;");
484 }
485
486 Object paramObj4 = new IntegerWrapper(begin);
487
488 Object paramObj5 = new IntegerWrapper(end);
489
490 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
491 "search",
492 new Object[] {
493 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
494 paramObj5
495 });
496
497 Object returnObj = null;
498
499 try {
500 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
501 }
502 catch (Exception e) {
503 if (e instanceof com.liferay.portal.SystemException) {
504 throw (com.liferay.portal.SystemException)e;
505 }
506
507 throw new com.liferay.portal.SystemException(e);
508 }
509
510 return (java.util.List<com.liferay.portal.model.Group>)returnObj;
511 }
512 catch (com.liferay.portal.SystemException se) {
513 _log.error(se, se);
514
515 throw se;
516 }
517 }
518
519 public static int searchCount(HttpPrincipal httpPrincipal, long companyId,
520 java.lang.String name, java.lang.String description,
521 java.lang.String[] params) throws com.liferay.portal.SystemException {
522 try {
523 Object paramObj0 = new LongWrapper(companyId);
524
525 Object paramObj1 = name;
526
527 if (name == null) {
528 paramObj1 = new NullWrapper("java.lang.String");
529 }
530
531 Object paramObj2 = description;
532
533 if (description == null) {
534 paramObj2 = new NullWrapper("java.lang.String");
535 }
536
537 Object paramObj3 = params;
538
539 if (params == null) {
540 paramObj3 = new NullWrapper("[Ljava.lang.String;");
541 }
542
543 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
544 "searchCount",
545 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
546
547 Object returnObj = null;
548
549 try {
550 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
551 }
552 catch (Exception e) {
553 if (e instanceof com.liferay.portal.SystemException) {
554 throw (com.liferay.portal.SystemException)e;
555 }
556
557 throw new com.liferay.portal.SystemException(e);
558 }
559
560 return ((Integer)returnObj).intValue();
561 }
562 catch (com.liferay.portal.SystemException se) {
563 _log.error(se, se);
564
565 throw se;
566 }
567 }
568
569 public static void setRoleGroups(HttpPrincipal httpPrincipal, long roleId,
570 long[] groupIds)
571 throws com.liferay.portal.SystemException,
572 com.liferay.portal.PortalException {
573 try {
574 Object paramObj0 = new LongWrapper(roleId);
575
576 Object paramObj1 = groupIds;
577
578 if (groupIds == null) {
579 paramObj1 = new NullWrapper("[J");
580 }
581
582 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
583 "setRoleGroups", new Object[] { paramObj0, paramObj1 });
584
585 try {
586 TunnelUtil.invoke(httpPrincipal, methodWrapper);
587 }
588 catch (Exception e) {
589 if (e instanceof com.liferay.portal.SystemException) {
590 throw (com.liferay.portal.SystemException)e;
591 }
592
593 if (e instanceof com.liferay.portal.PortalException) {
594 throw (com.liferay.portal.PortalException)e;
595 }
596
597 throw new com.liferay.portal.SystemException(e);
598 }
599 }
600 catch (com.liferay.portal.SystemException se) {
601 _log.error(se, se);
602
603 throw se;
604 }
605 }
606
607 public static void unsetRoleGroups(HttpPrincipal httpPrincipal,
608 long roleId, long[] groupIds)
609 throws com.liferay.portal.SystemException,
610 com.liferay.portal.PortalException {
611 try {
612 Object paramObj0 = new LongWrapper(roleId);
613
614 Object paramObj1 = groupIds;
615
616 if (groupIds == null) {
617 paramObj1 = new NullWrapper("[J");
618 }
619
620 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
621 "unsetRoleGroups", new Object[] { paramObj0, paramObj1 });
622
623 try {
624 TunnelUtil.invoke(httpPrincipal, methodWrapper);
625 }
626 catch (Exception e) {
627 if (e instanceof com.liferay.portal.SystemException) {
628 throw (com.liferay.portal.SystemException)e;
629 }
630
631 if (e instanceof com.liferay.portal.PortalException) {
632 throw (com.liferay.portal.PortalException)e;
633 }
634
635 throw new com.liferay.portal.SystemException(e);
636 }
637 }
638 catch (com.liferay.portal.SystemException se) {
639 _log.error(se, se);
640
641 throw se;
642 }
643 }
644
645 public static com.liferay.portal.model.Group updateFriendlyURL(
646 HttpPrincipal httpPrincipal, long groupId, java.lang.String friendlyURL)
647 throws com.liferay.portal.SystemException,
648 com.liferay.portal.PortalException {
649 try {
650 Object paramObj0 = new LongWrapper(groupId);
651
652 Object paramObj1 = friendlyURL;
653
654 if (friendlyURL == null) {
655 paramObj1 = new NullWrapper("java.lang.String");
656 }
657
658 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
659 "updateFriendlyURL", new Object[] { paramObj0, paramObj1 });
660
661 Object returnObj = null;
662
663 try {
664 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
665 }
666 catch (Exception e) {
667 if (e instanceof com.liferay.portal.SystemException) {
668 throw (com.liferay.portal.SystemException)e;
669 }
670
671 if (e instanceof com.liferay.portal.PortalException) {
672 throw (com.liferay.portal.PortalException)e;
673 }
674
675 throw new com.liferay.portal.SystemException(e);
676 }
677
678 return (com.liferay.portal.model.Group)returnObj;
679 }
680 catch (com.liferay.portal.SystemException se) {
681 _log.error(se, se);
682
683 throw se;
684 }
685 }
686
687 public static com.liferay.portal.model.Group updateGroup(
688 HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
689 java.lang.String description, int type, java.lang.String friendlyURL,
690 boolean active)
691 throws com.liferay.portal.SystemException,
692 com.liferay.portal.PortalException {
693 try {
694 Object paramObj0 = new LongWrapper(groupId);
695
696 Object paramObj1 = name;
697
698 if (name == null) {
699 paramObj1 = new NullWrapper("java.lang.String");
700 }
701
702 Object paramObj2 = description;
703
704 if (description == null) {
705 paramObj2 = new NullWrapper("java.lang.String");
706 }
707
708 Object paramObj3 = new IntegerWrapper(type);
709
710 Object paramObj4 = friendlyURL;
711
712 if (friendlyURL == null) {
713 paramObj4 = new NullWrapper("java.lang.String");
714 }
715
716 Object paramObj5 = new BooleanWrapper(active);
717
718 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
719 "updateGroup",
720 new Object[] {
721 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
722 paramObj5
723 });
724
725 Object returnObj = null;
726
727 try {
728 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
729 }
730 catch (Exception e) {
731 if (e instanceof com.liferay.portal.SystemException) {
732 throw (com.liferay.portal.SystemException)e;
733 }
734
735 if (e instanceof com.liferay.portal.PortalException) {
736 throw (com.liferay.portal.PortalException)e;
737 }
738
739 throw new com.liferay.portal.SystemException(e);
740 }
741
742 return (com.liferay.portal.model.Group)returnObj;
743 }
744 catch (com.liferay.portal.SystemException se) {
745 _log.error(se, se);
746
747 throw se;
748 }
749 }
750
751 public static com.liferay.portal.model.Group updateGroup(
752 HttpPrincipal httpPrincipal, long groupId, java.lang.String typeSettings)
753 throws com.liferay.portal.SystemException,
754 com.liferay.portal.PortalException {
755 try {
756 Object paramObj0 = new LongWrapper(groupId);
757
758 Object paramObj1 = typeSettings;
759
760 if (typeSettings == null) {
761 paramObj1 = new NullWrapper("java.lang.String");
762 }
763
764 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
765 "updateGroup", new Object[] { paramObj0, paramObj1 });
766
767 Object returnObj = null;
768
769 try {
770 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
771 }
772 catch (Exception e) {
773 if (e instanceof com.liferay.portal.SystemException) {
774 throw (com.liferay.portal.SystemException)e;
775 }
776
777 if (e instanceof com.liferay.portal.PortalException) {
778 throw (com.liferay.portal.PortalException)e;
779 }
780
781 throw new com.liferay.portal.SystemException(e);
782 }
783
784 return (com.liferay.portal.model.Group)returnObj;
785 }
786 catch (com.liferay.portal.SystemException se) {
787 _log.error(se, se);
788
789 throw se;
790 }
791 }
792
793 public static com.liferay.portal.model.Group updateWorkflow(
794 HttpPrincipal httpPrincipal, long groupId, boolean workflowEnabled,
795 int workflowStages, java.lang.String workflowRoleNames)
796 throws com.liferay.portal.SystemException,
797 com.liferay.portal.PortalException {
798 try {
799 Object paramObj0 = new LongWrapper(groupId);
800
801 Object paramObj1 = new BooleanWrapper(workflowEnabled);
802
803 Object paramObj2 = new IntegerWrapper(workflowStages);
804
805 Object paramObj3 = workflowRoleNames;
806
807 if (workflowRoleNames == null) {
808 paramObj3 = new NullWrapper("java.lang.String");
809 }
810
811 MethodWrapper methodWrapper = new MethodWrapper(GroupServiceUtil.class.getName(),
812 "updateWorkflow",
813 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
814
815 Object returnObj = null;
816
817 try {
818 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
819 }
820 catch (Exception e) {
821 if (e instanceof com.liferay.portal.SystemException) {
822 throw (com.liferay.portal.SystemException)e;
823 }
824
825 if (e instanceof com.liferay.portal.PortalException) {
826 throw (com.liferay.portal.PortalException)e;
827 }
828
829 throw new com.liferay.portal.SystemException(e);
830 }
831
832 return (com.liferay.portal.model.Group)returnObj;
833 }
834 catch (com.liferay.portal.SystemException se) {
835 _log.error(se, se);
836
837 throw se;
838 }
839 }
840
841 private static Log _log = LogFactoryUtil.getLog(GroupServiceHttp.class);
842 }