Package net.opengis.ows10

Examples of net.opengis.ows10.OperationsMetadataType


            ByteArrayOutputStream trace = new ByteArrayOutputStream();
            exception.printStackTrace(new PrintStream(trace));
            e.getExceptionText().add(new String(trace.toByteArray()));
        }

        ExceptionReportType report = factory.createExceptionReportType();
        report.setVersion("1.0.0");
        report.getException().add(e);

        request.getHttpResponse().setContentType("application/xml");

        //response.setCharacterEncoding( "UTF-8" );
        OWSConfiguration configuration = new OWSConfiguration();
View Full Code Here


        document = dom(xml);
        Object result = parse(OWS.EXCEPTIONREPORT);

        assertNotNull(result);
        assertTrue(result instanceof ExceptionReportType);
        ExceptionReportType er = (ExceptionReportType) result;

        assertEquals("1.0.0", er.getVersion());
        assertEquals(1, er.getException().size());
        ExceptionType ex = (ExceptionType) er.getException().get(0);
        assertEquals("InvalidParameterValue", ex.getExceptionCode());
        assertEquals("service", ex.getLocator());
        assertEquals(1, ex.getExceptionText().size());
        assertEquals("No service: ( madeUp )", ex.getExceptionText().get(0));
    }
View Full Code Here

     * Writes out an OWS ExceptionReport document.
     */
    public void handleServiceException(ServiceException exception, Request request) {
        Ows10Factory factory = Ows10Factory.eINSTANCE;

        ExceptionType e = factory.createExceptionType();

        if (exception.getCode() != null) {
            e.setExceptionCode(exception.getCode());
        } else {
            //set a default
            e.setExceptionCode("NoApplicableCode");
        }

        e.setLocator(exception.getLocator());

        //add the message
        StringBuffer sb = new StringBuffer();
        OwsUtils.dumpExceptionMessages(exception, sb, true);
        e.getExceptionText().add(sb.toString());
        e.getExceptionText().addAll(exception.getExceptionText());

        if(verboseExceptions) {
            //add the entire stack trace
            //exception.
            e.getExceptionText().add("Details:");
            ByteArrayOutputStream trace = new ByteArrayOutputStream();
            exception.printStackTrace(new PrintStream(trace));
            e.getExceptionText().add(new String(trace.toByteArray()));
        }

        ExceptionReportType report = factory.createExceptionReportType();
        report.setVersion("1.0.0");
        report.getException().add(e);
View Full Code Here

        assertTrue(result instanceof ExceptionReportType);
        ExceptionReportType er = (ExceptionReportType) result;

        assertEquals("1.0.0", er.getVersion());
        assertEquals(1, er.getException().size());
        ExceptionType ex = (ExceptionType) er.getException().get(0);
        assertEquals("InvalidParameterValue", ex.getExceptionCode());
        assertEquals("service", ex.getLocator());
        assertEquals(1, ex.getExceptionText().size());
        assertEquals("No service: ( madeUp )", ex.getExceptionText().get(0));
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        GetCapabilitiesType getCapabilities;

        if ((value != null) && value instanceof GetCapabilitiesType) {
            getCapabilities = (GetCapabilitiesType) value;
        } else {
            getCapabilities = owsfactory.createGetCapabilitiesType();
        }

        getCapabilities.setAcceptVersions((AcceptVersionsType) node.getChildValue(
                AcceptVersionsType.class));
        getCapabilities.setSections((SectionsType) node.getChildValue(SectionsType.class));
        getCapabilities.setAcceptFormats((AcceptFormatsType) node.getChildValue(
                AcceptFormatsType.class));
        getCapabilities.setUpdateSequence((String) node.getAttributeValue("updateSequence"));

        return getCapabilities;
    }
View Full Code Here

        assertEquals( "application/xml", response.getMimeType(null,null));
    }
  
    public void testEncode() throws Exception {
        Ows10Factory f = Ows10Factory.eINSTANCE;
        GetCapabilitiesType caps = f.createGetCapabilitiesType();
        AcceptVersionsType versions = f.createAcceptVersionsType();
        caps.setAcceptVersions( versions );
       
        versions.getVersion().add( "1.0.0" );
        versions.getVersion().add( "1.1.0" );
       
        ByteArrayOutputStream output = new ByteArrayOutputStream();
View Full Code Here

           
            "</ows:GetCapabilities>";

        buildDocument(xml);

        GetCapabilitiesType getCaps = (GetCapabilitiesType) parse();
        assertNotNull(getCaps);
       
        assertEquals( 1, getCaps.getAcceptVersions().getVersion().size() );
    }
View Full Code Here

    @Override
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        Ows10Factory ows10Factory = Ows10Factory.eINSTANCE;

        DCPType dcpType = ows10Factory.createDCPType();
        HTTPType httpType = ows10Factory.createHTTPType();
        dcpType.setHTTP(httpType);

        List<Node> httpChildren = node.getChildren("HTTP");
        for (Node http : httpChildren) {
            Node get = http.getChild("Get");
            if (get != null) {
                RequestMethodType methodType = createRequestMethodType(ows10Factory, get);
                httpType.getGet().add(methodType);
            }
            Node post = http.getChild("Post");
            if (post != null) {
                RequestMethodType methodType = createRequestMethodType(ows10Factory, post);
                httpType.getPost().add(methodType);
            }
        }

        return dcpType;
View Full Code Here

        ServiceIdentificationType sa = caps.getServiceIdentification();
        assertNotNull(sa);

        assertEquals(1, sa.getKeywords().size());

        KeywordsType keywords = (KeywordsType) sa.getKeywords().get(0);
        assertTrue(keywords.getKeyword().contains("WFS"));
        assertTrue(keywords.getKeyword().contains("NY"));
        assertTrue(keywords.getKeyword().contains("New York"));

        assertEquals("WFS", sa.getServiceType().getValue());
        assertEquals("1.1.0", sa.getServiceTypeVersion());
    }
View Full Code Here

            String crs = value == null ? null : String.valueOf(value);
            ((FeatureTypeType) eObject).setDefaultSRS(crs);
        } else if ("Keywords".equals(property)){
            if (value instanceof String) {
                String[] split = ((String) value).split(",");
                KeywordsType kwd = Ows10Factory.eINSTANCE.createKeywordsType();
                for(int i = 0; i < split.length; i++){
                    String kw = split[i].trim();
                    kwd.getKeyword().add(kw);
                }
                ((FeatureTypeType) eObject).getKeywords().add(kwd);
                return;
            }
        } else if ("LatLongBoundingBox".equals(property)){ // WFS 1.0
View Full Code Here

TOP

Related Classes of net.opengis.ows10.OperationsMetadataType

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.