Bug 736848 - links to autogroups and links to cluster groups are invalid in numerous places in the GUI
Summary: links to autogroups and links to cluster groups are invalid in numerous place...
Alias: None
Product: RHQ Project
Classification: Other
Component: Core UI
Version: 4.1
Hardware: Unspecified
OS: Unspecified
high vote
Target Milestone: ---
: ---
Assignee: Ian Springer
QA Contact: Mike Foley
Depends On: rhq41-ui
Blocks: rhq42
TreeView+ depends on / blocked
Reported: 2011-09-08 20:54 UTC by Ian Springer
Modified: 2013-08-06 00:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-02-07 19:24:41 UTC

Attachments (Terms of Use)
proposed-patch (39.17 KB, patch)
2011-10-03 12:42 UTC, Lukas Krejci
no flags Details | Diff

Description Ian Springer 2011-09-08 20:54:34 UTC
There are three different types of compat groups: regular compat groups, autogroups, and cluster groups. Each of these types has a different form of view path for its detail view:

- regular groups: #ResourceGroup/<groupId>
- autogroups: #Resource/AutoGroup/<groupId>
- cluster groups: #ResourceGroup/AutoCluster/<groupId>

For the most part, the same view classes are used for the group views for the three different types. Many of these group views use the various LinkManager.getGroupXxxLink(int groupId) methods (e.g. getGroupEventHistoryListLink()) to build links to other sub views within the same group. Unfortunately, these methods, which are passed a groupId, assume the groupId is for a regular group, so they will return invalid links if the groupId actually is for an autogroup or cluster group. The methods which are passed either a ResourceGroup or a (group) EntityContext should be used instead of the methods which are passed a groupId, because these methods have enough context to determine what type of group it is and will return the correct form of URL. Examples of the good methods are:

- getResourceGroupTabLink(ResourceGroup group, String tabName, String subTabName)
- getEntityTabLink(EntityContext entityContext, String tabName, String subTabName)

Comment 1 Ian Springer 2011-09-08 21:23:34 UTC
[master 70a43d5] adds a new method to LinkManager that can return the appropriate form of group URL given an EntityContext, and updates several spots in the code to start using this new method to ensure the correct form of URL is used for the different types of compat groups. However, there are still a bunch of other spots in the code that need to be fixed; we need to do a find usages of the following LinkManager methods and replace the usages with the good methods listed in my previous comment:


Comment 2 Lukas Krejci 2011-10-03 12:42:02 UTC
Created attachment 526056 [details]

This is a proposed patch for the usages of those methods. 

I didn't replace all the usages of the getResourceGroupLink() as there are places where nothing else but an actual group can be used (bundles for example).

Also, I'm not too familiar with the GWT GUI so I'm just attaching a patch here so that more experienced devs can take a look at it.

Comment 3 Ian Springer 2011-10-03 16:17:51 UTC
Lukas, the patch looks good to me - applied (master 651d673).

Comment 4 Mike Foley 2011-10-04 14:25:37 UTC
verified through regression testing around compat groups, autogroups,

Comment 5 Mike Foley 2012-02-07 19:24:41 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE

Note You need to log in before you can comment on or make changes to this bug.