dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #01373
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 401: Fixed bug related to preview of CompleteDataSetRegistrations
------------------------------------------------------------
revno: 401
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-06-30 16:52:21 +0200
message:
Fixed bug related to preview of CompleteDataSetRegistrations
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/CompleteDataSetRegistrationConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableOrganisationUnitConverter.java
dhis-2/pom.xml
=== 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 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java 2009-06-30 14:52:21 +0000
@@ -105,7 +105,12 @@
public DataSet()
{
}
-
+
+ public DataSet( String name )
+ {
+ this.name = name;
+ }
+
public DataSet( String name, PeriodType periodType )
{
this.name = name;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2009-06-28 15:32:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2009-06-30 14:52:21 +0000
@@ -85,6 +85,11 @@
{
}
+ public OrganisationUnit( String name )
+ {
+ this.name = name;
+ }
+
/**
* @param name
* @param shortName
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/CompleteDataSetRegistrationConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/CompleteDataSetRegistrationConverter.java 2009-06-24 13:16:07 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/CompleteDataSetRegistrationConverter.java 2009-06-30 14:52:21 +0000
@@ -45,8 +45,10 @@
import org.hisp.dhis.importexport.converter.AbstractCompleteDataSetRegistrationConverter;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.period.MonthlyPeriodType;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.source.Source;
import org.hisp.dhis.system.util.DateUtils;
@@ -64,7 +66,7 @@
private static final String FIELD_PERIOD = "period";
private static final String FIELD_SOURCE = "source";
private static final String FIELD_DATE = "date";
-
+
// -------------------------------------------------------------------------
// Properties
// -------------------------------------------------------------------------
@@ -79,6 +81,8 @@
private Map<Object, Integer> periodMapping;
private Map<Object, Integer> sourceMapping;
+ private PeriodType periodType;
+
// -------------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------------
@@ -120,6 +124,7 @@
this.dataSetMapping = dataSetMapping;
this.periodMapping = periodMapping;
this.sourceMapping = sourceMapping;
+ this.periodType = PeriodType.getPeriodTypeByName( MonthlyPeriodType.NAME );
}
// -------------------------------------------------------------------------
@@ -167,21 +172,22 @@
final CompleteDataSetRegistration registration = new CompleteDataSetRegistration();
- DataSet dataSet = new DataSet();
+ DataSet dataSet = new DataSet( "" );
registration.setDataSet( dataSet );
- Period period = new Period();
+ Period period = periodType.createPeriod();
registration.setPeriod( period );
- Source source = new OrganisationUnit();
+ Source source = new OrganisationUnit( "" );
registration.setSource( source );
registration.getDataSet().setId( dataSetMapping.get( Integer.parseInt( values.get( FIELD_DATASET ) ) ) );
registration.getPeriod().setId( periodMapping.get( Integer.parseInt( values.get( FIELD_PERIOD ) ) ) );
registration.getSource().setId( sourceMapping.get( Integer.parseInt( values.get( FIELD_SOURCE ) ) ) );
+
registration.setDate( DateUtils.getMediumDate( values.get( FIELD_DATE ) ) );
read( registration, GroupMemberType.NONE, params );
}
- }
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableOrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableOrganisationUnitConverter.java 2009-06-24 13:16:07 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableOrganisationUnitConverter.java 2009-06-30 14:52:21 +0000
@@ -56,7 +56,7 @@
public static final String ELEMENT_NAME = "reportTableOrganisationUnit";
private static final String FIELD_REPORTTABLE = "reportTable";
- private static final String FIELD_ORGANISTIONUNIT = "organisationUnit";
+ private static final String FIELD_ORGANISATIONUNIT = "organisationUnit";
private static final String FIELD_SORT_ORDER = "sortOrder";
// -------------------------------------------------------------------------
@@ -118,7 +118,7 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_REPORTTABLE, String.valueOf( reportTable.getId() ) );
- writer.writeElement( FIELD_ORGANISTIONUNIT, String.valueOf( unit.getId() ) );
+ writer.writeElement( FIELD_ORGANISATIONUNIT, String.valueOf( unit.getId() ) );
writer.writeElement( FIELD_SORT_ORDER, String.valueOf( sortOrder++ ) );
writer.closeElement();
@@ -139,10 +139,10 @@
final GroupMemberAssociation association = new GroupMemberAssociation( AssociationType.LIST );
association.setGroupId( reportTableMapping.get( Integer.parseInt( values.get( FIELD_REPORTTABLE ) ) ) );
- association.setMemberId( organisationUnitMapping.get( values.get( FIELD_ORGANISTIONUNIT ) ) );
- association.setSortOrder( Integer.parseInt( values.get( FIELD_ORGANISTIONUNIT ) ) );
+ association.setMemberId( organisationUnitMapping.get( Integer.parseInt( values.get( FIELD_ORGANISATIONUNIT ) ) ) );
+ association.setSortOrder( Integer.parseInt( values.get( FIELD_SORT_ORDER ) ) );
read( association, GroupMemberType.REPORTTABLE_ORGANISATIONUNIT, params );
}
- }
+ }
}
=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml 2009-06-29 15:07:39 +0000
+++ dhis-2/pom.xml 2009-06-30 14:52:21 +0000
@@ -274,7 +274,7 @@
<dependency>
<groupId>org.amplecode</groupId>
<artifactId>staxwax</artifactId>
- <version>1.0.6</version>
+ <version>1.0.7</version>
</dependency>
<dependency>
<groupId>org.amplecode</groupId>
--
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.