modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
| 21 ++++++++--
modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
| 4 -
modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
| 4 -
modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
| 4 -
4 files changed, 23 insertions(+), 10 deletions(-)
New commits:
commit d875599c6c31ce9309f6b96f4830d3cf1957a374
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 2 10:11:01 2011 -0400
Remove the ":" character from the plugin defined drift template names as
it is actually an illegal character (must only contain valid file-name
chars). The new template name convention is "Template-Some Name". Also
improved the descriptions slightly.
diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
index 2ae0e71..d6efd88 100644
--- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
@@ -1195,8 +1195,8 @@
</configuration>
</content>
- <drift-definition name="Template: Base Files"
- description="A template for monitoring base application
server files for drift. It defines monitoring for some standard sub-directories of the
HOME directory. Note, it is not recommeded to monitor all files for an application
server. There are many files, and many temp files.">
+ <drift-definition name="Template-Base Files"
+ description="Monitor base application server files for
drift. It defines monitoring for some standard sub-directories of the HOME directory.
Note, it is not recommeded to monitor all files for an application server. There are many
files, and many temp files.">
<basedir>
<value-context>pluginConfiguration</value-context>
<value-name>homeDir</value-name>
diff --git a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
index 2536cb5..f697574 100644
--- a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
@@ -259,8 +259,8 @@
</configuration>
</content>
- <drift-definition name="Template: Base Files"
- description="A template for monitoring base application
server files for drift. It defines monitoring for some standard sub-directories of the
HOME directory. Note, it is not recommeded to monitor all files for an application
server. There are many files, and many temp files.">
+ <drift-definition name="Template-Base Files"
+ description="Monitor base application server files for
drift. It defines monitoring for some standard sub-directories of the HOME directory.
Note, it is not recommeded to monitor all files for an application server. There are many
files, and many temp files.">
<basedir>
<value-context>pluginConfiguration</value-context>
<value-name>jbossHomeDir</value-name>
diff --git a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
index cd70d40..e967f24 100644
--- a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
@@ -40,8 +40,8 @@
</bundle-target>
'>
<!ENTITY driftConfig '
- <drift-definition name="Template: File System"
- description="A template for monitoring the file system for
drift. It is expected that definitions will set a more specific base directory as the file
system root is not recommended.">
+ <drift-definition name="Template-File System"
+ description="Monitor the file system for drift. Definitions
should set a more specific base directory as the file system root is not
recommended.">
<basedir>
<value-context>fileSystem</value-context>
<value-name>/</value-name>
commit 09e73f804a69af9899213f75944cc8443cfa905a
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Nov 3 11:20:18 2011 -0400
[751091 - Resource tree fails to render for non inventory manager]
Remove use of ResourceCriteria.fetchParentResource(true) to support
AutoGroup naming. Instead, make use of the fact that the needed
resource information is available in an ancestral ResourceTreeNode.
This approach avoids the need for inventory manager perm (required
for fetchParentResource) and also the potential inabaility to
query for the resource on-demand, as it could be unavailable (locked)
to the user (but the locked resource tree node has what we need).
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
index 87e5fa3..8938062 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java
@@ -145,7 +145,6 @@ public class ResourceTreeDatasource extends DataSource {
ResourceCriteria criteria = new ResourceCriteria();
criteria.addFilterParentResourceId(Integer.parseInt(parentResourceId));
- criteria.fetchParentResource(true);
resourceService.findResourcesByCriteria(criteria, new
AsyncCallback<PageList<Resource>>() {
public void onFailure(Throwable caught) {
@@ -266,6 +265,17 @@ public class ResourceTreeDatasource extends DataSource {
// If the parent node is an autogroup node, make sure the autogroup node
is in the
// tree prior to the resource node.
+ // First we need to ensure we have a properly populated parentResource
(id and name, minimally),
+ // get this from the parent ResourceTreeNode as resource.parentResource
may not be set with
+ // anything more than the id.
+
+ String parentResourceNodeId =
ResourceTreeNode.idOf(resource.getParentResource());
+ for (ResourceTreeNode node : resourceNodes) {
+ if (node.getID().equals(parentResourceNodeId)) {
+ resource.setParentResource(node.getResource());
+ }
+ }
+
String autoGroupNodeID = resourceNode.getParentID();
if (!allNodeIds.contains(autoGroupNodeID)) {
AutoGroupTreeNode autogroupNode = new AutoGroupTreeNode(resource);
@@ -334,8 +344,10 @@ public class ResourceTreeDatasource extends DataSource {
/**
* The parentID will be set to the parent resource at construction. It can be
changed
* later (prior to tree linkage) if the resource node should logically be set to
an
- * autogroup or subcategory parent.
- * @param resource
+ * autogroup or subcategory parent.
+ *
+ * @param resource The resource must have, minimally, id, name, description set.
And, if parent is not null,
+ * parentResource.id must be set as well. Also, resourceType.childresourceTypes.
* @param isLocked
*/
private ResourceTreeNode(Resource resource, boolean isLocked) {
@@ -442,7 +454,8 @@ public class ResourceTreeDatasource extends DataSource {
private boolean parentSubcategory = false;
/**
- * @param resource requires resourceType field be set. requires parentResource
field be set (null for no parent)
+ * @param resource.id must be set. resource.parentResource.id, .name must be
set.
+ * resource.resourceType.id, .name, .description, .subCategory must be set.
*/
private AutoGroupTreeNode(Resource resource) {
this.parentResource = resource.getParentResource();
Show replies by date