Hey Christian,
Alright. This is my solution; right after the “Nodes and attribute types” part:
// Set Inheritance:
for (EPackage epackage : module.getImports()) {
for (EClassifier eclassifier : epackage.getEClassifiers()) {
if (eclassifier instanceof EClass) {
EClass eclass = (EClass) eclassifier;
EList<EClass> parents = eclass.getESuperTypes();
if(parents != null) {
for(EClass parent : parents) {
String childID = nodeTypeIDs.get(eclass);
String parentID = nodeTypeIDs.get(parent);
Element parentElem = newElement("Parent", document.getElementById(childID), false);
parentElem.setAttribute("pID", parentID);
//Parent nodes have to appear before child node in XML document
//so only move if necessary
if(Integer.parseInt(childID.substring(1)) < Integer.parseInt(parentID.substring(1))) {
typesElem.insertBefore(document.getElementById(parentID), document.getElementById(childID));
}
}
}
}
}
}
Basically, it is the same as Frank’s patch except for the if-clause and its own surrounding for-loop.
Regards,
Florian
Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] Im Auftrag von Christian Krause
Gesendet: Freitag, 7. Februar 2014 20:23
An: Henshin developers mailing list
Betreff: Re: [henshin-dev] Export Henshin to AGG
Hi Florian,
thanks for pointing this out. If you have a solution, I would be happy to incorporate it. You can just send me a patch.
2014-02-07 19:33 GMT+01:00 Florian Heß <hessflorian@xxxxxxxxxxxxxxxxxxxxxxxxx>:
Hey!
Thanks for this patch. But if I get this patch right, it does not consider the fact that parent nodes have to appear BEFORE their child nodes inside the resulting XML document. Otherwise AGG will throw an error.
This problem occurs when you have got an existing model and add a parent node afterwards. Thus the parent node gets an higher ID and therefore will be added into the XML document after the child node.
The solution I am working with supports this case. I just wanted to test it out some more but I can make it available for you right now – if you want to (how?)
Cheers,
Florian
Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] Im Auftrag von Christian Krause
Gesendet: Mittwoch, 5. Februar 2014 18:58
An: Henshin developers mailing list
Betreff: Re: [henshin-dev] Export Henshin to AGG
Hi,
the AGG exporter now supports inheritance:
Thanks for submitting the patch, Frank.
2013-12-17 Florian Heß <hessflorian@xxxxxxxxxxxxxxxxxxxxxxxxx>:
Hello Christian,
thank you for the reply. I will take a deeper look into the exporter and try my best to add inheritance to the exporter.
Regards,
Florian
Von: henshin-dev-bounces@xxxxxxxxxxx [mailto:henshin-dev-bounces@xxxxxxxxxxx] Im Auftrag von Christian Krause
Gesendet: Montag, 16. Dezember 2013 22:23
An: Henshin developers mailing list
Betreff: Re: [henshin-dev] Export Henshin to AGG
Hello Florian,
inheritance is currently not supported by the AGG exporter. If you are interested in having this feature, maybe you can take a look at the exporter and try to add it yourself. If it works, we could add it to Henshin so that others can also make use of it. Maybe just take a look at the exporter to get a feeling of what is currently supported:
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev