Commits

Lynn Rees committed 4d00ff0

- basic infrastructure

  • Participants
  • Parent commits b231f69

Comments (0)

Files changed (3)

File scripts/wikdShell.groovy

+// @CacheScriptContent(true)
+// @ExecutionModes({ON_SINGLE_NODE})
+
+import groovy.ui.Console
+
+def binding = getBinding()
+
+def console = new Console(binding)
+console.setVariable('binding', binding)
+console.setVariable('map', node.map)
+console.setVariable('root', node.map.root)
+console.run()

File src/wikdShell.groovy

-// @CacheScriptContent(true)
-// @ExecutionModes({ON_SINGLE_NODE})
-
-import groovy.ui.Console
-
-def binding = getBinding()
-
-def console = new Console(binding)
-console.setVariable('binding', binding)
-console.setVariable('map', node.map)
-console.setVariable('root', node.map.root)
-console.run()

File wikdShell.mm

+<map version="freeplane 1.2.0">
+<!--To view this file, download free mind mapping software Freeplane from http://freeplane.sourceforge.net -->
+<node TEXT="wikdShell" FOLDED="false" ID="ID_1723255651" CREATED="1283093380553" MODIFIED="1358397138387" BACKGROUND_COLOR="#97c7dc"><hook NAME="MapStyle">
+    <properties show_icon_for_attributes="true" show_note_icons="true"/>
+
+<map_styles>
+<stylenode LOCALIZED_TEXT="styles.root_node">
+<stylenode LOCALIZED_TEXT="styles.predefined" POSITION="right">
+<stylenode LOCALIZED_TEXT="default" COLOR="#000000" STYLE="fork" MAX_WIDTH="600">
+<font NAME="SansSerif" SIZE="12" BOLD="false" ITALIC="false"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="defaultstyle.details"/>
+<stylenode LOCALIZED_TEXT="defaultstyle.note"/>
+<stylenode LOCALIZED_TEXT="defaultstyle.floating">
+<edge STYLE="hide_edge"/>
+<cloud COLOR="#f0f0f0" SHAPE="ROUND_RECT"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.ok">
+<icon BUILTIN="button_ok"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.needs_action">
+<icon BUILTIN="messagebox_warning"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.floating_node">
+<cloud COLOR="#ffffff" SHAPE="ARC"/>
+<edge STYLE="hide_edge"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.topic" COLOR="#18898b" STYLE="fork">
+<font NAME="Liberation Sans" SIZE="12" BOLD="true"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.subtopic" COLOR="#cc3300" STYLE="fork">
+<font NAME="Liberation Sans" SIZE="12" BOLD="true"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.subsubtopic" COLOR="#669900">
+<font NAME="Liberation Sans" SIZE="12" BOLD="true"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.connection" COLOR="#606060" STYLE="fork">
+<font NAME="Arial" SIZE="10" BOLD="false"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.important" COLOR="#ff0000">
+<icon BUILTIN="yes"/>
+<font NAME="Liberation Sans" SIZE="12"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.question">
+<icon BUILTIN="help"/>
+<font NAME="Aharoni" SIZE="12"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.key" COLOR="#996600">
+<icon BUILTIN="password"/>
+<font NAME="Liberation Sans" SIZE="12" BOLD="false"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.idea">
+<icon BUILTIN="idea"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.note" COLOR="#990000">
+<font NAME="Liberation Sans" SIZE="12"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.date" COLOR="#0033ff">
+<icon BUILTIN="calendar"/>
+<font NAME="Liberation Sans" SIZE="12"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.website" COLOR="#006633">
+<font NAME="Liberation Sans" SIZE="12"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.list" COLOR="#cc6600">
+<icon BUILTIN="list"/>
+<font NAME="Liberation Sans" SIZE="12" BOLD="true"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.quotation" COLOR="#338800" STYLE="fork">
+<font NAME="Liberation Sans" SIZE="12" BOLD="false" ITALIC="false"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.definition" COLOR="#666600">
+<font NAME="Liberation Sans" SIZE="12" BOLD="false"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.description" COLOR="#996600">
+<font NAME="Liberation Sans" SIZE="12" BOLD="false"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.pending" COLOR="#b3b95c">
+<font NAME="Liberation Sans" SIZE="12"/>
+</stylenode>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.AutomaticLayout" POSITION="right">
+<stylenode LOCALIZED_TEXT="AutomaticLayout.level.root" COLOR="#000000">
+<font SIZE="20"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="AutomaticLayout.level,1" COLOR="#0033ff">
+<font SIZE="18"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="AutomaticLayout.level,2" COLOR="#00b439">
+<font SIZE="16"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="AutomaticLayout.level,3" COLOR="#990000">
+<font SIZE="14"/>
+</stylenode>
+<stylenode LOCALIZED_TEXT="AutomaticLayout.level,4" COLOR="#111111">
+<font SIZE="12"/>
+</stylenode>
+</stylenode>
+<stylenode LOCALIZED_TEXT="styles.user-defined" POSITION="right"/>
+</stylenode>
+</map_styles>
+</hook>
+<hook NAME="AutomaticEdgeColor" COUNTER="10"/>
+<hook NAME="FlexibleLayout" VALUE="CHILDREN"/>
+<attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
+<attribute NAME="name" VALUE="wikdShell"/>
+<attribute NAME="version" VALUE=""/>
+<attribute NAME="author" VALUE=""/>
+<attribute NAME="freeplaneVersionFrom" VALUE=""/>
+<attribute NAME="freeplaneVersionTo" VALUE=""/>
+<font SIZE="16" BOLD="true" ITALIC="true"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      The homepage of this add-on should be set as the link of the root node.
+    </p>
+    <p>
+      The basic properties of this add-on. They can be used in script names and other attributes, e.g. &quot;${name}.groovy&quot;.
+    </p>
+    <ul>
+      <li>
+        name: The name of the add-on, normally a technically one (no spaces, no special characters except _.-).
+      </li>
+      <li>
+        author: Author's name(s) and (optionally) email adresses.
+      </li>
+      <li>
+        version: Since it's difficult to protect numbers like 1.0 from Freeplane's number parser it's advised to prepend a 'v' to the number, e.g. 'v1.0'.
+      </li>
+      <li>
+        freeplane-version-from: The oldest compatible Freeplane version. The add-on will not be installed if the Freeplane version is too old.
+      </li>
+      <li>
+        freeplane-version-to: Normally empty: The newest compatible Freeplane version. The add-on will not be installed if the Freeplane version is too new.
+      </li>
+    </ul>
+  </body>
+</html>
+
+</richcontent>
+<node TEXT="description" POSITION="left" ID="ID_1476543373" CREATED="1358397138392" MODIFIED="1358397138399">
+<edge COLOR="#ff0000"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      Description would be awkward to edit as an attribute.
+    </p>
+    <p>
+      So you have to put the add-on description as a child of the <i>'description'</i>&#160;node.
+    </p>
+  </body>
+</html>
+
+</richcontent>
+</node>
+<node TEXT="changes" POSITION="left" ID="ID_26360570" CREATED="1358397138400" MODIFIED="1358397138405">
+<edge COLOR="#0000ff"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      Change log of this add-on: append one node for each noteworthy version and put the details for each version into a child node.
+    </p>
+  </body>
+</html>
+
+</richcontent>
+</node>
+<node TEXT="license" FOLDED="true" POSITION="left" ID="ID_584948500" CREATED="1358397138405" MODIFIED="1358397138410">
+<edge COLOR="#00ff00"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      The add-ons's license that the user has to accept before she can install it.
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      The License text has to be entered as a child of the <i>'license'</i>&#160;node, either as plain text or as HTML.
+    </p>
+  </body>
+</html>
+
+</richcontent>
+<node TEXT="&#xa;This add-on is free software: you can redistribute it and/or modify&#xa;it under the terms of the GNU General Public License as published by&#xa;the Free Software Foundation, either version 2 of the License, or&#xa;(at your option) any later version.&#xa;&#xa;This program is distributed in the hope that it will be useful,&#xa;but WITHOUT ANY WARRANTY; without even the implied warranty of&#xa;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&#xa0;&#xa0;See the&#xa;GNU General Public License for more details.&#xa;" ID="ID_1182518149" CREATED="1358397138412" MODIFIED="1358397138412"/>
+</node>
+<node TEXT="preferences.xml" POSITION="left" ID="ID_892155711" CREATED="1358397138421" MODIFIED="1358397138436">
+<edge COLOR="#ff00ff"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      <font color="#000000" face="SansSerif, sans-serif">The child node contains the add-on configuration as an extension to mindmapmodemenu.xml (in Tools-&gt;Preferences-&gt;Add-ons). </font>
+    </p>
+    <p>
+      <font color="#000000" face="SansSerif, sans-serif">Every property in the configuration should receive a default value in <i>default.properties</i>&#160;node.</font>
+    </p>
+  </body>
+</html>
+
+</richcontent>
+</node>
+<node TEXT="default.properties" POSITION="left" ID="ID_762310990" CREATED="1358397138437" MODIFIED="1358397138441">
+<edge COLOR="#00ffff"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      These properties play together with the preferences: Each property defined in the preferences should have a default value in the attributes of this node.
+    </p>
+  </body>
+</html>
+
+</richcontent>
+</node>
+<node TEXT="translations" POSITION="left" ID="ID_1542326927" CREATED="1358397138442" MODIFIED="1358397138446">
+<edge COLOR="#ffff00"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      The translation keys that this script uses. Define one child node per supported locale. The attributes contain the translations. Define at least 'addons.${name}' for the add-on's name.
+    </p>
+  </body>
+</html>
+
+</richcontent>
+<node TEXT="en" ID="ID_502342550" CREATED="1358397138447" MODIFIED="1358397138449">
+<attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
+<attribute NAME="addons.${name}" VALUE="wikdShell"/>
+</node>
+</node>
+<node TEXT="deinstall" POSITION="left" ID="ID_1716047542" CREATED="1358397138451" MODIFIED="1358397138457">
+<edge COLOR="#7c0000"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      List of files and/or directories to remove on deinstall
+    </p>
+  </body>
+</html>
+
+</richcontent>
+<attribute_layout NAME_WIDTH="100" VALUE_WIDTH="100"/>
+<attribute NAME="delete" VALUE="${installationbase}/addons/${name}.script.xml"/>
+</node>
+<node TEXT="scripts" POSITION="right" ID="ID_1656924893" CREATED="1358397138459" MODIFIED="1358397138472">
+<edge COLOR="#00007c"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      An add-on may contain multiple scripts. The node text defines the script name (e.g. inserInlineImage.groovy). Its properties have to be configured via attributes:
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      * menuLocation: &lt;locationkey&gt;
+    </p>
+    <p>
+      &#160;&#160;&#160;- Defines where the menu location.
+    </p>
+    <p>
+      &#160;&#160;&#160;-&#160;See mindmapmodemenu.xml for how the menu locations look like.
+    </p>
+    <p>
+      &#160;&#160;&#160;- http://freeplane.bzr.sf.net/bzr/freeplane/freeplane_program/trunk/annotate/head%3A/freeplane/resources/xml/mindmapmodemenu.xml
+    </p>
+    <p>
+      &#160;&#160;&#160;- This attribute is mandatory
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      * menuTitleKey: &lt;key&gt;
+    </p>
+    <p>
+      &#160;&#160;&#160;- The menu item title will be looked up under the translation key &lt;key&gt; - don't forget to define its translation.
+    </p>
+    <p>
+      &#160;&#160;&#160;- This attribute is mandatory
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      * executionMode: &lt;mode&gt;
+    </p>
+    <p>
+      &#160;&#160;&#160;- The execution mode as described in the Freeplane wiki (http://freeplane.sourceforge.net/wiki/index.php/Scripting)
+    </p>
+    <p>
+      &#160;&#160;&#160;- ON_SINGLE_NODE: Execute the script once. The <i>node</i>&#160;variable is set to the selected node.
+    </p>
+    <p>
+      &#160;&#160;&#160;- ON_SELECTED_NODE: Execute the script n times for n selected nodes, once for each node.
+    </p>
+    <p>
+      &#160;&#160;&#160;- ON_SELECTED_NODE_RECURSIVELY: Execute the script on every selected node and recursively on all of its children.
+    </p>
+    <p>
+      &#160;&#160;&#160;- In doubt use ON_SINGLE_NODE.
+    </p>
+    <p>
+      &#160;&#160;&#160;- This attribute is mandatory
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      * keyboardShortcut: &lt;shortcut&gt;
+    </p>
+    <p>
+      &#160;&#160;&#160;- Optional: keyboard combination / accelerator for this script, e.g. control alt I
+    </p>
+    <p>
+      &#160;&#160;&#160;- Use lowercase letters for modifiers and uppercase for letters. Use no + signs.
+    </p>
+    <p>
+      &#160;&#160;&#160;- The available key names are listed at http://download.oracle.com/javase/1.4.2/docs/api/java/awt/event/KeyEvent.html#VK_0
+    </p>
+    <p>
+      &#160;&#160;&#160;&#160;&#160;In the list only entries with a 'VK_' prefix count. Omit the prefix in the shortcut definition.
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      * Permissions&#160;that the script(s) require, each either false or true:
+    </p>
+    <p>
+      &#160;&#160;&#160;- execute_scripts_without_asking
+    </p>
+    <p>
+      &#160;&#160;&#160;- execute_scripts_without_file_restriction: permission to read files
+    </p>
+    <p>
+      &#160;&#160;&#160;- execute_scripts_without_write_restriction: permission to create/change/delete files
+    </p>
+    <p>
+      &#160;&#160;&#160;- execute_scripts_without_exec_restriction: permission to execute other programs
+    </p>
+    <p>
+      &#160;&#160;&#160;- execute_scripts_without_network_restriction: permission to access the network
+    </p>
+    <p>
+      &#160;&#160;Notes:
+    </p>
+    <p>
+      &#160;&#160;- The set of permissions is fixed.
+    </p>
+    <p>
+      &#160;&#160;- Don't change the attribute names, don't omit one.
+    </p>
+    <p>
+      &#160;&#160;- Set the values either to true or to false
+    </p>
+    <p>
+      &#160;&#160;- In any case set execute_scripts_without_asking to true unless you want to annoy users.
+    </p>
+  </body>
+</html>
+
+</richcontent>
+</node>
+<node TEXT="zips" POSITION="right" ID="ID_686396268" CREATED="1358397138476" MODIFIED="1358397138482">
+<edge COLOR="#007c00"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      An add-on may contain any number of nodes containing zip files.
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      &#160;- The immediate child nodes contain a description of the zip. The devtools script releaseAddOn.groovy allows automatic zip creation if the name of this node matches a directory in the current directory.
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      &#160;- The child nodes of these nodes contain the actual zip files.
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      &#160;- Any zip file will be extracted in the &lt;installationbase&gt;. Currently, &lt;installationbase&gt; is always Freeplane's &lt;userhome&gt;, e.g. ~/.freeplane/1.2.
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      &#160;- The files will be processed in the sequence as seen in the map.
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      &#160;- Zip files must be uploaded into the map via the script <i>Tools-&gt;Scripts-&gt;Insert Binary</i>&#160;since they have to be (base64) encoded as simple strings.
+    </p>
+  </body>
+</html>
+
+</richcontent>
+</node>
+<node TEXT="images" POSITION="right" ID="ID_1421584650" CREATED="1358397138484" MODIFIED="1358397138489">
+<edge COLOR="#7c007c"/>
+<richcontent TYPE="NOTE">
+
+<html>
+  <head>
+    
+  </head>
+  <body>
+    <p>
+      An add-on may define any number of images as child nodes of the images node. The actual image data has to be placed as base64 encoded binary data into the text of a subnode.
+    </p>
+    <p>
+      The images are saved to the <i>${installationbase}/resources/images</i>&#160;directory.
+    </p>
+    <p>
+      
+    </p>
+    <p>
+      The following images should be present:
+    </p>
+    <ul>
+      <li>
+        <i>${name}.png</i>, like <i>oldicons-theme.png</i>. This will be used in the app-on details dialog.
+      </li>
+      <li>
+        <i>${name}-icon.png</i>, like <i>oldicons-theme-icon.png</i>. This will be used in the app-on overview.
+      </li>
+    </ul>
+    <p>
+      Images can be added automatically by releaseAddOn.groovy or must be uploaded into the map via the script <i>Tools-&gt;Scripts-&gt;Insert Binary</i>&#160;since they have to be (base64) encoded as simple strings.
+    </p>
+  </body>
+</html>
+
+</richcontent>
+</node>
+</node>
+</map>