private JcrPath getJcrPath() { if (parameterName == null) { return null; } final HstComponentWindow window = (HstComponentWindow) pageContext.getRequest().getAttribute(HST_COMPONENT_WINDOW); final HstComponent component = window.getComponent(); final ComponentConfiguration componentConfig = component.getComponentConfiguration(); final ParametersInfo paramsInfo = ParametersInfoAnnotationUtils.getParametersInfoAnnotation(component, componentConfig); return ParameterUtils.getParameterAnnotation(paramsInfo, parameterName, JcrPath.class); }
private String getComponentRenderPath() { final HstComponentWindow window = getCurrentComponentWindow(); if (window == null) { return ""; } final HstComponent component = window.getComponent(); if (component == null) { return ""; } final ComponentConfiguration componentConfiguration = component.getComponentConfiguration(); if (componentConfiguration == null) { return ""; } return componentConfiguration.getRenderPath(); }
" waste you are not aware of. If it is on purpose, for example because the component does only some" + " processing that does not involve direct response contribution, you can mark the component with '{} = true'.", RequestContextProvider.get().getServletRequest(), childWindow.getComponent().getComponentConfiguration().getCanonicalPath(), getRenderer(childWindow, childResponseImpl), COMPONENT_PROPERTY_SUPPRESS_WASTE_MESSAGE); } else { " If it is on purpose, for example because the component does only some" + " processing that does not involve direct response contribution, you can mark the component with '{} = true'.", RequestContextProvider.get().getServletRequest(), childWindow.getComponent().getComponentConfiguration().getCanonicalPath(), getRenderer(childWindow, childResponseImpl), COMPONENT_PROPERTY_SUPPRESS_WASTE_MESSAGE);
/** * 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); }
.createParameterInfoProxy( HstParameterInfoProxyFactoryImpl.TEMPLATE_PARAMETER_INFO_HOLDER.getParametersInfo(), component.getComponentConfiguration(), (HttpServletRequest) hstRequest, (parameterValue, returnType) -> parameterValue);
rootComponentWindow.getComponent().getComponentConfiguration()); } else if (actionWindowReferenceNamespace != null) { rootComponentWindow = findComponentWindow(rootComponentWindow, actionWindowReferenceNamespace); rootComponentWindow.getComponent().getComponentConfiguration()); rootComponentWindow.getComponent().getComponentConfiguration()); } else if (partialWindowPath != null) { HstComponentWindow partialWindow = findComponentWindowByNamePath(rootComponentWindow, log.info("Found component for partial rendering request '{}' targeting component '{}'.", context.getServletRequest(), rootComponentWindow.getComponent().getComponentConfiguration()); } else { log.warn("Cannot find the component by the path, '{}', for partial page rendering."