return super.read(request, kvp, rawKvp);
}
private QueryType readQuery(Map kvp, Object request) throws Exception {
Csw20Factory factory = Csw20Factory.eINSTANCE;
QueryType query = factory.createQueryType();
// parse the type names
String typeNamesString = (String) kvp.get("typeNames");
if(typeNamesString == null) {
throw new ServiceException("Mandatory parameter typeNames is missing", ServiceException.MISSING_PARAMETER_VALUE, "typeNames");
}
NamespaceSupport namespaces = (NamespaceSupport) kvp.get("namespace");
if (namespaces == null) {
// by spec, "NAMSPACE, If not included, all qualified names are in default namespace"
String outputSchema = (String) kvp.get("outputSchema");
if (outputSchema == null || descriptors.get(outputSchema) == null) {
outputSchema = CSW.NAMESPACE;
}
namespaces = descriptors.get( outputSchema).getNamespaceSupport();
}
List<QName> typeNames = resolver.parseQNames(typeNamesString, namespaces);
query.setTypeNames(typeNames);
// handle the element set
ElementSetType elementSet = (ElementSetType) kvp.remove("ELEMENTSETNAME");
if (elementSet != null) {
ElementSetNameType esn = Csw20Factory.eINSTANCE.createElementSetNameType();
esn.setValue(elementSet);
esn.setTypeNames(typeNames);
query.setElementSetName(esn);
}
// and the element names
String elementNamesString = (String) kvp.remove("ELEMENTNAME");
if(elementNamesString != null) {
List<QName> elementNames = resolver.parseQNames(elementNamesString, namespaces);
query.getElementName().addAll(elementNames);
}
// the filter
if (kvp.get(CONSTRAINT) != null) {
query.setConstraint(factory.createQueryConstraintType());
Object language = kvp.get(CONSTRAINTLANGUAGE);
String constraint = (String) kvp.get(CONSTRAINT);
if (CQL_TEXT.equals(language) || language == null) {
Filter filter = null;
try {