validateKeywords(resource.getKeywords()); return postValidate(resource, isNew);
if (enabled != other.isEnabled()) return false; if (keywords == null) { if (other.getKeywords() != null) return false; } else if (!keywords.equals(other.getKeywords())) return false; if (latLonBoundingBox == null) { if (other.getLatLonBoundingBox() != null) return false;
expect(r.getKeywords()).andReturn((List) Arrays.asList(new Keyword(name))).anyTimes(); expect(r.isEnabled()).andReturn(true).anyTimes(); expect(r.isAdvertised()).andReturn(true).anyTimes();
public String getKeywords() { if (layerInfo != null) { return layerInfo.getResource().getKeywords().toString(); } else { return ""; } }
/** * Overrides to return a dynamic view of the backing {@link LayerInfo} or {@link LayerGroupInfo} * metadata adapted to GWC * * @see org.geowebcache.layer.TileLayer#getMetaInformation() */ @Override public LayerMetaInformation getMetaInformation() { LayerMetaInformation meta = null; String title = getName(); String description = ""; List<String> keywords = Collections.emptyList(); List<ContactInformation> contacts = Collections.emptyList(); ResourceInfo resourceInfo = getResourceInfo(); if (resourceInfo != null) { title = resourceInfo.getTitle(); description = resourceInfo.getAbstract(); keywords = new ArrayList<String>(); for (KeywordInfo kw : resourceInfo.getKeywords()) { keywords.add(kw.getValue()); } } meta = new LayerMetaInformation(title, description, keywords, contacts); return meta; }
description = resourceInfo.getAbstract(); keywords = new ArrayList<>(); for (KeywordInfo kw : resourceInfo.getKeywords()) { keywords.add(kw.getValue());
@Override protected void onSetUp(SystemTestData testData) throws Exception { // insert extra metadata ResourceInfo forestInfo = getCatalog().getLayerByName("Forests").getResource(); forestInfo.getMetadata().put("date", "09/10/2012"); forestInfo.setLatLonBoundingBox(new ReferencedEnvelope(-200, -180, -100, -90, CRS .decode("EPSG:4326"))); forestInfo.getKeywords().add(new Keyword ("CustomKeyWord-1")); forestInfo.getKeywords().add(new Keyword ("CustomKeyWord-2")); forestInfo.setDescription("Land with lots of trees on."); forestInfo.getAlias().add("Bush"); forestInfo.getAlias().add("Woods"); getCatalog().save(forestInfo); }
public void testGetMetaInformation() { layerInfoTileLayer = new GeoServerTileLayer(layerInfo, defaults, gridSetBroker); layerGroupInfoTileLayer = new GeoServerTileLayer(layerGroup, defaults, gridSetBroker); LayerMetaInformation metaInformation = layerInfoTileLayer.getMetaInformation(); assertNotNull(metaInformation); String title = metaInformation.getTitle(); String description = metaInformation.getDescription(); List<String> keywords = metaInformation.getKeywords(); assertEquals(layerInfo.getResource().getTitle(), title); assertEquals(layerInfo.getResource().getAbstract(), description); assertEquals(layerInfo.getResource().getKeywords().size(), keywords.size()); for (String kw : keywords) { assertTrue(layerInfo.getResource().getKeywords().contains(new Keyword(kw))); } metaInformation = layerGroupInfoTileLayer.getMetaInformation(); assertNotNull(metaInformation); title = metaInformation.getTitle(); description = metaInformation.getDescription(); keywords = metaInformation.getKeywords(); // these properties are missing from LayerGroupInfo interface assertEquals(GWC.tileLayerName(layerGroup), title); assertEquals("", description); assertEquals(0, keywords.size()); }
handleKeywordList(layer.getResource().getKeywords());
handleKeywordList(layer.getResource().getKeywords());