// no task assigned
String relPath = TACourseNode.getTaskFolderPathRelToFolderRoot(course, node);
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(relPath, null);
OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(translate("taskfolder"), rootFolder);
namedFolder.setLocalSecurityCallback(getTaskFolderSecCallback(relPath));
frc = new FolderRunController(namedFolder, false, ureq, getWindowControl());
CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("folder.close"), frc
.getInitialComponent());
cmc.activate();
} else {
// already assigned task => open dialog with warn
String[] args = new String[] { new Integer(assignedProps.size()).toString() };
dialogBoxController = this.activateOkCancelDialog(ureq, "", getTranslator().translate("taskfolder.overwriting.confirm", args), dialogBoxController);
List cs = new ArrayList();
cs.add(dialogBoxController);
LayoutController vcc = new LayoutController(Layouts.VERTICAL, cs);
}
} else if (source == modulesForm) {
if (event == Form.EVNT_FORM_CANCELLED) {
return;
} else if (event == Form.EVNT_VALIDATION_OK) {
config.set(TACourseNode.CONF_TASK_ENABLED, new Boolean(modulesForm.hasTask()));
config.set(TACourseNode.CONF_DROPBOX_ENABLED, new Boolean(modulesForm.hasDropbox()));
config.set(TACourseNode.CONF_RETURNBOX_ENABLED, new Boolean(modulesForm.hasReturnbox()));
config.set(TACourseNode.CONF_SCORING_ENABLED, new Boolean(modulesForm.hasScoring()));
config.set(TACourseNode.CONF_SOLUTION_ENABLED, new Boolean(modulesForm.hasSolution()));
myTabbedPane.setEnabled(taskTabPosition, modulesForm.hasTask());
if (modulesForm.hasTask()) {
accessabilityVC.put("taskCondition", taskConditionC.getInitialComponent());
} else {
accessabilityVC.remove(taskConditionC.getInitialComponent());
}
myTabbedPane.setEnabled(dropboxTabPosition, modulesForm.hasDropbox());
if (modulesForm.hasDropbox()) {
accessabilityVC.put("dropCondition", dropConditionC.getInitialComponent());
} else {
accessabilityVC.remove(dropConditionC.getInitialComponent());
}
//add/remove returnboxConditionC
if (modulesForm.hasReturnbox()) {
accessabilityVC.put("returnboxCondition", returnboxConditionC.getInitialComponent());
} else {
accessabilityVC.remove(returnboxConditionC.getInitialComponent());
}
myTabbedPane.setEnabled(scoringTabPosition, modulesForm.hasScoring());
if (modulesForm.hasScoring()) {
accessabilityVC.put("scoringCondition", scoringConditionC.getInitialComponent());
} else {
accessabilityVC.remove(scoringConditionC.getInitialComponent());
}
myTabbedPane.setEnabled(solutionTabPosition, modulesForm.hasSolution());
if (modulesForm.hasSolution()) {
accessabilityVC.put("solutionCondition", solutionConditionC.getInitialComponent());
} else {
accessabilityVC.remove(solutionConditionC.getInitialComponent());
}
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
return;
}
} else if (source == dropboxForm) {
if (event == Form.EVNT_FORM_CANCELLED) {
return;
} else if (event == Form.EVNT_VALIDATION_OK) {
config.set(TACourseNode.CONF_DROPBOX_ENABLEMAIL, new Boolean(dropboxForm.mailEnabled()));
config.set(TACourseNode.CONF_DROPBOX_CONFIRMATION, dropboxForm.getConfirmation());
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
return;
}
} else if (source == vfButton) {
if (log.isDebug()) log.debug("Event for sampleVC");
// switch to new dialog
OlatNamedContainerImpl namedContainer = TACourseNode.getNodeFolderContainer(node, course.getCourseEnvironment());
Quota quota = QuotaManager.getInstance().getCustomQuota(namedContainer.getRelPath());
if (quota == null) {
Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
quota = QuotaManager.getInstance().createQuota(namedContainer.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
namedContainer.setLocalSecurityCallback(secCallback);
CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"),
new FolderRunController(namedContainer, false, ureq, getWindowControl()).getInitialComponent());
cmc.activate();
if (log.isDebug()) log.debug("Switch to sample folder dialog : DONE");
return;
} else if (source == editScoringConfigButton){