public Section getSection(String sectionEid) throws IdNotFoundException { for(Iterator implIter = implList.iterator(); implIter.hasNext();) { CourseManagementService cm = (CourseManagementService)implIter.next(); try { log.debug("{} found section {}", cm, sectionEid); return cm.getSection(sectionEid); } catch (IdNotFoundException ide) { if(log.isDebugEnabled()) log.debug(cm + " could not locate section " + sectionEid); } } throw new IdNotFoundException(sectionEid, Section.class.getName()); }
try Section section = cms.getSection(providerCourseEid);
Section section; try { section = cmService.getSection(sectionEid); } catch (IdNotFoundException e) { if (log.isWarnEnabled()) log.warn("Unable to find CM section " + sectionEid);
public void processRow(String[] data, ProcessorState state) throws Exception { log.debug("Reconciling section {}", data[0]); if (cmService.isSectionDefined(data[0])) { updateSection(cmService.getSection(data[0]), data); } else { addSection(data); } }
public void processRow(String[] data, ProcessorState state) throws Exception { log.debug("Reconciling section {}", data[0]); if (cmService.isSectionDefined(data[0])) { updateSection(cmService.getSection(data[0]), data); } else { addSection(data); } }
section = updateSection(cmService.getSection(eid), element); } else { section = addSection(element);
public void postProcess(ProcessorState state) throws Exception { Map<String, List<CourseMeeting>> meetings = getMeetings(state); log.debug("postProcess() " + meetings.size() + " sections to inspect"); for (String sectionEid : meetings.keySet()) { Section section = null; if (cmService.isSectionDefined(sectionEid)) { section = cmService.getSection(sectionEid); } else { log.error("can't add meeting no section with eid of {} found", sectionEid); continue; } List<CourseMeeting> currentMeetings = meetings.get(sectionEid); // clear existing sections cmAdmin.removeAllSectionMeetings(sectionEid); section.setMeetings(new HashSet<>()); for (CourseMeeting courseMeeting : currentMeetings) { Meeting meeting = cmAdmin.newSectionMeeting(sectionEid, courseMeeting.getLocation(), null, null, courseMeeting.getNotes()); section.getMeetings().add(meeting); } cmAdmin.updateSection(section); } }
public void postProcess(ProcessorState state) throws Exception { Map<String, List<CourseMeeting>> meetings = getMeetings(state); log.debug("postProcess() " + meetings.size() + " sections to inspect"); for (String sectionEid : meetings.keySet()) { Section section = null; if (cmService.isSectionDefined(sectionEid)) { section = cmService.getSection(sectionEid); } else { log.error("can't add meeting no section with eid of {} found", sectionEid); continue; } List<CourseMeeting> currentMeetings = meetings.get(sectionEid); // clear existing sections cmAdmin.removeAllSectionMeetings(sectionEid); section.setMeetings(new HashSet<>()); for (CourseMeeting courseMeeting : currentMeetings) { Meeting meeting = cmAdmin.newSectionMeeting(sectionEid, courseMeeting.getLocation(), null, null, courseMeeting.getNotes()); section.getMeetings().add(meeting); } cmAdmin.updateSection(section); } }
/** * 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; }
Section section = cms.getSection( sectionID ); if( portalUseSecTitlePreferredCategory.equals( section.getCategory() ) )
public Section updateSection(Section section, String[] data) { log.debug("Updating Section {}", section.getEid()); section.setTitle(data[1]); section.setDescription(data[2]); section.setCategory(data[3]); if (StringUtils.isNotBlank(data[4]) && cmService.isSectionDefined(data[4])) { section.setParent(cmService.getSection(data[4])); } // Note: There's no way to change the course offering. This makes sense, though. if (cmService.isEnrollmentSetDefined(data[5])) { section.setEnrollmentSet(cmService.getEnrollmentSet(data[5])); } cmAdmin.updateSection(section); return section; }
public Section updateSection(Section section, String[] data) { log.debug("Updating Section {}", section.getEid()); section.setTitle(data[1]); section.setDescription(data[2]); section.setCategory(data[3]); if (StringUtils.isNotBlank(data[4]) && cmService.isSectionDefined(data[4])) { section.setParent(cmService.getSection(data[4])); } // Note: There's no way to change the course offering. This makes sense, though. if (cmService.isEnrollmentSetDefined(data[5])) { section.setEnrollmentSet(cmService.getEnrollmentSet(data[5])); } cmAdmin.updateSection(section); return section; }
protected Section updateSection(Section section, Element element) { if(log.isDebugEnabled()) log.debug("Updating Section + " + section.getEid()); section.setTitle(element.getChildText("title")); section.setDescription(element.getChildText("description")); section.setCategory(element.getChildText("category")); if(cmService.isSectionDefined(element.getChildText("parent-section-eid"))) { section.setParent(cmService.getSection(element.getChildText("parent-section-eid"))); } // Note: There's no way to change the course offering. This makes sense, though. if(cmService.isEnrollmentSetDefined(element.getChildText("enrollment-set-eid"))) { section.setEnrollmentSet(cmService.getEnrollmentSet(element.getChildText("enrollment-set-eid"))); } cmAdmin.updateSection(section); return section; }