Package org.jboss.dashboard.provider

Examples of org.jboss.dashboard.provider.DataProvider


    }

    public DataProvider getDataProviderByCode(String code) {
        Iterator it = dataProviders.iterator();
        while (it.hasNext()) {
            DataProvider provider = (DataProvider) it.next();
            if (provider.getCode().equals(code)) return provider;
        }
        return null;
    }
View Full Code Here


    public String toString(Object element, Locale l) {
        if (element == null) return "";
        ResourceBundle i18n = localeManager.getBundle("org.jboss.dashboard.displayer.messages", l);

        if (element instanceof DataProvider) {
            DataProvider dp = (DataProvider) element;
            return dp.getCode() + ", " + dp.getDescription(l);
        }
        if (element instanceof KPI) {
            KPI kpi = (KPI) element;
            return kpi.getCode() + ", " + kpi.getDescription(l);
        }
View Full Code Here

        protected String rangePropId;

        public BuildXYDataSetTrace(DataProperty domainProperty, DataProperty rangeProperty, ScalarFunction scalarFunction) {
            super(null);
            displayerTitle = getTitle();
            DataProvider dataProvider = domainProperty.getDataSet().getDataProvider();
            providerCode = dataProvider.getCode();
            scalarFunctionCode = scalarFunction.getCode();
            domainPropId = domainProperty.getPropertyId();
            rangePropId = rangeProperty.getPropertyId();
            setId(providerCode + "-" + scalarFunctionCode + "-" + rangePropId + "-" + domainPropId);
        }
View Full Code Here

    public String toString(Object element, Locale l) {
        if (element == null) return "";
        ResourceBundle i18n = localeManager.getBundle("org.jboss.dashboard.displayer.messages", l);

        if (element instanceof DataProvider) {
            DataProvider dp = (DataProvider) element;
            return dp.getCode() + ", " + dp.getDescription(l);
        }
        if (element instanceof KPI) {
            KPI kpi = (KPI) element;
            return kpi.getCode() + ", " + kpi.getDescription(l);
        }
View Full Code Here

    public void setUp() throws Exception {
        CDIBeanLocator.beanManager = beanManager;
        dataSetManager = DataProviderServices.lookup().getDataSetManager();

        dataPoviderType = dataProviderManager.getProviderTypeByUid(CSVDataProviderType.UID);
        DataProvider dataProvider = dataProviderManager.createDataProvider();
        CSVDataLoader csvDataLoader = (CSVDataLoader) dataPoviderType.createDataLoader();

        InputStream dataStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("data.csv");
        dataSet = csvDataLoader.load(dataProvider, dataStream);
        dataSetManager.registerDataSet(dataProvider, dataSet);
View Full Code Here

    @Before
    public void setUp() throws Exception {
        CDIBeanLocator.beanManager = beanManager;

        dataPoviderType = dataProviderManager.getProviderTypeByUid(CSVDataProviderType.UID);
        DataProvider dataProvider = dataProviderManager.createDataProvider();
        CSVDataLoader csvDataLoader = (CSVDataLoader) dataPoviderType.createDataLoader();

        InputStream dataStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("data.csv");
        dataSet = csvDataLoader.load(dataProvider, dataStream);
        dataProvider.setDataSet(dataSet);
    }
View Full Code Here

    @Before
    public void setUp() throws Exception {
        CDIBeanLocator.beanManager = beanManager;

        dataPoviderType = dataProviderManager.getProviderTypeByUid(CSVDataProviderType.UID);
        DataProvider dataProvider = dataProviderManager.createDataProvider();
        CSVDataLoader csvDataLoader = (CSVDataLoader) dataPoviderType.createDataLoader();

        InputStream dataStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("data.csv");
        dataSet = csvDataLoader.load(dataProvider, dataStream);
        dataSetManager.registerDataSet(dataProvider, dataSet);
View Full Code Here

    }

    public List<DataProvider> getSelectedDataProviders() throws Exception {
        List<DataProvider> results = new ArrayList<DataProvider>();
        for (KPI kpi: getSelectedKPIs()) {
            DataProvider dp = kpi.getDataProvider();
            if (!results.contains(dp)) results.add(dp);
        }
        final Locale l = LocaleManager.currentLocale();
        Collections.sort(results, new Comparator() {
            public int compare(Object o1, Object o2) {
                DataProvider s1 = (DataProvider) o1;
                DataProvider s2 = (DataProvider) o2;
                return s1.getDescription(l).compareTo(s2.getDescription(l));
            }
        });
        return results;
    }
View Full Code Here

            if (staticProps != null) results.addAll(Arrays.asList(staticProps));

            // Dynamic properties.
            Iterator it = getDashboard().getDataProviders().iterator();
            while (it.hasNext()) {
                DataProvider dataProvider = (DataProvider) it.next();
                DataProperty[] allProperties = dataProvider.getDataSet().getProperties();
                for (int i = 0; i < allProperties.length; i++) {
                    DataProperty property = allProperties[i];
                    DashboardFilterProperty prop = getDashboardFilterPropertyForCurrentFilter(dataProvider.getCode(), property.getPropertyId());
                    if (prop == null) prop = new DashboardFilterProperty(dataProvider.getCode(), property.getPropertyId(), getFilter() ,null, false);
                    results.add(prop);
                }
            }
        } catch (Exception e) {
            log.error("Cannot get data provider results.", e);
View Full Code Here

        // Change the data provider if necessary.
        Locale locale = LocaleManager.currentLocale();
        DataDisplayer kpiDisplayer = kpi.getDataDisplayer();
        String selProviderCode = request.getRequestObject().getParameter("providerSelected");
        if (selProviderCode != null && !kpi.getDataProvider().getCode().equals(selProviderCode)) {
            DataProvider selProvider = DataDisplayerServices.lookup().getDataProviderManager().getDataProviderByCode(selProviderCode);
            kpi.setDataProvider(selProvider);
            kpiDisplayer.setDataProvider(selProvider);
            setKpi(kpi);
        }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.provider.DataProvider

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.