public DefaultGmlXlinkStrategy() { this.remoteXlinkTemplate = "#{}"; this.resolveOptions = new GmlXlinkOptions(); }
/** * Creates a new {@link GMLStreamWriter} instance. * * @param version * GML version of the output, must not be <code>null</code> * @param xmlStream * XML stream used to write the output, must not be <code>null</code> * @throws XMLStreamException */ GMLStreamWriter( GMLVersion version, XMLStreamWriter xmlStream ) throws XMLStreamException { this.version = version; this.xmlStream = xmlStream; referenceExportStrategy = new DefaultGmlXlinkStrategy( "#{}", new GmlXlinkOptions() ); prefixToNs.put( "ogc", OGCNS ); prefixToNs.put( "gml", version != GML_32 ? GMLNS : GML3_2_NS ); prefixToNs.put( "xlink", XLNNS ); prefixToNs.put( "xsi", XSINS ); prefixToNs.put( "dxtra", EXTRA_PROP_NS ); prefixToNs.put( "dxtra-string", EXTRA_PROP_NS_STRING ); prefixToNs.put( "dxtra-geometry", EXTRA_PROP_NS_GEOMETRY ); }
private GmlXlinkOptions getResolveParams( Property prop, GmlXlinkOptions resolveState ) { PropertyName projection = requestedPropertyNames.get( prop.getName() ); if ( projection != null && projection.getResolveParams() != null ) { return new GmlXlinkOptions( projection.getResolveParams() ); } return resolveState; }
protected GmlXlinkOptions getResolveStateForNextLevel( GmlXlinkOptions state ) { return new GmlXlinkOptions( null, state.getDepth(), state.getCurrentLevel() + 1, state.getMode(), state.getRemoteTimeoutInMilliseconds() ); } }
XlinkedObjectsHandler handler = new XlinkedObjectsHandler( true, null, new GmlXlinkOptions() ); writer.setReferenceResolveStrategy( handler );
private Property recreatePropertyFromGml( final PropertyType pt, final GenericXMLElement particle ) { try { final GMLSchemaInfoSet gmlSchema = ft.getSchema().getGMLSchema(); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); final XMLStreamWriter xmlWriter = XMLOutputFactory.newInstance().createXMLStreamWriter( bos ); final GMLVersion version = ft.getSchema().getGMLSchema().getVersion(); final GMLStreamWriter gmlWriter = GMLOutputFactory.createGMLStreamWriter( version, xmlWriter ); gmlWriter.setNamespaceBindings( gmlSchema.getNamespacePrefixes() ); final GmlXlinkOptions resolveState = new GmlXlinkOptions(); gmlWriter.getFeatureWriter().export( particle, resolveState ); gmlWriter.close(); xmlWriter.close(); bos.close(); final InputStream is = new ByteArrayInputStream( bos.toByteArray() ); final XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader( is ); final GMLStreamReader gmlReader = GMLInputFactory.createGMLStreamReader( version, xmlReader ); gmlReader.setApplicationSchema( ft.getSchema() ); gmlReader.setLaxMode( true ); final Property property = gmlReader.getFeatureReader().parseProperty( new XMLStreamReaderWrapper( xmlReader, null ), pt, null ); return property; } catch ( final Exception e ) { LOG.error( e.getMessage(), e ); } return new GenericProperty( pt, particle.getName(), null, particle.getAttributes(), particle.getChildren() ); }
prefixToNs.putAll( getFeatureTypeNsPrefixes( analyzer.getFeatureTypes() ) ); gmlStream.setNamespaceBindings( prefixToNs ); GmlXlinkOptions resolveOptions = new GmlXlinkOptions( request.getResolveParams() ); WfsXlinkStrategy additionalObjects = new WfsXlinkStrategy( (BufferableXMLStreamWriter) xmlStream, localReferencesPossible, xLinkTemplate,
prefixToNs.putAll( getFeatureTypeNsPrefixes( analyzer.getFeatureTypes() ) ); gmlStream.setNamespaceBindings( prefixToNs ); GmlXlinkOptions resolveOptions = new GmlXlinkOptions( request.getResolveParams() ); BufferableXMLStreamWriter bufferedStream = (BufferableXMLStreamWriter) xmlStream; WfsXlinkStrategy additionalObjects = new WfsXlinkStrategy( bufferedStream, localReferencesPossible,
GmlXlinkOptions resolveState = new GmlXlinkOptions( null, resolveDepth, 0, ALL, remoteTimeoutInMilliseconds );