Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext Web: generate and save(The requested generator artifact was not found.)
Xtext Web: generate and save [message #1805453] Mon, 15 April 2019 13:50 Go to next message
Markus Häge is currently offline Markus HägeFriend
Messages: 56
Registered: August 2018
Member
Hi again.
I try to generate my dsl and save it on disk via xtext web-editor and 'generate' button. The File-name is created in the generator.
fsa.generateFile(e.getName() ,e.compile)
i have to pass a folder but when i press the generate button i get the following message: "The requested generator artifact was not found."
I read s.th. in https://www.eclipse.org/forums/index.php/t/1076582/ but the addition of artifact : 'foo' and other things like filename and path doesn't work.
Where I have to implement the persistence of the generator or is it already there? How does it work?

Thanks again,
Markus
Re: Xtext Web: generate and save [message #1805454 is a reply to message #1805453] Mon, 15 April 2019 13:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i am not sure if i can follow you. nothing has changed since that post.
and there is no to-disk. you dont even say which disk (server, client) you mean


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext Web: generate and save [message #1805455 is a reply to message #1805454] Mon, 15 April 2019 13:54 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
besides that: is always helps to read and debug code.
GeneratorService in this case.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext Web: generate and save [message #1805456 is a reply to message #1805455] Mon, 15 April 2019 14:23 Go to previous messageGo to next message
Markus Häge is currently offline Markus HägeFriend
Messages: 56
Registered: August 2018
Member
I need a "to disk" on client side.
Debugging is difficult. I exported it and in the runtime env i have no sources, just compiled jars.
I send the request with jquery:

jQuery('#generate-button').bind("click", function(e) {
var data = {
serviceType: 'generate',
artifact : $("#PolWi").val(),
resource: $("#PolWi").val() + '.mydsl',
project: $("#PolProj").val(),
fullText: editor.getValue(),
contentType: 'text'
};
console.log(data);
jQuery.post('http://localhost:84/polarion/xtext-service', data, function(result) {
console.log("xxx");
});

I look for a way to save the generated file on a folder on client side.
Thanks
Re: Xtext Web: generate and save [message #1805457 is a reply to message #1805456] Mon, 15 April 2019 14:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i still cannot follow you.
the service allows you to send the generates to the client.
does this work. does it not?
please debug the generator service.
this should be a nobrainer with the launcher main
see also https://github.com/eclipse/xtext-web/blob/e865e71effc149f3c2255bded0c8674afb2fdce8/org.eclipse.xtext.web/src/test/java/org/eclipse/xtext/web/server/test/GeneratorTest.xtend
i also dont see what the values for artifact etc as


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 15 April 2019 14:31]

Report message to a moderator

Re: Xtext Web: generate and save [message #1805464 is a reply to message #1805457] Mon, 15 April 2019 15:46 Go to previous messageGo to next message
Markus Häge is currently offline Markus HägeFriend
Messages: 56
Registered: August 2018
Member
I got it with the artifact. it's the name of of the generated file.
I have result in the response of my browser. But it doesn't compile properly, i get s.th. like

testcase �domainmodel.gName()�()
{
//PreCondition
�FOR pre : domainmodel.eAllContents.toIterable.filter(PreCondition)�
�FOR fun: pre.function�
�fun�
�ENDFOR�
�ENDFOR�

�FOR ts : domainmodel.eAllContents.toIterable.filter(TestStep)�
//Teststep �ts.number�
�ts.compile�
�ENDFOR�

It worked when i tested my dsl in eclipse and it's editor
Re: Xtext Web: generate and save [message #1805468 is a reply to message #1805464] Mon, 15 April 2019 16:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
are you sure your encoding is correct when you compile the generator on command line?
how do you build it.
what is the default encoding on your machine?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 15 April 2019 16:32]

Report message to a moderator

Re: Xtext Web: generate and save [message #1805898 is a reply to message #1805468] Sat, 27 April 2019 06:42 Go to previous messageGo to next message
Markus Häge is currently offline Markus HägeFriend
Messages: 56
Registered: August 2018
Member
I compile with this instructions on a windows 7 machine to get a war, which i import in my project. I don't find out default encoding for my machine. Just Google results
Sorry for the delayed answer, i was busy.

1) create new project
(2) deselect eclipse
(3) select web
(4) select gradle
(5) go to org.xtext.example.mydsl.parent
(6) ./gradlew clean build -x test (might need workaround for eclipse/xtext: Fehler-Nr. 1231)
(7)go to org.xtext.example.mydsl.parent/org.xtext.example.mydsl.web/build/libs
(8) get a war
Re: Xtext Web: generate and save [message #1805900 is a reply to message #1805898] Sat, 27 April 2019 09:18 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
https://github.com/xtext/xtext-gradle-plugin/blob/3ec57eafa93a4ba79df58427656694c828ed3a08/xtext-gradle-plugin/src/main/java/org/xtext/gradle/XtextBuilderPlugin.xtend

You can set it explicitly in the java or the plugin options
Or you set a platform encoding somehow (win specific)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:On using XtextAntlrGeneratorFragment2 in work flow getting java.lang.IllegalStateException
Next Topic:How to let Quick Outline differ from Outline?
Goto Forum:
  


Current Time: Thu Apr 18 20:36:11 GMT 2024

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

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

Back to the top