Empty viewpoint.getOwnedRepresentations() list in e4 application [message #1586094] |
Mon, 26 January 2015 12:06  |
Eclipse User |
|
|
|
Hello everyone,
I am currently working on a POC. My objective is to create a simple multi-view Eclipse RCP application enabling to load a semantic model (serialized with the standard XMI format) and display its contents as trees or diagrams or tables. I have defined the corresponding representations in Sirius's graphical .odesign editor, as explained in the 4-minute tutorial.
But in the Activator class of my design plugin (generated by Sirius at design project creation), after the following line is executed :
viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN_ID + "/description/proto.odesign"));
then viewpoints contains only one Viewpoint object (as expected), but getOwnedRepresentations() returns an empty EList.
I don't understand why, because I defined 4 representations in my .odesign file.
I have exactly the same problem when I try to load a .aird file using SessionManager.INSTANCE.getSession() : getOwnedRepresentations() of every DView is empty.
What did I miss ?
Here are the first lines of my .odesign file (after replacing // with ||) :
<?xml version="1.0" encoding="UTF-8"?>
<description:Group xmi:version="2.0" xmlns:xmi="http:||www.omg.org/XMI" xmlns:xsi="http:||www.w3.org/2001/XMLSchema-instance" xmlns:description="http:||www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http:||www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:description_2="http:||www.eclipse.org/sirius/tree/description/1.0.0" xmlns:description_3="http:||www.eclipse.org/sirius/table/description/1.1.0" xmlns:style="http:||www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:tool="http:||www.eclipse.org/sirius/diagram/description/tool/1.1.0" xmlns:tool_1="http:||www.eclipse.org/sirius/description/tool/1.1.0" name="proto" version="8.1.0">
<ownedViewpoints name="myViewpoint" modelFileExtension="proto">
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="proto.positions" label="Positions" titleExpression="Positions" initialisation="true" showOnStartup="true" domainClass="proto.Container">
<metamodel href="../../proto.model/model/proto.ecore#/"/>
<metamodel href="../../proto.model/model/proto.ecore#//package1"/>
<metamodel href="../../model/model/proto.ecore#//package2"/>
<metamodel href="../../proto.model/model/proto.ecore#//package3"/>
<defaultLayer name="Default">
[Updated on: Thu, 29 January 2015 09:28] by Moderator
|
|
|
Re: Empty viewpoint.getOwnedRepresentations() list [message #1589741 is a reply to message #1586094] |
Wed, 28 January 2015 11:25   |
Eclipse User |
|
|
|
Le 26/01/2015 21:17, Francois Cabrol a écrit :
> Hello everyone,
>
Hi,
> I am currently working on a POC. My objective is to create a simple
> multi-view Eclipse RCP application enabling to load a semantic model
> (serialized with the standard XMI format) and display its contents as
> trees or diagrams or tables. I have defined the corresponding
> representations in Sirius's graphical .odesign editor, as explained in
> the 4-minute tutorial.
>
> But in the Activator class of my design plugin (generated by Sirius at
> design project creation), after the following line is executed :
>
> viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN_ID
> + "/description/proto.odesign"));
> then viewpoints contains only one Viewpoint object (as expected), but
> the ownedRepresentations list of this object is null.
>
> I don't understand why, because I defined 4 representations in my
> .odesign file.
I don't understand either. If you debug in the method
org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.registerFromPlugin(String)
,is the root object (a group) contained your Viewpoint (reference
ownedViewpoints) and is this viewpoint contained your representations
(reference ownedRepresentations)?
Is there any error in the error log view?
>
> What did I miss ?
>
> Here are the first lines of my .odesign file (after replacing // with
> ||) :
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <description:Group xmi:version="2.0" xmlns:xmi="http:||www.omg.org/XMI"
> xmlns:xsi="http:||www.w3.org/2001/XMLSchema-instance"
> xmlns:description="http:||www.eclipse.org/sirius/description/1.1.0"
> xmlns:description_1="http:||www.eclipse.org/sirius/diagram/description/1.1.0"
> xmlns:description_2="http:||www.eclipse.org/sirius/tree/description/1.0.0"
> xmlns:description_3="http:||www.eclipse.org/sirius/table/description/1.1.0"
> xmlns:style="http:||www.eclipse.org/sirius/diagram/description/style/1.1.0"
> xmlns:tool="http:||www.eclipse.org/sirius/diagram/description/tool/1.1.0" xmlns:tool_1="http:||www.eclipse.org/sirius/description/tool/1.1.0"
> name="proto" version="8.1.0">
> <ownedViewpoints name="myViewpoint" modelFileExtension="proto">
> <ownedRepresentations xsi:type="description_1:DiagramDescription"
> name="proto.positions" label="Positions" titleExpression="Positions"
> initialisation="true" showOnStartup="true" domainClass="proto.Container">
> <metamodel href="../../proto.model/model/proto.ecore#/"/>
> <metamodel href="../../proto.model/model/proto.ecore#//package1"/>
> <metamodel href="../../model/model/proto.ecore#//package2"/>
> <metamodel href="../../proto.model/model/proto.ecore#//package3"/>
> <defaultLayer name="Default">
>
Regards,
--
Laurent - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07323 seconds