@Override public DateTime getLastPublishDate(final String url, final int publication) throws ItemNotFoundException { final PageMeta pageMeta = getPageMetaByURL(url, publication); final Date lpd = pageMeta.getLastPublicationDate(); return lpd != null ? new DateTime(lpd) : Constants.THE_YEAR_ZERO; } }
@Override public DateTime getLastPublishDate(final String url, final int publication) throws ItemNotFoundException { PageMeta pageMeta = getPageMetaByURL(url, publication); Date lpd = pageMeta.getLastPublishDate(); return lpd != null ? new DateTime(pageMeta.getLastPublishDate()) : Constants.THE_YEAR_ZERO; }
/** * Retrieves content of a Page by looking the page up by its URL. * * @param url String representing the path part of the page URL * @param publication int representing the Publication id of the page * @return String representing the content of the Page * @throws SerializationException if something goes wrong deserializing * @throws ItemNotFoundException if the requested page does not exist */ @Override public String getPageContentByURL(String url, int publication) throws ItemNotFoundException, SerializationException { final PageMeta meta = getPageMetaByURL(url, publication); return getPageContentById(meta.getId(), meta.getPublicationId()); }
/** * Retrieves content of a Page by looking the page up by its URL. * * @param url String representing the path part of the page URL * @param publication int representing the Publication id of the page * @return String representing the content of the Page * @throws SerializationException if the character stream cannot be read * @throws ItemNotFoundException if the requested page does not exist */ @Override public String getPageContentByURL(String url, int publication) throws ItemNotFoundException, SerializationException { PageMeta meta = getPageMetaByURL(url, publication); return getPageContentById(meta.getItemId(), meta.getPublicationId()); }
@Override public TCMURI getPageIdForUrl(final String url, final int publicationId) throws ItemNotFoundException, SerializationException { PageMeta pageMeta = getPageMetaByURL(url, publicationId); if (pageMeta != null) { return new TCMURI(publicationId, pageMeta.getItemId(), pageMeta.getItemType(), pageMeta.getMajorVersion()); } throw new ItemNotFoundException("Page Id for URL not found."); }
@Override public TCMURI getPageIdForUrl(final String url, final int publicationId) throws ItemNotFoundException, SerializationException { final PageMeta pageMeta = getPageMetaByURL(url, publicationId); if (pageMeta != null) { return new TCMURI(publicationId, pageMeta.getId(), pageMeta.getType(), pageMeta.getMajorVersion()); } throw new ItemNotFoundException("Page Id for URL not found."); }
final PageMeta pageMeta = getPageMetaByURL(url, publicationId); if (pageMeta != null) { result = 1;
@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; }