if (typeList.size() == 0) {
typeList = getTypesFromFids(getValue("FEATUREID"));
if (typeList.size() == 0) {
throw new WfsException("The typename element is mandatory if "
+ "no FEATUREID is present");
}
}
int featureSize = typeList.size();
int filterSize = (filterList == null) ? 0 : filterList.size();
// prepare the release action boolean for all delete transactions
if (keyExists("RELEASEACTION")) {
String lockAction = getValue("RELEASEACTION");
parentRequest.setReleaseAction(lockAction);
}
// check for errors in the request
if (((filterSize != featureSize) && (filterSize > 0))
|| ((filterSize > 0) && (featureSize == 0))) {
throw new WfsException("Filter size does not match"
+ " feature types. Filter size: " + filterSize
+ " Feature size: " + featureSize);
} else if (filterSize == featureSize) {
for (int i = 0, n = featureSize; i < n; i++) {
DeleteRequest childRequest = new DeleteRequest();
childRequest.setTypeName((String) typeList.get(i));
childRequest.setFilter((Filter) filterList.get(i));
childRequest.setReleaseAll(releaseAll);
parentRequest.addSubRequest(childRequest);
}
} else if (filterSize == 0) {
String message = "No filter found. If you are sure you want to "
+ "wipe out your database, then use a filter that is always true"
+ ". We just don't want you to inadvertantly wipe everything "
+ "out without intending to";
throw new WfsException(message);
}
return parentRequest;
}