← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6291: Remove unused services from local/in

 

------------------------------------------------------------
revno: 6291
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-03-19 11:41:45 +0530
message:
  Remove unused services from local/in
modified:
  local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java
  local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java
  local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/portal/action/PortalExcelImportResultAction.java
  local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/tcs/action/TCSXmlImportResultAction.java
  local/in/dhis-web-excelimport/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportResultAction.java
  local/in/dhis-web-reports-national/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
=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java'
--- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java	2012-02-02 09:56:51 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java	2012-03-19 06:11:45 +0000
@@ -45,7 +45,6 @@
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataentryform.DataEntryForm;
-import org.hisp.dhis.datalock.DataSetLockService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.dataset.Section;
@@ -127,14 +126,15 @@
     public SelectedStateManager getSelectedStateManager()
     {
         return selectedStateManager;
-    }    
+    }
+    /*
     private DataSetLockService dataSetLockService;
     
     public void setDataSetLockService( DataSetLockService dataSetLockService)
     {
         this.dataSetLockService = dataSetLockService;
     }
-
+    */
     private I18n i18n;
 
     public void setI18n( I18n i18n )
@@ -449,10 +449,22 @@
     private static final String SECTION_FORM = "sectionform";
  */   
     
+    private boolean lockStatus;
+    
+    public boolean isLockStatus()
+    {
+        return lockStatus;
+    }
+
+
+    
+    
+    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
 
+
     public String execute()
         throws Exception
     {
@@ -796,6 +808,11 @@
             
         }
         
+        lockStatus = dataSetService.isLocked( dataSet, period, organisationUnit, null );
+        
+        
+        
+        /*
         if( dataSetLockService == null )
         {
             System.out.println(" DataSetLockService is null");
@@ -807,6 +824,22 @@
                 locked = true;
             }
         }
+        */
+        if( !lockStatus )
+        {
+            System.out.println(" DataSet Not Lock");
+        }
+        
+        if( lockStatus )
+        {
+            System.out.println(" DataSet Lockd");
+            //if( dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period ).getSources().contains(organisationUnit) ) 
+            //{
+                locked = true;
+            //}
+        }
+        
+        
         
         maxRecordNo = dataValueService.getMaxRecordNo();
         

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml	2012-02-02 09:56:51 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml	2012-03-19 06:11:45 +0000
@@ -103,8 +103,8 @@
       ref="org.hisp.dhis.den.state.SelectedStateManager"/>    
 	<property name="dataElementCategoryService"
       ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>
-	<property name="dataSetLockService"
-      ref="org.hisp.dhis.datalock.DataSetLockService"/>  
+	<!--<property name="dataSetLockService"
+      ref="org.hisp.dhis.datalock.DataSetLockService"/>-->
 	<property name="dataSetService"
       ref="org.hisp.dhis.dataset.DataSetService"/>
     <property name="sectionService" ref="org.hisp.dhis.dataset.SectionService"/>

=== modified file 'local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java'
--- local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java	2011-04-15 11:42:21 +0000
+++ local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java	2012-03-19 06:11:45 +0000
@@ -35,8 +35,6 @@
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.datalock.DataSetLock;
-import org.hisp.dhis.datalock.DataSetLockService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.datavalue.DataValue;
@@ -137,14 +135,14 @@
     {
         this.currentUserService = currentUserService;
     }
-
+    /*
     private DataSetLockService dataSetLockService;
     
     public void setDataSetLockService( DataSetLockService dataSetLockService )
     {
         this.dataSetLockService = dataSetLockService;
     }
-
+    */
     private SessionFactory sessionFactory;
 
     public void setSessionFactory( SessionFactory sessionFactory )
@@ -504,6 +502,14 @@
 
     OrganisationUnit orgUnit;
     
+    private boolean lockStatus;
+    
+    public boolean isLockStatus()
+    {
+        return lockStatus;
+    }
+    
+    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -601,9 +607,12 @@
 
         eDate = format.parseDate( String.valueOf( selectedPeriod.getEndDate() ) );
 
-        DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet, selectedPeriod, orgUnit );
-        
-        if( dataSetLock != null )
+        //DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet, selectedPeriod, orgUnit );
+        
+        lockStatus = dataSetService.isLocked( dataSet, selectedPeriod, orgUnit, null );
+        
+        //if( dataSetLock != null )
+        if( lockStatus )
         {
             message = "Unable to Import : Corresponding Dataset ( "+dataSet.getName()+" ) for the selected Excel Template is locked.";
             

=== modified file 'local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/portal/action/PortalExcelImportResultAction.java'
--- local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/portal/action/PortalExcelImportResultAction.java	2011-10-14 12:26:01 +0000
+++ local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/portal/action/PortalExcelImportResultAction.java	2012-03-19 06:11:45 +0000
@@ -21,8 +21,6 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
-import org.hisp.dhis.datalock.DataSetLock;
-import org.hisp.dhis.datalock.DataSetLockService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.excelimport.util.ExcelImport_DeCode;
@@ -110,14 +108,14 @@
     {
         this.currentUserService = currentUserService;
     }
-    
+    /*
     private DataSetLockService dataSetLockService;
     
     public void setDataSetLockService( DataSetLockService dataSetLockService )
     {
         this.dataSetLockService = dataSetLockService;
     }
-
+    */
     private DataSetService dataSetService;
 
     public void setDataSetService( DataSetService dataSetService )
@@ -219,6 +217,13 @@
     }
 
     private String raFolderName;
+    
+    private boolean lockStatus;
+    
+    public boolean isLockStatus()
+    {
+        return lockStatus;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -575,8 +580,10 @@
                     if( portalOrgUnit != null && orgUnitList.contains( portalOrgUnit ) )
                     {
                         System.out.println("--------Importing started for :"+portalOrgUnit.getName() + "-------------" );
-                        DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet, selectedPeriod, portalOrgUnit );
-                        if( dataSetLock != null )
+                        lockStatus = dataSetService.isLocked( dataSet, selectedPeriod, portalOrgUnit, null );
+                        //DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet, selectedPeriod, portalOrgUnit );
+                        //if( dataSetLock != null )
+                        if( lockStatus )
                         {
                             message += "<br><font color=red><strong>Unable to Import : Corresponding Dataset ( "+dataSet.getName()+" ) for " + portalOrgUnit.getName() + " and for period : " + periodFormat.format( selectedPeriod.getStartDate() ) + " is locked.</strong></font>";
                             System.out.println("Unable to Import : Corresponding Dataset ( "+dataSet.getName()+" ) for " + portalOrgUnit.getName() + " and for period : " + periodFormat.format( selectedPeriod.getStartDate() ) + " is locked.");

=== modified file 'local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/tcs/action/TCSXmlImportResultAction.java'
--- local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/tcs/action/TCSXmlImportResultAction.java	2011-06-17 04:57:05 +0000
+++ local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/tcs/action/TCSXmlImportResultAction.java	2012-03-19 06:11:45 +0000
@@ -12,7 +12,6 @@
 import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.amplecode.quick.StatementManager;
-import org.hisp.dhis.datalock.DataSetLockService;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.excelimport.util.ReportService;
 import org.hisp.dhis.excelimport.util.TCSXMLMap;
@@ -81,14 +80,14 @@
     {
         this.currentUserService = currentUserService;
     }
-    
+ /*   
     private DataSetLockService dataSetLockService;
     
     public void setDataSetLockService( DataSetLockService dataSetLockService )
     {
         this.dataSetLockService = dataSetLockService;
     }
-
+*/
     private DataSetService dataSetService;
 
     public void setDataSetService( DataSetService dataSetService )

=== modified file 'local/in/dhis-web-excelimport/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-excelimport/src/main/resources/META-INF/dhis/beans.xml	2012-02-02 09:56:51 +0000
+++ local/in/dhis-web-excelimport/src/main/resources/META-INF/dhis/beans.xml	2012-03-19 06:11:45 +0000
@@ -22,7 +22,7 @@
         <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
         <property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
         <property name="reportService" ref="org.hisp.dhis.excelimport.util.ReportService" />
-        <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
+        <!--<property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />-->
         <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
         <property name="sessionFactory" ref="sessionFactory"/>
     </bean>
@@ -43,7 +43,7 @@
         <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
         <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
         <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-        <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
+        <!--<property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />-->
         <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
     </bean>
     
@@ -61,7 +61,7 @@
         <property name="jdbcTemplate" ref="jdbcTemplate" />
         <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
         <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-        <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
+        <!--<property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />-->
         <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
     </bean>
     

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportResultAction.java	2012-02-02 09:56:51 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportResultAction.java	2012-03-19 06:11:45 +0000
@@ -24,8 +24,6 @@
 
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.config.Configuration_IN;
-import org.hisp.dhis.datalock.DataSetLock;
-import org.hisp.dhis.datalock.DataSetLockService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.i18n.I18nFormat;
@@ -65,14 +63,14 @@
     {
         this.dataSetService = dataSetService;
     }
-
+/*
     private DataSetLockService dataSetLockService;
 
     public void setDataSetLockService( DataSetLockService dataSetLockService )
     {
         this.dataSetLockService = dataSetLockService;
     }
-
+*/
     private ReportService reportService;
 
     public void setReportService( ReportService reportService )
@@ -316,9 +314,11 @@
                 sheet0.mergeCells( colStart + columnNo, rowStart + rowNo + 1, colStart + columnNo, x + 1 );
                 for ( Period periodElement : periods )
                 {
-                    DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet,
-                        periodElement, organisationUnit );
-                    if ( dataSetLock != null )
+                    
+                    boolean lockStatus = dataSetService.isLocked( dataSet, periodElement, organisationUnit, null );
+                    //DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet, periodElement, organisationUnit );
+                    //if ( dataSetLock != null )
+                    if ( lockStatus )
                     {
                         sheet0.addCell( new Number( colStart
                             + organisationUnitService.getNumberOfOrganisationalLevels() + 1 + periodsCounter, rowStart
@@ -389,9 +389,10 @@
                 int periodsCounter = 0;
                 for ( Period periodElement : periods )
                 {
-                    DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet,
-                        periodElement, organisationUnit );
-                    if ( dataSetLock != null )
+                    //DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet, periodElement, organisationUnit );
+                    boolean lockStatus = dataSetService.isLocked( dataSet, periodElement, organisationUnit, null );
+                    //if ( dataSetLock != null )
+                    if ( lockStatus )
                     {
                         sheet0.addCell( new Number( colStart
                             + organisationUnitService.getNumberOfOrganisationalLevels() + 1 + periodsCounter, rowStart

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml	2012-02-17 07:09:28 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml	2012-03-19 06:11:45 +0000
@@ -341,9 +341,9 @@
         <property name="dataSetService">
             <ref bean="org.hisp.dhis.dataset.DataSetService"/>
         </property>
-        <property name="dataSetLockService">
+<!--        <property name="dataSetLockService">
             <ref bean="org.hisp.dhis.datalock.DataSetLockService"/>
-        </property>
+        </property>-->
         <property name="reportService" ref="org.hisp.dhis.reports.ReportService">
         </property>
     </bean>