This project contains a concept map in which you can build your own course. It provides the initial setup of the package architecture and environment for a GLSP diagram editor that uses ...
This project is structured as follows:
glsp-clientconceptmap-browser-app: browser client application that integrates the basic Theia plugins and the coceptmap specific glsp pluginsconceptmap-glsp: diagram client configuring the views for rendering and the user interface modulesconceptmap-theia: glue code for integrating the editor into Theiaworkspace: place where you can work to create your own course in addition to being able to import/export courses
glsp-serversrc: dependency injection module of the server and diagram configurationsrc/handler: handlers for the diagram-specific actionssrc/model: all conceptmap model, graphical model and model state related filessrc/launch: contains the Java GLSP server launchersrc/palette: custom palette item providersrc/marker: contains the source code of the model validartor that allows you to verify if you are building the course correctly- [
src/operations]: contains operations necessary for the correct functioning of some elements of the model to be built - [
src/editname]: contains the file in charge of verifying that the name of the elements is assigned according to the rules of the metamodel - [
src/action]: contains specific actions such as changing the position of the elements of the diagram
The most important entry points are:
glsp-client/conceptmap-glsp/src/conceptmap-diagram-module.ts: dependency injection module of the clientglsp-client/conceptmap-browser-app/package.json: Theia browser application definitionglsp-server/src/main/java/org/eclipse/glsp/example/javaemf/ConceptMapDiagramModule.java: dependency injection module of the server
The following libraries/frameworks need to be installed on your system:
The examples are heavily interweaved with Eclipse Theia, so please also check the prerequisites of Theia.
To install node.js for this project is recommended to install nvm to manage versions more easily and be able to install yarn easily:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bashOnce we have nvm installed we can install the version we need for node.js:
nvm install 16.14.0And also use it:
nvm use 16.14.0Finally we will install yarn thanks to npm with the following command:
nvm install -g yarnTo download Maven in its latest version, you must go to the official Maven website and download the compressed file
After this we will proceed to install the compressed file:
tar -xzvf apache-maven-{version}-bin.tar.gzThe problem we have now, especially in Linux systems, is that the default version of Java for Maven will be 11, so it is necessary to install version 17 or another
So we go to the official Java page to download the compressed file that contains Java.
Once we have downloaded the corresponding tablet for the system we have, we will proceed to install it:
sudo dpkg -i jdk-{version}-linux-x64-bin.debFinally we check the java versions in both java and maven to verify that there are no additional steps to do:
java -versionmvn --versionThis project template is compatible with Theia >=1.39.0.
The server component is built with maven and the client component is built with yarn.
A convenience script to build both is provided.
The project has been configured so that the project can be built in two different ways:
The first of them is the manual way by using yarn and maven:
yarn buildIn addition, it is also possible to build each component individually:
# Build only the glsp-client
yarn build:client
# Build only glsp-server
yarn build:serverThe second way to build the project is using the dockerfile provided:
docker build -t conceptmap .When building the client part, if we do not have these libraries installed, we will have errors
1.Libsecret-1-dev
sudo apt-get install libsecret-1-dev2.Napi.h
sudo apt-get install node-gyp build-essentialAfter this there should not be any type of error
To start the Theia browser application with the integrated conceptmap project, navigate to the client directory
cd glsp-clientand then execute:
yarn startAnother way to run the project is using the docker image built before:
docker run -d -p 3000:3000 --name my_container conceptmap
This will launch the project in the browser with an embedded GLSP server on localhost:3000.
To debug the involved components, the VS Code workspace offers launch configs, available in the Run and Debug view (Ctrl + Shift + D).
Here you can choose between four different launch configurations:
Launch ConceptMap GLSP Server
This config can be used to manually launch theConceptMap GLSP Serverjava process. Breakpoints in the source files of theglsp-serverdirectory will be picked up. In order to use this config, the Theia application backend has to be launched inExternalserver mode (seeLaunch ConceptMap Theia Backend (External GLSP Server)). If the GLSP server is started via this launch config, it is possible to consume code changes immediately in the running instance viaHot Code Replacein the Debug toolbar.Launch ConceptMap Theia Backend (External GLSP Server)
This config launches the Theia browser backend application but does not start the GLSP server as embedded process. Breakpoints in the source files of theglsp-client/**/nodedirectories will be picked up. It expects that the GLSP Server process is already running and has been started externally with theLaunch ConcetpMap GLSP Serverconfig.Launch ConceptMap Theia Backend (Embedded GLSP Server)
This config launches the Theia browser backend application and will start the GLSP server as embedded process which means you won't be able to debug the GLSP Server source code. Breakpoints in the source files of theglsp-client/**/nodedirectories will be picked up.Launch ConceptMap Theia backed with external GLSP Server
This is a convenience compound config that launches both the ConceptMap Theia backend in external server mode and the ConcetpMap GLSP server process. Enables debugging of both the glsp-client and glsp-server code simultaneously.Launch Theia Frontend
Launches a Google chrome instance, opens the Theia browser application athttp://localhost:3000and will automatically open an project workspace that contains aexample.coursefile. Double-click the file in theExplorerto open it with theConceptMap Diagram Editor. Breakpoints in the source files of theglsp-client/**/browserdirectories will be picked up.
For more information, please visit the Eclipse GLSP Umbrella repository and the Eclipse GLSP Website. If you have questions, please raise them in the discussions and have a look at our communication and support options.
