← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21877: minor fixes

 

------------------------------------------------------------
revno: 21877
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2016-02-04 11:06:33 +0700
message:
  minor fixes
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/DefaultMetadataImportService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportException.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportService.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/metadata/MetadataExportController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/metadata/MetadataImportController.java
  dhis-2/dhis-web/dhis-web-ohie/pom.xml
  dhis-2/dhis-web/dhis-web-uaa/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-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/DefaultMetadataImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/DefaultMetadataImportService.java	2016-01-29 02:18:42 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/DefaultMetadataImportService.java	2016-02-04 04:06:33 +0000
@@ -83,7 +83,7 @@
     }
 
     @Override
-    public MetadataImportParams getParamsFromMap( Map<String, String> parameters )
+    public MetadataImportParams getParamsFromMap( Map<String, List<String>> parameters )
     {
         MetadataImportParams params = new MetadataImportParams();
         return params;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportException.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportException.java	2016-01-28 09:41:29 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportException.java	2016-02-04 04:06:33 +0000
@@ -32,7 +32,7 @@
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
 public class MetadataImportException
-    extends Exception
+    extends RuntimeException
 {
     public MetadataImportException( String message )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportService.java	2016-01-28 09:41:29 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/MetadataImportService.java	2016-02-04 04:06:33 +0000
@@ -28,6 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -39,5 +40,5 @@
 
     void validate( MetadataImportParams params ) throws MetadataImportException;
 
-    MetadataImportParams getParamsFromMap( Map<String, String> parameters );
+    MetadataImportParams getParamsFromMap( Map<String, List<String>> parameters );
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/metadata/MetadataExportController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/metadata/MetadataExportController.java	2016-02-03 06:57:11 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/metadata/MetadataExportController.java	2016-02-04 04:06:33 +0000
@@ -55,6 +55,7 @@
     public @ResponseBody RootNode getMetadata()
     {
         MetadataExportParams params = metadataExportService.getParamsFromMap( contextService.getParameterValuesMap() );
+        metadataExportService.validate( params );
         return metadataExportService.getMetadataAsNode( params );
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/metadata/MetadataImportController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/metadata/MetadataImportController.java	2016-01-28 09:41:29 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/metadata/MetadataImportController.java	2016-02-04 04:06:33 +0000
@@ -28,17 +28,16 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.dxf2.metadata2.MetadataImportException;
 import org.hisp.dhis.dxf2.metadata2.MetadataImportParams;
 import org.hisp.dhis.dxf2.metadata2.MetadataImportService;
+import org.hisp.dhis.webapi.service.ContextService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
 
-import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
-import java.util.Map;
 
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -50,9 +49,14 @@
     @Autowired
     private MetadataImportService metadataImportService;
 
+    @Autowired
+    private ContextService contextService;
+
     @RequestMapping( value = "", method = RequestMethod.POST )
-    public void postMetadata( @RequestParam Map<String, String> rpParameters, HttpServletRequest request ) throws IOException
+    public void postMetadata() throws IOException, MetadataImportException
     {
-        MetadataImportParams params = metadataImportService.getParamsFromMap( rpParameters );
+        MetadataImportParams params = metadataImportService.getParamsFromMap( contextService.getParameterValuesMap() );
+        metadataImportService.validate( params );
+        metadataImportService.importMetadata( params );
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-ohie/pom.xml'
--- dhis-2/dhis-web/dhis-web-ohie/pom.xml	2016-01-15 00:52:40 +0000
+++ dhis-2/dhis-web/dhis-web-ohie/pom.xml	2016-02-04 04:06:33 +0000
@@ -10,7 +10,7 @@
 
   <artifactId>dhis-web-ohie</artifactId>
   <packaging>war</packaging>
-  <name>DHIS 2 OHIE Implementations</name>
+  <name>DHIS OHIE Implementations</name>
 
   <build>
     <finalName>dhis-web-ohie</finalName>

=== modified file 'dhis-2/dhis-web/dhis-web-uaa/pom.xml'
--- dhis-2/dhis-web/dhis-web-uaa/pom.xml	2016-01-15 00:52:40 +0000
+++ dhis-2/dhis-web/dhis-web-uaa/pom.xml	2016-02-04 04:06:33 +0000
@@ -10,7 +10,7 @@
 
   <artifactId>dhis-web-uaa</artifactId>
   <packaging>war</packaging>
-  <name>User Account and Authentication (UAA) Server</name>
+  <name>DHIS User Account and Authentication (UAA) Server</name>
 
   <build>
     <finalName>dhis-web-uaa</finalName>