Examples of VelocityContainer


Examples of org.olat.core.gui.components.velocity.VelocityContainer

    String pagePath = bundleName.replace('.', '/') + ContextHelpModule.CHELP_DIR + pageName;
    if (getClass().getResource("/" + pagePath) == null) {
      logWarn("Context help page does not exist on path::" + pagePath, null);
      return null;
    }
    VelocityContainer container =  new VelocityContainer("contextHelpPageVC", pagePath, pageTranslator, this);         
    // add media directory url to context for resource delivery
    container.contextPut("chelpStaticDirUrl", chelpStaticDirUrl);
    return container;
  }
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

    */
  public SinglePageController(UserRequest ureq, WindowControl wControl, boolean inIframe, VFSContainer rootContainer, String fileName, String currentUri, boolean allowRelativeLinks, boolean showHomeLink, OLATResourceable contextResourcable) {
    super(wControl);
    trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    Panel mainP = new Panel("iframemain");
    myContent = new VelocityContainer("singlepagecontent", VELOCITY_ROOT + "/index.html", trans, this);
   
    homeLinkP = new Panel("homelink");
    homeLinkContent = new VelocityContainer("homelinkcontent", VELOCITY_ROOT + "/homelink.html", trans, this);
    homeLinkContent.contextPut("showHomeLink",showHomeLink?Boolean.TRUE:Boolean.FALSE);   
    homeLink = LinkFactory.createCustomLink("command.home", "command.home", "", Link.NONTRANSLATED, homeLinkContent, this);
    homeLink.setCustomEnabledLinkCSS("b_content_reset");
    homeLink.setTooltip(trans.translate("command.home"), false);
   
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

    super(ureq, wControl);
    // dummy translator, empty
    Translator trans = Util.createPackageTranslator(
        JavaScriptTracingController.class, ureq.getLocale());
    // dummy velocity container, empty
    VelocityContainer mainVC = new VelocityContainer("JSTracing", Util
        .getPackageVelocityRoot(JavaScriptTracingController.class)
        + "/JSTracing.html", trans, this);

    // The javascript ajax tracing library, attached to the dummy velocity
    // container so that it gets included
    JSAndCSSComponent tmJs = new JSAndCSSComponent("js",
        JavaScriptTracingController.class,
        new String[] { "JSTracing.js" }, null, false);
    mainVC.put("js", tmJs);

    // The mapper that handels all log postings
    Mapper mapper = new Mapper() {
      public MediaResource handle(String relPath,
          HttpServletRequest request) {
        // the log message
        String logMsg = request.getParameter("logMsg");
        // optional, the logging file name
        String jsFile = request.getParameter("jsFile");
        // currently only debug level is supported but in the future...
        String level = request.getParameter("level");
        if (level.equals("debug")) {
          // log to standard OLAT logging system
          logDebug(logMsg, jsFile);
        }
        // sent empty response
        StringMediaResource smr = new StringMediaResource();
        smr.setContentType("application/javascript");
        smr.setEncoding("utf-8");
        smr.setData("");
        StringMediaResource mediaResource = new StringMediaResource();
        mediaResource.setEncoding("utf-8");
        mediaResource.setContentType("text/javascript;charset=utf-8");
        mediaResource.setData("");
        return mediaResource;
      }
    };
    String mapperUri = registerMapper(mapper);

    // push some variables to the header that are needed to initialize the
    // JS Tracing
    String jsHeader = "<script type='text/javascript'>o_info.JSTracingUri='"
        + mapperUri
        + "/';o_info.JSTracingLogDebugEnabled="
        + isLogDebugEnabled()
        + ";</script>";
    HtmlHeaderComponent JSTracingHeader = new HtmlHeaderComponent(
        "JSTracingHeader", null, jsHeader);
    mainVC.put("JSTracingHeader", JSTracingHeader);

    putInitialPanel(mainVC);
  }
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

      if(disposedMessageController != null && wrapperPanel != null){
        wrapperPanel.setContent(disposedMessageController.getInitialComponent());
      }else if(wrapperPanel != null){
        // place disposed message
        Translator pT = Util.createPackageTranslator(DefaultController.class, locale);
        Component dispMsgVC = new VelocityContainer(DEFAULTDISPOSED_PAGE,DefaultController.class,DEFAULTDISPOSED_PAGE,pT,null);
        wrapperPanel.pushContent(dispMsgVC);
      }
    }
  }
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

        if (locale == null) {
          locale = ureq.getLocale();
        }
        // place disposed message
        Translator pT = Util.createPackageTranslator(DefaultController.class, locale);
        Component dispMsgVC = new VelocityContainer(DEFAULTDISPOSED_PAGE, DefaultController.class,DEFAULTDISPOSED_PAGE, pT, null);
        wrapperPanel.pushContent(dispMsgVC);
      }
    }
  }
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

        //fallback to default locale
        locale = I18nModule.getDefaultLocale();
      }
      // place disposed message
      Translator pT = Util.createPackageTranslator(DefaultController.class, locale);
      Component dispMsgVC = new VelocityContainer(DEFAULTDISPOSED_PAGE,DefaultController.class,DEFAULTDISPOSED_PAGE,pT,null);
      wrapperPanel.pushContent(dispMsgVC);
    }
     
     
    controllerCnt.decrementAndGet();//count controller count down. this should event work if a disposed msg controller is created.
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

   */
  public WizardInfoController(UserRequest ureq, int maxSteps) {
    super(null);
    this.maxSteps = maxSteps;
    Translator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    myContent = new VelocityContainer("genericwizard", VELOCITY_ROOT + "/wizard_steps.html", trans, null);

    myContent.contextPut("max", String.valueOf(maxSteps));
    myContent.contextPut("myself", this);
    setCurStep(1);
    setInitialComponent(myContent);
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

   */
  public WizardController(UserRequest ureq, WindowControl wControl, int steps) { super(wControl);
    this.steps = steps;
   
    this.trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    this.wizardVC = new VelocityContainer("wizard", VELOCITY_ROOT + "/wizard.html", this.trans, this);
    finishButton = LinkFactory.createCustomLink("finish", "cmd.wizard.cancel", "cmd.wizard.finished", Link.BUTTON, this.wizardVC, this);
    cancelButton = LinkFactory.createCustomLink("cancel", "cmd.wizard.cancel", "cmd.wizard.cancel", Link.BUTTON, this.wizardVC, this);
   
    this.wic = new WizardInfoController(ureq, this.steps);
    this.wizardVC.put("wic", wic.getInitialComponent());
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

  public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl windowControl, Translator trans) {
    this.folderComponent = fc;
    this.translator = trans;
    this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());
       
    main = new VelocityContainer("mc", VELOCITY_ROOT + "/movecopy.html", translator, this);
    main.contextPut("fileselection", fileSelection);
   
    //check if command is executed on a file list containing invalid filenames or paths
    if(fileSelection.getInvalidFileNames().size()>0) {   
      main.contextPut("invalidFileNames", fileSelection.getInvalidFileNames());
View Full Code Here

Examples of org.olat.core.gui.components.velocity.VelocityContainer

   * @param ureq
   */
  protected DidYouKnowPortletRunController(UserRequest ureq, WindowControl wControl) {
    super(wControl);
    this.trans = new PackageTranslator(Util.getPackageName(DidYouKnowPortlet.class), ureq.getLocale());
    this.didYouKnowVC = new VelocityContainer("didYouKnowVC", VELOCITY_ROOT + "/didYouKnowPortlet.html", trans, this);
    nextLink = LinkFactory.createLink("next", didYouKnowVC, this);
   
    // get tips boundary initialize a shuffled list of all possible tip numbers
    int numbTips = -1;
    // search in property file from this package for all questions
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.