/** * Returns the {@link FeatureStore} instance which is responsible for the specified feature type. * * @param ftName * name of the {@link FeatureType} * @return the responsible {@link FeatureStore} or <code>null</code> if no such store exists, i.e. the specified * feature type is not served */ public FeatureStore getStore( QName ftName ) { FeatureType ft = lookupFeatureType( ftName ); if ( ft == null ) { return null; } return schemaToStore.get( ft.getSchema() ); }
private void setSchema( Feature feature ) { if ( schema == null ) { schema = feature.getType().getSchema(); if ( schema != null ) { schemaInfoset = schema.getGMLSchema(); } } }
private static void writeLayer( HashSet<FeatureType> visited, XMLStreamWriter out, FeatureType ft, String storeId ) throws XMLStreamException { if ( visited.contains( ft ) || ft == null ) { return; } visited.add( ft ); out.writeCharacters( "\n" ); out.writeStartElement( ns, "RequestableLayer" ); XMLAdapter.writeElement( out, ns, "Name", ft.getName().getLocalPart() ); XMLAdapter.writeElement( out, ns, "Title", ft.getName().getLocalPart() ); for ( FeatureType sub : ft.getSchema().getDirectSubtypes( ft ) ) { writeLayer( visited, out, sub, storeId ); } XMLAdapter.writeElement( out, ns, "FeatureStoreId", storeId ); out.writeEndElement(); out.writeCharacters( "\n" ); }
public FeatureClass( FeatureType ft, FeatureClass parent ) { super( ft.getName(), D_PACKAGE, PACKAGE_DIR, null, false, ft.isAbstract() ); this.ft = ft; this.baseType = parent; AppSchema schema = ft.getSchema(); propertyDeclarations = schema.getNewPropertyDecls( ft ); }
AppSchema schema = ft.getSchema();
private TableJoin generateFtJoin( MappingContext from, FeatureType valueFt ) { if ( valueFt != null && valueFt.getSchema().getSubtypes( valueFt ).length == 1 ) { LOG.warn( "Ambigous feature join." ); } TableName fromTable = new TableName( from.getTable() ); TableName toTable = new TableName( "?" ); List<String> fromColumns = Collections.singletonList( from.getColumn() ); List<String> toColumns = Collections.singletonList( detectPrimaryKeyColumnName() ); Map<SQLIdentifier, IDGenerator> keyColumnToIdGenerator = new HashMap<SQLIdentifier, IDGenerator>(); keyColumnToIdGenerator.put( new SQLIdentifier( "id" ), new AutoIDGenerator() ); return new TableJoin( fromTable, toTable, fromColumns, toColumns, Collections.EMPTY_LIST, false, keyColumnToIdGenerator ); }
AppSchema schema = f.getType().getSchema(); if ( schema != null ) nsBindings.putAll( schema.getNamespaceBindings() );
protected static void writeFields( Writer out, FeatureType ft ) throws IOException { AppSchema schema = ft.getSchema(); List<PropertyType> propertyDeclarations = schema.getNewPropertyDecls( ft );
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() ); }
schemas.add( ft.getSchema() ); if ( ft.getName().getNamespaceURI().equals( targetNs ) ) { export( writer, ft );
bindings = f.getType().getSchema().getNamespaceBindings();
if ( valueFt != null && valueFt.getSchema().getSubtypes( valueFt ).length == 1 ) {
xmlStream.require( START_ELEMENT, null, "Value" ); GMLStreamReader gmlReader = createGMLStreamReader( inputFormat, xmlStream ); gmlReader.setApplicationSchema( ft.getSchema() ); GeometryFactory geomFac = new GeometryFactory(); geomFac.addInspector( new CoordinateValidityInspector() );