← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3798: Removed type='chain' into dhis-web-maintenance-dataset.

 

------------------------------------------------------------
revno: 3798
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-05-31 09:24:43 +0700
message:
  Removed type='chain' into dhis-web-maintenance-dataset.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/ViewDataEntryFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.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-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/ViewDataEntryFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/ViewDataEntryFormAction.java	2011-05-16 14:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/ViewDataEntryFormAction.java	2011-05-31 02:24:43 +0000
@@ -27,10 +27,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataentryform.DataEntryForm;
 import org.hisp.dhis.dataentryform.DataEntryFormService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.options.displayproperty.DisplayPropertyHandler;
 import org.hisp.dhis.user.UserSettingService;
 
 import com.opensymphony.xwork2.Action;
@@ -68,6 +75,28 @@
     }
 
     // -------------------------------------------------------------------------
+    // Comparator
+    // -------------------------------------------------------------------------
+
+    private Comparator<DataElement> dataElementComparator;
+
+    public void setDataElementComparator( Comparator<DataElement> dataElementComparator )
+    {
+        this.dataElementComparator = dataElementComparator;
+    }
+
+    // -------------------------------------------------------------------------
+    // DisplayPropertyHandler
+    // -------------------------------------------------------------------------
+
+    private DisplayPropertyHandler displayPropertyHandler;
+
+    public void setDisplayPropertyHandler( DisplayPropertyHandler displayPropertyHandler )
+    {
+        this.displayPropertyHandler = displayPropertyHandler;
+    }
+
+    // -------------------------------------------------------------------------
     // Getters & Setters
     // -------------------------------------------------------------------------
 
@@ -106,6 +135,13 @@
         return dataEntryValue;
     }
 
+    private List<DataElement> dataElementList;
+
+    public List<DataElement> getDataElementList()
+    {
+        return dataElementList;
+    }
+
     // -------------------------------------------------------------------------
     // Execute
     // -------------------------------------------------------------------------
@@ -122,6 +158,13 @@
 
         autoSave = (Boolean) userSettingService.getUserSetting( UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM, false );
 
+        
+        dataElementList = new ArrayList<DataElement>( dataSet.getDataElements() );
+
+        Collections.sort( dataElementList, dataElementComparator );
+
+        displayPropertyHandler.handle( dataElementList );
+
         return SUCCESS;
     }
 }

=== 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	2011-05-19 17:07:40 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml	2011-05-31 02:24:43 +0000
@@ -17,15 +17,15 @@
     <!-- Dataset -->
     
     <action name="showMobileDataSet"
-			class="org.hisp.dhis.dataset.action.MobileDataSetListAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-maintenance-dataset/mobileDatasetList.vm</param>
-			<param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
+	  class="org.hisp.dhis.dataset.action.MobileDataSetListAction">
+	  <result name="success" type="velocity">/main.vm</result>
+	  <param name="page">/dhis-web-maintenance-dataset/mobileDatasetList.vm</param>
+	  <param name="menu">/dhis-web-maintenance-dataset/menu.vm</param>
 	</action>
 	
 	<action name="updateMobileDataset"
-			class="org.hisp.dhis.dataset.action.UpdateMobileDataSetAction">
-			<result name="success" type="redirect">showMobileDataSet.action</result>
+	  class="org.hisp.dhis.dataset.action.UpdateMobileDataSetAction">
+	  <result name="success" type="redirect">showMobileDataSet.action</result>
 	</action>
     
     <action name="dataSet" class="org.hisp.dhis.dataset.action.DataSetListAction">
@@ -211,11 +211,6 @@
     </action>    
     
     <!-- DataEntryForm -->
-    
-    <action name="viewDataEntryForm"
-      class="org.hisp.dhis.dataset.action.dataentryform.GetSelectedDataElementsAction">
-      <result name="success" type="chain">viewDataEntryFormChain</result>
-    </action>
 
     <action name="viewDataEntryForm"
       class="org.hisp.dhis.dataset.action.dataentryform.ViewDataEntryFormAction">