Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » How to call invoke transform agasin each eClass
How to call invoke transform agasin each eClass [message #68090] |
Sat, 13 January 2007 08:01 |
Eclipse User |
|
|
|
Originally posted by: 2236249.gdvnet.com
Hi, I am using emft to gen some codes from a ecore model.
My ecore model has a EPackage and more than one eClass, I want my templates
to transform each eClass.
That is, I have a templte list.emf
I have an ecore model which contains classes: Ant, Cat, Rat
I want to get results
list_ant.jsp
list_cat.jsp
list_rat.jsp
Also since the class name can change anytime, and more classes can be added
in.
Thanks in advance!
|
|
|
Re: How to call invoke transform agasin each eClass [message #68207 is a reply to message #68090] |
Tue, 16 January 2007 12:40 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Lipan,
Have you looked at the JET2 examples or looked at the JET articles on
the EMF documentation page?
lipan wrote:
> Hi, I am using emft to gen some codes from a ecore model.
> My ecore model has a EPackage and more than one eClass, I want my templates
> to transform each eClass.
> That is, I have a templte list.emf
> I have an ecore model which contains classes: Ant, Cat, Rat
> I want to get results
> list_ant.jsp
> list_cat.jsp
> list_rat.jsp
> Also since the class name can change anytime, and more classes can be added
> in.
>
> Thanks in advance!
>
>
>
|
|
| |
Re: How to call invoke transform agasin each eClass [message #69204 is a reply to message #68272] |
Sat, 27 January 2007 15:43 |
Eclipse User |
|
|
|
Originally posted by: 2236249.gdvnet.com
Thanks for your response
I have read this pages, and have done some emft templates.
But I don't think they can answer my question.
Maybe it is my mistake. But follwing the document, I cann't get what I want
I have a package, it has classes Ant, Cat, Rat
Then I have a tempalte list.emf
What I want is three files,
list_ant.jsp which is based on Ant's properties
and
list_cat.jsp which is based on Cat's properties
This is my list.emf:
<html>
<body>
<c:iterate select="/contents/eClassifiers" var="currNode">
Name = <c:get select="$currNode/@name" />
</c:iterate>
</body>
</html>
yes it produce a file, which list all these classifiers, but I only want
three files, each list one classifiler
I thought <ws:file/> can help me, but it can only process the whole ecore
module(which list all 3 classifers)
I think it may be useful to write something like
<c:iterate select="/contents/eClassifiers" var="currNode">
<ws:file template="list.emf" processnode="$currNode/@name" />
</c:iterate>
but ws:file can't work this way.
> Some useful links:
>
> The EMFT JET (aka JET2) Getting started help pages:
>
> http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. jet.doc/gettingStarted/index.xhtml
>
> An introductory article on JET2:
>
> http://www-128.ibm.com/developerworks/opensource/library/os- ecl-jet/
>
> Paul
>
>
> "lipan" <2236249@gdvnet.com> wrote in message
> news:eoa3j1$bn8$1@utils.eclipse.org...
>> Hi, I am using emft to gen some codes from a ecore model.
>> My ecore model has a EPackage and more than one eClass, I want my
>> templates to transform each eClass.
>> That is, I have a templte list.emf
>> I have an ecore model which contains classes: Ant, Cat, Rat
>> I want to get results
>> list_ant.jsp
>> list_cat.jsp
>> list_rat.jsp
>> Also since the class name can change anytime, and more classes can be
>> added in.
>>
>> Thanks in advance!
>>
>
>
|
|
| |
Re: How to call invoke transform agasin each eClass [message #69321 is a reply to message #69225] |
Tue, 30 January 2007 06:01 |
Eclipse User |
|
|
|
Originally posted by: 2236249.gdvnet.com
Thank you!
> Lipan:
>
> Your second instinct is nearly right:
>
>> <c:iterate select="/contents/eClassifiers" var="currNode">
>> <ws:file template="list.emf" processnode="$currNode/@name" />
>> </c:iterate>
>
> But, JET doesn't do parameter passing the way you are expecting (or for
> that matter, the way I'd like it to). The variable 'currNode' is global,
> so you'd do the following:
>
> In templates/main.jet:
>
> <c:iterate select="/contents/eClassifiers" var="currNode">
> <ws:file template="templates/list.emf.jet"
> path="some-project/list_{$currNode/@name}.jsp"/>
> </c:iterate>
>
> Note the XPath expression in braces { } embedded in the path attribute.
> This can be enhanced using functions to make the name lowercase:
>
> <ws:file template="templates/list.emf.jet"
> path="some-project/list_{lower-case($currNode/@name)}.jsp"/ >
>
> Finally, in templates/list.emf.jet, you would do whatever it is you want:
>
> This is the content for: <c:get select="$currNode/@name"/>
> ...
>
> Paul
>
|
|
|
Re: How to call invoke transform agasin each eClass [message #601296 is a reply to message #68090] |
Tue, 16 January 2007 12:40 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Lipan,
Have you looked at the JET2 examples or looked at the JET articles on
the EMF documentation page?
lipan wrote:
> Hi, I am using emft to gen some codes from a ecore model.
> My ecore model has a EPackage and more than one eClass, I want my templates
> to transform each eClass.
> That is, I have a templte list.emf
> I have an ecore model which contains classes: Ant, Cat, Rat
> I want to get results
> list_ant.jsp
> list_cat.jsp
> list_rat.jsp
> Also since the class name can change anytime, and more classes can be added
> in.
>
> Thanks in advance!
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: How to call invoke transform agasin each eClass [message #601677 is a reply to message #68272] |
Sat, 27 January 2007 15:43 |
Eclipse User |
|
|
|
Originally posted by: 2236249.gdvnet.com
Thanks for your response
I have read this pages, and have done some emft templates.
But I don't think they can answer my question.
Maybe it is my mistake. But follwing the document, I cann't get what I want
I have a package, it has classes Ant, Cat, Rat
Then I have a tempalte list.emf
What I want is three files,
list_ant.jsp which is based on Ant's properties
and
list_cat.jsp which is based on Cat's properties
This is my list.emf:
<html>
<body>
<c:iterate select="/contents/eClassifiers" var="currNode">
Name = <c:get select="$currNode/@name" />
</c:iterate>
</body>
</html>
yes it produce a file, which list all these classifiers, but I only want
three files, each list one classifiler
I thought <ws:file/> can help me, but it can only process the whole ecore
module(which list all 3 classifers)
I think it may be useful to write something like
<c:iterate select="/contents/eClassifiers" var="currNode">
<ws:file template="list.emf" processnode="$currNode/@name" />
</c:iterate>
but ws:file can't work this way.
> Some useful links:
>
> The EMFT JET (aka JET2) Getting started help pages:
>
> http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. jet.doc/gettingStarted/index.xhtml
>
> An introductory article on JET2:
>
> http://www-128.ibm.com/developerworks/opensource/library/os- ecl-jet/
>
> Paul
>
>
> "lipan" <2236249@gdvnet.com> wrote in message
> news:eoa3j1$bn8$1@utils.eclipse.org...
>> Hi, I am using emft to gen some codes from a ecore model.
>> My ecore model has a EPackage and more than one eClass, I want my
>> templates to transform each eClass.
>> That is, I have a templte list.emf
>> I have an ecore model which contains classes: Ant, Cat, Rat
>> I want to get results
>> list_ant.jsp
>> list_cat.jsp
>> list_rat.jsp
>> Also since the class name can change anytime, and more classes can be
>> added in.
>>
>> Thanks in advance!
>>
>
>
|
|
| |
Re: How to call invoke transform agasin each eClass [message #601717 is a reply to message #69225] |
Tue, 30 January 2007 06:01 |
Eclipse User |
|
|
|
Originally posted by: 2236249.gdvnet.com
Thank you!
> Lipan:
>
> Your second instinct is nearly right:
>
>> <c:iterate select="/contents/eClassifiers" var="currNode">
>> <ws:file template="list.emf" processnode="$currNode/@name" />
>> </c:iterate>
>
> But, JET doesn't do parameter passing the way you are expecting (or for
> that matter, the way I'd like it to). The variable 'currNode' is global,
> so you'd do the following:
>
> In templates/main.jet:
>
> <c:iterate select="/contents/eClassifiers" var="currNode">
> <ws:file template="templates/list.emf.jet"
> path="some-project/list_{$currNode/@name}.jsp"/>
> </c:iterate>
>
> Note the XPath expression in braces { } embedded in the path attribute.
> This can be enhanced using functions to make the name lowercase:
>
> <ws:file template="templates/list.emf.jet"
> path="some-project/list_{lower-case($currNode/@name)}.jsp"/ >
>
> Finally, in templates/list.emf.jet, you would do whatever it is you want:
>
> This is the content for: <c:get select="$currNode/@name"/>
> ...
>
> Paul
>
|
|
|
Goto Forum:
Current Time: Thu Apr 25 02:08:11 GMT 2024
Powered by FUDForum. Page generated in 0.04324 seconds
|