1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
26  
27  /**
28   * <a href="RoleLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
29   *
30   * <p>
31   * ServiceBuilder generated this class. Modifications in this class will be
32   * overwritten the next time is generated.
33   * </p>
34   *
35   * <p>
36   * This class provides static methods for the
37   * {@link RoleLocalService} bean. The static methods of
38   * this class calls the same methods of the bean instance. It's convenient to be
39   * able to just write one line to call a method on a bean instead of writing a
40   * lookup call and a method call.
41   * </p>
42   *
43   * @author    Brian Wing Shun Chan
44   * @see       RoleLocalService
45   * @generated
46   */
47  public class RoleLocalServiceUtil {
48      public static com.liferay.portal.model.Role addRole(
49          com.liferay.portal.model.Role role)
50          throws com.liferay.portal.SystemException {
51          return getService().addRole(role);
52      }
53  
54      public static com.liferay.portal.model.Role createRole(long roleId) {
55          return getService().createRole(roleId);
56      }
57  
58      public static void deleteRole(long roleId)
59          throws com.liferay.portal.PortalException,
60              com.liferay.portal.SystemException {
61          getService().deleteRole(roleId);
62      }
63  
64      public static void deleteRole(com.liferay.portal.model.Role role)
65          throws com.liferay.portal.SystemException {
66          getService().deleteRole(role);
67      }
68  
69      public static java.util.List<Object> dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
71          throws com.liferay.portal.SystemException {
72          return getService().dynamicQuery(dynamicQuery);
73      }
74  
75      public static java.util.List<Object> dynamicQuery(
76          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
77          int end) throws com.liferay.portal.SystemException {
78          return getService().dynamicQuery(dynamicQuery, start, end);
79      }
80  
81      public static com.liferay.portal.model.Role getRole(long roleId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService().getRole(roleId);
85      }
86  
87      public static java.util.List<com.liferay.portal.model.Role> getRoles(
88          int start, int end) throws com.liferay.portal.SystemException {
89          return getService().getRoles(start, end);
90      }
91  
92      public static int getRolesCount() throws com.liferay.portal.SystemException {
93          return getService().getRolesCount();
94      }
95  
96      public static com.liferay.portal.model.Role updateRole(
97          com.liferay.portal.model.Role role)
98          throws com.liferay.portal.SystemException {
99          return getService().updateRole(role);
100     }
101 
102     public static com.liferay.portal.model.Role updateRole(
103         com.liferay.portal.model.Role role, boolean merge)
104         throws com.liferay.portal.SystemException {
105         return getService().updateRole(role, merge);
106     }
107 
108     public static com.liferay.portal.model.Role addRole(long userId,
109         long companyId, java.lang.String name, java.lang.String description,
110         int type)
111         throws com.liferay.portal.PortalException,
112             com.liferay.portal.SystemException {
113         return getService().addRole(userId, companyId, name, description, type);
114     }
115 
116     public static com.liferay.portal.model.Role addRole(long userId,
117         long companyId, java.lang.String name, java.lang.String description,
118         int type, java.lang.String className, long classPK)
119         throws com.liferay.portal.PortalException,
120             com.liferay.portal.SystemException {
121         return getService()
122                    .addRole(userId, companyId, name, description, type,
123             className, classPK);
124     }
125 
126     public static void addUserRoles(long userId, long[] roleIds)
127         throws com.liferay.portal.SystemException {
128         getService().addUserRoles(userId, roleIds);
129     }
130 
131     public static void checkSystemRoles(long companyId)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException {
134         getService().checkSystemRoles(companyId);
135     }
136 
137     public static com.liferay.portal.model.Role getGroupRole(long companyId,
138         long groupId)
139         throws com.liferay.portal.PortalException,
140             com.liferay.portal.SystemException {
141         return getService().getGroupRole(companyId, groupId);
142     }
143 
144     public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
145         long groupId) throws com.liferay.portal.SystemException {
146         return getService().getGroupRoles(groupId);
147     }
148 
149     public static java.util.Map<String, java.util.List<String>> getResourceRoles(
150         long companyId, java.lang.String name, int scope,
151         java.lang.String primKey) throws com.liferay.portal.SystemException {
152         return getService().getResourceRoles(companyId, name, scope, primKey);
153     }
154 
155     public static com.liferay.portal.model.Role getRole(long companyId,
156         java.lang.String name)
157         throws com.liferay.portal.PortalException,
158             com.liferay.portal.SystemException {
159         return getService().getRole(companyId, name);
160     }
161 
162     public static java.util.List<com.liferay.portal.model.Role> getRoles(
163         long companyId) throws com.liferay.portal.SystemException {
164         return getService().getRoles(companyId);
165     }
166 
167     public static java.util.List<com.liferay.portal.model.Role> getRoles(
168         long[] roleIds)
169         throws com.liferay.portal.PortalException,
170             com.liferay.portal.SystemException {
171         return getService().getRoles(roleIds);
172     }
173 
174     public static java.util.List<com.liferay.portal.model.Role> getRoles(
175         int type, java.lang.String subtype)
176         throws com.liferay.portal.SystemException {
177         return getService().getRoles(type, subtype);
178     }
179 
180     public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
181         java.lang.String subtype) throws com.liferay.portal.SystemException {
182         return getService().getSubtypeRoles(subtype);
183     }
184 
185     public static int getSubtypeRolesCount(java.lang.String subtype)
186         throws com.liferay.portal.SystemException {
187         return getService().getSubtypeRolesCount(subtype);
188     }
189 
190     public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
191         long userId, long groupId) throws com.liferay.portal.SystemException {
192         return getService().getUserGroupGroupRoles(userId, groupId);
193     }
194 
195     public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
196         long userId, long groupId) throws com.liferay.portal.SystemException {
197         return getService().getUserGroupRoles(userId, groupId);
198     }
199 
200     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
201         long userId, long groupId) throws com.liferay.portal.SystemException {
202         return getService().getUserRelatedRoles(userId, groupId);
203     }
204 
205     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
206         long userId, long[] groupIds) throws com.liferay.portal.SystemException {
207         return getService().getUserRelatedRoles(userId, groupIds);
208     }
209 
210     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
211         long userId, java.util.List<com.liferay.portal.model.Group> groups)
212         throws com.liferay.portal.SystemException {
213         return getService().getUserRelatedRoles(userId, groups);
214     }
215 
216     public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
217         long userId) throws com.liferay.portal.SystemException {
218         return getService().getUserRoles(userId);
219     }
220 
221     public static boolean hasUserRole(long userId, long roleId)
222         throws com.liferay.portal.SystemException {
223         return getService().hasUserRole(userId, roleId);
224     }
225 
226     public static boolean hasUserRole(long userId, long companyId,
227         java.lang.String name, boolean inherited)
228         throws com.liferay.portal.PortalException,
229             com.liferay.portal.SystemException {
230         return getService().hasUserRole(userId, companyId, name, inherited);
231     }
232 
233     public static boolean hasUserRoles(long userId, long companyId,
234         java.lang.String[] names, boolean inherited)
235         throws com.liferay.portal.PortalException,
236             com.liferay.portal.SystemException {
237         return getService().hasUserRoles(userId, companyId, names, inherited);
238     }
239 
240     public static java.util.List<com.liferay.portal.model.Role> search(
241         long companyId, java.lang.String name, java.lang.String description,
242         java.lang.Integer type, int start, int end,
243         com.liferay.portal.kernel.util.OrderByComparator obc)
244         throws com.liferay.portal.SystemException {
245         return getService()
246                    .search(companyId, name, description, type, start, end, obc);
247     }
248 
249     public static java.util.List<com.liferay.portal.model.Role> search(
250         long companyId, java.lang.String name, java.lang.String description,
251         java.lang.Integer type, java.util.LinkedHashMap<String, Object> params,
252         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
253         throws com.liferay.portal.SystemException {
254         return getService()
255                    .search(companyId, name, description, type, params, start,
256             end, obc);
257     }
258 
259     public static int searchCount(long companyId, java.lang.String name,
260         java.lang.String description, java.lang.Integer type)
261         throws com.liferay.portal.SystemException {
262         return getService().searchCount(companyId, name, description, type);
263     }
264 
265     public static int searchCount(long companyId, java.lang.String name,
266         java.lang.String description, java.lang.Integer type,
267         java.util.LinkedHashMap<String, Object> params)
268         throws com.liferay.portal.SystemException {
269         return getService()
270                    .searchCount(companyId, name, description, type, params);
271     }
272 
273     public static void setUserRoles(long userId, long[] roleIds)
274         throws com.liferay.portal.PortalException,
275             com.liferay.portal.SystemException {
276         getService().setUserRoles(userId, roleIds);
277     }
278 
279     public static void unsetUserRoles(long userId, long[] roleIds)
280         throws com.liferay.portal.PortalException,
281             com.liferay.portal.SystemException {
282         getService().unsetUserRoles(userId, roleIds);
283     }
284 
285     public static com.liferay.portal.model.Role updateRole(long roleId,
286         java.lang.String name,
287         java.util.Map<java.util.Locale, String> localeTitlesMap,
288         java.lang.String description, java.lang.String subtype)
289         throws com.liferay.portal.PortalException,
290             com.liferay.portal.SystemException {
291         return getService()
292                    .updateRole(roleId, name, localeTitlesMap, description,
293             subtype);
294     }
295 
296     public static RoleLocalService getService() {
297         if (_service == null) {
298             _service = (RoleLocalService)PortalBeanLocatorUtil.locate(RoleLocalService.class.getName());
299         }
300 
301         return _service;
302     }
303 
304     public void setService(RoleLocalService service) {
305         _service = service;
306     }
307 
308     private static RoleLocalService _service;
309 }