← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13249: minor deletion fix

 

------------------------------------------------------------
revno: 13249
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-16 12:49:45 +0100
message:
  minor deletion fix
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/ConfigurationDeletionHandler.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.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/configuration/ConfigurationDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/ConfigurationDeletionHandler.java	2013-12-16 10:07:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/ConfigurationDeletionHandler.java	2013-12-16 11:49:45 +0000
@@ -30,6 +30,7 @@
 
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
 import org.hisp.dhis.system.deletion.DeletionHandler;
 import org.hisp.dhis.user.UserGroup;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -76,4 +77,12 @@
 
         return jdbcTemplate.queryForObject( sql, Integer.class ) == 0 ? null : ERROR;
     }
+
+    @Override
+    public String allowDeleteOrganisationUnitLevel( OrganisationUnitLevel level )
+    {
+        String sql = "SELECT COUNT(*) FROM configuration where offlineorgunitlevelid=" + level.getId();
+
+        return jdbcTemplate.queryForObject( sql, Integer.class ) == 0 ? null : ERROR;
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java	2013-12-16 09:18:24 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java	2013-12-16 11:49:45 +0000
@@ -136,11 +136,6 @@
             types = Lists.newArrayList( ExchangeClasses.getImportMap().values() );
         }
 
-        /*
-        types.clear();
-        types.add( "dataSets" );
-        */
-
         for ( String type : types )
         {
             Object value = ReflectionUtils.invokeGetterMethod( type, metaData );