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