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     * <p>
025     * This class provides a SOAP utility for the
026     * {@link com.liferay.portal.service.UserGroupServiceUtil} service utility. The
027     * static methods of this class calls the same methods of the service utility.
028     * However, the signatures are different because it is difficult for SOAP to
029     * support certain types.
030     * </p>
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
051     * http://localhost:8080/api/secure/axis. Set the property
052     * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
053     * security.
054     * </p>
055     *
056     * <p>
057     * The SOAP utility is only generated for remote services.
058     * </p>
059     *
060     * @author    Brian Wing Shun Chan
061     * @see       UserGroupServiceHttp
062     * @see       com.liferay.portal.model.UserGroupSoap
063     * @see       com.liferay.portal.service.UserGroupServiceUtil
064     * @generated
065     */
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            * @throws PortalException if a group or user group with the primary key
073            could not be found, or if the user did not have permission to
074            assign group members
075            * @throws SystemException if a system exception occurred
076            */
077            public static void addGroupUserGroups(long groupId, long[] userGroupIds)
078                    throws RemoteException {
079                    try {
080                            UserGroupServiceUtil.addGroupUserGroups(groupId, userGroupIds);
081                    }
082                    catch (Exception e) {
083                            _log.error(e, e);
084    
085                            throw new RemoteException(e.getMessage());
086                    }
087            }
088    
089            /**
090            * Adds the user groups to the team
091            *
092            * @param teamId the primary key of the team
093            * @param userGroupIds the primary keys of the user groups
094            * @throws PortalException if a team or user group with the primary key
095            could not be found, or if the user did not have permission to
096            assign team members
097            * @throws SystemException if a system exception occurred
098            */
099            public static void addTeamUserGroups(long teamId, long[] userGroupIds)
100                    throws RemoteException {
101                    try {
102                            UserGroupServiceUtil.addTeamUserGroups(teamId, userGroupIds);
103                    }
104                    catch (Exception e) {
105                            _log.error(e, e);
106    
107                            throw new RemoteException(e.getMessage());
108                    }
109            }
110    
111            /**
112            * Adds a user group.
113            *
114            * <p>
115            * This method handles the creation and bookkeeping of the user group,
116            * including its resources, metadata, and internal data structures.
117            * </p>
118            *
119            * @param name the user group's name
120            * @param description the user group's description
121            * @return the user group
122            * @throws PortalException if the user group's information was invalid or if
123            the user did not have permission to add the user group
124            * @throws SystemException if a system exception occurred
125            */
126            public static com.liferay.portal.model.UserGroupSoap addUserGroup(
127                    java.lang.String name, java.lang.String description)
128                    throws RemoteException {
129                    try {
130                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name,
131                                            description);
132    
133                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
134                    }
135                    catch (Exception e) {
136                            _log.error(e, e);
137    
138                            throw new RemoteException(e.getMessage());
139                    }
140            }
141    
142            /**
143            * Deletes the user group.
144            *
145            * @param userGroupId the primary key of the user group
146            * @throws PortalException if a user group with the primary key could not be
147            found, if the user did not have permission to delete the user
148            group, or if the user group had a workflow in approved status
149            * @throws SystemException if a system exception occurred
150            */
151            public static void deleteUserGroup(long userGroupId)
152                    throws RemoteException {
153                    try {
154                            UserGroupServiceUtil.deleteUserGroup(userGroupId);
155                    }
156                    catch (Exception e) {
157                            _log.error(e, e);
158    
159                            throw new RemoteException(e.getMessage());
160                    }
161            }
162    
163            /**
164            * Returns the user group with the primary key.
165            *
166            * @param userGroupId the primary key of the user group
167            * @return Returns the user group with the primary key
168            * @throws PortalException if a user group with the primary key could not be
169            found or if the user did not have permission to view the user
170            group
171            * @throws SystemException if a system exception occurred
172            */
173            public static com.liferay.portal.model.UserGroupSoap getUserGroup(
174                    long userGroupId) throws RemoteException {
175                    try {
176                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId);
177    
178                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
179                    }
180                    catch (Exception e) {
181                            _log.error(e, e);
182    
183                            throw new RemoteException(e.getMessage());
184                    }
185            }
186    
187            /**
188            * Returns the user group with the name.
189            *
190            * @param name the user group's name
191            * @return Returns the user group with the name
192            * @throws PortalException if a user group with the name could not be found
193            or if the user did not have permission to view the user group
194            * @throws SystemException if a system exception occurred
195            */
196            public static com.liferay.portal.model.UserGroupSoap getUserGroup(
197                    java.lang.String name) throws RemoteException {
198                    try {
199                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name);
200    
201                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
202                    }
203                    catch (Exception e) {
204                            _log.error(e, e);
205    
206                            throw new RemoteException(e.getMessage());
207                    }
208            }
209    
210            /**
211            * Returns all the user groups to which the user belongs.
212            *
213            * @param userId the primary key of the user
214            * @return the user groups to which the user belongs
215            * @throws PortalException if the current user did not have permission to
216            view the user or any one of the user group members
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portal.model.UserGroupSoap[] getUserUserGroups(
220                    long userId) throws RemoteException {
221                    try {
222                            java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserUserGroups(userId);
223    
224                            return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue);
225                    }
226                    catch (Exception e) {
227                            _log.error(e, e);
228    
229                            throw new RemoteException(e.getMessage());
230                    }
231            }
232    
233            /**
234            * Removes the user groups from the group.
235            *
236            * @param groupId the primary key of the group
237            * @param userGroupIds the primary keys of the user groups
238            * @throws PortalException if the user did not have permission to assign
239            group members
240            * @throws SystemException if a system exception occurred
241            */
242            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
243                    throws RemoteException {
244                    try {
245                            UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds);
246                    }
247                    catch (Exception e) {
248                            _log.error(e, e);
249    
250                            throw new RemoteException(e.getMessage());
251                    }
252            }
253    
254            /**
255            * Removes the user groups from the team.
256            *
257            * @param teamId the primary key of the team
258            * @param userGroupIds the primary keys of the user groups
259            * @throws PortalException if the user did not have permission to assign
260            team members
261            * @throws SystemException if a system exception occurred
262            */
263            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
264                    throws RemoteException {
265                    try {
266                            UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds);
267                    }
268                    catch (Exception e) {
269                            _log.error(e, e);
270    
271                            throw new RemoteException(e.getMessage());
272                    }
273            }
274    
275            /**
276            * Updates the user group.
277            *
278            * @param userGroupId the primary key of the user group
279            * @param name the user group's name
280            * @param description the the user group's description
281            * @return the user group
282            * @throws PortalException if a user group with the primary key was not
283            found, if the new information was invalid, or if the user did not
284            have permission to update the user group information
285            * @throws SystemException if a system exception occurred
286            */
287            public static com.liferay.portal.model.UserGroupSoap updateUserGroup(
288                    long userGroupId, java.lang.String name, java.lang.String description)
289                    throws RemoteException {
290                    try {
291                            com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId,
292                                            name, description);
293    
294                            return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue);
295                    }
296                    catch (Exception e) {
297                            _log.error(e, e);
298    
299                            throw new RemoteException(e.getMessage());
300                    }
301            }
302    
303            private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class);
304    }