dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09267
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2410: Cleanup
------------------------------------------------------------
revno: 2410
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2010-12-22 10:16:14 +0100
message:
Cleanup
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/ConceptService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/DailyPeriodType.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/resources/META-INF/dhis/beans.xml
dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridTest.java
resources/sql/integritychecks.sql
--
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/concept/ConceptService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/ConceptService.java 2010-12-20 17:34:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/ConceptService.java 2010-12-22 09:16:14 +0000
@@ -29,8 +29,6 @@
import java.util.Collection;
-import org.hisp.dhis.dataelement.DataElementCategory;
-
/**
* @author Dang Duy Hieu
* @version $Id ConceptService.java Aug 25, 2010$
@@ -67,6 +65,5 @@
int getConceptCount();
- int getConceptCountByName( String name );
-
+ int getConceptCountByName( String name );
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java 2010-12-22 04:05:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java 2010-12-22 09:16:14 +0000
@@ -96,7 +96,7 @@
private DataEntryForm dataEntryForm;
/**
- * Indicating custom data entry form.
+ * Indicating version number.
*/
private Integer version;
@@ -302,8 +302,4 @@
{
this.version = version;
}
-
-
-
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/DailyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/DailyPeriodType.java 2010-12-20 12:43:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/DailyPeriodType.java 2010-12-22 09:16:14 +0000
@@ -27,7 +27,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
=== 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 04:05:46 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java 2010-12-22 09:16:14 +0000
@@ -199,7 +199,6 @@
}
- @SuppressWarnings( "unchecked" )
public Collection<DataSet> getMobileDataSetsFromCategoryOption( int categoryOptionId )
{
StatementHolder holder = statementManager.getHolder();
@@ -210,9 +209,10 @@
{
Statement statement = holder.getStatement();
- ResultSet resultSet = statement
- .executeQuery( "select * from dataset where datasetid in (select DISTINCT datasetid from datasetmembers where dataelementid in (select dataelementid from dataelement where categorycomboid in (select categorycomboid from categorycombos_categories where categoryid in (select categoryid from categories_categoryoptions where categoryoptionid = '"
- + categoryOptionId + "')))) and (mobile = true and mobile is not null)" );
+ ResultSet resultSet = statement.executeQuery( "select * from dataset where datasetid in " +
+ "(select DISTINCT datasetid from datasetmembers where dataelementid in (select dataelementid from dataelement where categorycomboid in " +
+ "(select categorycomboid from categorycombos_categories where categoryid in (select categoryid from categories_categoryoptions where categoryoptionid = '"
+ + categoryOptionId + "')))) and (mobile = true and mobile is not null)" );
while ( resultSet.next() )
{
@@ -232,7 +232,6 @@
return mobileDataSets;
}
- @SuppressWarnings( "unchecked" )
public Collection<DataSet> getMobileDataSetsFromCategory( int categoryId )
{
StatementHolder holder = statementManager.getHolder();
@@ -243,9 +242,11 @@
{
Statement statement = holder.getStatement();
- ResultSet resultSet = statement
- .executeQuery( "select * from dataset where datasetid in (select DISTINCT datasetid from datasetmembers where dataelementid in (select dataelementid from dataelement where categorycomboid in (select categorycomboid from categorycombos_categories where categoryid ='"
- + categoryId + "'))) and (mobile = true and mobile is not null)" );
+ ResultSet resultSet = statement.executeQuery( "select * from dataset where datasetid in " +
+ "(select DISTINCT datasetid from datasetmembers where dataelementid in " +
+ "(select dataelementid from dataelement where categorycomboid in (select categorycomboid from categorycombos_categories where categoryid ='"
+ + categoryId + "'))) and (mobile = true and mobile is not null)" );
+
while ( resultSet.next() )
{
DataSet dataSet = getDataSet( resultSet.getInt( 1 ) );
@@ -262,6 +263,7 @@
}
return mobileDataSets;
}
+
// -------------------------------------------------------------------------
// FrequencyOverrideAssociation
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2010-12-22 04:05:46 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2010-12-22 09:16:14 +0000
@@ -422,11 +422,11 @@
<bean id="org.hisp.dhis.user.UserService" class="org.hisp.dhis.user.DefaultUserService">
<property name="userStore" ref="org.hisp.dhis.user.UserStore" />
</bean>
+
<bean id="org.hisp.dhis.user.UserGroupService" class="org.hisp.dhis.user.DefaultUserGroupService">
<property name="userGroupStore" ref="org.hisp.dhis.user.UserGroupStore" />
</bean>
-
<bean id="org.hisp.dhis.validation.ValidationCriteriaService"
class="org.hisp.dhis.validation.DefaultValidationCriteriaService">
<property name="validationCriteriaStore"
@@ -581,7 +581,6 @@
<value>name</value>
</list>
</property>
-
<property name="rulePropertyNames">
<map>
<entry key="name">
@@ -1228,13 +1227,11 @@
<ref local="org.hisp.dhis.startup.TableAlteror" />
<ref local="org.hisp.dhis.period.PeriodTypePopulator" />
<ref local="org.hisp.dhis.startup.TableCreator" />
- <ref
- local="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator" />
+ <ref local="org.hisp.dhis.dataelement.DataElementDefaultDimensionPopulator" />
<ref local="org.hisp.dhis.expression.MultiDimensionExpressionUpgrader" />
<ref local="org.hisp.dhis.dataset.DataSetShortNamePopulator" />
<ref local="org.hisp.dhis.dataelement.UuidPopulator" />
- <ref
- local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator" />
+ <ref local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetPopulator" />
<ref local="org.hisp.dhis.dataentryform.DataEntryFormPopulator" />
</list>
</list>
@@ -1282,8 +1279,7 @@
ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
</bean>
- <bean
- id="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler"
+ <bean id="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler"
class="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler">
<property name="categoryService"
ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
@@ -1294,8 +1290,7 @@
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
</bean>
- <bean
- id="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler"
+ <bean id="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler"
class="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler">
<property name="completeDataSetRegistrationService"
ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
@@ -1307,8 +1302,7 @@
<property name="sectionService" ref="org.hisp.dhis.dataset.SectionService" />
</bean>
- <bean
- id="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler"
+ <bean id="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler"
class="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler">
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
</bean>
@@ -1352,15 +1346,13 @@
<property name="jdbcTemplate" ref="jdbcTemplate" />
</bean>
- <bean
- id="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler"
+ <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler"
class="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler">
<property name="organisationUnitGroupService"
ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
</bean>
- <bean
- id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler"
+ <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler"
class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler">
<property name="organisationUnitGroupService"
ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
@@ -1446,60 +1438,33 @@
<property name="arguments">
<list>
<list>
- <ref
- local="org.hisp.dhis.datadictionary.DataDictionaryDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataelement.DataElementDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataelement.DataElementGroupDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataelement.DataElementCategoryOptionDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataelement.DataElementCategoryOptionComboDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataset.DataSetDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataset.SectionDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataentryform.DataEntryFormDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler" />
- <ref
- local="org.hisp.dhis.expression.ExpressionDeletionHandler" />
- <ref
- local="org.hisp.dhis.indicator.IndicatorDeletionHandler" />
- <ref
- local="org.hisp.dhis.indicator.IndicatorGroupDeletionHandler" />
- <ref
- local="org.hisp.dhis.minmax.MinMaxDataElementDeletionHandler" />
- <ref
- local="org.hisp.dhis.validation.ValidationRuleDeletionHandler" />
- <ref
- local="org.hisp.dhis.validation.ValidationRuleGroupDeletionHandler" />
- <ref
- local="org.hisp.dhis.datavalue.DataValueDeletionHandler" />
- <ref
- local="org.hisp.dhis.datavalue.DataValueAuditDeletionHandler" />
- <ref
- local="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler" />
- <ref
- local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler" />
- <ref
- local="org.hisp.dhis.user.UserDeletionHandler" />
- <ref
- local="org.hisp.dhis.user.UserAuthorityGroupDeletionHandler" />
- <ref
- local="org.hisp.dhis.user.UserCredentialsDeletionHandler" />
- <ref
- local="org.hisp.dhis.user.UserSettingDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataelement.DataElementCategoryDeletionHandler" />
- <ref
- local="org.hisp.dhis.dataelement.DataElementGroupSetDeletionHandler" />
+ <ref local="org.hisp.dhis.datadictionary.DataDictionaryDeletionHandler" />
+ <ref local="org.hisp.dhis.dataelement.DataElementDeletionHandler" />
+ <ref local="org.hisp.dhis.dataelement.DataElementGroupDeletionHandler" />
+ <ref local="org.hisp.dhis.dataelement.DataElementCategoryOptionDeletionHandler" />
+ <ref local="org.hisp.dhis.dataelement.DataElementCategoryOptionComboDeletionHandler" />
+ <ref local="org.hisp.dhis.dataelement.DataElementCategoryComboDeletionHandler" />
+ <ref local="org.hisp.dhis.dataset.DataSetDeletionHandler" />
+ <ref local="org.hisp.dhis.dataset.CompleteDataSetRegistrationDeletionHandler" />
+ <ref local="org.hisp.dhis.dataset.SectionDeletionHandler" />
+ <ref local="org.hisp.dhis.dataentryform.DataEntryFormDeletionHandler" />
+ <ref local="org.hisp.dhis.dataset.FrequencyOverrideAssociationDeletionHandler" />
+ <ref local="org.hisp.dhis.expression.ExpressionDeletionHandler" />
+ <ref local="org.hisp.dhis.indicator.IndicatorDeletionHandler" />
+ <ref local="org.hisp.dhis.indicator.IndicatorGroupDeletionHandler" />
+ <ref local="org.hisp.dhis.minmax.MinMaxDataElementDeletionHandler" />
+ <ref local="org.hisp.dhis.validation.ValidationRuleDeletionHandler" />
+ <ref local="org.hisp.dhis.validation.ValidationRuleGroupDeletionHandler" />
+ <ref local="org.hisp.dhis.datavalue.DataValueDeletionHandler" />
+ <ref local="org.hisp.dhis.datavalue.DataValueAuditDeletionHandler" />
+ <ref local="org.hisp.dhis.organisationunit.OrganisationUnitGroupDeletionHandler" />
+ <ref local="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetDeletionHandler" />
+ <ref local="org.hisp.dhis.user.UserDeletionHandler" />
+ <ref local="org.hisp.dhis.user.UserAuthorityGroupDeletionHandler" />
+ <ref local="org.hisp.dhis.user.UserCredentialsDeletionHandler" />
+ <ref local="org.hisp.dhis.user.UserSettingDeletionHandler" />
+ <ref local="org.hisp.dhis.dataelement.DataElementCategoryDeletionHandler" />
+ <ref local="org.hisp.dhis.dataelement.DataElementGroupSetDeletionHandler" />
</list>
</list>
</property>
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridTest.java 2010-09-03 12:44:40 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/grid/GridTest.java 2010-12-22 09:16:14 +0000
@@ -30,18 +30,20 @@
import java.util.ArrayList;
import java.util.List;
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static junit.framework.Assert.*;
/**
* @author Lars Helge Overland
* @version $Id$
*/
public class GridTest
- extends TestCase
{
private ListGrid grid;
- @Override
+ @Before
public void setUp()
{
grid = new ListGrid();
@@ -62,16 +64,19 @@
grid.addValue( "33" );
}
+ @Test
public void testGetHeight()
{
assertEquals( 3, grid.getHeight() );
}
+ @Test
public void testGetWidth()
{
assertEquals( 3, grid.getWidth() );
}
+ @Test
public void testGetRow()
{
List<String> rowA = grid.getRow( 0 );
@@ -89,11 +94,13 @@
assertTrue( rowB.contains( "23" ) );
}
+ @Test
public void testGetRows()
{
assertEquals( 3, grid.getRows().size() );
}
+ @Test
public void testGetColumn()
{
List<String> columnB = grid.getColumn( 1 );
@@ -111,6 +118,7 @@
assertTrue( columnC.contains( "33" ) );
}
+ @Test
public void testAddColumn()
{
List<String> columnValues = new ArrayList<String>( 3 );
@@ -136,6 +144,7 @@
assertTrue( rowB.contains( "24" ) );
}
+ @Test
public void testAddRegressionColumn()
{
grid = new ListGrid();
=== modified file 'resources/sql/integritychecks.sql'
--- resources/sql/integritychecks.sql 2010-12-12 17:09:27 +0000
+++ resources/sql/integritychecks.sql 2010-12-22 09:16:14 +0000
@@ -41,3 +41,11 @@
join orgunitgroupmembers m using(orgunitgroupid)
join organisationunit o using (organisationunitid)
where o.name = 'Mandera District Hospital';
+
+-- Get reports which uses report table
+
+select * from report r
+join reportreporttables rr using(reportid)
+join reporttable t using(reporttableid)
+where t.name='Indicators';
+