Difference between revisions of "Scripting: API Changes"

From Freeplane - free mind mapping and knowledge management software
Line 1: Line 1:
The [[Scripting_API|Scripting API]], which is defined by the <groovy>org.freeplane.plugin.script.proxy.Proxy</groovy> interface, will evolve over time but Freeplane's developers will do whatever possible to keep new API versions downward compatible. On the other hand there might be changes in parts of the Freeplane code that are not part of the official API but on which some scripts might depend nevertheless. This mostly applies to the [[Scripting:_Freeplane_Utility_Classes|utility classes]].
+
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://ekygelymib.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 +
----
 +
=[http://ekygelymib.co.cc CLICK HERE]=
 +
----
 +
</div>
 +
The [[Scripting_API|Scripting API]], which is defined by the &lt;groovy&gt;org.freeplane.plugin.script.proxy.Proxy&lt;/groovy&gt; interface, will evolve over time but Freeplane's developers will do whatever possible to keep new API versions downward compatible. On the other hand there might be changes in parts of the Freeplane code that are not part of the official API but on which some scripts might depend nevertheless. This mostly applies to the [[Scripting:_Freeplane_Utility_Classes|utility classes]].
  
 
This page lists changes in Freeplane that you might want or sometimes have to care about when changing to new Freeplane versions.
 
This page lists changes in Freeplane that you might want or sometimes have to care about when changing to new Freeplane versions.
Line 8: Line 16:
  
 
Attributes:
 
Attributes:
<groovy>
+
&lt;groovy&gt;
List<String> getAll(String)
+
List&lt;String&gt; getAll(String)
public List<String> getAttributeNames()
+
public List&lt;String&gt; getAttributeNames()
 
String get(final int index)
 
String get(final int index)
 
void set(final int index, final String value)
 
void set(final int index, final String value)
Line 18: Line 26:
 
void add(final String name, final String value)
 
void add(final String name, final String value)
 
int size()
 
int size()
</groovy>
+
&lt;/groovy&gt;
  
 
===1.43 rc===
 
===1.43 rc===
<groovy>
+
&lt;groovy&gt;
 
   File Map.getFile()
 
   File Map.getFile()
</groovy>
+
&lt;/groovy&gt;
  
 
== After Release 1.1==
 
== After Release 1.1==
Line 29: Line 37:
 
===Refactoring of utility classes===
 
===Refactoring of utility classes===
  
In package <tt>org.freeplane.core.util</tt>:
+
In package &lt;tt&gt;org.freeplane.core.util&lt;/tt&gt;:
  
* <tt>ResUtil</tt> => <tt>FileUtils</tt>
+
* &lt;tt&gt;ResUtil&lt;/tt&gt; =&gt; &lt;tt&gt;FileUtils&lt;/tt&gt;
* <tt>HtmlTools</tt> => <tt>HtmlUtils</tt>
+
* &lt;tt&gt;HtmlTools&lt;/tt&gt; =&gt; &lt;tt&gt;HtmlUtils&lt;/tt&gt;
* <tt>LogTool</tt> => <tt>LogUtils</tt>
+
* &lt;tt&gt;LogTool&lt;/tt&gt; =&gt; &lt;tt&gt;LogUtils&lt;/tt&gt;
* <tt>MenuTools</tt> => <tt>MenuUtils</tt>
+
* &lt;tt&gt;MenuTools&lt;/tt&gt; =&gt; &lt;tt&gt;MenuUtils&lt;/tt&gt;
* <tt>SysUtil</tt> => <tt>SysUtils</tt>
+
* &lt;tt&gt;SysUtil&lt;/tt&gt; =&gt; &lt;tt&gt;SysUtils&lt;/tt&gt;
* <tt>XmlTool</tt> => <tt>XmlUtils</tt>
+
* &lt;tt&gt;XmlTool&lt;/tt&gt; =&gt; &lt;tt&gt;XmlUtils&lt;/tt&gt;
  
 
Other:
 
Other:
* <tt>org.freeplane.core.resources.FpStringUtils</tt> => <tt>org.freeplane.core.util.TextUtil</tt>
+
* &lt;tt&gt;org.freeplane.core.resources.FpStringUtils&lt;/tt&gt; =&gt; &lt;tt&gt;org.freeplane.core.util.TextUtil&lt;/tt&gt;
* <tt>org.freeplane.core.util.MultipleValueMap</tt> => <tt>org.freeplane.core.util.collection.MultipleValueMap</tt>
+
* &lt;tt&gt;org.freeplane.core.util.MultipleValueMap&lt;/tt&gt; =&gt; &lt;tt&gt;org.freeplane.core.util.collection.MultipleValueMap&lt;/tt&gt;
  
The following Perl script will adjust all scripts in the current directory with a ".groovy" suffix. The original file will be saved with a ".bak" suffix.
+
The following Perl script will adjust all scripts in the current directory with a &quot;.groovy&quot; suffix. The original file will be saved with a &quot;.bak&quot; suffix.
<groovy>
+
&lt;groovy&gt;
 
perl -i.bak -pe 's,\b(Res|Sys)Util\b,$1Utils,g;
 
perl -i.bak -pe 's,\b(Res|Sys)Util\b,$1Utils,g;
 
   s,\b(Html|Log|Menu|Xml)Tools?\b,$1Utils,g;
 
   s,\b(Html|Log|Menu|Xml)Tools?\b,$1Utils,g;
Line 49: Line 57:
 
   s,\bFpStringUtils\b,TextUtils,g;
 
   s,\bFpStringUtils\b,TextUtils,g;
 
   s,(util).(MultipleValueMap)\b,$1.collection.$2,g' *.groovy
 
   s,(util).(MultipleValueMap)\b,$1.collection.$2,g' *.groovy
</groovy>
+
&lt;/groovy&gt;
  
 
[[Category:Scripting]]
 
[[Category:Scripting]]

Revision as of 03:57, 24 November 2010


The Scripting API, which is defined by the <groovy>org.freeplane.plugin.script.proxy.Proxy</groovy> interface, will evolve over time but Freeplane's developers will do whatever possible to keep new API versions downward compatible. On the other hand there might be changes in parts of the Freeplane code that are not part of the official API but on which some scripts might depend nevertheless. This mostly applies to the utility classes.

This page lists changes in Freeplane that you might want or sometimes have to care about when changing to new Freeplane versions.


Before Release 1.1

1.41 beta

Attributes: <groovy> List<String> getAll(String) public List<String> getAttributeNames() String get(final int index) void set(final int index, final String value) void set(final int index, final String name, final String value) boolean removeAll(final String name) void remove(final int index) void add(final String name, final String value) int size() </groovy>

1.43 rc

<groovy>

 File Map.getFile()

</groovy>

After Release 1.1

Refactoring of utility classes

In package <tt>org.freeplane.core.util</tt>:

  • <tt>ResUtil</tt> => <tt>FileUtils</tt>
  • <tt>HtmlTools</tt> => <tt>HtmlUtils</tt>
  • <tt>LogTool</tt> => <tt>LogUtils</tt>
  • <tt>MenuTools</tt> => <tt>MenuUtils</tt>
  • <tt>SysUtil</tt> => <tt>SysUtils</tt>
  • <tt>XmlTool</tt> => <tt>XmlUtils</tt>

Other:

  • <tt>org.freeplane.core.resources.FpStringUtils</tt> => <tt>org.freeplane.core.util.TextUtil</tt>
  • <tt>org.freeplane.core.util.MultipleValueMap</tt> => <tt>org.freeplane.core.util.collection.MultipleValueMap</tt>

The following Perl script will adjust all scripts in the current directory with a ".groovy" suffix. The original file will be saved with a ".bak" suffix. <groovy> perl -i.bak -pe 's,\b(Res|Sys)Util\b,$1Utils,g;

 s,\b(Html|Log|Menu|Xml)Tools?\b,$1Utils,g;
 s,resources\.FpStringUtils\b,util\.FpStringUtils,g;
 s,\bFpStringUtils\b,TextUtils,g;
 s,(util).(MultipleValueMap)\b,$1.collection.$2,g' *.groovy

</groovy>