Skip to content
Snippets Groups Projects
Commit ae974b42 authored by uhensler's avatar uhensler
Browse files

OO-4207: Apply learning path migration rules to run structure as well

parent cbd1c1d6
No related branches found
No related tags found
No related merge requests found
...@@ -117,8 +117,10 @@ public class LearningPathServiceImpl implements LearningPathService { ...@@ -117,8 +117,10 @@ public class LearningPathServiceImpl implements LearningPathService {
TreeVisitor tv = new TreeVisitor(new PostMigrationVisitor(registry), course.getEditorTreeModel().getRootNode(), false); TreeVisitor tv = new TreeVisitor(new PostMigrationVisitor(registry), course.getEditorTreeModel().getRootNode(), false);
tv.visitAll(); tv.visitAll();
tv = new TreeVisitor(new PostMigrationVisitor(registry), course.getRunStructure().getRootNode(), false);
tv.visitAll();
CourseFactory.saveCourseEditorTreeModel(course.getResourceableId()); CourseFactory.saveCourse(course.getResourceableId());
CourseFactory.closeCourseEditSession(course.getResourceableId(), true); CourseFactory.closeCourseEditSession(course.getResourceableId(), true);
return lpEntry; return lpEntry;
} }
......
...@@ -41,9 +41,15 @@ public class PostMigrationVisitor implements Visitor { ...@@ -41,9 +41,15 @@ public class PostMigrationVisitor implements Visitor {
@Override @Override
public void visit(INode node) { public void visit(INode node) {
CourseNode courseNode = null;
if (node instanceof CourseEditorTreeNode) { if (node instanceof CourseEditorTreeNode) {
CourseEditorTreeNode courseEditorTreeNode = (CourseEditorTreeNode)node; CourseEditorTreeNode courseEditorTreeNode = (CourseEditorTreeNode)node;
CourseNode courseNode = courseEditorTreeNode.getCourseNode(); courseNode = courseEditorTreeNode.getCourseNode();
}
if (node instanceof CourseNode) {
courseNode = (CourseNode)node;
}
if (courseNode != null) {
LearningPathNodeHandler lpHandler = registry.getLearningPathNodeHandler(courseNode); LearningPathNodeHandler lpHandler = registry.getLearningPathNodeHandler(courseNode);
lpHandler.onMigrated(courseNode); lpHandler.onMigrated(courseNode);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment