QName qName = (QName) itr.next();
// check the type name is known, otherwise complain
if(catalog.getFeatureTypeByName(qName.getNamespaceURI(), qName.getLocalPart()) == null) {
String name = qName.getPrefix() + ":" + qName.getLocalPart();
throw new WFSException("Feature type " + name + " unknown", "InvalidParameterValue", "typeName");
}
List l = new ArrayList();
l.add(qName);
list.add(l);
}
kvp.put("typeName", list);
querySet(eObject, "typeName", list);
} else {
//check for featureId and infer typeName
if (kvp.containsKey("featureId")) {
//use featureId to infer type Names
List featureId = (List) kvp.get("featureId");
ArrayList typeNames = new ArrayList();
QNameKvpParser parser = new QNameKvpParser("typeName", catalog);
for (int i = 0; i < featureId.size(); i++) {
String fid = (String) featureId.get(i);
int pos = fid.indexOf(".");
if (pos != -1) {
String typeName = fid.substring(0, fid.lastIndexOf("."));
//add to a list to set on the query
List parsed = (List) parser.parse(typeName);
typeNames.add(parsed);
}
}
querySet(eObject, "typeName", typeNames);
} else {
throw new WFSException("The query should specify either typeName or a featureId filter", "MissingParameterValue");
}
}
//filter
if (kvp.containsKey("filter")) {