/** * Returns the revision sites link. * * @return Revision sites link or {@code null} for none. */ public Link getRevisionLink() { return getLink(SitesLink.Rel.REVISION, Link.Type.ATOM); }
/** * Returns the batch interruption information. * * @return batch interruption information */ public BatchInterrupted getBatchInterrupted() { return getExtension(BatchInterrupted.class); }
/** * Returns whether it has the revision. * * @return whether it has the revision */ public boolean hasRevision() { return hasExtension(Revision.class); }
/** * Sets the revision. * * @param revision revision or <code>null</code> to reset */ public void setRevision(Revision revision) { if (revision == null) { removeExtension(Revision.class); } else { setExtension(revision); } }
@Override public String toString() { return "{BasePageEntry " + super.toString() + "}"; }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(BasePageEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(BasePageEntry.class, PageName.class); }
/** * Sets the parent link of the given entry to the given id */ public static void setParentId(BaseContentEntry<?> entry, String id) { entry.addLink(SitesLink.Rel.PARENT, ILink.Type.ATOM, id); }
@SuppressWarnings("unchecked") @Override public List<BaseContentEntry<?>> getEntries(Query query, SitesService sitesService) throws IOException, ServiceException { checkNotNull(query, "query"); checkNotNull(sitesService, "sitesService"); List<BaseContentEntry> baseEntries = sitesService.getFeed(query, ContentFeed.class).getEntries(); List<BaseContentEntry<?>> adaptedEntries = Lists.newLinkedList(); for (BaseContentEntry entry : baseEntries) { BaseContentEntry<?> adaptedEntry = (BaseContentEntry<?>) entry.getAdaptedEntry(); if (adaptedEntry == null) { adaptedEntries.add(entry); } else { adaptedEntries.add(adaptedEntry); } } return adaptedEntries; } }
/** * Sets the revision. * * @param revision revision or <code>null</code> to reset */ public void setRevision(Revision revision) { if (revision == null) { removeExtension(Revision.class); } else { setExtension(revision); } }
@Override public String toString() { return "{CommentEntry " + super.toString() + "}"; }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(BasePageEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(BasePageEntry.class, PageName.class); }
entry.addLink(SitesLink.Rel.PARENT, ILink.Type.ATOM, parent.getId()); if (getType(entry) == COMMENT) { InReplyTo inReplyTo = new InReplyTo();
/** * Sets the batch interruption information. * * @param batchInterrupted batch interruption information or <code>null</code> * to reset */ public void setBatchInterrupted(BatchInterrupted batchInterrupted) { if (batchInterrupted == null) { removeExtension(BatchInterrupted.class); } else { setExtension(batchInterrupted); } }
@Override public String toString() { return "{BasePageEntry " + super.toString() + "}"; }
/** * Returns the link that provides the URI that can be used to post new entries * to the feed. * * @return Link that provides the URI that can be used to post new entries to * the feed or {@code null} for none. */ public Link getEntryPostLink() { return getLink(Link.Rel.ENTRY_POST, Link.Type.ATOM); }
/** * Returns whether it has the batch identifier. * * @return whether it has the batch identifier */ public boolean hasBatchId() { return hasExtension(BatchId.class); }
/** * Returns the revision. * * @return revision */ public Revision getRevision() { return getExtension(Revision.class); }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(CommentEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(CommentEntry.class, InReplyTo.getDefaultDescription(true, false)); }
/** * Sets the batch operation. * * @param batchOperation batch operation or <code>null</code> to reset */ public void setBatchOperation(BatchOperation batchOperation) { if (batchOperation == null) { removeExtension(BatchOperation.class); } else { setExtension(batchOperation); } }
@Override public String toString() { return "{CommentEntry " + super.toString() + "}"; }