archimatetool / archi

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

[Feature Request] Set Default Folder for new objects #281

Open rich-biker opened 7 years ago

rich-biker commented 7 years ago

Background New objects are created in their 'home' folder (Strategy, Business, Application etc). To be tidy I like to move them around to named subfolders (by object type, project etc). This often involves the excellent Search -> Filter Options to chose all objects of a certain type to move them around. Maybe everyone is ok to do this?

Feature Suggestion I've noticed some tools offer a folder right-click to 'set as default'. So that from then on, any new objects are created into that folder. Obviously you need a 'Set it to default home folder'.

peterprib commented 6 years ago

Have the same issue about folder but my solution would be to have a new property on a folder which is filter based on regex string. When object is created or changed from default name then if only one match auto moved. If more than one match is list of targets presented. If rename then I not sure if it should subjected to same logic but could be made a preference.

rich-biker commented 5 years ago

Now we have jArchi, it is now possible to run scripts to move objects into a folder after it's been created. I've created a script that does this by element type, but I do like to organise my elements by what they represent. My problem is that when I'm modelling on the fly, my elements are all over the place in their tool default locations and I'd like to pre-empt this.

Phillipus commented 5 years ago

Simple "default" folder logic:

set "default" attribute on a Folder when calling getDefaultFolderForElement() look for this attribute if found use it, if not use top folder for that type

Anything more complicated such as rules based, regex, what they represent, etc would be more complex to implement and take some time.

jbsarrodie commented 5 years ago

Simple "default" folder logic: set "default" attribute on a Folder when calling getDefaultFolderForElement() look for this attribute if found use it, if not use top folder for that type

That might be a good start and would answer some use-cases. But this "default" attribute might not be persisted in the model itself. I see this more as a per-user attribute, meaning that it should be stored in the preferences file of the local Archi setup.

rich-biker commented 5 years ago

And you'd have to worry about defaulting into the wrong domain area. For example, if the nominated default was under the Business top level, Technology elements shouldn't go there.

Phillipus commented 5 years ago

But what would be stored in the prefs file? The folder path?

Each default folder might be different per model. I might have a folder "My Folder" that I want to set as default for Business elements in one model. But another model might have a folder called "That Folder" for default.

Phillipus commented 5 years ago

If stored in Prefs would have to be something like:

DefaultBusinessFolder=/SubFolder/My Folder DefaultApplicationFolder=/SubFolder/Another Folder DefaultTechnologyFolder= DefaultViewsFolder=/My Views

And also if default folder doesn't exist would have to create it (and any parent folders if a sub-folder) when adding a new element from the Palette. And also check for its existence, and add UI to manage default folders...

(Needs to be well thought out first!)