Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Eclipse UserFriend
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 #63455 is a reply to message #63409] Fri, 01 December 2006 10:58 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kalin,
I think that this is more a Jet question then a Teneo question. I have not used Jet in this way so I
hope Paul can answer it.

gr. Martin

Kalin Nakov wrote:
> 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


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: How to combine Teneo with Jet? [message #63962 is a reply to message #63409] Thu, 07 December 2006 16:58 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Paul Elder is currently offline Paul ElderFriend
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 #596416 is a reply to message #63409] Fri, 01 December 2006 10:58 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kalin,
I think that this is more a Jet question then a Teneo question. I have not used Jet in this way so I
hope Paul can answer it.

gr. Martin

Kalin Nakov wrote:
> 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


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: How to combine Teneo with Jet? [message #596623 is a reply to message #63409] Thu, 07 December 2006 16:58 Go to previous message
Paul Elder is currently offline Paul ElderFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Paul Elder is currently offline Paul ElderFriend
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
>>
Previous Topic:General architecture question on performance
Next Topic:Error validating with ecore.xsd
Goto Forum:
  


Current Time: Thu Mar 28 17:04:28 GMT 2024

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

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

Back to the top