package com.sistic.ticketing.notification.email.velocity; import java.io.StringWriter; import java.util.*; import java.util.ArrayList; import java.util.Map; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.app.Velocity; import org.apache.velocity.exception.ParseErrorException; import org.apache.velocity.exception.ResourceNotFoundException; import java.util.Properties; public class velocityTemplateReader{ static String vmPath = "/Server1/sop/templates/"; static String language = "vmTemplate.vm"; public String handleVelocity(ArrayList velocityList, ArrayList notificationList) throws Exception { vmPath = (String)velocityList.get(0); language = (String)velocityList.get(1); Properties p = new Properties(); p.setProperty( "resource.loader", "class" ); p.setProperty( "class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader" ); p.setProperty( "file.resource.loader.path", "/Server1/sop/templates/" ); //VelocityEngine ve = new VelocityEngine(); //ve.init(p); Velocity.init(p); System.out.println("Inside the velocityTest_________________________"); ArrayList orderList = new ArrayList(); ArrayList lineList = new ArrayList(); orderList.add(notificationList.get(0)); for (int i =1; i