← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22060: TEI import, feedback

 

------------------------------------------------------------
revno: 22060
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2016-02-27 01:45:30 -0500
message:
  TEI import, feedback
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.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/trackedentity/DefaultTrackedEntityAttributeService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java	2016-02-26 18:25:04 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java	2016-02-27 06:45:30 +0000
@@ -214,7 +214,7 @@
     public String validateScope( TrackedEntityAttribute trackedEntityAttribute,
         String value, TrackedEntityInstance trackedEntityInstance, OrganisationUnit organisationUnit, Program program )
     {
-        Assert.notNull( trackedEntityAttribute, "trackedEntityAttribute is required." );
+        Assert.notNull( trackedEntityAttribute, "tracked entity attribute is required." );
 
         if ( !trackedEntityAttribute.isUnique() || value == null )
         {
@@ -232,7 +232,7 @@
 
             if ( !program.getOrganisationUnits().contains( organisationUnit ) )
             {
-                return "Given orgUnit is not assigned to program " + program.getUid();
+                return "Organisation unit is not assigned to program " + program.getUid();
             }
 
             params.setProgram( program );
@@ -241,7 +241,7 @@
         }
         else if ( trackedEntityAttribute.getOrgunitScope() )
         {
-            Assert.notNull( organisationUnit, "organisationUnit is required for org unit scope" );
+            Assert.notNull( organisationUnit, "organisation unit is required for org unit scope" );
             params.setOrganisationUnitMode( OrganisationUnitSelectionMode.SELECTED );
             params.addOrganisationUnit( organisationUnit );
         }
@@ -272,7 +272,7 @@
     @Override
     public String validateValueType( TrackedEntityAttribute trackedEntityAttribute, String value )
     {
-        Assert.notNull( trackedEntityAttribute, "trackedEntityAttribute is required." );
+        Assert.notNull( trackedEntityAttribute, "tracked entity attribute is required" );
         ValueType valueType = trackedEntityAttribute.getValueType();
 
         String errorValue = StringUtils.substring( value, 0, 30 );
@@ -284,19 +284,19 @@
 
         if ( ValueType.NUMBER == valueType && !MathUtils.isNumeric( value ) )
         {
-            return "Value '" + errorValue + "'is not a valid numeric for attribute " + trackedEntityAttribute.getUid();
+            return "Value '" + errorValue + "' is not a valid numeric type for attribute " + trackedEntityAttribute.getUid();
         }
         else if ( ValueType.BOOLEAN == valueType && !MathUtils.isBool( value ) )
         {
-            return "Value '" + errorValue + "'is not a valid boolean for attribute " + trackedEntityAttribute.getUid();
+            return "Value '" + errorValue + "' is not a valid boolean type for attribute " + trackedEntityAttribute.getUid();
         }
         else if ( ValueType.DATE == valueType && DateUtils.parseDate( value ) == null )
         {
-            return "Value '" + errorValue + "'is not a valid date for attribute " + trackedEntityAttribute.getUid();
+            return "Value '" + errorValue + "' is not a valid date type for attribute " + trackedEntityAttribute.getUid();
         }
         else if ( ValueType.TRUE_ONLY == valueType && !"true".equals( value ) )
         {
-            return "Value '" + errorValue + "'is not true (true-only value type) for attribute " + trackedEntityAttribute.getUid();
+            return "Value '" + errorValue + "' is not true (true-only type) for attribute " + trackedEntityAttribute.getUid();
         }
         else if ( ValueType.USERNAME == valueType )
         {
@@ -307,7 +307,8 @@
         }
         else if ( trackedEntityAttribute.hasOptionSet() && !trackedEntityAttribute.isValidOptionValue( value ) )
         {
-            return "Value '" + errorValue + "'is not a valid option for attribute " + trackedEntityAttribute.getUid();
+            return "Value '" + errorValue + "'is not a valid option for attribute " + 
+                trackedEntityAttribute.getUid() + " and option set " + trackedEntityAttribute.getOptionSet().getUid();
         }
 
         return null;