← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 43: - Fixed bug: Aggregated export includes duplicate data

 

------------------------------------------------------------
revno: 43
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Wed 2009-03-11 16:16:35 +0100
message:
  - Fixed bug: Aggregated export includes duplicate data
  
    Denying to export aggregated data if there are data elements registered for data sets with different period types. Exporting only periods with one period type for each data element.
  
  - Fixed bug: move_to_top vs Move to top
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ExportParams.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/AggregatedDataValueConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataValueConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java
  dhis-2/dhis-web/dhis-web-importexport/pom.xml
  dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DataValueExportAction.java
  dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties
  dhis-2/dhis-web/dhis-web-importexport/src/main/resources/xwork.xml
  dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties
  dhis-2/dhis-web/dhis-web-portal/pom.xml

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java	2009-03-11 12:42:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java	2009-03-11 15:16:35 +0000
@@ -159,6 +159,15 @@
      */
     PeriodType getPeriodType( DataElement dataElement, Collection<Integer> dataSetIdentifiers );
     
+    /**
+     * Returns a distinct collection of data elements associated with the data
+     * sets with the given corresponding data set identifiers.
+     * 
+     * @param dataSetIdentifiers the data set identifiers.
+     * @return a distinct collection of data elements.
+     */
+    Collection<DataElement> getDistinctDataElements( Collection<Integer> dataSetIdentifiers );
+    
     // -------------------------------------------------------------------------
     // FrequencyOverrideAssociation
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java	2009-03-11 12:42:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java	2009-03-11 15:16:35 +0000
@@ -222,11 +222,18 @@
         return null;
     }
     
-    public Collection<DataSet> getDistictDataElements( Collection<Integer> dataSetIdentifiers )
+    public Collection<DataElement> getDistinctDataElements( Collection<Integer> dataSetIdentifiers )
     {
         Collection<DataSet> dataSets = getDataSets( dataSetIdentifiers );
         
-        return dataSets;
+        Set<DataElement> dataElements = new HashSet<DataElement>();
+        
+        for ( DataSet dataSet : dataSets )
+        {
+            dataElements.addAll( dataSet.getDataElements() );
+        }
+        
+        return dataElements;
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ExportParams.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ExportParams.java	2009-03-09 12:11:46 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ExportParams.java	2009-03-11 15:16:35 +0000
@@ -29,6 +29,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Date;
 import java.util.HashSet;
 
 import org.hisp.dhis.i18n.I18n;
@@ -48,10 +49,12 @@
     
     private boolean aggregatedData;
     
+    private Date startDate;
+    
+    private Date endDate;
+    
     private Collection<Integer> categories = new ArrayList<Integer>();
     
-    private boolean allCategories;
-    
     private Collection<Integer> categoryOptions = new ArrayList<Integer>();
     
     private Collection<Integer> categoryCombos = new ArrayList<Integer>();
@@ -175,6 +178,26 @@
         this.aggregatedData = aggregatedData;
     }
 
+    public Date getStartDate()
+    {
+        return startDate;
+    }
+
+    public void setStartDate( Date startDate )
+    {
+        this.startDate = startDate;
+    }
+
+    public Date getEndDate()
+    {
+        return endDate;
+    }
+
+    public void setEndDate( Date endDate )
+    {
+        this.endDate = endDate;
+    }
+    
     public I18n getI18n()
     {
         return i18n;
@@ -394,14 +417,4 @@
     {
         this.olapUrls = olapUrls;
     }
-
-    public boolean isAllCategories()
-    {
-        return allCategories;
-    }
-
-    public void setAllCategories( boolean allCategories )
-    {
-        this.allCategories = allCategories;
-    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/AggregatedDataValueConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/AggregatedDataValueConverter.java	2009-03-09 12:11:46 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/AggregatedDataValueConverter.java	2009-03-11 15:16:35 +0000
@@ -27,18 +27,22 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.system.util.ConversionUtils.getIdentifiers;
+
 import java.util.Collection;
 
 import org.amplecode.staxwax.reader.XMLReader;
 import org.amplecode.staxwax.writer.XMLWriter;
 import org.hisp.dhis.aggregation.AggregatedDataValue;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.datamart.DataMartStore;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.ImportParams;
 import org.hisp.dhis.importexport.XMLConverter;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Period;
-import org.hisp.dhis.system.util.ConversionUtils;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
 
 /**
  * @author Lars Helge Overland
@@ -64,6 +68,10 @@
     // -------------------------------------------------------------------------
 
     private DataMartStore dataMartStore;
+
+    private DataSetService dataSetService;
+    
+    private PeriodService periodService;
     
     // -------------------------------------------------------------------------
     // Constructor
@@ -72,9 +80,13 @@
     /**
      * Constructor for write operations.
      */
-    public AggregatedDataValueConverter( DataMartStore dataMartStore )
+    public AggregatedDataValueConverter( DataMartStore dataMartStore,
+        DataSetService dataSetService,
+        PeriodService periodService )
     {
         this.dataMartStore = dataMartStore;
+        this.dataSetService = dataSetService;
+        this.periodService = periodService;
     }
 
     // -------------------------------------------------------------------------
@@ -83,20 +95,26 @@
 
     public void write( XMLWriter writer, ExportParams params )
     {
-        Collection<AggregatedDataValue> values = null;
-        
-        Collection<Integer> periodIds = ConversionUtils.getIdentifiers( Period.class, params.getPeriods() );
-        Collection<Integer> organisationUnitIds = ConversionUtils.getIdentifiers( OrganisationUnit.class, params.getOrganisationUnits() );
-        
         if ( params.isIncludeDataValues() )
         {
-            if ( params.getDataElements().size() > 0 && params.getPeriods().size() > 0 && params.getOrganisationUnits().size() > 0 )
+            Collection<DataElement> dataElements = dataSetService.getDistinctDataElements( params.getDataSets() );
+
+            if ( dataElements.size() > 0 && params.getStartDate() != null && params.getEndDate() != null )
             {
+                Collection<Period> periods = null;
+
+                Collection<AggregatedDataValue> values = null;
+                
                 writer.openElement( COLLECTION_NAME );
                 
-                for ( Integer dataElemetId : params.getDataElements() )
+                for ( final DataElement dataElement : dataElements )
                 {
-                    values = dataMartStore.getAggregatedDataValues( dataElemetId, periodIds, organisationUnitIds );
+                    final PeriodType periodType = dataSetService.getPeriodType( dataElement, params.getDataSets() );
+                    
+                    periods = periodService.getIntersectingPeriodsByPeriodType( periodType, params.getStartDate(), params.getEndDate() );
+                    
+                    values = dataMartStore.getAggregatedDataValues( dataElement.getId(), 
+                        getIdentifiers( Period.class, periods ), params.getOrganisationUnits() );
                     
                     for ( AggregatedDataValue value : values )
                     {
@@ -106,9 +124,9 @@
                         writer.writeElement( FIELD_PERIOD, String.valueOf( value.getPeriodId() ) );
                         writer.writeElement( FIELD_SOURCE, String.valueOf( value.getOrganisationUnitId() ) );
                         writer.writeElement( FIELD_VALUE, String.valueOf( Math.round( value.getValue() ) ) );
-                        writer.writeElement( FIELD_STOREDBY, "");
-                        writer.writeElement( FIELD_TIMESTAMP, "");
-                        writer.writeElement( FIELD_COMMENT, "");
+                        writer.writeElement( FIELD_STOREDBY, "" );
+                        writer.writeElement( FIELD_TIMESTAMP, "" );
+                        writer.writeElement( FIELD_COMMENT, "" );
                         writer.writeElement( FIELD_CATEGORY_OPTION_COMBO, String.valueOf( value.getCategoryOptionComboId() ) );
                         
                         writer.closeElement();

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataValueConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataValueConverter.java	2009-03-09 14:11:42 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataValueConverter.java	2009-03-11 15:16:35 +0000
@@ -48,6 +48,7 @@
 import org.hisp.dhis.jdbc.StatementManager;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.source.Source;
 import org.hisp.dhis.system.util.DateUtils;
 
@@ -78,6 +79,8 @@
     
     private StatementManager statementManager;
     
+    private PeriodService periodService;
+    
     private Map<Object, Integer> dataElementMapping;    
     private Map<Object, Integer> periodMapping;    
     private Map<Object, Integer> sourceMapping;
@@ -91,10 +94,12 @@
      * Constructor for write operations.
      */
     public DataValueConverter( DataMartStore dataMartStore,
-        StatementManager statementManager )
+        StatementManager statementManager,
+        PeriodService periodService )
     {
         this.dataMartStore = dataMartStore;
         this.statementManager = statementManager;
+        this.periodService = periodService;
     }
     
     /**
@@ -129,19 +134,21 @@
     {   
         if ( params.isIncludeDataValues() )
         {
-            Collection<DeflatedDataValue> values = null;
-            
-            if ( params.getDataElements().size() > 0 && params.getPeriods().size() > 0 && params.getOrganisationUnits().size() > 0 )
+            if ( params.getStartDate() != null && params.getEndDate() != null )
             {
+                Collection<DeflatedDataValue> values = null;
+            
+                Collection<Period> periods = periodService.getIntersectingPeriods( params.getStartDate(), params.getEndDate() );
+                
                 statementManager.initialise();
                 
                 writer.openElement( COLLECTION_NAME );
                 
                 for ( final Integer element : params.getDataElements() )
                 {
-                    for ( final Integer period : params.getPeriods() )
+                    for ( final Period period : periods )
                     {
-                        values = dataMartStore.getDeflatedDataValues( element, period, params.getOrganisationUnits() );
+                        values = dataMartStore.getDeflatedDataValues( element, period.getId(), params.getOrganisationUnits() );
                         
                         for ( final DeflatedDataValue value : values )
                         {   

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java	2009-03-09 14:11:42 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java	2009-03-11 15:16:35 +0000
@@ -322,8 +322,9 @@
             thread.registerXMLConverter( new CompleteDataSetRegistrationConverter( 
                 completeDataSetRegistrationService, dataSetService, organisationUnitService, periodService ) );
             
-            thread.registerXMLConverter( params.isAggregatedData() ? new AggregatedDataValueConverter( dataMartStore ) : 
-                new DataValueConverter( dataMartStore, statementManager ) );
+            thread.registerXMLConverter( params.isAggregatedData() ? 
+                new AggregatedDataValueConverter( dataMartStore, dataSetService, periodService ) : 
+                new DataValueConverter( dataMartStore, statementManager, periodService ) );
             
             thread.start();
             

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/pom.xml'
--- dhis-2/dhis-web/dhis-web-importexport/pom.xml	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/pom.xml	2009-03-11 15:16:35 +0000
@@ -43,14 +43,18 @@
     </dependency>
     <dependency>
       <groupId>org.hisp.dhis</groupId>
+      <artifactId>dhis-service-importexport</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.hisp.dhis</groupId>
+      <artifactId>dhis-service-administration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-options</artifactId>
     </dependency>
     <dependency>
       <groupId>org.hisp.dhis</groupId>
-      <artifactId>dhis-service-importexport</artifactId>
-	</dependency>
-    <dependency>
-      <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-commons</artifactId>
     </dependency>
     <dependency>

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DataValueExportAction.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DataValueExportAction.java	2009-03-09 12:11:46 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DataValueExportAction.java	2009-03-11 15:16:35 +0000
@@ -27,17 +27,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.system.util.ConversionUtils.getIdentifiers;
+import static org.hisp.dhis.system.util.ConversionUtils.getIntegerCollection;
 import static org.hisp.dhis.system.util.DateUtils.getMediumDate;
 import static org.hisp.dhis.system.util.DateUtils.getMediumDateString;
 
 import java.io.InputStream;
 import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
 
 import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.ExportService;
@@ -87,6 +85,13 @@
         this.dataSetService = dataSetService;
     }
     
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+    
     private OrganisationUnitService organisationUnitService;
 
     public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -94,13 +99,6 @@
         this.organisationUnitService = organisationUnitService;
     }
     
-    private PeriodService periodService;
-
-    public void setPeriodService( PeriodService periodService )
-    {
-        this.periodService = periodService;
-    }
-        
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -118,7 +116,7 @@
     {
         return fileName;
     }
-    
+
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -176,7 +174,7 @@
     {
         this.selectedDataSets = selectedDataSets;
     }
-    
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -185,7 +183,7 @@
         throws Exception
     {
         ExportParams params = new ExportParams();
-        
+
         // ---------------------------------------------------------------------
         // Get DataElements
         // ---------------------------------------------------------------------
@@ -196,19 +194,10 @@
             params.setCategoryCombos( null );
             params.setCategoryOptions( null );
             params.setCategoryOptionCombos( null );
-
-            Set<Integer> distinctDataElements = new HashSet<Integer>();
-            
-            for ( String dataSetId : selectedDataSets )
-            {
-                DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( dataSetId ) );
-                
-                distinctDataElements.addAll( ConversionUtils.getIdentifiers( DataElement.class, dataSet.getDataElements() ) );
-                
-                params.getDataSets().add( Integer.parseInt( dataSetId ) );
-            }
-            
-            params.setDataElements( distinctDataElements );
+            
+            params.setDataSets( getIntegerCollection( selectedDataSets ) );
+            
+            params.setDataElements( getIdentifiers( DataElement.class, dataSetService.getDistinctDataElements( params.getDataSets() ) ) );
         }
         
         // ---------------------------------------------------------------------
@@ -217,12 +206,11 @@
 
         if ( startDate != null && startDate.trim().length() > 0 && endDate != null && endDate.trim().length() > 0 )
         {
-            Date selectedStartDate = getMediumDate( startDate );
-        
-            Date selectedEndDate = getMediumDate( endDate );
-        
-            params.getPeriods().addAll( ConversionUtils.getIdentifiers( 
-                Period.class, periodService.getIntersectingPeriods( selectedStartDate, selectedEndDate ) ) );
+            params.setStartDate( getMediumDate( startDate ) );
+            params.setEndDate( getMediumDate( endDate ) );
+            
+            params.setPeriods( getIdentifiers( Period.class, 
+                periodService.getIntersectingPeriods( getMediumDate( startDate ), getMediumDate( endDate ) ) ) );
         }
         
         // ---------------------------------------------------------------------
@@ -258,10 +246,6 @@
             }
         }
 
-        // ---------------------------------------------------------------------
-        // Get CompleteDataSetRegistrations
-        // ---------------------------------------------------------------------
-        
         params.setIncludeDataValues( true );
         params.setIncludeCompleteDataSetRegistrations( true );
         params.setAggregatedData( aggregatedData );

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml	2009-03-09 12:11:46 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml	2009-03-11 15:16:35 +0000
@@ -172,10 +172,10 @@
       ref="org.hisp.dhis.importexport.ImportExportServiceManager"/>
     <property name="dataSetService"
       ref="org.hisp.dhis.dataset.DataSetService"/>
+    <property name="periodService"
+      ref="org.hisp.dhis.period.PeriodService"/>
     <property name="organisationUnitService"
       ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-    <property name="periodService"
-      ref="org.hisp.dhis.period.PeriodService"/>
   </bean>
 	
   <bean id="org.hisp.dhis.importexport.action.exp.GetExportOptionsAction"
@@ -241,6 +241,13 @@
     <property name="dataDictionaryService"
       ref="org.hisp.dhis.datadictionary.DataDictionaryService"/>
   </bean>
+  
+  <bean id="org.hisp.dhis.importexport.action.exp.ValidateAggregatedExportAction"
+    class="org.hisp.dhis.importexport.action.exp.ValidateAggregatedExportAction"
+    scope="prototype">
+    <property name="dataIntegrityService"
+      ref="org.hisp.dhis.dataintegrity.DataIntegrityService"/>
+  </bean>
     
   <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
   <!-- IXF Configuration                                             -->

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties	2009-03-08 05:33:34 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties	2009-03-11 15:16:35 +0000
@@ -425,4 +425,5 @@
 all = All
 all_data_dictionary = All / Data Dictionary
 all_data_element_group = All / Data Element Group
-all_indicator_group = All / Indicator Group
\ No newline at end of file
+all_indicator_group = All / Indicator Group
+error_data_elements_with_different_period_types = There are data elements registered for data sets with different period types, please go to data integrity checks for more information and then correct this before exporting

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/xwork.xml'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/xwork.xml	2009-03-07 13:10:38 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/xwork.xml	2009-03-11 15:16:35 +0000
@@ -170,6 +170,12 @@
       <result name="success" type="velocity-json">/dhis-web-importexport/responseIndicators.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
+    
+    <action name="validateAggregatedExport" class="org.hisp.dhis.importexport.action.exp.ValidateAggregatedExportAction">
+      <result name="success" type="velocity-xml">/dhis-web-importexport/responseSuccess.vm</result>
+      <result name="error" type="velocity-xml">/dhis-web-importexport/responseError.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+    </action>
         
     <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
     <!-- IXF Configuration                                             -->

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js	2009-03-08 05:33:34 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js	2009-03-11 15:16:35 +0000
@@ -8,20 +8,47 @@
     if ( validateDataValueExportForm() )
     {
         var aggregatedData = getListValue( "aggregatedData" );
+        
+        if ( aggregatedData == "true" )
+        {
+            var request = new Request();
+            request.setResponseTypeXML( 'message' );
+            request.setCallbackSuccess( validateAggregatedExportCompleted );
+            request.send( "validateAggregatedExport.action" );
+        }
+        else
+        {
+            submitDataValueExportForm();
+        }
+    }
+}
+
+function validateAggregatedExportCompleted( messageElement )
+{
+    var type = messageElement.getAttribute( 'type' );
+    var message = messageElement.firstChild.nodeValue;
+    
+    if ( type == 'success' )
+    {
         var generateDataSource = getListValue( "generateDataSource" );
         
-        if ( aggregatedData == "true" && generateDataSource && generateDataSource == "true" )
+        if ( generateDataSource && generateDataSource == "true" )
         {
             var request = new Request();
             request.sendAsPost( getDataMartExportParams() );
             request.setCallbackSuccess( exportDataMartReceived );
-            request.send( "exportDataMart.action" );        
+            request.send( "exportDataMart.action" );   
         }
         else
         {
             submitDataValueExportForm();
         }
     }
+    else if ( type == 'error' )
+    {
+        document.getElementById( 'message' ).innerHTML = message;
+        document.getElementById( 'message' ).style.display = 'block';
+    }
 }
 
 function exportDataMartReceived( messageElement )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties	2009-03-11 15:16:35 +0000
@@ -78,4 +78,6 @@
 data_set_sort_order											= Data set sort order
 move_up														= Move up
 move_down													= Move down
+move_to_top													= Move to top
+move_to_bottom												= Move to bottom
 cancel														= Cancel

=== modified file 'dhis-2/dhis-web/dhis-web-portal/pom.xml'
--- dhis-2/dhis-web/dhis-web-portal/pom.xml	2009-03-10 14:47:17 +0000
+++ dhis-2/dhis-web/dhis-web-portal/pom.xml	2009-03-11 15:16:35 +0000
@@ -149,6 +149,7 @@
     
     <!-- India modules -->
     
+    <!-- 
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-dashboard</artifactId>
@@ -173,6 +174,7 @@
       <version>${version}</version>
       <type>war</type>
     </dependency>
+    -->
     
     <!-- Other -->
     



--

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.