Package org.apache.velocity.app

Examples of org.apache.velocity.app.VelocityEngine


            }
        }
    }

    private void generateFeatureOverview() throws Exception {
        VelocityEngine ve = new VelocityEngine();
        ve.init(getProperties());
        Template featureOverview = ve.getTemplate("templates/featureOverview.vm");
        VelocityContextMap contextMap = VelocityContextMap.of(new VelocityContext());
        contextMap.putAll(getGeneralParameters());
        contextMap.put("features", ri.getFeatures());
        contextMap.put("parallel", ReportBuilder.isParallel());
        contextMap.put("total_features", ri.getTotalNumberOfFeatures());
View Full Code Here


    }


    public void generateTagReports() throws Exception {
        for (TagObject tagObject : ri.getTags()) {
            VelocityEngine ve = new VelocityEngine();
            ve.init(getProperties());
            Template featureResult = ve.getTemplate("templates/tagReport.vm");
            VelocityContextMap contextMap = VelocityContextMap.of(new VelocityContext());
            contextMap.putAll(getGeneralParameters());
            contextMap.put("tag", tagObject);
            contextMap.put("time_stamp", ri.timeStamp());
            contextMap.put("report_status_colour", ri.getTagReportStatusColour(tagObject));
View Full Code Here

            }
        }
    }

    public void generateTagOverview() throws Exception {
        VelocityEngine ve = new VelocityEngine();
        ve.init(getProperties());
        Template featureOverview = ve.getTemplate("templates/tagOverview.vm");
        VelocityContextMap contextMap = VelocityContextMap.of(new VelocityContext());
        contextMap.putAll(getGeneralParameters());
        contextMap.put("tags", ri.getTags());
        contextMap.put("total_tags", ri.getTotalTags());
        contextMap.put("total_scenarios", ri.getTotalTagScenarios());
View Full Code Here

        contextMap.put("total_duration", duration);
        generateReport("tag-overview.html", featureOverview, contextMap.getVelocityContext());
    }

    public void generateErrorPage(Exception exception) throws Exception {
        VelocityEngine ve = new VelocityEngine();
        ve.init(getProperties());
        Template errorPage = ve.getTemplate("templates/errorPage.vm");
        VelocityContextMap contextMap = VelocityContextMap.of(new VelocityContext());
        contextMap.putAll(getGeneralParameters());
        contextMap.put("error_message", exception);
        contextMap.put("time_stamp", new SimpleDateFormat("dd-MM-yyyy HH:mm:ss").format(new Date()));
        generateReport("feature-overview.html", errorPage, contextMap.getVelocityContext());
View Full Code Here

    private final VelocityEngine ve;
    private final Logger log; // logger

    private ReportGenerator() {
        ve = new VelocityEngine();

        final Properties props = new Properties();

        props.setProperty("resource.loader", "string");
        props.setProperty("string.resource.loader.class",
View Full Code Here

    StringWriter writer;
    Template pageTemplate;

    public void initialize(String template) {
        context = new VelocityContext();
        engine = new VelocityEngine();
        writer = new StringWriter();
        WebSearchIni.loadProps();
        try {
            engine.init(Vars.velocityProps);
            pageTemplate = engine.getTemplate(template, "UTF-8");
View Full Code Here

      Properties p = new Properties();

      p.setProperty("resource.loader", "file");
      p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
      p.setProperty("file.resource.loader.path", GenApp.properties.getProperty("templatePath"));
      VelocityEngine engine = new VelocityEngine();

      try {
      engine.init(p);
    } catch (Exception e) {
      System.out.println("Oops! We have an exception");
        e.printStackTrace();
    }
View Full Code Here

   * Constructor
   */
  public CodeGenWriter(CodeGenConfig config) {
    this.writerService = new WriterService(config);
    this.config = config;
    this.engine = new VelocityEngine();
    // we have to keep this in sync with our logging system
    // http://velocity.apache.org/engine/releases/velocity-1.5/developer-guide.html#simpleexampleofacustomlogger
    engine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM,
        new CommonsLogLogChute());
    if(config.getTemplateFolder() == null){
View Full Code Here

    }
   
  }

  private void initializeVelocity() throws MojoExecutionException {
    mainVelocityEngine = new VelocityEngine();
    mainVelocityEngine.setProperty("file.resource.loader.path", sourceTemplateRoot);
    if (testTemplateRoot != null) {
      testVelocityEngine = new VelocityEngine();
      testVelocityEngine.setProperty("file.resource.loader.path", testTemplateRoot);
    }

   
    try {
View Full Code Here

   
    if (testOutputDirectory != null && !testOutputDirectory.exists()) {
      testOutputDirectory.mkdirs();
    }

    VelocityEngine mainVelocityEngine = new VelocityEngine();
    mainVelocityEngine.setProperty("file.resource.loader.path", sourceTemplateRoot);
    if (testTemplateRoot != null) {
      testVelocityEngine = new VelocityEngine();
      testVelocityEngine.setProperty("file.resource.loader.path", testTemplateRoot);
    }

   
    try {
      mainVelocityEngine.init();
      if (testVelocityEngine != null) {
        testVelocityEngine.init();
      }
    } catch (Exception e) {
      throw new MojoExecutionException("Unable to initialize velocity", e);
View Full Code Here

TOP

Related Classes of org.apache.velocity.app.VelocityEngine

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.