Author: rareddy
Date: 2010-05-13 15:04:27 -0400 (Thu, 13 May 2010)
New Revision: 2126
Modified:
trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml
trunk/client/src/main/java/org/teiid/adminapi/Translator.java
trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorMetadata.java
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
Log:
TEIID-1079: adding an addtional property called "template-name", that includes
the template name with which the translator created.
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml
===================================================================
---
trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml 2010-05-13
18:31:49 UTC (rev 2125)
+++
trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml 2010-05-13
19:04:27 UTC (rev 2126)
@@ -3,54 +3,63 @@
<translator>
<name>access</name>
<execution-factory-class>org.teiid.translator.jdbc.access.AccessExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>db2</name>
<execution-factory-class>org.teiid.translator.jdbc.db2.DB2ExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>derby</name>
<execution-factory-class>org.teiid.translator.jdbc.derby.DerbyExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>h2</name>
<execution-factory-class>org.teiid.translator.jdbc.h2.H2ExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>hsql</name>
<execution-factory-class>org.teiid.translator.jdbc.hsql.HsqlExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>mysql</name>
<execution-factory-class>org.teiid.translator.jdbc.mysql.MySQLExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>mysql5</name>
<execution-factory-class>org.teiid.translator.jdbc.mysql.MySQL5ExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>oracle</name>
<execution-factory-class>org.teiid.translator.jdbc.oracle.OracleExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>postgresql</name>
<execution-factory-class>org.teiid.translator.jdbc.postgresql.PostgreSQLExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
@@ -58,11 +67,13 @@
<name>sqlserver</name>
<execution-factory-class>org.teiid.translator.jdbc.sqlserver.SQLServerExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
+ <template-name>translator-jdbc-${project.version}</template-name>
</translator>
<translator>
<name>sybase</name>
<execution-factory-class>org.teiid.translator.jdbc.sybase.SybaseExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
+ <template-name>translator-jdbc-${project.version}</template-name>
</translator>
</translator-factory>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml
===================================================================
---
trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml 2010-05-13
18:31:49 UTC (rev 2125)
+++
trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml 2010-05-13
19:04:27 UTC (rev 2126)
@@ -3,6 +3,7 @@
<translator>
<name>ldap</name>
<execution-factory-class>org.teiid.translator.ldap.LDAPExecutionFactory</execution-factory-class>
+ <template-name>translator-ldap-${project.version}</template-name>
<translator-property name="SearchDefaultBaseDN" value=""
/>
<translator-property name="SearchDefaultScope"
value="SUBTREE_SCOPE" />
<translator-property name="RestrictToObjectClass"
value="false" />
Modified:
trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml
===================================================================
---
trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml 2010-05-13
18:31:49 UTC (rev 2125)
+++
trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml 2010-05-13
19:04:27 UTC (rev 2126)
@@ -3,5 +3,6 @@
<translator>
<name>loopback</name>
<execution-factory-class>org.teiid.translator.loopback.LoopbackExecutionFactory</execution-factory-class>
+
<template-name>translator-loopback-${project.version}</template-name>
</translator>
</translator-factory>
\ No newline at end of file
Modified:
trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml
===================================================================
---
trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml 2010-05-13
18:31:49 UTC (rev 2125)
+++
trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml 2010-05-13
19:04:27 UTC (rev 2126)
@@ -3,5 +3,6 @@
<translator>
<name>salesforce</name>
<execution-factory-class>org.teiid.translator.salesforce.SalesForceExecutionFactory</execution-factory-class>
+
<template-name>translator-salesforce-${project.version}</template-name>
</translator>
</translator-factory>
\ No newline at end of file
Modified: trunk/client/src/main/java/org/teiid/adminapi/Translator.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Translator.java 2010-05-13 18:31:49 UTC
(rev 2125)
+++ trunk/client/src/main/java/org/teiid/adminapi/Translator.java 2010-05-13 19:04:27 UTC
(rev 2126)
@@ -39,4 +39,6 @@
public String getOverrideCapabilitiesFile();
public void setOverrideCapabilitiesFile(String propsFile);
+
+ public String getTemplateName();
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java 2010-05-13
18:31:49 UTC (rev 2125)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java 2010-05-13
19:04:27 UTC (rev 2126)
@@ -49,6 +49,7 @@
public static final String XA_CAPABLE = "xa-capable"; //$NON-NLS-1$
public static final String OVERRIDE_CAPABILITIES_FILE =
"override-capabilities-file"; //$NON-NLS-1$
public static final String NAME = "name"; //$NON-NLS-1$
+ public static final String TEMPLATE_NAME = "template-name"; //$NON-NLS-1$
// objects are used to keep the jaxb putting verbose xml elements when they are not
defined.
private String executionFactoryClass;
@@ -58,6 +59,7 @@
private int maxResultRows = -1;
private boolean xaCapable = false;
private String overrideCapabilitiesFile;
+ private String templateName;
@Override
@ManagementProperty(name="name", description="Name of the
Translator", mandatory = true)
@@ -156,6 +158,17 @@
return super.getJAXBProperties();
}
+ @Override
+ @ManagementProperty(name=TEMPLATE_NAME, description = "Template with which this
Translator is created")
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ @XmlElement(name = TEMPLATE_NAME)
+ public void setTemplateName(String templateName) {
+ this.templateName = templateName;
+ }
+
public String toString() {
return getName();
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-05-13
18:31:49 UTC (rev 2125)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-05-13
19:04:27 UTC (rev 2126)
@@ -193,8 +193,6 @@
throw new
AdminProcessingException(IntegrationPlugin.Util.getString("translator_template_not_found",
typeName)); //$NON-NLS-1$
}
- properties.setProperty("name", deploymentName); //$NON-NLS-1$
-
// template properties specific to the template
Map<String, ManagedProperty> propertyMap = info.getProperties();
@@ -208,6 +206,9 @@
}
}
}
+ propertyMap.get(TranslatorMetaData.NAME).setValue(SimpleValueSupport.wrap(deploymentName));
+ propertyMap.get(TranslatorMetaData.TEMPLATE_NAME).setValue(SimpleValueSupport.wrap(typeName));
+
getView().applyTemplate(deploymentName, info);
} catch (NoSuchDeploymentException e) {
throw new AdminComponentException(e.getMessage(), e);
Modified: trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorMetadata.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorMetadata.java 2010-05-13
18:31:49 UTC (rev 2125)
+++ trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorMetadata.java 2010-05-13
19:04:27 UTC (rev 2126)
@@ -48,6 +48,7 @@
tm.setExecutionFactoryClass("org.teiid.resource.adapter.jdbc.JDBCExecutionFactory");
tm.setXaCapable(true);
tm.setName("Oracle");
+ tm.setTemplateName("template name");
tm.addProperty("ExtensionTranslationClassName",
"org.teiid.translator.jdbc.oracle.OracleSQLTranslator");
JAXBContext jc = JAXBContext.newInstance(new Class<?>[]
{TranslatorMetaDataGroup.class});
@@ -67,6 +68,7 @@
assertEquals("Oracle", tm.getName());
assertEquals("org.teiid.resource.adapter.jdbc.JDBCExecutionFactory",
tm.getExecutionFactoryClass());
assertEquals("org.teiid.translator.jdbc.oracle.OracleSQLTranslator",
tm.getPropertyValue("ExtensionTranslationClassName"));
+ assertEquals("template name", tm.getTemplateName());
}
}
Modified:
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
---
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-05-13
18:31:49 UTC (rev 2125)
+++
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-05-13
19:04:27 UTC (rev 2126)
@@ -385,15 +385,15 @@
}
// test minimal correct add
- props.setProperty("execution-factory-class",
"org.teiid.resource.adapter.jdbc.JDBCExecutionFactory");
+ props.setProperty("execution-factory-class",
"org.teiid.translator.jdbc.JDBCExecutionFactory");
admin.addTranslator("foo", "translator-jdbc"+VERSION, props);
// test set property
admin.setTranslatorProperty("foo", "TrimStrings",
"true");
Translator t = admin.getTranslator("foo");
- assertEquals("org.teiid.resource.adapter.jdbc.JDBCExecutionFactory",
t.getExecutionFactoryClass());
- assertEquals("org.teiid.resource.adapter.jdbc.JDBCExecutionFactory",
t.getExecutionFactoryClass());
+ assertEquals("org.teiid.translator.jdbc.JDBCExecutionFactory",
t.getExecutionFactoryClass());
+ assertEquals("org.teiid.translator.jdbc.JDBCExecutionFactory",
t.getExecutionFactoryClass());
admin.setTranslatorProperty("foo", "any-thing",
"every-thing");