1   /**
2    * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  import com.liferay.portal.service.GroupServiceUtil;
28  
29  import java.rmi.RemoteException;
30  
31  /**
32   * <a href="GroupServiceSoap.java.html"><b><i>View Source</i></b></a>
33   *
34   * <p>
35   * ServiceBuilder generated this class. Modifications in this class will be overwritten
36   * the next time is generated.
37   * </p>
38   *
39   * <p>
40   * This class provides a SOAP utility for the <code>com.liferay.portal.service.GroupServiceUtil</code>
41   * service utility. The static methods of this class calls the same methods of the
42   * service utility. However, the signatures are different because it is difficult
43   * for SOAP to support certain types.
44   * </p>
45   *
46   * <p>
47   * ServiceBuilder follows certain rules in translating the methods. For example,
48   * if the method in the service utility returns a <code>java.util.List</code>, that
49   * is translated to an array of <code>com.liferay.portal.model.GroupSoap</code>.
50   * If the method in the service utility returns a <code>com.liferay.portal.model.Group</code>,
51   * that is translated to a <code>com.liferay.portal.model.GroupSoap</code>. Methods
52   * that SOAP cannot safely wire are skipped.
53   * </p>
54   *
55   * <p>
56   * The benefits of using the SOAP utility is that it is cross platform compatible.
57   * SOAP allows different languages like Java, .NET, C++, PHP, and even Perl, to
58   * call the generated services. One drawback of SOAP is that it is slow because
59   * it needs to serialize all calls into a text format (XML).
60   * </p>
61   *
62   * <p>
63   * You can see a list of services at http://localhost:8080/tunnel-web/secure/axis.
64   * Set the property <code>tunnel.servlet.hosts.allowed</code> in portal.properties
65   * to configure security.
66   * </p>
67   *
68   * <p>
69   * The SOAP utility is only generated for remote services.
70   * </p>
71   *
72   * @author Brian Wing Shun Chan
73   *
74   * @see com.liferay.portal.service.GroupServiceUtil
75   * @see com.liferay.portal.service.http.GroupServiceHttp
76   * @see com.liferay.portal.service.model.GroupSoap
77   *
78   */
79  public class GroupServiceSoap {
80      public static com.liferay.portal.model.GroupSoap addGroup(
81          java.lang.String name, java.lang.String description,
82          java.lang.String type, java.lang.String friendlyURL, boolean active)
83          throws RemoteException {
84          try {
85              com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(name,
86                      description, type, friendlyURL, active);
87  
88              return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
89          }
90          catch (Exception e) {
91              _log.error(e, e);
92              throw new RemoteException(e.getMessage());
93          }
94      }
95  
96      public static com.liferay.portal.model.GroupSoap addGroup(
97          long liveGroupId, java.lang.String name, java.lang.String description,
98          java.lang.String type, java.lang.String friendlyURL, boolean active)
99          throws RemoteException {
100         try {
101             com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(liveGroupId,
102                     name, description, type, friendlyURL, active);
103 
104             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
105         }
106         catch (Exception e) {
107             _log.error(e, e);
108             throw new RemoteException(e.getMessage());
109         }
110     }
111 
112     public static void addRoleGroups(long roleId, long[] groupIds)
113         throws RemoteException {
114         try {
115             GroupServiceUtil.addRoleGroups(roleId, groupIds);
116         }
117         catch (Exception e) {
118             _log.error(e, e);
119             throw new RemoteException(e.getMessage());
120         }
121     }
122 
123     public static void deleteGroup(long groupId) throws RemoteException {
124         try {
125             GroupServiceUtil.deleteGroup(groupId);
126         }
127         catch (Exception e) {
128             _log.error(e, e);
129             throw new RemoteException(e.getMessage());
130         }
131     }
132 
133     public static com.liferay.portal.model.GroupSoap getGroup(long groupId)
134         throws RemoteException {
135         try {
136             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(groupId);
137 
138             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
139         }
140         catch (Exception e) {
141             _log.error(e, e);
142             throw new RemoteException(e.getMessage());
143         }
144     }
145 
146     public static com.liferay.portal.model.GroupSoap getGroup(long companyId,
147         java.lang.String name) throws RemoteException {
148         try {
149             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(companyId,
150                     name);
151 
152             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
153         }
154         catch (Exception e) {
155             _log.error(e, e);
156             throw new RemoteException(e.getMessage());
157         }
158     }
159 
160     public static com.liferay.portal.model.GroupSoap[] getOrganizationsGroups(
161         java.util.List organizations) throws RemoteException {
162         try {
163             java.util.List returnValue = GroupServiceUtil.getOrganizationsGroups(organizations);
164 
165             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
166         }
167         catch (Exception e) {
168             _log.error(e, e);
169             throw new RemoteException(e.getMessage());
170         }
171     }
172 
173     public static com.liferay.portal.model.GroupSoap[] getUserGroupsGroups(
174         java.util.List userGroups) throws RemoteException {
175         try {
176             java.util.List returnValue = GroupServiceUtil.getUserGroupsGroups(userGroups);
177 
178             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
179         }
180         catch (Exception e) {
181             _log.error(e, e);
182             throw new RemoteException(e.getMessage());
183         }
184     }
185 
186     public static boolean hasUserGroup(long userId, long groupId)
187         throws RemoteException {
188         try {
189             boolean returnValue = GroupServiceUtil.hasUserGroup(userId, groupId);
190 
191             return returnValue;
192         }
193         catch (Exception e) {
194             _log.error(e, e);
195             throw new RemoteException(e.getMessage());
196         }
197     }
198 
199     public static com.liferay.portal.model.GroupSoap[] search(long companyId,
200         java.lang.String name, java.lang.String description,
201         java.lang.String[] params, int begin, int end)
202         throws RemoteException {
203         try {
204             java.util.List returnValue = GroupServiceUtil.search(companyId,
205                     name, description, params, begin, end);
206 
207             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
208         }
209         catch (Exception e) {
210             _log.error(e, e);
211             throw new RemoteException(e.getMessage());
212         }
213     }
214 
215     public static int searchCount(long companyId, java.lang.String name,
216         java.lang.String description, java.lang.String[] params)
217         throws RemoteException {
218         try {
219             int returnValue = GroupServiceUtil.searchCount(companyId, name,
220                     description, params);
221 
222             return returnValue;
223         }
224         catch (Exception e) {
225             _log.error(e, e);
226             throw new RemoteException(e.getMessage());
227         }
228     }
229 
230     public static void setRoleGroups(long roleId, long[] groupIds)
231         throws RemoteException {
232         try {
233             GroupServiceUtil.setRoleGroups(roleId, groupIds);
234         }
235         catch (Exception e) {
236             _log.error(e, e);
237             throw new RemoteException(e.getMessage());
238         }
239     }
240 
241     public static void unsetRoleGroups(long roleId, long[] groupIds)
242         throws RemoteException {
243         try {
244             GroupServiceUtil.unsetRoleGroups(roleId, groupIds);
245         }
246         catch (Exception e) {
247             _log.error(e, e);
248             throw new RemoteException(e.getMessage());
249         }
250     }
251 
252     public static com.liferay.portal.model.GroupSoap updateGroup(long groupId,
253         java.lang.String name, java.lang.String description,
254         java.lang.String type, java.lang.String friendlyURL, boolean active)
255         throws RemoteException {
256         try {
257             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
258                     name, description, type, friendlyURL, active);
259 
260             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
261         }
262         catch (Exception e) {
263             _log.error(e, e);
264             throw new RemoteException(e.getMessage());
265         }
266     }
267 
268     public static com.liferay.portal.model.GroupSoap updateGroup(long groupId,
269         java.lang.String typeSettings) throws RemoteException {
270         try {
271             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
272                     typeSettings);
273 
274             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
275         }
276         catch (Exception e) {
277             _log.error(e, e);
278             throw new RemoteException(e.getMessage());
279         }
280     }
281 
282     private static Log _log = LogFactoryUtil.getLog(GroupServiceSoap.class);
283 }