Package net.opengis.wfs

Examples of net.opengis.wfs.GetCapabilitiesType


public class CapabilitiesTransformerTest extends WFSTestSupport {

    static Logger logger = org.geotools.util.logging.Logging.getLogger("org.geoserver.wfs.test");

    GetCapabilitiesType request() {
        GetCapabilitiesType type = WfsFactory.eINSTANCE.createGetCapabilitiesType();
        type.setBaseUrl("http://localhost:8080/geoserver");
        return type;
    }
View Full Code Here


    public GetCapabilitiesTypeBindingTest() {
        super(WFS.GetCapabilitiesType, GetCapabilitiesType.class, Binding.OVERRIDE);
    }

    public void testEncode() throws Exception {
        GetCapabilitiesType getCaps = factory.createGetCapabilitiesType();
        Document dom = encode(getCaps, WFS.GetCapabilities);

        assertEquals("wfs:GetCapabilities", dom.getDocumentElement().getNodeName());
        assertEquals("WFS", dom.getDocumentElement().getAttribute("service"));
    }
View Full Code Here

        if (kvp.containsKey("version")) {
            AcceptVersionsType acceptVersions = Ows10Factory.eINSTANCE
                .createAcceptVersionsType();
            acceptVersions.getVersion().add(kvp.get("version"));

            GetCapabilitiesType getCapabilities = (GetCapabilitiesType) request;
            getCapabilities.setAcceptVersions(acceptVersions);
        }

        return request;
    }
View Full Code Here

        return "GetCapabilities".equalsIgnoreCase(operation.getId()) &&
                operation.getService().getId().equals("wfs");
    }

    public String getMimeType(Object value, Operation operation) {
        GetCapabilitiesType request = (GetCapabilitiesType) OwsUtils.parameter(operation
                .getParameters(), GetCapabilitiesType.class);

        if ((request != null) && (request.getAcceptFormats() != null)) {
            //look for an accepted format
            List formats = request.getAcceptFormats().getOutputFormat();

            for (Iterator f = formats.iterator(); f.hasNext();) {
                String format = (String) f.next();

                if (format.endsWith("/xml")) {
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        GetCapabilitiesType getCapabilities = wfsFactory.createGetCapabilitiesType();
        getCapabilities.setAcceptVersions(owsFactory.createAcceptVersionsType());

        WFSBindingUtils.service(getCapabilities, node);

        getCapabilities.getAcceptVersions().getVersion().add(node.getAttributeValue("version"));

        return getCapabilities;
    }
View Full Code Here

public class CapabilitiesTransformerTest extends WFSTestSupport {

    static Logger logger = org.geotools.util.logging.Logging.getLogger("org.geoserver.wfs.test");

    GetCapabilitiesType request() {
        GetCapabilitiesType type = WfsFactory.eINSTANCE.createGetCapabilitiesType();
        type.setBaseUrl("http://localhost:8080/geoserver");
        return type;
    }
View Full Code Here

        return type;
    }

    @Test
    public void test() throws Exception {
      GetCapabilitiesType request = request();
        CapabilitiesTransformer tx = new CapabilitiesTransformer.WFS1_1(getWFS(), request.getBaseUrl(), getCatalog(), Collections.<WFSExtendedCapabilitiesProvider>emptyList());
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        tx.transform(request, output);

        InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(output
                .toByteArray()));
View Full Code Here

    /**
     * see GEOS-2461
     */
    @Test
    public void testDefaultOutputFormat() throws Exception {
      GetCapabilitiesType request = request();
        CapabilitiesTransformer tx = new CapabilitiesTransformer.WFS1_1(getWFS(), request.getBaseUrl(), getCatalog(), Collections.<WFSExtendedCapabilitiesProvider>emptyList());
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        tx.transform(request, output);

        Document dom = super.dom(new ByteArrayInputStream(output.toByteArray()));

View Full Code Here

     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        net.opengis.ows10.GetCapabilitiesType owsGetCapabilities = (net.opengis.ows10.GetCapabilitiesType) value;
        GetCapabilitiesType getCapabilities = wfsfactory.createGetCapabilitiesType();

        getCapabilities.setAcceptFormats(owsGetCapabilities.getAcceptFormats());
        getCapabilities.setAcceptVersions(owsGetCapabilities.getAcceptVersions());
        getCapabilities.setSections(owsGetCapabilities.getSections());
        getCapabilities.setUpdateSequence(owsGetCapabilities.getUpdateSequence());

        if (node.hasAttribute("service")) {
            getCapabilities.setService((String) node.getAttributeValue("service"));
        }

        return getCapabilities;
    }
View Full Code Here

    }

    @Test
    public void test7() throws Exception {
        // test accepted = 1.0.5
        GetCapabilitiesType request = factory.createGetCapabilitiesType();
        request.setService("WFS");
        request.setAcceptVersions(owsFactory.createAcceptVersionsType());
        request.getAcceptVersions().getVersion().add("1.0.5");

        TransformerBase tx = getCaps.run(GetCapabilitiesRequest.adapt(request));
        assertTrue(tx instanceof CapabilitiesTransformer.WFS1_0);
    }
View Full Code Here

TOP

Related Classes of net.opengis.wfs.GetCapabilitiesType

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.