dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #06086
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1900: Implemented DXF export of featureType and coordinates. Feature type will typically be Point, Poly...
------------------------------------------------------------
revno: 1900
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Tue 2010-05-25 19:36:53 +0200
message:
Implemented DXF export of featureType and coordinates. Feature type will typically be Point, Polygon and MultiPolygon. Coordinates are represented in the database schema as a text attribute containing coordinates in javascript/geojson notation. Coordinates are represented in the XML schema as <coordinate> elements within a <coordinates> parent element inside <organisationUnit>.
added:
dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/
dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitTest.java
dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf/DXFOrganisationUnitsTest.java
dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractOrganisationUnitConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/IndicatorBatchHandler.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitBatchHandler.java
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.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/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java 2010-05-25 17:36:53 +0000
@@ -28,10 +28,13 @@
*/
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.hisp.dhis.dimension.DimensionOption;
import org.hisp.dhis.dimension.DimensionOptionElement;
@@ -44,6 +47,8 @@
public class OrganisationUnit
extends Source implements DimensionOptionElement
{
+ private static final Pattern COORDINATE_PATTERN = Pattern.compile( "(\\[{3}.*?\\]{3})" );
+
private Set<OrganisationUnit> children = new HashSet<OrganisationUnit>();
private OrganisationUnit parent;
@@ -57,12 +62,10 @@
private String comment;
private String geoCode;
-
- private String polygonCoordinates;
-
- private String latitude;
-
- private String longitude;
+
+ private String featureType;
+
+ private String coordinates;
private String url;
@@ -144,12 +147,52 @@
public boolean hasCoordinates()
{
- return latitude != null && latitude.trim().length() > 0 && longitude != null && longitude.trim().length() > 0;
- }
-
- public boolean hasPolygonCoordinates()
- {
- return polygonCoordinates != null && polygonCoordinates.trim().length() > 0;
+ return coordinates != null && coordinates.trim().length() > 0;
+ }
+
+ public Collection<String> getCoordinatesAsCollection()
+ {
+ Collection<String> collection = new ArrayList<String>();
+
+ if ( coordinates != null && !coordinates.trim().isEmpty() )
+ {
+ Matcher matcher = COORDINATE_PATTERN.matcher( coordinates );
+
+ while ( matcher.find() )
+ {
+ collection.add( matcher.group().replaceAll( "\\]\\,", "] " ).replaceAll( "[\\[\\]]", "" ) );
+ }
+ }
+
+ return collection;
+ }
+
+ public void setCoordinatesFromCollection( Collection<String> collection )
+ {
+ StringBuilder builder = new StringBuilder();
+
+ if ( collection != null && collection.size() > 0 )
+ {
+ builder.append( "[" );
+
+ for ( String c : collection )
+ {
+ builder.append( "[[" );
+
+ for ( String coordinate : c.split( "\\s" ) )
+ {
+ builder.append( "[" + coordinate + "]," );
+ }
+
+ builder.deleteCharAt( builder.lastIndexOf( "," ) );
+ builder.append( "]]," );
+ }
+
+ builder.deleteCharAt( builder.lastIndexOf( "," ) );
+ builder.append( "]" );
+ }
+
+ this.coordinates = builder.toString();
}
// -------------------------------------------------------------------------
@@ -295,34 +338,24 @@
this.geoCode = geoCode;
}
- public String getPolygonCoordinates()
- {
- return polygonCoordinates;
- }
-
- public void setPolygonCoordinates( String polygonCoordinates )
- {
- this.polygonCoordinates = polygonCoordinates;
- }
-
- public String getLatitude()
- {
- return latitude;
- }
-
- public void setLatitude( String latitude )
- {
- this.latitude = latitude;
- }
-
- public String getLongitude()
- {
- return longitude;
- }
-
- public void setLongitude( String longitude )
- {
- this.longitude = longitude;
+ public String getFeatureType()
+ {
+ return featureType;
+ }
+
+ public void setFeatureType( String featureType )
+ {
+ this.featureType = featureType;
+ }
+
+ public String getCoordinates()
+ {
+ return coordinates;
+ }
+
+ public void setCoordinates( String coordinates )
+ {
+ this.coordinates = coordinates;
}
public String getUrl()
=== added directory 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit'
=== added file 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitTest.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitTest.java 2010-05-25 17:36:53 +0000
@@ -0,0 +1,78 @@
+package org.hisp.dhis.organisationunit;
+
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static junit.framework.Assert.*;
+
+/**
+ * @author Lars Helge Overland
+ */
+public class OrganisationUnitTest
+{
+ private List<String> coordinatesCollection = new ArrayList<String>();
+
+ private String coordinates = "[[[[11.11,22.22],[33.33,44.44],[55.55,66.66]]],[[[77.77,88.88],[99.99,11.11],[22.22,33.33]]],[[[44.44,55.55],[66.66,77.77],[88.88,99.99]]]]";
+
+ @Before
+ public void before()
+ {
+ coordinatesCollection.add( "11.11,22.22 33.33,44.44 55.55,66.66" );
+ coordinatesCollection.add( "77.77,88.88 99.99,11.11 22.22,33.33" );
+ coordinatesCollection.add( "44.44,55.55 66.66,77.77 88.88,99.99" );
+ }
+
+ @Test
+ public void testGetCoordinatesAsCollection()
+ {
+ OrganisationUnit unit = new OrganisationUnit();
+ unit.setCoordinates( coordinates );
+
+ Collection<String> actual = unit.getCoordinatesAsCollection();
+
+ assertEquals( 3, actual.size() );
+ assertTrue( actual.contains( coordinatesCollection.get( 0 ) ) );
+ assertTrue( actual.contains( coordinatesCollection.get( 1 ) ) );
+ assertTrue( actual.contains( coordinatesCollection.get( 2 ) ) );
+ }
+
+ @Test
+ public void testSetCoordinatesFromCollection()
+ {
+ OrganisationUnit unit = new OrganisationUnit();
+ unit.setCoordinatesFromCollection( coordinatesCollection );
+
+ assertEquals( coordinates, unit.getCoordinates() );
+ }
+}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml 2010-02-16 13:47:02 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml 2010-05-25 17:36:53 +0000
@@ -43,11 +43,9 @@
<property name="geoCode"/>
- <property name="polygonCoordinates" type="text"/>
-
- <property name="latitude"/>
-
- <property name="longitude"/>
+ <property name="featureType"/>
+
+ <property name="coordinates" type="text"/>
<property name="url"/>
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractOrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractOrganisationUnitConverter.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractOrganisationUnitConverter.java 2010-05-25 17:36:53 +0000
@@ -117,6 +117,14 @@
{
return false;
}
+ if ( !isSimiliar( object.getFeatureType(), existing.getFeatureType() ) || ( isNotNull( object.getFeatureType(), existing.getFeatureType() ) && !object.getFeatureType().equals( existing.getFeatureType() ) ) )
+ {
+ return false;
+ }
+ if ( !isSimiliar( object.getCoordinates(), existing.getCoordinates() ) || ( isNotNull( object.getCoordinates(), existing.getCoordinates() ) && !object.getCoordinates().equals( existing.getCoordinates() ) ) )
+ {
+ return false;
+ }
return true;
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-05-19 09:48:29 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2010-05-25 17:36:53 +0000
@@ -27,8 +27,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.importexport.ImportParams.MINOR_VERSION_11;
+
+import java.util.ArrayList;
import java.util.Collection;
-import java.util.Map;
import org.amplecode.quick.BatchHandler;
import org.amplecode.staxwax.reader.XMLReader;
@@ -65,9 +67,9 @@
private static final String FIELD_ACTIVE = "active";
private static final String FIELD_COMMENT = "comment";
private static final String FIELD_GEO_CODE = "geoCode";
- private static final String FIELD_POLYGON_COORDINATES = "polygonCoordinates";
- private static final String FIELD_LATITUDE = "latitude";
- private static final String FIELD_LONGITUDE = "longitude";
+ private static final String FIELD_COORDINATES = "coordinates";
+ private static final String FIELD_COORDINATE = "coordinate";
+ private static final String FIELD_FEATURE_TYPE = "featureType";
private static final String FIELD_LAST_UPDATED = "lastUpdated";
// -------------------------------------------------------------------------
@@ -126,9 +128,15 @@
writer.writeElement( FIELD_ACTIVE, String.valueOf( unit.isActive() ) );
writer.writeElement( FIELD_COMMENT, unit.getComment() );
writer.writeElement( FIELD_GEO_CODE, unit.getGeoCode() );
- writer.writeElement( FIELD_POLYGON_COORDINATES, unit.getPolygonCoordinates() );
- writer.writeElement( FIELD_LATITUDE, unit.getLatitude() );
- writer.writeElement( FIELD_LONGITUDE, unit.getLongitude() );
+ writer.writeElement( FIELD_FEATURE_TYPE, unit.getFeatureType() );
+
+ writer.openElement( FIELD_COORDINATES );
+ for ( String coordinate : unit.getCoordinatesAsCollection() )
+ {
+ writer.writeElement( FIELD_COORDINATE, coordinate );
+ }
+ writer.closeElement();
+
writer.writeElement( FIELD_LAST_UPDATED, DateUtils.getMediumDateString( unit.getLastUpdated(), EMPTY ) );
writer.closeElement();
@@ -142,24 +150,53 @@
{
while ( reader.moveToStartElement( ELEMENT_NAME, COLLECTION_NAME ) )
{
- final Map<String, String> values = reader.readElements( ELEMENT_NAME );
-
final OrganisationUnit unit = new OrganisationUnit();
- unit.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
- unit.setUuid( values.get( FIELD_UUID ) );
- unit.setName( values.get( FIELD_NAME ) );
- unit.setShortName( values.get( FIELD_SHORT_NAME ) );
- unit.setCode( values.get( FIELD_CODE ) );
- unit.setOpeningDate( DateUtils.getMediumDate( values.get( FIELD_OPENING_DATE ) ) );
- unit.setClosedDate( DateUtils.getMediumDate( values.get( FIELD_CLOSED_DATE ) ) );
- unit.setActive( Boolean.parseBoolean( values.get( FIELD_ACTIVE ) ) );
- unit.setComment( values.get( FIELD_COMMENT ) );
- unit.setGeoCode( values.get( FIELD_GEO_CODE ) );
- unit.setPolygonCoordinates( values.get( FIELD_POLYGON_COORDINATES ) );
- unit.setLatitude( values.get( FIELD_LATITUDE ) );
- unit.setLongitude( values.get( FIELD_LONGITUDE ) );
- unit.setLastUpdated( DateUtils.getMediumDate( values.get( FIELD_LAST_UPDATED ) ) );
+ reader.moveToStartElement( FIELD_ID );
+ unit.setId( Integer.parseInt( reader.getElementValue() ) );
+
+ reader.moveToStartElement( FIELD_UUID );
+ unit.setUuid( reader.getElementValue() );
+
+ reader.moveToStartElement( FIELD_NAME );
+ unit.setName(reader.getElementValue() );
+
+ reader.moveToStartElement( FIELD_SHORT_NAME );
+ unit.setShortName( reader.getElementValue() );
+
+ reader.moveToStartElement( FIELD_CODE );
+ unit.setCode( reader.getElementValue() );
+
+ reader.moveToStartElement( FIELD_OPENING_DATE );
+ unit.setOpeningDate( DateUtils.getMediumDate( reader.getElementValue() ) );
+
+ reader.moveToStartElement( FIELD_CLOSED_DATE );
+ unit.setOpeningDate( DateUtils.getMediumDate( reader.getElementValue() ) );
+
+ reader.moveToStartElement( FIELD_ACTIVE );
+ unit.setActive( Boolean.parseBoolean( reader.getElementValue() ) );
+
+ reader.moveToStartElement( FIELD_COMMENT );
+ unit.setComment( reader.getElementValue() );
+
+ if ( params.minorVersionGreaterOrEqual( MINOR_VERSION_11 ) )
+ {
+ reader.moveToStartElement( FIELD_GEO_CODE );
+ unit.setGeoCode( reader.getElementValue() );
+
+ reader.moveToStartElement( FIELD_FEATURE_TYPE );
+ unit.setFeatureType( reader.getElementValue() );
+
+ Collection<String> coordinates = new ArrayList<String>();
+ while ( reader.moveToStartElement( FIELD_COORDINATE, FIELD_COORDINATES ) )
+ {
+ coordinates.add( reader.getElementValue() );
+ }
+ unit.setCoordinatesFromCollection( coordinates );
+
+ reader.moveToStartElement( FIELD_LAST_UPDATED );
+ unit.setLastUpdated( DateUtils.getMediumDate( reader.getElementValue() ) );
+ }
NameMappingUtil.addOrganisationUnitMapping( unit.getId(), unit.getName() );
=== added file 'dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf/DXFOrganisationUnitsTest.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf/DXFOrganisationUnitsTest.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf/DXFOrganisationUnitsTest.java 2010-05-25 17:36:53 +0000
@@ -0,0 +1,91 @@
+package org.hisp.dhis.importexport.dxf;
+
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+
+import org.hisp.dhis.DhisTest;
+import org.hisp.dhis.external.location.LocationManagerException;
+import org.hisp.dhis.importexport.ImportParams;
+import org.hisp.dhis.importexport.ImportService;
+import org.hisp.dhis.importexport.ImportStrategy;
+import org.hisp.dhis.importexport.util.ImportExportUtils;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.junit.Test;
+
+import static junit.framework.Assert.*;
+
+/**
+ * @author Lars Helge Overland
+ */
+public class DXFOrganisationUnitsTest
+ extends DhisTest
+{
+ private InputStream inputStream;
+
+ private ImportService importService;
+
+ @Override
+ public void setUpTest() throws LocationManagerException, IOException
+ {
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+
+ inputStream = classLoader.getResourceAsStream( "dxfOrganisationUnits.xml" );
+
+ organisationUnitService = (OrganisationUnitService) getBean( OrganisationUnitService.ID );
+ }
+
+ @Override
+ public void tearDownTest()
+ throws Exception
+ {
+ inputStream.close();
+ }
+
+ @Test
+ public void testImportOrganisationUnits() throws Exception
+ {
+ importService = (ImportService) getBean( "org.hisp.dhis.importexport.XMLImportService" );
+
+ ImportParams params = ImportExportUtils.getImportParams( ImportStrategy.NEW_AND_UPDATES, false, false, false );
+
+ importService.importData( params, inputStream );
+
+ Collection<OrganisationUnit> units = organisationUnitService.getAllOrganisationUnits();
+ OrganisationUnit unit = units.iterator().next();
+
+ assertNotNull( units );
+ assertEquals( 3, units.size() );
+ assertEquals( "GeoCode", unit.getGeoCode() );
+ assertEquals( "MultiPolygon", unit.getFeatureType() );
+ assertEquals( "[[[[11.11,22.22],[33.33,44.44],[55.55,66.66]]],[[[77.77,88.88],[99.99,11.11],[22.22,33.33]]],[[[44.44,55.55],[66.66,77.77],[88.88,99.99]]]]", unit.getCoordinates() );
+ }
+}
=== added file 'dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfOrganisationUnits.xml 2010-05-25 17:36:53 +0000
@@ -0,0 +1,61 @@
+<dxf xmlns="http://dhis2.org/schema/dxf/1.0" minorVersion="1.1" exported="2010-05-25">
+<organisationUnits>
+<organisationUnit>
+<id>226246</id>
+<uuid>0013311A-8A52-4530-9A64-EFA023E5A252</uuid>
+<name>NameA</name>
+<shortName>ShortNameA</shortName>
+<code>CodeA</code>
+<openingDate>1994-01-01</openingDate>
+<closedDate></closedDate>
+<active>true</active>
+<comment>Comment</comment>
+<geoCode>GeoCode</geoCode>
+<featureType>MultiPolygon</featureType>
+<coordinates>
+<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
+<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
+<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
+</coordinates>
+<lastUpdated>2010-01-01</lastUpdated>
+</organisationUnit>
+<organisationUnit>
+<id>226246</id>
+<uuid>0013311A-8A52-4530-9A64-EFA023E5A253</uuid>
+<name>NameB</name>
+<shortName>ShortNameB</shortName>
+<code>CodeB</code>
+<openingDate>1994-01-01</openingDate>
+<closedDate></closedDate>
+<active>true</active>
+<comment>Comment</comment>
+<geoCode>GeoCode</geoCode>
+<featureType>MultiPolygon</featureType>
+<coordinates>
+<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
+<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
+<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
+</coordinates>
+<lastUpdated>2010-01-01</lastUpdated>
+</organisationUnit>
+<organisationUnit>
+<id>226246</id>
+<uuid>0013311A-8A52-4530-9A64-EFA023E5A254</uuid>
+<name>NameC</name>
+<shortName>ShortNameC</shortName>
+<code>CodeC</code>
+<openingDate>1994-01-01</openingDate>
+<closedDate></closedDate>
+<active>true</active>
+<comment>Comment</comment>
+<geoCode>GeoCode</geoCode>
+<featureType>MultiPolygon</featureType>
+<coordinates>
+<coordinate>11.11,22.22 33.33,44.44 55.55,66.66</coordinate>
+<coordinate>77.77,88.88 99.99,11.11 22.22,33.33</coordinate>
+<coordinate>44.44,55.55 66.66,77.77 88.88,99.99</coordinate>
+</coordinates>
+<lastUpdated>2010-01-01</lastUpdated>
+</organisationUnit>
+</organisationUnits>
+</dxf>
\ No newline at end of file
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java 2010-05-25 17:36:53 +0000
@@ -105,7 +105,7 @@
statementBuilder.setColumn( "extendeddataelementid" );
statementBuilder.setColumn( "categorycomboid" );
statementBuilder.setColumn( "sortorder" );
- statementBuilder.setColumn( "lastUpdated" );
+ statementBuilder.setColumn( "lastupdated" );
}
protected void setValues( DataElement dataElement )
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/IndicatorBatchHandler.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/IndicatorBatchHandler.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/IndicatorBatchHandler.java 2010-05-25 17:36:53 +0000
@@ -108,7 +108,7 @@
statementBuilder.setColumn( "denominatoraggregationtype" );
statementBuilder.setColumn( "extendeddataelementid" );
statementBuilder.setColumn( "sortorder" );
- statementBuilder.setColumn( "lastUpdated" );
+ statementBuilder.setColumn( "lastupdated" );
}
protected void setValues( Indicator indicator )
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitBatchHandler.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitBatchHandler.java 2010-05-19 09:48:29 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitBatchHandler.java 2010-05-25 17:36:53 +0000
@@ -95,10 +95,9 @@
statementBuilder.setColumn( "active" );
statementBuilder.setColumn( "comment" );
statementBuilder.setColumn( "geocode" );
- statementBuilder.setColumn( "polygoncoordinates" );
- statementBuilder.setColumn( "latitude" );
- statementBuilder.setColumn( "longitude" );
- statementBuilder.setColumn( "lastUpdated" );
+ statementBuilder.setColumn( "featuretype" );
+ statementBuilder.setColumn( "coordinates" );
+ statementBuilder.setColumn( "lastupdated" );
}
protected void setValues( OrganisationUnit unit )
@@ -114,9 +113,8 @@
statementBuilder.setValue( unit.isActive() );
statementBuilder.setValue( unit.getComment() );
statementBuilder.setValue( unit.getGeoCode() );
- statementBuilder.setValue( unit.getPolygonCoordinates() );
- statementBuilder.setValue( unit.getLatitude() );
- statementBuilder.setValue( unit.getLongitude() );
+ statementBuilder.setValue( unit.getFeatureType() );
+ statementBuilder.setValue( unit.getCoordinates() );
statementBuilder.setValue( unit.getLastUpdated() );
}
}
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2010-05-17 21:54:30 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2010-05-25 17:36:53 +0000
@@ -561,8 +561,6 @@
unit.setActive( true );
unit.setComment( "Comment" + uniqueCharacter );
unit.setGeoCode( "GeoCode" );
- unit.setLatitude( "Latitude" );
- unit.setLongitude( "Longitude" );
return unit;
}