← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5894: Made constant import consistent with other importer classes

 

------------------------------------------------------------
revno: 5894
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-08 22:10:06 +0100
message:
  Made constant import consistent with other importer classes
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ConstantImporter.java
  dhis-2/pom.xml


--
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-importexport/src/main/java/org/hisp/dhis/importexport/importer/ConstantImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ConstantImporter.java	2012-02-06 13:20:20 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ConstantImporter.java	2012-02-08 21:10:06 +0000
@@ -73,20 +73,16 @@
     @Override
     protected void importMatching( Constant object, Constant match )
     {
-        log.info( object.getName() + ": Constant can only be unique or duplicate" );
+        match.setName( object.getName() );
+        match.setValue( object.getValue() );
+        
+        constantService.saveConstant( match );
     }
 
     @Override
     protected Constant getMatching( Constant object )
     {
-        Constant match = constantService.getConstantByName( object.getName() );
-
-        if ( match == null )
-        {
-            match = constantService.getConstant( object.getId() );
-        }
-
-        return match;
+        return constantService.getConstantByName( object.getName() );
     }
 
     @Override
@@ -96,10 +92,6 @@
         {
             return false;
         }
-        if ( object.getId() != existing.getId() )
-        {
-            return false;
-        }
         if ( object.getValue() != existing.getValue() )
         {
             return false;

=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml	2012-01-24 13:28:00 +0000
+++ dhis-2/pom.xml	2012-02-08 21:10:06 +0000
@@ -409,12 +409,12 @@
       <dependency>
         <groupId>org.apache.struts</groupId>
         <artifactId>struts2-core</artifactId>
-        <version>2.2.3.1</version>
+        <version>2.3.1.2</version>
       </dependency>
       <dependency>
         <groupId>org.apache.struts</groupId>
         <artifactId>struts2-spring-plugin</artifactId>
-        <version>2.2.3.1</version>
+        <version>2.3.1.2</version>
       </dependency>
       <dependency>
         <groupId>org.apache.velocity</groupId>