Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EOL and feature maps
EOL and feature maps [message #629719] Wed, 29 September 2010 11:13 Go to next message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
I found a reference to). This model uses FeatureMaps heavily and I'm now
struggling with the EOL for adding elements.

If I understand this correctly, a feature map is a way of storing a list
of entry elements, so that the values of the entries also appear in a
set of derived features. In the XHTML model, a Block contains a groups
FeatureMap, and there are derived multi-value references named p, h1,
.... When you add a P to the Block, I believe you have to create an
Entry, set the key to Block's p feature and the value to the new P. Then
the Entry is added to the FeatureMap. There is a convenience method in
FeatureMap for adding the key, value pair. In any case, I have to be
able to get hold of an EPackage instance and ask for a specific
EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();

I haven't found a way of calling static methods, but know about Native
technique. The question is, do I have to define a new Tool with my own
methods for accessing "static" information, like the EPackage registry?

Hallvard
Re: EOL and feature maps [message #629912 is a reply to message #629719] Wed, 29 September 2010 21:54 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I managed to solve it, twice in fact. First, I implemented a tool that
exposed necessary method for handling FeatureMaps, and used this by
initializing it in a pre block and using it when needed. Second, I
realized that I only needed methods on objects I already had access to
by means of eClass(). E.g. I could lookup features in the eClass, get
feature values, add values to features maps, etc, using only EOL.

:-)

Hallvard

On 29.09.10 13.13, Hallvard Trætteberg wrote:
>
> I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
> I found a reference to). This model uses FeatureMaps heavily and I'm now
> struggling with the EOL for adding elements.
>
> If I understand this correctly, a feature map is a way of storing a list
> of entry elements, so that the values of the entries also appear in a
> set of derived features. In the XHTML model, a Block contains a groups
> FeatureMap, and there are derived multi-value references named p, h1,
> ... When you add a P to the Block, I believe you have to create an
> Entry, set the key to Block's p feature and the value to the new P. Then
> the Entry is added to the FeatureMap. There is a convenience method in
> FeatureMap for adding the key, value pair. In any case, I have to be
> able to get hold of an EPackage instance and ask for a specific
> EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();
>
> I haven't found a way of calling static methods, but know about Native
> technique. The question is, do I have to define a new Tool with my own
> methods for accessing "static" information, like the EPackage registry?
>
> Hallvard
Re: EOL and feature maps [message #629986 is a reply to message #629912] Thu, 30 September 2010 08:03 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Hallvard,

Glad you managed to solve this! For XML-based models you may also want
to have a look at the plain XML driver we recently added to Epsilon:
http://www.eclipse.org/gmt/epsilon/doc/articles/plain-xml/

Cheers,
Dimitris

Hallvard Trætteberg wrote:
> Hi,
>
> I managed to solve it, twice in fact. First, I implemented a tool that
> exposed necessary method for handling FeatureMaps, and used this by
> initializing it in a pre block and using it when needed. Second, I
> realized that I only needed methods on objects I already had access to
> by means of eClass(). E.g. I could lookup features in the eClass, get
> feature values, add values to features maps, etc, using only EOL.
>
> :-)
>
> Hallvard
>
> On 29.09.10 13.13, Hallvard Trætteberg wrote:
>>
>> I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
>> I found a reference to). This model uses FeatureMaps heavily and I'm now
>> struggling with the EOL for adding elements.
>>
>> If I understand this correctly, a feature map is a way of storing a list
>> of entry elements, so that the values of the entries also appear in a
>> set of derived features. In the XHTML model, a Block contains a groups
>> FeatureMap, and there are derived multi-value references named p, h1,
>> ... When you add a P to the Block, I believe you have to create an
>> Entry, set the key to Block's p feature and the value to the new P. Then
>> the Entry is added to the FeatureMap. There is a convenience method in
>> FeatureMap for adding the key, value pair. In any case, I have to be
>> able to get hold of an EPackage instance and ask for a specific
>> EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();
>>
>> I haven't found a way of calling static methods, but know about Native
>> technique. The question is, do I have to define a new Tool with my own
>> methods for accessing "static" information, like the EPackage registry?
>>
>> Hallvard
>
Re: EOL and feature maps [message #630168 is a reply to message #629986] Thu, 30 September 2010 21:05 Go to previous message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 30.09.10 10.03, Dimitris Kolovos wrote:
>
> Glad you managed to solve this! For XML-based models you may also want
> to have a look at the plain XML driver we recently added to Epsilon:
> http://www.eclipse.org/gmt/epsilon/doc/articles/plain-xml/

Interesting! Although the example I'm working on now is for a lecture
(tomorrow morning) about M2M transformations (followed up by M2T with
EGL using the the same example). Hence, it's better to have an explicit
Ecore model of XHTML (found one in a QVTO example in Eclipse's CVS).

Hallvard
Previous Topic:Problem using `pre` to declare global data
Next Topic:need help in ETL transformation rules
Goto Forum:
  


Current Time: Sat Oct 25 22:55:38 GMT 2014

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

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