Hyperlinks: Difference between revisions
(→Tracker items: +) |
Dan Polansky (talk | contribs) (→Tracker items: +dates) |
||
(20 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
FreeMind supports having one hyperlink per node, linking to web pages, mail addresses, and to local files. | FreeMind supports having one hyperlink per node, linking to web pages, mail addresses, and to local files. | ||
==Limitations== | |||
* Opening of hyperlinks that contain various custom protocols such as "onenote://" and "outlook://" is unsupported. An example error message upon an attempt to open the hyperlink: "java.net.MalformedURLException:unknown protocol:". See also [[#Protocols]]. | |||
* Hyperlinks to executables with parameters is unsupported: passing parameters to executables is not possible in hyperlinks. The following does not work: "C:/Program Files/Windows Media Player/wmplayer.exe C:/My Documents/file.mp3"; the part "C:/My Documents/file.mp3" is not understood as a parameter. See also a [http://sourceforge.net/projects/freemind/forums/forum/22102/topic/3042693 Help forum post]. | |||
==Implementation== | ==Implementation== | ||
Line 13: | Line 17: | ||
| [http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/FreeMind.java FreeMind] | | [http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/FreeMind.java FreeMind] | ||
| openDocument | | openDocument | ||
| | | Opens the given URL in a browser or using the appropriate service of the operating system, using the browser command appropriate for the operating system. | ||
|- | |||
| [http://freemind.cvs.sourceforge.net/viewvc/freemind/freemind/freemind/modes/ControllerAdapter.java ControllerAdapter] | |||
| loadURL | |||
| Takes an URL as a string, checks whether it is relative or absolute, and whether it ends in ".mm", and opens it as a mind map, centers the target node if the URL is of the form "#nodeID", or forwards the URL to the openDocument method. | |||
|- | |- | ||
| [http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/Tools.java Tools] | | [http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/Tools.java Tools] | ||
Line 22: | Line 30: | ||
| fileToUrl | | fileToUrl | ||
| Converts a file to URL, working around Java issues. | | Converts a file to URL, working around Java issues. | ||
|- | |||
| [http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/Tools.java Tools] | |||
| isAbsolutePath | |||
| Tells whether the given string path is absolute or relative. For non-Windows, it decides based on whether the path starts with a file separator. The logic picked depends on the operating system. Used in the loadURL method. | |||
|} | |} | ||
FreeMind could, yet does not, open hyperlinks by using the [http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html Desktop class] introduced in Java 6. A downside: this would make FreeMind dependent on Java 6 rather than on Java 1.4. | |||
==Cases== | ==Cases== | ||
{| {{Table style}} | {| {{Table style}} | ||
|+ Cases of hyperlink paths | |||
! Type | ! Type | ||
! Case | ! Case | ||
Line 46: | Line 61: | ||
| Following is broken in 0.9.0 beta 18. | | Following is broken in 0.9.0 beta 18. | ||
|} | |} | ||
==Browser commands== | |||
The various default browser commands per operating system: | |||
Source: [http://freemind.cvs.sourceforge.net/viewvc/freemind/freemind/freemind.properties?view=log freemind.properties]. | |||
* default_browser_command_windows_nt = cmd.exe /c start "" "{0}" | |||
* default_browser_command_windows_9x = command.com /c start "{0}" | |||
* default_browser_command_mac = open {0} | |||
* default_browser_command_other_os = xdg-open {0} | |||
==Protocols== | ==Protocols== | ||
Line 52: | Line 75: | ||
* "mid://"[http://sourceforge.net/tracker/index.php?func=detail&aid=1738366&group_id=7118&atid=307118] -- for messages | * "mid://"[http://sourceforge.net/tracker/index.php?func=detail&aid=1738366&group_id=7118&atid=307118] -- for messages | ||
* "notes://"[http://sourceforge.net/tracker/index.php?func=detail&aid=1763220&group_id=7118&atid=357118] -- for Lotus Notes | * "notes://"[http://sourceforge.net/tracker/index.php?func=detail&aid=1763220&group_id=7118&atid=357118] -- for Lotus Notes | ||
* "svn://"[http://sourceforge.net/tracker/index.php?func=detail&aid=2102800&group_id=7118&atid=357118] | |||
* "outlook://"[http://sourceforge.net/tracker/index.php?func=detail&aid=2102800&group_id=7118&atid=357118] | |||
* "message://" -- Email helper protocol call on Mac OS X | |||
There is a patch fixing the issue for all the protocols: [http://sourceforge.net/tracker/index.php?func=detail&aid=1889293&group_id=7118&atid=307118 Support for arbitrary URIs]<br> | |||
''Would be nice if someone wrote an instruction on how to apply this patch!'' | |||
==Tracker items== | ==Tracker items== | ||
* [http://sourceforge.net/tracker/index.php?func=detail&aid=2002285&group_id=7118&atid=1006953 URLs of local files - spaces] | * [http://sourceforge.net/tracker/index.php?func=detail&aid=2002285&group_id=7118&atid=1006953 URLs of local files - spaces], 2008-06-25 | ||
* [http://sourceforge.net/tracker/index.php?func=detail&aid=1984395&group_id=7118&atid=107118 Error opening files from network PCs in Windows] | * Bug: [http://sourceforge.net/tracker/index.php?func=detail&aid=1984395&group_id=7118&atid=107118 Error opening files from network PCs in Windows], 2008-06-04 | ||
* [http://sourceforge.net/tracker/index.php?func=detail&aid=2102800&group_id=7118&atid=357118 | * RFE: [http://sourceforge.net/tracker/index.php?func=detail&aid=2102800&group_id=7118&atid=357118 Customisable hyperlink protocols (like Firefox)], 2008-09-09 | ||
* Bug: [http://sourceforge.net/tracker/index.php?func=detail&aid=2306014&group_id=7118&atid=107118 'Unknown protocol' for custom protocol hyperlinks], 2008-11-17 | |||
* Patch: [http://sourceforge.net/tracker/index.php?func=detail&aid=1889293&group_id=7118&atid=307118 Support for arbitrary URIs], 2008-02-07 | |||
==Forum entries== | |||
* [http://sourceforge.net/forum/message.php?msg_id=6450308 Lotus Notes hyperlink], 2009-02-17 | |||
==See also== | |||
* [[Local hyperlink]] | |||
==Links== | ==Links== |
Latest revision as of 09:30, 11 June 2011
FreeMind supports having one hyperlink per node, linking to web pages, mail addresses, and to local files.
Limitations
- Opening of hyperlinks that contain various custom protocols such as "onenote://" and "outlook://" is unsupported. An example error message upon an attempt to open the hyperlink: "java.net.MalformedURLException:unknown protocol:". See also #Protocols.
- Hyperlinks to executables with parameters is unsupported: passing parameters to executables is not possible in hyperlinks. The following does not work: "C:/Program Files/Windows Media Player/wmplayer.exe C:/My Documents/file.mp3"; the part "C:/My Documents/file.mp3" is not understood as a parameter. See also a Help forum post.
Implementation
Making hyperlinks work fine on all the supported platforms including Microsoft Windows, Max OS X and Linux is technically tricky, requiring dedicated code for each group of platforms.
Class | Method | Description |
---|---|---|
FreeMind | openDocument | Opens the given URL in a browser or using the appropriate service of the operating system, using the browser command appropriate for the operating system. |
ControllerAdapter | loadURL | Takes an URL as a string, checks whether it is relative or absolute, and whether it ends in ".mm", and opens it as a mind map, centers the target node if the URL is of the form "#nodeID", or forwards the URL to the openDocument method. |
Tools | urlGetFile | A heuristic workaround. |
Tools | fileToUrl | Converts a file to URL, working around Java issues. |
Tools | isAbsolutePath | Tells whether the given string path is absolute or relative. For non-Windows, it decides based on whether the path starts with a file separator. The logic picked depends on the operating system. Used in the loadURL method. |
FreeMind could, yet does not, open hyperlinks by using the Desktop class introduced in Java 6. A downside: this would make FreeMind dependent on Java 6 rather than on Java 1.4.
Cases
Type | Case | Example Path | Note |
---|---|---|---|
Local file | Unix path | "/folder/some more/file" | |
Local file | Windows drive path | "C:\Users\User Joe\file" | |
Local file | Windows network path | "\\hostname\folder\file" | Following is broken in 0.9.0 beta 18. |
Browser commands
The various default browser commands per operating system: Source: freemind.properties.
- default_browser_command_windows_nt = cmd.exe /c start "" "{0}"
- default_browser_command_windows_9x = command.com /c start "{0}"
- default_browser_command_mac = open {0}
- default_browser_command_other_os = xdg-open {0}
Protocols
Users are requesting that FreeMind supports various protocols that are currently unsupported. These include the following:
- "onenote://"[1] -- for Microsoft OneNote
- "mid://"[2] -- for messages
- "notes://"[3] -- for Lotus Notes
- "svn://"[4]
- "outlook://"[5]
- "message://" -- Email helper protocol call on Mac OS X
There is a patch fixing the issue for all the protocols: Support for arbitrary URIs
Would be nice if someone wrote an instruction on how to apply this patch!
Tracker items
- URLs of local files - spaces, 2008-06-25
- Bug: Error opening files from network PCs in Windows, 2008-06-04
- RFE: Customisable hyperlink protocols (like Firefox), 2008-09-09
- Bug: 'Unknown protocol' for custom protocol hyperlinks, 2008-11-17
- Patch: Support for arbitrary URIs, 2008-02-07
Forum entries
- Lotus Notes hyperlink, 2009-02-17