Copyright© 2008-2022 Sitevision AB, all rights reserved.
public interface CollaborationGroupWrapper extends Wrapper<Node>
This wrapper provides methods to update an existing collaboration group. You would typically use
CollaborationGroupUtil
to create a new collaboration group.
An instance of the Sitevision class implementing this interface can be obtained via
CollaborationFactory.getCollaborationGroupWrapper(javax.jcr.Node)
.
See CollaborationFactory
for how to obtain an instance of the CollaborationFactory
interface.
Modifier and Type | Method and Description |
---|---|
boolean |
addAdmin(Node aUserIdentity)
Adds a user identity as admin of the wrapped collaboration group.
|
boolean |
addMember(Node aUserIdentity)
Adds a user identity as member of the wrapped collaboration group.
|
Set<Node> |
getAdmins()
Gets the admins of the wrapped collaboration group.
|
Node |
getCollaborationGroup()
Gets the wrapped collaboration group.
|
Set<Node> |
getFollowers()
Gets the followers/eavesdroppers of the wrapped collaboration group.
|
String |
getGroupDescription()
Gets the group description of the wrapped collaboration group.
|
CollaborationGroupState |
getGroupState()
Gets the collaboration group state of the wrapped collaboration group.
|
CollaborationGroupType |
getGroupType()
Gets the collaboration group type of the wrapped collaboration group.
|
Set<Node> |
getMembers()
Gets the members of the wrapped collaboration group.
|
Node |
getProfileImage()
Gets the profile image of the wrapped collaboration group.
|
Node |
getProfileImagesFolder()
Gets the profile images folder of the wrapped collaboration group.
|
boolean |
isAdmin(Node aUserIdentity)
Checks if a user identity is admin of the wrapped collaboration group.
|
boolean |
isFollower(Node aUserIdentity)
Checks if a user identity is a follower/eavesdropper of the wrapped collaboration group.
|
boolean |
isMember(Node aUserIdentity)
Checks if a user identity is member of the wrapped collaboration group.
|
boolean |
removeMember(Node aUserIdentity)
Removes a member from the wrapped collaboration group.
|
boolean |
renameGroup(String aGroupName)
Alters the name of the wrapped collaboration group.
|
void |
setGroupDescription(String aGroupDescription)
Sets the group description of the wrapped collaboration group.
|
void |
setGroupState(CollaborationGroupState aCollaborationGroupState)
Changes the collaboration group state of the wrapped collaboration group.
|
void |
setGroupType(CollaborationGroupType aCollaborationGroupType)
Changes the collaboration group type of the wrapped collaboration group.
|
boolean |
setLocale(Locale aLocale)
Alters the render Locale used by the wrapped collaboration group.
|
boolean |
setProfileImage(Node aProfileImage)
Sets the profile image of the wrapped collaboration group.
|
Set<Node> getAdmins()
boolean isAdmin(Node aUserIdentity)
aUserIdentity
- a user identity (or user)true
if aUserIdentity
is admin of the wrapped group, false
otherwiseboolean addAdmin(Node aUserIdentity)
Only non-admins will be added, i.e. a user identity that already is an admin will be ignored. Collaboration groups that are inactive/unavailable don't accept any new admins.
Permission note! To add an admin to the wrapped group, current user must have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
on the group.
aUserIdentity
- a user identity (or user)true
if aUserIdentity
was added as admin of the wrapped group, false
otherwise.
false
is always returned if aUserIdentity
is null
or already is admin of the
wrapped collaboration group.Set<Node> getMembers()
Note! Admins are also considered as members.
boolean isMember(Node aUserIdentity)
aUserIdentity
- a user identity (or user)true
if aUserIdentity
is member of the wrapped group, false
otherwiseboolean addMember(Node aUserIdentity)
Only non-members will be added, i.e. a user identity that already is a member will be ignored. Collaboration groups that are inactive doesn't accept any new members.
Permission note! To add a member to the wrapped group, current user must have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
on the group -
or current user must match the given user identity (i.e. "is yourself") and have
PermissionUtil.Permission.READ
on the wrapped group.
aUserIdentity
- a user identity (or user)true
if aUserIdentity
was added as member of the wrapped group, false
otherwise.
false
is always returned if aUserIdentity
is null
or already are a member (or admin) of the
wrapped collaboration group.boolean removeMember(Node aUserIdentity)
Only members can be removed, i.e. a user identity that is a non-member will be ignored. Note that an admin is also a member so removing a member might in fact also remove an admin, but last admin will never be removed. Members can not be removed from collaboration groups that are inactive.
Permission note! To remove group membership for a user identity, current user
must match the user identity (i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
and PermissionUtil.Permission.READ
on the wrapped group.
aUserIdentity
- a user identity (or user)true
if aUserIdentity
was removed as member from the wrapped group, false
otherwise.
false
is always returned if aUserIdentity
is null
or not a member (or admin)
or last admin of the wrapped collaboration group.Set<Node> getFollowers()
boolean isFollower(Node aUserIdentity)
aUserIdentity
- a user identity (or user)true
if aUserIdentity
is a follower of the wrapped group, false
otherwiseboolean renameGroup(String aGroupName)
Permission note! Current user must have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
on the wrapped collaboration group.
Name note! Each group name must be (case-insensitively) unique in a given structure (i.e. collaboration group folder).
This method will remove leading and trailing whitespace from aGroupName
and use the remaining characters
as new name. The wrapped group will not be renamed if aGroupName
is null
, whitespace only or if
the remaining characters already exist as group name.
Tip! Use CollaborationGroupFolderUtil.containsCollaborationGroup(javax.jcr.Node, String)
to check if a named collaboration group already exists in the collaboration group folder of the group.
aGroupName
- the new group nametrue
if group could be renamed to aGroupName
, false
otherwise.CollaborationGroupType getGroupType()
void setGroupType(CollaborationGroupType aCollaborationGroupType)
The group type can not be changed for collaboration groups that are inactive.
Permission note! Current user must have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
on the wrapped collaboration group in order to change group type. In order to change group type to
CollaborationGroupType.CLOSED
,
current user must also have PermissionUtil.Permission.CREATE_CLOSED_COLLABORATION_GROUP
on the wrapped collaboration group.
aCollaborationGroupType
- the collaboration group typeCollaborationGroupState getGroupState()
void setGroupState(CollaborationGroupState aCollaborationGroupState)
Permission note! Current user must have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
on the wrapped collaboration group in order to change group state.
aCollaborationGroupState
- the collaboration group stateString getGroupDescription()
void setGroupDescription(String aGroupDescription)
Permission note! Current user must have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
on the wrapped collaboration group in order to change group description.
aGroupDescription
- the collaboration group descriptionNode getProfileImagesFolder()
Node getProfileImage()
Note! This method returns the 'raw' profile image (i.e. a Node of type sv:image
)
that the group has uploaded. For buddy icons, see BuddyIconRenderer
.
boolean setProfileImage(Node aProfileImage)
This method sets the active profile image, i.e. determines which profile image that should be used.
To create a new profile image (i.e. new binary data), you would typically use
a method in ImageUtil
first.
Model note! A profile image must be a Node of type sv:image
and a child of the profile images folder of the wrapped collaboration group.
The profile images folder is available via getProfileImagesFolder()
.
Permission note! Current user must have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
on the wrapped collaboration group in order to set the profile image.
aProfileImage
- the profile imagetrue
if the set operation succeeded, false
otherwiseboolean setLocale(Locale aLocale)
Permission note! Current user must have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
on the wrapped collaboration group.
Note! This method sets the Locale on the sv:collaborationGroupPage
where the wrapped collaboration group resides.
Mutation of Locale will fail if the collaboration group page is locked.
aLocale
- the Locale, must be a supported/available Locale (as of LocaleUtil.getAvailableLocales()
)Node getCollaborationGroup()
Note! This method is equivalent with Wrapper.unwrap()
if this wrapper is created with a sv:collaborationGroup
Node.
Sitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.