=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java 2011-09-07 13:42:12 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeService.java 2011-09-14 09:22:51 +0000 @@ -52,6 +52,12 @@ public Set getAllAttributes(); + public Set getDataElementAttributes(); + + public Set getIndicatorAttributes(); + + public Set getOrganisationUnitAttributes(); + public int getAttributeCount(); public int getAttributeCountByName( String name ); === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java 2011-09-07 13:42:12 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java 2011-09-14 09:22:51 +0000 @@ -108,7 +108,7 @@ { return attributeStore.getByName( name ); } - + @Override public Set getAllAttributes() { @@ -116,6 +116,24 @@ } @Override + public Set getDataElementAttributes() + { + return attributeStore.getDataElementAttributes(); + } + + @Override + public Set getIndicatorAttributes() + { + return attributeStore.getIndicatorAttributes(); + } + + @Override + public Set getOrganisationUnitAttributes() + { + return attributeStore.getOrganisationUnitAttributes(); + } + + @Override public int getAttributeCount() { return attributeStore.getCount(); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java 2011-04-26 17:29:50 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java 2011-09-14 09:22:51 +0000 @@ -31,7 +31,11 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Map; +import org.hisp.dhis.attribute.AttributeService; +import org.hisp.dhis.attribute.AttributeValue; +import org.hisp.dhis.attribute.Attribute; import org.hisp.dhis.dataelement.DataElementCategoryCombo; import org.hisp.dhis.dataelement.DataElementCategoryService; import org.hisp.dhis.dataelement.DataElementGroup; @@ -52,7 +56,7 @@ // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - + private DataElementService dataElementService; public void setDataElementService( DataElementService dataElementService ) @@ -73,55 +77,73 @@ { this.organisationUnitService = organisationUnitService; } - + + private AttributeService attributeService; + + public void setAttributeService( AttributeService attributeService ) + { + this.attributeService = attributeService; + } + // ------------------------------------------------------------------------- // Input/output // ------------------------------------------------------------------------- - + private Collection dataElementGroups; - + public Collection getDataElementGroups() { return dataElementGroups; } - + private List dataElementCategoryCombos; - + public List getDataElementCategoryCombos() { return dataElementCategoryCombos; } private DataElementCategoryCombo defaultCategoryCombo; - + public DataElementCategoryCombo getDefaultCategoryCombo() { - return defaultCategoryCombo; + return defaultCategoryCombo; } - + private List organisationUnitLevels; public List getOrganisationUnitLevels() { return organisationUnitLevels; } - + + private List attributes; + + public List getAttributes() + { + return attributes; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- - + public String execute() - { - defaultCategoryCombo = dataElementCategoryService.getDataElementCategoryComboByName( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME ); - + { + defaultCategoryCombo = dataElementCategoryService + .getDataElementCategoryComboByName( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME ); + dataElementGroups = dataElementService.getAllDataElementGroups(); - - dataElementCategoryCombos = new ArrayList( dataElementCategoryService.getAllDataElementCategoryCombos() ); - + + dataElementCategoryCombos = new ArrayList( + dataElementCategoryService.getAllDataElementCategoryCombos() ); + Collections.sort( dataElementCategoryCombos, new DataElementCategoryComboNameComparator() ); - + organisationUnitLevels = organisationUnitService.getOrganisationUnitLevels(); - + + attributes = new ArrayList( attributeService.getDataElementAttributes() ); + return SUCCESS; } } === 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 2011-09-12 06:19:59 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2011-09-14 09:22:51 +0000 @@ -3,7 +3,7 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> - + @@ -57,6 +57,7 @@ + - + @@ -191,7 +192,7 @@ - + @@ -243,7 +244,7 @@ - + @@ -315,7 +316,7 @@ - + @@ -366,7 +367,7 @@ - + @@ -410,7 +411,7 @@ - + @@ -481,7 +482,7 @@ - + @@ -551,7 +552,7 @@ - + @@ -617,7 +618,7 @@ - + @@ -668,24 +669,24 @@ - + - - - + + + - + - + @@ -694,7 +695,7 @@ - +