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