Exemplo n.º 1
0
  private void processDefaultTemplates() {
    ContextBuilder context = new ContextBuilder();
    fillProject(context.putSubContext("project"));
    fillWiki(context.putSubContext("wiki"));
    fillBlog(context.putSubContext("blog"));
    fillSprintBacklog(context.putSubContext("sprintBacklog"));
    fillProductBacklog(context.putSubContext("productBacklog"));
    fillBugs(context);
    fillIdeas(context);
    fillClosedIssues(context);
    fillReleases(context);
    fillIssues(context);
    fillStories(context);

    File[] templateFiles = templateDir.listFiles();
    if (templateFiles == null) return;
    for (File templateFile : templateFiles) {
      String templateName = templateFile.getName();
      if (!templateName.endsWith(".vm")) continue;
      if (templateName.equals(Velocity.LIB_TEMPLATE_NAME)) continue;
      if (templateName.startsWith("iss.")) continue;
      if (templateName.startsWith("blg.")) continue;
      if (templateName.startsWith("sto.")) continue;
      String outputFileName = Str.removeSuffix(templateName, ".vm");
      velocity.processTemplate(
          templateName, new File(outputDir.getPath() + "/" + outputFileName), context);
    }
  }
Exemplo n.º 2
0
  private void processEntityTemplate(ContextBuilder context, String reference) {
    fillProject(context.putSubContext("project"));
    fillProductBacklog(context.putSubContext("productBacklog"));
    fillSprintBacklog(context.putSubContext("sprintBacklog"));
    fillWiki(context.putSubContext("wiki"));

    String prefix = reference.substring(0, 3);
    File[] templateFiles = templateDir.listFiles();
    if (templateFiles == null) return;
    for (File templateFile : templateFiles) {
      String templateName = templateFile.getName();
      if (!templateName.endsWith(".vm")) continue;
      if (!templateName.startsWith(prefix + ".")) continue;
      String outputFileName = Str.removeSuffix(templateName, ".vm");
      outputFileName = Str.removePrefix(outputFileName, prefix + ".");
      outputFileName = reference + "." + outputFileName;
      velocity.processTemplate(
          templateName, new File(outputDir.getPath() + "/" + outputFileName), context);
    }
  }