public void setNamespace(NamespaceInfo namespace) { delegate.setNamespace(namespace); }
protected FeatureTypeInfo newFeatureType(String name, DataStoreInfo ds) { FeatureTypeInfo ft2 = catalog.getFactory().createFeatureType(); ft2.setNamespace(ns); ft2.setName(name); ft2.setStore(ds); return ft2; }
ftinfo.setNamespace(namespace);
@Test public void testAddFeatureType() throws Exception { testAddDataStore(); File d = new File(testData.getDataDirectoryRoot(), "workspaces/acme/foostore/foo"); assertFalse(d.exists()); NamespaceInfo ns = catalog.getFactory().createNamespace(); ns.setPrefix("bar"); ns.setURI("http://bar"); catalog.add(ns); FeatureTypeInfo ft = catalog.getFactory().createFeatureType(); ft.setName("foo"); ft.setNamespace(ns); ft.setStore(catalog.getDataStoreByName("acme", "foostore")); catalog.add(ft); assertTrue(d.exists()); }
featureType.setNamespace(catalog.getNamespaceByPrefix(prefix));
protected void runInternal() throws Exception { CatalogFactory factory = catalog.getFactory(); for (int i = 0; i < GET_LAYER_BY_ID_WITH_CONCURRENT_ADD_TEST_COUNT; i++) { // GR: Adding a new feature type info too, we can't really add multiple layers per // feature type yet. Setting the name of the layer changes the name of the resource, // then all previous layers for that resource get screwed String name = "LAYER-" + i + "-" + idx; FeatureTypeInfo resource = factory.createFeatureType(); resource.setName(name); resource.setNamespace(ns); resource.setStore(ds); catalog.add(resource); LayerInfo layer = factory.createLayer(); layer.setResource(resource); layer.setName(name); catalog.add(layer); } } };
featureType.setNamespace(catalog.getNamespaceByPrefix(prefix)); featureType.setName(LayerProperty.NAME.get(props, name)); featureType.setNativeName(FilenameUtils.getBaseName(filename));
ft2.setName("ft2Name"); ft2.setStore(ds); ft2.setNamespace(ns); catalog.add(ft2); LayerInfo l2 = catalog.getFactory().createLayer();
ft.setNamespace(ns); ft.setName("ft"); ft.setAbstract("abstract");
@Test public void testGetLayerByNameWithColon() { addNamespace(); addDataStore(); FeatureTypeInfo ft = catalog.getFactory().createFeatureType(); ft.setEnabled(true); ft.setName("foo:bar"); ft.setAbstract("ftAbstract"); ft.setDescription("ftDescription"); ft.setStore(ds); ft.setNamespace(ns); catalog.add(ft); addStyle(); LayerInfo l = catalog.getFactory().createLayer(); l.setResource(ft); l.setEnabled(true); l.setDefaultStyle(s); catalog.add(l); assertNotNull(catalog.getLayerByName("foo:bar")); }
ft.setNamespace(ns); ft.setName("ft"); ft.setAbstract("abstract");
ft.setNamespace(ns); ft.setName("ft"); ft.setAbstract("abstract");
@Test public void testGetFeatureTypeByName() { addFeatureType(); FeatureTypeInfo ft2 = catalog.getFeatureTypeByName(ft.getName()); assertNotNull(ft2); assertFalse(ft == ft2); assertEquals(ft, ft2); NamespaceInfo ns2 = catalog.getFactory().createNamespace(); ns2.setPrefix("ns2Prefix"); ns2.setURI("ns2URI"); catalog.add(ns2); FeatureTypeInfo ft3 = catalog.getFactory().createFeatureType(); ft3.setName("ft3Name"); ft3.setStore(ds); ft3.setNamespace(ns2); catalog.add(ft3); FeatureTypeInfo ft4 = catalog.getFeatureTypeByName(ns2.getPrefix(), ft3.getName()); assertNotNull(ft4); assertFalse(ft4 == ft3); assertEquals(ft3, ft4); ft4 = catalog.getFeatureTypeByName(ns2.getURI(), ft3.getName()); assertNotNull(ft4); assertFalse(ft4 == ft3); assertEquals(ft3, ft4); }
ft2.setDescription("ftDescription"); ft2.setStore(ds2); ft2.setNamespace(ns2); catalog.add(ft2);
ftA.setDescription("ftDescription"); ftA.setStore(dsA); ftA.setNamespace(nsA); ftB.setDescription("ftDescription"); ftB.setStore(dsB); ftB.setNamespace(nsB); ftC.setDescription("ftDescription"); ftC.setStore(dsA); ftC.setNamespace(nsA); ftC.setEnabled(true); ftB.setEnabled(true);
citeFeatureType.setName("citeLayer"); citeFeatureType.setStore(citeStore); citeFeatureType.setNamespace(catalog.getNamespaceByPrefix("cite")); catalog.add(citeFeatureType); sfFeatureType.setName("sfLayer"); sfFeatureType.setStore(sfStore); sfFeatureType.setNamespace(catalog.getNamespaceByPrefix("sf")); catalog.add(sfFeatureType);
ft.setDescription("ftDescription"); ft.setStore(ds); ft.setNamespace(ns);
/** * Performs the save of the store. * <p> * This method may be subclasses to provide custom save functionality. * </p> */ protected void doSaveStore(final DataStoreInfo info) { try { final Catalog catalog = getCatalog(); // The namespace may have changed, in which case we need to update the store resources NamespaceInfo namespace = catalog.getNamespaceByPrefix(info.getWorkspace().getName()); List<FeatureTypeInfo> configuredResources = catalog.getResourcesByStore(info, FeatureTypeInfo.class); for (FeatureTypeInfo alreadyConfigured : configuredResources) { alreadyConfigured.setNamespace(namespace); } ResourcePool resourcePool = catalog.getResourcePool(); resourcePool.clear(info); catalog.save(info); // save the resources after saving the store for (FeatureTypeInfo alreadyConfigured : configuredResources) { catalog.save(alreadyConfigured); } LOGGER.finer("Saved store " + info.getName()); } catch (Exception e) { LOGGER.log(Level.WARNING, "Error saving data store to catalog", e); throw new IllegalArgumentException("Error saving data store:" + e.getMessage()); } }
public static FeatureTypeInfo localizeFeatureType(final FeatureTypeInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final FeatureTypeInfo localObject=catalog.getFeatureTypeByName(info.getNamespace(),info.getName()); if (localObject !=null){ return localObject; } final FeatureTypeInfo createdObject = catalog.getFactory().createFeatureType(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setNamespace(localizeNamespace(info.getNamespace(), catalog)); final StoreInfo store=localizeStore(info.getStore(), catalog); createdObject.setStore(store); final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(createdObject); return createdObject; }
public static FeatureTypeInfo localizeFeatureType(final FeatureTypeInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final FeatureTypeInfo localObject=catalog.getFeatureTypeByName(info.getNamespace(),info.getName()); if (localObject !=null){ return localObject; } final FeatureTypeInfo createdObject = catalog.getFactory().createFeatureType(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setNamespace(localizeNamespace(info.getNamespace(), catalog)); final StoreInfo store=localizeStore(info.getStore(), catalog); createdObject.setStore(store); final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(createdObject); return createdObject; }