Package org.olat.core.gui

Examples of org.olat.core.gui.Windows


    }

    // fetch more info
    // get the latest window which caused this exception
    String componentListenerInfo = "";
    Windows ws = Windows.getWindows(ureq);
   
    Window window = ws.getWindow(ureq);
    if (window != null) {
      Component target = window.getAndClearLatestDispatchedComponent();
      if (target != null) {
        // there was a component id given, and a matching target could be found
        componentListenerInfo = "<dispatchinfo>\n\t<componentinfo>\n\t\t<compname>" + target.getComponentName() + "</compname>\n\t\t<compclass>"
            + target.getClass().getName() + "</compclass>\n\t\t<extendedinfo>" + target.getExtendedDebugInfo()
            + "</extendedinfo>\n\t\t<event>";
        Event latestEv = target.getAndClearLatestFiredEvent();
        if (latestEv != null) {
          componentListenerInfo += "\n\t\t\t<class>"+latestEv.getClass().getName()+"</class>\n\t\t\t<command>"+latestEv.getCommand()+"</command>\n\t\t\t<tostring>"+latestEv+"</tostring>";
        }
        componentListenerInfo += "\n\t\t</event>\n\t</componentinfo>\n\t<controllerinfo>";
        Controller c = target.getLatestDispatchedController();
        if (c != null) {
          // can be null if the error occured in the component itself
          // componentListenerInfo += c.toString();
          //WindowControl control = c.getWindowControl();
          // sorry, getting windowcontrol on a controller which does not have one (all should have one, legacy) throws an exception
          try {
           
            WindowControlInfo wci = c.getWindowControlForDebug().getWindowControlInfo();
            while (wci != null) {
              String cName = wci.getControllerClassName();
              componentListenerInfo += "\n\t\t<controllername>" + cName + "</controllername>";
              wci = wci.getParentWindowControlInfo();
            }
          } catch (Exception e) {
            componentListenerInfo += "no info, probably no windowcontrol set: "+e.getClass().getName()+", "+e.getMessage();
          }
        }
        componentListenerInfo += "\n\t</controllerinfo>\n</dispatchinfo>";
      }
    }

    if(o3e instanceof KnownIssueException){
      KnownIssueException kie = (KnownIssueException)o3e;
      msg.contextPut("knownissuelink", kie.getJiraLink());
    }
   
    // TODO: DB.getInstance().hasTransaction() TODO: log db transaction id if in
    // transaction
    long refNum = Tracing.logError("**RedScreen** "+o3e.getLogMsg() + " ::_::" + componentListenerInfo + " ::_::", o3e, o3e.getThrowingClazz());
    // only if debug
    if (Settings.isDebuging()) {
      msg.contextPut("debug", Boolean.TRUE);
    } else {
      msg.contextPut("debug", Boolean.FALSE);     
    }
    msg.contextPut("listenerInfo", Formatter.escWithBR(componentListenerInfo).toString());     
    msg.contextPut("stacktrace", OLATRuntimeException.throwableToHtml(th));     
   
    Identity curIdent = ureq.getIdentity();
    msg.contextPut("username", curIdent == null? "n/a" : curIdent.getName());
    msg.contextPut("allowBackButton", Boolean.valueOf(allowBackButton));
    msg.contextPut("detailedmessage", detailedmessage);
    // Cluster NodeId + E-Nr
    msg.contextPut("errnum", "N" + CoordinatorManager.getCoordinator().getNodeId() + "-E"+ refNum);
    msg.contextPut("supportaddress", WebappHelper.getMailConfig("mailSupport"));
    msg.contextPut("time", formatter.formatDateAndTime(new Date()));

    WindowBackOffice wbo = ws.getWindowManager().createWindowBackOffice("errormessagewindow", this);
    Window w = wbo.getWindow();
   
    msg.put("jsCssRawHtmlHeader", w.getJsCssRawHtmlHeader());   
    // the current GUI theme and the global settings that contains the
    // font-size. both are pushed as objects so that window.dirty always reads
    // out the correct value
    msg.contextPut("theme", w.getGuiTheme());   
    msg.contextPut("globalSettings", ws.getWindowManager().getGlobalSettings());   

   
    w.setContentPane(msg);
    setWindow(w);
  }
View Full Code Here


      if (checkNewWindow) {
        Window resWindow = ureq.getDispatchResult().getResultingWindow();
        if (resWindow != null) {
          // register it first, if not done before
          Windows ws = Windows.getWindows(ureq);
          if (!ws.isRegistered(resWindow)) {
            resWindow.setUriPrefix(uriPrefix);
            ws.registerWindow(resWindow);
          }
          // render initial state of new window by redirecting (302) to the new
          // window id. needed for asyncronous data like images loaded
         
          // todo maybe better delegate window registry to the windowbackoffice?
View Full Code Here

      }
      else {
        sb.append(" - ");
      }
      sb.append("<br />");
      Windows ws = Windows.getWindows(usess);
      for (Iterator iterator = ws.getWindowIterator(); iterator.hasNext(); ) {
        Window window = (Window) iterator.next();
        sb.append("- window ").append(window.getDispatchID()).append(" ").append(window.getLatestDispatchComponentInfo()).append("<br />");
      }
      sb.append("<br />");
    }
View Full Code Here

        // render the window
        Window w = cc.getWindow();
        w.dispatchRequest(ureq, true); // renderOnly
      } else { // valid uri for dispatching (has timestamp, componentid and
        // windowid)
        Windows ws = Windows.getWindows(ureq);
        Window window = ws.getWindow(ureq);
        if (window == null) {
          // If no window, this is probably a stale link. send not
          // found
          // note: do not redirect to login since this wastes a new
          // window each time since we are in an authenticated session
View Full Code Here

        // render only
        currentWindow.dispatchRequest(ureq, true);
       
      } else {
        // auth: get window
        Windows ws = Windows.getWindows(ureq);
        Window window = ws.getWindow(ureq);
        window.dispatchRequest(ureq);       
      }


    } catch (Throwable th) {
View Full Code Here

      msg.contextPut("supportEmail",supportEmail);
    }

    //Window w = new Window("messagewindow", this, jsadder);
   
    Windows ws = Windows.getWindows(ureq);
    WindowBackOffice wbo = ws.getWindowManager().createWindowBackOffice("messagewindow", this);
    Window w = wbo.getWindow();
   
    msg.put("jsAndCssC", w.getJsCssRawHtmlHeader());
    msg.contextPut("theme", w.getGuiTheme())
   
View Full Code Here

   
    UserRequest ureq = new UserRequest(uriPrefix, request, response);
    //String sessionId = request.getRequestedSessionId();
    try {
      UserSession usess = ureq.getUserSession();
      Windows ws = Windows.getWindows(usess);
      synchronized (ws) {  //o_clusterOK by:fj

        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();
          // 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();
            // 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);
       
          // 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);
        }
View Full Code Here

 
          // user environment
          myContent.contextPut("env", usess.getIdentityEnvironment());
 
          // GUI statistics
          Windows ws = Windows.getWindows(usess);
          StringBuilder sb = new StringBuilder();
          for (Iterator iterator = ws.getWindowIterator(); iterator.hasNext();) {
            Window window = (Window) iterator.next();
            sb.append("- Window ").append(window.getDispatchID()).append(" dispatch info: ").append(window.getLatestDispatchComponentInfo()).append("<br />");
          }
          sb.append("<br />");
          myContent.contextPut("guistats", sb.toString());
View Full Code Here

        // render the window
        Window w = cc.getWindow();
        w.dispatchRequest(ureq, true); // renderOnly
      } else { // valid uri for dispatching (has timestamp, componentid and
        // windowid)
        Windows ws = Windows.getWindows(ureq);
        Window window = ws.getWindow(ureq);
        if (window == null) {
          // If no window, this is probably a stale link. send not
          // found
          // note: do not redirect to login since this wastes a new
          // window each time since we are in an authenticated session
View Full Code Here

        }
        // chief controller creator for sub path, e.g.
        subPathccc = dmzServicesByPath.get(sub);
       
        UserSession usess = ureq.getUserSession();
        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);
View Full Code Here

TOP

Related Classes of org.olat.core.gui.Windows

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.