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.ows.AcceptVersionsType;
08: import net.opengis.ows.OwsFactory;
09: import net.opengis.wfs.GetCapabilitiesType;
10: import java.util.Map;
11:
12: public class GetCapabilitiesKvpRequestReader extends
13: WFSKvpRequestReader {
14: public GetCapabilitiesKvpRequestReader() {
15: super (GetCapabilitiesType.class);
16: }
17:
18: public Object read(Object request, Map kvp, Map rawKvp)
19: throws Exception {
20: request = super .read(request, kvp, rawKvp);
21:
22: //set the version attribute on the request
23: if (kvp.containsKey("version")) {
24: AcceptVersionsType acceptVersions = OwsFactory.eINSTANCE
25: .createAcceptVersionsType();
26: acceptVersions.getVersion().add(kvp.get("version"));
27:
28: GetCapabilitiesType getCapabilities = (GetCapabilitiesType) request;
29: getCapabilities.setAcceptVersions(acceptVersions);
30: }
31:
32: return request;
33: }
34: }
|