Empty viewpoint.getOwnedRepresentations() list in e4 application [message #1586094] |
Mon, 26 January 2015 17:06 |
Francois Cabrol Messages: 32 Registered: January 2015 |
Member |
|
|
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 14:28] Report message to a moderator
|
|
|
Re: Empty viewpoint.getOwnedRepresentations() list [message #1589741 is a reply to message #1586094] |
Wed, 28 January 2015 16:25 |
|
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
Laurent Redor - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Re: Empty viewpoint.getOwnedRepresentations() list in an e4 application [message #1591624 is a reply to message #1591383] |
Thu, 29 January 2015 16:54 |
|
Le 29/01/2015 14:54, Francois Cabrol a écrit :
> I forgot to explain that my POC is an e4 application. I just realized
> that if I try to deploy my design plugin in a e3 application, then the
> viewpoint.getOwnedRepresentations() list contains the expected
> representations.
> The problem is that when I include my design plugin in an e4 product,
> the behaviour of this method is not the same, and no error message
> appears (neither in a console nor in the error log).
> Is it a known problem ?
No. Are you sure that diagram plugins are available in your e4
application? Indeed the Group and the Viewpoint are concept defined in
the core plugins but Diagram representations are defined in another MM
part not in the core plugins.
Are there any successful examples of e4
> applications using Sirius ?
Obeo Designer is an application based on Sirius and on Eclipse Luna.
--
Laurent - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Laurent Redor - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25137 seconds