Package net.opengis.wps10

Examples of net.opengis.wps10.OutputDescriptionType


            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


     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetRawDataOutput(OutputDefinitionType newRawDataOutput, NotificationChain msgs) {
        OutputDefinitionType oldRawDataOutput = rawDataOutput;
        rawDataOutput = newRawDataOutput;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wps10Package.RESPONSE_FORM_TYPE__RAW_DATA_OUTPUT, oldRawDataOutput, newRawDataOutput);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

            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() );
            }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetOutputDefinitions(OutputDefinitionsType newOutputDefinitions, NotificationChain msgs) {
        OutputDefinitionsType oldOutputDefinitions = outputDefinitions;
        outputDefinitions = newOutputDefinitions;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wps10Package.EXECUTE_RESPONSE_TYPE__OUTPUT_DEFINITIONS, oldOutputDefinitions, newOutputDefinitions);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

    }
   
    void processOutputs( ProcessOutputsType outputs, ProcessFactory pf, Name name) {
        Map<String,Parameter<?>> outs = pf.getResultInfo(name, null);
        for ( Parameter p : outs.values() ) {
            OutputDescriptionType output = wpsf.createOutputDescriptionType();
            outputs.getOutput().add( output );
           
            output.setIdentifier( Ows11Util.code( p.key ) );
            output.setTitle( Ows11Util.languageString( p.title ) );
           
            List<ProcessParameterIO> ppios = ProcessParameterIO.findAll( p, context);
            if ( ppios.isEmpty() ) {
                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
           
            //handle the literal case
            if ( ppios.size() == 1 && ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralOutputType literal = wpsf.createLiteralOutputType();
                output.setLiteralOutput(literal);
               
                //map the java class to an xml type name
                if ( !String.class.equals( lppio.getType() ) ) {
                    Name typeName = xsp.name( lppio.getType() );
                    if ( typeName != null ) {
                        literal.setDataType( Ows11Util.type( typeName.getLocalPart() ) );       
                    }   
                }
            }
            else {
                //handle the complex data case
                SupportedComplexDataType complex = wpsf.createSupportedComplexDataType();
                output.setComplexOutput( complex );
               
                complex.setSupported( wpsf.createComplexDataCombinationsType() );
                for ( ProcessParameterIO ppio : ppios ) {
                    ComplexPPIO cppio = (ComplexPPIO) ppio;
View Full Code Here

        }

        Iterator iterator = outputs.iterator();
        while (iterator.hasNext())
        {
            OutputDescriptionType odt = (OutputDescriptionType) iterator.next();
            // determine if the output is a literal or complex data, and from that
            // find out what type the object should be
            LiteralOutputType literalOutput = odt.getLiteralOutput();
            SupportedComplexDataType complexOutput = odt.getComplexOutput();
            Class type = Object.class;
            if (literalOutput != null)
            {
                DomainMetadataType dataType = literalOutput.getDataType();
                if(dataType != null)
                {
                    // try and parse the type
                    Class literalType = null;
                   
                    if(dataType.getReference() != null) { // reference is 0..1
                        literalType = guessLiteralType(dataType.getReference());
                        if(literalType == null) {
                            LOGGER.warning("Unparsable ows:reference " + dataType.getReference());
                        }
                    }
                    if(literalType == null) { // no parsable reference
                        literalType = guessLiteralType(dataType.getValue()); // value is mandatory
                    }

                    type = literalType != null? literalType : String.class;
                }
                else
                {
                    // datatype is null => character string (OGC 05-007r7, Table 37, DataType)
                    type = String.class;
                }

                // TODO: handle UOM
            }
            else if (complexOutput != null)
            {
                // TODO: get all supported types and determine how to handle that, not just the
                // default.
                ComplexDataDescriptionType format = complexOutput.getDefault().getFormat();
                String encoding = format.getEncoding();
                String mimetype = format.getMimeType();
                String schema = format.getSchema();
                if (encoding == null)
                {
                    encoding = "";
                }
                if (mimetype == null)
                {
                    mimetype = "";
                }
                if (schema == null)
                {
                    schema = "";
                }
                type = getComplexType(encoding, mimetype, schema);
            }

            // create the parameter
            InternationalString description = Text.text(isAbstractNull(odt) ? "" : odt.getAbstract().getValue());
            Parameter param = new Parameter(odt.getIdentifier().getValue(), type, Text.text(odt.getTitle().getValue()), description);
            map.put(odt.getIdentifier().getValue(), param);
        }

        return map;
    }
View Full Code Here

    }
   
    void processOutputs( ProcessOutputsType outputs, ProcessFactory pf, Name name) {
        Map<String,Parameter<?>> outs = pf.getResultInfo(name, null);
        for ( Parameter p : outs.values() ) {
            OutputDescriptionType output = wpsf.createOutputDescriptionType();
            outputs.getOutput().add( output );
           
            output.setIdentifier( Ows11Util.code( p.key ) );
            output.setTitle( Ows11Util.languageString( p.title ) );
           
            List<ProcessParameterIO> ppios = ProcessParameterIO.findAll( p, context);
            if ( ppios.isEmpty() ) {
                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
           
            //handle the literal case
            if ( ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralOutputType literal = wpsf.createLiteralOutputType();
                output.setLiteralOutput(literal);
               
                //map the java class to an xml type name
                if ( !String.class.equals( lppio.getType() ) ) {
                  Class type = lppio.getType();
                  if(PRIMITIVE_TO_WRAPPER.containsKey(type)) {
                    type = PRIMITIVE_TO_WRAPPER.get(type);
                  }
                    Name typeName = xsp.name(type);
                    if ( typeName != null ) {
                        literal.setDataType( Ows11Util.type( typeName.getLocalPart() ) );       
                    }   
                }
            } else if(ppios.get(0) instanceof BoundingBoxPPIO) {
                output.setBoundingBoxOutput(buildSupportedCRSType());
            } else {
                //handle the complex data case
                SupportedComplexDataType complex = wpsf.createSupportedComplexDataType();
                output.setComplexOutput( complex );
               
                complex.setSupported( wpsf.createComplexDataCombinationsType() );
                for ( ProcessParameterIO ppio : ppios ) {
                    ComplexPPIO cppio = (ComplexPPIO) ppio;
View Full Code Here

    }
   
    void processOutputs( ProcessOutputsType outputs, ProcessFactory pf, Name name) {
        Map<String,Parameter<?>> outs = pf.getResultInfo(name, null);
        for ( Parameter p : outs.values() ) {
            OutputDescriptionType output = wpsf.createOutputDescriptionType();
            outputs.getOutput().add( output );
           
            output.setIdentifier( Ows11Util.code( p.key ) );
            output.setTitle( Ows11Util.languageString( p.title ) );
           
            List<ProcessParameterIO> ppios = ProcessParameterIO.findAll( p, context);
            if ( ppios.isEmpty() ) {
                throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
            }
           
            //handle the literal case
            if ( ppios.get( 0 ) instanceof LiteralPPIO ) {
                LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
               
                LiteralOutputType literal = wpsf.createLiteralOutputType();
                output.setLiteralOutput(literal);
               
                //map the java class to an xml type name
                if ( !String.class.equals( lppio.getType() ) ) {
                  Class type = lppio.getType();
                  if(PRIMITIVE_TO_WRAPPER.containsKey(type)) {
                    type = PRIMITIVE_TO_WRAPPER.get(type);
                  }
                    Name typeName = xsp.name(type);
                    if ( typeName != null ) {
                        literal.setDataType( Ows11Util.type( typeName.getLocalPart() ) );       
                    }   
                }
            } else if(ppios.get(0) instanceof BoundingBoxPPIO) {
                output.setBoundingBoxOutput(buildSupportedCRSType());
            } else {
                //handle the complex data case
                SupportedComplexDataType complex = wpsf.createSupportedComplexDataType();
                output.setComplexOutput( complex );
               
                complex.setSupported( wpsf.createComplexDataCombinationsType() );
                for ( ProcessParameterIO ppio : ppios ) {
                    ComplexPPIO cppio = (ComplexPPIO) ppio;
View Full Code Here

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

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetReference(OutputReferenceType newReference, NotificationChain msgs) {
        OutputReferenceType oldReference = reference;
        reference = newReference;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wps10Package.OUTPUT_DATA_TYPE__REFERENCE, oldReference, newReference);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

TOP

Related Classes of net.opengis.wps10.OutputDescriptionType

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.