Package org.geoserver.wfs

Examples of org.geoserver.wfs.WFSInfo


    public void testEncodeSrsDimension() throws Exception {
        Document dom = getAsDOM("wfs?request=GetFeature&version=1.1.0&service=wfs&typename="
            + getLayerId(SystemTestData.PRIMITIVEGEOFEATURE));
        XMLAssert.assertXpathExists("//gml:Point[@srsDimension = '2']", dom);

        WFSInfo wfs = getWFS();
        wfs.setCiteCompliant(true);
        getGeoServer().save(wfs);

        dom = getAsDOM("wfs?request=GetFeature&version=1.1.0&service=wfs&typename="
                + getLayerId(SystemTestData.PRIMITIVEGEOFEATURE));
        XMLAssert.assertXpathNotExists("//gml:Point[@srsDimension = '2']", dom);
View Full Code Here


     * @throws Exception
     */

    @Test
    public void testPropertyEncodingOrder_GeologicUnit() throws Exception {
        WFSInfo wfs = getGeoServer().getService(WFSInfo.class);
        wfs.setEncodeFeatureMember(true);
        getGeoServer().save(wfs);
        String path = "wfs?request=GetFeature&version=1.1.0&typename=gsml:GeologicUnit&featureid=gu.25699";
        Document doc = getAsDOM(path);
        LOGGER.info("WFS GetFeature&typename=gsml:GeologicUnit&featureid=gu.25699:\n"
                + prettyString(doc));
View Full Code Here

        testData.addVectorLayer(STREAMS, new HashMap<LayerProperty,Object>(), "Streams.properties", MockData.class, getCatalog());
    }
   
    @Before
    public void oneTimeSetUp() throws Exception {
      WFSInfo wfs = getGeoServer().getService( WFSInfo.class );
        wfs.setFeatureBounding(true);
      getGeoServer().save(wfs);
    }
View Full Code Here

        return "text/xml";
    }

    protected void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
        Operation describeFeatureType) throws IOException {
        WFSInfo wfs = getInfo();
       
        //generates response, using general function
        String xmlResponse = generateTypes(featureTypeInfos, (DescribeFeatureTypeType) describeFeatureType.getParameters()[0]);

        if (!wfs.getGeoServer().getSettings().isVerbose()) {
            //strip out the formatting.  This is pretty much the only way we
            //can do this, as the user files are going to have newline
            //characters and whatnot, unless we can get rid of formatting
            //when we read the file, which could be worth looking into if
            //this slows things down.
            xmlResponse = xmlResponse.replaceAll(">\n[ \\t\\n]*", ">");
            xmlResponse = xmlResponse.replaceAll("\n[ \\t\\n]*", " ");
        }

        Writer writer = new OutputStreamWriter(output, wfs.getGeoServer().getSettings().getCharset());
        writer.write(xmlResponse);
        writer.flush();
    }
View Full Code Here

        WFSXmlUtils.initWfsConfiguration(config, gs, new FeatureTypeSchemaBuilder.GML32(gs));
       
        Parser parser = new Parser(config);
        parser.setEntityResolver(entityResolverProvider.getEntityResolver());
       
        WFSInfo wfs = wfs();
       
        WFSXmlUtils.initRequestParser(parser, wfs, gs, kvp);
        Object parsed = null;
        try {
            parsed = WFSXmlUtils.parseRequest(parser, reader, wfs);   
View Full Code Here

    @Before
    public void setupInspireExtensions() {
       
        // prepare read only metadata
        final WFSInfo wfs = getGeoServer().getService(WFSInfo.class);
        wfs.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre");
        wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz");
        wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_TYPE.key, "application/vnd.iso.19139+xml");
        wfs.getMetadata().put(InspireMetadata.SPATIAL_DATASET_IDENTIFIER_TYPE.key,
                "one,http://www.geoserver.org/one;two,http://www.geoserver.org/two");
        getGeoServer().save(wfs);
       
        tester.startPage(new FormTestPage(new ComponentBuilder() {
View Full Code Here

     * <li><tt>&lt;encodeFeatureMember&gt;true&lt;/encodeFeatureMember&gt;<tt></li>
     * </ul>
     */
    @Override
    protected void onSetUp(SystemTestData testData) throws Exception {
        WFSInfo wfs = getGeoServer().getService(WFSInfo.class);
        wfs.setCanonicalSchemaLocation(true);
        wfs.setEncodeFeatureMember(true);
        getGeoServer().save(wfs);
        // disable schema caching in tests, as schemas are expected to provided on the classpath
        SchemaCache.disableAutomaticConfiguration();
    }
View Full Code Here

        super.setUpTestData(testData);
    }
   
    @Before
    public void clearMetadata() {
        WFSInfo wfs = getGeoServer().getService(WFSInfo.class);
        wfs.getMetadata().clear();
        getGeoServer().save(wfs);
    }
View Full Code Here

        getGeoServer().save(wfs);
    }

    @Test
    public void testExtendedCaps110() throws Exception {
        WFSInfo wfs = getGeoServer().getService(WFSInfo.class);
        wfs.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre");
        wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz");
        wfs.getMetadata().put(InspireMetadata.SPATIAL_DATASET_IDENTIFIER_TYPE.key, "codeOnly");
        getGeoServer().save(wfs);

        Document dom = getAsDOM("wfs?request=getcapabilities&service=wfs&version=1.1.0");
        // print(dom);
        assertEquals(DLS_NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_dls"));
View Full Code Here

        assertNull(ns);
    }
   
    @Test
    public void testExtendedCaps200() throws Exception {
        WFSInfo wfs = getGeoServer().getService(WFSInfo.class);
        wfs.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre");
        wfs.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz");
        wfs.getMetadata().put(InspireMetadata.SPATIAL_DATASET_IDENTIFIER_TYPE.key, "one,http://www.geoserver.org/inspire/one");
        getGeoServer().save(wfs);

        Document dom = getAsDOM("wfs?request=getcapabilities&service=wfs&version=2.0.0");
        // print(dom);
        assertEquals(DLS_NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_dls"));
View Full Code Here

TOP

Related Classes of org.geoserver.wfs.WFSInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.