Package org.olat.core.gui.components

Examples of org.olat.core.gui.components.Window


        Windows ws = Windows.getWindows(usess);
        synchronized (ws) { //o_clusterOK by:fj per user session
          ChiefController occ;
          if(subPathccc != null){
            occ = subPathccc.createChiefController(ureq);
            Window window = occ.getWindow();
            window.setUriPrefix(uriPrefix);
            ws.registerWindow(window);
           
            window.dispatchRequest(ureq, true);
            return;
          }         
        }
      }//else a /olat/dmz/ request
      /*
       * create content as it is defined in config.xml in he dmzbean
       */

      /*
       * solve this with a predispatcher action
       */
     
//      // convenience method to jump immediatly to AAI (Shibboleth) home
//      // organisation for login without selecting home organisation manually
//      if (ShibbolethModule.isEnableShibbolethLogins()) {
//        String preSelIdp = request.getParameter("preselection");
//        String redirect = request.getParameter("redirect");
//        if (preSelIdp != null && redirect != null && redirect.equalsIgnoreCase("true")) {
//          preSelIdp = preSelIdp.toLowerCase();
//          Collection sites = IdPSite.getIdPSites(ShibbolethModule.getMetadata());
//          for (Iterator iter = sites.iterator(); iter.hasNext();) {
//            IdPSite site = (IdPSite) iter.next();
//            if (site.getName().toLowerCase().indexOf(preSelIdp) > -1) {
//              response.sendRedirect(AssertionConsumerService.buildRequest(request.getLocale(), site));
//              break;
//            }
//          }
//        }
//      }

      UserSession usess = ureq.getUserSession();
      Windows ws = Windows.getWindows(usess);
      synchronized (ws) { //o_clusterOK by:fj per user session

        Window window;
        boolean windowHere = ws.isExisting(ureq.getWindowID());
        boolean validDispatchUri = ureq.isValidDispatchURI();
        if (validDispatchUri && !windowHere) {
          // probably valid framework link from previous user && new Session(no window):
          // when a previous user logged off, and 30min later (when the httpsession is invalidated), the next user clicks e.g. on
          // the log-in link in the -same- browser window ->
          // -> there is no window -> create a new one
          window = null;
          usess.signOffAndClear();
          usess.setLocale(LocaleNegotiator.getPreferedLocale(ureq));
          // request new windows since it is a new usersession, the old one was purged
          ws = Windows.getWindows(usess);
        } else {
          if (validDispatchUri) {
            window = ws.getWindow(ureq);
          } else {
            // e.g. /dmz/ -> start screen, clear previous session data
            window = null;
            usess.signOffAndClear();
            usess.setLocale(LocaleNegotiator.getPreferedLocale(ureq));
            // request new windows since it is a new usersession, the old one was purged
            ws = Windows.getWindows(usess);
          }
        }
       
        if (window == null) {
          // no window found, -> start a new WorkFlow/Controller and obtain the window
          // main controller which also implements the windowcontroller for pagestatus and modal dialogs
          ChiefController occ = chiefControllerCreator.createChiefController(ureq);
         
//        REVIEW:12-2007:CodeCleanup       
          // browser did not send a cookie && url has a window id with it (= we
          // are clicking a framework link or submitting a framework form)
          //if (sessionId == null && ureq.getWindowID() != null) {
            //Translator trans = new PackageTranslator("org.olat", ureq.getLocale()); // locale
            //occ.getWindowControl().setWarning(trans.translate("wayf.cookies"));
          //}

          window = occ.getWindow();
          window.setUriPrefix(uriPrefix);
          ws.registerWindow(window);
         
          window.dispatchRequest(ureq, true);
       
        } else {
          window.dispatchRequest(ureq);
        }
      }
    } catch (Throwable th) {
      try {
        ChiefController msgcc = MsgFactory.createMessageChiefController(ureq, th);
View Full Code Here


      // close window (a html page which calls Window.close onLoad
      ureq.getDispatchResult().setResultingMediaResource(
          new RedirectMediaResource(StaticMediaDispatcher.createStaticURIFor("closewindow.html")));
      // release all resources and close window
      WindowBackOffice wbo = getWindowControl().getWindowBackOffice();
      Window w = wbo.getWindow();
      Windows.getWindows(ureq).deregisterWindow(w);
      wbo.dispose();
    }
  }
View Full Code Here

     
    };
   
   
   
    Window myWindow = myWControl.getWindowBackOffice().getWindow();
    myWindow.setAttribute("DTabs", myDTabsImpl);
    //REVIEW:PB remove if back support is desired
    myWindow.addListener(this);//to be able to report BACK / FORWARD / RELOAD
    /*
     * use getAttribute on i.e. Windows(ureq).getWindow(ureq) to retrieve this "service"
     */

   
 
View Full Code Here

      dtabsControllers = null;
      sites = null;
      siteToBornSite = null;
    }
    //clear the DTabs Service
    Window myWindow = getWindowControl().getWindowBackOffice().getWindow();
    myDTabsImpl = null;
    myWindow.setAttribute("DTabs", null);   

    getWindowControl().getWindowBackOffice().removeCycleListener(this);
  }
View Full Code Here

  /**
   * Remove the current custom css from the view
   */
  protected void removeCurrentCustomCSSFromView() {
    Window myWindow = getWindowControl().getWindowBackOffice().getWindow();
    CustomCSS currentCustomCSS = (CustomCSS) myWindow.getAttribute(CURRENT_CUSTOM_CSS_KEY);
    if (currentCustomCSS != null) {
      // remove css and js from view
      mainVc.remove(currentCustomCSS.getJSAndCSSComponent());
      myWindow.removeAttribute(CURRENT_CUSTOM_CSS_KEY);
    }
  }
View Full Code Here

   */
  protected void addCurrentCustomCSSToView(CustomCSS customCSS) {
    if (customCSS == null) return;
    // The current CSS is stored as a window attribute so that is can be
    // accessed by the IFrameDisplayController
    Window myWindow = getWindowControl().getWindowBackOffice().getWindow();
    myWindow.setAttribute(CURRENT_CUSTOM_CSS_KEY, customCSS);
    // add css component to view
    mainVc.put("jsAndCss", customCSS.getJSAndCSSComponent());   
  }
View Full Code Here

      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
    }
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.Window

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.