Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deegree-services-wfs: Fix incomplete xsi:schemaLocation attributes in WFS 1.0.0/1.1.0 GetFeature response documents #191

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -101,11 +102,14 @@
import org.slf4j.LoggerFactory;

/**
*
* Handles {@link DescribeFeatureType} requests for the {@link GmlFormat}.
*
* @see GmlFormat
*
* @author <a href="mailto:schneider@occamlabs.de">Markus Schneider</a>
* @author <a href="mailto:schmitz@lat-lon.de">Andreas Schmitz</a>
* @author last edited by: $Author$
*
* @version $Revision$, $Date$
*
* @since 3.2
*/
abstract class AbstractGmlRequestHandler {

Expand Down Expand Up @@ -228,7 +232,7 @@ protected void writeMemberFeature( Feature member, GMLStreamWriter gmlStream, XM
* <li>WFS 2.0.0: GetFeature request using stored query (urn:ogc:def:query:OGC-WFS::GetFeatureById)</li>
* </ul>
* </p>
*
*
* @param version
* WFS protocol version, must not be <code>null</code>
* @param gmlVersion
Expand Down Expand Up @@ -266,7 +270,7 @@ protected String getObjectXlinkTemplate( Version version, GMLVersion gmlVersion

/**
* Returns the value for the <code>xsi:schemaLocation</code> attribute in the response document.
*
*
* @param requestVersion
* requested WFS version, must not be <code>null</code>
* @param requestedFts
Expand All @@ -289,19 +293,23 @@ protected String getSchemaLocation( Version requestVersion, Collection<FeatureTy

private String getSchemaLocationForWfs100( Collection<FeatureType> 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<FeatureType> 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 );
}

Expand Down Expand Up @@ -421,7 +429,7 @@ protected DateTime getCurrentDateTimeWithoutMilliseconds() {
/**
* Returns the value for the 'xsi:schemaLocation' attribute to be included in a <code>GetGmlObject</code> or
* <code>GetFeature</code> response.
*
*
* @param version
* WFS protocol version, must not be <code>null</code>
* @param gmlVersion
Expand All @@ -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" ) );
Expand Down