Package net.opengis.wps10

Examples of net.opengis.wps10.DocumentOutputDefinitionType


            throw new WPSException("Unknown output " + ioParam.id);
        }
       
        OutputDefinitionType odt;
        if(inDocument) {
            DocumentOutputDefinitionType dout = factory.createDocumentOutputDefinitionType();
            dout.setAsReference(Boolean.parseBoolean(ioParam.attributes.get("asReference")));
            odt = dout;
        } else {
            odt = factory.createOutputDefinitionType();
        }
        odt.setIdentifier(Ows11Util.code(ioParam.id));
View Full Code Here


            error = t;
        }
       
        //build the response
        Wps10Factory f = Wps10Factory.eINSTANCE;
        ExecuteResponseType response = f.createExecuteResponseType();
        response.setLang("en");
        response.setServiceInstance(ResponseUtils.appendQueryString(ResponseUtils.buildURL(request.getBaseUrl(), "ows", null, URLType.SERVICE), ""));
      
        //process
        final ProcessBriefType process = f.createProcessBriefType();
        response.setProcess( process );
        process.setIdentifier(ct);
        process.setProcessVersion(pf.getVersion(processName));
        process.setTitle( Ows11Util.languageString( pf.getTitle(processName).toString() ) );
        process.setAbstract( Ows11Util.languageString( pf.getDescription(processName).toString() ) );
      
        //status
        response.setStatus( f.createStatusType() );
        response.getStatus().setCreationTime( Converters.convert( started, XMLGregorianCalendar.class ));
       
        if ( error != null ) {
            ProcessFailedType failure = f.createProcessFailedType();
            response.getStatus().setProcessFailed( failure );
           
            failure.setExceptionReport( Ows11Util.exceptionReport( new ServiceException( error ), wps.getGeoServer().getGlobal().isVerboseExceptions()) );
        }
        else {
            response.getStatus().setProcessSucceeded( "Process succeeded.");
        }
     
        //inputs
        response.setDataInputs( f.createDataInputsType1() );
        for ( Iterator i = request.getDataInputs().getInput().iterator(); i.hasNext(); ) {
            InputType input = (InputType) i.next();
            response.getDataInputs().getInput().add( EMFUtils.clone( input, f, true ) );
        }
       
        //output definitions
        OutputDefinitionsType outputs = f.createOutputDefinitionsType();
        response.setOutputDefinitions( outputs );
       
        Map<String,Parameter<?>> outs = pf.getResultInfo(processName, null);
        Map<String,ProcessParameterIO> ppios = new HashMap();
       
        for ( String key : result.keySet() ) {
            Parameter p = pf.getResultInfo(processName, null).get( key );
            if ( p == null ) {
                throw new WPSException( "No such output: " + key );
            }
           
            //find the ppio
            ProcessParameterIO ppio = ProcessParameterIO.find( p, context );
            if ( ppio == null ) {
                throw new WPSException( "Unable to encode output: " + p.key );
            }
            ppios.put( p.key, ppio );
           
            DocumentOutputDefinitionType output = f.createDocumentOutputDefinitionType();
            outputs.getOutput().add( output );
           
            output.setIdentifier( Ows11Util.code( p.key ) );
            if ( ppio instanceof ComplexPPIO ) {
                output.setMimeType( ((ComplexPPIO) ppio).getMimeType() );
            }
           
            //TODO: encoding + schema
        }
       
        //process outputs
        ProcessOutputsType1 processOutputs = f.createProcessOutputsType1();
        response.setProcessOutputs( processOutputs );
       
        for ( String key : result.keySet() ) {
            OutputDataType output = f.createOutputDataType();
            output.setIdentifier(Ows11Util.code(key));
            output.setTitle(Ows11Util.languageString(pf.getResultInfo(processName, null).get( key ).description));
View Full Code Here

        if (execute.getResponseForm().getRawDataOutput() == null) {
            // normal execute response encoding
            return standardResponse.getMimeType(value, operation);
        } else {
            // raw response, let's see what the output is
            ExecuteResponseType response = (ExecuteResponseType) value;
            OutputDataType result = (OutputDataType) response
                    .getProcessOutputs().getOutput().get(0);
            LiteralDataType literal = result.getData().getLiteralData();
            if(literal != null) {
                // literals are encoded as plain strings
                return "text/plain";
            } else {
                // Execute should have properly setup the mime type
                OutputDefinitionType definition = (OutputDefinitionType) response
                    .getOutputDefinitions().getOutput().get(0);
                return definition.getMimeType();
            }
        }
View Full Code Here

        if (execute.getResponseForm().getRawDataOutput() == null) {
            // normal execute response encoding
            standardResponse.write(value, output, operation);
        } else {
            // raw response, let's see what the output is
            ExecuteResponseType response = (ExecuteResponseType) value;
            OutputDataType result = (OutputDataType) response
                    .getProcessOutputs().getOutput().get(0);
            LiteralDataType literal = result.getData().getLiteralData();
            if (literal != null) {
                writeLiteral(output, literal);
            } else {
View Full Code Here

        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);

        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNotNull(executeResponse);

        ExceptionReportType exceptionResponse = response.getExceptionResponse();
        assertNull(exceptionResponse);

        // check that the result is expected
        Geometry expected = geom1.buffer(350);
        EList outputs = executeResponse.getProcessOutputs().getOutput();
        OutputDataType output = (OutputDataType) outputs.get(0);
        Geometry result = (Geometry) output.getData().getComplexData().getData().get(0);
        // System.out.println(expected);
        // System.out.println(result);
        // assertTrue(expected.equals(result));
View Full Code Here

        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);

        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNotNull(executeResponse);

        ExceptionReportType exceptionResponse = response.getExceptionResponse();
        assertNull(exceptionResponse);

        // check result correctness
        EList outputs = executeResponse.getProcessOutputs().getOutput();
        assertTrue(!outputs.isEmpty());

        OutputDataType output = (OutputDataType) outputs.get(0);
        LiteralDataType literalData = output.getData().getLiteralData();
        String value = literalData.getValue();
View Full Code Here

        // response should not be null and no exception should occur.
        assertNotNull(response);

        // we should get a raw response, no exception, no response document
        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNull(executeResponse);
        ExceptionReportType exceptionResponse = response.getExceptionResponse();
        assertNull(exceptionResponse);

        // check result correctness
View Full Code Here

        // response should not be null and no exception should occur.
        assertNotNull(response);

        // we should get a raw response, no exception, no response document
        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNotNull(executeResponse);
        assertNotNull(executeResponse.getStatus().getProcessFailed());
        assertNotNull( executeResponse.getStatus().getProcessFailed().getExceptionReport());
    }
View Full Code Here

    }
   
    @Override
    public String getMimeType(Object value, Operation operation)
            throws ServiceException {
        ExecuteType execute = (ExecuteType) operation.getParameters()[0];
        if (execute.getResponseForm().getRawDataOutput() == null) {
            // normal execute response encoding
            return standardResponse.getMimeType(value, operation);
        } else {
            // raw response, let's see what the output is
            ExecuteResponseType response = (ExecuteResponseType) value;
View Full Code Here

    }

    @Override
    public void write(Object value, OutputStream output, Operation operation)
            throws IOException, ServiceException {
        ExecuteType execute = (ExecuteType) operation.getParameters()[0];
        if (execute.getResponseForm().getRawDataOutput() == null) {
            // normal execute response encoding
            standardResponse.write(value, output, operation);
        } else {
            // raw response, let's see what the output is
            ExecuteResponseType response = (ExecuteResponseType) value;
View Full Code Here

TOP

Related Classes of net.opengis.wps10.DocumentOutputDefinitionType

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.