Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Using Jet Transformation with EMF documents
Using Jet Transformation with EMF documents [message #66698] Fri, 05 January 2007 12:15 Go to next message
Eclipse UserFriend
Originally posted by: lakshmi.dnarayana.yahoo.com

Hi,

Can anyone please tell me what does the following mean in the
help.eclipse.org/emft JET developer site:

<%-- contents of main.jet that reads handles a .ecore file --%>
<%-- import the ecore namespace --%>
<%@jet imports="org.eclipse.emf.ecore.*"%>

<c:setVariable var="ePackage" select="/contents"/>

<%-- write to the JET execution console --%>
<c:log>
EPackage: <c:get select="$ePackage/@name"/>
<c:iterate select="$ePackage/eClassifiers" var="eClassifier">
<%
EClassifier ec = (EClassifier)context.getVariable("eClassifier");
%>
EClassifier: <c:get select="$eClassifier/@name"/>. Really it&apos;s <%=
ec.getName() %>
</c:iterate>
</c:log>

I have not been able to find a way to load an ecore model and browse the way
they have specified.

Thanks,
LN
Re: Using Jet Transformation with EMF documents [message #68227 is a reply to message #66698] Tue, 16 January 2007 15:29 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
LN:

The example assumes the following:

1) You created a new EMFT JET project using the New Project Wizard.
2) You opened plugin.xml, and added the following to the 'tranform' element:
modelLoader="org.eclipse.jet.emf"
(This tells the JET transformation to load its input document using EMF
rather than as an XML document.)
3) You paste the sample code into the already created file
'templates/main.jet'.
4) You create a JET Tranformation launch configuration as follows.
a) Click the menu Run > Run...
b) Select JET Transformation, and click the icon for a new configuration
c) You select a file with a .ecore extension as the input
d) You specify the JET project you created in 1) as the transformation to
execute.

If you do all of the above, the template will write the following to the JET
execution log. It will not create any files.
* The name of the EPackge at the root of the .ecore file
* The names of the EClassifiers contained by this EPackage.

The point of the example was to demonstrate:
* How XPath expressions traverse EMF models by matching EMF feature names to
XPath steps
* How to access XPath variables via Java code
* That JET is not adding a 'layer' over an EMF model - JET XPath expressions
are evaluated directly against the model.

Paul


"lakshmi" <lakshmi.dnarayana@yahoo.com> wrote in message
news:enlfhp$fmm$1@utils.eclipse.org...
> Hi,
>
> Can anyone please tell me what does the following mean in the
> help.eclipse.org/emft JET developer site:
>
> <%-- contents of main.jet that reads handles a .ecore file --%>
> <%-- import the ecore namespace --%>
> <%@jet imports="org.eclipse.emf.ecore.*"%>
>
> <c:setVariable var="ePackage" select="/contents"/>
>
> <%-- write to the JET execution console --%>
> <c:log>
> EPackage: <c:get select="$ePackage/@name"/>
> <c:iterate select="$ePackage/eClassifiers" var="eClassifier">
> <%
> EClassifier ec = (EClassifier)context.getVariable("eClassifier");
> %>
> EClassifier: <c:get select="$eClassifier/@name"/>. Really it&apos;s <%=
> ec.getName() %>
> </c:iterate>
> </c:log>
>
> I have not been able to find a way to load an ecore model and browse the
> way
> they have specified.
>
> Thanks,
> LN
>
>
Re: Using Jet Transformation with EMF documents [message #601304 is a reply to message #66698] Tue, 16 January 2007 15:29 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
LN:

The example assumes the following:

1) You created a new EMFT JET project using the New Project Wizard.
2) You opened plugin.xml, and added the following to the 'tranform' element:
modelLoader="org.eclipse.jet.emf"
(This tells the JET transformation to load its input document using EMF
rather than as an XML document.)
3) You paste the sample code into the already created file
'templates/main.jet'.
4) You create a JET Tranformation launch configuration as follows.
a) Click the menu Run > Run...
b) Select JET Transformation, and click the icon for a new configuration
c) You select a file with a .ecore extension as the input
d) You specify the JET project you created in 1) as the transformation to
execute.

If you do all of the above, the template will write the following to the JET
execution log. It will not create any files.
* The name of the EPackge at the root of the .ecore file
* The names of the EClassifiers contained by this EPackage.

The point of the example was to demonstrate:
* How XPath expressions traverse EMF models by matching EMF feature names to
XPath steps
* How to access XPath variables via Java code
* That JET is not adding a 'layer' over an EMF model - JET XPath expressions
are evaluated directly against the model.

Paul


"lakshmi" <lakshmi.dnarayana@yahoo.com> wrote in message
news:enlfhp$fmm$1@utils.eclipse.org...
> Hi,
>
> Can anyone please tell me what does the following mean in the
> help.eclipse.org/emft JET developer site:
>
> <%-- contents of main.jet that reads handles a .ecore file --%>
> <%-- import the ecore namespace --%>
> <%@jet imports="org.eclipse.emf.ecore.*"%>
>
> <c:setVariable var="ePackage" select="/contents"/>
>
> <%-- write to the JET execution console --%>
> <c:log>
> EPackage: <c:get select="$ePackage/@name"/>
> <c:iterate select="$ePackage/eClassifiers" var="eClassifier">
> <%
> EClassifier ec = (EClassifier)context.getVariable("eClassifier");
> %>
> EClassifier: <c:get select="$eClassifier/@name"/>. Really it&apos;s <%=
> ec.getName() %>
> </c:iterate>
> </c:log>
>
> I have not been able to find a way to load an ecore model and browse the
> way
> they have specified.
>
> Thanks,
> LN
>
>
Previous Topic:Questions on JET transformation project
Next Topic:JET error
Goto Forum:
  


Current Time: Thu Apr 25 17:35:17 GMT 2024

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

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

Back to the top