=== 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 2010-05-28 19:17:07 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/DefaultValidationRuleService.java 2010-08-30 06:24:45 +0000 @@ -109,10 +109,7 @@ { if ( (relevantRules = getRelevantValidationRules( dataSet )).size() > 0 ) { - for ( Period period : relevantPeriods ) // TODO use only - // period with - // validation rule - // period type + for ( Period period : relevantPeriods ) // TODO use only period with validation rule period type { validationViolations.addAll( validate( period, source, relevantRules ) ); } @@ -253,13 +250,11 @@ { final Collection relevantValidationRules = new HashSet(); - for ( final ValidationRule validationRule : validationRules ) + for ( ValidationRule validationRule : validationRules ) { - // Check periodType of the validationRule - if ( validationRule.getPeriodType() == dataSet.getPeriodType() ) { - for ( final DataElement dataElement : dataSet.getDataElements() ) + for ( DataElement dataElement : dataSet.getDataElements() ) { if ( validationRule.getLeftSide().getDataElementsInExpression().contains( dataElement ) || validationRule.getRightSide().getDataElementsInExpression().contains( dataElement ) ) === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/PdfService.java' --- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/PdfService.java 2010-06-03 08:06:09 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/PdfService.java 2010-08-30 06:24:45 +0000 @@ -56,6 +56,6 @@ void writeDataSetCompletenessResult( Collection results, OutputStream out, I18n i18n, OrganisationUnit unit, DataSet dataSet ); - void writeValidationResult( Map> results, OutputStream out, I18n i18n, + void writeValidationResult( List results, OutputStream out, I18n i18n, I18nFormat format ); } === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java' --- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java 2010-06-08 07:00:46 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java 2010-08-30 06:24:45 +0000 @@ -288,7 +288,7 @@ closeDocument( document ); } - public void writeValidationResult( Map> results, OutputStream out, I18n i18n, + public void writeValidationResult( List results, OutputStream out, I18n i18n, I18nFormat format ) { Document document = openDocument( out ); @@ -318,31 +318,22 @@ if ( results != null ) { - for ( String periodTypeName : results.keySet() ) + for ( ValidationResult validationResult : results ) { - List validationResults = results.get( periodTypeName ); - - table.addCell( getCell( 7, 8 ) ); - - table.addCell( getItalicCell( periodTypeName, 7 ) ); - - for ( ValidationResult validationResult : validationResults ) - { - OrganisationUnit unit = (OrganisationUnit) validationResult.getSource(); - - Period period = validationResult.getPeriod(); - - table.addCell( getTextCell( unit.getName(), TEXT ) ); - table.addCell( getTextCell( format.formatPeriod( period ), TEXT ) ); - table.addCell( getTextCell( validationResult.getValidationRule().getLeftSide().getDescription(), - TEXT ) ); - table.addCell( getTextCell( String.valueOf( validationResult.getLeftsideValue() ) ) ); - table.addCell( getTextCell( i18n.getString( validationResult.getValidationRule().getOperator() ), - 1, ALIGN_CENTER ) ); - table.addCell( getTextCell( String.valueOf( validationResult.getRightsideValue() ) ) ); - table.addCell( getTextCell( validationResult.getValidationRule().getRightSide().getDescription(), - TEXT ) ); - } + OrganisationUnit unit = (OrganisationUnit) validationResult.getSource(); + + Period period = validationResult.getPeriod(); + + table.addCell( getTextCell( unit.getName(), TEXT ) ); + table.addCell( getTextCell( format.formatPeriod( period ), TEXT ) ); + table.addCell( getTextCell( validationResult.getValidationRule().getLeftSide().getDescription(), + TEXT ) ); + table.addCell( getTextCell( String.valueOf( validationResult.getLeftsideValue() ) ) ); + table.addCell( getTextCell( i18n.getString( validationResult.getValidationRule().getOperator() ), + 1, ALIGN_CENTER ) ); + table.addCell( getTextCell( String.valueOf( validationResult.getRightsideValue() ) ) ); + table.addCell( getTextCell( validationResult.getValidationRule().getRightSide().getDescription(), + TEXT ) ); } } === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java' --- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java 2010-05-26 15:58:31 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java 2010-08-30 06:24:45 +0000 @@ -30,7 +30,6 @@ import java.io.OutputStream; import java.util.Collection; import java.util.List; -import java.util.Map; import org.hisp.dhis.completeness.DataSetCompletenessResult; import org.hisp.dhis.dataset.DataSet; @@ -57,5 +56,5 @@ void writeDataSetCompletenessResult( Collection results, OutputStream out, I18n i18n, OrganisationUnit unit, DataSet dataSet ); - void writeValidationResult( Map> results, OutputStream out, I18n i18n, I18nFormat format ); + void writeValidationResult( List results, OutputStream out, I18n i18n, I18nFormat format ); } === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java' --- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java 2010-05-26 15:58:31 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java 2010-08-30 06:24:45 +0000 @@ -395,8 +395,7 @@ } } - public void writeValidationResult( Map> results, OutputStream out, I18n i18n, - I18nFormat format ) + public void writeValidationResult( List results, OutputStream out, I18n i18n, I18nFormat format ) { final int MARGIN_LEFT = 1; @@ -434,38 +433,31 @@ if ( results != null ) { - for ( String periodTypeName : results.keySet() ) + for ( ValidationResult result : results ) { - List validationResults = results.get( periodTypeName ); - - sheet.addCell( new Label( MARGIN_LEFT + 0, row++, periodTypeName, columnHeader ) ); - - for ( ValidationResult result : validationResults ) - { - OrganisationUnit unit = (OrganisationUnit) result.getSource(); - - Period period = result.getPeriod(); - - sheet.addCell( new Label( MARGIN_LEFT + 0, row, unit.getName(), text ) ); - sheet.addCell( new Label( MARGIN_LEFT + 1, row, format.formatPeriod( period ), text ) ); - sheet.addCell( new Label( MARGIN_LEFT + 2, row, result.getValidationRule().getLeftSide() - .getDescription(), text ) ); - sheet.addCell( new Number( MARGIN_LEFT + 3, row, result.getLeftsideValue(), text ) ); - sheet.addCell( new Label( MARGIN_LEFT + 4, row, i18n.getString( result.getValidationRule() - .getOperator() ), text ) ); - sheet.addCell( new Number( MARGIN_LEFT + 5, row, result.getRightsideValue(), text ) ); - sheet.addCell( new Label( MARGIN_LEFT + 6, row, result.getValidationRule().getRightSide() - .getDescription(), text ) ); - - row++; - } + OrganisationUnit unit = (OrganisationUnit) result.getSource(); + + Period period = result.getPeriod(); + + sheet.addCell( new Label( MARGIN_LEFT + 0, row, unit.getName(), text ) ); + sheet.addCell( new Label( MARGIN_LEFT + 1, row, format.formatPeriod( period ), text ) ); + sheet.addCell( new Label( MARGIN_LEFT + 2, row, result.getValidationRule().getLeftSide() + .getDescription(), text ) ); + sheet.addCell( new Number( MARGIN_LEFT + 3, row, result.getLeftsideValue(), text ) ); + sheet.addCell( new Label( MARGIN_LEFT + 4, row, i18n.getString( result.getValidationRule() + .getOperator() ), text ) ); + sheet.addCell( new Number( MARGIN_LEFT + 5, row, result.getRightsideValue(), text ) ); + sheet.addCell( new Label( MARGIN_LEFT + 6, row, result.getValidationRule().getRightSide() + .getDescription(), text ) ); + + row++; } workbook.write(); workbook.close(); - }// end if + } } catch ( IOException ex ) { === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm 2010-07-04 23:55:46 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm 2010-08-30 06:24:45 +0000 @@ -122,10 +122,7 @@ var i18n_aggregate = '$encoder.jsEscape( $i18n.getString( "aggregate" ) , "'")'; var i18n_patient = '$encoder.jsEscape( $i18n.getString( "patient" ) , "'")'; - jQuery(document).ready(function(){ tableSorter( 'dataElementList' ); }); - - === modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GenerateValidationResultPDFAction.java' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GenerateValidationResultPDFAction.java 2010-05-26 15:58:31 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GenerateValidationResultPDFAction.java 2010-08-30 06:24:45 +0000 @@ -31,7 +31,6 @@ import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.List; -import java.util.Map; import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.i18n.I18nFormat; @@ -94,7 +93,7 @@ public String execute() throws Exception { - Map> results = (Map>) SessionUtils. + List results = (List) SessionUtils. getSessionVar( KEY_VALIDATIONRESULT ); ByteArrayOutputStream out = new ByteArrayOutputStream(); === modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GenerateValidationResultWorkbookAction.java' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GenerateValidationResultWorkbookAction.java 2010-05-27 08:42:06 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GenerateValidationResultWorkbookAction.java 2010-08-30 06:24:45 +0000 @@ -31,7 +31,6 @@ import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.List; -import java.util.Map; import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.i18n.I18nFormat; @@ -94,7 +93,7 @@ public String execute() throws Exception { - Map> results = (Map>) SessionUtils. + List results = (List) SessionUtils. getSessionVar( KEY_VALIDATIONRESULT ); ByteArrayOutputStream out = new ByteArrayOutputStream(); === modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/RunValidationAction.java' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/RunValidationAction.java 2010-06-30 16:52:11 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/RunValidationAction.java 2010-08-30 06:24:45 +0000 @@ -30,10 +30,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -41,7 +39,6 @@ import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.hisp.dhis.oust.manager.SelectionTreeManager; -import org.hisp.dhis.period.PeriodType; import org.hisp.dhis.source.Source; import org.hisp.dhis.util.SessionUtils; import org.hisp.dhis.validation.ValidationResult; @@ -129,12 +126,12 @@ { this.validationRuleGroupId = validationRuleGroupId; } - - private Map> mapValidationResults; - - public Map> getMapValidationResults() + + private List validationResults; + + public List getValidationResults() { - return mapValidationResults; + return validationResults; } // ------------------------------------------------------------------------- @@ -154,8 +151,6 @@ sources = organisationUnits; - List validationResults = null; - if ( validationRuleGroupId == -1 ) { log.info( "Validating all rules" ); @@ -175,29 +170,7 @@ Collections.sort( validationResults, new ValidationResultComparator() ); - mapValidationResults = new HashMap>(); - - for ( ValidationResult validationResult : validationResults ) - { - PeriodType periodType = validationResult.getPeriod().getPeriodType(); - - if ( periodType != null ) - { - - List result = mapValidationResults.get( periodType.getName() ); - - if ( result == null ) - { - result = new ArrayList(); - } - - result.add( validationResult ); - - mapValidationResults.put( periodType.getName(), result ); - } - } - - SessionUtils.setSessionVar( KEY_VALIDATIONRESULT, mapValidationResults ); + SessionUtils.setSessionVar( KEY_VALIDATIONRESULT, validationResults ); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js 2010-06-30 16:52:11 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js 2010-08-30 06:24:45 +0000 @@ -27,6 +27,7 @@ $( "div#analysisInput" ).hide(); $( "div#analysisResult" ).show(); $( "div#analysisResult" ).html( data ); + pageInit(); } ); } else if ( type == 'error' ) === modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultForm.vm' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultForm.vm 2010-05-26 15:58:31 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultForm.vm 2010-08-30 06:24:45 +0000 @@ -35,16 +35,16 @@ $i18n.getString( "validation_passed_successfully" ) #else - +
- - - - - - - - + + + + + + + + @@ -58,45 +58,24 @@ - - - + + #foreach( $result in $validationResults ) + + + + + + + + + + + #end +
$i18n.getString( "details" )
- #foreach($periodType in $mapValidationResults.keySet()) -
- $periodType - - - - - - - - - - - - - #foreach( $result in $mapValidationResults.get($periodType) ) - - - - - - - - - - - #end - -
$!result.source.name$!format.formatPeriod( $result.period )$!result.validationRule.leftSide.description$!result.leftsideValue$i18n.getString( $!result.validationRule.operator )$!result.rightsideValue$!result.validationRule.rightSide.description - - $i18n.getString( 'show_details' ) - -
-
- #end -
$!result.source.name$!format.formatPeriod( $result.period )$!result.validationRule.leftSide.description$!result.leftsideValue$i18n.getString( $!result.validationRule.operator )$!result.rightsideValue$!result.validationRule.rightSide.description + + $i18n.getString( 'show_details' ) + +
#end