Examples of GWCConfig


Examples of org.geoserver.gwc.config.GWCConfig

    public Component getCapabilitiesComponent(final String id) {

        List<CapsInfo> gwcCaps = new ArrayList<CapsInfo>();

        final GeoServerApplication app = GeoServerApplication.get();
        final GWCConfig gwcConfig = gwcFacade.getConfig();

        try {
            if (gwcConfig.isWMSCEnabled() && null != app.getBean("gwcServiceWMS")) {
                gwcCaps.add(new CapsInfo("WMS-C", new Version("1.1.1"),
                        "../gwc/service/wms?request=GetCapabilities&version=1.1.1&tiled=true"));
            }
        } catch (NoSuchBeanDefinitionException e) {
            // service not found, ignore exception
        }

        try {
            if (gwcConfig.isWMTSEnabled() && null != app.getBean("gwcServiceWMTS")) {
                gwcCaps.add(new CapsInfo("WMTS", new Version("1.0.0"),
                        "../gwc/service/wmts?REQUEST=GetCapabilities"));
            }
        } catch (NoSuchBeanDefinitionException e) {
            // service not found, ignore exception
        }
        try {
            if (gwcConfig.isTMSEnabled() && null != app.getBean("gwcServiceTMS")) {
                gwcCaps.add(new CapsInfo("TMS", new Version("1.0.0"), "../gwc/service/tms/1.0.0"));
            }
        } catch (NoSuchBeanDefinitionException e) {
            // service not found, ignore exception
        }
View Full Code Here

Examples of org.geoserver.gwc.config.GWCConfig

    public GWCSettingsPage() {
        setHeaderPanel(headerPanel());

        GWC gwc = GWC.get();
        // use a detached copy of gwc config to support the tabbed pane
        final GWCConfig gwcConfig = gwc.getConfig().clone();

        IModel<GWCConfig> formModel = new Model<GWCConfig>(gwcConfig);

        final Form<GWCConfig> form = new Form<GWCConfig>("form", formModel);
        add(form);

        final GWCServicesPanel gwcServicesPanel = new GWCServicesPanel("gwcServicesPanel",
                formModel);
        final CachingOptionsPanel defaultCachingOptionsPanel = new CachingOptionsPanel(
                "cachingOptionsPanel", formModel);

        form.add(gwcServicesPanel);
        form.add(defaultCachingOptionsPanel);

        form.add(new Button("submit") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onSubmit() {
                GWC gwc = GWC.get();
                final IModel<GWCConfig> gwcConfigModel = form.getModel();
                GWCConfig gwcConfig = gwcConfigModel.getObject();
                try {
                    gwc.saveConfig(gwcConfig);
                } catch (IOException e) {
                    LOGGER.log(Level.WARNING, "Error saving GWC config", e);
                    form.error("Error saving GWC config: " + e.getMessage());
View Full Code Here

Examples of org.geoserver.gwc.config.GWCConfig

        final boolean isNew = layerGroupInfo.getId() == null;

        GeoServerTileLayerInfo tileLayerInfo;

        final GWC mediator = GWC.get();
        final GWCConfig defaultSettings = mediator.getConfig();

        final GeoServerTileLayer tileLayer = isNew ? null : mediator.getTileLayer(layerGroupInfo);

        if (isNew || tileLayer == null) {
            /*
             * Ensure a sane config for defaults, in case automatic cache of new layers is defined
             * and the defaults is misconfigured
             */
            final GWCConfig saneDefaults = defaultSettings.saneConfig();
            tileLayerInfo = TileLayerInfoUtil.loadOrCreate(layerGroupInfo, saneDefaults);
        } else {
            tileLayerInfo = ((GeoServerTileLayer) tileLayer).getInfo().clone();
        }

View Full Code Here

Examples of org.geoserver.gwc.config.GWCConfig

    }

    @Test
    public void testAutoConfigureLayers() throws Exception {
        {
            GWCConfig insaneDefaults = new GWCConfig();
            insaneDefaults.setMetaTilingX(-1);
            assertFalse(insaneDefaults.isSane());
            try {
                mediator.autoConfigureLayers(Arrays.asList(tileLayer.getName()), insaneDefaults);
            } catch (IllegalArgumentException e) {
                assertTrue(true);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.