Package org.olat.core.dispatcher.mapper

Examples of org.olat.core.dispatcher.mapper.Mapper


    functionCallsVC.contextPut("selectPath", Boolean.FALSE);
    functionCallsVC.contextPut("reloadPath", Boolean.FALSE);
    functionCallsVC.contextPut("removePath", Boolean.FALSE);

    // The data mapper provides the dynamic data model to the view
    treeDataMapper = new Mapper() {
      public MediaResource handle(String relPath, HttpServletRequest request) {
        // each call is done for a specific node: get the child elements
        // for this node
        String data;
        String nodeId = request.getParameter(PARAM_NODE);
View Full Code Here


   * @param uSess
   *            The user session (needed to register the mapper)
   */
  public CustomCSS(final VFSContainer cssBaseContainer,
      final String relCssFilename, UserSession uSess) {
    cssUriMapper = new Mapper() {
      public MediaResource handle(String relPath,
          HttpServletRequest request) {
        VFSItem vfsItem = cssBaseContainer.resolve(relPath);
        MediaResource mr;
        if (vfsItem == null || !(vfsItem instanceof VFSLeaf))
View Full Code Here

    //more debug information: OLAT-3529
    if (ajaxEnabled) myContent.contextPut("isAdmin", Boolean.valueOf(ureq.getUserSession().getRoles().isOLATAdmin()));
   
    // create a mapper to not block main traffic when polling (or vica versa)
    final Window window = wboImpl.getWindow();
    m = new Mapper() {
      public MediaResource handle(String relPath, HttpServletRequest request) {
        pollCount++;
        // check for dirty components now.
        wboImpl.fireCycleEvent(Window.BEFORE_INLINE_RENDERING);
        Command updateDirtyCom = window.handleDirties();
View Full Code Here

   * with the default language and last but not least with the fallback
   * language.
   */
  private void initPageResourceMapper() {
    // Add page resources mapper
    Mapper pageResourceMapper = new Mapper() {
      public MediaResource handle(String relPath, HttpServletRequest request) {
        ClasspathMediaResource mr = null;
        // relPath: myimage.png
        int suffixPos = relPath.lastIndexOf(".");
        if (suffixPos > 0) {
View Full Code Here

      wasStartpage  = isStartpage;
    }
  }
  @SuppressWarnings("unused")
  private Mapper createMapper(final VFSContainer rootContainer) {
    Mapper map = new Mapper() {
      public MediaResource handle(String relPath,HttpServletRequest request) {
        VFSItem currentItem = rootContainer.resolve(relPath);
        if (currentItem == null || (currentItem instanceof VFSContainer)) {
          return new NotFoundMediaResource(relPath);
        }
View Full Code Here

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

        // Create a mapper to deliver the auto-download of the file. We have to
        // create a dedicated mapper here
        // and can not reuse the standard briefcase way of file delivering, some
        // very old fancy code
        // Mapper is cleaned up automatically by basic controller
        String baseUrl = registerMapper(new Mapper() {
          public MediaResource handle(String relPath, HttpServletRequest request) {
            VFSLeaf vfsfile = (VFSLeaf) folderComponent.getRootContainer().resolve(relPath);
            if (vfsfile == null) {
              return new NotFoundMediaResource(relPath);
            } else {
View Full Code Here

      // for single entry, define the behaviour to automatically submit after choosing an entry
      myContent.contextPut("afterUpdateElement","afterUpdateElement");
    }
   
    // create a mapper for the server responses for a given input
    mapper = new Mapper() {
      public MediaResource handle(String relPath, HttpServletRequest request) {
        String lastN = request.getParameter("qs");
        AutoCompleterListReceiver receiver = new AutoCompleterListReceiver(noresults);
        gprovider.getResult(lastN, receiver);
        String html = receiver.getResult();
View Full Code Here

   
    //Delivers content files via local mapper to enable session based browser caching for at least this instance
    //FIXME:FG: implement named mapper concept based on business path to allow browser caching and distributed media server
    //TODO:gs may use the same contentMapper if users clicks again on the same singlePage, now each time a new Mapper gets created and
    //therefore the browser can not reuse the cached elements
    contentMapper = new Mapper() {
      public MediaResource handle(String relPath, HttpServletRequest request) {
        String isPopUpParam = request.getParameter("olatraw");
        boolean isPopUp = false;
        if (isPopUpParam != null && isPopUpParam.equals("true")) isPopUp = true;
       
View Full Code Here

          Tracing.logDebug("ExternalSiteEvent is accepted", HtmlStaticPageComponent.class);
          checkRegular = false;
        } else {
          // it is a html page with olatraw parameter => redirect to mapper
          MapperRegistry mapperRegistry = MapperRegistry.getInstanceFor(ureq.getUserSession());
          Mapper mapper = createMapper(rootContainer);
          // NOTE: do not deregister this mapper, since it could be used a lot later (since it is opened in a new browser window)
          String amapPath = mapperRegistry.register(mapper);

          ese.setResultingMediaResource(new RedirectMediaResource(amapPath+"/"+moduleURI));
          Tracing.logDebug("RedirectMediaResource=" + amapPath+"/"+moduleURI, HtmlStaticPageComponent.class);
View Full Code Here

TOP

Related Classes of org.olat.core.dispatcher.mapper.Mapper

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.