Package org.apache.sirona.reporting.web.plugin.api

Examples of org.apache.sirona.reporting.web.plugin.api.Template


    private static final Role ROLLBACKED = new Role("jta-rollbacked", Unit.UNARY);
    private static final Role ACTIVE = new Role("jta-active", Unit.UNARY);

    @Regex
    public Template home() {
        return new Template("jta/jta.vm");
    }
View Full Code Here


import java.util.Map;

public class XMLFormat implements Format {
    @Override
    public Template render(final Map<String, ?> params) {
        return new Template("/templates/report/report-xml.vm",
            new MapBuilder<String, Object>()
                .set("MetricData", MetricData.class)
                .set("counters", Repository.INSTANCE.counters())
                .build(), false);
    }
View Full Code Here

import java.util.Map;

public class JSONFormat implements Format {
    @Override
    public Template render(final Map<String, ?> params) {
        return new Template("/templates/report/report-json.vm",
            new MapBuilder<String, Object>()
                .set("MetricData", MetricData.class)
                .set("counters", Repository.INSTANCE.counters())
                .build(), false);
    }
View Full Code Here

    public static final String HEADER = "Counter" + SEPARATOR + "Role" + SEPARATOR + toCsv(ATTRIBUTES_ORDERED_LIST);

    @Override
    public Template render(final Map<String, ?> params) {
        final Unit timeUnit = timeUnit(params);
        return new Template("/templates/report/report-csv.vm",
                        new MapBuilder<String, Object>()
                        .set("headers", HEADER)
                        .set("separator", SEPARATOR)
                        .set("lines", snapshot(timeUnit, format(params, null)))
                        .build(), false);
View Full Code Here

    public static final String NUMBER_FORMAT = "###,###,###,##0.00"; // DecimalFormat is not thread safe so don't init it statically

    @Override
    public Template render(final Map<String, ?> params) {
        final Unit timeUnit = timeUnit(params);
        return new Template("report/report.vm",
            new MapBuilder<String, Object>()
                .set(Map.class.cast(params))
                .set("headers", ATTRIBUTES_ORDERED_LIST)
                .set("data", snapshotByPath(timeUnit, format(params, NUMBER_FORMAT)))
                .build());
View Full Code Here

            }
        } else {
            counters.put("", generateLine(counter, timeUnit, format));
        }

        return new Template("report/counter.vm",
            new MapBuilder<String, Object>()
                .set("headers", HTMLFormat.ATTRIBUTES_ORDERED_LIST)
                .set("counter", counter)
                .set("counters", counters)
                .build());
View Full Code Here

    public static final String HEADER = "Monitor" + SEPARATOR + "Role" + SEPARATOR + toCsv(ATTRIBUTES_ORDERED_LIST);

    @Override
    public Template render(final Map<String, ?> params) {
        final Unit timeUnit = timeUnit(params);
        return new Template("/templates/report/report-csv.vm",
                        new MapBuilder<String, Object>()
                        .set("headers", HEADER)
                        .set("separator", SEPARATOR)
                        .set("lines", snapshot(timeUnit, format(params, null)))
                        .build(), false);
View Full Code Here

TOP

Related Classes of org.apache.sirona.reporting.web.plugin.api.Template

Copyright © 2018 www.massapicom. 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.