[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[emf-dev] using GMF to generate JavaScript

Hi all,

I've been familiarizing myself with GEF and GMF in order to determine the best way for my idea to slot into EMF's existing projects. Here is what I would like to propose:

I believe that the first step would be to expose a graphics API similar to Draw2d/GEF for the browser environment. The Dojo _javascript_ library's dojox.gfx project already provides a good foundation for this, and my work on this part would consist of extending their API.
 
I believe that the next step would be to allow the dynamic generation of the browser-based editing environment from GMF. In terms of the GMF workflow, this would slot into the step after you develop the mapping model. Just like how you now have an option to generate a generator model for a lightweight RCP client, this would allow you to generate a generator model for a lightweight browser-based diagram editor and abstract syntax HTTP server backend. Specifically, this generator model would generate:

1) _javascript_ and (X)HTML files for a browser-based visual diagram editor client,
2) Java files for an HTTP server that exposes the abstract syntax layer via RESTful interfaces, and
3) more _javascript_ files for client-side data bindings onto the server's RESTful interfaces.

Running the generated diagram editor project I believe would not entail running an Eclipse plugin, as would be normal in the GMF workflow, but instead would involve deploying a JAR inside of a Servlet container inside of Eclipse, and starting the server. Then in your web browser you would navigate to http://localhost:<some_port>/<restful_uri_to_some_diagram>, which would launch the client in your browser, which would bind to the server as expected.

Later on it might be possible to look into exporting a WAR file from the generated code, that would contain all of the project dependencies, for deployment outside of Eclipse.

I'm sure I'll have many more questions in the future, but that's the gist of it. I'd appreciate it if anyone could let me know whether this seems sound.

I also have two questions right now:

1. Is it true that GMF is using JET to generate Java code? As JET is a fairly generic templating engine, does this mean that there won't be any major, forseeable technical challenges creating a generator model which generates _javascript_, as opposed to Java? If there are forseeable technical restrictions, I'd appreciate it if you would let me know what you believe they might be.

2. This might be a bit off-topic, but I spent about three hours today trying to get the first GMF tutorial to work, without success. I am consistently able to reach the point where I'm able to run the generated diagram, but when I attempt to instantiate graphical Topic elements, nothing shows up on the Canvas. The domain model shows that I have instantiated a Topic, but under the diagram model, where the Topic should be, it instead shows "null". As I've now completed the tutorial a number of times, I feel reasonably certain that I have completed all of the steps correctly, and I'm wondering if instead the tutorial might be missing some information. Has anyone tried to work through the tutorial recently? I'd be interested to know what people's experiences are with this.

I'd appreciate any guidance anyone can provide. Thanks for your help,

Jake