/** * Returns the output parameters with the given identifier. * * @param parameterId * identifier of the output parameters to be looked up * @param codeSpace * codeSpace of the parameter identifier * @return the output parameters with the given identifier */ public ProcessletOutput getParameter( String parameterId, String codeSpace ) { return idToOutput.get( new CodeType( parameterId, codeSpace ) ); }
private void writeIdentifier( CodeType id ) throws XMLStreamException { writer.writeStartElement( "ows", "Identifier", owsNS ); if ( id.getCodeSpace() != null ) { writer.writeCharacters( id.getCodeSpace() + ":" + id.getCode() ); } else { writer.writeCharacters( id.getCode() ); } writer.writeEndElement(); }
@Override public OWSException inputInvalidDatatype( CodeType parameterId, String foundDatatype, String definedDataType ) { String msg = processMsg + ", the value of datatype attribute (='" + foundDatatype + "') for input parameter '" + parameterId + "' does not match the datatype from the corresponding parameter definition (='" + definedDataType + "')"; return new OWSException( msg, OWSException.INVALID_PARAMETER_VALUE, parameterId.toString() ); }
result = new Pair<Object, Object>( value1, parseTime( value2.toString() ) ); } else if ( value1 instanceof CodeType ) { result = new Pair<Object, Object>( value1, new CodeType( value2.toString(), ( (CodeType) value1 ).getCodeSpace() ) ); } else if ( value1 instanceof Measure ) { result = new Pair<Object, Object>( value1, new Measure( value2.toString(), result = new Pair<Object, Object>( parseTime( value1.toString() ), value2 ); } else if ( value1 instanceof CodeType ) { result = new Pair<Object, Object>( new CodeType( value1.toString(), ( (CodeType) value2 ).getCodeSpace() ), value2 ); } else if ( value1 instanceof Measure ) { result = new Pair<Object, Object>( new Measure( value1.toString(), ( (Measure) value2 ).getUomUri() ),
for ( CodeType identifier : request.getIdentifiers() ) { LOG.debug( "Looking up process '" + identifier + "'" ); if ( ALL_PROCESSES_IDENTIFIER.equals( identifier ) ) { processes.addAll( processManager.getProcesses().values() ); break; for ( WPSProcess process : processes ) { ProcessDefinition processDef = process.getDescription(); CodeType processId = new CodeType( processDef.getIdentifier().getValue(), processDef.getIdentifier().getCodeSpace() );
private void writeKeywords( XMLStreamWriter writer ) throws XMLStreamException { List<Pair<List<LanguageString>, CodeType>> keywords = identification == null ? null : identification.getKeywords(); if ( keywords != null && !keywords.isEmpty() ) { writer.writeStartElement( WMSNS, "KeywordList" ); for ( Pair<List<LanguageString>, CodeType> key : keywords ) { CodeType type = key.second; for ( LanguageString lanString : key.first ) { writer.writeStartElement( WMSNS, "Keyword" ); if ( type != null ) { writer.writeAttribute( "vocabulary", type.getCodeSpace() ); } writer.writeCharacters( lanString.getString() ); writer.writeEndElement(); } } writer.writeEndElement(); } }
@Override public OWSException inputNoSuchParameter( CodeType identifier ) { String msg = processMsg + " has no input parameter with identifier '" + identifier + "'."; return new OWSException( msg, OWSException.INVALID_PARAMETER_VALUE, identifier.getCode() ); }
private void writeKeywordList( final XMLStreamWriter writer, final List<Pair<List<LanguageString>, CodeType>> keywordList ) throws XMLStreamException { if ( keywordList != null && !keywordList.isEmpty() ) { writer.writeStartElement( WMSNS, "KeywordList" ); // <element ref="wms:Keyword" minOccurs="0" maxOccurs="unbounded"/> for ( final Pair<List<LanguageString>, CodeType> kws : keywordList ) { String vocabulary = null; if ( kws.second != null ) { vocabulary = kws.second.getCodeSpace(); } for ( final LanguageString ls : kws.first ) { writeElement( writer, WMSNS, "Keyword", ls.getString(), null, null, "vocabulary", vocabulary ); } } writer.writeEndElement(); } }
@Override public OWSException outputNoSuchParameter( CodeType outputParameterId ) { String msg = processMsg + " has no output parameter with identifier '" + outputParameterId + "'."; return new OWSException( msg, OWSException.INVALID_PARAMETER_VALUE, outputParameterId.getCode() ); }
/** * Returns the input parameters with the given identifier. * * @param parameterId * identifier of the input parameters to be looked up * @param codeSpace * codeSpace of the parameter identifier * @return the input parameters with the given identifier */ public List<ProcessletInput> getParameters( String parameterId, String codeSpace ) { return idsToInputs.get( new CodeType( parameterId, codeSpace ) ); }
private static void exportCodeTypeNew( XMLStreamWriter writer, org.deegree.commons.tom.ows.CodeType codeType, String localName, String owsNS ) throws XMLStreamException { if ( codeType != null ) { writer.writeStartElement( owsNS, localName ); if ( codeType.getCodeSpace() != null && !"".equals( codeType.getCodeSpace() ) ) { writer.writeAttribute( "codeSpace", codeType.getCodeSpace() ); } writer.writeCharacters( codeType.getCode() ); writer.writeEndElement(); // localName } }
return new SingleObjectIterator( new AttributeNode<Property>( (PropertyNode) node, new QName( "uom" ), uom ) ); } else if ( value instanceof CodeType && ( (CodeType) value ).getCodeSpace() != null ) { PrimitiveValue codeSpace = new PrimitiveValue( ( (CodeType) value ).getCodeSpace() ); return new SingleObjectIterator( new AttributeNode<Property>( (PropertyNode) node, new QName( "codeSpace" ), codeSpace ) );
writeElement( writer, owsNS, "Role", serviceContact.getRole().getCode() );
@Override public OWSException inputInvalidParameter( CodeType inputParameterId, Pair<String, String> kvp ) { String msg = processMsg + "Given value: " + kvp + " of input parameter '" + inputParameterId + "' is not supported according the corresponding parameter definition."; return new OWSException( msg, OWSException.INVALID_PARAMETER_VALUE, inputParameterId.toString() ); }
/** * Returns the input parameters with the given identifier (convenience method for identifiers with a * <code>null</code> codeSpace). * * @param parameterId * identifier of the input parameters to be looked up * @return the input parameters with the given identifier */ public List<ProcessletInput> getParameters( String parameterId ) { return idsToInputs.get( new CodeType( parameterId ) ); }
private static boolean equals( CodeType codeType, org.deegree.process.jaxb.java.CodeType codeType2 ) { if ( codeType2.getValue().equals( codeType.getCode() ) ) { if ( codeType2.getCodeSpace() == null ) { return codeType.getCodeSpace() == null; } return codeType2.getCodeSpace().equals( codeType.getCodeSpace() ); } return false; } }
/** * Creates a new {@link WPSClient} instance. * * @param capabilitiesURL * url of a WPS capabilities document, usually this is a GetCapabilities request to a WPS service, must * not be <code>null</code> * @throws OWSException * if the server replied with an exception * @throws IOException * if a communication/network problem occured */ public WPSClient( URL capabilitiesURL ) throws OWSExceptionReport, IOException { WPS100CapabilitiesAdapter capabilitiesDoc = retrieveCapabilities( capabilitiesURL ); // TODO what if server only supports Get? What is optional and what is mandatory? describeProcessURLs[0] = capabilitiesDoc.getOperationURL( "DescribeProcess", false ); describeProcessURLs[1] = capabilitiesDoc.getOperationURL( "DescribeProcess", true ); executeURLs[0] = capabilitiesDoc.getOperationURL( "Execute", false ); executeURLs[1] = capabilitiesDoc.getOperationURL( "Execute", true ); metadata = capabilitiesDoc.parseMetadata(); for ( ProcessInfo processInfo : capabilitiesDoc.getProcesses() ) { Process process = new Process( this, processInfo ); processIdToProcess.put( process.getId(), process ); processIdSimpleToProcess.put( process.getId().getCode(), process ); } }
@Override public OWSException outputInvalidParameter( CodeType outputParameterId, Pair<String, String> kvp ) { String msg = processMsg + "Given value: " + kvp + " of outputparameter '" + outputParameterId + "' is not supported according the corresponding parameter definition."; return new OWSException( msg, OWSException.INVALID_PARAMETER_VALUE, outputParameterId.toString() ); }
/** * Returns the output parameters with the given identifier (convenience method for identifiers with a * <code>null</code> codeSpace). * * @param parameterId * identifier of the output parameters to be looked up * @return the output parameters with the given identifier */ public ProcessletOutput getParameter( String parameterId ) { return idToOutput.get( new CodeType( parameterId ) ); }
private static boolean equals( CodeType codeType, org.deegree.process.jaxb.java.CodeType codeType2 ) { if ( codeType2.getValue().equals( codeType.getCode() ) ) { if ( codeType2.getCodeSpace() == null ) { return codeType.getCodeSpace() == null; } return codeType2.getCodeSpace().equals( codeType.getCodeSpace() ); } return false; }