Plugin development

Help
Tryfon
2010-07-03
2013-04-11
  • Tryfon
    Tryfon
    2010-07-03

    Hello,
    I am working at a research institute in Greece and I am developing a plugin for FreeMind which is in a mature enough state to be disseminated for test use but not to be published yet. I have developed it for FreeMind v0.9.0 and in Eclipse I have made the necessary xml file and put it in the freemind/plugins directory as well as the source code folder and everything works fine.
    Now I would like to ask for some instructions on how to compile my plugin so that the user can easily install it by copying the jar file in the plugins folder of the installed program. Is this even possible? I hope it is and I hope that it is not necessary for freemind to come together with the plugins precompiled and preinstalled.
    The documentation for plugins development is essentially non-existent so I would be very grateful for some help here.

    Thanks in advance!

     
  • Hello Tryfon, I would like to inform you that there is a forked and redesigned version of the FreeMind called Freeplane. I consider it as a challenger and successor of FreeMind. And if you want to develop plugins it is worth of looking there because Freeplane uses standard OSGi Framework for its plug-ins. If you are interested do not hesitate to visit the freeplane page http://freeplane.org and ask for help in freeplane's Source Forge forums. Kind regards, Dimitry Polivaev Freeplane project lead

     
  • Tryfon
    Tryfon
    2010-07-04

    Thanks dpolivaev I will consider designing a version of my plugin for freeplane but this doesn't help me very much with my current problem to be honest.

     
  • AFAIK FreeMind searches for plug-ins in java class path and in the installation directory. All found plug-ins are automatically loaded. Look at freemind.extensions.ImportWizard.buildClassList()

    Dimitry

     
  • Tryfon
    Tryfon
    2010-07-08

    Ok, thanks for the help up to now but problem still not entirely solved.

    I am using Eclipse for developing my plug-in. I have made a few new packages in Freemind's source code which contain my plugin's source code. My plugin needs several external JARs to become operational which I have placed in a lib folder inside my plugin's source folder and added in my workspace in Freemind's build path. After Freemind gets compiled I copy my plugin's folder with all the *.class and other files into the plugins folder of Freemind's installation directory. I also copy in there the necessary xml file for Freemind to register the plugin on startup which I have also created.
    Now when I start Freemind I can see the new menu entry under Tools which corresponds to my plugin. Still when I click on it I get in the console the notorious java.lang.NoClassDefFoundError message for one of my external JARs. I am obviously doing something wrong here. I tried editing my plugin's xml file adding lines like this one <plugin_classpath jar="pubsearch/lib/tablefilter-v3.0.0.jar"/> but without any success.

    Perhaps I should ask this question in an Eclipse forum but still any help would be very much appreciated.

     
  • Hello,

    to be honest, I was never able to fully understand how FreeMind plugins work and what classes are loaded. Therefore I only could help and support you if you had used Freeplane.

    Regards,
    Dimitry

     
  • Tryfon
    Tryfon
    2010-07-08

    Anyway thanks for your effort Dimitry.

    I understand that you can't help so I would appreciate some help from a member of the current developing team who understands the code better.

    Thanks in advance!

     
  • Hello Tryfon, unfortunately, there is indeed very little documentation for plugins. There are some third-party plugins for FreeMind, so there is definitely a way to compile a FreeMind plugin separately from FreeMind. See

    http://freemind.sourceforge.net/wiki/index.php/Plugins#Third-party_plugins

    I do not know the plugin architecture, so I cannot help myself. You could ask the people who have developed the third-party plugins listed in the page that I have posted. In any case, the existence of the third-party plugins is encouraging, in that their authors have figured out for themselves how to write and compile a FreeMind plugin. I am sorry I could not help in any specific way. -Dan

     
  • Tryfon
    Tryfon
    2010-07-09

    Thanks Daniel, I will take a look at all those. Isn't there any member of the developing team who could give me more specific instructions?

     
  • Given that neither I nor Dimitry can give you more specific instructions, the only team member who could tell you more could be Christian Foltin. However, Chris has a rather busy life, appearing in forums rather infrequently. I think there are fair chances you are going to find out yourself how to fix your issues. If you do, it would be nice if you post your results to this forum. FreeMind, being an open source project, relies in part on its users contributing back. -Dan

     
  • Hi,

    FreeMind searches for any xml files that contain plugin information that contains accessories or plugins in its path.
    (See freemind.modes.mindmapmode.hooks.MindMapHookFactory.actualizePlugins())
    Then, the xml is read and the class is constructed.

    It isn't necessary to compile FreeMind with the plugins (although it is thought, that it is the most easiest case to do so).

    You can send your code to me and I'll have a look at it, if there are still any questions.

    HTH, Chris

     
  • Tryfon
    Tryfon
    2010-07-13

    Thanks Chris for all the help. I wish to explain how exactly I want the thing to work and I I'd like some specific instructions from your side. I want the user to be able to paste the jar file of my plugin which contains the compiled classes as well as the necessary jar files in his freemind/plugins folder and that's all.
    Right now the external jars are in a lib folder in my plugin's source folder. I have added them to the project by using the Eclipse feature to add jars so I have no compilation problems. After I compile the thing I take the compiled folder and paste it in the freemind/plugins folder of the installed freemind in my system. I also paste there the plugins xml file. I startup freemind but when I try to start my plugin I get the class not found error.
    I could send you the compiled classes as well as the xml file to check it out if you give me your email address. I feel kind of reluctant to send you the source code.

     
  • Hi,,
    are the jar files annotated in the xml file as well? Look at /FreeMind_integration/plugins/ExportSvg.xml for example.

    My email is contained in the documentation map (freemind.mm).

    HTH, Chris

     
  • Hi,

    source code: be aware, that you are writing a plugin to a GPL software. Each delivery of your plugin (even company internal) is forcing you to publish the source code with your plugin. Please understand, that I refuse to help, if I get the impression that FreeMind's license is not obeyed.

    Chris

     
  • Hi,

    ok, perhaps, your plugin is currently not mature enough to be published, as one can think from your first post. Is that the case?
    Sorry, Chris

     
  • Tryfon
    Tryfon
    2010-07-13

    Yes Chris, that's exactly the case. I have barely started writing the documentation and I am not particularly proud for certain parts of my code. The whole thing is quite far from being called mature. Anyway if we don't find a solution I will probably send you the source.

    By the way if you give to somebody else your source code before having it published yourself you risk that he could publish it first and claim that he is the author. That's my only worry and it is not something personal of course but I am also working in an institution and sharing the code before the publication is not a decision which I can take only by myself.

     
  • Eric L.
    Eric L.
    2010-07-14

    Hello,

    just for the sake of correctness: even under GPL conditions, if you don't publish (make public) your plug-in, you are not obliged to release your code, i.e. as long as you only use it privately within your organization, you do whatever you want.
    But of course, under such conditions, Chris is free to be reluctant providing help (and I understand such a position).

    Eric

     
  • Tryfon
    Tryfon
    2010-07-14

    Thanks Eric.
    The code will be published as soon as I feel that it is ready to be published, something which I plan to be happening somewhere in the beginning of August. (First I have to refine the code, finish the documentation, prepare a website, host it in sourceforge.net etc)

     
  • Tryfon
    Tryfon
    2010-07-15

    Hi everyone,
    I wonder if it is possible for my plugin to listen to actions happening in the mindmap. I am interested particularly to be able to listen when the user adds or removes icons in mindmap nodes.

     
  • Hi,

    for icons: see  /FreeMind_integration/accessories/plugins/HierarchicalIcons.java for an example of listening to actions.
    HTH, Chris