Changes between Version 2 and Version 3 of PluginDevelopmentGuide


Ignore:
Timestamp:
06.04.2013 18:28:15 (12 years ago)
Author:
jri
Comment:

Setup for Hot-Deployment

Legend:

Unmodified
Added
Removed
Modified
  • PluginDevelopmentGuide

    v2 v3  
     1[[PageOutline]] 
     2 
    13= Plugin Development Guide = 
    24 
     
    1921}}} 
    2022 
    21 == A very simple plugin == 
     23== A very simple plugin: Tagging == 
    2224 
    2325Let's start with a very simple plugin. This plugin will just create a new topic type called `Tag`. Once the plugin is installed the topic type will appear in the DeepaMehta webclient's //Create// menu, so you can create instances. And you will be able to fulltext search for tags. 
     
    2628 
    2729Of course the topic type could be created interactively as well, by using DeepaMehta's type editor. However, being packaged as a plugin you can publish it. When other DeepaMehta users install your plugin they can use your type definitions. 
     30 
     31=== Create the plugin === 
    2832 
    2933You create the plugin just by creating directories and text files. A DeepaMehta plugin project adheres to a certain directory structure and file name conventions. 
     
    4347Create the file **`pom.xml`** with this content: 
    4448{{{ 
     49#!xml 
    4550<project> 
    4651    <modelVersion>4.0.0</modelVersion> 
     
    8489Create the file **`plugin.properties`**: 
    8590{{{ 
    86 requiredPluginMigrationNr = 1 
    87 importModels = de.deepamehta.webclient 
     91requiredPluginMigrationNr=1 
     92importModels=de.deepamehta.webclient 
    8893}}} 
     94 
     95=== Setup for Hot-Deployment === 
     96 
     97In order to let DeepaMehta hot-deploy the plugin you must include it in DeepaMehta's hot-deployment list. 
     98 
     99Add the line `/home/myhome/deepamehta-dev/dm4-tagging` to DeepaMehta's **`pom.xml`**. Impotant: append a comma to the previous line: 
     100{{{ 
     101#!xml 
     102<project> 
     103    ... 
     104    <felix.fileinstall.dir> 
     105        <![CDATA[ 
     106            ${project.basedir}/modules/dm4-core/target, 
     107            ... 
     108            ${project.basedir}/modules/dm4-storage-neo4j/target, 
     109            /home/myhome/deepamehta-dev/dm4-tagging 
     110        ]]> 
     111    </felix.fileinstall.dir> 
     112</project> 
     113}}} 
     114 
     115Now start DeepaMehta: 
     116{{{ 
     117cd deepamehta 
     118mvn pax:run 
     119}}} 
     120 
     121This starts DeepaMehta in development mode, that is with hot-deployment activated. The terminal gets occupied by the //Gogo// shell now. Type `lb` to see the list of deployed bundles. Your plugin does not yet appear in that list as it is not yet build. 
     122 
     123=== Build the plugin === 
     124 
     125In another terminal: 
     126{{{ 
     127cd dm4-tagging 
     128mvn clean package 
     129}}} 
     130 
     131This builds the plugin and hot-deploys it. 
     132