Examples of DBReportingServiceClient


Examples of org.wso2.carbon.reporting.ui.client.DBReportingServiceClient

        String serverURL = CarbonUIUtil.getServerURL(request.getSession().getServletContext(), request.getSession());
        ConfigurationContext configurationContext = (ConfigurationContext) request.getSession().getServletContext().
                getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
        String cookie = (String) request.getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
        DBReportingServiceClient dbReportingServiceClient = null;
        try {
            dbReportingServiceClient = new DBReportingServiceClient(cookie, serverURL, configurationContext);
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }
        List<ReportParamMap> reportParamMapsList = new ArrayList<ReportParamMap>();
        String[] parmCollection = params.split("\\|");

        for (String inputParam : parmCollection) {
            if (inputParam != null && !"".equals(inputParam)) {
                ReportParamMap reportParamMap = new ReportParamMap();
                String[] input = inputParam.split("\\=");
                reportParamMap.setParamKey(input[0]);
                reportParamMap.setParamValue(input[1]);
                reportParamMapsList.add(reportParamMap);
            }
        }

        try {
            DataHandler dataHandler = null;
            if (dbReportingServiceClient != null) {
                dataHandler = dbReportingServiceClient.getReport(reportBean,reportParamMapsList.toArray(new ReportParamMap[reportParamMapsList.size()]));
            }
            ServletOutputStream outputStream = response.getOutputStream();
            if (dataHandler != null) {
                dataHandler.writeTo(outputStream);
            }
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.