Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Sprotty » Integrating Sprotty-server into existing Spring application?
Integrating Sprotty-server into existing Spring application? [message #1830911] Thu, 06 August 2020 13:55 Go to next message
Jonas Sorgalla is currently offline Jonas SorgallaFriend
Messages: 10
Registered: September 2015
Location: Dortmund, Germany
Junior Member
Hi folks,

first of all thank you so much for your awesome work. I recently came accross the use case to visualize a model for the web browser and Sprotty seems to be a perfect fit. I already had nightmares of half-heartedly coded custom spaghetti java script code :D

However, I am not sure how to integrate Sprotty in the best possible way. I already have a Spring backend written in Kotlin which (among other things) holds several EMF-based models (plain emf, sry no xtext :/). My first thought was to simply expose the models and underlying ecore using a REST interface, consume everything in a separate node.js frontend relying on the Sprotty client and, thus, achieve a nice decoupled visual representation accessible with a browser. But, while running the Sprotty client examples and doing some reading, I stumbled upon the Sprotty server and corresponding (Theia-Xtext-Sprotty example). Now I am a little bit puzzled...

The possibility to the computational heavy lifting on the server side seems appealing, meaning I guess I should integrate the sprotty server and ELK somehow in the existing Kotlin backend? Is there a tutorial which exemplifies this? Or did I got it all wrong and the Sprotty server should be run separately? Or should I stick solemnly to the Sprotty client?

Would be awesome to get some pointers :)!
Re: Integrating Sprotty-server into existing Spring application? [message #1830940 is a reply to message #1830911] Fri, 07 August 2020 06:16 Go to previous messageGo to next message
Miro Spönemann is currently offline Miro SpönemannFriend
Messages: 78
Registered: March 2015
Location: Kiel, Germany
Member

Hi! The Sprotty server should be integrated in the same backend application that holds the data. The server is responsible for fetching data, transforming it into a Sprotty model, and sending it to the client.

A REST API would be possible, but it's better to use a websocket so the server can notify the client when new data is available. There's a very simple example in sprotty-server that shows how to do it:
https://github.com/eclipse/sprotty-server/tree/master/examples

You could also have a look at EMF.cloud (https://www.eclipse.org/emfcloud/) in conjunction with GLSP (https://www.eclipse.org/glsp/).
Re: Integrating Sprotty-server into existing Spring application? [message #1830955 is a reply to message #1830940] Fri, 07 August 2020 09:57 Go to previous message
Jonas Sorgalla is currently offline Jonas SorgallaFriend
Messages: 10
Registered: September 2015
Location: Dortmund, Germany
Junior Member
Thanks Miro for the quick reply :)! I'll have a look next week and (hopefully) report back about my success :D
Previous Topic:Installation and integration with eclipse sirius web
Next Topic:Sprotty from Graphical Change to Text
Goto Forum:
  


Current Time: Thu Dec 12 21:25:53 GMT 2024

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

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

Back to the top