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