RequestMethodType getRecordsPost = owsf.createRequestMethodType();
getRecordsPost.setHref(getRecordsHref);
// - GetRecords - constraints
DomainType getRecordsPostConstraints = owsf.createDomainType();
getRecordsPostConstraints.setName("PostEncoding");
getRecordsPostConstraints.getValue().add("XML");
getRecordsPost.getConstraint().add(getRecordsPostConstraints);
getRecordsHTTP.getPost().add(getRecordsPost);
// - Parameters
for (DomainType param : operationParameters.get("GetRecords"))
{
// clone the object, as the caps decorators might want to modify it
getRecords.getParameter().add(EcoreUtil.copy(param));
}
// - Constraints
for (DomainType constraint : operationConstraints.get("GetRecords"))
{
// clone the object, as the caps decorators might want to modify it
getRecords.getConstraint().add(EcoreUtil.copy(constraint));
}
// the additional queriables based on the store
try {
for(RecordDescriptor rd : store.getRecordDescriptors()) {
List<Name> queriables = store.getCapabilities().getQueriables(rd.getFeatureDescriptor().getName() );
if(queriables != null && queriables.size() > 0) {
DomainType dt = owsf.createDomainType();
dt.setName(rd.getQueryablesDescription());
NamespaceSupport nss = rd.getNamespaceSupport();
for (Name q : queriables) {
String prefix = nss.getPrefix(q.getNamespaceURI());
dt.getValue().add(prefix==null? q.getLocalPart() : prefix + ":" + q.getLocalPart());
}
getRecords.getConstraint().add(dt);
}
}
DomainType dt = owsf.createDomainType();
dt.setName("XPathQueryables");
dt.getValue().add("allowed");
getRecords.getConstraint().add(dt);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to encode getRecords additional queriables", e);
}