diff --git a/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/format/gml/request/AbstractGmlRequestHandler.java b/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/format/gml/request/AbstractGmlRequestHandler.java index 212a9b798c..de76b76283 100644 --- a/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/format/gml/request/AbstractGmlRequestHandler.java +++ b/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/format/gml/request/AbstractGmlRequestHandler.java @@ -91,6 +91,7 @@ import org.deegree.gml.GMLStreamWriter; import org.deegree.gml.GMLVersion; import org.deegree.gml.reference.GmlXlinkOptions; +import org.deegree.protocol.wfs.describefeaturetype.DescribeFeatureType; import org.deegree.protocol.wfs.getfeature.TypeName; import org.deegree.services.controller.OGCFrontController; import org.deegree.services.i18n.Messages; @@ -101,11 +102,14 @@ import org.slf4j.LoggerFactory; /** - * + * Handles {@link DescribeFeatureType} requests for the {@link GmlFormat}. + * + * @see GmlFormat + * + * @author Markus Schneider * @author Andreas Schmitz - * @author last edited by: $Author$ - * - * @version $Revision$, $Date$ + * + * @since 3.2 */ abstract class AbstractGmlRequestHandler { @@ -228,7 +232,7 @@ protected void writeMemberFeature( Feature member, GMLStreamWriter gmlStream, XM *
  • WFS 2.0.0: GetFeature request using stored query (urn:ogc:def:query:OGC-WFS::GetFeatureById)
  • * *

    - * + * * @param version * WFS protocol version, must not be null * @param gmlVersion @@ -266,7 +270,7 @@ protected String getObjectXlinkTemplate( Version version, GMLVersion gmlVersion /** * Returns the value for the xsi:schemaLocation attribute in the response document. - * + * * @param requestVersion * requested WFS version, must not be null * @param requestedFts @@ -289,19 +293,23 @@ protected String getSchemaLocation( Version requestVersion, Collection requestedFts ) { GMLVersion gmlVersion = options.getGmlVersion(); + String schemaLocation = null; if ( GML_2 == gmlVersion ) { - return WFS_NS + " " + WFS_100_BASIC_SCHEMA_URL; + schemaLocation = WFS_NS + " " + WFS_100_BASIC_SCHEMA_URL; + } else { + schemaLocation = getSchemaLocation( VERSION_100, gmlVersion, WFS_FEATURECOLLECTION_NAME ); } - String schemaLocation = getSchemaLocation( VERSION_100, gmlVersion, WFS_FEATURECOLLECTION_NAME ); return schemaLocation + " " + getSchemaLocationPartForFeatureTypes( VERSION_100, gmlVersion, requestedFts ); } private String getSchemaLocationForWfs110( Collection requestedFts ) { GMLVersion gmlVersion = options.getGmlVersion(); + String schemaLocation = null; if ( GML_31 == gmlVersion ) { - return WFS_NS + " " + WFS_110_SCHEMA_URL; + schemaLocation = WFS_NS + " " + WFS_110_SCHEMA_URL; + } else { + schemaLocation = getSchemaLocation( VERSION_110, gmlVersion, WFS_FEATURECOLLECTION_NAME ); } - String schemaLocation = getSchemaLocation( VERSION_110, gmlVersion, WFS_FEATURECOLLECTION_NAME ); return schemaLocation + " " + getSchemaLocationPartForFeatureTypes( VERSION_110, gmlVersion, requestedFts ); } @@ -421,7 +429,7 @@ protected DateTime getCurrentDateTimeWithoutMilliseconds() { /** * Returns the value for the 'xsi:schemaLocation' attribute to be included in a GetGmlObject or * GetFeature response. - * + * * @param version * WFS protocol version, must not be null * @param gmlVersion @@ -440,9 +448,9 @@ protected String getSchemaLocation( Version version, GMLVersion gmlVersion, QNam baseUrl.append( "&REQUEST=DescribeFeatureType&OUTPUTFORMAT=" ); try { - if ( VERSION_100.equals( version ) && gmlVersion == GMLVersion.GML_2 ) { + if ( VERSION_100.equals( version ) && gmlVersion == GML_2 ) { baseUrl.append( "XMLSCHEMA" ); - } else if ( VERSION_200.equals( version ) && gmlVersion == GMLVersion.GML_32 ) { + } else if ( VERSION_200.equals( version ) && gmlVersion == GML_32 ) { baseUrl.append( URLEncoder.encode( gmlVersion.getMimeType(), "UTF-8" ) ); } else { baseUrl.append( URLEncoder.encode( gmlVersion.getMimeTypeOldStyle(), "UTF-8" ) );