[QVTo] UnitResolverFactory weiredness [message #856161] |
Wed, 25 April 2012 08:22  |
Eclipse User |
|
|
|
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 08:44   |
Eclipse User |
|
|
|
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 #856264 is a reply to message #856249] |
Wed, 25 April 2012 10:05  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04424 seconds