← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14043: Fixes for csv data element import, works now

 

------------------------------------------------------------
revno: 14043
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-02-16 12:29:07 +0100
message:
  Fixes for csv data element import, works now
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/CsvObjectUtils.java
  dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties
  dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/index.vm


--
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/common/BaseNameableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java	2014-02-13 07:59:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java	2014-02-16 11:29:07 +0000
@@ -28,14 +28,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.common.view.DetailedView;
+import org.hisp.dhis.common.view.ExportView;
+import org.hisp.dhis.common.view.ShortNameView;
+
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonView;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.common.annotation.Description;
-import org.hisp.dhis.common.view.DetailedView;
-import org.hisp.dhis.common.view.ExportView;
-import org.hisp.dhis.common.view.ShortNameView;
 
 /**
  * @author Bob Jolliffe
@@ -147,7 +147,6 @@
     @JsonProperty
     @JsonView( { ShortNameView.class, DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( isAttribute = true )
-    @Description( "An short name representing this Object. Optional but unique." )
     public String getShortName()
     {
         return shortName;
@@ -161,7 +160,6 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    @Description( "Description of this Object." )
     public String getDescription()
     {
         return description;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/CsvObjectUtils.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/CsvObjectUtils.java	2014-02-15 18:09:14 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/CsvObjectUtils.java	2014-02-16 11:29:07 +0000
@@ -58,7 +58,7 @@
         while ( reader.readRecord() )
         {
             String[] values = reader.getValues();
-            
+
             if ( values == null || values.length == 0 )
             {
                 continue;
@@ -92,7 +92,7 @@
     {
         if ( values == null || index < 0 || index >= values.length )
         {
-            return null;
+            return defaultValue;
         }
         
         String value = values[index];

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties	2014-02-15 18:09:14 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties	2014-02-16 11:29:07 +0000
@@ -279,6 +279,8 @@
 intro_dhis14_file_configuration=Set the configuration for the DHIS 1.4 file import process, such as the location of the data file.
 intro_metadata_import=Import meta-data like data elements and organisation units using the standard DHIS 2 exchange format called DXF 2.
 intro_event_data_export=Export event data for programs, stages and persons on the DXF 2 format.
+intro_xml_metadata_import=Import meta-data like data elements and organisation units using the standard DHIS 2 exchange format called DXF 2.
+intro_csv_metadata_import=Import meta-data using CSV format. Currently only import of data elements is supported.
 no_item_to_match=There is no selected item to match
 dry_run=Dry run
 strategy=Strategy

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/index.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/index.vm	2013-10-30 12:51:03 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/index.vm	2014-02-16 11:29:07 +0000
@@ -1,7 +1,8 @@
 <h3>$i18n.getString( "dhis-web-importexport" )</h3>
 
 <ul class="introList">
-    #introListImgItem( "dxf2MetaDataImport.action" "metadata_import" "import" )
+    #introListImgItem( "dxf2MetaDataImport.action?importFormat=xml" "xml_metadata_import" "import" )
+    #introListImgItem( "dxf2MetaDataImport.action?importFormat=csv" "csv_metadata_import" "import" )
     #introListImgItem( "displayImportDataValueForm.action?importFormat=xml" "xml_data_import" "import" )
     #introListImgItem( "displayImportDataValueForm.action?importFormat=csv" "csv_data_import" "import" )
     #introListImgItem( "displayImportDataValueForm.action?importFormat=pdf" "pdf_data_import" "import" )