Bug 237678 - [wikitext] Issue tracking system url settings for Task Editor
Summary: [wikitext] Issue tracking system url settings for Task Editor
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.0.2   Edit
Assignee: Jingwen 'Owen' Ou CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-18 14:39 EDT by Jingwen 'Owen' Ou CLA
Modified: 2008-08-14 23:16 EDT (History)
2 users (show)

See Also:


Attachments
contributed an entry to the "Task Editor Extension" submenu (5.54 KB, patch)
2008-07-08 16:56 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
mylyn/context/zip (124.71 KB, application/octet-stream)
2008-07-08 16:56 EDT, Jingwen 'Owen' Ou CLA
no flags Details
recut the patch (2.92 KB, patch)
2008-08-14 15:29 EDT, Jingwen 'Owen' Ou CLA
no flags Details | Diff
mylyn/context/zip (92.32 KB, application/octet-stream)
2008-08-14 15:29 EDT, Jingwen 'Owen' Ou CLA
no flags Details
screenshot of the contributed menu (23.55 KB, image/png)
2008-08-14 15:35 EDT, Jingwen 'Owen' Ou CLA
no flags Details
patch based on Owen's work that sets the attribute on the task repository (6.96 KB, patch)
2008-08-14 16:22 EDT, David Green CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jingwen 'Owen' Ou CLA 2008-06-18 14:39:26 EDT
In the properties dialog of "Task Repositories" view we set up the url, then can internally refer to links in the issue tracking system, e.g. typing "refer to [[WikiText]] in the wiki" in the Bugzilla task editor, it generates links to WikiText in Eclipsepedia. 

This bug may relate to bug 237500
Comment 1 Jingwen 'Owen' Ou CLA 2008-06-18 16:52:39 EDT
this bug can start after bug 237500 is done
Comment 2 Steffen Pingel CLA 2008-06-18 18:10:44 EDT
This is similar to what has been requested on bug 218835. Is there a common abstraction that could be used to implement hyperlinking that is specific to a particular environment?
Comment 3 David Green CLA 2008-06-18 18:24:39 EDT
markup languages such as MediaWiki, TracWiki and Confluence define special syntax to refer to 'internal' links.  The markup language parser is able to detect these and will be able to generate the appropriate hyperlinks if the parser is configured correctly.

For example, from the MediaWiki syntax guide you can write:

Here's a link to the [[Main page]].

the corresponding rendered text looks like this:

Here's a link to the Main page.

where 'Main page' is a hyperlink to http://en.wikipedia.org/wiki/Main_page
Comment 4 Jingwen 'Owen' Ou CLA 2008-07-03 00:47:17 EDT
can this task start, based on the prototype in bug 237500? My idea is to contribute a menu that can show up a input dialog for the url of the issue tracking system
Comment 5 Steffen Pingel CLA 2008-07-03 01:04:31 EDT
Is it possible to intercept the links and redirect to the appropriate page?
Comment 6 Jingwen 'Owen' Ou CLA 2008-07-03 04:12:21 EDT
(In reply to comment #5)
> Is it possible to intercept the links and redirect to the appropriate page?

I am not sure how it would be possible to intercept the links.

Please note that issue tracking system and wiki system (e.g. eclipedia) are two different systems. A scenario could be typing internal links in bugzilla (e.g. Here's a link to the [[Main page]]) then a link to eclipedia will be generated. The goal is to NOT explicitly write the links then it can generate the links to the default wiki system. Therefore we need to insert and save the url of the wiki system set before hand.
Comment 7 David Green CLA 2008-07-04 16:13:18 EDT
You may want to take a look at org.eclipse.mylyn.wikitext.mediawiki.core.MediaWikiLanguage.setInternalPageHrefPrefix(String) as it is an API for doing exactly what Owen is describing.
This API could easily be called by the TaskEditorExtension when creating a source viewer or editor.
Comment 8 Jingwen 'Owen' Ou CLA 2008-07-07 16:14:38 EDT
I am planning to add an optional attribute *wikiURL* to repositoryAssociation in taskEditorExtensions.exsd, when TaskEditorExtensions.addRepositoryAssociation is called also adding such optional attribute to a map called wikiURLByConnectionKind. This might make as few changes as possible. Any thoughts?
Comment 9 Steffen Pingel CLA 2008-07-07 16:28:30 EDT
I am not sure if it makes sense to define a URL for all repositories of a particular kind. Isn't the URL something that should be set per repository, e.g. /wiki.eclipse.org for bugs.eclipse.org?
Comment 10 Jingwen 'Owen' Ou CLA 2008-07-07 17:30:31 EDT
(In reply to comment #9)
> I am not sure if it makes sense to define a URL for all repositories of a
> particular kind. Isn't the URL something that should be set per repository, e.g.
> /wiki.eclipse.org for bugs.eclipse.org?

It totally makes sense to have a URL for every repository instance :). But are there any ways to make sure the wiki URL does not tangle with existing repository settings if we do this? It might be a good idea to grouped with other WikiText settings, e.g. the markuplanguage. 
Comment 11 Jingwen 'Owen' Ou CLA 2008-07-07 17:32:06 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > I am not sure if it makes sense to define a URL for all repositories of a
> > particular kind. Isn't the URL something that should be set per repository,
> e.g.
> > /wiki.eclipse.org for bugs.eclipse.org?
> 
> It totally makes sense to have a URL for every repository instance :). But are
> there any ways to make sure the wiki URL does not tangle with existing
> repository settings if we do this? It might be a good idea to grouped with other
> WikiText settings, e.g. the markuplanguage.

I mean all concerns might be a good idea to go TaskEditorExtensions
Comment 12 David Green CLA 2008-07-07 17:37:48 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > I am not sure if it makes sense to define a URL for all repositories of a
> > particular kind. Isn't the URL something that should be set per repository, e.g.
> > /wiki.eclipse.org for bugs.eclipse.org?
> 
> It totally makes sense to have a URL for every repository instance :). But are
> there any ways to make sure the wiki URL does not tangle with existing
> repository settings if we do this? It might be a good idea to grouped with
> other WikiText settings, e.g. the markuplanguage. 
> 

The setting can easily be grouped together with other things in the UI.  
It doesn't belong in taskEditorExtensions.exsd.
Comment 13 Steffen Pingel CLA 2008-07-07 17:50:26 EDT
Yes, we can do the grouping in the UI. For now you could contribute an entry to the "Task Editor Extension" submenu, e.g. "Wiki URL", that shows an input dialog for the URL.
Comment 14 Jingwen 'Owen' Ou CLA 2008-07-08 16:56:25 EDT
Created attachment 106880 [details]
contributed an entry to the "Task Editor Extension" submenu

All can be shipped to Mylyn's repository setting page when its ready.

One question:

Would it be a good idea to support internal links for all markup languages, even for those which do not have such syntax, e.g. Textile? I myself do find it convenient to have such features.
Comment 15 Jingwen 'Owen' Ou CLA 2008-07-08 16:56:28 EDT
Created attachment 106881 [details]
mylyn/context/zip
Comment 16 Steffen Pingel CLA 2008-07-08 17:16:56 EDT
What do you mean by internal links? Something like anchors or links to other comments?
Comment 17 Jingwen 'Owen' Ou CLA 2008-07-08 17:33:46 EDT
(In reply to comment #16)
> What do you mean by internal links? Something like anchors or links to other
> comments?

sorry for the confusion. What I meant is the links to the wiki system. The term "Internal link" is quoted from http://www.mediawiki.org/wiki/Help:Links . It means a link to the system itself. 

Quoted from my proposal "Wikis and issue tracking systems are two of the most popular software management systems used in open-source communities and companies. Typically, developers keep track of reported software bugs in their work using bug tracking systems such as Bugzilla and at the same time, maintain their knowledge base using wikis such as MediaWiki. Real-world examples are not uncommon [1, 2, and 3]"

[1] Mozilla, https://bugzilla.mozilla.org/ and http://wiki.mozilla.org/Main_Page
[2] Eclipse, http://bugs.eclipse.org/bugs/ and http://wiki.eclipse.org/Main_Page
[3] Sun Microsystems Inc, http://wikis.sun.com/dashboard.action and http://bugs.sun.com/

Therefore, what I meant by "Internal link" is the links to an open-source community or company's knowledge base (e.g. the wiki system). As far as I know, Tasktop also redirects all the internal links in its Bugzilla to Wikipedia, right?
Comment 18 Jingwen 'Owen' Ou CLA 2008-07-08 17:35:41 EDT
the concept just switches from web pages (e.g. a page in Bugzilla) to offline editing task editors
Comment 19 Jingwen 'Owen' Ou CLA 2008-07-08 17:55:00 EDT
another example is Trac which combines wiki and issue tracking itself, http://www.hosted-projects.com/trac/TracDemo/Demo/wiki/WikiFormatting#Links
Comment 20 David Green CLA 2008-07-08 19:15:27 EDT
(In reply to comment #14)
> Would it be a good idea to support internal links for all markup languages,
> even for those which do not have such syntax, e.g. Textile? I myself do find it
> convenient to have such features. 
> 

We should only support internal links for those repositories that support it.
Comment 21 Steffen Pingel CLA 2008-07-08 20:10:02 EDT
> We should only support internal links for those repositories that support it.

That sounds right. Custom syntax extensions could be hard to remember. We could consider a custom hyperlink detector for references to a wiki, e.g. "wiki Page" (bug 239087).

Comment 22 Steffen Pingel CLA 2008-08-14 00:52:22 EDT
Owen, what is the status the patch? Can you recut it against cvs head?
Comment 23 Jingwen 'Owen' Ou CLA 2008-08-14 15:29:48 EDT
Created attachment 110026 [details]
recut the patch

the patch contributed a submenu to the "Task Editor Extension". 

I am afraid its impossible to set the internal link pattern at this point, unless the WikiText component provides API to do that, e.g. expose MakrupLanguage.setInternalLinkPattern(..) to AbstractTaskEditorExtension
Comment 24 Jingwen 'Owen' Ou CLA 2008-08-14 15:29:54 EDT
Created attachment 110027 [details]
mylyn/context/zip
Comment 25 Jingwen 'Owen' Ou CLA 2008-08-14 15:35:19 EDT
Created attachment 110028 [details]
screenshot of the contributed menu
Comment 26 David Green CLA 2008-08-14 16:07:55 EDT
This setting will only work for those repositories that support internal links to wiki pages from tasks (issues/bugs).
For WikiText, this can only be for repositories that use  TracWiki, MediaWiki or Confluence markup languages (Textile has no internal link syntax).  
I'm not aware of any task repository that uses MediaWiki syntax.

Some relevant links:

* http://confluence.atlassian.com/display/JIRASTUDIO/Creating+Links
* http://trac.edgewall.org/wiki/TracLinks

If the setting is made and stored in the @TaskRepository@, then the @MarkupTaskEditorExtension@ can configure the @MarkupLanguage@.  This is why the @TaskRepository@ is passed to the @MarkupTaskEditorExtension@ in the first place -- so that the extension has access to settings of the @TaskRepository@.

I recommend changing the patch to set the internal link pattern as an attribute on the @TaskRepository@ using @TaskRepository.setProperty(String,String)@.
Comment 27 Steffen Pingel CLA 2008-08-14 16:17:30 EDT
That sounds good to me. Owen, the best place to define the key for the property is probably in AbstractTaskEditorExtension. 
Comment 28 David Green CLA 2008-08-14 16:22:16 EDT
Created attachment 110032 [details]
patch based on Owen's work that sets the attribute on the task repository

how about something like this?  The editor extension and contribution item communicate via the repository settings.
the property name constant should of course be moved somewhere appropriate.
Comment 29 Jingwen 'Owen' Ou CLA 2008-08-14 16:31:27 EDT
(In reply to comment #28)
> Created an attachment (id=110032)
> patch based on Owen's work that sets the attribute on the task repository
> 
> how about something like this?  The editor extension and contribution item
> communicate via the repository settings.
> the property name constant should of course be moved somewhere appropriate.


Looks great! 

in reply to "For WikiText, this can only be for repositories that use  TracWiki, MediaWiki or Confluence markup languages (Textile has no internal link syntax).  
I'm not aware of any task repository that uses MediaWiki syntax." Any APIs to get a list of extensionIds that support internal link pattern? Otherwise I might have to hard code which repositories can run the action
Comment 30 Steffen Pingel CLA 2008-08-14 16:41:58 EDT
The enablement of the feature will depend on the selected WikiText extension rather than the selected repository. David, is there a way to tell if an extension supports this? Otherwise it could be okay to leave it enabled for all.
Comment 31 David Green CLA 2008-08-14 16:59:54 EDT
(In reply to comment #30)
> David, is there a way to tell if an
> extension supports this? Otherwise it could be okay to leave it enabled for
> all.

This could get complicated.  For example, how would we handle the situation where the attribute was set, then the markup language changed to something that doesn't support the setting?  The setting would have to get cleared when the markup language was changed.  Perhaps we should just leave it enabled for all.
Comment 32 Steffen Pingel CLA 2008-08-14 22:49:29 EDT
Excellent! Thanks Owen and David. I have applied the patch with minor modifications: I moved the constant for the properties key to the java class AbstractTaskEditorExtension (wow, the completion worked!).
Comment 33 David Green CLA 2008-08-14 23:16:29 EDT
Nice, thanks!