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