本文整理汇总了Java中org.apache.commons.jelly.JellyContext类的典型用法代码示例。如果您正苦于以下问题:Java JellyContext类的具体用法?Java JellyContext怎么用?Java JellyContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JellyContext类属于org.apache.commons.jelly包,在下文中一共展示了JellyContext类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getIconFileName
import org.apache.commons.jelly.JellyContext; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public String getIconFileName() {
String iconClassName = getIconClassName();
if (iconClassName != null) {
Icon icon = IconSet.icons.getIconByClassSpec(iconClassName + " icon-md");
if (icon != null) {
JellyContext ctx = new JellyContext();
ctx.setVariable("resURL", Stapler.getCurrentRequest().getContextPath() + Jenkins.RESOURCE_PATH);
return icon.getQualifiedUrl(ctx);
}
}
return null;
}
开发者ID:jenkinsci,项目名称:gitea-plugin,代码行数:17,代码来源:GiteaLink.java
示例2: iconFileName
import org.apache.commons.jelly.JellyContext; //导入依赖的package包/类
public static String iconFileName(String name, Size size) {
Icon icon = icons.getIconByClassSpec(classSpec(name, size));
if (icon == null) {
return null;
}
JellyContext ctx = new JellyContext();
ctx.setVariable("resURL", Stapler.getCurrentRequest().getContextPath() + Jenkins.RESOURCE_PATH);
return icon.getQualifiedUrl(ctx);
}
开发者ID:Argelbargel,项目名称:gitlab-branch-source-plugin,代码行数:11,代码来源:GitLabSCMIcons.java
示例3: generateHtmlReport
import org.apache.commons.jelly.JellyContext; //导入依赖的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);
}
}
开发者ID:jenkinsci,项目名称:checkmarx-plugin,代码行数:28,代码来源:CxScanBuilder.java
示例4: getHtml
import org.apache.commons.jelly.JellyContext; //导入依赖的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>";
}
开发者ID:groupon,项目名称:DotCi,代码行数:13,代码来源:GithubRepoAction.java
注:本文中的org.apache.commons.jelly.JellyContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论