/**
* persist the updates
*/
private void doUpdateContext(UserRequest ureq) {
// refresh group to prevent stale object exception and context proxy issues
BGContextManager contextManager = BGContextManagerImpl.getInstance();
this.groupContext = contextManager.loadBGContext(this.groupContext);
// update defaultContext switch changes
if (ureq.getUserSession().getRoles().isOLATAdmin()) {
boolean newisDefaultContext = this.contextController.isDefaultContext();
if (newisDefaultContext) {
if (this.repoTableModelEntries.size() == 0) {
getWindowControl().setError(translate("form.error.defaultButNoResource"));
this.contextController.setValues(this.groupContext);
return;
}
}
this.groupContext.setDefaultContext(newisDefaultContext);
}
// update name and descripton
String name = this.contextController.getName();
String desc = this.contextController.getDescription();
this.groupContext.setName(name);
this.groupContext.setDescription(desc);
contextManager.updateBGContext(this.groupContext);
// update velocity
String title = DefaultContextTranslationHelper.translateIfDefaultContextName(this.groupContext, getTranslator());
this.editVC.contextPut("title", getTranslator().translate("edit.title", new String[] { "<i>" + StringEscapeUtils.escapeHtml(title) + "</i>" }));
}