← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21927: minor, add name of object with invalid reference to InvalidReference

 

------------------------------------------------------------
revno: 21927
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2016-02-10 15:26:12 +0700
message:
  minor, add name of object with invalid reference to InvalidReference
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/InvalidReference.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatValidation.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.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/preheat/InvalidReference.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/InvalidReference.java	2016-02-10 03:08:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/InvalidReference.java	2016-02-10 08:26:12 +0000
@@ -40,19 +40,32 @@
 @JacksonXmlRootElement( localName = "invalidReference", namespace = DxfNamespaces.DXF_2_0 )
 public class InvalidReference
 {
+    private String name;
+
     private PreheatIdentifier identifier;
 
     private IdentifiableObject refObject;
 
     private Property property;
 
-    public InvalidReference( PreheatIdentifier identifier, IdentifiableObject refObject, Property property )
+    public InvalidReference( String name, PreheatIdentifier identifier, IdentifiableObject refObject, Property property )
     {
+        this.name = name;
         this.identifier = identifier;
         this.refObject = refObject;
         this.property = property;
     }
 
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
     public PreheatIdentifier getIdentifier()
     {
         return identifier;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatValidation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatValidation.java	2016-02-10 08:22:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatValidation.java	2016-02-10 08:26:12 +0000
@@ -30,6 +30,7 @@
 
 import com.google.common.base.MoreObjects;
 import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.common.IdentifiableObjectUtils;
 import org.hisp.dhis.schema.Property;
 
 import java.util.ArrayList;
@@ -46,9 +47,9 @@
     {
     }
 
-    public void addInvalidReference( PreheatIdentifier identifier, IdentifiableObject refObject, Property property )
+    public void addInvalidReference( Object object, PreheatIdentifier identifier, IdentifiableObject refObject, Property property )
     {
-        invalidReferences.add( new InvalidReference( identifier, refObject, property ) );
+        invalidReferences.add( new InvalidReference( IdentifiableObjectUtils.getDisplayName( object ), identifier, refObject, property ) );
     }
 
     public List<InvalidReference> getInvalidReferences()

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-02-10 08:22:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-02-10 08:26:12 +0000
@@ -279,7 +279,7 @@
 
                     if ( ref == null && refObject != null )
                     {
-                        preheatValidation.addInvalidReference( identifier, refObject, p );
+                        preheatValidation.addInvalidReference( object, identifier, refObject, p );
                     }
                 }
                 else
@@ -293,7 +293,7 @@
 
                         if ( ref == null && refObject != null )
                         {
-                            preheatValidation.addInvalidReference( identifier, refObject, p );
+                            preheatValidation.addInvalidReference( object, identifier, refObject, p );
                         }
                     }