Examples of OutputDataType


Examples of net.opengis.wps10.OutputDataType

                        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()) {
                    Parameter<?> outputParam = resultInfo.get(key);
                    OutputDataType output = encodeOutput(key, outputParam, null, false);
                    processOutputs.getOutput().add(output);
                }
            }
        }
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

    }

    OutputDataType encodeOutput(String key, Parameter<?> outputParam, String mimeType,
            boolean reference) {
        Wps10Factory f = Wps10Factory.eINSTANCE;
        OutputDataType output = f.createOutputDataType();
        output.setIdentifier(Ows11Util.code(key));
        output.setTitle(Ows11Util.languageString(outputParam.description));

        final Object o = outputs.get(key);
        if (mimeType == null) {
            mimeType = getOutputMimeType(key);
        }
        ProcessParameterIO ppio = ProcessParameterIO.find(outputParam, context, mimeType);

        if (ppio == null) {
            throw new WPSException("Don't know how to encode output " + key + " in mime type "
                    + mimeType);
        }

        try {
            if (reference && ppio instanceof ComplexPPIO) {
                // encode as reference
                OutputReferenceType outputReference = f.createOutputReferenceType();
                output.setReference(outputReference);
               
                ComplexPPIO cppio = (ComplexPPIO) ppio;
                File file = resourceManager.getOutputFile(executionId, key + "." + cppio.getFileExtension());
               
                // write out the file
                FileOutputStream fos = null;
                try {
                    fos = new FileOutputStream(file);
                    cppio.encode(o, fos);
                } finally {
                    IOUtils.closeQuietly(fos);
                }
               
                // create the link
                Map<String, String> kvp = new LinkedHashMap<String, String>();
                kvp.put("service", "WPS");
                kvp.put("version", "1.0.0");
                kvp.put("request", "GetExecutionResult");
                kvp.put("executionId", executionId);
                kvp.put("outputId", file.getName());
                if(o instanceof RawData) {
                  RawData rawData = (RawData) o;
                  kvp.put("mimetype", rawData.getMimeType());
                } else {
                  kvp.put("mimetype", cppio.getMimeType());
                }
                outputReference.setHref(ResponseUtils.buildURL(request.getBaseUrl(), "ows", kvp, URLType.SERVICE));
                outputReference.setMimeType(cppio.getMimeType());
            } 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.OutputDataType

            ExecuteResponseType response = (ExecuteResponseType) value;
            if(response.getProcessOutputs() == null) {
                // just a status report or a failure report
                return "text/xml";
            }
            OutputDataType result = (OutputDataType) response.getProcessOutputs().getOutput().get(0);
            LiteralDataType literal = result.getData().getLiteralData();
            ComplexDataType complex = result.getData().getComplexData();
            if(literal != null) {
                // literals are encoded as plain strings
                return "text/plain";
            } else if(complex != null) {
                // Execute should have properly setup the mime type
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

            ExecuteResponseType response = (ExecuteResponseType) value;
            if(response.getProcessOutputs() == null) {
                // just a status report or a failure report
                return "execute.xml";
            }
            OutputDataType result = (OutputDataType) response.getProcessOutputs().getOutput().get(0);
            String fname = result.getIdentifier().getValue();
            LiteralDataType literal = result.getData().getLiteralData();
            ComplexDataType complex = result.getData().getComplexData();
            String fext;
            // this is not the most robust way to get mime type...
            if (literal != null) {
                fext = "txt";
            } else if(complex != null) {
                String mimeType = result.getData().getComplexData().getMimeType();
                if (mimeType == null) {
                    fext = "txt";
                } else {
                    fext = mimeType.split("/")[1].toLowerCase();
                }
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

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

Examples of net.opengis.wps10.OutputDataType

            // 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
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

            // 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();
            BoundingBoxType bbox = result.getData().getBoundingBoxData();
            if (literal != null) {
                writeLiteral(output, literal);
            } else if(bbox != null) {
                writeBBox(output, bbox);
            } else {
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.