course = CourseFactory.getCourseEditSession(re.getOlatResource().getResourceableId());
String displayName = re.getDisplayname();
course.getRunStructure().getRootNode().setShortTitle(Formatter.truncateOnly(displayName, 25)); //do not use truncate!
course.getRunStructure().getRootNode().setLongTitle(displayName);
//course.saveRunStructure();
CourseEditorTreeNode editorRootNode = ((CourseEditorTreeNode)course.getEditorTreeModel().getRootNode());
editorRootNode.getCourseNode().setShortTitle(Formatter.truncateOnly(displayName, 25)); //do not use truncate!
editorRootNode.getCourseNode().setLongTitle(displayName);
// mark entire structure as dirty/new so the user can re-publish
markDirtyNewRecursively(editorRootNode);
// root has already been created during export. Unmark it.
editorRootNode.setNewnode(false);
CourseFactory.saveCourse(course.getResourceableId());
CourseFactory.closeCourseEditSession(course.getResourceableId(),true);
}