← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6972: Minor improvements to importer

 

------------------------------------------------------------
revno: 6972
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-05-17 11:11:30 +0200
message:
  Minor improvements to importer
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java
  dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java
  dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java
  dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml


--
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/attribute/Attribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java	2012-04-20 18:31:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java	2012-05-17 09:11:30 +0000
@@ -193,6 +193,9 @@
             userAttribute = attribute.isUserAttribute();
             mandatory = attribute.isMandatory();
             sortOrder = attribute.getSortOrder() == null ? sortOrder : attribute.getSortOrder();
+
+            attributeValues.clear();
+            attributeValues.addAll( attribute.getAttributeValues() );
         }
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2012-05-02 16:06:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2012-05-17 09:11:30 +0000
@@ -238,45 +238,6 @@
     }
 
     // -------------------------------------------------------------------------
-    // hashCode, equals, toString
-    // -------------------------------------------------------------------------
-
-    @Override
-    public int hashCode()
-    {
-        return name.hashCode();
-    }
-
-    @Override
-    public boolean equals( Object object )
-    {
-        if ( this == object )
-        {
-            return true;
-        }
-
-        if ( object == null )
-        {
-            return false;
-        }
-
-        if ( getClass() != object.getClass() )
-        {
-            return false;
-        }
-
-        Chart other = (Chart) object;
-
-        return name.equals( other.getName() );
-    }
-
-    @Override
-    public String toString()
-    {
-        return "[" + name + "]";
-    }
-
-    // -------------------------------------------------------------------------
     // Logic
     // -------------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2012-04-23 11:13:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2012-05-17 09:11:30 +0000
@@ -301,7 +301,7 @@
     public String toString()
     {
         return "{" + "id=" + id + ", uid='" + uid + '\'' + ", code='" +
-            code + '\'' + ", name='" + name + '\'' + ", lastUpdated=" + lastUpdated + "} ";
+            code + '\'' + ", name='" + name + '\'' + ", lastUpdated=" + lastUpdated + "}";
     }
 
     @Override

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2012-04-23 11:43:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2012-05-17 09:11:30 +0000
@@ -38,6 +38,7 @@
 import org.hisp.dhis.common.BaseNameableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
 import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.common.annotation.Scanned;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.dataset.DataSet;
@@ -581,10 +582,12 @@
         this.numberType = numberType;
     }
 
+    /*
     @JsonProperty( value = "attributes" )
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlElementWrapper( localName = "attributes", namespace = Dxf2Namespace.NAMESPACE )
     @JacksonXmlProperty( localName = "attribute", namespace = Dxf2Namespace.NAMESPACE )
+    */
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;
@@ -630,6 +633,9 @@
             url = dataElement.getUrl() == null ? url : dataElement.getUrl();
             optionSet = dataElement.getOptionSet() == null ? optionSet : dataElement.getOptionSet();
 
+            groups.clear();
+            dataSets.clear();
+
             removeAllCategoryLevels();
             aggregationLevels.addAll( dataElement.getAggregationLevels() );
 

=== 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	2012-05-16 18:08:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/Section.java	2012-05-17 09:11:30 +0000
@@ -32,6 +32,7 @@
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
 import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.common.annotation.Scanned;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.dataelement.DataElement;
@@ -54,8 +55,10 @@
 
     private DataSet dataSet;
 
+    @Scanned
     private List<DataElement> dataElements = new ArrayList<DataElement>();
 
+    @Scanned
     private Set<DataElementOperand> greyedFields = new HashSet<DataElementOperand>();
 
     private int sortOrder;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2012-04-20 18:31:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2012-05-17 09:11:30 +0000
@@ -38,6 +38,7 @@
 import org.hisp.dhis.common.BaseNameableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
 import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.common.annotation.Scanned;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.dataset.DataSet;
@@ -340,10 +341,12 @@
         this.dataSets = dataSets;
     }
 
+    /*
     @JsonProperty( value = "attributes" )
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlElementWrapper( localName = "attributes", namespace = Dxf2Namespace.NAMESPACE )
     @JacksonXmlProperty( localName = "attribute", namespace = Dxf2Namespace.NAMESPACE )
+    */
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;
@@ -372,6 +375,9 @@
             explodedDenominator = indicator.getExplodedDenominator() == null ? explodedDenominator : indicator.getExplodedDenominator();
             indicatorType = indicator.getIndicatorType() == null ? indicatorType : indicator.getIndicatorType();
 
+            dataSets.clear();
+            groups.clear();
+
             removeAllAttributeValues();
             attributeValues.addAll( indicator.getAttributeValues() );
         }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2012-05-16 09:54:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2012-05-17 09:11:30 +0000
@@ -40,6 +40,7 @@
 import org.hisp.dhis.common.BaseNameableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
 import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.common.annotation.Scanned;
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
@@ -813,10 +814,12 @@
         this.users = users;
     }
 
+    /*
     @JsonProperty( value = "attributes" )
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlElementWrapper( localName = "attributes", namespace = Dxf2Namespace.NAMESPACE )
     @JacksonXmlProperty( localName = "attribute", namespace = Dxf2Namespace.NAMESPACE )
+    */
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;
@@ -906,8 +909,11 @@
             parent = organisationUnit.getParent();
 
             groups.clear();
+            users.clear();
             dataSets.clear();
-            users.clear();
+
+            attributeValues.clear();
+            attributeValues.addAll( organisationUnit.getAttributeValues() );
         }
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2012-04-22 18:21:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2012-05-17 09:11:30 +0000
@@ -94,16 +94,6 @@
     // -------------------------------------------------------------------------
 
     @Override
-    public String toString()
-    {
-        return "[" + surname + " " + firstName + "]";
-    }
-
-    // -------------------------------------------------------------------------
-    // Logic
-    // -------------------------------------------------------------------------
-
-    @Override
     public int hashCode()
     {
         final int prime = 31;
@@ -118,6 +108,10 @@
         return result;
     }
 
+    // -------------------------------------------------------------------------
+    // Logic
+    // -------------------------------------------------------------------------
+
     // TODO fix, users might very well have the same name, should use credentials
 
     @Override
@@ -349,10 +343,12 @@
         this.organisationUnits = organisationUnits;
     }
 
+    /*
     @JsonProperty( value = "attributes" )
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlElementWrapper( localName = "attributes", namespace = Dxf2Namespace.NAMESPACE )
     @JacksonXmlProperty( localName = "attribute", namespace = Dxf2Namespace.NAMESPACE )
+    */
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java	2012-04-26 07:56:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java	2012-05-17 09:11:30 +0000
@@ -207,9 +207,11 @@
         this.type = type;
     }
 
+    /*
     @JsonProperty
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+    */
     public Expression getLeftSide()
     {
         return leftSide;
@@ -220,9 +222,11 @@
         this.leftSide = leftSide;
     }
 
+    /*
     @JsonProperty
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+    */
     public Expression getRightSide()
     {
         return rightSide;
@@ -263,6 +267,8 @@
             leftSide = validationRule.getLeftSide() == null ? leftSide : validationRule.getLeftSide();
             rightSide = validationRule.getRightSide() == null ? rightSide : validationRule.getRightSide();
             periodType = validationRule.getPeriodType() == null ? periodType : validationRule.getPeriodType();
+
+            groups.clear();
         }
     }
 }

=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java	2012-05-16 18:08:43 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java	2012-05-17 09:11:30 +0000
@@ -101,10 +101,12 @@
         doImport( metaData.getOrganisationUnitLevels(), importOptions, importSummary );
         doImport( metaData.getOrganisationUnitGroups(), importOptions, importSummary );
         doImport( metaData.getOrganisationUnitGroupSets(), importOptions, importSummary );
-        doImport( metaData.getUsers(), importOptions, importSummary );
-        doImport( metaData.getUserGroups(), importOptions, importSummary );
-        doImport( metaData.getUserAuthorityGroups(), importOptions, importSummary );
-
+
+        // doImport( metaData.getUsers(), importOptions, importSummary );
+        // doImport( metaData.getUserGroups(), importOptions, importSummary );
+        // doImport( metaData.getUserAuthorityGroups(), importOptions, importSummary );
+
+        doImport( metaData.getSqlViews(), importOptions, importSummary );
         doImport( metaData.getConcepts(), importOptions, importSummary );
         doImport( metaData.getConstants(), importOptions, importSummary );
         doImport( metaData.getDocuments(), importOptions, importSummary );
@@ -125,25 +127,23 @@
         doImport( metaData.getIndicatorGroups(), importOptions, importSummary );
         doImport( metaData.getIndicatorGroupSets(), importOptions, importSummary );
 
-/*
-        doImport( metaData.getMaps(), importOptions, importSummary );
-        doImport( metaData.getMapLegends(), importOptions, importSummary );
-        doImport( metaData.getMapLegendSets(), importOptions, importSummary );
-        doImport( metaData.getMapLayers(), importOptions, importSummary );
-        // doImport( metaData.getMessageConversations(), importOptions, importSummary );
-        doImport( metaData.getSqlViews(), importOptions, importSummary );
-
         doImport( metaData.getValidationRules(), importOptions, importSummary );
         doImport( metaData.getValidationRuleGroups(), importOptions, importSummary );
 
+        // doImport( metaData.getMessageConversations(), importOptions, importSummary );
+
         doImport( metaData.getDataDictionaries(), importOptions, importSummary );
+        doImport( metaData.getDataSets(), importOptions, importSummary );
+        doImport( metaData.getSections(), importOptions, importSummary );
+
+        doImport( metaData.getReportTables(), importOptions, importSummary );
         doImport( metaData.getReports(), importOptions, importSummary );
-        doImport( metaData.getReportTables(), importOptions, importSummary );
         doImport( metaData.getCharts(), importOptions, importSummary );
-*/
 
-        doImport( metaData.getDataSets(), importOptions, importSummary );
-        doImport( metaData.getSections(), importOptions, importSummary );
+        // doImport( metaData.getMaps(), importOptions, importSummary );
+        doImport( metaData.getMapLegends(), importOptions, importSummary );
+        doImport( metaData.getMapLegendSets(), importOptions, importSummary );
+        doImport( metaData.getMapLayers(), importOptions, importSummary );
 
         if ( importOptions.isDryRun() )
         {

=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java	2012-05-16 18:08:43 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java	2012-05-17 09:11:30 +0000
@@ -59,9 +59,6 @@
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.sqlview.SqlView;
-import org.hisp.dhis.user.User;
-import org.hisp.dhis.user.UserAuthorityGroup;
-import org.hisp.dhis.user.UserGroup;
 import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleGroup;
 import org.springframework.beans.factory.annotation.Autowired;

=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2012-05-16 18:08:43 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2012-05-17 09:11:30 +0000
@@ -29,10 +29,14 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.hibernate.SessionFactory;
+import org.hisp.dhis.attribute.AttributeStore;
+import org.hisp.dhis.attribute.AttributeValue;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.NameableObject;
 import org.hisp.dhis.common.annotation.Scanned;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dxf2.importsummary.ImportConflict;
 import org.hisp.dhis.dxf2.importsummary.ImportCount;
 import org.hisp.dhis.dxf2.metadata.ImportOptions;
@@ -40,13 +44,15 @@
 import org.hisp.dhis.dxf2.metadata.ObjectBridge;
 import org.hisp.dhis.dxf2.utils.OrganisationUnitUtils;
 import org.hisp.dhis.importexport.ImportStrategy;
+import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 import org.hisp.dhis.organisationunit.comparator.OrganisationUnitComparator;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodStore;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.system.util.ReflectionUtils;
+import org.hisp.dhis.user.User;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.lang.reflect.Field;
@@ -70,8 +76,17 @@
     private PeriodService periodService;
 
     @Autowired
+    private PeriodStore periodStore;
+
+    @Autowired
+    private AttributeStore attributeStore;
+
+    @Autowired
     private ObjectBridge objectBridge;
 
+    @Autowired
+    private SessionFactory sessionFactory;
+
     //-------------------------------------------------------------------------------------------------------
     // Constructor
     //-------------------------------------------------------------------------------------------------------
@@ -199,6 +214,9 @@
 
         for ( T object : objects )
         {
+            sessionFactory.getCurrentSession().flush();
+            log.info( "Currently importing: " + object + " (" + object.getClass().getSimpleName() + ")" );
+
             List<ImportConflict> conflicts = importObjectLocal( object, options );
 
             if ( !conflicts.isEmpty() )
@@ -441,7 +459,9 @@
         else if ( Period.class.isAssignableFrom( identifiableObject.getClass() ) )
         {
             Period period = (Period) identifiableObject;
-            return periodService.reloadPeriod( period );
+
+            // return periodStore.reloadForceAddPeriod( period );
+            return null;
         }
 
         return objectBridge.getObject( identifiableObject );
@@ -478,24 +498,21 @@
             IdentifiableObject idObject = identifiableObjects.get( field );
             IdentifiableObject ref = findObjectByReference( idObject );
 
-            if ( ref != null )
-            {
-                ReflectionUtils.invokeSetterMethod( field.getName(), identifiableObject, ref );
-            }
-            else
-            {
-                // FIXME special case, possible forward reference.. so just skip it..
-                if ( !OrganisationUnitGroupSet.class.isInstance( idObject ) )
-                {
-                }
-
-                log.warn( "Ignored reference " + idObject + " (" + idObject.getClass() + ") " + " on object " + identifiableObject + "." );
-
-                ImportConflict importConflict = new ImportConflict( getDisplayName( identifiableObject ),
-                    "Unknown reference to " + idObject + " (" + idObject.getClass() + ") " + " on field " + field.getName() + ", reference has been discarded." );
-
+            if ( ref == null )
+            {
+                String referenceName = idObject != null ? idObject.getClass().getSimpleName() : "null";
+                String objectName = identifiableObject != null ? identifiableObject.getClass().getSimpleName() : "null";
+
+                String logMsg = "Unknown reference to " + idObject + " (" + referenceName + ")" +
+                    " on object " + identifiableObject + " (" + objectName + ").";
+
+                log.warn( logMsg );
+
+                ImportConflict importConflict = new ImportConflict( getDisplayName( identifiableObject ), logMsg );
                 importConflicts.add( importConflict );
             }
+
+            ReflectionUtils.invokeSetterMethod( field.getName(), identifiableObject, ref );
         }
 
         return importConflicts;
@@ -563,11 +580,15 @@
                 }
                 else
                 {
-                    log.warn( "Ignored reference " + idObject + " (" + idObject.getClass() + ") " + " on object " + identifiableObject + "." );
-
-                    ImportConflict importConflict = new ImportConflict( getDisplayName( identifiableObject ),
-                        "Unknown reference to " + idObject + " (" + idObject.getClass() + ") " + " on field " + field.getName() + ", reference has been discarded." );
-
+                    String referenceName = idObject != null ? idObject.getClass().getSimpleName() : "null";
+                    String objectName = identifiableObject != null ? identifiableObject.getClass().getSimpleName() : "null";
+
+                    String logMsg = "Unknown reference to " + idObject + " (" + referenceName + ")" +
+                        " on object " + identifiableObject + " (" + objectName + ").";
+
+                    log.warn( logMsg );
+
+                    ImportConflict importConflict = new ImportConflict( getDisplayName( identifiableObject ), logMsg );
                     importConflicts.add( importConflict );
                 }
             }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2012-01-30 09:49:36 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2012-05-17 09:11:30 +0000
@@ -461,8 +461,8 @@
             
             for ( Indicator indicator : indicators )
             {
-                indicator.setExplodedNumerator( explodeExpression( indicator.getExplodedNumerator(), dataElementMap ) );
-                indicator.setExplodedDenominator( explodeExpression( indicator.getExplodedDenominator(), dataElementMap ) );
+                indicator.setExplodedNumerator( explodeExpression( indicator.getExplodedNumerator() != null ? indicator.getExplodedNumerator() : "", dataElementMap ) );
+                indicator.setExplodedDenominator( explodeExpression( indicator.getExplodedDenominator() != null ? indicator.getExplodedDenominator() : "", dataElementMap ) );
             }     
         }
     }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml	2011-12-22 17:28:35 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml	2012-05-17 09:11:30 +0000
@@ -4,7 +4,7 @@
     "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
     [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
     >
-	
+
 <hibernate-mapping>
   <class name="org.hisp.dhis.report.Report" table="report">
 
@@ -18,9 +18,9 @@
     <property name="designContent" type="text" />
 
     <many-to-one name="reportTable" class="org.hisp.dhis.reporttable.ReportTable" column="reporttableid"
-      foreign-key="fk_report_reporttableid" />
-	  
-	<property name="usingOrgUnitGroupSets"/>
-	  
+        foreign-key="fk_report_reporttableid" />
+
+    <property name="usingOrgUnitGroupSets" />
+
   </class>
 </hibernate-mapping>
\ No newline at end of file

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2012-04-20 07:38:56 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2012-05-17 09:11:30 +0000
@@ -92,9 +92,9 @@
       <property name="last12Months" />
       <property name="last4Quarters" />
       <property name="last2SixMonths" />
-	  <property name="thisFinancialYear" />
-	  <property name="lastFinancialYear" />
-	  <property name="last5FinancialYears" />
+      <property name="thisFinancialYear" />
+      <property name="lastFinancialYear" />
+      <property name="last5FinancialYears" />
     </component>
 
     <component name="reportParams">