Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext Web Editor (Web Editor Installation/Tutorial and possible to create multiple dsl files?)
Xtext Web Editor [message #1734627] Fri, 10 June 2016 02:34 Go to next message
Eclipse UserFriend
Good morning all,

I'm currently working on a dsl for educational institutions. This DSL should provide features like describing course syllabi, program descriptions etc. Since the dsl should also be used by people who are not from the PC domain, i wanted to use the web editor.

However I did not manage to install one of the three Orion, Ace or CodeMirror after several hours of research and checks. Does there exist a tutorial for running one of these 3? Or could I get any help please?

Additionally I wanted to ask if the web editors provide the feature to create some sort of project explorer to create multiple files of my DSL? I've seen that dsl forge provides some sort of project explorer but I think it covers less functionalities than the Xtext web editors?

Thank you for any information and help
Benjamin
Re: Xtext Web Editor [message #1734628 is a reply to message #1734627] Fri, 10 June 2016 02:37 Go to previous messageGo to next message
Eclipse UserFriend
hi can you be a bit more specific on what you mean by the term "install"
Re: Xtext Web Editor [message #1734630 is a reply to message #1734628] Fri, 10 June 2016 02:38 Go to previous messageGo to next message
Eclipse UserFriend
p.s.: and no there is no multi file / project explorer thingy available out of the box right no - but we are working on it

[Updated on: Fri, 10 June 2016 02:39] by Moderator

Re: Xtext Web Editor [message #1734639 is a reply to message #1734627] Fri, 10 June 2016 03:04 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your fast reply, well actually I've added in the MWE2Workflow in the language section the webSupport section : Here the code
language = StandardLanguage {
			name = "lu.uni.lassy.messep.tesma.Tesma"
			fileExtensions = "tes"

			serializer = {
				generateStub = false
			}
			
			[i]webSupport = {
				generateHtmlExample = true
				framework = "CODEMIRROR"
			}[/i]

			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
			}



and I've changed the script section in the index.html file to
require.config({
		    paths: {
		        "jquery": "webjars/jquery/<version>/jquery.min",
		        "xtext/xtext-codemirror": "xtext/<version>/xtext-codemirror"
		    },
		    packages: [{
		        name: "codemirror",
		        location: "webjars/codemirror/<version>",
		        main: "lib/codemirror"
		    }]
		});
		require(["xtext/xtext-codemirror"], function(xtext) {
		    xtext.createEditor();
		});
		}

and then I've executed the jettyrun command, the server starts properly but the textbox is actually not editable in the web application, neither in chrome or safari.

In attachement, I've put a screenshot of the web browser.

Thank you in advance

[Updated on: Fri, 10 June 2016 03:05] by Moderator

Re: Xtext Web Editor [message #1734644 is a reply to message #1734639] Fri, 10 June 2016 03:20 Go to previous messageGo to next message
Eclipse UserFriend
first question: did you give it a try with ace first (default setup)?
was it working?

did you adapt build.gradle for the codemirror web jar to be downloaded.

when you open the browser and have a look at the javascript console - which errors do you get ?

do you get any errors in the console of the jettyrun?
Re: Xtext Web Editor [message #1734646 is a reply to message #1734644] Fri, 10 June 2016 03:31 Go to previous messageGo to next message
Eclipse UserFriend
and you may need to add a

def void configureIPreferenceValuesProvider(Binder binder) {
binder.bind(IPreferenceValuesProvider).annotatedWith(FormatterPreferences).to(FormatterPreferenceValuesProvider)
}

to the webmodule if you use xtext 2.10

i filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=495851

for that
Re: Xtext Web Editor [message #1734740 is a reply to message #1734646] Fri, 10 June 2016 16:17 Go to previous messageGo to next message
Eclipse UserFriend
Great Thank you for your help.. I made it actually run with the ACE standard version run after reinstalling a new Eclipse Java and updating with the Xtext update site. It was actually due to the low internet connection I had. It could not download a file (i do not remember the name) for making jettyrun run.



Re: Xtext Web Editor [message #1750943 is a reply to message #1734646] Mon, 02 January 2017 08:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian

Quote:
and you may need to add a

def void configureIPreferenceValuesProvider(Binder binder) {
binder.bind(IPreferenceValuesProvider).annotatedWith(FormatterPreferences).to(FormatterPreferenceValuesProvider)
}

to the webmodule if you use xtext 2.10

This is a very important piece of information. I have wasted 1 day figuring out my mistake. I recently downloaded Xtext 2.10 for using Xtext on Web. And i ran into this error which I could not find any help for. Now it's working fine.

Thanks for writing the solution.

Puneet

[Updated on: Mon, 02 January 2017 08:26] by Moderator

Re: Xtext Web Editor [message #1750945 is a reply to message #1750943] Mon, 02 January 2017 09:33 Go to previous messageGo to next message
Eclipse UserFriend
see https://github.com/eclipse/xtext-web/issues/5
issue is fixed in the upcoming 2.11 version
Re: Xtext Web Editor [message #1750982 is a reply to message #1750945] Tue, 03 January 2017 07:12 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian

I want to understand how the Xtext on the web works, the various artifacts that gets generated in the .web project, use of the three javascript editor libraries, how could I save files from the browser (like we did in the eclipse version). Do you have an architecture for the "web support" feature so that it is easier to understand the new concepts.

Thanks in advance,
Puneet
Re: Xtext Web Editor [message #1750985 is a reply to message #1750982] Tue, 03 January 2017 07:50 Go to previous messageGo to next message
Eclipse UserFriend
The Xtext Web integration is not an IDE. If you want to save any files, you need to take care of that yourself by extending the server implementation. See the documentation.
Re: Xtext Web Editor [message #1751212 is a reply to message #1750985] Thu, 05 January 2017 12:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Do I need to bind the IServerResourceHandler in WebModule code? Can you help me with a link that shows how I can implement the persistence mechanism? I am lost. I am also unable to run Orion editor. I can use the default ACE editor easily. I have seen the documentation on the official website but I do not think its sufficient to get a complete idea as to what is happening behind the curtains. I am very curious to know how the things are working within Xtext.

Thanks
:Puneet

[Updated on: Thu, 05 January 2017 12:19] by Moderator

Re: Xtext Web Editor [message #1751226 is a reply to message #1751212] Thu, 05 January 2017 15:09 Go to previous message
Eclipse UserFriend
Yes you can use the web module.
I don't know any public example besides this one
https://github.com/eclipse/xtext-web/blob/master/org.eclipse.xtext.web/src/main/xtend-gen/org/eclipse/xtext/web/server/persistence/FileResourceHandler.java
For Orion: did you download and extract the Orion javascript files?
Previous Topic:[Highlighting] override text style
Next Topic:Combining Xtext with a MySQL database
Goto Forum:
  


Current Time: Thu Apr 17 21:37:52 EDT 2025

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

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

Back to the top