@Override public void processWindowBeforeRender(HstComponentWindow window, HstRequest request, HstResponse response) { HstURL compUrl = createAsyncComponentRenderingURL(request, response); final Comment ssiComment = response.createComment("#include virtual=\"" + compUrl.toString() + "\" "); response.addPreamble(ssiComment); } }
/** * Adding componentRendering URL link to the linkable model. * @param hstResponse HstResponse * @param linkableModel linkable model */ private void addComponentRenderingURLLink(HstResponse hstResponse, IdentifiableLinkableMetadataBaseModel linkableModel) { HstURL compRenderURL = hstResponse.createComponentRenderingURL(); linkableModel.putLink(ContainerConstants.LINK_NAME_COMPONENT_RENDERING, new LinkModel(compRenderURL.toString())); }
@Override public void processWindowBeforeRender(HstComponentWindow window, HstRequest request, HstResponse response) { HstURL url = createAsyncComponentRenderingURL(request, response); Element hiddenDiv = response.createElement("div"); hiddenDiv.setAttribute("id", url.toString()); hiddenDiv.setAttribute("class", OBFUSCATED_ASYNC_VAR); hiddenDiv.setAttribute("style", "display:none;"); response.addPreamble(hiddenDiv); if (!response.containsHeadElement(HEAD_SCRIPT_KEY_HINT)) { Element headScript = response.createElement("script"); headScript.setAttribute("type","text/javascript"); headScript.setTextContent(getIOScript()); response.addHeadElement(headScript, HEAD_SCRIPT_KEY_HINT); Element endBodyScript = response.createElement("script"); endBodyScript.setAttribute(ContainerConstants.HEAD_ELEMENT_CONTRIBUTION_CATEGORY_HINT_ATTRIBUTE, "scripts"); endBodyScript.setAttribute("type", "text/javascript"); endBodyScript.setTextContent(OBFUSCATED_HIPPO_HST_VAR + ".AsyncPage.load();"); response.addHeadElement(endBodyScript, "asyncLoad"); } }
@Override public HstURLRepresentation convert(HstURL value) { HstURLRepresentation representation = new HstURLRepresentation(); representation.setType(value.getType()); representation.setUrl(value.toString()); return representation; }
HstURLFactory urlFactory = requestContext.getURLFactory(); HstURL url = urlFactory.createURL(HstURL.COMPONENT_RENDERING_TYPE, window.getReferenceNamespace(), null, requestContext); populatingAttributesMap.put("url", url.toString()); populatingAttributesMap.put("refNS", window.getReferenceNamespace()); final Channel channel = requestContext.getResolvedMount().getMount().getChannel();
@Override public int doEndTag() throws JspException{ try { HstURL url = getUrl(); if (url == null) { throw new IllegalStateException("internal error: url not set"); } url.setResourceID(getResourceId()); setUrlParameters(url); HttpServletResponse response = (HttpServletResponse) pageContext.getResponse(); // properly encoding urls to allow non-cookie enabled sessions - ref.) PLUTO-252 String urlString = response.encodeURL(url.toString()); if (escapeXml) { urlString = doEscapeXml(urlString); } HstRequestContext requestContext = HstRequestUtils.getHstRequestContext((HttpServletRequest) pageContext.getRequest()); if (mustURLBeFullyQualified(requestContext)) { urlString = HstRequestUtils.getFullyQualifiedHstURL(requestContext, url, true); } TagUtils.writeOrSetVar(urlString, var, pageContext, scope); return EVAL_PAGE; } finally { cleanup(); } }
HstURL hstUrl = requestContext.getURLFactory().createURL(HstURL.RESOURCE_TYPE, ContainerConstants.CONTAINER_REFERENCE_NAMESPACE, null, requestContext, explicitContextPath); hstUrl.setResourceID(path); urlString = hstUrl.toString(); } else { urlString = requestContext.getURLFactory().createURL(HstURL.RENDER_TYPE, null, navURL, requestContext, explicitContextPath).toString(); if (StringUtils.isEmpty(path) && StringUtils.isEmpty(urlString)) {