private void initVelocityEngine() { engine = new VelocityEngine(); engine.addProperty("resource.loader", "class, file"); engine.addProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); engine.addProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); engine.addProperty("file.resource.loader.path", "/, ."); engine.setProperty("runtime.references.strict", true); engine.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.NullLogSystem"); }
private void initializeVelocity() { this.velocityEngine = new VelocityEngine(); // These properties tell Velocity to use its own classpath-based // loader, then drop down to check the root and the current folder velocityEngine.addProperty("resource.loader", "class, file"); velocityEngine.addProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); velocityEngine.addProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); velocityEngine.addProperty("file.resource.loader.path", "/, ."); velocityEngine.setProperty("runtime.references.strict", true); // Set whitespace gobbling to Backward Compatible (BC) // http://velocity.apache.org/engine/2.0/developer-guide.html#space-gobbling velocityEngine.setProperty("space.gobbling", "bc"); }
/** * Instantiates a new CSdkGenerator. */ public CSdkGenerator() { velocityEngine = new VelocityEngine(); velocityEngine.addProperty("resource.loader", "class, file"); velocityEngine.addProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); velocityEngine.addProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); velocityEngine.addProperty("file.resource.loader.path", "/, ."); velocityEngine.setProperty("runtime.references.strict", true); velocityEngine.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.NullLogSystem"); }
public StatsServlet(StatsPlugin statsPlugin) throws UnavailableException { this.statsPlugin = statsPlugin; this.velocityEngine = new VelocityEngine(); // These two properties tell Velocity to use its own classpath-based loader velocityEngine.addProperty("resource.loader", "class"); velocityEngine.addProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); velocityEngine.setProperty("runtime.references.strict", true); String logChuteName = "org.apache.velocity.runtime.log.NullLogChute"; velocityEngine.setProperty("runtime.log.logsystem.class", logChuteName); }
log.info("Setting jar resource path " + jarResourcePath); final VelocityEngine ve = azkabanWebServer.getVelocityEngine(); ve.addProperty("jar.resource.loader.path", jarResourcePath);
ve.addProperty("jar.resource.loader.path", jarResourcePath);
@Override protected void postProcessVelocityEngine(VelocityEngine velocityEngine) { super.postProcessVelocityEngine(velocityEngine); velocityEngine.setProperty(ROSE_MACRO_RESOURCE_LOADER_CLASS, ClasspathResourceLoader.class .getName()); velocityEngine.addProperty(VelocityEngine.RESOURCE_LOADER, ROSE_MACRO_RESOURCE_LOADER_NAME); velocityEngine.addProperty(VelocityEngine.VM_LIBRARY, ROSE_MACRO_LIBRARY); if (logger.isInfoEnabled()) { logger.info("ClasspathResourceLoader with name '" + ROSE_MACRO_RESOURCE_LOADER_NAME + "' added to configured VelocityEngine"); } } }
public StatsServlet(StatsPlugin statsPlugin) throws UnavailableException { this.statsPlugin = statsPlugin; this.velocityEngine = new VelocityEngine(); // These two properties tell Velocity to use its own classpath-based loader velocityEngine.addProperty("resource.loader", "class"); velocityEngine.addProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); }
public BaseVelocityServlet() { velocity = new VelocityEngine(); velocity.addProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, JdkLogChute.class.getName()); velocity.addProperty(Velocity.RESOURCE_LOADER, "classpath"); velocity.addProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); }
public UsersServlet(UserManager userManager, PageBuilderService pageBuilderService) { this.userManager = userManager; velocity = new VelocityEngine(); velocity.addProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, JdkLogChute.class.getName()); velocity.addProperty(Velocity.RESOURCE_LOADER, "classpath"); velocity.addProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); this.pageBuilderService = pageBuilderService; }
public RefImplStreamsServlet(WebResourceManager webResourceManager, I18nResolver i18nResolver, StreamsFeedUrlBuilderFactory streamsFeedUrlBuilderFactory) { this.webResourceManager = webResourceManager; this.i18nResolver = i18nResolver; this.streamsFeedUrlBuilderFactory = streamsFeedUrlBuilderFactory; velocity = new VelocityEngine(); velocity.addProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, JdkLogChute.class.getName()); velocity.addProperty(Velocity.RESOURCE_LOADER, "classpath"); velocity.addProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); }
public ConfluenceStreamsServlet(WebResourceManager webResourceManager, I18nResolver i18nResolver, StreamsFeedUriBuilderFactory streamsFeedUriBuilderFactory) { this.webResourceManager = webResourceManager; this.i18nResolver = i18nResolver; this.streamsFeedUriBuilderFactory = streamsFeedUriBuilderFactory; velocity = new VelocityEngine(); velocity.addProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, JdkLogChute.class.getName()); velocity.addProperty(Velocity.RESOURCE_LOADER, "classpath"); velocity.addProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); }
public TraceClientServlet() { this.velocityEngine = new VelocityEngine(); this.activeCollections = new HashMap<Integer, TraceCollection>(); this.activeSpans = new ArrayList<Span>(); // These two properties tell Velocity to use its own classpath-based loader velocityEngine.addProperty("resource.loader", "class"); velocityEngine.addProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); }
static VelocityEngine getVelocityEngine(File templateRoot) { VelocityEngine velocityEngine = new VelocityEngine(); velocityEngine.addProperty("file.resource.loader.path", templateRoot.getAbsolutePath()); velocityEngine.init(); return velocityEngine; }
static VelocityEngine getVelocityEngine(File templateRoot) { VelocityEngine velocityEngine = new VelocityEngine(); velocityEngine.addProperty("file.resource.loader.path", templateRoot.getAbsolutePath()); velocityEngine.init(); return velocityEngine; }
private void initStringEngine() { stringEngine = new VelocityEngine(); stringEngine.setProperty(Velocity.RESOURCE_LOADER, "string"); stringEngine.addProperty("string.resource.loader.class", StringResourceLoader.class.getName()); stringEngine.addProperty("string.resource.loader.repository.static", "false"); stringEngine.init(); }
private void overrideProperty(String key, Object value) { // "userdirective" property can have multiple values; all other overrideable // properties that we set at init time should have single values if (key.equals("userdirective")) { velocity.addProperty(key, value); } else { velocity.setProperty(key, value); } }
public StatsServlet(StatsPlugin statsPlugin) throws UnavailableException { this.statsPlugin = statsPlugin; this.velocityEngine = new VelocityEngine(); // These two properties tell Velocity to use its own classpath-based loader velocityEngine.addProperty("resource.loader", "class"); velocityEngine.addProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); velocityEngine.setProperty("runtime.references.strict", true); String logChuteName = "org.apache.velocity.runtime.log.NullLogChute"; velocityEngine.setProperty("runtime.log.logsystem.class", logChuteName); }
private void overrideProperty(String key, Object value) { // "userdirective" property can have multiple values; all other overrideable // properties that we set at init time should have single values if (key.equals("userdirective")) { velocity.addProperty(key, value); } else { velocity.setProperty(key, value); } }
@Override public void init(Config config) { engine = new VelocityEngine(); engine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.Log4JLogChute"); engine.setProperty("runtime.log.logsystem.log4j.logger", LOG.getName()); engine.setProperty(Velocity.RESOURCE_LOADER, "string"); engine.addProperty("string.resource.loader.class", StringResourceLoader.class.getName()); engine.addProperty("string.resource.loader.repository.static", "false"); engine.init(); stringResourceRepository = (StringResourceRepository) engine.getApplicationAttribute(StringResourceLoader.REPOSITORY_NAME_DEFAULT); policyDefinitionRepository = new HashMap<>(); }