term(constructor,dest,fterm.getTerm().getURI(),fterm.getValue());
}
link(constructor,dest,"related",resourceBase+feed.getPath());
dest.send(constructor.createElementEnd(AtomResource.ENTRY_NAME));
}
DocumentLoader loader = new SAXDocumentLoader();
Iterator<TermInstance<Entry>> entries = app.getDB().getEntriesByTerm(dbTerm,value);
while (entries.hasNext()) {
TermInstance<Entry> termValue = entries.next();
Entry entry = termValue.getTarget();
Feed feed = entry.getFeed();
String feedPath = feed.getPath();
String feedBaseURI = resourceBase.toString()+feedPath;
dest.send(constructor.createCharacters("\n"));
// get the entry representation
Representation rep = app.getStorage().getEntry(feedBaseURI,feedPath,feed.getUUID(),entry.getUUID());
// avoid thread creation because reading an output representation requires a thread
StringWriter sw = new StringWriter();
rep.write(sw);
rep.release();
loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));
}
}
} catch (Exception ex) {
throw new XMLException("Exception while getting ancestors.",ex);