Author: rareddy
Date: 2009-04-22 14:36:11 -0400 (Wed, 22 Apr 2009)
New Revision: 826
Modified:
branches/6.0.x/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
Log:
TEIID-472: When Embedded finds a connector type that is not defined in it's own
configuration.xml, it is wrong fully removing all the property definitions set by the VDB
loader from the connector type that is loaded from file"configurationInfo.def".
The correct behaviour should be, look in its configuration if not found, look for its
parent and combine its parent and seld defined properties to make the correct set of the
property definitions.
Modified:
branches/6.0.x/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
===================================================================
---
branches/6.0.x/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-04-22
18:21:28 UTC (rev 825)
+++
branches/6.0.x/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-04-22
18:36:11 UTC (rev 826)
@@ -53,6 +53,7 @@
import com.metamatrix.common.config.model.BasicComponentType;
import com.metamatrix.common.config.model.BasicConnectorBinding;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.object.PropertyDefinition;
import com.metamatrix.common.protocol.URLHelper;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.common.util.crypto.CryptoException;
@@ -1108,7 +1109,20 @@
private ComponentType addFullPropertyDefns(ConnectorBindingType type) {
BasicComponentType baseType = (BasicComponentType)type;
-
baseType.setComponentTypeDefinitions(this.configurationModel.getAllComponentTypeDefinitions((ComponentTypeID)baseType.getID()));
+ Collection c =
this.configurationModel.getAllComponentTypeDefinitions((ComponentTypeID)baseType.getID());
+
+ // if the type is found in the configuration.xml, then add its prop-definitions;
else look for parent
+ if (c == null || c.isEmpty()) {
+ // this means user has added a new connector type
+ c =
this.configurationModel.getAllComponentTypeDefinitions(type.getSuperComponentTypeID());
+ }
+
+ if (c != null && !c.isEmpty()) {
+ Set<PropertyDefinition> defns = new HashSet<PropertyDefinition>();
+ defns.addAll(c);
+ defns.addAll(type.getComponentTypeDefinitions());
+ baseType.setComponentTypeDefinitions(defns);
+ }
return baseType;
}
Show replies by date