Archi Forum

Archi => Archi Development => Topic started by: jucanoma on October 02, 2017, 19:13:07 PM

Title: Update IArchimateModel
Post by: jucanoma on October 02, 2017, 19:13:07 PM
Hi everybody
I'm working in a plugin to exlude some folders in the html report. Is there a way to update the EList of IFolder of the object IArchimateModel model who came in the event of the exporter?
Title: Re: Update IArchimateModel
Post by: Phil Beauvoir on October 02, 2017, 19:22:41 PM
I don't understand what you are trying to do. What do you mean by "update the EList of IFolder of the object IArchimateModel model". Do you mean you want to change the model itself? If so, that would not be a good idea!
Title: Re: Update IArchimateModel
Post by: jucanoma on October 02, 2017, 19:57:51 PM
Hi PB,
I have a wizard with one page. In the wizard I put a CheckedTreeSelectionDialog to show the folders of the model. The user select the folders he doesn't want to show in the report and after that he have to select the folder of the file system where the report is going to be written. To write the report I use some of the functionalities of the HTML report and I added a funcionality to read the selected folders and not write them in the report. It works well but when I use de libraries of org.stringtemplate.v4.ST.* it write the entire tree of the model. The selected view (of the wizard) is not available because I filtered and doesn't write it but I want to know if it's possible to delete some folders/views when I write the index.html. I thought I could update the IArchimateModel because it's the input of the writer.
Regards,
Juan
Title: Re: Update IArchimateModel
Post by: Phil Beauvoir on October 03, 2017, 10:35:16 AM
I would definitely advise against removing objects/folders from the model itself. This is dangerous.

However, the ST template files process the IArchimateModel and its contents so it seems to me you have a choice:

- Make a copy of the model with objects removed and process that (See EcoreUtil copy routines)

or

- Somehow save references to the objects/folders (perhaps their IDs) that you want to ignore and then edit the ST file to check against this list. The list could be a Java List that is added to the ST objects in code.
Title: Re: Update IArchimateModel
Post by: jucanoma on October 04, 2017, 14:13:50 PM
Hi PB
I have the ID's of the object I want to exclude but I don't understand how to edit the ST file against this list?
If I make a copy of the model, is there any way to find the objects in the copy and remove them easily?
Thks for your help,
Regards
Juan
Title: Re: Update IArchimateModel
Post by: Phil Beauvoir on October 04, 2017, 14:24:22 PM
I'm not sure deleting objects from a copy is a good idea either. It could get complicated if these are elements connected to relationships and appearing in views that you want to display in the report.

I'm not an expert on the ST stuff, to be honest. If I was going to do this, I think I would have to hack it by trial and error. Sorry I can't be more helpful.
Title: Re: Update IArchimateModel
Post by: jucanoma on October 04, 2017, 14:41:02 PM
No worries. Thx for your help PB.
for the moment, I filter when I generate the images of the diagrams and the only thing of these is that it appears in the HTML menu, but when I click it the ressource doesn't exist. It works for the moment.
I have another question. I generate the jar file and put it on the plugins folder. I run the Archi and I se the new menu, it show me the new wizard but when I select Finish in the wizard it doesn't do anything. When I run it in eclipse it works fine. Is there a way to run Archi in debug mode and see some logs?
Regards
Juan