=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java' --- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-06-13 12:11:43 +0000 +++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-06-13 12:41:24 +0000 @@ -470,6 +470,7 @@ Map uidNameMap = getUidNameMap( params ); Map cocNameMap = getCocNameMap( params ); uidNameMap.putAll( cocNameMap ); + uidNameMap.put( DATA_X_DIM_ID, DISPLAY_NAME_DATA_X ); metaData.put( NAMES_META_KEY, uidNameMap ); @@ -1280,33 +1281,16 @@ } /** - * Returns a mapping between the identifier and the name of all dimension and - * filter items for the given parameters. - * - * @param params the data query. - * @return a mapping between identifiers and names. - */ - private Map getUidNameMap( DataQueryParams params ) - { - Map map = new HashMap<>(); - map.putAll( getUidNameMap( params.getDimensions(), params.isHierarchyMeta(), params.getDisplayProperty() ) ); - map.putAll( getUidNameMap( params.getFilters(), params.isHierarchyMeta(), params.getDisplayProperty() ) ); - map.put( DATA_X_DIM_ID, DISPLAY_NAME_DATA_X ); - - return map; - } - - /** * Returns a mapping between identifiers and names for the given dimensional * objects. * - * @param dimensions the dimensional objects. - * @param hierarchyMeta indicates whether to include meta data of the - * organisation unit hierarchy. + * @param params the data query parameters. * @return a mapping between identifiers and names. */ - private Map getUidNameMap( List dimensions, boolean hierarchyMeta, DisplayProperty displayProperty ) + private Map getUidNameMap( DataQueryParams params ) { + List dimensions = params.getDimensionsAndFilters(); + Map map = new HashMap<>(); Calendar calendar = PeriodType.getCalendar(); @@ -1325,23 +1309,23 @@ } else { - map.put( object.getUid(), NameableObjectUtils.getDisplayProperty( object, displayProperty ) ); + map.put( object.getUid(), NameableObjectUtils.getDisplayProperty( object, params.getDisplayProperty() ) ); } - if ( DimensionType.ORGANISATIONUNIT.equals( dimension.getDimensionType() ) && hierarchyMeta ) + if ( DimensionType.ORGANISATIONUNIT.equals( dimension.getDimensionType() ) && params.isHierarchyMeta() ) { OrganisationUnit unit = (OrganisationUnit) object; - map.putAll( NameableObjectUtils.getUidDisplayPropertyMap( unit.getAncestors(), displayProperty ) ); + map.putAll( NameableObjectUtils.getUidDisplayPropertyMap( unit.getAncestors(), params.getDisplayProperty() ) ); } } - map.put( dimension.getDimension(), NameableObjectUtils.getDisplayProperty( dimension, displayProperty ) ); + map.put( dimension.getDimension(), NameableObjectUtils.getDisplayProperty( dimension, params.getDisplayProperty() ) ); } return map; } - + /** * Returns a mapping between the category option combo identifiers and names * in the given grid.