001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.persistence;
022:
023: /**
024: * <a href="PermissionUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * @author Brian Wing Shun Chan
027: *
028: */
029: public class PermissionUtil {
030: public static com.liferay.portal.model.Permission create(
031: long permissionId) {
032: return getPersistence().create(permissionId);
033: }
034:
035: public static com.liferay.portal.model.Permission remove(
036: long permissionId)
037: throws com.liferay.portal.SystemException,
038: com.liferay.portal.NoSuchPermissionException {
039: return getPersistence().remove(permissionId);
040: }
041:
042: public static com.liferay.portal.model.Permission remove(
043: com.liferay.portal.model.Permission permission)
044: throws com.liferay.portal.SystemException {
045: return getPersistence().remove(permission);
046: }
047:
048: public static com.liferay.portal.model.Permission update(
049: com.liferay.portal.model.Permission permission)
050: throws com.liferay.portal.SystemException {
051: return getPersistence().update(permission);
052: }
053:
054: public static com.liferay.portal.model.Permission update(
055: com.liferay.portal.model.Permission permission,
056: boolean merge) throws com.liferay.portal.SystemException {
057: return getPersistence().update(permission, merge);
058: }
059:
060: public static com.liferay.portal.model.Permission updateImpl(
061: com.liferay.portal.model.Permission permission,
062: boolean merge) throws com.liferay.portal.SystemException {
063: return getPersistence().updateImpl(permission, merge);
064: }
065:
066: public static com.liferay.portal.model.Permission findByPrimaryKey(
067: long permissionId)
068: throws com.liferay.portal.SystemException,
069: com.liferay.portal.NoSuchPermissionException {
070: return getPersistence().findByPrimaryKey(permissionId);
071: }
072:
073: public static com.liferay.portal.model.Permission fetchByPrimaryKey(
074: long permissionId)
075: throws com.liferay.portal.SystemException {
076: return getPersistence().fetchByPrimaryKey(permissionId);
077: }
078:
079: public static java.util.List findByResourceId(long resourceId)
080: throws com.liferay.portal.SystemException {
081: return getPersistence().findByResourceId(resourceId);
082: }
083:
084: public static java.util.List findByResourceId(long resourceId,
085: int begin, int end)
086: throws com.liferay.portal.SystemException {
087: return getPersistence()
088: .findByResourceId(resourceId, begin, end);
089: }
090:
091: public static java.util.List findByResourceId(long resourceId,
092: int begin, int end,
093: com.liferay.portal.kernel.util.OrderByComparator obc)
094: throws com.liferay.portal.SystemException {
095: return getPersistence().findByResourceId(resourceId, begin,
096: end, obc);
097: }
098:
099: public static com.liferay.portal.model.Permission findByResourceId_First(
100: long resourceId,
101: com.liferay.portal.kernel.util.OrderByComparator obc)
102: throws com.liferay.portal.SystemException,
103: com.liferay.portal.NoSuchPermissionException {
104: return getPersistence().findByResourceId_First(resourceId, obc);
105: }
106:
107: public static com.liferay.portal.model.Permission findByResourceId_Last(
108: long resourceId,
109: com.liferay.portal.kernel.util.OrderByComparator obc)
110: throws com.liferay.portal.SystemException,
111: com.liferay.portal.NoSuchPermissionException {
112: return getPersistence().findByResourceId_Last(resourceId, obc);
113: }
114:
115: public static com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext(
116: long permissionId, long resourceId,
117: com.liferay.portal.kernel.util.OrderByComparator obc)
118: throws com.liferay.portal.SystemException,
119: com.liferay.portal.NoSuchPermissionException {
120: return getPersistence().findByResourceId_PrevAndNext(
121: permissionId, resourceId, obc);
122: }
123:
124: public static com.liferay.portal.model.Permission findByA_R(
125: java.lang.String actionId, long resourceId)
126: throws com.liferay.portal.SystemException,
127: com.liferay.portal.NoSuchPermissionException {
128: return getPersistence().findByA_R(actionId, resourceId);
129: }
130:
131: public static com.liferay.portal.model.Permission fetchByA_R(
132: java.lang.String actionId, long resourceId)
133: throws com.liferay.portal.SystemException {
134: return getPersistence().fetchByA_R(actionId, resourceId);
135: }
136:
137: public static java.util.List findWithDynamicQuery(
138: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
139: throws com.liferay.portal.SystemException {
140: return getPersistence().findWithDynamicQuery(queryInitializer);
141: }
142:
143: public static java.util.List findWithDynamicQuery(
144: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
145: int begin, int end)
146: throws com.liferay.portal.SystemException {
147: return getPersistence().findWithDynamicQuery(queryInitializer,
148: begin, end);
149: }
150:
151: public static java.util.List findAll()
152: throws com.liferay.portal.SystemException {
153: return getPersistence().findAll();
154: }
155:
156: public static java.util.List findAll(int begin, int end)
157: throws com.liferay.portal.SystemException {
158: return getPersistence().findAll(begin, end);
159: }
160:
161: public static java.util.List findAll(int begin, int end,
162: com.liferay.portal.kernel.util.OrderByComparator obc)
163: throws com.liferay.portal.SystemException {
164: return getPersistence().findAll(begin, end, obc);
165: }
166:
167: public static void removeByResourceId(long resourceId)
168: throws com.liferay.portal.SystemException {
169: getPersistence().removeByResourceId(resourceId);
170: }
171:
172: public static void removeByA_R(java.lang.String actionId,
173: long resourceId) throws com.liferay.portal.SystemException,
174: com.liferay.portal.NoSuchPermissionException {
175: getPersistence().removeByA_R(actionId, resourceId);
176: }
177:
178: public static void removeAll()
179: throws com.liferay.portal.SystemException {
180: getPersistence().removeAll();
181: }
182:
183: public static int countByResourceId(long resourceId)
184: throws com.liferay.portal.SystemException {
185: return getPersistence().countByResourceId(resourceId);
186: }
187:
188: public static int countByA_R(java.lang.String actionId,
189: long resourceId) throws com.liferay.portal.SystemException {
190: return getPersistence().countByA_R(actionId, resourceId);
191: }
192:
193: public static int countAll()
194: throws com.liferay.portal.SystemException {
195: return getPersistence().countAll();
196: }
197:
198: public static java.util.List getGroups(long pk)
199: throws com.liferay.portal.SystemException,
200: com.liferay.portal.NoSuchPermissionException {
201: return getPersistence().getGroups(pk);
202: }
203:
204: public static java.util.List getGroups(long pk, int begin, int end)
205: throws com.liferay.portal.SystemException,
206: com.liferay.portal.NoSuchPermissionException {
207: return getPersistence().getGroups(pk, begin, end);
208: }
209:
210: public static java.util.List getGroups(long pk, int begin, int end,
211: com.liferay.portal.kernel.util.OrderByComparator obc)
212: throws com.liferay.portal.SystemException,
213: com.liferay.portal.NoSuchPermissionException {
214: return getPersistence().getGroups(pk, begin, end, obc);
215: }
216:
217: public static int getGroupsSize(long pk)
218: throws com.liferay.portal.SystemException {
219: return getPersistence().getGroupsSize(pk);
220: }
221:
222: public static boolean containsGroup(long pk, long groupPK)
223: throws com.liferay.portal.SystemException {
224: return getPersistence().containsGroup(pk, groupPK);
225: }
226:
227: public static boolean containsGroups(long pk)
228: throws com.liferay.portal.SystemException {
229: return getPersistence().containsGroups(pk);
230: }
231:
232: public static void addGroup(long pk, long groupPK)
233: throws com.liferay.portal.SystemException,
234: com.liferay.portal.NoSuchGroupException,
235: com.liferay.portal.NoSuchPermissionException {
236: getPersistence().addGroup(pk, groupPK);
237: }
238:
239: public static void addGroup(long pk,
240: com.liferay.portal.model.Group group)
241: throws com.liferay.portal.SystemException,
242: com.liferay.portal.NoSuchGroupException,
243: com.liferay.portal.NoSuchPermissionException {
244: getPersistence().addGroup(pk, group);
245: }
246:
247: public static void addGroups(long pk, long[] groupPKs)
248: throws com.liferay.portal.SystemException,
249: com.liferay.portal.NoSuchGroupException,
250: com.liferay.portal.NoSuchPermissionException {
251: getPersistence().addGroups(pk, groupPKs);
252: }
253:
254: public static void addGroups(long pk, java.util.List groups)
255: throws com.liferay.portal.SystemException,
256: com.liferay.portal.NoSuchGroupException,
257: com.liferay.portal.NoSuchPermissionException {
258: getPersistence().addGroups(pk, groups);
259: }
260:
261: public static void clearGroups(long pk)
262: throws com.liferay.portal.SystemException,
263: com.liferay.portal.NoSuchPermissionException {
264: getPersistence().clearGroups(pk);
265: }
266:
267: public static void removeGroup(long pk, long groupPK)
268: throws com.liferay.portal.SystemException,
269: com.liferay.portal.NoSuchGroupException,
270: com.liferay.portal.NoSuchPermissionException {
271: getPersistence().removeGroup(pk, groupPK);
272: }
273:
274: public static void removeGroup(long pk,
275: com.liferay.portal.model.Group group)
276: throws com.liferay.portal.SystemException,
277: com.liferay.portal.NoSuchGroupException,
278: com.liferay.portal.NoSuchPermissionException {
279: getPersistence().removeGroup(pk, group);
280: }
281:
282: public static void removeGroups(long pk, long[] groupPKs)
283: throws com.liferay.portal.SystemException,
284: com.liferay.portal.NoSuchGroupException,
285: com.liferay.portal.NoSuchPermissionException {
286: getPersistence().removeGroups(pk, groupPKs);
287: }
288:
289: public static void removeGroups(long pk, java.util.List groups)
290: throws com.liferay.portal.SystemException,
291: com.liferay.portal.NoSuchGroupException,
292: com.liferay.portal.NoSuchPermissionException {
293: getPersistence().removeGroups(pk, groups);
294: }
295:
296: public static void setGroups(long pk, long[] groupPKs)
297: throws com.liferay.portal.SystemException,
298: com.liferay.portal.NoSuchGroupException,
299: com.liferay.portal.NoSuchPermissionException {
300: getPersistence().setGroups(pk, groupPKs);
301: }
302:
303: public static void setGroups(long pk, java.util.List groups)
304: throws com.liferay.portal.SystemException,
305: com.liferay.portal.NoSuchGroupException,
306: com.liferay.portal.NoSuchPermissionException {
307: getPersistence().setGroups(pk, groups);
308: }
309:
310: public static java.util.List getRoles(long pk)
311: throws com.liferay.portal.SystemException,
312: com.liferay.portal.NoSuchPermissionException {
313: return getPersistence().getRoles(pk);
314: }
315:
316: public static java.util.List getRoles(long pk, int begin, int end)
317: throws com.liferay.portal.SystemException,
318: com.liferay.portal.NoSuchPermissionException {
319: return getPersistence().getRoles(pk, begin, end);
320: }
321:
322: public static java.util.List getRoles(long pk, int begin, int end,
323: com.liferay.portal.kernel.util.OrderByComparator obc)
324: throws com.liferay.portal.SystemException,
325: com.liferay.portal.NoSuchPermissionException {
326: return getPersistence().getRoles(pk, begin, end, obc);
327: }
328:
329: public static int getRolesSize(long pk)
330: throws com.liferay.portal.SystemException {
331: return getPersistence().getRolesSize(pk);
332: }
333:
334: public static boolean containsRole(long pk, long rolePK)
335: throws com.liferay.portal.SystemException {
336: return getPersistence().containsRole(pk, rolePK);
337: }
338:
339: public static boolean containsRoles(long pk)
340: throws com.liferay.portal.SystemException {
341: return getPersistence().containsRoles(pk);
342: }
343:
344: public static void addRole(long pk, long rolePK)
345: throws com.liferay.portal.SystemException,
346: com.liferay.portal.NoSuchRoleException,
347: com.liferay.portal.NoSuchPermissionException {
348: getPersistence().addRole(pk, rolePK);
349: }
350:
351: public static void addRole(long pk,
352: com.liferay.portal.model.Role role)
353: throws com.liferay.portal.SystemException,
354: com.liferay.portal.NoSuchRoleException,
355: com.liferay.portal.NoSuchPermissionException {
356: getPersistence().addRole(pk, role);
357: }
358:
359: public static void addRoles(long pk, long[] rolePKs)
360: throws com.liferay.portal.SystemException,
361: com.liferay.portal.NoSuchRoleException,
362: com.liferay.portal.NoSuchPermissionException {
363: getPersistence().addRoles(pk, rolePKs);
364: }
365:
366: public static void addRoles(long pk, java.util.List roles)
367: throws com.liferay.portal.SystemException,
368: com.liferay.portal.NoSuchRoleException,
369: com.liferay.portal.NoSuchPermissionException {
370: getPersistence().addRoles(pk, roles);
371: }
372:
373: public static void clearRoles(long pk)
374: throws com.liferay.portal.SystemException,
375: com.liferay.portal.NoSuchPermissionException {
376: getPersistence().clearRoles(pk);
377: }
378:
379: public static void removeRole(long pk, long rolePK)
380: throws com.liferay.portal.SystemException,
381: com.liferay.portal.NoSuchRoleException,
382: com.liferay.portal.NoSuchPermissionException {
383: getPersistence().removeRole(pk, rolePK);
384: }
385:
386: public static void removeRole(long pk,
387: com.liferay.portal.model.Role role)
388: throws com.liferay.portal.SystemException,
389: com.liferay.portal.NoSuchRoleException,
390: com.liferay.portal.NoSuchPermissionException {
391: getPersistence().removeRole(pk, role);
392: }
393:
394: public static void removeRoles(long pk, long[] rolePKs)
395: throws com.liferay.portal.SystemException,
396: com.liferay.portal.NoSuchRoleException,
397: com.liferay.portal.NoSuchPermissionException {
398: getPersistence().removeRoles(pk, rolePKs);
399: }
400:
401: public static void removeRoles(long pk, java.util.List roles)
402: throws com.liferay.portal.SystemException,
403: com.liferay.portal.NoSuchRoleException,
404: com.liferay.portal.NoSuchPermissionException {
405: getPersistence().removeRoles(pk, roles);
406: }
407:
408: public static void setRoles(long pk, long[] rolePKs)
409: throws com.liferay.portal.SystemException,
410: com.liferay.portal.NoSuchRoleException,
411: com.liferay.portal.NoSuchPermissionException {
412: getPersistence().setRoles(pk, rolePKs);
413: }
414:
415: public static void setRoles(long pk, java.util.List roles)
416: throws com.liferay.portal.SystemException,
417: com.liferay.portal.NoSuchRoleException,
418: com.liferay.portal.NoSuchPermissionException {
419: getPersistence().setRoles(pk, roles);
420: }
421:
422: public static java.util.List getUsers(long pk)
423: throws com.liferay.portal.SystemException,
424: com.liferay.portal.NoSuchPermissionException {
425: return getPersistence().getUsers(pk);
426: }
427:
428: public static java.util.List getUsers(long pk, int begin, int end)
429: throws com.liferay.portal.SystemException,
430: com.liferay.portal.NoSuchPermissionException {
431: return getPersistence().getUsers(pk, begin, end);
432: }
433:
434: public static java.util.List getUsers(long pk, int begin, int end,
435: com.liferay.portal.kernel.util.OrderByComparator obc)
436: throws com.liferay.portal.SystemException,
437: com.liferay.portal.NoSuchPermissionException {
438: return getPersistence().getUsers(pk, begin, end, obc);
439: }
440:
441: public static int getUsersSize(long pk)
442: throws com.liferay.portal.SystemException {
443: return getPersistence().getUsersSize(pk);
444: }
445:
446: public static boolean containsUser(long pk, long userPK)
447: throws com.liferay.portal.SystemException {
448: return getPersistence().containsUser(pk, userPK);
449: }
450:
451: public static boolean containsUsers(long pk)
452: throws com.liferay.portal.SystemException {
453: return getPersistence().containsUsers(pk);
454: }
455:
456: public static void addUser(long pk, long userPK)
457: throws com.liferay.portal.SystemException,
458: com.liferay.portal.NoSuchPermissionException,
459: com.liferay.portal.NoSuchUserException {
460: getPersistence().addUser(pk, userPK);
461: }
462:
463: public static void addUser(long pk,
464: com.liferay.portal.model.User user)
465: throws com.liferay.portal.SystemException,
466: com.liferay.portal.NoSuchPermissionException,
467: com.liferay.portal.NoSuchUserException {
468: getPersistence().addUser(pk, user);
469: }
470:
471: public static void addUsers(long pk, long[] userPKs)
472: throws com.liferay.portal.SystemException,
473: com.liferay.portal.NoSuchPermissionException,
474: com.liferay.portal.NoSuchUserException {
475: getPersistence().addUsers(pk, userPKs);
476: }
477:
478: public static void addUsers(long pk, java.util.List users)
479: throws com.liferay.portal.SystemException,
480: com.liferay.portal.NoSuchPermissionException,
481: com.liferay.portal.NoSuchUserException {
482: getPersistence().addUsers(pk, users);
483: }
484:
485: public static void clearUsers(long pk)
486: throws com.liferay.portal.SystemException,
487: com.liferay.portal.NoSuchPermissionException {
488: getPersistence().clearUsers(pk);
489: }
490:
491: public static void removeUser(long pk, long userPK)
492: throws com.liferay.portal.SystemException,
493: com.liferay.portal.NoSuchPermissionException,
494: com.liferay.portal.NoSuchUserException {
495: getPersistence().removeUser(pk, userPK);
496: }
497:
498: public static void removeUser(long pk,
499: com.liferay.portal.model.User user)
500: throws com.liferay.portal.SystemException,
501: com.liferay.portal.NoSuchPermissionException,
502: com.liferay.portal.NoSuchUserException {
503: getPersistence().removeUser(pk, user);
504: }
505:
506: public static void removeUsers(long pk, long[] userPKs)
507: throws com.liferay.portal.SystemException,
508: com.liferay.portal.NoSuchPermissionException,
509: com.liferay.portal.NoSuchUserException {
510: getPersistence().removeUsers(pk, userPKs);
511: }
512:
513: public static void removeUsers(long pk, java.util.List users)
514: throws com.liferay.portal.SystemException,
515: com.liferay.portal.NoSuchPermissionException,
516: com.liferay.portal.NoSuchUserException {
517: getPersistence().removeUsers(pk, users);
518: }
519:
520: public static void setUsers(long pk, long[] userPKs)
521: throws com.liferay.portal.SystemException,
522: com.liferay.portal.NoSuchPermissionException,
523: com.liferay.portal.NoSuchUserException {
524: getPersistence().setUsers(pk, userPKs);
525: }
526:
527: public static void setUsers(long pk, java.util.List users)
528: throws com.liferay.portal.SystemException,
529: com.liferay.portal.NoSuchPermissionException,
530: com.liferay.portal.NoSuchUserException {
531: getPersistence().setUsers(pk, users);
532: }
533:
534: public static PermissionPersistence getPersistence() {
535: return _getUtil()._persistence;
536: }
537:
538: public void setPersistence(PermissionPersistence persistence) {
539: _persistence = persistence;
540: }
541:
542: private static PermissionUtil _getUtil() {
543: if (_util == null) {
544: _util = (PermissionUtil) com.liferay.portal.kernel.bean.BeanLocatorUtil
545: .locate(_UTIL);
546: }
547:
548: return _util;
549: }
550:
551: private static final String _UTIL = PermissionUtil.class.getName();
552: private static PermissionUtil _util;
553: private PermissionPersistence _persistence;
554: }
|