=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ServiceProvider.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ServiceProvider.java 2010-02-02 13:21:02 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ServiceProvider.java 2010-02-02 19:21:58 +0000 @@ -28,6 +28,7 @@ */ import java.util.Map; +import java.util.Set; /** * @author Lars Helge Overland @@ -45,4 +46,9 @@ { return services.get( key ); } + + public Set getServiceKeySet() + { + return services.keySet(); + } } === removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportExportServiceManager.java' --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportExportServiceManager.java 2009-04-23 18:11:33 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportExportServiceManager.java 1970-01-01 00:00:00 +0000 @@ -1,45 +0,0 @@ -package org.hisp.dhis.importexport; - -/* - * Copyright (c) 2004-2007, 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.util.Collection; - -/** - * @author Lars Helge Overland - * @version $Id: ImportExportServiceManager.java 4646 2008-02-26 14:54:29Z larshelg $ - */ -public interface ImportExportServiceManager -{ - Collection getImportFormats(); - - ImportService getImportService( String format ); - - Collection getExportFormats(); - - ExportService getExportService( String format ); -} === removed directory 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/manager' === removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/manager/DefaultImportExportServiceManager.java' --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/manager/DefaultImportExportServiceManager.java 2009-04-23 18:11:33 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/manager/DefaultImportExportServiceManager.java 1970-01-01 00:00:00 +0000 @@ -1,85 +0,0 @@ -package org.hisp.dhis.importexport.manager; - -/* - * Copyright (c) 2004-2007, 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.util.Collection; -import java.util.Map; - -import org.hisp.dhis.importexport.ExportService; -import org.hisp.dhis.importexport.ImportExportServiceManager; -import org.hisp.dhis.importexport.ImportService; - -/** - * @author Lars Helge Overland - * @version $Id: DefaultImportExportServiceManager.java 4646 2008-02-26 14:54:29Z larshelg $ - */ -public class DefaultImportExportServiceManager - implements ImportExportServiceManager -{ - // ------------------------------------------------------------------------- - // Properties - // ------------------------------------------------------------------------- - - private Map importServices; - - public void setImportServices( Map importServices ) - { - this.importServices = importServices; - } - - private Map exportServices; - - public void setExportServices( Map exportServices ) - { - this.exportServices = exportServices; - } - - // ------------------------------------------------------------------------- - // ImportExportServiceManager implementation - // ------------------------------------------------------------------------- - - public Collection getImportFormats() - { - return importServices.keySet(); - } - - public ImportService getImportService( String format ) - { - return importServices.get( format ); - } - - public Collection getExportFormats() - { - return exportServices.keySet(); - } - - public ExportService getExportService( String format ) - { - return exportServices.get( format ); - } -} === 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 2009-11-25 09:34:14 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml 2010-02-02 19:21:58 +0000 @@ -7,37 +7,9 @@ - - - - - - IXF - - - - - - DXF - - - - - - DHIS14XML - - - - - - DHIS14FILE - - - - - - + + === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DataValueExportAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DataValueExportAction.java 2009-08-20 08:17:49 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DataValueExportAction.java 2010-02-02 19:21:58 +0000 @@ -35,11 +35,11 @@ import java.io.InputStream; import java.util.Collection; +import org.hisp.dhis.common.ServiceProvider; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataset.DataSetService; import org.hisp.dhis.importexport.ExportParams; import org.hisp.dhis.importexport.ExportService; -import org.hisp.dhis.importexport.ImportExportServiceManager; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.hisp.dhis.oust.manager.SelectionTreeManager; @@ -71,11 +71,11 @@ this.selectionTreeManager = selectionTreeManager; } - private ImportExportServiceManager serviceManager; + private ServiceProvider serviceProvider; - public void setServiceManager( ImportExportServiceManager serviceManager ) + public void setServiceProvider( ServiceProvider serviceProvider ) { - this.serviceManager = serviceManager; + this.serviceProvider = serviceProvider; } private DataSetService dataSetService; @@ -254,7 +254,7 @@ // Export // --------------------------------------------------------------------- - ExportService exportService = serviceManager.getExportService( exportFormat ); + ExportService exportService = serviceProvider.provide( exportFormat ); inputStream = exportService.exportData( params ); === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DetailedMetaDataExportAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DetailedMetaDataExportAction.java 2009-08-20 08:17:49 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/DetailedMetaDataExportAction.java 2010-02-02 19:21:58 +0000 @@ -36,6 +36,7 @@ import java.util.HashSet; import java.util.Set; +import org.hisp.dhis.common.ServiceProvider; import org.hisp.dhis.dataelement.CalculatedDataElement; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementService; @@ -45,7 +46,6 @@ import org.hisp.dhis.importexport.ExportParams; import org.hisp.dhis.importexport.ExportService; import org.hisp.dhis.importexport.ImportDataValueService; -import org.hisp.dhis.importexport.ImportExportServiceManager; import org.hisp.dhis.importexport.ImportObjectService; import org.hisp.dhis.indicator.Indicator; import org.hisp.dhis.indicator.IndicatorService; @@ -78,12 +78,12 @@ { this.format = format; } - - private ImportExportServiceManager serviceManager; - - public void setServiceManager( ImportExportServiceManager serviceManager ) + + private ServiceProvider serviceProvider; + + public void setServiceProvider( ServiceProvider serviceProvider ) { - this.serviceManager = serviceManager; + this.serviceProvider = serviceProvider; } private DataElementService dataElementService; @@ -219,7 +219,7 @@ params.setI18n( i18n ); params.setFormat( format ); - ExportService exportService = serviceManager.getExportService( exportFormat ); + ExportService exportService = serviceProvider.provide( exportFormat ); inputStream = exportService.exportData( params ); === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java 2009-11-01 21:32:55 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java 2010-02-02 19:21:58 +0000 @@ -29,12 +29,12 @@ import java.io.InputStream; +import org.hisp.dhis.common.ServiceProvider; import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.i18n.I18nFormat; import org.hisp.dhis.importexport.ExportParams; import org.hisp.dhis.importexport.ExportService; import org.hisp.dhis.importexport.ImportDataValueService; -import org.hisp.dhis.importexport.ImportExportServiceManager; import org.hisp.dhis.importexport.ImportObjectService; import org.hisp.dhis.options.datadictionary.DataDictionaryModeManager; @@ -53,11 +53,11 @@ // Dependencies // ------------------------------------------------------------------------- - private ImportExportServiceManager serviceManager; + private ServiceProvider serviceProvider; - public void setServiceManager( ImportExportServiceManager serviceManager ) + public void setServiceProvider( ServiceProvider serviceProvider ) { - this.serviceManager = serviceManager; + this.serviceProvider = serviceProvider; } private ImportObjectService importObjectService; @@ -337,7 +337,7 @@ params.setI18n( i18n ); params.setFormat( format ); - ExportService exportService = serviceManager.getExportService( exportFormat ); + ExportService exportService = serviceProvider.provide( exportFormat ); inputStream = exportService.exportData( params ); === 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 2009-10-27 06:36:41 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml 2010-02-02 19:21:58 +0000 @@ -128,8 +128,7 @@ - + - + @@ -156,8 +154,7 @@ scope="prototype"> - +