Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Datamodel migration with ecore2ecroe
Datamodel migration with ecore2ecroe [message #478398] Fri, 15 May 2009 19:30 Go to next message
Süleyman Vurucu is currently offline Süleyman VurucuFriend
Messages: 34
Registered: July 2009
Member
Hi @ all,

I need help with migrating datamodel. I found a possible solution at I
found an example at
http://wiki.eclipse.org/EMF/Recipes#XMI.2FXML_Serialization_ Recipes

in section EMF/Reciepe.

I made the folowing modifications the rest is the same with the example:

Namespaces:

public static final String RULES_100_NS_URI = "http://My.Model/1.0.0";
public static final String RULES_PLATFORM_URI = "platform:/model/
EA_ModelContainment.ecore";
public static final String RULES_100_PLATFORM_URI = "platform:/model/
ContainmentMapper.ecore2xml";

plugin.xml
The added entry is:

<extension
point="org.eclipse.emf.ecore.extension_parser">
<parser
class="RulesResourceFactoryImpl"
type="rules"/>
</extension>

I try to use the implementaion like this:

public void saveMofifiedModel() {
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry
().getExtensionToFactoryMap().
put(Resource.Factory.Registry.DEFAULT_EXTENSION,
new RulesResourceFactoryImpl());

File file = new File(PART1);
file.setWritable(true);
URI fileURI = URI.createFileURI(file.getAbsolutePath());

// Create a resource for this file.
Resource resource = resourceSet.createResource(fileURI);

resourceList = resource.getContents();
resourceList.add(sys);

try {
resource.save(saveOptions);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

So if I try to excecute this example then I get an exception ""main"
java.lang.RuntimeException: Cannot create a resource for 'platform:/model/
ContainmentMapper.ecore2xml'; a registered resource factory is needed"

I'm very happy for any help.
Thanks in advance
Re: Datamodel migration with ecore2ecroe [message #478410 is a reply to message #478398] Mon, 18 May 2009 22:42 Go to previous message
Süleyman Vurucu is currently offline Süleyman VurucuFriend
Messages: 34
Registered: July 2009
Member
Has nodbody an idea?
Re: Datamodel migration with ecore2ecroe [message #478411 is a reply to message #478398] Mon, 18 May 2009 22:42 Go to previous message
Süleyman Vurucu is currently offline Süleyman VurucuFriend
Messages: 34
Registered: July 2009
Member
Has nodbody an idea?
Re: Datamodel migration with ecore2ecroe [message #627595 is a reply to message #478398] Mon, 18 May 2009 22:42 Go to previous message
Süleyman Vurucu is currently offline Süleyman VurucuFriend
Messages: 34
Registered: July 2009
Member
Has nodbody an idea?
Re: Datamodel migration with ecore2ecroe [message #627596 is a reply to message #478398] Mon, 18 May 2009 22:42 Go to previous message
Süleyman Vurucu is currently offline Süleyman VurucuFriend
Messages: 34
Registered: July 2009
Member
Has nodbody an idea?
Previous Topic:UML Model difference
Next Topic:Re: UML -> Ecore (Derived + Composite)
Goto Forum:
  


Current Time: Tue Apr 23 16:40:30 GMT 2024

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

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

Back to the top