private String getVersion(final HstRequestContext requestContext) throws WebFileException { final String version = requestContext.getResolvedSiteMapItem().getParameter("version"); if (version == null) { log.info("Version is null. Serving latest WebFile version and don't set any cache headers on the response"); } return version; }
/** * 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); }
public HstLink create(HippoBean bean, HstRequestContext hstRequestContext) { return create(bean.getNode(), hstRequestContext.getResolvedSiteMapItem()); }
/** * @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()); }
/** * @see {@link #getComponentParameters()} * @deprecated since 2.26.01. Use #getComponentParameters()} instead */ @Deprecated public Map<String,String> getParameters(HstRequest request){ return this.getComponentConfiguration().getParameters(request.getRequestContext().getResolvedSiteMapItem()); }
/** * @see {@link #getComponentLocalParameter(String)} * @deprecated since 2.26.01. Use {@link #getComponentLocalParameter(String)} instead */ @Deprecated public String getLocalParameter(String name, HstRequest request) { return (String)this.getComponentConfiguration().getLocalParameter(name, request.getRequestContext().getResolvedSiteMapItem()); }
/** * See {@link #getComponentParameters()}, but now, only resolved parameter map of parameters is returned that is directly on * the HstComponenConfiguration, thus, no inheritance is applied * @return Map of all parameters, and when no parameters present, return empty map. */ public Map<String,String> getComponentLocalParameters(){ return this.getComponentConfiguration().getLocalParameters(RequestContextProvider.get().getResolvedSiteMapItem()); }
/** * 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()); }
/** * See {@link #getComponentParameter(String)}, where we now return all resolved parameters (thus with inheritance of * ancestor components) * @return Map of all parameters, and when no parameters present, return empty map. */ public Map<String,String> getComponentParameters(){ return this.getComponentConfiguration().getParameters(RequestContextProvider.get().getResolvedSiteMapItem()); }
/** * See {@link #getComponentParameter(String)}, but now, only resolved parameters directly on the HstComponent are taken into * account: in other words, no inheritance of parameters is applied * @param name * @return the resolved parameter value for this name, or <code>null</null> if not present */ public String getComponentLocalParameter(String name) { return (String)this.getComponentConfiguration().getLocalParameter(name, RequestContextProvider.get().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); } }
/** * See {@link #getParameter(String, HstRequest)}, where we now return all resolved parameters (thus with inheritance of * ancestor components) * @param request * @return Map of all parameters, and when no parameters present, return empty map. */ public Map<String,String> getParameters(HstRequest request){ return this.getComponentConfiguration().getParameters(request.getRequestContext().getResolvedSiteMapItem()); }
/** * Returns resolved parameter from HstComponentConfiguration : resolved means that possible property placeholders like * ${1} or ${year}, where the first refers to the first wildcard matcher in a resolved sitemap item, and the latter * to a resolved parameter in the resolved HstSiteMapItem * * The parameter map used has inherited parameters from ancestor components, which have precedence over child components) * * @param name * @return the resolved parameter value for this name, or <code>null</null> if not present */ public String getComponentParameter(String name) { return this.getComponentConfiguration().getParameter(name, RequestContextProvider.get().getResolvedSiteMapItem()); }
protected String getParameter(String name, HstRequest request) { return (String)this.getComponentConfiguration().getParameter(name, request.getRequestContext().getResolvedSiteMapItem()); }
private void notFound(final String type, final String componentRenderingWindowReferenceNamespace, final ValveContext context) throws ContainerException { log.warn("Illegal request for {} URL found because there is no component for id '{}' for matched " + "sitemap item '{}'. Set 404 on response for request '{}'.", type, componentRenderingWindowReferenceNamespace, context.getRequestContext().getResolvedSiteMapItem().getHstSiteMapItem().getId(), context.getServletRequest()); try { context.getServletResponse().sendError(HttpServletResponse.SC_NOT_FOUND); } catch (IOException e) { throw new ContainerException("Unable to set 404 on response after invalid resource path.", e); } } }
/** * Get the HST Site object from request. */ protected HstSite getHstSite(final HstRequest request){ return request.getRequestContext().getResolvedSiteMapItem().getHstSiteMapItem().getHstSiteMap().getSite(); }
public HstSiteMenusImpl(HstRequestContext hstRequestContext) { // find currently selected hstSiteMenuItemConfiguration's HstSiteMapItem selectedSiteMapItem = hstRequestContext.getResolvedSiteMapItem().getHstSiteMapItem(); HstSiteMenusConfiguration siteMenusConfiguration = selectedSiteMapItem.getHstSiteMap().getSite().getSiteMenusConfiguration(); if(siteMenusConfiguration != null) { for(HstSiteMenuConfiguration siteMenuConfiguration : siteMenusConfiguration.getSiteMenuConfigurations().values()) { HstSiteMenuImpl siteMenu = new HstSiteMenuImpl(this, siteMenuConfiguration, hstRequestContext); siteMenus.put(siteMenu.getName(), siteMenu); } } }
public HstSite getHstSite(HstRequest request){ return request.getRequestContext().getResolvedSiteMapItem().getHstSiteMapItem().getHstSiteMap().getSite(); }