use of de.bps.olat.modules.cl.ChecklistManager in project OpenOLAT by OpenOLAT.
the class ChecklistCourseNode method createInstanceForCopy.
@Override
public CourseNode createInstanceForCopy(boolean isNewTitle, ICourse course, Identity author) {
CourseNode copyInstance = super.createInstanceForCopy(isNewTitle, course, author);
ChecklistManager cm = ChecklistManager.getInstance();
// load checklist
Checklist checklist = cm.loadChecklist((Checklist) getModuleConfiguration().get(ChecklistCourseNode.CONF_CHECKLIST));
// remove old config
copyInstance.getModuleConfiguration().remove(ChecklistCourseNode.CONF_CHECKLIST);
// create new checklist with same settings and save to db
Checklist initialChecklist = cm.copyChecklist(checklist);
// set to config
copyInstance.getModuleConfiguration().set(CONF_CHECKLIST_COPY, initialChecklist);
return copyInstance;
}
use of de.bps.olat.modules.cl.ChecklistManager in project openolat by klemens.
the class ChecklistCourseNode method exportNode.
@Override
public void exportNode(File exportDirectory, ICourse course) {
XStream xstream = XStreamHelper.createXStreamInstance();
ChecklistManager cm = ChecklistManager.getInstance();
Checklist checklist = loadOrCreateChecklist(course.getCourseEnvironment().getCoursePropertyManager());
Checklist copy = cm.copyChecklistInRAM(checklist);
String exportContent = xstream.toXML(copy);
ExportUtil.writeContentToFile(getExportFilename(), exportContent, exportDirectory, WebappHelper.getDefaultCharset());
}
use of de.bps.olat.modules.cl.ChecklistManager in project OpenOLAT by OpenOLAT.
the class ChecklistCourseNode method exportNode.
@Override
public void exportNode(File exportDirectory, ICourse course) {
XStream xstream = XStreamHelper.createXStreamInstance();
ChecklistManager cm = ChecklistManager.getInstance();
Checklist checklist = loadOrCreateChecklist(course.getCourseEnvironment().getCoursePropertyManager());
Checklist copy = cm.copyChecklistInRAM(checklist);
String exportContent = xstream.toXML(copy);
ExportUtil.writeContentToFile(getExportFilename(), exportContent, exportDirectory, WebappHelper.getDefaultCharset());
}
use of de.bps.olat.modules.cl.ChecklistManager in project openolat by klemens.
the class ChecklistCourseNode method createInstanceForCopy.
@Override
public CourseNode createInstanceForCopy(boolean isNewTitle, ICourse course, Identity author) {
CourseNode copyInstance = super.createInstanceForCopy(isNewTitle, course, author);
ChecklistManager cm = ChecklistManager.getInstance();
// load checklist
Checklist checklist = cm.loadChecklist((Checklist) getModuleConfiguration().get(ChecklistCourseNode.CONF_CHECKLIST));
// remove old config
copyInstance.getModuleConfiguration().remove(ChecklistCourseNode.CONF_CHECKLIST);
// create new checklist with same settings and save to db
Checklist initialChecklist = cm.copyChecklist(checklist);
// set to config
copyInstance.getModuleConfiguration().set(CONF_CHECKLIST_COPY, initialChecklist);
return copyInstance;
}
Aggregations