001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.ResourceBlockServiceUtil;
023
024
054 public class ResourceBlockServiceHttp {
055 public static void addCompanyScopePermission(HttpPrincipal httpPrincipal,
056 long scopeGroupId, long companyId, java.lang.String name, long roleId,
057 java.lang.String actionId)
058 throws com.liferay.portal.kernel.exception.PortalException,
059 com.liferay.portal.kernel.exception.SystemException {
060 try {
061 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
062 "addCompanyScopePermission",
063 _addCompanyScopePermissionParameterTypes0);
064
065 MethodHandler methodHandler = new MethodHandler(methodKey,
066 scopeGroupId, companyId, name, roleId, actionId);
067
068 try {
069 TunnelUtil.invoke(httpPrincipal, methodHandler);
070 }
071 catch (Exception e) {
072 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
073 throw (com.liferay.portal.kernel.exception.PortalException)e;
074 }
075
076 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
077 throw (com.liferay.portal.kernel.exception.SystemException)e;
078 }
079
080 throw new com.liferay.portal.kernel.exception.SystemException(e);
081 }
082 }
083 catch (com.liferay.portal.kernel.exception.SystemException se) {
084 _log.error(se, se);
085
086 throw se;
087 }
088 }
089
090 public static void addGroupScopePermission(HttpPrincipal httpPrincipal,
091 long scopeGroupId, long companyId, long groupId, java.lang.String name,
092 long roleId, java.lang.String actionId)
093 throws com.liferay.portal.kernel.exception.PortalException,
094 com.liferay.portal.kernel.exception.SystemException {
095 try {
096 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
097 "addGroupScopePermission",
098 _addGroupScopePermissionParameterTypes1);
099
100 MethodHandler methodHandler = new MethodHandler(methodKey,
101 scopeGroupId, companyId, groupId, name, roleId, actionId);
102
103 try {
104 TunnelUtil.invoke(httpPrincipal, methodHandler);
105 }
106 catch (Exception e) {
107 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
108 throw (com.liferay.portal.kernel.exception.PortalException)e;
109 }
110
111 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
112 throw (com.liferay.portal.kernel.exception.SystemException)e;
113 }
114
115 throw new com.liferay.portal.kernel.exception.SystemException(e);
116 }
117 }
118 catch (com.liferay.portal.kernel.exception.SystemException se) {
119 _log.error(se, se);
120
121 throw se;
122 }
123 }
124
125 public static void addIndividualScopePermission(
126 HttpPrincipal httpPrincipal, long companyId, long groupId,
127 java.lang.String name, long primKey, long roleId,
128 java.lang.String actionId)
129 throws com.liferay.portal.kernel.exception.PortalException,
130 com.liferay.portal.kernel.exception.SystemException {
131 try {
132 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
133 "addIndividualScopePermission",
134 _addIndividualScopePermissionParameterTypes2);
135
136 MethodHandler methodHandler = new MethodHandler(methodKey,
137 companyId, groupId, name, primKey, roleId, actionId);
138
139 try {
140 TunnelUtil.invoke(httpPrincipal, methodHandler);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
144 throw (com.liferay.portal.kernel.exception.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
148 throw (com.liferay.portal.kernel.exception.SystemException)e;
149 }
150
151 throw new com.liferay.portal.kernel.exception.SystemException(e);
152 }
153 }
154 catch (com.liferay.portal.kernel.exception.SystemException se) {
155 _log.error(se, se);
156
157 throw se;
158 }
159 }
160
161 public static void removeAllGroupScopePermissions(
162 HttpPrincipal httpPrincipal, long scopeGroupId, long companyId,
163 java.lang.String name, long roleId, java.lang.String actionId)
164 throws com.liferay.portal.kernel.exception.PortalException,
165 com.liferay.portal.kernel.exception.SystemException {
166 try {
167 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
168 "removeAllGroupScopePermissions",
169 _removeAllGroupScopePermissionsParameterTypes3);
170
171 MethodHandler methodHandler = new MethodHandler(methodKey,
172 scopeGroupId, companyId, name, roleId, actionId);
173
174 try {
175 TunnelUtil.invoke(httpPrincipal, methodHandler);
176 }
177 catch (Exception e) {
178 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
179 throw (com.liferay.portal.kernel.exception.PortalException)e;
180 }
181
182 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
183 throw (com.liferay.portal.kernel.exception.SystemException)e;
184 }
185
186 throw new com.liferay.portal.kernel.exception.SystemException(e);
187 }
188 }
189 catch (com.liferay.portal.kernel.exception.SystemException se) {
190 _log.error(se, se);
191
192 throw se;
193 }
194 }
195
196 public static void removeCompanyScopePermission(
197 HttpPrincipal httpPrincipal, long scopeGroupId, long companyId,
198 java.lang.String name, long roleId, java.lang.String actionId)
199 throws com.liferay.portal.kernel.exception.PortalException,
200 com.liferay.portal.kernel.exception.SystemException {
201 try {
202 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
203 "removeCompanyScopePermission",
204 _removeCompanyScopePermissionParameterTypes4);
205
206 MethodHandler methodHandler = new MethodHandler(methodKey,
207 scopeGroupId, companyId, name, roleId, actionId);
208
209 try {
210 TunnelUtil.invoke(httpPrincipal, methodHandler);
211 }
212 catch (Exception e) {
213 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
214 throw (com.liferay.portal.kernel.exception.PortalException)e;
215 }
216
217 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
218 throw (com.liferay.portal.kernel.exception.SystemException)e;
219 }
220
221 throw new com.liferay.portal.kernel.exception.SystemException(e);
222 }
223 }
224 catch (com.liferay.portal.kernel.exception.SystemException se) {
225 _log.error(se, se);
226
227 throw se;
228 }
229 }
230
231 public static void removeGroupScopePermission(HttpPrincipal httpPrincipal,
232 long scopeGroupId, long companyId, long groupId, java.lang.String name,
233 long roleId, java.lang.String actionId)
234 throws com.liferay.portal.kernel.exception.PortalException,
235 com.liferay.portal.kernel.exception.SystemException {
236 try {
237 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
238 "removeGroupScopePermission",
239 _removeGroupScopePermissionParameterTypes5);
240
241 MethodHandler methodHandler = new MethodHandler(methodKey,
242 scopeGroupId, companyId, groupId, name, roleId, actionId);
243
244 try {
245 TunnelUtil.invoke(httpPrincipal, methodHandler);
246 }
247 catch (Exception e) {
248 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
249 throw (com.liferay.portal.kernel.exception.PortalException)e;
250 }
251
252 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
253 throw (com.liferay.portal.kernel.exception.SystemException)e;
254 }
255
256 throw new com.liferay.portal.kernel.exception.SystemException(e);
257 }
258 }
259 catch (com.liferay.portal.kernel.exception.SystemException se) {
260 _log.error(se, se);
261
262 throw se;
263 }
264 }
265
266 public static void removeIndividualScopePermission(
267 HttpPrincipal httpPrincipal, long companyId, long groupId,
268 java.lang.String name, long primKey, long roleId,
269 java.lang.String actionId)
270 throws com.liferay.portal.kernel.exception.PortalException,
271 com.liferay.portal.kernel.exception.SystemException {
272 try {
273 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
274 "removeIndividualScopePermission",
275 _removeIndividualScopePermissionParameterTypes6);
276
277 MethodHandler methodHandler = new MethodHandler(methodKey,
278 companyId, groupId, name, primKey, roleId, actionId);
279
280 try {
281 TunnelUtil.invoke(httpPrincipal, methodHandler);
282 }
283 catch (Exception e) {
284 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
285 throw (com.liferay.portal.kernel.exception.PortalException)e;
286 }
287
288 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
289 throw (com.liferay.portal.kernel.exception.SystemException)e;
290 }
291
292 throw new com.liferay.portal.kernel.exception.SystemException(e);
293 }
294 }
295 catch (com.liferay.portal.kernel.exception.SystemException se) {
296 _log.error(se, se);
297
298 throw se;
299 }
300 }
301
302 public static void setCompanyScopePermissions(HttpPrincipal httpPrincipal,
303 long scopeGroupId, long companyId, java.lang.String name, long roleId,
304 java.util.List<java.lang.String> actionIds)
305 throws com.liferay.portal.kernel.exception.PortalException,
306 com.liferay.portal.kernel.exception.SystemException {
307 try {
308 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
309 "setCompanyScopePermissions",
310 _setCompanyScopePermissionsParameterTypes7);
311
312 MethodHandler methodHandler = new MethodHandler(methodKey,
313 scopeGroupId, companyId, name, roleId, actionIds);
314
315 try {
316 TunnelUtil.invoke(httpPrincipal, methodHandler);
317 }
318 catch (Exception e) {
319 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
320 throw (com.liferay.portal.kernel.exception.PortalException)e;
321 }
322
323 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
324 throw (com.liferay.portal.kernel.exception.SystemException)e;
325 }
326
327 throw new com.liferay.portal.kernel.exception.SystemException(e);
328 }
329 }
330 catch (com.liferay.portal.kernel.exception.SystemException se) {
331 _log.error(se, se);
332
333 throw se;
334 }
335 }
336
337 public static void setGroupScopePermissions(HttpPrincipal httpPrincipal,
338 long scopeGroupId, long companyId, long groupId, java.lang.String name,
339 long roleId, java.util.List<java.lang.String> actionIds)
340 throws com.liferay.portal.kernel.exception.PortalException,
341 com.liferay.portal.kernel.exception.SystemException {
342 try {
343 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
344 "setGroupScopePermissions",
345 _setGroupScopePermissionsParameterTypes8);
346
347 MethodHandler methodHandler = new MethodHandler(methodKey,
348 scopeGroupId, companyId, groupId, name, roleId, actionIds);
349
350 try {
351 TunnelUtil.invoke(httpPrincipal, methodHandler);
352 }
353 catch (Exception e) {
354 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
355 throw (com.liferay.portal.kernel.exception.PortalException)e;
356 }
357
358 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
359 throw (com.liferay.portal.kernel.exception.SystemException)e;
360 }
361
362 throw new com.liferay.portal.kernel.exception.SystemException(e);
363 }
364 }
365 catch (com.liferay.portal.kernel.exception.SystemException se) {
366 _log.error(se, se);
367
368 throw se;
369 }
370 }
371
372 public static void setIndividualScopePermissions(
373 HttpPrincipal httpPrincipal, long companyId, long groupId,
374 java.lang.String name, long primKey, long roleId,
375 java.util.List<java.lang.String> actionIds)
376 throws com.liferay.portal.kernel.exception.PortalException,
377 com.liferay.portal.kernel.exception.SystemException {
378 try {
379 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
380 "setIndividualScopePermissions",
381 _setIndividualScopePermissionsParameterTypes9);
382
383 MethodHandler methodHandler = new MethodHandler(methodKey,
384 companyId, groupId, name, primKey, roleId, actionIds);
385
386 try {
387 TunnelUtil.invoke(httpPrincipal, methodHandler);
388 }
389 catch (Exception e) {
390 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
391 throw (com.liferay.portal.kernel.exception.PortalException)e;
392 }
393
394 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
395 throw (com.liferay.portal.kernel.exception.SystemException)e;
396 }
397
398 throw new com.liferay.portal.kernel.exception.SystemException(e);
399 }
400 }
401 catch (com.liferay.portal.kernel.exception.SystemException se) {
402 _log.error(se, se);
403
404 throw se;
405 }
406 }
407
408 public static void setIndividualScopePermissions(
409 HttpPrincipal httpPrincipal, long companyId, long groupId,
410 java.lang.String name, long primKey,
411 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
412 throws com.liferay.portal.kernel.exception.PortalException,
413 com.liferay.portal.kernel.exception.SystemException {
414 try {
415 MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class.getName(),
416 "setIndividualScopePermissions",
417 _setIndividualScopePermissionsParameterTypes10);
418
419 MethodHandler methodHandler = new MethodHandler(methodKey,
420 companyId, groupId, name, primKey, roleIdsToActionIds);
421
422 try {
423 TunnelUtil.invoke(httpPrincipal, methodHandler);
424 }
425 catch (Exception e) {
426 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
427 throw (com.liferay.portal.kernel.exception.PortalException)e;
428 }
429
430 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
431 throw (com.liferay.portal.kernel.exception.SystemException)e;
432 }
433
434 throw new com.liferay.portal.kernel.exception.SystemException(e);
435 }
436 }
437 catch (com.liferay.portal.kernel.exception.SystemException se) {
438 _log.error(se, se);
439
440 throw se;
441 }
442 }
443
444 private static Log _log = LogFactoryUtil.getLog(ResourceBlockServiceHttp.class);
445 private static final Class<?>[] _addCompanyScopePermissionParameterTypes0 = new Class[] {
446 long.class, long.class, java.lang.String.class, long.class,
447 java.lang.String.class
448 };
449 private static final Class<?>[] _addGroupScopePermissionParameterTypes1 = new Class[] {
450 long.class, long.class, long.class, java.lang.String.class,
451 long.class, java.lang.String.class
452 };
453 private static final Class<?>[] _addIndividualScopePermissionParameterTypes2 =
454 new Class[] {
455 long.class, long.class, java.lang.String.class, long.class,
456 long.class, java.lang.String.class
457 };
458 private static final Class<?>[] _removeAllGroupScopePermissionsParameterTypes3 =
459 new Class[] {
460 long.class, long.class, java.lang.String.class, long.class,
461 java.lang.String.class
462 };
463 private static final Class<?>[] _removeCompanyScopePermissionParameterTypes4 =
464 new Class[] {
465 long.class, long.class, java.lang.String.class, long.class,
466 java.lang.String.class
467 };
468 private static final Class<?>[] _removeGroupScopePermissionParameterTypes5 = new Class[] {
469 long.class, long.class, long.class, java.lang.String.class,
470 long.class, java.lang.String.class
471 };
472 private static final Class<?>[] _removeIndividualScopePermissionParameterTypes6 =
473 new Class[] {
474 long.class, long.class, java.lang.String.class, long.class,
475 long.class, java.lang.String.class
476 };
477 private static final Class<?>[] _setCompanyScopePermissionsParameterTypes7 = new Class[] {
478 long.class, long.class, java.lang.String.class, long.class,
479 java.util.List.class
480 };
481 private static final Class<?>[] _setGroupScopePermissionsParameterTypes8 = new Class[] {
482 long.class, long.class, long.class, java.lang.String.class,
483 long.class, java.util.List.class
484 };
485 private static final Class<?>[] _setIndividualScopePermissionsParameterTypes9 =
486 new Class[] {
487 long.class, long.class, java.lang.String.class, long.class,
488 long.class, java.util.List.class
489 };
490 private static final Class<?>[] _setIndividualScopePermissionsParameterTypes10 =
491 new Class[] {
492 long.class, long.class, java.lang.String.class, long.class,
493 java.util.Map.class
494 };
495 }