001
014
015 package com.liferay.portal.service.http;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.log.Log;
020 import com.liferay.portal.kernel.log.LogFactoryUtil;
021 import com.liferay.portal.kernel.util.LocalizationUtil;
022 import com.liferay.portal.service.RoleServiceUtil;
023
024 import java.rmi.RemoteException;
025
026 import java.util.Locale;
027 import java.util.Map;
028
029
069 @ProviderType
070 public class RoleServiceSoap {
071
089 public static com.liferay.portal.model.RoleSoap addRole(
090 java.lang.String className, long classPK, java.lang.String name,
091 java.lang.String[] titleMapLanguageIds,
092 java.lang.String[] titleMapValues,
093 java.lang.String[] descriptionMapLanguageIds,
094 java.lang.String[] descriptionMapValues, int type,
095 java.lang.String subtype,
096 com.liferay.portal.service.ServiceContext serviceContext)
097 throws RemoteException {
098 try {
099 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
100 titleMapValues);
101 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
102 descriptionMapValues);
103
104 com.liferay.portal.model.Role returnValue = RoleServiceUtil.addRole(className,
105 classPK, name, titleMap, descriptionMap, type, subtype,
106 serviceContext);
107
108 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
109 }
110 catch (Exception e) {
111 _log.error(e, e);
112
113 throw new RemoteException(e.getMessage());
114 }
115 }
116
117
124 public static void addUserRoles(long userId, long[] roleIds)
125 throws RemoteException {
126 try {
127 RoleServiceUtil.addUserRoles(userId, roleIds);
128 }
129 catch (Exception e) {
130 _log.error(e, e);
131
132 throw new RemoteException(e.getMessage());
133 }
134 }
135
136
141 public static void deleteRole(long roleId) throws RemoteException {
142 try {
143 RoleServiceUtil.deleteRole(roleId);
144 }
145 catch (Exception e) {
146 _log.error(e, e);
147
148 throw new RemoteException(e.getMessage());
149 }
150 }
151
152 public static com.liferay.portal.model.RoleSoap fetchRole(long roleId)
153 throws RemoteException {
154 try {
155 com.liferay.portal.model.Role returnValue = RoleServiceUtil.fetchRole(roleId);
156
157 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
158 }
159 catch (Exception e) {
160 _log.error(e, e);
161
162 throw new RemoteException(e.getMessage());
163 }
164 }
165
166
172 public static com.liferay.portal.model.RoleSoap[] getGroupRoles(
173 long groupId) throws RemoteException {
174 try {
175 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getGroupRoles(groupId);
176
177 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
178 }
179 catch (Exception e) {
180 _log.error(e, e);
181
182 throw new RemoteException(e.getMessage());
183 }
184 }
185
186
192 public static com.liferay.portal.model.RoleSoap getRole(long roleId)
193 throws RemoteException {
194 try {
195 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(roleId);
196
197 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
198 }
199 catch (Exception e) {
200 _log.error(e, e);
201
202 throw new RemoteException(e.getMessage());
203 }
204 }
205
206
218 public static com.liferay.portal.model.RoleSoap getRole(long companyId,
219 java.lang.String name) throws RemoteException {
220 try {
221 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(companyId,
222 name);
223
224 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
225 }
226 catch (Exception e) {
227 _log.error(e, e);
228
229 throw new RemoteException(e.getMessage());
230 }
231 }
232
233 public static com.liferay.portal.model.RoleSoap[] getRoles(int type,
234 java.lang.String subtype) throws RemoteException {
235 try {
236 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getRoles(type,
237 subtype);
238
239 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
240 }
241 catch (Exception e) {
242 _log.error(e, e);
243
244 throw new RemoteException(e.getMessage());
245 }
246 }
247
248 public static com.liferay.portal.model.RoleSoap[] getRoles(long companyId,
249 int[] types) throws RemoteException {
250 try {
251 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getRoles(companyId,
252 types);
253
254 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
255 }
256 catch (Exception e) {
257 _log.error(e, e);
258
259 throw new RemoteException(e.getMessage());
260 }
261 }
262
263
270 public static com.liferay.portal.model.RoleSoap[] getUserGroupGroupRoles(
271 long userId, long groupId) throws RemoteException {
272 try {
273 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupGroupRoles(userId,
274 groupId);
275
276 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
277 }
278 catch (Exception e) {
279 _log.error(e, e);
280
281 throw new RemoteException(e.getMessage());
282 }
283 }
284
285
292 public static com.liferay.portal.model.RoleSoap[] getUserGroupRoles(
293 long userId, long groupId) throws RemoteException {
294 try {
295 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupRoles(userId,
296 groupId);
297
298 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
299 }
300 catch (Exception e) {
301 _log.error(e, e);
302
303 throw new RemoteException(e.getMessage());
304 }
305 }
306
307
314 public static com.liferay.portal.model.RoleSoap[] getUserRelatedRoles(
315 long userId, com.liferay.portal.model.GroupSoap[] groups)
316 throws RemoteException {
317 try {
318 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRelatedRoles(userId,
319 com.liferay.portal.model.impl.GroupModelImpl.toModels(
320 groups));
321
322 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
323 }
324 catch (Exception e) {
325 _log.error(e, e);
326
327 throw new RemoteException(e.getMessage());
328 }
329 }
330
331
337 public static com.liferay.portal.model.RoleSoap[] getUserRoles(long userId)
338 throws RemoteException {
339 try {
340 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRoles(userId);
341
342 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
343 }
344 catch (Exception e) {
345 _log.error(e, e);
346
347 throw new RemoteException(e.getMessage());
348 }
349 }
350
351
363 public static boolean hasUserRole(long userId, long companyId,
364 java.lang.String name, boolean inherited) throws RemoteException {
365 try {
366 boolean returnValue = RoleServiceUtil.hasUserRole(userId,
367 companyId, name, inherited);
368
369 return returnValue;
370 }
371 catch (Exception e) {
372 _log.error(e, e);
373
374 throw new RemoteException(e.getMessage());
375 }
376 }
377
378
390 public static boolean hasUserRoles(long userId, long companyId,
391 java.lang.String[] names, boolean inherited) throws RemoteException {
392 try {
393 boolean returnValue = RoleServiceUtil.hasUserRoles(userId,
394 companyId, names, inherited);
395
396 return returnValue;
397 }
398 catch (Exception e) {
399 _log.error(e, e);
400
401 throw new RemoteException(e.getMessage());
402 }
403 }
404
405
412 public static void unsetUserRoles(long userId, long[] roleIds)
413 throws RemoteException {
414 try {
415 RoleServiceUtil.unsetUserRoles(userId, roleIds);
416 }
417 catch (Exception e) {
418 _log.error(e, e);
419
420 throw new RemoteException(e.getMessage());
421 }
422 }
423
424
439 public static com.liferay.portal.model.RoleSoap updateRole(long roleId,
440 java.lang.String name, java.lang.String[] titleMapLanguageIds,
441 java.lang.String[] titleMapValues,
442 java.lang.String[] descriptionMapLanguageIds,
443 java.lang.String[] descriptionMapValues, java.lang.String subtype,
444 com.liferay.portal.service.ServiceContext serviceContext)
445 throws RemoteException {
446 try {
447 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
448 titleMapValues);
449 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
450 descriptionMapValues);
451
452 com.liferay.portal.model.Role returnValue = RoleServiceUtil.updateRole(roleId,
453 name, titleMap, descriptionMap, subtype, serviceContext);
454
455 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
456 }
457 catch (Exception e) {
458 _log.error(e, e);
459
460 throw new RemoteException(e.getMessage());
461 }
462 }
463
464 private static Log _log = LogFactoryUtil.getLog(RoleServiceSoap.class);
465 }