@Override public PageProviderResultItem<String> getPageById(final int id, final int publication) throws IOException, ItemNotFoundException, SerializationException { final PageMeta pageMeta = getPageMetaById(id, publication); PageProviderResultItem<String> pageResult = new PageResultItemImpl(pageMeta.getPublicationId(), pageMeta .getId(), pageMeta.getURLPath()); pageResult.setLastPublishDate(pageMeta.getLastPublicationDate()); pageResult.setRevisionDate(pageMeta.getModificationDate()); pageResult.setContentSource(getPageContentById(id, publication)); return pageResult; }
private <T extends Page> T producePage(PageProviderResultItem<String> resultItem, RequestContext context, Class<T> pageClass) throws FactoryException { String pageSource = resultItem.getSourceContent(); Page page = deserialize(pageSource, pageClass); page.setLastPublishedDate(resultItem.getLastPublishDate()); page.setRevisionDate(resultItem.getRevisionDate()); page.setUrl(resultItem.getUrl()); LOG.debug("Running pre caching processors"); this.executeProcessors(page, RunPhase.BEFORE_CACHING, context); return (T) page; }
PageProviderResultItem<String> resultItem; resultItem = pageProvider.getPageByURL(url, publicationId); String pageSource = resultItem.getSourceContent(); cacheProvider.storeInItemCache(cacheKey, cacheElement, resultItem.getPublicationId(), resultItem .getItemId()); cacheElement.setExpired(false);
tcmUri = new TCMURI(uri); resultItem = pageProvider.getPageById(tcmUri.getItemId(), tcmUri.getPublicationId()); pageSource = resultItem.getSourceContent();
@Override public PageProviderResultItem<String> getPageById(final int id, final int publication) throws IOException, ItemNotFoundException, SerializationException { final PageMeta pageMeta = getPageMetaById(id, publication); if (pageMeta == null) { throw new ItemNotFoundException("Unable to find page meta by id '" + id + "' and publication '" + publication + "'."); } PageProviderResultItem<String> pageResult = new PageResultItemImpl(pageMeta.getPublicationId(), pageMeta .getItemId(), pageMeta.getUrl()); pageResult.setLastPublishDate(pageMeta.getLastPublishDate()); pageResult.setRevisionDate(pageMeta.getModificationDate()); pageResult.setContentSource(getPageContentById(id, publication)); return pageResult; }
@Override public PageProviderResultItem<String> getPageByURL(final String url, final int publication) throws ItemNotFoundException, SerializationException { final PageMeta pageMeta = getPageMetaByURL(url, publication); PageProviderResultItem<String> pageResult = new PageResultItemImpl(pageMeta.getPublicationId(), pageMeta .getId(), pageMeta.getURLPath()); pageResult.setLastPublishDate(pageMeta.getLastPublicationDate()); pageResult.setRevisionDate(pageMeta.getModificationDate()); pageResult.setContentSource(getPageContentById(pageMeta.getId(), pageMeta.getPublicationId())); return pageResult; }
@Override public PageProviderResultItem<String> getPageByURL(final String url, final int publication) throws ItemNotFoundException, SerializationException { PageMeta pageMeta = getPageMetaByURL(url, publication); if (pageMeta == null) { throw new ItemNotFoundException("Unable to find page meta by url '" + url + "' and publication '" + publication + "'."); } PageProviderResultItem<String> pageResult = new PageResultItemImpl(pageMeta.getPublicationId(), pageMeta .getItemId(), pageMeta.getUrl()); pageResult.setLastPublishDate(pageMeta.getLastPublishDate()); pageResult.setRevisionDate(pageMeta.getModificationDate()); pageResult.setContentSource(getPageContentById(pageMeta.getItemId(), pageMeta.getPublicationId())); return pageResult; }