Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTo] UnitResolverFactory weiredness
[QVTo] UnitResolverFactory weiredness [message #856161] Wed, 25 April 2012 12:22 Go to next message
Eclipse UserFriend
Hello,

when using QVTo transformations programmatically, the method
InternalTransformationExecutor.doLoad() executes this code:

UnitProxy unit = UnitResolverFactory.Registry.INSTANCE.getUnit(fURI);
if (unit == null) {
/* ... cause error and return */
}

So obviously a UnitResolverFactory must be there which handles the input
URI (specifying the *.qvto script). However, the default
UnitResolverFactory which is present is the EclipseUnitResolverFactory,
does not accept my URI.

What I did now is I wrote my own

public class MyUnitResolverFactory implements UnitResolverFactory...

and registered it at the org.eclipse.m2m.qvt.oml.unitResolverFactory
extension point. However, while that works, I'm extending a private
interface so it's a bit shady.

What is the recommended way for this to "just work", be it in a runtime
workbench or not? The same question was asked here, but was never
answered: http://www.eclipse.org/forums/index.php/t/238973/

Thanks
Marius
Re: [QVTo] UnitResolverFactory weiredness [message #856178 is a reply to message #856161] Wed, 25 April 2012 12:44 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You haven't provided your URI so it is difficult to tell whether

your URI is bad
the QVTo code is bad
the QVTo interface should be public

Regards

Ed Willink

On 25/04/2012 13:22, Marius Gröger wrote:
> Hello,
>
> when using QVTo transformations programmatically, the method
> InternalTransformationExecutor.doLoad() executes this code:
>
> UnitProxy unit = UnitResolverFactory.Registry.INSTANCE.getUnit(fURI);
> if (unit == null) {
> /* ... cause error and return */
> }
>
> So obviously a UnitResolverFactory must be there which handles the input
> URI (specifying the *.qvto script). However, the default
> UnitResolverFactory which is present is the EclipseUnitResolverFactory,
> does not accept my URI.
>
> What I did now is I wrote my own
>
> public class MyUnitResolverFactory implements UnitResolverFactory...
>
> and registered it at the org.eclipse.m2m.qvt.oml.unitResolverFactory
> extension point. However, while that works, I'm extending a private
> interface so it's a bit shady.
>
> What is the recommended way for this to "just work", be it in a runtime
> workbench or not? The same question was asked here, but was never
> answered: http://www.eclipse.org/forums/index.php/t/238973/
>
> Thanks
> Marius
Re: [QVTo] UnitResolverFactory weirdness [message #856249 is a reply to message #856178] Wed, 25 April 2012 13:51 Go to previous messageGo to next message
Eclipse UserFriend
On 25.04.2012 14:44, Ed Willink wrote:
> Hi
>
> You haven't provided your URI so it is difficult to tell whether
>
> your URI is bad
> the QVTo code is bad
> the QVTo interface should be public

Well it's a normal platform URI, generated by
URI.createPlatformPluginURI(). It looks like this:

platform:/plugin/my.plugin.com/adir/transform.qvto

Again: if I simply squeeze in a custom UnitFactoryResolver that looks
exactly like the UnitResolverFactory.BasicRegistry it works. My only
problem is that this registry is not registered when running the debug
workbench, and that I have to hack it into it using the
org.eclipse.m2m.qvt.oml.unitResolverFactory EP.

Regards,
Marius
Re: [QVTo] UnitResolverFactory weirdness [message #856264 is a reply to message #856249] Wed, 25 April 2012 14:05 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

See my answer on the "how to run qvto stand-along" thread.

Support for platform: URIs is automatic whehn running in Eclipse; they
are a user responsibility when running standalone.

(Your URI is probably bad in the way that you are using it. Given a
suitable URI mapping, the existing QVTo code may work fine.)

Regards

Ed Willink

On 25/04/2012 14:51, Marius Gröger wrote:
> On 25.04.2012 14:44, Ed Willink wrote:
>> Hi
>>
>> You haven't provided your URI so it is difficult to tell whether
>>
>> your URI is bad
>> the QVTo code is bad
>> the QVTo interface should be public
> Well it's a normal platform URI, generated by
> URI.createPlatformPluginURI(). It looks like this:
>
> platform:/plugin/my.plugin.com/adir/transform.qvto
>
> Again: if I simply squeeze in a custom UnitFactoryResolver that looks
> exactly like the UnitResolverFactory.BasicRegistry it works. My only
> problem is that this registry is not registered when running the debug
> workbench, and that I have to hack it into it using the
> org.eclipse.m2m.qvt.oml.unitResolverFactory EP.
>
> Regards,
> Marius
Previous Topic:[QVTO] advice needed for large models
Next Topic:[qvto]how to run qvto stand-along
Goto Forum:
  


Current Time: Fri Apr 19 20:21:12 GMT 2024

Powered by FUDForum. Page generated in 0.04443 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top