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