Examples of DocumentOutputDefinitionType


Examples of net.opengis.wps10.DocumentOutputDefinitionType

            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));
            processOutputs.getOutput().add( output );
           
            final Object o = result.get( key );
            ProcessParameterIO ppio = ppios.get( key );
           
            if ( ppio instanceof ReferencePPIO ) {
                //encode as a reference
                OutputReferenceType ref = f.createOutputReferenceType();
                output.setReference( ref );
               
                //TODO: mime type
                ref.setHref( ((ReferencePPIO) ppio).encode(o).toString() );
            }
            else {
                //encode as data
                DataType data = f.createDataType();
                output.setData( data );
          
                if ( ppio instanceof LiteralPPIO ) {
                    LiteralDataType literal = f.createLiteralDataType();
                    data.setLiteralData( literal );
                   
View Full Code Here

Examples of net.opengis.wps10.DocumentOutputDefinitionType

        exeRequest.setIdentifier(processIdenLocal);
        exeRequest.addInput("envelope", Arrays.asList(wps.createBoundingBoxInputValue("EPSG:4326", 2, Arrays.asList(-180d, -90d), Arrays.asList(180d, 90d))));
        exeRequest.addInput("width", Arrays.asList(wps.createLiteralInputValue("100")));
        exeRequest.addInput("height", Arrays.asList(wps.createLiteralInputValue("50")));
        ResponseDocumentType doc = wps.createResponseDocumentType(false, true, true, "result");
        DocumentOutputDefinitionType odt = (DocumentOutputDefinitionType) doc.getOutput().get(0);
        odt.setMimeType("application/arcgrid");
        odt.setAsReference(true);
        ResponseFormType responseForm = wps.createResponseForm(doc, null);
        exeRequest.setResponseForm(responseForm);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);
View Full Code Here

Examples of net.opengis.wps10.DocumentOutputDefinitionType

        // setup a fake call to fake process
        ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
        exeRequest.setIdentifier(processIdenLocal);
        ResponseDocumentType doc = wps.createResponseDocumentType(false, true, true, "result");
        DocumentOutputDefinitionType odt = (DocumentOutputDefinitionType) doc.getOutput().get(0);
        odt.setMimeType("application/arcgrid");
        odt.setAsReference(true);
        ResponseFormType responseForm = wps.createResponseForm(doc, null);
        exeRequest.setResponseForm(responseForm);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);
View Full Code Here

Examples of net.opengis.wps10.DocumentOutputDefinitionType

        responseDoc.setStatus(status);
        responseDoc.setStoreExecuteResponse(storeExecuteResponse);

        if (outputType != null)
        {
            DocumentOutputDefinitionType output = wpsFactory.createDocumentOutputDefinitionType();
            CodeType inputType = Ows11Factory.eINSTANCE.createCodeType();
            inputType.setValue(outputType);
            output.setIdentifier(inputType);
            responseDoc.getOutput().add(output);
        }

        return responseDoc;
    }
View Full Code Here

Examples of net.opengis.wps10.DocumentOutputDefinitionType

            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());
                if (ppio instanceof BinaryPPIO) {
                    output.setEncoding("base64");
                } else if (ppio instanceof XMLPPIO) {
                    output.setEncoding("utf-8");
                }
            }

            // TODO: better encoding handling + schema
        }

        // process outputs
        ProcessOutputsType1 processOutputs = f.createProcessOutputsType1();
        response.setProcessOutputs(processOutputs);

        for (String key : outputMap.keySet()) {
            OutputDataType output = f.createOutputDataType();
            output.setIdentifier(Ows11Util.code(key));
            output.setTitle(Ows11Util
                    .languageString(pf.getResultInfo(processName, null).get(key).description));
            processOutputs.getOutput().add(output);

            final Object o = outputMap.get(key).object;
            ProcessParameterIO ppio = ppios.get(key);

            if (ppio instanceof ReferencePPIO) {
                // encode as a reference
                OutputReferenceType ref = f.createOutputReferenceType();
                output.setReference(ref);

                ref.setMimeType(outputMap.get(key).definition.getMimeType());
                ref.setHref(((ReferencePPIO) ppio).encode(o).toString());
            } else {
                // encode as data
                DataType data = f.createDataType();
                output.setData(data);

                try {
                  if (ppio instanceof LiteralPPIO) {
                      LiteralDataType literal = f.createLiteralDataType();
                      data.setLiteralData(literal);
View Full Code Here

Examples of net.opengis.wps10.DocumentOutputDefinitionType

                    && request.getResponseForm().getResponseDocument().getOutput().size() > 0) {
                // we have a selection of outputs, possibly with indication of mime type
                // and reference encoding
                EList outputs = request.getResponseForm().getResponseDocument().getOutput();
                for (Object object : outputs) {
                    DocumentOutputDefinitionType odt = (DocumentOutputDefinitionType) object;
                    String key = odt.getIdentifier().getValue();
                    Parameter<?> outputParam = resultInfo.get(key);
                    if (outputParam == null) {
                        throw new WPSException("Unknown output " + key + " possible values are: "
                                + resultInfo.keySet());
                    }

                    String mimeType = odt.getMimeType();
                    OutputDataType output = encodeOutput(key, outputParam, mimeType, odt.isAsReference());
                    processOutputs.getOutput().add(output);
                }
            } else {
                // encode all as inline for the moment
                for (String key : outputs.keySet()) {
View Full Code Here

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
TOP
Copyright © 2018 www.massapi.com. 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.