dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41976
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21436: temporary fix for issues with introspector and getters with same name (but different args) and OU...
------------------------------------------------------------
revno: 21436
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-12-14 10:19:58 +0100
message:
temporary fix for issues with introspector and getters with same name (but different args) and OU.parents
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitTest.java
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/event/data/DefaultEventAnalyticsService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.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/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2015-12-01 10:00:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2015-12-14 09:19:58 +0000
@@ -208,7 +208,7 @@
// -------------------------------------------------------------------------
// Logic
// -------------------------------------------------------------------------
-
+
public void addOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup )
{
groups.add( organisationUnitGroup );
@@ -560,7 +560,7 @@
public String getAncestorNames()
{
- List<OrganisationUnit> units = getAncestors();
+ List<OrganisationUnit> units = getParents();
StringBuilder builder = new StringBuilder();
@@ -581,7 +581,7 @@
@JsonView( { DetailedView.class } )
@JacksonXmlElementWrapper( localName = "parents", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 )
- public List<OrganisationUnit> getAncestors()
+ public List<OrganisationUnit> getParents()
{
List<OrganisationUnit> units = new ArrayList<>();
=== modified file 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitTest.java 2015-09-17 04:29:29 +0000
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitTest.java 2015-12-14 09:19:58 +0000
@@ -104,7 +104,7 @@
List<OrganisationUnit> expected = new ArrayList<>( Arrays.asList( unitA, unitB, unitC ) );
- assertEquals( expected, unitD.getAncestors() );
+ assertEquals( expected, unitD.getParents() );
}
@Test
=== 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-12-13 10:54:45 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-12-14 09:19:58 +0000
@@ -942,7 +942,7 @@
{
OrganisationUnit unit = (OrganisationUnit) object;
- map.putAll( NameableObjectUtils.getUidDisplayPropertyMap( unit.getAncestors(), params.getDisplayProperty() ) );
+ map.putAll( NameableObjectUtils.getUidDisplayPropertyMap( unit.getParents(), params.getDisplayProperty() ) );
}
}
=== 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 2015-11-25 20:25:11 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2015-12-14 09:19:58 +0000
@@ -384,7 +384,7 @@
if ( hierarchy )
{
OrganisationUnit unit = (OrganisationUnit) object;
- objects.addAll( unit.getAncestors() );
+ objects.addAll( unit.getParents() );
}
map.putAll( NameableObjectUtils.getUidDisplayPropertyMap( objects, displayProperty ) );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java 2015-12-08 19:33:06 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java 2015-12-14 09:19:58 +0000
@@ -525,7 +525,7 @@
{
for ( OrganisationUnit o : user.getOrganisationUnits() )
{
- if ( source == o || source.getAncestors().contains( o ) )
+ if ( source == o || source.getParents().contains( o ) )
{
return true;
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java 2015-12-01 10:48:27 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java 2015-12-14 09:19:58 +0000
@@ -159,7 +159,7 @@
{
options.getOptions().put( "useWrapper", "true" );
organisationUnits.add( organisationUnit );
- List<OrganisationUnit> ancestors = organisationUnit.getAncestors();
+ List<OrganisationUnit> ancestors = organisationUnit.getParents();
Collections.reverse( ancestors );
organisationUnits.addAll( ancestors );
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java 2015-12-01 10:01:35 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java 2015-12-14 09:19:58 +0000
@@ -218,7 +218,7 @@
organisationUnits.add( leaf );
organisationUnits.addAll( leaf.getChildren() );
- for ( OrganisationUnit organisationUnit : leaf.getAncestors() )
+ for ( OrganisationUnit organisationUnit : leaf.getParents() )
{
organisationUnits.add( organisationUnit );
organisationUnits.addAll( organisationUnit.getChildren() );