Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community.socialgroup
Interface SocialGroupManager

All Superinterfaces:
JiveManager

public interface SocialGroupManager
extends JiveManager

Create, retrieve, update and delete social groups.


Method Summary
 void addMember(SocialGroup socialGroup, User memberToAdd, com.jivesoftware.community.socialgroup.SocialGroupMember.Type memberType)
          Adds a user to a social group
 SocialGroup create(String name, SocialGroup.Type type, String description, User user, ContentRetrieval.ContentType... types)
          Creates a new Social Group
 SocialGroup create(String name, String displayName, SocialGroup.Type type, String description, User user, ContentRetrieval.ContentType... types)
          Creates a new Social Group
 void delete(SocialGroup socialGroup)
          Deletes the passed social group
 void deleteSocialGroupAssociations(User user)
          Deletes the given user's social group memberships, plus any social groups owned by the given user.
 void deleteSocialGroupImage(SocialGroup socialGroup)
          Deletes the social groups image
 SocialGroup getSocialGroup(long socialGroupID)
          Gets the social group with the given id
 SocialGroup getSocialGroup(String socialGroupDisplayName)
          Gets the social group with the given display name
 int getSocialGroupCount()
          Returns the total number of groups viewable by the currently authenticated user (as specified by the default group filter)
 int getSocialGroupCount(com.jivesoftware.community.socialgroup.SocialGroupResultFilter socialGroupResultFilter)
          Returns the total number of groups that match the criteria of the given result filter
 InputStream getSocialGroupImage(SocialGroup socialGroup, int size)
          Returns the profile image for a user.
 long getSocialGroupImageID(SocialGroup socialGroup, int size)
          Returns the profile image for a user.
 com.jivesoftware.community.socialgroup.SocialGroupMember getSocialGroupMember(long membershipID)
          Returns the group member with the matching membership id
 JiveIterator<com.jivesoftware.community.socialgroup.SocialGroupMember> getSocialGroupMembers(SocialGroup socialGroup)
          Gets all users, excluding invited users, that are members of the given social group.
 JiveIterator<com.jivesoftware.community.socialgroup.SocialGroupMember> getSocialGroupMembers(com.jivesoftware.community.socialgroup.SocialGroupMemberResultFilter memberResultFilter)
          Gets all users, excluding invited users, that are members of the given social group and match the given filter.
 JiveIterator<SocialGroup> getSocialGroups()
          Returns all groups viewable by the currently authenticated user (as specified by the default group filter)
 JiveIterator<SocialGroup> getSocialGroups(com.jivesoftware.community.socialgroup.SocialGroupResultFilter socialGroupResultFilter)
          Returns all groups viewable by the currently authenticated user (as specified by the default group filter)
 int getTotalMemberships(com.jivesoftware.community.socialgroup.SocialGroupMemberResultFilter memberResultFilter)
          Returns the total number of users matching the given result filter.
 int getTotalUsersInGroup(SocialGroup socialGroup)
          Returns the total number of owners and members in this social group
 boolean isBanned(SocialGroup socialGroup, User member)
          Returns true if the user has been banned from participating in the group (as defined by SocialGroupMember.Type) false otherwise.
 boolean isPendingApproval(SocialGroup socialGroup, User member)
          Returns true if the user is pending approval to have access to the group (as defined by SocialGroupMember.Type) false otherwise.
 boolean isSocialGroupMember(SocialGroup socialGroup, User member)
          Returns true if the user is a member (as defined by SocialGroupMember.Type) of the social group false otherwise.
 boolean isSocialGroupOwner(SocialGroup socialGroup, User owner)
          Returns true if the user is an owner (as defined by SocialGroupMember.Type) of the social group false otherwise.
 boolean isUniqueDisplayName(String displayName)
          Returns true if the group display name is unique
 boolean isUniqueName(String name)
          Returns true if the given group name is unique
 void registerMemberApprovalWorkflow(com.jivesoftware.community.socialgroup.SocialGroupMember member, long workflowID)
          Creates a new OSWorkflow workflow item to mirror the group member pending approval workflow by associating a group membership to a workflow id.
 void removeMember(SocialGroup socialGroup, User memberToRemove)
          Removes a member from a social group and deletes the membership details.
 void setSocialGroupImage(SocialGroup socialGroup, String mimeType, InputStream smallImage, InputStream medImage, InputStream largeImage)
          Set a new social group image for the specified social group.
 void update(SocialGroup socialGroup)
          Updates the passed social group
 void updateMember(SocialGroup socialGroup, com.jivesoftware.community.socialgroup.SocialGroupMember member, com.jivesoftware.community.socialgroup.SocialGroupMember.Type memberType)
          Updates the membership of the user in the group to have the given membership type
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

create

SocialGroup create(String name,
                   SocialGroup.Type type,
                   String description,
                   User user,
                   ContentRetrieval.ContentType... types)
                   throws NameAlreadyExistsException,
                          UnauthorizedException
Creates a new Social Group

Parameters:
name - - the group name (will also be converted into a valid display name)
type - - the type of memberships allowed in the group
description - - a short description of this group
user - - the user creating the group
types - - content types allowed in this group
Returns:
the created group
Throws:
NameAlreadyExistsException - - if the name or display name is already in use
UnauthorizedException - - if the currently authenticated user isn't authorized to create a group

create

SocialGroup create(String name,
                   String displayName,
                   SocialGroup.Type type,
                   String description,
                   User user,
                   ContentRetrieval.ContentType... types)
                   throws NameAlreadyExistsException,
                          UnauthorizedException
Creates a new Social Group

Parameters:
name - - the group name
displayName - - a display name to use for this group
type - - the type of memberships allowed in the group
description - - a short description of this group
user - - the user creating the group
types - - content types allowed in this group
Returns:
the created group
Throws:
NameAlreadyExistsException - - if the name or display name is already in use
UnauthorizedException - - if the currently authenticated user isn't authorized to create a group

getSocialGroup

SocialGroup getSocialGroup(long socialGroupID)
                           throws NotFoundException,
                                  UnauthorizedException
Gets the social group with the given id

Parameters:
socialGroupID - - the id of the group
Returns:
the group with the specified id
Throws:
NotFoundException - if no group is found with the specified id
UnauthorizedException - if the currently authenticated user isn't authorized to see that group

getSocialGroup

SocialGroup getSocialGroup(String socialGroupDisplayName)
                           throws NotFoundException,
                                  UnauthorizedException
Gets the social group with the given display name

Parameters:
socialGroupDisplayName - - the display name of the group
Returns:
the group with the specified display name
Throws:
NotFoundException - if no group is found with the specified display name
UnauthorizedException - if the currently authenticated user isn't authorized to see that group

getSocialGroupCount

int getSocialGroupCount()
Returns the total number of groups viewable by the currently authenticated user (as specified by the default group filter)

Returns:
the number of groups

getSocialGroupCount

int getSocialGroupCount(com.jivesoftware.community.socialgroup.SocialGroupResultFilter socialGroupResultFilter)
Returns the total number of groups that match the criteria of the given result filter

Parameters:
socialGroupResultFilter - - a filter on group attributes
Returns:
the number of groups

getSocialGroups

JiveIterator<SocialGroup> getSocialGroups()
                                          throws UnauthorizedException
Returns all groups viewable by the currently authenticated user (as specified by the default group filter)

Returns:
the number of groups
Throws:
UnauthorizedException - if the default filter includes a group the currently authenticated user isn't authorized to access

getSocialGroups

JiveIterator<SocialGroup> getSocialGroups(com.jivesoftware.community.socialgroup.SocialGroupResultFilter socialGroupResultFilter)
                                          throws UnauthorizedException
Returns all groups viewable by the currently authenticated user (as specified by the default group filter)

Parameters:
socialGroupResultFilter - - a filter on group attributes
Returns:
the number of groups
Throws:
UnauthorizedException - if the filter includes a group the currently authenticated user isn't authorized to access

update

void update(SocialGroup socialGroup)
            throws NameAlreadyExistsException,
                   UnauthorizedException
Updates the passed social group

Parameters:
socialGroup - to be updated
Throws:
NameAlreadyExistsException - if a new name or display name is set that is already in use
UnauthorizedException - if the currently authenticated user isn't authorized to update the group

delete

void delete(SocialGroup socialGroup)
            throws UnauthorizedException
Deletes the passed social group

Parameters:
socialGroup - to be deleted
Throws:
UnauthorizedException - if the currently authenticated user isn't authorized to delete the group

deleteSocialGroupAssociations

void deleteSocialGroupAssociations(User user)
                                   throws UnauthorizedException,
                                          NotFoundException
Deletes the given user's social group memberships, plus any social groups owned by the given user.

Parameters:
user - the user with the social group memberships being deleted, and/or the owner of the social groups being deleted.
Throws:
UnauthorizedException - If authenticated user is not a system admin.
NotFoundException - if the user isn't found in the group

addMember

void addMember(SocialGroup socialGroup,
               User memberToAdd,
               com.jivesoftware.community.socialgroup.SocialGroupMember.Type memberType)
               throws UnauthorizedException,
                      com.jivesoftware.util.AlreadyExistsException
Adds a user to a social group

Parameters:
socialGroup - the group to add the member to
memberToAdd - the user to add to the group
memberType - the type to assign to the user's membership
Throws:
UnauthorizedException - if the currently authenticated user isn't authorized to add users to the group
com.jivesoftware.util.AlreadyExistsException - if there is already a membership for the specified user

getSocialGroupMembers

JiveIterator<com.jivesoftware.community.socialgroup.SocialGroupMember> getSocialGroupMembers(SocialGroup socialGroup)
Gets all users, excluding invited users, that are members of the given social group.

Parameters:
socialGroup - - the socialGroup to get members for
Returns:
the members of the social group. Does not include invited users

getSocialGroupMembers

JiveIterator<com.jivesoftware.community.socialgroup.SocialGroupMember> getSocialGroupMembers(com.jivesoftware.community.socialgroup.SocialGroupMemberResultFilter memberResultFilter)
Gets all users, excluding invited users, that are members of the given social group and match the given filter.

Parameters:
memberResultFilter - - the filter to specify member attributes to match
Returns:
the members of the social group. Does not include invited users

removeMember

void removeMember(SocialGroup socialGroup,
                  User memberToRemove)
                  throws UnauthorizedException
Removes a member from a social group and deletes the membership details.

Parameters:
socialGroup - the group to removed the member from
memberToRemove - the user to remove from the group
Throws:
UnauthorizedException - if the currently authenticated user isn't authorized to remove users from the group

getSocialGroupMember

com.jivesoftware.community.socialgroup.SocialGroupMember getSocialGroupMember(long membershipID)
                                                                              throws NotFoundException,
                                                                                     UnauthorizedException
Returns the group member with the matching membership id

Parameters:
membershipID - - the unique id of the membership details
Returns:
the member details associated with the membership
Throws:
NotFoundException - if there is no membership with the specified id
UnauthorizedException - if the currently authenticated user isn't authorized to see the membership information

updateMember

void updateMember(SocialGroup socialGroup,
                  com.jivesoftware.community.socialgroup.SocialGroupMember member,
                  com.jivesoftware.community.socialgroup.SocialGroupMember.Type memberType)
                  throws UnauthorizedException
Updates the membership of the user in the group to have the given membership type

Parameters:
socialGroup - - the group to update membership for
member - - the user with memberhsip in the group
memberType - - the type of membership to set
Throws:
UnauthorizedException - if the currently authenticated user isn't authorized to update the membership in the group

registerMemberApprovalWorkflow

void registerMemberApprovalWorkflow(com.jivesoftware.community.socialgroup.SocialGroupMember member,
                                    long workflowID)
                                    throws NotFoundException
Creates a new OSWorkflow workflow item to mirror the group member pending approval workflow by associating a group membership to a workflow id. The resulting workflow can either be approved or rejected through the workflow process; or circumvented by a direct approval (changing a user from the pending approval state to the member or administrator state through the updateMember method causing the workflow item to be deleted.

Parameters:
member - - the member to start the workflow for
workflowID - - the workflow to associate with the group member pending approval
Throws:
NotFoundException - if the group the member is asking to join no longer exists

isSocialGroupOwner

boolean isSocialGroupOwner(SocialGroup socialGroup,
                           User owner)
Returns true if the user is an owner (as defined by SocialGroupMember.Type) of the social group false otherwise.

Parameters:
socialGroup - - the social group that has at least one owner
owner - - the user whose ownership role we want to determine
Returns:
true if the user is an owner of the social group, false otherwise.

isSocialGroupMember

boolean isSocialGroupMember(SocialGroup socialGroup,
                            User member)
Returns true if the user is a member (as defined by SocialGroupMember.Type) of the social group false otherwise. A group owner is not considered a member of the group even though they are in the group. If the user is an owner false will be returned.

Parameters:
socialGroup - - the social group that has memebers
member - - the user whose membership we want to determine
Returns:
true if the user is a member of the social group, false otherwise.

isPendingApproval

boolean isPendingApproval(SocialGroup socialGroup,
                          User member)
Returns true if the user is pending approval to have access to the group (as defined by SocialGroupMember.Type) false otherwise. A user is pending approval after they ask to join a private group.

Parameters:
socialGroup - - the social group that has memebers
member - - the user whose membership we want to determine
Returns:
true if the user is a member of the social group, false otherwise.

isBanned

boolean isBanned(SocialGroup socialGroup,
                 User member)
Returns true if the user has been banned from participating in the group (as defined by SocialGroupMember.Type) false otherwise. A banned member may have either been banned only from this group, or from the system as defined by the possible member status settings SocialGroupMember.Status

Parameters:
socialGroup - - the social group that has memebers
member - - the user whose ban status we want to determine
Returns:
true if the user is has been banned from the social group, false otherwise.

getTotalUsersInGroup

int getTotalUsersInGroup(SocialGroup socialGroup)
                         throws UnauthorizedException
Returns the total number of owners and members in this social group

Parameters:
socialGroup - with members
Returns:
the total number of users in the given group
Throws:
UnauthorizedException - - If the group is secret and the currently authenticated user is not supposed to know it exists, or if the group is private and this user isn't a member of the group

getTotalMemberships

int getTotalMemberships(com.jivesoftware.community.socialgroup.SocialGroupMemberResultFilter memberResultFilter)
                        throws UnauthorizedException
Returns the total number of users matching the given result filter. If a group is specified in the filter returns the number of members in the group. Otherwise the total of all memberships in all groups matching the filter is returned.

Parameters:
memberResultFilter - - filter criteria
Returns:
the total number of users in a group or set of groups matching the filter criteria
Throws:
UnauthorizedException - - If a group is specified and is secret and the currently authenticated user is not supposed to know it exists, or if the group is private and this user isn't a member of the group. Also thrown if no group is specified and no user id is specified preventing groups from being filtered by the specified users membership.

setSocialGroupImage

void setSocialGroupImage(SocialGroup socialGroup,
                         String mimeType,
                         InputStream smallImage,
                         InputStream medImage,
                         InputStream largeImage)
                         throws AttachmentException
Set a new social group image for the specified social group.

Parameters:
socialGroup - The socialGroup to add an image for.
mimeType - The mime type of the image.
smallImage - The content for the small image.
medImage - The content for the medium image.
largeImage - The content for the large image.
Throws:
AttachmentException - Thrown if the image cannot be added.

getSocialGroupImage

InputStream getSocialGroupImage(SocialGroup socialGroup,
                                int size)
Returns the profile image for a user.

Parameters:
socialGroup - The social group to get an image for.
size - 0 for the small image, 1 for the medium image, and 2 for the large image
Returns:
The content of the image.

getSocialGroupImageID

long getSocialGroupImageID(SocialGroup socialGroup,
                           int size)
Returns the profile image for a user.

Parameters:
socialGroup - The social group to get an image for.
size - 0 for the small image, 1 for the medium image, and 2 for the large image
Returns:
The id of the image.

deleteSocialGroupImage

void deleteSocialGroupImage(SocialGroup socialGroup)
Deletes the social groups image

Parameters:
socialGroup - The social group to delete image for.

isUniqueName

boolean isUniqueName(String name)
Returns true if the given group name is unique

Parameters:
name - to test
Returns:
true if the name is unique

isUniqueDisplayName

boolean isUniqueDisplayName(String displayName)
Returns true if the group display name is unique

Parameters:
displayName - to test
Returns:
true if the displayName is unique

Clearspace Project Page

Copyright © 1999-2007 Jive Software.