private BBoxOutputType parseBBoxOutput( OMElement bboxData, CodeType id, LanguageString outputTitle, LanguageString outputAbstract ) { XPath xpath = new XPath( "Default/CRS", nsContext ); String defaultCrs = omResponse.getElement( bboxData, xpath ).getText(); xpath = new XPath( "Supported/CRS", nsContext ); List<OMElement> omSupported = omResponse.getElements( bboxData, xpath ); String[] supportedCrs = new String[omSupported.size()]; for ( int i = 0; i < omSupported.size(); i++ ) { supportedCrs[i] = omSupported.get( i ).getText(); } return new BBoxOutputType( id, outputTitle, outputAbstract, defaultCrs, supportedCrs ); }
private BBoxInputType parseBBoxData( OMElement input, CodeType id, LanguageString inputTitle, LanguageString inputAbstract, String minOccurs, String maxOccurs ) { XPath xpath = new XPath( "Default/CRS", nsContext ); String defaultCRS = omResponse.getElement( input, xpath ).getText(); xpath = new XPath( "Supported/CRS", nsContext ); List<OMElement> omSupported = omResponse.getElements( input, xpath ); String[] supportedCRSs = new String[omSupported.size()]; for ( int i = 0; i < omSupported.size(); i++ ) { supportedCRSs[i] = omSupported.get( i ).getText(); } return new BBoxInputType( id, inputTitle, inputAbstract, minOccurs, maxOccurs, defaultCRS, supportedCRSs ); }
@Override public List<WFSFeatureType> parseFeatureTypeList() { List<OMElement> ftEls = getElements( rootElement, new XPath( "wfs:FeatureTypeList/wfs:FeatureType", nsContext ) ); List<WFSFeatureType> fts = new ArrayList<WFSFeatureType>( ftEls.size() ); for ( OMElement ftEl : ftEls ) { fts.add( parseFeatureType( ftEl ) ); } return fts; }
@Override public List<WFSFeatureType> parseFeatureTypeList() { List<OMElement> ftEls = getElements( rootElement, new XPath( "wfs:FeatureTypeList/wfs:FeatureType", nsContext ) ); List<WFSFeatureType> fts = new ArrayList<WFSFeatureType>( ftEls.size() ); for ( OMElement ftEl : ftEls ) { fts.add( parseFeatureType( ftEl ) ); } return fts; }
private List<Pair<String, String>> parseIdentifiers( OMElement lay ) { List<Pair<String, String>> identifiers = new ArrayList<Pair<String, String>>(); List<OMElement> identiferElements = getElements( lay, new XPath( getPrefix() + "Identifier", nsContext ) ); for ( OMElement identifierElement : identiferElements ) { String id = identifierElement.getText(); if ( id != null && id.length() > 0 ) { String authority = getNodeAsString( identifierElement, new XPath( "@authority" ), null ); identifiers.add( new Pair<String, String>( id, authority ) ); } } return identifiers; }
private List<Pair<String, String>> parseAuthorities( OMElement lay ) { List<Pair<String, String>> authorities = new ArrayList<Pair<String, String>>(); List<OMElement> authorityElements = getElements( lay, new XPath( getPrefix() + "AuthorityURL", nsContext ) ); for ( OMElement authorityElement : authorityElements ) { String authority = getNodeAsString( authorityElement, new XPath( "@name" ), null ); String authorityUrl = getNodeAsString( authorityElement, new XPath( getPrefix() + "OnlineResource/@xlink:href", nsContext ), null ); authorities.add( new Pair<String, String>( authority, authorityUrl ) ); } return authorities; }
@Override public void serialize( XMLStreamWriter writer, String[] elementNames ) throws XMLStreamException { List<XPath> xpathEN = new ArrayList<XPath>(); for ( String s : elementNames ) { xpathEN.add( new XPath( s, CommonNamespaces.getNamespaceContext() ) ); } if ( !xpathEN.isEmpty() ) { writer = new FilteringXMLStreamWriter( writer, xpathEN ); } root.serialize( writer ); }
/** * @return the id */ public String getId() { return adapter.getRequiredNodeAsString( adapter.getRootElement(), new XPath( "./@id", ns ) ); }
/** * @return the extId */ public String getExtId() { return adapter.getNodeAsString( adapter.getRootElement(), new XPath( "./rim:ExternalIdentifier/rim:Name/rim:LocalizedString/@value", ns ), null ); }
/** * @return the queryExpression */ public OMElement getQueryExpression() { return adapter.getElement( adapter.getRootElement(), new XPath( "./rim:QueryExpression", ns ) ); }
private static String retrieveLiteral( OMElement value ) { XMLAdapter adapter = new XMLAdapter(); XPath xpath = new XPath( "//" + FES_PREFIX + ":Literal", NS_CONTEXT ); return adapter.getNodeAsString( value, xpath, null ); }
/** * @return the desc */ public String getDesc() { return adapter.getNodeAsString( adapter.getRootElement(), new XPath( "./rim:Description/rim:LocalizedString/@value", ns ), null ); }
/** * @return the home */ public String getHome() { return adapter.getNodeAsString( adapter.getRootElement(), new XPath( "./@home", ns ), null ); }
/** * @return the status */ public String getStatus() { return adapter.getNodeAsString( adapter.getRootElement(), new XPath( "./@status", ns ), null ); }
/** * @return the targetObject */ public String getTargetObject() { return adapter.getRequiredNodeAsString( adapter.getRootElement(), new XPath( "@targetObject", ns ) ); }
/** * @return the parent */ public String getParent() { return adapter.getNodeAsString( adapter.getRootElement(), new XPath( "./@parent", ns ), null ); }
/** * @return the code */ public String getCode() { return adapter.getNodeAsString( adapter.getRootElement(), new XPath( "./@code", ns ), null ); }
private String parseOutputFormat() throws OWSException { String format = getNodeAsString( rootElement, new XPath( "/" + WCS_PREFIX + ":GetCoverage/" + WCS_PREFIX + ":output/" + WCS_PREFIX + ":format", wcsNSContext ), null ); checkRequiredString( "format", format ); return format; }
/** * @return a {@link OWSCapabilities} instance, never <code>null</code> */ public OWSCapabilities parseMetadata() { Version version = getNodeAsVersion( rootElement, new XPath( "@version", nsContext ), null ); String sequence = getNodeAsString( rootElement, new XPath( "@updateSequence", nsContext ), null ); ServiceIdentification serviceId = parseServiceIdentification(); ServiceProvider serviceProvider = parseServiceProvider(); OperationsMetadata opMetadata = parseOperationsMetadata(); List<String> languages = parseLanguages(); return new OWSCapabilities( version, sequence, serviceId, serviceProvider, opMetadata, languages ); }
private QName determineTargetElementAdv( XMLAdapter annotationXML ) { NamespaceBindings nsContext = new NamespaceBindings(); nsContext.addNamespace( "xs", CommonNamespaces.XSNS ); nsContext.addNamespace( "adv", "http://www.adv-online.de/nas" ); QName refElement = annotationXML.getNodeAsQName( annotationXML.getRootElement(), new XPath( "xs:appinfo/adv:referenziertesElement/text()", nsContext ), null ); if ( refElement != null ) { LOG.trace( "Identified a target element annotation (adv style)." ); } return refElement; }