01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.geoserver.wfs.kvp;
06:
07: import net.opengis.wfs.DescribeFeatureTypeType;
08: import java.util.Map;
09:
10: public class DescribeFeatureTypeKvpRequestReader extends
11: WFSKvpRequestReader {
12: public DescribeFeatureTypeKvpRequestReader() {
13: super (DescribeFeatureTypeType.class);
14: }
15:
16: public Object read(Object request, Map kvp, Map rawKvp)
17: throws Exception {
18: //let super do its thing
19: request = super .read(request, kvp, rawKvp);
20:
21: //do an additional check for outputFormat, because the default
22: // in wfs 1.1 is not the default for wfs 1.0
23: DescribeFeatureTypeType describeFeatureType = (DescribeFeatureTypeType) request;
24:
25: if (!describeFeatureType.isSetOutputFormat()) {
26: if (describeFeatureType.getVersion().startsWith("1.1")) {
27: //set 1.1 default
28: describeFeatureType
29: .setOutputFormat("text/xml; subtype=gml/3.1.1");
30: } else {
31: //set 1.0 default
32: describeFeatureType.setOutputFormat("XMLSCHEMA");
33: }
34: }
35:
36: return request;
37: }
38: }
|