public void updateAcademicSession(AcademicSession session, String[] data) { log.debug("Updating AcademicSession {}", session.getEid()); session.setTitle(data[1]); session.setDescription(data[2]); session.setStartDate(getDate(data[3])); session.setEndDate(getDate(data[4])); cmAdmin.updateAcademicSession(session); setCurrentStatus(session); }
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); } }
publishDate = new Date(academicSession.getStartDate().getTime() - numDaysBeforeTermStarts * ONE_DAY_IN_MS); if (publishDate.getTime() < today.getTime() && today.getTime() < academicSession.getEndDate().getTime()) { propertyCriteria.put("term_eid", academicSession.getEid());
for(Iterator iter = existing.iterator(); iter.hasNext();) { AcademicSession as = (AcademicSession)iter.next(); academicSessionMap.put(as.getEid(), as);
/** * 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; }
Collection<AcademicSession> sessions = courseManagementService.getAcademicSessions(); for (AcademicSession s: sessions) { String title = s.getTitle();
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()); String co1Eid = CO1_PREFIX + as.getEid(); String lec1Eid = co1Eid; Section lec1 = cmAdmin.createSection(lec1Eid, lec1Eid, lec1Eid + " Lecture", String co2Eid = CO2_PREFIX + as.getEid(); String lec2Eid = co2Eid; Section lec2 = cmAdmin.createSection(lec2Eid, lec2Eid, lec2Eid + " Lecture", loadDiscussionSection("Discussion 1 " + CC1, as.getEid(), co1Eid, discussionCategory.getCategoryCode(), null, null, null, new boolean[]{false, false, false, false, false, false, false}, studentMemberCount, incrementStudentCount()); loadDiscussionSection("Discussion 2 " + CC1, as.getEid(), co1Eid, discussionCategory.getCategoryCode(), "B Building 202", getTime("10:00" + AMPM[0]), getTime("11:30" + AMPM[0]), new boolean[]{false, true, false, true, false, false, false}, studentMemberCount, incrementStudentCount()); loadDiscussionSection("Discussion 3 " + CC1, as.getEid(), co1Eid, discussionCategory.getCategoryCode(), "B Hall 11", getTime("9:00" + AMPM[0]), getTime("10:30" + AMPM[0]), new boolean[]{false, true, false, true, false, false, false}, studentMemberCount, incrementStudentCount());
public void updateAcademicSession(AcademicSession session, String[] data) { log.debug("Updating AcademicSession {}", session.getEid()); session.setTitle(data[1]); session.setDescription(data[2]); session.setStartDate(getDate(data[3])); session.setEndDate(getDate(data[4])); cmAdmin.updateAcademicSession(session); setCurrentStatus(session); }
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); } }
protected void updateAcademicSession(AcademicSession session, Element element) { if(log.isDebugEnabled()) log.debug("Updating AcademicSession + " + session.getEid()); session.setTitle(element.getChildText("title")); session.setDescription(element.getChildText("description")); session.setStartDate(getDate(element.getChildText("start-date"))); session.setEndDate(getDate(element.getChildText("end-date"))); cmAdmin.updateAcademicSession(session); }
for (AcademicSession academicSession : academicSessions) { if (academicSession.getEndDate().getTime() < expirationDate.getTime()) { propertyCriteria.put("term_eid", academicSession.getEid()); numSitesRemoved += removeCourseSitesWithCriteria(action, propertyCriteria, expirationDate);