001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.service.RoleServiceUtil;
020
021 import java.rmi.RemoteException;
022
023
066 public class RoleServiceSoap {
067 public static void addUserRoles(long userId, long[] roleIds)
068 throws RemoteException {
069 try {
070 RoleServiceUtil.addUserRoles(userId, roleIds);
071 }
072 catch (Exception e) {
073 _log.error(e, e);
074
075 throw new RemoteException(e.getMessage());
076 }
077 }
078
079 public static void deleteRole(long roleId) throws RemoteException {
080 try {
081 RoleServiceUtil.deleteRole(roleId);
082 }
083 catch (Exception e) {
084 _log.error(e, e);
085
086 throw new RemoteException(e.getMessage());
087 }
088 }
089
090 public static com.liferay.portal.model.RoleSoap[] getGroupRoles(
091 long groupId) throws RemoteException {
092 try {
093 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getGroupRoles(groupId);
094
095 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
096 }
097 catch (Exception e) {
098 _log.error(e, e);
099
100 throw new RemoteException(e.getMessage());
101 }
102 }
103
104 public static com.liferay.portal.model.RoleSoap getRole(long roleId)
105 throws RemoteException {
106 try {
107 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(roleId);
108
109 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
110 }
111 catch (Exception e) {
112 _log.error(e, e);
113
114 throw new RemoteException(e.getMessage());
115 }
116 }
117
118 public static com.liferay.portal.model.RoleSoap getRole(long companyId,
119 java.lang.String name) throws RemoteException {
120 try {
121 com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(companyId,
122 name);
123
124 return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
125 }
126 catch (Exception e) {
127 _log.error(e, e);
128
129 throw new RemoteException(e.getMessage());
130 }
131 }
132
133 public static com.liferay.portal.model.RoleSoap[] getUserGroupGroupRoles(
134 long userId, long groupId) throws RemoteException {
135 try {
136 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupGroupRoles(userId,
137 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[] getUserGroupRoles(
149 long userId, long groupId) throws RemoteException {
150 try {
151 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupRoles(userId,
152 groupId);
153
154 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
155 }
156 catch (Exception e) {
157 _log.error(e, e);
158
159 throw new RemoteException(e.getMessage());
160 }
161 }
162
163 public static com.liferay.portal.model.RoleSoap[] getUserRelatedRoles(
164 long userId, com.liferay.portal.model.GroupSoap[] groups)
165 throws RemoteException {
166 try {
167 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRelatedRoles(userId,
168 com.liferay.portal.model.impl.GroupModelImpl.toModels(
169 groups));
170
171 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
172 }
173 catch (Exception e) {
174 _log.error(e, e);
175
176 throw new RemoteException(e.getMessage());
177 }
178 }
179
180 public static com.liferay.portal.model.RoleSoap[] getUserRoles(long userId)
181 throws RemoteException {
182 try {
183 java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRoles(userId);
184
185 return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
186 }
187 catch (Exception e) {
188 _log.error(e, e);
189
190 throw new RemoteException(e.getMessage());
191 }
192 }
193
194 public static boolean hasUserRole(long userId, long companyId,
195 java.lang.String name, boolean inherited) throws RemoteException {
196 try {
197 boolean returnValue = RoleServiceUtil.hasUserRole(userId,
198 companyId, name, inherited);
199
200 return returnValue;
201 }
202 catch (Exception e) {
203 _log.error(e, e);
204
205 throw new RemoteException(e.getMessage());
206 }
207 }
208
209 public static boolean hasUserRoles(long userId, long companyId,
210 java.lang.String[] names, boolean inherited) throws RemoteException {
211 try {
212 boolean returnValue = RoleServiceUtil.hasUserRoles(userId,
213 companyId, names, inherited);
214
215 return returnValue;
216 }
217 catch (Exception e) {
218 _log.error(e, e);
219
220 throw new RemoteException(e.getMessage());
221 }
222 }
223
224 public static void unsetUserRoles(long userId, long[] roleIds)
225 throws RemoteException {
226 try {
227 RoleServiceUtil.unsetUserRoles(userId, roleIds);
228 }
229 catch (Exception e) {
230 _log.error(e, e);
231
232 throw new RemoteException(e.getMessage());
233 }
234 }
235
236 private static Log _log = LogFactoryUtil.getLog(RoleServiceSoap.class);
237 }