=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/IbatisConfiguration.java' --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/IbatisConfiguration.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/IbatisConfiguration.java 1970-01-01 00:00:00 +0000 @@ -1,194 +0,0 @@ -package org.hisp.dhis.importexport; - -/* - * Copyright (c) 2004-2014, 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.Serializable; - -/** - * @author Lars Helge Overland - * @version $Id: IbatisConfiguration.java 6028 2008-10-24 13:44:34Z larshelg $ - */ -public class IbatisConfiguration - implements Serializable -{ - /** - * Determines if a de-serialized file is compatible with this class. - */ - private static final long serialVersionUID = -2191931273375896356L; - - private String dataFile; - - private String userName; - - private String password; - - private String levels; - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - public IbatisConfiguration() - { - } - - // ------------------------------------------------------------------------- - // hashCode and equals - // ------------------------------------------------------------------------- - - @Override - public int hashCode() - { - final int prime = 31; - - int result = 1; - - result = prime * result + ( ( dataFile == null) ? 0 : dataFile.hashCode() ); - result = prime * result + ( ( levels == null) ? 0 : levels.hashCode() ); - result = prime * result + ( ( password == null) ? 0 : password.hashCode() ); - result = prime * result + ( ( userName == null) ? 0 : userName.hashCode() ); - - return result; - } - - @Override - public boolean equals( Object object ) - { - if ( this == object ) - { - return true; - } - - if ( object == null ) - { - return false; - } - - if ( getClass() != object.getClass() ) - { - return false; - } - - final IbatisConfiguration other = (IbatisConfiguration) object; - - if ( dataFile == null ) - { - if ( other.dataFile != null ) - { - return false; - } - } - else if ( !dataFile.equals( other.dataFile ) ) - { - return false; - } - - if ( levels == null ) - { - if ( other.levels != null ) - { - return false; - } - } - else if ( !levels.equals( other.levels ) ) - { - return false; - } - - if ( password == null ) - { - if ( other.password != null ) - { - return false; - } - } - else if ( !password.equals( other.password ) ) - { - return false; - } - - if ( userName == null ) - { - if ( other.userName != null ) - { - return false; - } - } - else if ( !userName.equals( other.userName ) ) - { - return false; - } - - return true; - } - - // ------------------------------------------------------------------------- - // Getters and setters - // ------------------------------------------------------------------------- - - public String getDataFile() - { - return dataFile; - } - - public void setDataFile( String dataFile ) - { - this.dataFile = dataFile; - } - - public String getUserName() - { - return userName; - } - - public void setUserName( String userName ) - { - this.userName = userName; - } - - public String getPassword() - { - return password; - } - - public void setPassword( String password ) - { - this.password = password; - } - - public String getLevels() - { - return levels; - } - - public void setLevels( String levels ) - { - this.levels = levels; - } -} === modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/IbatisConfigurationManager.java' --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/IbatisConfigurationManager.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/IbatisConfigurationManager.java 2014-10-11 11:23:15 +0000 @@ -30,8 +30,6 @@ import java.util.Properties; -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; - /** * @author Lars Helge Overland * @version $Id: IbatisConfigurationManager.java 6270 2008-11-13 11:49:21Z larshelg $ @@ -42,10 +40,7 @@ Properties getPropertiesConfiguration(); - IbatisConfiguration getIbatisConfiguration() - throws NoConfigurationFoundException; - - void setIbatisConfiguration( IbatisConfiguration config ); + void setConfiguration( String connectionUrl, String username, String password, String levels ); boolean fileIsValid( String path ); } === modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/configuration/DefaultIbatisConfigurationManager.java' --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/configuration/DefaultIbatisConfigurationManager.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/configuration/DefaultIbatisConfigurationManager.java 2014-10-11 11:23:15 +0000 @@ -29,16 +29,11 @@ */ import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; import java.util.Properties; -import org.hisp.dhis.external.configuration.ConfigurationManager; -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.external.location.LocationManager; -import org.hisp.dhis.external.location.LocationManagerException; -import org.hisp.dhis.importexport.IbatisConfiguration; import org.hisp.dhis.importexport.IbatisConfigurationManager; +import org.hisp.dhis.setting.SystemSettingManager; +import org.springframework.beans.factory.annotation.Autowired; /** * @author Lars Helge Overland @@ -54,96 +49,32 @@ private static final String ACCESS_EXTENSION = ".mdb"; - // ------------------------------------------------------------------------- - // Properties - // ------------------------------------------------------------------------- - - private String configDir; - - public void setConfigDir( String configDir ) - { - this.configDir = configDir; - } + @Autowired + private SystemSettingManager systemSettingManager; - private String configFile; - - public void setConfigFile( String configFile ) - { - this.configFile = configFile; - } - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private LocationManager locationManager; - - public void setLocationManager( LocationManager locationManager ) - { - this.locationManager = locationManager; - } - - private ConfigurationManager configurationManager; - - public void setConfigurationManager( ConfigurationManager configurationManager ) - { - this.configurationManager = configurationManager; - } - // ------------------------------------------------------------------------- // IbatisConfigurationManager implementation // ------------------------------------------------------------------------- public Properties getPropertiesConfiguration() { - try - { - IbatisConfiguration configuration = getIbatisConfiguration(); - - Properties properties = new Properties(); - - properties.put( KEY_CONNECTION_URL_DATABASE, configuration.getDataFile() ); - properties.put( KEY_USERNAME, configuration.getUserName() ); - properties.put( KEY_PASSWORD, configuration.getPassword() ); - properties.put( KEY_LEVELS, configuration.getLevels() ); - - return properties; - } - catch ( NoConfigurationFoundException ex ) - { - throw new RuntimeException( "No configuration found for Ibatis", ex ); - } - } - - public IbatisConfiguration getIbatisConfiguration() - throws NoConfigurationFoundException - { - try - { - InputStream in = locationManager.getInputStream( configFile, configDir ); - - return configurationManager.getConfiguration( in, IbatisConfiguration.class ); - } - catch ( LocationManagerException ex ) - { - throw new NoConfigurationFoundException( "No configuration file found" ); - } - } - - public void setIbatisConfiguration( IbatisConfiguration configuration ) - { - try - { - OutputStream out = locationManager.getOutputStream( configFile, configDir ); - - configurationManager.setConfiguration( configuration, out ); - } - catch ( LocationManagerException ex ) - { - throw new RuntimeException( "Failed to set configuration", ex ); - } - } - + Properties properties = new Properties(); + + properties.put( KEY_CONNECTION_URL_DATABASE, systemSettingManager.getSystemSetting( KEY_CONNECTION_URL_DATABASE ) ); + properties.put( KEY_USERNAME, systemSettingManager.getSystemSetting( KEY_USERNAME ) ); + properties.put( KEY_PASSWORD, systemSettingManager.getSystemSetting( KEY_PASSWORD ) ); + properties.put( KEY_LEVELS, systemSettingManager.getSystemSetting( KEY_LEVELS ) ); + + return properties; + } + + public void setConfiguration( String connectionUrl, String username, String password, String levels ) + { + systemSettingManager.saveSystemSetting( KEY_CONNECTION_URL_DATABASE, connectionUrl ); + systemSettingManager.saveSystemSetting( KEY_USERNAME, username ); + systemSettingManager.saveSystemSetting( KEY_PASSWORD, password ); + systemSettingManager.saveSystemSetting( KEY_LEVELS, levels ); + } public boolean fileIsValid( String path ) { === modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml 2014-10-10 16:00:19 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml 2014-10-11 11:23:15 +0000 @@ -176,12 +176,7 @@ - - - - - - + === modified file 'dhis-2/dhis-support/dhis-support-external/pom.xml' --- dhis-2/dhis-support/dhis-support-external/pom.xml 2014-10-02 09:37:25 +0000 +++ dhis-2/dhis-support/dhis-support-external/pom.xml 2014-10-11 11:23:15 +0000 @@ -95,10 +95,6 @@ commons-logging - com.thoughtworks.xstream - xstream - - org.openid4java openid4java === removed directory 'dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/configuration' === removed file 'dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/configuration/DefaultConfigurationManager.java' --- dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/configuration/DefaultConfigurationManager.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/configuration/DefaultConfigurationManager.java 1970-01-01 00:00:00 +0000 @@ -1,138 +0,0 @@ -package org.hisp.dhis.external.configuration; - -/* - * Copyright (c) 2004-2014, 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.io.OutputStream; - -import com.thoughtworks.xstream.XStream; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class DefaultConfigurationManager - implements ConfigurationManager -{ - private static final String CONFIG_NAME = "configuration"; - - public void setConfiguration( T configuration, OutputStream out, Class... clazzes ) - { - try - { - XStream xStream = getXStream( configuration.getClass(), clazzes ); - - xStream.toXML( configuration, out ); - } - finally - { - closeOutputStream( out ); - } - } - - @SuppressWarnings( "unchecked" ) - public T getConfiguration( InputStream in, Class clazz, Class... clazzes ) - { - T object = null; - - try - { - XStream xStream = getXStream( clazz, clazzes ); - - object = (T) xStream.fromXML( in ); - } - finally - { - closeInputStream( in ); - } - - return object; - } - - // ------------------------------------------------------------------------- - // Supportive methods - // ------------------------------------------------------------------------- - - private XStream getXStream( Class clazz, Class... clazzes ) - { - XStream xStream = new XStream(); - - xStream.alias( CONFIG_NAME, clazz ); - - if ( clazzes != null ) - { - for ( Class temp : clazzes ) - { - xStream.alias( temp.getSimpleName().toLowerCase(), temp ); - } - } - - return xStream; - } - - private static void closeInputStream( InputStream in ) - { - if ( in != null ) - { - try - { - in.close(); - } - catch ( IOException ex ) - { - ex.printStackTrace(); - } - } - } - - private static void closeOutputStream( OutputStream out ) - { - if ( out != null ) - { - try - { - out.flush(); - } - catch ( IOException ex ) - { - ex.printStackTrace(); - } - - try - { - out.close(); - } - catch ( IOException ex ) - { - ex.printStackTrace(); - } - } - } -} === modified file 'dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml 2012-12-14 13:46:47 +0000 +++ dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml 2014-10-11 11:23:15 +0000 @@ -10,8 +10,6 @@ - - === modified file 'dhis-2/dhis-web/dhis-web-commons/pom.xml' --- dhis-2/dhis-web/dhis-web-commons/pom.xml 2014-07-23 14:53:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons/pom.xml 2014-10-11 11:23:15 +0000 @@ -90,10 +90,6 @@ commons-fileupload - com.thoughtworks.xstream - xstream - - xpp3 xpp3 === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dhis14/GetDhis14ConfigurationAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dhis14/GetDhis14ConfigurationAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dhis14/GetDhis14ConfigurationAction.java 2014-10-11 11:23:15 +0000 @@ -28,11 +28,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.importexport.IbatisConfiguration; -import org.hisp.dhis.importexport.IbatisConfigurationManager; - import com.opensymphony.xwork2.Action; /** @@ -43,61 +38,11 @@ implements Action { // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private IbatisConfigurationManager configurationManager; - - public void setConfigurationManager( IbatisConfigurationManager configurationManager ) - { - this.configurationManager = configurationManager; - } - - private I18n i18n; - - public void setI18n( I18n i18n ) - { - this.i18n = i18n; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private IbatisConfiguration configuration; - - public IbatisConfiguration getConfiguration() - { - return configuration; - } - - private String message; - - public String getMessage() - { - return message; - } - - // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- public String execute() - { - try - { - configuration = configurationManager.getIbatisConfiguration(); - - if ( !configurationManager.fileIsValid( configuration.getDataFile() ) ) - { - message = i18n.getString( "data_file_is_not_valid" ); - } - } - catch ( NoConfigurationFoundException ex ) - { - message = i18n.getString( "set_configuration" ); - } - + { return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dhis14/SetDhis14ConfigurationAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dhis14/SetDhis14ConfigurationAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dhis14/SetDhis14ConfigurationAction.java 2014-10-11 11:23:15 +0000 @@ -28,7 +28,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import org.hisp.dhis.importexport.IbatisConfiguration; import org.hisp.dhis.importexport.IbatisConfigurationManager; import com.opensymphony.xwork2.Action; @@ -90,14 +89,7 @@ public String execute() throws Exception { - IbatisConfiguration configuration = new IbatisConfiguration(); - - configuration.setDataFile( dataFile ); - configuration.setUserName( userName ); - configuration.setPassword( password ); - configuration.setLevels( levels ); - - configurationManager.setIbatisConfiguration( configuration ); + configurationManager.setConfiguration( dataFile, userName, password, levels ); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/GetImportOptionsAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/GetImportOptionsAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/GetImportOptionsAction.java 2014-10-11 11:23:15 +0000 @@ -30,9 +30,6 @@ import static org.hisp.dhis.importexport.action.util.ImportExportInternalProcessUtil.getCurrentRunningProcessImportFormat; -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.importexport.IbatisConfigurationManager; - import com.opensymphony.xwork2.Action; /** @@ -43,17 +40,6 @@ implements Action { // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private IbatisConfigurationManager configurationManager; - - public void setConfigurationManager( IbatisConfigurationManager configurationManager ) - { - this.configurationManager = configurationManager; - } - - // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- @@ -89,22 +75,6 @@ { importFormat = getCurrentRunningProcessImportFormat(); - // --------------------------------------------------------------------- - // Verify import configuration - // --------------------------------------------------------------------- - - if ( importFormat != null && importFormat.equals( "DHIS14FILE" ) ) - { - try - { - configurationManager.getIbatisConfiguration(); - } - catch ( NoConfigurationFoundException ex ) - { - return "dhis14"; - } - } - return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/ImportAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/ImportAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/ImportAction.java 2014-10-11 11:23:15 +0000 @@ -45,9 +45,7 @@ import org.amplecode.cave.process.ProcessExecutor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.importexport.IbatisConfigurationManager; import org.hisp.dhis.importexport.ImportInternalProcess; import org.hisp.dhis.importexport.ImportParams; import org.hisp.dhis.importexport.ImportStrategy; @@ -90,13 +88,6 @@ this.currentUserService = currentUserService; } - private IbatisConfigurationManager configurationManager; - - public void setConfigurationManager( IbatisConfigurationManager configurationManager ) - { - this.configurationManager = configurationManager; - } - private I18n i18n; public void setI18n( I18n i18n ) @@ -268,22 +259,6 @@ setCurrentRunningProcess( PROCESS_KEY_IMPORT, executor.getId() ); setCurrentRunningProcessType( type ); setCurrentImportFileName( fileName ); - - // --------------------------------------------------------------------- - // Verify import configuration - // --------------------------------------------------------------------- - - if ( importFormat != null && importFormat.equals( "DHIS14FILE" ) ) - { - try - { - configurationManager.getIbatisConfiguration(); - } - catch ( NoConfigurationFoundException ex ) - { - return "dhis14"; - } - } return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/SetImportTypeAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/SetImportTypeAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/imp/SetImportTypeAction.java 2014-10-11 11:23:15 +0000 @@ -28,11 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import static org.hisp.dhis.importexport.action.util.ImportExportInternalProcessUtil.*; - -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.importexport.IbatisConfiguration; -import org.hisp.dhis.importexport.IbatisConfigurationManager; +import static org.hisp.dhis.importexport.action.util.ImportExportInternalProcessUtil.setCurrentRunningProcessImportFormat; import com.opensymphony.xwork2.Action; @@ -43,21 +39,6 @@ public class SetImportTypeAction implements Action { - //TODO rename to SetImportFormatAction - - private static final String CONFIG_DHIS14 = "configDhis14"; - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private IbatisConfigurationManager configurationManager; - - public void setConfigurationManager( IbatisConfigurationManager configurationManager ) - { - this.configurationManager = configurationManager; - } - // ------------------------------------------------------------------------- // Input // ------------------------------------------------------------------------- @@ -76,27 +57,6 @@ public String execute() { // --------------------------------------------------------------------- - // Verify configuration if dhis14 file format - // --------------------------------------------------------------------- - - if ( importFormat != null && importFormat.equalsIgnoreCase( "DHIS14FILE" ) ) - { - try - { - IbatisConfiguration config = configurationManager.getIbatisConfiguration(); - - if ( config == null || !configurationManager.fileIsValid( config.getDataFile() ) ) - { - return CONFIG_DHIS14; - } - } - catch ( NoConfigurationFoundException ex ) - { - return CONFIG_DHIS14; - } - } - - // --------------------------------------------------------------------- // Set current format // --------------------------------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/object/DiscardObjectAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/object/DiscardObjectAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/object/DiscardObjectAction.java 2014-10-11 11:23:15 +0000 @@ -32,8 +32,6 @@ import java.util.Collection; -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.importexport.IbatisConfigurationManager; import org.hisp.dhis.importexport.ImportObjectService; import com.opensymphony.xwork2.Action; @@ -85,13 +83,6 @@ this.importObjectService = importObjectService; } - private IbatisConfigurationManager configurationManager; - - public void setConfigurationManager( IbatisConfigurationManager configurationManager ) - { - this.configurationManager = configurationManager; - } - // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -114,18 +105,6 @@ importFormat = getCurrentRunningProcessImportFormat(); - if ( importFormat != null && importFormat.equals( "DHIS14FILE" ) ) - { - try - { - configurationManager.getIbatisConfiguration(); - } - catch ( NoConfigurationFoundException ex ) - { - return "dhis14"; - } - } - return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/object/MatchObjectAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/object/MatchObjectAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/object/MatchObjectAction.java 2014-10-11 11:23:15 +0000 @@ -30,8 +30,6 @@ import static org.hisp.dhis.importexport.action.util.ImportExportInternalProcessUtil.getCurrentRunningProcessImportFormat; -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.importexport.IbatisConfigurationManager; import org.hisp.dhis.importexport.ImportObjectService; import com.opensymphony.xwork2.Action; @@ -79,13 +77,6 @@ this.importObjectService = importObjectService; } - private IbatisConfigurationManager configurationManager; - - public void setConfigurationManager( IbatisConfigurationManager configurationManager ) - { - this.configurationManager = configurationManager; - } - // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -104,18 +95,6 @@ importFormat = getCurrentRunningProcessImportFormat(); - if ( importFormat != null && importFormat.equals( "DHIS14FILE" ) ) - { - try - { - configurationManager.getIbatisConfiguration(); - } - catch ( NoConfigurationFoundException ex ) - { - return "dhis14"; - } - } - 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 2014-02-15 18:09:14 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml 2014-10-11 11:23:15 +0000 @@ -32,13 +32,11 @@ scope="prototype"> - - - - - - - + scope="prototype"/> 2.1.7 - com.thoughtworks.xstream - xstream - 1.4.3 - - org.nfunk jep 2.4.0