dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02848
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 935: Check namespace URI of dxf root element
------------------------------------------------------------
revno: 935
committer: Bob Jolliffe <bobj@bobj-laptop>
branch nick: trunk
timestamp: Fri 2009-10-30 12:02:47 +0000
message:
Check namespace URI of dxf root element
Further tidying up of pom files
modified:
dhis-2/dhis-services/dhis-service-aggregationengine-default/pom.xml
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java
dhis-2/dhis-services/pom.xml
dhis-2/dhis-web/dhis-web-commons/pom.xml
dhis-2/dhis-web/dhis-web-excel-reporting/pom.xml
dhis-2/dhis-web/pom.xml
--
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-services/dhis-service-aggregationengine-default/pom.xml'
--- dhis-2/dhis-services/dhis-service-aggregationengine-default/pom.xml 2009-09-19 11:00:10 +0000
+++ dhis-2/dhis-services/dhis-service-aggregationengine-default/pom.xml 2009-10-30 12:02:47 +0000
@@ -18,8 +18,8 @@
<!-- DHIS -->
<dependency>
- <groupId>org.hisp.dhis</groupId>
- <artifactId>dhis-api</artifactId>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-api</artifactId>
</dependency>
<dependency>
<groupId>org.hisp.dhis</groupId>
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java 2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java 2009-10-30 12:02:47 +0000
@@ -166,7 +166,10 @@
public class DefaultDXFImportService
implements ImportService
{
- private final Log log = LogFactory.getLog( DefaultDXFImportService.class );
+ public static final String ROOT_NAME = "dxf";
+ public static final String DXF2_NAMESPACE_URI = "http://dhis2.org/ns/schema/dxf2";
+
+ private final Log log = LogFactory.getLog( DefaultDXFImportService.class );
// -------------------------------------------------------------------------
// Dependencies
@@ -337,10 +340,26 @@
StreamUtils.getNextZipEntry( zipIn );
XMLReader reader = XMLFactory.getXMLReader( zipIn );
+
+ // assume default version 1
+ int dxfVersion = 1;
while ( reader.next() )
{
- if ( reader.isStartElement( DataElementCategoryOptionConverter.COLLECTION_NAME ) )
+ if (reader.isStartElement( ROOT_NAME) )
+ {
+ if (reader.getXmlStreamReader().getNamespaceURI() == DXF2_NAMESPACE_URI)
+ {
+ dxfVersion = 2;
+ }
+ else
+ {
+ dxfVersion = 1;
+ }
+ log.info("dxf version "+dxfVersion);
+ }
+
+ if ( reader.isStartElement( DataElementCategoryOptionConverter.COLLECTION_NAME ) )
{
//setMessage( "importing_data_element_category_options" );
=== modified file 'dhis-2/dhis-services/pom.xml'
--- dhis-2/dhis-services/pom.xml 2009-09-19 11:00:10 +0000
+++ dhis-2/dhis-services/pom.xml 2009-10-30 12:02:47 +0000
@@ -21,11 +21,11 @@
<module>dhis-service-user-hibernate</module>
<module>dhis-service-importexport</module>
<module>dhis-service-reporting</module>
- <module>dhis-service-excel-reporting</module>
+ <module>dhis-service-excel-reporting</module>
<module>dhis-service-mapping</module>
<module>dhis-service-jdbc</module>
<module>dhis-service-jdbc-test</module>
- <module>dhis-service-aggregationengine-default</module>
+ <module>dhis-service-aggregationengine-default</module>
</modules>
<dependencies>
=== modified file 'dhis-2/dhis-web/dhis-web-commons/pom.xml'
--- dhis-2/dhis-web/dhis-web-commons/pom.xml 2009-09-10 13:17:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/pom.xml 2009-10-30 12:02:47 +0000
@@ -67,7 +67,7 @@
<groupId>org.hisp.dhis</groupId>
<artifactId>dhis-service-organisationunit</artifactId>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.hisp.dhis</groupId>
<artifactId>dhis-service-administration</artifactId>
</dependency>
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/pom.xml'
--- dhis-2/dhis-web/dhis-web-excel-reporting/pom.xml 2009-10-30 11:54:30 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/pom.xml 2009-10-30 12:02:47 +0000
@@ -63,10 +63,13 @@
<artifactId>dhis-support-external</artifactId>
</dependency>
<dependency>
- <groupId>org.hisp.dhis</groupId>
- <artifactId>dhis-service-aggregationengine-default</artifactId>
- </dependency>
-
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-service-aggregationengine-default</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-service-aggregationengine-default</artifactId>
+ </dependency>
<!-- Other -->
=== modified file 'dhis-2/dhis-web/pom.xml'
--- dhis-2/dhis-web/pom.xml 2009-10-21 07:39:24 +0000
+++ dhis-2/dhis-web/pom.xml 2009-10-30 12:02:47 +0000
@@ -21,7 +21,7 @@
<module>dhis-web-reporting</module>
<module>dhis-web-mapping</module>
<module>dhis-web-dashboard-integration</module>
- <module>dhis-web-excel-reporting</module>
+ <module>dhis-web-excel-reporting</module>
<module>dhis-web-portal</module>
</modules>