1
19
20 package com.liferay.portal.service.http;
21
22 import com.liferay.portal.kernel.log.Log;
23 import com.liferay.portal.kernel.log.LogFactoryUtil;
24 import com.liferay.portal.service.RoleServiceUtil;
25
26 import java.rmi.RemoteException;
27
28
79 public class RoleServiceSoap {
80 public static com.liferay.portal.model.RoleSoap addRole(
81 java.lang.String name, java.lang.String description, int type)
82 throws RemoteException {
83 try {
84 com.liferay.portal.model.Role returnValue = RoleServiceUtil.addRole(name,
85 description, type);
86
87 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
88 }
89 catch (Exception e) {
90 _log.error(e, e);
91
92 throw new RemoteException(e.getMessage());
93 }
94 }
95
96 public static void addUserRoles(long userId, long[] roleIds)
97 throws RemoteException {
98 try {
99 RoleServiceUtil.addUserRoles(userId, roleIds);
100 }
101 catch (Exception e) {
102 _log.error(e, e);
103
104 throw new RemoteException(e.getMessage());
105 }
106 }
107
108 public static void deleteRole(long roleId) throws RemoteException {
109 try {
110 RoleServiceUtil.deleteRole(roleId);
111 }
112 catch (Exception e) {
113 _log.error(e, e);
114
115 throw new RemoteException(e.getMessage());
116 }
117 }
118
119 public static com.liferay.portal.model.RoleSoap getGroupRole(
120 long companyId, long groupId) throws RemoteException {
121 try {
122 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getGroupRole(companyId,
123 groupId);
124
125 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
126 }
127 catch (Exception e) {
128 _log.error(e, e);
129
130 throw new RemoteException(e.getMessage());
131 }
132 }
133
134 public static com.liferay.portal.model.RoleSoap[] getGroupRoles(
135 long groupId) throws RemoteException {
136 try {
137 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getGroupRoles(groupId);
138
139 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
140 }
141 catch (Exception e) {
142 _log.error(e, e);
143
144 throw new RemoteException(e.getMessage());
145 }
146 }
147
148 public static com.liferay.portal.model.RoleSoap getRole(long roleId)
149 throws RemoteException {
150 try {
151 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(roleId);
152
153 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
154 }
155 catch (Exception e) {
156 _log.error(e, e);
157
158 throw new RemoteException(e.getMessage());
159 }
160 }
161
162 public static com.liferay.portal.model.RoleSoap getRole(long companyId,
163 java.lang.String name) throws RemoteException {
164 try {
165 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(companyId,
166 name);
167
168 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
169 }
170 catch (Exception e) {
171 _log.error(e, e);
172
173 throw new RemoteException(e.getMessage());
174 }
175 }
176
177 public static com.liferay.portal.model.RoleSoap[] getUserGroupRoles(
178 long userId, long groupId) throws RemoteException {
179 try {
180 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupRoles(userId,
181 groupId);
182
183 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
184 }
185 catch (Exception e) {
186 _log.error(e, e);
187
188 throw new RemoteException(e.getMessage());
189 }
190 }
191
192 public static com.liferay.portal.model.RoleSoap[] getUserRelatedRoles(
193 long userId, com.liferay.portal.model.GroupSoap[] groups)
194 throws RemoteException {
195 try {
196 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRelatedRoles(userId,
197 com.liferay.portal.model.impl.GroupModelImpl.toModels(
198 groups));
199
200 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
201 }
202 catch (Exception e) {
203 _log.error(e, e);
204
205 throw new RemoteException(e.getMessage());
206 }
207 }
208
209 public static com.liferay.portal.model.RoleSoap[] getUserRoles(long userId)
210 throws RemoteException {
211 try {
212 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRoles(userId);
213
214 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
215 }
216 catch (Exception e) {
217 _log.error(e, e);
218
219 throw new RemoteException(e.getMessage());
220 }
221 }
222
223 public static boolean hasUserRole(long userId, long companyId,
224 java.lang.String name, boolean inherited) throws RemoteException {
225 try {
226 boolean returnValue = RoleServiceUtil.hasUserRole(userId,
227 companyId, name, inherited);
228
229 return returnValue;
230 }
231 catch (Exception e) {
232 _log.error(e, e);
233
234 throw new RemoteException(e.getMessage());
235 }
236 }
237
238 public static boolean hasUserRoles(long userId, long companyId,
239 java.lang.String[] names, boolean inherited) throws RemoteException {
240 try {
241 boolean returnValue = RoleServiceUtil.hasUserRoles(userId,
242 companyId, names, inherited);
243
244 return returnValue;
245 }
246 catch (Exception e) {
247 _log.error(e, e);
248
249 throw new RemoteException(e.getMessage());
250 }
251 }
252
253 public static void unsetUserRoles(long userId, long[] roleIds)
254 throws RemoteException {
255 try {
256 RoleServiceUtil.unsetUserRoles(userId, roleIds);
257 }
258 catch (Exception e) {
259 _log.error(e, e);
260
261 throw new RemoteException(e.getMessage());
262 }
263 }
264
265 public static com.liferay.portal.model.RoleSoap updateRole(long roleId,
266 java.lang.String name, java.lang.String description)
267 throws RemoteException {
268 try {
269 com.liferay.portal.model.Role returnValue = RoleServiceUtil.updateRole(roleId,
270 name, description);
271
272 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
273 }
274 catch (Exception e) {
275 _log.error(e, e);
276
277 throw new RemoteException(e.getMessage());
278 }
279 }
280
281 private static Log _log = LogFactoryUtil.getLog(RoleServiceSoap.class);
282 }