1
19
20 package com.liferay.portal.service;
21
22
23
44 public class GroupServiceUtil {
45 public static com.liferay.portal.model.Group addGroup(
46 java.lang.String name, java.lang.String description, int type,
47 java.lang.String friendlyURL, boolean active,
48 com.liferay.portal.service.ServiceContext serviceContext)
49 throws com.liferay.portal.PortalException,
50 com.liferay.portal.SystemException {
51 return getService()
52 .addGroup(name, description, type, friendlyURL, active,
53 serviceContext);
54 }
55
56 public static com.liferay.portal.model.Group addGroup(long liveGroupId,
57 java.lang.String name, java.lang.String description, int type,
58 java.lang.String friendlyURL, boolean active,
59 com.liferay.portal.service.ServiceContext serviceContext)
60 throws com.liferay.portal.PortalException,
61 com.liferay.portal.SystemException {
62 return getService()
63 .addGroup(liveGroupId, name, description, type, friendlyURL,
64 active, serviceContext);
65 }
66
67 public static void addRoleGroups(long roleId, long[] groupIds)
68 throws com.liferay.portal.PortalException,
69 com.liferay.portal.SystemException {
70 getService().addRoleGroups(roleId, groupIds);
71 }
72
73 public static void deleteGroup(long groupId)
74 throws com.liferay.portal.PortalException,
75 com.liferay.portal.SystemException {
76 getService().deleteGroup(groupId);
77 }
78
79 public static com.liferay.portal.model.Group getGroup(long groupId)
80 throws com.liferay.portal.PortalException,
81 com.liferay.portal.SystemException {
82 return getService().getGroup(groupId);
83 }
84
85 public static com.liferay.portal.model.Group getGroup(long companyId,
86 java.lang.String name)
87 throws com.liferay.portal.PortalException,
88 com.liferay.portal.SystemException {
89 return getService().getGroup(companyId, name);
90 }
91
92 public static java.util.List<com.liferay.portal.model.Group> getManageableGroups(
93 java.lang.String actionId, int max)
94 throws com.liferay.portal.PortalException,
95 com.liferay.portal.SystemException {
96 return getService().getManageableGroups(actionId, max);
97 }
98
99 public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
100 java.util.List<com.liferay.portal.model.Organization> organizations) {
101 return getService().getOrganizationsGroups(organizations);
102 }
103
104 public static com.liferay.portal.model.Group getUserGroup(long companyId,
105 long userId)
106 throws com.liferay.portal.PortalException,
107 com.liferay.portal.SystemException {
108 return getService().getUserGroup(companyId, userId);
109 }
110
111 public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
112 java.util.List<com.liferay.portal.model.UserGroup> userGroups) {
113 return getService().getUserGroupsGroups(userGroups);
114 }
115
116 public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
117 long userId, int start, int end)
118 throws com.liferay.portal.PortalException,
119 com.liferay.portal.SystemException {
120 return getService().getUserOrganizationsGroups(userId, start, end);
121 }
122
123 public static boolean hasUserGroup(long userId, long groupId)
124 throws com.liferay.portal.SystemException {
125 return getService().hasUserGroup(userId, groupId);
126 }
127
128 public static java.util.List<com.liferay.portal.model.Group> search(
129 long companyId, java.lang.String name, java.lang.String description,
130 java.lang.String[] params, int start, int end)
131 throws com.liferay.portal.SystemException {
132 return getService()
133 .search(companyId, name, description, params, start, end);
134 }
135
136 public static int searchCount(long companyId, java.lang.String name,
137 java.lang.String description, java.lang.String[] params)
138 throws com.liferay.portal.SystemException {
139 return getService().searchCount(companyId, name, description, params);
140 }
141
142 public static void setRoleGroups(long roleId, long[] groupIds)
143 throws com.liferay.portal.PortalException,
144 com.liferay.portal.SystemException {
145 getService().setRoleGroups(roleId, groupIds);
146 }
147
148 public static void unsetRoleGroups(long roleId, long[] groupIds)
149 throws com.liferay.portal.PortalException,
150 com.liferay.portal.SystemException {
151 getService().unsetRoleGroups(roleId, groupIds);
152 }
153
154 public static com.liferay.portal.model.Group updateFriendlyURL(
155 long groupId, java.lang.String friendlyURL)
156 throws com.liferay.portal.PortalException,
157 com.liferay.portal.SystemException {
158 return getService().updateFriendlyURL(groupId, friendlyURL);
159 }
160
161 public static com.liferay.portal.model.Group updateGroup(long groupId,
162 java.lang.String name, java.lang.String description, int type,
163 java.lang.String friendlyURL, boolean active,
164 com.liferay.portal.service.ServiceContext serviceContext)
165 throws com.liferay.portal.PortalException,
166 com.liferay.portal.SystemException {
167 return getService()
168 .updateGroup(groupId, name, description, type, friendlyURL,
169 active, serviceContext);
170 }
171
172 public static com.liferay.portal.model.Group updateGroup(long groupId,
173 java.lang.String typeSettings)
174 throws com.liferay.portal.PortalException,
175 com.liferay.portal.SystemException {
176 return getService().updateGroup(groupId, typeSettings);
177 }
178
179 public static com.liferay.portal.model.Group updateWorkflow(long groupId,
180 boolean workflowEnabled, int workflowStages,
181 java.lang.String workflowRoleNames)
182 throws com.liferay.portal.PortalException,
183 com.liferay.portal.SystemException {
184 return getService()
185 .updateWorkflow(groupId, workflowEnabled, workflowStages,
186 workflowRoleNames);
187 }
188
189 public static GroupService getService() {
190 if (_service == null) {
191 throw new RuntimeException("GroupService is not set");
192 }
193
194 return _service;
195 }
196
197 public void setService(GroupService service) {
198 _service = service;
199 }
200
201 private static GroupService _service;
202 }