/** * @return the id of the SVG renderer being used by the wms. */ public String getSvgRenderer() { return (String) wms.getMetadata().get( "svgRenderer" ); //return svgRenderer; }
/** * Sets the id of the SVG renderer being used by the wms. */ public void setSvgRenderer(String svgRenderer) { wms.getMetadata().put( "svgRenderer", svgRenderer ); //this.svgRenderer = svgRenderer; }
/** * @return Flag indicating wether the svg renderer should anti-alias or not. */ public boolean isSvgAntiAlias() { Boolean svgAntiAlias = (Boolean) wms.getMetadata().get( "svgAntiAlias"); return svgAntiAlias != null ? svgAntiAlias : true; //return svgAntiAlias; }
/** * Sets the Flag indicating wether the svg renderer should anti-alias or * not. */ public void setSvgAntiAlias(boolean svgAntiAlias) { wms.getMetadata().put( "svgAntiAlias", svgAntiAlias ); //this.svgAntiAlias = svgAntiAlias; }
public int getPngCompression() { WMSInfo serviceInfo = getServiceInfo(); return getMetadataPercentage( serviceInfo.getMetadata(), PNG_COMPRESSION, PNG_COMPRESSION_DEFAULT); }
public int getJpegCompression() { WMSInfo serviceInfo = getServiceInfo(); return getMetadataPercentage( serviceInfo.getMetadata(), JPEG_COMPRESSION, JPEG_COMPRESSION_DEFAULT); }
public String getKmlReflectorMode() { String value = (String) getServiceInfo().getMetadata().get(KML_REFLECTOR_MODE); return value != null ? value : KML_REFLECTOR_MODE_DEFAULT; }
public int getKmScore() { return getMetadataPercentage( getServiceInfo().getMetadata(), KML_KMSCORE, KML_KMSCORE_DEFAULT); }
public String getSvgRenderer() { WMSInfo serviceInfo = getServiceInfo(); String svgRendererHint = (String) serviceInfo.getMetadata().get("svgRenderer"); return svgRendererHint; }
public boolean isSvgAntiAlias() { WMSInfo serviceInfo = getServiceInfo(); Boolean svgAntiAlias = Converters.convert(serviceInfo.getMetadata().get("svgAntiAlias"), Boolean.class); return svgAntiAlias == null ? true : svgAntiAlias.booleanValue(); }
public boolean getKmlKmAttr() { Boolean kmAttr = Converters.convert(getServiceInfo().getMetadata().get(KML_KMLATTR), Boolean.class); return kmAttr == null ? KML_KMLATTR_DEFAULT : kmAttr.booleanValue(); }
public String getKmlSuperoverlayMode() { String value = (String) getServiceInfo().getMetadata().get(KML_SUPEROVERLAY_MODE); return value != null ? value : KML_SUPEROVERLAY_MODE_DEFAULT; }
public boolean getKmlPlacemark() { Boolean kmAttr = Converters.convert( getServiceInfo().getMetadata().get(KML_KMLPLACEMARK), Boolean.class); return kmAttr == null ? KML_KMLPLACEMARK_DEFAULT : kmAttr.booleanValue(); }
<T> T getMetadataValue(String key, T defaultValue, Class<T> clazz) { if (getServiceInfo() == null) { return defaultValue; } MetadataMap metadata = getServiceInfo().getMetadata(); T parsedValue = Converters.convert(metadata.get(key), clazz); if (parsedValue == null) return defaultValue; return parsedValue; }
public void setSvgRenderer(String svgRendererHint) { WMSInfo serviceInfo = getServiceInfo(); serviceInfo.getMetadata().put("svgRenderer", svgRendererHint); getGeoServer().save(serviceInfo); }
/** * Before using {@code gwc-gs.xml} to hold the integrated GWC configuration, the only property * configured was whether the direct WMS integration option was enabled, and it was saved as * part of the {@link WMSInfo} metadata map under the {@code GWC_WMS_Integration} key. This * method removes that key from WMSInfo if present and sets its value to the {@code gwcConfig} * instead. */ private void upgradeWMSIntegrationConfig(final GeoServer geoServer, final GWCConfig gwcConfig) throws IOException { // Check whether we're using the old way of storing this information, and get rid of it WMSInfo service = geoServer.getService(WMSInfo.class); if (service != null) { MetadataMap metadata = service.getMetadata(); if (service != null && metadata != null) { Boolean storedValue = metadata.get(WMS_INTEGRATION_ENABLED_KEY, Boolean.class); if (storedValue != null) { boolean enabled = storedValue.booleanValue(); gwcConfig.setDirectWMSIntegrationEnabled(enabled); metadata.remove(WMS_INTEGRATION_ENABLED_KEY); geoServer.save(service); } } } }
/** * Before using {@code gwc-gs.xml} to hold the integrated GWC configuration, the only property * configured was whether the direct WMS integration option was enabled, and it was saved as * part of the {@link WMSInfo} metadata map under the {@code GWC_WMS_Integration} key. This * method removes that key from WMSInfo if present and sets its value to the {@code gwcConfig} * instead. */ private void upgradeWMSIntegrationConfig(final GeoServer geoServer, final GWCConfig gwcConfig) throws IOException { // Check whether we're using the old way of storing this information, and get rid of it WMSInfo service = geoServer.getService(WMSInfo.class); if (service != null) { MetadataMap metadata = service.getMetadata(); if (service != null && metadata != null) { Boolean storedValue = metadata.get(WMS_INTEGRATION_ENABLED_KEY, Boolean.class); if (storedValue != null) { boolean enabled = storedValue.booleanValue(); gwcConfig.setDirectWMSIntegrationEnabled(enabled); metadata.remove(WMS_INTEGRATION_ENABLED_KEY); geoServer.save(service); } } } }
public void testChangeMediaType() throws Exception { WMSInfo wms = getGeoServer().getService(WMSInfo.class); wms.getSRS().add("EPSG:4326"); wms.getMetadata().put(InspireMetadata.LANGUAGE.key, "fre"); wms.getMetadata().put(InspireMetadata.SERVICE_METADATA_URL.key, "http://foo.com?bar=baz"); getGeoServer().save(wms); Document dom = getAsDOM("wms?request=getcapabilities"); assertEquals(NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_vs")); assertMetadataUrlAndMediaType(dom, "http://foo.com?bar=baz", "application/vnd.iso.19139+xml"); wms.getMetadata().put(InspireMetadata.SERVICE_METADATA_TYPE.key, "application/xml"); getGeoServer().save(wms); dom = getAsDOM("wms?request=getcapabilities"); assertEquals(NAMESPACE, dom.getDocumentElement().getAttribute("xmlns:inspire_vs")); assertMetadataUrlAndMediaType(dom, "http://foo.com?bar=baz", "application/xml"); }
@Before public void setupAdvancedProjectionHandling() { GeoServer gs = getGeoServer(); WMSInfo wms = gs.getService(WMSInfo.class); wms.getMetadata().put(WMS.ADVANCED_PROJECTION_KEY, aphEnabled); gs.save(wms); }
@Before public void setupAdvancedProjectionHandling() { GeoServer gs = getGeoServer(); WMSInfo wms = gs.getService(WMSInfo.class); wms.getMetadata().put(WMS.ADVANCED_PROJECTION_KEY, aphEnabled); // make sure GetFeatureInfo is not deactivated (this will only update the global service) wms.setFeaturesReprojectionDisabled(false); gs.save(wms); }