← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12907: Validation service, removed unused argument from method

 

------------------------------------------------------------
revno: 12907
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-11-08 23:17:41 +0100
message:
  Validation service, removed unused argument from method
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/Validator.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-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java	2013-10-30 11:24:24 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java	2013-11-08 22:17:41 +0000
@@ -171,25 +171,19 @@
     @Override
     public Collection<ValidationResult> validate( Date startDate, Date endDate, Collection<OrganisationUnit> sources )
     {
-        log.info( "Validate start: " + startDate + " end: " + endDate + " sources: " + sources.size() );
-        
-        Collection<Period> periods = periodService.getPeriodsBetweenDates( startDate, endDate );
-        Collection<ValidationRule> rules = getAllValidationRules();
-        
-        return Validator.validate( sources, periods, rules, ValidationRunType.INTERACTIVE, null,
-            constantService, expressionService, periodService, dataValueService );
+        return validate( startDate, endDate, sources, null );
     }
 
     @Override
     public Collection<ValidationResult> validate( Date startDate, Date endDate, Collection<OrganisationUnit> sources,
         ValidationRuleGroup group )
     {
-    	log.info( "Validate start:" + startDate + " end: " + endDate + " sources: " + sources.size() + " group: " + group.getName() );
+    	log.info( "Validate start:" + startDate + " end: " + endDate + " sources: " + sources.size() + " group: " + group );
     	
         Collection<Period> periods = periodService.getPeriodsBetweenDates( startDate, endDate );
-        Collection<ValidationRule> rules = group.getMembers();
+        Collection<ValidationRule> rules = group != null ? group.getMembers() : getAllValidationRules();
         
-        return Validator.validate( sources, periods, rules, ValidationRunType.INTERACTIVE, null,
+        return Validator.validate( sources, periods, rules, null,
             constantService, expressionService, periodService, dataValueService );
     }
 
@@ -203,7 +197,7 @@
         Collection<OrganisationUnit> sources = new HashSet<OrganisationUnit>();
         sources.add( source );
         
-        return Validator.validate( sources, periods, rules, ValidationRunType.INTERACTIVE, null,
+        return Validator.validate( sources, periods, rules, null,
             constantService, expressionService, periodService, dataValueService );
     }
 
@@ -232,7 +226,7 @@
         Collection<OrganisationUnit> sources = new HashSet<OrganisationUnit>();
         sources.add( source );
         
-        return Validator.validate( sources, periods, rules, ValidationRunType.INTERACTIVE, null,
+        return Validator.validate( sources, periods, rules, null,
             constantService, expressionService, periodService, dataValueService );
     }
 
@@ -258,7 +252,7 @@
         log.info( "Scheduled monitoring run sources: " + sources.size() + ", periods: " + periods.size() + ", rules:" + rules.size()
             + ", last run: " + ( lastScheduledRun == null ? "[none]" : lastScheduledRun ) );
         
-        Collection<ValidationResult> results = Validator.validate( sources, periods, rules, ValidationRunType.SCHEDULED,
+        Collection<ValidationResult> results = Validator.validate( sources, periods, rules,
             lastScheduledRun, constantService, expressionService, periodService, dataValueService );
         
         log.info( "Run results: " + results.size() );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/Validator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/Validator.java	2013-10-23 22:03:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/Validator.java	2013-11-08 22:17:41 +0000
@@ -68,7 +68,7 @@
      * @return a collection of any validations that were found
      */
     public static Collection<ValidationResult> validate( Collection<OrganisationUnit> sources,
-        Collection<Period> periods, Collection<ValidationRule> rules, ValidationRunType runType, Date lastScheduledRun,
+        Collection<Period> periods, Collection<ValidationRule> rules, Date lastScheduledRun,
         ConstantService constantService, ExpressionService expressionService, PeriodService periodService, DataValueService dataValueService )
     {
         ValidationRunContext context = ValidationRunContext.getNewValidationRunContext( sources, periods, rules,