Changes between Version 1 and Version 2 of BuildASimplePlugin


Ignore:
Timestamp:
24.07.2011 01:53:00 (9 years ago)
Author:
jri
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildASimplePlugin

    v1 v2  
    11= Build a simple plugin = 
    22 
    3 This page describes how you can build a very simple plugin. This demo plugin just creates a new topic type. 
     3This page describes how you can build a very simple DeepaMehta plugin. This demo plugin just creates a new topic type. 
    44 
    55Once installed in DeepaMehta the topic type will appear in the create menu, so you can create instances. 
     
    1919== Setup the directory structure == 
    2020 
     21A DeepaMehta plugin project adheres to a certain directory structure and file name conventions. 
     22 
     23Setup a directory structure as follows: 
     24 
    2125{{{ 
    2226demo-plugin-1/ 
     
    2933                plugin.properties 
    3034}}} 
     35 
     36Create the file `pom.xml` with this content: 
     37 
     38{{{ 
     39<project> 
     40    <modelVersion>4.0.0</modelVersion> 
     41 
     42    <name>DM4 Demo Plugin 1</name> 
     43    <groupId>de.deepamehta.demo-plugins</groupId> 
     44    <artifactId>dm4-demo-plugin-1</artifactId> 
     45    <version>4.0.RC1</version> 
     46    <packaging>bundle</packaging> 
     47 
     48    <parent> 
     49        <groupId>de.deepamehta</groupId> 
     50        <artifactId>deepamehta-plugin-parent</artifactId> 
     51        <version>4.0.RC1</version> 
     52    </parent> 
     53 
     54    <repositories> 
     55        <repository> 
     56            <id>deepamehta-public-repository</id> 
     57            <url>http://www.deepamehta.de/maven2</url> 
     58        </repository> 
     59    </repositories> 
     60</project> 
     61}}} 
     62 
     63Create the file `migration1.json`: 
     64 
     65{{{ 
     66{ 
     67    topic_types: [ 
     68        { 
     69            value: "My Topic Type", 
     70            uri: "domain.dm4_demo_plugins.my_topic_type", 
     71            data_type_uri: "dm4.core.text", 
     72            index_mode_uris: ["dm4.core.fulltext"], 
     73            view_config_topics: [ 
     74                { 
     75                    type_uri: "dm4.webclient.view_config", 
     76                    composite: { 
     77                        dm4.webclient.add_to_create_menu: true 
     78                    } 
     79                } 
     80            ] 
     81        } 
     82    ] 
     83} 
     84}}} 
     85 
     86Create the file `plugin.properties`: 
     87 
     88{{{ 
     89requiredPluginMigrationNr = 1 
     90importModels = de.deepamehta.webclient 
     91}}} 
     92