public Entry setSource(Source source) { complete(); if (source != null) { if (source instanceof Feed) source = ((Feed)source).getAsSource(); _setChild(SOURCE, (OMElement)source); } else { _removeChildren(SOURCE, false); } return this; }
/** * Creates the ResponseContext for a GET entry request. By default, a BaseResponseContext is returned. The Entry * will contain an appropriate atom:source element and the Etag header will be set. */ protected ResponseContext buildGetEntryResponse(RequestContext request, Entry entry) throws ResponseContextException { Feed feed = createFeedBase(request); entry.setSource(feed.getAsSource()); Document<Entry> entry_doc = entry.getDocument(); AbstractResponseContext rc = new BaseResponseContext<Document<Entry>>(entry_doc); rc.setEntityTag(calculateEntityTag(entry)); return rc; }
public ResponseContext getEntry(RequestContext request) { Entry entry = getAbderaEntry(request); if (entry != null) { Feed feed = entry.getParentElement(); entry = (Entry) entry.clone(); entry.setSource(feed.getAsSource()); Document<Entry> entry_doc = entry.getDocument(); AbstractResponseContext rc = new BaseResponseContext<Document<Entry>>( entry_doc); rc.setEntityTag(calculateEntityTag(entry)); return rc; } else { return new EmptyResponseContext(404); } }