this.class.classLoader.parseClass("C:/IBM/RationalSDLC/ClearQuest/snakeyaml-1.9.jar")
import jenkins.model.Jenkins
import org.yaml.snakeyaml.*
import org.yaml.snakeyaml.constructor.*
import java.util.Map
def jenkinsHome = Jenkins.instance.getRootDir()
def fp = "d:\\Jenkins\\userContent\\Chn\\info\\newcomp\\compconfig\\"
def fn = binding.variables.get('Composer_servers')
def f1 = [fp,fn]
def f2 = f1.join("")
def f3 = "d:\\Jenkins\\userContent\\Chn\\info\\newcomp\\compconfig\\temxpxx.txt"
def yaml = new Yaml()
def map
pr = new File(f2).text
Yaml configyml = new Yaml()
map = configyml.load(pr)
html ="<FONT FACE=\"Courier New\" size = \"3\" color=\"red\"><U><b>${map.keySet()}</b></U></FONT>"
map.each {k, v ->
v.each {x, y ->
html = html + "<br></br><FONT FACE=\"Courier New\" size = \"3\" color=\"green\"><u>${x}</u></FONT>"
y.each {
it.each {p, q ->
if (p =~ /item/ ){
html = html + "<FONT FACE=\"Courier New\" size = \"3\" color=\"indigo\"><br></br>" }
else {
html = html + "<FONT FACE=\"Courier New\" size = \"3\" color=\"blue\"><br></br>" }
html = html + "<B>"+p.padRight(28,'.')+"</B></FONT>"
if (p != 'item') {
html = html + "<textarea name=\"text\" cols=\"40\" rows = \"1\">"
html = html+"${q}"
html = html+"</textarea>"
}
}
}
}
}
return "<input name= \"value\" value = \"${html}\" class=\"setting-input\" type=\"text\">"
From: Leslie Klein <klei...@gmail.com>
To: BioUno Developers <biouno-d...@googlegroups.com>
Sent: Monday, 4 April 2016 5:24 PM
Subject: Empty HTML with AC Reactive Reference parameter passing in Job
HiI am reading a YAML file, parsing into html and updating the values. This is working fine with the AC Reactive Reference parameter. But when I try to pass html that has been updated (to write the original YAML file using another AC ref parameter), it contains only "FONT FACE". What seems to be happening is that the first equal sign in the code (after FONT FACE) is parsing value of html. Choice type is Formatted HTML The input YAML file is referenced from binding.variables.get('Composer_servers')TIA
this.class.classLoader. parseClass("C:/IBM/ RationalSDLC/ClearQuest/ snakeyaml-1.9.jar")
import jenkins.model.Jenkinsimport org.yaml.snakeyaml.*import org.yaml.snakeyaml.constructor .*import java.util.Mapdef jenkinsHome = Jenkins.instance.getRootDir()def fp = "d:\\Jenkins\\userContent\\ Chn\\info\\newcomp\\compconfig \\"def fn = binding.variables.get(' Composer_servers')def f1 = [fp,fn]def f2 = f1.join("")def f3 = "d:\\Jenkins\\userContent\\ Chn\\info\\newcomp\\ compconfig\\temxpxx.txt"def yaml = new Yaml()def mappr = new File(f2).textYaml configyml = new Yaml()map = configyml.load(pr)
html ="<FONT FACE=\"Courier New\" size = \"3\" color=\"red\"><U><b>${map. keySet()}</b></U></FONT>"
map.each {k, v ->v.each {x, y ->html = html + "<br></br><FONT FACE=\"Courier New\" size = \"3\" color=\"green\"><u>${x}</u></ FONT>"y.each {it.each {p, q ->if (p =~ /item/ ){html = html + "<FONT FACE=\"Courier New\" size = \"3\" color=\"indigo\"><br></br>" }else {html = html + "<FONT FACE=\"Courier New\" size = \"3\" color=\"blue\"><br></br>" }html = html + "<B>"+p.padRight(28,'.')+"</B> </FONT>"if (p != 'item') {html = html + "<textarea name=\"text\" cols=\"40\" rows = \"1\">"html = html+"${q}"html = html+"</textarea>"}}}}}return "<input name= \"value\" value = \"${html}\" class=\"setting-input\" type=\"text\">"
--
You received this message because you are subscribed to the Google Groups "BioUno Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biouno-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sent: Thursday, 7 April 2016 12:08 AM
Subject: Re: Empty HTML with AC Reactive Reference parameter passing in Job
Hi Bruno,you are right about the encoding, changing the return value of the html toreturn "<input name= \"value\" value = \"${URLEncoder.encode(html,"UTF-8")}\" class=\"setting-input\" type=\"text\">"does pass the string in the build. However, the html is invalidated and cannot be rendered within the AC control.Thanks
Leslie
On Monday, April 4, 2016 at 8:24:43 AM UTC+3, Leslie Klein wrote:
HiI am reading a YAML file, parsing into html and updating the values. This is working fine with the AC Reactive Reference parameter. But when I try to pass html that has been updated (to write the original YAML file using another AC ref parameter), it contains only "FONT FACE". What seems to be happening is that the first equal sign in the code (after FONT FACE) is parsing value of html. Choice type is Formatted HTML The input YAML file is referenced from binding.variables.get('Co mposer_servers')TIAthis.class.classLoader. parseClass("C:/IBM/ RationalSDLC/ClearQuest/ snakeyaml-1.9.jar")
import jenkins.model.Jenkinsimport org.yaml.snakeyaml.*import org.yaml.snakeyaml.constructor .*import java.util.Mapdef jenkinsHome = Jenkins.instance.getRootDir()def fp = "d:\\Jenkins\\userContent\\ Chn\\info\\newcomp\\compconfig \\"def fn = binding.variables.get(' Composer_servers')def f1 = [fp,fn]def f2 = f1.join("")def f3 = "d:\\Jenkins\\userContent\\ Chn\\info\\newcomp\\ compconfig\\temxpxx.txt"def yaml = new Yaml()def mappr = new File(f2).textYaml configyml = new Yaml()map = configyml.load(pr)
html ="<FONT FACE=\"Courier New\" size = \"3\" color=\"red\"><U><b>${map. keySet()}</b></U></FONT>"
map.each {k, v ->v.each {x, y ->html = html + "<br></br><FONT FACE=\"Courier New\" size = \"3\" color=\"green\"><u>${x}</u></ FONT>"y.each {it.each {p, q ->if (p =~ /item/ ){html = html + "<FONT FACE=\"Courier New\" size = \"3\" color=\"indigo\"><br></br>" }else {html = html + "<FONT FACE=\"Courier New\" size = \"3\" color=\"blue\"><br></br>" }html = html + "<B>"+p.padRight(28,'.')+"</B> </FONT>"if (p != 'item') {html = html + "<textarea name=\"text\" cols=\"40\" rows = \"1\">"html = html+"${q}"html = html+"</textarea>"}}}}}return "<input name= \"value\" value = \"${html}\" class=\"setting-input\" type=\"text\">"
--