Package org.apache.velocity.app

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


    public void testIncludeRelativePath() throws Exception
    {
        VelocityEngine ve = new VelocityEngine();
        ve.setProperty(RuntimeConstants.EVENTHANDLER_INCLUDE, "org.apache.velocity.app.event.implement.IncludeRelativePath");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        Template template;
        FileOutputStream fos;
        Writer fwriter;
View Full Code Here


     */
    private void testFile(String basefilename, Map properties)
    throws Exception
    {
        VelocityEngine ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
    
        for (Iterator i = properties.keySet().iterator(); i.hasNext();)
        {
            String key = (String) i.next();
            String value = (String) properties.get(key);
View Full Code Here

    
        for (Iterator i = properties.keySet().iterator(); i.hasNext();)
        {
            String key = (String) i.next();
            String value = (String) properties.get(key);
            ve.addProperty(key, value);
        }
       
        ve.init();
       
        Template template;
View Full Code Here

                log("Using templatePath: " + templatePath, project.MSG_VERBOSE);
                ve.setProperty("torque" + VelocityEngine.FILE_RESOURCE_LOADER_PATH,
                        templatePath);

                // TR: We need our own FileResourceLoader
                ve.addProperty(VelocityEngine.RESOURCE_LOADER, "torquefile");
                ve.setProperty("torquefile." + VelocityEngine.RESOURCE_LOADER
                            + ".instance",
                        new TorqueFileResourceLoader(this));
            }
View Full Code Here

            if (useClasspath)
            {
                log("Using classpath");
                // TR: We need our own ClasspathResourceLoader
                ve.addProperty(VelocityEngine.RESOURCE_LOADER, "classpath");

                ve.setProperty("classpath." + VelocityEngine.RESOURCE_LOADER
                        + ".instance", new TorqueClasspathResourceLoader(this));

                ve.setProperty("classpath." + VelocityEngine.RESOURCE_LOADER
View Full Code Here

            }
           
            if (useClasspath)
            {
              log("Using classpath");
                ve.addProperty(
                    VelocityEngine.RESOURCE_LOADER, "classpath");
           
                ve.setProperty(
                    "classpath." + VelocityEngine.RESOURCE_LOADER + ".class",
                        "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
View Full Code Here

    public void testIncludeNotFound() throws Exception
    {
        VelocityEngine ve = new VelocityEngine();
        ve.setProperty(RuntimeConstants.EVENTHANDLER_INCLUDE, "org.apache.velocity.app.event.implement.IncludeNotFound");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        Template template;
        FileOutputStream fos;
        Writer fwriter;
View Full Code Here

    public void testIncludeRelativePath() throws Exception
    {
        VelocityEngine ve = new VelocityEngine();
        ve.setProperty(RuntimeConstants.EVENTHANDLER_INCLUDE, "org.apache.velocity.app.event.implement.IncludeRelativePath");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        Template template;
        FileOutputStream fos;
        Writer fwriter;
View Full Code Here

            }

            if (useClasspath)
            {
                log("Using classpath");
                ve.addProperty(
                    VelocityEngine.RESOURCE_LOADER, "classpath");

                ve.setProperty(
                    "classpath." + VelocityEngine.RESOURCE_LOADER + ".class",
                        "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
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.