Examples of SkimpyTemplate


Examples of net.caprazzi.minima.framework.SkimpyTemplate

   
    Boolean readonly = req.getParameter("readonly") != null
        || (Boolean)req.getAttribute("minima.readonly");
   
    resp.setContentType("text/html");
    SkimpyTemplate index = build.getPage("index");
    index
      .add("BOARD_TITLE", boardTitle)
      .add("READ_ONLY", readonly.toString())
      .add("WEBSOCKET_LOCATION", websocketLocation.equals("auto")
          ? "ws://" + req.getServerName() + ":" + req.getServerPort() + contextPath + "/websocket" : websocketLocation)
      .add("DATA_LOCATION", contextPath + "/data")
      .add("COMET_LOCATION", contextPath + "/comet")
      .add("LOGIN_URL", contextPath + "/login")
      .add("CLIENT_TAG", Utils.makeId())
      .add("TEMPLATES", build.getTemplatesHtml());
   
    if (req.getParameter("devel") != null) {
      index
        .add("CSS_IMPORTS", build.getDevelCssTags(contextPath))
        .add("LIB_IMPORTS", build.getDevelLibsTags(contextPath))
        .add("MAIN_IMPORTS", build.getDevelMainTags(contextPath));     
    }     
    else {
      index
        .add("CSS_IMPORTS", build.getProductionCssTag(contextPath))
        .add("LIB_IMPORTS", build.getProductionLibsTag(contextPath))
        .add("MAIN_IMPORTS", build.getProductionMainTag(contextPath));
    }

    PrintWriter writer = resp.getWriter();
    index.write(writer);
    writer.close();   
  }
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.