001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 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/tunnel-web/secure/axis. Set the property 052 * <b>tunnel.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 * @param publicLayoutSetPrototypeId the primary key of the user group's 122 public layout set 123 * @param privateLayoutSetPrototypeId the primary key of the user group's 124 private layout set 125 * @return the user group 126 * @throws PortalException if the user group's information was invalid or 127 if the user did not have permission to add the user group 128 * @throws SystemException if a system exception occurred 129 */ 130 public static com.liferay.portal.model.UserGroupSoap addUserGroup( 131 java.lang.String name, java.lang.String description, 132 long publicLayoutSetPrototypeId, long privateLayoutSetPrototypeId) 133 throws RemoteException { 134 try { 135 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.addUserGroup(name, 136 description, publicLayoutSetPrototypeId, 137 privateLayoutSetPrototypeId); 138 139 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 140 } 141 catch (Exception e) { 142 _log.error(e, e); 143 144 throw new RemoteException(e.getMessage()); 145 } 146 } 147 148 /** 149 * Deletes the user group. 150 * 151 * @param userGroupId the primary key of the user group 152 * @throws PortalException if a user group with the primary key could not 153 be found, if the user did not have permission to delete the user 154 group, or if the user group had a workflow in approved status 155 * @throws SystemException if a system exception occurred 156 */ 157 public static void deleteUserGroup(long userGroupId) 158 throws RemoteException { 159 try { 160 UserGroupServiceUtil.deleteUserGroup(userGroupId); 161 } 162 catch (Exception e) { 163 _log.error(e, e); 164 165 throw new RemoteException(e.getMessage()); 166 } 167 } 168 169 /** 170 * Returns the user group with the primary key. 171 * 172 * @param userGroupId the primary key of the user group 173 * @return Returns the user group with the primary key 174 * @throws PortalException if a user group with the primary key could not 175 be found or if the user did not have permission to view the user 176 group 177 * @throws SystemException if a system exception occurred 178 */ 179 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 180 long userGroupId) throws RemoteException { 181 try { 182 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(userGroupId); 183 184 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 185 } 186 catch (Exception e) { 187 _log.error(e, e); 188 189 throw new RemoteException(e.getMessage()); 190 } 191 } 192 193 /** 194 * Returns the user group with the name. 195 * 196 * @param name the user group's name 197 * @return Returns the user group with the name 198 * @throws PortalException if a user group with the name could not be found 199 or if the user did not have permission to view the user group 200 * @throws SystemException if a system exception occurred 201 */ 202 public static com.liferay.portal.model.UserGroupSoap getUserGroup( 203 java.lang.String name) throws RemoteException { 204 try { 205 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.getUserGroup(name); 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 all the user groups to which the user belongs. 218 * 219 * @param userId the primary key of the user 220 * @return the user groups to which the user belongs 221 * @throws SystemException if a system exception occurred 222 */ 223 public static com.liferay.portal.model.UserGroupSoap[] getUserUserGroups( 224 long userId) throws RemoteException { 225 try { 226 java.util.List<com.liferay.portal.model.UserGroup> returnValue = UserGroupServiceUtil.getUserUserGroups(userId); 227 228 return com.liferay.portal.model.UserGroupSoap.toSoapModels(returnValue); 229 } 230 catch (Exception e) { 231 _log.error(e, e); 232 233 throw new RemoteException(e.getMessage()); 234 } 235 } 236 237 /** 238 * Removes the user groups from the group. 239 * 240 * @param groupId the primary key of the group 241 * @param userGroupIds the primary keys of the user groups 242 * @throws PortalException if the user did not have permission to assign 243 group members 244 * @throws SystemException if a system exception occurred 245 */ 246 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 247 throws RemoteException { 248 try { 249 UserGroupServiceUtil.unsetGroupUserGroups(groupId, userGroupIds); 250 } 251 catch (Exception e) { 252 _log.error(e, e); 253 254 throw new RemoteException(e.getMessage()); 255 } 256 } 257 258 /** 259 * Removes the user groups from the team. 260 * 261 * @param teamId the primary key of the team 262 * @param userGroupIds the primary keys of the user groups 263 * @throws PortalException if the user did not have permission to assign 264 team members 265 * @throws SystemException if a system exception occurred 266 */ 267 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 268 throws RemoteException { 269 try { 270 UserGroupServiceUtil.unsetTeamUserGroups(teamId, userGroupIds); 271 } 272 catch (Exception e) { 273 _log.error(e, e); 274 275 throw new RemoteException(e.getMessage()); 276 } 277 } 278 279 /** 280 * Updates the user group. 281 * 282 * @param userGroupId the primary key of the user group 283 * @param name the user group's name 284 * @param description the the user group's description 285 * @param publicLayoutSetPrototypeId the primary key of the user group's 286 public layout set 287 * @param privateLayoutSetPrototypeId the primary key of the user group's 288 private layout set 289 * @return the user group 290 * @throws PortalException if a user group with the primary key was not 291 found, if the new information was invalid, or if the user did 292 not have permission to update the user group information 293 * @throws SystemException if a system exception occurred 294 */ 295 public static com.liferay.portal.model.UserGroupSoap updateUserGroup( 296 long userGroupId, java.lang.String name, java.lang.String description, 297 long publicLayoutSetPrototypeId, long privateLayoutSetPrototypeId) 298 throws RemoteException { 299 try { 300 com.liferay.portal.model.UserGroup returnValue = UserGroupServiceUtil.updateUserGroup(userGroupId, 301 name, description, publicLayoutSetPrototypeId, 302 privateLayoutSetPrototypeId); 303 304 return com.liferay.portal.model.UserGroupSoap.toSoapModel(returnValue); 305 } 306 catch (Exception e) { 307 _log.error(e, e); 308 309 throw new RemoteException(e.getMessage()); 310 } 311 } 312 313 private static Log _log = LogFactoryUtil.getLog(UserGroupServiceSoap.class); 314 }