dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #05527
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1798: Clean up the code, apply the DHIS 2 code convention.
------------------------------------------------------------
revno: 1798
committer: Quang <Quang@Quang-PC>
branch nick: trunk
timestamp: Wed 2010-04-21 21:32:54 +0700
message:
Clean up the code, apply the DHIS 2 code convention.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataprune/DataPruneService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueAuditService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationDeletionHandler.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DataSetDeletionHandler.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DataValueAuditDeletionHandler.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueAuditStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PatientIdentifierDeletionHandler.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/ChartDeletionHandler.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableDeletionHandler.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveValueAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataprune/PruneOrganisationUnitAction.java
--
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/dataprune/DataPruneService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataprune/DataPruneService.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataprune/DataPruneService.java 2010-04-21 14:32:54 +0000
@@ -29,7 +29,6 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
-
/**
* @author Quang Nguyen
* @version Apr 6, 2010 5:44:47 PM
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueAuditService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueAuditService.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueAuditService.java 2010-04-21 14:32:54 +0000
@@ -46,9 +46,9 @@
void deleteDataValueAudit( DataValueAudit dataValueAudit );
int deleteDataValueAuditByDataValue( DataValue dataValue );
-
+
void deleteDataValueAuditBySource( Source source );
-
+
void deleteDataValueAuditByDataElement( DataElement dataElement );
Collection<DataValueAudit> getDataValueAuditByDataValue( DataValue dataValue );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationDeletionHandler.java 2010-04-20 13:16:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationDeletionHandler.java 2010-04-21 14:32:54 +0000
@@ -45,7 +45,8 @@
public CompleteDataSetRegistrationService completeDataSetRegistrationService;
- public void setCompleteDataSetRegistrationService( CompleteDataSetRegistrationService completeDataSetRegistrationService )
+ public void setCompleteDataSetRegistrationService(
+ CompleteDataSetRegistrationService completeDataSetRegistrationService )
{
this.completeDataSetRegistrationService = completeDataSetRegistrationService;
}
@@ -66,27 +67,28 @@
{
return CompleteDataSetRegistration.class.getSimpleName();
}
-
+
@Override
public void deleteDataSet( DataSet dataSet )
{
completeDataSetRegistrationService.deleteCompleteDataSetRegistrations( dataSet );
}
-
+
@Override
public boolean allowDeletePeriod( Period period )
- {
+ {
String sql = "SELECT COUNT(*) FROM completedatasetregistration where periodid=" + period.getId();
-
+
return jdbcTemplate.queryForInt( sql ) == 0;
}
-
+
@Override
public void deleteSource( Source source )
{
- for(CompleteDataSetRegistration registration : completeDataSetRegistrationService.getAllCompleteDataSetRegistrations())
+ for ( CompleteDataSetRegistration registration : completeDataSetRegistrationService
+ .getAllCompleteDataSetRegistrations() )
{
- if(registration.getSource().equals( source ))
+ if ( registration.getSource().equals( source ) )
{
completeDataSetRegistrationService.deleteCompleteDataSetRegistration( registration );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DataSetDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DataSetDeletionHandler.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DataSetDeletionHandler.java 2010-04-21 14:32:54 +0000
@@ -44,7 +44,7 @@
// -------------------------------------------------------------------------
private DataSetService dataSetService;
-
+
public void setDataSetService( DataSetService dataSetService )
{
this.dataSetService = dataSetService;
@@ -59,7 +59,7 @@
{
return DataSet.class.getSimpleName();
}
-
+
@Override
public void deleteDataElement( DataElement dataElement )
{
@@ -71,7 +71,7 @@
}
}
}
-
+
@Override
public void deleteSource( Source source )
{
@@ -83,7 +83,7 @@
}
}
}
-
+
@Override
public void deletePeriod( Period period )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DataValueAuditDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DataValueAuditDeletionHandler.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DataValueAuditDeletionHandler.java 2010-04-21 14:32:54 +0000
@@ -48,7 +48,6 @@
this.dataValueAuditService = dataValueAuditService;
}
-
// -------------------------------------------------------------------------
// DeletionHandler implementation
// -------------------------------------------------------------------------
@@ -58,11 +57,11 @@
{
return DataValueAudit.class.getSimpleName();
}
-
+
@Override
public boolean allowDeleteDataValue( DataValue dataValue )
{
return dataValueAuditService.getDataValueAuditByDataValue( dataValue ).size() == 0;
}
-
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java 2010-04-21 14:32:54 +0000
@@ -119,7 +119,7 @@
@Transactional
public int deleteDataValuesBySource( Source source )
{
- dataValueAuditService.deleteDataValueAuditBySource(source);
+ dataValueAuditService.deleteDataValueAuditBySource( source );
return dataValueStore.deleteDataValuesBySource( source );
}
@@ -128,7 +128,7 @@
public int deleteDataValuesByDataElement( DataElement dataElement )
{
dataValueAuditService.deleteDataValueAuditByDataElement( dataElement );
-
+
return dataValueStore.deleteDataValuesByDataElement( dataElement );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueAuditStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueAuditStore.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueAuditStore.java 2010-04-21 14:32:54 +0000
@@ -85,8 +85,9 @@
public void deleteDataValueAuditBySource( Source source )
{
- for(DataValueAudit each : getAll()) {
- if(each.getDataValue().getSource().equals( source ))
+ for ( DataValueAudit each : getAll() )
+ {
+ if ( each.getDataValue().getSource().equals( source ) )
{
deleteDataValueAudit( each );
}
@@ -116,8 +117,9 @@
public void deleteDataValueAuditByDataElement( DataElement dataElement )
{
- for(DataValueAudit each : getAll()) {
- if(each.getDataValue().getDataElement().equals( dataElement ))
+ for ( DataValueAudit each : getAll() )
+ {
+ if ( each.getDataValue().getDataElement().equals( dataElement ) )
{
deleteDataValueAudit( each );
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PatientIdentifierDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PatientIdentifierDeletionHandler.java 2010-04-20 13:16:00 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PatientIdentifierDeletionHandler.java 2010-04-21 14:32:54 +0000
@@ -48,7 +48,7 @@
{
this.patientIdentifierService = patientIdentifierService;
}
-
+
// -------------------------------------------------------------------------
// DeletionHandler implementation
// -------------------------------------------------------------------------
@@ -62,7 +62,8 @@
@Override
public void deleteSource( Source source )
{
- for ( PatientIdentifier patientIdentifier : patientIdentifierService.getPatientIdentifiersByOrgUnit( (OrganisationUnit) source ) )
+ for ( PatientIdentifier patientIdentifier : patientIdentifierService
+ .getPatientIdentifiersByOrgUnit( (OrganisationUnit) source ) )
{
patientIdentifierService.deletePatientIdentifier( patientIdentifier );
}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/ChartDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/ChartDeletionHandler.java 2010-04-20 13:16:00 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/ChartDeletionHandler.java 2010-04-21 14:32:54 +0000
@@ -59,7 +59,7 @@
{
return Chart.class.getSimpleName();
}
-
+
@Override
public boolean allowDeleteIndicator( Indicator indicator )
{
@@ -70,10 +70,10 @@
return false;
}
}
-
+
return true;
}
-
+
@Override
public boolean allowDeletePeriod( Period period )
{
@@ -84,10 +84,10 @@
return false;
}
}
-
+
return true;
}
-
+
@Override
public void deleteSource( Source source )
{
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableDeletionHandler.java 2010-04-20 13:16:00 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableDeletionHandler.java 2010-04-21 14:32:54 +0000
@@ -61,7 +61,7 @@
{
return ReportTable.class.getSimpleName();
}
-
+
@Override
public boolean allowDeleteDataElement( DataElement dataElement )
{
@@ -72,10 +72,10 @@
return false;
}
}
-
+
return true;
}
-
+
@Override
public boolean allowDeleteIndicator( Indicator indicator )
{
@@ -86,10 +86,10 @@
return false;
}
}
-
+
return true;
}
-
+
@Override
public boolean allowDeleteDataSet( DataSet dataSet )
{
@@ -100,7 +100,7 @@
return false;
}
}
-
+
return true;
}
@@ -114,16 +114,16 @@
return false;
}
}
-
+
return true;
}
@Override
public void deleteSource( Source source )
{
- for(ReportTable reportTable : reportTableService.getAllReportTables())
+ for ( ReportTable reportTable : reportTableService.getAllReportTables() )
{
- if(reportTable.getUnits().remove( source ))
+ if ( reportTable.getUnits().remove( source ) )
{
reportTableService.updateReportTable( reportTable );
}
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java 2010-04-21 14:32:54 +0000
@@ -218,9 +218,9 @@
isHistoryValid = false;
}
- /*
- * Data Value Audit
- */
+ // ---------------------------------------------------------------------
+ // Data Value Audit
+ // ---------------------------------------------------------------------
dataValueAudits = dataValueAuditService.getDataValueAuditByDataValue( dataValue );
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveValueAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveValueAction.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveValueAction.java 2010-04-21 14:32:54 +0000
@@ -207,9 +207,10 @@
dataValueService.updateDataValue( dataValue );
- /*
- * Add DataValueAudit
- */
+ // ---------------------------------------------------------------------
+ // Add DataValueAudit
+ // ---------------------------------------------------------------------
+
if ( value != null )
{
dataValueAuditService.addDataValueAudit( audit );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataprune/PruneOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataprune/PruneOrganisationUnitAction.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataprune/PruneOrganisationUnitAction.java 2010-04-21 14:32:54 +0000
@@ -55,7 +55,7 @@
{
this.dataPruneService = dataPruneService;
}
-
+
private OrganisationUnitService organisationUnitService;
public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -68,7 +68,7 @@
// -------------------------------------------------------------------------
private Integer organisationUnitSelected;
-
+
public void setOrganisationUnitSelected( Integer organisationUnitSelected )
{
this.organisationUnitSelected = organisationUnitSelected;
@@ -81,12 +81,12 @@
{
OrganisationUnit kept = organisationUnitService.getOrganisationUnit( organisationUnitSelected );
- log.info( "Pruning Organisation Unit, " + kept + " is kept");
-
+ log.info( "Pruning Organisation Unit, " + kept + " is kept" );
+
dataPruneService.pruneOrganisationUnit( kept );
-
+
log.info( "Pruning complete" );
-
+
return SUCCESS;
}
}