*
* @param ureq
* @param wControl
*/
public void launch(UserRequest ureq, WindowControl wControl) {
BusinessControl bc = wControl.getBusinessControl();
ContextEntry mainCe = bc.popLauncherContextEntry();
OLATResourceable ores = mainCe.getOLATResourceable();
// Check for RepositoryEntry resource
boolean ceConsumed = false;
if (ores.getResourceableTypeName().equals(OresHelper.calculateTypeName(RepositoryEntry.class))) {
// It is a repository-entry => get OLATResourceable from RepositoryEntry
RepositoryManager repom = RepositoryManager.getInstance();
RepositoryEntry re = repom.lookupRepositoryEntry(ores.getResourceableId());
ores = re.getOlatResource();
ceConsumed = true;
}
// was brasato:: DTabs dts = wControl.getDTabs();
Window window = Windows.getWindows(ureq.getUserSession()).getWindow(ureq);
if (window == null) {
logDebug("Found no window for jumpin => take WindowBackOffice", null);
window = wControl.getWindowBackOffice().getWindow();
}
DTabs dts = (DTabs) window.getAttribute("DTabs");
DTab dt = dts.getDTab(ores);
if (dt != null) {
// tab already open => close it
dts.removeDTab(dt);// disposes also dt and controllers
}
String firstType = mainCe.getOLATResourceable().getResourceableTypeName();
// String firstTypeId = ClassToId.getInstance().lookup() BusinessGroup
ContextEntryControllerCreator typeHandler = contextEntryControllerCreators.get(firstType);
if (typeHandler == null) throw new AssertException("Unable to get a handler for the type: " + firstType);
String siteClassName = typeHandler.getSiteClassName(mainCe);
// open in existing site
if (siteClassName != null) {
// use special activation key to trigger the activate method
String viewIdentifyer = null;
if (bc.hasContextEntry()) {
ContextEntry subContext = bc.popLauncherContextEntry();
if (subContext != null) {
OLATResourceable subResource = subContext.getOLATResourceable();
if (subResource != null) {
viewIdentifyer = subResource.getResourceableTypeName();
if (subResource.getResourceableId() != null) {