1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
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  /**
24   * <a href="RoleServiceSoap.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides a SOAP utility for the
33   * {@link com.liferay.portal.service.RoleServiceUtil} service utility. The
34   * static methods of this class calls the same methods of the service utility.
35   * However, the signatures are different because it is difficult for SOAP to
36   * support certain types.
37   * </p>
38   *
39   * <p>
40   * ServiceBuilder follows certain rules in translating the methods. For example,
41   * if the method in the service utility returns a {@link java.util.List}, that
42   * is translated to an array of {@link com.liferay.portal.model.RoleSoap}.
43   * If the method in the service utility returns a
44   * {@link com.liferay.portal.model.Role}, that is translated to a
45   * {@link com.liferay.portal.model.RoleSoap}. Methods that SOAP cannot
46   * safely wire are skipped.
47   * </p>
48   *
49   * <p>
50   * The benefits of using the SOAP utility is that it is cross platform
51   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
52   * even Perl, to call the generated services. One drawback of SOAP is that it is
53   * slow because it needs to serialize all calls into a text format (XML).
54   * </p>
55   *
56   * <p>
57   * You can see a list of services at
58   * http://localhost:8080/tunnel-web/secure/axis. Set the property
59   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
60   * security.
61   * </p>
62   *
63   * <p>
64   * The SOAP utility is only generated for remote services.
65   * </p>
66   *
67   * @author    Brian Wing Shun Chan
68   * @see       RoleServiceHttp
69   * @see       com.liferay.portal.model.RoleSoap
70   * @see       com.liferay.portal.service.RoleServiceUtil
71   * @generated
72   */
73  public class RoleServiceSoap {
74      public static com.liferay.portal.model.RoleSoap addRole(
75          java.lang.String name, java.lang.String description, int type)
76          throws RemoteException {
77          try {
78              com.liferay.portal.model.Role returnValue = RoleServiceUtil.addRole(name,
79                      description, type);
80  
81              return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
82          }
83          catch (Exception e) {
84              _log.error(e, e);
85  
86              throw new RemoteException(e.getMessage());
87          }
88      }
89  
90      public static void addUserRoles(long userId, long[] roleIds)
91          throws RemoteException {
92          try {
93              RoleServiceUtil.addUserRoles(userId, roleIds);
94          }
95          catch (Exception e) {
96              _log.error(e, e);
97  
98              throw new RemoteException(e.getMessage());
99          }
100     }
101 
102     public static void deleteRole(long roleId) throws RemoteException {
103         try {
104             RoleServiceUtil.deleteRole(roleId);
105         }
106         catch (Exception e) {
107             _log.error(e, e);
108 
109             throw new RemoteException(e.getMessage());
110         }
111     }
112 
113     public static com.liferay.portal.model.RoleSoap getGroupRole(
114         long companyId, long groupId) throws RemoteException {
115         try {
116             com.liferay.portal.model.Role returnValue = RoleServiceUtil.getGroupRole(companyId,
117                     groupId);
118 
119             return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
120         }
121         catch (Exception e) {
122             _log.error(e, e);
123 
124             throw new RemoteException(e.getMessage());
125         }
126     }
127 
128     public static com.liferay.portal.model.RoleSoap[] getGroupRoles(
129         long groupId) throws RemoteException {
130         try {
131             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getGroupRoles(groupId);
132 
133             return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
134         }
135         catch (Exception e) {
136             _log.error(e, e);
137 
138             throw new RemoteException(e.getMessage());
139         }
140     }
141 
142     public static com.liferay.portal.model.RoleSoap getRole(long roleId)
143         throws RemoteException {
144         try {
145             com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(roleId);
146 
147             return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
148         }
149         catch (Exception e) {
150             _log.error(e, e);
151 
152             throw new RemoteException(e.getMessage());
153         }
154     }
155 
156     public static com.liferay.portal.model.RoleSoap getRole(long companyId,
157         java.lang.String name) throws RemoteException {
158         try {
159             com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(companyId,
160                     name);
161 
162             return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
163         }
164         catch (Exception e) {
165             _log.error(e, e);
166 
167             throw new RemoteException(e.getMessage());
168         }
169     }
170 
171     public static com.liferay.portal.model.RoleSoap[] getUserGroupRoles(
172         long userId, long groupId) throws RemoteException {
173         try {
174             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupRoles(userId,
175                     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     public static com.liferay.portal.model.RoleSoap[] getUserRelatedRoles(
187         long userId, com.liferay.portal.model.GroupSoap[] groups)
188         throws RemoteException {
189         try {
190             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRelatedRoles(userId,
191                     com.liferay.portal.model.impl.GroupModelImpl.toModels(
192                         groups));
193 
194             return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
195         }
196         catch (Exception e) {
197             _log.error(e, e);
198 
199             throw new RemoteException(e.getMessage());
200         }
201     }
202 
203     public static com.liferay.portal.model.RoleSoap[] getUserRoles(long userId)
204         throws RemoteException {
205         try {
206             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRoles(userId);
207 
208             return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
209         }
210         catch (Exception e) {
211             _log.error(e, e);
212 
213             throw new RemoteException(e.getMessage());
214         }
215     }
216 
217     public static boolean hasUserRole(long userId, long companyId,
218         java.lang.String name, boolean inherited) throws RemoteException {
219         try {
220             boolean returnValue = RoleServiceUtil.hasUserRole(userId,
221                     companyId, name, inherited);
222 
223             return returnValue;
224         }
225         catch (Exception e) {
226             _log.error(e, e);
227 
228             throw new RemoteException(e.getMessage());
229         }
230     }
231 
232     public static boolean hasUserRoles(long userId, long companyId,
233         java.lang.String[] names, boolean inherited) throws RemoteException {
234         try {
235             boolean returnValue = RoleServiceUtil.hasUserRoles(userId,
236                     companyId, names, inherited);
237 
238             return returnValue;
239         }
240         catch (Exception e) {
241             _log.error(e, e);
242 
243             throw new RemoteException(e.getMessage());
244         }
245     }
246 
247     public static void unsetUserRoles(long userId, long[] roleIds)
248         throws RemoteException {
249         try {
250             RoleServiceUtil.unsetUserRoles(userId, roleIds);
251         }
252         catch (Exception e) {
253             _log.error(e, e);
254 
255             throw new RemoteException(e.getMessage());
256         }
257     }
258 
259     public static com.liferay.portal.model.RoleSoap updateRole(long roleId,
260         java.lang.String name, java.lang.String description)
261         throws RemoteException {
262         try {
263             com.liferay.portal.model.Role returnValue = RoleServiceUtil.updateRole(roleId,
264                     name, description);
265 
266             return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
267         }
268         catch (Exception e) {
269             _log.error(e, e);
270 
271             throw new RemoteException(e.getMessage());
272         }
273     }
274 
275     private static Log _log = LogFactoryUtil.getLog(RoleServiceSoap.class);
276 }