public static String encodeTo(Item item, String text) { return encodeTo('/'+item.getUrl(),text); }
/** * Returns the absolute URL of this item. This relies on the current * {@link StaplerRequest} to figure out what the host name is, * so can be used only during processing client requests. * * @return * absolute URL. * @throws IllegalStateException * if the method is invoked outside the HTTP request processing. * * @deprecated * This method shall <b>NEVER</b> be used during HTML page rendering, as it won't work with * network set up like Apache reverse proxy. * This method is only intended for the remote API clients who cannot resolve relative references * (even this won't work for the same reason, which should be fixed.) */ @Deprecated default String getAbsoluteUrl() { String r = Jenkins.getInstance().getRootUrl(); if(r==null) throw new IllegalStateException("Root URL isn't configured yet. Cannot compute absolute URL."); return Util.encode(r+getUrl()); }
} else { return normalizeURI(request.getContextPath()+'/'+p.getUrl());
@Override protected String getOwnerUrl() { return "/" + owner.getUrl(); } }
private static String getDetailsLink(StaplerRequest req, Item context, String fileId) { String link = req.getContextPath(); link = StringUtils.isNotBlank(context.getUrl()) ? link + "/" + context.getUrl() : link; link = link + "configfiles/show?id=" + fileId; String linkHtml = "<a target=\"_blank\" href=\"" + link + "\">view selected file</a>"; // 1x16 spacer needed for IE since it doesn't support min-height return "<div class='ok'><img src='" + req.getContextPath() + Jenkins.RESOURCE_PATH + "/images/none.gif' height=16 width=1>" + linkHtml + "</div>"; }
public HtmlPage getPage(Item item, String relative) throws IOException, SAXException { return goTo(item.getUrl()+relative); }
public static String encodeTo(Item item, String text) { return encodeTo('/'+item.getUrl(),text); }
public HtmlPage getPage(Item item, String relative) throws IOException, SAXException { return goTo(item.getUrl()+relative); }
public HtmlPage getPage(Item item, String relative) throws IOException, SAXException { return goTo(item.getUrl() + relative); }
public HtmlPage getPage(Item item, String relative) throws IOException, SAXException { return goTo(item.getUrl()+relative); }
public HtmlPage getPage(Item item, String relative) throws IOException, SAXException { return goTo(item.getUrl()+relative); }
/** * Set {@link Item} propertis on the message instance. * @param item The Jenkins {@link Item}. */ protected T setItemProps(@Nonnull Item item) { set(EventProps.Jenkins.jenkins_object_name, item.getFullName()); set(EventProps.Jenkins.jenkins_object_url, item.getUrl()); return (T) this; }
holder.imageView.setImageUrl(item.getImage(), imageLoader); holder.news_text.setText(item.getNews_text()); holder.news_url.setText(item.getUrl()); holder.time_stamp.setText(item.getTime_stamp()); holder.news_title.setText(item.getNews_title());
} else { return request.getContextPath()+'/'+p.getUrl();
} else { return request.getContextPath()+'/'+p.getUrl();
} else { return request.getContextPath()+'/'+p.getUrl();
} else { return getRequestRootPath(request) + '/' + p.getUrl();
} else { return normalizeURI(request.getContextPath()+'/'+p.getUrl());