=== removed directory 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration' === removed file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/AddRouteAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/AddRouteAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/AddRouteAction.java 1970-01-01 00:00:00 +0000 @@ -1,118 +0,0 @@ -package org.hisp.dhis.importexport.action.integration; - -/* - * 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 java.io.File; -import java.io.FileInputStream; -import org.apache.camel.CamelContext; -import org.apache.camel.model.ModelCamelContext; -import org.apache.camel.model.RouteDefinition; -import org.apache.camel.model.RoutesDefinition; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hisp.dhis.system.util.StreamUtils; - -/** - * @author Bob Jolliffe - * @version $Id$ - */ -public class AddRouteAction - implements Action -{ - private static final Log log = LogFactory.getLog( AddRouteAction.class ); - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ModelCamelContext builtinCamelContext; - - public void setBuiltinCamelContext( CamelContext camelContext ) - { - this.builtinCamelContext = (ModelCamelContext) camelContext; - } - - private File file; - - public void setUpload( File file ) - { - this.file = file; - } - - private String fileName; - - public void setUploadFileName( String fileName ) - { - this.fileName = fileName; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - log.info( "Uploaded " + fileName ); - - if ( file != null ) - { - FileInputStream is = new FileInputStream( file ); - - try - { - RoutesDefinition routes = builtinCamelContext.loadRoutesDefinition( is ); - for (RouteDefinition route : routes.getRoutes() ) - { - // remove any existing route with this id before adding ... - RouteDefinition existingRoute = builtinCamelContext.getRouteDefinition( route.getId() ); - if (existingRoute != null) - { - builtinCamelContext.stopRoute( route.getId()); - builtinCamelContext.removeRouteDefinition( route ); - } - builtinCamelContext.addRouteDefinitions( routes.getRoutes() ); - } - } - catch ( Exception e ) - { - log.info( "Unable to load route: " + e.getMessage() ); - return ERROR; - } - finally - { - StreamUtils.closeInputStream( is ); - } - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/DisplayRoutesAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/DisplayRoutesAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/DisplayRoutesAction.java 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -package org.hisp.dhis.importexport.action.integration; - -/* - * 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 java.util.Collection; -import java.util.LinkedList; -import org.apache.camel.CamelContext; -import org.apache.camel.model.ModelCamelContext; -import org.apache.camel.model.RouteDefinition; - -/** - * @author Bob Jolliffe - * @version $Id$ - */ -public class DisplayRoutesAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ModelCamelContext builtinCamelContext; - - public void setBuiltinCamelContext( CamelContext camelContext ) - { - this.builtinCamelContext = (ModelCamelContext) camelContext; - } - - public CamelContext getBuiltinCamelContext() - { - return builtinCamelContext; - } - - private Collection routeDefinitions; - - public Collection getRouteDefinitions() - { - return routeDefinitions; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - routeDefinitions = new LinkedList(); - for (RouteDefinition routeDefinition : builtinCamelContext.getRouteDefinitions()) - { - // hide the internal routes - if (!routeDefinition.getId().startsWith( "internal") ) - { - routeDefinitions.add( routeDefinition); - } - } - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/RouteOperationAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/RouteOperationAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/RouteOperationAction.java 1970-01-01 00:00:00 +0000 @@ -1,129 +0,0 @@ -package org.hisp.dhis.importexport.action.integration; - -/* - * 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.apache.camel.CamelContext; -import org.apache.camel.model.ModelCamelContext; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * @author Bob Jolliffe - * @version $Id$ - */ -public class RouteOperationAction - implements Action -{ - - private static final Log log = LogFactory.getLog( RouteOperationAction.class ); - - // ------------------------------------------------------------------------- - // Http Parameters - // ------------------------------------------------------------------------- - - private String id; - - public void setId( String id ) - { - this.id = id; - } - - public enum Operation { enable, disable ; } - - private Operation operation; - - public void setOperation( Operation operation ) - { - this.operation = operation; - } - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ModelCamelContext builtinCamelContext; - - public void setBuiltinCamelContext( CamelContext camelContext ) - { - this.builtinCamelContext = (ModelCamelContext) camelContext; - } - - public CamelContext getBuiltinCamelContext() - { - return builtinCamelContext; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - switch (operation) { - case enable: - enableRoute(); - break; - - case disable: - disableRoute(); - break; - - default: - log.debug( "Unsupported route operation"); - break; - } - - return SUCCESS; - } - - private void enableRoute() - { - try - { - builtinCamelContext.startRoute( id ); - } catch ( Exception ex ) - { - log.info( "Route start exception: " + ex.getMessage()); - } - } - - private void disableRoute() - { - try - { - builtinCamelContext.stopRoute( id ); - } catch ( Exception ex ) - { - log.info( "Route stop exception: " + ex.getMessage()); - } - } -} === removed file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/ShowAddRouteFormAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/ShowAddRouteFormAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/integration/ShowAddRouteFormAction.java 1970-01-01 00:00:00 +0000 @@ -1,53 +0,0 @@ -package org.hisp.dhis.importexport.action.integration; - -/* - * 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; - -/** - * @author Bob Jolliffe - * @version $Id$ - */ -public class ShowAddRouteFormAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - 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-09-05 09:25:02 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml 2013-10-01 13:16:44 +0000 @@ -191,21 +191,6 @@ - - - - - - - - - - - - $i18n.getString( "integration_configuration" ) - -
- -
- - - - - - - - - - - - - - - #set( $mark = false ) - #foreach( $route in $routeDefinitions ) - - - - - - - #end -
$i18n.getString( "route" )$i18n.getString( "state" )$i18n.getString( "description" )$i18n.getString( "operations" )
$encoder.htmlEncode( $route.id )$encoder.htmlEncode( $route.getStatus( $builtinCamelContext ) )$encoder.htmlEncode( $route.descriptionText ) - $i18n.getString( 'enable' ) - $i18n.getString( 'disable' ) -
=== 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-29 11:59:39 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/index.vm 2013-10-01 13:16:44 +0000 @@ -14,5 +14,4 @@ #introListImgItem( "displayExternalExportMenu.action" "export_to_other_systems" "export" ) #introListImgItem( "displayConfigDhis14Form.action" "dhis14_file_configuration" "configuration" ) - #introListImgItem( "displayRoutes.action" "integration_configuration" "configuration" ) === 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-08-29 11:59:39 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/mainMenu.vm 2013-10-01 13:16:44 +0000 @@ -24,5 +24,4 @@ === removed file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/showAddRouteForm.vm' --- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/showAddRouteForm.vm 2012-07-31 11:28:33 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/showAddRouteForm.vm 1970-01-01 00:00:00 +0000 @@ -1,23 +0,0 @@ -

$i18n.getString( "create_new_route" )

-
- - - - - - - - - - - - - - -
$i18n.getString( "details" )
-

- - -

- -