1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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 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 getGroupRole(
98          long companyId, long groupId) throws RemoteException {
99          try {
100             com.liferay.portal.model.Role returnValue = RoleServiceUtil.getGroupRole(companyId,
101                     groupId);
102 
103             return com.liferay.portal.model.RoleSoap.toSoapModel(returnValue);
104         }
105         catch (Exception e) {
106             _log.error(e, e);
107 
108             throw new RemoteException(e.getMessage());
109         }
110     }
111 
112     public static com.liferay.portal.model.RoleSoap[] getGroupRoles(
113         long groupId) throws RemoteException {
114         try {
115             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getGroupRoles(groupId);
116 
117             return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
118         }
119         catch (Exception e) {
120             _log.error(e, e);
121 
122             throw new RemoteException(e.getMessage());
123         }
124     }
125 
126     public static com.liferay.portal.model.RoleSoap getRole(long roleId)
127         throws RemoteException {
128         try {
129             com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(roleId);
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 getRole(long companyId,
141         java.lang.String name) throws RemoteException {
142         try {
143             com.liferay.portal.model.Role returnValue = RoleServiceUtil.getRole(companyId,
144                     name);
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     public static com.liferay.portal.model.RoleSoap[] getUserGroupGroupRoles(
156         long userId, long groupId) throws RemoteException {
157         try {
158             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupGroupRoles(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[] getUserGroupRoles(
171         long userId, long groupId) throws RemoteException {
172         try {
173             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserGroupRoles(userId,
174                     groupId);
175 
176             return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
177         }
178         catch (Exception e) {
179             _log.error(e, e);
180 
181             throw new RemoteException(e.getMessage());
182         }
183     }
184 
185     public static com.liferay.portal.model.RoleSoap[] getUserRelatedRoles(
186         long userId, com.liferay.portal.model.GroupSoap[] groups)
187         throws RemoteException {
188         try {
189             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRelatedRoles(userId,
190                     com.liferay.portal.model.impl.GroupModelImpl.toModels(
191                         groups));
192 
193             return com.liferay.portal.model.RoleSoap.toSoapModels(returnValue);
194         }
195         catch (Exception e) {
196             _log.error(e, e);
197 
198             throw new RemoteException(e.getMessage());
199         }
200     }
201 
202     public static com.liferay.portal.model.RoleSoap[] getUserRoles(long userId)
203         throws RemoteException {
204         try {
205             java.util.List<com.liferay.portal.model.Role> returnValue = RoleServiceUtil.getUserRoles(userId);
206 
207             return com.liferay.portal.model.RoleSoap.toSoapModels(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 hasUserRole(long userId, long companyId,
217         java.lang.String name, boolean inherited) throws RemoteException {
218         try {
219             boolean returnValue = RoleServiceUtil.hasUserRole(userId,
220                     companyId, name, 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 boolean hasUserRoles(long userId, long companyId,
232         java.lang.String[] names, boolean inherited) throws RemoteException {
233         try {
234             boolean returnValue = RoleServiceUtil.hasUserRoles(userId,
235                     companyId, names, inherited);
236 
237             return returnValue;
238         }
239         catch (Exception e) {
240             _log.error(e, e);
241 
242             throw new RemoteException(e.getMessage());
243         }
244     }
245 
246     public static void unsetUserRoles(long userId, long[] roleIds)
247         throws RemoteException {
248         try {
249             RoleServiceUtil.unsetUserRoles(userId, roleIds);
250         }
251         catch (Exception e) {
252             _log.error(e, e);
253 
254             throw new RemoteException(e.getMessage());
255         }
256     }
257 
258     private static Log _log = LogFactoryUtil.getLog(RoleServiceSoap.class);
259 }