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.kernel.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.kernel.model.UserGroupSoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.kernel.model.UserGroup}, that is translated to a
038     * {@link com.liferay.portal.kernel.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.kernel.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.kernel.model.UserGroupSoap addUserGroup(
119                    java.lang.String name, java.lang.String description)
120                    throws RemoteException {
121                    try {
122                            com.liferay.portal.kernel.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name,
123                                            description);
124    
125                            return com.liferay.portal.kernel.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.kernel.model.UserGroupSoap addUserGroup(
150                    java.lang.String name, java.lang.String description,
151                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
152                    throws RemoteException {
153                    try {
154                            com.liferay.portal.kernel.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name,
155                                            description, serviceContext);
156    
157                            return com.liferay.portal.kernel.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.kernel.model.UserGroupSoap fetchUserGroup(
190                    long userGroupId) throws RemoteException {
191                    try {
192                            com.liferay.portal.kernel.model.UserGroup returnValue = UserGroupServiceUtil.fetchUserGroup(userGroupId);
193    
194                            return com.liferay.portal.kernel.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.kernel.model.UserGroupSoap getUserGroup(
210                    long userGroupId) throws RemoteException {
211                    try {
212                            com.liferay.portal.kernel.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId);
213    
214                            return com.liferay.portal.kernel.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.kernel.model.UserGroupSoap getUserGroup(
230                    java.lang.String name) throws RemoteException {
231                    try {
232                            com.liferay.portal.kernel.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name);
233    
234                            return com.liferay.portal.kernel.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.kernel.model.UserGroupSoap[] getUserGroups(
244                    long companyId) throws RemoteException {
245                    try {
246                            java.util.List<com.liferay.portal.kernel.model.UserGroup> returnValue =
247                                    UserGroupServiceUtil.getUserGroups(companyId);
248    
249                            return com.liferay.portal.kernel.model.UserGroupSoap.toSoapModels(returnValue);
250                    }
251                    catch (Exception e) {
252                            _log.error(e, e);
253    
254                            throw new RemoteException(e.getMessage());
255                    }
256            }
257    
258            /**
259            * Returns all the user groups to which the user belongs.
260            *
261            * @param userId the primary key of the user
262            * @return the user groups to which the user belongs
263            */
264            public static com.liferay.portal.kernel.model.UserGroupSoap[] getUserUserGroups(
265                    long userId) throws RemoteException {
266                    try {
267                            java.util.List<com.liferay.portal.kernel.model.UserGroup> returnValue =
268                                    UserGroupServiceUtil.getUserUserGroups(userId);
269    
270                            return com.liferay.portal.kernel.model.UserGroupSoap.toSoapModels(returnValue);
271                    }
272                    catch (Exception e) {
273                            _log.error(e, e);
274    
275                            throw new RemoteException(e.getMessage());
276                    }
277            }
278    
279            /**
280            * Removes the user groups from the group.
281            *
282            * @param groupId the primary key of the group
283            * @param userGroupIds the primary keys of the user groups
284            */
285            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
286                    throws RemoteException {
287                    try {
288                            UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds);
289                    }
290                    catch (Exception e) {
291                            _log.error(e, e);
292    
293                            throw new RemoteException(e.getMessage());
294                    }
295            }
296    
297            /**
298            * Removes the user groups from the team.
299            *
300            * @param teamId the primary key of the team
301            * @param userGroupIds the primary keys of the user groups
302            */
303            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
304                    throws RemoteException {
305                    try {
306                            UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds);
307                    }
308                    catch (Exception e) {
309                            _log.error(e, e);
310    
311                            throw new RemoteException(e.getMessage());
312                    }
313            }
314    
315            /**
316            * Updates the user group.
317            *
318            * @param userGroupId the primary key of the user group
319            * @param name the user group's name
320            * @param description the the user group's description
321            * @return the user group
322            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long,
323            String, String, ServiceContext)}
324            */
325            @Deprecated
326            public static com.liferay.portal.kernel.model.UserGroupSoap updateUserGroup(
327                    long userGroupId, java.lang.String name, java.lang.String description)
328                    throws RemoteException {
329                    try {
330                            com.liferay.portal.kernel.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId,
331                                            name, description);
332    
333                            return com.liferay.portal.kernel.model.UserGroupSoap.toSoapModel(returnValue);
334                    }
335                    catch (Exception e) {
336                            _log.error(e, e);
337    
338                            throw new RemoteException(e.getMessage());
339                    }
340            }
341    
342            /**
343            * Updates the user group.
344            *
345            * @param userGroupId the primary key of the user group
346            * @param name the user group's name
347            * @param description the the user group's description
348            * @param serviceContext the service context to be applied (optionally
349            <code>null</code>). Can set expando bridge attributes for the
350            user group.
351            * @return the user group
352            */
353            public static com.liferay.portal.kernel.model.UserGroupSoap updateUserGroup(
354                    long userGroupId, java.lang.String name, java.lang.String description,
355                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
356                    throws RemoteException {
357                    try {
358                            com.liferay.portal.kernel.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId,
359                                            name, description, serviceContext);
360    
361                            return com.liferay.portal.kernel.model.UserGroupSoap.toSoapModel(returnValue);
362                    }
363                    catch (Exception e) {
364                            _log.error(e, e);
365    
366                            throw new RemoteException(e.getMessage());
367                    }
368            }
369    
370            private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class);
371    }