1   /**
2    * Copyright (c) 2000-2009 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
36   * overwritten the next time is generated.
37   * </p>
38   *
39   * <p>
40   * This class provides a SOAP utility for the
41   * <code>com.liferay.portal.service.GroupServiceUtil</code> service
42   * utility. The static methods of this class calls the same methods of the
43   * service utility. However, the signatures are different because it is
44   * difficult for SOAP to support certain types.
45   * </p>
46   *
47   * <p>
48   * ServiceBuilder follows certain rules in translating the methods. For example,
49   * if the method in the service utility returns a <code>java.util.List</code>,
50   * that is translated to an array of
51   * <code>com.liferay.portal.model.GroupSoap</code>. If the method in the
52   * service utility returns a <code>com.liferay.portal.model.Group</code>,
53   * that is translated to a <code>com.liferay.portal.model.GroupSoap</code>.
54   * Methods that SOAP cannot safely wire are skipped.
55   * </p>
56   *
57   * <p>
58   * The benefits of using the SOAP utility is that it is cross platform
59   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
60   * even Perl, to call the generated services. One drawback of SOAP is that it is
61   * slow because it needs to serialize all calls into a text format (XML).
62   * </p>
63   *
64   * <p>
65   * You can see a list of services at
66   * http://localhost:8080/tunnel-web/secure/axis. Set the property
67   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
68   * security.
69   * </p>
70   *
71   * <p>
72   * The SOAP utility is only generated for remote services.
73   * </p>
74   *
75   * @author Brian Wing Shun Chan
76   *
77   * @see com.liferay.portal.model.GroupSoap
78   * @see com.liferay.portal.service.GroupServiceUtil
79   * @see com.liferay.portal.service.http.GroupServiceHttp
80   *
81   */
82  public class GroupServiceSoap {
83      public static com.liferay.portal.model.GroupSoap addGroup(
84          java.lang.String name, java.lang.String description, int type,
85          java.lang.String friendlyURL, boolean active,
86          com.liferay.portal.service.ServiceContext serviceContext)
87          throws RemoteException {
88          try {
89              com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(name,
90                      description, type, friendlyURL, active, serviceContext);
91  
92              return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
93          }
94          catch (Exception e) {
95              _log.error(e, e);
96  
97              throw new RemoteException(e.getMessage());
98          }
99      }
100 
101     public static com.liferay.portal.model.GroupSoap addGroup(
102         long liveGroupId, java.lang.String name, java.lang.String description,
103         int type, java.lang.String friendlyURL, boolean active,
104         com.liferay.portal.service.ServiceContext serviceContext)
105         throws RemoteException {
106         try {
107             com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(liveGroupId,
108                     name, description, type, friendlyURL, active, serviceContext);
109 
110             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
111         }
112         catch (Exception e) {
113             _log.error(e, e);
114 
115             throw new RemoteException(e.getMessage());
116         }
117     }
118 
119     public static void addRoleGroups(long roleId, long[] groupIds)
120         throws RemoteException {
121         try {
122             GroupServiceUtil.addRoleGroups(roleId, groupIds);
123         }
124         catch (Exception e) {
125             _log.error(e, e);
126 
127             throw new RemoteException(e.getMessage());
128         }
129     }
130 
131     public static void deleteGroup(long groupId) throws RemoteException {
132         try {
133             GroupServiceUtil.deleteGroup(groupId);
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.GroupSoap getGroup(long groupId)
143         throws RemoteException {
144         try {
145             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(groupId);
146 
147             return com.liferay.portal.model.GroupSoap.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.GroupSoap getGroup(long companyId,
157         java.lang.String name) throws RemoteException {
158         try {
159             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(companyId,
160                     name);
161 
162             return com.liferay.portal.model.GroupSoap.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.GroupSoap[] getManageableGroups(
172         java.lang.String actionId, int max) throws RemoteException {
173         try {
174             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getManageableGroups(actionId,
175                     max);
176 
177             return com.liferay.portal.model.GroupSoap.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.GroupSoap[] getOrganizationsGroups(
187         com.liferay.portal.model.OrganizationSoap[] organizations)
188         throws RemoteException {
189         try {
190             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getOrganizationsGroups(com.liferay.portal.model.impl.OrganizationModelImpl.toModels(
191                         organizations));
192 
193             return com.liferay.portal.model.GroupSoap.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.GroupSoap getUserGroup(
203         long companyId, long userId) throws RemoteException {
204         try {
205             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getUserGroup(companyId,
206                     userId);
207 
208             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
209         }
210         catch (Exception e) {
211             _log.error(e, e);
212 
213             throw new RemoteException(e.getMessage());
214         }
215     }
216 
217     public static com.liferay.portal.model.GroupSoap[] getUserGroupsGroups(
218         com.liferay.portal.model.UserGroupSoap[] userGroups)
219         throws RemoteException {
220         try {
221             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserGroupsGroups(com.liferay.portal.model.impl.UserGroupModelImpl.toModels(
222                         userGroups));
223 
224             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
225         }
226         catch (Exception e) {
227             _log.error(e, e);
228 
229             throw new RemoteException(e.getMessage());
230         }
231     }
232 
233     public static com.liferay.portal.model.GroupSoap[] getUserOrganizationsGroups(
234         long userId, int start, int end) throws RemoteException {
235         try {
236             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserOrganizationsGroups(userId,
237                     start, end);
238 
239             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
240         }
241         catch (Exception e) {
242             _log.error(e, e);
243 
244             throw new RemoteException(e.getMessage());
245         }
246     }
247 
248     public static boolean hasUserGroup(long userId, long groupId)
249         throws RemoteException {
250         try {
251             boolean returnValue = GroupServiceUtil.hasUserGroup(userId, groupId);
252 
253             return returnValue;
254         }
255         catch (Exception e) {
256             _log.error(e, e);
257 
258             throw new RemoteException(e.getMessage());
259         }
260     }
261 
262     public static com.liferay.portal.model.GroupSoap[] search(long companyId,
263         java.lang.String name, java.lang.String description,
264         java.lang.String[] params, int start, int end)
265         throws RemoteException {
266         try {
267             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.search(companyId,
268                     name, description, params, start, end);
269 
270             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
271         }
272         catch (Exception e) {
273             _log.error(e, e);
274 
275             throw new RemoteException(e.getMessage());
276         }
277     }
278 
279     public static int searchCount(long companyId, java.lang.String name,
280         java.lang.String description, java.lang.String[] params)
281         throws RemoteException {
282         try {
283             int returnValue = GroupServiceUtil.searchCount(companyId, name,
284                     description, params);
285 
286             return returnValue;
287         }
288         catch (Exception e) {
289             _log.error(e, e);
290 
291             throw new RemoteException(e.getMessage());
292         }
293     }
294 
295     public static void setRoleGroups(long roleId, long[] groupIds)
296         throws RemoteException {
297         try {
298             GroupServiceUtil.setRoleGroups(roleId, groupIds);
299         }
300         catch (Exception e) {
301             _log.error(e, e);
302 
303             throw new RemoteException(e.getMessage());
304         }
305     }
306 
307     public static void unsetRoleGroups(long roleId, long[] groupIds)
308         throws RemoteException {
309         try {
310             GroupServiceUtil.unsetRoleGroups(roleId, groupIds);
311         }
312         catch (Exception e) {
313             _log.error(e, e);
314 
315             throw new RemoteException(e.getMessage());
316         }
317     }
318 
319     public static com.liferay.portal.model.GroupSoap updateFriendlyURL(
320         long groupId, java.lang.String friendlyURL) throws RemoteException {
321         try {
322             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateFriendlyURL(groupId,
323                     friendlyURL);
324 
325             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
326         }
327         catch (Exception e) {
328             _log.error(e, e);
329 
330             throw new RemoteException(e.getMessage());
331         }
332     }
333 
334     public static com.liferay.portal.model.GroupSoap updateGroup(long groupId,
335         java.lang.String name, java.lang.String description, int type,
336         java.lang.String friendlyURL, boolean active,
337         com.liferay.portal.service.ServiceContext serviceContext)
338         throws RemoteException {
339         try {
340             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
341                     name, description, type, friendlyURL, active, serviceContext);
342 
343             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
344         }
345         catch (Exception e) {
346             _log.error(e, e);
347 
348             throw new RemoteException(e.getMessage());
349         }
350     }
351 
352     public static com.liferay.portal.model.GroupSoap updateGroup(long groupId,
353         java.lang.String typeSettings) throws RemoteException {
354         try {
355             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
356                     typeSettings);
357 
358             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
359         }
360         catch (Exception e) {
361             _log.error(e, e);
362 
363             throw new RemoteException(e.getMessage());
364         }
365     }
366 
367     public static com.liferay.portal.model.GroupSoap updateWorkflow(
368         long groupId, boolean workflowEnabled, int workflowStages,
369         java.lang.String workflowRoleNames) throws RemoteException {
370         try {
371             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateWorkflow(groupId,
372                     workflowEnabled, workflowStages, workflowRoleNames);
373 
374             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
375         }
376         catch (Exception e) {
377             _log.error(e, e);
378 
379             throw new RemoteException(e.getMessage());
380         }
381     }
382 
383     private static Log _log = LogFactoryUtil.getLog(GroupServiceSoap.class);
384 }