1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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   * {@link com.liferay.portal.service.GroupServiceUtil} service utility. The
42   * static methods of this class calls the same methods of the service utility.
43   * However, the signatures are different because it is difficult for SOAP to
44   * 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 {@link java.util.List}, that
50   * is translated to an array of {@link com.liferay.portal.model.GroupSoap}.
51   * If the method in the service utility returns a
52   * {@link com.liferay.portal.model.Group}, that is translated to a
53   * {@link com.liferay.portal.model.GroupSoap}. Methods that SOAP cannot
54   * 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   * <b>tunnel.servlet.hosts.allowed</b> 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   * @see       GroupServiceHttp
77   * @see       com.liferay.portal.model.GroupSoap
78   * @see       com.liferay.portal.service.GroupServiceUtil
79   * @generated
80   */
81  public class GroupServiceSoap {
82      public static com.liferay.portal.model.GroupSoap addGroup(
83          java.lang.String name, java.lang.String description, int type,
84          java.lang.String friendlyURL, boolean active,
85          com.liferay.portal.service.ServiceContext serviceContext)
86          throws RemoteException {
87          try {
88              com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(name,
89                      description, type, friendlyURL, active, serviceContext);
90  
91              return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
92          }
93          catch (Exception e) {
94              _log.error(e, e);
95  
96              throw new RemoteException(e.getMessage());
97          }
98      }
99  
100     public static com.liferay.portal.model.GroupSoap addGroup(
101         long liveGroupId, java.lang.String name, java.lang.String description,
102         int type, java.lang.String friendlyURL, boolean active,
103         com.liferay.portal.service.ServiceContext serviceContext)
104         throws RemoteException {
105         try {
106             com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(liveGroupId,
107                     name, description, type, friendlyURL, active, serviceContext);
108 
109             return com.liferay.portal.model.GroupSoap.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 void addRoleGroups(long roleId, long[] groupIds)
119         throws RemoteException {
120         try {
121             GroupServiceUtil.addRoleGroups(roleId, groupIds);
122         }
123         catch (Exception e) {
124             _log.error(e, e);
125 
126             throw new RemoteException(e.getMessage());
127         }
128     }
129 
130     public static void deleteGroup(long groupId) throws RemoteException {
131         try {
132             GroupServiceUtil.deleteGroup(groupId);
133         }
134         catch (Exception e) {
135             _log.error(e, e);
136 
137             throw new RemoteException(e.getMessage());
138         }
139     }
140 
141     public static com.liferay.portal.model.GroupSoap getGroup(long groupId)
142         throws RemoteException {
143         try {
144             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(groupId);
145 
146             return com.liferay.portal.model.GroupSoap.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.GroupSoap getGroup(long companyId,
156         java.lang.String name) throws RemoteException {
157         try {
158             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(companyId,
159                     name);
160 
161             return com.liferay.portal.model.GroupSoap.toSoapModel(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.GroupSoap[] getManageableGroups(
171         java.lang.String actionId, int max) throws RemoteException {
172         try {
173             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getManageableGroups(actionId,
174                     max);
175 
176             return com.liferay.portal.model.GroupSoap.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.GroupSoap[] getOrganizationsGroups(
186         com.liferay.portal.model.OrganizationSoap[] organizations)
187         throws RemoteException {
188         try {
189             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getOrganizationsGroups(com.liferay.portal.model.impl.OrganizationModelImpl.toModels(
190                         organizations));
191 
192             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
193         }
194         catch (Exception e) {
195             _log.error(e, e);
196 
197             throw new RemoteException(e.getMessage());
198         }
199     }
200 
201     public static com.liferay.portal.model.GroupSoap getUserGroup(
202         long companyId, long userId) throws RemoteException {
203         try {
204             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getUserGroup(companyId,
205                     userId);
206 
207             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
208         }
209         catch (Exception e) {
210             _log.error(e, e);
211 
212             throw new RemoteException(e.getMessage());
213         }
214     }
215 
216     public static com.liferay.portal.model.GroupSoap[] getUserGroupsGroups(
217         com.liferay.portal.model.UserGroupSoap[] userGroups)
218         throws RemoteException {
219         try {
220             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserGroupsGroups(com.liferay.portal.model.impl.UserGroupModelImpl.toModels(
221                         userGroups));
222 
223             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
224         }
225         catch (Exception e) {
226             _log.error(e, e);
227 
228             throw new RemoteException(e.getMessage());
229         }
230     }
231 
232     public static com.liferay.portal.model.GroupSoap[] getUserOrganizationsGroups(
233         long userId, int start, int end) throws RemoteException {
234         try {
235             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserOrganizationsGroups(userId,
236                     start, end);
237 
238             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
239         }
240         catch (Exception e) {
241             _log.error(e, e);
242 
243             throw new RemoteException(e.getMessage());
244         }
245     }
246 
247     public static boolean hasUserGroup(long userId, long groupId)
248         throws RemoteException {
249         try {
250             boolean returnValue = GroupServiceUtil.hasUserGroup(userId, groupId);
251 
252             return returnValue;
253         }
254         catch (Exception e) {
255             _log.error(e, e);
256 
257             throw new RemoteException(e.getMessage());
258         }
259     }
260 
261     public static com.liferay.portal.model.GroupSoap[] search(long companyId,
262         java.lang.String name, java.lang.String description,
263         java.lang.String[] params, int start, int end)
264         throws RemoteException {
265         try {
266             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.search(companyId,
267                     name, description, params, start, end);
268 
269             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
270         }
271         catch (Exception e) {
272             _log.error(e, e);
273 
274             throw new RemoteException(e.getMessage());
275         }
276     }
277 
278     public static int searchCount(long companyId, java.lang.String name,
279         java.lang.String description, java.lang.String[] params)
280         throws RemoteException {
281         try {
282             int returnValue = GroupServiceUtil.searchCount(companyId, name,
283                     description, params);
284 
285             return returnValue;
286         }
287         catch (Exception e) {
288             _log.error(e, e);
289 
290             throw new RemoteException(e.getMessage());
291         }
292     }
293 
294     public static void setRoleGroups(long roleId, long[] groupIds)
295         throws RemoteException {
296         try {
297             GroupServiceUtil.setRoleGroups(roleId, groupIds);
298         }
299         catch (Exception e) {
300             _log.error(e, e);
301 
302             throw new RemoteException(e.getMessage());
303         }
304     }
305 
306     public static void unsetRoleGroups(long roleId, long[] groupIds)
307         throws RemoteException {
308         try {
309             GroupServiceUtil.unsetRoleGroups(roleId, groupIds);
310         }
311         catch (Exception e) {
312             _log.error(e, e);
313 
314             throw new RemoteException(e.getMessage());
315         }
316     }
317 
318     public static com.liferay.portal.model.GroupSoap updateFriendlyURL(
319         long groupId, java.lang.String friendlyURL) throws RemoteException {
320         try {
321             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateFriendlyURL(groupId,
322                     friendlyURL);
323 
324             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
325         }
326         catch (Exception e) {
327             _log.error(e, e);
328 
329             throw new RemoteException(e.getMessage());
330         }
331     }
332 
333     public static com.liferay.portal.model.GroupSoap updateGroup(long groupId,
334         java.lang.String name, java.lang.String description, int type,
335         java.lang.String friendlyURL, boolean active,
336         com.liferay.portal.service.ServiceContext serviceContext)
337         throws RemoteException {
338         try {
339             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
340                     name, description, type, friendlyURL, active, serviceContext);
341 
342             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
343         }
344         catch (Exception e) {
345             _log.error(e, e);
346 
347             throw new RemoteException(e.getMessage());
348         }
349     }
350 
351     public static com.liferay.portal.model.GroupSoap updateGroup(long groupId,
352         java.lang.String typeSettings) throws RemoteException {
353         try {
354             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
355                     typeSettings);
356 
357             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
358         }
359         catch (Exception e) {
360             _log.error(e, e);
361 
362             throw new RemoteException(e.getMessage());
363         }
364     }
365 
366     public static com.liferay.portal.model.GroupSoap updateWorkflow(
367         long groupId, boolean workflowEnabled, int workflowStages,
368         java.lang.String workflowRoleNames) throws RemoteException {
369         try {
370             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateWorkflow(groupId,
371                     workflowEnabled, workflowStages, workflowRoleNames);
372 
373             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
374         }
375         catch (Exception e) {
376             _log.error(e, e);
377 
378             throw new RemoteException(e.getMessage());
379         }
380     }
381 
382     private static Log _log = LogFactoryUtil.getLog(GroupServiceSoap.class);
383 }