001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-api/src/java/org/sakaiproject/section/api/CourseManager.java $
003: * $Id: CourseManager.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.section.api;
021:
022: import org.sakaiproject.section.api.coursemanagement.Course;
023: import org.sakaiproject.section.api.coursemanagement.ParticipationRecord;
024: import org.sakaiproject.section.api.coursemanagement.User;
025:
026: /**
027: * Provides methods for adding a top-level course object, to which CourseSections
028: * can be associated, and for associating users with the course.
029: *
030: * The membership-related methods are intended for use in testing the standalone
031: * application only. In sakai, we will can use this as an external interface
032: * that allows for Course creation, but does not alter membership in the course.
033: *
034: * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
035: *
036: */
037: public interface CourseManager {
038:
039: /**
040: * Creates a new Course object for this site.
041: *
042: * @param siteContext The site context
043: * @param title The title of the course or site
044: * @param selfRegAllowed Whether to allow students to register for sections in this course.
045: * @param selfSwitchingAllowed Whether to allow students to switch sections in this course.
046: * @param externallyManaged Whether to flag this course as externally manager
047: * (read-only to the app).
048: *
049: * @return The newly created Course object.
050: */
051: public Course createCourse(String siteContext, String title,
052: boolean selfRegAllowed, boolean selfSwitchingAllowed,
053: boolean externallyManaged);
054:
055: /**
056: * Checks to see whether a course exists in this site.
057: *
058: * @param siteContext The site context
059: * @return
060: */
061: public boolean courseExists(String siteContext);
062:
063: /**
064: * Adds a student to a course. Useful for dataloading in standalone mode.
065: *
066: * @param user
067: * @param course
068: * @return
069: */
070: public ParticipationRecord addEnrollment(User user, Course course);
071:
072: /**
073: * Adds a TA to a course. Useful for dataloading in standalone mode.
074: *
075: * @param user
076: * @param course
077: * @return
078: */
079: public ParticipationRecord addTA(User user, Course course);
080:
081: /**
082: * Adds an instructor to a course. Useful for dataloading in standalone mode.
083: *
084: * @param user
085: * @param course
086: * @return
087: */
088: public ParticipationRecord addInstructor(User user, Course course);
089:
090: /**
091: * Removes a user from the course.
092: *
093: * @param userUid
094: * @param course
095: */
096: public void removeCourseMembership(String userUid, Course course);
097:
098: /**
099: * Removes any section membership record from a site that belongs to a user
100: * who is no longer associated with the site.
101: *
102: * @param siteContext The site context from which to remove the orphaned records
103: * @param userUids The current set of user ids that are a member of the site.
104: * Must not be null or empty.
105: */
106: public void removeOrphans(String siteContext);
107:
108: }
|