Hello,
i am trying to write an EMF Editor that merges two models. This works very well until i try to save the model. after that, my two files are different but thats only because the way it saves the resource is different between my sample ecore model editor - file and the one i created.
This is what i expect/want:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="foo" nsURI="http://foo" nsPrefix="foo">
<eClassifiers xsi:type="ecore:EClass" name="Bar">
<eGenericSuperTypes eClassifier="ecore:EClass platform:/plugin/mymodell/model/somemodel.ecore#//MapEntry">
<eTypeArguments eClassifier="#//Kirikaese"/>
<eTypeArguments eClassifier="#//Kirikaese"/>
</eGenericSuperTypes>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Kirikaese" eSuperTypes="platform:/plugin/mymodell/model/somemodel.ecore#//Nameable platform:/plugin/mymodell/model/somemodel.ecore#//MapEntryKey"/>
</ecore:EPackage>
this is what i get
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="foo" nsURI="http://foo" nsPrefix="foo">
<eClassifiers xsi:type="ecore:EClass" name="Bar">
<eGenericSuperTypes>
<eTypeArguments eClassifier="//Kirikaese"/>
<eTypeArguments eClassifier="//Kirikaese"/>
<eClassifier xsi:type="ecore:EClass" href="../../../plugin/mymodell/model/somemodel.ecore#//MapEntry"/>
</eGenericSuperTypes>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Kirikaese">
<eSuperTypes href="../../../plugin/mymodell/model/somemodel.ecore#//Nameable"/>
<eSuperTypes href="../../../plugin/mymodell/model/somemodel.ecore#//MapEntryKey"/>
</eClassifiers>
</ecore:EPackage>
What is it that i am doing wrong?
i am working within an eclipse-instance.
This is how i load my resource:
URI originResourceURI = URI.createPlatformResourceURI("originResourceURI", true);
originResource = editingDomain.getResourceSet().getResource(originResourceURI, true);
This is how i save them:
final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
try {
originResource .save(saveOptions);
} catch (IOException e) {
e.printStackTrace();
}
Thank you for your time and help