[teiid-commits] teiid SVN: r2170 - in trunk/console/src/main: resources/META-INF and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri May 28 14:35:50 EDT 2010


Author: tejones
Date: 2010-05-28 14:35:50 -0400 (Fri, 28 May 2010)
New Revision: 2170

Modified:
   trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
   trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
Updated Translator logic to reflect changes in Teiid and remove create logic since this is no longer allowed via the plugin

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java	2010-05-28 14:18:02 UTC (rev 2169)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java	2010-05-28 18:35:50 UTC (rev 2170)
@@ -319,11 +319,6 @@
 			componentType = new ComponentType(
 					PluginConstants.ComponentType.VDB.TYPE,
 					PluginConstants.ComponentType.VDB.SUBTYPE);
-		} else if (this.getComponentType()
-				.equals(PluginConstants.ComponentType.Translator.NAME)) {
-			componentType = new ComponentType(
-					PluginConstants.ComponentType.Translator.TYPE,
-					PluginConstants.ComponentType.Translator.SUBTYPE);
 		} else {
 			report.setStatus(ConfigurationUpdateStatus.FAILURE);
 			report.setErrorMessage("Update not implemented for the component type.");
@@ -496,11 +491,11 @@
 	@Override
 	public CreateResourceReport createResource(CreateResourceReport report) {
 		ResourceType resourceType = report.getResourceType();
-		if (resourceType.getName().equals("Translators")) {
-			createConfigurationBasedResource(report);
-		} else {
+//		if (resourceType.getName().equals("Translators")) {
+//			createConfigurationBasedResource(report);
+//		} else {
 			createContentBasedResource(report);
-		}
+//		}
 
 		return report;
 	}

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java	2010-05-28 14:18:02 UTC (rev 2169)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java	2010-05-28 18:35:50 UTC (rev 2170)
@@ -28,26 +28,19 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.jboss.deployers.spi.management.ManagementView;
 import org.jboss.managed.api.ComponentType;
-import org.jboss.managed.api.DeploymentTemplateInfo;
 import org.jboss.managed.api.ManagedComponent;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.metatype.api.types.MetaType;
 import org.jboss.metatype.api.values.MetaValue;
 import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.rhq.core.domain.configuration.Configuration;
 import org.rhq.core.domain.configuration.PropertyList;
 import org.rhq.core.domain.configuration.PropertyMap;
 import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
 import org.rhq.core.domain.measurement.MeasurementDataNumeric;
 import org.rhq.core.domain.measurement.MeasurementReport;
 import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.CreateResourceStatus;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.pluginapi.inventory.CreateResourceReport;
 import org.rhq.core.pluginapi.inventory.ResourceContext;
 import org.rhq.core.pluginapi.measurement.MeasurementFacet;
 import org.teiid.rhq.comm.ConnectionConstants;
@@ -165,28 +158,12 @@
 
 		// First get translator specific properties
 		ManagedProperty translatorProps = translator
-				.getProperty("translator-property");
+				.getProperty("property");
 		getTranslatorValues(translatorProps.getValue(), propMap, list);
 
 		// Now get common properties
 		c.put(new PropertySimple("name", translatorName));
-		c.put(new PropertySimple("execution-factory-class",
-				ProfileServiceUtil.getSimpleValue(translator,
-						"execution-factory-class", String.class)));
-		c.put(new PropertySimple("immutable", ProfileServiceUtil
-				.getSimpleValue(translator, "immutable", Boolean.class)));
-		c.put(new PropertySimple("xa-capable", ProfileServiceUtil
-				.getSimpleValue(translator, "xa-capable", Boolean.class)));
-		c.put(new PropertySimple("exception-on-max-rows",
-				ProfileServiceUtil.getSimpleValue(translator,
-						"exception-on-max-rows", Boolean.class)));
-		c.put(new PropertySimple("max-result-rows", ProfileServiceUtil
-				.getSimpleValue(translator, "max-result-rows",
-						Integer.class)));
-		c.put(new PropertySimple("template-name", ProfileServiceUtil
-						.getSimpleValue(translator, "template-name",
-								String.class)));
-
+		
 		return c;
 
 	}
@@ -200,7 +177,7 @@
 					.getInstance().unwrap(pValue);
 
 			for (String key : unwrappedvalue.keySet()) {
-				map = new PropertyMap("translator-properties");
+				map = new PropertyMap("property");
 				map.put(new PropertySimple("name", key));
 				map.put(new PropertySimple("value", unwrappedvalue.get(key)));
 				map.put(new PropertySimple("description", "Custom property"));

Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml	2010-05-28 14:18:02 UTC (rev 2169)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml	2010-05-28 18:35:50 UTC (rev 2170)
@@ -487,7 +487,7 @@
 								required="false" readOnly="true" />
 							<c:simple-property name="translatorName"
 								displayName="Translator Name" description="Name of the translator"
-								required="true" />
+								required="false" readOnly="true"/>
 							<c:simple-property name="jndiName" displayName="Connection JNDI Name"
 								description="JNDI name for this connection" required="false" />
 							<c:simple-property name="visibility"
@@ -548,76 +548,16 @@
 			class="TranslatorComponent" discovery="TranslatorDiscoveryComponent"
 			createDeletePolicy="both" creationDataType="configuration">
 
-			<plugin-configuration>
-				<c:simple-property name="componentType" default="teiid" readOnly="true" />
-				<c:simple-property name="componentSubtype" default="translator" readOnly="true" />
-				<c:simple-property name="componentName" default="teiid" readOnly="true" />
-				<c:simple-property name="template-name" default="translator"	readOnly="true" />
-				<c:simple-property name="resourceName" default="name">
-					<c:description>The name of the Resource configuration property
-						whose value should be used as the
-						Resource name when creating a new
-						Resource of this type.</c:description>
-				</c:simple-property>
-			</plugin-configuration>
-
 			<resource-configuration>
-				<c:simple-property name="name" displayName="Name" description="Name of the translator" />
-				<c:simple-property name="type" 	displayName="Type" description="Base Translator Type" readOnly="true"/>
+				<c:simple-property name="name" displayName="Name" description="Name of the translator" readOnly="true" required="false"/>
 				<c:list-property name="translatorList" readOnly="true" required="false"
-                			displayName="Translator Specific Properties" description="List of translator specific properties">
-					<c:map-property name="translator-properties" readOnly="true">
+                			displayName="Properties" description="Translator properties">
+					<c:map-property name="properties" readOnly="true">
 						<c:simple-property name="name" displayName="Name" description="Name of this property" readOnly="true" />
 						<c:simple-property name="value" displayName="Value"	description="Value of this property" readOnly="true"/>
-						<!--c:simple-property name="description" 	displayName="Description" description="Description of this property" readOnly="true"/-->
 					</c:map-property>
 				</c:list-property>
 
-				<c:template name="Access" description="Translator for Access">
-					<c:simple-property name="type" 	default="access" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="DB2" description="Translator for DB2">
-                    <c:simple-property name="type" 	default="db2" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="Derby" description="Translator for Derby">
-					<c:simple-property name="execution-factory-class"
-						default="org.teiid.translator.jdbc.derby.DerbyExecutionFactory"
-						displayName="execution-factory-class" description="Connector Class" />
-				</c:template>
-				<c:template name="H2" description="Translator for H2">
-                    <c:simple-property name="type" 	default="h2" displayName="Type" description="Base Translator Type" readOnly="true"/>				
-                </c:template>
-				<c:template name="HSQL" description="Translator for HSQL">
-					<c:simple-property name="type" 	default="hsql" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="MySQL" description="Translator for MySQL">
-					<c:simple-property name="type" 	default="mysql" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="MySQL5" description="Translator for MySQL 5">
-					<c:simple-property name="type" 	default="mysql5" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="Oracle" description="Translator for Oracle">
-					<c:simple-property name="type" 	default="oracle" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="SQLServer" description="Translator for SQLServer">
-					<c:simple-property name="type" 	default="sqlserver" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="Sybase" description="Translator for Sybase">
-					<c:simple-property name="type" 	default="sybase" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="LDAP" description="Translator for LDAP">
-					<c:simple-property name="type" 	default="ldap" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="SalesForce" description="Translator for SalesForce">
-					<c:simple-property name="type" 	default="salesforce" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="XML" description="Translator for XML">
-					<c:simple-property name="type" 	default="xml" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-				<c:template name="Loopback" description="Translator for Loopback">
-					<c:simple-property name="type" 	default="loopback" displayName="Type" description="Base Translator Type" readOnly="true"/>
-				</c:template>
-
 			</resource-configuration>
 
 		</service>



More information about the teiid-commits mailing list