|
|
Re: [EDapt] Windows filenames are not URIs [message #1752153 is a reply to message #1751971] |
Thu, 19 January 2017 09:47 |
|
Hi Steve,
I just had a look at this and I can't reproduce this.
What I did is the following:
@Test
public void run() throws MigrationException {
final URI historyURI = URI.createFileURI("C:\\Users\\VM\\Desktop\\task.history");
final URI resourceURI = URI.createFileURI("C:\\Users\\VM\\Desktop\\Task.xmi");
final Migrator migrator = new Migrator(historyURI, new BundleClassLoader(FrameworkUtil.getBundle(getClass())));
final Release release = migrator.getRelease(resourceURI).iterator().next();
migrator.migrateAndSave(Collections.singletonList(resourceURI), release, null, new NullProgressMonitor());
}
This is working fine. The URIs Edapt is expecting are of type org.eclipse.emf.common.util.URI
In order to create file uris you can use URI.createFileURI(path).
Does this solve your problem? Otherwise please specify which code is creating the Migrator instance.
Regards
Johannes
Johannes Faltermeier
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
|
Re: [EDapt] Windows filenames are not URIs [message #1753151 is a reply to message #1752766] |
Thu, 02 February 2017 09:12 |
|
Hi Steve,
This Editor integration sample creates the Migrator by using the MigratorRegistory. This one is filled from the org.eclipse.emf.edapt.migrators extension point.
At this extension point you have to register your history, which is expected to be contained in the plugin. It is advised to keep the history next to the ecore anyway.
See below example for the extension point.
If you can't keep the history file in your plugin, then you can't use the extension point. You will have to create the Migrator as shown here: https://www.eclipse.org/forums/index.php?t=msg&th=1083743&goto=1752153&#msg_1752153
Cheers
Johannes
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
name=""
point="org.eclipse.emf.ecore.generated_package">
<package
genModel="model/task.genmodel"
uri="http://eclipse/org/emf/ecp/makeithappen/model/task"
class="org.eclipse.emf.ecp.makeithappen.model.task.TaskPackage">
</package>
</extension>
<extension
point="org.eclipse.emf.edapt.migrators">
<migrator
path="model/task.history">
</migrator>
</extension>
</plugin>
Johannes Faltermeier
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Powered by
FUDForum. Page generated in 0.50748 seconds