archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
955 stars 268 forks source link

[Feature request] Create a viewpoint #833

Open foxfoox opened 2 years ago

foxfoox commented 2 years ago

There are many viewpoints that can exist so if there is a mechanism that enables a custom view to be created. I've seen a glimpse of the source code like Viewpoint, IViewpoint, ViewpointAction, and there is a nice structure in Archi that makes it flexible. I'm a programmer in Java and maybe I can work with you, it's a great feature to add.

Phillipus commented 2 years ago

The main issue around this is where to store the Viewpoint definition. To be portable, it has to be stored somehow inside the model file. But it also needs to be stored somewhere outside the model so it can be re-used.

foxfoox commented 2 years ago

What do you suggest solutions?

Phillipus commented 2 years ago

What do you suggest solutions?

I don't have any solutions yet, that's why I haven't implemented it. This feature is low priority so I won't be thinking about it at the moment.

foxfoox commented 2 years ago

Viewpoints are parts of AD (architecture description) and can be in the model file (it is rational). For export to other models they may be separate files with the same syntax (XML). I don't read the code clearly but I think there is a way. This feature will make a small change but the great ability will be enabled. I can involve in enabling this feature.

Phillipus commented 2 years ago

You can create custom Viewpoints now by editing the viewpoints.xml file. You can share that file with others if you want to.

jbsarrodie commented 2 years ago

Hi,

My 2cts on this:

This means that implementing customizable viewpoints in Archi is a really big topic.

In the meantime, there's a trick I use to customize viewpoints: I create a lang plugin which sole purpose is to replace the viewpoints.xml file (discussed a bit in this issue). I even created an automated way to create such plugins using a model as input and a jArchi script. I plan to enhance it and share it someday (need some work, so not for the near future).

foxfoox commented 2 years ago

Yes, It is not just restrictions on concepts but Modeling tools such as Archi, it is concerned about how the modeling will be for the intended purpose. Other things shall be described elsewhere outside the Archi.

foxfoox commented 2 years ago

Another thing, I tried to add relationships in the viewpoint but it did not work. Is it allowable to be within viewpoint tags?.

Phillipus commented 2 years ago

Another thing, I tried to add relationships in the viewpoint but it did not work. Is it allowable to be within viewpoint tags?.

No. At the moment, all relationships are allowed in every Viewpoint. Maybe we'll change that one day,

WatchTh1 commented 2 years ago

You can create custom Viewpoints now by editing the viewpoints.xml file. You can share that file with others if you want to.

Could it be solved as following:

  1. Create singleton ViewPointsStorage object.
  2. Basic init of this object is done from viewpoints.xml within basic distro,\
  3. Model can store viewpoint definition as extension of certain object of viewpoints.xml .
  4. Viewpoints could be copied within single instance of Archi between models.

Also maybe in this solution there could be done custom concept definitions inside a viewpiont definition, as proposed at 42010.

jbsarrodie commented 1 year ago

Hi,

Reacting on #942

Some companies don't allow modifying the program files, of which the viewpoints.xml. Might be interesting to allow user defined viewpoints, defined in a viewpoints.xml stored in user files.

There's a better way to modify this file without admin right: launch Archi with a custom language (even one which doesn't exist, such as custom) and create a translation plugin for this language containing only a custom version of the viewpoint.xml file.

That's what I'm doing for my colleagues and it works just fine. I even setup a method for that: I document my viewpoints in a model, then a script generate the plugin based on the model and some metadata.

guillermofuentesuclm commented 10 months ago

Hello! I have been working on a viewpoints importer using an XML file, which is then saved into a viewpoint_custom.xml within the tool. With this, it is possible to share the viewpoint, and furthermore, it is also stored within the tool. Is this something that could be considered for inclusion in Archi?

screenshot

jbsarrodie commented 10 months ago

Is this something that could be considered for inclusion in Archi?

It depends on how it has been implemented, but yes, this is the kind of feature that could be added. (Btw, there's some way to import viewpoints using a translation/localization plugin).

Could you share the code somewhere ?

guillermofuentesuclm commented 10 months ago

It depends on how it has been implemented, but yes, this is the kind of feature that could be added. (Btw, there's some way to import viewpoints using a translation/localization plugin).

I follow the same basic structure for the viewpoints as Archi, so their names could be translated. Here's an example:

<?xml version="1.0" encoding="UTF-8"?>

Test Location Grouping

Could you share the code somewhere ?

Yes, of course, you can check it here. This is a first version of the development, and I'm willing to refactor and improve it in order to incorporate the feature

guillermofuentesuclm commented 10 months ago

Could you share the code somewhere ?

What do you think about code?

Phillipus commented 10 months ago

Could you share the code somewhere ?

What do you think about code?

Thanks for sharing. I need more time to think about how best to implement this.