public Name getName() { return delegate.getName(); }
@Override public Name getQualifiedName() { return featureSource.getName(); }
@Override public String prefixedName() { return featureSource.getName().getNamespaceURI() + ":" + getName(); }
public FeatureSourceWrappingFeatureTypeInfoImpl(FeatureSource featureSource) throws IOException, TransformException, FactoryException { super(); this.featureSource = featureSource; setName(featureSource.getName().getLocalPart()); setEnabled(true); setLatLonBoundingBox( featureSource.getBounds().transform(DefaultGeographicCRS.WGS84, true)); }
@Override public Name getName() { return originalFeatureSource.getName(); }
@Test public void testMetadataFromFeatueSource() throws Exception { CatalogBuilder cb = new CatalogBuilder(getCatalog()); cb.setStore(cb.buildDataStore("fooStore")); FeatureType ft = createMock(FeatureType.class); expect(ft.getName()).andReturn(new NameImpl("foo")).anyTimes(); expect(ft.getCoordinateReferenceSystem()).andReturn(null).anyTimes(); expect(ft.getGeometryDescriptor()).andReturn(null).anyTimes(); replay(ft); ResourceInfo rInfo = createMock(ResourceInfo.class); expect(rInfo.getTitle()).andReturn("foo title"); expect(rInfo.getDescription()).andReturn("foo description"); expect(rInfo.getKeywords()) .andReturn(new LinkedHashSet<String>(Arrays.asList("foo", "bar", "baz", ""))) .anyTimes(); replay(rInfo); FeatureSource fs = createMock(FeatureSource.class); expect(fs.getSchema()).andReturn(ft).anyTimes(); expect(fs.getInfo()).andReturn(rInfo).anyTimes(); expect(fs.getName()).andReturn(ft.getName()).anyTimes(); replay(fs); FeatureTypeInfo ftInfo = cb.buildFeatureType(fs); assertEquals("foo title", ftInfo.getTitle()); assertEquals("foo description", ftInfo.getDescription()); assertTrue(ftInfo.getKeywords().contains(new Keyword("foo"))); assertTrue(ftInfo.getKeywords().contains(new Keyword("bar"))); assertTrue(ftInfo.getKeywords().contains(new Keyword("baz"))); }
public Name getName() { return delegate.getName(); }
/** * Wraps a {@link FeatureSource} in a {@link LayerInfo} containing a {@link FeatureTypeInfo}. * * @param featureSource the feature source to be wrapped * @return The wrapping layer */ protected LayerInfo getLayerFromFeatureSource(final FeatureSource featureSource) { // TODO: Wrap info from GeoTools {@link FeatureSource#getInfo()} for GetFeatureInfo, etc. FeatureTypeInfoImpl featureTypeInfo = null; try { featureTypeInfo = new FeatureSourceWrappingFeatureTypeInfoImpl(featureSource); } catch (IOException | TransformException | FactoryException e) { throw new IllegalStateException("Error constructing wrapping feature source", e); } featureTypeInfo.setName(featureSource.getName().getLocalPart()); featureTypeInfo.setEnabled(true); featureTypeInfo.setCatalog(catalog); LayerInfo layerInfo = catalog.getFactory().createLayer(); layerInfo.setResource(featureTypeInfo); layerInfo.setEnabled(true); // CollectionFeatureSource doesn't support getDataStore if (!(featureSource instanceof CollectionFeatureSource) && featureSource.getDataStore() instanceof WFSDataStore) { layerInfo.setType(PublishedType.REMOTE); } else { layerInfo.setType(PublishedType.VECTOR); } return layerInfo; }
Name name = featureSource.getName(); if (name == null) { name = featureType.getName();
assertEquals("sf_archsites", type.getName().getLocalPart()); assertEquals( "sf_archsites", ftInfo.getFeatureSource(null, null).getName().getLocalPart()); } catch (IOException e) { String expectedMessage = "Unknown type sf_archsites";
String.format( "JDBC multi values only work with JDBC based data sources, got '%s'.", mappedSource.getName()));
String name = layer.getTitle(); if (name == null || name.trim().length() == 0) { name = layer.getFeatureSource().getName().getLocalPart();
@Override public Name getName() { return source.getName(); }
public Name getName() { return delegate.getName(); }
layerName = layer.getFeatureSource().getName().getLocalPart();
public Name getName() { return fsource.getName(); }
@Override public Name getName() { return source.getName(); }
String name = source.getName().getLocalPart(); newQuery.setTypeName(name); newQuery.setFilter(unrolledFilter);
private Map<String, CollectionLayer> getCollectionPublishingConfigurations() throws IOException { FeatureSource<FeatureType, Feature> collectionSource = getCollectionSource(); Query query = new Query(collectionSource.getName().getLocalPart()); query.setPropertyNames(new String[] {COLLECTION_NAME, LAYER}); FeatureCollection<FeatureType, Feature> features = collectionSource.getFeatures(query); Map<String, CollectionLayer> result = new LinkedHashMap<>(); features.accepts( f -> { Property p = f.getProperty(COLLECTION_NAME); String name = (String) p.getValue(); CollectionLayer config = CollectionLayer.buildCollectionLayerFromFeature(f); result.put(name, config); }, null); return result; }
/** * Builds the feature type exposed to client for OGC links * * @return * @throws IOException */ protected SimpleFeatureType buildOgcLinksType() throws IOException { String ns = getOpenSearchAccess().getCollectionSource().getName().getNamespaceURI(); SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder(); tb.setName("ogc_links"); tb.setNamespaceURI(ns); tb.add("offering", String.class); tb.add("method", String.class); tb.add("code", String.class); tb.add("type", String.class); tb.add("href", String.class); return tb.buildFeatureType(); }