@Override public HstRequestContext getRequestContext() { return request.getRequestContext(); }
/** * Is this a request in preview? */ protected boolean isPreview(final HstRequest request) { return request.getRequestContext().isPreview(); }
/** * @param request the {@link HstRequest} * @return the {@link HstQueryManager} * @see {@link #getQueryManager(HstRequestContext)} and {@link #getQueryManager(Session)} * @deprecated since 7.9.0 : use {@link org.hippoecm.hst.core.request.HstRequestContext#getQueryManager()} instead */ @Deprecated public HstQueryManager getQueryManager(HstRequest request){ return getQueryManager(request.getRequestContext()); }
/** * Get the site content base bean, which is the root document bean whithin * preview or live context. */ protected HippoBean getSiteContentBaseBean(HstRequest request) { return request.getRequestContext().getSiteContentBaseBean(); }
/** * When the <code>{@link ResolvedSiteMapItem}</code> belonging to the current requestUri has a relativeContentPath that points to an * existing jcr Node, a HippoBean wrapping this node is returned. When there is no relativeContentPath or the location does not exist, * <code>null</code> is returned * @param request * @return A <code>HippoBean</code> or <code>null</code> when there cannot be created a content bean for the resolvedSiteMapItem belonging to the current request * @deprecated since 7.9.0 : use {@link org.hippoecm.hst.core.request.HstRequestContext#getContentBean()} instead */ @Deprecated public HippoBean getContentBean(HstRequest request) { return request.getRequestContext().getContentBean(); }
/** * @see {@link #getContentBean(HstRequest)} but only returns the bean if the found content bean is of type {@code beanMappingClass}. * When the bean cannot be found, or is not of type {@code beanMappingClass}, <code>null</code> is returned * @param request current HstRequest * @param beanMappingClass the class of the bean that you expect * @return A HippoBean of {@code beanMappingClass} or <code>null</code> if bean cannot be found or is of a different class * @deprecated since 7.9.1 : use {@link org.hippoecm.hst.core.request.HstRequestContext#getContentBean(Class<T>)} instead */ @Deprecated public <T extends HippoBean> T getContentBean(HstRequest request, Class<T> beanMappingClass) { return request.getRequestContext().getContentBean(beanMappingClass); }
/** * @deprecated since 7.9.0. Use {@link org.hippoecm.hst.core.request.HstRequestContext#getSiteContentBaseBean()} instead */ @Deprecated public HippoBean getSiteContentBaseBean(HstRequest request) { return request.getRequestContext().getSiteContentBaseBean(); }
/** * @deprecated since 7.9.0 : use {@link org.hippoecm.hst.core.request.HstRequestContext#getObjectBeanManager()} instead */ @Deprecated public ObjectBeanManager getObjectBeanManager(HstRequest request) { return request.getRequestContext().getObjectBeanManager(); }
/** * @param request * @return the jcr path relative to the root (not starting with / thus) * @deprecated since 7.9.0 : use {@link org.hippoecm.hst.core.request.HstRequestContext#getSiteContentBasePath()} instead */ @Deprecated public String getSiteContentBasePath(HstRequest request){ return request.getRequestContext().getSiteContentBasePath(); }
/** * @return <code>true</code> when this request is matched to a preview site * @see Mount#isPreview() */ public boolean isPreview(HstRequest request) { return request.getRequestContext().isPreview(); }
/** * When the <code>{@link ResolvedSiteMapItem}</code> belonging to the current requestUri has a relativeContentPath that points to an * existing jcr Node, a HippoBean wrapping this node is returned. When there is no relativeContentPath or the location does not exist, * <code>null</code> is returned * @param request * @return A <code>HippoBean</code> or <code>null</code> when there cannot be created a content bean for the resolvedSiteMapItem belonging to the current request */ public HippoBean getContentBean(HstRequest request) { ResolvedSiteMapItem resolvedSiteMapItem = request.getRequestContext().getResolvedSiteMapItem(); return this.getBeanForResolvedSiteMapItem(request, resolvedSiteMapItem); }
/** * Get the {@link Mount} for the current */ protected Mount getMount(final HstRequest request){ return request.getRequestContext().getResolvedMount().getMount(); }
/** * @see {@link #getComponentParameter(String)} * @deprecated since 2.26.01. Use {@link #getComponentParameter(String)} instead */ @Deprecated public String getParameter(String name, HstRequest request) { return this.getComponentConfiguration().getParameter(name, request.getRequestContext().getResolvedSiteMapItem()); }
/** * See {@link #getComponentLocalParameters()}, * @deprecated since 2.26.01. Use {@link #getComponentLocalParameters()} instead */ @Deprecated public Map<String,String> getLocalParameters(HstRequest request){ return this.getComponentConfiguration().getLocalParameters(request.getRequestContext().getResolvedSiteMapItem()); }
@Override public void processWindowBeforeRender(HstComponentWindow window, HstRequest request, HstResponse response) { HstRequestContext requestContext = request.getRequestContext(); HstURL compUrl = createAsyncComponentRenderingURL(request, response); String url = HstRequestUtils.getFullyQualifiedHstURL(requestContext, compUrl, false); Element esiElem = response.createElement("esi:include"); esiElem.setAttribute("src", url); esiElem.setAttribute("onerror", "continue"); response.addPreamble(esiElem); }
/** * See {@link #getParameter(String, HstRequest)}, but now, only resolved parameters directly on the HstComponent are taken into * acoount: in other words, no inheritance of parameters is applied * @param name * @param request * @return the resolved parameter value for this name, or <code>null</null> if not present */ public String getLocalParameter(String name, HstRequest request) { return (String)this.getComponentConfiguration().getLocalParameter(name, request.getRequestContext().getResolvedSiteMapItem()); }
/** * See {@link #getParameters(HstRequest)}, but now, only resolved parameter map of parameters is returned that is directly on * the HstComponenConfiguration, thus, no inheritance is applied * @param request * @return Map of all parameters, and when no parameters present, return empty map. */ public Map<String,String> getLocalParameters(HstRequest request){ return this.getComponentConfiguration().getLocalParameters(request.getRequestContext().getResolvedSiteMapItem()); }
protected String getParameter(String name, HstRequest request, String defaultValue) { String value = (String) this.getComponentConfiguration().getParameter(name, request.getRequestContext().getResolvedSiteMapItem()); return (value != null ? value : defaultValue); } }
/** * Get the HST Site object from request. */ protected HstSite getHstSite(final HstRequest request){ return request.getRequestContext().getResolvedSiteMapItem().getHstSiteMapItem().getHstSiteMap().getSite(); }
public ObjectBeanManager getObjectBeanManager(HstRequest request) { try { HstRequestContext requestContext = request.getRequestContext(); return new ObjectBeanManagerImpl(requestContext.getSession(), this.objectConverter); } catch (UnsupportedRepositoryOperationException e) { throw new HstComponentException(e); } catch (RepositoryException e) { throw new HstComponentException(e); } }