Bug 346046 - [api] provide an extension point for registering URL handlers (was: Hyperlinks to builds should open in task editor)
Summary: [api] provide an extension point for registering URL handlers (was: Hyperlink...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 3.7   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy, plan
Depends on: 357738 370186 370504
Blocks:
  Show dependency tree
 
Reported: 2011-05-17 04:11 EDT by Sascha Scholz CLA
Modified: 2012-05-01 03:14 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Scholz CLA 2011-05-17 04:11:11 EDT
Hudson/Jenkins is often used to verify changes in the Gerrit code review system. After a change has been proposed, Hudson fetches  the change, builds it, puts a voting in the 'Verified' category and adds a comment pointing to the build (as an example see http://egit.eclipse.org/r/#change,3441).

There is also a Mylyn Connector for Gerrit available in the Mylyn Reviews project which is able to show all the data (including the comments) in a task editor. Currently, if you click on a link to the build it's opened in a web browser. It would be nice if the link could be opened in a task editor for the build (if a Hudson for this URL is  registered).

Is it possible to register a general-purpose handler for ÙRLs pointing to Hudson builds which provides this behavior?
Comment 1 Steffen Pingel CLA 2011-05-17 18:26:27 EDT
That's an excellent idea that we should definitely consider for the next release to facilitate linking between the different artifacts. I am not sure where this would go but my first guess is that this is a platform concern and should be provided in the commons on the bottom of the stack.
Comment 2 Frank Becker CLA 2011-06-04 14:39:02 EDT
Sascha,
Steffen,

we have multiple Hyperlinks for Attachments in the Bugzilla Editor. Maybe we can use this to!
Comment 3 Torkild Resheim CLA 2011-08-04 04:09:45 EDT
There is a similar issue with regards to the Hudson/Jenkins discovery notification and the notifications framework. Handlers are implemented in the ServiceMessageControl. As a result the builds view can handle links properly but the notification popup can not. It would be great to have a common mechanism.
Comment 4 Steffen Pingel CLA 2011-08-09 08:47:56 EDT
(In reply to comment #3)
> There is a similar issue with regards to the Hudson/Jenkins discovery
> notification and the notifications framework. Handlers are implemented in the
> ServiceMessageControl. As a result the builds view can handle links properly but
> the notification popup can not. It would be great to have a common mechanism.

I believe that the notification popup uses a Label whereas the service message uses a Link control which can cause inconsistencies. I agree that we should have common renderer and handling mechanism for this.  Please file a separate bug against Commons/Notifications to track that since it's not directly related to this bug.
Comment 5 Steffen Pingel CLA 2012-01-31 01:53:44 EST
I have pushed a proposal to http://review.mylyn.org/231. Shawn, it'd be great if you could take a look and let me know what you think.
Comment 6 Steffen Pingel CLA 2012-01-31 16:44:42 EST
I have pushed the changes to master. Leaving open as a reminder to document the change.
Comment 7 Steffen Pingel CLA 2012-02-01 11:04:09 EST
URL handlers can be registered through the org.eclipse.mylyn.commons.workbench.urlHandlers extension point. Implementors need to extend AbstractUrlHandler which gets passed a location and returns a boolean whether the URL was handled or not. The first handler to return true wins. The invocation order is controlled through a priority that can be specified in the handler. Handlers with higher priorties are invoked first.
Comment 8 Steffen Pingel CLA 2012-02-04 13:33:06 EST
I have added a org.eclipse.mylyn.commons.workbench.browser.UrlHyperlink class which implements IHyperlink and uses BrowserUtil.openUrl() to open hyperlinks in rich editors when available.
Comment 9 Robert Pattinson CLA 2012-05-01 03:14:13 EDT
Spam removed by droy 2012-05-01