← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2226: Merged r 2077..2078 from 2.0.5

 

------------------------------------------------------------
revno: 2226
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2010-11-29 18:16:41 +0100
message:
  Merged r 2077..2078 from 2.0.5
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java
  dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlIndicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataintegrity/GetDataIntegrityAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataIntegrityForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataIntegrity.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseDataIntegrity.vm


--
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/dataintegrity/DataIntegrityService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java	2010-07-13 15:50:08 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java	2010-11-29 17:16:41 +0000
@@ -32,6 +32,7 @@
 
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
@@ -82,6 +83,16 @@
     SortedMap<DataElement, Collection<DataSet>> getDataElementsAssignedToDataSetsWithDifferentPeriodTypes();
 
     // -------------------------------------------------------------------------
+    // Section
+    // -------------------------------------------------------------------------
+
+    /**
+     * Gets all section with invalid category combinations. Invalid means that
+     * the data elements in the sections don't have the same category combination.
+     */
+    Collection<Section> getSectionsWithInvalidCategoryCombinations();
+    
+    // -------------------------------------------------------------------------
     // DataSet
     // -------------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java	2010-11-20 10:53:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java	2010-11-29 17:16:41 +0000
@@ -84,6 +84,26 @@
 
         return false;
     }
+    
+    public boolean categorComboIsInvalid()
+    {
+        if ( dataElements != null && dataElements.size() > 0 )
+        {
+            DataElementCategoryCombo categoryCombo = null;
+            
+            for ( DataElement element : dataElements )
+            {
+                if ( categoryCombo != null && !categoryCombo.equals( element.getCategoryCombo() ) )
+                {
+                    return true;
+                }
+                
+                categoryCombo = element.getCategoryCombo();
+            }
+        }
+        
+        return false;
+    }
 
     // -------------------------------------------------------------------------
     // hashCode, equals and toString

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java	2010-07-13 15:50:08 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java	2010-11-29 17:16:41 +0000
@@ -43,6 +43,8 @@
 import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.Section;
+import org.hisp.dhis.dataset.SectionService;
 import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
@@ -99,6 +101,13 @@
     {
         this.dataSetService = dataSetService;
     }
+    
+    private SectionService sectionService;
+
+    public void setSectionService( SectionService sectionService )
+    {
+        this.sectionService = sectionService;
+    }
 
     private OrganisationUnitService organisationUnitService;
 
@@ -181,7 +190,6 @@
     @Override
     public Collection<DataElement> getDataElementsViolatingCompulsoryGroupSets()
     {
-
         Collection<DataElementGroupSet> groupSets = dataElementService.getAllDataElementGroupSets();
 
         Collection<DataElement> dataElements = dataElementService.getAllDataElements();
@@ -237,6 +245,25 @@
     }
 
     // -------------------------------------------------------------------------
+    // Section
+    // -------------------------------------------------------------------------
+
+    public Collection<Section> getSectionsWithInvalidCategoryCombinations()
+    {
+        Collection<Section> sections = new HashSet<Section>();
+        
+        for ( Section section : sectionService.getAllSections() )
+        {
+            if ( section.categorComboIsInvalid() )
+            {
+                sections.add( section );
+            }
+        }
+        
+        return sections;
+    }
+    
+    // -------------------------------------------------------------------------
     // Indicator
     // -------------------------------------------------------------------------
 
@@ -382,16 +409,13 @@
 
                     break;
                 }
-                else if ( visited.contains( parent ) ) // Ends in cyclic
-                // reference but not part
-                // of it
+                else if ( visited.contains( parent ) ) // Ends in cyclic ref
                 {
                     break;
                 }
                 else
-                // Remember visited
                 {
-                    visited.add( parent );
+                    visited.add( parent ); // Remember visited
                 }
             }
 

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml	2010-11-22 10:45:31 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml	2010-11-29 17:16:41 +0000
@@ -55,6 +55,8 @@
       ref="org.hisp.dhis.indicator.IndicatorService"/>
     <property name="dataSetService"
       ref="org.hisp.dhis.dataset.DataSetService"/>
+	<property name="sectionService"
+	  ref="org.hisp.dhis.dataset.SectionService"/>
     <property name="organisationUnitService"
       ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
     <property name="organisationUnitGroupService"

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlIndicator.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlIndicator.vm	2010-11-20 08:23:34 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlIndicator.vm	2010-11-29 17:16:41 +0000
@@ -6,7 +6,7 @@
     <alternativeName>$!encoder.xmlEncode( $indicator.alternativeName )</alternativeName>
     <code>$!encoder.xmlEncode( $indicator.code )</code>
     <description>$!encoder.xmlEncode( $indicator.description )</description>
-    <annualized>$indicator.annualized</annualized>
+    <annualized>$indicator.isAnnualized()</annualized>
     <indicatorTypeId>$indicator.indicatorType.id</indicatorTypeId>
     <indicatorTypeName>$!encoder.xmlEncode( $indicator.indicatorType.name )</indicatorTypeName>
     <numerator>$!encoder.xmlEncode( $indicator.numerator )</numerator>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataintegrity/GetDataIntegrityAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataintegrity/GetDataIntegrityAction.java	2010-07-13 15:50:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataintegrity/GetDataIntegrityAction.java	2010-11-29 17:16:41 +0000
@@ -37,7 +37,9 @@
 import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.dataintegrity.DataIntegrityService;
 import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
+import org.hisp.dhis.dataset.comparator.SectionOrderComparator;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.comparator.IndicatorNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -106,6 +108,13 @@
         return dataSetsNotAssignedToOrganisationUnits;
     }
 
+    private List<Section> sectionsWithInvalidCategoryCombinations;
+    
+    public List<Section> getSectionsWithInvalidCategoryCombinations()
+    {
+        return sectionsWithInvalidCategoryCombinations;
+    }
+
     private Map<DataElement, Collection<DataSet>> dataElementsAssignedToDataSetsWithDifferentPeriodTypes;
 
     public Map<DataElement, Collection<DataSet>> getDataElementsAssignedToDataSetsWithDifferentPeriodTypes()
@@ -236,6 +245,9 @@
         dataSetsNotAssignedToOrganisationUnits = new ArrayList<DataSet>( dataIntegrityService
             .getDataSetsNotAssignedToOrganisationUnits() );
 
+        sectionsWithInvalidCategoryCombinations = new ArrayList<Section>( dataIntegrityService.
+            getSectionsWithInvalidCategoryCombinations() );
+        
         indicatorsWithIdenticalFormulas = dataIntegrityService.getIndicatorsWithIdenticalFormulas();
         indicatorsWithoutGroups = new ArrayList<Indicator>( dataIntegrityService.getIndicatorsWithoutGroups() );
         invalidIndicatorNumerators = dataIntegrityService.getInvalidIndicatorNumerators();
@@ -267,6 +279,7 @@
         Collections.sort( dataElementsViolatingCompulsoryGroupSets, new DataElementNameComparator() );
         Collections.sort( dataElementsViolatingExclusiveGroupSets, new DataElementNameComparator() );
         Collections.sort( dataSetsNotAssignedToOrganisationUnits, new DataSetNameComparator() );
+        Collections.sort( sectionsWithInvalidCategoryCombinations, new SectionOrderComparator() );
         Collections.sort( indicatorsWithoutGroups, new IndicatorNameComparator() );
         Collections.sort( indicatorsViolatingCompulsoryGroupSets, new IndicatorNameComparator() );
         Collections.sort( indicatorsViolatingExclusiveGroupSets, new IndicatorNameComparator() );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2010-11-18 06:46:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2010-11-29 17:16:41 +0000
@@ -317,5 +317,6 @@
 orgunit_group_list                                                  = Organisation Unit Group list
 patient_data_archive												= Beneficiary Data Archive
 intro__patient_data_archive											= Archive beneficiary data which is not currently relevant to your system in order to improve performance. Data can also be unarchived.
-pruning_interrupted                                                 = You must choose the organisation unit has parent to prune. Please try again!
-sqlquery_is_not_allowed                                             = Not allowance to query in the special tables !
\ No newline at end of file
+pruning_interrupted                                                 = You must choose the organisation unit parent to prune
+sqlquery_is_not_allowed                                             = Not allowed to query in this table
+sections_with_invalid_category_combinations                         = Sections with invalid category combinations
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataIntegrityForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataIntegrityForm.vm	2010-07-13 15:50:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataIntegrityForm.vm	2010-11-29 17:16:41 +0000
@@ -18,6 +18,7 @@
 #integrityItem( $i18n.getString( "data_elements_violating_exclusive_group_sets" ) "dataElementsViolatingExclusiveGroupSets" )
 #integrityItem( $i18n.getString( "data_elements_assigned_to_period_types_with_different_period_types" ) "dataElementsAssignedToDataSetsWithDifferentPeriodTypes" )
 #integrityItem( $i18n.getString( "data_sets_not_assigned_to_organisation_units" ) "dataSetsNotAssignedToOrganisationUnits" )
+#integrityItem( $i18n.getString( "sections_with_invalid_category_combinations" ) "sectionsWithInvalidCategoryCombinations" )
 #integrityItem( $i18n.getString( "indicators_with_identical_formulas" ) "indicatorsWithIdenticalFormulas" )
 #integrityItem( $i18n.getString( "indicators_without_groups" ) "indicatorsWithoutGroups" )
 #integrityItem( $i18n.getString( "invalid_indicator_numerators" ) "invalidIndicatorNumerators" )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataIntegrity.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataIntegrity.js	2010-07-13 15:50:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataIntegrity.js	2010-11-29 17:16:41 +0000
@@ -16,6 +16,7 @@
 	displayViolationList( json.dataElementsViolatingExclusiveGroupSets, "dataElementsViolatingExclusiveGroupSets" );
     displayViolationList( json.dataElementsAssignedToDataSetsWithDifferentPeriodTypes, "dataElementsAssignedToDataSetsWithDifferentPeriodTypes" );
     displayViolationList( json.dataSetsNotAssignedToOrganisationUnits, "dataSetsNotAssignedToOrganisationUnits" );
+    displayViolationList( json.sectionsWithInvalidCategoryCombinations, "sectionsWithInvalidCategoryCombinations" );
     displayViolationList( json.indicatorsWithIdenticalFormulas, "indicatorsWithIdenticalFormulas" );
     displayViolationList( json.indicatorsWithoutGroups, "indicatorsWithoutGroups" );
     displayViolationList( json.invalidIndicatorNumerators, "invalidIndicatorNumerators" );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseDataIntegrity.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseDataIntegrity.vm	2010-11-29 17:00:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseDataIntegrity.vm	2010-11-29 17:16:41 +0000
@@ -44,6 +44,7 @@
     #violation( "dataElementsViolatingExclusiveGroupSets" $dataElementsViolatingExclusiveGroupSets ),    
     #violationWithMapList( "dataElementsAssignedToDataSetsWithDifferentPeriodTypes" $dataElementsAssignedToDataSetsWithDifferentPeriodTypes ),    
     #violation( "dataSetsNotAssignedToOrganisationUnits" $dataSetsNotAssignedToOrganisationUnits ),
+    #violation( "sectionsWithInvalidCategoryCombinations" $sectionsWithInvalidCategoryCombinations ),
     #violationWithCollection( "indicatorsWithIdenticalFormulas" $indicatorsWithIdenticalFormulas ),
     #violation( "indicatorsWithoutGroups" $indicatorsWithoutGroups ),    
     #violationWithMap( "invalidIndicatorNumerators" $invalidIndicatorNumerators ),