1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="RoleServiceUtil.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 RoleService} 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       RoleService
37   * @generated
38   */
39  public class RoleServiceUtil {
40      public static com.liferay.portal.model.Role addRole(java.lang.String name,
41          java.lang.String description, int type)
42          throws com.liferay.portal.PortalException,
43              com.liferay.portal.SystemException, java.rmi.RemoteException {
44          return getService().addRole(name, description, type);
45      }
46  
47      public static void addUserRoles(long userId, long[] roleIds)
48          throws com.liferay.portal.PortalException,
49              com.liferay.portal.SystemException, java.rmi.RemoteException {
50          getService().addUserRoles(userId, roleIds);
51      }
52  
53      public static void deleteRole(long roleId)
54          throws com.liferay.portal.PortalException,
55              com.liferay.portal.SystemException, java.rmi.RemoteException {
56          getService().deleteRole(roleId);
57      }
58  
59      public static com.liferay.portal.model.Role getGroupRole(long companyId,
60          long groupId)
61          throws com.liferay.portal.PortalException,
62              com.liferay.portal.SystemException, java.rmi.RemoteException {
63          return getService().getGroupRole(companyId, groupId);
64      }
65  
66      public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
67          long groupId)
68          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
69          return getService().getGroupRoles(groupId);
70      }
71  
72      public static com.liferay.portal.model.Role getRole(long roleId)
73          throws com.liferay.portal.PortalException,
74              com.liferay.portal.SystemException, java.rmi.RemoteException {
75          return getService().getRole(roleId);
76      }
77  
78      public static com.liferay.portal.model.Role getRole(long companyId,
79          java.lang.String name)
80          throws com.liferay.portal.PortalException,
81              com.liferay.portal.SystemException, java.rmi.RemoteException {
82          return getService().getRole(companyId, name);
83      }
84  
85      public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
86          long userId, long groupId)
87          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
88          return getService().getUserGroupRoles(userId, groupId);
89      }
90  
91      public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
92          long userId, java.util.List<com.liferay.portal.model.Group> groups)
93          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
94          return getService().getUserRelatedRoles(userId, groups);
95      }
96  
97      public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
98          long userId)
99          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
100         return getService().getUserRoles(userId);
101     }
102 
103     public static boolean hasUserRole(long userId, long companyId,
104         java.lang.String name, boolean inherited)
105         throws com.liferay.portal.PortalException,
106             com.liferay.portal.SystemException, java.rmi.RemoteException {
107         return getService().hasUserRole(userId, companyId, name, inherited);
108     }
109 
110     public static boolean hasUserRoles(long userId, long companyId,
111         java.lang.String[] names, boolean inherited)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException, java.rmi.RemoteException {
114         return getService().hasUserRoles(userId, companyId, names, inherited);
115     }
116 
117     public static void unsetUserRoles(long userId, long[] roleIds)
118         throws com.liferay.portal.PortalException,
119             com.liferay.portal.SystemException, java.rmi.RemoteException {
120         getService().unsetUserRoles(userId, roleIds);
121     }
122 
123     public static com.liferay.portal.model.Role updateRole(long roleId,
124         java.lang.String name, java.lang.String description)
125         throws com.liferay.portal.PortalException,
126             com.liferay.portal.SystemException, java.rmi.RemoteException {
127         return getService().updateRole(roleId, name, description);
128     }
129 
130     public static RoleService getService() {
131         if (_service == null) {
132             _service = (RoleService)PortalBeanLocatorUtil.locate(RoleService.class.getName());
133         }
134 
135         return _service;
136     }
137 
138     public void setService(RoleService service) {
139         _service = service;
140     }
141 
142     private static RoleService _service;
143 }