Home » Eclipse Projects » Sirius » Grayed diagram name when reopening aird(repon diagram)
Grayed diagram name when reopening aird [message #1829110] |
Thu, 25 June 2020 06:18  |
Eclipse User |
|
|
|
Hi, I'm having a strange behaviour with Sirius.
I designed a simple viewpoint with a couple of diagram representations, to display some xml files in a fancy way.
The xml files are constrained by an XSD that I transformed to .ecore, and then corresponding model/edit/editor.
I added some derived/transient/volatile references in order to easily handle name-based references in the XML.
When I create a new representation file for an xml file, I have absolutely no problem when creating diagrams, showing/removing elements from the diags, edition through property views, and saving.
If i close and then reopen the project, the aird will properly open, with the model tree.
BUT the diagrams names appear "grayed", and when I click them nothing happens.
No log, no console message, no stacktrace (even in runtime).
> see attached "Sirius_Gray.jpg" file.
I am using Obeo designer 11.1.1 / Sirius 6.1.1
How can I investigate this issues by Myself?
regards!
Franco
[Updated on: Thu, 25 June 2020 06:19] by Moderator
|
|
| | | | | |
Re: Grayed diagram name when reopening aird [message #1829141 is a reply to message #1829135] |
Thu, 25 June 2020 13:48   |
Eclipse User |
|
|
|
Hi Franco,
Thanks for letting me know.
I would say that the problem arises in this sense (qualified = false). If you take a look at the minimal example that I submitted you will see that also in the representations.aird the target reference is serialized as:
<target xmi:type="Family" href="sample.basicfamily#//@family"/>
and when I open the aird file with the reflective editor, in the properties view, the target reference appears empty.
In the basicfamily.ecore, if you change the qualified=true, generate a new model and a modelling project, you will see that the problem disappear. Of course, in this case, the target reference is serialized with a prefix as:
<target xmi:type="basicfamily:Family" href="example.basicfamily#//@family"/>
Kind regards,
Anthony
|
|
| | |
Re: Grayed diagram name when reopening aird [message #1829727 is a reply to message #1829711] |
Thu, 09 July 2020 10:29   |
Eclipse User |
|
|
|
Hi Anthony,
I'm sorry that I wasn't able to answer before. I had to switch to another activity and didn't finish the analysis o this issue.
However I tried what you proposed (thank you), but I was not able to open my ".xml" file anymore as a model since it was violating the need (from EMF) to have prefixes everywhere.
I didn't have time enough to create a sample model with the generated editor in order to see if it would be working on Sirius.
I keep believing that Sirius is doing something strange when loading the resource.
Why ?
#1st test
I have a model "A.dtp5g" that complies with an xsd and that can be read/write with the generated model/edit/editor plugins.
I created a second model "B.dtp5g" that has a reference to A.dtp5g (To do that i intentionally added a EReference in one of the metaclasses, since it is not possible in plain xml).
So in "B.dtp5g" i have a href referencing one element (with XPath syntax like //@blabla1@blibli.2)
When i Open B model, EMF immediately loads the A model, and I can see the reference in the property view, change it, and it is then properly saved & loaded.
#2nd test
If i take the same A.dtp5G and create its representation file (.aird);
I create a View (Diagram for instance), that displays elements from A.
When i save the .aird, and read it textually, I see the same reference that I was seeing in B file (of test #1).
BUT
> If i reopen the aird file the diagram name appears "grayed", and the DRepresentationDescriptorQuery#isDangling method returns true.
> If i open the aird file with the ecore reflexive editor, the reference seems not to be resolved; it remains empty in the property view; I can set a value but it won't be saved.
and a NPE is thrown if trying to validate the model (see my previous message).
As soon as I have time, I'll try
> either to set up an example to reproduce & study this issue..
> or look through your example to extend it in order to reproduce & study the issue
regards,
Franco
|
|
|
Re: Grayed diagram name when reopening aird [message #1829730 is a reply to message #1829727] |
Thu, 09 July 2020 12:19  |
Eclipse User |
|
|
|
Hi Franco,
Thanks for the answer. Let see if I can save you some time, because I think that I found a solution. Indeed, it is related to how Sirius load the resources, because Sirius does not know that we are using ExtendedMetadata right? So, I would say that we should do this explicitly.
I just made a new extension point "org.eclipse.emf.ecore.extension_parser" with the type aird and create a class. This class is the same as AirDResourceFactory. The only addition I made was in the method setOptions:
// TODO Support the XML Metadata
ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE));
extendedMetaData.putPackage(null, basicfamilyPackage.eINSTANCE);
loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
//TODO
This example works for the basicfamily example.
Hope that helps.
Kind regards,
Anthony
|
|
|
Goto Forum:
Current Time: Wed Jul 23 15:45:46 EDT 2025
Powered by FUDForum. Page generated in 0.04677 seconds
|