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