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