001 /** 002 * Copyright (c) 2000-2012 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 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 com.liferay.portal.service.UserGroupServiceUtil 063 * @generated 064 */ 065 public class UserGroupServiceSoap { 066 /** 067 * Adds the user groups to the group. 068 * 069 * @param groupId the primary key of the group 070 * @param userGroupIds the primary keys of the user groups 071 * @throws PortalException if a group or user group with the primary key 072 could not be found, or if the user did not have permission to 073 assign group members 074 * @throws SystemException if a system exception occurred 075 */ 076 public static void addGroupUserGroups(long groupId, long[] userGroupIds) 077 throws RemoteException { 078 try { 079 UserGroupServiceUtil.addGroupUserGroups(groupId, userGroupIds); 080 } 081 catch (Exception e) { 082 _log.error(e, e); 083 084 throw new RemoteException(e.getMessage()); 085 } 086 } 087 088 /** 089 * Adds the user groups to the team 090 * 091 * @param teamId the primary key of the team 092 * @param userGroupIds the primary keys of the user groups 093 * @throws PortalException if a team or user group with the primary key 094 could not be found, or if the user did not have permission to 095 assign team members 096 * @throws SystemException if a system exception occurred 097 */ 098 public static void addTeamUserGroups(long teamId, long[] userGroupIds) 099 throws RemoteException { 100 try { 101 UserGroupServiceUtil.addTeamUserGroups(teamId, userGroupIds); 102 } 103 catch (Exception e) { 104 _log.error(e, e); 105 106 throw new RemoteException(e.getMessage()); 107 } 108 } 109 110 /** 111 * Adds a user group. 112 * 113 * <p> 114 * This method handles the creation and bookkeeping of the user group, 115 * including its resources, metadata, and internal data structures. 116 * </p> 117 * 118 * @param name the user group's name 119 * @param description the user group's description 120 * @return the user group 121 * @throws PortalException if the user group's information was invalid or if 122 the user did not have permission to add the user group 123 * @throws SystemException if a system exception occurred 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 * Deletes the user group. 143 * 144 * @param userGroupId the primary key of the user group 145 * @throws PortalException if a user group with the primary key could not be 146 found, if the user did not have permission to delete the user 147 group, or if the user group had a workflow in approved status 148 * @throws SystemException if a system exception occurred 149 */ 150 public static void deleteUserGroup(long userGroupId) 151 throws RemoteException { 152 try { 153 UserGroupServiceUtil.deleteUserGroup(userGroupId); 154 } 155 catch (Exception e) { 156 _log.error(e, e); 157 158 throw new RemoteException(e.getMessage()); 159 } 160 } 161 162 /** 163 * Returns the user group with the primary key. 164 * 165 * @param userGroupId the primary key of the user group 166 * @return Returns the user group with the primary key 167 * @throws PortalException if a user group with the primary key could not be 168 found or if the user did not have permission to view the user 169 group 170 * @throws SystemException if a system exception occurred 171 */ 172 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 173 long userGroupId) throws RemoteException { 174 try { 175 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId); 176 177 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 178 } 179 catch (Exception e) { 180 _log.error(e, e); 181 182 throw new RemoteException(e.getMessage()); 183 } 184 } 185 186 /** 187 * Returns the user group with the name. 188 * 189 * @param name the user group's name 190 * @return Returns the user group with the name 191 * @throws PortalException if a user group with the name could not be found 192 or if the user did not have permission to view the user group 193 * @throws SystemException if a system exception occurred 194 */ 195 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 196 java.lang.String name) throws RemoteException { 197 try { 198 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name); 199 200 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 201 } 202 catch (Exception e) { 203 _log.error(e, e); 204 205 throw new RemoteException(e.getMessage()); 206 } 207 } 208 209 /** 210 * Returns all the user groups to which the user belongs. 211 * 212 * @param userId the primary key of the user 213 * @return the user groups to which the user belongs 214 * @throws PortalException if the current user did not have permission to 215 view the user or any one of the user group members 216 * @throws SystemException if a system exception occurred 217 */ 218 public static com.liferay.portal.model.UserGroupSoap[] getUserUserGroups( 219 long userId) throws RemoteException { 220 try { 221 java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserUserGroups(userId); 222 223 return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue); 224 } 225 catch (Exception e) { 226 _log.error(e, e); 227 228 throw new RemoteException(e.getMessage()); 229 } 230 } 231 232 /** 233 * Removes the user groups from the group. 234 * 235 * @param groupId the primary key of the group 236 * @param userGroupIds the primary keys of the user groups 237 * @throws PortalException if the user did not have permission to assign 238 group members 239 * @throws SystemException if a system exception occurred 240 */ 241 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 242 throws RemoteException { 243 try { 244 UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds); 245 } 246 catch (Exception e) { 247 _log.error(e, e); 248 249 throw new RemoteException(e.getMessage()); 250 } 251 } 252 253 /** 254 * Removes the user groups from the team. 255 * 256 * @param teamId the primary key of the team 257 * @param userGroupIds the primary keys of the user groups 258 * @throws PortalException if the user did not have permission to assign 259 team members 260 * @throws SystemException if a system exception occurred 261 */ 262 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 263 throws RemoteException { 264 try { 265 UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds); 266 } 267 catch (Exception e) { 268 _log.error(e, e); 269 270 throw new RemoteException(e.getMessage()); 271 } 272 } 273 274 /** 275 * Updates the user group. 276 * 277 * @param userGroupId the primary key of the user group 278 * @param name the user group's name 279 * @param description the the user group's description 280 * @return the user group 281 * @throws PortalException if a user group with the primary key was not 282 found, if the new information was invalid, or if the user did not 283 have permission to update the user group information 284 * @throws SystemException if a system exception occurred 285 */ 286 public static com.liferay.portal.model.UserGroupSoap updateUserGroup( 287 long userGroupId, java.lang.String name, java.lang.String description) 288 throws RemoteException { 289 try { 290 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId, 291 name, description); 292 293 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 294 } 295 catch (Exception e) { 296 _log.error(e, e); 297 298 throw new RemoteException(e.getMessage()); 299 } 300 } 301 302 private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class); 303 }