if (query == null) {
return Response.status(Status.BAD_REQUEST).build();
}
OCApp app = getApplication();
QueryTemplate template = new QueryTemplate(app);
if (LOG.isInfoEnabled()) {
LOG.info("Query: " + query);
}
OCQueryResultSelection selection = template.queryForSelection(query);
MarshalHelper marshalHelper = new MarshalHelper(app);
String xml = marshalHelper.selection2xml(selection, Integer.valueOf(mode));
return Response.ok(xml).build();
} catch (Exception e) {
throw new WebApplicationException(e);