From: <dcr...@hy...> - 2009-08-17 23:14:09
|
Author: dcrutchf Date: 2009-08-17 16:13:54 -0700 (Mon, 17 Aug 2009) New Revision: 13634 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13634 Modified: trunk/src/org/hyperic/hq/ui/taglib/ResourceBreadcrumbTag.java Log: Fixed another issue found during my own testing Modified: trunk/src/org/hyperic/hq/ui/taglib/ResourceBreadcrumbTag.java =================================================================== --- trunk/src/org/hyperic/hq/ui/taglib/ResourceBreadcrumbTag.java 2009-08-17 22:47:41 UTC (rev 13633) +++ trunk/src/org/hyperic/hq/ui/taglib/ResourceBreadcrumbTag.java 2009-08-17 23:13:54 UTC (rev 13634) @@ -398,9 +398,19 @@ if (autoGroupResourceType.getAppdefType() == memberResource.getResourceType().getAppdefType()) { // ...resource types are the same, now check if parents are the same, // luckily resourceId represents the parent... - Resource parentResource = resourceManager.findResource(new AppdefEntityID(group.getResourceId())); + AppdefEntityID parentAppdef = new AppdefEntityID(group.getResourceId()); - result = resourceManager.isResourceChildOf(parentResource, memberResource); + if (parentAppdef.isApplication()) { + // ...if the parent is an application we need to determine if the other is a member... + ApplicationManagerLocal applicationManager = ApplicationManagerEJBImpl.getOne(); + + result = applicationManager.isApplicationMember(parentAppdef, member.getAppdefEntityId()); + } else { + // ...otherwise, we check if it's a child resource... + Resource parentResource = resourceManager.findResource(parentAppdef); + + result = resourceManager.isResourceChildOf(parentResource, memberResource); + } } } |