for (Dimension dimension : layer.getDimensions().values()) {
Extent dimExtent = layer.getExtent(dimension.getName());
paramFilters.add(new NaiveWMSDimensionFilter(dimension, dimExtent));
}
WMSLayer wmsLayer = null;
try {
wmsLayer = getLayer(name, wmsUrls, bounds4326, bounds3785, stylesStr,
queryable, layer.getBoundingBoxes(), paramFilters);
} catch (GeoWebCacheException gwc) {
log.error("Error creating " + layer.getName() + ": " + gwc.getMessage());
}
if (wmsLayer != null) {
// Finalize with some defaults
wmsLayer.setCacheBypassAllowed(allowCacheBypass);
wmsLayer.setBackendTimeout(backendTimeout);
wmsLayer.setMetaInformation(layerMetaInfo);
if (urlVersion != null) {
wmsLayer.setVersion(urlVersion);
} else {
String wmsVersion = capabilities.getVersion();
if (wmsVersion != null && wmsVersion.length() > 0) {
wmsLayer.setVersion(wmsVersion);
}
}
wmsLayer.setSourceHelper(sourceHelper);
List<org.geotools.data.wms.xml.MetadataURL> metadataURLs = layer.getMetadataURL();
if (metadataURLs != null && !metadataURLs.isEmpty()) {
List<MetadataURL> convertedMetadataURLs = new ArrayList<MetadataURL>();
for (org.geotools.data.wms.xml.MetadataURL metadataURL : metadataURLs) {
convertedMetadataURLs.add(new MetadataURL(metadataURL.getType(), metadataURL.getFormat(), metadataURL.getUrl()));
}
wmsLayer.setMetadataURLs(convertedMetadataURLs);
}
layers.add(wmsLayer);
}
}