← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14815: minor fixes

 

------------------------------------------------------------
revno: 14815
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-04-13 10:59:46 +0700
message:
  minor fixes
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/DefaultFilterService.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/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-api/src/main/java/org/hisp/dhis/schema/Property.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java	2014-03-26 16:25:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java	2014-04-13 03:59:46 +0000
@@ -55,7 +55,7 @@
 
     private Class<?> klass;
 
-    private Method method;
+    private Method getterMethod;
 
     private boolean collection;
 
@@ -63,9 +63,9 @@
 
     private boolean nameableObject;
 
-    public Property( Method method )
+    public Property( Method getterMethod )
     {
-        this.method = method;
+        this.getterMethod = getterMethod;
     }
 
     @JsonProperty
@@ -152,14 +152,14 @@
         this.klass = klass;
     }
 
-    public Method getMethod()
+    public Method getGetterMethod()
     {
-        return method;
+        return getterMethod;
     }
 
-    public void setMethod( Method method )
+    public void setGetterMethod( Method getterMethod )
     {
-        this.method = method;
+        this.getterMethod = getterMethod;
     }
 
     @JsonProperty
@@ -208,7 +208,7 @@
             ", xmlAttribute=" + xmlAttribute +
             ", xmlCollectionName='" + xmlCollectionName + '\'' +
             ", klass=" + klass +
-            ", method=" + method +
+            ", getter=" + getterMethod +
             ", collection=" + collection +
             ", identifiableObject=" + identifiableObject +
             '}';

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/DefaultFilterService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/DefaultFilterService.java	2014-03-31 05:22:34 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/filter/DefaultFilterService.java	2014-04-13 03:59:46 +0000
@@ -143,7 +143,7 @@
             Map value = fieldMap.get( key );
             Property descriptor = propertiesMap.get( key );
 
-            Object returned = ReflectionUtils.invokeMethod( object, descriptor.getMethod() );
+            Object returned = ReflectionUtils.invokeMethod( object, descriptor.getGetterMethod() );
 
             if ( returned == null )
             {
@@ -251,7 +251,7 @@
                 continue;
             }
 
-            Object o = ReflectionUtils.invokeMethod( object, descriptor.getMethod() );
+            Object o = ReflectionUtils.invokeMethod( object, descriptor.getGetterMethod() );
 
             if ( o != null )
             {
@@ -282,7 +282,7 @@
                 continue;
             }
 
-            Object value = ReflectionUtils.invokeMethod( object, descriptor.getMethod() );
+            Object value = ReflectionUtils.invokeMethod( object, descriptor.getGetterMethod() );
 
             Object filter = filters.getFilters().get( field );
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SchemaController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SchemaController.java	2014-03-21 09:35:30 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SchemaController.java	2014-04-13 03:59:46 +0000
@@ -60,6 +60,7 @@
         MetaData metaData = new MetaData();
         metaData.setSchemas( schemas );
 
+        response.setContentType( MediaType.APPLICATION_JSON_VALUE );
         JacksonUtils.toJson( response.getOutputStream(), schemas );
     }
 
@@ -67,6 +68,8 @@
     public void getSchemaJson( @PathVariable String type, HttpServletResponse response ) throws IOException
     {
         Schema schema = schemaService.getSchemaBySingularName( type );
+
+        response.setContentType( MediaType.APPLICATION_JSON_VALUE );
         JacksonUtils.toJson( response.getOutputStream(), schema );
     }
 
@@ -77,6 +80,7 @@
         MetaData metaData = new MetaData();
         metaData.setSchemas( schemas );
 
+        response.setContentType( MediaType.APPLICATION_XML_VALUE );
         JacksonUtils.toXml( response.getOutputStream(), metaData );
     }
 
@@ -84,6 +88,8 @@
     public void getSchemaXml( @PathVariable String type, HttpServletResponse response ) throws IOException
     {
         Schema schema = schemaService.getSchemaBySingularName( type );
+
+        response.setContentType( MediaType.APPLICATION_XML_VALUE );
         JacksonUtils.toXml( response.getOutputStream(), schema );
     }
 }