Examples of GWC


Examples of org.geoserver.gwc.GWC

    @Override
    protected void onSave(AjaxRequestTarget target, Form<?> form) {
        GridSetInfo info = (GridSetInfo) form.getModelObject();

        GWC gwc = GWC.get();

        final GridSet newGridset;
        try {
            newGridset = GridSetBuilder.build(info);
        } catch (IllegalStateException e) {
            form.error(e.getMessage());
            target.addComponent(form);
            return;
        }

        try {
            // TODO: warn and eliminate caches
            gwc.modifyGridSet(originalName, newGridset);
            doReturn(GridSetsPage.class);
        } catch (Exception e) {
            e.printStackTrace();
            form.error("Error saving gridset: " + e.getMessage());
            target.addComponent(form);
View Full Code Here

Examples of org.geoserver.gwc.GWC

        final IModel<Quota> globalUsedQuotaModel = new LoadableDetachableModel<Quota>() {
            private static final long serialVersionUID = 1L;

            @Override
            protected Quota load() {
                GWC gwc = GWC.get();
                if (!gwc.isDiskQuotaAvailable()) {
                    return new Quota();// fake
                }
                return gwc.getGlobalUsedQuota();
            }
        };

        Object[] progressMessageParams = { globalUsedQuotaModel.getObject().toNiceString(),
                globalQuotaModel.getObject().toNiceString() };
View Full Code Here

Examples of org.geoserver.gwc.GWC

    private static final Logger LOGGER = Logging.getLogger(GWCSettingsPage.class);

    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());
                    return;
                }
View Full Code Here

Examples of org.geoserver.gwc.GWC

                private static final long serialVersionUID = 1L;

                @Override
                protected Component getContents(final String id) {
                    // show a confirmation panel for all the objects we have to remove
                    final GWC gwcFacade = GWC.get();
                    Quota totalQuota = new Quota();
                    for (String layerName : selectedNames) {
                        Quota usedQuota = gwcFacade.getUsedQuota(layerName);
                        if (usedQuota != null) {
                            totalQuota.add(usedQuota);
                        }
                    }
                    final String usedQuotaStr = totalQuota.toNiceString();
                    final Integer selectedLayerCount = selectedNames.size();

                    IModel<String> model = new StringResourceModel(
                            "CachedLayersPage.confirmSelectionRemoval",
                            CachedLayerSelectionRemovalLink.this, null, new Object[] {
                                    selectedLayerCount.toString(), usedQuotaStr });
                    Label confirmLabel = new Label(id, model);
                    confirmLabel.setEscapeModelStrings(false);// allow some html inside, like
                                                              // <b></b>, etc
                    return confirmLabel;
                }

                @Override
                protected boolean onSubmit(final AjaxRequestTarget target, final Component contents) {
                    GWC facade = GWC.get();
                    facade.removeTileLayers(selectedNames);
                    table.clearSelection();
                    return true;
                }

                @Override
View Full Code Here

Examples of org.geoserver.gwc.GWC

        final LayerGroupInfo layerGroupInfo = getLayerGroupInfo();
        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
View Full Code Here

Examples of org.geoserver.gwc.GWC

    /**
     * @see org.geoserver.web.wicket.GeoServerDataProvider#getItems()
     */
    @Override
    protected List<TileLayer> getItems() {
        final GWC gwc = GWC.get();
        List<String> tileLayerNames = new ArrayList<String>(gwc.getTileLayerNames());
        return Lists.transform(tileLayerNames, new Function<String, TileLayer>() {

            @Override
            public TileLayer apply(String input) {
                return GWC.get().getTileLayerByName(input);
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.