0

I have a Java application which uses Sirius to model some nodes and diagrams.

I have two questions:

1. How I can export these diagrams as an XML/JSON? Is it possible to export some nodes of the diagram only? Please see the attached screenshot. For example, I want to export the node "DataRetentionPeriod" as a JSON. What is the required code and where I should insert it?

2. Can I use Post and Get commands of Liferay to export a diagram or some nodes of the Sirius files. I know that by right clicking on the modelling editor of the Sirius file I can export the diagram as an image. Can I add an option, similar to export an image, to export or call another function which can create endpoints or connection to a database? see the attach screenshot please.

A screenshot of the Sirius odesign file

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
M.Ghazi
  • 1
  • 1
  • Please enter two questions as two questions: One of them is probably answerable by people who know Sirius, while the other is answerable by people who know Liferay. I assume there's not too much overlap to get a satisfying answer for both questions. However, the questions are also very broad and generic: What have you tried already? See https://stackoverflow.com/help/how-to-ask – Olaf Kock Mar 06 '20 at 08:48

1 Answers1

0
  1. The diagram is already an XML file (or more precisely, an XMI). Open the .aird file with any text editor. Note that the aird represents only the "drawing" element while you may be interested in the underlying "semantic" element (usually an XMI model conforming to your Ecore metamodel). https://www.eclipse.org/sirius/doc/ may help

  2. You want to have a look at Eclipse Commands which allow you to enhance your RCP application with additional menus, menu entries, etc. Vogella.com has a lot of tutorials about this that should help you. Then you can do any behavior, like transforming a model element in an appropriate JSON and upload it to your database.

user1292456
  • 778
  • 4
  • 12