← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4464: Updating dataset version for section greying

 

------------------------------------------------------------
revno: 4464
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-08-27 12:06:52 +0200
message:
  Updating dataset version for section greying
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/Section.hbm.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionGreyStatusAction.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-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/Section.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/Section.hbm.xml	2011-05-28 21:25:46 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/Section.hbm.xml	2011-08-27 10:06:52 +0000
@@ -14,7 +14,8 @@
 
     <property name="name" not-null="true" unique-key="key_sectionnamedataset" />
 
-    <many-to-one name="dataSet" class="org.hisp.dhis.dataset.DataSet" column="datasetid" unique-key="key_sectionnamedataset" foreign-key="fk_section_datasetid" />
+    <many-to-one name="dataSet" class="org.hisp.dhis.dataset.DataSet" column="datasetid" 
+		unique-key="key_sectionnamedataset" foreign-key="fk_section_datasetid" not-null="true" />
 
     <list name="dataElements" table="sectiondataelements">
       <cache usage="read-write" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionGreyStatusAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionGreyStatusAction.java	2011-01-17 17:24:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SaveSectionGreyStatusAction.java	2011-08-27 10:06:52 +0000
@@ -36,6 +36,8 @@
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.dataelement.DataElementOperandService;
 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;
 
@@ -75,6 +77,13 @@
     {
         this.categoryService = categoryService;
     }
+    
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
 
     // -------------------------------------------------------------------------
     // Input & output
@@ -179,6 +188,9 @@
         section.setGreyedFields( greyedFields );
         sectionService.updateSection( section );       
 
+        DataSet dataSet = section.getDataSet();
+        dataSetService.updateDataSet( dataSet.increaseVersion() ); // Update version
+        
         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	2011-08-26 23:38:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml	2011-08-27 10:06:52 +0000
@@ -107,6 +107,9 @@
     <property name="categoryService">
       <ref bean="org.hisp.dhis.dataelement.DataElementCategoryService" />
     </property>
+	<property name="dataSetService">
+	  <ref bean="org.hisp.dhis.dataset.DataSetService" />
+	</property>
   </bean>
 
   <bean id="org.hisp.dhis.dataset.action.section.SaveSectionSortOrderAction" class="org.hisp.dhis.dataset.action.section.SaveSectionSortOrderAction"