metas.add(meta);
}
GeoServerInfo global = wfs.getGeoServer().getGlobal();
Encoder encoder = new Encoder(configuration, configuration.schema());
encoder.setEncoding(Charset.forName( global.getCharset() ));
// declare wfs schema location
BaseRequestType gft = (BaseRequestType) getFeature.getParameters()[0];
encoder.setSchemaLocation(org.geoserver.wfsv.xml.v1_1_0.WFSV.NAMESPACE,
buildSchemaURL(gft.getBaseUrl(), "wfs/1.1.0/wfs.xsd"));
// declare application schema namespaces
for (Iterator i = ns2metas.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
String namespaceURI = (String) entry.getKey();
Set metas = (Set) entry.getValue();
StringBuffer typeNames = new StringBuffer();
for (Iterator m = metas.iterator(); m.hasNext();) {
FeatureTypeInfo meta = (FeatureTypeInfo) m.next();
typeNames.append(meta.getName());
if (m.hasNext()) {
typeNames.append(",");
}
}
// set the schema location
Map<String, String> params = params("service", "WFS",
"version", "1.1.0",
"request", "DescribeFeatureType",
"typeName", typeNames.toString());
encoder.setSchemaLocation(namespaceURI, buildURL(gft.getBaseUrl(), "wfs", params, URLType.SERVICE));
}
encoder.encode(results,
org.geoserver.wfs.xml.v1_1_0.WFS.FEATURECOLLECTION, output);
}