Examples of SiteRenderingContext


Examples of org.apache.maven.doxia.siterenderer.SiteRenderingContext

    return file;
  }

  private void render(final Locale locale) throws IOException, MojoExecutionException, MojoFailureException {
    final SiteRenderingContext context = createSiteRenderingContext(locale);

    context.setInputEncoding(getInputEncoding());
    context.setOutputEncoding(getOutputEncoding());
    context.setValidate(validate);
    if (validate) {
      getLog().info("Validation is switched on, xml input documents will be validated!");
    }

    final ChangeFreq changeFreq = ChangeFreq.valueOf(this.changeFreq.toUpperCase());
    if (changeFreq == null) {
      getLog().error("Change frequency must be set or is wrong.");
      return;
    }

    final File outputDir = getOutputDirectory(locale);
    getLog().info("Generating Sitemap.");

    final W3CDateFormat dateFormat = new W3CDateFormat(Pattern.DAY);
    final WebSitemapGenerator generator = WebSitemapGenerator.builder(project.getUrl(), outputDir).autoValidate(validate)
        .dateFormat(dateFormat).build();
    new Sitemap(getOutputEncoding(), i18n).generate(project, context.getDecoration(), generator, changeFreq);
    final List<File> files = generator.write();
    for (final File file : files) {
      getLog().info("Generated Sitemap: " + file.getPath());
    }
  }
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.