Search in sources :

Example 1 with ChecklistManager

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;
}
Also used : ChecklistManager(de.bps.olat.modules.cl.ChecklistManager) Checklist(de.bps.olat.modules.cl.Checklist) CourseNode(org.olat.course.nodes.CourseNode) AbstractAccessableCourseNode(org.olat.course.nodes.AbstractAccessableCourseNode)

Example 2 with ChecklistManager

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());
}
Also used : XStream(com.thoughtworks.xstream.XStream) ChecklistManager(de.bps.olat.modules.cl.ChecklistManager) Checklist(de.bps.olat.modules.cl.Checklist)

Example 3 with ChecklistManager

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());
}
Also used : XStream(com.thoughtworks.xstream.XStream) ChecklistManager(de.bps.olat.modules.cl.ChecklistManager) Checklist(de.bps.olat.modules.cl.Checklist)

Example 4 with ChecklistManager

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;
}
Also used : ChecklistManager(de.bps.olat.modules.cl.ChecklistManager) Checklist(de.bps.olat.modules.cl.Checklist) CourseNode(org.olat.course.nodes.CourseNode) AbstractAccessableCourseNode(org.olat.course.nodes.AbstractAccessableCourseNode)

Aggregations

Checklist (de.bps.olat.modules.cl.Checklist)4 ChecklistManager (de.bps.olat.modules.cl.ChecklistManager)4 XStream (com.thoughtworks.xstream.XStream)2 AbstractAccessableCourseNode (org.olat.course.nodes.AbstractAccessableCourseNode)2 CourseNode (org.olat.course.nodes.CourseNode)2