001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-impl/integration-support/src/java/org/sakaiproject/component/section/support/IntegrationSupport.java $
003: * $Id: IntegrationSupport.java 18134 2006-11-14 18:59:25Z jholtzman@berkeley.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Regents of the University of California and The Regents of the University of Michigan
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.component.section.support;
021:
022: import java.sql.Time;
023: import java.util.List;
024: import java.util.Set;
025:
026: import org.sakaiproject.section.api.coursemanagement.Course;
027: import org.sakaiproject.section.api.coursemanagement.CourseSection;
028: import org.sakaiproject.section.api.coursemanagement.ParticipationRecord;
029: import org.sakaiproject.section.api.coursemanagement.User;
030: import org.sakaiproject.section.api.facade.Role;
031:
032: /**
033: * Provides methods for manipulating users, courses, sections, and memberships.
034: * Implementations do not provide any authorization, so they are to be used for
035: * integration testing only.
036: *
037: * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
038: *
039: */
040: public interface IntegrationSupport {
041: /**
042: * Creates a new course.
043: *
044: * @param siteContext
045: * @param title
046: * @param externallyManaged
047: * @param selfRegistrationAllowed
048: * @param selfSwitchingAllowed
049: * @return
050: */
051: public Course createCourse(String siteContext, String title,
052: boolean externallyManaged, boolean selfRegistrationAllowed,
053: boolean selfSwitchingAllowed);
054:
055: /**
056: * Creates a new section.
057: *
058: * @param courseUuid
059: * @param title
060: * @param category
061: * @param maxEnrollments
062: * @param location
063: * @param startTime
064: * @param endTime
065: * @param monday
066: * @param tuesday
067: * @param wednesday
068: * @param thursday
069: * @param friday
070: * @param saturday
071: * @param sunday
072: * @return
073: */
074: public CourseSection createSection(String courseUuid, String title,
075: String category, Integer maxEnrollments, String location,
076: Time startTime, Time endTime, boolean monday,
077: boolean tuesday, boolean wednesday, boolean thursday,
078: boolean friday, boolean saturday, boolean sunday);
079:
080: /**
081: * Creates a new user.
082: *
083: * @param userUid
084: * @param displayName
085: * @param sortName
086: * @param displayId
087: * @return
088: */
089: public User createUser(String userUid, String displayName,
090: String sortName, String displayId);
091:
092: /**
093: * Finds a user by their uuid.
094: *
095: * @param userUid
096: * @return
097: */
098: public User findUser(String userUid);
099:
100: /**
101: * Gets all of the site-scoped ParticipationRecords for a user. This can be
102: * a mix of enrollments and instructor or TA records, since a user can play
103: * different roles in different sites.
104: *
105: * @param userUid
106: * @return
107: */
108: public List getAllSiteMemberships(String userUid);
109:
110: /**
111: * Gets all of the section-scoped ParticipationRecords for a user in a
112: * given site. The returned Set should contain either enrollment, instructor,
113: * or TA records, since a user can not play different roles in the sections
114: * belonging to a single site.
115: *
116: * @param userUid
117: * @param siteContext
118: * @return
119: */
120: public Set getAllSectionMemberships(String userUid,
121: String siteContext);
122:
123: /**
124: * Adds a user to a site (or "Course").
125: *
126: * @param userUid
127: * @param siteContext
128: * @param role
129: * @return
130: */
131: public ParticipationRecord addSiteMembership(String userUid,
132: String siteContext, Role role);
133:
134: /**
135: * Removes a user from a site (or "Course").
136: *
137: * @param userUid
138: * @param siteContext
139: */
140: public void removeSiteMembership(String userUid, String siteContext);
141:
142: /**
143: * Adds a user to a section under the given role.
144: *
145: * @param userUid
146: * @param sectionUuid
147: * @param role
148: * @return
149: */
150: public ParticipationRecord addSectionMembership(String userUid,
151: String sectionUuid, Role role);
152:
153: /**
154: * Removes a user from membership in a section.
155: *
156: * @param userUid
157: * @param sectionUuid
158: */
159: public void removeSectionMembership(String userUid,
160: String sectionUuid);
161:
162: }
|