[rhq] 2 commits - modules/core modules/enterprise
by snegrea
modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java | 12 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java | 58 ++++++++--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java | 12 ++
3 files changed, 71 insertions(+), 11 deletions(-)
New commits:
commit b5808831cbfdcf66f19fe6282384f59861834135
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Nov 17 15:46:43 2011 -0600
[BZ 747430] Update the code that defaults the icon to document.png to check for nulls. The exception path is specific to I18N implementation.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index 9ae00e4..2d86b1d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -122,6 +122,9 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
String icon;
try {
icon = this.getContent("view_help_section_" + i + "_propIcon_" + j);
+ if (icon == null) {
+ icon = "[SKIN]/../headerIcons/document.png";
+ }
} catch (MissingResourceException e) {
icon = "[SKIN]/../headerIcons/document.png";
}
commit 76a10d9c499680595bbd551186bf282612c76359
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Nov 17 13:19:10 2011 -0600
[BZ 747430] Add support for loading help view content from product info file.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java
index 29aa74e..ea34515 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java
@@ -19,6 +19,7 @@
package org.rhq.core.domain.common;
import java.io.Serializable;
+import java.util.HashMap;
/**
* Product (i.e. RHQ or JON) information.
@@ -27,7 +28,7 @@ import java.io.Serializable;
*/
public class ProductInfo implements Serializable {
private static final long serialVersionUID = 1L;
-
+
private String shortName;
private String name;
private String fullName;
@@ -38,6 +39,7 @@ public class ProductInfo implements Serializable {
private String version;
private String buildNumber;
private String helpDocRoot;
+ private HashMap<String, String> helpViewContent;
public String getShortName() {
return shortName;
@@ -118,4 +120,12 @@ public class ProductInfo implements Serializable {
public void setHelpDocRoot(String helpDocRoot) {
this.helpDocRoot = helpDocRoot;
}
+
+ public HashMap<String, String> getHelpViewContent() {
+ return helpViewContent;
+ }
+
+ public void setHelpViewContent(HashMap<String, String> helpViewContent) {
+ this.helpViewContent = helpViewContent;
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index 8f4df4b..9ae00e4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -27,8 +27,8 @@ import java.util.List;
import java.util.MissingResourceException;
import com.smartgwt.client.widgets.Canvas;
-
import com.smartgwt.client.widgets.Label;
+
import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.MessageConstants;
@@ -53,7 +53,9 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
private static final ViewName SECTION_PRODUCT_VIEW_ID = new ViewName("Product", MSG.view_help_section_product());
- private static ProductInfo PRODUCT_INFO;
+ private final ProductInfo productInfo = CoreGUI.get().getProductInfo();
+ private final MessageConstants messageConstants = CoreGUI.getMessageConstants();
+ private boolean contentFromProductInfo;
public HelpView() {
// This is a top level view, so our locator id can simply be our view id.
@@ -94,7 +96,6 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
"[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
- ProductInfo productInfo = CoreGUI.get().getProductInfo();
aboutModalWindow.setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
aboutModalWindow.show();
return aboutModalWindow;
@@ -106,21 +107,21 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
}
private void addUrlSections(List<NavigationSection> sections) {
+ this.selectContentLocation();
- MessageConstants mc = CoreGUI.getMessageConstants();
- int numSections = Integer.valueOf(mc.view_help_section_count());
+ int numSections = Integer.valueOf(this.getContent("view_help_section_count"));
for (int i = 1; i <= numSections; ++i) {
- int numItems = Integer.valueOf(mc.getString("view_help_section_" + i + "_item_count"));
+ int numItems = Integer.valueOf(this.getContent("view_help_section_" + i + "_item_count"));
NavigationItem[] items = new NavigationItem[numItems];
- String sectionTitle = mc.getString("view_help_section_" + i + "_title");
+ String sectionTitle = this.getContent("view_help_section_" + i + "_title");
for (int j = 1; j <= numItems; ++j) {
- String title = mc.getString("view_help_section_" + i + "_propTitle_" + j);
- final String url = mc.getString("view_help_section_" + i + "_propUrl_" + j);
+ String title = this.getContent("view_help_section_" + i + "_propTitle_" + j);
+ final String url = this.getContent("view_help_section_" + i + "_propUrl_" + j);
String icon;
try {
- icon = mc.getString("view_help_section_" + i + "_propIcon_" + j);
+ icon = this.getContent("view_help_section_" + i + "_propIcon_" + j);
} catch (MissingResourceException e) {
icon = "[SKIN]/../headerIcons/document.png";
}
@@ -139,4 +140,38 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
}
}
+ /**
+ * Preselects content location.
+ *
+ * I18N GWT bakes all the messages into the compiled Javascript (it is impossible to change anything
+ * without recompiling the entire project). However, there is a need to dynamically change the help
+ * content after the code is compiled and shipped. ProductInfo is dynamically loaded at runtime from disk.
+ * This implementation allows runtime location selection for help page content:
+ * 1) ProductInfo
+ * 2) I18N GWT system
+ *
+ * NOTE: All the content is loaded from a single location and production info properties file gets priority.
+ */
+ private void selectContentLocation() {
+ if (productInfo.getHelpViewContent().containsKey("view_help_section_count")) {
+ //use the product info file for help content
+ this.contentFromProductInfo = true;
+ } else {
+ //use the I18N mechanism for help content
+ this.contentFromProductInfo = false;
+ }
+ }
+
+ /**
+ * Retrieves help view content from the selected content location.
+ *
+ * @return help view content
+ */
+ private String getContent(String key) {
+ if (this.contentFromProductInfo) {
+ return productInfo.getHelpViewContent().get(key);
+ } else {
+ return messageConstants.getString(key);
+ }
+ }
}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
index decf99e..4da4f55 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
+import java.util.HashMap;
import java.util.Properties;
import javax.management.MBeanServer;
@@ -157,6 +158,17 @@ public class CoreServer extends ServiceMBeanSupport implements CoreServerMBean {
productInfo.setUrlDomain(props.getProperty("urlDomain"));
productInfo.setUrl(props.getProperty("url"));
productInfo.setVersion(props.getProperty("version"));
+
+ HashMap<String, String> helpViewContent = new HashMap<String, String>();
+
+ for (String propertyName : props.stringPropertyNames()) {
+ if (propertyName.startsWith("view_help_section")) {
+ helpViewContent.put(propertyName, props.getProperty(propertyName));
+ }
+ }
+
+ productInfo.setHelpViewContent(helpViewContent);
+
return productInfo;
} else {
throw new IllegalStateException("Failed to find class loader resource ["
12 years, 6 months
[rhq] Branch 'stefan/helpupdates' - modules/enterprise
by snegrea
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit d27d1ceff8c5b6c004c75053405216b21e86ffe2
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Nov 17 15:46:43 2011 -0600
[BZ 747430] Update the code that defaults the icon to document.png to check for nulls. The exception path is specific to I18N implementation.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index 9ae00e4..2d86b1d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -122,6 +122,9 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
String icon;
try {
icon = this.getContent("view_help_section_" + i + "_propIcon_" + j);
+ if (icon == null) {
+ icon = "[SKIN]/../headerIcons/document.png";
+ }
} catch (MissingResourceException e) {
icon = "[SKIN]/../headerIcons/document.png";
}
12 years, 6 months
[rhq] Branch 'release-3.0.1' - modules/enterprise
by Larry O'Leary
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java | 27 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/operation/OperationManagerBeanTest.java | 205 +++++-----
2 files changed, 131 insertions(+), 101 deletions(-)
New commits:
commit cf2e49c5d69a5d844b22708b9deea29065c61f97
Author: Larry O'Leary <loleary(a)redhat.com>
Date: Thu Nov 17 15:29:20 2011 -0600
Fixed reliability of a couple of unit tests
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java
index ab55bac..9bba49b 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -75,6 +75,7 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
import org.rhq.core.util.file.FileUtil;
@@ -91,7 +92,7 @@ import org.rhq.enterprise.server.util.LookupUtil;
* @author John Mazzitelli
* @author Jay Shaughnessy
*/
-@SuppressWarnings( { "unused" })
+@SuppressWarnings({ "unused" })
@Test
public class BundleManagerBeanTest extends UpdateSubsytemTestBase {
@@ -123,14 +124,12 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase {
@BeforeMethod
public void beforeMethod() throws Exception {
-
this.ps = new TestBundleServerPluginService();
prepareCustomServerPluginService(this.ps);
bundleManager = LookupUtil.getBundleManager();
resourceManager = LookupUtil.getResourceManager();
overlord = LookupUtil.getSubjectManager().getOverlord();
this.ps.startMasterPluginContainer();
-
// try and clean up any junk that may be lying around from a failed run
cleanupDatabase();
}
@@ -580,6 +579,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase {
// verify our composite criteria query can return more than one item
Bundle b2 = createBundle("two");
assertNotNull(b2);
+ criteria.addSortName(PageOrdering.ASC);
results = bundleManager.findBundlesWithLatestVersionCompositesByCriteria(overlord, criteria);
assert results.size() == 2 : results;
assert results.get(0).getBundleId().equals(b1.getId());
@@ -597,19 +597,6 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase {
assertNotNull(b2_bv1);
assertEquals("9.1", b2_bv1.getVersion());
- results = bundleManager.findBundlesWithLatestVersionCompositesByCriteria(overlord, criteria);
- assert results.size() == 2 : results;
- assert results.get(0).getBundleId().equals(b1.getId());
- assert results.get(0).getBundleName().equals(b1.getName());
- assert results.get(0).getBundleDescription().equals(b1.getDescription());
- assert results.get(0).getLatestVersion().equals("2.0");
- assert results.get(0).getVersionsCount().longValue() == 4L;
- assert results.get(1).getBundleId().equals(b2.getId());
- assert results.get(1).getBundleName().equals(b2.getName());
- assert results.get(1).getBundleDescription().equals(b2.getDescription());
- assert results.get(1).getLatestVersion().equals("9.1");
- assert results.get(1).getVersionsCount().longValue() == 1L;
-
// test sorting of the BundleWithLastestVersionComposite
criteria.addSortName(PageOrdering.DESC);
results = bundleManager.findBundlesWithLatestVersionCompositesByCriteria(overlord, criteria);
@@ -818,6 +805,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase {
// return all with no optional data
c.addFilterName(TEST_PREFIX);
+ c.addSortName(PageOrdering.ASC);
bundles = bundleManager.findBundlesByCriteria(overlord, c);
assertNotNull(bundles);
assertEquals(2, bundles.size());
@@ -875,7 +863,12 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase {
// return all with no optional data
c.addFilterName(TEST_PREFIX);
+ c.fetchBundle(true);
+ PageControl pc = new PageControl();
+ pc.addDefaultOrderingField("version");
+ c.setPageControl(pc);
bvs = bundleManager.findBundleVersionsByCriteria(overlord, c);
+
bv = bvs.get(1);
assertNotNull(bvs);
assertEquals(3, bvs.size());
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/operation/OperationManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/operation/OperationManagerBeanTest.java
index eaf6182..d3f8a31 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/operation/OperationManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/operation/OperationManagerBeanTest.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -35,8 +35,8 @@ import org.testng.annotations.Test;
import org.rhq.core.clientapi.agent.PluginContainerException;
import org.rhq.core.clientapi.agent.operation.CancelResults;
-import org.rhq.core.clientapi.agent.operation.OperationAgentService;
import org.rhq.core.clientapi.agent.operation.CancelResults.InterruptedState;
+import org.rhq.core.clientapi.agent.operation.OperationAgentService;
import org.rhq.core.clientapi.server.operation.OperationServerService;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.configuration.Configuration;
@@ -224,8 +224,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
.getGroup().getId());
PageList<GroupOperationHistory> results;
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results.size() == 0;
// should be no resource histories that belong to it
@@ -288,8 +288,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert list.size() == 0;
PageList<GroupOperationHistory> results;
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results.size() == 0;
// should be no resource histories that belong to it
@@ -334,14 +334,14 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
Thread.sleep(9000L); // wait for it to be triggered and finish
PageList<GroupOperationHistory> results;
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results.size() == 1 : "Expected 1 result, but got " + results.size();
operationManager.deleteOperationHistory(overlord, results.get(0).getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results.size() == 0;
// purging group history purges all resource histories that belong to it
@@ -373,8 +373,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
// wait for it to be triggered so we get a history item
for (int i = 0; i < 5; i++) {
Thread.sleep(1000L);
- results = operationManager.findPendingGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findPendingGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
if ((results != null) && (results.size() > 0)) {
break; // operation was triggered - got the history item
}
@@ -404,8 +404,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
// cancel the group history - which cancels all the resource histories
operationManager.cancelOperationHistory(overlord, history.getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 1;
assert results.get(0).getStatus() == OperationRequestStatus.CANCELED : results.get(0);
@@ -424,8 +424,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
// purge the group history
operationManager.deleteOperationHistory(overlord, history.getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0; // none left, we purged the only group history there was
@@ -458,8 +458,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
// wait for it to be triggered so we get a history item
for (int i = 0; i < 5; i++) {
Thread.sleep(1000L);
- results = operationManager.findPendingGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findPendingGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
if ((results != null) && (results.size() > 0)) {
break; // operation was triggered - got the history item
}
@@ -471,9 +471,17 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert history.getStatus() == OperationRequestStatus.INPROGRESS : history;
// get the one resource history from the group
- PageList<ResourceOperationHistory> results2;
- results2 = operationManager.findPendingResourceOperationHistories(overlord, newResource.getId(), PageControl
- .getUnlimitedInstance());
+ PageList<ResourceOperationHistory> results2 = null;
+ // Give the operation up to 30 seconds to complete before we consider the test a failure
+ for (int i = 0; i < 30; i++) {
+ results2 = operationManager.findPendingResourceOperationHistories(overlord, newResource.getId(),
+ PageControl.getUnlimitedInstance());
+ assert results2 != null;
+ if (results2.size() > 0)
+ break;
+ Thread.sleep(1000L); // wait for it to finish, should be fast
+ }
+
assert results2.size() == 1 : "Should have had 1 resource history result: " + results2;
ResourceOperationHistory rHistory = results2.get(0);
@@ -483,28 +491,28 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
// this doesn't actually cancel the FINISHED resource operation. This simulates the fact that
// the agent couldn't cancel the resource op since it already finished.
operationManager.cancelOperationHistory(overlord, history.getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results.size() == 1;
assert results.get(0).getStatus() == OperationRequestStatus.CANCELED : results.get(0);
- results = operationManager.findPendingGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findPendingGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results.size() == 0;
// still pending - our operation wasn't really canceled - waiting for the agent to tell us its finished
results2 = operationManager.findCompletedResourceOperationHistories(overlord, newResource.getId(), null, null,
PageControl.getUnlimitedInstance());
assert results2.size() == 0;
- results2 = operationManager.findPendingResourceOperationHistories(overlord, newResource.getId(), PageControl
- .getUnlimitedInstance());
+ results2 = operationManager.findPendingResourceOperationHistories(overlord, newResource.getId(),
+ PageControl.getUnlimitedInstance());
assert results2.size() == 1;
assert results2.get(0).getStatus() == OperationRequestStatus.INPROGRESS : results2.get(0);
// purge the group history (note we tell it to even purge those in progress)
operationManager.deleteOperationHistory(overlord, history.getId(), true);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0; // none left, we purged the only group history there was
@@ -531,12 +539,16 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert schedule.getParameters() == null;
assert schedule.getGroup().getId() == newGroup.getId();
- Thread.sleep(4000L); // wait for it to finish, should be fast
-
- PageList<GroupOperationHistory> results;
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
- assert results != null;
+ PageList<GroupOperationHistory> results = null;
+ // Give the operation up to 30 seconds to complete before we consider the test a failure
+ for (int i = 0; i < 30; i++) {
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
+ assert results != null;
+ if (results.size() > 0)
+ break;
+ Thread.sleep(1000L); // wait for it to finish, should be fast
+ }
assert results.size() == 1;
GroupOperationHistory history = results.get(0);
assert history.getId() > 0 : history;
@@ -571,8 +583,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert rHistory.getSubjectName().equals(overlord.getName()) : rHistory;
operationManager.deleteOperationHistory(overlord, history.getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0; // none left, we purged the only group history there was
@@ -605,8 +617,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
Thread.sleep(8000L); // wait for it to finish, should be fast
PageList<GroupOperationHistory> results;
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
// the group job executed twice
assert results != null;
@@ -661,8 +673,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
operationManager.deleteOperationHistory(overlord, history0.getId(), false);
operationManager.deleteOperationHistory(overlord, history1.getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0 : results; // none left, we purged the two group histories
@@ -705,12 +717,17 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
int scheduleParamId = schedule.getParameters().getId();
- Thread.sleep(4000L); // wait for it to finish, should be fast
+ PageList<GroupOperationHistory> results = null;
+ // Give the operation up to 30 seconds to complete before we consider the test a failure
+ for (int i = 0; i < 30; i++) {
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
+ assert results != null;
+ if (results.size() > 0)
+ break;
+ Thread.sleep(1000L); // wait for it to finish, should be fast
+ }
- PageList<GroupOperationHistory> results;
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
- assert results != null;
assert results.size() == 1;
GroupOperationHistory history = results.get(0);
assert history.getId() > 0 : history;
@@ -740,8 +757,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert rHistory.getSubjectName().equals(overlord.getName()) : rHistory;
// parameters and results are lazily loaded in the paginated queries, but are eagerly individually
- rHistory = (ResourceOperationHistory) operationManager.getOperationHistoryByHistoryId(overlord, rHistory
- .getId());
+ rHistory = (ResourceOperationHistory) operationManager.getOperationHistoryByHistoryId(overlord,
+ rHistory.getId());
assert rHistory.getResults() != null;
assert rHistory.getResults().getSimple("param1echo") != null;
assert rHistory.getResults().getSimple("param1echo").getStringValue().equals("group-test");
@@ -749,8 +766,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert rHistory.getParameters().getId() != history.getParameters().getId() : "params should be copies - not shared";
operationManager.deleteOperationHistory(overlord, history.getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0; // none left, we purged the only group history there was
@@ -776,12 +793,17 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert schedule.getParameters() == null;
assert schedule.getGroup().getId() == newGroup.getId();
- Thread.sleep(4000L); // wait for it to finish, should be fast
+ PageList<GroupOperationHistory> results = null;
+ // Give the operation up to 30 seconds to complete before we consider the test a failure
+ for (int i = 0; i < 30; i++) {
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
+ assert results != null;
+ if (results.size() > 0)
+ break;
+ Thread.sleep(1000L); // wait for it to finish, should be fast
+ }
- PageList<GroupOperationHistory> results;
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
- assert results != null;
assert results.size() == 1 : "Did not get 1 result back, but " + results.size();
GroupOperationHistory history = results.get(0);
assert history.getId() > 0 : history;
@@ -808,8 +830,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert rHistory.getSubjectName().equals(overlord.getName()) : rHistory;
operationManager.deleteOperationHistory(overlord, history.getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0; // none left, we purged the only group history there was
@@ -835,12 +857,17 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert schedule.getParameters() == null;
assert schedule.getGroup().getId() == newGroup.getId();
- Thread.sleep(4000L); // wait for it to finish, should be fast
+ PageList<GroupOperationHistory> results = null;
+ // Give the operation up to 30 seconds to complete before we consider the test a failure
+ for (int i = 0; i < 30; i++) {
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
+ assert results != null;
+ if (results.size() > 0)
+ break;
+ Thread.sleep(1000L); // wait for it to finish, should be fast
+ }
- PageList<GroupOperationHistory> results;
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
- assert results != null;
assert results.size() == 1;
GroupOperationHistory history = results.get(0);
assert history.getId() > 0 : history;
@@ -867,8 +894,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert rHistory.getSubjectName().equals(overlord.getName()) : rHistory;
operationManager.deleteOperationHistory(overlord, history.getId(), false);
- results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findCompletedGroupOperationHistories(overlord, newGroup.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0; // none left, we purged the only group history there was
@@ -1172,8 +1199,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
// wait for it to be triggered so we get a history item
for (int i = 0; i < 5; i++) {
Thread.sleep(1000L);
- results = operationManager.findPendingResourceOperationHistories(overlord, resource.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findPendingResourceOperationHistories(overlord, resource.getId(),
+ PageControl.getUnlimitedInstance());
if ((results != null) && (results.size() > 0)) {
break; // operation was triggered - got the history item
}
@@ -1231,8 +1258,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
// wait for it to be triggered so we get a history item
for (int i = 0; i < 5; i++) {
Thread.sleep(1000L);
- results = operationManager.findPendingResourceOperationHistories(overlord, resource.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findPendingResourceOperationHistories(overlord, resource.getId(),
+ PageControl.getUnlimitedInstance());
if ((results != null) && (results.size() > 0)) {
break; // operation was triggered - got the history item
}
@@ -1252,8 +1279,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert results.size() == 0;
// still pending - our operation wasn't really canceled - waiting for the agent to tell us its finished
- results = operationManager.findPendingResourceOperationHistories(overlord, resource.getId(), PageControl
- .getUnlimitedInstance());
+ results = operationManager.findPendingResourceOperationHistories(overlord, resource.getId(),
+ PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 1;
history = results.get(0);
@@ -1306,8 +1333,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert history.getSubjectName().equals(overlord.getName()) : history;
PageList<ResourceOperationLastCompletedComposite> list;
- list = operationManager.findRecentlyCompletedResourceOperations(overlord, null, PageControl
- .getUnlimitedInstance());
+ list = operationManager.findRecentlyCompletedResourceOperations(overlord, null,
+ PageControl.getUnlimitedInstance());
assert list.size() == 1;
assert list.get(0).getOperationHistoryId() == history.getId();
assert list.get(0).getResourceId() == resource.getId();
@@ -1320,8 +1347,8 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert results != null;
assert results.size() == 0;
- list = operationManager.findRecentlyCompletedResourceOperations(overlord, null, PageControl
- .getUnlimitedInstance());
+ list = operationManager.findRecentlyCompletedResourceOperations(overlord, null,
+ PageControl.getUnlimitedInstance());
assert list.size() == 0;
}
@@ -1343,12 +1370,17 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
assert schedule.getParameters() == null;
assert schedule.getResource().getId() == newResource.getId();
- Thread.sleep(4000L); // wait for it to finish, should be very quick
+ PageList<ResourceOperationHistory> results = null;
+ // Give the operation up to 30 seconds to complete before we consider the test a failure
+ for (int i = 0; i < 30; i++) {
+ results = operationManager.findCompletedResourceOperationHistories(overlord, resource.getId(), null, null,
+ PageControl.getUnlimitedInstance());
+ assert results != null;
+ if (results.size() > 1)
+ break;
+ Thread.sleep(1000L); // wait for it to finish, should be fast
+ }
- PageList<ResourceOperationHistory> results;
- results = operationManager.findCompletedResourceOperationHistories(overlord, resource.getId(), null, null,
- PageControl.getUnlimitedInstance());
- assert results != null;
assert results.size() == 2 : "Should have had multiple results: " + results;
ResourceOperationHistory history0 = results.get(0);
assert history0.getId() > 0 : history0;
@@ -1407,12 +1439,17 @@ public class OperationManagerBeanTest extends AbstractEJB3Test {
int scheduleParamId = schedule.getParameters().getId();
- Thread.sleep(4000L); // wait for it to finish, should be very quick
+ PageList<ResourceOperationHistory> results = null;
+ // Give the operation up to 30 seconds to complete before we consider the test a failure
+ for (int i = 0; i < 30; i++) {
+ results = operationManager.findCompletedResourceOperationHistories(overlord, resource.getId(), null, null,
+ PageControl.getUnlimitedInstance());
+ assert results != null;
+ if (results.size() > 0)
+ break;
+ Thread.sleep(1000L); // wait for it to finish, should be fast
+ }
- PageList<ResourceOperationHistory> results;
- results = operationManager.findCompletedResourceOperationHistories(overlord, resource.getId(), null, null,
- PageControl.getUnlimitedInstance());
- assert results != null;
assert results.size() == 1 : "size was " + results.size();
ResourceOperationHistory history = results.get(0);
assert history.getId() > 0 : history;
12 years, 6 months
[rhq] Branch 'release_jon3.x' - 2 commits - modules/core modules/enterprise
by Jay Shaughnessy
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 2 -
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java | 2 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 13 ++++++----
3 files changed, 10 insertions(+), 7 deletions(-)
New commits:
commit fd6532484a4df2787481aae880afd740a282f45d
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Nov 17 15:44:22 2011 -0500
- make sure to protect against null *and* empty path or pattern fields
in filters.
- Enhance description for filter pattern to be more clear about what works.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
index c8b8f63..9829480 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
@@ -539,7 +539,7 @@ public class DriftConfigurationDefinition implements Serializable {
private static PropertyDefinitionSimple createIncludePattern(boolean readOnly) {
String name = PROP_PATTERN;
- String description = "Pathname pattern that must match for the items in the directory path to be included.";
+ String description = "Pathname pattern that must match for the items in the directory path to be included. '*' matches zero or more characters, '?' matches one character. For example, '*.txt' (no quotes) will match text files in the filter's path directory. '**/*.txt' will match text files in any subdirectory below the filter's path directory";
boolean required = false;
PropertySimpleType type = PropertySimpleType.STRING;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index 41477f3..851372d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -838,14 +838,17 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
filtersList.add(driftDef.getExcludes());
for (List<Filter> filterList : filtersList) {
for (Filter filter : filterList) {
- if (!filter.getPath().matches(DriftConfigurationDefinition.PROP_FILTER_PATH_REGEX_PATTERN)) {
+ String path = (null == filter.getPath()) ? null : filter.getPath().trim();
+ if (null != path && !path.isEmpty()
+ && !path.matches(DriftConfigurationDefinition.PROP_FILTER_PATH_REGEX_PATTERN)) {
throw new IllegalArgumentException("Drift definition filter path contains invalid characters: "
- + filter.getPath());
+ + path);
}
- if (null != filter.getPattern()
- && !filter.getPattern().matches(DriftConfigurationDefinition.PROP_FILTER_PATTERN_REGEX_PATTERN)) {
+ String pattern = (null == filter.getPattern()) ? null : filter.getPattern().trim();
+ if (null != pattern && !pattern.isEmpty()
+ && !pattern.matches(DriftConfigurationDefinition.PROP_FILTER_PATTERN_REGEX_PATTERN)) {
throw new IllegalArgumentException("Drift definition filter pattern contains invalid characters: "
- + filter.getPattern());
+ + pattern);
}
}
}
commit a46c61ddd89883d7b86539e88831e0d7624521fa
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Nov 17 16:02:47 2011 -0500
Fix oracle syntax for sequence renaming in drift upgrade.
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 2c95f02..1a92fe1 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3682,7 +3682,7 @@
ALTER TABLE RHQ_DRIFT_CONFIG_ID_SEQ RENAME TO RHQ_DRIFT_DEFINITION_ID_SEQ
</statement>
<statement targetDBVendor="oracle">
- ALTER TABLE RENAME RHQ_DRIFT_CONFIG_ID_SEQ TO RHQ_DRIFT_DEFINITION_ID_SEQ
+ RENAME RHQ_DRIFT_CONFIG_ID_SEQ TO RHQ_DRIFT_DEFINITION_ID_SEQ
</statement>
</schema-directSQL>
12 years, 6 months
[rhq] 2 commits - modules/core modules/enterprise
by Jay Shaughnessy
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 2 -
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java | 2 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 13 ++++++----
3 files changed, 10 insertions(+), 7 deletions(-)
New commits:
commit 9a6dcdcf42ce0c82edd3d8ae04e8baff242da8ff
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Nov 17 16:02:47 2011 -0500
Fix oracle syntax for sequence renaming in drift upgrade.
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 2c95f02..1a92fe1 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3682,7 +3682,7 @@
ALTER TABLE RHQ_DRIFT_CONFIG_ID_SEQ RENAME TO RHQ_DRIFT_DEFINITION_ID_SEQ
</statement>
<statement targetDBVendor="oracle">
- ALTER TABLE RENAME RHQ_DRIFT_CONFIG_ID_SEQ TO RHQ_DRIFT_DEFINITION_ID_SEQ
+ RENAME RHQ_DRIFT_CONFIG_ID_SEQ TO RHQ_DRIFT_DEFINITION_ID_SEQ
</statement>
</schema-directSQL>
commit 05694c0f82fa4b1bb6e8d2f51d1c40246bc0ec05
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Nov 17 15:44:22 2011 -0500
- make sure to protect against null *and* empty path or pattern fields
in filters.
- Enhance description for filter pattern to be more clear about what works.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
index c8b8f63..9829480 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
@@ -539,7 +539,7 @@ public class DriftConfigurationDefinition implements Serializable {
private static PropertyDefinitionSimple createIncludePattern(boolean readOnly) {
String name = PROP_PATTERN;
- String description = "Pathname pattern that must match for the items in the directory path to be included.";
+ String description = "Pathname pattern that must match for the items in the directory path to be included. '*' matches zero or more characters, '?' matches one character. For example, '*.txt' (no quotes) will match text files in the filter's path directory. '**/*.txt' will match text files in any subdirectory below the filter's path directory";
boolean required = false;
PropertySimpleType type = PropertySimpleType.STRING;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index 41477f3..851372d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -838,14 +838,17 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
filtersList.add(driftDef.getExcludes());
for (List<Filter> filterList : filtersList) {
for (Filter filter : filterList) {
- if (!filter.getPath().matches(DriftConfigurationDefinition.PROP_FILTER_PATH_REGEX_PATTERN)) {
+ String path = (null == filter.getPath()) ? null : filter.getPath().trim();
+ if (null != path && !path.isEmpty()
+ && !path.matches(DriftConfigurationDefinition.PROP_FILTER_PATH_REGEX_PATTERN)) {
throw new IllegalArgumentException("Drift definition filter path contains invalid characters: "
- + filter.getPath());
+ + path);
}
- if (null != filter.getPattern()
- && !filter.getPattern().matches(DriftConfigurationDefinition.PROP_FILTER_PATTERN_REGEX_PATTERN)) {
+ String pattern = (null == filter.getPattern()) ? null : filter.getPattern().trim();
+ if (null != pattern && !pattern.isEmpty()
+ && !pattern.matches(DriftConfigurationDefinition.PROP_FILTER_PATTERN_REGEX_PATTERN)) {
throw new IllegalArgumentException("Drift definition filter pattern contains invalid characters: "
- + filter.getPattern());
+ + pattern);
}
}
}
12 years, 6 months
[rhq] modules/jopr
by Robert Buck
modules/jopr/etc/jbas5-jnp-client/README | 16 ++++++++++
modules/jopr/etc/jbas5-jnp-client/client.sh | 6 +++
modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java | 2 -
3 files changed, 22 insertions(+), 2 deletions(-)
New commits:
commit 69d00f93585bca6d6a1b5b7f6a40301975289b42
Author: Robert Buck <rbuck(a)redhat.com>
Date: Thu Nov 17 15:08:58 2011 -0500
add support for authentication; reproduce profile service bug with
getProfile()/getActiveProfile()
diff --git a/modules/jopr/etc/jbas5-jnp-client/README b/modules/jopr/etc/jbas5-jnp-client/README
new file mode 100644
index 0000000..afd0676
--- /dev/null
+++ b/modules/jopr/etc/jbas5-jnp-client/README
@@ -0,0 +1,16 @@
+To build run the following command:
+
+ mvn install
+
+To set up your environment set the JBOSS_HOME directory:
+
+ export JBOSS_HOME=/home/rbuck/dev/servers/jboss-eap/5.1.2-ER2/jboss-as
+
+To run the client perform the following command:
+
+ ./client.sh
+
+To run the client against a different port or address run the command like this:
+
+ ./client.sh jnp://127.0.0.1:1099
+
diff --git a/modules/jopr/etc/jbas5-jnp-client/client.sh b/modules/jopr/etc/jbas5-jnp-client/client.sh
index b4ae736..d4f0b8d 100755
--- a/modules/jopr/etc/jbas5-jnp-client/client.sh
+++ b/modules/jopr/etc/jbas5-jnp-client/client.sh
@@ -9,7 +9,11 @@
MAIN_JAR_NAME=jbas5-jnp-client-1.0.jar
MAIN_CLASS=test.RmiClient
-JBOSS_HOME=/home/ips/Applications/jboss-eap-5.1.1/jboss-as
+if [ "x$JBOSS_HOME" = "x" ]; then
+ echo "JBOSS_HOME environment variable is undefined."
+ exit 1
+fi
+
if [ ! -d "$JBOSS_HOME" ]; then
echo "Dir specified by JBOSS_HOME variable ($JBOSS_HOME) does not exist."
exit 1
diff --git a/modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java b/modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java
index 58d7a61..de32923 100644
--- a/modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java
+++ b/modules/jopr/etc/jbas5-jnp-client/src/main/java/test/RmiClient.java
@@ -26,7 +26,7 @@ public class RmiClient
public static void main(String[] args)
throws Exception
{
- String jnpUrl = (args.length == 1) ? args[0] : "jnp://127.0.0.51:1099";
+ String jnpUrl = (args.length == 1) ? args[0] : "jnp://127.0.0.1:1099";
Properties env = new Properties();
env.setProperty(Context.PROVIDER_URL, jnpUrl);
12 years, 6 months
[rhq] Changes to 'stefan/helpupdates'
by snegrea
New branch 'stefan/helpupdates' available with the following commits:
commit b7766a9d889fef3f7079904c3de5f1fbfc988fa9
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Nov 17 13:19:10 2011 -0600
[BZ 747430] Add support for loading help view content from product info file.
12 years, 6 months
[rhq] Branch 'release_jon3.x' - modules/enterprise
by John Sanda
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 7bdcb92b1a47feb7450439b4af736f2804d03d7e
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Nov 17 14:01:42 2011 -0500
[BZ 753827] Fixing regression for pinning snapshot to existing template
My fix for bug 753827 caused a regression that breaks the wizard for
pinning a snapshot to an existing template. I was previously unware that
if you selected a new template in the wizard, that the code still runs
through the config step. In that case, the config editor in the config
step page is never intialized and this caused an NPE as a result of my
changes. A check is now in place to determine whether or not the
validation needs to be performed, and thus avoiding the NPE.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
index 3c8fa9f..cfe570d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
@@ -72,11 +72,13 @@ public class DriftPinTemplateWizardConfigStep extends AbstractWizardStep {
}
public boolean nextPage() {
- Configuration templateConfig = editor.getConfiguration();
- PropertySimple templateNameProp = templateConfig.getSimple(DriftConfigurationDefinition.PROP_NAME);
+ if (wizard.isCreateTemplate()) {
+ Configuration templateConfig = editor.getConfiguration();
+ PropertySimple templateNameProp = templateConfig.getSimple(DriftConfigurationDefinition.PROP_NAME);
- if (!isTemplateNameUnique(templateNameProp.getStringValue())) {
- templateNameProp.setErrorMessage(MSG.view_drift_wizard_pinTemplate_duplicate_name_error());
+ if (!isTemplateNameUnique(templateNameProp.getStringValue())) {
+ templateNameProp.setErrorMessage(MSG.view_drift_wizard_pinTemplate_duplicate_name_error());
+ }
}
if (wizard.isCreateTemplate() && (null == editor || !editor.validate())) {
12 years, 6 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 98b01d25a425efa5bbea032d472e75f054a1ea28
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Nov 17 14:01:42 2011 -0500
[BZ 753827] Fixing regression for pinning snapshot to existing template
My fix for bug 753827 caused a regression that breaks the wizard for
pinning a snapshot to an existing template. I was previously unware that
if you selected a new template in the wizard, that the code still runs
through the config step. In that case, the config editor in the config
step page is never intialized and this caused an NPE as a result of my
changes. A check is now in place to determine whether or not the
validation needs to be performed, and thus avoiding the NPE.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
index 3c8fa9f..cfe570d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
@@ -72,11 +72,13 @@ public class DriftPinTemplateWizardConfigStep extends AbstractWizardStep {
}
public boolean nextPage() {
- Configuration templateConfig = editor.getConfiguration();
- PropertySimple templateNameProp = templateConfig.getSimple(DriftConfigurationDefinition.PROP_NAME);
+ if (wizard.isCreateTemplate()) {
+ Configuration templateConfig = editor.getConfiguration();
+ PropertySimple templateNameProp = templateConfig.getSimple(DriftConfigurationDefinition.PROP_NAME);
- if (!isTemplateNameUnique(templateNameProp.getStringValue())) {
- templateNameProp.setErrorMessage(MSG.view_drift_wizard_pinTemplate_duplicate_name_error());
+ if (!isTemplateNameUnique(templateNameProp.getStringValue())) {
+ templateNameProp.setErrorMessage(MSG.view_drift_wizard_pinTemplate_duplicate_name_error());
+ }
}
if (wizard.isCreateTemplate() && (null == editor || !editor.validate())) {
12 years, 6 months
[rhq] Branch 'release_jon3.x' - 3 commits - modules/core modules/enterprise
by Jay Shaughnessy
modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml | 5
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 4
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java | 57 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardContainer.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 18 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java | 7 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java | 7 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 38 +++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java | 9 +
10 files changed, 126 insertions(+), 26 deletions(-)
New commits:
commit 6e3f3f8c51dc079578337e9f6b97e568998fd1d6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 16 17:45:27 2011 -0500
Related to bug 753000, prevent paths and filter patterns that will
cause regex error downstream.
- Enforce a minimal character set for base directory path, filter path,
and filter patterns. Do enforcement at gui and slsb layersm and apply
to template and definition creation.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
index 4337010..c8b8f63 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
@@ -66,6 +66,17 @@ public class DriftConfigurationDefinition implements Serializable {
// Thus, we only allow config names to only include spaces or "." or "-" or alphanumeric or "_" characters.
public static final String PROP_NAME_REGEX_PATTERN = "[ \\.\\-\\w]+";
+ // because we know drift definition base directory paths and filter paths will actually be used by the agent's
+ // plugin container as part of regex expressions, we must make sure they are restricted to only be characters
+ // valid for file system paths and regex. And, additionally for filter patterns, the (ant-style) filter
+ // wildcards. Thus, we only allow the base paths to include the separator characters "\", "/", the windows
+ // drive character ":" and the filename characters (see PROP_NAME_REGEX_PATTERN). Filter paths can
+ // contain the same as the base path, less the drive character. And filter patterns are the same as
+ // filter paths, plus the wildcard characters. "*", "?".
+ public static final String PROP_BASEDIR_PATH_REGEX_PATTERN = "[ \\.\\-\\w/\\:\\\\]+";
+ public static final String PROP_FILTER_PATH_REGEX_PATTERN = "[ \\.\\-\\w/\\\\]+";
+ public static final String PROP_FILTER_PATTERN_REGEX_PATTERN = "[ \\.\\-\\w/\\\\\\?\\*]+";
+
public static final boolean DEFAULT_ENABLED = true;
public static final boolean DEFAULT_ATTACHED = true;
public static final long DEFAULT_INTERVAL = 1800L;
@@ -103,9 +114,9 @@ public class DriftConfigurationDefinition implements Serializable {
private static final ConfigurationDefinition NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE = new ConfigurationDefinition(
"NEW_RESOURCE_DRIFT_DEF_BY_PINNED_TEMPLATE", "A new resource drift definition created from a pinned template");
- private static final ConfigurationDefinition EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE =
- new ConfigurationDefinition("EXISTING_RESOURCE_DRIFT_DEF_BY_PINNED_TEMPLATE",
- "An existing resource drift definition created from a pinned template");
+ private static final ConfigurationDefinition EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE = new ConfigurationDefinition(
+ "EXISTING_RESOURCE_DRIFT_DEF_BY_PINNED_TEMPLATE",
+ "An existing resource drift definition created from a pinned template");
private static final ConfigurationDefinition NEW_TEMPLATE_INSTANCE = new ConfigurationDefinition(
"NEW_TEMPLATE_DRIFT_CONFIG_DEF", "A new template drift definition");
@@ -201,10 +212,13 @@ public class DriftConfigurationDefinition implements Serializable {
EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createName(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
true));
- EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createDescription(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
- EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createInterval(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE
+ .put(createDescription(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE
+ .put(createInterval(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createEnabled(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
- EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createDriftHandlingMode(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE
+ .put(createDriftHandlingMode(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createBasedir(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
true));
EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createIncludes(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
@@ -261,9 +275,9 @@ public class DriftConfigurationDefinition implements Serializable {
pd.setAllowCustomEnumeratedValue(false);
pd.setConfigurationDefinition(configDef);
- RegexConstraint constrait = new RegexConstraint();
- constrait.setDetails(PROP_NAME_REGEX_PATTERN);
- pd.addConstraints(constrait);
+ RegexConstraint constraint = new RegexConstraint();
+ constraint.setDetails(PROP_NAME_REGEX_PATTERN);
+ pd.addConstraints(constraint);
return pd;
}
@@ -303,10 +317,10 @@ public class DriftConfigurationDefinition implements Serializable {
private static PropertyDefinitionSimple createAttached(ConfigurationDefinition configDef, boolean readOnly) {
String name = PROP_ATTACHED;
- String description = "A flag that indicates whether or not the definition is attached to the template from " +
- "which it is created. When a template is updated, the changes will be propagated to any attached " +
- "definitions. Furthermore, if you pin an existing template to a snapshot, then attached definitions will " +
- "become pinned as well. Finally, if you delete a template, attached definitions will also be deleted.";
+ String description = "A flag that indicates whether or not the definition is attached to the template from "
+ + "which it is created. When a template is updated, the changes will be propagated to any attached "
+ + "definitions. Furthermore, if you pin an existing template to a snapshot, then attached definitions will "
+ + "become pinned as well. Finally, if you delete a template, attached definitions will also be deleted.";
boolean required = true;
PropertySimpleType type = PropertySimpleType.BOOLEAN;
@@ -461,6 +475,11 @@ public class DriftConfigurationDefinition implements Serializable {
pd.setSummary(true);
pd.setOrder(1);
pd.setAllowCustomEnumeratedValue(false);
+
+ RegexConstraint constraint = new RegexConstraint();
+ constraint.setDetails(PROP_BASEDIR_PATH_REGEX_PATTERN);
+ pd.addConstraints(constraint);
+
return pd;
}
@@ -477,6 +496,7 @@ public class DriftConfigurationDefinition implements Serializable {
pd.setSummary(true);
pd.setOrder(8);
pd.setConfigurationDefinition(configDef);
+
return pd;
}
@@ -493,6 +513,7 @@ public class DriftConfigurationDefinition implements Serializable {
pd.setReadOnly(readOnly);
pd.setSummary(true);
pd.setOrder(0);
+
return pd;
}
@@ -508,6 +529,11 @@ public class DriftConfigurationDefinition implements Serializable {
pd.setSummary(true);
pd.setOrder(0);
pd.setAllowCustomEnumeratedValue(false);
+
+ RegexConstraint constraint = new RegexConstraint();
+ constraint.setDetails(PROP_FILTER_PATH_REGEX_PATTERN);
+ pd.addConstraints(constraint);
+
return pd;
}
@@ -523,6 +549,11 @@ public class DriftConfigurationDefinition implements Serializable {
pd.setSummary(true);
pd.setOrder(1);
pd.setAllowCustomEnumeratedValue(false);
+
+ RegexConstraint constraint = new RegexConstraint();
+ constraint.setDetails(PROP_FILTER_PATTERN_REGEX_PATTERN);
+ pd.addConstraints(constraint);
+
return pd;
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index 37a87b7..41477f3 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -77,7 +77,9 @@ import org.rhq.core.domain.drift.DriftFile;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.DriftSnapshotRequest;
import org.rhq.core.domain.drift.FileDiffReport;
+import org.rhq.core.domain.drift.Filter;
import org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode;
+import org.rhq.core.domain.drift.DriftDefinition.BaseDirectory;
import org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode;
import org.rhq.core.domain.drift.dto.DriftChangeSetDTO;
import org.rhq.core.domain.drift.dto.DriftDTO;
@@ -743,11 +745,8 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
@Override
public void updateDriftDefinition(Subject subject, EntityContext entityContext, DriftDefinition driftDef) {
- // before we do anything, make sure the drift def name is valid
- if (!driftDef.getName().matches(DriftConfigurationDefinition.PROP_NAME_REGEX_PATTERN)) {
- throw new IllegalArgumentException("Drift definition name contains invalid characters: "
- + driftDef.getName());
- }
+ // before we do anything, validate certain field values to prevent downstream errors
+ validateDriftDefinition(driftDef);
switch (entityContext.getType()) {
case Resource:
@@ -823,6 +822,35 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
}
}
+ public static void validateDriftDefinition(DriftDefinition driftDef) {
+ if (!driftDef.getName().matches(DriftConfigurationDefinition.PROP_NAME_REGEX_PATTERN)) {
+ throw new IllegalArgumentException("Drift definition name contains invalid characters: "
+ + driftDef.getName());
+ }
+ BaseDirectory baseDir = driftDef.getBasedir();
+ if (null == baseDir
+ || !baseDir.getValueName().matches(DriftConfigurationDefinition.PROP_BASEDIR_PATH_REGEX_PATTERN)) {
+ throw new IllegalArgumentException(
+ "Drift definition base directory is null or contains invalid characters: " + baseDir.getValueName());
+ }
+ List<List<Filter>> filtersList = new ArrayList<List<Filter>>(2);
+ filtersList.add(driftDef.getIncludes());
+ filtersList.add(driftDef.getExcludes());
+ for (List<Filter> filterList : filtersList) {
+ for (Filter filter : filterList) {
+ if (!filter.getPath().matches(DriftConfigurationDefinition.PROP_FILTER_PATH_REGEX_PATTERN)) {
+ throw new IllegalArgumentException("Drift definition filter path contains invalid characters: "
+ + filter.getPath());
+ }
+ if (null != filter.getPattern()
+ && !filter.getPattern().matches(DriftConfigurationDefinition.PROP_FILTER_PATTERN_REGEX_PATTERN)) {
+ throw new IllegalArgumentException("Drift definition filter pattern contains invalid characters: "
+ + filter.getPattern());
+ }
+ }
+ }
+ }
+
@Override
public boolean isBinaryFile(Subject subject, Drift<?, ?> drift) {
String path = drift.getPath();
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
index 28e1fa1..361eb44 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
@@ -81,6 +81,11 @@ public class DriftTemplateManagerBean implements DriftTemplateManagerLocal, Drif
DriftDefinition definition) {
try {
+ // before we do anything, validate certain field values to prevent downstream errors
+ if (isUserDefined) {
+ DriftManagerBean.validateDriftDefinition(definition);
+ }
+
ResourceType resourceType = resourceTypeMgr.getResourceTypeById(subject, resourceTypeId);
DriftDefinitionTemplate template = new DriftDefinitionTemplate();
template.setName(definition.getName());
@@ -89,8 +94,8 @@ public class DriftTemplateManagerBean implements DriftTemplateManagerLocal, Drif
template.setTemplateDefinition(definition);
if (isDuplicateName(resourceType, template)) {
- throw new IllegalArgumentException("Drift definition template name must be unique. A template named " +
- "[" + template.getName() + "] already exists for " + resourceType);
+ throw new IllegalArgumentException("Drift definition template name must be unique. A template named "
+ + "[" + template.getName() + "] already exists for " + resourceType);
}
resourceType.addDriftDefinitionTemplate(template);
commit 4f08eac8fc78d5ef8b6809df6385e9652e151ac2
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Nov 17 13:36:51 2011 -0500
db-upgrade changes
- fix issue with duplicate constraint names in drift-related upgrade
- remove obsolete table RHQ_DRIFT_TEMPLATE_MAP
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml
index 1b1ce8c..7da4b23 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml
@@ -9,6 +9,11 @@
<!-- !!! REMOVED FROM CONTENT-SCHEMA !!!! -->
+ <table name="RHQ_DRIFT_TEMPLATE_MAP">
+ <column name="RESOURCE_TYPE_ID" type="INTEGER" required="true" references="RHQ_RESOURCE_TYPE"/>
+ <column name="CONFIG_TEMPLATE_ID" type="INTEGER" required="true" references="RHQ_CONFIG_TEMPLATE"/>
+ </table>
+
<table name="RHQ_BUNDLE_CONFIG" obsolete="true">
<column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/>
<column name="CONFIG_ID" type="INTEGER" required="false" references="RHQ_CONFIG" />
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index e65f519..2c95f02 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3656,13 +3656,13 @@
<schema-directSQL>
<statement desc="Creating RHQ_DRIFT_DEF_TEMPLATE foreign key to RHQ_RESOURCE_TYPE">
ALTER TABLE RHQ_DRIFT_DEF_TEMPLATE
- ADD CONSTRAINT RHQ_DTM_RESOURCE_TYPE_ID_FK
+ ADD CONSTRAINT RHQ_DDT_RESOURCE_TYPE_ID_FK
FOREIGN KEY (RESOURCE_TYPE_ID)
REFERENCES RHQ_RESOURCE_TYPE (ID)
</statement>
<statement desc="Creating RHQ_DRIFT_DEF_TEMPLATE foreign key to RHQ_CONFIG">
ALTER TABLE RHQ_DRIFT_DEF_TEMPLATE
- ADD CONSTRAINT RHQ_DTM_CONFIG_ID_FK
+ ADD CONSTRAINT RHQ_DDT_CONFIG_ID_FK
FOREIGN KEY (CONFIG_ID)
REFERENCES RHQ_CONFIG (ID)
</statement>
commit 9a7e2047d3d6c7bffb85afb70dc41a98691ba6c9
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Nov 17 13:44:04 2011 -0500
[Bug 754382 - Login after session timeout does not (re)display the portlets on summary tab]
A couple of things going on here:
- make sure we request a refresh after re-login, for RefreshableViews
- make the dashboard views Refreshable to take advantage of the above change
- for the global dash, ensure switching amongst dash tabs works appropriately
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index d9758cf..6f3a332 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -331,7 +331,9 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
History.newItem(getDefaultView());
} else {
- // otherwise just fire an event for the bookmarked URL they are returning to
+ // otherwise just fire an event for the bookmarked URL they are returning to and
+ // ensure it is refreshed if it is a RefreshableView
+ pendingRefresh = true;
History.fireCurrentHistoryState();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardContainer.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardContainer.java
index 6b1d507..335c0ad 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardContainer.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardContainer.java
@@ -3,8 +3,9 @@ package org.rhq.enterprise.gui.coregui.client.dashboard;
import java.util.Set;
import org.rhq.core.domain.authz.Permission;
+import org.rhq.enterprise.gui.coregui.client.RefreshableView;
-public interface DashboardContainer {
+public interface DashboardContainer extends RefreshableView {
public Set<Permission> getGlobalPermissions();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index e240ecb..0566e0c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -217,7 +217,7 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
* which would require the user to hit the back button twice to return to the previous page.
*/
if (selectedDashboardView != null) {
- CoreGUI.goToView(LinkManager.getDashboardLink(Integer.valueOf(selectedTab.getName())));
+ CoreGUI.goToView(LinkManager.getDashboardLink(Integer.valueOf(selectedTab.getName())), true);
}
selectedDashboardView = (DashboardView) selectedTab.getPane();
@@ -482,7 +482,12 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
}
}
- tabSet.selectTab(selectedTab);
+ if (!selectedTab.equals(tabSet.getSelectedTab())) {
+ tabSet.selectTab(selectedTab);
+
+ } else if (viewPath.isRefresh()) {
+ refresh();
+ }
}
public Dashboard getDashboard() {
@@ -509,4 +514,13 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
}
}
+ @Override
+ public void refresh() {
+ if (isInitialized()) {
+ if (null != selectedDashboardView && selectedDashboardView.isDrawn()) {
+ selectedDashboardView.rebuild();
+ }
+ }
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
index 45b1a9e..09abe9d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
@@ -339,4 +339,11 @@ public class ActivityView extends LocatableVLayout implements DashboardContainer
return ((name != null) && (dashboardView != null) && name.equals(dashboardView.getDashboard().getName()));
}
+ @Override
+ public void refresh() {
+ if (isInitialized()) {
+ dashboardView.rebuild();
+ }
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java
index d075bc2..77a729d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java
@@ -250,4 +250,11 @@ public class ActivityView extends LocatableVLayout implements DashboardContainer
return ((name != null) && (dashboardView != null) && name.equals(dashboardView.getDashboard().getName()));
}
+ @Override
+ public void refresh() {
+ if (isInitialized()) {
+ dashboardView.rebuild();
+ }
+ }
+
}
12 years, 6 months