@Test public void testGetSupportedGetFeatureOutputFormats() throws IOException { createTestProtocol(GEOS_ARCHSITES.CAPABILITIES); Set<String> supportedOutputFormats = wfs.getSupportedGetFeatureOutputFormats(); assertNotNull(supportedOutputFormats); assertEquals(8, supportedOutputFormats.size()); assertTrue(supportedOutputFormats.contains("text/gml; subtype=gml/3.1.1")); assertTrue(supportedOutputFormats.contains("text/xml; subtype=gml/2.1.2")); assertTrue(supportedOutputFormats.contains("text/xml; subtype=gml/3.1.1")); assertTrue(supportedOutputFormats.contains("GML2-GZIP")); assertTrue(supportedOutputFormats.contains("gml3")); assertTrue(supportedOutputFormats.contains("json")); assertTrue(supportedOutputFormats.contains("SHAPE-ZIP")); assertTrue(supportedOutputFormats.contains("GML2")); }
public Set<String> getSupportedGetFeatureOutputFormats() { OperationType operationMetadata = getOperationMetadata(WFSOperationType.GET_FEATURE); List<DomainType> parameters = operationMetadata.getParameter(); List featuretypes = capabilities.getFeatureTypeList().getFeatureType(); List supportedByAllFeatureTypes= null; for (int i=0; i < featuretypes.size() ; i++){ net.opengis.wfs.FeatureTypeType ft = (FeatureTypeType) featuretypes.get(i); if (ft.getOutputFormats()!=null){ List value=ft.getOutputFormats().getFormat(); if (supportedByAllFeatureTypes ==null){ supportedByAllFeatureTypes=value; }else{ List removeOutputFormats= new ArrayList(); for (Object o : supportedByAllFeatureTypes){ if (!value.contains(o)){ removeOutputFormats.add(o); } } for (Object o : removeOutputFormats){ supportedByAllFeatureTypes.remove(o); } if (supportedByAllFeatureTypes.size() ==0){ break; } } } } Set<String> outputFormats = new HashSet<String>(); for (DomainType param : parameters) { String paramName = param.getName(); if ("outputFormat".equals(paramName)) { List value = param.getValue(); outputFormats.addAll(value); } } if (supportedByAllFeatureTypes!=null) outputFormats.addAll(supportedByAllFeatureTypes); return outputFormats; }
WFS_1_1_0_Protocol implements WFSProtocol { public Set<String> getSupportedGetFeatureOutputFormats() { OperationType operationMetadata = getOperationMetadata(WFSOperationType.GET_FEATURE); List<DomainType> parameters = operationMetadata.getParameter(); List featuretypes = capabilities.getFeatureTypeList().getFeatureType(); List supportedByAllFeatureTypes= null; for (int i=0; i < featuretypes.size() ; i++){ net.opengis.wfs.FeatureTypeType ft = (FeatureTypeType) featuretypes.get(i); if (ft.getOutputFormats()!=null){ List value=ft.getOutputFormats().getFormat(); if (supportedByAllFeatureTypes ==null){ supportedByAllFeatureTypes=value; }else{ List removeOutputFormats= new ArrayList(); for (Object o : supportedByAllFeatureTypes){ if (!value.contains(o)){ removeOutputFormats.add(o); } } for (Object o : removeOutputFormats){ supportedByAllFeatureTypes.remove(o); } if (supportedByAllFeatureTypes.size() ==0){ break; } } } } Set<String> outputFormats = new HashSet<String>(); for (DomainType param : parameters) { String paramName = param.getName(); if ("outputFormat".equals(paramName)) { List value = param.getValue(); outputFormats.addAll(value); } } if (supportedByAllFeatureTypes!=null) outputFormats.addAll(supportedByAllFeatureTypes); return outputFormats; } }
WFS_1_1_0_Protocol implements WFSProtocol { public Set<String> getSupportedGetFeatureOutputFormats() { OperationType operationMetadata = getOperationMetadata(WFSOperationType.GET_FEATURE); List<DomainType> parameters = operationMetadata.getParameter(); List featuretypes = capabilities.getFeatureTypeList().getFeatureType(); List supportedByAllFeatureTypes= null; for (int i=0; i < featuretypes.size() ; i++){ net.opengis.wfs.FeatureTypeType ft = (FeatureTypeType) featuretypes.get(i); if (ft.getOutputFormats()!=null){ List value=ft.getOutputFormats().getFormat(); if (supportedByAllFeatureTypes ==null){ supportedByAllFeatureTypes=value; }else{ List removeOutputFormats= new ArrayList(); for (Object o : supportedByAllFeatureTypes){ if (!value.contains(o)){ removeOutputFormats.add(o); } } for (Object o : removeOutputFormats){ supportedByAllFeatureTypes.remove(o); } if (supportedByAllFeatureTypes.size() ==0){ break; } } } } Set<String> outputFormats = new HashSet<String>(); for (DomainType param : parameters) { String paramName = param.getName(); if ("outputFormat".equals(paramName)) { List value = param.getValue(); outputFormats.addAll(value); } } if (supportedByAllFeatureTypes!=null) outputFormats.addAll(supportedByAllFeatureTypes); return outputFormats; } WFS_1_1_0_Protocol(InputStream capabilitiesReader, HTTPProtocol http); }
WFS_1_1_0_Protocol implements WFSProtocol { public Set<String> getSupportedGetFeatureOutputFormats() { OperationType operationMetadata = getOperationMetadata(WFSOperationType.GET_FEATURE); List<DomainType> parameters = operationMetadata.getParameter(); List featuretypes = capabilities.getFeatureTypeList().getFeatureType(); List supportedByAllFeatureTypes= null; for (int i=0; i < featuretypes.size() ; i++){ net.opengis.wfs.FeatureTypeType ft = (FeatureTypeType) featuretypes.get(i); if (ft.getOutputFormats()!=null){ List value=ft.getOutputFormats().getFormat(); if (supportedByAllFeatureTypes ==null){ supportedByAllFeatureTypes=value; }else{ List removeOutputFormats= new ArrayList(); for (Object o : supportedByAllFeatureTypes){ if (!value.contains(o)){ removeOutputFormats.add(o); } } for (Object o : removeOutputFormats){ supportedByAllFeatureTypes.remove(o); } if (supportedByAllFeatureTypes.size() ==0){ break; } } } } Set<String> outputFormats = new HashSet<String>(); for (DomainType param : parameters) { String paramName = param.getName(); if ("outputFormat".equals(paramName)) { List value = param.getValue(); outputFormats.addAll(value); } } if (supportedByAllFeatureTypes!=null) outputFormats.addAll(supportedByAllFeatureTypes); return outputFormats; } WFS_1_1_0_Protocol(InputStream capabilitiesReader, HTTPProtocol http); void setStrategy(WFSStrategy strategy); Version getServiceVersion(); String getServiceTitle(); String getServiceAbstract(); Set<String> getServiceKeywords(); URI getServiceProviderUri(); Set<String> getSupportedGetFeatureOutputFormats(); Set<String> getSupportedOutputFormats(String typeName); Set<QName> getFeatureTypeNames(); QName getFeatureTypeName(String typeName); FilterCapabilities getFilterCapabilities(); boolean supportsOperation(WFSOperationType operation, boolean post); URL getOperationURL(WFSOperationType operation, boolean post); String getFeatureTypeTitle(String typeName); String getFeatureTypeAbstract(String typeName); ReferencedEnvelope getFeatureTypeWGS84Bounds(String typeName); String getDefaultCRS(String typeName); Set<String> getSupportedCRSIdentifiers(String typeName); Set<String> getFeatureTypeKeywords(String typeName); URL getDescribeFeatureTypeURLGet(String typeName); WFSResponse describeFeatureTypeGET(String typeName, String outputFormat); WFSResponse describeFeatureTypePOST(String typeName, String outputFormat); WFSResponse issueGetFeatureGET(final GetFeature request); WFSResponse issueGetFeaturePOST(final GetFeature request); void dispose(); static void encode(final EObject request, final Configuration configuration,
            final OutputStream out, final Charset charset); String getDefaultOutputFormat(WFSOperationType operation); Filter[] splitFilters(Filter filter); }
WFS_1_1_0_Protocol implements WFSProtocol { public Set<String> getSupportedGetFeatureOutputFormats() { OperationType operationMetadata = getOperationMetadata(WFSOperationType.GET_FEATURE); List<DomainType> parameters = operationMetadata.getParameter(); List featuretypes = capabilities.getFeatureTypeList().getFeatureType(); List supportedByAllFeatureTypes= null; for (int i=0; i < featuretypes.size() ; i++){ net.opengis.wfs.FeatureTypeType ft = (FeatureTypeType) featuretypes.get(i); if (ft.getOutputFormats()!=null){ List value=ft.getOutputFormats().getFormat(); if (supportedByAllFeatureTypes ==null){ supportedByAllFeatureTypes=value; }else{ List removeOutputFormats= new ArrayList(); for (Object o : supportedByAllFeatureTypes){ if (!value.contains(o)){ removeOutputFormats.add(o); } } for (Object o : removeOutputFormats){ supportedByAllFeatureTypes.remove(o); } if (supportedByAllFeatureTypes.size() ==0){ break; } } } } Set<String> outputFormats = new HashSet<String>(); for (DomainType param : parameters) { String paramName = param.getName(); if ("outputFormat".equals(paramName)) { List value = param.getValue(); outputFormats.addAll(value); } } if (supportedByAllFeatureTypes!=null) outputFormats.addAll(supportedByAllFeatureTypes); return outputFormats; } WFS_1_1_0_Protocol(InputStream capabilitiesReader, HTTPProtocol http); void setStrategy(WFSStrategy strategy); Version getServiceVersion(); String getServiceTitle(); String getServiceAbstract(); Set<String> getServiceKeywords(); URI getServiceProviderUri(); Set<String> getSupportedGetFeatureOutputFormats(); Set<String> getSupportedOutputFormats(String typeName); Set<QName> getFeatureTypeNames(); QName getFeatureTypeName(String typeName); FilterCapabilities getFilterCapabilities(); boolean supportsOperation(WFSOperationType operation, boolean post); URL getOperationURL(WFSOperationType operation, boolean post); String getFeatureTypeTitle(String typeName); String getFeatureTypeAbstract(String typeName); ReferencedEnvelope getFeatureTypeWGS84Bounds(String typeName); String getDefaultCRS(String typeName); Set<String> getSupportedCRSIdentifiers(String typeName); Set<String> getFeatureTypeKeywords(String typeName); URL getDescribeFeatureTypeURLGet(String typeName); WFSResponse describeFeatureTypeGET(String typeName, String outputFormat); WFSResponse describeFeatureTypePOST(String typeName, String outputFormat); WFSResponse issueGetFeatureGET(final GetFeature request); WFSResponse issueGetFeaturePOST(final GetFeature request); void dispose(); static void encode(final EObject request, final Configuration configuration,
            final OutputStream out, final Charset charset); String getDefaultOutputFormat(WFSOperationType operation); Filter[] splitFilters(Filter filter);  }