Examples of FileTemplateLoader


Examples of freemarker.cache.FileTemplateLoader

     *
     * @throws IOException
     */
    public GeoServerTemplateLoader(Class caller, GeoServerResourceLoader rl) throws IOException {
        //create a file template loader to delegate to
        fileTemplateLoader = new FileTemplateLoader(rl.getBaseDirectory());

        //grab the catalog and store a reference
        catalog = (Catalog)GeoServerExtensions.bean("catalog");

        //create a class template loader to delegate to
View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

    public static Configuration newFreeMarkerConfiguration(List<File> templateRootDirs,String defaultEncoding,String templateName) throws IOException {
        Configuration conf = new Configuration();
     
      FileTemplateLoader[] templateLoaders = new FileTemplateLoader[templateRootDirs.size()];
      for(int i = 0; i < templateRootDirs.size(); i++) {
        templateLoaders[i] = new FileTemplateLoader((File)templateRootDirs.get(i));
      }
      MultiTemplateLoader multiTemplateLoader = new MultiTemplateLoader(templateLoaders);
     
      conf.setTemplateLoader(multiTemplateLoader);
      conf.setNumberFormat("###############");
View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

            }
            else
            {
               oLog.info( "freemarker > template load path > adding directory > " + oDir.getDir() );

               oTemplateLoaderList.add( new FileTemplateLoader( oDir.getDir() ) );
            }
         }
         else if ( oLoaderPathItem instanceof Config.Templating.TemplatePath.LoaderClass )
         {
            Config.Templating.TemplatePath.LoaderClass oLoaderClass = ( Config.Templating.TemplatePath.LoaderClass ) oLoaderPathItem;
View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

     * <p/>
     * The WebappTemplateLoader attempts to resolve templates relative to the web root folder
     */
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                log.error("Invalid template path specified: " + e.getMessage(), e);
            }
        }

View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

        File file = path.getFile()// will fail if not resolvable in the file system
        if (logger.isDebugEnabled()) {
          logger.debug(
              "Template loader path [" + path + "] resolved to file path [" + file.getAbsolutePath() + "]");
        }
        return new FileTemplateLoader(file);
      }
      catch (IOException ex) {
        if (logger.isDebugEnabled()) {
          logger.debug("Cannot resolve template loader path [" + templateLoaderPath +
              "] to [java.io.File]: using SpringTemplateLoader as fallback", ex);
View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

        File file = path.getFile()// will fail if not resolvable in the file system
        if (logger.isDebugEnabled()) {
          logger.debug(
              "Template loader path [" + path + "] resolved to file path [" + file.getAbsolutePath() + "]");
        }
        return new FileTemplateLoader(file);
      }
      catch (IOException ex) {
        if (logger.isDebugEnabled()) {
          logger.debug("Cannot resolve template loader path [" + templateLoaderPath +
              "] to [java.io.File]: using SpringTemplateLoader as fallback", ex);
View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

     * <p/>
     * The WebappTemplateLoader attempts to resolve templates relative to the web root folder
     */
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                LOG.error("Invalid template path specified: " + e.getMessage(), e);
            }
        }

View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

     * <p/>
     * The WebappTemplateLoader attempts to resolve templates relative to the web root folder
     */
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                log.error("Invalid template path specified: " + e.getMessage(), e);
            }
        }

View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

    private static final Logger LOG = LoggerFactory.getLogger(BundleFreemarkerManager.class);

    @Override
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                if (LOG.isErrorEnabled())
                    LOG.error("Invalid template path specified: [#0]", e, e.getMessage());
            }
        }
View Full Code Here

Examples of freemarker.cache.FileTemplateLoader

     * <p/>
     * The WebappTemplateLoader attempts to resolve templates relative to the web root folder
     */
    protected TemplateLoader getTemplateLoader(ServletContext servletContext) {
        // construct a FileTemplateLoader for the init-param 'TemplatePath'
        FileTemplateLoader templatePathLoader = null;

        String templatePath = servletContext.getInitParameter("TemplatePath");
        if (templatePath == null) {
            templatePath = servletContext.getInitParameter("templatePath");
        }

        if (templatePath != null) {
            try {
                templatePathLoader = new FileTemplateLoader(new File(templatePath));
            } catch (IOException e) {
                LOG.error("Invalid template path specified: " + e.getMessage(), 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.