extraMap.put(PARAM_KEY_SHOW_THUMBNAIL, "false");
}
}
// parse the query
RestQuery query = null;
try {
query = parseRequest(request, context);
} catch (Throwable t) {
getLogger().log(Level.SEVERE, "Error parsing request.", t);
}
if (query == null) {
query = new RestQuery();
}
// establish the response content type, print writer and feed writer
RestQueryServlet.ResponseFormat format = getResponseFormat(request, query);
String sFormat = getRequestParameter(request, "f");
FeedWriter2 feedWriter2 = WriterFactory.createWriter(
sFormat, msgBroker, query, request, response, context);
FeedWriter feedWriter = null;
PrintWriter printWriter = null;
if (feedWriter2 != null) {
feedWriter = (FeedWriter) feedWriter2;
} else {
this.setResponseContentType(request, response, query);
printWriter = response.getWriter();
feedWriter = makeFeedWriter(request, context, printWriter, msgBroker, query);
}
// execute the query, write the response
try {
if (format == RestQueryServlet.ResponseFormat.xjson) {
String callback = request.getParameter("callback");
if (callback != null) {
printWriter.print(callback + "(");
}
// init query
query.setReturnables(new CoreQueryables(context).getFull());
toSearchCriteria(request, context, query);
feedWriter.write(JsonSearchEngine.createInstance().search(request, response, context, query));
if (callback != null) {
printWriter.print(")");
}
}else if (format == RestQueryServlet.ResponseFormat.dcat) {
String callback = request.getParameter("callback");
if (callback != null) {
printWriter.print(callback + "(");
}
// The following part of the code has been disabled since DCAT content
// is being cached.
query.setReturnables(new CoreQueryables(context).getFull());
toSearchCriteria(request, context, query);
feedWriter.write(DcatJsonSearchEngine.createInstance().search(request, response, context, query));
if (callback != null) {
printWriter.print(")");