Skip to content

Developing Import and Export Plug ins

Phil Beauvoir edited this page Aug 3, 2018 · 9 revisions

Creating Import and Export Plug-ins

To create a plug-in for Archi that allows you to export or import certain file types into or out of Archi take a look at the example plug-in, com.archimatetool.importexportexample in the source code. There are two classes, MyExporter.java and MyImporter.java that illustrate how to achieve this.

Tutorial - Creating an Export Plug-in

The simplest way to do this is to copy and modify the com.archimatetool.importexportexample plug-in:

  1. In Eclipse copy the com.archimatetool.importexportexample plug-in (found in the "other" folder) and give it a suitable name, for example "org.myorganisation.export"
  2. In Eclipse, view the project in the Package Explorer. It should look like the following:
  3. Delete the MyImporter.java class as we won't be needing it
  4. Open the plugin.xml file to edit it. Fill in the fields on the "Overview" tab as follows:
  5. On the "Extensions" tab of plugin.xml delete the com.archimatetool.editor.importHandler entry. Only one entry should remain for the extension point com.archimatetool.editor.exportHandler
  6. Also on the "Extensions" tab of plugin.xml edit the label to describe the format you wish to export to. For example "Model to HTML Format..."
  7. To test that it is working create a Launch configuration to Run Archi. See Running and Debugging Archi for details on how to set this up. Ensure that your plug-in is included on the list of plug-ins:
  8. Now Run Archi from Eclipse. Select a model in the Models Tree and then select the "File->Export" menu. You should see your plug-in's export menu item:
  9. If you select the menu item and provide a file name then the model should be saved in the format of a "*.mex" file using the format as defined in the MyExporter.java class
Clone this wiki locally