← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2906: Removed obsolete properties

 

------------------------------------------------------------
revno: 2906
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-02-24 00:39:31 +0100
message:
  Removed obsolete properties
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportStoreTest.java
  dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.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/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2011-02-23 23:26:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2011-02-23 23:39:31 +0000
@@ -115,8 +115,7 @@
         put( OrganisationUnit.class, ORGANISATIONUNIT_ID );
     } };
 
-    private static final String EMPTY = "";    
-    private static final String TABLE_PREFIX = "_report_";
+    private static final String EMPTY = "";
     private static final IdentifiableObject[] IRT = new IdentifiableObject[0];
     private static final String[] SRT = new String[0];    
     private static final String ILLEGAL_FILENAME_CHARS_REGEX = "[/\\?%*:|\"<>.]";
@@ -126,16 +125,6 @@
     // -------------------------------------------------------------------------
 
     /**
-     * The name of the database table corresponding to the ReportTable object name.
-     */
-    private String tableName;
-    
-    /**
-     * The name of the existing database table.
-     */
-    private String existingTableName;
-    
-    /**
      * Whether the ReportTable contains regression columns.
      */
     private boolean regression;
@@ -327,8 +316,6 @@
         String reportingMonthName )
     {
         this.name = name;
-        this.tableName = generateTableName( name );
-        this.existingTableName = generateTableName( name );
         this.regression = regression;
         this.dataElements = dataElements;
         this.indicators = indicators;
@@ -370,11 +357,9 @@
         }
 
         // ---------------------------------------------------------------------
-        // Init tableName, allPeriods, allUnits, allIndicators
+        // Init allPeriods, allUnits, allIndicators
         // ---------------------------------------------------------------------
 
-        this.tableName = generateTableName( name );
-
         allIndicators.addAll( dataElements );
         allIndicators.addAll( indicators );
         allIndicators.addAll( dataSets );
@@ -407,15 +392,7 @@
     // -------------------------------------------------------------------------
     // Public methods
     // -------------------------------------------------------------------------
-    
-    /**
-     * Updates the existing table name with the current name.
-     */
-    public void updateExistingTableName()
-    {
-        this.existingTableName = generateTableName( name );
-    }
-    
+        
     /**
      * Tests whether this ReportTable is multi-dimensional.
      */
@@ -627,14 +604,6 @@
     }
 
     /**
-     * Generates a prefixed, database encoded name.
-     */
-    private static String generateTableName( String name )
-    {
-        return TABLE_PREFIX + columnEncode( name );
-    }
-
-    /**
      * Adds an empty list of IdentifiableObjects to the given list if empty.
      */
     private void addIfEmpty( List<List<IdentifiableObject>> list )
@@ -763,26 +732,6 @@
     // Get- and set-methods for persisted properties
     // -------------------------------------------------------------------------
 
-    public String getTableName()
-    {
-        return tableName;
-    }
-    
-    public void setTableName( String tableName )
-    {
-        this.tableName = tableName;
-    }
-    
-    public String getExistingTableName()
-    {
-        return existingTableName;
-    }
-
-    public void setExistingTableName( String existingTableName )
-    {
-        this.existingTableName = existingTableName;
-    }
-    
     public boolean isRegression()
     {
         return regression;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-02-23 14:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-02-23 23:39:31 +0000
@@ -89,6 +89,8 @@
         executeSql( "ALTER TABLE dataelementcategoryoption drop column categoryid" );
         executeSql( "ALTER TABLE reporttable DROP column dimension_type" );
         executeSql( "ALTER TABLE reporttable DROP column dimensiontype" );
+        executeSql( "ALTER TABLE reporttable DROP column tablename" );
+        executeSql( "ALTER TABLE reporttable DROP column existingtablename" );
         executeSql( "ALTER TABLE categoryoptioncombo DROP COLUMN displayorder" );
         executeSql( "ALTER TABLE dataelementcategoryoption DROP COLUMN shortname" );
         executeSql( "ALTER TABLE section DROP COLUMN label" );

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableConverter.java	2011-02-17 20:35:09 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableConverter.java	2011-02-23 23:39:31 +0000
@@ -64,8 +64,6 @@
 
     private static final String FIELD_ID = "id";
     private static final String FIELD_NAME = "name";
-    private static final String FIELD_TABLE_NAME = "tableName";
-    private static final String FIELD_EXISTING_TABLE_NAME = "existingTableName";
     private static final String FIELD_REGRESSION = "regression";
     
     private static final String FIELD_DATA_ELEMENTS = "dataElements";
@@ -181,8 +179,6 @@
                 
                 writer.writeElement( FIELD_ID, String.valueOf( reportTable.getId() ) );
                 writer.writeElement( FIELD_NAME, reportTable.getName() );
-                writer.writeElement( FIELD_TABLE_NAME, reportTable.getTableName() );
-                writer.writeElement( FIELD_EXISTING_TABLE_NAME, reportTable.getExistingTableName() );
                 writer.writeElement( FIELD_REGRESSION, String.valueOf( reportTable.isRegression() ) );
                 
                 writer.openElement( FIELD_DATA_ELEMENTS );
@@ -263,12 +259,6 @@
             reader.moveToStartElement( FIELD_NAME );
             reportTable.setName( reader.getElementValue() );
 
-            reader.moveToStartElement( FIELD_TABLE_NAME );
-            reportTable.setTableName( reader.getElementValue() );
-
-            reader.moveToStartElement( FIELD_EXISTING_TABLE_NAME );
-            reportTable.setExistingTableName( reader.getElementValue() );
-
             reader.moveToStartElement( FIELD_REGRESSION );
             reportTable.setRegression( Boolean.parseBoolean( reader.getElementValue() ) );
 

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java	2011-02-17 20:35:09 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java	2011-02-23 23:39:31 +0000
@@ -85,7 +85,6 @@
     protected void importMatching( ReportTable object, ReportTable match )
     {
         match.setName( object.getName() );
-        match.setTableName( object.getTableName() );
         match.setRegression( object.isRegression() );
         
         match.setDoIndicators( match.isDoIndicators() );
@@ -120,10 +119,6 @@
         {
             return false;
         }
-        if ( !object.getTableName().equals( existing.getTableName() ) )
-        {
-            return false;
-        }
         if ( object.isRegression() != existing.isRegression() )
         {
             return false;

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2011-02-23 23:26:47 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2011-02-23 23:39:31 +0000
@@ -352,7 +352,7 @@
     {
         String subtitle = StringUtils.trimToEmpty( reportTable.getOrganisationUnitName() ) + SPACE + StringUtils.trimToEmpty( reportTable.getReportingMonthName() );
         
-        Grid grid = new ListGrid().setTitle( reportTable.getName() ).setSubtitle( subtitle ).setTable( reportTable.getExistingTableName() );
+        Grid grid = new ListGrid().setTitle( reportTable.getName() ).setSubtitle( subtitle );
         
         final Map<String, Double> map = reportTableManager.getAggregatedValueMap( reportTable );
         

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2011-02-18 19:27:56 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2011-02-23 23:39:31 +0000
@@ -14,12 +14,6 @@
       <column name="name" not-null="true" unique="true"/>
     </property>
     
-    <property name="tableName">
-      <column name="tablename" not-null="true" unique="true"/>
-    </property>
-    
-    <property name="existingTableName"/>
-        
     <property name="regression"/>
     
     <list name="dataElements" table="reporttable_dataelements">

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportStoreTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportStoreTest.java	2011-02-22 23:05:45 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportStoreTest.java	2011-02-23 23:39:31 +0000
@@ -67,7 +67,6 @@
         
         reportTableA = new ReportTable();
         reportTableA.setName( "ReportTableA" );
-        reportTableA.setTableName( "ReportTableA" );
 
         reportTableService.saveReportTable( reportTableA );
     }

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java	2011-02-17 20:35:09 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java	2011-02-23 23:39:31 +0000
@@ -87,8 +87,6 @@
     protected void setColumns()
     {
         statementBuilder.setColumn( "name" );
-        statementBuilder.setColumn( "tablename" );
-        statementBuilder.setColumn( "existingtablename" );
         statementBuilder.setColumn( "regression" );
         statementBuilder.setColumn( "doindicators" );
         statementBuilder.setColumn( "doperiods" );
@@ -110,8 +108,6 @@
     protected void setValues( ReportTable reportTable )
     {        
         statementBuilder.setValue( reportTable.getName() );
-        statementBuilder.setValue( reportTable.getTableName() );
-        statementBuilder.setValue( reportTable.getExistingTableName() );
         statementBuilder.setValue( reportTable.isRegression() );
         statementBuilder.setValue( reportTable.isDoIndicators() );
         statementBuilder.setValue( reportTable.isDoPeriods() );