Search in sources :

Example 1 with Html

use of com.googlecode.jatl.Html in project gradle by gradle.

the class ProjectsPageRenderer method render.

@Override
public void render(final Set<Project> projects, final HtmlPageBuilder<Writer> builder) throws IOException {
    final String baseCssLink = builder.requireResource(getClass().getResource("/org/gradle/reporting/base-style.css"));
    final String cssLink = builder.requireResource(getClass().getResource("/org/gradle/api/tasks/diagnostics/htmldependencyreport/style.css"));
    new Html(builder.getOutput()) {

        {
            html();
            head();
            meta().httpEquiv("Content-Type").content("text/html; charset=utf-8");
            meta().httpEquiv("x-ua-compatible").content("IE=edge");
            link().rel("stylesheet").type("text/css").href(baseCssLink).end();
            link().rel("stylesheet").type("text/css").href(cssLink).end();
            title().text("Dependency reports").end();
            end();
            body();
            div().id("content");
            h1().text("Dependency Reports").end();
            div().classAttr("tab");
            table();
            thead();
            tr();
            th().text("Project").end();
            th().text("Description").end();
            end();
            end();
            tbody();
            for (Project project : projects) {
                tr();
                td().a().href(namingScheme.transform(project)).text(project.toString()).end().end();
                td().text(project.getDescription()).end();
                end();
            }
            end();
            end();
            end();
            div().id("footer");
            p();
            text("Generated by ");
            a().href("http://www.gradle.org").text(GradleVersion.current().toString()).end();
            text(" at " + builder.formatDate(new Date()));
            end();
            end();
            end();
            end();
            endAll();
        }
    };
}
Also used : Project(org.gradle.api.Project) Html(com.googlecode.jatl.Html) Date(java.util.Date)

Example 2 with Html

use of com.googlecode.jatl.Html in project gradle by gradle.

the class BuildDashboardGenerator method generate.

private void generate(final HtmlPageBuilder<Writer> builder) {
    final String baseCssLink = builder.requireResource(getClass().getResource("/org/gradle/reporting/base-style.css"));
    final String cssLink = builder.requireResource(getClass().getResource("style.css"));
    new Html(builder.getOutput()) {

        {
            html();
            head();
            meta().httpEquiv("Content-Type").content("text/html; charset=utf-8");
            meta().httpEquiv("x-ua-compatible").content("IE=edge");
            link().rel("stylesheet").type("text/css").href(baseCssLink).end();
            link().rel("stylesheet").type("text/css").href(cssLink).end();
            title().text("Build dashboard").end();
            end();
            body();
            div().id("content");
            if (reports.size() > 0) {
                h1().text("Build reports").end();
                ul();
                for (Report report : reports) {
                    li();
                    if (report.getDestination().exists()) {
                        a().href(GFileUtils.relativePath(outputFile.getParentFile(), getHtmlLinkedFileFromReport(report))).text(report.getDisplayName());
                    } else {
                        span().classAttr("unavailable").text(report.getDisplayName());
                    }
                    end(2);
                }
                end();
            } else {
                h1().text("There are no build reports available.").end();
            }
            div().id("footer");
            p();
            text("Generated by ");
            a().href("http://www.gradle.org").text(GradleVersion.current().toString()).end();
            text(" at " + builder.formatDate(new Date()));
            end();
            end();
            end();
            endAll();
        }
    };
}
Also used : Report(org.gradle.api.reporting.Report) DirectoryReport(org.gradle.api.reporting.DirectoryReport) Html(com.googlecode.jatl.Html)

Example 3 with Html

use of com.googlecode.jatl.Html in project gradle by gradle.

the class ProjectPageRenderer method render.

@Override
public void render(final Project project, final HtmlPageBuilder<Writer> builder) throws IOException {
    final String baseCssLink = builder.requireResource(getClass().getResource("/org/gradle/reporting/base-style.css"));
    final String cssLink = builder.requireResource(getClass().getResource(getReportResourcePath("style.css")));
    final String jqueryLink = builder.requireResource(getClass().getResource("/org/gradle/reporting/jquery.min-1.11.0.js"));
    final String jtreeLink = builder.requireResource(getClass().getResource(getReportResourcePath("jquery.jstree.js")));
    final String scriptLink = builder.requireResource(getClass().getResource(getReportResourcePath("script.js")));
    builder.requireResource(getClass().getResource(getReportResourcePath("tree.css")));
    builder.requireResource(getClass().getResource(getReportResourcePath("d.gif")));
    builder.requireResource(getClass().getResource(getReportResourcePath("d.png")));
    builder.requireResource(getClass().getResource(getReportResourcePath("throbber.gif")));
    new Html(builder.getOutput()) {

        {
            html();
            head();
            meta().httpEquiv("Content-Type").content("text/html; charset=utf-8");
            meta().httpEquiv("x-ua-compatible").content("IE=edge");
            link().rel("stylesheet").type("text/css").href(baseCssLink).end();
            link().rel("stylesheet").type("text/css").href(cssLink).end();
            script().src(jqueryLink).charset("utf-8").end();
            script().src(jtreeLink).charset("utf-8").end();
            script().src(namingScheme.transform(project)).charset("utf-8").end();
            script().src(scriptLink).charset("utf-8").end();
            title().text("Dependency reports").end();
            end();
            body();
            div().id("content");
            h1().text("Dependency Report").end();
            div().classAttr("breadcrumbs");
            a().href("index.html").text("Projects").end();
            text(" > ");
            span().id("projectBreacrumb").end();
            end();
            div().id("insight").end();
            div().id("dependencies").end();
            div().id("footer");
            p();
            text("Generated by ");
            a().href("http://www.gradle.org").text(GradleVersion.current().toString()).end();
            text(" at " + builder.formatDate(new Date()));
            end();
            end();
            end();
            end();
            endAll();
        }
    };
}
Also used : Html(com.googlecode.jatl.Html) Date(java.util.Date)

Example 4 with Html

use of com.googlecode.jatl.Html in project EnrichmentMapApp by BaderLab.

the class CreationParametersPanel method getInfoText.

/**
	 * Get the files and parameters corresponding to the current enrichment map
	 */
private String getInfoText() {
    EMCreationParameters params = map.getParams();
    StringWriter writer = new StringWriter();
    new Html(writer) {

        {
            bind("bold", "font-weight: bold;");
            bind("code", "font-family: Courier,monospaced;");
            html().body().style("font-family: Helvetica,Arial,sans-serif; font-size: 1em;");
            ol();
            addTitle("Cut-Off Values");
            ul();
            addCutOffItem("P-value", params.getPvalue());
            addCutOffItem("FDR Q-value", params.getQvalue());
            if (params.getSimilarityMetric() == SimilarityMetric.JACCARD)
                addCutOffItem("Jaccard", params.getSimilarityCutoff(), "Jaccard Index");
            else if (params.getSimilarityMetric() == SimilarityMetric.OVERLAP)
                addCutOffItem("Overlap", params.getSimilarityCutoff(), "Overlap Index");
            else if (params.getSimilarityMetric() == SimilarityMetric.COMBINED)
                addCutOffItem("Jaccard Overlap Combined", params.getSimilarityCutoff(), "Jaccard Overlap Combined Index (k constant = " + params.getCombinedConstant() + ")");
            end();
            addTitle("Data Sets");
            ol();
            for (EMDataSet ds : map.getDataSetList()) addDataSet(ds);
            end();
            end();
            endAll();
            done();
        }

        Html addTitle(String s) {
            return li().style("${bold} font-size: 1.1em;").text(s + ": ").end();
        }

        Html addCutOffItem(String k, Object v) {
            return addCutOffItem(k, v, null);
        }

        Html addCutOffItem(String k, Object v, String test) {
            li().b().text(k + ": ").end().span().style("${code}").text("" + v).end();
            if (test != null)
                br().span().style("${padding}").text("Test used: ").i().text(test).end().end();
            return end();
        }

        Html addDataSet(EMDataSet ds) {
            li().b().text(ds.getName()).end();
            ul();
            li().text("Gene Sets File: ").span().style("${code}").text(shortenPathname(ds.getDataSetFiles().getGMTFileName())).end().end();
            String ef1 = ds.getDataSetFiles().getEnrichmentFileName1();
            String ef2 = ds.getDataSetFiles().getEnrichmentFileName2();
            if (ef1 != null || ef2 != null) {
                li().text("Data Files:");
                if (ef1 != null)
                    br().span().style("${code}").raw(INDENT).text(shortenPathname(ef1)).end();
                if (ef2 != null)
                    br().span().style("${code}").raw(INDENT).text(shortenPathname(ef2)).end();
                end();
            }
            if (ds.getDataSetFiles().getExpressionFileName() != null) {
                li().text("Expression File: ").span().style("${code}").text(shortenPathname(ds.getDataSetFiles().getExpressionFileName())).end().end();
            }
            if (ds.getDataSetFiles().getGseaHtmlReportFile() != null) {
                li().text("GSEA Report: ").span().style("${code}").text(shortenPathname(ds.getDataSetFiles().getGseaHtmlReportFile())).end().end();
            }
            end();
            return end();
        }
    };
    return writer.getBuffer().toString();
}
Also used : EMCreationParameters(org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters) StringWriter(java.io.StringWriter) Html(com.googlecode.jatl.Html) EMDataSet(org.baderlab.csplugins.enrichmentmap.model.EMDataSet)

Aggregations

Html (com.googlecode.jatl.Html)4 Date (java.util.Date)2 StringWriter (java.io.StringWriter)1 EMCreationParameters (org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters)1 EMDataSet (org.baderlab.csplugins.enrichmentmap.model.EMDataSet)1 Project (org.gradle.api.Project)1 DirectoryReport (org.gradle.api.reporting.DirectoryReport)1 Report (org.gradle.api.reporting.Report)1