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.exception.PortalException; 020 import com.liferay.portal.kernel.exception.SystemException; 021 import com.liferay.portal.kernel.jsonwebservice.JSONWebService; 022 import com.liferay.portal.kernel.security.access.control.AccessControlled; 023 import com.liferay.portal.kernel.transaction.Isolation; 024 import com.liferay.portal.kernel.transaction.Propagation; 025 import com.liferay.portal.kernel.transaction.Transactional; 026 027 /** 028 * Provides the remote service interface for UserGroup. Methods of this 029 * service are expected to have security checks based on the propagated JAAS 030 * credentials because this service can be accessed remotely. 031 * 032 * @author Brian Wing Shun Chan 033 * @see UserGroupServiceUtil 034 * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl 035 * @see com.liferay.portal.service.impl.UserGroupServiceImpl 036 * @generated 037 */ 038 @AccessControlled 039 @JSONWebService 040 @ProviderType 041 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 042 PortalException.class, SystemException.class}) 043 public interface UserGroupService extends BaseService { 044 /* 045 * NOTE FOR DEVELOPERS: 046 * 047 * Never modify or reference this interface directly. Always use {@link UserGroupServiceUtil} to access the user group remote service. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 048 */ 049 050 /** 051 * Adds the user groups to the group. 052 * 053 * @param groupId the primary key of the group 054 * @param userGroupIds the primary keys of the user groups 055 * @throws PortalException if the user did not have permission to assign 056 group members 057 */ 058 public void addGroupUserGroups(long groupId, long[] userGroupIds) 059 throws PortalException; 060 061 /** 062 * Adds the user groups to the team 063 * 064 * @param teamId the primary key of the team 065 * @param userGroupIds the primary keys of the user groups 066 * @throws PortalException if the user did not have permission to assign 067 team members 068 */ 069 public void addTeamUserGroups(long teamId, long[] userGroupIds) 070 throws PortalException; 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 @java.lang.Deprecated 089 public com.liferay.portal.model.UserGroup addUserGroup( 090 java.lang.String name, java.lang.String description) 091 throws PortalException; 092 093 /** 094 * Adds a user group. 095 * 096 * <p> 097 * This method handles the creation and bookkeeping of the user group, 098 * including its resources, metadata, and internal data structures. 099 * </p> 100 * 101 * @param name the user group's name 102 * @param description the user group's description 103 * @param serviceContext the service context to be applied (optionally 104 <code>null</code>). Can set expando bridge attributes for the 105 user group. 106 * @return the user group 107 * @throws PortalException if the user group's information was invalid or if 108 the user did not have permission to add the user group 109 */ 110 public com.liferay.portal.model.UserGroup addUserGroup( 111 java.lang.String name, java.lang.String description, 112 com.liferay.portal.service.ServiceContext serviceContext) 113 throws PortalException; 114 115 /** 116 * Deletes the user group. 117 * 118 * @param userGroupId the primary key of the user group 119 * @throws PortalException if a user group with the primary key could not be 120 found, if the user did not have permission to delete the user 121 group, or if the user group had a workflow in approved status 122 */ 123 public void deleteUserGroup(long userGroupId) throws PortalException; 124 125 /** 126 * Fetches the user group with the primary key. 127 * 128 * @param userGroupId the primary key of the user group 129 * @return the user group with the primary key 130 * @throws PortalException if the user did not have permission to view the 131 user group 132 */ 133 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 134 public com.liferay.portal.model.UserGroup fetchUserGroup(long userGroupId) 135 throws PortalException; 136 137 /** 138 * Returns the Spring bean ID for this bean. 139 * 140 * @return the Spring bean ID for this bean 141 */ 142 public java.lang.String getBeanIdentifier(); 143 144 /** 145 * Returns the user group with the name. 146 * 147 * @param name the user group's name 148 * @return the user group with the name 149 * @throws PortalException if a user group with the name could not be found 150 or if the user did not have permission to view the user group 151 */ 152 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 153 public com.liferay.portal.model.UserGroup getUserGroup( 154 java.lang.String name) throws PortalException; 155 156 /** 157 * Returns the user group with the primary key. 158 * 159 * @param userGroupId the primary key of the user group 160 * @return the user group with the primary key 161 * @throws PortalException if a user group with the primary key could not be 162 found or if the user did not have permission to view the user 163 group 164 */ 165 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 166 public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId) 167 throws PortalException; 168 169 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 170 public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups( 171 long companyId) throws PortalException; 172 173 /** 174 * Returns all the user groups to which the user belongs. 175 * 176 * @param userId the primary key of the user 177 * @return the user groups to which the user belongs 178 * @throws PortalException if the current user did not have permission to 179 view the user or any one of the user group members 180 */ 181 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 182 public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups( 183 long userId) throws PortalException; 184 185 /** 186 * Sets the Spring bean ID for this bean. 187 * 188 * @param beanIdentifier the Spring bean ID for this bean 189 */ 190 public void setBeanIdentifier(java.lang.String beanIdentifier); 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 void unsetGroupUserGroups(long groupId, long[] userGroupIds) 201 throws PortalException; 202 203 /** 204 * Removes the user groups from the team. 205 * 206 * @param teamId the primary key of the team 207 * @param userGroupIds the primary keys of the user groups 208 * @throws PortalException if the user did not have permission to assign 209 team members 210 */ 211 public void unsetTeamUserGroups(long teamId, long[] userGroupIds) 212 throws PortalException; 213 214 /** 215 * Updates the user group. 216 * 217 * @param userGroupId the primary key of the user group 218 * @param name the user group's name 219 * @param description the the user group's description 220 * @return the user group 221 * @throws PortalException if a user group with the primary key was not 222 found, if the new information was invalid, or if the user did 223 not have permission to update the user group information 224 * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, 225 String, String, ServiceContext)} 226 */ 227 @java.lang.Deprecated 228 public com.liferay.portal.model.UserGroup updateUserGroup( 229 long userGroupId, java.lang.String name, java.lang.String description) 230 throws PortalException; 231 232 /** 233 * Updates the user group. 234 * 235 * @param userGroupId the primary key of the user group 236 * @param name the user group's name 237 * @param description the the user group's description 238 * @param serviceContext the service context to be applied (optionally 239 <code>null</code>). Can set expando bridge attributes for the 240 user group. 241 * @return the user group 242 * @throws PortalException if a user group with the primary key was not 243 found, if the new information was invalid, or if the user did not 244 have permission to update the user group information 245 */ 246 public com.liferay.portal.model.UserGroup updateUserGroup( 247 long userGroupId, java.lang.String name, java.lang.String description, 248 com.liferay.portal.service.ServiceContext serviceContext) 249 throws PortalException; 250 }