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.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * The utility for the user group remote service. This utility wraps {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and is the primary access point for service operations in application layer code running on a remote server. 022 * 023 * <p> 024 * 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. 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see UserGroupService 029 * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl 030 * @see com.liferay.portal.service.impl.UserGroupServiceImpl 031 * @generated 032 */ 033 public class UserGroupServiceUtil { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and rerun ServiceBuilder to regenerate this class. 038 */ 039 040 /** 041 * Returns the Spring bean ID for this bean. 042 * 043 * @return the Spring bean ID for this bean 044 */ 045 public static java.lang.String getBeanIdentifier() { 046 return getService().getBeanIdentifier(); 047 } 048 049 /** 050 * Sets the Spring bean ID for this bean. 051 * 052 * @param beanIdentifier the Spring bean ID for this bean 053 */ 054 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 055 getService().setBeanIdentifier(beanIdentifier); 056 } 057 058 /** 059 * Adds the user groups to the group. 060 * 061 * @param groupId the primary key of the group 062 * @param userGroupIds the primary keys of the user groups 063 * @throws PortalException if a group or user group with the primary key 064 could not be found, or if the user did not have permission to 065 assign group members 066 * @throws SystemException if a system exception occurred 067 */ 068 public static void addGroupUserGroups(long groupId, long[] userGroupIds) 069 throws com.liferay.portal.kernel.exception.PortalException, 070 com.liferay.portal.kernel.exception.SystemException { 071 getService().addGroupUserGroups(groupId, userGroupIds); 072 } 073 074 /** 075 * Adds the user groups to the team 076 * 077 * @param teamId the primary key of the team 078 * @param userGroupIds the primary keys of the user groups 079 * @throws PortalException if a team or user group with the primary key 080 could not be found, or if the user did not have permission to 081 assign team members 082 * @throws SystemException if a system exception occurred 083 */ 084 public static void addTeamUserGroups(long teamId, long[] userGroupIds) 085 throws com.liferay.portal.kernel.exception.PortalException, 086 com.liferay.portal.kernel.exception.SystemException { 087 getService().addTeamUserGroups(teamId, userGroupIds); 088 } 089 090 /** 091 * Adds a user group. 092 * 093 * <p> 094 * This method handles the creation and bookkeeping of the user group, 095 * including its resources, metadata, and internal data structures. 096 * </p> 097 * 098 * @param name the user group's name 099 * @param description the user group's description 100 * @return the user group 101 * @throws PortalException if the user group's information was invalid or if 102 the user did not have permission to add the user group 103 * @throws SystemException if a system exception occurred 104 */ 105 public static com.liferay.portal.model.UserGroup addUserGroup( 106 java.lang.String name, java.lang.String description) 107 throws com.liferay.portal.kernel.exception.PortalException, 108 com.liferay.portal.kernel.exception.SystemException { 109 return getService().addUserGroup(name, description); 110 } 111 112 /** 113 * Deletes the user group. 114 * 115 * @param userGroupId the primary key of the user group 116 * @throws PortalException if a user group with the primary key could not be 117 found, if the user did not have permission to delete the user 118 group, or if the user group had a workflow in approved status 119 * @throws SystemException if a system exception occurred 120 */ 121 public static void deleteUserGroup(long userGroupId) 122 throws com.liferay.portal.kernel.exception.PortalException, 123 com.liferay.portal.kernel.exception.SystemException { 124 getService().deleteUserGroup(userGroupId); 125 } 126 127 /** 128 * Returns the user group with the primary key. 129 * 130 * @param userGroupId the primary key of the user group 131 * @return Returns the user group with the primary key 132 * @throws PortalException if a user group with the primary key could not be 133 found or if the user did not have permission to view the user 134 group 135 * @throws SystemException if a system exception occurred 136 */ 137 public static com.liferay.portal.model.UserGroup getUserGroup( 138 long userGroupId) 139 throws com.liferay.portal.kernel.exception.PortalException, 140 com.liferay.portal.kernel.exception.SystemException { 141 return getService().getUserGroup(userGroupId); 142 } 143 144 /** 145 * Returns the user group with the name. 146 * 147 * @param name the user group's name 148 * @return Returns 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 * @throws SystemException if a system exception occurred 152 */ 153 public static com.liferay.portal.model.UserGroup getUserGroup( 154 java.lang.String name) 155 throws com.liferay.portal.kernel.exception.PortalException, 156 com.liferay.portal.kernel.exception.SystemException { 157 return getService().getUserGroup(name); 158 } 159 160 /** 161 * Returns all the user groups to which the user belongs. 162 * 163 * @param userId the primary key of the user 164 * @return the user groups to which the user belongs 165 * @throws PortalException if the current user did not have permission to 166 view the user or any one of the user group members 167 * @throws SystemException if a system exception occurred 168 */ 169 public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups( 170 long userId) 171 throws com.liferay.portal.kernel.exception.PortalException, 172 com.liferay.portal.kernel.exception.SystemException { 173 return getService().getUserUserGroups(userId); 174 } 175 176 /** 177 * Removes the user groups from the group. 178 * 179 * @param groupId the primary key of the group 180 * @param userGroupIds the primary keys of the user groups 181 * @throws PortalException if the user did not have permission to assign 182 group members 183 * @throws SystemException if a system exception occurred 184 */ 185 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 186 throws com.liferay.portal.kernel.exception.PortalException, 187 com.liferay.portal.kernel.exception.SystemException { 188 getService().unsetGroupUserGroups(groupId, userGroupIds); 189 } 190 191 /** 192 * Removes the user groups from the team. 193 * 194 * @param teamId the primary key of the team 195 * @param userGroupIds the primary keys of the user groups 196 * @throws PortalException if the user did not have permission to assign 197 team members 198 * @throws SystemException if a system exception occurred 199 */ 200 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 201 throws com.liferay.portal.kernel.exception.PortalException, 202 com.liferay.portal.kernel.exception.SystemException { 203 getService().unsetTeamUserGroups(teamId, userGroupIds); 204 } 205 206 /** 207 * Updates the user group. 208 * 209 * @param userGroupId the primary key of the user group 210 * @param name the user group's name 211 * @param description the the user group's description 212 * @return the user group 213 * @throws PortalException if a user group with the primary key was not 214 found, if the new information was invalid, or if the user did not 215 have permission to update the user group information 216 * @throws SystemException if a system exception occurred 217 */ 218 public static com.liferay.portal.model.UserGroup updateUserGroup( 219 long userGroupId, java.lang.String name, java.lang.String description) 220 throws com.liferay.portal.kernel.exception.PortalException, 221 com.liferay.portal.kernel.exception.SystemException { 222 return getService().updateUserGroup(userGroupId, name, description); 223 } 224 225 public static UserGroupService getService() { 226 if (_service == null) { 227 _service = (UserGroupService)PortalBeanLocatorUtil.locate(UserGroupService.class.getName()); 228 229 ReferenceRegistry.registerReference(UserGroupServiceUtil.class, 230 "_service"); 231 } 232 233 return _service; 234 } 235 236 /** 237 * @deprecated 238 */ 239 public void setService(UserGroupService service) { 240 } 241 242 private static UserGroupService _service; 243 }