Author: tejones
Date: 2010-11-30 04:03:48 -0500 (Tue, 30 Nov 2010)
New Revision: 2748
Modified:
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
TEIID-1364: Added a property to the Data Services tab to enable/disable filtering of
preview VDBs.
Modified:
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
===================================================================
---
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-11-29
21:03:01 UTC (rev 2747)
+++
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2010-11-30
09:03:48 UTC (rev 2748)
@@ -179,7 +179,6 @@
try {
managementView.updateComponent(managedComponent);
- managementView.load();
} catch (Exception e) {
LOG.error("Unable to update component [" //$NON-NLS-1$
+ managedComponent.getName() + "] of type " //$NON-NLS-1$
@@ -193,6 +192,8 @@
report.setStatus(ConfigurationUpdateStatus.FAILURE);
report.setErrorMessageFromThrowable(e);
}
+
+ managementView.load();
}
@@ -205,8 +206,8 @@
public Configuration loadResourceConfiguration() {
// Get plugin config
- Configuration c = resourceContext.getPluginConfiguration();
-
+ Configuration c = resourceConfiguration;
+
getProperties(c);
return c;
Modified:
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java
===================================================================
---
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java 2010-11-29
21:03:01 UTC (rev 2747)
+++
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java 2010-11-30
09:03:48 UTC (rev 2748)
@@ -90,8 +90,7 @@
);
Configuration configuration = detail.getPluginConfiguration();
- configuration.put(new PropertySimple(
- PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT, 600));
+ configuration.put(new PropertySimple("displayPreviewVDBS", Boolean.FALSE));
detail.setPluginConfiguration(configuration);
// Add to return values
Modified:
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
===================================================================
---
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-11-29
21:03:01 UTC (rev 2747)
+++
branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-11-30
09:03:48 UTC (rev 2748)
@@ -28,6 +28,10 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
@@ -58,9 +62,35 @@
.getManagedComponents(connection, new ComponentType(
PluginConstants.ComponentType.VDB.TYPE,
PluginConstants.ComponentType.VDB.SUBTYPE));
-
+
+ PropertySimple displayPreviewVdbs =
((PlatformComponent)discoveryContext.getParentResourceComponent()).getResourceConfiguration().getSimple("displayPreviewVDBS");
+
for (ManagedComponent mcVdb : vdbs) {
+ boolean skipVdb = false;
+ if (!displayPreviewVdbs.getBooleanValue()){
+ MetaValue[] propsArray =
((CollectionValueSupport)mcVdb.getProperty("JAXBProperties").getValue()).getElements();
+ String isPreview = "false";
+
+ for (MetaValue propertyMetaData : propsArray) {
+ GenericValueSupport genValueSupport = (GenericValueSupport) propertyMetaData;
+ ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+ .getValue();
+
+ String propertyName = ProfileServiceUtil.getSimpleValue(
+ managedObject, "name", String.class);
+ if (propertyName.equals("preview")){
+ isPreview =ProfileServiceUtil.getSimpleValue(
+ managedObject, "value", String.class);
+ if (Boolean.valueOf(isPreview)) skipVdb=true;
+ break;
+ }
+ }
+ }
+
+ //If this is a Preview VDB and displayPreviewVdbs is false, skip this VDB
+ if (skipVdb) continue;
+
String vdbKey = (String)mcVdb.getName();
String vdbName = vdbKey;
String fullName = ProfileServiceUtil.getSimpleValue(mcVdb, "fullName",
Modified: branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml 2010-11-29 21:03:01
UTC (rev 2747)
+++ branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml 2010-11-30 09:03:48
UTC (rev 2748)
@@ -296,6 +296,13 @@
property="QUERY_SERVICE_RESULT_SET_CACHE.requestCount"
description="Total number of requests made against cache" />
<resource-configuration>
+ <c:group name="SessionSettings" displayName="Settings for the
Data Services plugin. Will be reset with a server restart."
+ hiddenByDefault="false">
+ <c:simple-property name="displayPreviewVDBS" displayName="Display
Preview VDBs"
+ description="If 'Yes', Preview VDBs (created by the Teiid Designer)
will display in the Virtual Database resource grouping. The default is 'No'"
+ required="true" readOnly="false" type="boolean"
default="true" />
+ </c:group>
+
<c:group name="RuntimeEngineDeployer" displayName="Runtime Engine
Properties (restart required before modifications take effect)"
hiddenByDefault="false">
<c:simple-property name="RuntimeEngineDeployer.maxRowsFetchSize"