001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/course-management/tags/sakai_2-4-1/cm-api/api/src/java/org/sakaiproject/coursemanagement/api/CourseManagementAdministration.java $
003: * $Id: CourseManagementAdministration.java 20714 2007-01-26 19:47:36Z jholtzman@berkeley.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2006 The Sakai Foundation.
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.coursemanagement.api;
021:
022: import java.sql.Time;
023: import java.util.Date;
024: import java.util.Set;
025:
026: import org.sakaiproject.coursemanagement.api.exception.IdExistsException;
027: import org.sakaiproject.coursemanagement.api.exception.IdNotFoundException;
028:
029: /**
030: * A service that provides for the administration of enterprise-defined course data.
031: * This service is typically not used inside Sakai, and should not be exposed until
032: * appropriate permission and reconciliation issues are solved.
033: *
034: * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
035: */
036: public interface CourseManagementAdministration {
037:
038: /**
039: * Creates a new AcademicSession.
040: *
041: * @param eid
042: * @param title
043: * @param description
044: * @param startDate
045: * @param endDate
046: * @throws IdExistsException
047: */
048: public AcademicSession createAcademicSession(String eid,
049: String title, String description, Date startDate,
050: Date endDate) throws IdExistsException;
051:
052: /**
053: * Updates an existing AcademicSession.
054: *
055: * @param academicSession The AcademicSession to be updated
056: */
057: public void updateAcademicSession(AcademicSession academicSession);
058:
059: /**
060: * Removes an academic session and all CourseOfferings associated with this
061: * academic session.
062: *
063: * @param eid The enterprise id of the academic session
064: */
065: public void removeAcademicSession(String eid);
066:
067: /**
068: * Creates a new CourseSet.
069: *
070: * @param eid
071: * @param title
072: * @param description
073: * @param category
074: * @param parentCourseSetEid The parent CourseSet's eid, or null if none.
075: * @throws IdExistsException
076: */
077: public CourseSet createCourseSet(String eid, String title,
078: String description, String category,
079: String parentCourseSetEid) throws IdExistsException;
080:
081: /**
082: * Updates an existing CourseSet.
083: *
084: * @param courseSet
085: */
086: public void updateCourseSet(CourseSet courseSet);
087:
088: /**
089: * Removes a course set and any memberships in the course set.
090: *
091: * @param eid The enterprise id of the course set
092: */
093: public void removeCourseSet(String eid);
094:
095: /**
096: * Creates a new CanonicalCourse.
097: *
098: * @param eid
099: * @param title
100: * @param description
101: * @throws IdExistsException
102: */
103: public CanonicalCourse createCanonicalCourse(String eid,
104: String title, String description) throws IdExistsException;
105:
106: /**
107: * Updates an existing CanonicalCourse.
108: *
109: * @param canonicalCourse
110: */
111: public void updateCanonicalCourse(CanonicalCourse canonicalCourse);
112:
113: /**
114: * Adds a CanonicalCourse to a CourseSet.
115: *
116: * @param courseSetEid
117: * @param canonicalCourseEid
118: * @throws IdNotFoundException
119: */
120: public void addCanonicalCourseToCourseSet(String courseSetEid,
121: String canonicalCourseEid) throws IdNotFoundException;
122:
123: /**
124: * Removes a CanonicalCourse from a CourseSet.
125: *
126: * @param courseSetEid
127: * @param canonicalCourseEid
128: * @return Whether the CanonicalCourse was a member of the CourseSet and
129: * was successfully removed.
130: */
131: public boolean removeCanonicalCourseFromCourseSet(
132: String courseSetEid, String canonicalCourseEid);
133:
134: /**
135: * Creates an equivalency (cross listing) between CanonicalCourses
136: *
137: * @param canonicalCourses
138: */
139: public void setEquivalentCanonicalCourses(Set canonicalCourses);
140:
141: /**
142: * Removes a CanonicalCourse from its set of equivalent CanonicalCourses, if it is
143: * a member of such a set.
144: *
145: * @param canonicalCourse
146: * @return Whether the equivalency existed and was removed.
147: */
148: public boolean removeEquivalency(CanonicalCourse canonicalCourse);
149:
150: /**
151: * Removes a canonical course and any course offerings associated with this
152: * canonical course.
153: *
154: * @param eid The enterprise id of the canonical course
155: */
156: public void removeCanonicalCourse(String eid);
157:
158: /**
159: * Creates a new CourseOffering.
160: *
161: * @param eid
162: * @param title
163: * @param description
164: * @param academicSessionEid
165: * @param canonicalCourseEid
166: * @param startDate
167: * @param endDate
168: * @throws IdExistsException
169: */
170: public CourseOffering createCourseOffering(String eid,
171: String title, String description, String status,
172: String academicSessionEid, String canonicalCourseEid,
173: Date startDate, Date endDate) throws IdExistsException;
174:
175: /**
176: * Updates an existing CourseOffering.
177: *
178: * @param courseOffering
179: */
180: public void updateCourseOffering(CourseOffering courseOffering);
181:
182: /**
183: * Creates an equivalency (cross listing) betweencourseOfferings
184: *
185: * @param courseOfferings
186: */
187: public void setEquivalentCourseOfferings(Set courseOfferings);
188:
189: /**
190: * Removes a CourseOffering from its set of equivalent CourseOfferings, if it is
191: * a member of such a set.
192: *
193: * @param courseOffering
194: * @return Whether the equivalency existed and was removed.
195: */
196: public boolean removeEquivalency(CourseOffering courseOffering);
197:
198: /**
199: * Adds a CourseOffering to a CourseSet.
200: *
201: * @param courseSetEid
202: * @param courseOfferingEid
203: */
204: public void addCourseOfferingToCourseSet(String courseSetEid,
205: String courseOfferingEid);
206:
207: /**
208: * Removes a CourseOffering from a CourseSet.
209: *
210: * @param courseSetEid
211: * @param courseOfferingEid
212: * @return Whether the CourseOffering was in the CourseSet and was removed.
213: */
214: public boolean removeCourseOfferingFromCourseSet(
215: String courseSetEid, String courseOfferingEid);
216:
217: /**
218: * Removes a course offering, any memberships in the course offering, as well
219: * as sections and enrollment sets that belong to this course offering.
220: *
221: * @param eid The enterprise id of the course offering
222: */
223: public void removeCourseOffering(String eid);
224:
225: /**
226: * Creates a new EnrollmentSet.
227: *
228: * @param eid
229: * @param title
230: * @param description
231: * @param category
232: * @param defaultEnrollmentCredits
233: * @param courseOfferingEid
234: * @param officialInstructors
235: * @throws IdExistsException
236: */
237: public EnrollmentSet createEnrollmentSet(String eid, String title,
238: String description, String category,
239: String defaultEnrollmentCredits, String courseOfferingEid,
240: Set officialInstructors) throws IdExistsException;
241:
242: /**
243: * Updates an existing EnrollmentSet.
244: *
245: * @param enrollmentSet
246: */
247: public void updateEnrollmentSet(EnrollmentSet enrollmentSet);
248:
249: /**
250: * Removes an enrollment set and all associated enrollments.
251: *
252: * @param eid The enterprise id of the enrollment set
253: */
254: public void removeEnrollmentSet(String eid);
255:
256: /**
257: * Adds an Enrollment to an EnrollmentSet. If the user is already enrolled in the
258: * EnrollmentSet, the Enrollment record is updated for the user.
259: *
260: * @param userId
261: * @param enrollmentSetEid
262: * @param enrollmentStatus
263: * @param credits
264: * @param gradingScheme
265: */
266: public Enrollment addOrUpdateEnrollment(String userId,
267: String enrollmentSetEid, String enrollmentStatus,
268: String credits, String gradingScheme);
269:
270: /**
271: * Removes an Enrollment from an EnrollmentSet by setting the Enrollment to
272: * dropped=true.
273: *
274: * @param userId
275: * @param enrollmentSetEid
276: * @return Whether the enrollment existed and was removed.
277: */
278: public boolean removeEnrollment(String userId,
279: String enrollmentSetEid);
280:
281: /**
282: * Creates a new Section.
283: *
284: * @param eid
285: * @param title
286: * @param description
287: * @param category
288: * @param parentSectionEid
289: * @param courseOfferingEid
290: * @param enrollmentSetEid
291: * @throws IdExistsException
292: */
293: public Section createSection(String eid, String title,
294: String description, String category,
295: String parentSectionEid, String courseOfferingEid,
296: String enrollmentSetEid) throws IdExistsException;
297:
298: public SectionCategory addSectionCategory(String categoryCode,
299: String categoryDescription);
300:
301: /**
302: * Creates a new meeting instance. The meeting must be associated with a section
303: * and the section must be updated for the meeting to be persisted.
304: *
305: * @param location The location of the meeting
306: * @param startTime The time that the section starts
307: * @param startTime The time that the section finishes
308: * @param notes Optional notes about this meeting
309: */
310: public Meeting newSectionMeeting(String sectionEid,
311: String location, Time startTime, Time finishTime,
312: String notes);
313:
314: /**
315: * Updates an existing Section.
316: *
317: * @param section
318: */
319: public void updateSection(Section section);
320:
321: /**
322: * Removes a section and any memberships in the section. If an enrollment set
323: * is attached to this section, it must be removed via removeEnrollmentSet
324: * before removing the section.
325: *
326: * @param eid The enterprise id of the section
327: */
328: public void removeSection(String eid);
329:
330: /**
331: * Adds a user to a CourseSet. If the user is already a member of the CourseSet,
332: * update the user's role.
333: *
334: * @param userId
335: * @param role
336: * @param courseSetEid
337: * @param status
338: * @throws IdNotFoundException If the CourseSet can not be found
339: */
340: public Membership addOrUpdateCourseSetMembership(String userId,
341: String role, String courseSetEid, String status)
342: throws IdNotFoundException;
343:
344: /**
345: * Removes a user from a CourseSet.
346: *
347: * @param userId
348: * @param courseSetEid
349: * @return Whether the user was a member of the CourseSet and was removed.
350: */
351: public boolean removeCourseSetMembership(String userId,
352: String courseSetEid);
353:
354: /**
355: * Adds a user to a CourseOffering. If the user is already a member of the CourseOffering,
356: * update the user's role.
357: *
358: * @param userId
359: * @param role
360: * @param courseOfferingEid
361: * @param status
362: */
363: public Membership addOrUpdateCourseOfferingMembership(
364: String userId, String role, String courseOfferingEid,
365: String status);
366:
367: /**
368: * Removes a user from a CourseOffering.
369: *
370: * @param userId
371: * @param courseOfferingEid
372: * @return Whether the user was a member of the CourseOffering and was
373: * removed.
374: */
375: public boolean removeCourseOfferingMembership(String userId,
376: String courseOfferingEid);
377:
378: /**
379: * Adds a user to a Section. If the user is already a member of the Section,
380: * update the user's role.
381: *
382: * @param userId
383: * @param role
384: * @param sectionEid
385: * @param status
386: */
387: public Membership addOrUpdateSectionMembership(String userId,
388: String role, String sectionEid, String status);
389:
390: /**
391: * Removes a user from a Section.
392: *
393: * @param userId
394: * @param sectionEid
395: * @return Whether the user was a member of the Section and was removed.
396: */
397: public boolean removeSectionMembership(String userId,
398: String sectionEid);
399: }
|