← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18667: Minor updates, use getProperty/haveProperty instead of using property map directly

 

------------------------------------------------------------
revno: 18667
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-03-24 10:01:32 +0700
message:
  Minor updates, use getProperty/haveProperty instead of using property map directly
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/DefaultSchemaService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/fieldfilter/DefaultFieldFilterService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/objectfilter/DefaultObjectFilterService.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SchemaController.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-core/src/main/java/org/hisp/dhis/schema/DefaultSchemaService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/DefaultSchemaService.java	2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/DefaultSchemaService.java	2015-03-24 03:01:32 +0000
@@ -197,7 +197,7 @@
     {
         if ( schema.getPropertyMap().containsKey( "__self__" ) )
         {
-            Property property = schema.getPropertyMap().get( "__self__" );
+            Property property = schema.getProperty( "__self__" );
             schema.setName( property.getName() );
             schema.setCollectionName( schema.getPlural() );
             schema.setNamespace( property.getNamespace() );

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/fieldfilter/DefaultFieldFilterService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/fieldfilter/DefaultFieldFilterService.java	2015-02-06 03:50:03 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/fieldfilter/DefaultFieldFilterService.java	2015-03-24 03:01:32 +0000
@@ -175,12 +175,12 @@
         {
             AbstractNode child = null;
 
-            if ( !schema.getPropertyMap().containsKey( fieldKey ) )
+            if ( !schema.haveProperty( fieldKey ) )
             {
                 continue;
             }
 
-            Property property = schema.getPropertyMap().get( fieldKey );
+            Property property = schema.getProperty( fieldKey );
 
             Object returnValue = ReflectionUtils.invokeMethod( object, property.getGetterMethod() );
             Schema propertySchema = schemaService.getDynamicSchema( property.getKlass() );
@@ -467,7 +467,7 @@
 
         for ( String field : fields )
         {
-            Property property = schema.getPropertyMap().get( field );
+            Property property = schema.getProperty( field );
 
             if ( property == null )
             {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/objectfilter/DefaultObjectFilterService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/objectfilter/DefaultObjectFilterService.java	2015-02-20 09:14:02 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/objectfilter/DefaultObjectFilterService.java	2015-03-24 03:01:32 +0000
@@ -92,12 +92,12 @@
 
         for ( String field : filters.getFilters().keySet() )
         {
-            if ( !schema.getPropertyMap().containsKey( field ) )
+            if ( !schema.haveProperty( field ) )
             {
                 continue;
             }
 
-            Property descriptor = schema.getPropertyMap().get( field );
+            Property descriptor = schema.getProperty( field );
 
             if ( descriptor == null )
             {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2015-03-23 06:21:33 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2015-03-24 03:01:32 +0000
@@ -349,7 +349,7 @@
             return;
         }
 
-        if ( !getSchema().getPropertyMap().containsKey( pvProperty ) )
+        if ( !getSchema().haveProperty( pvProperty ) )
         {
             ContextUtils.notFoundResponse( response, "Property " + pvProperty + " does not exist on " + getEntityName() );
             return;
@@ -754,13 +754,13 @@
             return;
         }
 
-        if ( !getSchema().getPropertyMap().containsKey( pvProperty ) )
+        if ( !getSchema().haveProperty( pvProperty ) )
         {
             ContextUtils.notFoundResponse( response, "Property " + pvProperty + " does not exist on " + getEntityName() );
             return;
         }
 
-        Property property = getSchema().getPropertyMap().get( pvProperty );
+        Property property = getSchema().getProperty( pvProperty );
 
         if ( !property.isCollection() || !property.isIdentifiableObject() )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SchemaController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SchemaController.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SchemaController.java	2015-03-24 03:01:32 +0000
@@ -128,9 +128,9 @@
             throw new HttpClientErrorException( HttpStatus.NOT_FOUND, "Type " + type + " does not exist." );
         }
 
-        if ( schema.getPropertyMap().containsKey( property ) )
+        if ( schema.haveProperty( property ) )
         {
-            return schema.getPropertyMap().get( property );
+            return schema.getProperty( property );
         }
 
         throw new HttpClientErrorException( HttpStatus.NOT_FOUND, "Property " + property + " does not exist on type " + type + "." );