Examples of BadReportSyntaxException


Examples of com.cfinkel.reports.exceptions.BadReportSyntaxException

        }

        //get queries before outputs
        for (QueryElement queryElement : reportElement.getQuery()) {
            if (queries.get(queryElement.getName()) != null)
                throw new BadReportSyntaxException("Query named '" + queryElement.getName() + "' already exists.");
            Query query;
            if (queryElement instanceof PreparedQueryElement) {
                query = new PreparedQuery((PreparedQueryElement)queryElement,this);
            } else {
                query = new GeneratedQuery((GeneratedQueryElement)queryElement);
            }
            queries.put(queryElement.getName(),query);

        }

// get outputs
        for (OutputElement outputElement : reportElement.getOutput()) {
            if (outputs.get(outputElement.getName()) != null) {
                throw new BadReportSyntaxException("There are more than one output named '" + outputElement.getName());
            }
            Output output = new Output(outputElement,this);
            outputs.put(outputElement.getName(),output);
        }
View Full Code Here

Examples of com.cfinkel.reports.exceptions.BadReportSyntaxException

        this.formats = new ObjectsByColumn<Format>();

        if (outputElement.getQueryRef() != null) {
            query = report.getQueries().get(outputElement.getQueryRef());
            if (query == null)
                throw new BadReportSyntaxException("No query " + outputElement.getQueryRef() + " found.");

        } else if (outputElement.getQuery() != null) {
            PreparedQueryElement queryElement = outputElement.getQuery();
            if (report.getQueries().get(queryElement.getName()) != null)
                throw new BadReportSyntaxException("Query named " + queryElement.getName() + " already present in report");
            query = new PreparedQuery(queryElement,report,outputElement);
            // add query to report:
            report.getQueries().put(queryElement.getName(),query);

        } else {
            GeneratedQueryElement queryElement = outputElement.getGeneratedQuery();
            if (report.getQueries().get(queryElement.getName()) != null)
                throw new BadReportSyntaxException("Query named " + queryElement.getName() + " already present in report");

            query = new GeneratedQuery(queryElement,outputElement);
            // add query to report:
            report.getQueries().put(queryElement.getName(),query);
        }

        updatePostProcessClass();

        chart =  outputElement.getChart() == null ? Chart.TABLE : outputElement.getChart().getType();

        int i = 1;

        // formats:
        try {
            for (FormatElement formatElement : outputElement.getFormat()) {
                Format format = new Format(formatElement.getValue());
                formats.addByColName(format,formatElement.getColumn());
            }
        } catch (Exception e) {
            log.error("exception adding formats",e);
            throw new BadReportSyntaxException("Exception adding formats");
        }

        //drilldowns:
        drillDowns = new ObjectsByColumn<DrillDownElement>();
        for (DrillDownElement drillDownElement : outputElement.getDrillDown()) {
View Full Code Here

Examples of com.cfinkel.reports.exceptions.BadReportSyntaxException

            String className = outputElement.getPostProcessClass();
            try {
                Class clazz = AppData.getCustomClassLoader().loadClass(className);
                postQueryProcessor = (PostQueryProcessor)clazz.newInstance();
            } catch (InstantiationException e) {
                throw new BadReportSyntaxException("Class " + className + " cannot be abstract or interface.");
            } catch (IllegalAccessException e) {
                throw new BadReportSyntaxException("No access to class " + className);
            } catch (ClassNotFoundException e) {
                throw new BadReportSyntaxException("Can't find class " + className);
            }
        }

    }
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.