/**
* @see org.olat.bookmark.handler.BookmarkLaunchHandler#tryToLaunch(org.olat.bookmark.Bookmark, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
*/
public boolean tryToLaunch(Bookmark bookmark, UserRequest ureq, WindowControl wControl) {
OLATResourceable reores = BookmarkManager.getInstance().getLaunchOlatResourceable(bookmark);
RepositoryManager rm = RepositoryManager.getInstance();
RepositoryEntry re = rm.lookupRepositoryEntry(reores.getResourceableId());
if (re == null) {
// we can't launch this bookmark, exit with false
return false;
}
// ok, this bookmark represents a repo entry, try to launch
if (!rm.isAllowedToLaunch(ureq, re)) {
Translator trans = Util.createPackageTranslator(Bookmark.class, ureq.getLocale());
wControl.setWarning(trans.translate("warn.cantlaunch"));
} else {
// get the OLAT resource from this repo entry
OLATResourceable ores = re.getOlatResource();
//was brasato:: DTabs dts = getWindowControl().getDTabs();
DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
DTab dt = dts.getDTab(ores);
if (dt == null) {
// does not yet exist -> create and add