public boolean groupExists(String groupId) { if (cmService.isSectionDefined(groupId)) return true; return false; } }
public boolean isSectionDefined(String eid) { for(Iterator implIter = implList.iterator(); implIter.hasNext();) { CourseManagementService cm = (CourseManagementService)implIter.next(); try { // If any implementation says that the object exists, it exists! if(cm.isSectionDefined(eid)) { return true; } } catch (UnsupportedOperationException uso) { if(log.isDebugEnabled()) log.debug(cm + " doesn't know whether section "+ eid + " exists"); } } return false; }
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); } }
public void postProcess(ProcessorState state) throws Exception { Map<String, List<String[]>> sectionMembers = getSectionMembers(state); for (String sectionEid : sectionMembers.keySet()) { if (!cmService.isSectionDefined(sectionEid)) { log.error("can't sync section memberships, no section with eid of {} found", sectionEid); continue;
public void postProcess(ProcessorState state) throws Exception { Map<String, List<String[]>> sectionMembers = getSectionMembers(state); for (String sectionEid : sectionMembers.keySet()) { if (!cmService.isSectionDefined(sectionEid)) { log.error("can't sync section memberships, no section with eid of {} found", sectionEid); continue;
if(cmService.isSectionDefined(eid)) { section = updateSection(cmService.getSection(eid), element); } else {
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); } }
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; }