org.sakaiproject.component.section.support
Interface IntegrationSupport

All Known Implementing Classes:
IntegrationSupportImpl

public interface IntegrationSupport

Provides methods for manipulating users, courses, sections, and memberships. Implementations do not provide any authorization, so they are to be used for integration testing only.

Author:
Josh Holtzman

Method Summary
 ParticipationRecord addSectionMembership(String userUid, String sectionUuid, Role role)
          Adds a user to a section under the given role.
 ParticipationRecord addSiteMembership(String userUid, String siteContext, Role role)
          Adds a user to a site (or "Course").
 Course createCourse(String siteContext, String title, boolean externallyManaged, boolean selfRegistrationAllowed, boolean selfSwitchingAllowed)
          Creates a new course.
 CourseSection createSection(String courseUuid, String title, String category, Integer maxEnrollments, String location, Time startTime, Time endTime, boolean monday, boolean tuesday, boolean wednesday, boolean thursday, boolean friday, boolean saturday, boolean sunday)
          Creates a new section.
 User createUser(String userUid, String displayName, String sortName, String displayId)
          Creates a new user.
 User findUser(String userUid)
          Finds a user by their uuid.
 Set getAllSectionMemberships(String userUid, String siteContext)
          Gets all of the section-scoped ParticipationRecords for a user in a given site.
 List getAllSiteMemberships(String userUid)
          Gets all of the site-scoped ParticipationRecords for a user.
 void removeSectionMembership(String userUid, String sectionUuid)
          Removes a user from membership in a section.
 void removeSiteMembership(String userUid, String siteContext)
          Removes a user from a site (or "Course").
 

Method Detail

createCourse

public Course createCourse(String siteContext,
                           String title,
                           boolean externallyManaged,
                           boolean selfRegistrationAllowed,
                           boolean selfSwitchingAllowed)
Creates a new course.

Parameters:
siteContext -
title -
externallyManaged -
selfRegistrationAllowed -
selfSwitchingAllowed -
Returns:

createSection

public CourseSection createSection(String courseUuid,
                                   String title,
                                   String category,
                                   Integer maxEnrollments,
                                   String location,
                                   Time startTime,
                                   Time endTime,
                                   boolean monday,
                                   boolean tuesday,
                                   boolean wednesday,
                                   boolean thursday,
                                   boolean friday,
                                   boolean saturday,
                                   boolean sunday)
Creates a new section.

Parameters:
courseUuid -
title -
category -
maxEnrollments -
location -
startTime -
endTime -
monday -
tuesday -
wednesday -
thursday -
friday -
saturday -
sunday -
Returns:

createUser

public User createUser(String userUid,
                       String displayName,
                       String sortName,
                       String displayId)
Creates a new user.

Parameters:
userUid -
displayName -
sortName -
displayId -
Returns:

findUser

public User findUser(String userUid)
Finds a user by their uuid.

Parameters:
userUid -
Returns:

getAllSiteMemberships

public List getAllSiteMemberships(String userUid)
Gets all of the site-scoped ParticipationRecords for a user. This can be a mix of enrollments and instructor or TA records, since a user can play different roles in different sites.

Parameters:
userUid -
Returns:

getAllSectionMemberships

public Set getAllSectionMemberships(String userUid,
                                    String siteContext)
Gets all of the section-scoped ParticipationRecords for a user in a given site. The returned Set should contain either enrollment, instructor, or TA records, since a user can not play different roles in the sections belonging to a single site.

Parameters:
userUid -
siteContext -
Returns:

addSiteMembership

public ParticipationRecord addSiteMembership(String userUid,
                                             String siteContext,
                                             Role role)
Adds a user to a site (or "Course").

Parameters:
userUid -
siteContext -
role -
Returns:

removeSiteMembership

public void removeSiteMembership(String userUid,
                                 String siteContext)
Removes a user from a site (or "Course").

Parameters:
userUid -
siteContext -

addSectionMembership

public ParticipationRecord addSectionMembership(String userUid,
                                                String sectionUuid,
                                                Role role)
Adds a user to a section under the given role.

Parameters:
userUid -
sectionUuid -
role -
Returns:

removeSectionMembership

public void removeSectionMembership(String userUid,
                                    String sectionUuid)
Removes a user from membership in a section.

Parameters:
userUid -
sectionUuid -