Sirius - Create graphical interface to xtext template language - dsl

in my project we use a Xtext template language to create some documents.
Similar to whats written here:
https://www.eclipse.org/Xtext/documentation/207_template.html
So basically a template starts with a « and ends with a »
In between we call xtend functions which define what will be visible in the output html document.
We would like to add a graphical editor to the already existing textual one.
I saw that Sirius can interact with Xtext and found the examples quite interesting.
What I could not figure out was how to tell Sirius to use my already existing xtend functions.
My question is: Is there a way to create a graphical interface for a xtedt template language with sirius or am i running in a dead end?
Thanks in advance

This seems doable, however it is not clear what you mean by "how to tell Sirius to use my already existing xtend functions". Maybe you could start by providing an example of what your templates look like, and the kind of representation you expect to have.
If I refer to the Xtext example you link, an Xtend function call in your template is an XBlockExpression. You would thus need to specify in Sirius an adequate representation for this metaclass.
Links that may help can be found here: https://www.eclipse.org/forums/index.php/t/1090448/

Related

How to specify the items in reference list using BibTeX? ChemPhysChem LaTeX requirement

I'm revising a manuscript for ChemPhysChem. They just provided a very simple templet here. However, I have some problems meeting the requirement:
Please follow our house style for references for example: [1] X. Y.
Name, A. B. Name, J. Abbr. 2016, 5, 111-120.
This kind of reference hides the title, and I can not find an existing style to meet the need.
I am using the following latex script:
\documentclass{article}
\usepackage[sorting=none, backend=biber]{biblatex}
\addbibresource{ref_r.bib}
What do I need to do to solve the problem? Do I really need to build a new .bst file? Could anyone share their experience on submitting manuscripts on ChemPhysChem using LaTeX?
Don't use biblatex for journal submissions unless your publisher explicitly states that they do accept it. While it is a nice and flexible tool, biblatex is not yet the standard.
Just follow the instructions from the template and use
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%alternatively you may use
\bibliographystyle{unsrt}
\bibliography{mymanuscript.bib}
%and send the .bib file along with your manuscript
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Don't worry if the resulting style might be a bit different from their requirement, they won't use it anyway but convert your source files with their pipeline.
I changed to my latex using BibTeX back, and built a cpc.bst file for ChemPhysChem using the following command with the help of the youtube video:
latex makebst
It would not be that hard to create the bibliography style file using the guide of the above-mentioned video.
And the result looks like
this.

How can I use dynamic values in a language generation template?

I would like to re-use a given set of "language generation" sentences in bot composer, while filling it with localized values.
See my example execution + LG template, which does not work.
--> the target LG template
${defaultResponse("Yes")}
--> the source LG template
defaultResponse(defaultValue)
I did not understand your input, so I have made a decision for you and answered the question with "${defaultValue}".
Any idea what I do wrong? I do not find something similar in the documentation.
To create bot with different languages, there is a function called Multilingual support. It's introduced in document here: https://learn.microsoft.com/en-us/composer/how-to-use-multiple-language
The structure looks like as below when you created bot with Chinese and English.
/coolbot
coolbot.dialog
/language-generation
/en-us
common.en-us.lg
coolbot.en-us.lg
/zh-cn
common.zh-cn.lg
coolbot.zh-cn.lg
/language-understanding
/en-us
coolbot.en-us.lu
/zh-cn
coolbot.zh-cn.lu

Automatically generate graphical documentation for XSD like XmlSpy does

I would like to generate a graphical documentation of some XSD files (XML schema definition).
I know, there are a few projects that do a good job generating a textual documentation. But I use XmlSpy and I really love the tree that I get when I click on "print".
I would like to generate this automatically on a continuous integration server.
The question is: how can I get this scripted? I found a forum post that sais "it's possible", but I don't have a clue where to start.
EDIT: the focus here is doing it from the command line rather than having a graphical editor.
Some ideas:
You may like Xsdvi, which converts an input XSD into an SVG diagram like this one (which I think is a logical choice: it's an XML to XML conversion). It is simple to use and its output can be rendered to any scale, it is SVG after all.
This tool was mentioned in this off-topic and deleted post (requires 20k+ rep to view). And there's XSDiagram, check it out.
Apparently, JDeveloper can be used for this, as this post shows, which is free for registered users.
I have not tried any of these, I'm happy with what oXygen provides. Try them out. Be aware that asking for tools is typically off-topic on StackOverflow, though continuous-integration is not (hence I decided to answer anyway).
You can also use the stylesheets from the XS3P project. You can apply them using a standard XSLT transformation engine (Saxon...).
Thanks to #Abel for pointing me to XSD Diagram. Since version 1.0 this program can also write the annotations into the generated image.
I am using it in the following way now:
XSDDiagramConsole.exe -o picture.png -r rootnode -d -y -e 10 schema.xsd

ExtLibUtil documentation - where do you find what the available functions are?

As I have asked questions in this form - thanks for your many helpful answers - i have found many really neat things that one can do using ExtLibUtil.???? however, other than a bit here and a bit there I have not found anything that gives a listing on the various functions. I one post I read that it is all in the source of the extension Library, and it might be if you really understand where in the source to look. Sure would appreciate a pointer and starting point.
I've been unable to find a JavaDoc for it. The library slipped passed us when we wrote the book - certainly I was not as au fait with Java to be aware of it and all the strength within it. So the best option currently is to look at the source code in Eclipse. Many of the methods are helper methods to easily access things like viewScope etc, which is easy from SSJS but less easy from Java. Most are pretty self-explanatory.
Content assist doesn't seem to work from SSJS, but will from any Java class or, alternatively, open up one of the Java classes created for XPages / Custom Controls under the "local" package in Package Explorer, type "ExtLibUtil." in any method and you'll see the list.

wizard that create code in multiple programming languages

as part of our application i need to build component that will output code in php and asp
that have the same functionality ( and maybe latter jsp ) .
how can i design this kind of component to be generic as possible ?
You need to be able to create a parse tree out of all input languages.
For each output language, you will need to create a set of tree transforming grammar.
You may also require a runtime library to help translate routines that are not available in your output language.
I would personally go with the Strategy Pattern. You could have a master code maker class and instantiate it with a strategy.
PHPCodeStrategy
ASPCodeStrategy
Then each would have a method called execute maybe. Bu then you could add further strategies down the line and extend your application.
Andrew

Resources