Author Topic: Update IArchimateModel  (Read 1294 times)

jucanoma

  • Member
  • **
  • Posts: 16
Update IArchimateModel
« 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?

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1501
  • Archi Guy
    • Archi
Re: Update IArchimateModel
« Reply #1 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!
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

jucanoma

  • Member
  • **
  • Posts: 16
Re: Update IArchimateModel
« Reply #2 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

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1501
  • Archi Guy
    • Archi
Re: Update IArchimateModel
« Reply #3 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.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

jucanoma

  • Member
  • **
  • Posts: 16
Re: Update IArchimateModel
« Reply #4 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

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1501
  • Archi Guy
    • Archi
Re: Update IArchimateModel
« Reply #5 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.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

jucanoma

  • Member
  • **
  • Posts: 16
Re: Update IArchimateModel
« Reply #6 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