getFeature.setResolve(request.getResolve());
getFeature.setResolveDepth(request.getResolveDepth());
getFeature.setResolveTimeout(request.getResolveTimeout());
getFeature.setCount(request.getCount());
FeatureCollectionType fc = (FeatureCollectionType) delegate.run(
GetFeatureRequest.adapt(getFeature)).getAdaptee();
QueryType query = (QueryType) request.getAbstractQueryExpression();
QName typeName = (QName) query.getTypeNames().iterator().next();
FeatureTypeInfo featureType = catalog.getFeatureTypeByName(typeName.getNamespaceURI(),
typeName.getLocalPart());
try {
PropertyName propertyName = filterFactory.property(request.getValueReference(),
getNamespaceSupport());
PropertyName propertyNameNoIndexes = filterFactory.property(request.getValueReference()
.replaceAll("\\[.*\\]", ""), getNamespaceSupport());
AttributeDescriptor descriptor = (AttributeDescriptor) propertyNameNoIndexes
.evaluate(featureType.getFeatureType());
if (descriptor == null) {
throw new WFSException(request, "No such attribute: " + request.getValueReference());
}
// create value collection type from feature collection
ValueCollectionType vc = Wfs20Factory.eINSTANCE.createValueCollectionType();
vc.setTimeStamp(fc.getTimeStamp());
vc.setNumberMatched(fc.getNumberMatched());
vc.setNumberReturned(fc.getNumberReturned());
vc.getMember().add(new PropertyValueCollection(fc.getMember().iterator().next(), descriptor, propertyName));
return vc;
} catch (IOException e) {
throw new WFSException(request, e);
}
}