Archi Forum

Discussion Boards => Archi Development => Topic started by: jarzebina on July 15, 2021, 08:23:34 AM

Title: Parsing .archimate files and generating SVG
Post by: jarzebina on July 15, 2021, 08:23:34 AM
We'd like to use .archimate models created by Archi in a Spring Boot opensource project. We need an operation to parse archimate models and generate SVG. Are there any libraries to do this? In which Maven repository can we find them? Or perhaps is it possible to publish them from https://github.com/archimatetool/archi project? Can Eclipse-RCP plugins be used in a web project without Eclipse-RCP dependencies? Thank you in advance.
Title: Re: Parsing .archimate files and generating SVG
Post by: Phil Beauvoir on July 15, 2021, 08:34:26 AM
If you want to generate SVG diagrams from *.archimate files outside of Archi you'll find it difficult.

Archi's SVG generation works like this:

1. Load the model into the EMF (Eclipse Modelling Framework) the create a GEF (Graphical Eclipse Framework) / Draw2d GraphicalViewer with EditParts and Figures
2. Get the root printable Figure layer
3. Draw this Figure onto a Graphics instance in order to convert to SVG via Batik and other libraries

You'll need all of the Archi code and its Eclipse dependencies to do this.

Take a look here - https://github.com/archimatetool/archi/tree/master/com.archimatetool.export.svg

Another potential option is to use jArchi which can run standalone via the ACLI and that could generate SVG files from models. However, we haven't implemented the SVG exporter in jArchi until the next version.

Another possibility is to generate SVG diagrams from a model that is in the Open Exchange Format. Of course, you'd have to write your own parser and generator but it can be done and some people have done this.

Short answer - there are no standalone libraries.