← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2172: Added Group Member count dataset name, and sorting by group name in GroupWise dataStatus in Dashboard

 

------------------------------------------------------------
revno: 2172
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-11-25 19:43:58 +0530
message:
  Added Group Member count dataset name,and sorting by group name in GroupWise dataStatus in Dashboard
modified:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateGroupWiseDataStatusResultAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateGroupWiseMobileDataStatusResultAction.java
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/groupWiseDataStatusResult.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/groupWiseMobileDataStatusResult.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 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateGroupWiseDataStatusResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateGroupWiseDataStatusResultAction.java	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateGroupWiseDataStatusResultAction.java	2010-11-25 14:13:58 +0000
@@ -16,6 +16,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 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.options.displayproperty.DisplayPropertyHandler;
@@ -129,7 +130,14 @@
     {
         return orgUnitList;
     }
+    
+    private Map<DataElementGroup, Integer> deMapGroupCount;
 
+    public Map<DataElementGroup, Integer> getDeMapGroupCount()
+    {
+        return deMapGroupCount;
+    }
+    
     private List<DataSet> dataSetList;
 
     public List<DataSet> getDataSetList()
@@ -325,7 +333,13 @@
     {
         return selDataSet;
     }
-
+    
+    private Integer dsSize;
+    
+    public Integer getDsSize()
+    {
+        return dsSize;
+    }
     // ---------------------------------------------------------------
     // Action Implementation
     // ---------------------------------------------------------------
@@ -339,6 +353,8 @@
 
         // Intialization
         ouMapDataStatusResult = new HashMap<OrganisationUnit, List<Integer>>();
+        deMapGroupCount = new HashMap<DataElementGroup, Integer>(); // dataelement Group Count
+        
         results = new ArrayList<Integer>();
         maxOULevel = 1;
         minOULevel = organisationUnitService.getNumberOfOrganisationalLevels();
@@ -442,10 +458,15 @@
         deInfo = "-1";
         selDataSet = new DataSet();      
         selDataSet = dataSetService.getDataSet( Integer.parseInt( selectedDataSets.get( 0 ) ) );
-
+        
+        //for size of dataset( no of dataElement of Selected dataset)
+        dsSize = selDataSet.getDataElements().size(); 
+        
         // Data Element Group Related Info
         dataElementGroups = new ArrayList<DataElementGroup>();
         dataElementGroups.addAll( getApplicableDataElementGroups( selDataSet ) );
+        
+        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
 
         for ( DataElementGroup deGroup : dataElementGroups )
         {
@@ -488,6 +509,11 @@
                 deGroupMemberCount1 += de1.getCategoryCombo().getOptionCombos().size();
             }
 
+            // detaElement Group member Count
+            Integer deGroupMemberCount = dataElements.size();
+            
+            deMapGroupCount.put( deg, deGroupMemberCount );
+            
             deInfo = getDEInfo( dataElements );
 
             dataSetPeriodType = ds.getPeriodType();

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateGroupWiseMobileDataStatusResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateGroupWiseMobileDataStatusResultAction.java	2010-11-25 07:50:13 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateGroupWiseMobileDataStatusResultAction.java	2010-11-25 14:13:58 +0000
@@ -42,6 +42,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 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.options.displayproperty.DisplayPropertyHandler;
@@ -175,6 +176,13 @@
     {
         return orgUnitList;
     }
+    
+    private Map<DataElementGroup, Integer> deMapGroupCount;
+
+    public Map<DataElementGroup, Integer> getDeMapGroupCount()
+    {
+        return deMapGroupCount;
+    }
 
     private List<DataSet> dataSetList;
 
@@ -371,7 +379,13 @@
     {
         return selDataSet;
     }
-    
+    private Integer dsSize;
+     
+    public Integer getDsSize()
+    {
+        return dsSize;
+    }
+
     private String userPhoneNo;
     
     public String getUserPhoneNo()
@@ -394,6 +408,8 @@
         // Intialization
         ouMapDataStatusResult = new HashMap<OrganisationUnit, List<Integer>>();
         ouMapUserPhoneNo = new HashMap<OrganisationUnit,String>();//for User PhoneNo Map
+        deMapGroupCount = new HashMap<DataElementGroup, Integer>(); // dataelement Group Count
+        
         
         results = new ArrayList<Integer>();
         maxOULevel = 1;
@@ -498,10 +514,15 @@
         deInfo = "-1";
         selDataSet = new DataSet();      
         selDataSet = dataSetService.getDataSet( Integer.parseInt( selectedDataSets.get( 0 ) ) );
-
+        
+        //for size of dataset( no of dataElement of Selected dataset)
+        dsSize = selDataSet.getDataElements().size(); 
+        
         // Data Element Group Related Info
         dataElementGroups = new ArrayList<DataElementGroup>();
+        
         dataElementGroups.addAll( getApplicableDataElementGroups( selDataSet ) );
+        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
 
         for ( DataElementGroup deGroup : dataElementGroups )
         {
@@ -537,13 +558,20 @@
 
             dataElements = deg.getMembers();
             dataElements.retainAll( ds.getDataElements() );
-
+            
+           // System.out.println( "dataElementGroup Size  : " + dataElements.size() );
+            
             int deGroupMemberCount1 = 0;
             for ( DataElement de1 : dataElements )
             {
                 deGroupMemberCount1 += de1.getCategoryCombo().getOptionCombos().size();
             }
 
+            // detaElement Group member Count
+            Integer deGroupMemberCount = dataElements.size();
+            
+            deMapGroupCount.put( deg, deGroupMemberCount );
+            
             deInfo = getDEInfo( dataElements );
 
             dataSetPeriodType = ds.getPeriodType();
@@ -683,7 +711,19 @@
                 }
             }
         }
-
+      
+ /*       
+        for( DataElementGroup orgUnitGroup : deMapGroupCount.keySet() )
+        {
+            System.out.print( orgUnitGroup.getName()+ " : " );
+            for( Integer gCount : deMapGroupCount.values())
+            {
+                System.out.print( " - "+ gCount );
+            }
+            System.out.println("");
+        }
+*/      
+        
         // For Level Names
         String ouLevelNames[] = new String[organisationUnitService.getNumberOfOrganisationalLevels() + 1];
         for ( int i = 0; i < ouLevelNames.length; i++ )

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/groupWiseDataStatusResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/groupWiseDataStatusResult.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/groupWiseDataStatusResult.vm	2010-11-25 14:13:58 +0000
@@ -44,7 +44,7 @@
 			</div>
 			
 		<div id="formResult">			    
-		        <div align="center" class="NormalB">Data Entry Status by Data Element Groups</div>
+		        <div align="center" class="NormalB">Data Entry Status by Data Element Groups Of Data Set :  $selDataSet.name </div>
         <div align="right">
             			<table width="30%">
                 				<tr class="TableDataCellStyles" >
@@ -68,7 +68,8 @@
         		#set($count2 = 0)
         			#foreach($dataElementGroup in $dataElementGroups)
             <br><br>
-            			<div align="left" class="NormalB">Data Element Group : $dataElementGroup.name</div>
+            			#set( $deGroupCount = $deMapGroupCount.get($dataElementGroup) )
+            			<div align="left" class="NormalB">Data Element Group : $dataElementGroup.name  ( $!deGroupCount )</div>
             			<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">		
   				              <tr class="TableHeadingCellStyles" align="center">
   				                  #foreach($levelName in $levelNames)

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/groupWiseMobileDataStatusResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/groupWiseMobileDataStatusResult.vm	2010-11-25 07:50:13 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/groupWiseMobileDataStatusResult.vm	2010-11-25 14:13:58 +0000
@@ -44,7 +44,7 @@
             </div>
             
         <div id="formResult">               
-                <div align="center" class="NormalB">$i18n.getString( "ds_dataentry_dataelement_group_status_mobile" )</div>
+                <div align="center" class="NormalB">$i18n.getString( "ds_dataentry_dataelement_group_status_mobile" ) Of Data Set :  $selDataSet.name  </div>
         <div align="right">
                         <table width="30%">
                                 <tr class="TableHeadingCellStyles" >
@@ -68,7 +68,8 @@
                 #set($count2 = 0)
                     #foreach($dataElementGroup in $dataElementGroups)
             <br />
-                        <div align="left" class="NormalB">$i18n.getString( "ds_dataelement_group_mobile" ) : $dataElementGroup.name</div>
+                        #set( $deGroupCount = $deMapGroupCount.get($dataElementGroup) )
+                        <div align="left" class="NormalB">$i18n.getString( "ds_dataelement_group_mobile" ) : $dataElementGroup.name ( $!deGroupCount )</div>
                         <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">       
                               <tr class="TableHeadingCellStyles" align="center">
                                   #foreach($levelName in $levelNames)