001 /** 002 * Copyright (c) 2000-2012 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 024 /** 025 * The interface for the user group remote service. 026 * 027 * <p> 028 * 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. 029 * </p> 030 * 031 * @author Brian Wing Shun Chan 032 * @see UserGroupServiceUtil 033 * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl 034 * @see com.liferay.portal.service.impl.UserGroupServiceImpl 035 * @generated 036 */ 037 @JSONWebService 038 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 039 PortalException.class, SystemException.class}) 040 public interface UserGroupService { 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 * Adds the user groups to the group. 049 * 050 * @param groupId the primary key of the group 051 * @param userGroupIds the primary keys of the user groups 052 * @throws PortalException if a group or user group with the primary key 053 could not be found, or if the user did not have permission to 054 assign group members 055 * @throws SystemException if a system exception occurred 056 */ 057 public void addGroupUserGroups(long groupId, long[] userGroupIds) 058 throws com.liferay.portal.kernel.exception.PortalException, 059 com.liferay.portal.kernel.exception.SystemException; 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 a team or user group with the primary key 067 could not be found, or if the user did not have permission to 068 assign team members 069 * @throws SystemException if a system exception occurred 070 */ 071 public void addTeamUserGroups(long teamId, long[] userGroupIds) 072 throws com.liferay.portal.kernel.exception.PortalException, 073 com.liferay.portal.kernel.exception.SystemException; 074 075 /** 076 * Adds a user group. 077 * 078 * <p> 079 * This method handles the creation and bookkeeping of the user group, 080 * including its resources, metadata, and internal data structures. 081 * </p> 082 * 083 * @param name the user group's name 084 * @param description the user group's description 085 * @return the user group 086 * @throws PortalException if the user group's information was invalid or if 087 the user did not have permission to add the user group 088 * @throws SystemException if a system exception occurred 089 */ 090 public com.liferay.portal.model.UserGroup addUserGroup( 091 java.lang.String name, java.lang.String description) 092 throws com.liferay.portal.kernel.exception.PortalException, 093 com.liferay.portal.kernel.exception.SystemException; 094 095 /** 096 * Deletes the user group. 097 * 098 * @param userGroupId the primary key of the user group 099 * @throws PortalException if a user group with the primary key could not be 100 found, if the user did not have permission to delete the user 101 group, or if the user group had a workflow in approved status 102 * @throws SystemException if a system exception occurred 103 */ 104 public void deleteUserGroup(long userGroupId) 105 throws com.liferay.portal.kernel.exception.PortalException, 106 com.liferay.portal.kernel.exception.SystemException; 107 108 /** 109 * Returns the user group with the primary key. 110 * 111 * @param userGroupId the primary key of the user group 112 * @return Returns the user group with the primary key 113 * @throws PortalException if a user group with the primary key could not be 114 found or if the user did not have permission to view the user 115 group 116 * @throws SystemException if a system exception occurred 117 */ 118 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 119 public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId) 120 throws com.liferay.portal.kernel.exception.PortalException, 121 com.liferay.portal.kernel.exception.SystemException; 122 123 /** 124 * Returns the user group with the name. 125 * 126 * @param name the user group's name 127 * @return Returns the user group with the name 128 * @throws PortalException if a user group with the name could not be found 129 or if the user did not have permission to view the user group 130 * @throws SystemException if a system exception occurred 131 */ 132 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 133 public com.liferay.portal.model.UserGroup getUserGroup( 134 java.lang.String name) 135 throws com.liferay.portal.kernel.exception.PortalException, 136 com.liferay.portal.kernel.exception.SystemException; 137 138 /** 139 * Returns all the user groups to which the user belongs. 140 * 141 * @param userId the primary key of the user 142 * @return the user groups to which the user belongs 143 * @throws SystemException if a system exception occurred 144 */ 145 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 146 public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups( 147 long userId) throws com.liferay.portal.kernel.exception.SystemException; 148 149 /** 150 * Removes the user groups from the group. 151 * 152 * @param groupId the primary key of the group 153 * @param userGroupIds the primary keys of the user groups 154 * @throws PortalException if the user did not have permission to assign 155 group members 156 * @throws SystemException if a system exception occurred 157 */ 158 public void unsetGroupUserGroups(long groupId, long[] userGroupIds) 159 throws com.liferay.portal.kernel.exception.PortalException, 160 com.liferay.portal.kernel.exception.SystemException; 161 162 /** 163 * Removes the user groups from the team. 164 * 165 * @param teamId the primary key of the team 166 * @param userGroupIds the primary keys of the user groups 167 * @throws PortalException if the user did not have permission to assign 168 team members 169 * @throws SystemException if a system exception occurred 170 */ 171 public void unsetTeamUserGroups(long teamId, long[] userGroupIds) 172 throws com.liferay.portal.kernel.exception.PortalException, 173 com.liferay.portal.kernel.exception.SystemException; 174 175 /** 176 * Updates the user group. 177 * 178 * @param userGroupId the primary key of the user group 179 * @param name the user group's name 180 * @param description the the user group's description 181 * @return the user group 182 * @throws PortalException if a user group with the primary key was not 183 found, if the new information was invalid, or if the user did not 184 have permission to update the user group information 185 * @throws SystemException if a system exception occurred 186 */ 187 public com.liferay.portal.model.UserGroup updateUserGroup( 188 long userGroupId, java.lang.String name, java.lang.String description) 189 throws com.liferay.portal.kernel.exception.PortalException, 190 com.liferay.portal.kernel.exception.SystemException; 191 }