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