=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java 2013-08-28 07:27:01 +0000 @@ -28,10 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; - +import com.opensymphony.xwork2.Action; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hisp.dhis.common.IdentifiableObject.IdentifiableProperty; @@ -47,7 +44,9 @@ import org.hisp.dhis.user.CurrentUserService; import org.springframework.beans.factory.annotation.Autowired; -import com.opensymphony.xwork2.Action; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; /** * @author Lars Helge Overland @@ -56,13 +55,13 @@ implements Action { private static final Log log = LogFactory.getLog( ImportDataValueAction.class ); - + @Autowired private DataValueSetService dataValueSetService; @Autowired private CurrentUserService currentUserService; - + @Autowired private Scheduler scheduler; @@ -72,14 +71,14 @@ // ------------------------------------------------------------------------- // Input // ------------------------------------------------------------------------- - + private File upload; public void setUpload( File upload ) { this.upload = upload; } - + private boolean dryRun; public void setDryRun( boolean dryRun ) @@ -102,12 +101,12 @@ } private IdentifiableProperty orgUnitIdScheme; - + public void setOrgUnitIdScheme( IdentifiableProperty orgUnitIdScheme ) { this.orgUnitIdScheme = orgUnitIdScheme; } - + private boolean skipExistingCheck; public void setSkipExistingCheck( boolean skipExistingCheck ) @@ -130,28 +129,28 @@ // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- - + public String execute() throws Exception { strategy = strategy != null ? strategy : ImportStrategy.NEW_AND_UPDATES; - dataElementIdScheme = dataElementIdScheme != null ? dataElementIdScheme : IdentifiableProperty.UID; + dataElementIdScheme = dataElementIdScheme != null ? dataElementIdScheme : IdentifiableProperty.UID; orgUnitIdScheme = orgUnitIdScheme != null ? orgUnitIdScheme : IdentifiableProperty.UID; TaskId taskId = new TaskId( TaskCategory.DATAVALUE_IMPORT, currentUserService.getCurrentUser() ); notifier.clear( taskId ); - + InputStream in = new FileInputStream( upload ); - + in = StreamUtils.wrapAndCheckCompressionFormat( in ); - + ImportOptions options = new ImportOptions( dataElementIdScheme, orgUnitIdScheme, dryRun, strategy, skipExistingCheck ); - + log.info( options ); - + scheduler.executeTask( new ImportDataValueTask( dataValueSetService, in, options, taskId, importFormat ) ); - + return SUCCESS; } } === added directory 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/event' === added file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/event/ImportEventAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/event/ImportEventAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/event/ImportEventAction.java 2013-08-28 07:27:01 +0000 @@ -0,0 +1,73 @@ +package org.hisp.dhis.importexport.action.event; + +/* + * Copyright (c) 2004-2013, 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 com.opensymphony.xwork2.Action; +import org.hisp.dhis.dxf2.event.EventService; +import org.springframework.beans.factory.annotation.Autowired; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; + +/** + * @author Morten Olav Hansen + */ +public class ImportEventAction implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + @Autowired + private EventService eventService; + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private File upload; + + public void setUpload( File upload ) + { + this.upload = upload; + } + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() throws Exception + { + InputStream in = new FileInputStream( upload ); + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml 2013-03-15 15:34:40 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml 2013-08-28 07:27:01 +0000 @@ -1,87 +1,92 @@ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"> + class="org.hisp.dhis.importexport.action.datavalue.ImportDataValueAction" /> + class="org.hisp.dhis.importexport.action.GetImportSummaryAction"> + class="org.hisp.dhis.importexport.action.datavalue.ExportDataValueAction" /> + + + + + class="org.hisp.dhis.importexport.action.imp.ImportAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.imp.GetImportOptionsAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.imp.GetImportStatusAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.imp.SetImportTypeAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.imp.GetImportAnalysisAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.object.MatchObjectAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.object.DiscardObjectAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.object.DiscardObjectsOfTypeAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.object.DiscardAllObjectsAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.object.ImportAllObjectsAction" + scope="prototype"> @@ -89,15 +94,15 @@ + class="org.hisp.dhis.importexport.action.imp.GetPreviewOptionsAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.imp.GetMatchOptionsAction" + scope="prototype"> @@ -113,23 +118,23 @@ + class="org.hisp.dhis.importexport.action.imp.GetCompareOptionsAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.exp.MetaDataExportAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.exp.DetailedMetaDataExportAction" + scope="prototype"> @@ -139,75 +144,75 @@ + class="org.hisp.dhis.importexport.action.exp.GetDetailedExportOptionsAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.exp.GetDataElementListAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.exp.GetIndicatorListAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.exp.ValidateAggregatedExportAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.dhis14.GetDhis14ConfigurationAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.dhis14.SetDhis14ConfigurationAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.dhis14.ValidateDhis14ConfigurationAction" + scope="prototype"> + class="org.hisp.dhis.importexport.action.integration.DisplayRoutesAction"> + class="org.hisp.dhis.importexport.action.integration.AddRouteAction"> + class="org.hisp.dhis.importexport.action.integration.RouteOperationAction"> - + class="org.hisp.dhis.importexport.action.dxf2.MetaDataExportFormAction" /> + + class="org.hisp.dhis.importexport.action.dxf2.MetaDataImportAction" /> + class="org.hisp.dhis.importexport.action.dxf2.GetImportSummaryAction" scope="prototype"> === 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 2013-08-06 16:33:02 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties 2013-08-28 07:27:01 +0000 @@ -295,6 +295,7 @@ xml_data_import=XML Data Import csv_data_import=CSV Data Import pdf_data_import=PDF Data Import +event_data_import=Event Data Import no_data_values_found=No data values found create_new_route=Create new route integration=Integration === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/struts.xml 2013-03-21 11:09:47 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/struts.xml 2013-08-28 07:27:01 +0000 @@ -1,7 +1,7 @@ + "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" + "http://struts.apache.org/dtds/struts-2.0.dtd"> @@ -51,6 +51,22 @@ F_EXPORT_DATA + + + + /main.vm + /dhis-web-importexport/eventImportForm.vm + /dhis-web-importexport/mainMenu.vm + javascript/importEventData.js + F_IMPORT_DATA + + + + displayEventImportForm.action + + F_IMPORT_DATA + + @@ -185,7 +201,7 @@ + class="org.hisp.dhis.importexport.action.exp.GetDetailedExportOptionsAction"> /main.vm /dhis-web-importexport/exportDetailedMetaDataForm.vm /dhis-web-importexport/mainMenu.vm @@ -224,7 +240,7 @@ + class="org.hisp.dhis.importexport.action.exp.ValidateAggregatedExportAction"> /dhis-web-importexport/responseSuccess.vm /dhis-web-importexport/responseError.vm plainTextError @@ -234,7 +250,7 @@ + class="org.hisp.dhis.importexport.action.dhis14.GetDhis14ConfigurationAction"> /main.vm /dhis-web-importexport/configDhis14Form.vm /dhis-web-importexport/mainMenu.vm @@ -247,7 +263,7 @@ + class="org.hisp.dhis.importexport.action.dhis14.ValidateDhis14ConfigurationAction"> /dhis-web-importexport/responseSuccess.vm /dhis-web-importexport/responseInput.vm === added file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/eventImportForm.vm' --- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/eventImportForm.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/eventImportForm.vm 2013-08-28 07:27:01 +0000 @@ -0,0 +1,41 @@ + +

$i18n.getString( "event_data_import" )

+ +
+
+ +++ + + + + + + + + + + + + + + + +
$i18n.getString( "file" )
$i18n.getString( "dry_run" )
$i18n.getString( "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-08-16 12:29:21 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/index.vm 2013-08-28 07:27:01 +0000 @@ -5,8 +5,9 @@ #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" ) + #introListImgItem( "displayEventImportForm.action" "event_data_import" "import" ) #introListImgItem( "displayExternalImportMenu.action" "dhis14_import" "import" ) - + #introListImgItem( "dxf2MetaDataExport.action" "metadata_export" "export" ) #introListImgItem( "displayDataValueExportForm.action" "data_export" "export" ) #introListImgItem( "displayExternalExportMenu.action" "export_to_other_systems" "export" ) === added file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importEventData.js' --- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importEventData.js 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importEventData.js 2013-08-28 07:27:01 +0000 @@ -0,0 +1,12 @@ + +function importEventData() +{ + if ( !$( "#upload" ).val() ) + { + setHeaderDelayMessage( "Please select a file to upload" ); + return false; + } + + $( "#notificationTable" ).empty(); + $( "#importForm" ).submit(); +} === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/mainMenu.vm' --- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/mainMenu.vm 2013-05-23 04:30:18 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/mainMenu.vm 2013-08-28 07:27:01 +0000 @@ -6,6 +6,7 @@
  • $i18n.getString( "xml_data_import" ) 
  • $i18n.getString( "csv_data_import" ) 
  • $i18n.getString( "pdf_data_import" ) 
  • +
  • $i18n.getString( "event_data_import" ) 
  • $i18n.getString( "dhis14_import" ) 
  • $i18n.getString( "gml_import" )