bug fix deactivtated / deleted component use 6.0
authorchris
Wed, 03 May 2017 11:18:55 +0200
branch6.0
changeset 249dd84160d1db5
parent 248 56f849b377b1
child 250 95f56e86f736
bug fix deactivtated / deleted component use
colibriweb/src/main/java/com/proclos/colibriweb/session/modules/component/ComponentModule.java
     1.1 --- a/colibriweb/src/main/java/com/proclos/colibriweb/session/modules/component/ComponentModule.java	Fri Apr 28 13:32:00 2017 +0200
     1.2 +++ b/colibriweb/src/main/java/com/proclos/colibriweb/session/modules/component/ComponentModule.java	Wed May 03 11:18:55 2017 +0200
     1.3 @@ -303,11 +303,17 @@
     1.4  				XSDAnalyzer.ComplexFieldValue v = analyzer.getConnection();
     1.5  				if (v != null) {
     1.6  					if (v.getInput() != null) {
     1.7 +						boolean connectionFound = false;
     1.8  						for (Component connection : availableConnections) {
     1.9  							if (connection.getName().equals(v.getInput())) {
    1.10  								getInstance().setConnection((Connection) connection);
    1.11 +								connectionFound = true;
    1.12 +								break;
    1.13  							}
    1.14  						}
    1.15 +						if (!connectionFound) {
    1.16 +							analyzer.deleteConnection();
    1.17 +						}
    1.18  					}
    1.19  				}
    1.20  			}
    1.21 @@ -343,11 +349,17 @@
    1.22  			getInstance().getSources().clear();
    1.23  			for (XSDAnalyzer.ComplexFieldValue v : analyzer.getSources()) {
    1.24  				if (v.getInput() != null) {
    1.25 +					boolean sourceFound = false;
    1.26  					for (Component source : availableSources) {
    1.27  						if (source.getName().equals(v.getInput())) {
    1.28  							getInstance().getSources().add(source);
    1.29 +							sourceFound = true;
    1.30 +							break;
    1.31  						}
    1.32  					}
    1.33 +					if (!sourceFound) { //deactivated or deleted
    1.34 +						analyzer.deleteSource(v.getInput());
    1.35 +					}
    1.36  				}
    1.37  			}
    1.38  		}