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 122 or if the user did not have permission to add the user group 123 * @throws SystemException if a system exception occurred 124 * @deprecated {@link #addUserGroup(String, String, serviceContext)} 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 * Adds a user group. 144 * 145 * <p> 146 * This method handles the creation and bookkeeping of the user group, 147 * including its resources, metadata, and internal data structures. 148 * </p> 149 * 150 * @param name the user group's name 151 * @param description the user group's description 152 * @param serviceContext the user group's service context (optionally 153 <code>null</code>). Can set expando bridge attributes for the 154 user group. 155 * @return the user group 156 * @throws PortalException if the user group's information was invalid or if 157 the user did not have permission to add the user group 158 * @throws SystemException if a system exception occurred 159 */ 160 public static com.liferay.portal.model.UserGroupSoap addUserGroup( 161 java.lang.String name, java.lang.String description, 162 com.liferay.portal.service.ServiceContext serviceContext) 163 throws RemoteException { 164 try { 165 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name, 166 description, serviceContext); 167 168 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 169 } 170 catch (Exception e) { 171 _log.error(e, e); 172 173 throw new RemoteException(e.getMessage()); 174 } 175 } 176 177 /** 178 * Deletes the user group. 179 * 180 * @param userGroupId the primary key of the user group 181 * @throws PortalException if a user group with the primary key could not be 182 found, if the user did not have permission to delete the user 183 group, or if the user group had a workflow in approved status 184 * @throws SystemException if a system exception occurred 185 */ 186 public static void deleteUserGroup(long userGroupId) 187 throws RemoteException { 188 try { 189 UserGroupServiceUtil.deleteUserGroup(userGroupId); 190 } 191 catch (Exception e) { 192 _log.error(e, e); 193 194 throw new RemoteException(e.getMessage()); 195 } 196 } 197 198 /** 199 * Returns the user group with the primary key. 200 * 201 * @param userGroupId the primary key of the user group 202 * @return Returns the user group with the primary key 203 * @throws PortalException if a user group with the primary key could not be 204 found or if the user did not have permission to view the user 205 group 206 * @throws SystemException if a system exception occurred 207 */ 208 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 209 long userGroupId) throws RemoteException { 210 try { 211 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId); 212 213 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 214 } 215 catch (Exception e) { 216 _log.error(e, e); 217 218 throw new RemoteException(e.getMessage()); 219 } 220 } 221 222 /** 223 * Returns the user group with the name. 224 * 225 * @param name the user group's name 226 * @return Returns the user group with the name 227 * @throws PortalException if a user group with the name could not be found 228 or if the user did not have permission to view the user group 229 * @throws SystemException if a system exception occurred 230 */ 231 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 232 java.lang.String name) throws RemoteException { 233 try { 234 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name); 235 236 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 237 } 238 catch (Exception e) { 239 _log.error(e, e); 240 241 throw new RemoteException(e.getMessage()); 242 } 243 } 244 245 /** 246 * Returns all the user groups to which the user belongs. 247 * 248 * @param userId the primary key of the user 249 * @return the user groups to which the user belongs 250 * @throws PortalException if the current user did not have permission to 251 view the user or any one of the user group members 252 * @throws SystemException if a system exception occurred 253 */ 254 public static com.liferay.portal.model.UserGroupSoap[] getUserUserGroups( 255 long userId) throws RemoteException { 256 try { 257 java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserUserGroups(userId); 258 259 return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue); 260 } 261 catch (Exception e) { 262 _log.error(e, e); 263 264 throw new RemoteException(e.getMessage()); 265 } 266 } 267 268 /** 269 * Removes the user groups from the group. 270 * 271 * @param groupId the primary key of the group 272 * @param userGroupIds the primary keys of the user groups 273 * @throws PortalException if the user did not have permission to assign 274 group members 275 * @throws SystemException if a system exception occurred 276 */ 277 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 278 throws RemoteException { 279 try { 280 UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds); 281 } 282 catch (Exception e) { 283 _log.error(e, e); 284 285 throw new RemoteException(e.getMessage()); 286 } 287 } 288 289 /** 290 * Removes the user groups from the team. 291 * 292 * @param teamId the primary key of the team 293 * @param userGroupIds the primary keys of the user groups 294 * @throws PortalException if the user did not have permission to assign 295 team members 296 * @throws SystemException if a system exception occurred 297 */ 298 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 299 throws RemoteException { 300 try { 301 UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds); 302 } 303 catch (Exception e) { 304 _log.error(e, e); 305 306 throw new RemoteException(e.getMessage()); 307 } 308 } 309 310 /** 311 * Updates the user group. 312 * 313 * @param userGroupId the primary key of the user group 314 * @param name the user group's name 315 * @param description the the user group's description 316 * @return the user group 317 * @throws PortalException if a user group with the primary key was not 318 found, if the new information was invalid, or if the user did 319 not have permission to update the user group information 320 * @throws SystemException if a system exception occurred 321 * @deprecated {@link #updateUserGroup(long, String, String, 322 serviceContext)} 323 */ 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 user group's service context (optionally 347 <code>null</code>). Can set expando bridge attributes for the 348 user group. 349 * @return the user group 350 * @throws PortalException if a user group with the primary key was not 351 found, if the new information was invalid, or if the user did not 352 have permission to update the user group information 353 * @throws SystemException if a system exception occurred 354 */ 355 public static com.liferay.portal.model.UserGroupSoap updateUserGroup( 356 long userGroupId, java.lang.String name, java.lang.String description, 357 com.liferay.portal.service.ServiceContext serviceContext) 358 throws RemoteException { 359 try { 360 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId, 361 name, description, serviceContext); 362 363 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 364 } 365 catch (Exception e) { 366 _log.error(e, e); 367 368 throw new RemoteException(e.getMessage()); 369 } 370 } 371 372 private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class); 373 }