01: package org.geoserver.wfsv.response.v1_1_0;
02:
03: import org.eclipse.xsd.XSDSchema;
04: import org.geoserver.platform.GeoServerResourceLoader;
05: import org.geoserver.wfs.WFS;
06: import org.geoserver.wfs.xml.FeatureTypeSchemaBuilder;
07: import org.geoserver.wfs.xml.GML3Profile;
08: import org.geoserver.wfsv.xml.v1_1_0.WFSVConfiguration;
09: import org.geotools.feature.AttributeType;
10: import org.vfny.geoserver.global.Data;
11:
12: public class VersionedSchemaBuilder extends FeatureTypeSchemaBuilder {
13: /**
14: * Cached gml3 schema
15: */
16: private static XSDSchema gml3Schema;
17:
18: public VersionedSchemaBuilder(WFS wfs, Data catalog,
19: GeoServerResourceLoader resourceLoader,
20: WFSVConfiguration configuration) {
21: super (wfs, catalog, resourceLoader);
22:
23: profiles.add(new GML3Profile());
24:
25: gmlNamespace = org.geoserver.wfsv.xml.v1_1_0.WFSV.NAMESPACE;
26: gmlSchemaLocation = "wfs/1.1.0/wfsv.xsd";
27: baseType = "AbstractVersionedFeatureType";
28: substitutionGroup = "_VersionedFeature";
29: describeFeatureTypeBase = "request=DescribeVersionedFeatureType&version=1.1.0&versioned=true";
30: gmlPrefix = "wfsv";
31: xmlConfiguration = new org.geotools.gml3.GMLConfiguration();
32: }
33:
34: protected XSDSchema gmlSchema() {
35: if (gml3Schema == null) {
36: gml3Schema = xmlConfiguration.schema();
37: }
38:
39: return gml3Schema;
40: }
41:
42: protected boolean filterAttributeType(AttributeType attribute) {
43: return super .filterAttributeType(attribute)
44: || "metaDataProperty".equals(attribute.getName())
45: || "location".equals(attribute.getName());
46: }
47: }
|