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
130 @Deprecated
131 public static com.liferay.portal.model.RoleSoap addRole(
132 java.lang.String name, java.lang.String[] titleMapLanguageIds,
133 java.lang.String[] titleMapValues,
134 java.lang.String[] descriptionMapLanguageIds,
135 java.lang.String[] descriptionMapValues, int type)
136 throws RemoteException {
137 try {
138 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
139 titleMapValues);
140 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
141 descriptionMapValues);
142
143 com.liferay.portal.model.Role returnValue = RoleServiceUtil.addRole(name,
144 titleMap, descriptionMap, type);
145
146 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
147 }
148 catch (Exception e) {
149 _log.error(e, e);
150
151 throw new RemoteException(e.getMessage());
152 }
153 }
154
155
162 public static void addUserRoles(long userId, long[] roleIds)
163 throws RemoteException {
164 try {
165 RoleServiceUtil.addUserRoles(userId, roleIds);
166 }
167 catch (Exception e) {
168 _log.error(e, e);
169
170 throw new RemoteException(e.getMessage());
171 }
172 }
173
174
179 public static void deleteRole(long roleId) throws RemoteException {
180 try {
181 RoleServiceUtil.deleteRole(roleId);
182 }
183 catch (Exception e) {
184 _log.error(e, e);
185
186 throw new RemoteException(e.getMessage());
187 }
188 }
189
190 public static com.liferay.portal.model.RoleSoap fetchRole(long roleId)
191 throws RemoteException {
192 try {
193 com.liferay.portal.model.Role returnValue = RoleServiceUtil.fetchRole(roleId);
194
195 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
196 }
197 catch (Exception e) {
198 _log.error(e, e);
199
200 throw new RemoteException(e.getMessage());
201 }
202 }
203
204
210 public static com.liferay.portal.model.RoleSoap[] getGroupRoles(
211 long groupId) throws RemoteException {
212 try {
213 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getGroupRoles(groupId);
214
215 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
216 }
217 catch (Exception e) {
218 _log.error(e, e);
219
220 throw new RemoteException(e.getMessage());
221 }
222 }
223
224
230 public static com.liferay.portal.model.RoleSoap getRole(long roleId)
231 throws RemoteException {
232 try {
233 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(roleId);
234
235 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
236 }
237 catch (Exception e) {
238 _log.error(e, e);
239
240 throw new RemoteException(e.getMessage());
241 }
242 }
243
244
256 public static com.liferay.portal.model.RoleSoap getRole(long companyId,
257 java.lang.String name) throws RemoteException {
258 try {
259 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(companyId,
260 name);
261
262 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
263 }
264 catch (Exception e) {
265 _log.error(e, e);
266
267 throw new RemoteException(e.getMessage());
268 }
269 }
270
271 public static com.liferay.portal.model.RoleSoap[] getRoles(int type,
272 java.lang.String subtype) throws RemoteException {
273 try {
274 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getRoles(type,
275 subtype);
276
277 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
278 }
279 catch (Exception e) {
280 _log.error(e, e);
281
282 throw new RemoteException(e.getMessage());
283 }
284 }
285
286 public static com.liferay.portal.model.RoleSoap[] getRoles(long companyId,
287 int[] types) throws RemoteException {
288 try {
289 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getRoles(companyId,
290 types);
291
292 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
293 }
294 catch (Exception e) {
295 _log.error(e, e);
296
297 throw new RemoteException(e.getMessage());
298 }
299 }
300
301
308 public static com.liferay.portal.model.RoleSoap[] getUserGroupGroupRoles(
309 long userId, long groupId) throws RemoteException {
310 try {
311 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupGroupRoles(userId,
312 groupId);
313
314 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
315 }
316 catch (Exception e) {
317 _log.error(e, e);
318
319 throw new RemoteException(e.getMessage());
320 }
321 }
322
323
330 public static com.liferay.portal.model.RoleSoap[] getUserGroupRoles(
331 long userId, long groupId) throws RemoteException {
332 try {
333 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupRoles(userId,
334 groupId);
335
336 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
337 }
338 catch (Exception e) {
339 _log.error(e, e);
340
341 throw new RemoteException(e.getMessage());
342 }
343 }
344
345
352 public static com.liferay.portal.model.RoleSoap[] getUserRelatedRoles(
353 long userId, com.liferay.portal.model.GroupSoap[] groups)
354 throws RemoteException {
355 try {
356 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRelatedRoles(userId,
357 com.liferay.portal.model.impl.GroupModelImpl.toModels(
358 groups));
359
360 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
361 }
362 catch (Exception e) {
363 _log.error(e, e);
364
365 throw new RemoteException(e.getMessage());
366 }
367 }
368
369
375 public static com.liferay.portal.model.RoleSoap[] getUserRoles(long userId)
376 throws RemoteException {
377 try {
378 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRoles(userId);
379
380 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
381 }
382 catch (Exception e) {
383 _log.error(e, e);
384
385 throw new RemoteException(e.getMessage());
386 }
387 }
388
389
401 public static boolean hasUserRole(long userId, long companyId,
402 java.lang.String name, boolean inherited) throws RemoteException {
403 try {
404 boolean returnValue = RoleServiceUtil.hasUserRole(userId,
405 companyId, name, inherited);
406
407 return returnValue;
408 }
409 catch (Exception e) {
410 _log.error(e, e);
411
412 throw new RemoteException(e.getMessage());
413 }
414 }
415
416
428 public static boolean hasUserRoles(long userId, long companyId,
429 java.lang.String[] names, boolean inherited) throws RemoteException {
430 try {
431 boolean returnValue = RoleServiceUtil.hasUserRoles(userId,
432 companyId, names, inherited);
433
434 return returnValue;
435 }
436 catch (Exception e) {
437 _log.error(e, e);
438
439 throw new RemoteException(e.getMessage());
440 }
441 }
442
443
450 public static void unsetUserRoles(long userId, long[] roleIds)
451 throws RemoteException {
452 try {
453 RoleServiceUtil.unsetUserRoles(userId, roleIds);
454 }
455 catch (Exception e) {
456 _log.error(e, e);
457
458 throw new RemoteException(e.getMessage());
459 }
460 }
461
462
477 public static com.liferay.portal.model.RoleSoap updateRole(long roleId,
478 java.lang.String name, java.lang.String[] titleMapLanguageIds,
479 java.lang.String[] titleMapValues,
480 java.lang.String[] descriptionMapLanguageIds,
481 java.lang.String[] descriptionMapValues, java.lang.String subtype,
482 com.liferay.portal.service.ServiceContext serviceContext)
483 throws RemoteException {
484 try {
485 Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(titleMapLanguageIds,
486 titleMapValues);
487 Map<Locale, String> descriptionMap = LocalizationUtil.getLocalizationMap(descriptionMapLanguageIds,
488 descriptionMapValues);
489
490 com.liferay.portal.model.Role returnValue = RoleServiceUtil.updateRole(roleId,
491 name, titleMap, descriptionMap, subtype, serviceContext);
492
493 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
494 }
495 catch (Exception e) {
496 _log.error(e, e);
497
498 throw new RemoteException(e.getMessage());
499 }
500 }
501
502 private static Log _log = LogFactoryUtil.getLog(RoleServiceSoap.class);
503 }