Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem generating edit/editor(Still get the "not mapped" issue)
Problem generating edit/editor [message #704942] Fri, 29 July 2011 08:46 Go to next message
Marc Hamilton is currently offline Marc HamiltonFriend
Messages: 11
Registered: July 2009
Junior Member
Just downloaded Indigo, now trying to generate the "default" Xtext project that is produced with the Xtext New project wizard...

I only added the option:
generateEdit=true

to the EcoreGeneratorFragment in the default GenerateMyDsl.mwe2 workflow file.

Now I get the "path is unmapped" exception:
0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri 'C:\localdata\Eclipse\Indigo\v1\ws_try1'
609  [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning [...]
609  [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning [...]
734  [main] INFO  ipse.xtext.generator.LanguageConfig  - generating [...]
2672 [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.xtext.org/example/mydsl/MyDsl' from 'file:/C:/localdata/Eclipse/Indigo/v1/ws_try1/org.xtext.example.mydsl/src-gen/org/xtext/example/mydsl/MyDsl.genmodel'
org.eclipse.emf.common.util.WrappedException: java.io.IOException: The path '/org.xtext.example.mydsl.edit/src/org/xtext/example/mydsl/myDsl/provider/MyDslEditPlugin.java' is unmapped
	at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1112)


The generated 'genmodel' provides all info to run EMF 'generate Edit' from the context menu without problems, so why doesn't it work in the workflow?

I found some old issue, with the answer to "register the target directories in your standalone setup as platform-uri"...

... what is meant my this? Looking at the first line of output, it seems that StandaloneSetup does register the proper directory root as platform uri...?

So, do I need to change something else in the workflow file?


---
Mvg, Marc.
Re: Problem generating edit/editor [message #705024 is a reply to message #704942] Fri, 29 July 2011 10:35 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 6480
Registered: July 2009
Senior Member
Hi,

guess you have to create the org.xtext.example.mydsl.edit plugin manually

~Christian
Re: Problem generating edit/editor [message #705121 is a reply to message #705024] Fri, 29 July 2011 13:08 Go to previous messageGo to next message
Marc Hamilton is currently offline Marc HamiltonFriend
Messages: 11
Registered: July 2009
Junior Member
Ok, I generated the edit plugin manually.

I noticed that once the plugin was created, the workflow doesn't give the error anymore.

Even when I just create an empty project with the target name ('org.xtext.example.mydsl.edit'), the workflow generates the output:
...
2469 [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.xtext.org/example/mydsl/MyDsl' from 'file:/C:/localdata/Eclipse/Indigo/v1/ws_try1/org.xtext.example.mydsl/src-gen/org/xtext/example/mydsl/MyDsl.genmodel'
...

and so gives no error. However, it doesn't generate anything in this empty project...

So, this seems to be a bug?
Does anyone perhaps know why it goes wrong? It seems that the workflow doesn't create the targeted plugin projects.

---
Marc
Re: Problem generating edit/editor [message #729463 is a reply to message #705121] Mon, 26 September 2011 09:14 Go to previous messageGo to next message
Marc Hamilton is currently offline Marc HamiltonFriend
Messages: 11
Registered: July 2009
Junior Member
Working with Indigo. Still don't understand the problem.

Given the example "Domainmodel" (org.eclipse.xtext.example.domainmodel), I want to extend the generator to also generate an EMF Edit plugin.
The example model contains the following line:
fragment = ecore.EcoreGeneratorFragment {}


Attempt 1: only add setting to generate editor (generating edit plugin from genmodel works, so I'd assume that this is sufficient):
fragment = ecore.EcoreGeneratorFragment {
   generateEdit = true
}

=> result in the java.io.IOException" The path '/org.eclipse.xtext.example.domainmodel.edit/src/org/eclipse/xtext/example/domainmodel/domainmodel/provider/DomainmodelEditPlugin.java' is unmapped.

Attempt 2: the 'hoover' comment on generateEdit suggests that setEditDirectory and setEditPluginID should be considered. So, let's try to add these:
fragment = ecore.EcoreGeneratorFragment {
   generateEdit = true
   editPluginID = "${projectName}.edit"
   editDirectory = "platform:/resource/${projectName}.edit"
}

However, this makes no difference.

Attempt 3: using file: path settings
fragment = ecore.EcoreGeneratorFragment {
   generateEdit = true
   editPluginID = "${projectName}.edit"
   editDirectory = "file:C:/localdata/Eclipse/Indigo/v1/ws/learn/${projectName}.edit"
}


Again, no difference.

Digging a bit futher, debugging to the exception, I found that the PlatformResourceURIHandlerImpl throws the exception on an attempt to convert a uri that already contains "/resource/..." at the beginning.
It tries to convert e.g. "/resource/org.eclipse.xtext.example.domainmodel", or "/resource/localdata/Eclipse/Indigo/...", which cannot be resolved.

What can I do in the workflow to prevent this exception?

Is there anyone who succeeded in generating the edit plugin via the workflow?

---
Regards, Marc.



Re: Problem generating edit/editor [message #729475 is a reply to message #729463] Mon, 26 September 2011 09:18 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 6480
Registered: July 2009
Senior Member
Hi, you have to initially create the plugin stub yourself.
Re: Problem generating edit/editor [message #729505 is a reply to message #704942] Mon, 26 September 2011 11:08 Go to previous messageGo to next message
Marc Hamilton is currently offline Marc HamiltonFriend
Messages: 11
Registered: July 2009
Junior Member
Just to be more clear:
When the "EcoreGeneratorFragment" is empty,
a genmodel is generated from which I can generate Edit plugin using the standard EMF context menu, e.g.
org.eclipse.xtext.example.domainmodel.edit

When I fill in something in EcoreGeneratorFragment, the generated genmodel will result in an additional /resource/ in the target path when generating, it generates
/resource/org.eclipse.xtext.example.domainmodel.edit in the workspace.

...it still seems a bug to me...

---
Best regards, Marc.
Re: Problem generating edit/editor [message #729524 is a reply to message #729475] Mon, 26 September 2011 12:20 Go to previous message
Marc Hamilton is currently offline Marc HamiltonFriend
Messages: 11
Registered: July 2009
Junior Member
Hi Christian,

Ok, it now seems to work, I did it now using the following steps:

1. Make sure that in the workflow the "EcoreGeneratorFragment" is empty, and run the workflow.
2. Use the generated "genmodel" to generate the EMF Edit plugin
3. Now change the workflow and add the 'generateEdit = true' line to the EcoreGeneratorFragment
4. When you now run the workflow, no error is reported.
Indeed, the edit plugin java file also have a new timestamp, so it seems to really generate now.

Christian, thanks for your answer, at least I get the generator going now.

Still, step 1 and 2 is just doing what a generator should have done.

--
Regards, Marc.
Previous Topic:parsing javadoc-like text blocks
Next Topic:Xtend2 with Maven
Goto Forum:
  


Current Time: Fri Nov 21 08:50:39 GMT 2014

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

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