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
093 public static com.liferay.portal.model.RoleSoap addRole(
094 java.lang.String className, long classPK, java.lang.String name,
095 java.lang.String[] titleMapLanguageIds,
096 java.lang.String[] titleMapValues,
097 java.lang.String[] descriptionMapLanguageIds,
098 java.lang.String[] descriptionMapValues, int type,
099 java.lang.String subtype,
100 com.liferay.portal.service.ServiceContext serviceContext)
101 throws RemoteException {
102 try {
103 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
104 titleMapValues);
105 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
106 descriptionMapValues);
107
108 com.liferay.portal.model.Role returnValue = RoleServiceUtil.addRole(className,
109 classPK, name, titleMap, descriptionMap, type, subtype,
110 serviceContext);
111
112 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
113 }
114 catch (Exception e) {
115 _log.error(e, e);
116
117 throw new RemoteException(e.getMessage());
118 }
119 }
120
121
138 @Deprecated
139 public static com.liferay.portal.model.RoleSoap addRole(
140 java.lang.String name, java.lang.String[] titleMapLanguageIds,
141 java.lang.String[] titleMapValues,
142 java.lang.String[] descriptionMapLanguageIds,
143 java.lang.String[] descriptionMapValues, int type)
144 throws RemoteException {
145 try {
146 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
147 titleMapValues);
148 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
149 descriptionMapValues);
150
151 com.liferay.portal.model.Role returnValue = RoleServiceUtil.addRole(name,
152 titleMap, descriptionMap, type);
153
154 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
155 }
156 catch (Exception e) {
157 _log.error(e, e);
158
159 throw new RemoteException(e.getMessage());
160 }
161 }
162
163
173 public static void addUserRoles(long userId, long[] roleIds)
174 throws RemoteException {
175 try {
176 RoleServiceUtil.addUserRoles(userId, roleIds);
177 }
178 catch (Exception e) {
179 _log.error(e, e);
180
181 throw new RemoteException(e.getMessage());
182 }
183 }
184
185
194 public static void deleteRole(long roleId) throws RemoteException {
195 try {
196 RoleServiceUtil.deleteRole(roleId);
197 }
198 catch (Exception e) {
199 _log.error(e, e);
200
201 throw new RemoteException(e.getMessage());
202 }
203 }
204
205 public static com.liferay.portal.model.RoleSoap fetchRole(long roleId)
206 throws RemoteException {
207 try {
208 com.liferay.portal.model.Role returnValue = RoleServiceUtil.fetchRole(roleId);
209
210 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
211 }
212 catch (Exception e) {
213 _log.error(e, e);
214
215 throw new RemoteException(e.getMessage());
216 }
217 }
218
219
226 public static com.liferay.portal.model.RoleSoap[] getGroupRoles(
227 long groupId) throws RemoteException {
228 try {
229 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getGroupRoles(groupId);
230
231 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
232 }
233 catch (Exception e) {
234 _log.error(e, e);
235
236 throw new RemoteException(e.getMessage());
237 }
238 }
239
240
248 public static com.liferay.portal.model.RoleSoap getRole(long roleId)
249 throws RemoteException {
250 try {
251 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(roleId);
252
253 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
254 }
255 catch (Exception e) {
256 _log.error(e, e);
257
258 throw new RemoteException(e.getMessage());
259 }
260 }
261
262
276 public static com.liferay.portal.model.RoleSoap getRole(long companyId,
277 java.lang.String name) throws RemoteException {
278 try {
279 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(companyId,
280 name);
281
282 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
283 }
284 catch (Exception e) {
285 _log.error(e, e);
286
287 throw new RemoteException(e.getMessage());
288 }
289 }
290
291 public static com.liferay.portal.model.RoleSoap[] getRoles(int type,
292 java.lang.String subtype) throws RemoteException {
293 try {
294 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getRoles(type,
295 subtype);
296
297 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
298 }
299 catch (Exception e) {
300 _log.error(e, e);
301
302 throw new RemoteException(e.getMessage());
303 }
304 }
305
306 public static com.liferay.portal.model.RoleSoap[] getRoles(long companyId,
307 int[] types) throws RemoteException {
308 try {
309 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getRoles(companyId,
310 types);
311
312 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
313 }
314 catch (Exception e) {
315 _log.error(e, e);
316
317 throw new RemoteException(e.getMessage());
318 }
319 }
320
321
329 public static com.liferay.portal.model.RoleSoap[] getUserGroupGroupRoles(
330 long userId, long groupId) throws RemoteException {
331 try {
332 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupGroupRoles(userId,
333 groupId);
334
335 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
336 }
337 catch (Exception e) {
338 _log.error(e, e);
339
340 throw new RemoteException(e.getMessage());
341 }
342 }
343
344
352 public static com.liferay.portal.model.RoleSoap[] getUserGroupRoles(
353 long userId, long groupId) throws RemoteException {
354 try {
355 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupRoles(userId,
356 groupId);
357
358 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
359 }
360 catch (Exception e) {
361 _log.error(e, e);
362
363 throw new RemoteException(e.getMessage());
364 }
365 }
366
367
375 public static com.liferay.portal.model.RoleSoap[] getUserRelatedRoles(
376 long userId, com.liferay.portal.model.GroupSoap[] groups)
377 throws RemoteException {
378 try {
379 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRelatedRoles(userId,
380 com.liferay.portal.model.impl.GroupModelImpl.toModels(
381 groups));
382
383 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
384 }
385 catch (Exception e) {
386 _log.error(e, e);
387
388 throw new RemoteException(e.getMessage());
389 }
390 }
391
392
399 public static com.liferay.portal.model.RoleSoap[] getUserRoles(long userId)
400 throws RemoteException {
401 try {
402 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRoles(userId);
403
404 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
405 }
406 catch (Exception e) {
407 _log.error(e, e);
408
409 throw new RemoteException(e.getMessage());
410 }
411 }
412
413
427 public static boolean hasUserRole(long userId, long companyId,
428 java.lang.String name, boolean inherited) throws RemoteException {
429 try {
430 boolean returnValue = RoleServiceUtil.hasUserRole(userId,
431 companyId, name, inherited);
432
433 return returnValue;
434 }
435 catch (Exception e) {
436 _log.error(e, e);
437
438 throw new RemoteException(e.getMessage());
439 }
440 }
441
442
457 public static boolean hasUserRoles(long userId, long companyId,
458 java.lang.String[] names, boolean inherited) throws RemoteException {
459 try {
460 boolean returnValue = RoleServiceUtil.hasUserRoles(userId,
461 companyId, names, inherited);
462
463 return returnValue;
464 }
465 catch (Exception e) {
466 _log.error(e, e);
467
468 throw new RemoteException(e.getMessage());
469 }
470 }
471
472
483 public static void unsetUserRoles(long userId, long[] roleIds)
484 throws RemoteException {
485 try {
486 RoleServiceUtil.unsetUserRoles(userId, roleIds);
487 }
488 catch (Exception e) {
489 _log.error(e, e);
490
491 throw new RemoteException(e.getMessage());
492 }
493 }
494
495
513 public static com.liferay.portal.model.RoleSoap updateRole(long roleId,
514 java.lang.String name, java.lang.String[] titleMapLanguageIds,
515 java.lang.String[] titleMapValues,
516 java.lang.String[] descriptionMapLanguageIds,
517 java.lang.String[] descriptionMapValues, java.lang.String subtype,
518 com.liferay.portal.service.ServiceContext serviceContext)
519 throws RemoteException {
520 try {
521 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
522 titleMapValues);
523 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
524 descriptionMapValues);
525
526 com.liferay.portal.model.Role returnValue = RoleServiceUtil.updateRole(roleId,
527 name, titleMap, descriptionMap, subtype, serviceContext);
528
529 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
530 }
531 catch (Exception e) {
532 _log.error(e, e);
533
534 throw new RemoteException(e.getMessage());
535 }
536 }
537
538 private static Log _log = LogFactoryUtil.getLog(RoleServiceSoap.class);
539 }