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; 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 * Adds the user groups to the group. 046 * 047 * @param groupId the primary key of the group 048 * @param userGroupIds the primary keys of the user groups 049 * @throws PortalException if a group or user group with the primary key 050 could not be found, or if the user did not have permission to 051 assign group members 052 */ 053 public static void addGroupUserGroups(long groupId, long[] userGroupIds) 054 throws com.liferay.portal.kernel.exception.PortalException { 055 getService().addGroupUserGroups(groupId, userGroupIds); 056 } 057 058 /** 059 * Adds the user groups to the team 060 * 061 * @param teamId the primary key of the team 062 * @param userGroupIds the primary keys of the user groups 063 * @throws PortalException if a team or user group with the primary key 064 could not be found, or if the user did not have permission to 065 assign team members 066 */ 067 public static void addTeamUserGroups(long teamId, long[] userGroupIds) 068 throws com.liferay.portal.kernel.exception.PortalException { 069 getService().addTeamUserGroups(teamId, userGroupIds); 070 } 071 072 /** 073 * Adds a user group. 074 * 075 * <p> 076 * This method handles the creation and bookkeeping of the user group, 077 * including its resources, metadata, and internal data structures. 078 * </p> 079 * 080 * @param name the user group's name 081 * @param description the user group's description 082 * @return the user group 083 * @throws PortalException if the user group's information was invalid 084 or if the user did not have permission to add the user group 085 * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String, 086 ServiceContext)} 087 */ 088 @Deprecated 089 public static com.liferay.portal.model.UserGroup addUserGroup( 090 java.lang.String name, java.lang.String description) 091 throws com.liferay.portal.kernel.exception.PortalException { 092 return getService().addUserGroup(name, description); 093 } 094 095 /** 096 * Adds a user group. 097 * 098 * <p> 099 * This method handles the creation and bookkeeping of the user group, 100 * including its resources, metadata, and internal data structures. 101 * </p> 102 * 103 * @param name the user group's name 104 * @param description the user group's description 105 * @param serviceContext the service context to be applied (optionally 106 <code>null</code>). Can set expando bridge attributes for the 107 user group. 108 * @return the user group 109 * @throws PortalException if the user group's information was invalid or if 110 the user did not have permission to add the user group 111 */ 112 public static com.liferay.portal.model.UserGroup addUserGroup( 113 java.lang.String name, java.lang.String description, 114 com.liferay.portal.service.ServiceContext serviceContext) 115 throws com.liferay.portal.kernel.exception.PortalException { 116 return getService().addUserGroup(name, description, serviceContext); 117 } 118 119 /** 120 * Deletes the user group. 121 * 122 * @param userGroupId the primary key of the user group 123 * @throws PortalException if a user group with the primary key could not be 124 found, if the user did not have permission to delete the user 125 group, or if the user group had a workflow in approved status 126 */ 127 public static void deleteUserGroup(long userGroupId) 128 throws com.liferay.portal.kernel.exception.PortalException { 129 getService().deleteUserGroup(userGroupId); 130 } 131 132 /** 133 * Returns the Spring bean ID for this bean. 134 * 135 * @return the Spring bean ID for this bean 136 */ 137 public static java.lang.String getBeanIdentifier() { 138 return getService().getBeanIdentifier(); 139 } 140 141 /** 142 * Returns the user group with the name. 143 * 144 * @param name the user group's name 145 * @return Returns the user group with the name 146 * @throws PortalException if a user group with the name could not be found 147 or if the user did not have permission to view the user group 148 */ 149 public static com.liferay.portal.model.UserGroup getUserGroup( 150 java.lang.String name) 151 throws com.liferay.portal.kernel.exception.PortalException { 152 return getService().getUserGroup(name); 153 } 154 155 /** 156 * Returns the user group with the primary key. 157 * 158 * @param userGroupId the primary key of the user group 159 * @return Returns the user group with the primary key 160 * @throws PortalException if a user group with the primary key could not be 161 found or if the user did not have permission to view the user 162 group 163 */ 164 public static com.liferay.portal.model.UserGroup getUserGroup( 165 long userGroupId) 166 throws com.liferay.portal.kernel.exception.PortalException { 167 return getService().getUserGroup(userGroupId); 168 } 169 170 /** 171 * Returns all the user groups to which the user belongs. 172 * 173 * @param userId the primary key of the user 174 * @return the user groups to which the user belongs 175 * @throws PortalException if the current user did not have permission to 176 view the user or any one of the user group members 177 */ 178 public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups( 179 long userId) throws com.liferay.portal.kernel.exception.PortalException { 180 return getService().getUserUserGroups(userId); 181 } 182 183 /** 184 * Sets the Spring bean ID for this bean. 185 * 186 * @param beanIdentifier the Spring bean ID for this bean 187 */ 188 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 189 getService().setBeanIdentifier(beanIdentifier); 190 } 191 192 /** 193 * Removes the user groups from the group. 194 * 195 * @param groupId the primary key of the group 196 * @param userGroupIds the primary keys of the user groups 197 * @throws PortalException if the user did not have permission to assign 198 group members 199 */ 200 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 201 throws com.liferay.portal.kernel.exception.PortalException { 202 getService().unsetGroupUserGroups(groupId, userGroupIds); 203 } 204 205 /** 206 * Removes the user groups from the team. 207 * 208 * @param teamId the primary key of the team 209 * @param userGroupIds the primary keys of the user groups 210 * @throws PortalException if the user did not have permission to assign 211 team members 212 */ 213 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 214 throws com.liferay.portal.kernel.exception.PortalException { 215 getService().unsetTeamUserGroups(teamId, userGroupIds); 216 } 217 218 /** 219 * Updates the user group. 220 * 221 * @param userGroupId the primary key of the user group 222 * @param name the user group's name 223 * @param description the the user group's description 224 * @return the user group 225 * @throws PortalException if a user group with the primary key was not 226 found, if the new information was invalid, or if the user did 227 not have permission to update the user group information 228 * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, 229 String, String, ServiceContext)} 230 */ 231 @Deprecated 232 public static com.liferay.portal.model.UserGroup updateUserGroup( 233 long userGroupId, java.lang.String name, java.lang.String description) 234 throws com.liferay.portal.kernel.exception.PortalException { 235 return getService().updateUserGroup(userGroupId, name, description); 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 * @param serviceContext the service context to be applied (optionally 245 <code>null</code>). Can set expando bridge attributes for the 246 user group. 247 * @return the user group 248 * @throws PortalException if a user group with the primary key was not 249 found, if the new information was invalid, or if the user did not 250 have permission to update the user group information 251 */ 252 public static com.liferay.portal.model.UserGroup updateUserGroup( 253 long userGroupId, java.lang.String name, java.lang.String description, 254 com.liferay.portal.service.ServiceContext serviceContext) 255 throws com.liferay.portal.kernel.exception.PortalException { 256 return getService() 257 .updateUserGroup(userGroupId, name, description, 258 serviceContext); 259 } 260 261 public static UserGroupService getService() { 262 if (_service == null) { 263 _service = (UserGroupService)PortalBeanLocatorUtil.locate(UserGroupService.class.getName()); 264 265 ReferenceRegistry.registerReference(UserGroupServiceUtil.class, 266 "_service"); 267 } 268 269 return _service; 270 } 271 272 /** 273 * @deprecated As of 6.2.0 274 */ 275 @Deprecated 276 public void setService(UserGroupService service) { 277 } 278 279 private static UserGroupService _service; 280 }