← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2282: Removed deprecated and unused code

 

------------------------------------------------------------
revno: 2282
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2010-12-04 01:17:59 +0100
message:
  Removed deprecated and unused code
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/DataDictionaryService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/hibernate/HibernateValidationRuleStore.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleStoreTest.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientIdentifierTypeService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/programattributevalue/ProgramAttributeValueDeletionHandler.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/OrgUnit.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/ListDataElementGroupSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetIndicatorGroupListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ListIndicatorGroupSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/GetValidationRuleGroupListAction.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/datadictionary/DataDictionaryService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/DataDictionaryService.java	2010-12-03 12:31:32 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/DataDictionaryService.java	2010-12-04 00:17:59 +0000
@@ -30,7 +30,6 @@
 import java.util.Collection;
 
 import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.indicator.IndicatorGroupSet;
 
 /**
  * @author Lars Helge Overland

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java	2010-12-02 18:13:14 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java	2010-12-04 00:17:59 +0000
@@ -29,8 +29,6 @@
 
 import java.util.Collection;
 
-import org.hisp.dhis.dataelement.DataElementGroupSet;
-
 /**
  * @author Lars Helge Overland
  * @version $Id$

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleService.java	2010-12-03 16:15:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleService.java	2010-12-04 00:17:59 +0000
@@ -32,7 +32,6 @@
 import java.util.List;
 
 import org.hisp.dhis.common.Grid;
-import org.hisp.dhis.datadictionary.DataDictionary;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.period.Period;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java	2010-11-27 07:46:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java	2010-12-04 00:17:59 +0000
@@ -32,7 +32,6 @@
 import org.hibernate.Criteria;
 import org.hibernate.Query;
 import org.hibernate.Session;
-import org.hibernate.SessionFactory;
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.hibernate.HibernateGenericStore;
 import org.hisp.dhis.indicator.Indicator;
@@ -45,7 +44,6 @@
 public class HibernateIndicatorStore 
     extends HibernateGenericStore<Indicator> implements IndicatorStore
 {
-
     // -------------------------------------------------------------------------
     // Indicator
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/hibernate/HibernateValidationRuleStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/hibernate/HibernateValidationRuleStore.java	2010-09-04 06:30:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/hibernate/HibernateValidationRuleStore.java	2010-12-04 00:17:59 +0000
@@ -31,7 +31,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.hibernate.Hibernate;
 import org.hibernate.Session;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.hibernate.HibernateGenericStore;
@@ -107,9 +106,10 @@
         
         return validationRules;
     }
-    
+
+    @Override
     public Integer getNumberOfValidationRules()
     {
-        return (Integer) getSqlQuery( "select count(*) as no from validationrule" ).addScalar( "no", Hibernate.INTEGER ).uniqueResult();
+        return getCount();
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleStoreTest.java	2010-08-30 13:04:39 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleStoreTest.java	2010-12-04 00:17:59 +0000
@@ -287,4 +287,41 @@
         assertTrue( rules.contains( ruleA ) );
         assertTrue( rules.contains( ruleB ) );
     }
+
+    @Test
+    public void testGetValidationRuleCount()
+    {
+        Set<DataElement> dataElementsA = new HashSet<DataElement>();
+        dataElementsA.add( dataElementA );
+        dataElementsA.add( dataElementB );
+
+        Set<DataElement> dataElementsB = new HashSet<DataElement>();
+        dataElementsB.add( dataElementC );
+        dataElementsB.add( dataElementD );
+
+        Set<DataElement> dataElementsC = new HashSet<DataElement>();
+        
+        Set<DataElement> dataElementsD = new HashSet<DataElement>();
+        dataElementsD.addAll( dataElementsA );
+        dataElementsD.addAll( dataElementsB );        
+        
+        Expression expression1 = new Expression( "Expression1", "Expression1", dataElementsA );
+        Expression expression2 = new Expression( "Expression2", "Expression2", dataElementsB );
+        Expression expression3 = new Expression( "Expression3", "Expression3", dataElementsC );
+        
+        expressionService.addExpression( expression1 );
+        expressionService.addExpression( expression2 );
+        expressionService.addExpression( expression3 );
+        
+        ValidationRule ruleA = createValidationRule( 'A', ValidationRule.OPERATOR_EQUAL, expression1, expression3, periodType );
+        ValidationRule ruleB = createValidationRule( 'B', ValidationRule.OPERATOR_EQUAL, expression2, expression3, periodType );
+        ValidationRule ruleC = createValidationRule( 'C', ValidationRule.OPERATOR_EQUAL, expression3, expression3, periodType );
+
+        validationRuleStore.saveValidationRule( ruleA );
+        validationRuleStore.saveValidationRule( ruleB );
+        validationRuleStore.saveValidationRule( ruleC );
+        
+        assertNotNull( validationRuleStore.getNumberOfValidationRules().intValue() );
+        assertEquals( 3, validationRuleStore.getNumberOfValidationRules().intValue() );
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientIdentifierTypeService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientIdentifierTypeService.java	2010-12-01 08:10:28 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientIdentifierTypeService.java	2010-12-04 00:17:59 +0000
@@ -28,7 +28,6 @@
 
 import java.util.Collection;
 
-import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 import org.springframework.transaction.annotation.Transactional;
 
 /**

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/programattributevalue/ProgramAttributeValueDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/programattributevalue/ProgramAttributeValueDeletionHandler.java	2010-11-30 08:39:40 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/programattributevalue/ProgramAttributeValueDeletionHandler.java	2010-12-04 00:17:59 +0000
@@ -29,7 +29,6 @@
 
 import java.util.Collection;
 
-import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramAttribute;
 import org.hisp.dhis.program.ProgramInstance;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/OrgUnit.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/OrgUnit.java	2010-11-26 11:00:40 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/OrgUnit.java	2010-12-04 00:17:59 +0000
@@ -31,24 +31,23 @@
 import java.io.DataOutputStream;
 import java.io.IOException;
 
-import javax.xml.bind.annotation.XmlAttachmentRef;
 import javax.xml.bind.annotation.XmlAttribute;
 
-
-public class OrgUnit implements DataStreamSerializable {
-
+public class OrgUnit
+    implements DataStreamSerializable
+{
     private int id;
 
     private String name;
 
     private String downloadAllUrl;
-    
+
     private String downloadActivityPlanUrl;
-    
+
     private String uploadFacilityReportUrl;
-    
+
     private String uploadActivityReportUrl;
-    
+
     @XmlAttribute
     public int getId()
     {
@@ -120,7 +119,6 @@
         dataOutputStream.writeUTF( this.downloadActivityPlanUrl );
         dataOutputStream.writeUTF( this.uploadFacilityReportUrl );
         dataOutputStream.writeUTF( this.uploadActivityReportUrl );
-        
     }
 
     public void deSerialize( DataInputStream dataInputStream )
@@ -133,5 +131,4 @@
         this.uploadFacilityReportUrl = dataInputStream.readUTF();
         this.uploadActivityReportUrl = dataInputStream.readUTF();
     }
-
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java	2010-12-03 06:08:58 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java	2010-12-04 00:17:59 +0000
@@ -52,7 +52,6 @@
 import org.hisp.dhis.organisationunit.comparator.OrganisationUnitShortNameComparator;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.user.CurrentUserService;
 
 import com.opensymphony.xwork2.Action;
@@ -73,13 +72,6 @@
         this.selectionTreeManager = selectionTreeManager;
     }
 
-    private PeriodService periodService;
-
-    public void setPeriodService( PeriodService periodService )
-    {
-        this.periodService = periodService;
-    }
-
     private DataSetService dataSetService;
 
     public void setDataSetService( DataSetService dataSetService )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2010-12-03 06:08:58 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2010-12-04 00:17:59 +0000
@@ -357,7 +357,6 @@
 		scope="prototype">
 		<property name="selectionTreeManager"
 			ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
-		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
 		<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
 		<property name="aggregationConditionService"
 			ref="org.hisp.dhis.caseaggregation.CaseAggregationConditionService" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/ListDataElementGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/ListDataElementGroupSetAction.java	2010-12-01 18:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/ListDataElementGroupSetAction.java	2010-12-04 00:17:59 +0000
@@ -33,7 +33,6 @@
 import java.util.Collections;
 import java.util.List;
 
-import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataelement.comparator.DataElementGroupSetNameComparator;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetIndicatorGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetIndicatorGroupListAction.java	2010-12-02 17:54:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetIndicatorGroupListAction.java	2010-12-04 00:17:59 +0000
@@ -35,12 +35,9 @@
 
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.IndicatorType;
 import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
-import com.opensymphony.xwork2.ActionSupport;
-
 /**
  * @author Torgeir Lorange Ostby
  * @version $Id: GetIndicatorGroupListAction.java 3305 2007-05-14 18:55:52Z larshelg $

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ListIndicatorGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ListIndicatorGroupSetAction.java	2010-12-02 18:13:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ListIndicatorGroupSetAction.java	2010-12-04 00:17:59 +0000
@@ -39,8 +39,6 @@
 import org.hisp.dhis.indicator.comparator.IndicatorGroupSetNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
-import com.opensymphony.xwork2.Action;
-
 /**
  * @author Tran Thanh Tri
  * @version $Id$

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java	2010-12-02 17:41:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java	2010-12-04 00:17:59 +0000
@@ -33,14 +33,11 @@
 import java.util.Collections;
 import java.util.List;
 
-import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.indicator.IndicatorType;
 import org.hisp.dhis.indicator.comparator.IndicatorTypeNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
-import com.opensymphony.xwork2.ActionSupport;
-
 /**
  * @author Torgeir Lorange Ostby
  * @version $Id: GetIndicatorTypeListAction.java 3305 2007-05-14 18:55:52Z larshelg $

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/GetValidationRuleGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/GetValidationRuleGroupListAction.java	2010-12-03 16:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/GetValidationRuleGroupListAction.java	2010-12-04 00:17:59 +0000
@@ -34,13 +34,10 @@
 import java.util.List;
 
 import org.hisp.dhis.paging.ActionPagingSupport;
-import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleGroup;
 import org.hisp.dhis.validation.ValidationRuleService;
 import org.hisp.dhis.validation.comparator.ValidationRuleGroupNameComparator;
 
-import com.opensymphony.xwork2.Action;
-
 /**
 * @author Lars Helge Overland
 * @version $Id$