Trying to use the Xtext tool service in a cross origin configuration editor instances autocompletion and validation do not work. This was seen when setting up the new ep.mde-network.org domain and trying to use the Xtext tool on mdenet-ep.sites.er.kcl.ac.uk/tools/xtext.
Until this issue is solved, it will not be possible to create an activity using the Xtext tool service from another education platform instance on a different domain. Workaround:
Run an instance of the Xtext tool service on the education platform domain
Run the activity on the education platform of the Xtext service
Details
Configuring the Xtext tool services Access-Control-Allow-Origin headers to allow all origins in the following places the editor instances autocompletion and validation do not work due to CORS errors.
in editor server in header text/editorserver/src/config.js and for the tool static files hosted on the editor server tomcat
How the editor instance java service's CORS header is set and see if there is a way to set it to all origins "". The cors origin value may be being derived from the createEditor() parameter baseUrl and serviceUrl in which case require changes as per 3 alternatively there may be a way to override this in the generated java service war in web.xml similar to how CORS setttings are being set in xtext/acemodebundler/web.xml* or even globally overriding this globally in the editor server tomcat config.
Another thing I suspect would be the Xtext web editor createEditor() method that is called in XtextEditorPanel.initialize(). We may not be calling createEditor() correctly as per the documentation there are lots of options and there may also be some undocumented behaviour, so changing the parameters may be able get fully stateless working.
If something if something identifiable in createEditor() is preventing this from working it would be possible to customise it in platform/src/xtext/2.31.0/xtext-ace.js
Bigger changes would be to try different editors or Xtext's LSP.
Trying to use the Xtext tool service in a cross origin configuration editor instances autocompletion and validation do not work. This was seen when setting up the new ep.mde-network.org domain and trying to use the Xtext tool on mdenet-ep.sites.er.kcl.ac.uk/tools/xtext.
Until this issue is solved, it will not be possible to create an activity using the Xtext tool service from another education platform instance on a different domain. Workaround:
Details
Configuring the Xtext tool services
Access-Control-Allow-Origin
headers to allow all origins in the following places the editor instances autocompletion and validation do not work due to CORS errors.(There is a separate issue to use environment variables to configure these https://github.com/mdenet/platformtools/issues/38). .
Things to look into
How the editor instance java service's CORS header is set and see if there is a way to set it to all origins "". The cors origin value may be being derived from the
createEditor()
parameterbaseUrl
andserviceUrl
in which case require changes as per 3 alternatively there may be a way to override this in the generated java service war in web.xml similar to how CORS setttings are being set in xtext/acemodebundler/web.xml* or even globally overriding this globally in the editor server tomcat config.Another thing I suspect would be the Xtext web editor
createEditor()
method that is called inXtextEditorPanel.initialize()
. We may not be callingcreateEditor()
correctly as per the documentation there are lots of options and there may also be some undocumented behaviour, so changing the parameters may be able get fully stateless working.If something if something identifiable in createEditor() is preventing this from working it would be possible to customise it in platform/src/xtext/2.31.0/xtext-ace.js
Bigger changes would be to try different editors or Xtext's LSP.