public String prefixedName() { return delegate.prefixedName(); }
throw new IllegalStateException( "Found no resource named " + layer.prefixedName() + " , Layer with that name can't be added"); Level.INFO, "Layer " + layer.prefixedName() + " is missing the default style, assigning one automatically"); StyleInfo style = new CatalogBuilder(this).getDefaultStyle(layer.getResource()); Level.WARNING, "Layer " + layer.prefixedName() + " is missing the default style, " + "failed to associate one automatically",
@Test public void testLayerLocalWithContainingGroup() throws Exception { CatalogFactory factory = catalog.getFactory(); WorkspaceInfo citeWs = catalog.getWorkspaceByName("cite"); addLocalGroup(factory, citeWs); // set a local layer that's in the group final LayerInfo buildingsLayer = getBuildingsLayer(); LocalPublished.set(buildingsLayer); assertNotNull(catalog.getLayerByName(buildingsLayer.prefixedName())); assertNull(catalog.getLayerGroupByName(GLOBAL_GROUP)); assertNull(catalog.getLayerGroupByName(LOCAL_GROUP)); assertEquals(1, catalog.getLayers().size()); assertThat(catalog.getLayerGroups(), empty()); }
@Test public void testLayerLocalWithNonContainingGroup() throws Exception { CatalogFactory factory = catalog.getFactory(); WorkspaceInfo citeWs = catalog.getWorkspaceByName("cite"); addLocalGroup(factory, citeWs); // set a local layer that's not in the group final LayerInfo dividedRoutes = catalog.getLayerByName(getLayerId(SystemTestData.DIVIDED_ROUTES)); LocalPublished.set(dividedRoutes); assertNotNull(catalog.getLayerByName(dividedRoutes.prefixedName())); assertNull(catalog.getLayerGroupByName(GLOBAL_GROUP)); assertNull(catalog.getLayerGroupByName(LOCAL_GROUP)); assertEquals(1, catalog.getLayers().size()); assertThat(catalog.getLayerGroups(), empty()); }
LayerInfo ll = catalog.getLayerByName(l.prefixedName()); ll.setDefaultStyle(catalog.getStyleByName(s2.getName())); catalog.save(ll);
assertEquals("cite:citeLayer", catalog.getLayerByName("citeLayer").prefixedName()); assertNull(catalog.getLayerByName("citeLayer")); assertNotNull(catalog.getLayerByName("sfLayer")); assertEquals("sfLayer", catalog.getLayerByName("sfLayer").prefixedName()); LocalWorkspace.remove(); assertNull(catalog.getLayerByName("sfLayer")); assertNotNull(catalog.getLayerByName("citeLayer")); assertEquals("citeLayer", catalog.getLayerByName("citeLayer").prefixedName()); LocalWorkspace.remove();
@Override public String convertToString(LayerInfo obj, Locale locale) { if (obj == null) return ""; else return ((LayerInfo) obj).prefixedName(); } }
@Override public Object getPropertyValue(PreviewLayer item) { if (item.layerInfo != null) { return item.layerInfo.prefixedName(); } if (item.groupInfo != null) { return item.groupInfo.prefixedName(); } return null; } };
private void setLayerName(String layerName) { List<LayerInfo> layers = NCNameResourceCodec.getLayers(catalog, layerName); if (!layers.isEmpty()) { typeName = layers.get(0).prefixedName(); } else { throw new HttpErrorCodeException( HttpStatus.NOT_FOUND.value(), "Could not find feature type " + layerName); } }
private void setIdentifier(LayerInfo layer) { LOGGER.log( Level.FINE, "Updating geogig auth identifier for layer {0}", layer.prefixedName()); final String layerIdentifier = buildLayerIdentifier(layer); updateIdentifier(layer, layerIdentifier); }
private LayerIdentifier getLayerIdentifier( MapLayerInfo layer, List<LayerIdentifier> identifiers) { for (LayerIdentifier identifier : identifiers) { if (identifier.canHandle(layer)) { return identifier; } } throw new ServiceException( "Could not find any identifier that can handle layer " + layer.getLayerInfo().prefixedName() + " among these identifiers: " + identifiers); }
@Test public void testGlobalCapabilities() throws Exception { LayerInfo layer = layer(catalog, MockData.PRIMITIVEGEOFEATURE); Document doc = getAsDOM("/wms?service=WMS&request=getCapabilities&version=1.3.0", true); assertXpathExists("//wms:Layer[wms:Name='" + layer.prefixedName() + "']", doc); }
@Test public void testGlobalCapabilities() throws Exception { LayerInfo layer = layer(catalog, MockData.PRIMITIVEGEOFEATURE); Document doc = getAsDOM("/wms?service=WMS&request=getCapabilities&version=1.1.1", true); assertXpathExists("//Layer[Name='" + layer.prefixedName() + "']", doc); }
@Test public void testWmsStandaloneOpaqueGroup() throws Exception { setupRequestThreadLocal("WMS"); LayerGroupInfo opaque = prepareStandaloneOpaqueGroup(); // direct access to layers not allowed assertNull(sc.getLayerByName(statesLayer.prefixedName())); assertNull(sc.getLayerByName(roadsLayer.prefixedName())); // however we can access the group and the layers through it LayerGroupInfo securedGroup = sc.getLayerGroupByName(opaque.prefixedName()); assertNotNull(securedGroup); assertEquals(2, securedGroup.getLayers().size()); }
@Test public void testWmsNamedOpaqueGroup() throws Exception { setupRequestThreadLocal("WMS"); LayerGroupInfo opaque = prepareNamedAndOpaqueGroup(); // direct access to layers allowed because of the named group assertNotNull(sc.getLayerByName(statesLayer.prefixedName())); assertNotNull(sc.getLayerByName(roadsLayer.prefixedName())); // we can access the group and the layers through it LayerGroupInfo securedGroup = sc.getLayerGroupByName(opaque.prefixedName()); assertNotNull(securedGroup); assertEquals(2, securedGroup.getLayers().size()); }
@Test public void testWfsNamedOpaqueGroup() throws Exception { setupRequestThreadLocal("WFS"); LayerGroupInfo opaque = prepareNamedAndOpaqueGroup(); // direct access to layers allowed assertNotNull(sc.getLayerByName(statesLayer.prefixedName())); assertNotNull(sc.getLayerByName(roadsLayer.prefixedName())); // and we can access the group and the layers through it LayerGroupInfo securedGroup = sc.getLayerGroupByName(opaque.prefixedName()); assertNotNull(securedGroup); assertEquals(2, securedGroup.getLayers().size()); }
@Test public void testGlobalDescribeLayer() throws Exception { LayerInfo layer = layer(catalog, MockData.PRIMITIVEGEOFEATURE); Document doc = getAsDOM( "/wms?service=WMS&request=describeLayer&version=1.1.1&LAYERS=" + layer.getName(), true); assertXpathExists("//LayerDescription[@name='" + layer.prefixedName() + "']", doc); }
@Test public void testWfsStandaloneOpaqueGroup() throws Exception { setupRequestThreadLocal("WFS"); LayerGroupInfo opaque = prepareStandaloneOpaqueGroup(); // direct access to layers is allowed in this case assertNotNull(sc.getLayerByName(statesLayer.prefixedName())); assertNotNull(sc.getLayerByName(roadsLayer.prefixedName())); // and we can access the group and the layers through it LayerGroupInfo securedGroup = sc.getLayerGroupByName(opaque.prefixedName()); assertNotNull(securedGroup); assertEquals(2, securedGroup.getLayers().size()); }
@Test public void testOpaqueGroup() throws Exception { Document dom = dom(get("wms?request=GetCapabilities&version=1.1.0"), true); // the layer group is there, but not the contained layers assertXpathEvaluatesTo("1", "count(//Layer[Name='opaqueGroup'])", dom); for (LayerInfo l : getCatalog().getLayerGroupByName(OPAQUE_GROUP).layers()) { assertXpathNotExists("//Layer[Name='" + l.prefixedName() + "']", dom); } }
@Test public void testOpaqueGroup() throws Exception { Document dom = dom(get("wms?request=GetCapabilities&version=1.3.0"), true); // the layer group is there, but not the contained layers assertXpathEvaluatesTo("1", "count(//wms:Layer[wms:Name='opaqueGroup'])", dom); for (LayerInfo l : getCatalog().getLayerGroupByName(OPAQUE_GROUP).layers()) { assertXpathNotExists("//wms:Layer[wms:Name='" + l.prefixedName() + "']", dom); } ; }