public void setNativeName(String nativeName) { delegate.setNativeName(nativeName); }
name = featureType.getName(); ftinfo.setNativeName(name.getLocalPart()); ftinfo.setName(name.getLocalPart());
FeatureTypeInfo featureType = factory.createFeatureType(); featureType.setNativeName(ftInfoReader.name()); if (ftInfoReader.alias() != null) { featureType.setName(ftInfoReader.alias());
@Test public void testLookupSRSDetached() throws Exception { Catalog cat = getCatalog(); CatalogBuilder cb = new CatalogBuilder(cat); DataStoreInfo sf = cat.getDataStoreByName("sf"); FeatureSource fs = sf.getDataStore(null).getFeatureSource(toName(MockData.PRIMITIVEGEOFEATURE)); FeatureTypeInfo ft = cat.getFactory().createFeatureType(); ft.setNativeName("PrimitiveGeoFeature"); assertNull(ft.getSRS()); assertNull(ft.getCRS()); cb.lookupSRS(ft, fs, true); assertNotNull(ft.getSRS()); assertNotNull(ft.getCRS()); }
featureType.setNamespace(catalog.getNamespaceByPrefix(prefix)); featureType.setName(LayerProperty.NAME.get(props, name)); featureType.setNativeName(FilenameUtils.getBaseName(filename)); featureType.setTitle(name); featureType.setAbstract("abstract about " + name);
@Test public void testSetupBoundsDetached() throws Exception { Catalog cat = getCatalog(); CatalogBuilder cb = new CatalogBuilder(cat); DataStoreInfo sf = cat.getDataStoreByName("sf"); FeatureSource fs = sf.getDataStore(null).getFeatureSource(toName(MockData.PRIMITIVEGEOFEATURE)); FeatureTypeInfo ft = cat.getFactory().createFeatureType(); ft.setNativeName("PrimitiveGeoFeature"); assertNull(ft.getNativeBoundingBox()); assertNull(ft.getLatLonBoundingBox()); cb.lookupSRS(ft, fs, true); cb.setupBounds(ft, fs); assertNotNull(ft.getNativeBoundingBox()); assertNotNull(ft.getLatLonBoundingBox()); }
ft.setNativeName(ft.getName());
ft.setNativeName(ft.getName());
@Override protected void onSave() { try { VirtualTable vt = buildVirtualTable(); SimpleFeatureType rawFeatureType = getFeatureType(vt); // update the feature type info tinfo.getMetadata().put(FeatureTypeInfo.JDBC_VIRTUAL_TABLE, vt); CoordinateReferenceSystem crs = rawFeatureType.getCoordinateReferenceSystem(); if (crs != null) { tinfo.setNativeCRS(crs); } tinfo.setNativeName(vt.getName()); // set it back in the main page and redirect to it previusPage.updateResource(tinfo); setResponsePage(previusPage); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to create feature type", e); error( new ParamResourceModel("creationFailure", this, getFirstErrorMessage(e)) .getString()); } }
@Override protected void onSave() { try { VirtualTable vt = buildVirtualTable(); SimpleFeatureType rawFeatureType = getFeatureType(vt); // update the feature type info tinfo.getMetadata().put(FeatureTypeInfo.JDBC_VIRTUAL_TABLE, vt); CoordinateReferenceSystem crs = rawFeatureType.getCoordinateReferenceSystem(); if(crs != null) { tinfo.setNativeCRS(crs); } tinfo.setNativeName(vt.getName()); // set it back in the main page and redirect to it previusPage.updateResource(tinfo); setResponsePage(previusPage); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to create feature type", e); error(new ParamResourceModel("creationFailure", this, getFirstErrorMessage(e)) .getString()); } }
private void updateSolrConfiguration(FeatureTypeInfo ft, SolrLayerConfiguration slc) { // go directly to the resource pool to avoid security wrappers try { DataAccess<? extends FeatureType, ? extends Feature> dataStore = catalog.getResourcePool().getDataStore(ft.getStore()); if (dataStore instanceof SolrDataStore) { SolrDataStore solr = (SolrDataStore) dataStore; solr.getSolrConfigurations().remove(slc.getLayerName()); slc.setLayerName(ft.getName()); solr.setSolrConfigurations(slc); } } catch (IOException e) { throw new CatalogException("Failed to remove layer configuration from data store", e); } FeatureTypeInfo proxy = catalog.getFeatureType(ft.getId()); proxy.setNativeName(ft.getName()); proxy.getMetadata().put(SolrLayerConfiguration.KEY, slc); catalog.save(proxy); }
FeatureTypeInfo ftinfo = factory.createFeatureType(); ftinfo.setEnabled(true); ftinfo.setNativeName(name); ftinfo.setName(name); ftinfo.setTitle(name);
FeatureTypeInfo ftinfo = factory.createFeatureType(); ftinfo.setEnabled(true); ftinfo.setNativeName(name); ftinfo.setName(name); ftinfo.setTitle(name);
ftInfo.setNativeName(ftInfo.getName().toLowerCase());
@Test public void testSkipMisconfiguredLayers() throws Exception { // make sure AggregateGeoFeature is in the mock data set Document doc = getAsDOM("wfs?service=WFS&request=DescribeFeatureType&version=1.0.0"); assertEquals("xsd:schema", doc.getDocumentElement().getNodeName()); XMLAssert.assertXpathEvaluatesTo( "1", "count(//xsd:import[contains(@schemaLocation, 'AggregateGeoFeature')])", doc); // enable skipping of misconfigured layers GeoServerInfo global = getGeoServer().getGlobal(); global.setResourceErrorHandling(ResourceErrorHandling.SKIP_MISCONFIGURED_LAYERS); getGeoServer().save(global); // misconfigure a layer FeatureTypeInfo ftype = getCatalog().getFeatureTypeByName(CiteTestData.AGGREGATEGEOFEATURE.getLocalPart()); ftype.setNativeName("NOT ACTUALLY THERE"); getCatalog().save(ftype); // check the results again doc = getAsDOM("wfs?service=WFS&request=DescribeFeatureType&version=1.0.0"); assertEquals("xsd:schema", doc.getDocumentElement().getNodeName()); XMLAssert.assertXpathEvaluatesTo( "0", "count(//xsd:import[contains(@schemaLocation, 'AggregateGeoFeature')])", doc); }
FeatureTypeInfo ftinfo = factory.createFeatureType(); ftinfo.setEnabled(true); ftinfo.setNativeName(name); ftinfo.setName(name); ftinfo.setTitle(name);
featureType.setNativeName(featureType.getName().toLowerCase());
featureType.setNativeName("featureType-NativeName"); featureType.setNamespace(namespace); featureType.setTitle("featureType-Title");