change output filename for RootTemplate

  • 4
  • 13

In a generator root node, I am trying to generate the same output filename for different models. I found a way to specify the file extension with TextGen, but I also need to change the filename. It looks like the filename must be the name of the concept as defined in the generator. Is there a way to override this?
Hm, are you using the generator or the textGet?

I am using a generator with root nodes that eventually convert to text with
TextGen.

Under Generator:

Root A
Root B

The type of either A or B uses TextGen and writes to a file called
A.extension, B. extension.
I would like instead to write to C.extension. Only A or B can be generated
at any time with a switch template. The content of these files depend on
some property of an input node. However, I need the content to go to the
same destination filename.

Any idea how to do this? Thanks, Fabien




On Thu, Jul 11, 2013 at 5:22 AM, Jens Nerche - Meta Programming System <
jetforum@jetbrains.com> wrote:

* Meta Programming System<http://forum.jetbrains.com/forum/Meta-Programming-System>
* > * change output filename for RootTemplate<http://forum.jetbrains.com/thread/Meta-Programming-System-864>
* 5:22 am<http://forum.jetbrains.com/thread/Meta-Programming-System-864?message=Meta-Programming-System-864-1> Jens
Nerche <http://forum.jetbrains.com/user/jensnerche>

Hm, are you using the generator or the textGet?

Fabien Campagne <http://forum.jetbrains.com/user/Fabien%20Campagne> @ Jul
10 <http://forum.jetbrains.com/thread/Meta-Programming-System-864>

In a generator root node, I am trying to generate the same output filename
for different models. I found a way to specify the file extension with
TextGen, but I also need to change the filename. It looks like the filename
must be the name of the concept as defined in the generator. Is there a way
to override this?

JetBrains Forum | Build #171 (Jun/07/2013 10:26AM) | Feedback<http://confluence.jetbrains.net/display/JETF/Feedback>




--
Fabien Campagne, PhD – http://campagnelab.org

Assistant Professor, Dept. of Physiology and Biophysics
Institute for Computational Biomedicine
Associate Director, Biomedical Informatics Core,
Clinical Translational Science Center

Weill Medical College of Cornell University
phone: (646)-962-5613 1305 York Avenue
fax: (646)-962-0383 Box 140
New York, NY 10021

Do you speak next-gen?

See how GobyWeb can help simplify your NGS projects at
http://gobyweb.campagnelab.org

Sounds like you simply may use a property macro in the generator. The same works e.g. for baseLanguage: this eventually uses textGen for generating text, but if ClassConcept is used as a generator root template, the name can be determined by a property macro.

Simple and elegant. It works. Thanks.


On Thu, Jul 11, 2013 at 9:10 AM, Jens Nerche - Meta Programming System <
jetforum@jetbrains.com> wrote:

* Meta Programming System<http://forum.jetbrains.com/forum/Meta-Programming-System>
* > * change output filename for RootTemplate<http://forum.jetbrains.com/thread/Meta-Programming-System-864>
* 9:09 am<http://forum.jetbrains.com/thread/Meta-Programming-System-864?message=Meta-Programming-System-864-3> Jens
Nerche <http://forum.jetbrains.com/user/jensnerche>

Sounds like you simply may use a property macro in the generator. The same
works e.g. for baseLanguage: this eventually uses textGen for generating
text, but if ClassConcept is used as a generator root template, the name
can be determined by a property macro.

Fabien Campagne <http://forum.jetbrains.com/user/Fabien%20Campagne> @ 8:20
am<http://forum.jetbrains.com/thread/Meta-Programming-System-864?message=Meta-Programming-System-864-2>

I am using a generator with root nodes that eventually convert to text with
TextGen.

Under Generator:

Root A
Root B

The type of either A or B uses TextGen and writes to a file called
A.extension, B. extension.
I would like instead to write to C.extension. Only A or B can be generated
at any time with a switch template. The content of these files depend on
some property of an input node. However, I need the content to go to the
same destination filename.

Any idea how to do this? Thanks, Fabien




On Thu, Jul 11, 2013 at 5:22 AM, Jens Nerche - Meta Programming System <
jetforum@jetbrains.com> wrote:

* Meta Programming System<
http://forum.jetbrains.com/forum/Meta-Programming-System>
* > * change output filename for RootTemplate<
http://forum.jetbrains.com/thread/Meta-Programming-System-864>
* 5:22 am<
http://forum.jetbrains.com/thread/Meta-Programming-System-864?message=Meta-Programming-System-864-1>
Jens
Nerche <http://forum.jetbrains.com/user/jensnerche>

Hm, are you using the generator or the textGet?

Fabien Campagne <http://forum.jetbrains.com/user/Fabien%20Campagne> @ Jul
10 <http://forum.jetbrains.com/thread/Meta-Programming-System-864>

In a generator root node, I am trying to generate the same output filename
for different models. I found a way to specify the file extension with
TextGen, but I also need to change the filename. It looks like the filename
must be the name of the concept as defined in the generator. Is there a way
to override this?

JetBrains Forum | Build #171 (Jun/07/2013 10:26AM) | Feedback<
http://confluence.jetbrains.net/display/JETF/Feedback>





Fabien Campagne, PhD – http://campagnelab.org

Assistant Professor, Dept. of Physiology and Biophysics
Institute for Computational Biomedicine
Associate Director, Biomedical Informatics Core,
Clinical Translational Science Center

Weill Medical College of Cornell University
phone: (646)-962-5613 1305 York Avenue
fax: (646)-962-0383 Box 140
New York, NY 10021

Do you speak next-gen?

See how GobyWeb can help simplify your NGS projects at
http://gobyweb.campagnelab.org

JetBrains Forum | Build #171 (Jun/07/2013 10:26AM) | Feedback<http://confluence.jetbrains.net/display/JETF/Feedback>




--
Fabien Campagne, PhD – http://campagnelab.org

Assistant Professor, Dept. of Physiology and Biophysics
Institute for Computational Biomedicine
Associate Director, Biomedical Informatics Core,
Clinical Translational Science Center

Weill Medical College of Cornell University
phone: (646)-962-5613 1305 York Avenue
fax: (646)-962-0383 Box 140
New York, NY 10021

Do you speak next-gen?

See how GobyWeb can help simplify your NGS projects at
http://gobyweb.campagnelab.org