dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09376
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2470: Impl method getOperandsLikeName(String)
------------------------------------------------------------
revno: 2470
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-01-06 14:33:29 +0100
message:
Impl method getOperandsLikeName(String)
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java
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/DefaultDataElementService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js
--
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-api/src/main/java/org/hisp/dhis/common/GenericStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java 2011-01-06 13:33:29 +0000
@@ -76,6 +76,14 @@
T load( int id );
/**
+ * Retriveves a Collection of objects where the name is like the given name.
+ *
+ * @param name hte name.
+ * @return a Collection of objects.
+ */
+ Collection<T> getLikeName( String name );
+
+ /**
* Retrieves a Collection of all objects.
*
* @return a Collection of all objects.
=== 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-20 17:34:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java 2011-01-06 13:33:29 +0000
@@ -341,12 +341,19 @@
Collection<DataElementOperand> getOperands( Collection<DataElement> dataElements, boolean includeTotals );
/**
+ * Gets the Operands for the DataElements whith names like the given name.
+ *
+ * @param name the name.
+ * @return the Operands for the DataElements whith names like the given name.
+ */
+ Collection<DataElementOperand> getOperandsLikeName( String name );
+
+ /**
* Gets the Operands for the given Collection of DataElements. Operands will contain DataElement and CategoryOptionCombo object
*
* @param dataElements the Collection of DataElements.
* @return the Operands for the given Collection of DataElements.
*/
-
Collection<DataElementOperand> getFullOperands( Collection<DataElement> dataElements );
Collection<DataElementCategory> getDataElementCategorysBetween( int first, int max );
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2010-12-01 18:00:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2011-01-06 13:33:29 +0000
@@ -299,6 +299,8 @@
Collection<DataElement> getDataElementsByDataSets( Collection<DataSet> dataSets );
+ Collection<DataElement> getDataElementsLikeName( String name );
+
Collection<DataElement> getDataElementsBetween( int first, int max );
Collection<DataElement> getDataElementsBetweenByName( String name, int first, int max );
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java 2010-11-23 18:25:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java 2011-01-06 13:33:29 +0000
@@ -236,6 +236,8 @@
Collection<DataElement> getDataElementsByDataSets( Collection<DataSet> dataSets );
+ Collection<DataElement> getDataElementsLikeName( String name );
+
Collection<DataElement> getDataElementsBetween( int first, int max );
Collection<DataElement> getDataElementsBetweenByName( String name, int first, int 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-20 17:34:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java 2011-01-06 13:33:29 +0000
@@ -432,6 +432,13 @@
return getOperands( dataElements, false );
}
+ public Collection<DataElementOperand> getOperandsLikeName( String name )
+ {
+ Collection<DataElement> dataElements = dataElementService.getDataElementsLikeName( name );
+
+ return getOperands( dataElements );
+ }
+
public Collection<DataElementOperand> getFullOperands( Collection<DataElement> dataElements )
{
Collection<DataElementOperand> operands = new ArrayList<DataElementOperand>();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2010-12-01 18:00:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2011-01-06 13:33:29 +0000
@@ -357,6 +357,11 @@
{
return dataElementStore.dataElementCategoryOptionComboExists( id );
}
+
+ public Collection<DataElement> getDataElementsLikeName( String name )
+ {
+ return dataElementStore.getDataElementsLikeName( name );
+ }
public Collection<DataElement> getDataElementsBetween( int first, int max )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java 2010-11-23 18:25:34 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java 2011-01-06 13:33:29 +0000
@@ -272,7 +272,6 @@
if ( !dataElementIds.isEmpty() )
{
-
sql = "update DataElement set zeroIsSignificant=true where id in (:dataElementIds)";
query = session.createQuery( sql );
@@ -379,6 +378,11 @@
}
+ public Collection<DataElement> getDataElementsLikeName( String name )
+ {
+ return getLikeName( name );
+ }
+
public Collection<DataElement> getDataElementsBetween( int first, int max )
{
return getBetween( first, max );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java 2010-12-22 09:16:14 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java 2011-01-06 13:33:29 +0000
@@ -63,6 +63,7 @@
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
+
private StatementManager statementManager;
public void setStatementManager( StatementManager statementManager )
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2010-12-16 04:38:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2011-01-06 13:33:29 +0000
@@ -194,19 +194,50 @@
}
executeSql( "ALTER TABLE section DROP CONSTRAINT section_name_key" );
-
executeSql( "UPDATE patientattribute set inheritable=false where inheritable is null" );
-
executeSql( "UPDATE dataelement set numbertype='number' where numbertype is null and valuetype='int'" );
// revert prepare aggregateXXXValue tables for offline diffs
executeSql( "ALTER TABLE aggregateddatavalue DROP COLUMN modified");
-
executeSql( "ALTER TABLE aggregatedindicatorvalue DROP COLUMN modified ");
-
executeSql( "UPDATE indicatortype SET indicatornumber=false WHERE indicatornumber is null" );
+ // remove outdated relative periods
+
+ executeSql( "ALTER TABLE reporttable DROP COLUMN last3Months" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN last6Months" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN last12Months" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN soFarThisYear" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN last3To6Months" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN last6To9Months" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN last9To12Months" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN last12IndividualMonths" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN individualMonthsThisYear" );
+ executeSql( "ALTER TABLE reporttable DROP COLUMN individualQuartersThisYear" );
+
+ executeSql( "ALTER TABLE chart DROP COLUMN last3Months" );
+ executeSql( "ALTER TABLE chart DROP COLUMN last6Months" );
+ executeSql( "ALTER TABLE chart DROP COLUMN last12Months" );
+ executeSql( "ALTER TABLE chart DROP COLUMN soFarThisYear" );
+ executeSql( "ALTER TABLE chart DROP COLUMN last3To6Months" );
+ executeSql( "ALTER TABLE chart DROP COLUMN last6To9Months" );
+ executeSql( "ALTER TABLE chart DROP COLUMN last9To12Months" );
+ executeSql( "ALTER TABLE chart DROP COLUMN last12IndividualMonths" );
+ executeSql( "ALTER TABLE chart DROP COLUMN individualMonthsThisYear" );
+ executeSql( "ALTER TABLE chart DROP COLUMN individualQuartersThisYear" );
+
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN last3Months" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN last6Months" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN last12Months" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN soFarThisYear" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN last3To6Months" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN last6To9Months" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN last9To12Months" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN last12IndividualMonths" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN individualMonthsThisYear" );
+ executeSql( "ALTER TABLE datamartexport DROP COLUMN individualQuartersThisYear" );
+
log.info( "Tables updated" );
}
=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2010-11-23 18:25:34 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2011-01-06 13:33:29 +0000
@@ -220,6 +220,13 @@
}
@Override
+ @SuppressWarnings("unchecked")
+ public Collection<T> getLikeName( String name )
+ {
+ return getCriteria().add( Restrictions.ilike( "name", "%" + name + "%" ) ).list();
+ }
+
+ @Override
@SuppressWarnings( "unchecked" )
public final Collection<T> getAll()
{
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js 2011-01-06 12:40:57 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js 2011-01-06 13:33:29 +0000
@@ -96,13 +96,13 @@
{
setWaitMessage( i18n_please_wait );
- waitAndGetReportStatus( 2000 );
+ waitAndGetReportStatus( 1500 );
}
else
{
setWaitMessage( i18n_please_wait + " - " + statusMessage );
- waitAndGetReportStatus( 2000 );
+ waitAndGetReportStatus( 1500 );
}
}