1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="ResourcePermissionLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * <p>
23   * ServiceBuilder generated this class. Modifications in this class will be
24   * overwritten the next time is generated.
25   * </p>
26   *
27   * <p>
28   * This class provides static methods for the
29   * {@link ResourcePermissionLocalService} bean. The static methods of
30   * this class calls the same methods of the bean instance. It's convenient to be
31   * able to just write one line to call a method on a bean instead of writing a
32   * lookup call and a method call.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       ResourcePermissionLocalService
37   * @generated
38   */
39  public class ResourcePermissionLocalServiceUtil {
40      public static com.liferay.portal.model.ResourcePermission addResourcePermission(
41          com.liferay.portal.model.ResourcePermission resourcePermission)
42          throws com.liferay.portal.SystemException {
43          return getService().addResourcePermission(resourcePermission);
44      }
45  
46      public static com.liferay.portal.model.ResourcePermission createResourcePermission(
47          long resourcePermissionId) {
48          return getService().createResourcePermission(resourcePermissionId);
49      }
50  
51      public static void deleteResourcePermission(long resourcePermissionId)
52          throws com.liferay.portal.PortalException,
53              com.liferay.portal.SystemException {
54          getService().deleteResourcePermission(resourcePermissionId);
55      }
56  
57      public static void deleteResourcePermission(
58          com.liferay.portal.model.ResourcePermission resourcePermission)
59          throws com.liferay.portal.SystemException {
60          getService().deleteResourcePermission(resourcePermission);
61      }
62  
63      public static java.util.List<Object> dynamicQuery(
64          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
65          throws com.liferay.portal.SystemException {
66          return getService().dynamicQuery(dynamicQuery);
67      }
68  
69      public static java.util.List<Object> dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
71          int end) throws com.liferay.portal.SystemException {
72          return getService().dynamicQuery(dynamicQuery, start, end);
73      }
74  
75      public static java.util.List<Object> dynamicQuery(
76          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
77          int end,
78          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
79          throws com.liferay.portal.SystemException {
80          return getService()
81                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
82      }
83  
84      public static int dynamicQueryCount(
85          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
86          throws com.liferay.portal.SystemException {
87          return getService().dynamicQueryCount(dynamicQuery);
88      }
89  
90      public static com.liferay.portal.model.ResourcePermission getResourcePermission(
91          long resourcePermissionId)
92          throws com.liferay.portal.PortalException,
93              com.liferay.portal.SystemException {
94          return getService().getResourcePermission(resourcePermissionId);
95      }
96  
97      public static java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions(
98          int start, int end) throws com.liferay.portal.SystemException {
99          return getService().getResourcePermissions(start, end);
100     }
101 
102     public static int getResourcePermissionsCount()
103         throws com.liferay.portal.SystemException {
104         return getService().getResourcePermissionsCount();
105     }
106 
107     public static com.liferay.portal.model.ResourcePermission updateResourcePermission(
108         com.liferay.portal.model.ResourcePermission resourcePermission)
109         throws com.liferay.portal.SystemException {
110         return getService().updateResourcePermission(resourcePermission);
111     }
112 
113     public static com.liferay.portal.model.ResourcePermission updateResourcePermission(
114         com.liferay.portal.model.ResourcePermission resourcePermission,
115         boolean merge) throws com.liferay.portal.SystemException {
116         return getService().updateResourcePermission(resourcePermission, merge);
117     }
118 
119     public static void addResourcePermission(long companyId,
120         java.lang.String name, int scope, java.lang.String primKey,
121         long roleId, java.lang.String actionId)
122         throws com.liferay.portal.PortalException,
123             com.liferay.portal.SystemException {
124         getService()
125             .addResourcePermission(companyId, name, scope, primKey, roleId,
126             actionId);
127     }
128 
129     public static java.util.List<String> getAvailableResourcePermissionActionIds(
130         long companyId, java.lang.String name, int scope,
131         java.lang.String primKey, long roleId, java.util.List<String> actionIds)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException {
134         return getService()
135                    .getAvailableResourcePermissionActionIds(companyId, name,
136             scope, primKey, roleId, actionIds);
137     }
138 
139     public static int getResourcePermissionsCount(long companyId,
140         java.lang.String name, int scope, java.lang.String primKey)
141         throws com.liferay.portal.SystemException {
142         return getService()
143                    .getResourcePermissionsCount(companyId, name, scope, primKey);
144     }
145 
146     public static java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions(
147         long roleId) throws com.liferay.portal.SystemException {
148         return getService().getRoleResourcePermissions(roleId);
149     }
150 
151     public static java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions(
152         long roleId, int[] scopes, int start, int end)
153         throws com.liferay.portal.SystemException {
154         return getService()
155                    .getRoleResourcePermissions(roleId, scopes, start, end);
156     }
157 
158     public static boolean hasActionId(
159         com.liferay.portal.model.ResourcePermission resourcePermission,
160         com.liferay.portal.model.ResourceAction resourceAction) {
161         return getService().hasActionId(resourcePermission, resourceAction);
162     }
163 
164     public static boolean hasResourcePermission(long companyId,
165         java.lang.String name, int scope, java.lang.String primKey,
166         long roleId, java.lang.String actionId)
167         throws com.liferay.portal.PortalException,
168             com.liferay.portal.SystemException {
169         return getService()
170                    .hasResourcePermission(companyId, name, scope, primKey,
171             roleId, actionId);
172     }
173 
174     public static boolean hasScopeResourcePermission(long companyId,
175         java.lang.String name, int scope, long roleId, java.lang.String actionId)
176         throws com.liferay.portal.PortalException,
177             com.liferay.portal.SystemException {
178         return getService()
179                    .hasScopeResourcePermission(companyId, name, scope, roleId,
180             actionId);
181     }
182 
183     public static void mergePermissions(long fromRoleId, long toRoleId)
184         throws com.liferay.portal.PortalException,
185             com.liferay.portal.SystemException {
186         getService().mergePermissions(fromRoleId, toRoleId);
187     }
188 
189     public static void reassignPermissions(long resourcePermissionId,
190         long toRoleId)
191         throws com.liferay.portal.PortalException,
192             com.liferay.portal.SystemException {
193         getService().reassignPermissions(resourcePermissionId, toRoleId);
194     }
195 
196     public static void removeResourcePermission(long companyId,
197         java.lang.String name, int scope, java.lang.String primKey,
198         long roleId, java.lang.String actionId)
199         throws com.liferay.portal.PortalException,
200             com.liferay.portal.SystemException {
201         getService()
202             .removeResourcePermission(companyId, name, scope, primKey, roleId,
203             actionId);
204     }
205 
206     public static void removeResourcePermissions(long companyId,
207         java.lang.String name, int scope, long roleId, java.lang.String actionId)
208         throws com.liferay.portal.PortalException,
209             com.liferay.portal.SystemException {
210         getService()
211             .removeResourcePermissions(companyId, name, scope, roleId, actionId);
212     }
213 
214     public static void setResourcePermissions(long companyId,
215         java.lang.String name, int scope, java.lang.String primKey,
216         long roleId, java.lang.String[] actionIds)
217         throws com.liferay.portal.PortalException,
218             com.liferay.portal.SystemException {
219         getService()
220             .setResourcePermissions(companyId, name, scope, primKey, roleId,
221             actionIds);
222     }
223 
224     public static ResourcePermissionLocalService getService() {
225         if (_service == null) {
226             _service = (ResourcePermissionLocalService)PortalBeanLocatorUtil.locate(ResourcePermissionLocalService.class.getName());
227         }
228 
229         return _service;
230     }
231 
232     public void setService(ResourcePermissionLocalService service) {
233         _service = service;
234     }
235 
236     private static ResourcePermissionLocalService _service;
237 }