Package org.jboss.dashboard.provider

Examples of org.jboss.dashboard.provider.DataProperty


        int rowIndex = Integer.parseInt(request.getRequestObject().getParameter("rowindex"));
        int columnIndex = Integer.parseInt(request.getRequestObject().getParameter("columnindex"));

        DataSetTable dataSetTable = (DataSetTable) getTable();
        DataProperty selectedProperty = dataSetTable.getDataProperty(columnIndex);
        Dashboard dashboard = DashboardHandler.lookup().getCurrentDashboard();
        Object selectedValue = dataSetTable.getValueAt(rowIndex, columnIndex);
        if (selectedValue instanceof Interval) {
            if (dashboard.filter(selectedProperty.getPropertyId(), (Interval) selectedValue, FilterByCriteria.ALLOW_ANY)) {
                // If drill-down then force the whole screen to be refreshed.
                return new ShowCurrentScreenResponse();
            }
        } else {
            Collection values = new ArrayList();
            values.add(selectedValue);
            if (dashboard.filter(selectedProperty.getPropertyId(), null, false, null, false, values, FilterByCriteria.ALLOW_ANY)) {
                // If drill-down then force the whole screen to be refreshed.
                return new ShowCurrentScreenResponse();
            }
        }
        return null;
View Full Code Here


            // Get for the selected non-group by column the scalar function to apply.
            if (dataSetTable.getNonGroupByColumnIndexes().length > 0) {
                int currentSelectedColumnIndex = Integer.parseInt(request.getRequestObject().getParameter("groupbyfunctionindex"));
                if (currentSelectedColumnIndex == groupBySelectedColumnIndex) {
                    String functionCode = request.getRequestObject().getParameter("groupbyfunctioncode");
                    DataProperty originalDataProperty = dataSetTable.getOriginalDataProperty(groupBySelectedColumnIndex);
                    if (originalDataProperty.getDomain().isScalarFunctionSupported(functionCode)) {
                        dataSetTable.setGroupByFunctionCode(groupBySelectedColumnIndex, functionCode);
                    }
                } else {
                    groupBySelectedColumnIndex = currentSelectedColumnIndex;
                }
View Full Code Here

        super();
    }

    protected String formatCellValue(Table table, int row, int column) {
        DataSetTable dataSetTable = (DataSetTable) table;
        DataProperty property = dataSetTable.getDataProperty(column);
        if (property == null) return "";
       
        DataPropertyFormatter formatter = DataFormatterRegistry.lookup().getPropertyFormatter(property.getPropertyId());
        return StringEscapeUtils.escapeHtml(formatter.formatValue(property, table.getValueAt(row, column), LocaleManager.currentLocale()));
    }
View Full Code Here

        // New domain and range properties.
        String idDomainDetails = request.getRequestObject().getParameter("idDomainDetails");
        if (idDomainDetails != null) {

            // If the domain property has been changed, load it.
            DataProperty domainProperty = displayer.getDomainProperty();
            if (!idDomainDetails.equals(domainProperty.getPropertyId())) displayer.setDomainProperty(ds.getPropertyById(idDomainDetails));

            // If domain save button has been pressed, update its configuration parameters
            // TODO: Also save if the enter key has been pressed.
            String domainSaveButtonPressed = request.getRequestObject().getParameter(DOMAIN_SAVE_BUTTON_PRESSED);
            boolean updateDomainDetails =  (domainSaveButtonPressed != null) && Boolean.valueOf(domainSaveButtonPressed).booleanValue();
            if (updateDomainDetails) {
                DomainConfiguration domainConfig = new DomainConfiguration();
                DomainConfigurationParser parser = new DomainConfigurationParser(domainConfig);
                parser.parse(request);
                domainConfig.setPropertyId(idDomainDetails);
                domainConfig.apply(displayer.getDomainProperty());
            }
        }

        String idRangeDetails = request.getRequestObject().getParameter("idRangeDetails");
        if (idRangeDetails != null) {

            // If the range property has been changed, load it.
            DataProperty rangeProperty = displayer.getRangeProperty();
            if (!idRangeDetails.equals(rangeProperty.getPropertyId())) displayer.setRangeProperty(ds.getPropertyById(idRangeDetails));

            // If range save button has been pressed, update its configuration parameters.
            String rangeSaveButtonPressed = request.getRequestObject().getParameter(RANGE_SAVE_BUTTON_PRESSED);
            boolean updateRangeDetails =  (rangeSaveButtonPressed != null) && Boolean.valueOf(rangeSaveButtonPressed).booleanValue();
            // TODO: Also save if the enter key has been pressed.
View Full Code Here

            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

    public List getPropertyAllValues() {
        List results = null;
        if (isStaticProperty()) {
            results = filter.getStaticPropertyAllowedValuesById(propertyId);
        } else {
            DataProperty dp = getDataProperty();
            if (dp != null) results = dp.getValues();
        }
        if (results == null) return new ArrayList();

        // Purge the null values before return.
        Iterator it = results.iterator();
View Full Code Here

        return sectionId != null;
    }

    public String getPropertyName(Locale l) {
        // If property exist in any dashboard's data provider, get it and get its name
        DataProperty property = getDataProperty();
        if (property != null) return property.getName(l);

        // If property is static, use data property formatter to get its name.
        DataPropertyFormatter df = getDataPropertyFormatter();
        if (df != null) return df.formatName(propertyId, l);
        return propertyId;
View Full Code Here

        if (df != null) return df.formatName(propertyId, l);
        return propertyId;
    }

    public String formatPropertyValue(Object value, Locale l) {
        DataProperty property = getDataProperty();
        DataPropertyFormatter df = getDataPropertyFormatter();
        if (df == null) return value == null ? "" : value.toString();
        if (property != null) return df.formatValue(property, value, l);
        return df.formatValue(propertyId,value,l);
    }
View Full Code Here

        while (dashboard != null) {
            Iterator it = dashboard.getDataProviders().iterator();
            while (it.hasNext()) {
                DataProvider provider = (DataProvider) it.next();
                try {
                    DataProperty p = provider.getDataSet().getPropertyById(propertyId);
                    if (p != null) return p;
                } catch (Exception e) {
                    log.error("Dashboard provider dataset load: " + provider.getCode(), e);
                    continue;
                }
View Full Code Here

            // Static properties.
            DashboardFilterProperty prop = getStaticPropertyById(id);
            if (prop != null) return prop;

            // Dynamic properties.
            DataProperty dp = getDashboard().getDataPropertyById(id);
            if (dp != null) return new DashboardFilterProperty(dp, this);
            return new DashboardFilterProperty(id, this);
        } catch (Exception e) {
            log.error("Cannot get data provider results.", e);
            return null;
View Full Code Here

TOP

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

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.