public LayerGroupInfo createLayerGroup() { return new LayerGroupInfoImpl(); }
if (lgi.getMode() == null) { lgi.setMode(Mode.SINGLE); lgi.convertLegacyLayers(); MetadataMap metadata = lgi.getMetadata(); if (lgi.getTitle() == null && metadata != null) { String title = metadata.get("title", String.class); if (title != null) { lgi.setTitle(title); metadata.remove("title"); if (lgi.getAbstract() == null && metadata != null) { String abstractTxt = metadata.get("abstract", String.class); if (abstractTxt != null) { lgi.setAbstract(abstractTxt); metadata.remove("abstract"); if (lgi.getAuthorityURLs() == null && metadata != null) { String serialized = metadata.get("authorityURLs", String.class); List<AuthorityURLInfo> authorities; lgi.setAuthorityURLs(authorities); if (lgi.getIdentifiers() == null && metadata != null) { String serialized = metadata.get("identifiers", String.class); List<LayerIdentifierInfo> identifiers;
for (int i = 0; i < lg.getLayers().size(); i++) { PublishedInfo l = lg.getLayers().get(i); lg.getLayers().set(i, resolved); for (int i = 0; i < lg.getStyles().size(); i++) { StyleInfo s = lg.getStyles().get(i); if (s != null) { StyleInfo resolved = unwrap(ResolvingProxy.resolve(getCatalog(), s)); lg.getStyles().set(i, resolved);
public static LayerGroupInfoImpl mockGroup(String name, LayerInfo... layers) { LayerGroupInfoImpl lg = new LayerGroupInfoImpl(); lg.setId("id-" + name); lg.setName(name); lg.setLayers(Lists.newArrayList(layers)); lg.setBounds(new ReferencedEnvelope(-180, -90, 180, 90, DefaultGeographicCRS.WGS84)); return lg; }
private void addLayerGroup(String id, String name, PublishedInfo... publisheds) { LayerGroupInfoImpl group = (LayerGroupInfoImpl) getCatalog().getFactory().createLayerGroup(); group.setId(id); group.setName(name); group.setTitle(name); group.getLayers().addAll(Arrays.asList(publisheds)); getCatalog().add(group); }
public void testLoadLayerGroup() { LayerGroupInfoImpl lg = mockGroup("tesGroup", mockLayer("L1", new String[]{}, LayerInfoImpl.Type.RASTER), mockLayer("L2", new String[]{}, LayerInfoImpl.Type.RASTER)); assertNull(LegacyTileLayerInfoLoader.load(lg)); GeoServerTileLayerInfo info = defaultVectorInfo; info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultOtherCacheFormats()); LegacyTileLayerInfoLoader.save(info, lg.getMetadata()); GeoServerTileLayerInfo actual; actual = LegacyTileLayerInfoLoader.load(lg); info.setId(lg.getId()); info.setName(GWC.tileLayerName(lg)); assertEquals(info, actual); }
public void testClear() { LayerGroupInfoImpl lg = mockGroup("tesGroup", mockLayer("L1", new String[]{}, LayerInfoImpl.Type.RASTER), mockLayer("L2", new String[]{}, LayerInfoImpl.Type.RASTER)); assertNull(LegacyTileLayerInfoLoader.load(lg)); GeoServerTileLayerInfo info = defaultVectorInfo; info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultOtherCacheFormats()); LegacyTileLayerInfoLoader.save(info, lg.getMetadata()); GeoServerTileLayerInfo actual; actual = LegacyTileLayerInfoLoader.load(lg); assertNotNull(actual); LegacyTileLayerInfoLoader.clear(lg.getMetadata()); assertNull(LegacyTileLayerInfoLoader.load(lg)); }
private void createTetLayerGroup() { Catalog catalog = getCatalog(); // preparing the list of layers LayerInfo roads = catalog.getLayerByName(new NameImpl(MockData.ROAD_SEGMENTS)); LayerInfo bridges = catalog.getLayerByName(new NameImpl(MockData.BRIDGES)); List<PublishedInfo> layers = Arrays.asList(roads, bridges); // creating the layer group LayerGroupInfoImpl layerGroup = new LayerGroupInfoImpl(); layerGroup.setId(TEST_LAYER_GROUP_NAME); layerGroup.setName(TEST_LAYER_GROUP_NAME); layerGroup.setLayers(layers); // adding a style, jms catalog handler expect the layer group to have styles layerGroup.setStyles(Arrays.asList(roads.getDefaultStyle(), bridges.getDefaultStyle())); // save the layer group catalog.add(layerGroup); } }
styles.add(catalog.getLayerByName("Buildings").getDefaultStyle()); styles.add(catalog.getLayerByName("DividedRoutes").getDefaultStyle()); LayerGroupInfoImpl layerGroup = new LayerGroupInfoImpl(); layerGroup.setName("layer_group"); layerGroup.setLayers(layers); layerGroup.setStyles(styles); catalog.add(layerGroup); Map kvp = new HashMap<>();
LayerGroupInfo eoProduct = new LayerGroupInfoImpl(); eoProduct.setName("EO Sample"); eoProduct.setMode(LayerGroupInfo.Mode.EO);
styles.add(catalog.getLayerByName("Buildings").getDefaultStyle()); styles.add(catalog.getLayerByName("DividedRoutes").getDefaultStyle()); LayerGroupInfoImpl layerGroup = new LayerGroupInfoImpl(); layerGroup.setName("layer_group"); layerGroup.setLayers(layers); layerGroup.setStyles(styles); catalog.add(layerGroup); Map kvp = new HashMap<>();
LayerGroupInfo eoProduct = new LayerGroupInfoImpl(); eoProduct.setName("EO Sample"); eoProduct.setMode(LayerGroupInfo.Mode.EO);
layerInfo.setStyles(alternateStyles); layerGroup = new LayerGroupInfoImpl(); final String layerGroupId = "mock-layergroup-id"; layerGroup.setId(layerGroupId); layerGroup.setName("MockLayerGroup"); layerGroup.setLayers(Collections.singletonList((LayerInfo) layerInfo));
catalog.add(wmsLayer); LayerGroupInfo layerGroup = new LayerGroupInfoImpl(); layerGroup.setTitle("layerGroup-Title"); layerGroup.setName("layerGroup-Name");