ctx = new JellyContext(); ctx.setVariable("resURL", req.getContextPath() + Jenkins.RESOURCE_PATH); } else {
/** * Factory method to create a new child of this context */ protected JellyContext createChildContext() { return new JellyContext(this); }
/** * Factory method to create a new child of this context */ protected JellyContext createChildContext() { return new JellyContext(this); }
/** * Factory method to create a new child of this context */ protected JellyContext createChildContext() { return new JellyContext(this); }
/** * Factory method to create a new child of this context */ protected JellyContext createChildContext() { return new JellyContext(this); }
/** * Creates the Jelly context for executing the builder script. This method * is called by <code>setUpJellyContext()</code>. Its task is only the * creation of the context, not its initialization. * * @return the newly created context */ protected JellyContext createJellyContext() { return new JellyContext(); }
/** * The context to use */ public JellyContext getJellyContext() throws MalformedURLException { if (context == null) { // take off the name off the URL String text = getUrl().toString(); int idx = text.lastIndexOf('/'); text = text.substring(0, idx + 1); context = new JellyContext(getRootContext(), new URL(text)); } return context; }
/** * The context to use */ public JellyContext getJellyContext() throws MalformedURLException { if (context == null) { // take off the name off the URL String text = getUrl().toString(); int idx = text.lastIndexOf('/'); text = text.substring(0, idx + 1); context = new JellyContext(getRootContext(), new URL(text)); } return context; }
/** * The context to use */ public JellyContext getJellyContext() throws MalformedURLException { if (context == null) { // take off the name off the URL String text = getUrl().toString(); int idx = text.lastIndexOf('/'); text = text.substring(0, idx + 1); context = new JellyContext(getRootContext(), new URL(text)); } return context; }
/** * The context to use */ public JellyContext getJellyContext() throws MalformedURLException { if (context == null) { // take off the name off the URL String text = getUrl().toString(); int idx = text.lastIndexOf('/'); text = text.substring(0, idx + 1); context = new JellyContext(getRootContext(), new URL(text)); } return context; }
public void setUp() throws Exception { super.setUp(); jelly = new Jelly(); context = new JellyContext(); xmlOutput = XMLOutput.createDummyXMLOutput(); }
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>"; }
public void setUp() throws Exception { super.setUp(); jelly = new Jelly(); context = new JellyContext(); xmlOutput = XMLOutput.createDummyXMLOutput(); }
public void setUp() throws Exception { super.setUp(); jelly = new Jelly(); context = new JellyContext(); xmlOutput = XMLOutput.createDummyXMLOutput(); }
public void setUp() throws Exception { super.setUp(); jelly = new Jelly(); context = new JellyContext(); xmlOutput = XMLOutput.createDummyXMLOutput(); }
private JellyContext createContext(Object it, @Nonnull Run<?, ?> build, @Nonnull TaskListener listener) { JellyContext context = new JellyContext(); ExtendedEmailPublisherDescriptor descriptor = Jenkins.getActiveInstance().getDescriptorByType(ExtendedEmailPublisherDescriptor.class); context.setVariable("it", it); context.setVariable("build", build); context.setVariable("project", build.getParent()); context.setVariable("logger", listener.getLogger()); context.setVariable("rooturl", descriptor.getHudsonUrl()); return context; } }
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); }
@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; }
public void testSetVariablesAndRetainContextEntry() { final JellyContext jc = new JellyContext(); assertNotNull( "Initial variable of context", jc.getVariable( "context" ) ); jc.setVariables( new HashMap() ); assertNotNull( "Value after setVariables()", jc.getVariable( "context" ) ); } }
protected void runTest() throws Throwable { // create a new child context so that each test case // will have its own variable scopes JellyContext newContext = new JellyContext( context ); // disable inheritence of variables and tag libraries newContext.setExportLibraries(false); newContext.setExport(false); // invoke the test case getBody().run(newContext, output); } };