1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.http;
21  
22  import com.liferay.portal.kernel.log.Log;
23  import com.liferay.portal.kernel.log.LogFactoryUtil;
24  import com.liferay.portal.service.GroupServiceUtil;
25  
26  import java.rmi.RemoteException;
27  
28  /**
29   * <a href="GroupServiceSoap.java.html"><b><i>View Source</i></b></a>
30   *
31   * <p>
32   * ServiceBuilder generated this class. Modifications in this class will be
33   * overwritten the next time is generated.
34   * </p>
35   *
36   * <p>
37   * This class provides a SOAP utility for the
38   * <code>com.liferay.portal.service.GroupServiceUtil</code> service
39   * utility. The static methods of this class calls the same methods of the
40   * service utility. However, the signatures are different because it is
41   * difficult for SOAP to support certain types.
42   * </p>
43   *
44   * <p>
45   * ServiceBuilder follows certain rules in translating the methods. For example,
46   * if the method in the service utility returns a <code>java.util.List</code>,
47   * that is translated to an array of
48   * <code>com.liferay.portal.model.GroupSoap</code>. If the method in the
49   * service utility returns a <code>com.liferay.portal.model.Group</code>,
50   * that is translated to a <code>com.liferay.portal.model.GroupSoap</code>.
51   * Methods that SOAP cannot safely wire are skipped.
52   * </p>
53   *
54   * <p>
55   * The benefits of using the SOAP utility is that it is cross platform
56   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
57   * even Perl, to call the generated services. One drawback of SOAP is that it is
58   * slow because it needs to serialize all calls into a text format (XML).
59   * </p>
60   *
61   * <p>
62   * You can see a list of services at
63   * http://localhost:8080/tunnel-web/secure/axis. Set the property
64   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
65   * 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.model.GroupSoap
75   * @see com.liferay.portal.service.GroupServiceUtil
76   * @see com.liferay.portal.service.http.GroupServiceHttp
77   *
78   */
79  public class GroupServiceSoap {
80      public static com.liferay.portal.model.GroupSoap addGroup(
81          java.lang.String name, java.lang.String description, int type,
82          java.lang.String friendlyURL, boolean active) throws RemoteException {
83          try {
84              com.liferay.portal.model.Group returnValue = GroupServiceUtil.addGroup(name,
85                      description, type, friendlyURL, active);
86  
87              return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
88          }
89          catch (Exception e) {
90              _log.error(e, e);
91  
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          int 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 
109             throw new RemoteException(e.getMessage());
110         }
111     }
112 
113     public static void addRoleGroups(long roleId, long[] groupIds)
114         throws RemoteException {
115         try {
116             GroupServiceUtil.addRoleGroups(roleId, groupIds);
117         }
118         catch (Exception e) {
119             _log.error(e, e);
120 
121             throw new RemoteException(e.getMessage());
122         }
123     }
124 
125     public static void deleteGroup(long groupId) throws RemoteException {
126         try {
127             GroupServiceUtil.deleteGroup(groupId);
128         }
129         catch (Exception e) {
130             _log.error(e, e);
131 
132             throw new RemoteException(e.getMessage());
133         }
134     }
135 
136     public static com.liferay.portal.model.GroupSoap getGroup(long groupId)
137         throws RemoteException {
138         try {
139             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(groupId);
140 
141             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
142         }
143         catch (Exception e) {
144             _log.error(e, e);
145 
146             throw new RemoteException(e.getMessage());
147         }
148     }
149 
150     public static com.liferay.portal.model.GroupSoap getGroup(long companyId,
151         java.lang.String name) throws RemoteException {
152         try {
153             com.liferay.portal.model.Group returnValue = GroupServiceUtil.getGroup(companyId,
154                     name);
155 
156             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
157         }
158         catch (Exception e) {
159             _log.error(e, e);
160 
161             throw new RemoteException(e.getMessage());
162         }
163     }
164 
165     public static com.liferay.portal.model.GroupSoap[] getOrganizationsGroups(
166         com.liferay.portal.model.OrganizationSoap[] organizations)
167         throws RemoteException {
168         try {
169             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getOrganizationsGroups(com.liferay.portal.model.impl.OrganizationModelImpl.toModels(
170                         organizations));
171 
172             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
173         }
174         catch (Exception e) {
175             _log.error(e, e);
176 
177             throw new RemoteException(e.getMessage());
178         }
179     }
180 
181     public static com.liferay.portal.model.GroupSoap[] getUserGroupsGroups(
182         com.liferay.portal.model.UserGroupSoap[] userGroups)
183         throws RemoteException {
184         try {
185             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.getUserGroupsGroups(com.liferay.portal.model.impl.UserGroupModelImpl.toModels(
186                         userGroups));
187 
188             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
189         }
190         catch (Exception e) {
191             _log.error(e, e);
192 
193             throw new RemoteException(e.getMessage());
194         }
195     }
196 
197     public static boolean hasUserGroup(long userId, long groupId)
198         throws RemoteException {
199         try {
200             boolean returnValue = GroupServiceUtil.hasUserGroup(userId, groupId);
201 
202             return returnValue;
203         }
204         catch (Exception e) {
205             _log.error(e, e);
206 
207             throw new RemoteException(e.getMessage());
208         }
209     }
210 
211     public static com.liferay.portal.model.GroupSoap[] search(long companyId,
212         java.lang.String name, java.lang.String description,
213         java.lang.String[] params, int start, int end)
214         throws RemoteException {
215         try {
216             java.util.List<com.liferay.portal.model.Group> returnValue = GroupServiceUtil.search(companyId,
217                     name, description, params, start, end);
218 
219             return com.liferay.portal.model.GroupSoap.toSoapModels(returnValue);
220         }
221         catch (Exception e) {
222             _log.error(e, e);
223 
224             throw new RemoteException(e.getMessage());
225         }
226     }
227 
228     public static int searchCount(long companyId, java.lang.String name,
229         java.lang.String description, java.lang.String[] params)
230         throws RemoteException {
231         try {
232             int returnValue = GroupServiceUtil.searchCount(companyId, name,
233                     description, params);
234 
235             return returnValue;
236         }
237         catch (Exception e) {
238             _log.error(e, e);
239 
240             throw new RemoteException(e.getMessage());
241         }
242     }
243 
244     public static void setRoleGroups(long roleId, long[] groupIds)
245         throws RemoteException {
246         try {
247             GroupServiceUtil.setRoleGroups(roleId, groupIds);
248         }
249         catch (Exception e) {
250             _log.error(e, e);
251 
252             throw new RemoteException(e.getMessage());
253         }
254     }
255 
256     public static void unsetRoleGroups(long roleId, long[] groupIds)
257         throws RemoteException {
258         try {
259             GroupServiceUtil.unsetRoleGroups(roleId, groupIds);
260         }
261         catch (Exception e) {
262             _log.error(e, e);
263 
264             throw new RemoteException(e.getMessage());
265         }
266     }
267 
268     public static com.liferay.portal.model.GroupSoap updateFriendlyURL(
269         long groupId, java.lang.String friendlyURL) throws RemoteException {
270         try {
271             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateFriendlyURL(groupId,
272                     friendlyURL);
273 
274             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
275         }
276         catch (Exception e) {
277             _log.error(e, e);
278 
279             throw new RemoteException(e.getMessage());
280         }
281     }
282 
283     public static com.liferay.portal.model.GroupSoap updateGroup(long groupId,
284         java.lang.String name, java.lang.String description, int type,
285         java.lang.String friendlyURL, boolean active) throws RemoteException {
286         try {
287             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
288                     name, description, type, friendlyURL, active);
289 
290             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
291         }
292         catch (Exception e) {
293             _log.error(e, e);
294 
295             throw new RemoteException(e.getMessage());
296         }
297     }
298 
299     public static com.liferay.portal.model.GroupSoap updateGroup(long groupId,
300         java.lang.String typeSettings) throws RemoteException {
301         try {
302             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateGroup(groupId,
303                     typeSettings);
304 
305             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
306         }
307         catch (Exception e) {
308             _log.error(e, e);
309 
310             throw new RemoteException(e.getMessage());
311         }
312     }
313 
314     public static com.liferay.portal.model.GroupSoap updateWorkflow(
315         long groupId, boolean workflowEnabled, int workflowStages,
316         java.lang.String workflowRoleNames) throws RemoteException {
317         try {
318             com.liferay.portal.model.Group returnValue = GroupServiceUtil.updateWorkflow(groupId,
319                     workflowEnabled, workflowStages, workflowRoleNames);
320 
321             return com.liferay.portal.model.GroupSoap.toSoapModel(returnValue);
322         }
323         catch (Exception e) {
324             _log.error(e, e);
325 
326             throw new RemoteException(e.getMessage());
327         }
328     }
329 
330     private static Log _log = LogFactoryUtil.getLog(GroupServiceSoap.class);
331 }