← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2553: Work in progress for Target Analysis/Cumulative Chart

 

------------------------------------------------------------
revno: 2553
committer: Neeraj <neeraj.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-01-13 15:09:35 +0530
message:
  Work in progress for Target Analysis/Cumulative Chart
added:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetOrgUnitNameAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisFormAction.java
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/tr.js
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForTarget.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responseOrgUnitName.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/targetAnalysisFront.vm
modified:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsForTabularAnalysisAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetOrgUnitsAction.java
  local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties
  local/in/dhis-web-dashboard/src/main/resources/struts.xml
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.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/dataanalyser/action/GetDataElementsForTabularAnalysisAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsForTabularAnalysisAction.java	2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsForTabularAnalysisAction.java	2011-01-13 09:39:35 +0000
@@ -112,6 +112,7 @@
 
         if ( id == null || id == ALL )
         {
+            System.out.println("The id is null");
             dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
         } 
         else

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetOrgUnitNameAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetOrgUnitNameAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetOrgUnitNameAction.java	2011-01-13 09:39:35 +0000
@@ -0,0 +1,59 @@
+package org.hisp.dhis.dataanalyser.action;
+
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+
+import com.opensymphony.xwork2.Action;
+
+public class GetOrgUnitNameAction
+implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+        
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Input/Output
+    // -------------------------------------------------------------------------
+    private String selectedOrgUnitId;
+    
+    public void setSelectedOrgUnitId( String selectedOrgUnitId )
+    {
+        this.selectedOrgUnitId = selectedOrgUnitId;
+    }
+    
+    private Integer id;
+
+    public void setId( Integer id )
+    {
+        this.id = id;
+    }
+
+    private OrganisationUnit organisationUnit;
+
+    public OrganisationUnit getOrganisationUnit()
+    {
+        return organisationUnit;
+    }
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+    {
+       
+        System.out.println( "orgUnit Id is "  + id );
+        organisationUnit = organisationUnitService.getOrganisationUnit( id );
+        
+        System.out.println( "orgUnit Id is "  + selectedOrgUnitId + " , orgNunit name is : " + organisationUnit.getName() );
+        
+        return SUCCESS;
+    }
+}
\ No newline at end of file

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetOrgUnitsAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetOrgUnitsAction.java	2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetOrgUnitsAction.java	2011-01-13 09:39:35 +0000
@@ -77,6 +77,7 @@
         
         System.out.println(" orgUnit Id is : " + orgUnit.getId() + " , orgUnit Name is : " + orgUnit.getName() );
         orgUnitLevel = organisationUnitService.getLevelOfOrganisationUnit( orgUnit );
+        //orgUnitLevel = orgUnit.getLevel();
         maxOrgUnitLevel = organisationUnitService.getNumberOfOrganisationalLevels();
         
         // Hardcoded : if it is Tabular Analysis, Null Reporter

=== added directory 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr'
=== added directory 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action'
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisFormAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisFormAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisFormAction.java	2011-01-13 09:39:35 +0000
@@ -0,0 +1,134 @@
+package org.hisp.dhis.dataanalyser.tr.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+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.dataelement.comparator.DataElementNameComparator;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.period.MonthlyPeriodType;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.comparator.PeriodComparator;
+
+import com.opensymphony.xwork2.Action;
+
+public class GenerateTargetAnalysisFormAction
+implements Action
+{
+    //--------------------------------------------------------------------------
+    //Dependencies
+    //--------------------------------------------------------------------------
+    
+    private DataElementService dataElementService;
+    
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+    
+    private PeriodService periodService;
+    
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+
+    private OrganisationUnitGroupService orgUnitGroupService;
+    
+    public void setOrgUnitGroupService( OrganisationUnitGroupService orgUnitGroupService )
+    {
+        this.orgUnitGroupService = orgUnitGroupService;
+    }
+    
+    //--------------------------------------------------------------------------
+    //Input/Output
+    //--------------------------------------------------------------------------
+    
+    private List<DataElement> dataElements;
+    
+    public List<DataElement> getDataElements()
+    {
+        return dataElements;
+    }
+
+   private List<DataElementGroup> dataElementGroups;
+
+   public List<DataElementGroup> getDataElementGroups()
+   {
+      return dataElementGroups;
+   }
+   
+   private List<OrganisationUnitGroup> orgUnitGroups;
+
+   public List<OrganisationUnitGroup> getOrgUnitGroups()
+   {
+       return orgUnitGroups;
+   }
+   
+   private List<Period> monthlyPeriods;
+   
+   public List<Period> getMonthlyPeriods()
+   {
+       return monthlyPeriods;
+   }
+   
+   private SimpleDateFormat simpleDateFormat;
+
+   public SimpleDateFormat getSimpleDateFormat()
+   {
+       return simpleDateFormat;
+   }
+   
+    //--------------------------------------------------------------------------
+    //Action Implementation
+    //--------------------------------------------------------------------------
+
+    public String execute()
+    {
+        dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
+        
+        // take only those dataElement which are VALUE_TYPE_INT and DOMAIN_TYPE_AGGREGATE
+        Iterator<DataElement> alldeIterator = dataElements.iterator();
+        while ( alldeIterator.hasNext() )
+        {
+            DataElement dataElement = alldeIterator.next();
+            if ( !dataElement.getDomainType().equalsIgnoreCase( DataElement.DOMAIN_TYPE_AGGREGATE ) )
+            {
+                alldeIterator.remove();
+            }
+        }
+        
+        dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
+        Collections.sort( dataElements, new DataElementNameComparator() );
+        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+        
+        orgUnitGroups = new ArrayList<OrganisationUnitGroup> ( orgUnitGroupService.getAllOrganisationUnitGroups() );
+        
+        monthlyPeriods = new ArrayList<Period> ( periodService.getPeriodsByPeriodType( new MonthlyPeriodType() ));
+        Iterator<Period> periodIterator = monthlyPeriods.iterator();
+        while( periodIterator.hasNext() )
+        {
+            Period p1 = periodIterator.next();
+            
+            if ( p1.getStartDate().compareTo( new Date() ) > 0 )
+            {
+                periodIterator.remove( );
+            }
+            
+        }
+        Collections.sort( monthlyPeriods, new PeriodComparator() );
+        simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
+        
+        return SUCCESS;
+    }
+
+}

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2011-01-11 08:04:51 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2011-01-13 09:39:35 +0000
@@ -505,6 +505,35 @@
         </property>
     </bean> 
 	
+	<!-- Target Analyser -->
+	
+	<bean id="org.hisp.dhis.dataanalyser.tr.action.GenerateTargetAnalysisFormAction"
+        class="org.hisp.dhis.dataanalyser.tr.action.GenerateTargetAnalysisFormAction"
+        scope="prototype">
+		
+		<property name="periodService">
+            <ref bean="org.hisp.dhis.period.PeriodService"/>
+        </property>
+		<property name="dataElementService">
+            <ref bean="org.hisp.dhis.dataelement.DataElementService"/>
+        </property>
+		<property name="orgUnitGroupService">
+            <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"/>
+        </property>
+		
+	</bean>
+	
+	<bean id="org.hisp.dhis.dataanalyser.action.GetOrgUnitNameAction"
+		class="org.hisp.dhis.dataanalyser.action.GetOrgUnitNameAction"
+		scope="prototype">
+		
+		<property name="organisationUnitService">
+			<ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
+		</property>
+			
+	</bean>
+		
+	
 	<!-- DataStatus -->
 	
     <bean id="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusFormAction"

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties'
--- local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties	2010-12-23 07:23:23 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties	2011-01-13 09:39:35 +0000
@@ -47,11 +47,17 @@
 aa_months = Months
 aa_orgunit = OrganisationUnit
 
-#------SurveyAnalusis------------------------#
+#------SurveyAnalysis------------------------#
 
 survey = Survey
 sa_survey_analyser = Survey Analyser
 
+#------Target Analysis-----------------------#
+
+target = Target
+view_cumulativechart = View Cumulative Chart
+viewchart = View Chart
+
 #-------TabularAnalysis----------------------#
 
 ta = Tabular Analysis

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml	2011-01-11 08:04:51 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml	2011-01-13 09:39:35 +0000
@@ -313,6 +313,25 @@
             </result>
         </action>       
 		
+		<!-- Target Analyser Module Stuff -->
+		
+		<action name="targetAnalyser"
+			class="org.hisp.dhis.dataanalyser.tr.action.GenerateTargetAnalysisFormAction">
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">/dhis-web-dashboard/targetAnalysisFront.vm</param>
+			<param name="menu">/dhis-web-dashboard/menuWithTreeForTarget.vm</param>
+			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ta.js,javascript/db.js,javascript/tr.js,javascript/hashtable.js,javascript/date.js</param>
+			<param name="stylesheets">css/StylesForTags.css</param>
+			<interceptor-ref name="organisationUnitTreeStack"/>
+		</action>
+		
+		<action name="getOrgUnitName"
+			class="org.hisp.dhis.dataanalyser.action.GetOrgUnitNameAction">
+			<result name="success" type="velocity-xml">
+				/dhis-web-dashboard/responseOrgUnitName.vm</result>
+			<param name="onExceptionReturn">plainTextError</param>
+		</action>
+		
 		
 		
 		<!-- DataStatus Module Stuff -->
@@ -620,15 +639,15 @@
 		<!-- TabularAnalysis Module Stuff -->
 		
 		<action name="tabularAnalysisForm"
-			class="org.hisp.dhis.dataanalyser.ta.action.GenerateTabularAnalysisFormAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-dashboard/tabularAnalysisFront.vm</param>
-			<param name="menu">/dhis-web-dashboard/menuWithTreeForTA.vm</param>
-			<param name="javascripts">
-				../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ta.js,javascript/hashtable.js</param>
-			<param name="stylesheets">css/StylesForTags.css</param>
-			<interceptor-ref name="organisationUnitTreeStack"/>
-		</action>
+            class="org.hisp.dhis.dataanalyser.ta.action.GenerateTabularAnalysisFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">/dhis-web-dashboard/tabularAnalysisFront.vm</param>
+            <param name="menu">/dhis-web-dashboard/menuWithTreeForTA.vm</param>
+            <param name="javascripts">
+                ../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ta.js,javascript/hashtable.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
 		
 		<!--
 		<action name="tabularAnalysisResult"

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/tr.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/tr.js	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/tr.js	2011-01-13 09:39:35 +0000
@@ -0,0 +1,146 @@
+function formValidations()
+{
+    var orgUnitListCB = document.getElementById("orgUnitListCB");
+    var selOUListLength = document.tabularAnalysisForm.orgUnitListCB.options.length;
+    
+    sDateIndex    = document.targetAnalysisForm.sDateLB.selectedIndex;
+    eDateIndex    = document.targetAnalysisForm.eDateLB.selectedIndex;
+    sDateTxt = document.targetAnalysisForm.sDateLB.options[sDateIndex].text;
+    sDate = formatDate(new Date(getDateFromFormat(sDateTxt,"MMM-y")),"yyyy-MM-dd");
+    eDateTxt = document.targetAnalysisForm.eDateLB.options[eDateIndex].text;
+    eDate = formatDate(new Date(getDateFromFormat(eDateTxt,"MMM-y")),"yyyy-MM-dd");
+
+    if(sDateIndex < 0) {alert("Please Select Starting Period");return false;}
+    else if(eDateIndex < 0) {alert("Please Select Ending Period");return false;}
+    else if(sDate > eDate) {alert("Starting Date is Greater");return false;}
+    orgUnitListCB.disabled = false;
+    
+    return true;
+} // formValidations Function End
+
+function deSelectionChangeFuntion( listId1, listId2 )
+{
+    var list1 = document.getElementById( listId1 );
+    var list2 = document.getElementById( listId2 );
+
+    clearList( list1 );
+	
+    for(var i=list2.options.length-1; i >= 0; i--)
+    {
+        option = list2.options[ i ];
+        var optValue = option.value;
+        var partsOfOptVal = new Array();
+        partsOfOptVal = optValue.split(":");
+        if(partsOfOptVal[0] == "D")
+        {
+            list2.remove( i );
+        }
+    }
+	
+    getDataElements();
+}
+
+function getDataElements()
+{
+	var dataElementGroupList = document.getElementById("dataElementGroupId");
+    var dataElementGroupId = dataElementGroupList.options[ dataElementGroupList.selectedIndex ].value;
+    
+    var deSelectionList = document.getElementById("deSelection");    
+    var deOptionValue = deSelectionList.options[ deSelectionList.selectedIndex ].value;
+    
+    if ( dataElementGroupId != null )
+    {
+		$.post("getDataElementsForTA.action",
+		{
+			id:dataElementGroupId,
+			deOptionValue:deOptionValue
+		},
+		function (data)
+		{
+			getDataElementsReceived(data);
+		},'xml');
+    }
+}// getDataElements end      
+
+function getDataElementsReceived( xmlObject )
+{
+    var availableDataElements = document.getElementById("availableDataElements");
+
+    clearList(availableDataElements);
+
+    var dataElements = xmlObject.getElementsByTagName("dataElement");
+
+    for ( var i = 0; i < dataElements.length; i++ )
+    {
+        var id = "D:"+dataElements[ i ].getElementsByTagName("id")[0].firstChild.nodeValue;
+        var dataElementName = dataElements[ i ].getElementsByTagName("name")[0].firstChild.nodeValue;
+        
+            var option = document.createElement("option");
+            option.value = id;
+            option.text = dataElementName;
+            option.title = dataElementName;
+            availableDataElements.add(option, null);
+    }
+    
+}
+// getDataElementsReceived end
+
+function getOUDeatilsForTaget( orgUnitIds )
+{
+	document.getElementById( "ougGroupSetCB" ).disabled = false;
+	document.getElementById( "orgUnitGroupList" ).disabled = false;
+	jQuery.postJSON("getOrgUnitName.action",{
+  	  id : orgUnitIds[0]
+   }, function( json ){
+         setFieldValue( "ouNameTB",json.organisationUnit.name );
+   });
+}
+
+function getOUDetailsForTargetRecevied(xmlObject)
+{
+	var element = dataelement.getElementsByTagName("orgunit");
+    var orgUnitname = element[0].getElementsByTagName("OugUnitName")[0].firstChild.nodeValue;
+    document.targetAnalysisForm.ouNameTB.value = orgUnitname;
+}
+
+function getOrgUnitGroupsDataElements() 
+{
+	var checked = byId('ougGroupSetCB').checked;
+	clearListById('orgUnitGroupList');
+	
+	if (checked)
+	{
+		var ouGroupId = document.getElementById("orgUnitGroupList");
+		for ( var i = 0; i < orgUnitGroupIds.length; i++) 
+		{
+
+			var option = document.createElement("option");
+			option.value = orgUnitGroupIds[i];
+			option.text = orgUnitGroupNames[i];
+			option.title = orgUnitGroupNames[i];
+			ouGroupId.add(option, null);
+		}
+	}
+	else
+	{
+	//document.getElementById( "ougGroupSetCB" ).disabled = true;
+	}
+	//clearList( ouGroupId );
+}
+
+function showOverlay() 
+{
+    var o = document.getElementById('overlay');
+    o.style.visibility = 'visible';
+    jQuery("#overlay").css({
+        "height": jQuery(document).height()
+    });
+    jQuery("#overlayImg").css({
+        "top":jQuery(window).height()/2
+    });
+}
+function hideOverlay() 
+{
+    var o = document.getElementById('overlay');
+    o.style.visibility = 'hidden';
+}
\ No newline at end of file

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm	2010-12-23 07:23:23 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm	2011-01-13 09:39:35 +0000
@@ -8,6 +8,7 @@
 		        <li><a href="graphicalAnalyserDataElement.action">$i18n.getString( "dataelements_wise" )</a></li>
 		        <li><a href="graphicalAnalyserIndicator.action">$i18n.getString( "indicator_wise" )</a></li>
 		        <li><a href="surveyAnalyser.action">$i18n.getString( "survey" )</a></li>
+		        <li><a href="targetAnalyser.action">$i18n.getString( "target" )</a></li>
 		      <!--  <li><a href="motionChartForm.action">MotionChart</a></li> -->
 		   	</ul>
 		<li><a href="tabularAnalysisForm.action">$i18n.getString( "ta" )</a></li>   	

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForTarget.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForTarget.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForTarget.vm	2011-01-13 09:39:35 +0000
@@ -0,0 +1,35 @@
+<h2>$i18n.getString( "dataanalyser" )</h2>
+    <ul>
+        <li>$i18n.getString( "graphical_analysis" )</li>
+        <ul>
+            <li>$i18n.getString( "target" )</li>
+         </ul>
+    </ul>
+<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-20px; ">
+        <a href="index.action">
+          <img src="images/goback.png" width="36" height="30" alt="$i18n.getString( "go_back" )"></a>
+</div>
+<!--#parse( "/dhis-web-commons/ouwt/orgunittree.vm" ) -->
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" ) 
+<!-- The script that registeres selctions in the orgunit tree -->
+<script type="text/javascript">
+
+selection.setListenerFunction( orgUnitHasBeenSelected );
+
+function orgUnitHasBeenSelected( orgUnitIds )
+{
+    if(orgUnitIds == null || orgUnitIds == "" )
+    {
+        return;
+    }
+    if( orgUnitIds != null )
+    {
+        getOUDeatilsForTaget( orgUnitIds );
+    }       
+}
+
+</script>
+
+
+
+

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responseOrgUnitName.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responseOrgUnitName.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responseOrgUnitName.vm	2011-01-13 09:39:35 +0000
@@ -0,0 +1,7 @@
+
+{ "organisationUnit":
+    {
+   "id": $!{organisationUnit.id},
+   "name": "$!encoder.jsonEncode( ${organisationUnit.name} )"
+    }
+}

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/targetAnalysisFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/targetAnalysisFront.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/targetAnalysisFront.vm	2011-01-13 09:39:35 +0000
@@ -0,0 +1,138 @@
+<style>
+#overlay {
+z-index:9998;
+position:absolute;
+top:0;
+bottom:0;
+left:0;
+width:100%;
+background:#000;
+opacity:0.45;
+-moz-opacity:0.45;
+filter:alpha(opacity=45);
+visibility:hidden;
+}
+#overlayImg{ width: 50px; height: 50px; z-index: 9999; position: absolute; left:50%}
+</style>
+<div id="overlay">
+<div id="overlayImg"><img  width="50" height="50" src="images/ajax-loader.gif" /></div>
+</div>
+
+<script>
+	
+	var orgUnitGroupIds = new Array();
+	var orgUnitGroupNames = new Array();
+
+	#set( $count1 = 0 );
+	#foreach( $orgUnitGroup in $orgUnitGroups )
+	   orgUnitGroupIds[$count1] = $orgUnitGroup.id;
+	   orgUnitGroupNames[$count1] = '$orgUnitGroup.name';
+	   #set( $count1 = $count1 + 1 );
+	#end
+	
+</script>
+
+<h1>Target Analysis Form</h1>
+<hr />
+
+<form id="targetAnalysisForm" name="targetAnalysisForm" action="targetAnalysisResult.action" method="post" onsubmit="return formValidations()" target="_blank">	
+	<table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="100%" border=0>
+		<colgroup>
+        	<col width="40%">
+  		    <col width="20%">
+ 		    <col width="40%">
+  	    </colgroup>
+  	    
+  	    <tr>
+			<td class="NormalB">$i18n.getString( "ga_filter_by_degroup" )<br>
+		   		<select id="dataElementGroupId" name="dataElementGroupId" style="width:350px" onchange="getDataElements()">
+                	<option value="0">[ Select DataElementGroup / All ]</option>				                    
+            			#foreach ( $degroup in $dataElementGroups )
+            			<option value="$degroup.id" title="$degroup.name">$degroup.name</option>        			
+     		        #end
+     		    </select>
+            </td>  
+        </tr>
+        <tr>
+			<td class="NormalB">&nbsp;</td>   
+		</tr>
+		
+		<tr>
+			<td class="NormalB">&nbsp;</td>   
+		</tr>
+        <tr>
+           
+            <td class="NormalB" style="display:none" >$i18n.getString( "compare_view" )<br>
+            	<select id="deSelection" name="deSelection" style="width:350px" onchange="deSelectionChangeFuntion( 'availableDataElements', 'selectedServices' )">
+                	<option value="dataelement">DataElements</option>
+                    <option value="optioncombo" selected>Options in DataElements</option>
+                </select>
+            </td>
+            
+            <td class="NormalB">$i18n.getString( "ga_available_delist" )<br>
+				<select id="availableDataElements" name="availableDataElements" style="width:350px" >					
+					#foreach ( $element in $dataElements )
+						<option value="D:$element.id" title="$element.name">$element.name</option>					
+				    #end
+				</select>
+			</td>
+			
+        </tr>
+        
+        <tr>
+			<td class="NormalB">&nbsp;</td>   
+		</tr>
+		
+		<tr>
+			<td class="NormalB">&nbsp;</td>   
+		</tr>
+		
+		<tr>
+			<td class="NormalB">	
+				$i18n.getString( "ga_from" )<br>
+				<select id="sDateLB" name="sDateLB">												
+					#foreach($period in $monthlyPeriods)
+						<option value="$period.id">$simpleDateFormat.format($period.startDate)</option>
+					#end
+				</select>
+			</td>
+			      
+			<td class="NormalB">    
+				$i18n.getString( "ga_to" )<br>
+				<select id="eDateLB" name="eDateLB">
+					#foreach($period in $monthlyPeriods)
+						<option value="$period.id">$simpleDateFormat.format($period.endDate)</option>
+					#end			  							
+				</select>
+			</td>    
+		</tr>
+		
+		<tr>
+	        <td class="NormalB">$i18n.getString( "nr_orgunit" )<br>
+	            <input type="text" name="ouNameTB" id="ouNameTB" style="width:150px" disabled>
+	            </select>                       
+	        </td>
+	        <td class="NormalB"><input type="checkbox" id="ougGroupSetCB" name="ougGroupSetCB" onChange="getOrgUnitGroupsDataElements()"  disabled="true">$i18n.getString( "ga_orgUnitGroups" )<br>
+	            <select name="orgUnitGroupList" id="orgUnitGroupList" multiple size="7"  onChange="selectSingleOptionOrgUnitGroup()"  style="width: 150px;" disabled="true">
+	            </select>
+	        </td>
+		
+      	</tr>
+      	
+      	<tr>
+			<td>&nbsp;</td>
+			<td>&nbsp;</td>
+			<td>&nbsp;</td>
+		</tr>                    			                   			        
+		<tr>
+			<td>
+				<input type="submit" id="ViewChart" name="ViewChart" value="$i18n.getString( 'viewchart' )" style="width: 120; height: 25; font-family:Arial; font-weight:bold; color:#000000">
+			</td>
+			
+			<td>
+				<input type="submit" id="ViewCumulativeChart" name="ViewChart" value="$i18n.getString( 'view_cumulativechart' )" style="width: 120; height: 25; font-family:Arial; font-weight:bold; color:#000000">
+			</td>
+		</tr>
+      </table>
+</form>
+