← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1923: Removed startup routine, has served its purpose

 

------------------------------------------------------------
revno: 1923
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Fri 2010-05-28 20:17:58 +0200
message:
  Removed startup routine, has served its purpose
removed:
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/startup/ReportTableUpgrader.java
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.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
=== removed file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/startup/ReportTableUpgrader.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/startup/ReportTableUpgrader.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/startup/ReportTableUpgrader.java	1970-01-01 00:00:00 +0000
@@ -1,79 +0,0 @@
-package org.hisp.dhis.startup;
-
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.reporttable.ReportTable;
-import org.hisp.dhis.reporttable.ReportTableService;
-import org.hisp.dhis.system.startup.AbstractStartupRoutine;
-
-/**
- * The purpose of this startup routine is simply to make existing report tables
- * compatible with the new logic and can be removed after some time (included
- * at 26.09.2008).
- * 
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class ReportTableUpgrader
-    extends AbstractStartupRoutine
-{
-    private static final Log log = LogFactory.getLog( ReportTableUpgrader.class );
-
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private ReportTableService reportTableService;
-
-    public void setReportTableService( ReportTableService reportTableService )
-    {
-        this.reportTableService = reportTableService;
-    }
-
-    // -------------------------------------------------------------------------
-    // AbstractStartupRoutine implementation
-    // -------------------------------------------------------------------------
-
-    public void execute()
-        throws Exception
-    {
-        for ( ReportTable table : reportTableService.getAllReportTables() )
-        {
-            if ( table.getExistingTableName() == null || table.getExistingTableName().trim().length() == 0 )
-            {
-                table.setExistingTableName( table.getTableName() );
-                
-                reportTableService.updateReportTable( table );
-            }
-        }
-        
-        log.info( "Upgraded report tables" );
-    }
-}

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-05-18 20:05:58 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-05-28 18:17:58 +0000
@@ -238,13 +238,7 @@
     <property name="environmentVariable" value="OPENHEALTH_HOME"/>
     <property name="dataSourceFile" value="datasources.xml"/>
   </bean>
-  
-  <bean id="org.hisp.dhis.startup.ReportTableUpgrader"
-    class="org.hisp.dhis.startup.ReportTableUpgrader">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-  
+    
   <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
     <property name="targetObject"
       ref="org.hisp.dhis.system.startup.StartupRoutineExecutor"/>
@@ -252,7 +246,6 @@
     <property name="arguments">
       <list>
         <ref local="org.hisp.dhis.startup.OpenHealthDataSourceWriter"/>
-        <ref local="org.hisp.dhis.startup.ReportTableUpgrader"/>
       </list>
     </property>
   </bean>