} else { if ( ( column.getAggregationType() == setting ) || column.getAggregationList() != null && column.getAggregationList().contains( setting ) ) { aggsetting = setting; } else {
protected void addOrderBy( Query query, Category category, String columnId, String aggregation, Order.Type orderType ) throws PentahoMetadataException { if ( category == null ) { throw new PentahoMetadataException( Messages.getErrorString( "QueryXmlHelper.ERROR_0016_BUSINESS_CATEGORY_NULL" ) ); //$NON-NLS-1$ } LogicalColumn column = category.findLogicalColumn( columnId ); if ( column == null ) { throw new PentahoMetadataException( Messages.getErrorString( "QueryXmlHelper.ERROR_0013_BUSINESS_COL_NOT_FOUND", category.getId(), columnId ) ); //$NON-NLS-1$ } // this code verifies the aggregation setting provided is a // valid option AggregationType aggsetting = null; if ( aggregation != null ) { AggregationType setting = AggregationType.valueOf( aggregation.toUpperCase() ); if ( ( column.getAggregationType() == setting ) || column.getAggregationList() != null && column.getAggregationList().contains( setting ) ) { aggsetting = setting; } } query.getOrders().add( new Order( new Selection( category, column, aggsetting ), orderType ) ); }
/** * This is a utility method that looks into an old domain for the same column ids, and then copies over the old * metadata into the new. * * @param oldDomain * @param newDomain */ public void copyOverMetadata( Domain oldDomain, Domain newDomain ) { Category category = newDomain.getLogicalModels().get( 0 ).getCategories().get( 0 ); LogicalModel oldModel = oldDomain.getLogicalModels().get( 0 ); for ( LogicalColumn column : category.getLogicalColumns() ) { LogicalColumn oldColumn = oldModel.findLogicalColumn( column.getId() ); if ( oldColumn != null ) { column.setDataType( oldColumn.getDataType() ); column.setName( oldColumn.getName() ); column.setAggregationList( oldColumn.getAggregationList() ); column.setAggregationType( oldColumn.getAggregationType() ); } } }
if ( col.getAggregationList() != null && col.getAggregationList().isEmpty() == false ) { setSelectedAggregations( col.getAggregationList() ); } else { setSelectedAggregations( possibleAggregations );
if ( aggregation != null ) { AggregationType setting = AggregationType.valueOf( aggregation.toUpperCase() ); if ( ( column.getAggregationType() == setting ) || column.getAggregationList() != null && column.getAggregationList().contains( setting ) ) { aggsetting = setting;
col.setCategory( category.getId() ); List<AggregationType> possibleAggs = c.getAggregationList(); List<String> aggTypes = new ArrayList<String>(); if ( possibleAggs != null ) {