/** Render the crawlable HTML A tag. * If crawlable is not enabled or href is empty, nothing is generated. * * @param href the hyper link. If null or empty, nothing is generated. * @param label the label to show. Empty is assumed if null. * @since 5.0.0 */ public static void renderCrawlableA(String href, String label) throws IOException { if (href != null && href.length() > 0) { final HtmlPageRenders.RenderContext rc = HtmlPageRenders.getRenderContext(null); if (rc != null && rc.crawlable) { final Writer cwout = rc.temp; cwout.write("<a href=\""); cwout.write(href); cwout.write("\">"); cwout.write(label != null ? label : ""); cwout.write("</a>\n"); } } }
/** Render the crawlable text. * If crawlable is not enabled or the text is empty, nothing is generated. * @param text the text that is crawlable. * If null or empty, nothing is generated. * @since 5.0.0 */ public static void renderCrawlableText(String text) throws IOException { if (text != null && text.length() > 0) { final HtmlPageRenders.RenderContext rc = HtmlPageRenders.getRenderContext(null); if (rc != null && rc.crawlable) { final Writer cwout = rc.temp; cwout.write("<div>"); cwout.write(XMLs.encodeText(text)); //encode required since it might not be valid HTML cwout.write("</div>\n"); } } }
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException { super.renderProperties(renderer); String cnt = getContent(); //allow deriving to override getContent() if (cnt.length() > 0) { final HtmlPageRenders.RenderContext rc = HtmlPageRenders.getRenderContext(null); if (rc != null) { final Writer cwout = rc.temp; cwout.write("<div id=\""); cwout.write(getUuid()); cwout.write("\" style=\"display:none\">"); cwout.write(cnt); cwout.write("</div>\n"); if (!rc.included) //Use detachChildren() only if not included (since the included page is rendered a bit late because of Include handles _childjs in bind_) cnt = null; //means already generated } if (cnt == null) renderer.render("content", new JavaScriptValue("zk('" + getUuid() + "').detachChildren()")); else render(renderer, "content", cnt); } }
final HtmlPageRenders.RenderContext rc = _defer ? null : HtmlPageRenders.getRenderContext(null); if (rc != null && rc.perm != null) { final Writer cwout = rc.perm;
final HtmlPageRenders.RenderContext rc = HtmlPageRenders.getRenderContext(null); if (rc != null && !rc.included) { //Use zk().detachChildren() only if not included final Writer cwout = rc.temp;
setRenderContext(exec, rc); } else if (owner != null) { old = getRenderContext(exec); //store final boolean crawlable = old != null && old.temp != null && desktop.getWebApp().getConfiguration().isCrawlable();