Parser parser = new Parser(getLogger());
Query query = parser.parseQuery(r);
r.close();
getResponse().setStatus(Status.SUCCESS_OK);
final QueryContext context = new QueryContext(getLogger(),app.getDB(),query);
final XMLRepresentationParser xmlParser = new XMLRepresentationParser();
return new OutputRepresentation(MediaType.APPLICATION_ATOM) {
public void write(OutputStream os)
throws IOException
{
final ItemDestination dest = new WriterItemDestination(new OutputStreamWriter(os,"UTF-8"),"UTF-8");
final ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
try {
context.execute(new QueryContext.ResultListener() {
DocumentLoader loader = new SAXDocumentLoader();
public void onStart() throws QueryException {
try {
dest.send(constructor.createDocument());
dest.send(constructor.createElement(AtomResource.FEED_NAME));