Class SiteParticipantHelper


  • public class SiteParticipantHelper
    extends Object
    • Constructor Detail

      • SiteParticipantHelper

        public SiteParticipantHelper()
    • Method Detail

      • addParticipantsFromEnrollmentSet

        public static void addParticipantsFromEnrollmentSet​(Map<String,​Participant> participantsMap,
                                                            org.sakaiproject.authz.api.AuthzGroup realm,
                                                            String providerCourseEid,
                                                            org.sakaiproject.coursemanagement.api.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,
                                                            org.sakaiproject.authz.api.AuthzGroup realm,
                                                            String providerCourseEid,
                                                            org.sakaiproject.coursemanagement.api.EnrollmentSet enrollmentSet,
                                                            String sectionTitle,
                                                            String filterType,
                                                            String filterID,
                                                            Set<org.sakaiproject.authz.api.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 on
        groupMembership -
      • getEidUserMapFromCollection

        public static Map<String,​org.sakaiproject.user.api.User> getEidUserMapFromCollection​(Collection<Object> cObjects)
        Collect all member users data in one call
        Parameters:
        memberships -
        Returns:
      • addParticipantsFromMemberships

        public static void addParticipantsFromMemberships​(Map participantsMap,
                                                          org.sakaiproject.authz.api.AuthzGroup realm,
                                                          Set memberships,
                                                          String sectionTitle,
                                                          String filterType,
                                                          String filterID,
                                                          Set<org.sakaiproject.authz.api.Member> groupMembership)
        Add participant from provider-defined membership set
        Parameters:
        participantsMap -
        realm -
        memberships -
        sectionTitle -
        filterType -
        filterID -
        groupMembership -
      • addParticipantsFromMemberships

        public static void addParticipantsFromMemberships​(Map participantsMap,
                                                          org.sakaiproject.authz.api.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<org.sakaiproject.authz.api.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 question
        groupID - the ID of the group to add participants from
        Returns:
        the set of members for the given group in the given site
      • 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<org.sakaiproject.authz.api.Role> getAllowedRoles​(String siteType,
                                                                            List<org.sakaiproject.authz.api.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<org.sakaiproject.authz.api.Role> getAllowedRoles​(String siteType,
                                                                            Set<org.sakaiproject.authz.api.Role> allRolesForSiteType)
      • makeUserDisplayName

        public static String makeUserDisplayName​(String userId)