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 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 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 the user did not have permission to assign 073 group members 074 */ 075 public static void addGroupUserGroups(long groupId, long[] userGroupIds) 076 throws RemoteException { 077 try { 078 UserGroupServiceUtil.addGroupUserGroups(groupId, userGroupIds); 079 } 080 catch (Exception e) { 081 _log.error(e, e); 082 083 throw new RemoteException(e.getMessage()); 084 } 085 } 086 087 /** 088 * Adds the user groups to the team 089 * 090 * @param teamId the primary key of the team 091 * @param userGroupIds the primary keys of the user groups 092 * @throws PortalException if the user did not have permission to assign 093 team members 094 */ 095 public static void addTeamUserGroups(long teamId, long[] userGroupIds) 096 throws RemoteException { 097 try { 098 UserGroupServiceUtil.addTeamUserGroups(teamId, userGroupIds); 099 } 100 catch (Exception e) { 101 _log.error(e, e); 102 103 throw new RemoteException(e.getMessage()); 104 } 105 } 106 107 /** 108 * Adds a user group. 109 * 110 * <p> 111 * This method handles the creation and bookkeeping of the user group, 112 * including its resources, metadata, and internal data structures. 113 * </p> 114 * 115 * @param name the user group's name 116 * @param description the user group's description 117 * @return the user group 118 * @throws PortalException if the user group's information was invalid 119 or if the user did not have permission to add the user group 120 * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String, 121 ServiceContext)} 122 */ 123 @Deprecated 124 public static com.liferay.portal.model.UserGroupSoap addUserGroup( 125 java.lang.String name, java.lang.String description) 126 throws RemoteException { 127 try { 128 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name, 129 description); 130 131 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 132 } 133 catch (Exception e) { 134 _log.error(e, e); 135 136 throw new RemoteException(e.getMessage()); 137 } 138 } 139 140 /** 141 * Adds a user group. 142 * 143 * <p> 144 * This method handles the creation and bookkeeping of the user group, 145 * including its resources, metadata, and internal data structures. 146 * </p> 147 * 148 * @param name the user group's name 149 * @param description the user group's description 150 * @param serviceContext the service context to be applied (optionally 151 <code>null</code>). Can set expando bridge attributes for the 152 user group. 153 * @return the user group 154 * @throws PortalException if the user group's information was invalid or if 155 the user did not have permission to add the user group 156 */ 157 public static com.liferay.portal.model.UserGroupSoap addUserGroup( 158 java.lang.String name, java.lang.String description, 159 com.liferay.portal.service.ServiceContext serviceContext) 160 throws RemoteException { 161 try { 162 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name, 163 description, serviceContext); 164 165 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 166 } 167 catch (Exception e) { 168 _log.error(e, e); 169 170 throw new RemoteException(e.getMessage()); 171 } 172 } 173 174 /** 175 * Deletes the user group. 176 * 177 * @param userGroupId the primary key of the user group 178 * @throws PortalException if a user group with the primary key could not be 179 found, if the user did not have permission to delete the user 180 group, or if the user group had a workflow in approved status 181 */ 182 public static void deleteUserGroup(long userGroupId) 183 throws RemoteException { 184 try { 185 UserGroupServiceUtil.deleteUserGroup(userGroupId); 186 } 187 catch (Exception e) { 188 _log.error(e, e); 189 190 throw new RemoteException(e.getMessage()); 191 } 192 } 193 194 /** 195 * Fetches the user group with the primary key. 196 * 197 * @param userGroupId the primary key of the user group 198 * @return the user group with the primary key 199 * @throws PortalException if the user did not have permission to view the 200 user group 201 */ 202 public static com.liferay.portal.model.UserGroupSoap fetchUserGroup( 203 long userGroupId) throws RemoteException { 204 try { 205 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.fetchUserGroup(userGroupId); 206 207 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 208 } 209 catch (Exception e) { 210 _log.error(e, e); 211 212 throw new RemoteException(e.getMessage()); 213 } 214 } 215 216 /** 217 * Returns the user group with the primary key. 218 * 219 * @param userGroupId the primary key of the user group 220 * @return the user group with the primary key 221 * @throws PortalException if a user group with the primary key could not be 222 found or if the user did not have permission to view the user 223 group 224 */ 225 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 226 long userGroupId) throws RemoteException { 227 try { 228 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId); 229 230 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 231 } 232 catch (Exception e) { 233 _log.error(e, e); 234 235 throw new RemoteException(e.getMessage()); 236 } 237 } 238 239 /** 240 * Returns the user group with the name. 241 * 242 * @param name the user group's name 243 * @return the user group with the name 244 * @throws PortalException if a user group with the name could not be found 245 or if the user did not have permission to view the user group 246 */ 247 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 248 java.lang.String name) throws RemoteException { 249 try { 250 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name); 251 252 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 253 } 254 catch (Exception e) { 255 _log.error(e, e); 256 257 throw new RemoteException(e.getMessage()); 258 } 259 } 260 261 public static com.liferay.portal.model.UserGroupSoap[] getUserGroups( 262 long companyId) throws RemoteException { 263 try { 264 java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserGroups(companyId); 265 266 return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue); 267 } 268 catch (Exception e) { 269 _log.error(e, e); 270 271 throw new RemoteException(e.getMessage()); 272 } 273 } 274 275 /** 276 * Returns all the user groups to which the user belongs. 277 * 278 * @param userId the primary key of the user 279 * @return the user groups to which the user belongs 280 * @throws PortalException if the current user did not have permission to 281 view the user or any one of the user group members 282 */ 283 public static com.liferay.portal.model.UserGroupSoap[] getUserUserGroups( 284 long userId) throws RemoteException { 285 try { 286 java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserUserGroups(userId); 287 288 return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue); 289 } 290 catch (Exception e) { 291 _log.error(e, e); 292 293 throw new RemoteException(e.getMessage()); 294 } 295 } 296 297 /** 298 * Removes the user groups from the group. 299 * 300 * @param groupId the primary key of the group 301 * @param userGroupIds the primary keys of the user groups 302 * @throws PortalException if the user did not have permission to assign 303 group members 304 */ 305 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 306 throws RemoteException { 307 try { 308 UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds); 309 } 310 catch (Exception e) { 311 _log.error(e, e); 312 313 throw new RemoteException(e.getMessage()); 314 } 315 } 316 317 /** 318 * Removes the user groups from the team. 319 * 320 * @param teamId the primary key of the team 321 * @param userGroupIds the primary keys of the user groups 322 * @throws PortalException if the user did not have permission to assign 323 team members 324 */ 325 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 326 throws RemoteException { 327 try { 328 UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds); 329 } 330 catch (Exception e) { 331 _log.error(e, e); 332 333 throw new RemoteException(e.getMessage()); 334 } 335 } 336 337 /** 338 * Updates the user group. 339 * 340 * @param userGroupId the primary key of the user group 341 * @param name the user group's name 342 * @param description the the user group's description 343 * @return the user group 344 * @throws PortalException if a user group with the primary key was not 345 found, if the new information was invalid, or if the user did 346 not have permission to update the user group information 347 * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, 348 String, String, ServiceContext)} 349 */ 350 @Deprecated 351 public static com.liferay.portal.model.UserGroupSoap updateUserGroup( 352 long userGroupId, java.lang.String name, java.lang.String description) 353 throws RemoteException { 354 try { 355 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId, 356 name, description); 357 358 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 359 } 360 catch (Exception e) { 361 _log.error(e, e); 362 363 throw new RemoteException(e.getMessage()); 364 } 365 } 366 367 /** 368 * Updates the user group. 369 * 370 * @param userGroupId the primary key of the user group 371 * @param name the user group's name 372 * @param description the the user group's description 373 * @param serviceContext the service context to be applied (optionally 374 <code>null</code>). Can set expando bridge attributes for the 375 user group. 376 * @return the user group 377 * @throws PortalException if a user group with the primary key was not 378 found, if the new information was invalid, or if the user did not 379 have permission to update the user group information 380 */ 381 public static com.liferay.portal.model.UserGroupSoap updateUserGroup( 382 long userGroupId, java.lang.String name, java.lang.String description, 383 com.liferay.portal.service.ServiceContext serviceContext) 384 throws RemoteException { 385 try { 386 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId, 387 name, description, serviceContext); 388 389 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 390 } 391 catch (Exception e) { 392 _log.error(e, e); 393 394 throw new RemoteException(e.getMessage()); 395 } 396 } 397 398 private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class); 399 }