Package org.eclipse.birt.report.service.api

Examples of org.eclipse.birt.report.service.api.ReportServiceException


    @Override
    public String runReport(IViewerReportDesignHandle design, String outputDocName, InputOptions runOptions, Map parameters,
            Map displayTexts, List<Exception> errorList) throws ReportServiceException {

        if (design == null || design.getDesignObject( ) == null) {
            throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
        }

        IReportRunnable runnable;
        HttpServletRequest request = (HttpServletRequest) runOptions.getOption(InputOptions.OPT_REQUEST);
        Locale locale = (Locale) runOptions.getOption(InputOptions.OPT_LOCALE);
        TimeZone timeZone = (TimeZone) runOptions.getOption(InputOptions.OPT_TIMEZONE);

        ViewerAttributeBean attrBean = (ViewerAttributeBean) request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
        // Set parameters
        Map parsedParams = attrBean.getParameters();
        if (parameters != null) {
            parsedParams.putAll(parameters);
        }
        // Set display Text of select parameters
        Map displayTextMap = attrBean.getDisplayTexts();
        if (displayTexts != null) {
            displayTextMap.putAll(displayTexts);
        }

        runnable = (IReportRunnable) design.getDesignObject();
        try {
            // get maxRows
            Integer maxRows = null;
            if (ParameterAccessor.isReportParameterExist(request, ParameterAccessor.PARAM_MAXROWS)) {
                maxRows = Integer.valueOf(ParameterAccessor.getMaxRows(request));
            }

            try {
                // put all app context from Birt Container to Report Engine Service
                ReportEngineService.getInstance().getEngineConfig().getAppContext().putAll(
                        BirtContainer.getReportEngine().getConfig().getAppContext());
                /*
                --- DISABLE JDBC FEATURE
                Connection connection = getConnection();
                BirtContainer.getReportEngine().getConfig().getAppContext().put("OdaJDBCDriverPassInConnection", connection);
                */
            } catch (Exception e) {
                Debug.logError(e, module);
            }
            List<Exception> errors = this.runReport(request, runnable, outputDocName, locale, timeZone, parsedParams, displayTextMap, maxRows);
            if (errors != null && !errors.isEmpty()) {
                errorList.addAll(errors);
            }
        } catch ( RemoteException e ) {
            if (e.getCause() instanceof ReportServiceException) {
                throw (ReportServiceException) e.getCause();
            } else {
                throw new ReportServiceException(e.getLocalizedMessage(), e.getCause());
            }
        }
        return outputDocName;
    }
View Full Code Here


    public void runAndRenderReport(IViewerReportDesignHandle design,
            String outputDocName, InputOptions options, Map parameters,
            OutputStream out, List activeIds, Map displayTexts) throws ReportServiceException {

        if (design == null || design.getDesignObject() == null) {
            throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
        }

        HttpServletRequest request = (HttpServletRequest) options.getOption(InputOptions.OPT_REQUEST);

        try {
View Full Code Here

     */
    private void throwDummyException(Exception e) throws DummyRemoteException {
        if (e instanceof ReportServiceException) {
            throw new DummyRemoteException(e);
        } else {
            throw new DummyRemoteException(new ReportServiceException(e.getLocalizedMessage(), e));
        }
    }
View Full Code Here

            wrappedException = e.getCause();
        }
        if (wrappedException instanceof ReportServiceException) {
            throw (ReportServiceException) wrappedException;
        } else if (wrappedException != null) {
            throw new ReportServiceException(wrappedException.getLocalizedMessage(), wrappedException);
        } else {
            throw new ReportServiceException(e.getLocalizedMessage(), e);
        }
    }
View Full Code Here

    @Override
    public String runReport(IViewerReportDesignHandle design, String outputDocName, InputOptions runOptions, Map parameters,
            Map displayTexts, List<Exception> errorList) throws ReportServiceException {

        if (design == null || design.getDesignObject( ) == null) {
            throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
        }

        IReportRunnable runnable;
        HttpServletRequest request = (HttpServletRequest) runOptions.getOption(InputOptions.OPT_REQUEST);
        Locale locale = (Locale) runOptions.getOption(InputOptions.OPT_LOCALE);
        TimeZone timeZone = (TimeZone) runOptions.getOption(InputOptions.OPT_TIMEZONE);

        ViewerAttributeBean attrBean = (ViewerAttributeBean) request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
        // Set parameters
        Map parsedParams = attrBean.getParameters();
        if (parameters != null) {
            parsedParams.putAll(parameters);
        }
        // Set display Text of select parameters
        Map displayTextMap = attrBean.getDisplayTexts();
        if (displayTexts != null) {
            displayTextMap.putAll(displayTexts);
        }

        runnable = (IReportRunnable) design.getDesignObject();
        try {
            // get maxRows
            Integer maxRows = null;
            if (ParameterAccessor.isReportParameterExist(request, ParameterAccessor.PARAM_MAXROWS)) {
                maxRows = Integer.valueOf(ParameterAccessor.getMaxRows(request));
            }

            try {
                // put all app context from Birt Container to Report Engine Service
                ReportEngineService.getInstance().getEngineConfig().getAppContext().putAll(
                        BirtContainer.getReportEngine().getConfig().getAppContext());
                /*
                --- DISABLE JDBC FEATURE
                Connection connection = getConnection();
                BirtContainer.getReportEngine().getConfig().getAppContext().put("OdaJDBCDriverPassInConnection", connection);
                */
            } catch (Exception e) {
                Debug.logError(e, module);
            }
            List<Exception> errors = this.runReport(request, runnable, outputDocName, locale, timeZone, parsedParams, displayTextMap, maxRows);
            if (errors != null && !errors.isEmpty()) {
                errorList.addAll(errors);
            }
        } catch ( RemoteException e ) {
            if (e.getCause() instanceof ReportServiceException) {
                throw (ReportServiceException) e.getCause();
            } else {
                throw new ReportServiceException(e.getLocalizedMessage(), e.getCause());
            }
        }
        return outputDocName;
    }
View Full Code Here

    public void runAndRenderReport(IViewerReportDesignHandle design,
            String outputDocName, InputOptions options, Map parameters,
            OutputStream out, List activeIds, Map displayTexts) throws ReportServiceException {

        if (design == null || design.getDesignObject() == null) {
            throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
        }

        HttpServletRequest request = (HttpServletRequest) options.getOption(InputOptions.OPT_REQUEST);

        try {
View Full Code Here

     */
    private void throwDummyException(Exception e) throws DummyRemoteException {
        if (e instanceof ReportServiceException) {
            throw new DummyRemoteException(e);
        } else {
            throw new DummyRemoteException(new ReportServiceException(e.getLocalizedMessage(), e));
        }
    }
View Full Code Here

            wrappedException = e.getCause();
        }
        if (wrappedException instanceof ReportServiceException) {
            throw (ReportServiceException) wrappedException;
        } else if (wrappedException != null) {
            throw new ReportServiceException(wrappedException.getLocalizedMessage(), wrappedException);
        } else {
            throw new ReportServiceException(e.getLocalizedMessage(), e);
        }
    }
View Full Code Here

    @Override
    public String runReport(IViewerReportDesignHandle design, String outputDocName, InputOptions runOptions, Map parameters,
            Map displayTexts, List<Exception> errorList) throws ReportServiceException {

        if (design == null || design.getDesignObject( ) == null) {
            throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
        }

        IReportRunnable runnable;
        HttpServletRequest request = (HttpServletRequest) runOptions.getOption(InputOptions.OPT_REQUEST);
        Locale locale = (Locale) runOptions.getOption(InputOptions.OPT_LOCALE);
        TimeZone timeZone = (TimeZone) runOptions.getOption(InputOptions.OPT_TIMEZONE);

        ViewerAttributeBean attrBean = (ViewerAttributeBean) request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
        // Set parameters
        Map parsedParams = attrBean.getParameters();
        if (parameters != null) {
            parsedParams.putAll(parameters);
        }
        // Set display Text of select parameters
        Map displayTextMap = attrBean.getDisplayTexts();
        if (displayTexts != null) {
            displayTextMap.putAll(displayTexts);
        }

        runnable = (IReportRunnable) design.getDesignObject();
        try {
            // get maxRows
            Integer maxRows = null;
            if (ParameterAccessor.isReportParameterExist(request, ParameterAccessor.PARAM_MAXROWS)) {
                maxRows = Integer.valueOf(ParameterAccessor.getMaxRows(request));
            }

            try {
                // put all app context from Birt Container to Report Engine Service
                ReportEngineService.getInstance().getEngineConfig().getAppContext().putAll(
                        BirtContainer.getReportEngine().getConfig().getAppContext());
                /*
                --- DISABLE JDBC FEATURE
                Connection connection = getConnection();
                BirtContainer.getReportEngine().getConfig().getAppContext().put("OdaJDBCDriverPassInConnection", connection);
                */
            } catch (Exception e) {
                Debug.logError(e, module);
            }
            List<Exception> errors = this.runReport(request, runnable, outputDocName, locale, timeZone, parsedParams, displayTextMap, maxRows);
            if (errors != null && !errors.isEmpty()) {
                errorList.addAll(errors);
            }
        } catch ( RemoteException e ) {
            if (e.getCause() instanceof ReportServiceException) {
                throw (ReportServiceException) e.getCause();
            } else {
                throw new ReportServiceException(e.getLocalizedMessage(), e.getCause());
            }
        }
        return outputDocName;
    }
View Full Code Here

    public void runAndRenderReport(IViewerReportDesignHandle design,
            String outputDocName, InputOptions options, Map parameters,
            OutputStream out, List activeIds, Map displayTexts) throws ReportServiceException {

        if (design == null || design.getDesignObject() == null) {
            throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
        }

        HttpServletRequest request = (HttpServletRequest) options.getOption(InputOptions.OPT_REQUEST);

        try {
View Full Code Here

TOP

Related Classes of org.eclipse.birt.report.service.api.ReportServiceException

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.