Bug 441761 - Support semantic resource renaming from the workspace
Summary: Support semantic resource renaming from the workspace
Status: ASSIGNED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: Next   Edit
Assignee: Jessy Mallet CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-08-14 05:10 EDT by Pierre-Charles David CLA
Modified: 2019-02-22 09:19 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2014-08-14 05:10:05 EDT
1. Create a session (modeling project or not), with a semantic file and a representation. 
2. Rename the semantic model: representation elements and representation are lost. 

We should provide a rename participant to report name changes on semantic model files. Note thaht it should work on save , unsaved , opened or closed sessions.

I believe both Esteban and Cedric have prototypes for this, developed independently.
Comment 1 Stéphane Thibaudeau CLA 2014-09-19 06:00:28 EDT
Bonus points if we were able to handle resources deletion too.

I have an example with 1 aird file referencing another one.
When the second aird file is deleted, the reference is not removed from the first one. Then the project can not be reloaded until one manualy removes the reference in the aird file.
Comment 2 Maxime Porhel CLA 2014-09-30 09:16:49 EDT
Bug 445468 looks like Stephane's bonus point. 

I do not mark it as duplicate of this as it could allow to explicitly deal with deletion and move of aird and semantic files whereas the current bug (bug 441761) will deal with the rename participants.
Comment 3 Cedric Brun CLA 2014-09-30 10:42:59 EDT
I coded a proof of concept plugin with a slightly broader scope (any model managed by Sirius- even model referenced by the semantic resources was managed through Move and Rename participants.

I will try to cleanup the code a bit, reduce the scope to only the models referenced by .aird files and publish it in a patch. The nice thing is that it can be done in its own plugin and then could be an "opt in" option while we consider this experimental.
Comment 4 Jessy Mallet CLA 2014-12-18 09:31:48 EST
After renaming an ecore model in some cases, two ecore models are generated.

Steps to reproduce :
Test case 1 :
1. Create a modeling project
2. add an ecore model and set the "Design" viewpoint
3. rename the ecore model 
4. Make an undo
Test case 2 :
1. In project A, Add the B.ecore model
2. Rename B.ecore
3. Make an undo

Moreover after moving an ecore model, two ecore models are also generated.

Steps to reproduce :
Test case 3 :
1. Create a modeling project
2. add an ecore model and set the "Design" viewpoint
3. create a folder
4. move the ecore model in the folder
5. Make an undo
Test case 4 :
1. In project A, Add the B.ecore model
2. Create a sub folder
3. Move the B.ecore in the sub project
4. Make an undo
Comment 5 Cedric Brun CLA 2016-08-01 08:06:25 EDT
I could not find time to investigate this further, here is a proof of concept I drafted when this bug was tracked.

https://github.com/cbrun/org.eclipse.sirius/commits/workspace_consistency
Comment 6 Eclipse Genie CLA 2018-07-24 11:56:30 EDT
New Gerrit change created: https://git.eclipse.org/r/126565