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