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 051 * http://localhost:8080/api/secure/axis. Set the property 052 * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure 053 * security. 054 * </p> 055 * 056 * <p> 057 * The SOAP utility is only generated for remote services. 058 * </p> 059 * 060 * @author Brian Wing Shun Chan 061 * @see UserGroupServiceHttp 062 * @see com.liferay.portal.model.UserGroupSoap 063 * @see com.liferay.portal.service.UserGroupServiceUtil 064 * @generated 065 */ 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 or if 123 the user did not have permission to add the user group 124 * @throws SystemException if a system exception occurred 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 * Deletes the user group. 144 * 145 * @param userGroupId the primary key of the user group 146 * @throws PortalException if a user group with the primary key could not be 147 found, if the user did not have permission to delete the user 148 group, or if the user group had a workflow in approved status 149 * @throws SystemException if a system exception occurred 150 */ 151 public static void deleteUserGroup(long userGroupId) 152 throws RemoteException { 153 try { 154 UserGroupServiceUtil.deleteUserGroup(userGroupId); 155 } 156 catch (Exception e) { 157 _log.error(e, e); 158 159 throw new RemoteException(e.getMessage()); 160 } 161 } 162 163 /** 164 * Returns the user group with the primary key. 165 * 166 * @param userGroupId the primary key of the user group 167 * @return Returns the user group with the primary key 168 * @throws PortalException if a user group with the primary key could not be 169 found or if the user did not have permission to view the user 170 group 171 * @throws SystemException if a system exception occurred 172 */ 173 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 174 long userGroupId) throws RemoteException { 175 try { 176 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId); 177 178 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 179 } 180 catch (Exception e) { 181 _log.error(e, e); 182 183 throw new RemoteException(e.getMessage()); 184 } 185 } 186 187 /** 188 * Returns the user group with the name. 189 * 190 * @param name the user group's name 191 * @return Returns the user group with the name 192 * @throws PortalException if a user group with the name could not be found 193 or if the user did not have permission to view the user group 194 * @throws SystemException if a system exception occurred 195 */ 196 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 197 java.lang.String name) throws RemoteException { 198 try { 199 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name); 200 201 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 202 } 203 catch (Exception e) { 204 _log.error(e, e); 205 206 throw new RemoteException(e.getMessage()); 207 } 208 } 209 210 /** 211 * Returns all the user groups to which the user belongs. 212 * 213 * @param userId the primary key of the user 214 * @return the user groups to which the user belongs 215 * @throws SystemException if a system exception occurred 216 */ 217 public static com.liferay.portal.model.UserGroupSoap[] getUserUserGroups( 218 long userId) throws RemoteException { 219 try { 220 java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserUserGroups(userId); 221 222 return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue); 223 } 224 catch (Exception e) { 225 _log.error(e, e); 226 227 throw new RemoteException(e.getMessage()); 228 } 229 } 230 231 /** 232 * Removes the user groups from the group. 233 * 234 * @param groupId the primary key of the group 235 * @param userGroupIds the primary keys of the user groups 236 * @throws PortalException if the user did not have permission to assign 237 group members 238 * @throws SystemException if a system exception occurred 239 */ 240 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 241 throws RemoteException { 242 try { 243 UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds); 244 } 245 catch (Exception e) { 246 _log.error(e, e); 247 248 throw new RemoteException(e.getMessage()); 249 } 250 } 251 252 /** 253 * Removes the user groups from the team. 254 * 255 * @param teamId the primary key of the team 256 * @param userGroupIds the primary keys of the user groups 257 * @throws PortalException if the user did not have permission to assign 258 team members 259 * @throws SystemException if a system exception occurred 260 */ 261 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 262 throws RemoteException { 263 try { 264 UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds); 265 } 266 catch (Exception e) { 267 _log.error(e, e); 268 269 throw new RemoteException(e.getMessage()); 270 } 271 } 272 273 /** 274 * Updates the user group. 275 * 276 * @param userGroupId the primary key of the user group 277 * @param name the user group's name 278 * @param description the the user group's description 279 * @return the user group 280 * @throws PortalException if a user group with the primary key was not 281 found, if the new information was invalid, or if the user did not 282 have permission to update the user group information 283 * @throws SystemException if a system exception occurred 284 */ 285 public static com.liferay.portal.model.UserGroupSoap updateUserGroup( 286 long userGroupId, java.lang.String name, java.lang.String description) 287 throws RemoteException { 288 try { 289 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId, 290 name, description); 291 292 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 293 } 294 catch (Exception e) { 295 _log.error(e, e); 296 297 throw new RemoteException(e.getMessage()); 298 } 299 } 300 301 private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class); 302 }