Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » How to combine Teneo with Jet?
How to combine Teneo with Jet? [message #63409] |
Fri, 01 December 2006 08:25 |
Eclipse User |
|
|
|
Originally posted by: kalin.nakov.gmail.com
Hello,
My application needs to generate code out of a very huge model
(thousands of classes). Since loading everything into memory is not an
option, I think Teneo will suit best. I am able to run JET
transformation in Java using Jet2Platform.runTransformOnResource() by
specifying a XMI file, but how can I run a Jet transformation on a
ResourceSet object?
I want to load the huge model from the database as a ResourceSet
(through EMF/JPOX resources) and then run a JET transformation.
Thanks in advance,
Kalin
|
|
| |
Re: How to combine Teneo with Jet? [message #63962 is a reply to message #63409] |
Thu, 07 December 2006 16:58 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Kalin:
Sorry, I didn't notice your post sooner...
You'll have to pardon my ignorance of Teneo details, I have only scanned the
tutorial, but here goes...
As you note, JET2Platform.runTransfornOnResource() works on an Eclipse
IResource, something you won't have if using Teneo. But all
JET2Platform.runTransformOnResource() does is load the EMF resource for the
IResource, and then pass the loaded EMF Resource off to the execution
engine.
Try the following:
1) Load the Teneo-based resource. Here's the snippet from the Teneo/JPOX
tutorial:
String uriStr = "jpox://?" + JPOXResource.DS_NAME_PARAM + "=MyPMF";
final URI uri = URI.createURI(uriStr);
ResourceSet resourceSet = new ResourceSetImpl();
final Resource res =
resourceSet.createResource(uri);res.load(Collections.EMPTY_M AP);2) Pass the
loaded resource to JET2Platform.runTransformOnObject();
JET2Platform.runTransformOnObject("...id", res, progressMonitor);
If Teneo delivers as promised, then JET should have not problem navigating
your model.
Paul
"Kalin Nakov" <kalin.nakov@gmail.com> wrote in message
news:ekoot3$5uq$1@utils.eclipse.org...
> Hello,
>
> My application needs to generate code out of a very huge model (thousands
> of classes). Since loading everything into memory is not an option, I
> think Teneo will suit best. I am able to run JET transformation in Java
> using Jet2Platform.runTransformOnResource() by specifying a XMI file, but
> how can I run a Jet transformation on a ResourceSet object?
>
> I want to load the huge model from the database as a ResourceSet (through
> EMF/JPOX resources) and then run a JET transformation.
>
> Thanks in advance,
> Kalin
|
|
|
Re: How to combine Teneo with Jet? [message #63985 is a reply to message #63962] |
Thu, 07 December 2006 20:13 |
Eclipse User |
|
|
|
Originally posted by: kalin.nakov.gmail.com
Thank you very much for the help, it works that way. One note - I just
had to define the org.eclipse.jet.resource.project.name variable when
using runTransformOnObject(), otherwise it throws exception for the
undefined variable.
Paul Elder wrote:
> Kalin:
>
> Sorry, I didn't notice your post sooner...
>
> You'll have to pardon my ignorance of Teneo details, I have only scanned the
> tutorial, but here goes...
>
> As you note, JET2Platform.runTransfornOnResource() works on an Eclipse
> IResource, something you won't have if using Teneo. But all
> JET2Platform.runTransformOnResource() does is load the EMF resource for the
> IResource, and then pass the loaded EMF Resource off to the execution
> engine.
>
> Try the following:
>
> 1) Load the Teneo-based resource. Here's the snippet from the Teneo/JPOX
> tutorial:
> String uriStr = "jpox://?" + JPOXResource.DS_NAME_PARAM + "=MyPMF";
> final URI uri = URI.createURI(uriStr);
> ResourceSet resourceSet = new ResourceSetImpl();
> final Resource res =
> resourceSet.createResource(uri);res.load(Collections.EMPTY_M AP);2) Pass the
> loaded resource to JET2Platform.runTransformOnObject();
>
> JET2Platform.runTransformOnObject("...id", res, progressMonitor);
>
> If Teneo delivers as promised, then JET should have not problem navigating
> your model.
>
> Paul
>
> "Kalin Nakov" <kalin.nakov@gmail.com> wrote in message
> news:ekoot3$5uq$1@utils.eclipse.org...
>> Hello,
>>
>> My application needs to generate code out of a very huge model (thousands
>> of classes). Since loading everything into memory is not an option, I
>> think Teneo will suit best. I am able to run JET transformation in Java
>> using Jet2Platform.runTransformOnResource() by specifying a XMI file, but
>> how can I run a Jet transformation on a ResourceSet object?
>>
>> I want to load the huge model from the database as a ResourceSet (through
>> EMF/JPOX resources) and then run a JET transformation.
>>
>> Thanks in advance,
>> Kalin
>
>
|
|
|
Re: How to combine Teneo with Jet? [message #64154 is a reply to message #63985] |
Fri, 08 December 2006 14:19 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Kalin:
Good to hear it worked - kudo's go to Teneo for that.
To predefine variables for a JET transformation, you can pass in a map:
Map variables = new HashMap();
variables.put("org.eclipse.jet.resource.project.name", ...);
JET2Platform.runTransformOnObject("... jet id ..", res, variables, ..
progress montitor ...);
Paul
"Kalin Nakov" <kalin.nakov@gmail.com> wrote in message
news:el9sma$m2e$1@utils.eclipse.org...
> Thank you very much for the help, it works that way. One note - I just had
> to define the org.eclipse.jet.resource.project.name variable when using
> runTransformOnObject(), otherwise it throws exception for the undefined
> variable.
>
> Paul Elder wrote:
>> Kalin:
>>
>> Sorry, I didn't notice your post sooner...
>>
>> You'll have to pardon my ignorance of Teneo details, I have only scanned
>> the tutorial, but here goes...
>>
>> As you note, JET2Platform.runTransfornOnResource() works on an Eclipse
>> IResource, something you won't have if using Teneo. But all
>> JET2Platform.runTransformOnResource() does is load the EMF resource for
>> the IResource, and then pass the loaded EMF Resource off to the execution
>> engine.
>>
>> Try the following:
>>
>> 1) Load the Teneo-based resource. Here's the snippet from the Teneo/JPOX
>> tutorial:
>> String uriStr = "jpox://?" + JPOXResource.DS_NAME_PARAM + "=MyPMF";
>> final URI uri = URI.createURI(uriStr);
>> ResourceSet resourceSet = new ResourceSetImpl();
>> final Resource res =
>> resourceSet.createResource(uri);res.load(Collections.EMPTY_M AP);2) Pass
>> the loaded resource to JET2Platform.runTransformOnObject();
>>
>> JET2Platform.runTransformOnObject("...id", res, progressMonitor);
>>
>> If Teneo delivers as promised, then JET should have not problem
>> navigating your model.
>>
>> Paul
>>
>> "Kalin Nakov" <kalin.nakov@gmail.com> wrote in message
>> news:ekoot3$5uq$1@utils.eclipse.org...
>>> Hello,
>>>
>>> My application needs to generate code out of a very huge model
>>> (thousands of classes). Since loading everything into memory is not an
>>> option, I think Teneo will suit best. I am able to run JET
>>> transformation in Java using Jet2Platform.runTransformOnResource() by
>>> specifying a XMI file, but how can I run a Jet transformation on a
>>> ResourceSet object?
>>>
>>> I want to load the huge model from the database as a ResourceSet
>>> (through EMF/JPOX resources) and then run a JET transformation.
>>>
>>> Thanks in advance,
>>> Kalin
>>
|
|
| |
Re: How to combine Teneo with Jet? [message #596623 is a reply to message #63409] |
Thu, 07 December 2006 16:58 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Kalin:
Sorry, I didn't notice your post sooner...
You'll have to pardon my ignorance of Teneo details, I have only scanned the
tutorial, but here goes...
As you note, JET2Platform.runTransfornOnResource() works on an Eclipse
IResource, something you won't have if using Teneo. But all
JET2Platform.runTransformOnResource() does is load the EMF resource for the
IResource, and then pass the loaded EMF Resource off to the execution
engine.
Try the following:
1) Load the Teneo-based resource. Here's the snippet from the Teneo/JPOX
tutorial:
String uriStr = "jpox://?" + JPOXResource.DS_NAME_PARAM + "=MyPMF";
final URI uri = URI.createURI(uriStr);
ResourceSet resourceSet = new ResourceSetImpl();
final Resource res =
resourceSet.createResource(uri);res.load(Collections.EMPTY_M AP);2) Pass the
loaded resource to JET2Platform.runTransformOnObject();
JET2Platform.runTransformOnObject("...id", res, progressMonitor);
If Teneo delivers as promised, then JET should have not problem navigating
your model.
Paul
"Kalin Nakov" <kalin.nakov@gmail.com> wrote in message
news:ekoot3$5uq$1@utils.eclipse.org...
> Hello,
>
> My application needs to generate code out of a very huge model (thousands
> of classes). Since loading everything into memory is not an option, I
> think Teneo will suit best. I am able to run JET transformation in Java
> using Jet2Platform.runTransformOnResource() by specifying a XMI file, but
> how can I run a Jet transformation on a ResourceSet object?
>
> I want to load the huge model from the database as a ResourceSet (through
> EMF/JPOX resources) and then run a JET transformation.
>
> Thanks in advance,
> Kalin
|
|
|
Re: How to combine Teneo with Jet? [message #596638 is a reply to message #63962] |
Thu, 07 December 2006 20:13 |
Eclipse User |
|
|
|
Originally posted by: kalin.nakov.gmail.com
Thank you very much for the help, it works that way. One note - I just
had to define the org.eclipse.jet.resource.project.name variable when
using runTransformOnObject(), otherwise it throws exception for the
undefined variable.
Paul Elder wrote:
> Kalin:
>
> Sorry, I didn't notice your post sooner...
>
> You'll have to pardon my ignorance of Teneo details, I have only scanned the
> tutorial, but here goes...
>
> As you note, JET2Platform.runTransfornOnResource() works on an Eclipse
> IResource, something you won't have if using Teneo. But all
> JET2Platform.runTransformOnResource() does is load the EMF resource for the
> IResource, and then pass the loaded EMF Resource off to the execution
> engine.
>
> Try the following:
>
> 1) Load the Teneo-based resource. Here's the snippet from the Teneo/JPOX
> tutorial:
> String uriStr = "jpox://?" + JPOXResource.DS_NAME_PARAM + "=MyPMF";
> final URI uri = URI.createURI(uriStr);
> ResourceSet resourceSet = new ResourceSetImpl();
> final Resource res =
> resourceSet.createResource(uri);res.load(Collections.EMPTY_M AP);2) Pass the
> loaded resource to JET2Platform.runTransformOnObject();
>
> JET2Platform.runTransformOnObject("...id", res, progressMonitor);
>
> If Teneo delivers as promised, then JET should have not problem navigating
> your model.
>
> Paul
>
> "Kalin Nakov" <kalin.nakov@gmail.com> wrote in message
> news:ekoot3$5uq$1@utils.eclipse.org...
>> Hello,
>>
>> My application needs to generate code out of a very huge model (thousands
>> of classes). Since loading everything into memory is not an option, I
>> think Teneo will suit best. I am able to run JET transformation in Java
>> using Jet2Platform.runTransformOnResource() by specifying a XMI file, but
>> how can I run a Jet transformation on a ResourceSet object?
>>
>> I want to load the huge model from the database as a ResourceSet (through
>> EMF/JPOX resources) and then run a JET transformation.
>>
>> Thanks in advance,
>> Kalin
>
>
|
|
|
Re: How to combine Teneo with Jet? [message #596724 is a reply to message #63985] |
Fri, 08 December 2006 14:19 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Kalin:
Good to hear it worked - kudo's go to Teneo for that.
To predefine variables for a JET transformation, you can pass in a map:
Map variables = new HashMap();
variables.put("org.eclipse.jet.resource.project.name", ...);
JET2Platform.runTransformOnObject("... jet id ..", res, variables, ..
progress montitor ...);
Paul
"Kalin Nakov" <kalin.nakov@gmail.com> wrote in message
news:el9sma$m2e$1@utils.eclipse.org...
> Thank you very much for the help, it works that way. One note - I just had
> to define the org.eclipse.jet.resource.project.name variable when using
> runTransformOnObject(), otherwise it throws exception for the undefined
> variable.
>
> Paul Elder wrote:
>> Kalin:
>>
>> Sorry, I didn't notice your post sooner...
>>
>> You'll have to pardon my ignorance of Teneo details, I have only scanned
>> the tutorial, but here goes...
>>
>> As you note, JET2Platform.runTransfornOnResource() works on an Eclipse
>> IResource, something you won't have if using Teneo. But all
>> JET2Platform.runTransformOnResource() does is load the EMF resource for
>> the IResource, and then pass the loaded EMF Resource off to the execution
>> engine.
>>
>> Try the following:
>>
>> 1) Load the Teneo-based resource. Here's the snippet from the Teneo/JPOX
>> tutorial:
>> String uriStr = "jpox://?" + JPOXResource.DS_NAME_PARAM + "=MyPMF";
>> final URI uri = URI.createURI(uriStr);
>> ResourceSet resourceSet = new ResourceSetImpl();
>> final Resource res =
>> resourceSet.createResource(uri);res.load(Collections.EMPTY_M AP);2) Pass
>> the loaded resource to JET2Platform.runTransformOnObject();
>>
>> JET2Platform.runTransformOnObject("...id", res, progressMonitor);
>>
>> If Teneo delivers as promised, then JET should have not problem
>> navigating your model.
>>
>> Paul
>>
>> "Kalin Nakov" <kalin.nakov@gmail.com> wrote in message
>> news:ekoot3$5uq$1@utils.eclipse.org...
>>> Hello,
>>>
>>> My application needs to generate code out of a very huge model
>>> (thousands of classes). Since loading everything into memory is not an
>>> option, I think Teneo will suit best. I am able to run JET
>>> transformation in Java using Jet2Platform.runTransformOnResource() by
>>> specifying a XMI file, but how can I run a Jet transformation on a
>>> ResourceSet object?
>>>
>>> I want to load the huge model from the database as a ResourceSet
>>> (through EMF/JPOX resources) and then run a JET transformation.
>>>
>>> Thanks in advance,
>>> Kalin
>>
|
|
|
Goto Forum:
Current Time: Fri Dec 27 00:29:14 GMT 2024
Powered by FUDForum. Page generated in 0.04938 seconds
|