001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.service.UserGroupServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    /**
026     * Provides the SOAP utility for the
027     * {@link UserGroupServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it is difficult for SOAP to
030     * support certain types.
031     *
032     * <p>
033     * ServiceBuilder follows certain rules in translating the methods. For example,
034     * if the method in the service utility returns a {@link java.util.List}, that
035     * is translated to an array of {@link com.liferay.portal.model.UserGroupSoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.model.UserGroup}, that is translated to a
038     * {@link com.liferay.portal.model.UserGroupSoap}. Methods that SOAP cannot
039     * safely wire are skipped.
040     * </p>
041     *
042     * <p>
043     * The benefits of using the SOAP utility is that it is cross platform
044     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
045     * even Perl, to call the generated services. One drawback of SOAP is that it is
046     * slow because it needs to serialize all calls into a text format (XML).
047     * </p>
048     *
049     * <p>
050     * You can see a list of services at http://localhost:8080/api/axis. Set the
051     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
052     * security.
053     * </p>
054     *
055     * <p>
056     * The SOAP utility is only generated for remote services.
057     * </p>
058     *
059     * @author Brian Wing Shun Chan
060     * @see UserGroupServiceHttp
061     * @see com.liferay.portal.model.UserGroupSoap
062     * @see UserGroupServiceUtil
063     * @generated
064     */
065    @ProviderType
066    public class UserGroupServiceSoap {
067            /**
068            * Adds the user groups to the group.
069            *
070            * @param groupId the primary key of the group
071            * @param userGroupIds the primary keys of the user groups
072            */
073            public static void addGroupUserGroups(long groupId, long[] userGroupIds)
074                    throws RemoteException {
075                    try {
076                            UserGroupServiceUtil.addGroupUserGroups(groupId, userGroupIds);
077                    }
078                    catch (Exception e) {
079                            _log.error(e, e);
080    
081                            throw new RemoteException(e.getMessage());
082                    }
083            }
084    
085            /**
086            * Adds the user groups to the team
087            *
088            * @param teamId the primary key of the team
089            * @param userGroupIds the primary keys of the user groups
090            */
091            public static void addTeamUserGroups(long teamId, long[] userGroupIds)
092                    throws RemoteException {
093                    try {
094                            UserGroupServiceUtil.addTeamUserGroups(teamId, userGroupIds);
095                    }
096                    catch (Exception e) {
097                            _log.error(e, e);
098    
099                            throw new RemoteException(e.getMessage());
100                    }
101            }
102    
103            /**
104            * Adds a user group.
105            *
106            * <p>
107            * This method handles the creation and bookkeeping of the user group,
108            * including its resources, metadata, and internal data structures.
109            * </p>
110            *
111            * @param name the user group's name
112            * @param description the user group's description
113            * @return the user group
114            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String,
115            ServiceContext)}
116            */
117            @Deprecated
118            public static com.liferay.portal.model.UserGroupSoap addUserGroup(
119                    java.lang.String name, java.lang.String description)
120                    throws RemoteException {
121                    try {
122                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name,
123                                            description);
124    
125                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
126                    }
127                    catch (Exception e) {
128                            _log.error(e, e);
129    
130                            throw new RemoteException(e.getMessage());
131                    }
132            }
133    
134            /**
135            * Adds a user group.
136            *
137            * <p>
138            * This method handles the creation and bookkeeping of the user group,
139            * including its resources, metadata, and internal data structures.
140            * </p>
141            *
142            * @param name the user group's name
143            * @param description the user group's description
144            * @param serviceContext the service context to be applied (optionally
145            <code>null</code>). Can set expando bridge attributes for the
146            user group.
147            * @return the user group
148            */
149            public static com.liferay.portal.model.UserGroupSoap addUserGroup(
150                    java.lang.String name, java.lang.String description,
151                    com.liferay.portal.service.ServiceContext serviceContext)
152                    throws RemoteException {
153                    try {
154                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name,
155                                            description, serviceContext);
156    
157                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
158                    }
159                    catch (Exception e) {
160                            _log.error(e, e);
161    
162                            throw new RemoteException(e.getMessage());
163                    }
164            }
165    
166            /**
167            * Deletes the user group.
168            *
169            * @param userGroupId the primary key of the user group
170            */
171            public static void deleteUserGroup(long userGroupId)
172                    throws RemoteException {
173                    try {
174                            UserGroupServiceUtil.deleteUserGroup(userGroupId);
175                    }
176                    catch (Exception e) {
177                            _log.error(e, e);
178    
179                            throw new RemoteException(e.getMessage());
180                    }
181            }
182    
183            /**
184            * Fetches the user group with the primary key.
185            *
186            * @param userGroupId the primary key of the user group
187            * @return the user group with the primary key
188            */
189            public static com.liferay.portal.model.UserGroupSoap fetchUserGroup(
190                    long userGroupId) throws RemoteException {
191                    try {
192                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.fetchUserGroup(userGroupId);
193    
194                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
195                    }
196                    catch (Exception e) {
197                            _log.error(e, e);
198    
199                            throw new RemoteException(e.getMessage());
200                    }
201            }
202    
203            /**
204            * Returns the user group with the primary key.
205            *
206            * @param userGroupId the primary key of the user group
207            * @return the user group with the primary key
208            */
209            public static com.liferay.portal.model.UserGroupSoap getUserGroup(
210                    long userGroupId) throws RemoteException {
211                    try {
212                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId);
213    
214                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
215                    }
216                    catch (Exception e) {
217                            _log.error(e, e);
218    
219                            throw new RemoteException(e.getMessage());
220                    }
221            }
222    
223            /**
224            * Returns the user group with the name.
225            *
226            * @param name the user group's name
227            * @return the user group with the name
228            */
229            public static com.liferay.portal.model.UserGroupSoap getUserGroup(
230                    java.lang.String name) throws RemoteException {
231                    try {
232                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name);
233    
234                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
235                    }
236                    catch (Exception e) {
237                            _log.error(e, e);
238    
239                            throw new RemoteException(e.getMessage());
240                    }
241            }
242    
243            public static com.liferay.portal.model.UserGroupSoap[] getUserGroups(
244                    long companyId) throws RemoteException {
245                    try {
246                            java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserGroups(companyId);
247    
248                            return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue);
249                    }
250                    catch (Exception e) {
251                            _log.error(e, e);
252    
253                            throw new RemoteException(e.getMessage());
254                    }
255            }
256    
257            /**
258            * Returns all the user groups to which the user belongs.
259            *
260            * @param userId the primary key of the user
261            * @return the user groups to which the user belongs
262            */
263            public static com.liferay.portal.model.UserGroupSoap[] getUserUserGroups(
264                    long userId) throws RemoteException {
265                    try {
266                            java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserUserGroups(userId);
267    
268                            return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue);
269                    }
270                    catch (Exception e) {
271                            _log.error(e, e);
272    
273                            throw new RemoteException(e.getMessage());
274                    }
275            }
276    
277            /**
278            * Removes the user groups from the group.
279            *
280            * @param groupId the primary key of the group
281            * @param userGroupIds the primary keys of the user groups
282            */
283            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
284                    throws RemoteException {
285                    try {
286                            UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds);
287                    }
288                    catch (Exception e) {
289                            _log.error(e, e);
290    
291                            throw new RemoteException(e.getMessage());
292                    }
293            }
294    
295            /**
296            * Removes the user groups from the team.
297            *
298            * @param teamId the primary key of the team
299            * @param userGroupIds the primary keys of the user groups
300            */
301            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
302                    throws RemoteException {
303                    try {
304                            UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds);
305                    }
306                    catch (Exception e) {
307                            _log.error(e, e);
308    
309                            throw new RemoteException(e.getMessage());
310                    }
311            }
312    
313            /**
314            * Updates the user group.
315            *
316            * @param userGroupId the primary key of the user group
317            * @param name the user group's name
318            * @param description the the user group's description
319            * @return the user group
320            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long,
321            String, String, ServiceContext)}
322            */
323            @Deprecated
324            public static com.liferay.portal.model.UserGroupSoap updateUserGroup(
325                    long userGroupId, java.lang.String name, java.lang.String description)
326                    throws RemoteException {
327                    try {
328                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId,
329                                            name, description);
330    
331                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
332                    }
333                    catch (Exception e) {
334                            _log.error(e, e);
335    
336                            throw new RemoteException(e.getMessage());
337                    }
338            }
339    
340            /**
341            * Updates the user group.
342            *
343            * @param userGroupId the primary key of the user group
344            * @param name the user group's name
345            * @param description the the user group's description
346            * @param serviceContext the service context to be applied (optionally
347            <code>null</code>). Can set expando bridge attributes for the
348            user group.
349            * @return the user group
350            */
351            public static com.liferay.portal.model.UserGroupSoap updateUserGroup(
352                    long userGroupId, java.lang.String name, java.lang.String description,
353                    com.liferay.portal.service.ServiceContext serviceContext)
354                    throws RemoteException {
355                    try {
356                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId,
357                                            name, description, serviceContext);
358    
359                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
360                    }
361                    catch (Exception e) {
362                            _log.error(e, e);
363    
364                            throw new RemoteException(e.getMessage());
365                    }
366            }
367    
368            private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class);
369    }