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.kernel.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 a user group. 046 * 047 * <p> 048 * This method handles the creation and bookkeeping of the user group, 049 * including its resources, metadata, and internal data structures. 050 * </p> 051 * 052 * @param name the user group's name 053 * @param description the user group's description 054 * @return the user group 055 * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String, 056 ServiceContext)} 057 */ 058 @Deprecated 059 public static com.liferay.portal.kernel.model.UserGroup addUserGroup( 060 java.lang.String name, java.lang.String description) 061 throws com.liferay.portal.kernel.exception.PortalException { 062 return getService().addUserGroup(name, description); 063 } 064 065 /** 066 * Adds a user group. 067 * 068 * <p> 069 * This method handles the creation and bookkeeping of the user group, 070 * including its resources, metadata, and internal data structures. 071 * </p> 072 * 073 * @param name the user group's name 074 * @param description the user group's description 075 * @param serviceContext the service context to be applied (optionally 076 <code>null</code>). Can set expando bridge attributes for the 077 user group. 078 * @return the user group 079 */ 080 public static com.liferay.portal.kernel.model.UserGroup addUserGroup( 081 java.lang.String name, java.lang.String description, 082 ServiceContext serviceContext) 083 throws com.liferay.portal.kernel.exception.PortalException { 084 return getService().addUserGroup(name, description, serviceContext); 085 } 086 087 /** 088 * Fetches the user group with the primary key. 089 * 090 * @param userGroupId the primary key of the user group 091 * @return the user group with the primary key 092 */ 093 public static com.liferay.portal.kernel.model.UserGroup fetchUserGroup( 094 long userGroupId) 095 throws com.liferay.portal.kernel.exception.PortalException { 096 return getService().fetchUserGroup(userGroupId); 097 } 098 099 /** 100 * Returns the user group with the name. 101 * 102 * @param name the user group's name 103 * @return the user group with the name 104 */ 105 public static com.liferay.portal.kernel.model.UserGroup getUserGroup( 106 java.lang.String name) 107 throws com.liferay.portal.kernel.exception.PortalException { 108 return getService().getUserGroup(name); 109 } 110 111 /** 112 * Returns the user group with the primary key. 113 * 114 * @param userGroupId the primary key of the user group 115 * @return the user group with the primary key 116 */ 117 public static com.liferay.portal.kernel.model.UserGroup getUserGroup( 118 long userGroupId) 119 throws com.liferay.portal.kernel.exception.PortalException { 120 return getService().getUserGroup(userGroupId); 121 } 122 123 /** 124 * Updates the user group. 125 * 126 * @param userGroupId the primary key of the user group 127 * @param name the user group's name 128 * @param description the the user group's description 129 * @return the user group 130 * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, 131 String, String, ServiceContext)} 132 */ 133 @Deprecated 134 public static com.liferay.portal.kernel.model.UserGroup updateUserGroup( 135 long userGroupId, java.lang.String name, java.lang.String description) 136 throws com.liferay.portal.kernel.exception.PortalException { 137 return getService().updateUserGroup(userGroupId, name, description); 138 } 139 140 /** 141 * Updates the user group. 142 * 143 * @param userGroupId the primary key of the user group 144 * @param name the user group's name 145 * @param description the the user group's description 146 * @param serviceContext the service context to be applied (optionally 147 <code>null</code>). Can set expando bridge attributes for the 148 user group. 149 * @return the user group 150 */ 151 public static com.liferay.portal.kernel.model.UserGroup updateUserGroup( 152 long userGroupId, java.lang.String name, java.lang.String description, 153 ServiceContext serviceContext) 154 throws com.liferay.portal.kernel.exception.PortalException { 155 return getService() 156 .updateUserGroup(userGroupId, name, description, 157 serviceContext); 158 } 159 160 /** 161 * Returns the OSGi service identifier. 162 * 163 * @return the OSGi service identifier 164 */ 165 public static java.lang.String getOSGiServiceIdentifier() { 166 return getService().getOSGiServiceIdentifier(); 167 } 168 169 public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserGroups( 170 long companyId) 171 throws com.liferay.portal.kernel.exception.PortalException { 172 return getService().getUserGroups(companyId); 173 } 174 175 /** 176 * Returns all the user groups to which the user belongs. 177 * 178 * @param userId the primary key of the user 179 * @return the user groups to which the user belongs 180 */ 181 public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserUserGroups( 182 long userId) throws com.liferay.portal.kernel.exception.PortalException { 183 return getService().getUserUserGroups(userId); 184 } 185 186 /** 187 * Adds the user groups to the group. 188 * 189 * @param groupId the primary key of the group 190 * @param userGroupIds the primary keys of the user groups 191 */ 192 public static void addGroupUserGroups(long groupId, long[] userGroupIds) 193 throws com.liferay.portal.kernel.exception.PortalException { 194 getService().addGroupUserGroups(groupId, userGroupIds); 195 } 196 197 /** 198 * Adds the user groups to the team 199 * 200 * @param teamId the primary key of the team 201 * @param userGroupIds the primary keys of the user groups 202 */ 203 public static void addTeamUserGroups(long teamId, long[] userGroupIds) 204 throws com.liferay.portal.kernel.exception.PortalException { 205 getService().addTeamUserGroups(teamId, userGroupIds); 206 } 207 208 /** 209 * Deletes the user group. 210 * 211 * @param userGroupId the primary key of the user group 212 */ 213 public static void deleteUserGroup(long userGroupId) 214 throws com.liferay.portal.kernel.exception.PortalException { 215 getService().deleteUserGroup(userGroupId); 216 } 217 218 /** 219 * Removes the user groups from the group. 220 * 221 * @param groupId the primary key of the group 222 * @param userGroupIds the primary keys of the user groups 223 */ 224 public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) 225 throws com.liferay.portal.kernel.exception.PortalException { 226 getService().unsetGroupUserGroups(groupId, userGroupIds); 227 } 228 229 /** 230 * Removes the user groups from the team. 231 * 232 * @param teamId the primary key of the team 233 * @param userGroupIds the primary keys of the user groups 234 */ 235 public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) 236 throws com.liferay.portal.kernel.exception.PortalException { 237 getService().unsetTeamUserGroups(teamId, userGroupIds); 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 }