How is superbrewer3000.coffeenotation created? #80
Replies: 8 comments
-
This is done by Eclipse EMF, see e.g. https://eclipsesource.com/blogs/tutorials/emf-tutorial/ |
Beta Was this translation helpful? Give feedback.
-
[GaryKopp] Thanks, Philip. That's what I was thinking was the case. Am I right that it is the ModelServer that then uses the generated model files, and these are the Java .class files? Is this an introspection-based process? I'm wondering how it decides just which model files to process, and whether there's perhaps some package or class naming it expects in the model that relates back to the demo application configuration. Since I've done some renaming I could have messed that up. At this point I'm still using the coffee model files as distributed. My next step will be to replace that model with my own, once I figure out the basics. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
[GaryKopp] One other basic question. Let's say I produce a completely new model and generate its Java Code. I put that code in the demo application's model directory and rebuild the application. I delete the notation file since it was based on a different model. Assuming I make other necessary changes to the demo code to adapt to the new model, can I then just fire up the demo's diagram editor and it will recognize the new model and eventually create the notation file, or are there other steps? BTW, thanks for that blog pointer -- it is very informative. |
Beta Was this translation helpful? Give feedback.
-
Yes
No, the generated EMF Package needs to be registered in the model server, see the DI module.
I don't know by heart whether the coffee editor example auto-generates a layout. It can be done but this is typically custom code that needs to be written. The model server itself doesn't do that, as it can't generically know how to generate that. |
Beta Was this translation helpful? Give feedback.
-
[GaryKopp] Please pardon my current ignorance, but exactly where is the model server's DI module? And many thanks for your help. Once I find the place to register the EMF package I'm pretty sure this will solve my current problem at least. |
Beta Was this translation helpful? Give feedback.
-
Oh right, the coffee editor master doesn't use DI as an extension mechanism yet, this is just upcoming. |
Beta Was this translation helpful? Give feedback.
-
[GaryKopp] Many thanks. I had actually 'discovered' that code just after messaging you and found that I had mis-specified an extension in the PackageConfiguration class. I believe that will solve my original problem (leaving outstanding my confusion about creating an example application from scratch). |
Beta Was this translation helpful? Give feedback.
-
[GaryKopp] Well, after cleaning up the loose ends my original problem is back. When I click on 'Diagram Editor' in the welcome widget the file superbrewer3000.typeexplorer (originally superbrewer3000.coffee) is deleted and then the display of the diagram fails because that same file can't be found. Baffling. I guess I'm going to have to trace the ModelServer code :-( I think instead I will first create a new example application from scratch with a new model and see how that goes. Once I'm clear on the details of constructing a new application. |
Beta Was this translation helpful? Give feedback.
-
I have done a lot of renaming to move away from the 'coffee' naming scheme, so the file mentioned in the title of this message is now actually superbrewer3000.typeexplorernotation, and as you will see in the log line I paste in later it's in a new directory. I made what I think are the necessary code changes in several places to deal with this changed file extension (.typeexplorernotation). After I build and before I run the modified demo the file superbrewer3000.typeexplorernotation exists. When I then run the application and click on Diagram Editor in the welcome widget the editor area of Theia remains blank and the file superbrewer3000.typeexplorernotation magically disappears from the file system (and from the explorer in Theia). It looks like this file is supposed to carry the current layout of the diagram, so I guess it makes sense it has to be recreated, so maybe the disappearance isn't a problem. But then why isn't it being recreated when I ask for the diagram?
I'm assuming the ModelServer is accessing the source code generated from the raw ecore files (?). Should I perhaps be looking there for possible issues? Actually, I now realize I don't understand the model generation process. What is responsible for processing the ecore files to produce the Java source code found in the model plugin directory? I originally thought the backend build was responsible for that, but I see that these Java source codes files are present in the demo distro. They don't have to be coded from scratch, do they? Or is this an automated process done in Eclipse EMF?
The following line appears in the server console, and I'm assuming it was logged after the file disappeared:
root INFO ModelServerBackendContribution: 0 [qtp1260127127-32] ERROR ModelServerRouting - Cannot subscribe to 'file:/home/gary/type-explorer-prototype/type-explorer/TypeExplorer/superbrewer3000.typeexplorernotation': modeluri is not a valid model resource
original thread by GaryKopp
Beta Was this translation helpful? Give feedback.
All reactions