From a6e8687d71a22887e6b83c54421716432178c5bd Mon Sep 17 00:00:00 2001 From: aaron Date: Tue, 30 Mar 2010 04:20:19 +0000 Subject: [PATCH] implementing a clean way to import the template files into the GATK jar (they should not always get bundled). All further resources should be added to the gatk.resources path id in the build script. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3094 348d0f76-0448-11de-a6fe-93d51630548a --- build.xml | 13 +++++++++++-- .../playground/utils/report/VE2ReportFactory.java | 9 +++------ .../utils/report/templates}/csv_readable.ftl | 0 .../utils/report/templates}/grep_readable.ftl | 0 .../utils/report/templates}/human_readable.ftl | 0 5 files changed, 14 insertions(+), 8 deletions(-) rename {templates/VE2 => java/src/org/broadinstitute/sting/playground/utils/report/templates}/csv_readable.ftl (100%) rename {templates/VE2 => java/src/org/broadinstitute/sting/playground/utils/report/templates}/grep_readable.ftl (100%) rename {templates/VE2 => java/src/org/broadinstitute/sting/playground/utils/report/templates}/human_readable.ftl (100%) diff --git a/build.xml b/build.xml index d95553efc..a79c4dbe9 100644 --- a/build.xml +++ b/build.xml @@ -35,7 +35,15 @@ - + + + + + + + + @@ -138,8 +146,9 @@ + - + diff --git a/java/src/org/broadinstitute/sting/playground/utils/report/VE2ReportFactory.java b/java/src/org/broadinstitute/sting/playground/utils/report/VE2ReportFactory.java index 23b59e911..770c23998 100644 --- a/java/src/org/broadinstitute/sting/playground/utils/report/VE2ReportFactory.java +++ b/java/src/org/broadinstitute/sting/playground/utils/report/VE2ReportFactory.java @@ -22,7 +22,7 @@ import java.util.Map; */ public class VE2ReportFactory { // where templates are stored - public static final String ve2templateDir = "templates/VE2"; + public static final String ve2templateDir = "templates/"; // our default output type public static final VE2TemplateType defaultReportFormat = VE2TemplateType.Table; @@ -71,11 +71,8 @@ public class VE2ReportFactory { */ private static Template createTemplate(VE2TemplateType template) { Configuration cfg = new Configuration(); - try { - cfg.setDirectoryForTemplateLoading(new File(ve2templateDir)); - } catch (IOException e) { - throw new StingException("Unable to find template directory " + ve2templateDir,e); - } + cfg.setClassForTemplateLoading(VE2ReportFactory.class,ve2templateDir); + cfg.setObjectWrapper(new DefaultObjectWrapper()); Template temp = null; try { diff --git a/templates/VE2/csv_readable.ftl b/java/src/org/broadinstitute/sting/playground/utils/report/templates/csv_readable.ftl similarity index 100% rename from templates/VE2/csv_readable.ftl rename to java/src/org/broadinstitute/sting/playground/utils/report/templates/csv_readable.ftl diff --git a/templates/VE2/grep_readable.ftl b/java/src/org/broadinstitute/sting/playground/utils/report/templates/grep_readable.ftl similarity index 100% rename from templates/VE2/grep_readable.ftl rename to java/src/org/broadinstitute/sting/playground/utils/report/templates/grep_readable.ftl diff --git a/templates/VE2/human_readable.ftl b/java/src/org/broadinstitute/sting/playground/utils/report/templates/human_readable.ftl similarity index 100% rename from templates/VE2/human_readable.ftl rename to java/src/org/broadinstitute/sting/playground/utils/report/templates/human_readable.ftl