Copyright© 2008-2018 SiteVision AB, all rights reserved.
public interface UserIdentityWrapper extends Wrapper<Node>
This wrapper provides methods to check and update the social network (i.e. contacts and collaboration groups) of a (wrapped) user identity.
Note that a disabled user identity is prohibited to execute some of the mutating/write operations.
An instance of the SiteVision class implementing this interface can be obtained via
UserFactory.getUserIdentityWrapper(javax.jcr.Node)
.
See UserFactory
for how to obtain an instance of the UserFactory
interface.
Modifier and Type | Method and Description |
---|---|
boolean |
addContact(Node aUserIdentity)
Adds a contact for the wrapped user identity.
|
boolean |
followGroup(Node aCollaborationGroup)
The wrapped user identity follows/eavesdrops a collaboration group.
|
java.util.Set<Node> |
getCollaborationGroups()
Gets the collaboration groups of the wrapped user identity.
|
java.util.Set<Node> |
getContacts()
Gets the contacts of the wrapped user identity.
|
java.util.Set<Node> |
getFollowedGroups()
Gets the collaboration groups the wrapped user identity follows/eavesdrops.
|
Node |
getProfileImage()
Gets the profile image of the wrapped user identity.
|
Node |
getProfileImagesFolder()
Gets the profile images folder of the wrapped user identity.
|
Node |
getUserIdentity()
Gets the wrapped user identity.
|
boolean |
isAdminOf(Node aCollaborationGroup)
Checks if wrapped user identity is admin of a collaboration group.
|
boolean |
isContact(Node aUserIdentity)
Checks if the wrapped user identity is contact with a specified user identity.
|
boolean |
isDisabled()
Checks if the wrapped user identity is disabled or not.
|
boolean |
isFollowing(Node aCollaborationGroup)
Checks if wrapped user identity is following/eavesdropping a collaboration group.
|
boolean |
isMemberOf(Node aCollaborationGroup)
Checks if wrapped user identity is member of a collaboration group.
|
boolean |
joinGroup(Node aCollaborationGroup)
The wrapped user identity joins a collaboration group.
|
boolean |
leaveGroup(Node aCollaborationGroup)
The wrapped user identity leaves a collaboration group.
|
boolean |
removeContact(Node aUserIdentity)
Removes a contact of the wrapped user identity.
|
boolean |
setDisabled(boolean aDisabled)
Sets the availability of the wrapped user identity.
|
boolean |
setHidden(boolean aHidden)
Sets the visibility of the wrapped user identity in search results.
|
boolean |
setProfileImage(Node aProfileImage)
Sets the profile image of the wrapped user identity.
|
boolean |
unfollowGroup(Node aCollaborationGroup)
The wrapped user identity stops following/eavesdropping a collaboration group.
|
java.util.Set<Node> getContacts()
boolean isContact(Node aUserIdentity)
aUserIdentity
- the user identity to checktrue
if aUserIdentity
is a contact of the wrapped user identity, false
otherwiseboolean addContact(Node aUserIdentity)
Permission note! This mutating operation is not allowed for a wrapped user identity that is disabled
.
To be allowed to add a contact for the wrapped user identity, current user must match the wrapped user identity
(i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_USER_IDENTITIES
on current page.
aUserIdentity
- the user identity (or user) that should be added as contact for the wrapped user identitytrue
if aUserIdentity
was added as contact for the wrapped user identity, false
otherwiseboolean removeContact(Node aUserIdentity)
Permission note! This mutating operation is not allowed for a wrapped user identity that is disabled
.
To be allowed to remove a contact for the wrapped user identity, current user must match the wrapped user identity
(i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_USER_IDENTITIES
on current page.
aUserIdentity
- the user identity (or user) that should be added as contact for the wrapped user identitytrue
if aUserIdentity
was added as contact for the wrapped user identity, false
otherwisejava.util.Set<Node> getCollaborationGroups()
Permission note! The returned set will only contain the collaboration groups that
that current user is allowed to read (i.e. PermissionUtil.Permission.READ
).
boolean isAdminOf(Node aCollaborationGroup)
aCollaborationGroup
- the collaboration group (or collaboration group page) to checktrue
if the wrapped user identity is admin of aCollaborationGroup
, false
otherwiseboolean isMemberOf(Node aCollaborationGroup)
aCollaborationGroup
- the collaboration group (or collaboration group page) to checktrue
if the wrapped user identity is member of aCollaborationGroup
, false
otherwiseboolean leaveGroup(Node aCollaborationGroup)
Only members can leave a collaboration group, i.e. the leave attempt will be ignored if wrapped user identity isn't a member of specified collaboration group. Note that a group admin is also a group member so leaving a collaboration group might in fact also remove an admin, but last admin will never be removed. Collaboration groups that are inactive can not be leaved.
Permission note! This mutating operation is not allowed for a wrapped user identity that is disabled
.
To remove group membership for the wrapped user identity, current user must match the wrapped user identity
(i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
and PermissionUtil.Permission.READ
on the collaboration group.
aCollaborationGroup
- the collaboration group (or collaboration group page) to leavetrue
if the leave operation succeeded, false
otherwiseboolean joinGroup(Node aCollaborationGroup)
Only non-members can join a collaboration group, i.e. the join attempt will be ignored if wrapped user identity already are a member of specified collaboration group. Collaboration groups that are inactive can not be joined.
Permission note! This mutating operation is not allowed for a wrapped user identity that is disabled
.
To join a collaboration group for the wrapped user identity, current user must match the wrapped user identity
(i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
and PermissionUtil.Permission.READ
on the collaboration group.
aCollaborationGroup
- the collaboration group (or collaboration group page) to jointrue
if the join operation succeeded, false
otherwiseboolean followGroup(Node aCollaborationGroup)
Only non-members can follow a collaboration group, i.e. the follow attempt will be ignored if wrapped user identity already are a member of specified collaboration group. Collaboration groups that are inactive or closed can not be followed.
Permission note! This mutating operation is not allowed for a wrapped user identity that is disabled
.
To follow a collaboration group for the wrapped user identity, current user must match the wrapped user identity
(i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
and PermissionUtil.Permission.READ
on the collaboration group.
aCollaborationGroup
- the collaboration group (or collaboration group page) to followtrue
if the follow operation succeeded, false
otherwisejava.util.Set<Node> getFollowedGroups()
Permission note! The returned set will only contain active collaboration groups that
that current user is allowed to read (i.e. PermissionUtil.Permission.READ
).
boolean isFollowing(Node aCollaborationGroup)
aCollaborationGroup
- the collaboration group (or collaboration group page) to checktrue
if the wrapped user identity is following aCollaborationGroup
, false
otherwiseboolean unfollowGroup(Node aCollaborationGroup)
Only followers can stop following a collaboration group, i.e. the unfollow attempt will be ignored if wrapped user identity isn't a follower of specified collaboration group. Collaboration groups that are inactive can not be unfollowed.
Permission note! This mutating operation is not allowed for a wrapped user identity that is disabled
.
To unfollow a group for the wrapped user identity, current user must match the wrapped user identity
(i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_COLLABORATION_GROUP
and PermissionUtil.Permission.READ
on the collaboration group.
aCollaborationGroup
- the collaboration group (or collaboration group page) to stop followingtrue
if the unfollow operation succeeded, false
otherwiseNode getProfileImage()
Note! This method returns the 'raw' profile image (i.e. a node of type sv:image
)
that the user has uploaded. For buddy icons, see BuddyIconRenderer
.
Node getProfileImagesFolder()
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 user identity.
The profile images folder is available via getProfileImagesFolder()
.
Permission note! This mutating operation is not allowed for a wrapped user identity that is disabled
.
To set the profile image for the wrapped user identity, current user must match the wrapped user identity
(i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_USER_IDENTITIES
on current page.
aProfileImage
- the profile imagetrue
if the set operation succeeded, false
otherwiseboolean setHidden(boolean aHidden)
Permission note! This mutating operation is not allowed for a wrapped user identity that is disabled
.
To update the hidden property for the wrapped user identity, current user must match the wrapped user identity
(i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_USER_IDENTITIES
on current page.
aHidden
- true
if the wrapped user identity should be hidden, false
otherwisetrue
if the set operation succeeded, false
otherwiseboolean setDisabled(boolean aDisabled)
Permission note! To update the disabled property for the wrapped user identity,
current user must match the wrapped user identity (i.e. "is yourself") - or have
PermissionUtil.Permission.MANAGE_USER_IDENTITIES
on current page.
aDisabled
- true
if the wrapped user identity should be disabled, false
otherwisetrue
if the set operation succeeded, false
otherwiseboolean isDisabled()
This is a convenience method the check the boolean value of the disabled
property of the wrapped user identity.
Note that a disabled user identity is not allowed to perform any mutating/write operations except setDisabled(boolean)
.
Node getUserIdentity()
Note! This method is equivalent with Wrapper.unwrap()
if this wrapper is created with a sv:userIdentity
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-2018 SiteVision AB, all rights reserved.