← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2407: [DHIS-Mobile] Versioning DataSet

 

------------------------------------------------------------
revno: 2407
committer: Tran Ng Minh Luan <Luan@MinhLuan-PC>
branch nick: dhis2
timestamp: Wed 2010-12-22 11:05:46 +0700
message:
  [DHIS-Mobile] Versioning DataSet
  Fix return null value of DataSet's mobile and version
added:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/DataSetList.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetStore.java
  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/hibernate/HibernateDataSetStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/DataSet.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/OrgUnit.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/MobileResource.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/FacilityReportingServiceImpl.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryOptionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/RemoveDataElementAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/AddDataSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UpdateDataSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/AddSectionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/EditSectionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/RemoveSectionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionSortOrderAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/UpdateSectionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.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/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2010-11-20 10:53:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2010-12-22 04:05:46 +0000
@@ -95,6 +95,11 @@
      */
     private DataEntryForm dataEntryForm;
 
+    /**
+     * Indicating custom data entry form.
+     */
+    private Integer version;
+    
     // -------------------------------------------------------------------------
     // Contructors
     // -------------------------------------------------------------------------
@@ -287,4 +292,18 @@
 
         return result;
     }
+
+    public Integer getVersion()
+    {
+        return version;
+    }
+
+    public void setVersion( Integer version )
+    {
+        this.version = version;
+    }
+
+    
+    
+    
 }

=== 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	2010-11-27 09:37:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java	2010-12-22 04:05:46 +0000
@@ -199,6 +199,20 @@
      */
     Collection<DataSet> getDataSetsForMobile(Source source);
 
+    /**
+     * Get list of realted datasets from categoryOption
+     * 
+     * @return A List containing related DataSets.
+     */
+    Collection<DataSet> getMobileDataSetsFromCategoryOption(int categoryOptionId);
+    
+    /**
+     * Get list of realted datasets from category
+     * 
+     * @return A List containing related DataSets.
+     */
+    Collection<DataSet> getMobileDataSetsFromCategory(int categoryOptionId);
+    
     // -------------------------------------------------------------------------
     // FrequencyOverrideAssociation
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetStore.java	2010-11-27 09:37:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetStore.java	2010-12-22 04:05:46 +0000
@@ -122,6 +122,9 @@
 
     Collection<DataSet> getDataSetsBySources( Collection<? extends Source> sources );
     
+    Collection<DataSet> getMobileDataSetsFromCategoryOption(int categoryOptionId);
+    
+    Collection<DataSet> getMobileDataSetsFromCategory(int categoryId);
     // -------------------------------------------------------------------------
     // 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	2010-11-27 09:37:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java	2010-12-22 04:05:46 +0000
@@ -275,11 +275,18 @@
         return i18n( i18nService, dataSet.getDataElements() );
     }    
     
-	public Collection<DataSet> getDataSetsForMobile(Source source) 
-	{
-		return i18n( i18nService, dataSetStore.getDataSetsForMobile(source) );		
-	}
-
+    public Collection<DataSet> getDataSetsForMobile(Source source) 
+    {
+        return i18n( i18nService, dataSetStore.getDataSetsForMobile(source) );		
+    }
+    
+    public Collection<DataSet> getMobileDataSetsFromCategoryOption(int categoryOptionId){
+        return dataSetStore.getMobileDataSetsFromCategoryOption(categoryOptionId);
+    }
+    
+    public Collection<DataSet> getMobileDataSetsFromCategory(int categoryId){
+        return dataSetStore.getMobileDataSetsFromCategory(categoryId);
+    }
     // -------------------------------------------------------------------------
     // FrequencyOverrideAssociation
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java	2010-12-12 07:34:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java	2010-12-22 04:05:46 +0000
@@ -27,8 +27,16 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
+import org.amplecode.quick.StatementHolder;
+import org.amplecode.quick.StatementManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.hibernate.Criteria;
 import org.hibernate.Query;
 import org.hibernate.Session;
@@ -47,11 +55,20 @@
  * @version $Id: HibernateDataSetStore.java 3303 2007-05-14 13:39:34Z larshelg $
  */
 public class HibernateDataSetStore
-    extends HibernateGenericStore<DataSet> implements DataSetStore
+    extends HibernateGenericStore<DataSet>
+    implements DataSetStore
 {
+    private static final Log log = LogFactory.getLog( HibernateDataSetStore.class );
+
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
+    private StatementManager statementManager;
+
+    public void setStatementManager( StatementManager statementManager )
+    {
+        this.statementManager = statementManager;
+    }
 
     private PeriodStore periodStore;
 
@@ -142,12 +159,12 @@
     public Collection<DataSet> getDataSetsByPeriodType( PeriodType periodType )
     {
         periodType = periodStore.getPeriodType( periodType.getClass() );
-        
+
         Session session = sessionFactory.getCurrentSession();
-        
+
         Criteria criteria = session.createCriteria( DataSet.class );
         criteria.add( Restrictions.eq( "periodType", periodType ) );
-        
+
         return criteria.list();
     }
 
@@ -155,10 +172,10 @@
     public Collection<DataSet> getDataSetsBySource( Source source )
     {
         String hql = "from DataSet d where :source in elements(d.sources)";
-        
+
         Query query = sessionFactory.getCurrentSession().createQuery( hql );
         query.setEntity( "source", source );
-        
+
         return query.list();
     }
 
@@ -166,8 +183,9 @@
     public Collection<DataSet> getDataSetsBySources( Collection<? extends Source> sources )
     {
         String hql = "select distinct d from DataSet d join d.sources s where s.id in (:ids)";
-        
-        return sessionFactory.getCurrentSession().createQuery( hql ).setParameterList( "ids", ConversionUtils.getIdentifiers( Source.class, sources ) ).list();
+
+        return sessionFactory.getCurrentSession().createQuery( hql )
+            .setParameterList( "ids", ConversionUtils.getIdentifiers( Source.class, sources ) ).list();
     }
 
     @SuppressWarnings( "unchecked" )
@@ -178,8 +196,72 @@
         query.setEntity( "source", source );
 
         return query.list();
-    }
-
+
+    }
+
+    @SuppressWarnings( "unchecked" )
+    public Collection<DataSet> getMobileDataSetsFromCategoryOption( int categoryOptionId )
+    {
+        StatementHolder holder = statementManager.getHolder();
+
+        List<DataSet> mobileDataSets = new ArrayList<DataSet>();
+
+        try
+        {
+            Statement statement = holder.getStatement();
+
+            ResultSet resultSet = statement
+                .executeQuery( "select * from dataset where datasetid  in (select DISTINCT datasetid from datasetmembers where dataelementid in (select dataelementid from dataelement where categorycomboid in (select categorycomboid from categorycombos_categories where categoryid in (select categoryid from categories_categoryoptions where categoryoptionid = '"
+                    + categoryOptionId + "')))) and (mobile = true and mobile is not null)" );
+
+            while ( resultSet.next() )
+            {
+                DataSet dataSet = getDataSet( resultSet.getInt( 1 ) );
+                mobileDataSets.add( dataSet );
+            }
+        }
+        catch ( Exception ex )
+        {
+            log.error( ex );
+        }
+        finally
+        {
+            holder.close();
+        }
+
+        return mobileDataSets;
+    }
+
+    @SuppressWarnings( "unchecked" )
+    public Collection<DataSet> getMobileDataSetsFromCategory( int categoryId )
+    {
+        StatementHolder holder = statementManager.getHolder();
+
+        List<DataSet> mobileDataSets = new ArrayList<DataSet>();
+
+        try
+        {
+            Statement statement = holder.getStatement();
+
+            ResultSet resultSet = statement
+                .executeQuery( "select * from dataset where datasetid in (select DISTINCT datasetid from datasetmembers where dataelementid in (select dataelementid     from dataelement where categorycomboid in (select categorycomboid from categorycombos_categories where categoryid ='"
+                    + categoryId + "'))) and (mobile = true and mobile is not null)" );
+            while ( resultSet.next() )
+            {
+                DataSet dataSet = getDataSet( resultSet.getInt( 1 ) );
+                mobileDataSets.add( dataSet );
+            }
+        }
+        catch ( Exception ex )
+        {
+            log.error( ex );
+        }
+        finally
+        {
+            holder.close();
+        }
+        return mobileDataSets;
+    }
     // -------------------------------------------------------------------------
     // FrequencyOverrideAssociation
     // -------------------------------------------------------------------------
@@ -272,5 +354,5 @@
     public Collection<DataSet> getDataSetsBetweenByName( String name, int first, int max )
     {
         return getBetweenByName( name, first, max );
-    }	
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2010-12-16 17:38:32 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2010-12-22 04:05:46 +0000
@@ -1,167 +1,195 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-  xmlns:aop="http://www.springframework.org/schema/aop";
-  xsi:schemaLocation="
+<beans xmlns="http://www.springframework.org/schema/beans";
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:aop="http://www.springframework.org/schema/aop";
+	xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd";>
 
-  <!-- Store definitions -->
-
-  <bean id="org.hisp.dhis.dataelement.DataElementOperandStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.dataelement.DataElementOperand" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataentryform.DataEntryFormStore" class="org.hisp.dhis.dataentryform.hibernate.HibernateDataEntryFormStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.customvalue.CustomValueStore" class="org.hisp.dhis.customvalue.hibernate.HibernateCustomValueStore">
-    <property name="clazz" value="org.hisp.dhis.customvalue.CustomValue" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementStore" class="org.hisp.dhis.dataelement.hibernate.HibernateDataElementStore">
-    <property name="clazz" value="org.hisp.dhis.dataelement.DataElement" />
-    <property name="sessionFactory" ref="sessionFactory" />
-    <property name="statementManager" ref="statementManager" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementGroupStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.dataelement.DataElementGroup" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementGroupSetStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.dataelement.DataElementGroupSet" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datadictionary.DataDictionaryStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.datadictionary.DataDictionary" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datavalue.DataValueStore" class="org.hisp.dhis.datavalue.hibernate.HibernateDataValueStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-    <property name="statementManager" ref="statementManager" />
-    <property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.indicator.IndicatorStore" class="org.hisp.dhis.indicator.hibernate.HibernateIndicatorStore">
-    <property name="clazz" value="org.hisp.dhis.indicator.Indicator" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.indicator.IndicatorTypeStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.indicator.IndicatorType" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.indicator.IndicatorGroupStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.indicator.IndicatorGroup" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.indicator.IndicatorGroupSetStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.indicator.IndicatorGroupSet" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.period.PeriodStore" class="org.hisp.dhis.period.hibernate.HibernatePeriodStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.source.SourceStore" class="org.hisp.dhis.source.hibernate.HibernateSourceStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.DataSetStore" class="org.hisp.dhis.dataset.hibernate.HibernateDataSetStore">
-    <property name="clazz" value="org.hisp.dhis.dataset.DataSet" />
-    <property name="sessionFactory" ref="sessionFactory" />
-    <property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.CompleteDataSetRegistrationStore" class="org.hisp.dhis.dataset.hibernate.HibernateCompleteDataSetRegistrationStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.minmax.MinMaxDataElementStore" class="org.hisp.dhis.minmax.hibernate.HibernateMinMaxDataElementStore">
-    <property name="clazz" value="org.hisp.dhis.minmax.MinMaxDataElement" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.expression.ExpressionStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.expression.Expression" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.validation.ValidationRuleStore" class="org.hisp.dhis.validation.hibernate.HibernateValidationRuleStore">
-    <property name="clazz" value="org.hisp.dhis.validation.ValidationRule" />
-    <property name="sessionFactory" ref="sessionFactory" />
-    <property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.validation.ValidationRuleGroupStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.validation.ValidationRuleGroup" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.dataelement.DataElementCategory" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryOptionStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.dataelement.DataElementCategoryOption" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryComboStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.dataelement.DataElementCategoryCombo" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryOptionComboStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.SectionStore" class="org.hisp.dhis.dataset.hibernate.HibernateSectionStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitStore" class="org.hisp.dhis.organisationunit.hibernate.HibernateOrganisationUnitStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-    <property name="statementManager" ref="statementManager" />
-    <property name="jdbcTemplate" ref="jdbcTemplate" />
-  </bean>
-
-  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.organisationunit.OrganisationUnitGroup" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" class="org.hisp.dhis.dataanalysis.jdbc.JdbcDataAnalysisStore">
-    <property name="statementManager" ref="statementManager" />
-    <property name="statementBuilder" ref="statementBuilder" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datavalue.DataValueAuditStore" class="org.hisp.dhis.datavalue.hibernate.HibernateDataValueAuditStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserStore" class="org.hisp.dhis.user.hibernate.HibernateUserStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-    <property name="userRoleStore" ref="org.hisp.dhis.user.UserAuthorityGroupStore" />
-    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-  </bean>
+	<!-- Store definitions -->
+
+	<bean id="org.hisp.dhis.dataelement.DataElementOperandStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.dataelement.DataElementOperand" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataentryform.DataEntryFormStore"
+		class="org.hisp.dhis.dataentryform.hibernate.HibernateDataEntryFormStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.customvalue.CustomValueStore"
+		class="org.hisp.dhis.customvalue.hibernate.HibernateCustomValueStore">
+		<property name="clazz" value="org.hisp.dhis.customvalue.CustomValue" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementStore"
+		class="org.hisp.dhis.dataelement.hibernate.HibernateDataElementStore">
+		<property name="clazz" value="org.hisp.dhis.dataelement.DataElement"/>
+		<property name="sessionFactory" ref="sessionFactory"/>
+		<property name="statementManager" ref="statementManager"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementGroupStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.dataelement.DataElementGroup" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementGroupSetStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz"
+			value="org.hisp.dhis.dataelement.DataElementGroupSet" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.datadictionary.DataDictionaryStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.datadictionary.DataDictionary" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.datavalue.DataValueStore"
+		class="org.hisp.dhis.datavalue.hibernate.HibernateDataValueStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+		<property name="statementManager" ref="statementManager"/>
+		<property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.indicator.IndicatorStore"
+		class="org.hisp.dhis.indicator.hibernate.HibernateIndicatorStore">
+		<property name="clazz" value="org.hisp.dhis.indicator.Indicator"/>
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.indicator.IndicatorTypeStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.indicator.IndicatorType" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.indicator.IndicatorGroupStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.indicator.IndicatorGroup" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.indicator.IndicatorGroupSetStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.indicator.IndicatorGroupSet" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.period.PeriodStore" class="org.hisp.dhis.period.hibernate.HibernatePeriodStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.source.SourceStore" class="org.hisp.dhis.source.hibernate.HibernateSourceStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.DataSetStore" class="org.hisp.dhis.dataset.hibernate.HibernateDataSetStore">
+		<property name="clazz" value="org.hisp.dhis.dataset.DataSet" />
+		<property name="sessionFactory" ref="sessionFactory"/>
+		<property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
+		<property name="statementManager" ref="statementManager" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.CompleteDataSetRegistrationStore"
+		class="org.hisp.dhis.dataset.hibernate.HibernateCompleteDataSetRegistrationStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.minmax.MinMaxDataElementStore"
+		class="org.hisp.dhis.minmax.hibernate.HibernateMinMaxDataElementStore">
+		<property name="clazz" value="org.hisp.dhis.minmax.MinMaxDataElement" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.expression.ExpressionStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.expression.Expression" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.validation.ValidationRuleStore"
+		class="org.hisp.dhis.validation.hibernate.HibernateValidationRuleStore">
+		<property name="clazz" value="org.hisp.dhis.validation.ValidationRule" />
+		<property name="sessionFactory" ref="sessionFactory" />
+		<property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.validation.ValidationRuleGroupStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.validation.ValidationRuleGroup" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementCategoryStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz"
+			value="org.hisp.dhis.dataelement.DataElementCategory" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementCategoryOptionStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz"
+			value="org.hisp.dhis.dataelement.DataElementCategoryOption" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementCategoryComboStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz"
+			value="org.hisp.dhis.dataelement.DataElementCategoryCombo" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementCategoryOptionComboStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz"
+			value="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.SectionStore" class="org.hisp.dhis.dataset.hibernate.HibernateSectionStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.organisationunit.OrganisationUnitStore"
+		class="org.hisp.dhis.organisationunit.hibernate.HibernateOrganisationUnitStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+		<property name="statementManager" ref="statementManager"/>
+		<property name="jdbcTemplate" ref="jdbcTemplate"/>
+	</bean>
+	
+	<bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz"
+			value="org.hisp.dhis.organisationunit.OrganisationUnitGroup" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz"
+			value="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore"
+		class="org.hisp.dhis.dataanalysis.jdbc.JdbcDataAnalysisStore">
+		<property name="statementManager" ref="statementManager"/>
+		<property name="statementBuilder" ref="statementBuilder"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.datavalue.DataValueAuditStore"
+		class="org.hisp.dhis.datavalue.hibernate.HibernateDataValueAuditStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.user.UserStore" class="org.hisp.dhis.user.hibernate.HibernateUserStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+		<property name="userRoleStore" ref="org.hisp.dhis.user.UserAuthorityGroupStore" />
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+	</bean>
 
   <bean id="org.hisp.dhis.user.UserGroupStore" class="org.hisp.dhis.user.hibernate.HiberntateUserGroupStore">
     <property name="sessionFactory" ref="sessionFactory" />
@@ -173,1231 +201,1395 @@
     <property name="sessionFactory" ref="sessionFactory" />
   </bean>
 
-  <bean id="org.hisp.dhis.translation.TranslationStore" class="org.hisp.dhis.translation.hibernate.HibernateTranslationStore">
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.aggregation.AggregatedDataValueStore" class="org.hisp.dhis.aggregation.jdbc.JdbcAggregatedDataValueStore">
-    <property name="statementManager" ref="statementManager" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserAuthorityGroupStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.user.UserAuthorityGroup" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-
-  <!-- Service definitions -->
-
-  <bean id="org.hisp.dhis.dataelement.DataElementOperandService" class="org.hisp.dhis.dataelement.DefaultDataElementOperandService">
-    <property name="dataElementOperandStore" ref="org.hisp.dhis.dataelement.DataElementOperandStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.customvalue.CustomValueService" class="org.hisp.dhis.customvalue.DefaultCustomValueService">
-    <property name="customValueStore" ref="org.hisp.dhis.customvalue.CustomValueStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datavalue.DataValueService" class="org.hisp.dhis.datavalue.DefaultDataValueService">
-    <property name="dataValueStore" ref="org.hisp.dhis.datavalue.DataValueStore" />
-    <property name="dataValueAuditService" ref="org.hisp.dhis.datavalue.DataValueAuditService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datavalue.DataValueAuditService" class="org.hisp.dhis.datavalue.DefaultDataValueAuditService">
-    <property name="dataValueAuditStore" ref="org.hisp.dhis.datavalue.DataValueAuditStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementService" class="org.hisp.dhis.dataelement.DefaultDataElementService">
-    <property name="dataElementStore" ref="org.hisp.dhis.dataelement.DataElementStore" />
-    <property name="dataElementGroupStore" ref="org.hisp.dhis.dataelement.DataElementGroupStore" />
-    <property name="dataElementGroupSetStore" ref="org.hisp.dhis.dataelement.DataElementGroupSetStore" />
-    <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.minmax.MinMaxDataElementService" class="org.hisp.dhis.minmax.DefaultMinMaxDataElementService">
-    <property name="minMaxDataElementStore" ref="org.hisp.dhis.minmax.MinMaxDataElementStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datadictionary.DataDictionaryService" class="org.hisp.dhis.datadictionary.DefaultDataDictionaryService">
-    <property name="dataDictionaryStore" ref="org.hisp.dhis.datadictionary.DataDictionaryStore" />
-    <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.indicator.IndicatorService" class="org.hisp.dhis.indicator.DefaultIndicatorService">
-    <property name="indicatorStore" ref="org.hisp.dhis.indicator.IndicatorStore" />
-    <property name="indicatorTypeStore" ref="org.hisp.dhis.indicator.IndicatorTypeStore" />
-    <property name="indicatorGroupStore" ref="org.hisp.dhis.indicator.IndicatorGroupStore" />
-    <property name="indicatorGroupSetStore" ref="org.hisp.dhis.indicator.IndicatorGroupSetStore" />
-    <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.period.PeriodService" class="org.hisp.dhis.period.DefaultPeriodService">
-    <property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.DataSetService" class="org.hisp.dhis.dataset.DefaultDataSetService">
-    <property name="dataSetStore" ref="org.hisp.dhis.dataset.DataSetStore" />
-    <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
-    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" class="org.hisp.dhis.dataset.DefaultCompleteDataSetRegistrationService">
-    <property name="completeDataSetRegistrationStore" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.SectionService" class="org.hisp.dhis.dataset.DefaultSectionService">
-    <property name="sectionStore" ref="org.hisp.dhis.dataset.SectionStore" />
-    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
-    <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataentryform.DataEntryFormService" class="org.hisp.dhis.dataentryform.DefaultDataEntryFormService">
-    <property name="dataEntryFormStore" ref="org.hisp.dhis.dataentryform.DataEntryFormStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.expression.ExpressionService" class="org.hisp.dhis.expression.DefaultExpressionService">
-    <property name="expressionStore" ref="org.hisp.dhis.expression.ExpressionStore" />
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-    <property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
-    <property name="aggregatedDataValueService" ref="org.hisp.dhis.aggregation.AggregatedDataValueService" />
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.validation.ValidationRuleService" class="org.hisp.dhis.validation.DefaultValidationRuleService">
-    <property name="validationRuleStore" ref="org.hisp.dhis.validation.ValidationRuleStore" />
-    <property name="validationRuleGroupStore" ref="org.hisp.dhis.validation.ValidationRuleGroupStore" />
-    <property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
-    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
-    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryService" class="org.hisp.dhis.dataelement.DefaultDataElementCategoryService">
-    <property name="dataElementCategoryStore" ref="org.hisp.dhis.dataelement.DataElementCategoryStore" />
-    <property name="dataElementCategoryOptionStore" ref="org.hisp.dhis.dataelement.DataElementCategoryOptionStore" />
-    <property name="dataElementCategoryComboStore" ref="org.hisp.dhis.dataelement.DataElementCategoryComboStore" />
-    <property name="dataElementCategoryOptionComboStore" ref="org.hisp.dhis.dataelement.DataElementCategoryOptionComboStore" />
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dimension.DimensionService" class="org.hisp.dhis.dimension.DefaultDimensionService">
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitService" class="org.hisp.dhis.organisationunit.DefaultOrganisationUnitService">
-    <property name="sourceStore" ref="org.hisp.dhis.source.SourceStore" />
-    <property name="organisationUnitStore" ref="org.hisp.dhis.organisationunit.OrganisationUnitStore" />
-    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" class="org.hisp.dhis.organisationunit.DefaultOrganisationUnitGroupService">
-    <property name="organisationUnitGroupStore" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupStore" />
-    <property name="organisationUnitGroupSetStore" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService" class="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService">
-    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-    <property name="dataAnalysisStore" ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService" class="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService">
-    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-    <property name="minMaxDataElementService" ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
-    <property name="dataAnalysisStore" ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataanalysis.GapAnalysisService" class="org.hisp.dhis.dataanalysis.GapAnalysisService">
-    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-    <property name="dataAnalysisStore" ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataanalysis.FollowupAnalysisService" class="org.hisp.dhis.dataanalysis.FollowupAnalysisService">
-    <property name="dataAnalysisStore" ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
-  </bean>
-
-  <bean id="dataAnalysisServiceProvider" class="org.hisp.dhis.common.ServiceProvider">
-    <property name="services">
-      <map>
-        <entry>
-          <key>
-            <value>stddevoutlier</value>
-          </key>
-          <ref bean="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService" />
-        </entry>
-        <entry>
-          <key>
-            <value>minmaxoutlier</value>
-          </key>
-          <ref bean="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService" />
-        </entry>
-        <entry>
-          <key>
-            <value>gap</value>
-          </key>
-          <ref bean="org.hisp.dhis.dataanalysis.GapAnalysisService" />
-        </entry>
-        <entry>
-          <key>
-            <value>followup</value>
-          </key>
-          <ref bean="org.hisp.dhis.dataanalysis.FollowupAnalysisService" />
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="org.hisp.dhis.user.CurrentUserService" class="org.hisp.dhis.user.DefaultCurrentUserService">
-    <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserSettingService" class="org.hisp.dhis.user.DefaultUserSettingService">
-    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-    <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserService" class="org.hisp.dhis.user.DefaultUserService">
-    <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserGroupService" class="org.hisp.dhis.user.DefaultUserGroupService">
-    <property name="userGroupStore" ref="org.hisp.dhis.user.UserGroupStore" />
-  </bean>
-
-
-
-  <bean id="org.hisp.dhis.validation.ValidationCriteriaService" class="org.hisp.dhis.validation.DefaultValidationCriteriaService">
-    <property name="validationCriteriaStore" ref="org.hisp.dhis.validation.ValidationCriteriaStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.translation.TranslationService" class="org.hisp.dhis.translation.DefaultTranslationService">
-    <property name="translationStore" ref="org.hisp.dhis.translation.TranslationStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.i18n.locale.LocaleManagerDb" class="org.hisp.dhis.i18n.locale.DatabaseLocaleManager">
-    <property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.PivotDataSetAssociationTableService" class="org.hisp.dhis.dataset.DefaultPivotDataSetAssociationTableService">
-    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
-    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.aggregation.AggregatedDataValueService" class="org.hisp.dhis.aggregation.DefaultAggregatedDataValueService">
-    <property name="aggregatedDataValueStore" ref="org.hisp.dhis.aggregation.AggregatedDataValueStore" />
-  </bean>
-
-  <!-- Concept Name -->
-
-  <bean id="org.hisp.dhis.concept.ConceptStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.concept.Concept" />
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="org.hisp.dhis.concept.ConceptService" class="org.hisp.dhis.concept.DefaultConceptService">
-    <property name="conceptStore" ref="org.hisp.dhis.concept.ConceptStore" />
-  </bean>
-
-  <!-- I18nService -->
-
-  <bean id="org.hisp.dhis.i18n.I18nService" class="org.hisp.dhis.i18n.DefaultI18nService">
-    <property name="localeManager">
-      <ref bean="org.hisp.dhis.i18n.locale.LocaleManagerDb" />
-    </property>
-    <property name="translationService">
-      <ref bean="org.hisp.dhis.translation.TranslationService" />
-    </property>
-    <property name="objects">
-      <list>
-        <ref bean="I18nDataElement" />
-        <ref bean="I18nDataElementGroup" />
-        <ref bean="I18nDataElementGroupSet" />
-        <ref bean="I18nDataDictionary" />
-        <ref bean="I18nIndicator" />
-        <ref bean="I18nIndicatorType" />
-        <ref bean="I18nIndicatorGroup" />
-        <ref bean="I18nIndicatorGroupSet" />
-        <ref bean="I18nDataSet" />
-        <ref bean="I18nOrganisationUnit" />
-        <ref bean="I18nReportExcelNormal" />
-        <ref bean="I18nReportExcelCategory" />
-        <ref bean="I18nReportExcelOganiztionGroupListing" />
-        <ref bean="I18nReportExcelPeriodColumnListing" />
-        <ref bean="I18nReportExcelItem" />
-        <ref bean="I18nExcelItemGroup" />
-        <ref bean="I18nExcelItem" />
-        <ref bean="I18nSection" />
-      </list>
-    </property>
-  </bean>
-
-  <!-- I18n object definitions -->
-
-  <bean id="I18nDataElement" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="DataElement" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-        <value>shortName</value>
-        <value>description</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="shortName">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="25" />
-            <entry key="regex" value="/^[\w]?[\w\d]*$/" />
-            <entry key="message" value="translation_shortname_wellformed" />
-          </map>
-        </entry>
-        <entry key="description">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="200" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nDataElementGroup" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="DataElementGroup" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-
-  </bean>
-
-  <bean id="I18nDataElementGroupSet" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="DataElementGroupSet" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nIndicator" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="Indicator" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-        <value>shortName</value>
-        <value>description</value>
-        <value>numeratorDescription</value>
-        <value>denominatorDescription</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="shortName">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="25" />
-            <entry key="regex" value="/^[\w]?[\w\d]*$/" />
-            <entry key="message" value="translation_shortname_wellformed" />
-          </map>
-        </entry>
-        <entry key="description">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="200" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="numeratorDescription">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="100" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="denominatorDescription">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="100" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nIndicatorType" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="IndicatorType" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nIndicatorGroup" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="IndicatorGroup" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nIndicatorGroupSet" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="IndicatorGroupSet" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nDataDictionary" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="DataDictionary" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-        <value>description</value>
-        <value>region</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="description">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="200" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="region">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="255" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nOrganisationUnit" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="OrganisationUnit" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-        <value>shortName</value>
-        <value>comment</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="shortName">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="25" />
-            <entry key="regex" value="/^[\w]?[\w\d]*$/" />
-            <entry key="message" value="translation_shortname_wellformed" />
-          </map>
-        </entry>
-        <entry key="comment">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="360" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nOrganisationUnitGroup" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="OrganisationUnitGroup" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nOrganisationUnitGroupSet" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="OrganisationUnitGroupSet" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-        <value>description</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="description">
-          <map>
-            <entry key="unique" value="false" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="200" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nDataSet" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="DataSet" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-        <value>shortName</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-        <entry key="shortName">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="false" />
-            <entry key="minlength" value="0" />
-            <entry key="maxlength" value="25" />
-            <entry key="regex" value="/^[\w]?[\w\d]*$/" />
-            <entry key="message" value="translation_shortname_wellformed" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nDataElementCategory" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="DataElementCategory" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nReportExcelNormal" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="ReportExcelNormal" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nReportExcelCategory" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="ReportExcelCategory" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nReportExcelOganiztionGroupListing" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="ReportExcelOganiztionGroupListing" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nReportExcelPeriodColumnListing" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="ReportExcelPeriodColumnListing" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nReportExcelItem" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="ReportExcelItem" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nExcelItemGroup" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="ExcelItemGroup" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nExcelItem" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="ExcelItem" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <bean id="I18nSection" class="org.hisp.dhis.i18n.I18nObject">
-    <property name="className" value="Section" />
-    <property name="propertyNames">
-      <list>
-        <value>name</value>
-      </list>
-    </property>
-
-    <property name="rulePropertyNames">
-      <map>
-        <entry key="name">
-          <map>
-            <entry key="unique" value="true" />
-            <entry key="required" value="true" />
-            <entry key="minlength" value="2" />
-            <entry key="maxlength" value="160" />
-            <entry key="regex" value="''" />
-            <entry key="message" value="" />
-          </map>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
-  <!-- Startup routine definitions -->
-
-  <bean id="org.hisp.dhis.startup.TableAlteror" class="org.hisp.dhis.startup.TableAlteror">
-    <property name="statementManager" ref="statementManager" />
-    <property name="name" value="TableAlteror" />
-    <property name="runlevel" value="1" />
-    <property name="skipInTests" value="true" />
-  </bean>
-
-  <bean id="org.hisp.dhis.period.PeriodTypePopulator" class="org.hisp.dhis.period.PeriodTypePopulator">
-    <property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
-    <property name="name" value="PeriodTypePopulator" />
-    <property name="runlevel" value="2" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator" class="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator">
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-    <property name="conceptService" ref="org.hisp.dhis.concept.ConceptService" />
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-    <property name="name" value="DataElementDefaultDimensionPopulator" />
-    <property name="runlevel" value="3" />
-  </bean>
-
-  <bean id="org.hisp.dhis.expression.MultiDimensionExpressionUpgrader" class="org.hisp.dhis.expression.MultiDimensionExpressionUpgrader">
-    <property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
-    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-    <property name="name" value="MultiDimensionExpressionUpgrader" />
-    <property name="runlevel" value="3" />
-    <property name="skipInTests" value="true" />
-  </bean>
-
-  <bean id="org.hisp.dhis.startup.TableCreator" class="org.hisp.dhis.startup.TableCreator">
-    <property name="jdbcTemplate" ref="jdbcTemplate" />
-    <property name="statementBuilder" ref="statementBuilder" />
-    <property name="name" value="TableCreator" />
-    <property name="runlevel" value="3" />
-  </bean>
-
-  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator" class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator">
-    <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
-    <property name="runlevel" value="5" />
-    <property name="name" value="OrganisationUnitGroupSetPopulator" />
-    <property name="skipInTests" value="true" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.UuidPopulator" class="org.hisp.dhis.dataelement.UuidPopulator">
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-    <property name="name" value="UuidPopulator" />
-    <property name="runlevel" value="5" />
-    <property name="skipInTests" value="true" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.DataSetShortNamePopulator" class="org.hisp.dhis.dataset.DataSetShortNamePopulator">
-    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
-    <property name="name" value="DataSetShortNamePopulator" />
-    <property name="runlevel" value="5" />
-    <property name="skipInTests" value="true" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataentryform.DataEntryFormPopulator" class="org.hisp.dhis.dataentryform.DataEntryFormPopulator">
-    <property name="jdbcTemplate" ref="jdbcTemplate" />
-    <property name="statementBuilder" ref="statementBuilder" />
-    <property name="name" value="DataEntryFormPopulator" />
-    <property name="runlevel" value="5" />
-    <property name="skipInTests" value="true" />
-  </bean>
-
-  <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    <property name="targetObject" ref="org.hisp.dhis.system.startup.StartupRoutineExecutor" />
-    <property name="targetMethod" value="addStartupRoutines" />
-    <property name="arguments">
-      <list>
-        <list>
-          <ref local="org.hisp.dhis.startup.TableAlteror" />
-          <ref local="org.hisp.dhis.period.PeriodTypePopulator" />
-          <ref local="org.hisp.dhis.startup.TableCreator" />
-          <ref local="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator" />
-          <ref local="org.hisp.dhis.expression.MultiDimensionExpressionUpgrader" />
-          <ref local="org.hisp.dhis.dataset.DataSetShortNamePopulator" />
-          <ref local="org.hisp.dhis.dataelement.UuidPopulator" />
-          <ref local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator" />
-          <ref local="org.hisp.dhis.dataentryform.DataEntryFormPopulator" />
-        </list>
-      </list>
-    </property>
-  </bean>
-
-  <!-- DeletionHandlers -->
-
-  <bean id="org.hisp.dhis.dataentryform.DataEntryFormDeletionHandler" class="org.hisp.dhis.dataentryform.DataEntryFormDeletionHandler">
-    <property name="dataEntryFormService" ref="org.hisp.dhis.dataentryform.DataEntryFormService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datadictionary.DataDictionaryDeletionHandler" class="org.hisp.dhis.datadictionary.DataDictionaryDeletionHandler">
-    <property name="dataDictionaryService" ref="org.hisp.dhis.datadictionary.DataDictionaryService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementDeletionHandler" class="org.hisp.dhis.dataelement.DataElementDeletionHandler">
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementGroupDeletionHandler" class="org.hisp.dhis.dataelement.DataElementGroupDeletionHandler">
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryOptionDeletionHandler" class="org.hisp.dhis.dataelement.DataElementCategoryOptionDeletionHandler">
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryOptionComboDeletionHandler" class="org.hisp.dhis.dataelement.DataElementCategoryOptionComboDeletionHandler">
-    <property name="jdbcTemplate" ref="jdbcTemplate" />
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler" class="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler">
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.DataSetDeletionHandler" class="org.hisp.dhis.dataset.DataSetDeletionHandler">
-    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler" class="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler">
-    <property name="completeDataSetRegistrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
-    <property name="jdbcTemplate" ref="jdbcTemplate" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.SectionDeletionHandler" class="org.hisp.dhis.dataset.SectionDeletionHandler">
-    <property name="sectionService" ref="org.hisp.dhis.dataset.SectionService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler" class="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler">
-    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.expression.ExpressionDeletionHandler" class="org.hisp.dhis.expression.ExpressionDeletionHandler">
-    <property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.indicator.IndicatorDeletionHandler" class="org.hisp.dhis.indicator.IndicatorDeletionHandler">
-    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
-    <property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.indicator.IndicatorGroupDeletionHandler" class="org.hisp.dhis.indicator.IndicatorGroupDeletionHandler">
-    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.minmax.MinMaxDataElementDeletionHandler" class="org.hisp.dhis.minmax.MinMaxDataElementDeletionHandler">
-    <property name="minMaxDataElementService" ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.validation.ValidationRuleDeletionHandler" class="org.hisp.dhis.validation.ValidationRuleDeletionHandler">
-    <property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.validation.ValidationRuleGroupDeletionHandler" class="org.hisp.dhis.validation.ValidationRuleGroupDeletionHandler">
-    <property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datavalue.DataValueDeletionHandler" class="org.hisp.dhis.datavalue.DataValueDeletionHandler">
-    <property name="jdbcTemplate" ref="jdbcTemplate" />
-  </bean>
-
-  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler" class="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler">
-    <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler" class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler">
-    <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.datavalue.DataValueAuditDeletionHandler" class="org.hisp.dhis.datavalue.DataValueAuditDeletionHandler">
-    <property name="dataValueAuditService" ref="org.hisp.dhis.datavalue.DataValueAuditService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserDeletionHandler" class="org.hisp.dhis.user.UserDeletionHandler">
-    <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserAuthorityGroupDeletionHandler" class="org.hisp.dhis.user.UserAuthorityGroupDeletionHandler">
-    <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserCredentialsDeletionHandler" class="org.hisp.dhis.user.UserCredentialsDeletionHandler">
-    <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
-  </bean>
-
-  <bean id="org.hisp.dhis.user.UserSettingDeletionHandler" class="org.hisp.dhis.user.UserSettingDeletionHandler">
-    <property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementCategoryDeletionHandler" class="org.hisp.dhis.dataelement.DataElementCategoryDeletionHandler">
-    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.dataelement.DataElementGroupSetDeletionHandler" class="org.hisp.dhis.dataelement.DataElementGroupSetDeletionHandler">
-    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
-  </bean>
-
-  <!-- Security -->
-
-  <bean id="org.hisp.dhis.security.PasswordManager" class="org.hisp.dhis.security.spring.SpringSecurityPasswordManager">
-    <property name="passwordEncoder" ref="passwordEncoder" />
-    <property name="usernameSaltSource" ref="usernameSaltSource" />
-  </bean>
-
-  <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
-    <property name="providers" ref="daoAuthenticationProvider" />
-    <property name="authenticationEventPublisher" ref="defaultAuthenticationEventPublisher" />
-  </bean>
-
-  <bean id="defaultAuthenticationEventPublisher" class="org.springframework.security.authentication.DefaultAuthenticationEventPublisher" />
-
-  <bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
-    <property name="userDetailsService" ref="userDetailsService" />
-    <property name="passwordEncoder" ref="passwordEncoder" />
-    <property name="saltSource" ref="usernameSaltSource" />
-  </bean>
-
-  <bean id="userDetailsService" class="org.hisp.dhis.security.hibernate.HibernateUserDetailsService">
-    <property name="sessionFactory" ref="sessionFactory" />
-  </bean>
-
-  <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" />
-
-  <bean id="usernameSaltSource" class="org.hisp.dhis.security.DefaultUsernameSaltSource" />
-
-  <!-- DeletionManager -->
-
-  <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    <property name="targetObject" ref="deletionManager" />
-    <property name="targetMethod" value="addDeletionHandlers" />
-    <property name="arguments">
-      <list>
-        <list>
-          <ref local="org.hisp.dhis.datadictionary.DataDictionaryDeletionHandler" />
-          <ref local="org.hisp.dhis.dataelement.DataElementDeletionHandler" />
-          <ref local="org.hisp.dhis.dataelement.DataElementGroupDeletionHandler" />
-          <ref local="org.hisp.dhis.dataelement.DataElementCategoryOptionDeletionHandler" />
-          <ref local="org.hisp.dhis.dataelement.DataElementCategoryOptionComboDeletionHandler" />
-          <ref local="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler" />
-          <ref local="org.hisp.dhis.dataset.DataSetDeletionHandler" />
-          <ref local="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler" />
-          <ref local="org.hisp.dhis.dataset.SectionDeletionHandler" />
-          <ref local="org.hisp.dhis.dataentryform.DataEntryFormDeletionHandler" />
-          <ref local="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler" />
-          <ref local="org.hisp.dhis.expression.ExpressionDeletionHandler" />
-          <ref local="org.hisp.dhis.indicator.IndicatorDeletionHandler" />
-          <ref local="org.hisp.dhis.indicator.IndicatorGroupDeletionHandler" />
-          <ref local="org.hisp.dhis.minmax.MinMaxDataElementDeletionHandler" />
-          <ref local="org.hisp.dhis.validation.ValidationRuleDeletionHandler" />
-          <ref local="org.hisp.dhis.validation.ValidationRuleGroupDeletionHandler" />
-          <ref local="org.hisp.dhis.datavalue.DataValueDeletionHandler" />
-          <ref local="org.hisp.dhis.datavalue.DataValueAuditDeletionHandler" />
-          <ref local="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler" />
-          <ref local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler" />
-          <ref local="org.hisp.dhis.user.UserDeletionHandler" />
-          <ref local="org.hisp.dhis.user.UserAuthorityGroupDeletionHandler" />
-          <ref local="org.hisp.dhis.user.UserCredentialsDeletionHandler" />
-          <ref local="org.hisp.dhis.user.UserSettingDeletionHandler" />
-          <ref local="org.hisp.dhis.dataelement.DataElementCategoryDeletionHandler" />
-          <ref local="org.hisp.dhis.dataelement.DataElementGroupSetDeletionHandler" />
-        </list>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Min/Max validation -->
-
-  <bean id="org.hisp.dhis.minmax.validation.MinMaxValuesGenerationService" class="org.hisp.dhis.minmax.validation.DefaultMinMaxValuesGenerationService">
-    <property name="dataAnalysisStore" ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
-  </bean>
-
-  <!-- AOP definitions -->
-
-  <aop:config>
-
-    <aop:aspect ref="deletionInterceptor">
-      <aop:before pointcut="execution( * org.hisp.dhis.datadictionary.DataDictionaryService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.dataelement.DataElementService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.dataelement.DataElementCategoryService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.dataset.DataSetService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.indicator.IndicatorService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.expression.ExpressionService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.minmax.MinMaxDataElementService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.validation.ValidationRuleService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.period.PeriodService.delete*(..) )"
-        method="intercept" />
-      <aop:before
-        pointcut="execution( * org.hisp.dhis.organisationunit.OrganisationUnitService.delete*(..) )"
-        method="intercept" />
-      <aop:before
-        pointcut="execution( * org.hisp.dhis.organisationunit.OrganisationUnitGroupService.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.user.UserStore.delete*(..) )"
-        method="intercept" />
-      <aop:before pointcut="execution( * org.hisp.dhis.concept.ConceptService.delete*(..) )"
-        method="intercept" />
-    </aop:aspect>
-
-    <aop:aspect ref="statementInterceptor">
-      <aop:around pointcut="execution( * org.hisp.dhis.validation.ValidationRuleService.validate*(..) )"
-        method="intercept" />
-      <aop:around pointcut="execution( * org.hisp.dhis.dataanalysis.DataAnalysisService.analyse(..) )"
-        method="intercept" />
-    </aop:aspect>
-
-    <!-- <aop:aspect ref="i18nTranslationInterceptor"> <aop:after-returning pointcut="execution( * org.hisp.dhis.dataelement.DataElementService.get*(..) 
-      )" method="intercept" returning="object"/> <aop:after-returning pointcut="execution( * org.hisp.dhis.dataelement.DataElementCategoryService.get*(..) 
-      )" method="intercept" returning="object"/> <aop:after-returning pointcut="execution( * org.hisp.dhis.indicator.IndicatorService.get*(..) 
-      )" method="intercept" returning="object"/> <aop:after-returning pointcut="execution( * org.hisp.dhis.datadictionary.DataDictionaryService.get*(..) 
-      )" method="intercept" returning="object"/> <aop:after-returning pointcut="execution( * org.hisp.dhis.dataset.DataSetService.get*(..) 
-      )" method="intercept" returning="object"/> <aop:after-returning pointcut="execution( * org.hisp.dhis.organisationunit.OrganisationUnitService.get*(..) 
-      )" method="intercept" returning="object"/> <aop:after-returning pointcut="execution( * org.hisp.dhis.organisationunit.OrganisationUnitGroupService.get*(..) 
-      )" method="intercept" returning="object"/> </aop:aspect> -->
-
-  </aop:config>
+	<bean id="org.hisp.dhis.translation.TranslationStore"
+		class="org.hisp.dhis.translation.hibernate.HibernateTranslationStore">
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.aggregation.AggregatedDataValueStore"
+		class="org.hisp.dhis.aggregation.jdbc.JdbcAggregatedDataValueStore">
+		<property name="statementManager" ref="statementManager"/>
+	</bean>
+	
+	<bean id="org.hisp.dhis.user.UserAuthorityGroupStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.user.UserAuthorityGroup" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+	
+
+	<!-- Service definitions -->
+
+	<bean id="org.hisp.dhis.dataelement.DataElementOperandService"
+		class="org.hisp.dhis.dataelement.DefaultDataElementOperandService">
+		<property name="dataElementOperandStore"
+			ref="org.hisp.dhis.dataelement.DataElementOperandStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.customvalue.CustomValueService" class="org.hisp.dhis.customvalue.DefaultCustomValueService">
+		<property name="customValueStore" ref="org.hisp.dhis.customvalue.CustomValueStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.datavalue.DataValueService" class="org.hisp.dhis.datavalue.DefaultDataValueService">
+		<property name="dataValueStore" ref="org.hisp.dhis.datavalue.DataValueStore" />
+		<property name="dataValueAuditService"
+			ref="org.hisp.dhis.datavalue.DataValueAuditService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.datavalue.DataValueAuditService" class="org.hisp.dhis.datavalue.DefaultDataValueAuditService">
+		<property name="dataValueAuditStore" ref="org.hisp.dhis.datavalue.DataValueAuditStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementService" class="org.hisp.dhis.dataelement.DefaultDataElementService">
+		<property name="dataElementStore" ref="org.hisp.dhis.dataelement.DataElementStore" />
+		<property name="dataElementGroupStore"
+			ref="org.hisp.dhis.dataelement.DataElementGroupStore" />
+		<property name="dataElementGroupSetStore"
+			ref="org.hisp.dhis.dataelement.DataElementGroupSetStore" />
+		<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.minmax.MinMaxDataElementService" class="org.hisp.dhis.minmax.DefaultMinMaxDataElementService">
+		<property name="minMaxDataElementStore" ref="org.hisp.dhis.minmax.MinMaxDataElementStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.datadictionary.DataDictionaryService"
+		class="org.hisp.dhis.datadictionary.DefaultDataDictionaryService">
+		<property name="dataDictionaryStore"
+			ref="org.hisp.dhis.datadictionary.DataDictionaryStore" />
+		<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.indicator.IndicatorService" class="org.hisp.dhis.indicator.DefaultIndicatorService">
+		<property name="indicatorStore" ref="org.hisp.dhis.indicator.IndicatorStore" />
+		<property name="indicatorTypeStore" ref="org.hisp.dhis.indicator.IndicatorTypeStore" />
+		<property name="indicatorGroupStore" ref="org.hisp.dhis.indicator.IndicatorGroupStore" />
+		<property name="indicatorGroupSetStore"
+			ref="org.hisp.dhis.indicator.IndicatorGroupSetStore" />
+		<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.period.PeriodService" class="org.hisp.dhis.period.DefaultPeriodService">
+		<property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.DataSetService" class="org.hisp.dhis.dataset.DefaultDataSetService">
+		<property name="dataSetStore" ref="org.hisp.dhis.dataset.DataSetStore" />
+		<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.CompleteDataSetRegistrationService"
+		class="org.hisp.dhis.dataset.DefaultCompleteDataSetRegistrationService">
+		<property name="completeDataSetRegistrationStore"
+			ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.SectionService" class="org.hisp.dhis.dataset.DefaultSectionService">
+		<property name="sectionStore" ref="org.hisp.dhis.dataset.SectionStore" />
+		<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+		<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataentryform.DataEntryFormService" class="org.hisp.dhis.dataentryform.DefaultDataEntryFormService">
+		<property name="dataEntryFormStore"
+			ref="org.hisp.dhis.dataentryform.DataEntryFormStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.expression.ExpressionService" class="org.hisp.dhis.expression.DefaultExpressionService">
+		<property name="expressionStore" ref="org.hisp.dhis.expression.ExpressionStore" />
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
+		<property name="aggregatedDataValueService" ref="org.hisp.dhis.aggregation.AggregatedDataValueService"/>
+		<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.validation.ValidationRuleService" class="org.hisp.dhis.validation.DefaultValidationRuleService">
+		<property name="validationRuleStore" ref="org.hisp.dhis.validation.ValidationRuleStore" />
+		<property name="validationRuleGroupStore"
+			ref="org.hisp.dhis.validation.ValidationRuleGroupStore" />
+		<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
+		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+		<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService"/>
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService"/>
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementCategoryService"
+		class="org.hisp.dhis.dataelement.DefaultDataElementCategoryService">
+		<property name="dataElementCategoryStore"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryStore" />
+		<property name="dataElementCategoryOptionStore"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryOptionStore" />
+		<property name="dataElementCategoryComboStore"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryComboStore" />
+		<property name="dataElementCategoryOptionComboStore"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryOptionComboStore" />
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dimension.DimensionService" class="org.hisp.dhis.dimension.DefaultDimensionService">
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="categoryService"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.organisationunit.OrganisationUnitService"
+		class="org.hisp.dhis.organisationunit.DefaultOrganisationUnitService">
+		<property name="sourceStore" ref="org.hisp.dhis.source.SourceStore" />
+		<property name="organisationUnitStore"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitStore" />
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"
+		class="org.hisp.dhis.organisationunit.DefaultOrganisationUnitGroupService">
+		<property name="organisationUnitGroupStore"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupStore" />
+		<property name="organisationUnitGroupSetStore"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService"
+		class="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService">
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+		<property name="dataAnalysisStore"
+			ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService"
+		class="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService">
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+		<property name="minMaxDataElementService"
+			ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
+		<property name="dataAnalysisStore"
+			ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataanalysis.GapAnalysisService" class="org.hisp.dhis.dataanalysis.GapAnalysisService">
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+		<property name="dataAnalysisStore"
+			ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataanalysis.FollowupAnalysisService"
+		class="org.hisp.dhis.dataanalysis.FollowupAnalysisService">
+		<property name="dataAnalysisStore"
+			ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
+	</bean>
+
+	<bean id="dataAnalysisServiceProvider" class="org.hisp.dhis.common.ServiceProvider">
+		<property name="services">
+			<map>
+				<entry>
+					<key>
+						<value>stddevoutlier</value>
+					</key>
+					<ref bean="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService" />
+				</entry>
+				<entry>
+					<key>
+						<value>minmaxoutlier</value>
+					</key>
+					<ref bean="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService" />
+				</entry>
+				<entry>
+					<key>
+						<value>gap</value>
+					</key>
+					<ref bean="org.hisp.dhis.dataanalysis.GapAnalysisService" />
+				</entry>
+				<entry>
+					<key>
+						<value>followup</value>
+					</key>
+					<ref bean="org.hisp.dhis.dataanalysis.FollowupAnalysisService" />
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="org.hisp.dhis.user.CurrentUserService" class="org.hisp.dhis.user.DefaultCurrentUserService">
+		<property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.user.UserSettingService" class="org.hisp.dhis.user.DefaultUserSettingService">
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+		<property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.user.UserService" class="org.hisp.dhis.user.DefaultUserService">
+		<property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+	</bean>
+	<bean id="org.hisp.dhis.user.UserGroupService" class="org.hisp.dhis.user.DefaultUserGroupService">
+		<property name="userGroupStore" ref="org.hisp.dhis.user.UserGroupStore" />
+  	</bean>
+
+
+	<bean id="org.hisp.dhis.validation.ValidationCriteriaService"
+		class="org.hisp.dhis.validation.DefaultValidationCriteriaService">
+		<property name="validationCriteriaStore"
+			ref="org.hisp.dhis.validation.ValidationCriteriaStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.translation.TranslationService" class="org.hisp.dhis.translation.DefaultTranslationService">
+		<property name="translationStore" ref="org.hisp.dhis.translation.TranslationStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.i18n.locale.LocaleManagerDb" class="org.hisp.dhis.i18n.locale.DatabaseLocaleManager">
+		<property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.PivotDataSetAssociationTableService"
+		class="org.hisp.dhis.dataset.DefaultPivotDataSetAssociationTableService">
+		<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+	</bean>
+	
+	<bean id="org.hisp.dhis.aggregation.AggregatedDataValueService"
+		class="org.hisp.dhis.aggregation.DefaultAggregatedDataValueService">
+		<property name="aggregatedDataValueStore"
+			ref="org.hisp.dhis.aggregation.AggregatedDataValueStore"/>
+	</bean>
+	
+	<!-- Concept Name -->
+	
+	<bean id="org.hisp.dhis.concept.ConceptStore"
+		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+		<property name="clazz" value="org.hisp.dhis.concept.Concept"/>
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+	
+	<bean id="org.hisp.dhis.concept.ConceptService" 
+		class="org.hisp.dhis.concept.DefaultConceptService">
+		<property name="conceptStore" ref="org.hisp.dhis.concept.ConceptStore" />
+	</bean>
+	
+	<!-- I18nService -->
+
+	<bean id="org.hisp.dhis.i18n.I18nService" class="org.hisp.dhis.i18n.DefaultI18nService">
+		<property name="localeManager">
+			<ref bean="org.hisp.dhis.i18n.locale.LocaleManagerDb" />
+		</property>
+		<property name="translationService">
+			<ref bean="org.hisp.dhis.translation.TranslationService" />
+		</property>
+		<property name="objects">
+			<list>
+				<ref bean="I18nDataElement" />
+				<ref bean="I18nDataElementGroup" />
+				<ref bean="I18nDataElementGroupSet" />
+				<ref bean="I18nDataDictionary" />
+				<ref bean="I18nIndicator" />
+				<ref bean="I18nIndicatorType" />
+				<ref bean="I18nIndicatorGroup" />
+				<ref bean="I18nIndicatorGroupSet" />
+				<ref bean="I18nDataSet" />
+				<ref bean="I18nOrganisationUnit" />
+				<ref bean="I18nReportExcelNormal" />
+				<ref bean="I18nReportExcelCategory" />
+				<ref bean="I18nReportExcelOganiztionGroupListing" />
+				<ref bean="I18nReportExcelPeriodColumnListing" />
+				<ref bean="I18nReportExcelItem" />
+				<ref bean="I18nExcelItemGroup" />
+				<ref bean="I18nExcelItem" />
+				<ref bean="I18nSection" />
+			</list>
+		</property>
+	</bean>
+
+	<!-- I18n object definitions -->
+
+	<bean id="I18nDataElement" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="DataElement" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+				<value>shortName</value>
+				<value>description</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="shortName">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="25" />
+						<entry key="regex" value="/^[\w]?[\w\d]*$/" />
+						<entry key="message" value="translation_shortname_wellformed" />
+					</map>
+				</entry>
+				<entry key="description">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="200" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nDataElementGroup" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="DataElementGroup" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+
+	</bean>
+
+	<bean id="I18nDataElementGroupSet" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="DataElementGroupSet" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nIndicator" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="Indicator" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+				<value>shortName</value>
+				<value>description</value>
+				<value>numeratorDescription</value>
+				<value>denominatorDescription</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="shortName">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="25" />
+						<entry key="regex" value="/^[\w]?[\w\d]*$/" />
+						<entry key="message" value="translation_shortname_wellformed" />
+					</map>
+				</entry>
+				<entry key="description">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="200" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="numeratorDescription">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="100" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="denominatorDescription">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="100" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nIndicatorType" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="IndicatorType" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nIndicatorGroup" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="IndicatorGroup" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nIndicatorGroupSet" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="IndicatorGroupSet" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nDataDictionary" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="DataDictionary" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+				<value>description</value>
+				<value>region</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="description">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="200" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="region">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="255" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nOrganisationUnit" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="OrganisationUnit" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+				<value>shortName</value>
+				<value>comment</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="shortName">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="25" />
+						<entry key="regex" value="/^[\w]?[\w\d]*$/" />
+						<entry key="message" value="translation_shortname_wellformed" />
+					</map>
+				</entry>
+				<entry key="comment">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="360" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nOrganisationUnitGroup" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="OrganisationUnitGroup" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nOrganisationUnitGroupSet" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="OrganisationUnitGroupSet" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+				<value>description</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="description">
+					<map>
+						<entry key="unique" value="false" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="200" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nDataSet" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="DataSet" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+				<value>shortName</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+				<entry key="shortName">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="false" />
+						<entry key="minlength" value="0" />
+						<entry key="maxlength" value="25" />
+						<entry key="regex" value="/^[\w]?[\w\d]*$/" />
+						<entry key="message" value="translation_shortname_wellformed" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nDataElementCategory" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="DataElementCategory" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nReportExcelNormal" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="ReportExcelNormal" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nReportExcelCategory" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="ReportExcelCategory" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nReportExcelOganiztionGroupListing" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="ReportExcelOganiztionGroupListing" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nReportExcelPeriodColumnListing" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="ReportExcelPeriodColumnListing" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nReportExcelItem" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="ReportExcelItem" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nExcelItemGroup" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="ExcelItemGroup" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nExcelItem" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="ExcelItem" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<bean id="I18nSection" class="org.hisp.dhis.i18n.I18nObject">
+		<property name="className" value="Section" />
+		<property name="propertyNames">
+			<list>
+				<value>name</value>
+			</list>
+		</property>
+
+		<property name="rulePropertyNames">
+			<map>
+				<entry key="name">
+					<map>
+						<entry key="unique" value="true" />
+						<entry key="required" value="true" />
+						<entry key="minlength" value="2" />
+						<entry key="maxlength" value="160" />
+						<entry key="regex" value="''" />
+						<entry key="message" value="" />
+					</map>
+				</entry>
+			</map>
+		</property>
+	</bean>
+
+	<!-- Startup routine definitions -->
+
+	<bean id="org.hisp.dhis.startup.TableAlteror" class="org.hisp.dhis.startup.TableAlteror">
+		<property name="statementManager" ref="statementManager" />
+		<property name="name" value="TableAlteror" />
+		<property name="runlevel" value="1" />
+		<property name="skipInTests" value="true" />
+	</bean>
+
+	<bean id="org.hisp.dhis.period.PeriodTypePopulator" class="org.hisp.dhis.period.PeriodTypePopulator">
+		<property name="periodStore" ref="org.hisp.dhis.period.PeriodStore" />
+		<property name="name" value="PeriodTypePopulator" />
+		<property name="runlevel" value="2" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator"
+		class="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator">
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="conceptService" ref="org.hisp.dhis.concept.ConceptService"/>
+		<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+		<property name="name" value="DataElementDefaultDimensionPopulator" />
+		<property name="runlevel" value="3" />
+	</bean>
+
+	<bean id="org.hisp.dhis.expression.MultiDimensionExpressionUpgrader"
+		class="org.hisp.dhis.expression.MultiDimensionExpressionUpgrader">
+		<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
+		<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+		<property name="categoryService"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+		<property name="name" value="MultiDimensionExpressionUpgrader" />
+		<property name="runlevel" value="3" />
+		<property name="skipInTests" value="true" />
+	</bean>
+
+	<bean id="org.hisp.dhis.startup.TableCreator" class="org.hisp.dhis.startup.TableCreator">
+		<property name="jdbcTemplate" ref="jdbcTemplate" />
+		<property name="statementBuilder" ref="statementBuilder" />
+		<property name="name" value="TableCreator" />
+		<property name="runlevel" value="3" />
+	</bean>
+
+	<bean
+		id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator"
+		class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator">
+		<property name="organisationUnitGroupService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+		<property name="runlevel" value="5" />
+		<property name="name" value="OrganisationUnitGroupSetPopulator" />
+		<property name="skipInTests" value="true" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.UuidPopulator" class="org.hisp.dhis.dataelement.UuidPopulator">
+		<property name="categoryService"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="name" value="UuidPopulator" />
+		<property name="runlevel" value="5" />
+		<property name="skipInTests" value="true" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.DataSetShortNamePopulator" class="org.hisp.dhis.dataset.DataSetShortNamePopulator">
+		<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+		<property name="name" value="DataSetShortNamePopulator" />
+		<property name="runlevel" value="5" />
+		<property name="skipInTests" value="true" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataentryform.DataEntryFormPopulator"
+		class="org.hisp.dhis.dataentryform.DataEntryFormPopulator">
+		<property name="jdbcTemplate" ref="jdbcTemplate" />
+		<property name="statementBuilder" ref="statementBuilder" />
+		<property name="name" value="DataEntryFormPopulator" />
+		<property name="runlevel" value="5" />
+		<property name="skipInTests" value="true" />
+	</bean>
+
+	<bean
+		class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+		<property name="targetObject"
+			ref="org.hisp.dhis.system.startup.StartupRoutineExecutor" />
+		<property name="targetMethod" value="addStartupRoutines" />
+		<property name="arguments">
+			<list>
+				<list>
+					<ref local="org.hisp.dhis.startup.TableAlteror" />
+					<ref local="org.hisp.dhis.period.PeriodTypePopulator" />
+					<ref local="org.hisp.dhis.startup.TableCreator" />
+					<ref
+						local="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator" />
+					<ref local="org.hisp.dhis.expression.MultiDimensionExpressionUpgrader" />
+					<ref local="org.hisp.dhis.dataset.DataSetShortNamePopulator" />
+					<ref local="org.hisp.dhis.dataelement.UuidPopulator" />
+					<ref
+						local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator" />
+					<ref local="org.hisp.dhis.dataentryform.DataEntryFormPopulator" />
+				</list>
+			</list>
+		</property>
+	</bean>
+
+	<!-- DeletionHandlers -->
+
+	<bean id="org.hisp.dhis.dataentryform.DataEntryFormDeletionHandler"
+		class="org.hisp.dhis.dataentryform.DataEntryFormDeletionHandler">
+		<property name="dataEntryFormService"
+			ref="org.hisp.dhis.dataentryform.DataEntryFormService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.datadictionary.DataDictionaryDeletionHandler"
+		class="org.hisp.dhis.datadictionary.DataDictionaryDeletionHandler">
+		<property name="dataDictionaryService"
+			ref="org.hisp.dhis.datadictionary.DataDictionaryService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementDeletionHandler"
+		class="org.hisp.dhis.dataelement.DataElementDeletionHandler">
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="categoryService"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementGroupDeletionHandler"
+		class="org.hisp.dhis.dataelement.DataElementGroupDeletionHandler">
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+	</bean>
+
+	<bean
+		id="org.hisp.dhis.dataelement.DataElementCategoryOptionDeletionHandler"
+		class="org.hisp.dhis.dataelement.DataElementCategoryOptionDeletionHandler">
+		<property name="categoryService"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+	</bean>
+
+	<bean
+		id="org.hisp.dhis.dataelement.DataElementCategoryOptionComboDeletionHandler"
+		class="org.hisp.dhis.dataelement.DataElementCategoryOptionComboDeletionHandler">
+		<property name="jdbcTemplate" ref="jdbcTemplate" />
+		<property name="categoryService"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+	</bean>
+
+	<bean
+		id="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler"
+		class="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler">
+		<property name="categoryService"
+			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.DataSetDeletionHandler" 
+		class="org.hisp.dhis.dataset.DataSetDeletionHandler">
+		<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+	</bean>
+
+	<bean
+		id="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler"
+		class="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler">
+		<property name="completeDataSetRegistrationService"
+			ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
+		<property name="jdbcTemplate" ref="jdbcTemplate" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataset.SectionDeletionHandler" 
+		class="org.hisp.dhis.dataset.SectionDeletionHandler">
+		<property name="sectionService" ref="org.hisp.dhis.dataset.SectionService" />
+	</bean>
+
+	<bean
+		id="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler"
+		class="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler">
+		<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.expression.ExpressionDeletionHandler"
+		class="org.hisp.dhis.expression.ExpressionDeletionHandler">
+		<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.indicator.IndicatorDeletionHandler" 
+		class="org.hisp.dhis.indicator.IndicatorDeletionHandler">
+		<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+		<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.indicator.IndicatorGroupDeletionHandler"
+		class="org.hisp.dhis.indicator.IndicatorGroupDeletionHandler">
+		<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.minmax.MinMaxDataElementDeletionHandler"
+		class="org.hisp.dhis.minmax.MinMaxDataElementDeletionHandler">
+		<property name="minMaxDataElementService"
+			ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.validation.ValidationRuleDeletionHandler"
+		class="org.hisp.dhis.validation.ValidationRuleDeletionHandler">
+		<property name="validationRuleService"
+			ref="org.hisp.dhis.validation.ValidationRuleService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.validation.ValidationRuleGroupDeletionHandler"
+		class="org.hisp.dhis.validation.ValidationRuleGroupDeletionHandler">
+		<property name="validationRuleService"
+			ref="org.hisp.dhis.validation.ValidationRuleService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.datavalue.DataValueDeletionHandler" 
+		class="org.hisp.dhis.datavalue.DataValueDeletionHandler">
+		<property name="jdbcTemplate" ref="jdbcTemplate" />
+	</bean>
+
+	<bean
+		id="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler"
+		class="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler">
+		<property name="organisationUnitGroupService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+	</bean>
+
+	<bean
+		id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler"
+		class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler">
+		<property name="organisationUnitGroupService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.datavalue.DataValueAuditDeletionHandler"
+		class="org.hisp.dhis.datavalue.DataValueAuditDeletionHandler">
+		<property name="dataValueAuditService"
+			ref="org.hisp.dhis.datavalue.DataValueAuditService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.user.UserDeletionHandler" class="org.hisp.dhis.user.UserDeletionHandler">
+		<property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.user.UserAuthorityGroupDeletionHandler"
+		class="org.hisp.dhis.user.UserAuthorityGroupDeletionHandler">
+		<property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.user.UserCredentialsDeletionHandler"
+		class="org.hisp.dhis.user.UserCredentialsDeletionHandler">
+		<property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+	</bean>
+
+	<bean id="org.hisp.dhis.user.UserSettingDeletionHandler" 
+		class="org.hisp.dhis.user.UserSettingDeletionHandler">
+		<property name="userSettingService" ref="org.hisp.dhis.user.UserSettingService" />
+	</bean>
+
+	<bean id="org.hisp.dhis.dataelement.DataElementCategoryDeletionHandler" 
+		class="org.hisp.dhis.dataelement.DataElementCategoryDeletionHandler">
+		<property name="categoryService" 
+			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+	</bean>
+	
+	<bean id="org.hisp.dhis.dataelement.DataElementGroupSetDeletionHandler"
+		class="org.hisp.dhis.dataelement.DataElementGroupSetDeletionHandler">
+		<property name="dataElementService" 
+			ref="org.hisp.dhis.dataelement.DataElementService" />
+	</bean>
+	
+	<!-- Security -->
+
+	<bean id="org.hisp.dhis.security.PasswordManager"
+		class="org.hisp.dhis.security.spring.SpringSecurityPasswordManager">
+		<property name="passwordEncoder" ref="passwordEncoder" />
+		<property name="usernameSaltSource" ref="usernameSaltSource" />
+	</bean>
+
+	<bean id="authenticationManager"
+		class="org.springframework.security.authentication.ProviderManager">
+		<property name="providers" ref="daoAuthenticationProvider" />
+		<property name="authenticationEventPublisher" ref="defaultAuthenticationEventPublisher" />
+	</bean>
+
+	<bean id="defaultAuthenticationEventPublisher"
+		class="org.springframework.security.authentication.DefaultAuthenticationEventPublisher" />
+
+	<bean id="daoAuthenticationProvider"
+		class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
+		<property name="userDetailsService" ref="userDetailsService" />
+		<property name="passwordEncoder" ref="passwordEncoder" />
+		<property name="saltSource" ref="usernameSaltSource" />
+	</bean>
+
+	<bean id="userDetailsService"
+		class="org.hisp.dhis.security.hibernate.HibernateUserDetailsService">
+		<property name="sessionFactory" ref="sessionFactory"/>
+	</bean>
+
+	<bean id="passwordEncoder"
+		class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" />
+
+	<bean id="usernameSaltSource" class="org.hisp.dhis.security.DefaultUsernameSaltSource" />
+
+	<!-- DeletionManager -->
+
+	<bean
+		class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+		<property name="targetObject" ref="deletionManager" />
+		<property name="targetMethod" value="addDeletionHandlers" />
+		<property name="arguments">
+			<list>
+				<list>
+					<ref 
+						local="org.hisp.dhis.datadictionary.DataDictionaryDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.dataelement.DataElementDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.dataelement.DataElementGroupDeletionHandler" />
+					<ref
+						local="org.hisp.dhis.dataelement.DataElementCategoryOptionDeletionHandler" />
+					<ref
+						local="org.hisp.dhis.dataelement.DataElementCategoryOptionComboDeletionHandler" />
+					<ref
+						local="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.dataset.DataSetDeletionHandler" />
+					<ref
+						local="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.dataset.SectionDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.dataentryform.DataEntryFormDeletionHandler" />
+					<ref
+						local="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.expression.ExpressionDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.indicator.IndicatorDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.indicator.IndicatorGroupDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.minmax.MinMaxDataElementDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.validation.ValidationRuleDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.validation.ValidationRuleGroupDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.datavalue.DataValueDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.datavalue.DataValueAuditDeletionHandler" />
+					<ref
+						local="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler" />
+					<ref
+						local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.user.UserDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.user.UserAuthorityGroupDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.user.UserCredentialsDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.user.UserSettingDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.dataelement.DataElementCategoryDeletionHandler" />
+					<ref 
+						local="org.hisp.dhis.dataelement.DataElementGroupSetDeletionHandler" />
+				</list>
+			</list>
+		</property>
+	</bean>
+
+	<!-- Min/Max validation -->
+
+	<bean id="org.hisp.dhis.minmax.validation.MinMaxValuesGenerationService"
+		class="org.hisp.dhis.minmax.validation.DefaultMinMaxValuesGenerationService">
+		<property name="dataAnalysisStore"
+			ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore" />
+	</bean>
+
+	<!-- AOP definitions -->
+
+	<aop:config>
+
+		<aop:aspect ref="deletionInterceptor">
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.datadictionary.DataDictionaryService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.dataelement.DataElementService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.dataelement.DataElementCategoryService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.dataset.DataSetService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.indicator.IndicatorService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.expression.ExpressionService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.minmax.MinMaxDataElementService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.validation.ValidationRuleService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.period.PeriodService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.organisationunit.OrganisationUnitService.delete*(..) )"
+				method="intercept" />
+			<aop:before
+				pointcut="execution( * org.hisp.dhis.organisationunit.OrganisationUnitGroupService.delete*(..) )"
+				method="intercept" />
+			<aop:before pointcut="execution( * org.hisp.dhis.user.UserStore.delete*(..) )"
+				method="intercept" />
+			<aop:before pointcut="execution( * org.hisp.dhis.concept.ConceptService.delete*(..) )"
+				method="intercept" />
+		</aop:aspect>
+
+		<aop:aspect ref="statementInterceptor">
+			<aop:around
+				pointcut="execution( * org.hisp.dhis.validation.ValidationRuleService.validate*(..) )"
+				method="intercept" />
+			<aop:around
+				pointcut="execution( * org.hisp.dhis.dataanalysis.DataAnalysisService.analyse(..) )"
+				method="intercept" />
+		</aop:aspect>
+
+		<!--
+			<aop:aspect ref="i18nTranslationInterceptor"> <aop:after-returning
+			pointcut="execution( *
+			org.hisp.dhis.dataelement.DataElementService.get*(..) )"
+			method="intercept" returning="object"/> <aop:after-returning
+			pointcut="execution( *
+			org.hisp.dhis.dataelement.DataElementCategoryService.get*(..) )"
+			method="intercept" returning="object"/> <aop:after-returning
+			pointcut="execution( *
+			org.hisp.dhis.indicator.IndicatorService.get*(..) )"
+			method="intercept" returning="object"/> <aop:after-returning
+			pointcut="execution( *
+			org.hisp.dhis.datadictionary.DataDictionaryService.get*(..) )"
+			method="intercept" returning="object"/> <aop:after-returning
+			pointcut="execution( * org.hisp.dhis.dataset.DataSetService.get*(..)
+			)" method="intercept" returning="object"/> <aop:after-returning
+			pointcut="execution( *
+			org.hisp.dhis.organisationunit.OrganisationUnitService.get*(..) )"
+			method="intercept" returning="object"/> <aop:after-returning
+			pointcut="execution( *
+			org.hisp.dhis.organisationunit.OrganisationUnitGroupService.get*(..)
+			)" method="intercept" returning="object"/> </aop:aspect>
+		-->
+
+	</aop:config>
 
 </beans>

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml	2010-10-22 06:52:16 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml	2010-12-22 04:05:46 +0000
@@ -49,5 +49,7 @@
 	
 	<property name="mobile"/>
 	
+	<property name="version"/>
+	
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2010-11-09 06:45:07 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2010-12-22 04:05:46 +0000
@@ -69,6 +69,10 @@
         
         updateDOBType();
         
+		updateDataSetMobileAttribute();
+		
+		updateDataSetVersionAttribute();
+		
         executeSql("UPDATE patientidentifiertype SET type='" + PatientIdentifierType.VALUE_TYPE_TEXT +"' WHERE type IS NULL");
         
         executeSql("UPDATE program SET minDaysAllowedInputData=0 WHERE minDaysAllowedInputData IS NULL");
@@ -131,6 +135,40 @@
             holder.close();
         }
     }
+	
+	private void updateDataSetMobileAttribute(){
+		StatementHolder holder = statementManager.getHolder();
+		
+		try
+        {
+            executeSql( "UPDATE dataset SET mobile = false WHERE mobile is null");
+        }
+        catch ( Exception ex )
+        {
+            log.error( ex );
+        }
+        finally
+        {
+            holder.close();
+        }
+	}
+	
+	private void updateDataSetVersionAttribute(){
+		StatementHolder holder = statementManager.getHolder();
+		
+		try
+        {
+            executeSql( "UPDATE dataset SET version = 1 WHERE version is null");
+        }
+        catch ( Exception ex )
+        {
+            log.error( ex );
+        }
+        finally
+        {
+            holder.close();
+        }
+	}
     
     private int executeSql( String sql )
     {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/DataSet.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/DataSet.java	2010-11-30 19:36:40 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/DataSet.java	2010-12-22 04:05:46 +0000
@@ -37,12 +37,28 @@
 
 public class DataSet
     extends Model
+    implements DataStreamSerializable, Comparable<DataSet>
 {
 
     private String periodType;
 
     private List<Section> sections;
 
+    private int version;
+
+    public DataSet()
+    {
+    }
+
+    public DataSet( DataSet dataSet )
+    {
+        this.setId( dataSet.getId() );
+        this.setName( dataSet.getName() );
+        this.periodType = dataSet.getPeriodType();
+        this.sections = dataSet.getSections();
+        this.version = dataSet.getVersion();
+    }
+
     public String getPeriodType()
     {
         return periodType;
@@ -53,8 +69,18 @@
         this.periodType = periodType;
     }
 
-    @XmlElementWrapper(name="sections")
-    @XmlElement(name="section")
+    public int getVersion()
+    {
+        return version;
+    }
+
+    public void setVersion( int version )
+    {
+        this.version = version;
+    }
+
+    @XmlElementWrapper( name = "sections" )
+    @XmlElement( name = "section" )
     public List<Section> getSections()
     {
         return sections;
@@ -71,6 +97,7 @@
     {
         dout.writeInt( this.getId() );
         dout.writeUTF( this.getName() );
+        dout.writeInt( this.getVersion() );
         dout.writeUTF( this.getPeriodType() );
 
         if ( this.sections == null )
@@ -92,7 +119,45 @@
         throws IOException
     {
         // FIXME: Get implementation from client
-
+        this.setId( dataInputStream.readInt() );
+        this.setName( dataInputStream.readUTF() );
+        this.setVersion( dataInputStream.readInt() );
+        this.setPeriodType( dataInputStream.readUTF() );
+
+        int sectionSize = dataInputStream.readInt();
+
+        for ( int i = 0; i < sectionSize; i++ )
+        {
+            Section section = new Section();
+            section.deSerialize( dataInputStream );
+            sections.add( section );
+        }
+
+    }
+
+    @Override
+    public boolean equals( Object obj )
+    {
+        if ( ((DataSet) obj).getId() == this.getId() )
+            return true;
+        return false;
+    }
+
+    @Override
+    public int compareTo( DataSet ds )
+    {
+        if ( this.getId() > ds.getId() )
+        {
+            return 1;
+        }
+        else if ( this.getId() < ds.getId() )
+        {
+            return -1;
+        }
+        else
+        {
+            return 0;
+        }
     }
 
 }

=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/DataSetList.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/DataSetList.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/DataSetList.java	2010-12-22 04:05:46 +0000
@@ -0,0 +1,153 @@
+package org.hisp.dhis.web.api.model;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DataSetList
+    extends Model implements DataStreamSerializable
+{
+    private List<DataSet> addedDataSets;
+
+    private List<DataSet> deletedDataSets;
+
+    private List<DataSet> modifiedDataSets;
+    
+    private List<DataSet> currentDataSets;
+
+    public DataSetList()
+    {
+    }
+
+    public List<DataSet> getAddedDataSets()
+    {
+        return addedDataSets;
+    }
+
+    public void setAddedDataSets( List<DataSet> addedDataSets )
+    {
+        this.addedDataSets = addedDataSets;
+    }
+
+    public List<DataSet> getDeletedDataSets()
+    {
+        return deletedDataSets;
+    }
+
+    public void setDeletedDataSets( List<DataSet> deletedDataSets )
+    {
+        this.deletedDataSets = deletedDataSets;
+    }
+
+    public List<DataSet> getModifiedDataSets()
+    {
+        return modifiedDataSets;
+    }
+
+    public void setModifiedDataSets( List<DataSet> modifiedDataSets )
+    {
+        this.modifiedDataSets = modifiedDataSets;
+    }
+
+    public List<DataSet> getCurrentDataSets()
+    {
+        return currentDataSets;
+    }
+
+    public void setCurrentDataSets( List<DataSet> currentDataSets )
+    {
+        this.currentDataSets = currentDataSets;
+    }
+
+    @Override
+    public void serialize( DataOutputStream dout )
+        throws IOException
+    {
+        if ( addedDataSets != null )
+        {
+            dout.writeInt( addedDataSets.size() );
+            for ( DataSet dataSet : addedDataSets )
+            {
+                dataSet.serialize( dout );
+            }
+        }else{
+            dout.writeInt( 0 );
+        }
+        if ( deletedDataSets != null )
+        {
+            dout.writeInt( deletedDataSets.size() );
+            for ( DataSet dataSet : deletedDataSets )
+            {
+                dataSet.serialize( dout );
+            }
+        }else{
+            dout.writeInt( 0 );
+        }
+        if ( modifiedDataSets != null )
+        {
+            dout.writeInt( modifiedDataSets.size() );
+            for ( DataSet dataSet : modifiedDataSets )
+            {
+                dataSet.serialize( dout );
+            }
+        }else{
+            dout.writeInt( 0 );
+        }
+        if ( currentDataSets != null )
+        {
+            dout.writeInt( currentDataSets.size() );
+            for ( DataSet dataSet : currentDataSets )
+            {
+                dataSet.serialize( dout );
+            }
+        }else{
+            dout.writeInt( 0 );
+        }
+    }
+    
+    @Override
+    public void deSerialize( DataInputStream dataInputStream )
+        throws IOException
+    {
+        int temp = 0;
+        temp = dataInputStream.readInt();
+        if(temp > 0){
+            addedDataSets = new ArrayList<DataSet>();
+            for(int i = 0; i < temp; i++){
+                DataSet dataSet = new DataSet();
+                dataSet.deSerialize( dataInputStream );
+                addedDataSets.add( dataSet );
+            }
+        }
+        temp = dataInputStream.readInt();
+        if(temp > 0){
+            deletedDataSets = new ArrayList<DataSet>();
+            for(int i = 0; i < temp; i++){
+                DataSet dataSet = new DataSet();
+                dataSet.deSerialize( dataInputStream );
+                deletedDataSets.add( dataSet );
+            }
+        }
+        temp = dataInputStream.readInt();
+        if(temp > 0){
+            modifiedDataSets = new ArrayList<DataSet>();
+            for(int i = 0; i < temp; i++){
+                DataSet dataSet = new DataSet();
+                dataSet.deSerialize( dataInputStream );
+                modifiedDataSets.add( dataSet );
+            }
+        }
+        temp = dataInputStream.readInt();
+        if(temp > 0){
+            currentDataSets = new ArrayList<DataSet>();
+            for(int i = 0; i < temp; i++){
+                DataSet dataSet = new DataSet();
+                dataSet.deSerialize( dataInputStream );
+                currentDataSets.add( dataSet );
+            }
+        }
+    }
+
+}

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/OrgUnit.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/OrgUnit.java	2010-12-04 00:17:59 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/OrgUnit.java	2010-12-22 04:05:46 +0000
@@ -47,6 +47,8 @@
     private String uploadFacilityReportUrl;
 
     private String uploadActivityReportUrl;
+    
+    private String updateDataSetUrl;
 
     @XmlAttribute
     public int getId()
@@ -108,6 +110,16 @@
     public void setUploadActivityReportUrl( String uploadActivityReportUrl )
     {
         this.uploadActivityReportUrl = uploadActivityReportUrl;
+    }    
+
+    public String getUpdateDataSetUrl()
+    {
+        return updateDataSetUrl;
+    }
+
+    public void setUpdateDataSetUrl( String updateDataSetUrl )
+    {
+        this.updateDataSetUrl = updateDataSetUrl;
     }
 
     public void serialize( DataOutputStream dataOutputStream )
@@ -119,6 +131,7 @@
         dataOutputStream.writeUTF( this.downloadActivityPlanUrl );
         dataOutputStream.writeUTF( this.uploadFacilityReportUrl );
         dataOutputStream.writeUTF( this.uploadActivityReportUrl );
+        dataOutputStream.writeUTF( this.updateDataSetUrl );
     }
 
     public void deSerialize( DataInputStream dataInputStream )
@@ -130,5 +143,6 @@
         this.downloadActivityPlanUrl = dataInputStream.readUTF();
         this.uploadFacilityReportUrl = dataInputStream.readUTF();
         this.uploadActivityReportUrl = dataInputStream.readUTF();
+        this.updateDataSetUrl = dataInputStream.readUTF();
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/MobileResource.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/MobileResource.java	2010-12-08 05:45:56 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/MobileResource.java	2010-12-22 04:05:46 +0000
@@ -118,7 +118,8 @@
             .build( unit.getId() ).toString() );
         orgUnit.setUploadActivityReportUrl( uriInfo.getBaseUriBuilder().path( "/orgUnits/{id}" ).path( "activities" )
             .build( unit.getId() ).toString() );
-
+        orgUnit.setUpdateDataSetUrl( uriInfo.getBaseUriBuilder().path( "/orgUnits/{id}" ).path( "updateDataSets" )
+            .build( unit.getId() ).toString()  );
         return orgUnit;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java	2010-12-08 05:45:56 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java	2010-12-22 04:05:46 +0000
@@ -1,5 +1,9 @@
 package org.hisp.dhis.web.api.resources;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
 import javax.ws.rs.HeaderParam;
@@ -13,6 +17,8 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.web.api.model.ActivityPlan;
 import org.hisp.dhis.web.api.model.ActivityValue;
+import org.hisp.dhis.web.api.model.DataSet;
+import org.hisp.dhis.web.api.model.DataSetList;
 import org.hisp.dhis.web.api.model.DataSetValue;
 import org.hisp.dhis.web.api.model.MobileModel;
 import org.hisp.dhis.web.api.service.ActivityReportingService;
@@ -45,7 +51,10 @@
         this.unit = unit;
     }
 
-    /** Get activity plan, program forms and facility forms wrapped in a {@link MobileModel}
+    /**
+     * Get activity plan, program forms and facility forms wrapped in a
+     * {@link MobileModel}
+     * 
      * @param locale - localize for the given locale
      */
     @GET
@@ -64,8 +73,71 @@
         return mobileModel;
     }
 
+    @POST
+    @Path( "updateDataSets" )
+    public DataSetList checkUpdatedDataSet( DataSetList dataSetList, @HeaderParam( "accept-language" ) String locale )
+    {
+        if ( DEBUG )
+            log.debug( "Checking updated datasets for org unit " + unit.getName() );
+        DataSetList updatedDataSetList = new DataSetList();
+        List<DataSet> dataSets = facilityReportingService.getMobileDataSetsForUnit( unit, locale );
+        List<DataSet> currentDataSets = dataSetList.getCurrentDataSets();
+//        List<DataSet> copyCurrentDataSets = new ArrayList<DataSet>(currentDataSets.size());
+//        Collections.copy( copyCurrentDataSets, currentDataSets );
+        // check added dataset
+        for ( DataSet dataSet : dataSets )
+        {
+            if ( !currentDataSets.contains( dataSet ) )
+            {
+                if(updatedDataSetList.getAddedDataSets() == null)
+                    updatedDataSetList.setAddedDataSets( new ArrayList<DataSet>() );
+                updatedDataSetList.getAddedDataSets().add( dataSet );
+                currentDataSets.add( dataSet );
+            }
+        }
+        
+        // check deleted dataset
+        for ( DataSet dataSet : currentDataSets )
+        {
+            if ( !dataSets.contains( dataSet ) )
+            {
+                if(updatedDataSetList.getDeletedDataSets() == null)
+                    updatedDataSetList.setDeletedDataSets( new ArrayList<DataSet>() );
+                updatedDataSetList.getDeletedDataSets().add(  new DataSet( dataSet )  );
+            }
+        }
+        if(updatedDataSetList.getDeletedDataSets() != null){
+            for (DataSet dataSet : updatedDataSetList.getDeletedDataSets()){
+                currentDataSets.remove( dataSet );
+            }
+        }    
+        
+        // check modified dataset        
+        Collections.sort( dataSets );
+        Collections.sort( currentDataSets );
+        
+        for ( int i = 0; i < dataSets.size(); i++ )
+        {
+            if ( dataSets.get( i ).getVersion() != currentDataSets.get( i ).getVersion() )
+            {
+                if(updatedDataSetList.getModifiedDataSets() == null)
+                    updatedDataSetList.setModifiedDataSets( new ArrayList<DataSet>() );
+                updatedDataSetList.getModifiedDataSets().add( dataSets.get( i ) );
+            }
+        }
+        return getUpdatedDataSet( updatedDataSetList );
+    }
+
+    @GET
+    public DataSetList getUpdatedDataSet( DataSetList dataSetList )
+    {
+        if ( DEBUG )
+            log.debug( "Returning updated datasets for org unit " + unit.getName() );
+        return dataSetList;
+    }
+
     /**
-     * Get a localized representation of the current activity plan 
+     * Get a localized representation of the current activity plan
      */
     @GET
     @Path( "activitiyplan" )
@@ -75,25 +147,30 @@
     }
 
     /**
-     * Save a facility report for unit 
+     * Save a facility report for unit
+     * 
      * @param dataSetValue - the report to save
      * @throws NotAllowedException if the {@link DataSetValue} is invalid
      */
     @POST
     @Path( "dataSets" )
-    public void saveDataSetValues( DataSetValue dataSetValue ) throws NotAllowedException
+    public void saveDataSetValues( DataSetValue dataSetValue )
+        throws NotAllowedException
     {
         facilityReportingService.saveDataSetValues( unit, dataSetValue );
     }
 
     /**
      * Save activity report for unit
+     * 
      * @param activityValue - the report to save
-     * @throws NotAllowedException if the {@link ActivityValue activity value} is invalid
+     * @throws NotAllowedException if the {@link ActivityValue activity value}
+     *         is invalid
      */
     @POST
     @Path( "activities" )
-    public void saveActivityReport( ActivityValue activityValue ) throws NotAllowedException
+    public void saveActivityReport( ActivityValue activityValue )
+        throws NotAllowedException
     {
         activityReportingService.saveActivityReport( unit, activityValue );
     }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/FacilityReportingServiceImpl.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/FacilityReportingServiceImpl.java	2010-12-06 06:19:53 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/FacilityReportingServiceImpl.java	2010-12-22 04:05:46 +0000
@@ -133,7 +133,6 @@
         DataSet ds = new DataSet();
 
         ds.setId( dataSet.getId() );
-
         // Name defaults to short name with fallback to name if empty
         String name = dataSet.getShortName();
         if (name == null || name.trim().isEmpty()) {
@@ -141,7 +140,7 @@
         }
         
         ds.setName( name );
-//        ds.setVersionDataSet( dataSet.getVersionDataSet() );
+        ds.setVersion( dataSet.getVersion() );
         ds.setPeriodType( dataSet.getPeriodType().getName() );
 
         List<Section> sectionList = new ArrayList<Section>();

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java	2010-09-04 07:26:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java	2010-12-22 04:05:46 +0000
@@ -28,11 +28,14 @@
  */
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 
 import org.hisp.dhis.concept.ConceptService;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 
 import com.opensymphony.xwork2.Action;
 
@@ -61,6 +64,12 @@
         this.conceptService = conceptService;
     }
 
+    private DataSetService dataSetService;
+    
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    } 
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -117,6 +126,11 @@
 
         dataElementCategoryService.updateDataElementCategory( dataElementCategory );
 
+        Collection<DataSet> dataSets = dataSetService.getMobileDataSetsFromCategory(dataElementCategory.getId());
+        for(DataSet dataSet : dataSets){
+            dataSet.setVersion( dataSet.getVersion() + 1 );
+            dataSetService.updateDataSet( dataSet );
+        }
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryOptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryOptionAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryOptionAction.java	2010-12-22 04:05:46 +0000
@@ -27,8 +27,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Collection;
+
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 
 import com.opensymphony.xwork2.Action;
 
@@ -48,11 +52,18 @@
     public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
     {
         this.dataElementCategoryService = dataElementCategoryService;
-    }
+    }  
+    
+    private DataSetService dataSetService;
+    
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }    
 
     // -------------------------------------------------------------------------
     // Input
-    // -------------------------------------------------------------------------
+    // -------------------------------------------------------------------------    
 
     private Integer id;
 
@@ -77,9 +88,13 @@
         DataElementCategoryOption categoryOption = dataElementCategoryService
             .getDataElementCategoryOption( id );
         categoryOption.setName( name );
-        
         dataElementCategoryService.updateDataElementCategoryOption( categoryOption );
 
+        Collection<DataSet> dataSets = dataSetService.getMobileDataSetsFromCategoryOption(id);
+        for(DataSet dataSet : dataSets){
+            dataSet.setVersion( dataSet.getVersion() + 1 );
+            dataSetService.updateDataSet( dataSet );
+        }
         return SUCCESS;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/RemoveDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/RemoveDataElementAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/RemoveDataElementAction.java	2010-12-22 04:05:46 +0000
@@ -27,8 +27,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Set;
+
 import org.hisp.dhis.common.DeleteNotAllowedException;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.i18n.I18n;
 
 import com.opensymphony.xwork2.Action;
@@ -57,7 +62,14 @@
     {
         this.i18n = i18n;
     }
-    
+
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -79,7 +91,7 @@
     {
         return message;
     }
-    
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -89,6 +101,15 @@
     {
         try
         {
+            DataElement dataElement = dataElementService.getDataElement( id );
+            Set<DataSet> dataSets = dataElement.getDataSets();
+            for(DataSet dataSet : dataSets){
+                if(dataSet.getMobile() != null && dataSet.getMobile()){
+                    dataSet.setVersion( dataSet.getVersion() + 1 );
+                    dataSetService.updateDataSet( dataSet );
+                }                
+            }
+            
             dataElementService.deleteDataElement( dataElementService.getDataElement( id ) );
         }
         catch ( DeleteNotAllowedException ex )
@@ -101,6 +122,7 @@
             }
         }
         
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2010-12-22 04:05:46 +0000
@@ -38,6 +38,8 @@
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.expression.Expression;
 import org.hisp.dhis.system.util.ConversionUtils;
 
@@ -70,6 +72,13 @@
         this.dataElementCategoryService = dataElementCategoryService;
     }
 
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -230,7 +239,7 @@
         // ---------------------------------------------------------------------
 
         DataElement dataElement = dataElementService.getDataElement( id );
-        
+
         DataElementCategoryCombo categoryCombo = dataElementCategoryService
             .getDataElementCategoryCombo( selectedCategoryComboId );
 
@@ -303,6 +312,16 @@
             dataElement.getGroupSets().add( dataElementService.getDataElementGroupSet( Integer.parseInt( id ) ) );
         }
 
+        Set<DataSet> dataSets = dataElement.getDataSets();
+        for ( DataSet dataSet : dataSets )
+        {
+            if ( dataSet.getMobile() != null && dataSet.getMobile())
+            {
+                dataSet.setVersion( dataSet.getVersion() + 1 );
+                dataSetService.updateDataSet( dataSet );
+            }
+        }
+
         dataElementService.updateDataElement( dataElement );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml	2010-12-09 05:53:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml	2010-12-22 04:05:46 +0000
@@ -75,6 +75,9 @@
 		<property name="dataElementService">
 			<ref bean="org.hisp.dhis.dataelement.DataElementService" />
 		</property>
+		<property name="dataSetService">
+			<ref bean="org.hisp.dhis.dataset.DataSetService" />
+		</property>
 	</bean>
 
 	<bean id="org.hisp.dhis.dd.action.dataelement.AddDataElementAction"
@@ -97,6 +100,9 @@
 		<property name="dataElementCategoryService">
 			<ref bean="org.hisp.dhis.dataelement.DataElementCategoryService" />
 		</property>
+		<property name="dataSetService">
+			<ref bean="org.hisp.dhis.dataset.DataSetService" />
+		</property>
 	</bean>
 
 	<bean
@@ -757,6 +763,9 @@
 		<property name="conceptService">
 			<ref bean="org.hisp.dhis.concept.ConceptService" />
 		</property>
+		<property name="dataSetService">
+			<ref bean="org.hisp.dhis.dataset.DataSetService" />
+		</property>
 	</bean>
 
 	<bean id="org.hisp.dhis.dd.action.category.GetDataElementCategoryAction"
@@ -786,6 +795,9 @@
 		<property name="dataElementCategoryService">
 			<ref bean="org.hisp.dhis.dataelement.DataElementCategoryService" />
 		</property>
+		<property name="dataSetService">
+			<ref bean="org.hisp.dhis.dataset.DataSetService" />
+		</property>
 	</bean>
 	
 	<!-- CategoryCombo -->

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/AddDataSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/AddDataSetAction.java	2010-12-16 04:49:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/AddDataSetAction.java	2010-12-22 04:05:46 +0000
@@ -163,6 +163,7 @@
 
         dataSet.setMobile( mobile );
 
+        dataSet.setVersion( 1 );
         for ( String id : selectedList )
         {
             DataElement dataElement = dataElementService.getDataElement( Integer.parseInt( id ) );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UpdateDataSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UpdateDataSetAction.java	2010-09-24 11:12:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UpdateDataSetAction.java	2010-12-22 04:05:46 +0000
@@ -52,21 +52,21 @@
     {
         this.name = name;
     }
-    
+
     private String shortName;
 
     public void setShortName( String shortName )
     {
         this.shortName = shortName;
     }
-    
+
     private String code;
 
     public void setCode( String code )
     {
         this.code = code;
-    }    
-    
+    }
+
     private String frequencySelect;
 
     public void setFrequencySelect( String frequencySelect )
@@ -87,13 +87,13 @@
     {
         this.selectedList = selectedList;
     }
-    
+
     private boolean mobile;
-    
-    public void setMobile(boolean mobile) 
+
+    public void setMobile( boolean mobile )
     {
-		this.mobile = mobile;
-	}
+        this.mobile = mobile;
+    }
 
     // -------------------------------------------------------------------------
     // Dependencies
@@ -127,7 +127,7 @@
     public String execute()
         throws Exception
     {
-    	// ---------------------------------------------------------------------
+        // ---------------------------------------------------------------------
         // Prepare values
         // ---------------------------------------------------------------------
 
@@ -140,7 +140,7 @@
         {
             code = null;
         }
-    	
+
         Collection<DataElement> dataElements = new HashSet<DataElement>();
 
         for ( String id : selectedList )
@@ -149,7 +149,7 @@
         }
 
         PeriodType periodType = periodService.getPeriodTypeByName( frequencySelect );
-        
+
         DataSet dataSet = dataSetService.getDataSet( dataSetId );
 
         dataSet.setName( name );
@@ -158,7 +158,10 @@
         dataSet.setPeriodType( periodService.getPeriodTypeByClass( periodType.getClass() ) );
         dataSet.setDataElements( dataElements );
         dataSet.setMobile( mobile );
-
+        if ( dataSet.getMobile() != null && dataSet.getMobile() )
+        {
+            dataSet.setVersion( dataSet.getVersion() + 1 );
+        }
         dataSetService.updateDataSet( dataSet );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/AddSectionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/AddSectionAction.java	2010-11-29 16:21:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/AddSectionAction.java	2010-12-22 04:05:46 +0000
@@ -122,6 +122,11 @@
         section.setDataElements( selectedDataElements );
         sectionService.addSection( section );
 
+        if ( dataSet.getMobile() != null && dataSet.getMobile() )
+        {
+            dataSet.setVersion( dataSet.getVersion() + 1 );
+            dataSetService.updateDataSet( dataSet );
+        }
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/EditSectionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/EditSectionAction.java	2010-11-29 16:21:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/EditSectionAction.java	2010-12-22 04:05:46 +0000
@@ -40,6 +40,7 @@
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 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.options.displayproperty.DisplayPropertyHandler;
@@ -204,7 +205,7 @@
         Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
 
         displayPropertyHandler.handle( dataElementOfDataSet );
-
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/RemoveSectionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/RemoveSectionAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/RemoveSectionAction.java	2010-12-22 04:05:46 +0000
@@ -27,6 +27,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dataset.SectionService;
 
@@ -45,6 +47,13 @@
     {
         this.sectionService = sectionService;
     }
+    
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
 
     // -------------------------------------------------------------------------
     // Input & output
@@ -66,6 +75,13 @@
     {
         Section section = sectionService.getSection( id );
         
+        DataSet dataSet = section.getDataSet();
+        
+        if(dataSet.getMobile() != null && dataSet.getMobile()){
+            dataSet.setVersion( dataSet.getVersion() + 1 );
+            dataSetService.updateDataSet( dataSet );
+        }
+        
         sectionService.deleteSection( section );
         
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionSortOrderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionSortOrderAction.java	2010-11-29 16:43:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionSortOrderAction.java	2010-12-22 04:05:46 +0000
@@ -29,6 +29,8 @@
 
 import java.util.List;
 
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dataset.SectionService;
 
@@ -54,6 +56,13 @@
     {
         this.sections = sections;
     }
+    
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
 
     @Override
     public String execute()
@@ -61,6 +70,8 @@
     {
         int sortOrder = 1;
         
+        DataSet dataSet = null;
+        
         for ( String id : sections )
         {
             Section section = sectionService.getSection( Integer.parseInt( id ) );
@@ -68,7 +79,15 @@
             section.setSortOrder( sortOrder++ );
             
             sectionService.updateSection( section );
-        }
+            
+            if(dataSet == null)
+                dataSet = section.getDataSet();
+        }
+        if(dataSet.getMobile() != null && dataSet.getMobile()){
+            dataSet.setVersion( dataSet.getVersion() + 1 );
+            dataSetService.updateDataSet( dataSet );
+        }
+        dataSet = null;
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/UpdateSectionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/UpdateSectionAction.java	2010-08-25 09:31:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/UpdateSectionAction.java	2010-12-22 04:05:46 +0000
@@ -32,6 +32,8 @@
 
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dataset.SectionService;
 
@@ -58,6 +60,12 @@
         this.dataElementService = dataElementService;
     }
 
+    private DataSetService dataSetService;
+    
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
     // -------------------------------------------------------------------------
     // Input & output
     // -------------------------------------------------------------------------
@@ -110,6 +118,12 @@
 
         sectionService.updateSection( section );
 
+        DataSet dataSet = section.getDataSet();
+        if(dataSet.getMobile() != null && dataSet.getMobile()){
+            dataSet.setVersion( dataSet.getVersion() + 1 );
+            dataSetService.updateDataSet( dataSet );
+        }
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml	2010-11-30 06:49:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml	2010-12-22 04:05:46 +0000
@@ -85,6 +85,9 @@
 		<property name="dataElementService">
 			<ref bean="org.hisp.dhis.dataelement.DataElementService"/>
 		</property>
+		<property name="dataSetService">
+			<ref bean="org.hisp.dhis.dataset.DataSetService"/>
+		</property>		
 	</bean>
 	
 	<bean id="org.hisp.dhis.dataset.action.section.RemoveSectionAction"
@@ -93,6 +96,9 @@
 		<property name="sectionService">
 			<ref bean="org.hisp.dhis.dataset.SectionService"/>
 		</property>
+		<property name="dataSetService">
+			<ref bean="org.hisp.dhis.dataset.DataSetService"/>
+		</property>
 	</bean>
 	
 	<bean id="org.hisp.dhis.dataset.action.section.SectionListAction"
@@ -136,6 +142,9 @@
 		<property name="sectionService">
 			<ref bean="org.hisp.dhis.dataset.SectionService"/>
 		</property>
+		<property name="dataSetService">
+			<ref bean="org.hisp.dhis.dataset.DataSetService"/>
+		</property>
 	</bean>
 	
 	<bean id="org.hisp.dhis.dataset.action.section.GetSectionListSortOrderAction"