Package org.sakaiproject.site.util
Class SiteParticipantHelper
- java.lang.Object
-
- org.sakaiproject.site.util.SiteParticipantHelper
-
public class SiteParticipantHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description SiteParticipantHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddParticipantsFromEnrollmentSet(Map<String,Participant> participantsMap, AuthzGroup realm, String providerCourseEid, EnrollmentSet enrollmentSet, String sectionTitle)Add participant from provider-defined enrollment setstatic voidaddParticipantsFromEnrollmentSet(Map<String,Participant> participantsMap, AuthzGroup realm, String providerCourseEid, EnrollmentSet enrollmentSet, String sectionTitle, String filterType, String filterID, Set<Member> groupMembership)Add participant from provider-defined enrollment setstatic voidaddParticipantsFromMemberships(Map participantsMap, AuthzGroup realm, Set memberships, String sectionTitle)Add participant from provider-defined membership setstatic voidaddParticipantsFromMemberships(Map participantsMap, AuthzGroup realm, Set memberships, String sectionTitle, String filterType, String filterID, Set<Member> groupMembership)Add participant from provider-defined membership setstatic List<Role>getAllowedRoles(String siteType, List<Role> allRolesForSiteType)Get a list of the 'allowed roles', taking into account the current site type and the list of restricted roles defined in sakai.properties.static List<Role>getAllowedRoles(String siteType, Set<Role> allRolesForSiteType)static Map<String,User>getEidUserMapFromCollection(Collection<Object> cObjects)Collect all member users data in one callstatic List<String>getProviderCourseList(String siteId)getProviderCourseList a course site/realm id in one of three formats, for a single section, for multiple sections of the same course, or for a cross-listing having multiple courses. getProviderCourseList parses a realm id into year, term, campus_code, catalog_nbr, section components.static Set<String>getRestrictedRoles(String siteType)Get a list of restricted roles, taking into account the current site typestatic StringmakeUserDisplayName(String userId)static Collection<Participant>prepareParticipants(String siteID, List<String> providerCourseList)static Collection<Participant>prepareParticipants(String siteId, List<String> providerCourseList, String filterType, String filterID)static Set<Member>setGroupMembership(String siteID, String groupID)Set the membership for the given group from the given site
-
-
-
Method Detail
-
addParticipantsFromEnrollmentSet
public static void addParticipantsFromEnrollmentSet(Map<String,Participant> participantsMap, AuthzGroup realm, String providerCourseEid, EnrollmentSet enrollmentSet, String sectionTitle)
Add participant from provider-defined enrollment set- Parameters:
participantsMap-realm-providerCourseEid-enrollmentSet-sectionTitle-
-
addParticipantsFromEnrollmentSet
public static void addParticipantsFromEnrollmentSet(Map<String,Participant> participantsMap, AuthzGroup realm, String providerCourseEid, EnrollmentSet enrollmentSet, String sectionTitle, String filterType, String filterID, Set<Member> groupMembership)
Add participant from provider-defined enrollment set- Parameters:
participantsMap-realm-providerCourseEid-enrollmentSet-sectionTitle-filterType- the type of filter (section, group or role)filterID- the ID to filter ongroupMembership-
-
getEidUserMapFromCollection
public static Map<String,User> getEidUserMapFromCollection(Collection<Object> cObjects)
Collect all member users data in one call- Parameters:
memberships-- Returns:
-
addParticipantsFromMemberships
public static void addParticipantsFromMemberships(Map participantsMap, AuthzGroup realm, Set memberships, String sectionTitle, String filterType, String filterID, Set<Member> groupMembership)
Add participant from provider-defined membership set- Parameters:
participantsMap-realm-memberships-sectionTitle-filterType-filterID-groupMembership-
-
addParticipantsFromMemberships
public static void addParticipantsFromMemberships(Map participantsMap, AuthzGroup realm, Set memberships, String sectionTitle)
Add participant from provider-defined membership set- Parameters:
participantsMap-realm-memberships-sectionTitle-
-
getProviderCourseList
public static List<String> getProviderCourseList(String siteId)
getProviderCourseList a course site/realm id in one of three formats, for a single section, for multiple sections of the same course, or for a cross-listing having multiple courses. getProviderCourseList parses a realm id into year, term, campus_code, catalog_nbr, section components.- Parameters:
id- is a String representation of the course realm id (external id).
-
setGroupMembership
public static Set<Member> setGroupMembership(String siteID, String groupID)
Set the membership for the given group from the given site- Parameters:
siteID- the ID of the site which contains the group in questiongroupID- the ID of the group to add participants from- Returns:
- the set of members for the given group in the given site
-
prepareParticipants
public static Collection<Participant> prepareParticipants(String siteID, List<String> providerCourseList)
-
prepareParticipants
public static Collection<Participant> prepareParticipants(String siteId, List<String> providerCourseList, String filterType, String filterID)
-
getRestrictedRoles
public static Set<String> getRestrictedRoles(String siteType)
Get a list of restricted roles, taking into account the current site type- Parameters:
siteType- the current site's type- Returns:
- a list of restricted role IDs for the given site type
-
getAllowedRoles
public static List<Role> getAllowedRoles(String siteType, List<Role> allRolesForSiteType)
Get a list of the 'allowed roles', taking into account the current site type and the list of restricted roles defined in sakai.properties. If the properties are not found, just return all the roles. If the user is an admin, return all the roles. SAK-23257- Parameters:
siteType- the current site's type- Returns:
- A list of 'allowed' role objects for the given site type
-
getAllowedRoles
public static List<Role> getAllowedRoles(String siteType, Set<Role> allRolesForSiteType)
-
-