Package aQute.bnd.header

Examples of aQute.bnd.header.Attrs$DataType


        // if our value is some sort of collection, then created multiple
        // dataTypes for this inputdescriptiontype.
        List<EObject> list = new ArrayList<EObject>();
        if (inputValue instanceof Map) {
          for (Object inVal : ((Map)inputValue).values()) {
            DataType createdInput = WPSUtils.createInputDataType(inVal, idt);
            list.add(createdInput);
          }
        } else if (inputValue instanceof Collection) {
          for (Object inVal : (Collection)inputValue) {
            DataType createdInput = WPSUtils.createInputDataType(inVal, idt);
            list.add(createdInput);
          }
        } else {
          // our value is a single object so create a single datatype for it
          DataType createdInput = WPSUtils.createInputDataType(inputValue, idt);
          list.add(createdInput);
        }
        // add the input to the execute request
        exeRequest.addInput(identifier, list);
      }
View Full Code Here


    }

    @Override
    public DataType createLiteralInputValue(String literalValue)
    {
        DataType literalInputValue = wpsFactory.createDataType();
        LiteralDataType literalDataType = wpsFactory.createLiteralDataType();
        literalDataType.setValue(literalValue);
        literalInputValue.setLiteralData(literalDataType);

        return literalInputValue;
    }
View Full Code Here

    @Override
    public DataType createBoundingBoxInputValue(String crs, int dimensions, List<Double> lowerCorner,
        List<Double> upperCorner)
    {
        DataType bbox = wpsFactory.createDataType();
        BoundingBoxType bboxType = Ows11Factory.eINSTANCE.createBoundingBoxType();
        bboxType.setCrs(crs);
        bboxType.setDimensions(BigInteger.valueOf(dimensions));
        bboxType.setLowerCorner(lowerCorner);
        bboxType.setUpperCorner(upperCorner);
        bbox.setBoundingBoxData(bboxType);

        return bbox;
    }
View Full Code Here

        ex.setDataInputs(inputs);

        InputType in = f.createInputType();
        inputs.getInput().add(in);

        DataType data = f.createDataType();
        in.setData(data);

        ComplexDataType cd = f.createComplexDataType();
        data.setComplexData(cd);

        //cd.getData().add(new GeometryFactory().createPoint(new Coordinate(1, 2)));

        Encoder e = new Encoder(new WPSConfiguration());
        e.setIndenting(true);
View Full Code Here

        LanguageStringType title = Ows11Factory.eINSTANCE.createLanguageStringType();
        output.setTitle(title);
        title.setValue("foo");

        DataType data = f.createDataType();
        output.setData(data);

        ComplexDataType cdata = f.createComplexDataType();
        data.setComplexData(cdata);
        //cdata.getData().add(new GeometryFactory().createPoint(new Coordinate(1, 1)));

        Encoder e = new Encoder(new WPSConfiguration());
        e.setIndenting(true);
        e.encode(response, WPS.ExecuteResponse, System.out);
View Full Code Here

                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);
 
                      literal.setValue(((LiteralPPIO) ppio).encode(o));
                  } else if (ppio instanceof BoundingBoxPPIO) {
                      BoundingBoxType bbox = ((BoundingBoxPPIO) ppio).encode(o);
                      data.setBoundingBoxData(bbox);
                  } else if (ppio instanceof ComplexPPIO) {
                      ComplexDataType complex = f.createComplexDataType();
                      data.setComplexData(complex);
 
                      ComplexPPIO cppio = (ComplexPPIO) ppio;
                      complex.setMimeType(cppio.getMimeType());
 
                      if (cppio instanceof XMLPPIO) {
View Full Code Here

                        decoded = executeRemoteRequest(ref, (ComplexPPIO) ppio, inputId);
                    }

                } else {
                    // actual data, figure out which type
                    DataType data = input.getData();

                    if (data.getLiteralData() != null) {
                        LiteralDataType literal = data.getLiteralData();
                        decoded = ((LiteralPPIO) ppio).decode(literal.getValue());
                    } else if (data.getComplexData() != null) {
                        ComplexDataType complex = data.getComplexData();
                        decoded = ((ComplexPPIO) ppio).decode(complex.getData().get(0));
                    } else if (data.getBoundingBoxData() != null) {
                        decoded = ((BoundingBoxPPIO) ppio).decode(data.getBoundingBoxData());
                    }

                }
            } catch (Exception e) {
                throw new WPSException("Unable to decode input: " + inputId, e);
View Full Code Here

                }
                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);

                    literal.setValue(((LiteralPPIO) ppio).encode(o));
                } else if (ppio instanceof BoundingBoxPPIO) {
                    BoundingBoxType bbox = ((BoundingBoxPPIO) ppio).encode(o);
                    data.setBoundingBoxData(bbox);
                } else if (ppio instanceof ComplexPPIO) {
                    ComplexDataType complex = f.createComplexDataType();
                    data.setComplexData(complex);

                    ComplexPPIO cppio = (ComplexPPIO) ppio;
                    complex.setMimeType(cppio.getMimeType());

                    if (cppio instanceof RawDataPPIO) {
View Full Code Here

        return data;
    }

    private Object decodeInputData(final InputType input) {
        Object   output = null;
        DataType data   = input.getData();

        String       parameterName = input.getIdentifier().getValue();
        Parameter<?> parameter     = this.inputParameters.get(parameterName);

        try {
            if (null != data.getLiteralData()) {
                output = this.decodeLiteralData(data.getLiteralData(), parameter.type);
            }

            if (null != data.getComplexData()) {
                output = this.decodeComplexData(data.getComplexData(), parameter.type);
            }
        } catch(Exception e) {
            throw new WPSException("InvalidParameterValue", parameterName);
        }

        if (null != data.getBoundingBoxData()) {
            // Parse bounding box data
            throw new WPSException("NoApplicableCode", "Unimplemented");
        }

        return output;
View Full Code Here

                    value = executeRemoteRequest(ref, (ComplexPPIO) ppio, inputId);
                }

            } else {
                // actual data, figure out which type
                DataType data = input.getData();

                if (data.getLiteralData() != null) {
                    LiteralDataType literal = data.getLiteralData();
                    value = ((LiteralPPIO) ppio).decode(literal.getValue());
                } else if (data.getComplexData() != null) {
                    ComplexDataType complex = data.getComplexData();
                    if (ppio instanceof RawDataPPIO) {
                        Object inputData = complex.getData().get(0);
                        String encoding = complex.getEncoding();
                        byte[] decoded = null;
                        if (encoding != null) {
                            if ("base64".equals(encoding)) {
                                String input = inputData.toString();
                                decoded = Base64.decode(input);
                            } else {
                                throw new WPSException("Unsupported encoding " + encoding);
                            }
                        }
                       
                        if(decoded != null) {
                            return new ByteArrayRawData(decoded, complex.getMimeType());
                        } else {
                            return new StringRawData(inputData.toString(), complex.getMimeType());
                        }
                       
                    } else {
                        Object inputData = complex.getData().get(0);
                        String encoding = complex.getEncoding();
                        byte[] decoded = null;
                        if (encoding != null) {
                            if ("base64".equals(encoding)) {
                                String input = inputData.toString();
                                decoded = Base64.decode(input);
                            } else {
                                throw new WPSException("Unsupported encoding " + encoding);
                            }
                        }

                        if (decoded != null) {
                            value = ((ComplexPPIO) ppio).decode(new ByteArrayInputStream(decoded));
                        } else {
                            value = ((ComplexPPIO) ppio).decode(inputData);
                        }
                    }
                } else if (data.getBoundingBoxData() != null) {
                    value = ((BoundingBoxPPIO) ppio).decode(data.getBoundingBoxData());
                }

            }
           
            if(value instanceof GridCoverage) {
View Full Code Here

TOP

Related Classes of aQute.bnd.header.Attrs$DataType

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.