@Override public ComponentPresentation getComponentPresentation(String componentURI, String viewOrTemplateURI) throws FactoryException { return getComponentPresentation(componentURI, viewOrTemplateURI, null); }
/** * <p>componentPresentationFactory.</p> * * @return a {@link org.dd4t.core.factories.ComponentPresentationFactory} object. */ @Bean public ComponentPresentationFactory componentPresentationFactory() { ComponentPresentationFactoryImpl presentationFactory = ComponentPresentationFactoryImpl.getInstance(); presentationFactory.setComponentPresentationProvider(componentPresentationProvider()); presentationFactory.setCacheProvider(cacheProvider); return presentationFactory; }
int componentId = componentTcmUri.getItemId(); String key = getKey(publicationId, componentId, templateId); CacheElement<ComponentPresentation> cacheElement = cacheProvider.loadPayloadFromLocalCache(key); componentPresentation = selectDataBinder(rawComponentPresentation).buildComponentPresentation (rawComponentPresentation, ComponentPresentation.class); this.executeProcessors(componentPresentation.getComponent(), RunPhase.BEFORE_CACHING, context); cacheElement.setPayload(componentPresentation); cacheProvider.storeInItemCache(key, cacheElement, publicationId, componentId); LOG.debug("Running Post caching Processors"); try { this.executeProcessors(componentPresentation.getComponent(), RunPhase.AFTER_CACHING, context); } catch (ProcessorException e) { LOG.error(e.getLocalizedMessage(), e);
@Override public ComponentPresentation getComponentPresentation(String componentURI) throws FactoryException { return getComponentPresentation(componentURI, null, null); }
@Override public ComponentPresentation getComponentPresentation(String componentURI, RequestContext context) throws FactoryException { return getComponentPresentation(componentURI, null, context); } }
componentPresentation = componentPresentationFactory.getComponentPresentation(new TCMURI(ctUri .getPublicationId(), componentId, 16, 0).toString(), componentPresentation .getComponentTemplate().getId());