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; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the remote service utility for UserGroup. This utility wraps 024 * {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on a remote server. Methods of this service are expected to have security 027 * checks based on the propagated JAAS credentials because this service can be 028 * accessed remotely. 029 * 030 * @author Brian Wing Shun Chan 031 * @see UserGroupService 032 * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl 033 * @see com.liferay.portal.service.impl.UserGroupServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class UserGroupServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Returns the Spring bean ID for this bean. 046 * 047 * @return the Spring bean ID for this bean 048 */ 049 public static java.lang.String getBeanIdentifier() { 050 return getService().getBeanIdentifier(); 051 } 052 053 /** 054 * Sets the Spring bean ID for this bean. 055 * 056 * @param beanIdentifier the Spring bean ID for this bean 057 */ 058 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 059 getService().setBeanIdentifier(beanIdentifier); 060 } 061 062 /** 063 * Adds the user groups to the group. 064 * 065 * @param groupId the primary key of the group 066 * @param userGroupIds the primary keys of the user groups 067 * @throws PortalException if a group or user group with the primary key 068 could not be found, or if the user did not have permission to 069 assign group members 070 * @throws SystemException if a system exception occurred 071 */ 072 public static void addGroupUserGroups(long groupId, long[] userGroupIds) 073 throws com.liferay.portal.kernel.exception.PortalException, 074 com.liferay.portal.kernel.exception.SystemException { 075 getService().addGroupUserGroups(groupId, userGroupIds); 076 } 077 078 /** 079 * Adds the user groups to the team 080 * 081 * @param teamId the primary key of the team 082 * @param userGroupIds the primary keys of the user groups 083 * @throws PortalException if a team or user group with the primary key 084 could not be found, or if the user did not have permission to 085 assign team members 086 * @throws SystemException if a system exception occurred 087 */ 088 public static void addTeamUserGroups(long teamId, long[] userGroupIds) 089 throws com.liferay.portal.kernel.exception.PortalException, 090 com.liferay.portal.kernel.exception.SystemException { 091 getService().addTeamUserGroups(teamId, userGroupIds); 092 } 093 094 /** 095 * Adds a user group. 096 * 097 * <p> 098 * This method handles the creation and bookkeeping of the user group, 099 * including its resources, metadata, and internal data structures. 100 * </p> 101 * 102 * @param name the user group's name 103 * @param description the user group's description 104 * @return the user group 105 * @throws PortalException if the user group's information was invalid 106 or if the user did not have permission to add the user group 107 * @throws SystemException if a system exception occurred 108 * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String, 109 ServiceContext)} 110 */ 111 public static com.liferay.portal.model.UserGroup addUserGroup( 112 java.lang.String name, java.lang.String description) 113 throws com.liferay.portal.kernel.exception.PortalException, 114 com.liferay.portal.kernel.exception.SystemException { 115 return getService().addUserGroup(name, description); 116 } 117 118 /** 119 * Adds a user group. 120 * 121 * <p> 122 * This method handles the creation and bookkeeping of the user group, 123 * including its resources, metadata, and internal data structures. 124 * </p> 125 * 126 * @param name the user group's name 127 * @param description the user group's description 128 * @param serviceContext the service context to be applied (optionally 129 <code>null</code>). Can set expando bridge attributes for the 130 user group. 131 * @return the user group 132 * @throws PortalException if the user group's information was invalid or if 133 the user did not have permission to add the user group 134 * @throws SystemException if a system exception occurred 135 */ 136 public static com.liferay.portal.model.UserGroup addUserGroup( 137 java.lang.String name, java.lang.String description, 138 com.liferay.portal.service.ServiceContext serviceContext) 139 throws com.liferay.portal.kernel.exception.PortalException, 140 com.liferay.portal.kernel.exception.SystemException { 141 return getService().addUserGroup(name, description, serviceContext); 142 } 143 144 /** 145 * Deletes the user group. 146 * 147 * @param userGroupId the primary key of the user group 148 * @throws PortalException if a user group with the primary key could not be 149 found, if the user did not have permission to delete the user 150 group, or if the user group had a workflow in approved status 151 * @throws SystemException if a system exception occurred 152 */ 153 public static void deleteUserGroup(long userGroupId) 154 throws com.liferay.portal.kernel.exception.PortalException, 155 com.liferay.portal.kernel.exception.SystemException { 156 getService().deleteUserGroup(userGroupId); 157 } 158 159 /** 160 * Returns the user group with the primary key. 161 * 162 * @param userGroupId the primary key of the user group 163 * @return Returns the user group with the primary key 164 * @throws PortalException if a user group with the primary key could not be 165 found or if the user did not have permission to view the user 166 group 167 * @throws SystemException if a system exception occurred 168 */ 169 public static com.liferay.portal.model.UserGroup getUserGroup( 170 long userGroupId) 171 throws com.liferay.portal.kernel.exception.PortalException, 172 com.liferay.portal.kernel.exception.SystemException { 173 return getService().getUserGroup(userGroupId); 174 } 175 176 /** 177 * Returns the user group with the name. 178 * 179 * @param name the user group's name 180 * @return Returns the user group with the name 181 * @throws PortalException if a user group with the name could not be found 182 or if the user did not have permission to view the user group 183 * @throws SystemException if a system exception occurred 184 */ 185 public static com.liferay.portal.model.UserGroup getUserGroup( 186 java.lang.String name) 187 throws com.liferay.portal.kernel.exception.PortalException, 188 com.liferay.portal.kernel.exception.SystemException { 189 return getService().getUserGroup(name); 190 } 191 192 /** 193 * Returns all the user groups to which the user belongs. 194 * 195 * @param userId the primary key of the user 196 * @return the user groups to which the user belongs 197 * @throws PortalException if the current user did not have permission to 198 view the user or any one of the user group members 199 * @throws SystemException if a system exception occurred 200 */ 201 public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups( 202 long userId) 203 throws com.liferay.portal.kernel.exception.PortalException, 204 com.liferay.portal.kernel.exception.SystemException { 205 return getService().getUserUserGroups(userId); 206 } 207 208 /** 209 * Removes the user groups from the group. 210 * 211 * @param groupId the primary key of the group 212 * @param userGroupIds the primary keys of the user groups 213 * @throws PortalException if the user did not have permission to assign 214 group members 215 * @throws SystemException if a system exception occurred 216 */ 217 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 218 throws com.liferay.portal.kernel.exception.PortalException, 219 com.liferay.portal.kernel.exception.SystemException { 220 getService().unsetGroupUserGroups(groupId, userGroupIds); 221 } 222 223 /** 224 * Removes the user groups from the team. 225 * 226 * @param teamId the primary key of the team 227 * @param userGroupIds the primary keys of the user groups 228 * @throws PortalException if the user did not have permission to assign 229 team members 230 * @throws SystemException if a system exception occurred 231 */ 232 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 233 throws com.liferay.portal.kernel.exception.PortalException, 234 com.liferay.portal.kernel.exception.SystemException { 235 getService().unsetTeamUserGroups(teamId, userGroupIds); 236 } 237 238 /** 239 * Updates the user group. 240 * 241 * @param userGroupId the primary key of the user group 242 * @param name the user group's name 243 * @param description the the user group's description 244 * @return the user group 245 * @throws PortalException if a user group with the primary key was not 246 found, if the new information was invalid, or if the user did 247 not have permission to update the user group information 248 * @throws SystemException if a system exception occurred 249 * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, 250 String, String, ServiceContext)} 251 */ 252 public static com.liferay.portal.model.UserGroup updateUserGroup( 253 long userGroupId, java.lang.String name, java.lang.String description) 254 throws com.liferay.portal.kernel.exception.PortalException, 255 com.liferay.portal.kernel.exception.SystemException { 256 return getService().updateUserGroup(userGroupId, name, description); 257 } 258 259 /** 260 * Updates the user group. 261 * 262 * @param userGroupId the primary key of the user group 263 * @param name the user group's name 264 * @param description the the user group's description 265 * @param serviceContext the service context to be applied (optionally 266 <code>null</code>). Can set expando bridge attributes for the 267 user group. 268 * @return the user group 269 * @throws PortalException if a user group with the primary key was not 270 found, if the new information was invalid, or if the user did not 271 have permission to update the user group information 272 * @throws SystemException if a system exception occurred 273 */ 274 public static com.liferay.portal.model.UserGroup updateUserGroup( 275 long userGroupId, java.lang.String name, java.lang.String description, 276 com.liferay.portal.service.ServiceContext serviceContext) 277 throws com.liferay.portal.kernel.exception.PortalException, 278 com.liferay.portal.kernel.exception.SystemException { 279 return getService() 280 .updateUserGroup(userGroupId, name, description, 281 serviceContext); 282 } 283 284 public static UserGroupService getService() { 285 if (_service == null) { 286 _service = (UserGroupService)PortalBeanLocatorUtil.locate(UserGroupService.class.getName()); 287 288 ReferenceRegistry.registerReference(UserGroupServiceUtil.class, 289 "_service"); 290 } 291 292 return _service; 293 } 294 295 /** 296 * @deprecated As of 6.2.0 297 */ 298 public void setService(UserGroupService service) { 299 } 300 301 private static UserGroupService _service; 302 }