Package net.opengis.wps10

Examples of net.opengis.wps10.ProcessDescriptionType


     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetSupported(CRSsType newSupported, NotificationChain msgs) {
        CRSsType oldSupported = supported;
        supported = newSupported;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wps10Package.SUPPORTED_CR_SS_TYPE__SUPPORTED, oldSupported, newSupported);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here


               
                complex.setSupported( wpsf.createComplexDataCombinationsType() );
                for ( ProcessParameterIO ppio : ppios ) {
                    ComplexPPIO cppio = (ComplexPPIO) ppio;

                    ComplexDataDescriptionType format = wpsf.createComplexDataDescriptionType();
                    format.setMimeType( cppio.getMimeType() );
                   
                    //add to supported
                    complex.getSupported().getFormat().add( format );
                   
                    //handle the default   
                    if ( complex.getDefault() == null ) {
                        ComplexDataDescriptionType def = wpsf.createComplexDataDescriptionType();
                        def.setMimeType( format.getMimeType() );
                       
                        complex.setDefault( wpsf.createComplexDataCombinationType() );
                        complex.getDefault().setFormat( def );
                    }
                }
View Full Code Here

               
                complex.setSupported( wpsf.createComplexDataCombinationsType() );
                for ( ProcessParameterIO ppio : ppios ) {
                    ComplexPPIO cppio = (ComplexPPIO) ppio;

                    ComplexDataDescriptionType format = wpsf.createComplexDataDescriptionType();
                    format.setMimeType( cppio.getMimeType() );
                   
                    //add to supported
                    complex.getSupported().getFormat().add( format );
                   
                    //handle the default   
                    if ( complex.getDefault() == null ) {
                        ComplexDataDescriptionType def = wpsf.createComplexDataDescriptionType();
                        def.setMimeType( format.getMimeType() );
                       
                        complex.setDefault( wpsf.createComplexDataCombinationType() );
                        complex.getDefault().setFormat( def );
                    }
                }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetFormat(ComplexDataDescriptionType newFormat, NotificationChain msgs) {
        ComplexDataDescriptionType oldFormat = format;
        format = newFormat;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wps10Package.COMPLEX_DATA_COMBINATION_TYPE__FORMAT, oldFormat, newFormat);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

                if ( data.getLiteralData() != null ) {
                    LiteralDataType literal = data.getLiteralData();
                    decoded = ((LiteralPPIO)ppio).decode( literal.getValue() );
                }
                else if ( data.getComplexData() != null ) {
                    ComplexDataType complex = data.getComplexData();
                    decoded = complex.getData().get( 0 );
                    try {
                        decoded = ((ComplexPPIO)ppio).decode( decoded );
                    }
                    catch (Exception e) {
                        throw new WPSException( "Unable to decode input: " + input.getIdentifier().getValue() );
                    }
                }
               
            }
           
            //decode the input
            inputs.put( p.key, decoded );
        }
       
        //execute the process
        Map<String,Object> result = null;
        Throwable error = null;
        try {
            Process p = pf.create(processName);
            result = p.execute( inputs, null );   
        }
        catch( Throwable t ) {
            //save the error to report back
            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));
            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 );
                   
                    literal.setValue( ((LiteralPPIO) ppio).encode( o ) );
                }
                else if ( ppio instanceof ComplexPPIO ) {
                    ComplexDataType complex = f.createComplexDataType();
                    data.setComplexData( complex );
                   
                    ComplexPPIO cppio = (ComplexPPIO) ppio;
                    complex.setMimeType( cppio.getMimeType() );
                   
                    if ( cppio instanceof XMLPPIO ) {
                        //encode directly
                        complex.getData().add(
                            new ComplexDataEncoderDelegate( (XMLPPIO) cppio, o )
                        );
                    }
                    else {
                       //TODO: handle other content types, perhaps as CDATA
View Full Code Here

        super( factory );
    }

    @Override
    public List getProperties(Object object) throws Exception {
        ComplexDataType complex = (ComplexDataType) object;
        if ( !complex.getData().isEmpty() && complex.getData().get( 0 ) instanceof ComplexDataEncoderDelegate ) {
            ComplexDataEncoderDelegate delegate = (ComplexDataEncoderDelegate) complex.getData().get( 0 );
            List properties = new ArrayList();
            properties.add( new Object[]{
                delegate.getProcessParameterIO().getElement(), delegate } );
           
            return properties;
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetComplexData(ComplexDataType newComplexData, NotificationChain msgs) {
        ComplexDataType oldComplexData = complexData;
        complexData = newComplexData;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wps10Package.DATA_TYPE__COMPLEX_DATA, oldComplexData, newComplexData);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

        return OVERRIDE;
    }
   
   
    public Object getProperty(Object object, QName name) throws Exception {
        ComplexDataType data = (ComplexDataType) object;
       
        if ( "schema".equals( name.getLocalPart() ) ) {
            return data.getSchema();
        }
       
        if ( "mimeType".equals( name.getLocalPart() ) ) {
            return data.getMimeType();
        }
       
        if ( "encoding".equals( name.getLocalPart() ) ) {
            return data.getEncoding();
        }
       
        return super.getProperty(object, name);
    }
View Full Code Here

    /*
      NodeImpl -> JTS.Polygon
    */
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception
    {
        ComplexDataType data = factory.createComplexDataType();
       
        if ( node.hasAttribute( "schema" ) ) {
            data.setSchema( node.getAttributeValue( "schema").toString() );
        }
        if ( node.hasAttribute( "mimeType" ) ) {
            data.setMimeType( node.getAttributeValue( "mimeType").toString() );
        }
        if ( node.hasAttribute( "encoding" ) ) {
            data.setEncoding( node.getAttributeValue( "encoding").toString() );
        }
       
        for ( Iterator i = node.getChildren().iterator(); i.hasNext(); ) {
            Node c = (Node) i.next();
            data.getData().add( c.getValue() );
        }
       
        return data;
    }
View Full Code Here

        pd.setIdentifier( Ows11Util.code( id.getValue() ) );
        pd.setTitle( Ows11Util.languageString(pf.getTitle(name)) );
        pd.setAbstract( Ows11Util.languageString(pf.getDescription(name)) );
       
        //data inputs
        DataInputsType inputs = wpsf.createDataInputsType();
        pd.setDataInputs(inputs);
        dataInputs( inputs, pf, name );
       
        //process outputs
        ProcessOutputsType outputs = wpsf.createProcessOutputsType();
View Full Code Here

TOP

Related Classes of net.opengis.wps10.ProcessDescriptionType

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.