Jenkins text parameter rebuild - jenkins

I'm using the text parameter to get multi line parameters, and write them to file.
If I use the rebuild, the text parameter is loaded as a single line string (where newline is removed).
Does anyone have an idea on how to fix this? I guess the rebuild plugin is the problem...

The multi-line text parameter seems to be rather buggy. One workaround you may consider is to substitute newlines with some custom escape system and then convert the escape sequences back to newlines inside your build.
A more advanced solution would be to modify the plugin itself to convert the escape sequences into newlines and use that modified plugin in your Jenkins. I've done that sort of thing for Claim Plugin to display failed matrix jobs which it did not do on its own. If you decide to take this route I can walk you through the main steps.

I have just enhanced the plugin to add TextParameterValue.jelly
That works fine, since text and textarea are not that different except new lines just use StringParameterValue.jelly as template and use <f:textarea name="value" value="${it.value}" /> instead of <f:textbox name="value" value="${it.value}" />

Related

How do I specify tab(\t) as a separator for text in a Dataflow Template?

There are some Dataflow templates that support Column delimiter of the data files as an optional parameter (for instance, the template loading Text Files into Spanner), but I am unable to pass tabulator (i.e. \t) as a column delimiter. How do I do this?
There was a bug in the Dataflow UI that made it impossible to pass escaped characters to a Dataflow template.
Gladly, this is no longer the case. To specify tab as a delimiter, you can simply pass \\t, and the template will work as expected.
For passing any other parameter, note that you can escape any character. (e.g. \\n, \\t, etc).

Easiest way to render an Integer without thousands separator when using Fields plugin 2.0.2

I'm building a very basic app using Grails 3.0.2.
I have a domain class called Unit which contains, among others, a field called season, whose type is Integer and represents a year.
I have used the command generate-views to generate the scaffolded views.
Once running the application, when an existing instance is shown, the season is displayed using "," as thousands separator, and I want to remove it.
What is the easiest way to override (only) the format of the season?
For testing purposes, I have modified the show.gsp of the Unit class in the following manner:
<f:with bean="unit">
<f:display />
<f:display property="season" />
</f:with>
The <f:display property="season" /> displays simply "1,975", but ignores the label.
I've tried to understand the documentation of the Fields plugin, but I do not achieve what I want so it's obvious that I do not understand it.
I have added _displayWidget.gsp under views/_fields/unit/season (I have also tried under views/unit/season), but the outcome is exactly the same than before, so I assume the plugin is not taking them into account.
<g:formatNumber groupingUsed="false" number="${value}" />
I am not familiar with the _displayWidget.gsp convention, but a simpler approach might be to override the display of the unit.season property by adding a _display.gsp under views/_fields/unit/season containing just the following:
${value}
Diego, you can format any given number using the taglib formatNumber:
https://grails.github.io/grails-doc/latest/ref/Tags/formatNumber.html
Use the param 'format' and check the DecimalFormat patterns to find the one that suits fine for you.
Hope it helps!
I was able to get this working in Grails 3.1.14 by creating views/_fields/myDomainClass/myFieldName/_displayWrapper.gsp and containing a single line of ${value}

Change format of inline code evaluation in org-mode's LaTeX-export

I have a code block in an org document
#+NAME: result_whatever
#+BEGIN_SRC python :session data :results value :exports none
return(8.1 - 5)
#+END_SRC
which I evaluate inline:
Now, does this work? Let's see: call_result_whatever(). I'd be surprised ...
When exporting to LaTeX, this generates the following:
Now, does this work? Let's see: \texttt{3.1}. I'd be surprised \ldots{}
However, I don't want the results to be displayed in monospace. I want it to be formatted in "normal" upright font, without any special markup.
How can I achieve this?
You should be able to get it work using the optional header arguments which can be added to call_function().
I don't have LaTeX installed on this system so can't fully test the outputs to ensure they come out exactly as desired, I'm using the plain text output to compare instead. However you can use the following syntax as part of your call to modify the results.
Now, does this work? Let's see call_results_whatever()[:results raw].
I'd be surprised ...
Without the [:results raw] the output to Plain Text (Ascii buffer) is Let's see `3.0999999999999996'.. With the added results it becomes Let's see 3.0999999999999996.
For full details of the available results keywords as well as other optional header arguments for the inline blocks please see Evaluation Code Blocks and Results arguments.
this is 5 years later. apparently in org-mode 8.2 or so, a new variable was introduced (documenting in "Evaluating Code Blocks" in the org-mode manual, but this from etc/ORG-NEWS in the source tree):
*** New option: org-babel-inline-result-wrap
If you set this to the following
: (setq org-babel-inline-result-wrap "$%s$")
then inline code snippets will be wrapped into the formatting string.
so, to eliminate \texttt{}
(setq org-babel-inline-result-wrap "%s")
The problem of this type can be solved in two ways:
1: Easy does it:
A plain query-replace on the exported buffer.
Once you're in the LaTeX buffer,
beginning-of-buffer or M-<
query-replace or M-%
enter \texttt as the string that you want to replace
enter nothing as the replacement
continue to replace each match interactively
with y/n or just replace everything with !
2: But I wanna!
The second way is to nag the org-mode mailing list into
implementing a switch or an option for your specific case.
While it's necessary sometimes, it also produces a system
with thousands of switches, which can become unwieldy.
You can try, but I don't recommend.

Odt file, shown with all styles

I'm using odt file as some kind of template and Libre Office as tool to create this template. It usually works fine except one thing.
Let assume our odt file has a paragraph of text.
There is my text.
XML file may or may not look (seems random) like this (messy, not very good thing for for parsing or as a template):
<text:p text:style-name="P7">There is</text:p><text:p text:style-name="P7"> my text<text:p text:style-name="P7">.</text:p></text:p>
Sometimes it's (again seems random) like this (expected result, makes sense after all):
<text:p text:style-name="P7">There is my text.</text:p>
Is there any way to get rid superfluous xml tags? Or at least can user see a raw document in LibreOffice/OpenOffice to manually remove redundancy?
The key is to provide easy tool for a user, to detect and fix artefacts like this.
Have you tried Ctrl-M? If all formatting is defined in styles and style formatting is not manually overridden, it should not disturb the formatting but should remove redundant tags.
A tedious user process would be to cut and paste-special as text and apply style again.
Finally, a macro would definitely do the trick.

Multiline Messages in Message Bundles

I would like to make use of the message bundles feature in grails, but always run into the problem that I need multiline messages for text (instructions or help text for example).
Is there a way to create multiline messages or do I have to create single line messages with <br />s or \ns in between?
Or is it the wrong approach for longer text?
I believe you can simply end the line with a trailing slash (\) and continue on the next line in Java Properties files.
See: http://www.rgagnon.com/javadetails/java-0503.html

Resources