dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21673
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10324: Analytics, including name of relative periods in meta data
------------------------------------------------------------
revno: 10324
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-03-19 18:31:48 +0100
message:
Analytics, including name of relative periods in meta data
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java 2013-03-15 17:37:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java 2013-03-19 17:31:48 +0000
@@ -455,11 +455,5 @@
this.code = other.getCode() == null ? this.code : other.getCode();
this.lastUpdated = other.getLastUpdated() == null ? this.lastUpdated : other.getLastUpdated();
this.created = other.getCreated() == null ? this.created : other.getCreated();
-
- // TODO disabled for 2.11 release, we don't support sharing in dxf2 import-export
- //this.user = other.getUser() == null ? this.user : other.getUser();
- //this.publicAccess = other.getPublicAccess() == null ? this.publicAccess : other.getPublicAccess();
- //this.userGroupAccesses.clear();
- //this.userGroupAccesses.addAll( other.getUserGroupAccesses() );
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java 2013-02-22 06:30:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java 2013-03-19 17:31:48 +0000
@@ -88,9 +88,20 @@
@Override
public boolean equals( Object o )
{
- if ( this == o ) return true;
- if ( o == null || getClass() != o.getClass() ) return false;
- if ( !super.equals( o ) ) return false;
+ if ( this == o )
+ {
+ return true;
+ }
+
+ if ( o == null || getClass() != o.getClass() )
+ {
+ return false;
+ }
+
+ if ( !super.equals( o ) )
+ {
+ return false;
+ }
BaseNameableObject that = (BaseNameableObject) o;
=== 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 2013-03-14 13:07:10 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2013-03-19 17:31:48 +0000
@@ -115,6 +115,7 @@
private static final Log log = LogFactory.getLog( DefaultAnalyticsService.class );
private static final String VALUE_HEADER_NAME = "Value";
+ private static final String PERIOD_META_KEY = "periods";
private static final int PERCENT = 100;
private static final int MAX_QUERIES = 8;
@@ -577,7 +578,6 @@
if ( period != null )
{
- period.setName( format != null ? format.formatPeriod( period ) : null );
periods.add( period );
}
}
@@ -587,6 +587,11 @@
{
throw new IllegalQueryException( "Dimension pe is present in query without any valid dimension options" );
}
+
+ for ( Period period : periods )
+ {
+ period.setName( format != null ? format.formatPeriod( period ) : null );
+ }
List<Period> periodList = new ArrayList<Period>( periods );
Collections.sort( periodList, PeriodComparator.INSTANCE );