// 1. do copy learning group contexts
BGContextManager contextManager = BGContextManagerImpl.getInstance();
List origLgC = originalCourseGroupManager.getLearningGroupContexts();
Iterator iter = origLgC.iterator();
while (iter.hasNext()) {
BGContext origContext = (BGContext) iter.next();
if (origContext.isDefaultContext()) {
// we found default context, copy this one
String learningGroupContextName = CourseGroupManager.DEFAULT_NAME_LC_PREFIX + courseTitle;
contextManager.copyAndAddBGContextToResource(learningGroupContextName, this.courseResource, origContext);
// no need to add it to list of contexts, already done by copyAndAddBGContextToResource
} else {
// not a course default context but an associated context - copy only
// reference
contextManager.addBGContextToResource(origContext, courseResource);
// no need to add it to list of contexts, already done by addBGContextToResource
}
}
// 2. do copy right group contexts
List origRgC = originalCourseGroupManager.getRightGroupContexts();
iter = origRgC.iterator();
while (iter.hasNext()) {
BGContext origContext = (BGContext) iter.next();
if (origContext.isDefaultContext()) {
// we found default context, copy this one
String rightGroupContextName = CourseGroupManager.DEFAULT_NAME_RC_PREFIX + courseTitle;
contextManager.copyAndAddBGContextToResource(rightGroupContextName, this.courseResource, origContext);
// no need to add it to list of contexts, already done by copyAndAddBGContextToResource
} else {