← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13351: Introduced assocation between data set and category combo. The purpose is to link attribute type ...

 

------------------------------------------------------------
revno: 13351
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-12-20 15:53:40 +0100
message:
  Introduced assocation between data set and category combo. The purpose is to link attribute type categories to all data values coming from a form. Useful for capture of attributes/information which applies to the form, like an implementing partner organisation or a project.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateCategoryComboStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
  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/EditDataSetFormAction.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/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2013-12-10 19:08:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2013-12-20 14:53:40 +0000
@@ -46,6 +46,7 @@
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.common.view.WithoutOrganisationUnitsView;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.dataentryform.DataEntryForm;
 import org.hisp.dhis.indicator.Indicator;
@@ -119,6 +120,11 @@
      * The Sections associated with the DataSet.
      */
     private Set<Section> sections = new HashSet<Section>();
+    
+    /**
+     * The CategoryCombo used for data attributes.
+     */
+    private DataElementCategoryCombo categoryCombo;
 
     /**
      * Indicating position in the custom sort order.
@@ -578,6 +584,20 @@
     }
 
     @JsonProperty
+    @JsonSerialize( as = BaseIdentifiableObject.class )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    public DataElementCategoryCombo getCategoryCombo()
+    {
+        return categoryCombo;
+    }
+
+    public void setCategoryCombo( DataElementCategoryCombo categoryCombo )
+    {
+        this.categoryCombo = categoryCombo;
+    }
+
+    @JsonProperty
     @JsonView({ DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class })
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isMobile()

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateCategoryComboStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateCategoryComboStore.java	2013-12-20 12:15:39 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateCategoryComboStore.java	2013-12-20 14:53:40 +0000
@@ -45,6 +45,8 @@
     @SuppressWarnings("unchecked")
     public Collection<DataElementCategoryCombo> getCategoryCombosByDimensionType( String dimensionType )
     {
-        return getCriteria( Restrictions.eq( "dimensionType", dimensionType ) ).list();
+        return getCriteria( Restrictions.or( 
+            Restrictions.eq( "dimensionType", dimensionType ),
+            Restrictions.eq( "name", "default" ) ) ).list();
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2013-12-20 12:55:20 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2013-12-20 14:53:40 +0000
@@ -79,6 +79,8 @@
     @Transactional
     public void execute()
     {
+        int defaultCategoryComboId = getDefaultCategoryCombo();
+        
         // ---------------------------------------------------------------------
         // Drop outdated tables
         // ---------------------------------------------------------------------
@@ -656,7 +658,8 @@
 	
 	executeSql( "update categorycombo set dimensiontype = '" + DataElementCategoryCombo.DIMENSION_TYPE_DISAGGREGATION + "' where dimensiontype is null" );
         executeSql( "update dataelementcategory set dimensiontype = '" + DataElementCategoryCombo.DIMENSION_TYPE_DISAGGREGATION + "' where dimensiontype is null" );
-	
+	executeSql( "update dataset set categorycomboid = " + defaultCategoryComboId + " where categorycomboid is null" );
+        
 	upgradeDataValuesWithAttributeOptionCombo();
         upgradeMapViewsToAnalyticalObject();
 
@@ -1075,6 +1078,13 @@
         return statementManager.getHolder().queryForInteger( sql );
     }
     
+    private int getDefaultCategoryCombo()
+    {
+        String sql = "select categorycomboid from categorycombo where name = 'default'";
+        
+        return statementManager.getHolder().queryForInteger( sql );
+    }
+    
     private boolean updateDataSetAssociation()
     {
         StatementHolder holder = statementManager.getHolder();

=== 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	2013-11-28 20:52:27 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml	2013-12-20 14:53:40 +0000
@@ -61,6 +61,10 @@
       <one-to-many class="org.hisp.dhis.dataset.Section" />
     </set>
 
+    <many-to-one name="categoryCombo" class="org.hisp.dhis.dataelement.DataElementCategoryCombo"
+      column="categorycomboid"
+      foreign-key="fk_dataset_categorycomboid" />
+
     <property name="sortOrder" />
 
     <many-to-one name="dataEntryForm" class="org.hisp.dhis.dataentryform.DataEntryForm"

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js	2013-11-04 13:21:35 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js	2013-12-20 14:53:40 +0000
@@ -137,7 +137,7 @@
     "dataEntry" : {
         "name" : {
             "required" : true,
-            "rangelength" : [ 4, 100 ]
+            "rangelength" : [ 2, 100 ]
         }
     },
     "section" : {
@@ -153,7 +153,7 @@
         "name" : {
             "required" : true,
             "alphanumericwithbasicpuncspaces" : true,
-            "rangelength" : [ 4, 150 ]
+            "rangelength" : [ 2, 150 ]
         },
         "shortName" : {
             "required" : true,
@@ -211,7 +211,7 @@
     "dataElement" : {
         "name" : {
             "required" : true,
-            "rangelength" : [ 3, 150 ],
+            "rangelength" : [ 2, 150 ],
             "alphanumericwithbasicpuncspaces" : true,
             "notOnlyDigits" : true
         },
@@ -222,7 +222,7 @@
             "notOnlyDigits" : true
         },
         "alternativeName" : {
-            "rangelength" : [ 3, 150 ],
+            "rangelength" : [ 2, 150 ],
             "alphanumericwithbasicpuncspaces" : true,
             "notOnlyDigits" : true
         },
@@ -306,7 +306,7 @@
     "indicator" : {
         "name" : {
             "required" : true,
-            "rangelength" : [ 3, 150 ],
+            "rangelength" : [ 2, 150 ],
             "alphanumericwithbasicpuncspaces" : true,
             "nostartwhitespace" : true
         },
@@ -316,7 +316,7 @@
             "alphanumericwithbasicpuncspaces" : true
         },
         "alternativeName" : {
-            "rangelength" : [ 3, 150 ],
+            "rangelength" : [ 2, 150 ],
             "alphanumericwithbasicpuncspaces" : true
         },
         "code" : {
@@ -355,7 +355,7 @@
     "indicatorType" : {
         "name" : {
             "required" : true,
-            "rangelength" : [ 3, 150 ],
+            "rangelength" : [ 2, 150 ],
             "alphanumericwithbasicpuncspaces" : true
         },
         "factor" : {
@@ -434,27 +434,6 @@
             "required" : true
         }
     },
-    "chartGroup" : {
-        "name" : {
-            "required" : true,
-            "rangelength" : [ 3, 230 ],
-            "alphanumericwithbasicpuncspaces" : true
-        }
-    },
-    "reportGroup" : {
-        "name" : {
-            "required" : true,
-            "rangelength" : [ 3, 230 ],
-            "alphanumericwithbasicpuncspaces" : true
-        }
-    },
-    "reportTableGroup" : {
-        "name" : {
-            "required" : true,
-            "rangelength" : [ 3, 230 ],
-            "alphanumericwithbasicpuncspaces" : true
-        }
-    },
     "attribute" : {
         "name" : {
             "required" : true,

=== 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	2013-11-28 20:52:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/AddDataSetAction.java	2013-12-20 14:53:40 +0000
@@ -29,6 +29,8 @@
  */
 
 import com.opensymphony.xwork2.Action;
+
+import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
@@ -77,6 +79,13 @@
     {
         this.indicatorService = indicatorService;
     }
+    
+    private DataElementCategoryService categoryService;
+
+    public void setCategoryService( DataElementCategoryService categoryService )
+    {
+        this.categoryService = categoryService;
+    }
 
     private UserService userService;
 
@@ -236,6 +245,13 @@
         this.indicatorsSelectedList = indicatorsSelectedList;
     }
 
+    private Integer categoryComboId;
+    
+    public void setCategoryComboId( Integer categoryComboId )
+    {
+        this.categoryComboId = categoryComboId;
+    }
+
     private Integer selectedLegendSetId;
 
     public void setSelectedLegendSetId( Integer selectedLegendSetId )
@@ -280,6 +296,11 @@
             indicators.add( indicatorService.getIndicator( Integer.parseInt( id ) ) );
         }
 
+        if ( categoryComboId != null )
+        {
+            dataSet.setCategoryCombo( categoryService.getDataElementCategoryCombo( categoryComboId ) );
+        }
+        
         dataSet.setDescription( description );
         dataSet.setVersion( 1 );
         dataSet.setMobile( false );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/EditDataSetFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/EditDataSetFormAction.java	2013-11-28 20:52:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/EditDataSetFormAction.java	2013-12-20 14:53:40 +0000
@@ -34,6 +34,8 @@
 
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.indicator.Indicator;
@@ -45,7 +47,6 @@
 import org.hisp.dhis.user.UserGroupService;
 
 import com.opensymphony.xwork2.Action;
-import org.springframework.beans.factory.annotation.Autowired;
 
 /**
  * @author mortenoh
@@ -78,9 +79,15 @@
         this.userGroupService = userGroupService;
     }
 
+    private DataElementCategoryService categoryService;
+
+    public void setCategoryService( DataElementCategoryService categoryService )
+    {
+        this.categoryService = categoryService;
+    }
+
     private MappingService mappingService;
 
-    @Autowired
     public void setMappingService( MappingService mappingService )
     {
         this.mappingService = mappingService;
@@ -132,6 +139,13 @@
         return indicators;
     }
 
+    private List<DataElementCategoryCombo> categoryCombos = new ArrayList<DataElementCategoryCombo>();
+    
+    public List<DataElementCategoryCombo> getCategoryCombos()
+    {
+        return categoryCombos;
+    }
+
     private List<MapLegendSet> legendSets;
 
     public List<MapLegendSet> getLegendSets()
@@ -148,8 +162,9 @@
     {
         periodTypes = periodService.getAllPeriodTypes();
         userGroups = new ArrayList<UserGroup>( userGroupService.getAllUserGroups() );
+        categoryCombos = new ArrayList<DataElementCategoryCombo>( categoryService.getAttributeCategoryCombos() );
         legendSets = new ArrayList<MapLegendSet>( mappingService.getAllMapLegendSets() );
-
+        
         if ( dataSetId != null )
         {
             dataSet = dataSetService.getDataSet( dataSetId, true, true, false );

=== 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	2013-11-28 20:52:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UpdateDataSetAction.java	2013-12-20 14:53:40 +0000
@@ -30,6 +30,7 @@
 
 import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
@@ -89,6 +90,13 @@
         this.indicatorService = indicatorService;
     }
 
+    private DataElementCategoryService categoryService;
+
+    public void setCategoryService( DataElementCategoryService categoryService )
+    {
+        this.categoryService = categoryService;
+    }
+
     private SectionService sectionService;
 
     public void setSectionService( SectionService sectionService )
@@ -254,6 +262,13 @@
         this.indicatorsSelectedList = indicatorsSelectedList;
     }
 
+    private Integer categoryComboId;
+    
+    public void setCategoryComboId( Integer categoryComboId )
+    {
+        this.categoryComboId = categoryComboId;
+    }
+
     private Integer selectedLegendSetId;
 
     public void setSelectedLegendSetId( Integer selectedLegendSetId )
@@ -300,7 +315,7 @@
         dataSet.setTimelyDays( timelyDays );
         dataSet.setSkipAggregation( skipAggregation );
 
-        if ( !(equalsNullSafe( name, dataSet.getName() ) &&
+        if ( !( equalsNullSafe( name, dataSet.getName() ) &&
             periodType.equals( dataSet.getPeriodType() ) &&
             dataElements.equals( dataSet.getDataElements() ) &&
             indicators.equals( dataSet.getIndicators() ) &&
@@ -327,6 +342,11 @@
         dataSet.setNotificationRecipients( userGroupService.getUserGroup( notificationRecipients ) );
         dataSet.setLegendSet( legendSet );
 
+        if ( categoryComboId != null )
+        {
+            dataSet.setCategoryCombo( categoryService.getDataElementCategoryCombo( categoryComboId ) );
+        }
+        
         dataSetService.updateDataSet( dataSet );
 
         // ---------------------------------------------------------------------

=== 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	2013-11-28 20:52:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml	2013-12-20 14:53:40 +0000
@@ -91,15 +91,11 @@
     <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
   </bean>
 	
-	<!-- Validation -->
-
   <bean id="org.hisp.dhis.dataset.action.ValidateDataSetAction" class="org.hisp.dhis.dataset.action.ValidateDataSetAction"
     scope="prototype">
     <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
   </bean>
-	
-	<!-- Overview -->
-
+  
   <bean id="org.hisp.dhis.dataset.action.DataSetListAction" class="org.hisp.dhis.dataset.action.DataSetListAction"
     scope="prototype">
     <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
@@ -115,6 +111,8 @@
     <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
     <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
     <property name="userGroupService" ref="org.hisp.dhis.user.UserGroupService" />
+    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+    <property name="mappingService" ref="org.hisp.dhis.mapping.MappingService" />
   </bean>
 
   <bean id="org.hisp.dhis.dataset.action.AddDataSetAction" class="org.hisp.dhis.dataset.action.AddDataSetAction"
@@ -122,6 +120,7 @@
     <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
     <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
     <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
     <property name="userService" ref="org.hisp.dhis.user.UserService" />
     <property name="userGroupService" ref="org.hisp.dhis.user.UserGroupService" />
     <property name="mappingService" ref="org.hisp.dhis.mapping.MappingService" />
@@ -134,6 +133,7 @@
     <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
     <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
     <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
     <property name="userGroupService" ref="org.hisp.dhis.user.UserGroupService" />
     <property name="mappingService" ref="org.hisp.dhis.mapping.MappingService" />
   </bean>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties	2013-12-17 20:08:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties	2013-12-20 14:53:40 +0000
@@ -8,10 +8,9 @@
 data_element=Data element
 data_elements=Data elements
 indicators=Indicators
-category_combo=Category Combo
 select_categorycombo=Select Category Combo
 title=Title
-category_combo=Category combinations
+category_combo=Combination of categories
 add_dataset=Add data set
 dataset_details=Data set details
 multiorg_dataset_details=Multi-organisation unit entry details

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml	2013-09-23 09:49:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml	2013-12-20 14:53:40 +0000
@@ -14,15 +14,6 @@
       <param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
     </action>
 
-    <!-- Dataset -->
-
-    <action name="dataSet" class="org.hisp.dhis.dataset.action.DataSetListAction">
-      <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-maintenance-dataset/dataSetList.vm</param>
-      <param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
-      <param name="javascripts">javascript/dataSet.js</param>
-    </action>
-
     <!-- Section -->
 
     <action name="section" class="org.hisp.dhis.dataset.action.section.SectionListAction">
@@ -112,7 +103,14 @@
       <result name="success" type="redirect">dataSet.action</result>
     </action>
 
-    <!-- Show add DataSet form -->
+    <!-- Dataset -->
+
+    <action name="dataSet" class="org.hisp.dhis.dataset.action.DataSetListAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="page">/dhis-web-maintenance-dataset/dataSetList.vm</param>
+      <param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
+      <param name="javascripts">javascript/dataSet.js</param>
+    </action>
 
     <action name="addDataSetForm" class="org.hisp.dhis.dataset.action.EditDataSetFormAction">
       <result name="success" type="velocity">/main.vm</result>
@@ -121,8 +119,6 @@
       <param name="anyAuthorities">F_DATASET_PUBLIC_ADD, F_DATASET_PRIVATE_ADD</param>
     </action>
 
-    <!-- Show edit DataSet form -->
-
     <action name="editDataSetForm" class="org.hisp.dhis.dataset.action.EditDataSetFormAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-dataset/editDataSet.vm</param>
@@ -130,8 +126,6 @@
       <param name="anyAuthorities">F_DATASET_PUBLIC_ADD, F_DATASET_PRIVATE_ADD</param>
     </action>
 
-    <!-- Validation, add, update, and delete -->
-
     <action name="validateDataSet" class="org.hisp.dhis.dataset.action.ValidateDataSetAction">
       <result name="success" type="velocity-json">../dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <result name="error" type="velocity-json">../dhis-web-commons/ajax/jsonResponseError.vm</result>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm	2013-12-12 15:38:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm	2013-12-20 14:53:40 +0000
@@ -89,13 +89,23 @@
         <td><label>$i18n.getString( "frequency" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
         <td>
           <select id="frequencySelect" name="frequencySelect">
-            #foreach ( $periodType in $periodTypes )
+            #foreach( $periodType in $periodTypes )
               <option value="$periodType.name">$i18n.getString( $periodType.name )</option>
             #end
           </select>
         </td>
       </tr>
       <tr>
+      	<td><label>$i18n.getString( "category_combo" )</label></td>
+      	<td>
+      	  <select id="categoryComboId" name="categoryComboId">
+      	  	#foreach( $categoryCombo in $categoryCombos )
+      	  	  <option value="$categoryCombo.id">$encoder.htmlEncode( $categoryCombo.displayName )</option>
+	  	    #end
+  	      </select>
+	    </td>
+      </tr>
+      <tr>
       	<td><label>$i18n.getString( "notification_recipients" )</label></td>
       	<td>
       	  <select id="notificationRecipients" name="notificationRecipients">
@@ -104,7 +114,7 @@
       	  	  <option value="$group.id">$encoder.htmlEncode( $group.name )</option>
 	  	    #end
   	      </select>
-	    </td>
+	    </td>  
       </tr>
       <tr>
         <td><label>$i18n.getString( "notify_completing_user" )</label></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm	2013-12-12 15:38:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm	2013-12-20 14:53:40 +0000
@@ -94,7 +94,17 @@
             #end
           </select>
         </td>
-      </tr>	   
+      </tr>
+      <tr>
+        <td><label>$i18n.getString( "category_combo" )</label></td>
+        <td>
+          <select id="categoryComboId" name="categoryComboId">
+            #foreach( $categoryCombo in $categoryCombos )
+              <option value="$categoryCombo.id"#if( $dataSet.categoryCombo.id == $categoryCombo.id ) selected="selected"#end>$encoder.htmlEncode( $categoryCombo.displayName )</option>
+            #end
+          </select>
+        </td>
+      </tr>
       <tr>
         <td><label>$i18n.getString( "notification_recipients" )</label></td>
         <td>