dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25361
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12563: Event analytics, issue with sorting
------------------------------------------------------------
revno: 12563
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-10-10 19:04:05 +0200
message:
Event analytics, issue with sorting
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2013-10-10 16:54:14 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2013-10-10 17:04:05 +0000
@@ -94,6 +94,8 @@
private static final String ITEM_GENDER = "gender";
private static final String ITEM_ISDEAD = "isdead";
+ private static final String COL_NAME_EVENTDATE = "executiondate";
+
@Autowired
private ProgramService programService;
@@ -462,11 +464,13 @@
private String getSortItem( String item, Program program )
{
- if ( !ITEM_EXECUTION_DATE.equals( item ) && getItem( program, item, null, null ) == null )
+ if ( !ITEM_EXECUTION_DATE.equalsIgnoreCase( item ) && getItem( program, item, null, null ) == null )
{
throw new IllegalQueryException( "Descending sort item is invalid: " + item );
}
+ item = ITEM_EXECUTION_DATE.equalsIgnoreCase( item ) ? COL_NAME_EVENTDATE : item;
+
return item;
}