private void setCurrentStatus(AcademicSession session) { List<AcademicSession> currentSessions = cmService.getCurrentAcademicSessions(); List<String> currentTerms = new ArrayList<String>(); // initialize the array with the current sessions for (AcademicSession s : currentSessions) { currentTerms.add(s.getEid()); } // add this session if its end date is after today if (session.getEndDate().after(new Date())) { if (!currentTerms.contains(session.getEid().toString())) { currentTerms.add(session.getEid()); } // otherwise remove this session } else { if (currentTerms.contains(session.getEid().toString())) { currentTerms.remove(session.getEid().toString()); } } cmAdmin.setCurrentAcademicSessions(currentTerms); } }
private void setCurrentStatus(AcademicSession session) { List<AcademicSession> currentSessions = cmService.getCurrentAcademicSessions(); List<String> currentTerms = new ArrayList<String>(); // initialize the array with the current sessions for (AcademicSession s : currentSessions) { currentTerms.add(s.getEid()); } // add this session if its end date is after today if (session.getEndDate().after(new Date())) { if (!currentTerms.contains(session.getEid().toString())) { currentTerms.add(session.getEid()); } // otherwise remove this session } else { if (currentTerms.contains(session.getEid().toString())) { currentTerms.remove(session.getEid().toString()); } } cmAdmin.setCurrentAcademicSessions(currentTerms); } }
for (AcademicSession academicSession : academicSessions) { if (academicSession.getEndDate().getTime() < expirationDate.getTime()) {
/** * For crosslisted sites, the sections may belong to multiple academic sessions which have differing end dates. * If we find a date that isn't before the grace period, this site is not supposed to be removed / unpublished. * @return true if this site has an academic session with an end date after the expiration date */ private boolean isSiteCrosslistedWithEndDateAfterExpirationDate(String siteId, Date expirationDate) { String siteReference = siteService.siteReference(siteId); Set<String> providerIds = authzGroupService.getProviderIds(siteReference); for (String providerId : providerIds) { Section section = courseManagementService.getSection(providerId); if (section != null) { CourseOffering offering = courseManagementService.getCourseOffering(section.getCourseOfferingEid()); if (offering != null) { AcademicSession session = offering.getAcademicSession(); if (session != null) { Date endDate = session.getEndDate(); if (endDate != null && endDate.getTime() >= expirationDate.getTime()) { return true; } } } } } return false; }
publishDate = new Date(academicSession.getStartDate().getTime() - numDaysBeforeTermStarts * ONE_DAY_IN_MS); if (publishDate.getTime() < today.getTime() && today.getTime() < academicSession.getEndDate().getTime()) {
CourseOffering co1 = cmAdmin.createCourseOffering(CO1_PREFIX + as.getEid(), CC1, "Sample course offering #1, " + as.getEid(), "open", as.getEid(), CC1, as.getStartDate(), as.getEndDate()); CourseOffering co2 = cmAdmin.createCourseOffering(CO2_PREFIX + as.getEid(), CC2, "Sample course offering #2, " + as.getEid(), "open", as.getEid(), CC2, as.getStartDate(), as.getEndDate());