public void processRow(String[] data, ProcessorState state) throws Exception { log.debug("Reconciling course set {}", data[0]); if (cmService.isCourseSetDefined(data[0])) { CourseSet courseSet = cmService.getCourseSet(data[0]); log.debug("Updating CourseSet {}", courseSet.getEid()); courseSet.setTitle(data[1]); courseSet.setDescription(data[2]); courseSet.setCategory(data[3]); if (StringUtils.isNotBlank(data[4]) && cmService.isCourseSetDefined(data[4])) { CourseSet parent = cmService.getCourseSet(data[4]); courseSet.setParent(parent); } cmAdmin.updateCourseSet(courseSet); } else { String eid = data[0]; log.debug("Adding CourseSet + " + eid); cmAdmin.createCourseSet(data[0], data[1], data[2], data[3], StringUtils.defaultIfEmpty(data[4], null)); } }
public void processRow(String[] data, ProcessorState state) throws Exception { log.debug("Reconciling course set {}", data[0]); if (cmService.isCourseSetDefined(data[0])) { CourseSet courseSet = cmService.getCourseSet(data[0]); log.debug("Updating CourseSet {}", courseSet.getEid()); courseSet.setTitle(data[1]); courseSet.setDescription(data[2]); courseSet.setCategory(data[3]); if (StringUtils.isNotBlank(data[4]) && cmService.isCourseSetDefined(data[4])) { CourseSet parent = cmService.getCourseSet(data[4]); courseSet.setParent(parent); } cmAdmin.updateCourseSet(courseSet); } else { String eid = data[0]; log.debug("Adding CourseSet + " + eid); cmAdmin.createCourseSet(data[0], data[1], data[2], data[3], StringUtils.defaultIfEmpty(data[4], null)); } }
protected CourseSet updateCourseSet(CourseSet courseSet, Element element) { if(log.isDebugEnabled()) log.debug("Updating CourseSet + " + courseSet.getEid()); courseSet.setTitle(element.getChildText("title")); courseSet.setDescription(element.getChildText("description")); courseSet.setCategory(element.getChildText("category")); String parentEid = element.getChildText("parent-course-set"); if(cmService.isCourseSetDefined(parentEid)) { CourseSet parent = cmService.getCourseSet(parentEid); courseSet.setParent(parent); } cmAdmin.updateCourseSet(courseSet); return courseSet; }