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.LongWrapper;
28 import com.liferay.portal.kernel.util.MethodWrapper;
29 import com.liferay.portal.kernel.util.NullWrapper;
30 import com.liferay.portal.security.auth.HttpPrincipal;
31 import com.liferay.portal.service.UserGroupServiceUtil;
32
33
72 public class UserGroupServiceHttp {
73 public static void addGroupUserGroups(HttpPrincipal httpPrincipal,
74 long groupId, long[] userGroupIds)
75 throws com.liferay.portal.SystemException,
76 com.liferay.portal.PortalException {
77 try {
78 Object paramObj0 = new LongWrapper(groupId);
79
80 Object paramObj1 = userGroupIds;
81
82 if (userGroupIds == null) {
83 paramObj1 = new NullWrapper("[J");
84 }
85
86 MethodWrapper methodWrapper = new MethodWrapper(UserGroupServiceUtil.class.getName(),
87 "addGroupUserGroups", new Object[] { paramObj0, paramObj1 });
88
89 try {
90 TunnelUtil.invoke(httpPrincipal, methodWrapper);
91 }
92 catch (Exception e) {
93 if (e instanceof com.liferay.portal.SystemException) {
94 throw (com.liferay.portal.SystemException)e;
95 }
96
97 if (e instanceof com.liferay.portal.PortalException) {
98 throw (com.liferay.portal.PortalException)e;
99 }
100
101 throw new com.liferay.portal.SystemException(e);
102 }
103 }
104 catch (com.liferay.portal.SystemException se) {
105 _log.error(se, se);
106
107 throw se;
108 }
109 }
110
111 public static com.liferay.portal.model.UserGroup addUserGroup(
112 HttpPrincipal httpPrincipal, java.lang.String name,
113 java.lang.String description)
114 throws com.liferay.portal.SystemException,
115 com.liferay.portal.PortalException {
116 try {
117 Object paramObj0 = name;
118
119 if (name == null) {
120 paramObj0 = new NullWrapper("java.lang.String");
121 }
122
123 Object paramObj1 = description;
124
125 if (description == null) {
126 paramObj1 = new NullWrapper("java.lang.String");
127 }
128
129 MethodWrapper methodWrapper = new MethodWrapper(UserGroupServiceUtil.class.getName(),
130 "addUserGroup", new Object[] { paramObj0, paramObj1 });
131
132 Object returnObj = null;
133
134 try {
135 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
136 }
137 catch (Exception e) {
138 if (e instanceof com.liferay.portal.SystemException) {
139 throw (com.liferay.portal.SystemException)e;
140 }
141
142 if (e instanceof com.liferay.portal.PortalException) {
143 throw (com.liferay.portal.PortalException)e;
144 }
145
146 throw new com.liferay.portal.SystemException(e);
147 }
148
149 return (com.liferay.portal.model.UserGroup)returnObj;
150 }
151 catch (com.liferay.portal.SystemException se) {
152 _log.error(se, se);
153
154 throw se;
155 }
156 }
157
158 public static void deleteUserGroup(HttpPrincipal httpPrincipal,
159 long userGroupId)
160 throws com.liferay.portal.SystemException,
161 com.liferay.portal.PortalException {
162 try {
163 Object paramObj0 = new LongWrapper(userGroupId);
164
165 MethodWrapper methodWrapper = new MethodWrapper(UserGroupServiceUtil.class.getName(),
166 "deleteUserGroup", new Object[] { paramObj0 });
167
168 try {
169 TunnelUtil.invoke(httpPrincipal, methodWrapper);
170 }
171 catch (Exception e) {
172 if (e instanceof com.liferay.portal.SystemException) {
173 throw (com.liferay.portal.SystemException)e;
174 }
175
176 if (e instanceof com.liferay.portal.PortalException) {
177 throw (com.liferay.portal.PortalException)e;
178 }
179
180 throw new com.liferay.portal.SystemException(e);
181 }
182 }
183 catch (com.liferay.portal.SystemException se) {
184 _log.error(se, se);
185
186 throw se;
187 }
188 }
189
190 public static com.liferay.portal.model.UserGroup getUserGroup(
191 HttpPrincipal httpPrincipal, long userGroupId)
192 throws com.liferay.portal.SystemException,
193 com.liferay.portal.PortalException {
194 try {
195 Object paramObj0 = new LongWrapper(userGroupId);
196
197 MethodWrapper methodWrapper = new MethodWrapper(UserGroupServiceUtil.class.getName(),
198 "getUserGroup", new Object[] { paramObj0 });
199
200 Object returnObj = null;
201
202 try {
203 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
204 }
205 catch (Exception e) {
206 if (e instanceof com.liferay.portal.SystemException) {
207 throw (com.liferay.portal.SystemException)e;
208 }
209
210 if (e instanceof com.liferay.portal.PortalException) {
211 throw (com.liferay.portal.PortalException)e;
212 }
213
214 throw new com.liferay.portal.SystemException(e);
215 }
216
217 return (com.liferay.portal.model.UserGroup)returnObj;
218 }
219 catch (com.liferay.portal.SystemException se) {
220 _log.error(se, se);
221
222 throw se;
223 }
224 }
225
226 public static com.liferay.portal.model.UserGroup getUserGroup(
227 HttpPrincipal httpPrincipal, java.lang.String name)
228 throws com.liferay.portal.SystemException,
229 com.liferay.portal.PortalException {
230 try {
231 Object paramObj0 = name;
232
233 if (name == null) {
234 paramObj0 = new NullWrapper("java.lang.String");
235 }
236
237 MethodWrapper methodWrapper = new MethodWrapper(UserGroupServiceUtil.class.getName(),
238 "getUserGroup", new Object[] { paramObj0 });
239
240 Object returnObj = null;
241
242 try {
243 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
244 }
245 catch (Exception e) {
246 if (e instanceof com.liferay.portal.SystemException) {
247 throw (com.liferay.portal.SystemException)e;
248 }
249
250 if (e instanceof com.liferay.portal.PortalException) {
251 throw (com.liferay.portal.PortalException)e;
252 }
253
254 throw new com.liferay.portal.SystemException(e);
255 }
256
257 return (com.liferay.portal.model.UserGroup)returnObj;
258 }
259 catch (com.liferay.portal.SystemException se) {
260 _log.error(se, se);
261
262 throw se;
263 }
264 }
265
266 public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
267 HttpPrincipal httpPrincipal, long userId)
268 throws com.liferay.portal.SystemException,
269 com.liferay.portal.PortalException {
270 try {
271 Object paramObj0 = new LongWrapper(userId);
272
273 MethodWrapper methodWrapper = new MethodWrapper(UserGroupServiceUtil.class.getName(),
274 "getUserUserGroups", new Object[] { paramObj0 });
275
276 Object returnObj = null;
277
278 try {
279 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
280 }
281 catch (Exception e) {
282 if (e instanceof com.liferay.portal.SystemException) {
283 throw (com.liferay.portal.SystemException)e;
284 }
285
286 if (e instanceof com.liferay.portal.PortalException) {
287 throw (com.liferay.portal.PortalException)e;
288 }
289
290 throw new com.liferay.portal.SystemException(e);
291 }
292
293 return (java.util.List<com.liferay.portal.model.UserGroup>)returnObj;
294 }
295 catch (com.liferay.portal.SystemException se) {
296 _log.error(se, se);
297
298 throw se;
299 }
300 }
301
302 public static void unsetGroupUserGroups(HttpPrincipal httpPrincipal,
303 long groupId, long[] userGroupIds)
304 throws com.liferay.portal.SystemException,
305 com.liferay.portal.PortalException {
306 try {
307 Object paramObj0 = new LongWrapper(groupId);
308
309 Object paramObj1 = userGroupIds;
310
311 if (userGroupIds == null) {
312 paramObj1 = new NullWrapper("[J");
313 }
314
315 MethodWrapper methodWrapper = new MethodWrapper(UserGroupServiceUtil.class.getName(),
316 "unsetGroupUserGroups",
317 new Object[] { paramObj0, paramObj1 });
318
319 try {
320 TunnelUtil.invoke(httpPrincipal, methodWrapper);
321 }
322 catch (Exception e) {
323 if (e instanceof com.liferay.portal.SystemException) {
324 throw (com.liferay.portal.SystemException)e;
325 }
326
327 if (e instanceof com.liferay.portal.PortalException) {
328 throw (com.liferay.portal.PortalException)e;
329 }
330
331 throw new com.liferay.portal.SystemException(e);
332 }
333 }
334 catch (com.liferay.portal.SystemException se) {
335 _log.error(se, se);
336
337 throw se;
338 }
339 }
340
341 public static com.liferay.portal.model.UserGroup updateUserGroup(
342 HttpPrincipal httpPrincipal, long userGroupId, java.lang.String name,
343 java.lang.String description)
344 throws com.liferay.portal.SystemException,
345 com.liferay.portal.PortalException {
346 try {
347 Object paramObj0 = new LongWrapper(userGroupId);
348
349 Object paramObj1 = name;
350
351 if (name == null) {
352 paramObj1 = new NullWrapper("java.lang.String");
353 }
354
355 Object paramObj2 = description;
356
357 if (description == null) {
358 paramObj2 = new NullWrapper("java.lang.String");
359 }
360
361 MethodWrapper methodWrapper = new MethodWrapper(UserGroupServiceUtil.class.getName(),
362 "updateUserGroup",
363 new Object[] { paramObj0, paramObj1, paramObj2 });
364
365 Object returnObj = null;
366
367 try {
368 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
369 }
370 catch (Exception e) {
371 if (e instanceof com.liferay.portal.SystemException) {
372 throw (com.liferay.portal.SystemException)e;
373 }
374
375 if (e instanceof com.liferay.portal.PortalException) {
376 throw (com.liferay.portal.PortalException)e;
377 }
378
379 throw new com.liferay.portal.SystemException(e);
380 }
381
382 return (com.liferay.portal.model.UserGroup)returnObj;
383 }
384 catch (com.liferay.portal.SystemException se) {
385 _log.error(se, se);
386
387 throw se;
388 }
389 }
390
391 private static Log _log = LogFactoryUtil.getLog(UserGroupServiceHttp.class);
392 }