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