Hyperlinks

From FreeMind

(Redirected from Links)

FreeMind supports having one hyperlink per node, linking to web pages, mail addresses, and to local files.

Table of contents

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.

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.

Methods
Class Method Description
FreeMind (http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/FreeMind.java) 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 (http://freemind.cvs.sourceforge.net/viewvc/freemind/freemind/freemind/modes/ControllerAdapter.java) 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 (http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/Tools.java) urlGetFile A heuristic workaround.
Tools (http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/Tools.java) fileToUrl Converts a file to URL, working around Java issues.
Tools (http://freemind.cvs.sourceforge.net/freemind/freemind/freemind/main/Tools.java) 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.

Cases

Cases of hyperlink paths
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 (http://freemind.cvs.sourceforge.net/viewvc/freemind/freemind/freemind.properties?view=log).

  • 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] (http://sourceforge.net/tracker/index.php?func=detail&aid=2306014&group_id=7118&atid=107118) -- for Microsoft OneNote
  • "mid://"[2] (http://sourceforge.net/tracker/index.php?func=detail&aid=1738366&group_id=7118&atid=307118) -- for messages
  • "notes://"[3] (http://sourceforge.net/tracker/index.php?func=detail&aid=1763220&group_id=7118&atid=357118) -- for Lotus Notes
  • "svn://"[4] (http://sourceforge.net/tracker/index.php?func=detail&aid=2102800&group_id=7118&atid=357118)
  • "outlook://"[5] (http://sourceforge.net/tracker/index.php?func=detail&aid=2102800&group_id=7118&atid=357118)

Tracker items

Forum entries

See also

Links