Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Sirius integration with EMFStore
Sirius integration with EMFStore [message #1389379] Fri, 27 June 2014 14:20 Go to next message
Olivier Labrosse is currently offline Olivier Labrosse
Messages: 46
Registered: November 2011
Member
Hi,

We're trying to convert our XMI file-based app into an ECP/EMFStore app, but I'm getting Sirius issues (pardon the pun) with regards to the emfstore URI that the semantic resource now has.

At first I tried getting the SessionManager to create the Session in the EMFStore, but it failed due to the TransactionalEditingDomain's ResourceSet not having a URIConverter that supports emfstore URIs. I resorted to keeping the .aird file saved in the workspace for now; the Session gets created fine.

Then comes the time to add the semantic resource to the Session. Again the emfstore URI causes issues. Even if I "hack" the Session's URIConverter (basically set it to that of the semantic resource), createInputStream() fails due to a lack of URLStreamHandler handling the emfstore protocol. Here's the stack trace:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.net.MalformedURLException: unknown protocol: emfstore
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.addSemanticResource(DAnalysisSessionImpl.java:731)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.addSemanticResource(DAnalysisSessionImpl.java:744)
	at com.castortech.ba.sirius.BaSiriusUtils$1.run(BaSiriusUtils.java:73)
	at com.castortech.ba.sirius.BaSiriusUtils.runInTransaction(BaSiriusUtils.java:123)
	at com.castortech.ba.sirius.BaSiriusUtils.getSession(BaSiriusUtils.java:69)
	...
Caused by: java.net.MalformedURLException: unknown protocol: emfstore
	at java.net.URL.<init>(URL.java:592)
	at java.net.URL.<init>(URL.java:482)
	at java.net.URL.<init>(URL.java:431)
	at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.createInputStream(URIHandlerImpl.java:199)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	... 56 more


I need a little hand understanding what can be done to make it all work nicely. Any help will be much appreciated.

Best regards,

-Olivier
Re: Sirius integration with EMFStore [message #1391097 is a reply to message #1389379] Mon, 30 June 2014 08:41 Go to previous message
Florian Barbin is currently offline Florian Barbin
Messages: 25
Registered: August 2010
Junior Member
Hi Olivier,

Having taken a look at EMFStore project, it seems that it provides its
own URIConverter
(org.eclipse.emf.emfstore.internal.client.provider.XMIClientURIConverter) when
creating its Resourceset. The emfstore protocol seems to be handled by
this URIConverter. In the Sirius context, the session uses its own
resourceset with a specific URIConverter so the EMFStore URIConverter is
never installed.

You could provides your own
org.eclipse.sirius.common.tools.api.resource.ResourceSetFactory and
install a specific URIConverter for emfstore URIs. That has already been
done before, to integrate XText with Sirius. You should take a look on
org.eclipse.sirius.common.xtext.internal.XtextResourceSetFactory which
is registered in org.eclipse.sirius.common.xtext:
<extension
point="org.eclipse.sirius.common.resourceSetFactory">
<factory

class="org.eclipse.sirius.common.xtext.internal.XTextResourceSetFactory">
</factory>
</extension>

An other solution could be providing your own protocol parser as it is
done with org.eclipse.sirius.tools.internal.uri.ViewpointProtocolParser.
See org.eclipse.emf.ecore.protocol_parser extension point for more details.

Regards,

Florian

On 06/27/2014 08:20 PM, Olivier Labrosse wrote:
> Hi,
>
> We're trying to convert our XMI file-based app into an ECP/EMFStore app,
> but I'm getting Sirius issues (pardon the pun) with regards to the
> emfstore URI that the semantic resource now has.
>
> At first I tried getting the SessionManager to create the Session in the
> EMFStore, but it failed due to the TransactionalEditingDomain's
> ResourceSet not having a URIConverter that supports emfstore URIs. I
> resorted to keeping the .aird file saved in the workspace for now; the
> Session gets created fine.
>
> Then comes the time to add the semantic resource to the Session. Again
> the emfstore URI causes issues. Even if I "hack" the Session's
> URIConverter (basically set it to that of the semantic resource),
> createInputStream() fails due to a lack of URLStreamHandler handling the
> emfstore protocol. Here's the stack trace:
>
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
> java.net.MalformedURLException: unknown protocol: emfstore
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
>
> at
> org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.addSemanticResource(DAnalysisSessionImpl.java:731)
>
> at
> org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.addSemanticResource(DAnalysisSessionImpl.java:744)
>
> at com.castortech.ba.sirius.BaSiriusUtils$1.run(BaSiriusUtils.java:73)
> at
> com.castortech.ba.sirius.BaSiriusUtils.runInTransaction(BaSiriusUtils.java:123)
>
> at
> com.castortech.ba.sirius.BaSiriusUtils.getSession(BaSiriusUtils.java:69)
> ...
> Caused by: java.net.MalformedURLException: unknown protocol: emfstore
> at java.net.URL.<init>(URL.java:592)
> at java.net.URL.<init>(URL.java:482)
> at java.net.URL.<init>(URL.java:431)
> at
> org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.createInputStream(URIHandlerImpl.java:199)
>
> at
> org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
>
> ... 56 more
>
>
> I need a little hand understanding what can be done to make it all work
> nicely. Any help will be much appreciated.
>
> Best regards,
>
> -Olivier

[Updated on: Mon, 30 June 2014 09:46]

Report message to a moderator

Previous Topic:Dynamic creation of layers
Next Topic:Can a Sirius modeler be available as plug-ins ?
Goto Forum:
  


Current Time: Wed Jul 23 22:34:14 EDT 2014

Powered by FUDForum. Page generated in 0.01628 seconds