=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/ConceptService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/ConceptService.java 2010-09-17 21:30:59 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/ConceptService.java 2010-12-20 17:34:30 +0000 @@ -29,6 +29,8 @@ import java.util.Collection; +import org.hisp.dhis.dataelement.DataElementCategory; + /** * @author Dang Duy Hieu * @version $Id ConceptService.java Aug 25, 2010$ @@ -59,4 +61,12 @@ // Concept expanding // ------------------------------------------------------------------------- + Collection getConceptsBetween( int first, int max ); + + Collection getConceptsBetweenByName( String name, int first, int max ); + + int getConceptCount(); + + int getConceptCountByName( String name ); + } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java 2010-12-07 17:02:27 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java 2010-12-20 17:34:30 +0000 @@ -348,4 +348,20 @@ */ Collection getFullOperands( Collection dataElements ); + + Collection getDataElementCategorysBetween( int first, int max ); + + Collection getDataElementCategorysBetweenByName( String name, int first, int max ); + + int getDataElementCategoryCount(); + + int getDataElementCategoryCountByName( String name ); + + Collection getDataElementCategoryCombosBetween( int first, int max ); + + Collection getDataElementCategoryCombosBetweenByName( String name, int first, int max ); + + int getDataElementCategoryComboCount(); + + int getDataElementCategoryComboCountByName( String name ); } === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/concept/DefaultConceptService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/concept/DefaultConceptService.java 2010-11-12 17:58:03 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/concept/DefaultConceptService.java 2010-12-20 17:34:30 +0000 @@ -92,4 +92,28 @@ Concept defaultConcept = new Concept( "default" ); conceptStore.save( defaultConcept ); } + + @Override + public int getConceptCount() + { + return conceptStore.getCount(); + } + + @Override + public int getConceptCountByName( String name ) + { + return conceptStore.getCountByName( name ); + } + + @Override + public Collection getConceptsBetween( int first, int max ) + { + return conceptStore.getBetween( first, max ); + } + + @Override + public Collection getConceptsBetweenByName( String name, int first, int max ) + { + return conceptStore.getBetweenByName( name, first, max ); + } } === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java 2010-12-07 17:02:27 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java 2010-12-20 17:34:30 +0000 @@ -682,4 +682,45 @@ return optionsMap; } + + public int getDataElementCategoryCount() + { + return dataElementCategoryStore.getCount(); + } + + public int getDataElementCategoryCountByName( String name ) + { + return dataElementCategoryStore.getCountByName( name ); + } + + public Collection getDataElementCategorysBetween( int first, int max ) + { + return dataElementCategoryStore.getBetween( first, max ); + } + + public Collection getDataElementCategorysBetweenByName( String name, int first, int max ) + { + return dataElementCategoryStore.getBetweenByName( name, first, max ); + } + + public int getDataElementCategoryComboCount() + { + return dataElementCategoryComboStore.getCount(); + } + + public int getDataElementCategoryComboCountByName( String name ) + { + return dataElementCategoryComboStore.getCountByName( name ); + } + + public Collection getDataElementCategoryCombosBetween( int first, int max ) + { + return dataElementCategoryComboStore.getBetween( first, max ); + } + + public Collection getDataElementCategoryCombosBetweenByName( String name, int first, + int max ) + { + return dataElementCategoryComboStore.getBetweenByName( name, first, max ); + } } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryListAction.java 2010-11-27 18:16:14 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryListAction.java 2010-12-20 17:34:30 +0000 @@ -27,22 +27,24 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import static org.apache.commons.lang.StringUtils.isNotBlank; + import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.hisp.dhis.datadictionary.DataDictionary; import org.hisp.dhis.dataelement.DataElementCategory; import org.hisp.dhis.dataelement.DataElementCategoryService; import org.hisp.dhis.dataelement.comparator.DataElementCategoryNameComparator; - -import com.opensymphony.xwork2.Action; +import org.hisp.dhis.paging.ActionPagingSupport; /** * @author Abyot Asalefew * @version $Id$ */ public class GetDataElementCategoryListAction - implements Action + extends ActionPagingSupport { // ------------------------------------------------------------------------- // Dependencies @@ -72,6 +74,18 @@ { return defaultCategory; } + + private String key; + + public String getKey() + { + return key; + } + + public void setKey( String key ) + { + this.key = key; + } // ------------------------------------------------------------------------- // Action implementation @@ -81,9 +95,19 @@ { defaultCategory = dataElementCategoryService.getDataElementCategoryByName( DataElementCategory.DEFAULT_NAME ); - dataElementCategories = new ArrayList( dataElementCategoryService - .getAllDataElementCategories() ); - + if ( isNotBlank( key ) ) // Filter on key only if set + { + this.paging = createPaging( dataElementCategoryService.getDataElementCategoryCountByName( key ) ); + + dataElementCategories = new ArrayList( dataElementCategoryService.getDataElementCategorysBetweenByName( key, paging.getStartPos(), paging.getPageSize() ) ); + } + else + { + this.paging = createPaging( dataElementCategoryService.getDataElementCategoryCount() ); + + dataElementCategories = new ArrayList( dataElementCategoryService.getDataElementCategorysBetween( paging.getStartPos(), paging.getPageSize() ) ); + } + Collections.sort( dataElementCategories, new DataElementCategoryNameComparator() ); return SUCCESS; === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboListAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboListAction.java 2010-12-20 17:34:30 +0000 @@ -27,13 +27,17 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import static org.apache.commons.lang.StringUtils.isNotBlank; + import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.hisp.dhis.datadictionary.DataDictionary; import org.hisp.dhis.dataelement.DataElementCategoryCombo; import org.hisp.dhis.dataelement.DataElementCategoryService; import org.hisp.dhis.dataelement.comparator.DataElementCategoryComboNameComparator; +import org.hisp.dhis.paging.ActionPagingSupport; import com.opensymphony.xwork2.Action; @@ -42,7 +46,7 @@ * @version $Id$ */ public class GetDataElementCategoryComboListAction - implements Action + extends ActionPagingSupport { // ------------------------------------------------------------------------- // Dependencies @@ -72,6 +76,18 @@ { return defaultCombo; } + private String key; + + public String getKey() + { + return key; + } + + public void setKey( String key ) + { + this.key = key; + } + // ------------------------------------------------------------------------- // Action implementation @@ -82,9 +98,19 @@ defaultCombo = dataElementCategoryService .getDataElementCategoryComboByName( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME ); - dataElementCategoryCombos = new ArrayList( dataElementCategoryService - .getAllDataElementCategoryCombos() ); - + if ( isNotBlank( key ) ) // Filter on key only if set + { + this.paging = createPaging( dataElementCategoryService.getDataElementCategoryComboCountByName( key ) ); + + dataElementCategoryCombos = new ArrayList( dataElementCategoryService.getDataElementCategoryCombosBetweenByName( key, paging.getStartPos(), paging.getPageSize() ) ); + } + else + { + this.paging = createPaging( dataElementCategoryService.getDataElementCategoryComboCount() ); + + dataElementCategoryCombos = new ArrayList( dataElementCategoryService.getDataElementCategoryCombosBetween( paging.getStartPos(), paging.getPageSize() ) ); + } + Collections.sort( dataElementCategoryCombos, new DataElementCategoryComboNameComparator() ); return SUCCESS; === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/concept/GetConceptListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/concept/GetConceptListAction.java 2010-11-27 18:16:14 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/concept/GetConceptListAction.java 2010-12-20 17:34:30 +0000 @@ -27,6 +27,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import static org.apache.commons.lang.StringUtils.isNotBlank; + import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -34,6 +36,8 @@ import org.hisp.dhis.concept.ConceptService; import org.hisp.dhis.concept.Concept; import org.hisp.dhis.concept.comparator.ConceptNameComparator; +import org.hisp.dhis.dataelement.DataElementCategoryCombo; +import org.hisp.dhis.paging.ActionPagingSupport; import com.opensymphony.xwork2.ActionSupport; @@ -42,7 +46,7 @@ * @version $Id$ */ public class GetConceptListAction - extends ActionSupport + extends ActionPagingSupport { // ------------------------------------------------------------------------- // Dependencies @@ -73,6 +77,18 @@ return defaultConcept; } + private String key; + + public String getKey() + { + return key; + } + + public void setKey( String key ) + { + this.key = key; + } + // ------------------------------------------------------------------------- // Action implemantation // ------------------------------------------------------------------------- @@ -81,8 +97,19 @@ { defaultConcept = conceptService.getConceptByName( Concept.DEFAULT_CONCEPT_NAME ); - concepts = new ArrayList( conceptService.getAllConcepts() ); - + if ( isNotBlank( key ) ) // Filter on key only if set + { + this.paging = createPaging( conceptService.getConceptCountByName( key ) ); + + concepts = new ArrayList( conceptService.getConceptsBetweenByName( key, paging.getStartPos(), paging.getPageSize() ) ); + } + else + { + this.paging = createPaging( conceptService.getConceptCount() ); + + concepts = new ArrayList( conceptService.getConceptsBetween( paging.getStartPos(), paging.getPageSize() ) ); + } + Collections.sort( concepts, new ConceptNameComparator() ); return SUCCESS; === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml 2010-12-13 06:40:41 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml 2010-12-20 17:34:30 +0000 @@ -803,6 +803,7 @@ /dhis-web-maintenance-datadictionary/multidimensional/category.vm /dhis-web-maintenance-datadictionary/menu.vm javascript/category.js + ../dhis-web-commons/paging/paging.css /dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm /dhis-web-maintenance-datadictionary/menu.vm javascript/categoryCombo.js + ../dhis-web-commons/paging/paging.css javascript/concept.js F_CONCEPT_MANAGEMENT + ../dhis-web-commons/paging/paging.css - +
$i18n.getString( "filter_by_name" ):
#filterDiv( "category" )
@@ -34,6 +34,8 @@ +

+ #parse( "/dhis-web-commons/paging/paging.vm" ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm 2010-12-03 05:41:34 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm 2010-12-20 17:34:30 +0000 @@ -5,7 +5,7 @@ - +
$i18n.getString( "filter_by_name" ):
#filterDiv( "categoryCombo" )
@@ -34,6 +34,8 @@ +

+ #parse( "/dhis-web-commons/paging/paging.vm" ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm 2010-12-03 05:41:34 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/concept.vm 2010-12-20 17:34:30 +0000 @@ -5,7 +5,7 @@ - +
$i18n.getString( "filter_by_name" ):
#filterDiv( "concept" )
@@ -33,6 +33,8 @@ #end +

+ #parse( "/dhis-web-commons/paging/paging.vm" )