/** * @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()); }
/** * Add <code>params</code> metadata to the {@code model} from the {@code window}. * @param window HST Component Window instance * @param model the {@link MetadataContributable} model instance where the parameter map should be contributed to */ private void addParametersInfoMetadata(HstComponentWindow window, HstRequest hstRequest, MetadataContributable model) { final ComponentConfiguration compConfig = window.getComponent().getComponentConfiguration(); if (compConfig == null) { return; } final Object paramsInfo = ParametersInfoUtils.createParametersInfo(window.getComponent(), compConfig, hstRequest); JsonNode paramsInfoNode = null; if (paramsInfo != null) { try { paramsInfoNode = getObjectMapper().valueToTree(paramsInfo); model.putMetadata(PARAMETERS_INFO_METADATA, paramsInfoNode); } catch (Exception e) { log.warn("Failed to convert ParametersInfo instance ({}) to ObjectNode.", paramsInfo, e); } } final ResolvedSiteMapItem resolvedSiteMapItem = RequestContextProvider.get().getResolvedSiteMapItem(); final ObjectNode paramsNode = getObjectMapper().getNodeFactory().objectNode(); for (String paramName : compConfig.getParameterNames()) { final String paramValue = compConfig.getParameter(paramName, resolvedSiteMapItem); if (paramValue != null) { paramsNode.put(paramName, paramValue); } } model.putMetadata(PARAMETERS_METADATA, paramsNode); }
/** * 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, String defaultValue) { String value = (String) this.getComponentConfiguration().getParameter(name, request.getRequestContext().getResolvedSiteMapItem()); return (value != null ? value : defaultValue); } }
protected String getParameter(String name, HstRequest request) { return (String)this.getComponentConfiguration().getParameter(name, request.getRequestContext().getResolvedSiteMapItem()); }
protected String getParameter(String name, HstRequest request) { return (String)this.getComponentConfiguration().getParameter(name, 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); }
/** * 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 * @param request * @return the resolved parameter value for this name, or <code>null</null> if not present */ public String getParameter(String name, HstRequest request) { return (String)this.getComponentConfiguration().getParameter(name, request.getRequestContext().getResolvedSiteMapItem()); }
hstSiteMenuName = getComponentConfiguration().getParameter("hstsitemenuname", request.getRequestContext().getResolvedSiteMapItem());