BusinessGroupManagerImpl.getInstance().setLastUsageFor(currBusinessGroup);
//disposed message controller
//must be created beforehand
Panel empty = new Panel("empty");//empty panel set as "menu" and "tool"
Controller disposedBusinessGroup = new DisposedBusinessGroup(ureq, getWindowControl());
LayoutMain3ColsController disposedController = new LayoutMain3ColsController(ureq, getWindowControl(), empty, empty, disposedBusinessGroup.getInitialComponent(), "disposed grouprun");
disposedController.addDisposableChildController(disposedBusinessGroup);
setDisposedMsgController(disposedController);
// add as listener to BusinessGroup so we are being notified about changes.
CoordinatorManager.getCoordinator().getEventBus().registerFor(this, ureq.getIdentity(), currBusinessGroup);
// show disabled message when collaboration is disabled (e.g. in a test)
if(AssessmentEvent.isAssessmentStarted(ureq.getUserSession())){
groupRunDisabled = true;
this.showError("grouprun.disabled");
}
//REVIEW:PB:2009-05-31: consolidate ContextEntry <-> initialViewIdentifier Concept -> go for ContextEntry at the end.
// first step -> if initialViewIdentifier != null -> map initialViewIdentifier to ore with OresHelper
// how to remove initialViewIdentifier and replace by ContextEntry Path?
// jump to either the forum or the folder if the business-launch-path says so.
BusinessControl bc = getWindowControl().getBusinessControl();
ContextEntry ce = bc.popLauncherContextEntry();
if (ce != null) { // a context path is left for me
OLATResourceable ores = ce.getOLATResourceable();
if (OresHelper.equals(ores, ORES_TOOLFORUM)) {
// start the forum
if (nodeForum != null) {
handleTreeActions(ureq, ACTIVITY_MENUSELECT_FORUM);
bgTree.setSelectedNode(nodeForum);
} else { // not enabled
String text = translate("warn.forumnotavailable");
Controller mc = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
listenTo(mc); // cleanup on dispose
mainPanel.setContent(mc.getInitialComponent());
}
} else if (OresHelper.equals(ores, ORES_TOOLFOLDER)) {
if (nodeFolder != null) {
handleTreeActions(ureq, ACTIVITY_MENUSELECT_FOLDER);
bgTree.setSelectedNode(nodeFolder);
} else { // not enabled
String text = translate("warn.foldernotavailable");
Controller mc = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
listenTo(mc); // cleanup on dispose
mainPanel.setContent(mc.getInitialComponent());
}
} else if (OresHelper.equals(ores, ORES_TOOLWIKI)) {
if (nodeWiki != null) {
handleTreeActions(ureq, ACTIVITY_MENUSELECT_WIKI);
bgTree.setSelectedNode(nodeWiki);
} else { // not enabled
String text = translate("warn.wikinotavailable");
Controller mc = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
listenTo(mc); // cleanup on dispose
mainPanel.setContent(mc.getInitialComponent());
}
} else if (OresHelper.equals(ores, ORES_TOOLCAL)) {
if (nodeCal != null) {
handleTreeActions(ureq, ACTIVITY_MENUSELECT_CALENDAR);
bgTree.setSelectedNode(nodeCal);
} else { // not enabled
String text = translate("warn.calnotavailable");
Controller mc = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
listenTo(mc); // cleanup on dispose
mainPanel.setContent(mc.getInitialComponent());
}
}
}
// jump to node if initialViewIdent says so.
if (initialViewIdentifier != null) {
if (initialViewIdentifier.equals(INITVIEW_TOOLFORUM)) {
if (nodeForum != null) {
handleTreeActions(ureq, ACTIVITY_MENUSELECT_FORUM);
bgTree.setSelectedNode(nodeForum);
} else { // not enabled
String text = translate("warn.forumnotavailable");
Controller mc = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
listenTo(mc); // cleanup on dispose
mainPanel.setContent(mc.getInitialComponent());
}
} else if (initialViewIdentifier.equals(INITVIEW_TOOLFOLDER)) {
if (nodeFolder != null) {
handleTreeActions(ureq, ACTIVITY_MENUSELECT_FOLDER);
bgTree.setSelectedNode(nodeFolder);
} else { // not enabled
String text = translate("warn.foldernotavailable");
Controller mc = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
listenTo(mc); // cleanup on dispose
mainPanel.setContent(mc.getInitialComponent());
}
}
else if (initialViewIdentifier.equals(INITVIEW_TOOLWIKI)) {
if (nodeWiki != null) {
handleTreeActions(ureq, ACTIVITY_MENUSELECT_WIKI);
bgTree.setSelectedNode(nodeWiki);
} else { // not enabled
String text = translate("warn.wikinotavailable");
Controller mc = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
listenTo(mc); // cleanup on dispose
mainPanel.setContent(mc.getInitialComponent());
}
}
else if (initialViewIdentifier.equals(INITVIEW_TOOLCAL)) {
if (nodeCal != null) {
handleTreeActions(ureq, ACTIVITY_MENUSELECT_CALENDAR);
bgTree.setSelectedNode(nodeCal);
} else { // not enabled
String text = translate("warn.calnotavailable");
Controller mc = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), null, text);
listenTo(mc); // cleanup on dispose
mainPanel.setContent(mc.getInitialComponent());
}
}
else throw new AssertException("unknown initialViewIdentifier:'" + initialViewIdentifier + "'");
}
}