archimatetool / archi

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

[Archi 5] Location of Archi data folders #880

Closed Phillipus closed 1 year ago

Phillipus commented 1 year ago

Location of Archi data folders

These are the current locations:

We propose to change these to:

We want to store only app settings in these locations such as:

.config
.metadata
dropins
canvasses.xml
models.xml
templates.xml

Directories that should be more accessible are:

jasper-reports
model-repository
scripts

So in fact this would require one change to Archi itself (jasper-reports) and one to coArchi (model-repository) and one to jArchi (scripts).

We could create these in a @user.home/Documents/Archi folder. Windows, Mac and Linux distros all seem to have a @user.home/Documents folder.

Alternate suggestions are welcome.

Phillipus commented 1 year ago

So in fact this would require one change to Archi itself (jasper-reports) and one to coArchi (model-repository) and one to jArchi (scripts).

Not true. At the moment the root location for Archi's data is derived from this in ArchiPlugin class:

public File getUserDataFolder()

This in fact returns getWorkspaceFolder(). So all we have to do is change the default location of getUserDataFolder() to @user.home/Documents/Archi and the locations of jasper-reports, model-repository and scripts will be changed too. In cases where getUserDataFolder() is being called to store internal data those cases can be replaced with getWorkspaceFolder(). In fact, that makes more sense.

Phillipus commented 1 year ago

@jbsarrodie From this point on when testing the latest code, your jasper templates, coArchi repos and jArchi scripts will be gone. :-) Copy them from @user.home/AppData/Roaming/Archi4 to @user.home/Documents/Archi

Phillipus commented 1 year ago

I've written a migrator so that the first time Archi 5 is run it will check if the default Archi4 folder exists and if it does copy all the files to the new target folders. If the Archi configuration does not use the default Archi4 folder names it won't migrate and the user will have to manually copy.