}
protected abstract Document generateResponse(Query query) throws Exception;
private Query parseQuery() {
Query query = new Query();
for (String value : getParamValues("target")) {
query.addKeyword(new Query.Target(value));
}
for (String value : getParamValues("area")) {
query.addKeyword(new Query.Area(value));
}
for (String value : getParamValues("time")) {
query.addKeyword(new Query.Time(value));
}
for (String value : getParamValues("project")) {
query.addKeyword(new Query.ProjectName(value));
}
for (String value : getParamValues("timeOfYear")) {
query.addKeyword(new Query.TimeOfYear(value));
}
for (String value : getParamValues("collection")) {
query.addKeyword(new Query.CollectionURI(value));
}
String sources = toCommaSeparatedTerm("source");
if (containsOnlyNumericIds(sources)) {
query.addKeyword(new Query.Source(sources));
}
String recordBases = toCommaSeparatedTerm("recordBasis");
if (containsOnlyNumericIds(recordBases)) {
query.addKeyword(new Query.RecordBasis(recordBases));
}
String documentID = req.getParameter("documentID");
if (given(documentID)) {
query.addKeyword(new Query.DocumentID(documentID));
}
return query;
}