← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22245: minor bugfix, set autofields on PTEA

 

------------------------------------------------------------
revno: 22245
committer: Morten Olav Hansen <morten@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-03-11 13:49:09 +0700
message:
  minor bugfix, set autofields on PTEA
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ObjectErrorReports.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ObjectTypeStats.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceProgramTest.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.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/feedback/ObjectErrorReports.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ObjectErrorReports.java	2016-03-11 03:24:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ObjectErrorReports.java	2016-03-11 06:49:09 +0000
@@ -33,6 +33,7 @@
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.google.common.base.MoreObjects;
 import org.hisp.dhis.common.DxfNamespaces;
 
 import java.util.ArrayList;
@@ -92,4 +93,13 @@
     {
         return objectErrorReportsMap.size();
     }
+
+
+    @Override
+    public String toString()
+    {
+        return MoreObjects.toStringHelper( this )
+            .add( "objectErrorReports", getObjectErrorReports() )
+            .toString();
+    }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ObjectTypeStats.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ObjectTypeStats.java	2016-03-11 03:24:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ObjectTypeStats.java	2016-03-11 06:49:09 +0000
@@ -39,6 +39,8 @@
 @JacksonXmlRootElement( localName = "stats", namespace = DxfNamespaces.DXF_2_0 )
 public class ObjectTypeStats
 {
+    private int total;
+
     private int created;
 
     private int updated;
@@ -53,6 +55,7 @@
 
     public void merge( ObjectTypeStats stats )
     {
+        total += stats.getTotal();
         created += stats.getCreated();
         updated += stats.getUpdated();
         deleted += stats.getDeleted();
@@ -61,6 +64,13 @@
 
     @JsonProperty
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public int getTotal()
+    {
+        return total;
+    }
+
+    @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public int getCreated()
     {
         return created;
@@ -68,6 +78,7 @@
 
     public void incCreated()
     {
+        total++;
         created++;
     }
 
@@ -80,6 +91,7 @@
 
     public void incUpdated()
     {
+        total++;
         updated++;
     }
 
@@ -92,6 +104,7 @@
 
     public void incDeleted()
     {
+        total++;
         deleted++;
     }
 
@@ -104,6 +117,7 @@
 
     public void incIgnored()
     {
+        total++;
         ignored++;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceProgramTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceProgramTest.java	2016-03-10 13:17:12 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceProgramTest.java	2016-03-11 06:49:09 +0000
@@ -44,7 +44,6 @@
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserAuthorityGroup;
 import org.hisp.dhis.validation.ValidationRule;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
@@ -162,7 +161,6 @@
     }
 
     @Test
-    @Ignore
     public void testCreateSimpleProgramReg() throws IOException
     {
         Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> metadata = renderService.fromMetadata(

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java	2016-03-11 06:49:09 +0000
@@ -370,6 +370,7 @@
 
                 ProgramTrackedEntityAttribute programAttribute = new ProgramTrackedEntityAttribute( program, attribute,
                     personDisplayNames.get( index ), mandatory.get( index ), allowFutureDate.get( index ) );
+                programAttribute.setAutoFields();
 
                 program.getProgramAttributes().add( programAttribute );
             }