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