addressing external nodes within formulas

addressing external nodes within formulas

Postby petra1973 » Tue Jun 18, 2013 3:04 pm

Hi,

I was wondering if Freeplane already facilitates accessing contents of external nodes (i.e. nodes which reside not in the local map but in an external map). As far as I know, the core text portion of a local node can be accessed using something like

Code: Select all
= ID_1234567890.text


In my imagination, access to an external link using a formula could be expressed like

Code: Select all
= ExternalMindmap.mm#ID_2345678901.text


when the link specification was to follow the syntax of the current realization of anchored external links (https://sourceforge.net/apps/phpbb/freeplane/viewtopic.php?f=1&t=213).

Does Freeplane already facilitate any function syntax for accessing external nodes by functions? If not, is there interest for having it implemented?

Regards.
Nnamdi
petra1973
 
Posts: 14
Joined: Sun Mar 11, 2012 12:17 pm

Re: addressing external nodes within formulas

Postby boercher » Sun Jun 23, 2013 7:34 pm

Hi Nnamdi,

such links would be nice and not very difficult to implement if the maps would be opened already. Would you like to try an implementation? Have a look at uses of FreeplaneScriptBaseClass.nodeIdPattern

Volker
boercher
 
Posts: 644
Joined: Tue Jul 26, 2011 7:13 am

Re: addressing external nodes within formulas

Postby petra1973 » Thu Jun 27, 2013 7:52 pm

Hi Volker,

thanks. I'd really like love to catch up again. It might take some time to get the installations (eclipse,...) done, again, but there will be help in the wiki and forum, I guess. So, you'll see me soon.

Nnamdi
petra1973
 
Posts: 14
Joined: Sun Mar 11, 2012 12:17 pm

Re: addressing external nodes within formulas

Postby nnako » Mon Nov 11, 2013 6:50 pm

Hi developers,

I'd like to start the development of the functionality mentioned in the postings above: "accessing map-external node contents from within formulas".

What do you think of this roadmap?:

(1) definition of a pattern string format which fits into Freeplane's addressing syntax (suggestion as you see above)
(2) determination of a suitable place within the code to evaluate the modified formula string before it is led into Groovy evaluation
(3) navigation into the external map (without actually displaying the map) and collecting the contents from there
(4) replacing the the original formula string with the fetched contents according to Groovy syntax
(5) evaluating the formula containing the external contents within the original Groovy path

Comments are welcome.

Nnamdi
--
Windows 7 x64
nnako
 
Posts: 10
Joined: Tue Jul 30, 2013 1:46 pm

Re: addressing external nodes within formulas

Postby dpolivaev » Tue Nov 12, 2013 9:26 am

Hello,

1. I do not think that we should extend groovy syntax so that to support code like map.mm#ID_123.text . Current substitution of ID_XXX by a node works because ID_XXX is a valid groovy identifier and therefore they can be resolved using a standard approach overriding getProperty by org.freeplane.plugin.script.FreeplaneScriptBaseClass.getProperty(String).

Strings like map.mm#ID_123 are no valid groovy identifiers and therefore it would mean a groovy syntax change which is almost never a good thing.

I would extend existing scripting API by defining two new methods

Code: Select all
package org.freeplane.plugin.script.proxy
interface Proxy.Controller {
    Proxy.Map map(URL relativeOrAbsoluteUrl)
}

interface Proxy.Map {
    Proxy.Node node(String nodeId)
}


2. I would implement a container mapping map URI to WeakReference<MapModel> where all loaded maps are stored. This way all loaded maps remain accessible by their URL as long as the instances are referenced from somewhere else.

3. I am not sure what is the best place to keep the strong reference to the loaded map. Probably I would add it as an extension of the map or the node the request comes from.

Nnamdi, do you understand the approach?
Volker, what do you think?

Regards, Dimitry
User avatar
dpolivaev
Site Admin
 
Posts: 667
Joined: Sat Jul 23, 2011 1:21 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest

cron