← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8978: Improved resource tables

 

------------------------------------------------------------
revno: 8978
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-11-12 17:42:09 +0100
message:
  Improved resource tables
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateDataElementGroupSetTableStatement.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateIndicatorGroupSetTableStatement.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateOrganisationUnitGroupSetTableStatement.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-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2012-01-25 17:11:43 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2012-11-12 16:42:09 +0000
@@ -233,7 +233,8 @@
             {
                 DataElementGroup group = groupSet.getGroup( dataElement );
                 
-                values.add( group != null ? group.getName() : null );    
+                values.add( group != null ? group.getName() : null );
+                values.add( group != null ? String.valueOf( group.getId() ) : null );
             }
             
             batchHandler.addObject( values );
@@ -280,7 +281,8 @@
             {
                 IndicatorGroup group = groupSet.getGroup( indicator );
                 
-                values.add( group != null ? group.getName() : null );    
+                values.add( group != null ? group.getName() : null );
+                values.add( group != null ? String.valueOf( group.getId() ) : null );
             }
             
             batchHandler.addObject( values );
@@ -330,6 +332,7 @@
                 OrganisationUnitGroup group = groupSet.getGroup( unit );
                 
                 values.add( group != null ? group.getName() : null );
+                values.add( group != null ? String.valueOf( group.getId() ) : null );
             }
 
             batchHandler.addObject( values );
@@ -373,9 +376,10 @@
             
             for ( DataElementCategory category : categories )
             {
-                DataElementCategoryOption dimensionOption = category.getCategoryOption( categoryOptionCombo );
+                DataElementCategoryOption categoryOption = category.getCategoryOption( categoryOptionCombo );
                 
-                values.add( dimensionOption != null ? dimensionOption.getName() : null );    
+                values.add( categoryOption != null ? categoryOption.getName() : null );
+                values.add( categoryOption != null ? String.valueOf( categoryOption.getId() ) : null );
             }
             
             batchHandler.addObject( values );

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java	2012-11-12 16:42:09 +0000
@@ -63,6 +63,7 @@
         for ( DataElementCategory category : categories )
         {
             statement += CodecUtils.databaseEncode( category.getName() ) + SPACE + LONG_TEXT_COLUMN_TYPE + SEPARATOR;
+            statement += "cat_" + category.getId() + SPACE + "INTEGER" + SEPARATOR;
         }
 
         statement += "PRIMARY KEY ( categoryoptioncomboid ) )";

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateDataElementGroupSetTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateDataElementGroupSetTableStatement.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateDataElementGroupSetTableStatement.java	2012-11-12 16:42:09 +0000
@@ -63,6 +63,7 @@
         for ( DataElementGroupSet groupSet : groupSets )
         {
             statement += CodecUtils.databaseEncode( groupSet.getName() ) + SPACE + LONG_TEXT_COLUMN_TYPE + SEPARATOR;
+            statement += "dgs_" + groupSet.getUid() + SPACE + "INTEGER" + SEPARATOR;
         }
         
         statement += "PRIMARY KEY ( dataelementid ) )";

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateIndicatorGroupSetTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateIndicatorGroupSetTableStatement.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateIndicatorGroupSetTableStatement.java	2012-11-12 16:42:09 +0000
@@ -63,6 +63,7 @@
         for ( IndicatorGroupSet groupSet : groupSets )
         {
             statement += CodecUtils.databaseEncode( groupSet.getName() ) + SPACE + LONG_TEXT_COLUMN_TYPE + SEPARATOR;
+            statement += "igs_" + groupSet.getUid() + SPACE + "INTEGER" + SEPARATOR;
         }
         
         statement += "PRIMARY KEY ( indicatorid ) )";

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateOrganisationUnitGroupSetTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateOrganisationUnitGroupSetTableStatement.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateOrganisationUnitGroupSetTableStatement.java	2012-11-12 16:42:09 +0000
@@ -63,6 +63,7 @@
         for ( OrganisationUnitGroupSet groupSet : groupSets )
         {
             statement += CodecUtils.databaseEncode( groupSet.getName() ) + SPACE + LONG_TEXT_COLUMN_TYPE + SEPARATOR;
+            statement += "ougs_" + groupSet.getUid() + SPACE + "INTEGER" + SEPARATOR;
         }
         
         statement += "PRIMARY KEY ( organisationunitid ) )";