Package freemarker.cache

Examples of freemarker.cache.TemplateLoader


    private Configuration initFTLConfig(InitParams initParams,
            AppResources resources, String ftlPath) {
       
        logger.debug("initializing freemarker Configuration...");
        Configuration config = new Configuration();
        TemplateLoader templateLoader = getTemplateLoader(initParams, resources, ftlPath);
        config.setTemplateLoader(templateLoader);
        config.setObjectWrapper(new DefaultObjectWrapper());
        return config;
    }
View Full Code Here


        Map vars = new HashMap();
        vars.put("name", "value");

        Configuration conf = FreemarkerTemplateEngine.createConfiguration(loader, settings, vars, null);

        TemplateLoader templateLoader = conf.getTemplateLoader();
        assertTrue(ResourceLoaderTemplateLoader.class.isInstance(templateLoader));
        ResourceLoaderTemplateLoader resourceLoaderTemplateLoader = (ResourceLoaderTemplateLoader) templateLoader;
        assertSame(loader, resourceLoaderTemplateLoader.getResourceLoader());

        assertEquals(6, conf.getSharedVariableNames().size());
View Full Code Here

        Map vars = new HashMap();
        vars.put("name", "value");

        Configuration conf = FreemarkerTemplateEngine.createConfiguration(loader, settings, vars);

        TemplateLoader templateLoader = conf.getTemplateLoader();
        assertTrue(ResourceLoaderTemplateLoader.class.isInstance(templateLoader));
        ResourceLoaderTemplateLoader resourceLoaderTemplateLoader = (ResourceLoaderTemplateLoader) templateLoader;
        assertSame(loader, resourceLoaderTemplateLoader.getResourceLoader());

        assertEquals(6, conf.getSharedVariableNames().size());
View Full Code Here

     
    throw new ExporterException("Could not find template with name: " + name);
    }*/
   
    public boolean templateExists(String templateName) {
      TemplateLoader templateLoader = freeMarkerEngine.getTemplateLoader();
     
        try {
      return templateLoader.findTemplateSource(templateName)!=null;
    }
    catch (IOException e) {
      throw new ExporterException("templateExists for " + templateName + " failed", e);
    }
    }
View Full Code Here

     * @param templatePath the template path to create a loader for
     * @return a newly created template loader
     * @throws IOException
     */
    protected TemplateLoader createTemplateLoader(ServletContext servletContext, String templatePath) {
        TemplateLoader templatePathLoader = null;

         try {
             if(templatePath!=null){
                 if (templatePath.startsWith("class://")) {
                     // substring(7) is intentional as we "reuse" the last slash
View Full Code Here

     * @param templatePath the template path to create a loader for
     * @return a newly created template loader
     * @throws IOException
     */
    protected TemplateLoader createTemplateLoader(ServletContext servletContext, String templatePath) {
        TemplateLoader templatePathLoader = null;

         try {
             if(templatePath!=null){
                 if (templatePath.startsWith("class://")) {
                     // substring(7) is intentional as we "reuse" the last slash
View Full Code Here

    // Register template loaders that are supposed to kick in late.
    if (this.postTemplateLoaders != null) {
      this.templateLoaders.addAll(this.postTemplateLoaders);
    }

    TemplateLoader loader = getAggregateTemplateLoader(this.templateLoaders);
    if (loader != null) {
      config.setTemplateLoader(loader);
    }

    postProcessConfiguration(config);
View Full Code Here

    // Register template loaders that are supposed to kick in late.
    if (this.postTemplateLoaders != null) {
      this.templateLoaders.addAll(this.postTemplateLoaders);
    }

    TemplateLoader loader = getAggregateTemplateLoader(this.templateLoaders);
    if (loader != null) {
      config.setTemplateLoader(loader);
    }

    postProcessConfiguration(config);
View Full Code Here

     * @param templatePath the template path to create a loader for
     * @return a newly created template loader
     * @throws IOException
     */
    protected TemplateLoader createTemplateLoader(ServletContext servletContext, String templatePath) {
        TemplateLoader templatePathLoader = null;

         try {
             if(templatePath!=null){
                 if (templatePath.startsWith("class://")) {
                     // substring(7) is intentional as we "reuse" the last slash
View Full Code Here

     * @param templatePath the template path to create a loader for
     * @return a newly created template loader
     * @throws IOException
     */
    protected TemplateLoader createTemplateLoader(ServletContext servletContext, String templatePath) {
        TemplateLoader templatePathLoader = null;

         try {
             if(templatePath!=null){
                 if (templatePath.startsWith("class://")) {
                     // substring(7) is intentional as we "reuse" the last slash
View Full Code Here

TOP

Related Classes of freemarker.cache.TemplateLoader

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.