public class GroupUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_WAIT_TIME |
static int |
DEFAULT_WAIT_BETWEEN_RETRIES |
static int |
WARN_RETRY_DELAY |
static int |
WARN_WAIT_TIME |
Constructor and Description |
---|
GroupUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canAccessCommunityGroup(ResourceResolver resolver,
CommunityGroup group) |
static boolean |
canEveryoneCreateGroup(Resource resource) |
static boolean |
canInviteGroupMember(ResourceResolver resolver,
CommunityContext context,
ServiceUserWrapper serviceUserWrapper,
SlingRepository repository,
UserManager um)
Check if logged in user can invite group members.
|
static boolean |
canLeaveGroup(ResourceResolver resolver,
CommunityContext context,
ServiceUserWrapper serviceUserWrapper,
SlingRepository repository,
UserManager um)
Check if logged in user can invite group members.
|
static boolean |
canPromoteGroupMember(ResourceResolver resolver,
CommunityContext context,
ServiceUserWrapper serviceUserWrapper,
SlingRepository repository,
UserManager um)
Check if logged in user can promote group members.
|
static java.lang.String |
getMemberGroupName(ResourceResolver resourceResolver,
java.lang.String groupPath) |
static int |
getNumberOfMembers(UserPropertiesService userPropertiesService,
ResourceResolver resourceResolver,
java.lang.String groupId)
Returns the number of the group members.
|
static boolean |
isGroupAdmin(Session session,
Resource resource)
Deprecated.
|
static boolean |
isMember(java.lang.String groupId,
java.lang.String userId,
ServiceUserWrapper serviceUserWrapper,
SlingRepository repository) |
static boolean |
isMember(UserManager um,
java.lang.String groupId,
java.lang.String userId)
Check if the specified user id belong to the group admin or not.
|
static boolean |
isMember(UserPropertiesService userPropertiesService,
ResourceResolver resourceResolver,
java.lang.String authId,
java.lang.String groupId)
Returns true if an authorizable is a group member.
|
static boolean |
isPublicGroup(ResourceResolver resourceResolver,
java.lang.String groupPath) |
static java.lang.Object |
toObject(java.lang.String value,
java.lang.Class clazz) |
static boolean |
validateGroupName(ResourceResolver resolver,
java.lang.String name,
java.lang.String groupRoot)
Validate if a community group name is unique.
|
static void |
waitForPageCreation(ResourceResolver resolver,
java.lang.String pagePath,
long maxWaitTime,
long waitInterval)
wait for page content creation to complete.
|
public static final int DEFAULT_MAX_WAIT_TIME
public static final int DEFAULT_WAIT_BETWEEN_RETRIES
public static final int WARN_WAIT_TIME
public static final int WARN_RETRY_DELAY
public static boolean canEveryoneCreateGroup(Resource resource)
public static boolean validateGroupName(ResourceResolver resolver, java.lang.String name, java.lang.String groupRoot)
resolver
- resource resolver.name
- community group name.groupRoot
- community group site path.true
if a community group name is unique.public static int getNumberOfMembers(UserPropertiesService userPropertiesService, ResourceResolver resourceResolver, java.lang.String groupId)
userPropertiesService
- user properties service.resourceResolver
- resource resolver.groupId
- group id.public static boolean isMember(UserPropertiesService userPropertiesService, ResourceResolver resourceResolver, java.lang.String authId, java.lang.String groupId)
userPropertiesService
- user properties service.resourceResolver
- resource resolver.authId
- authorizable id.groupId
- group id.true
if an authorizable is a group member.public static void waitForPageCreation(ResourceResolver resolver, java.lang.String pagePath, long maxWaitTime, long waitInterval) throws RepositoryException
resolver
- resource resolver.pagePath
- page pathmaxWaitTime
- time out in millisecondwaitInterval
- wait interval in millisecondRepositoryException
- - thrown if unable to wait for page creation.public static java.lang.Object toObject(java.lang.String value, java.lang.Class clazz)
public static boolean isMember(UserManager um, java.lang.String groupId, java.lang.String userId) throws RepositoryException
um
- user managergroupId
- Id of the groupuserId
- Id of the userRepositoryException
- - thrown if get member status.public static boolean isMember(java.lang.String groupId, java.lang.String userId, ServiceUserWrapper serviceUserWrapper, SlingRepository repository) throws RepositoryException
RepositoryException
@Deprecated public static boolean isGroupAdmin(Session session, Resource resource) throws OperationException
OperationException
public static boolean canInviteGroupMember(ResourceResolver resolver, CommunityContext context, ServiceUserWrapper serviceUserWrapper, SlingRepository repository, UserManager um)
resolver
- a resource resolver.context
- CommunityContext.serviceUserWrapper
- ServiceUserWrapper.repository
- sling repository.um
- user manager.public static boolean canLeaveGroup(ResourceResolver resolver, CommunityContext context, ServiceUserWrapper serviceUserWrapper, SlingRepository repository, UserManager um)
resolver
- a resource resolver.context
- CommunityContext.serviceUserWrapper
- ServiceUserWrapper.repository
- sling repository.um
- user manager.public static boolean canPromoteGroupMember(ResourceResolver resolver, CommunityContext context, ServiceUserWrapper serviceUserWrapper, SlingRepository repository, UserManager um)
resolver
- a resource resolver.context
- CommunityContext.serviceUserWrapper
- ServiceUserWrapper.repository
- sling repository.um
- user manager.public static boolean canAccessCommunityGroup(ResourceResolver resolver, CommunityGroup group)
public static boolean isPublicGroup(ResourceResolver resourceResolver, java.lang.String groupPath)
public static java.lang.String getMemberGroupName(ResourceResolver resourceResolver, java.lang.String groupPath)
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"