001 /** 002 * Copyright (c) 2000-present 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 */ 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 */ 097 public static void addTeamUserGroups(long teamId, long[] userGroupIds) 098 throws RemoteException { 099 try { 100 UserGroupServiceUtil.addTeamUserGroups(teamId, userGroupIds); 101 } 102 catch (Exception e) { 103 _log.error(e, e); 104 105 throw new RemoteException(e.getMessage()); 106 } 107 } 108 109 /** 110 * Adds a user group. 111 * 112 * <p> 113 * This method handles the creation and bookkeeping of the user group, 114 * including its resources, metadata, and internal data structures. 115 * </p> 116 * 117 * @param name the user group's name 118 * @param description the user group's description 119 * @return the user group 120 * @throws PortalException if the user group's information was invalid 121 or if the user did not have permission to add the user group 122 * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String, 123 ServiceContext)} 124 */ 125 @Deprecated 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 service context to be applied (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 */ 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 */ 184 public static void deleteUserGroup(long userGroupId) 185 throws RemoteException { 186 try { 187 UserGroupServiceUtil.deleteUserGroup(userGroupId); 188 } 189 catch (Exception e) { 190 _log.error(e, e); 191 192 throw new RemoteException(e.getMessage()); 193 } 194 } 195 196 /** 197 * Returns the user group with the primary key. 198 * 199 * @param userGroupId the primary key of the user group 200 * @return Returns the user group with the primary key 201 * @throws PortalException if a user group with the primary key could not be 202 found or if the user did not have permission to view the user 203 group 204 */ 205 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 206 long userGroupId) throws RemoteException { 207 try { 208 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId); 209 210 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 211 } 212 catch (Exception e) { 213 _log.error(e, e); 214 215 throw new RemoteException(e.getMessage()); 216 } 217 } 218 219 /** 220 * Returns the user group with the name. 221 * 222 * @param name the user group's name 223 * @return Returns the user group with the name 224 * @throws PortalException if a user group with the name could not be found 225 or if the user did not have permission to view the user group 226 */ 227 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 228 java.lang.String name) throws RemoteException { 229 try { 230 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name); 231 232 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 233 } 234 catch (Exception e) { 235 _log.error(e, e); 236 237 throw new RemoteException(e.getMessage()); 238 } 239 } 240 241 /** 242 * Returns all the user groups to which the user belongs. 243 * 244 * @param userId the primary key of the user 245 * @return the user groups to which the user belongs 246 * @throws PortalException if the current user did not have permission to 247 view the user or any one of the user group members 248 */ 249 public static com.liferay.portal.model.UserGroupSoap[] getUserUserGroups( 250 long userId) throws RemoteException { 251 try { 252 java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserUserGroups(userId); 253 254 return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue); 255 } 256 catch (Exception e) { 257 _log.error(e, e); 258 259 throw new RemoteException(e.getMessage()); 260 } 261 } 262 263 /** 264 * Removes the user groups from the group. 265 * 266 * @param groupId the primary key of the group 267 * @param userGroupIds the primary keys of the user groups 268 * @throws PortalException if the user did not have permission to assign 269 group members 270 */ 271 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 272 throws RemoteException { 273 try { 274 UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds); 275 } 276 catch (Exception e) { 277 _log.error(e, e); 278 279 throw new RemoteException(e.getMessage()); 280 } 281 } 282 283 /** 284 * Removes the user groups from the team. 285 * 286 * @param teamId the primary key of the team 287 * @param userGroupIds the primary keys of the user groups 288 * @throws PortalException if the user did not have permission to assign 289 team members 290 */ 291 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 292 throws RemoteException { 293 try { 294 UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds); 295 } 296 catch (Exception e) { 297 _log.error(e, e); 298 299 throw new RemoteException(e.getMessage()); 300 } 301 } 302 303 /** 304 * Updates the user group. 305 * 306 * @param userGroupId the primary key of the user group 307 * @param name the user group's name 308 * @param description the the user group's description 309 * @return the user group 310 * @throws PortalException if a user group with the primary key was not 311 found, if the new information was invalid, or if the user did 312 not have permission to update the user group information 313 * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, 314 String, String, ServiceContext)} 315 */ 316 @Deprecated 317 public static com.liferay.portal.model.UserGroupSoap updateUserGroup( 318 long userGroupId, java.lang.String name, java.lang.String description) 319 throws RemoteException { 320 try { 321 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId, 322 name, description); 323 324 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 325 } 326 catch (Exception e) { 327 _log.error(e, e); 328 329 throw new RemoteException(e.getMessage()); 330 } 331 } 332 333 /** 334 * Updates the user group. 335 * 336 * @param userGroupId the primary key of the user group 337 * @param name the user group's name 338 * @param description the the user group's description 339 * @param serviceContext the service context to be applied (optionally 340 <code>null</code>). Can set expando bridge attributes for the 341 user group. 342 * @return the user group 343 * @throws PortalException if a user group with the primary key was not 344 found, if the new information was invalid, or if the user did not 345 have permission to update the user group information 346 */ 347 public static com.liferay.portal.model.UserGroupSoap updateUserGroup( 348 long userGroupId, java.lang.String name, java.lang.String description, 349 com.liferay.portal.service.ServiceContext serviceContext) 350 throws RemoteException { 351 try { 352 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId, 353 name, description, serviceContext); 354 355 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 356 } 357 catch (Exception e) { 358 _log.error(e, e); 359 360 throw new RemoteException(e.getMessage()); 361 } 362 } 363 364 private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class); 365 }