public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextClosedEvent) { this.delegatedBeanApplicationContext = null; if (delegatedBean != null) { delegatedBean.destroy(); delegatedBean = null; } } }
@Override public void doAction(HstRequest request, HstResponse response) throws HstComponentException { getDelegatedBean(request).doAction(request, response); }
@Override public void doBeforeRender(HstRequest request, HstResponse response) throws HstComponentException { getDelegatedBean(request).doBeforeRender(request, response); }
@Override public void doBeforeServeResource(HstRequest request, HstResponse response) throws HstComponentException { getDelegatedBean(request).doBeforeServeResource(request, response); }
component.init(requestContainerConfig.getServletContext(), compConfigImpl);
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); }
component.prepareBeforeRender(hstRequest, hstResponse); } catch (HstComponentException e) { if (this.exceptionThrowable) {
@Override public void doBeforeServeResource(HstRequest request, HstResponse response) throws HstComponentException { final HstComponent delegatee = getDelegatedBean(request); if (HDC.isStarted()) { final Task curTask = HDC.getCurrentTask(); curTask.setAttribute("SpringBridgeHstComponent.delegatee", delegatee.getClass().toString()); } delegatee.doBeforeServeResource(request, response); }
delegatedBean.init(getServletContext(), getComponentConfiguration());
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(); }
@Override public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextClosedEvent) { this.delegatedBeanApplicationContext = null; if (delegatedBean != null) { delegatedBean.destroy(); delegatedBean = null; } } }
@Override public void doBeforeRender(HstRequest request, HstResponse response) throws HstComponentException { final HstComponent delegatee = getDelegatedBean(request); if (HDC.isStarted()) { final Task curTask = HDC.getCurrentTask(); curTask.setAttribute("SpringBridgeHstComponent.delegatee", delegatee.getClass().toString()); } delegatee.doBeforeRender(request, response); }
component.doBeforeServeResource(hstRequest, hstResponse); } catch (HstComponentException e) { if (this.exceptionThrowable) {
@Override public void doAction(HstRequest request, HstResponse response) throws HstComponentException { final HstComponent delegatee = getDelegatedBean(request); if (HDC.isStarted()) { final Task curTask = HDC.getCurrentTask(); curTask.setAttribute("SpringBridgeHstComponent.delegatee", delegatee.getClass().toString()); } delegatee.doAction(request, response); }
component.init(requestContainerConfig.getServletContext(), compConfigImpl);
/** * 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); }
@Override public void destroy() throws HstComponentException { this.delegatedBeanApplicationContext = null; if (delegatedBean != null) { delegatedBean.destroy(); delegatedBean = null; } super.destroy(); }
component.doBeforeRender(hstRequest, hstResponse); } catch (HstComponentException e) { if (this.exceptionThrowable) {
component.doBeforeServeResource(hstRequest, hstResponse); } catch (HstComponentException e) { if (this.exceptionThrowable) {
component.doAction(hstRequest, hstResponse); } catch (HstComponentException e) { if (this.exceptionThrowable) {