public List<String> getWmsOutputFormats() { // get beans of type GetMapOutputFormat List<GetMapOutputFormat> formats = GeoServerExtensions.extensions(GetMapOutputFormat.class); return formats.stream().map(f -> f.getMimeType()).collect(Collectors.toList()); } }
/** * Checks is a getMap mime type is allowed * * @param format */ public boolean isAllowedGetMapFormat(GetMapOutputFormat format) { if (getServiceInfo().isGetMapMimeTypeCheckingEnabled() == false) return true; Set<String> mimeTypes = getServiceInfo().getGetMapMimeTypes(); return mimeTypes.contains(format.getMimeType()); }
for (GetMapOutputFormat producer : outputFormats) { Set<String> producerFormats = new HashSet<String>(producer.getOutputFormatNames()); producerFormats.add(producer.getMimeType()); String knownFormat = producer.getMimeType(); for (String formatName : producerFormats) { String translatedFormatName = translateFormat("format.wms.", formatName);
if (format.getOutputFormatNames().contains(format.getMimeType())) { formats.add(format.getMimeType()); } else { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.warning( "Map output format " + format.getMimeType() + " (" + format.getClass()
@Test public void testGetOutputFormat() { List<GetMapOutputFormat> producers = WMSExtensions.findMapProducers(applicationContext); for (GetMapOutputFormat producer : producers) { assertNotNull(producer.getMimeType()); } }
@Test public void testSetOutputFormat() { List<GetMapOutputFormat> producers = WMSExtensions.findMapProducers(applicationContext); for (GetMapOutputFormat producer : producers) { assertNotNull(producer.getMimeType()); assertNotNull(producer.getOutputFormatNames()); assertTrue(producer.getOutputFormatNames().size() > 0); } } }
void addMimeTypes() { getMapFormat = new RenderedImageMapOutputFormat(getWMS()); getInfoFormat = new TextFeatureInfoOutputFormat(getWMS()); WMSInfo wms = getWMS().getServiceInfo(); wms.getGetMapMimeTypes().add(getMapFormat.getMimeType()); wms.getGetFeatureInfoMimeTypes().add(getInfoFormat.getContentType()); wms.setGetMapMimeTypeCheckingEnabled(true); wms.setGetFeatureInfoMimeTypeCheckingEnabled(true); getGeoServer().save(wms); }
void addMimeTypes() { getMapFormat = new RenderedImageMapOutputFormat(getWMS()); getInfoFormat = new TextFeatureInfoOutputFormat(getWMS()); WMSInfo wms = getWMS().getServiceInfo(); wms.getGetMapMimeTypes().add(getMapFormat.getMimeType()); wms.getGetFeatureInfoMimeTypes().add(getInfoFormat.getContentType()); wms.setGetMapMimeTypeCheckingEnabled(true); wms.setGetFeatureInfoMimeTypeCheckingEnabled(true); getGeoServer().save(wms); }
doc); Assert.assertEquals(1, formatNodes.getLength()); Assert.assertEquals(getMapFormat.getMimeType(), formatNodes.item(0).getTextContent());
"/WMT_MS_Capabilities/Capability/Request/GetMap/Format", doc); Assert.assertEquals(1, formatNodes.getLength()); Assert.assertEquals(getMapFormat.getMimeType(), formatNodes.item(0).getTextContent());
wms.getGetMapMimeTypes().add(format.getMimeType()); wms.setGetMapMimeTypeCheckingEnabled(true);
wms.getGetMapMimeTypes().add(format.getMimeType()); wms.setGetMapMimeTypeCheckingEnabled(true); getGeoServer().save(wms);
getMapAvailable.add(format.getMimeType());