Examples of mergeTemplate()


Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

        ctx.put("names", names);
        ctx.put("values", values);

        StringWriter writer = new StringWriter();

        if (engine.mergeTemplate(template, ctx, writer) != true) {
            throw new Exception("Error processing template");
        }

        writer.flush();
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

      }
     
      String resourcePath = localizeResourceName(pathName, resourceKey, locale);
         
      Writer outputWriter = new OutputWriter(output);
      engine.mergeTemplate(resourcePath, "UTF-8", context, outputWriter);
      outputWriter.flush();
    } catch (IOException e) {
      throw new ManifoldCFException(e.getMessage(),e);
    }
  }
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

      VelocityEngine ve = new VelocityEngine();
      ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
      ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
     
      ve.mergeTemplate(
        "screenshare.vm"
        , "UTF-8"
        , ctx
        , response.getWriter());
    } catch (Exception er) {
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

      VelocityEngine ve = new VelocityEngine();
      ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
      ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
      ve.setProperty(Log4JLogChute.RUNTIME_LOG_LOG4J_LOGGER, Log4JLogChute.class.getName());
     
      ve.mergeTemplate(
        "screenshare.vm"
        , "UTF-8"
        , ctx
        , response.getWriter());
    } catch (Exception er) {
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

      VelocityEngine ve = new VelocityEngine();
      ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
      ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
      ve.setProperty(Log4JLogChute.RUNTIME_LOG_LOG4J_LOGGER, Log4JLogChute.class.getName());
     
      ve.mergeTemplate(
        "screenshare.vm"
        , "UTF-8"
        , ctx
        , response.getWriter());
    } catch (Exception er) {
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

      }
     
      String resourcePath = localizeResourceName(pathName, resourceKey, locale);
         
      Writer outputWriter = new OutputWriter(output);
      engine.mergeTemplate(resourcePath, "UTF-8", context, outputWriter);
      outputWriter.flush();
    } catch (IOException e) {
      throw new ManifoldCFException(e.getMessage(),e);
    }
  }
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

        OutputStream stream = new FileOutputStream(
                new File(dir, name + ".html"));
        try {
            Writer out = new OutputStreamWriter(stream, "UTF-8");
            try {
                engine.mergeTemplate(
                        "template.html", "UTF-8", context, out);
            } finally {
                out.close();
            }
        } finally {
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

      }
     
      String resourcePath = localizeResourceName(pathName, resourceKey, locale);
         
      Writer outputWriter = new OutputWriter(output);
      engine.mergeTemplate(resourcePath, StandardCharsets.UTF_8.name(), context, outputWriter);
      outputWriter.flush();
    } catch (IOException e) {
      throw new ManifoldCFException(e.getMessage(),e);
    }
  }
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

       
        VelocityContext velocityContext;
        StringWriter result = new StringWriter();
        try {
            velocityContext = new VelocityContext(model);
            velocityEngine.mergeTemplate("eu/planets_project/tb/"+templateName+".vm", velocityContext, result);
        } catch  (VelocityException ex) {
            log.error("Mailing failed! :: "+ex);
            return;
        } catch  (RuntimeException ex) {
            log.error("Mailing failed! :: "+ex);
View Full Code Here

Examples of org.apache.velocity.app.VelocityEngine.mergeTemplate()

        StringWriter w2 = new StringWriter();

        try
        {
            ve1.mergeTemplate("instanceexample.vm", context, w1);
            ve2.mergeTemplate("instanceexample.vm", context, w2);
        }
        catch (Exception e )
        {
            System.out.println("Problem merging template : " + e );
        }
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.