dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17834
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7256: Fixed bug with add new indicator ui
------------------------------------------------------------
revno: 7256
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-06-09 23:41:33 +0200
message:
Fixed bug with add new indicator ui
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowAddIndicatorForm.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/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-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowAddIndicatorForm.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowAddIndicatorForm.java 2012-06-01 12:17:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowAddIndicatorForm.java 2012-06-09 21:41:33 +0000
@@ -31,6 +31,9 @@
import org.hisp.dhis.attribute.Attribute;
import org.hisp.dhis.attribute.AttributeService;
import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
+import org.hisp.dhis.indicator.IndicatorService;
+import org.hisp.dhis.indicator.IndicatorType;
import java.util.ArrayList;
import java.util.Collections;
@@ -46,6 +49,13 @@
// Dependencies
// -------------------------------------------------------------------------
+ private IndicatorService indicatorService;
+
+ public void setIndicatorService( IndicatorService indicatorService )
+ {
+ this.indicatorService = indicatorService;
+ }
+
private AttributeService attributeService;
public void setAttributeService( AttributeService attributeService )
@@ -57,6 +67,13 @@
// Input/output
// -------------------------------------------------------------------------
+ private List<IndicatorType> indicatorTypes;
+
+ public List<IndicatorType> getIndicatorTypes()
+ {
+ return indicatorTypes;
+ }
+
private List<Attribute> attributes;
public List<Attribute> getAttributes()
@@ -70,6 +87,9 @@
public String execute()
{
+ indicatorTypes = new ArrayList<IndicatorType>( indicatorService.getAllIndicatorTypes() );
+ Collections.sort( indicatorTypes, IdentifiableObjectNameComparator.INSTANCE );
+
attributes = new ArrayList<Attribute>( attributeService.getIndicatorAttributes() );
Collections.sort( attributes, new AttributeSortOrderComparator() );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2012-06-01 12:17:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2012-06-09 21:41:33 +0000
@@ -440,6 +440,9 @@
<!-- Indicator -->
<bean id="org.hisp.dhis.dd.action.indicator.ShowAddIndicatorForm" class="org.hisp.dhis.dd.action.indicator.ShowAddIndicatorForm">
+ <property name="indicatorService">
+ <ref bean="org.hisp.dhis.indicator.IndicatorService" />
+ </property>
<property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
</bean>