本文整理汇总了Java中org.apache.commons.jelly.XMLOutput类的典型用法代码示例。如果您正苦于以下问题:Java XMLOutput类的具体用法?Java XMLOutput怎么用?Java XMLOutput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLOutput类属于org.apache.commons.jelly包,在下文中一共展示了XMLOutput类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeLogTo
import org.apache.commons.jelly.XMLOutput; //导入依赖的package包/类
/**
* Used from <tt>console.jelly</tt> to write annotated log to the given output.
*
*/
public void writeLogTo(long offset, XMLOutput out) throws IOException {
try {
getLogText().writeHtmlTo(offset, out.asWriter());
} catch (IOException e) {
// try to fall back to the old getLogInputStream()
// mainly to support .gz compressed files
// In this case, console annotation handling will be turned off.
InputStream input = getLogInputStream();
try {
IOUtils.copy(input, out.asWriter());
} finally {
IOUtils.closeQuietly(input);
}
}
}
示例2: generateHtmlReport
import org.apache.commons.jelly.XMLOutput; //导入依赖的package包/类
private void generateHtmlReport(File checkmarxBuildDir, CxScanResult cxScanResult) {
jobConsoleLogger.info("Generating HTML report");
try {
//create output file report.html
File reportFile = new File(checkmarxBuildDir, "report.html");
OutputStream output = new FileOutputStream(reportFile);
XMLOutput xmlOutput = XMLOutput.createXMLOutput(output);
//jelly template file to set vars in
InputSource jellyTemplate = new InputSource(this.getClass().getClassLoader().getResourceAsStream("com/checkmarx/jenkins/CxScanResult/summary.jelly"));
//create jelly context for setting variables
JellyContext context = new JellyContext();
context.setVariable("it", cxScanResult);
context.setVariable("app", Jenkins.getInstance());
//run script
context.runScript(jellyTemplate, xmlOutput);
xmlOutput.flush();
jobConsoleLogger.info("HTML report created successfully");
} catch (Exception e) {
jobConsoleLogger.error("Failed to generate HTML report", e);
}
}
示例3: writeLogTo
import org.apache.commons.jelly.XMLOutput; //导入依赖的package包/类
public void writeLogTo(long offset, XMLOutput out) throws IOException {
try {
obtainLog().writeHtmlTo(offset, out.asWriter());
} catch (IOException e) {
// try to fall back to the old getLogInputStream()
// mainly to support .gz compressed files
// In this case, console annotation handling will be turned off.
InputStream input = getLogInputStream();
try {
IOUtils.copy(input, out.asWriter());
} finally {
IOUtils.closeQuietly(input);
}
}
}
示例4: getHtml
import org.apache.commons.jelly.XMLOutput; //导入依赖的package包/类
public String getHtml(ProjectConfigInfo projectConfigInfo) throws IOException, ClassNotFoundException, JellyException {
String name = getClass().getName().replace('.', '/').replace('$', '/') + "/" + "index.jelly";
URL actionTemplate = getClass().getClassLoader().getResource(name);
JellyContext context = new JellyContext();
context.setVariable("p", projectConfigInfo);
context.setVariable("it", this);
OutputStream outputStream = new ByteArrayOutputStream();
XMLOutput output = XMLOutput.createXMLOutput(outputStream);
context.runScript(actionTemplate, output);
output.flush();
return "<p>" + outputStream.toString() + " </p>";
}
示例5: writeLogTo
import org.apache.commons.jelly.XMLOutput; //导入依赖的package包/类
@Override
public void writeLogTo(long offset, XMLOutput out) throws IOException {
initPython();
if (pexec.isImplemented(50)) {
pexec.execPythonVoid("write_log_to", DataConvertor.fromLong(offset), out);
} else {
super.writeLogTo(offset, out);
}
}
示例6: writePollingLogTo
import org.apache.commons.jelly.XMLOutput; //导入依赖的package包/类
/**
* Writes the annotated log to the given output.
*/
public void writePollingLogTo(XMLOutput out) throws IOException {
new AnnotatedLargeText<>(getPollingLogFile(), Charset.defaultCharset(), true, this).writeHtmlTo(0, out.asWriter());
}
示例7: superWriteLogTo
import org.apache.commons.jelly.XMLOutput; //导入依赖的package包/类
public void superWriteLogTo(long offset, XMLOutput out) throws IOException {
super.writeLogTo(offset, out);
}
示例8: writeLogTo
import org.apache.commons.jelly.XMLOutput; //导入依赖的package包/类
/**
* Writes the annotated log to the given output.
*
* @param out XML output
* @throws IOException pudh up stack
*/
public void writeLogTo(XMLOutput out) throws IOException {
new AnnotatedLargeText<P4TriggerAction>(getLogFile(job), Charset.defaultCharset(), true, this).writeHtmlTo(0,
out.asWriter());
}